From 1e59b9ad63cf13b85eb6be5dcc27f08e613c7db3 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Sat, 17 Oct 2026 04:11:05 +0000 Subject: [PATCH 1/3] chore(deps): bump the host group across 1 directory with 12 updates Bumps the host group with 12 updates in the /ui/host directory: | Package | From | To | | --- | --- | --- | | [@mantine/core](https://github.com/mantinedev/mantine/tree/HEAD/packages/@mantine/core) | `9.7.1` | `9.7.2` | | [@mantine/hooks](https://github.com/mantinedev/mantine/tree/HEAD/packages/@mantine/hooks) | `9.7.1` | `9.7.2` | | [@tanstack/react-query](https://github.com/TanStack/query/tree/HEAD/packages/react-query) | `5.104.1` | `5.104.2` | | [@tanstack/react-router](https://github.com/TanStack/router/tree/HEAD/packages/react-router) | `1.170.41` | `1.170.44` | | [@tanstack/react-table](https://github.com/TanStack/table/tree/HEAD/packages/react-table) | `9.2.6` | `9.3.1` | | [uuid](https://github.com/uuidjs/uuid) | `14.0.2` | `14.0.3` | | [@playwright/test](https://github.com/microsoft/playwright) | `1.63.0` | `1.64.0` | | [@tanstack/router-plugin](https://github.com/TanStack/router/tree/HEAD/packages/router-plugin) | `1.168.42` | `1.168.45` | | [axe-core](https://github.com/dequelabs/axe-core) | `4.13.0` | `4.14.0` | | [knip](https://github.com/webpro-nl/knip/tree/HEAD/packages/knip) | `6.40.0` | `6.41.0` | | [vite](https://github.com/vitejs/vite/tree/HEAD/packages/vite) | `8.3.3` | `8.3.4` | | [vitest](https://github.com/vitest-dev/vitest/tree/HEAD/packages/vitest) | `5.0.3` | `5.0.4` | Updates `@mantine/core` from 9.7.1 to 9.7.2 - [Release notes](https://github.com/mantinedev/mantine/releases) - [Changelog](https://github.com/mantinedev/mantine/blob/master/CHANGELOG.md) - [Commits](https://github.com/mantinedev/mantine/commits/9.7.2/packages/@mantine/core) Updates `@mantine/hooks` from 9.7.1 to 9.7.2 - [Release notes](https://github.com/mantinedev/mantine/releases) - [Changelog](https://github.com/mantinedev/mantine/blob/master/CHANGELOG.md) - [Commits](https://github.com/mantinedev/mantine/commits/9.7.2/packages/@mantine/hooks) Updates `@tanstack/react-query` from 5.104.1 to 5.104.2 - [Release notes](https://github.com/TanStack/query/releases) - [Changelog](https://github.com/TanStack/query/blob/main/packages/react-query/CHANGELOG.md) - [Commits](https://github.com/TanStack/query/commits/@tanstack/react-query@5.104.2/packages/react-query) Updates `@tanstack/react-router` from 1.170.41 to 1.170.44 - [Release notes](https://github.com/TanStack/router/releases) - [Changelog](https://github.com/TanStack/router/blob/main/packages/react-router/CHANGELOG.md) - [Commits](https://github.com/TanStack/router/commits/@tanstack/react-router@1.170.44/packages/react-router) Updates `@tanstack/react-table` from 9.2.6 to 9.3.1 - [Release notes](https://github.com/TanStack/table/releases) - [Changelog](https://github.com/TanStack/table/blob/main/packages/react-table/CHANGELOG.md) - [Commits](https://github.com/TanStack/table/commits/@tanstack/react-table@9.3.1/packages/react-table) Updates `uuid` from 14.0.2 to 14.0.3 - [Release notes](https://github.com/uuidjs/uuid/releases) - [Changelog](https://github.com/uuidjs/uuid/blob/main/CHANGELOG.md) - [Commits](https://github.com/uuidjs/uuid/compare/v14.0.2...v14.0.3) Updates `@playwright/test` from 1.63.0 to 1.64.0 - [Release notes](https://github.com/microsoft/playwright/releases) - [Commits](https://github.com/microsoft/playwright/compare/v1.63.0...v1.64.0) Updates `@tanstack/router-plugin` from 1.168.42 to 1.168.45 - [Release notes](https://github.com/TanStack/router/releases) - [Changelog](https://github.com/TanStack/router/blob/main/packages/router-plugin/CHANGELOG.md) - [Commits](https://github.com/TanStack/router/commits/@tanstack/router-plugin@1.168.45/packages/router-plugin) Updates `axe-core` from 4.13.0 to 4.14.0 - [Release notes](https://github.com/dequelabs/axe-core/releases) - [Changelog](https://github.com/dequelabs/axe-core/blob/develop/CHANGELOG.md) - [Commits](https://github.com/dequelabs/axe-core/compare/v4.13.0...v4.14.0) Updates `knip` from 6.40.0 to 6.41.0 - [Release notes](https://github.com/webpro-nl/knip/releases) - [Commits](https://github.com/webpro-nl/knip/commits/knip@6.41.0/packages/knip) Updates `vite` from 8.3.3 to 8.3.4 - [Release notes](https://github.com/vitejs/vite/releases) - [Changelog](https://github.com/vitejs/vite/blob/main/packages/vite/CHANGELOG.md) - [Commits](https://github.com/vitejs/vite/commits/v8.3.4/packages/vite) Updates `vitest` from 5.0.3 to 5.0.4 - [Release notes](https://github.com/vitest-dev/vitest/releases) - [Changelog](https://github.com/vitest-dev/vitest/blob/main/docs/releases.md) - [Commits](https://github.com/vitest-dev/vitest/commits/v5.0.4/packages/vitest) --- updated-dependencies: - dependency-name: "@mantine/core" dependency-version: 9.7.2 dependency-type: direct:production update-type: version-update:semver-patch dependency-group: host - dependency-name: "@mantine/hooks" dependency-version: 9.7.2 dependency-type: direct:production update-type: version-update:semver-patch dependency-group: host - dependency-name: "@tanstack/react-query" dependency-version: 5.104.2 dependency-type: direct:production update-type: version-update:semver-patch dependency-group: host - dependency-name: "@tanstack/react-router" dependency-version: 1.170.44 dependency-type: direct:production update-type: version-update:semver-patch dependency-group: host - dependency-name: "@tanstack/react-table" dependency-version: 9.3.1 dependency-type: direct:production update-type: version-update:semver-minor dependency-group: host - dependency-name: uuid dependency-version: 14.0.3 dependency-type: direct:production update-type: version-update:semver-patch dependency-group: host - dependency-name: "@playwright/test" dependency-version: 1.64.0 dependency-type: direct:development update-type: version-update:semver-minor dependency-group: host - dependency-name: "@tanstack/router-plugin" dependency-version: 1.168.45 dependency-type: direct:development update-type: version-update:semver-patch dependency-group: host - dependency-name: axe-core dependency-version: 4.14.0 dependency-type: direct:development update-type: version-update:semver-minor dependency-group: host - dependency-name: knip dependency-version: 6.41.0 dependency-type: direct:development update-type: version-update:semver-minor dependency-group: host - dependency-name: vite dependency-version: 8.3.4 dependency-type: direct:development update-type: version-update:semver-patch dependency-group: host - dependency-name: vitest dependency-version: 5.0.4 dependency-type: direct:development update-type: version-update:semver-patch dependency-group: host ... Signed-off-by: dependabot[bot] --- ui/host/bun.lock | 122 ++++++++++++++++++++++--------------------- ui/host/package.json | 24 ++++----- 2 files changed, 74 insertions(+), 72 deletions(-) diff --git a/ui/host/bun.lock b/ui/host/bun.lock index c9ab4e14c..42d5652a7 100644 --- a/ui/host/bun.lock +++ b/ui/host/bun.lock @@ -9,37 +9,37 @@ "@dagrejs/dagre": "3.1.1", "@fontsource-variable/geist": "5.3.0", "@fontsource-variable/geist-mono": "5.3.0", - "@mantine/core": "9.7.1", - "@mantine/hooks": "9.7.1", + "@mantine/core": "9.7.2", + "@mantine/hooks": "9.7.2", "@modelcontextprotocol/client": "2.3.1", "@modelcontextprotocol/ext-apps": "2.0.3", "@phosphor-icons/react": "2.1.10", - "@tanstack/react-query": "5.104.1", - "@tanstack/react-router": "1.170.41", - "@tanstack/react-table": "9.2.6", + "@tanstack/react-query": "5.104.2", + "@tanstack/react-router": "1.170.44", + "@tanstack/react-table": "9.3.1", "echarts": "6.1.0", "react": "19.3.0", "react-dom": "19.3.0", "react-grid-layout": "2.3.0", "react-markdown": "10.1.0", "remark-gfm": "4.0.1", - "uuid": "14.0.2", + "uuid": "14.0.3", }, "devDependencies": { "@axe-core/playwright": "4.13.0", - "@playwright/test": "1.63.0", - "@tanstack/router-plugin": "1.168.42", + "@playwright/test": "1.64.0", + "@tanstack/router-plugin": "1.168.45", "@testing-library/dom": "10.4.2", "@types/react": "19.3.0", "@types/react-dom": "19.3.0", "@vitejs/plugin-react": "6.1.2", - "axe-core": "4.13.0", + "axe-core": "4.14.0", "happy-dom": "20.14.5", - "knip": "6.40.0", + "knip": "6.41.0", "typescript": "7.0.2", - "vite": "8.3.3", + "vite": "8.3.4", "vite-plugin-singlefile": "2.3.3", - "vitest": "5.0.3", + "vitest": "5.0.4", }, }, }, @@ -131,9 +131,9 @@ "@jridgewell/trace-mapping": ["@jridgewell/trace-mapping@0.3.31", "", { "dependencies": { "@jridgewell/resolve-uri": "^3.1.0", "@jridgewell/sourcemap-codec": "^1.4.14" } }, "sha512-zzNR+SdQSDJzc8joaeP8QQoCQr8NuYx2dIIytl1QeBEZHJ9uW6hebsrYgbz8hJwUQao3TWCMtmfV8Nu1twOLAw=="], - "@mantine/core": ["@mantine/core@9.7.1", "", { "dependencies": { "@floating-ui/react": "^0.27.20", "clsx": "^2.1.1", "react-number-format": "^5.4.5", "react-remove-scroll": "^2.7.2", "type-fest": "^5.10.0" }, "peerDependencies": { "@mantine/hooks": "9.7.1", "react": "^19.2.0", "react-dom": "^19.2.0" } }, "sha512-SU1xklOfdEDzpPhw35ti9rF4QRE9HUongCe37C+xCO2Ea8MLJkAzreCrMxb8qcCij+gnF7SQbtTCBa1r+pKxYA=="], + "@mantine/core": ["@mantine/core@9.7.2", "", { "dependencies": { "@floating-ui/react": "^0.27.20", "clsx": "^2.1.1", "react-number-format": "^5.4.5", "react-remove-scroll": "^2.7.2", "type-fest": "^5.10.0" }, "peerDependencies": { "@mantine/hooks": "9.7.2", "react": "^19.2.0", "react-dom": "^19.2.0" } }, "sha512-+cggJDD0PO057SwZU/dKlWPjp0LaAn1nEM9W1m/Ia4Cjb/Hy9DjZ4I7R7xirp/eZ6xnV7OqeGmPFSJ8zeGa5kQ=="], - "@mantine/hooks": ["@mantine/hooks@9.7.1", "", { "peerDependencies": { "react": "^19.2.0" } }, "sha512-C1xD4A3bfB87nUsLHr42WqOabnK4G+fCyEf8FN14EEiZAcKjdcWJbK63qxhIXFKuHCc3acLbpm2ts9UqmLASTw=="], + "@mantine/hooks": ["@mantine/hooks@9.7.2", "", { "peerDependencies": { "react": "^19.2.0" } }, "sha512-11emsRp/Mg+vfaKVyoMwiMdCHmO/15XOL6JG9fACkclVZnLPBVvRIaDdRBudsR3ALGZ5iTzrArPJDjjoeO6X4w=="], "@modelcontextprotocol/client": ["@modelcontextprotocol/client@2.3.1", "", { "dependencies": { "@modelcontextprotocol/core": "2.3.1", "cross-spawn": "^7.0.5", "eventsource": "^3.0.2", "eventsource-parser": "^3.0.8", "jose": "^6.1.3", "pkce-challenge": "^5.0.0", "zod": "^4.2.0" } }, "sha512-mIGZXpHsjnZ6lD+gD/WCMpR5k8yVQQ8nNFH1N0Srf7AvnwTUMYD6pvTY8ng2+He5FfV7YMZLmrjL7cLa/cc3dQ=="], @@ -143,45 +143,45 @@ "@napi-rs/wasm-runtime": ["@napi-rs/wasm-runtime@1.2.5", "", { "dependencies": { "@tybys/wasm-util": "^0.10.3" }, "peerDependencies": { "@emnapi/core": "^1.7.1 || ^2.0.0-alpha.4", "@emnapi/runtime": "^1.7.1 || ^2.0.0-alpha.4" } }, "sha512-HshSvXzmBxNzqejd3k/KemgQ3hdREUYFRRrgxOZ+gPljDIsO2SDZrVZMd4Z/HsxudQbE62OVyVFE8z9BCurfjA=="], - "@oxc-parser/binding-android-arm-eabi": ["@oxc-parser/binding-android-arm-eabi@0.150.0", "", { "os": "android", "cpu": "arm" }, "sha512-oQef2Zu4Prz1KLKznz3HqZzU9uVoA5PMoDZuuLmqms7hKmKSAPzlaMnLllJq3t+rgKmfJJ2siPrpZfFrW06btw=="], + "@oxc-parser/binding-android-arm-eabi": ["@oxc-parser/binding-android-arm-eabi@0.153.0", "", { "os": "android", "cpu": "arm" }, "sha512-BcWu25dMwMjHpaDCEidmpAi7rGg1qZoihJeUUH9bD55pVZ0z4Wa5CQgqSTo0R41H81oozisQKW3WqvAN2m77IQ=="], - "@oxc-parser/binding-android-arm64": ["@oxc-parser/binding-android-arm64@0.150.0", "", { "os": "android", "cpu": "arm64" }, "sha512-B6ofpoFiAUwIZ0MJ2IgHPvZK8FAtL4qzSZRwOkAKIfxEobE1mQC8nDdiFZj7pUaJiVUVCsfkMsBJKedzO8rZvA=="], + "@oxc-parser/binding-android-arm64": ["@oxc-parser/binding-android-arm64@0.153.0", "", { "os": "android", "cpu": "arm64" }, "sha512-9l5rdp2DhRqVriBHsNpu5cEf+hizZ4B58rt93HzyQEBUgZiC6qe2oFpaAAnXGCxHGnQExI1s7S2G0QhFacUZ6w=="], - "@oxc-parser/binding-darwin-arm64": ["@oxc-parser/binding-darwin-arm64@0.150.0", "", { "os": "darwin", "cpu": "arm64" }, "sha512-J+9IHKzx/bSz1JetOfD4zKXSK9sOm4/a7+0qomJODcTL6JsRXGeV/ZdkAPSIDydfFmWzYCraMlQEosSZEyBYkQ=="], + "@oxc-parser/binding-darwin-arm64": ["@oxc-parser/binding-darwin-arm64@0.153.0", "", { "os": "darwin", "cpu": "arm64" }, "sha512-EcpsyRXHhENDpekpG4QNaSZj2F/BAz4Gh4o89zZwNss86R8KyRSQ6sXbAj74Xyeb4z3j/yBZZ6joQZhraIWyfw=="], - "@oxc-parser/binding-darwin-x64": ["@oxc-parser/binding-darwin-x64@0.150.0", "", { "os": "darwin", "cpu": "x64" }, "sha512-v6IPfcAcSYrBWXV5Tce1DmxDMXLhEYpIIWiRFPJopgCVscZdLaV4MRQOUxvL3usQlw+yrwYOjBFB9IwBx+jUiQ=="], + "@oxc-parser/binding-darwin-x64": ["@oxc-parser/binding-darwin-x64@0.153.0", "", { "os": "darwin", "cpu": "x64" }, "sha512-hlj80HUQy07/2lYp6rmxH+3u+H2ik3rjLR52CUdPApxmZCNxASDUf/+ykTzAHS/fehftmVMATKvPaWmuLHuasg=="], - "@oxc-parser/binding-freebsd-x64": ["@oxc-parser/binding-freebsd-x64@0.150.0", "", { "os": "freebsd", "cpu": "x64" }, "sha512-AoR/4jD02HET0KO0yNT4nbTE+XJUxiO9jB1X/ycEjUE3WrIJ3IjV/Vf+gskhWLcqqeXfvNnkDtBR7epllAm88A=="], + "@oxc-parser/binding-freebsd-x64": ["@oxc-parser/binding-freebsd-x64@0.153.0", "", { "os": "freebsd", "cpu": "x64" }, "sha512-fWRcv2pMSh1qtez46MOu8vuUJ5fiaQZPHSphbWulbL7SHBMKfRgZl2PzjXZYQJbq7NEXyXbgIuIuUm+/Rmkv8w=="], - "@oxc-parser/binding-linux-arm-gnueabihf": ["@oxc-parser/binding-linux-arm-gnueabihf@0.150.0", "", { "os": "linux", "cpu": "arm" }, "sha512-A/hycCFjLUrCmLoL5O/vBp40ohlaXO1Ta3v5hqYZxicYFs129wZmgZJggcW4mYGYbZebQLhup+N8JjeQl8qwyw=="], + "@oxc-parser/binding-linux-arm-gnueabihf": ["@oxc-parser/binding-linux-arm-gnueabihf@0.153.0", "", { "os": "linux", "cpu": "arm" }, "sha512-paZeUK1GXShl/bOJQET1/8AQxayFeuN4SIWAkgTRxE7ZQwv9uYSB2n0648smygP22N7jcI3zxAm0Z+ALNiIKxg=="], - "@oxc-parser/binding-linux-arm-musleabihf": ["@oxc-parser/binding-linux-arm-musleabihf@0.150.0", "", { "os": "linux", "cpu": "arm" }, "sha512-pbqahg1Pkz7J4RKmXm30s/iQu99hv64ayXCu8P4p75HcEH5azOdR4eGqiB6lFGkFR3mMpzaYsSKLkS8oJbjmeQ=="], + "@oxc-parser/binding-linux-arm-musleabihf": ["@oxc-parser/binding-linux-arm-musleabihf@0.153.0", "", { "os": "linux", "cpu": "arm" }, "sha512-qFPp5NwMf4K1C0O+DCVGmcbOaYyYAq98Rvv9p4VSfb777iUwlJCqMUxf6QG9N5f5ls4TEX6LitOZHi+6GL6rYQ=="], - "@oxc-parser/binding-linux-arm64-gnu": ["@oxc-parser/binding-linux-arm64-gnu@0.150.0", "", { "os": "linux", "cpu": "arm64" }, "sha512-HV11aRbBQGwqv8bEo+K/6qr88uB4fEe1mhXncMhlVCrj+WpBSraxrUzHaPVmeQRU6x6x8v/3DuCbbo93rpp+fw=="], + "@oxc-parser/binding-linux-arm64-gnu": ["@oxc-parser/binding-linux-arm64-gnu@0.153.0", "", { "os": "linux", "cpu": "arm64" }, "sha512-oufEhZCX7saeo27Logra8cvBR1jQ/yw2zUI2hHmWw3qA/XYqEW31FOvLQBv7DWN32NjVdlcaP11WBBZTJo4k9g=="], - "@oxc-parser/binding-linux-arm64-musl": ["@oxc-parser/binding-linux-arm64-musl@0.150.0", "", { "os": "linux", "cpu": "arm64" }, "sha512-k6pVkJqALwtEuP4zukVhGRhdIy4+ofChUIUUsAHHyqDZlNsknmel3JjbggrJiWGaes6h/dIcWmEXsKW4SmK9oQ=="], + "@oxc-parser/binding-linux-arm64-musl": ["@oxc-parser/binding-linux-arm64-musl@0.153.0", "", { "os": "linux", "cpu": "arm64" }, "sha512-zXYzuAqng85h6+LI3iRm0zeMLX1/K2z41ZAMWxVRgt0D10VvZUaV5q+TEB46KDhoKBpdexoTLC6QoB/EiP2oqQ=="], - "@oxc-parser/binding-linux-ppc64-gnu": ["@oxc-parser/binding-linux-ppc64-gnu@0.150.0", "", { "os": "linux", "cpu": "ppc64" }, "sha512-tEFg39mw/rHO5n8GK2DR4ZMFfsPQZtnQIPbsIpjoQRomJc/2tRfsCSmCT6gNit+NZGoeJG5aH9ATDH5bf0WnoQ=="], + "@oxc-parser/binding-linux-ppc64-gnu": ["@oxc-parser/binding-linux-ppc64-gnu@0.153.0", "", { "os": "linux", "cpu": "ppc64" }, "sha512-J7+NLwLEzdkKM9cKyPHH/AjXXstWOs98KYgLrPPnO4N9MO8EZRBfPNnBcS3S67uMOBkRpUmCl2FhRnWdQ5CbBA=="], - "@oxc-parser/binding-linux-riscv64-gnu": ["@oxc-parser/binding-linux-riscv64-gnu@0.150.0", "", { "os": "linux", "cpu": "none" }, "sha512-0JO7IFkoek6HqV589Menx3hJySNXi6quRhO4tq2P7kpEHKEXoDATnoPVUpn5B7gDH2KLkdo751N0uIrGJFCTCw=="], + "@oxc-parser/binding-linux-riscv64-gnu": ["@oxc-parser/binding-linux-riscv64-gnu@0.153.0", "", { "os": "linux", "cpu": "none" }, "sha512-sD0K11GQTLWylln54nPMMTtgmBbQrR5It/vMpZpy/fogiw8O2AvIE+9LuWUXddrWk9zvFIHGRcSgFn4IHOfoYg=="], - "@oxc-parser/binding-linux-riscv64-musl": ["@oxc-parser/binding-linux-riscv64-musl@0.150.0", "", { "os": "linux", "cpu": "none" }, "sha512-7XPzREnyAS5wHU9aB+49Uaqgoo1gVCklHc3DRlc3fJy2tXD/eAJFN1QFz/crj+Ulup5P1+axNREF+/RGaB/IRA=="], + "@oxc-parser/binding-linux-riscv64-musl": ["@oxc-parser/binding-linux-riscv64-musl@0.153.0", "", { "os": "linux", "cpu": "none" }, "sha512-7L66uql2BhvSz51LwfExjOdn6et/ydTiQxl23VApdKzJhTc3TczA1Qt6VR/UcvlQrL2ZbytIJb447vh7p5wmUw=="], - "@oxc-parser/binding-linux-s390x-gnu": ["@oxc-parser/binding-linux-s390x-gnu@0.150.0", "", { "os": "linux", "cpu": "s390x" }, "sha512-7n7ZxcbRWDFaTdyj8M8p0O9OfzoMKm8O6syBAIgcSutbOALq0Bb9G52Me+XH0anMLZV+NgXc726gqgG2q39vcQ=="], + "@oxc-parser/binding-linux-s390x-gnu": ["@oxc-parser/binding-linux-s390x-gnu@0.153.0", "", { "os": "linux", "cpu": "s390x" }, "sha512-hXV3T7mNyrPR19rbPYkglkQJtoM/UNo/xwbZeeqdAxEg8PXgb4LXXuxPpGgI4bzRRCWwLUxdDSS58xIyC2u1TA=="], - "@oxc-parser/binding-linux-x64-gnu": ["@oxc-parser/binding-linux-x64-gnu@0.150.0", "", { "os": "linux", "cpu": "x64" }, "sha512-Vx0GSA9ZCRTUiczoEQnIIyXkMvtEY8uc6IiwLQtMe5ci2sXPqjrry0Ek5fsPP1k2kCzkML3ow9UOOEgnEDi7Bw=="], + "@oxc-parser/binding-linux-x64-gnu": ["@oxc-parser/binding-linux-x64-gnu@0.153.0", "", { "os": "linux", "cpu": "x64" }, "sha512-Da8Vqs1xdtoDYtEjmozD7wGgJeLBQkMbR0WUBECOSxodyX5DXy8ySlvJWbukyO2Q0+TM9EK+4LT6tbq0jCg4hQ=="], - "@oxc-parser/binding-linux-x64-musl": ["@oxc-parser/binding-linux-x64-musl@0.150.0", "", { "os": "linux", "cpu": "x64" }, "sha512-ii4/9m3viDLssMnfXU7/Pni/3nYplApuGayceX4qsVGaqqQJCx3tHIH9M/HWIeSty5i8LjS21zPYT6lVIkwLxw=="], + "@oxc-parser/binding-linux-x64-musl": ["@oxc-parser/binding-linux-x64-musl@0.153.0", "", { "os": "linux", "cpu": "x64" }, "sha512-zGAPxNTIIw6X5WyTRscIFE/oDjpdNtrrl32ing6NOXdGjzRucadnxBilexLdeYQ9YxixF93GujpXyQ0jw7ddSg=="], - "@oxc-parser/binding-openharmony-arm64": ["@oxc-parser/binding-openharmony-arm64@0.150.0", "", { "os": "none", "cpu": "arm64" }, "sha512-ZtoxX5rez36ZWkwtiEhjkCPnlTPoQ2I7lIL0IYZ1yjxMYohbvoOjBmUIZzrf9W/HouONq0omIfTeCWEY+R380w=="], + "@oxc-parser/binding-openharmony-arm64": ["@oxc-parser/binding-openharmony-arm64@0.153.0", "", { "os": "none", "cpu": "arm64" }, "sha512-GoHzpqP5XyPIp9DHokoEdCp+K4UPl/h1neFj1uXnUB3pJYyOQ7NOhFVOttNUgCGcj2eywAvu5cRivTOSq4S10g=="], - "@oxc-parser/binding-win32-arm64-msvc": ["@oxc-parser/binding-win32-arm64-msvc@0.150.0", "", { "os": "win32", "cpu": "arm64" }, "sha512-VqeRb5JX/bKYBrff7TUDvJyKY0914UzuCkuXIGxJS4FUmvMNfqkCbc7Sq90iMz9DlmAtlggwaBYQ9eg3h3ltiw=="], + "@oxc-parser/binding-win32-arm64-msvc": ["@oxc-parser/binding-win32-arm64-msvc@0.153.0", "", { "os": "win32", "cpu": "arm64" }, "sha512-xGcy12tO9k7zFbeyQzEuilfWfQpyRq23/fLPfN3wjSWuWv58k46fQT1hsO1KFNykZuVGW9xSJE/z592TmAoSDA=="], - "@oxc-parser/binding-win32-ia32-msvc": ["@oxc-parser/binding-win32-ia32-msvc@0.150.0", "", { "os": "win32", "cpu": "ia32" }, "sha512-EPqJfeZ4Pgg2BJSsCV8GozxV0FDltRzpVtGVa1r2noJu1iu+opOw3gtBWXwIo9odCT/MdFfyHxdy0/CRqs3OqA=="], + "@oxc-parser/binding-win32-ia32-msvc": ["@oxc-parser/binding-win32-ia32-msvc@0.153.0", "", { "os": "win32", "cpu": "ia32" }, "sha512-o1ykUjWncvXX6N5a4KebgLjtD8zRui+f1llMhSGoSC9oP2KOqapRpdwmZ3NcNG0axFouwVKmhGBjd+IhA8BksA=="], - "@oxc-parser/binding-win32-x64-msvc": ["@oxc-parser/binding-win32-x64-msvc@0.150.0", "", { "os": "win32", "cpu": "x64" }, "sha512-n5YMzbqwPQqozbkrexi0lNZrUz5cnPHalYpFWe6Dau7AmKIWNo+y24IwzDuZEQtEdUHuKhXmMMih/MPjOI+CMw=="], + "@oxc-parser/binding-win32-x64-msvc": ["@oxc-parser/binding-win32-x64-msvc@0.153.0", "", { "os": "win32", "cpu": "x64" }, "sha512-gxQz7G96Up136fd+2zWrP+o6FYGs9NO4Dyv55IoeJFJUDwLFHcLYY11hhA5wQKs0HoM57Q8esQ3nEVhnCdsjAQ=="], - "@oxc-project/types": ["@oxc-project/types@0.150.0", "", {}, "sha512-rDS5/31E9HfPl/CIzGrn0DOlvBbXFseQ5URJ9sYMfstbKLD/c6Gm9vmRzRGDdAXyOIL4zmO37lc9RIwYqVruZw=="], + "@oxc-project/types": ["@oxc-project/types@0.153.0", "", {}, "sha512-jSNrRIyvPVLL5E1z/tS5zLAprosGz/FuI1PWwEOz59j3E4TTTzSpqKb/RDGqJhhW0QHYISGXxq582wGx6T11Tw=="], "@oxc-resolver/binding-android-arm-eabi": ["@oxc-resolver/binding-android-arm-eabi@11.24.2", "", { "os": "android", "cpu": "arm" }, "sha512-y09e0L0SRI2OA2tUIrjBgoV3eH5hvUKXNkJqXmNo5V2WxIjyC7I7aJfRLMEVpA8yi95f90gFDvO0VMgrDw+vwA=="], @@ -223,7 +223,7 @@ "@phosphor-icons/react": ["@phosphor-icons/react@2.1.10", "", { "peerDependencies": { "react": ">= 16.8", "react-dom": ">= 16.8" } }, "sha512-vt8Tvq8GLjheAZZYa+YG/pW7HDbov8El/MANW8pOAz4eGxrwhnbfrQZq0Cp4q8zBEu8NIhHdnr+r8thnfRSNYA=="], - "@playwright/test": ["@playwright/test@1.63.0", "", { "dependencies": { "playwright": "1.63.0" }, "bin": { "playwright": "cli.js" } }, "sha512-oxMK4vllB9RK5NQ2l1pq1IfOf2AvnEuj/vYGDj0H2nMtmtZpKtCwt/l00GEO6xjGfpBNAvjovvYdCm50dRQkpQ=="], + "@playwright/test": ["@playwright/test@1.64.0", "", { "dependencies": { "playwright": "1.64.0" }, "bin": { "playwright": "cli.js" } }, "sha512-oTN9FNYuN6bqQMwiho6jJKLCG2/QOYCixGXuCjRmzOq23eODeukuY2XiAVoVpAECbuezMt1MHQjAiQxK8F+Y+g=="], "@protobuf-ts/protoc": ["@protobuf-ts/protoc@2.11.1", "", { "bin": { "protoc": "protoc.js" } }, "sha512-mUZJaV0daGO6HUX90o/atzQ6A7bbN2RSuHtdwo8SSF2Qoe3zHwa4IHyCN1evftTeHfLmdz+45qo47sL+5P8nyg=="], @@ -261,29 +261,29 @@ "@standard-schema/spec": ["@standard-schema/spec@1.1.0", "", {}, "sha512-l2aFy5jALhniG5HgqrD6jXLi/rUWrKvqN/qJx6yoJsgKhblVd+iqqU4RCXavm/jPityDo5TCvKMnpjKnOriy0w=="], - "@tanstack/history": ["@tanstack/history@1.162.4", "", {}, "sha512-utTS5L2OkeYUzXGohL1Z8sefu1GLNOJcxe8Hd6iIdc/Xo1K1nDB2JEp4iSFhvYh33xKC9V91TxrS8qfrpoKobQ=="], + "@tanstack/history": ["@tanstack/history@1.162.5", "", {}, "sha512-w1+YvwmTkwt5n8yUqEH3IWZ9DsmorCZW/EQ3KYHnqEgIkOZpH54NvW6/Epq3Dzb8H0ifIeYX8PExvrNLIH5FIA=="], - "@tanstack/query-core": ["@tanstack/query-core@5.104.1", "", {}, "sha512-TiRghcrGkUTE+M4JBxvpPSpBhxvIzQairw+cksrHYGr+2uwC77yW1SY9nYxnYRYOppvucf8rEg6b5byoz4rTpw=="], + "@tanstack/query-core": ["@tanstack/query-core@5.104.2", "", {}, "sha512-/qbsxJK5c3Ve1aFIULWYNcT2jeRUAiD4HME6Eu2ZdpofHoVgAjpkQhLg5xHuOoBkTPQUJLfP7zOxy0qsBcqROA=="], - "@tanstack/react-query": ["@tanstack/react-query@5.104.1", "", { "dependencies": { "@tanstack/query-core": "5.104.1" }, "peerDependencies": { "react": "^18 || ^19" } }, "sha512-Zz70EgjahNI7aCz8BZxM3vUGU44ycxEAzMuCUjLeA7SVhhOkg3ZgPjPJPvHjs6Rmky/dtmnu1WzjGHNHmhCoZQ=="], + "@tanstack/react-query": ["@tanstack/react-query@5.104.2", "", { "dependencies": { "@tanstack/query-core": "5.104.2" }, "peerDependencies": { "react": "^18 || ^19" } }, "sha512-xKmzWGhadbE5wGS/ZmXShRITnI9oItox5GO14KvFZco3+vhTAyXS1erYzJWdiY280zapAGJXFUL9nHgwP6SV/g=="], - "@tanstack/react-router": ["@tanstack/react-router@1.170.41", "", { "dependencies": { "@tanstack/history": "1.162.4", "@tanstack/react-store": "^0.11.2", "@tanstack/router-core": "1.171.34", "isbot": "^5.1.22" }, "peerDependencies": { "react": ">=18.0.0 || >=19.0.0", "react-dom": ">=18.0.0 || >=19.0.0" } }, "sha512-Mpvw8Wm5MGDbTqI8Yc9flLKxbOHwoWocv0H2aGKcgw2a017oK5nZWqa954P+DrUx/8fI98YNywnHP5XcD3tQ9w=="], + "@tanstack/react-router": ["@tanstack/react-router@1.170.44", "", { "dependencies": { "@tanstack/history": "1.162.5", "@tanstack/react-store": "^0.11.2", "@tanstack/router-core": "1.171.37", "isbot": "^5.1.22" }, "peerDependencies": { "react": ">=18.0.0 || >=19.0.0", "react-dom": ">=18.0.0 || >=19.0.0" } }, "sha512-uIIZ3CHU1yWlkMkmbnGFX3WIfZozF+tNrOMMEoM9lo+jzPInCRq80LBqW3DH9ixNHWjB3TM/cNIvr05uGIlP3A=="], "@tanstack/react-store": ["@tanstack/react-store@0.11.2", "", { "dependencies": { "@tanstack/store": "0.11.2", "use-sync-external-store": "^1.6.0" }, "peerDependencies": { "react": "^16.8.0 || ^17.0.0 || ^18.0.0 || ^19.0.0", "react-dom": "^16.8.0 || ^17.0.0 || ^18.0.0 || ^19.0.0" } }, "sha512-oj5O5DmiMWE+ih+SioX2ayC1kbK7d3fpLx0B75fPJr9nY3zU+hoW010yr64qXsY/9fyiLVE2bn5mGNV3owm8RQ=="], - "@tanstack/react-table": ["@tanstack/react-table@9.2.6", "", { "dependencies": { "@tanstack/react-store": "^0.11.2", "@tanstack/table-core": "9.2.6" }, "peerDependencies": { "react": ">=18" } }, "sha512-Wmt3sbzwz+5CtB0pqIxGw2FrNW9mF4AhJ9KnS1/VGZ8cDAEg51S4ixru2dnF0xQnY407kdYNLer3ms+n8zCN6w=="], + "@tanstack/react-table": ["@tanstack/react-table@9.3.1", "", { "dependencies": { "@tanstack/react-store": "^0.11.2", "@tanstack/table-core": "9.3.1" }, "peerDependencies": { "react": ">=18" } }, "sha512-E6Ya5TnY6EaGyZYIUqig/29Lr/gJSAubQkLJFqiWkUl5nRCr0Xr9hvJot+NiRTtG+TzGxHTiqUW3bnLtQxlHug=="], - "@tanstack/router-core": ["@tanstack/router-core@1.171.34", "", { "dependencies": { "@tanstack/history": "1.162.4", "cookie-es": "^3.0.0", "seroval": "^1.6.7", "seroval-plugins": "^1.6.7" } }, "sha512-X+19pGuuLVPvvAvPYw9v/+ktRk5cCll8AtfpBpOhDRmVgUMrfqze0467xtq8YRVVs/mmo5rVtWn/7Tp32RDBKw=="], + "@tanstack/router-core": ["@tanstack/router-core@1.171.37", "", { "dependencies": { "@tanstack/history": "1.162.5", "cookie-es": "^3.0.0", "seroval": "^1.6.7", "seroval-plugins": "^1.6.7" } }, "sha512-11Le36++mHNeeFIABz4C3PdTWyJ1ilOmGmANOQOypknZwC1xN674al5BUqWuimKasWane1/XSNcEx8NYNHh0+A=="], - "@tanstack/router-generator": ["@tanstack/router-generator@1.167.40", "", { "dependencies": { "@babel/types": "^7.29.8", "@tanstack/router-core": "1.171.34", "@tanstack/router-utils": "1.162.3", "@tanstack/virtual-file-routes": "1.162.0", "jiti": "^2.7.0", "magic-string": "^0.30.21", "prettier": "^3.9.6", "zod": "^4.5.4" } }, "sha512-WkEueqEvsBBudzO0fx1nWfOmRNW8OAvBoVABTGls9bAWzjdC+KDGHvjCNrvn88ofs1F6gqL8aWnzKCbxW3dCyQ=="], + "@tanstack/router-generator": ["@tanstack/router-generator@1.167.43", "", { "dependencies": { "@babel/types": "^7.29.8", "@tanstack/router-core": "1.171.37", "@tanstack/router-utils": "1.162.3", "@tanstack/virtual-file-routes": "1.162.0", "jiti": "^2.7.0", "magic-string": "^0.30.21", "prettier": "^3.9.6", "zod": "^4.5.4" } }, "sha512-3IOgWD3gUmbokR9q1ZFQE9/By/VMX4/bDSKJwaIa625PDB0czCF6J+OPSeA/7wb1wDE42fAqX1q4j7bnr1eLcA=="], - "@tanstack/router-plugin": ["@tanstack/router-plugin@1.168.42", "", { "dependencies": { "@babel/core": "^7.29.7", "@babel/template": "^7.29.7", "@babel/types": "^7.29.8", "@tanstack/router-core": "1.171.34", "@tanstack/router-generator": "1.167.40", "@tanstack/router-utils": "1.162.3", "chokidar": "^5.0.0", "unplugin": "^3.3.0", "zod": "^4.5.4" }, "peerDependencies": { "@rsbuild/core": ">=1.0.2 || ^2.0.0", "@tanstack/react-router": "^1.170.41", "vite": ">=5.0.0 || >=6.0.0 || >=7.0.0 || >=8.0.0", "vite-plugin-solid": "^2.11.10 || ^3.0.0-0", "webpack": ">=5.92.0" }, "optionalPeers": ["@rsbuild/core", "@tanstack/react-router", "vite", "vite-plugin-solid", "webpack"] }, "sha512-vAR5WXJh/ErseEWQftDhsJcr2c++ucRQ6FbqN3ygMO44+ZxxRfW3sIpZmddHROVSmBk8jc6MrwjTPNjVhd62Vw=="], + "@tanstack/router-plugin": ["@tanstack/router-plugin@1.168.45", "", { "dependencies": { "@babel/core": "^7.29.7", "@babel/template": "^7.29.7", "@babel/types": "^7.29.8", "@tanstack/router-core": "1.171.37", "@tanstack/router-generator": "1.167.43", "@tanstack/router-utils": "1.162.3", "chokidar": "^5.0.0", "unplugin": "^3.3.0", "zod": "^4.5.4" }, "peerDependencies": { "@rsbuild/core": ">=1.0.2 || ^2.0.0", "@tanstack/react-router": "^1.170.44", "vite": ">=5.0.0 || >=6.0.0 || >=7.0.0 || >=8.0.0", "vite-plugin-solid": "^2.11.10 || ^3.0.0-0", "webpack": ">=5.92.0" }, "optionalPeers": ["@rsbuild/core", "@tanstack/react-router", "vite", "vite-plugin-solid", "webpack"] }, "sha512-caBZAfe9iLCaVy5zEuYwXx9TpZgN7XX1AkW55e0LfeIZGEZvMw5h2KE3ZNdx0k1Kxik4HPBRMUj8Np/TYTJG7Q=="], "@tanstack/router-utils": ["@tanstack/router-utils@1.162.3", "", { "dependencies": { "@babel/generator": "^7.29.8", "@babel/parser": "^7.29.8", "@babel/types": "^7.29.8", "ansis": "^4.3.1", "babel-dead-code-elimination": "^1.0.12", "diff": "^8.0.4", "pathe": "^2.0.3", "tinyglobby": "^0.2.17" } }, "sha512-Icb0xGuG1+54IV0WMLRcc3ErTx2HeJWyPG661FkQ8UT6guoBq1FJjFRqlG/JS0xi4mFFkBhvwO7tbLa32f3yxA=="], "@tanstack/store": ["@tanstack/store@0.11.2", "", {}, "sha512-sJ4mjol8uQsHV0gOJzzjwXfh2Fwm+Sz0+8deqiTm4jGbMdjzNSW+xZCFm0kUa870uhd8yi+DpKnZb5Kc4apa0Q=="], - "@tanstack/table-core": ["@tanstack/table-core@9.2.6", "", { "dependencies": { "@tanstack/store": "^0.11.2" } }, "sha512-t5LaLx8gDCgzjvwtZo5xtLklJP11D9zaKOW8q6jOCyuQYhkqpTK1heqMfgTQwDlhl0dU8f1X66Xurbj3jpCUSw=="], + "@tanstack/table-core": ["@tanstack/table-core@9.3.1", "", { "dependencies": { "@tanstack/store": "^0.11.2" } }, "sha512-zQvlxSNi2qGM3L4jh85Z6hqMfdIR5qOfD9KHOU32nuKFJGN0RlJ7UvV1lsPb1fPVhpFYI0VP3jJGxLdLDpTKjQ=="], "@tanstack/virtual-file-routes": ["@tanstack/virtual-file-routes@1.162.0", "", {}, "sha512-uhOeFyxLcU41HzvrxsGpiWdcMbScY1EDgbZ5K7DVRMYInbLYWAC0EA/kx9wXAoSM8q82bUG2hRl8+EAjE6XAbA=="], @@ -367,9 +367,9 @@ "@vitejs/plugin-react": ["@vitejs/plugin-react@6.1.2", "", { "dependencies": { "@rolldown/pluginutils": "^1.0.1" }, "peerDependencies": { "@rolldown/plugin-babel": "^0.1.7 || ^0.2.0", "babel-plugin-react-compiler": "^1.0.0", "oxc-transform-react": "^0.152.0", "vite": "^8.0.0" }, "optionalPeers": ["@rolldown/plugin-babel", "babel-plugin-react-compiler", "oxc-transform-react"] }, "sha512-fhJNGUdscQa4HkI0xFxwonWyhnVReCPDbXI7FH7jmzpnVCrFQI7PRrhWecO263610vOrs9tr2Y4xcf8uAdFxbw=="], - "@vitest/mocker": ["@vitest/mocker@5.0.3", "", { "dependencies": { "@jridgewell/trace-mapping": "0.3.31", "@vitest/spy": "5.0.3", "estree-walker": "^3.0.3", "magic-string": "^1.2.3" }, "peerDependencies": { "msw": "^2.4.9", "vite": "^6.0.0 || ^7.0.0 || ^8.0.0" }, "optionalPeers": ["msw", "vite"] }, "sha512-T8sWAIbkSyAjkwTcaEc3Iu0o9A27X1/kdXrizhZkGuSKScRQtRzclfAMpOTcGdXCsqxeWlpGy3XjqaW8CpLORg=="], + "@vitest/mocker": ["@vitest/mocker@5.0.4", "", { "dependencies": { "@jridgewell/trace-mapping": "0.3.31", "@vitest/spy": "5.0.4", "estree-walker": "^3.0.3", "magic-string": "^1.4.3" }, "peerDependencies": { "msw": "^2.4.9 || ^3.0.0", "vite": "^6.0.0 || ^7.0.0 || ^8.0.0" }, "optionalPeers": ["msw", "vite"] }, "sha512-tqAlrYWce4iUxhr3ncNohejtCTOcHeE8XWrSNZY3OhPoDn01yeGv+gnaBy64ATp7o6pb03eIbBAjzmibpc9vIQ=="], - "@vitest/spy": ["@vitest/spy@5.0.3", "", {}, "sha512-XhFysQTB8AZ+P4gMi+Lpo99vg2AZi0qKpaB9yXQl37+CaMEAPO3iH/wGVnSyL5MPERiLezpqTVtrR6UZH5GCXg=="], + "@vitest/spy": ["@vitest/spy@5.0.4", "", {}, "sha512-MZKk/gSkm2q+ICobMxCpH1mA+cCAWm8WV7UhxlqGjq/sJ3AGc1BqFOs5CRVXxH78wQtme9q/NAAgBquj4AcyMw=="], "ansi-regex": ["ansi-regex@5.0.1", "", {}, "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ=="], @@ -381,7 +381,7 @@ "assertion-error": ["assertion-error@2.0.1", "", {}, "sha512-Izi8RQcffqCeNVgFigKli1ssklIbpHnCYc6AknXGYoB6grJqyeby7jv12JUQgmTAnIDnbck1uxksT4dzN3PWBA=="], - "axe-core": ["axe-core@4.13.0", "", {}, "sha512-UzGt8zg7Ny8djbYMhxl2zuEevVa7r2gJjYY5Lwr1xM7+XU2nd6CkIWFTVcCIbAP63vSz71NaVyyuSk9lHKcy0A=="], + "axe-core": ["axe-core@4.14.0", "", {}, "sha512-9WTZxEjsZ7b13TH8JPmbV2z8CHbl80/2hm3XPEG4JgNdQLK81IBRXmSxHfMAOkSqQeRxT/0dwNDz2GOm3zzpcQ=="], "babel-dead-code-elimination": ["babel-dead-code-elimination@1.0.12", "", { "dependencies": { "@babel/core": "^7.23.7", "@babel/parser": "^7.23.6", "@babel/traverse": "^7.23.7", "@babel/types": "^7.23.6" } }, "sha512-GERT7L2TiYcYDtYk1IpD+ASAYXjKbLTDPhBtYj7X1NuRMDTMtAx9kyBenub1Ev41lo91OHCKdmP+egTDmfQ7Ig=="], @@ -475,7 +475,7 @@ "fill-range": ["fill-range@7.1.1", "", { "dependencies": { "to-regex-range": "^5.0.1" } }, "sha512-YsGpe3WHLK8ZYi4tWDg2Jy3ebRz2rXowDxnld4bkQB00cc/1Zw9AWnC0i9ztDJitivtQvaI9KaLyKrc+hBW0yg=="], - "formatly": ["formatly@0.7.1", "", { "dependencies": { "fd-package-json": "^2.0.0", "package-manager-detector": "^1.8.0" }, "bin": { "formatly": "bin/index.mjs" } }, "sha512-ESuCEJE0SGgabl9q+zABI8LhJDmF+8nhpuqDzuM48HfJ9QTD5o6PqFJDFZY7w6f8xsh5lixuj5nJsQNvYOWvKQ=="], + "formatly": ["formatly@0.11.4", "", { "dependencies": { "fd-package-json": "^2.0.0", "package-manager-detector": "^1.8.0" }, "bin": { "formatly": "bin/index.mjs" } }, "sha512-TeCC10lP8KCgoX+Fe5lryILIT0/Dy+nP0OSVnsuB5CwXoLuOdqxCYlPFF1inR8S/zTy1ec7TjhS2TeRKWzzImA=="], "fsevents": ["fsevents@2.3.3", "", { "os": "darwin" }, "sha512-5xoDfX+fL7faATnagmWPpbFtwh/R77WmMMqqHGS65C3vvB0YHrgF+B1YmZ3441tMj5n63k0212XNoJwzlhffQw=="], @@ -521,7 +521,7 @@ "json5": ["json5@2.2.3", "", { "bin": { "json5": "lib/cli.js" } }, "sha512-XmOWe7eyHYH14cLdVPoyg+GOH3rYX++KpzrylJwSW98t3Nk+U8XOl8FWKOgwtzdb8lXGf6zYwDUzeHMWfxasyg=="], - "knip": ["knip@6.40.0", "", { "dependencies": { "fdir": "^6.5.0", "formatly": "^0.7.0", "get-tsconfig": "4.14.3", "jiti": "^2.7.0", "oxc-parser": "^0.150.0", "oxc-resolver": "11.24.2", "picomatch": "^4.0.7", "smol-toml": "^1.8.0", "strip-json-comments": "5.0.3", "tinyglobby": "^0.2.17", "unbash": "^4.0.11", "yaml": "^2.9.1", "zod": "^4.4.3" }, "bin": { "knip": "bin/knip.js", "knip-bun": "bin/knip-bun.js" } }, "sha512-5Lp/ANJu3AkW5f+J+2QG14z7xKZGi/ybb5MU1EWjeGdt6MpuIaLpLFiyBi0ZKryTiuTHiJqo/WKJRaWYimvavw=="], + "knip": ["knip@6.41.0", "", { "dependencies": { "formatly": "^0.11.4", "get-tsconfig": "4.14.3", "jiti": "^2.7.0", "oxc-parser": "^0.153.0", "oxc-resolver": "11.24.2", "picomatch": "^4.0.7", "smol-toml": "^1.9.0", "strip-json-comments": "5.0.3", "tinyglobby": "^0.2.17", "unbash": "^5.0.0", "yaml": "^2.9.1", "zod": "^4.6.5" }, "bin": { "knip": "bin/knip.js", "knip-bun": "bin/knip-bun.js" } }, "sha512-DrhQlIuV6xScd5Q+WTF1znd1w41QzxFGCtAHXCajsH/ndGMotHoNYbdXbuFtzW3mIOmniHtZ7zCtvnQkUmJtQQ=="], "lightningcss": ["lightningcss@1.33.0", "", { "dependencies": { "detect-libc": "^2.0.3" }, "optionalDependencies": { "lightningcss-android-arm64": "1.33.0", "lightningcss-darwin-arm64": "1.33.0", "lightningcss-darwin-x64": "1.33.0", "lightningcss-freebsd-x64": "1.33.0", "lightningcss-linux-arm-gnueabihf": "1.33.0", "lightningcss-linux-arm64-gnu": "1.33.0", "lightningcss-linux-arm64-musl": "1.33.0", "lightningcss-linux-x64-gnu": "1.33.0", "lightningcss-linux-x64-musl": "1.33.0", "lightningcss-win32-arm64-msvc": "1.33.0", "lightningcss-win32-x64-msvc": "1.33.0" } }, "sha512-WkUDrojuJs0xkgGf2udWxa3yGBRxPtxUkB79i6aCZLRgc7PM8fZe9TosfPDcvEpQZbuFASnHYmRLBLUbmLOIIA=="], @@ -555,7 +555,7 @@ "lz-string": ["lz-string@1.5.0", "", { "bin": { "lz-string": "bin/bin.js" } }, "sha512-h5bgJWpxJNswbU7qCrV0tIKQCaS3blPDrqKWx+QxzuzL1zGUzij9XCWLrSLsJPu5t+eWA/ycetzYAO5IOMcWAQ=="], - "magic-string": ["magic-string@1.4.2", "", { "dependencies": { "@jridgewell/sourcemap-codec": "^1.6.0" } }, "sha512-vG+rjFRj1PqdIBozIxAGMjPlOhaVe+GXpbttY/iSK7rGcJRMlwNJO7dcUwmUqkymsFLJiNGI06t4D7Fr7yRC9g=="], + "magic-string": ["magic-string@1.4.3", "", { "dependencies": { "@jridgewell/sourcemap-codec": "^1.6.0" } }, "sha512-z12OxmaPGE0F4xlpGdjuAUckipLpQlTAuAmyGhNoD7ODpYUzvDfvtxUbjM/jwznyP178oju/KDdyi220wNJ0RQ=="], "markdown-table": ["markdown-table@3.0.4", "", {}, "sha512-wiYz4+JrLyb/DqW2hkFJxP7Vd7JuTDm77fvbM8VfEQdmSMqcImWeeRbHwZjBjIFki/VaMK2BhFi7oUUZeM5bqw=="], @@ -657,9 +657,9 @@ "object-assign": ["object-assign@4.1.1", "", {}, "sha512-rJgTQnkUnH1sFw8yT6VSU3zD3sWmu6sZhIseY8VX+GRu3P6F7Fu+JNDoXfklElbLJSnc3FUQHVe4cU5hj+BcUg=="], - "obug": ["obug@2.2.1", "", {}, "sha512-XrsrhT5sybtKI6wakr2SPOlGZWWYbUXZ7a0jT8/QOeAPau+1X/bSegNe5YR75oJmEZQbKningirmGOEJCIk61Q=="], + "obug": ["obug@3.0.0", "", {}, "sha512-5vvB5+W7ePv+p3uqxi+RcW1XAzLW0/hxt3/4X4Lc4qHudzOhmBiBwOY6DRob4WnanAEGvNcLjF+KNOufrUoEQw=="], - "oxc-parser": ["oxc-parser@0.150.0", "", { "dependencies": { "@oxc-project/types": "^0.150.0" }, "optionalDependencies": { "@oxc-parser/binding-android-arm-eabi": "0.150.0", "@oxc-parser/binding-android-arm64": "0.150.0", "@oxc-parser/binding-darwin-arm64": "0.150.0", "@oxc-parser/binding-darwin-x64": "0.150.0", "@oxc-parser/binding-freebsd-x64": "0.150.0", "@oxc-parser/binding-linux-arm-gnueabihf": "0.150.0", "@oxc-parser/binding-linux-arm-musleabihf": "0.150.0", "@oxc-parser/binding-linux-arm64-gnu": "0.150.0", "@oxc-parser/binding-linux-arm64-musl": "0.150.0", "@oxc-parser/binding-linux-ppc64-gnu": "0.150.0", "@oxc-parser/binding-linux-riscv64-gnu": "0.150.0", "@oxc-parser/binding-linux-riscv64-musl": "0.150.0", "@oxc-parser/binding-linux-s390x-gnu": "0.150.0", "@oxc-parser/binding-linux-x64-gnu": "0.150.0", "@oxc-parser/binding-linux-x64-musl": "0.150.0", "@oxc-parser/binding-openharmony-arm64": "0.150.0", "@oxc-parser/binding-win32-arm64-msvc": "0.150.0", "@oxc-parser/binding-win32-ia32-msvc": "0.150.0", "@oxc-parser/binding-win32-x64-msvc": "0.150.0" } }, "sha512-zwajKw1GUa57IOdafIS7/yOObGF2NihwIfZfs5yJTRprMSkiwhWOc/k+n8bwnUPbHr2/XsjfBO8KyTPaW3VpWg=="], + "oxc-parser": ["oxc-parser@0.153.0", "", { "dependencies": { "@oxc-project/types": "^0.153.0" }, "optionalDependencies": { "@oxc-parser/binding-android-arm-eabi": "0.153.0", "@oxc-parser/binding-android-arm64": "0.153.0", "@oxc-parser/binding-darwin-arm64": "0.153.0", "@oxc-parser/binding-darwin-x64": "0.153.0", "@oxc-parser/binding-freebsd-x64": "0.153.0", "@oxc-parser/binding-linux-arm-gnueabihf": "0.153.0", "@oxc-parser/binding-linux-arm-musleabihf": "0.153.0", "@oxc-parser/binding-linux-arm64-gnu": "0.153.0", "@oxc-parser/binding-linux-arm64-musl": "0.153.0", "@oxc-parser/binding-linux-ppc64-gnu": "0.153.0", "@oxc-parser/binding-linux-riscv64-gnu": "0.153.0", "@oxc-parser/binding-linux-riscv64-musl": "0.153.0", "@oxc-parser/binding-linux-s390x-gnu": "0.153.0", "@oxc-parser/binding-linux-x64-gnu": "0.153.0", "@oxc-parser/binding-linux-x64-musl": "0.153.0", "@oxc-parser/binding-openharmony-arm64": "0.153.0", "@oxc-parser/binding-win32-arm64-msvc": "0.153.0", "@oxc-parser/binding-win32-ia32-msvc": "0.153.0", "@oxc-parser/binding-win32-x64-msvc": "0.153.0" } }, "sha512-cEnpyyV1OJRXv++SFNw0z8i+2o/cr88rVLaOYJafELDoHM5yHvCAbwGRLvxuany6SNLcbblSMUyZaGzH+quSYg=="], "oxc-resolver": ["oxc-resolver@11.24.2", "", { "optionalDependencies": { "@oxc-resolver/binding-android-arm-eabi": "11.24.2", "@oxc-resolver/binding-android-arm64": "11.24.2", "@oxc-resolver/binding-darwin-arm64": "11.24.2", "@oxc-resolver/binding-darwin-x64": "11.24.2", "@oxc-resolver/binding-freebsd-x64": "11.24.2", "@oxc-resolver/binding-linux-arm-gnueabihf": "11.24.2", "@oxc-resolver/binding-linux-arm-musleabihf": "11.24.2", "@oxc-resolver/binding-linux-arm64-gnu": "11.24.2", "@oxc-resolver/binding-linux-arm64-musl": "11.24.2", "@oxc-resolver/binding-linux-ppc64-gnu": "11.24.2", "@oxc-resolver/binding-linux-riscv64-gnu": "11.24.2", "@oxc-resolver/binding-linux-riscv64-musl": "11.24.2", "@oxc-resolver/binding-linux-s390x-gnu": "11.24.2", "@oxc-resolver/binding-linux-x64-gnu": "11.24.2", "@oxc-resolver/binding-linux-x64-musl": "11.24.2", "@oxc-resolver/binding-openharmony-arm64": "11.24.2", "@oxc-resolver/binding-wasm32-wasi": "11.24.2", "@oxc-resolver/binding-win32-arm64-msvc": "11.24.2", "@oxc-resolver/binding-win32-x64-msvc": "11.24.2" } }, "sha512-FY91FiDBj7ls5MsFS9jN3tjz2o0/zsdSsymlakySaBwVJZorHhkWyICLZMKxlu1R9vYo+sd3z1jwb4J8x7bNDw=="], @@ -677,11 +677,11 @@ "pkce-challenge": ["pkce-challenge@5.0.1", "", {}, "sha512-wQ0b/W4Fr01qtpHlqSqspcj3EhBvimsdh0KlHhH8HRZnMsEa0ea2fTULOXOS9ccQr3om+GcGRk4e+isrZWV8qQ=="], - "playwright": ["playwright@1.63.0", "", { "dependencies": { "playwright-core": "1.63.0" }, "bin": { "playwright": "cli.js" } }, "sha512-+7ziBLidS4NaNCdt57SUDT+wYmmd5fmiQejUic/kb+YsYSCPyOOE9sebzMjNmQrsnNpDJqd4WHvV/8lfKfUDUg=="], + "playwright": ["playwright@1.64.0", "", { "dependencies": { "playwright-core": "1.64.0" }, "bin": { "playwright": "cli.js" } }, "sha512-kVzTnYFYEyQ9RGzBjNCd2+yEqWmVbxl3AHPynv3qQ6JTjv4a+kwRcnqQwIpuP3NnrnIrE/Q6wWAIAvMfIE2/Yg=="], - "playwright-core": ["playwright-core@1.63.0", "", { "bin": { "playwright-core": "cli.js" } }, "sha512-rYCsBF/M5HjUch52bbtVONEFjv6Xu8sm8h72dNlR5bzIE1fvC/bxgspzkjSfU+MweEMmPM8KJebG6nnyxo5mCg=="], + "playwright-core": ["playwright-core@1.64.0", "", { "bin": { "playwright-core": "cli.js" } }, "sha512-T9r+MZkTECl2+oUcZ26YgZzTrYidTsIhYYkJix+6iDOymOb1FB2RLLSOxRGnZGv5DStt+aduIVbt+E8WygXYpg=="], - "postcss": ["postcss@8.5.28", "", { "dependencies": { "nanoid": "^3.3.18", "picocolors": "^1.1.1", "source-map-js": "^1.2.1" } }, "sha512-RRuzqDtt5Y9h3quz5hWhK+TPnsmVs6WwSU6LkJMeY4HstUEDuYTG8UJSdawMRzmzAtV+KEoG8N3Qg2qLy5vM/A=="], + "postcss": ["postcss@8.5.30", "", { "dependencies": { "nanoid": "^3.3.20", "picocolors": "^1.1.1", "source-map-js": "^1.2.2" } }, "sha512-zkd+e9S1AQHhmaBKye9zlFHWjOwVgqXl1q3ECYy8561K7qxR2cREf/STLskulBFd78k6AOFeA+ff1TtEzk9bAA=="], "prettier": ["prettier@3.9.9", "", { "bin": { "prettier": "bin/prettier.cjs" } }, "sha512-Z/CJHIkdujO/OtN7nXUii0Rf3VT5SRuhjBA82Xvu2XhBUgX3nhP67T0LHceBdQLex7OOFGTox+Q5Yg8Jk2Qivg=="], @@ -763,7 +763,7 @@ "tagged-tag": ["tagged-tag@1.0.0", "", {}, "sha512-yEFYrVhod+hdNyx7g5Bnkkb0G6si8HJurOoOEgC8B/O0uXLHlaey/65KRv6cuWBNhBgHKAROVpc7QyYqE5gFng=="], - "tinybench": ["tinybench@6.2.0", "", {}, "sha512-78U2TlB2CnVenajOFzf3BKSm0J6oz5L0NV7g32LCPccvYc0lbWvys4d3uUUCS2B1N8PAf2+aekR8i1KbC3HO7Q=="], + "tinybench": ["tinybench@6.2.2", "", {}, "sha512-nIZ2N2dFpjBsg2hgitKu7mA+FvsIJuGJOwysRngmVRRmWgR/UyPjwJj8c/fT/dhm8EkHnF5EOogRf+0Z2qrimA=="], "tinyexec": ["tinyexec@1.3.1", "", {}, "sha512-GCvB3aoys96IuDFBMcTB46JOR6mdMtAToqwiW8JlWhsoh1mhHi/xn9ss/Dg7N555GiJyEt2qzoG/NHCwM6h1EA=="], @@ -781,7 +781,7 @@ "typescript": ["typescript@7.0.2", "", { "optionalDependencies": { "@typescript/typescript-aix-ppc64": "7.0.2", "@typescript/typescript-darwin-arm64": "7.0.2", "@typescript/typescript-darwin-x64": "7.0.2", "@typescript/typescript-freebsd-arm64": "7.0.2", "@typescript/typescript-freebsd-x64": "7.0.2", "@typescript/typescript-linux-arm": "7.0.2", "@typescript/typescript-linux-arm64": "7.0.2", "@typescript/typescript-linux-loong64": "7.0.2", "@typescript/typescript-linux-mips64el": "7.0.2", "@typescript/typescript-linux-ppc64": "7.0.2", "@typescript/typescript-linux-riscv64": "7.0.2", "@typescript/typescript-linux-s390x": "7.0.2", "@typescript/typescript-linux-x64": "7.0.2", "@typescript/typescript-netbsd-arm64": "7.0.2", "@typescript/typescript-netbsd-x64": "7.0.2", "@typescript/typescript-openbsd-arm64": "7.0.2", "@typescript/typescript-openbsd-x64": "7.0.2", "@typescript/typescript-sunos-x64": "7.0.2", "@typescript/typescript-win32-arm64": "7.0.2", "@typescript/typescript-win32-x64": "7.0.2" }, "bin": { "tsc": "bin/tsc" } }, "sha512-8FYau96o3NKOhbjKi/qNvG/W5jhzxkbdm5sj9AbZ/5T5sWqn3hJgLfGx27sRKZWTvyzCP8dLRBTf5tBTSRVUNA=="], - "unbash": ["unbash@4.0.12", "", {}, "sha512-PnKvRX+Fbxl/usVlTr/31tXIOVAH+8OdC9qaxUQcvurwEnoc3Vk/ipi2Ce8IjMxzK9byfSGdsUBjqqJGc1o5lw=="], + "unbash": ["unbash@5.1.0", "", {}, "sha512-YVGyy4XqoZ2AVgHjVdL9cchMSurlXFHWviORa8RiU/Bnol4ooW5Lpyur/5XmbgDdyCKxymmgsEQsLGBMIJ/Agg=="], "undici-types": ["undici-types@8.9.0", "", {}, "sha512-KTDyRTYX8sWmKXAikPHHSyc63CRPETMctyjKFupcC6OBLXT3xsN0e9aF7m+mIXutFWpUXuedtowG7iLOzp0kQg=="], @@ -809,17 +809,17 @@ "use-sync-external-store": ["use-sync-external-store@1.7.0", "", { "peerDependencies": { "react": "^16.8.0 || ^17.0.0 || ^18.0.0 || ^19.0.0" } }, "sha512-6L+EeigHMQhdaIPNIFUKwfWJSwWFQ8gJbJ2DLOs5sDIegTwR9fRxvnM3uciHKjIZhFz+KAv2emhWMRvDmMcY8A=="], - "uuid": ["uuid@14.0.2", "", { "bin": { "uuid": "dist-node/bin/uuid" } }, "sha512-xZe/16rV4aa+HGSOCiY2YeLT1OybRLrrkL/Rqaq7p7GMVXjFh+6wN4oMYgjFmnSnhY8t6Xpdl2l9qmnHYuMHwQ=="], + "uuid": ["uuid@14.0.3", "", { "bin": { "uuid": "dist-node/bin/uuid" } }, "sha512-Sc5u1VVln93y1Xnz4R+CunOZc7R9LUcTmhj7Rc7Eg3HVcf7rVn2FOoa812fe0W8p3jD7xeoGSYbfqCGGH2B6xw=="], "vfile": ["vfile@6.0.3", "", { "dependencies": { "@types/unist": "^3.0.0", "vfile-message": "^4.0.0" } }, "sha512-KzIbH/9tXat2u30jf+smMwFCsno4wHVdNmzFyL+T/L3UGqqk6JKfVqOFOZEpZSHADH1k40ab6NUIXZq422ov3Q=="], "vfile-message": ["vfile-message@4.0.3", "", { "dependencies": { "@types/unist": "^3.0.0", "unist-util-stringify-position": "^4.0.0" } }, "sha512-QTHzsGd1EhbZs4AsQ20JX1rC3cOlt/IWJruk893DfLRr57lcnOeMaWG4K0JrRta4mIJZKth2Au3mM3u03/JWKw=="], - "vite": ["vite@8.3.3", "", { "dependencies": { "lightningcss": "^1.33.0", "picomatch": "^4.0.7", "postcss": "^8.5.28", "rolldown": "~1.2.11", "tinyglobby": "^0.2.17" }, "optionalDependencies": { "fsevents": "~2.3.3" }, "peerDependencies": { "@types/node": "^20.19.0 || >=22.12.0", "@vitejs/devtools": "^0.7.1", "esbuild": "^0.27.0 || ^0.28.0", "jiti": ">=1.21.0", "less": "^4.0.0", "sass": "^1.70.0", "sass-embedded": "^1.70.0", "stylus": ">=0.54.8", "sugarss": "^5.0.0", "terser": "^5.16.0", "tsx": "^4.8.1", "yaml": "^2.4.2" }, "optionalPeers": ["@types/node", "@vitejs/devtools", "esbuild", "jiti", "less", "sass", "sass-embedded", "stylus", "sugarss", "terser", "tsx", "yaml"], "bin": { "vite": "bin/vite.js" } }, "sha512-cTAldKPImjg6c+gk48U19POPn3GCBzZwpdsN8ZMEEcbpes+6/wvfqUd0C2y3qYY4wsj8PwgFwrZ/1jBPVttMSg=="], + "vite": ["vite@8.3.4", "", { "dependencies": { "lightningcss": "^1.33.0", "picomatch": "^4.0.7", "postcss": "^8.5.29", "rolldown": "~1.2.12", "tinyglobby": "^0.2.17" }, "optionalDependencies": { "fsevents": "~2.3.3" }, "peerDependencies": { "@types/node": "^20.19.0 || >=22.12.0", "@vitejs/devtools": "^0.7.1", "esbuild": "^0.27.0 || ^0.28.0", "jiti": ">=1.21.0", "less": "^4.0.0", "sass": "^1.70.0", "sass-embedded": "^1.70.0", "stylus": ">=0.54.8", "sugarss": "^5.0.0", "terser": "^5.16.0", "tsx": "^4.8.1", "yaml": "^2.4.2" }, "optionalPeers": ["@types/node", "@vitejs/devtools", "esbuild", "jiti", "less", "sass", "sass-embedded", "stylus", "sugarss", "terser", "tsx", "yaml"], "bin": { "vite": "bin/vite.js" } }, "sha512-IftLE8phJhdNRIGNEV4JCCvfNScoZQVfcXaN8TQropWGJtOHcu+iAB9pHcuGvmEb/kddw0LBe/jS8ztdC6xdiQ=="], "vite-plugin-singlefile": ["vite-plugin-singlefile@2.3.3", "", { "dependencies": { "micromatch": "^4.0.8" }, "peerDependencies": { "rollup": "^4.59.0", "vite": "^5.4.21 || ^6.0.0 || ^7.0.0 || ^8.0.0" }, "optionalPeers": ["rollup"] }, "sha512-XVnGH0QzbOa8fxRSsHdCarVN1BSBXNi7uLMQYlrGRN5apdHkk62XQWRJhVever0lnfuyBkwn+kvVChdm/OoOUg=="], - "vitest": ["vitest@5.0.3", "", { "dependencies": { "@types/chai": "^5.2.2", "@vitest/mocker": "5.0.3", "chai": "^6.2.2", "es-module-lexer": "^2.3.2", "expect-type": "^1.4.0", "magic-string": "^1.2.3", "obug": "^2.1.4", "picomatch": "^4.0.7", "std-env": "^4.2.0", "tinybench": "^6.1.4", "tinyexec": "^1.3.0", "tinyglobby": "^0.2.17", "why-is-node-running": "3.2.1" }, "peerDependencies": { "@edge-runtime/vm": "*", "@opentelemetry/api": "^1.9.0", "@types/node": "^22.0.0 || >=24.0.0", "@vitest/browser-playwright": "5.0.3", "@vitest/browser-preview": "5.0.3", "@vitest/browser-webdriverio": "^5.0.0-beta.5 || >=5.0.0", "@vitest/coverage-istanbul": "5.0.3", "@vitest/coverage-v8": "5.0.3", "@vitest/ui": "5.0.3", "happy-dom": "*", "jsdom": "*", "vite": "^6.4.0 || ^7.0.0 || ^8.0.0" }, "optionalPeers": ["@edge-runtime/vm", "@opentelemetry/api", "@types/node", "@vitest/browser-playwright", "@vitest/browser-preview", "@vitest/browser-webdriverio", "@vitest/coverage-istanbul", "@vitest/coverage-v8", "@vitest/ui", "happy-dom", "jsdom"], "bin": { "vitest": "./vitest.mjs" } }, "sha512-xMw97S3rjdtj5dkVat7jCsqWBpvchs3RlpQctUqwJD0KkERk40vz2fJ77lDwW/Vzh/pk18eItYAzkodhSes3jQ=="], + "vitest": ["vitest@5.0.4", "", { "dependencies": { "@types/chai": "^5.2.2", "@vitest/mocker": "5.0.4", "chai": "^6.3.0", "es-module-lexer": "^2.3.2", "expect-type": "^1.4.0", "magic-string": "^1.4.3", "obug": "^3.0.0", "picomatch": "^4.0.7", "std-env": "^4.3.0", "tinybench": "^6.2.2", "tinyexec": "^1.3.1", "tinyglobby": "^0.2.17", "why-is-node-running": "3.2.1" }, "peerDependencies": { "@edge-runtime/vm": "*", "@opentelemetry/api": "^1.9.0", "@types/node": "^22.0.0 || >=24.0.0", "@vitest/browser-playwright": "5.0.4", "@vitest/browser-preview": "5.0.4", "@vitest/browser-webdriverio": "^5.0.0-beta.5 || >=5.0.0", "@vitest/coverage-istanbul": "5.0.4", "@vitest/coverage-v8": "5.0.4", "@vitest/ui": "5.0.4", "happy-dom": "*", "jsdom": "*", "vite": "^6.4.0 || ^7.0.0 || ^8.0.0" }, "optionalPeers": ["@edge-runtime/vm", "@opentelemetry/api", "@types/node", "@vitest/browser-playwright", "@vitest/browser-preview", "@vitest/browser-webdriverio", "@vitest/coverage-istanbul", "@vitest/coverage-v8", "@vitest/ui", "happy-dom", "jsdom"], "bin": { "vitest": "./vitest.mjs" } }, "sha512-z0WxZRV2Sg48wF0FSgMq3TFG8JS38/Qr96vZVZdX6+Em9raQTvnXQvdTFJe2m3rfyJnEHeHQ/snceIdi8D1pVg=="], "walk-up-path": ["walk-up-path@4.0.0", "", {}, "sha512-3hu+tD8YzSLGuFYtPRb48vdhKMi0KQV5sn+uWr8+7dMEq/2G/dtLrdDinkLjqq5TIbIBjYJ4Ax/n3YiaW7QM8A=="], @@ -849,6 +849,8 @@ "@ag-ui/proto/zod": ["zod@3.25.76", "", {}, "sha512-gzUt/qt81nXsFGKIFcC3YnfEAx5NkunCfnDlvuBSSFS02bcXu4Lmea0AFIUwbLWxWPx3d9p8S5QoaujKcNQxcQ=="], + "@axe-core/playwright/axe-core": ["axe-core@4.13.0", "", {}, "sha512-UzGt8zg7Ny8djbYMhxl2zuEevVa7r2gJjYY5Lwr1xM7+XU2nd6CkIWFTVcCIbAP63vSz71NaVyyuSk9lHKcy0A=="], + "@emnapi/core/tslib": ["tslib@2.8.1", "", {}, "sha512-oJFu94HQb+KVduSUQL7wnpmqnfmLsOA/nAh6b6EH0wCEoK0/mPeXU6c3wKDV83MkOuHPRHtSXKKU99IBazS/2w=="], "@emnapi/runtime/tslib": ["tslib@2.8.1", "", {}, "sha512-oJFu94HQb+KVduSUQL7wnpmqnfmLsOA/nAh6b6EH0wCEoK0/mPeXU6c3wKDV83MkOuHPRHtSXKKU99IBazS/2w=="], diff --git a/ui/host/package.json b/ui/host/package.json index 6ab0fe65f..69e92bbde 100644 --- a/ui/host/package.json +++ b/ui/host/package.json @@ -20,37 +20,37 @@ "@dagrejs/dagre": "3.1.1", "@fontsource-variable/geist": "5.3.0", "@fontsource-variable/geist-mono": "5.3.0", - "@mantine/core": "9.7.1", - "@mantine/hooks": "9.7.1", + "@mantine/core": "9.7.2", + "@mantine/hooks": "9.7.2", "@modelcontextprotocol/client": "2.3.1", "@modelcontextprotocol/ext-apps": "2.0.3", "@phosphor-icons/react": "2.1.10", - "@tanstack/react-query": "5.104.1", - "@tanstack/react-router": "1.170.41", - "@tanstack/react-table": "9.2.6", + "@tanstack/react-query": "5.104.2", + "@tanstack/react-router": "1.170.44", + "@tanstack/react-table": "9.3.1", "echarts": "6.1.0", "react": "19.3.0", "react-dom": "19.3.0", "react-grid-layout": "2.3.0", "react-markdown": "10.1.0", "remark-gfm": "4.0.1", - "uuid": "14.0.2" + "uuid": "14.0.3" }, "devDependencies": { "@axe-core/playwright": "4.13.0", - "@playwright/test": "1.63.0", - "@tanstack/router-plugin": "1.168.42", + "@playwright/test": "1.64.0", + "@tanstack/router-plugin": "1.168.45", "@testing-library/dom": "10.4.2", "@types/react": "19.3.0", "@types/react-dom": "19.3.0", "@vitejs/plugin-react": "6.1.2", - "axe-core": "4.13.0", + "axe-core": "4.14.0", "happy-dom": "20.14.5", - "knip": "6.40.0", + "knip": "6.41.0", "typescript": "7.0.2", - "vite": "8.3.3", + "vite": "8.3.4", "vite-plugin-singlefile": "2.3.3", - "vitest": "5.0.3" + "vitest": "5.0.4" }, "overrides": { "@hono/node-server": "1.19.15", From ac1add8165e3feeccd384e28539ba8215ad1f1f9 Mon Sep 17 00:00:00 2001 From: Vishal Rana Date: Fri, 16 Oct 2026 23:08:34 -0700 Subject: [PATCH 2/3] chore(deps): rebuild embedded UI and notices for the host group bump Claude-Session: https://claude.ai/code/session_018HfyEXHyGD1utmKF4CQtyQ --- THIRD_PARTY_NOTICES | 60 ++++---- internal/mcp/apps/panels.html | 124 ++++++++-------- internal/ui/dist/assets/Tooltip-B3r3s_B9.js | 1 + internal/ui/dist/assets/Tooltip-DhnGSmh7.js | 1 - .../dist/assets/WarningCircle.es-CQHtdoVp.js | 1 - .../dist/assets/WarningCircle.es-DMCNfIHa.js | 1 + internal/ui/dist/assets/auth-C8kS8ur3.js | 1 - .../{brand-Bcp2Tp5I.js => brand-DUaZkIz1.js} | 2 +- .../{chat-_owdy9Bf.js => chat-CAy267fh.js} | 4 +- .../ui/dist/assets/chat._threadId-CybsW_0R.js | 1 + .../ui/dist/assets/chat._threadId-eVfsC4Jb.js | 1 - .../ui/dist/assets/chat.index-CybsW_0R.js | 1 + .../ui/dist/assets/chat.index-eVfsC4Jb.js | 1 - ....js => dashboard-change-chips-BKnD9tpX.js} | 2 +- .../dashboards._dashboardId-09220iIf.js | 1 - .../dashboards._dashboardId-CGcM78tU.js | 1 + .../dist/assets/dashboards.index-BGm8G1FV.js | 1 + .../dist/assets/dashboards.index-mQSdDlyY.js | 1 - internal/ui/dist/assets/index-CNsdEvGl.js | 97 ------------- internal/ui/dist/assets/index-D1TEoZWj.js | 136 ++++++++++++++++++ .../ui/dist/assets/mcp-app-frame-XtROHu70.js | 57 ++++++++ .../ui/dist/assets/mcp-app-frame-tweTxib0.js | 57 -------- .../{page-vAmZFsvk.js => page-BaMlOBRS.js} | 16 +-- .../ui/dist/assets/preload-helper-DpsUT6aH.js | 1 - .../ui/dist/assets/preload-helper-FMCtZeYw.js | 2 + ...tings-BnFwabAq.js => settings-TyOL6EZs.js} | 4 +- internal/ui/dist/assets/theme-DdznftKI.js | 1 - .../use-computed-color-scheme-BIja2o3c.js | 1 - internal/ui/dist/assets/useQuery-CEXOTfck.js | 41 ------ internal/ui/dist/index.html | 12 +- 30 files changed, 311 insertions(+), 319 deletions(-) create mode 100644 internal/ui/dist/assets/Tooltip-B3r3s_B9.js delete mode 100644 internal/ui/dist/assets/Tooltip-DhnGSmh7.js delete mode 100644 internal/ui/dist/assets/WarningCircle.es-CQHtdoVp.js create mode 100644 internal/ui/dist/assets/WarningCircle.es-DMCNfIHa.js delete mode 100644 internal/ui/dist/assets/auth-C8kS8ur3.js rename internal/ui/dist/assets/{brand-Bcp2Tp5I.js => brand-DUaZkIz1.js} (54%) rename internal/ui/dist/assets/{chat-_owdy9Bf.js => chat-CAy267fh.js} (57%) create mode 100644 internal/ui/dist/assets/chat._threadId-CybsW_0R.js delete mode 100644 internal/ui/dist/assets/chat._threadId-eVfsC4Jb.js create mode 100644 internal/ui/dist/assets/chat.index-CybsW_0R.js delete mode 100644 internal/ui/dist/assets/chat.index-eVfsC4Jb.js rename internal/ui/dist/assets/{dashboard-change-chips-C08J6wNb.js => dashboard-change-chips-BKnD9tpX.js} (99%) delete mode 100644 internal/ui/dist/assets/dashboards._dashboardId-09220iIf.js create mode 100644 internal/ui/dist/assets/dashboards._dashboardId-CGcM78tU.js create mode 100644 internal/ui/dist/assets/dashboards.index-BGm8G1FV.js delete mode 100644 internal/ui/dist/assets/dashboards.index-mQSdDlyY.js delete mode 100644 internal/ui/dist/assets/index-CNsdEvGl.js create mode 100644 internal/ui/dist/assets/index-D1TEoZWj.js create mode 100644 internal/ui/dist/assets/mcp-app-frame-XtROHu70.js delete mode 100644 internal/ui/dist/assets/mcp-app-frame-tweTxib0.js rename internal/ui/dist/assets/{page-vAmZFsvk.js => page-BaMlOBRS.js} (51%) delete mode 100644 internal/ui/dist/assets/preload-helper-DpsUT6aH.js create mode 100644 internal/ui/dist/assets/preload-helper-FMCtZeYw.js rename internal/ui/dist/assets/{settings-BnFwabAq.js => settings-TyOL6EZs.js} (56%) delete mode 100644 internal/ui/dist/assets/theme-DdznftKI.js delete mode 100644 internal/ui/dist/assets/use-computed-color-scheme-BIja2o3c.js delete mode 100644 internal/ui/dist/assets/useQuery-CEXOTfck.js diff --git a/THIRD_PARTY_NOTICES b/THIRD_PARTY_NOTICES index a1ede0aea..dfeef3836 100644 --- a/THIRD_PARTY_NOTICES +++ b/THIRD_PARTY_NOTICES @@ -88,24 +88,24 @@ COMPONENT INVENTORY - npm: @floating-ui/utils 0.2.12 (declared license: MIT) - npm: @fontsource-variable/geist 5.3.0 (declared license: OFL-1.1) - npm: @fontsource-variable/geist-mono 5.3.0 (declared license: OFL-1.1) -- npm: @mantine/core 9.7.1 (declared license: MIT) -- npm: @mantine/hooks 9.7.1 (declared license: MIT) +- npm: @mantine/core 9.7.2 (declared license: MIT) +- npm: @mantine/hooks 9.7.2 (declared license: MIT) - npm: @modelcontextprotocol/client 2.3.1 (declared license: Apache-2.0) - npm: @modelcontextprotocol/core 2.3.1 (declared license: Apache-2.0) - npm: @modelcontextprotocol/ext-apps 2.0.3 (declared license: MIT) -- npm: @oxc-project/types 0.150.0 (declared license: MIT) +- npm: @oxc-project/types 0.153.0 (declared license: MIT) - npm: @phosphor-icons/react 2.1.10 (declared license: MIT) - npm: @protobuf-ts/protoc 2.11.1 (declared license: Apache-2.0) - npm: @standard-schema/spec 1.1.0 (declared license: MIT) -- npm: @tanstack/history 1.162.4 (declared license: MIT) -- npm: @tanstack/query-core 5.104.1 (declared license: MIT) -- npm: @tanstack/react-query 5.104.1 (declared license: MIT) -- npm: @tanstack/react-router 1.170.41 (declared license: MIT) +- npm: @tanstack/history 1.162.5 (declared license: MIT) +- npm: @tanstack/query-core 5.104.2 (declared license: MIT) +- npm: @tanstack/react-query 5.104.2 (declared license: MIT) +- npm: @tanstack/react-router 1.170.44 (declared license: MIT) - npm: @tanstack/react-store 0.11.2 (declared license: MIT) -- npm: @tanstack/react-table 9.2.6 (declared license: MIT) -- npm: @tanstack/router-core 1.171.34 (declared license: MIT) +- npm: @tanstack/react-table 9.3.1 (declared license: MIT) +- npm: @tanstack/router-core 1.171.37 (declared license: MIT) - npm: @tanstack/store 0.11.2 (declared license: MIT) -- npm: @tanstack/table-core 9.2.6 (declared license: MIT) +- npm: @tanstack/table-core 9.3.1 (declared license: MIT) - npm: @types/debug 4.1.13 (declared license: MIT) - npm: @types/estree 1.0.9 (declared license: MIT) - npm: @types/estree-jsx 1.0.5 (declared license: MIT) @@ -144,7 +144,7 @@ COMPONENT INVENTORY - npm: fast-json-patch 3.1.1 (declared license: MIT) - npm: fd-package-json 2.0.0 (declared license: MIT) - npm: fdir 6.5.0 (declared license: MIT) -- npm: formatly 0.7.1 (declared license: MIT) +- npm: formatly 0.11.4 (declared license: MIT) - npm: get-nonce 1.0.1 (declared license: MIT) - npm: get-tsconfig 4.14.3 (declared license: MIT) - npm: hast-util-to-jsx-runtime 2.3.6 (declared license: MIT) @@ -161,7 +161,7 @@ COMPONENT INVENTORY - npm: jiti 2.7.0 (declared license: MIT) - npm: jose 6.2.12 (declared license: MIT) - npm: js-tokens 4.0.0 (declared license: MIT) -- npm: knip 6.40.0 (declared license: ISC) +- npm: knip 6.41.0 (declared license: ISC) - npm: longest-streak 3.1.0 (declared license: MIT) - npm: loose-envify 1.4.0 (declared license: MIT) - npm: markdown-table 3.0.4 (declared license: MIT) @@ -211,7 +211,7 @@ COMPONENT INVENTORY - npm: micromark-util-types 2.0.3 (declared license: MIT) - npm: ms 2.1.3 (declared license: MIT) - npm: object-assign 4.1.1 (declared license: MIT) -- npm: oxc-parser 0.150.0 (declared license: MIT) +- npm: oxc-parser 0.153.0 (declared license: MIT) - npm: oxc-resolver 11.24.2 (declared license: MIT) - npm: package-manager-detector 1.9.0 (declared license: MIT) - npm: parse-entities 4.0.2 (declared license: MIT) @@ -257,7 +257,7 @@ COMPONENT INVENTORY - npm: tslib 2.3.0 (declared license: 0BSD) - npm: tslib 2.8.1 (declared license: 0BSD) - npm: type-fest 5.10.0 (declared license: (MIT OR CC0-1.0)) -- npm: unbash 4.0.12 (declared license: ISC) +- npm: unbash 5.1.0 (declared license: ISC) - npm: unified 11.0.5 (declared license: MIT) - npm: unist-util-is 6.0.1 (declared license: MIT) - npm: unist-util-position 5.0.0 (declared license: MIT) @@ -269,7 +269,7 @@ COMPONENT INVENTORY - npm: use-sidecar 1.1.3 (declared license: MIT) - npm: use-sync-external-store 1.7.0 (declared license: MIT) - npm: uuid 11.1.1 (declared license: MIT) -- npm: uuid 14.0.2 (declared license: MIT) +- npm: uuid 14.0.3 (declared license: MIT) - npm: vfile 6.0.3 (declared license: MIT) - npm: vfile-message 4.0.3 (declared license: MIT) - npm: walk-up-path 4.0.0 (declared license: ISC) @@ -7556,8 +7556,8 @@ FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM OTHER DEALINGS IN THE FONT SOFTWARE. --- Applies to ------------------------------------------------------------- -- npm: @mantine/core 9.7.1 / LICENSE -- npm: @mantine/hooks 9.7.1 / LICENSE +- npm: @mantine/core 9.7.2 / LICENSE +- npm: @mantine/hooks 9.7.2 / LICENSE ---------------------------------------------------------------------------- MIT License @@ -7806,8 +7806,8 @@ CC-BY-4.0. See https://creativecommons.org/licenses/by/4.0/legalcode for the full license text. --- Applies to ------------------------------------------------------------- -- npm: @oxc-project/types 0.150.0 / LICENSE -- npm: oxc-parser 0.150.0 / LICENSE +- npm: @oxc-project/types 0.153.0 / LICENSE +- npm: oxc-parser 0.153.0 / LICENSE - npm: oxc-resolver 11.24.2 / LICENSE ---------------------------------------------------------------------------- @@ -7887,11 +7887,11 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. --- Applies to ------------------------------------------------------------- -- npm: @tanstack/history 1.162.4 / LICENSE -- npm: @tanstack/query-core 5.104.1 / LICENSE -- npm: @tanstack/react-query 5.104.1 / LICENSE -- npm: @tanstack/react-router 1.170.41 / LICENSE -- npm: @tanstack/router-core 1.171.34 / LICENSE +- npm: @tanstack/history 1.162.5 / LICENSE +- npm: @tanstack/query-core 5.104.2 / LICENSE +- npm: @tanstack/react-query 5.104.2 / LICENSE +- npm: @tanstack/react-router 1.170.44 / LICENSE +- npm: @tanstack/router-core 1.171.37 / LICENSE ---------------------------------------------------------------------------- MIT License @@ -7944,8 +7944,8 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. --- Applies to ------------------------------------------------------------- -- npm: @tanstack/react-table 9.2.6 / LICENSE -- npm: @tanstack/table-core 9.2.6 / LICENSE +- npm: @tanstack/react-table 9.3.1 / LICENSE +- npm: @tanstack/table-core 9.3.1 / LICENSE ---------------------------------------------------------------------------- MIT License @@ -8848,7 +8848,7 @@ The above copyright notice and this permission notice shall be included in all c THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. --- Applies to ------------------------------------------------------------- -- npm: formatly 0.7.1 / LICENSE.md +- npm: formatly 0.11.4 / LICENSE.md ---------------------------------------------------------------------------- # MIT License @@ -9096,7 +9096,7 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. --- Applies to ------------------------------------------------------------- -- npm: knip 6.40.0 / LICENSE +- npm: knip 6.41.0 / LICENSE ---------------------------------------------------------------------------- ISC License (ISC) @@ -10256,7 +10256,7 @@ express Statement of Purpose. this CC0 or use of the Work. --- Applies to ------------------------------------------------------------- -- npm: unbash 4.0.12 / LICENSE +- npm: unbash 5.1.0 / LICENSE ---------------------------------------------------------------------------- ISC License @@ -10357,7 +10357,7 @@ SOFTWARE. --- Applies to ------------------------------------------------------------- - npm: uuid 11.1.1 / LICENSE.md -- npm: uuid 14.0.2 / LICENSE.md +- npm: uuid 14.0.3 / LICENSE.md ---------------------------------------------------------------------------- The MIT License (MIT) diff --git a/internal/mcp/apps/panels.html b/internal/mcp/apps/panels.html index d73d396a7..5676c0226 100644 --- a/internal/mcp/apps/panels.html +++ b/internal/mcp/apps/panels.html @@ -1,18 +1,18 @@ -Fanout panels +- "app": Tool callable by the app from this server only`),csp:f6().optional(),permissions:f6().optional()}),Q({mimeTypes:Z(Y()).optional().describe('Array of supported MIME types for UI resources.\nMust include `"text/html;profile=mcp-app"` for MCP Apps support.')}),Q({method:$(`ui/download-file`),params:Q({contents:Z(g6([h5,g5])).describe(`Resource contents to download — embedded (inline data) or linked (host fetches). Uses standard MCP resource types.`)})}),Q({method:$(`ui/message`),params:Q({role:$(`user`).describe(`Message role, currently only "user" is supported.`),content:Z(_5).describe(`Message content blocks (text, image, etc.).`)})}),Q({method:$(`ui/notifications/sandbox-resource-ready`),params:Q({html:Y().describe(`HTML content to load into the inner iframe.`),sandbox:Y().optional().describe(`Optional override for the inner iframe's sandbox attribute.`),csp:q9.optional().describe(`CSP configuration from resource metadata.`),permissions:J9.optional().describe(`Sandbox permissions from resource metadata.`)})});var XPe=Q({method:$(`ui/notifications/tool-result`),params:E5.describe(`Standard MCP tool execution result.`)}),X9=Q({toolInfo:Q({id:$6.optional().describe(`JSON-RPC id of the tools/call request.`),tool:C5.describe(`Tool definition including name, inputSchema, etc.`)}).optional().describe(`Metadata of the tool call that instantiated this App.`),theme:PPe.optional().describe(`Current color theme preference.`),styles:UPe.optional().describe(`Style configuration for theming the app.`),displayMode:K9.optional().describe(`How the UI is currently displayed.`),availableDisplayModes:Z(K9).optional().describe(`Display modes the host supports.`),containerDimensions:g6([Q({height:X().describe(`Fixed container height in pixels.`)}),Q({maxHeight:g6([X(),c6()]).optional().describe(`Maximum container height in pixels.`)})]).and(g6([Q({width:X().describe(`Fixed container width in pixels.`)}),Q({maxWidth:g6([X(),c6()]).optional().describe(`Maximum container width in pixels.`)})])).optional().describe(`Container dimensions. Represents the dimensions of the iframe or other +container holding the app. Specify either width or maxWidth, and either height or maxHeight.`),locale:Y().optional().describe(`User's language and region preference in BCP 47 format.`),timeZone:Y().optional().describe(`User's timezone in IANA format.`),userAgent:Y().optional().describe(`Host application identifier.`),platform:g6([$(`web`),$(`desktop`),$(`mobile`)]).optional().describe(`Platform type for responsive design decisions.`),deviceCapabilities:Q({touch:s6().optional().describe(`Whether the device supports touch input.`),hover:s6().optional().describe(`Whether the device supports hover interactions.`)}).optional().describe(`Device input capabilities.`),safeAreaInsets:Q({top:X().describe(`Top safe area inset in pixels.`),right:X().describe(`Right safe area inset in pixels.`),bottom:X().describe(`Bottom safe area inset in pixels.`),left:X().describe(`Left safe area inset in pixels.`)}).optional().describe(`Mobile safe area boundaries in pixels.`)}).passthrough(),Z9=Q({method:$(`ui/notifications/host-context-changed`),params:X9.describe(`Partial context update containing only changed fields.`)});Q({method:$(`ui/update-model-context`),params:Q({content:Z(_5).optional().describe(`Context content blocks (text, image, etc.).`),structuredContent:b6(Y(),d6().describe(`Structured content for machine-readable context data.`)).optional().describe(`Structured content for machine-readable context data.`)})}),Q({method:$(`ui/initialize`),params:Q({appInfo:d8.describe(`App identification (name and version).`),appCapabilities:qPe.describe(`Features and capabilities this app provides.`),protocolVersion:Y().describe(`Protocol version this app supports.`)})});var ZPe=Q({protocolVersion:Y().describe(`Negotiated protocol version string (e.g., "2025-11-21").`),hostInfo:d8.describe(`Host application identification and version.`),hostCapabilities:KPe.describe(`Features and capabilities provided by the host.`),hostContext:X9.describe(`Rich context about the host environment.`)}).passthrough(),QPe={target:`draft-2020-12`};async function Q9(e,t){let n=e[`~standard`];if(n.jsonSchema)return n.jsonSchema[t](QPe);throw Error(`Schema (vendor: ${n.vendor}) does not implement Standard JSON Schema (~standard.jsonSchema). Use a library that does (zod v4, ArkType, Valibot) or wrap your schema accordingly.`)}async function $9(e,t,n=``){let r=await e[`~standard`].validate(t);if(r.issues){let e=r.issues.map(e=>{let t=e.path?.map(e=>typeof e==`object`?e.key:e).join(`.`);return t?`${t}: ${e.message}`:e.message}).join(`; `);throw Error(n+e)}return r.value}function $Pe(e,t){let n={...e,...t};return t.experimental!==void 0&&(n.experimental={...e.experimental,...t.experimental}),t.tools!==void 0&&(n.tools={...e.tools,...t.tools}),n}var eFe=class e extends hPe{_appInfo;_appCapabilities;options;_hostCapabilities;_hostInfo;_hostContext;_registeredTools={};_initializedSent=!1;_registeredEvents=new Set;_events=new APe;_methods=new jPe;setRequestHandler=(...e)=>{let[t,...n]=W9(`request`,e)??e;this._methods.claim(t,`setRequestHandler`),super.setRequestHandler.call(this,t,...n)};setNotificationHandler=(...e)=>{let[t,...n]=W9(`notification`,e)??e;this._methods.claim(t,`setNotificationHandler`),super.setNotificationHandler.call(this,t,...n)};removeRequestHandler=e=>{this._methods.release(e),super.removeRequestHandler(e)};removeNotificationHandler=e=>{this._methods.release(e),super.removeNotificationHandler(e)};replaceRequestHandler=(e,...t)=>{this._methods.replace(e),super.setRequestHandler.call(this,e,...t)};_assertInitialized(e){if(this._initializedSent)return;let t=`[ext-apps] App.${e}() called before connect() completed the ui/initialize handshake. Await app.connect() before calling this method, or move data loading to an ontoolresult handler.`;if(this.options?.strict)throw Error(t);console.warn(`${t}. This will throw in a future release.`)}eventSchemas={toolinput:zPe,toolinputpartial:BPe,toolresult:XPe,toolcancelled:VPe,hostcontextchanged:Z9};static ONE_SHOT_EVENTS=new Set([`toolinput`,`toolinputpartial`,`toolresult`,`toolcancelled`]);_everHadListener=new Set;_assertHandlerTiming(t){if(!e.ONE_SHOT_EVENTS.has(t)||this._everHadListener.has(t)||(this._everHadListener.add(t),!this._initializedSent))return;let n=`[ext-apps] "${String(t)}" handler registered after connect() completed the ui/initialize handshake. The host may have already sent this notification. Register handlers before calling app.connect().`;if(this.options?.strict)throw Error(n);console.warn(n)}setEventHandler(e,t){t&&this._assertHandlerTiming(e),this._ensureEventSlot(e),this._events.setHandler(e,t)}addEventListener(e,t){this._assertHandlerTiming(e),this._ensureEventSlot(e),this._events.addEventListener(e,t)}removeEventListener(e,t){this._events.removeEventListener(e,t)}_ensureEventSlot(e){if(this._registeredEvents.has(e))return;let t=this.eventSchemas[e];if(!t)throw Error(`Unknown event: ${String(e)}`);this.setNotificationHandler(t.shape.method.value,{params:t.shape.params},t=>{let n=t;e===`hostcontextchanged`&&(this._hostContext={...this._hostContext,...n}),this._events.dispatch(e,n)}),this._registeredEvents.add(e)}getEventHandler(e){return this._events.getHandler(e)}warnIfRequestHandlerReplaced(e,t,n){t&&n&&console.warn(`[MCP Apps] ${e} handler replaced. Previous handler will no longer be called.`)}constructor(e,t={},n={autoResize:!0}){super(n),this._appInfo=e,this._appCapabilities=t,this.options=n,this._methods.replace(`notifications/cancelled`),this._methods.replace(`notifications/progress`),!n.allowUnsafeEval&&b2({jitless:!0}),this.replaceRequestHandler(`ping`,e=>(console.log(`Received ping:`,e.params),{})),this.setEventHandler(`hostcontextchanged`,void 0)}buildContext(e){return e}registerAppCapabilities(e){if(this.transport)throw Error(`Cannot register capabilities after transport is established`);this._appCapabilities=$Pe(this._appCapabilities,e)}registerTool(e,t,n){if(this._registeredTools[e])throw Error(`Tool ${e} is already registered`);let r=this,i=()=>{r._initializedSent&&r._appCapabilities.tools?.listChanged&&r.sendToolListChanged()},a=t.inputSchema!==void 0,o={title:t.title,description:t.description,inputSchema:t.inputSchema,outputSchema:t.outputSchema,annotations:t.annotations,_meta:t._meta,enabled:!0,enable(){this.enabled=!0,i()},disable(){this.enabled=!1,i()},update(e){Object.assign(this,e),i()},remove(){r._registeredTools[e]===o&&(delete r._registeredTools[e],i())},handler:async(t,r)=>{if(!o.enabled)throw Error(`Tool ${e} is disabled`);let i;if(a){let a=o.inputSchema;i=await n(a?await $9(a,t??{},`Invalid input for tool ${e}: `):t??{},r)}else i=await n(r);return o.outputSchema&&!i.isError&&(i.structuredContent=await $9(o.outputSchema,i.structuredContent,`Invalid output for tool ${e}: `)),i}};return this._registeredTools[e]=o,!this._appCapabilities.tools&&!this.transport&&this.registerAppCapabilities({tools:{listChanged:!0}}),this.ensureToolHandlersInitialized(),i(),o}_toolHandlersInitialized=!1;ensureToolHandlersInitialized(){this._toolHandlersInitialized||(this._toolHandlersInitialized=!0,this.oncalltool=async(e,t)=>{let n=this._registeredTools[e.name];if(!n)throw Error(`Tool ${e.name} not found`);return n.handler(e.arguments,t)},this.onlisttools=async(e,t)=>({tools:await Promise.all(Object.entries(this._registeredTools).filter(([e,t])=>t.enabled).map(async([e,t])=>{let n={name:e,title:t.title,description:t.description,inputSchema:t.inputSchema?await Q9(t.inputSchema,`input`):{type:`object`,properties:{}}};return t.outputSchema&&(n.outputSchema=await Q9(t.outputSchema,`output`)),t.annotations&&(n.annotations=t.annotations),t._meta&&(n._meta=t._meta),n}))}))}async sendToolListChanged(e={}){this._assertInitialized(`sendToolListChanged`),await this.notification({method:`notifications/tools/list_changed`,params:e})}getHostCapabilities(){return this._hostCapabilities}getHostVersion(){return this._hostInfo}getHostContext(){return this._hostContext}get ontoolinput(){return this.getEventHandler(`toolinput`)}set ontoolinput(e){this.setEventHandler(`toolinput`,e)}get ontoolinputpartial(){return this.getEventHandler(`toolinputpartial`)}set ontoolinputpartial(e){this.setEventHandler(`toolinputpartial`,e)}get ontoolresult(){return this.getEventHandler(`toolresult`)}set ontoolresult(e){this.setEventHandler(`toolresult`,e)}get ontoolcancelled(){return this.getEventHandler(`toolcancelled`)}set ontoolcancelled(e){this.setEventHandler(`toolcancelled`,e)}get onhostcontextchanged(){return this.getEventHandler(`hostcontextchanged`)}set onhostcontextchanged(e){this.setEventHandler(`hostcontextchanged`,e)}_onteardown;get onteardown(){return this._onteardown}set onteardown(e){this.warnIfRequestHandlerReplaced(`onteardown`,this._onteardown,e),this._onteardown=e,this.replaceRequestHandler(`ui/resource-teardown`,{params:WPe.shape.params,result:GPe},(e,t)=>{if(!this._onteardown)throw Error(`No onteardown handler set`);return this._onteardown(e,t)})}_oncalltool;get oncalltool(){return this._oncalltool}set oncalltool(e){this.warnIfRequestHandlerReplaced(`oncalltool`,this._oncalltool,e),this._oncalltool=e,this.replaceRequestHandler(`tools/call`,(e,t)=>{if(!this._oncalltool)throw Error(`No oncalltool handler set`);return this._oncalltool(e.params,t)})}_onlisttools;get onlisttools(){return this._onlisttools}set onlisttools(e){this.warnIfRequestHandlerReplaced(`onlisttools`,this._onlisttools,e),this._onlisttools=e,this.replaceRequestHandler(`tools/list`,(e,t)=>{if(!this._onlisttools)throw Error(`No onlisttools handler set`);return this._onlisttools(e.params,t)})}assertCapabilityForMethod(e){if(e===`sampling/createMessage`&&!this._hostCapabilities?.sampling)throw Error(`Host does not support sampling (required for ${e})`)}assertRequestHandlerCapability(e){switch(e){case`tools/call`:case`tools/list`:if(!this._appCapabilities.tools)throw Error(`Client does not support tool capability (required for ${e})`);return;default:return}}assertNotificationCapability(e){}async callServerTool(e,t){if(this._assertInitialized(`callServerTool`),typeof e==`string`)throw Error(`callServerTool() expects an object as its first argument, but received a string ("${e}"). Did you mean: callServerTool({ name: "${e}", arguments: { ... } })?`);return await this.request({method:`tools/call`,params:e},{onprogress:()=>{},resetTimeoutOnProgress:!0,...t})}async readServerResource(e,t){return this._assertInitialized(`readServerResource`),await this.request({method:`resources/read`,params:e},t)}async listServerResources(e,t){return this._assertInitialized(`listServerResources`),await this.request({method:`resources/list`,params:e},t)}async createSamplingMessage(e,t){return this._assertInitialized(`createSamplingMessage`),await this.request({method:`sampling/createMessage`,params:e},t)}sendMessage(e,t){return this._assertInitialized(`sendMessage`),this.request({method:`ui/message`,params:e},RPe,t)}sendLog(e){return this.notification({method:`notifications/message`,params:e})}updateModelContext(e,t){return this._assertInitialized(`updateModelContext`),this.request({method:`ui/update-model-context`,params:e},a8,t)}openLink(e,t){return this._assertInitialized(`openLink`),this.request({method:`ui/open-link`,params:e},IPe,t)}sendOpenLink=this.openLink;downloadFile(e,t){return this._assertInitialized(`downloadFile`),this.request({method:`ui/download-file`,params:e},LPe,t)}requestTeardown(e={}){return this.notification({method:`ui/notifications/request-teardown`,params:e})}requestDisplayMode(e,t){return this._assertInitialized(`requestDisplayMode`),this.request({method:`ui/request-display-mode`,params:e},JPe,t)}sendSizeChanged(e){return this.notification({method:`ui/notifications/size-changed`,params:e})}setupSizeChangedNotifications(){let e=!1,t=0,n=0,r=()=>{e||(e=!0,requestAnimationFrame(()=>{e=!1;let r=document.documentElement,i=r.style.height;r.style.height=`max-content`;let a=Math.ceil(r.getBoundingClientRect().height);r.style.height=i;let o=Math.ceil(window.innerWidth);(o!==t||a!==n)&&(t=o,n=a,this.sendSizeChanged({width:o,height:a}))}))};r();let i=new ResizeObserver(r);return i.observe(document.documentElement),i.observe(document.body),()=>i.disconnect()}async connect(e=new G9(window.parent,window.parent),t){if(this.transport)throw Error(`App is already connected. Call close() before connecting again.`);this._initializedSent=!1;try{await super.connect(e);let n=await this.request({method:`ui/initialize`,params:{appCapabilities:this._appCapabilities,appInfo:this._appInfo,protocolVersion:NPe}},ZPe,t);if(n===void 0)throw Error(`Server sent invalid initialize result: ${n}`);this._hostCapabilities=n.hostCapabilities,this._hostInfo=n.hostInfo,this._hostContext=n.hostContext,await this.notification({method:`ui/notifications/initialized`}),this._initializedSent=!0,this.options?.autoResize&&this.setupSizeChangedNotifications()}catch(e){throw this.close(),e}}};function tFe({appInfo:e,capabilities:t,onAppCreated:n,autoResize:r=!0,strict:i}){let[a,o]=(0,A.useState)(null),[s,c]=(0,A.useState)(!1),[l,u]=(0,A.useState)(null);return(0,A.useEffect)(()=>{let a=!0,s;async function l(){try{let l=new G9(window.parent,window.parent);if(s=new eFe(e,t,{autoResize:r,strict:i}),n?.(s),await s.connect(l),!a){s.close();return}o(s),c(!0),u(null)}catch(e){a&&(o(null),c(!1),u(e instanceof Error?e:Error(`Failed to connect`)))}}return l(),()=>{a=!1,s?.close()}},[]),{app:a,isConnected:s,error:l}}function nFe(){let[e,t]=(0,A.useState)(null),[n,r]=(0,A.useState)(),[i,a]=(0,A.useState)(null);function o(e){try{if(e.isError)throw Error(`Tool error`);let n=Xg(e.structuredContent);t(n),a(null)}catch{a(`This view could not be loaded. Please try again.`)}}let s=tFe({autoResize:!1,appInfo:{name:`Fanout panels`,version:`1.0.0`},capabilities:{},onAppCreated:e=>{e.ontoolresult=o,e.onhostcontextchanged=e=>r(t=>({...t,...e})),e.onerror=()=>a(`This view could not be refreshed. Please try again.`)}});return(0,A.useEffect)(()=>{s.app&&r(s.app.getHostContext())},[s.app]),{...s,fragment:e,host:n,toolError:i}}function rFe(e,t){let n,r=()=>{let r=e.getBoundingClientRect().height;n!==void 0&&Math.abs(r-n)<2||(n=r,t({height:Math.round(r)}))},i=new ResizeObserver(r);return i.observe(e),r(),()=>i.disconnect()}var iFe=new fee({defaultOptions:{queries:{retry:!1}}});function aFe(){let{app:e,fragment:t,host:n,error:r,toolError:i}=nFe(),a=(0,A.useRef)(null);(0,A.useEffect)(()=>{if(e&&a.current)return rFe(a.current,t=>e.sendSizeChanged(t))},[e]);let o=(0,A.useMemo)(()=>e?UEe(e):void 0,[e]),s=n?.theme===`dark`,c=i??(r?`This view could not be loaded. Please try again.`:null);return(0,R.jsx)(Sn,{theme:Mee,cssVariablesResolver:kee,forceColorScheme:s?`dark`:`light`,children:(0,R.jsx)(Rh,{client:iFe,children:(0,R.jsx)(`div`,{ref:a,"data-app-content":!0,children:t&&o&&n?(0,R.jsxs)(R.Fragment,{children:[c&&(0,R.jsx)(Sd,{color:`bad`,m:`md`,children:c}),(0,R.jsx)(HEe,{fragment:t,dark:s,onQuery:o.query,drillClient:o.drill,resolveVariables:o.resolveVariables,hostDisplayMode:n.displayMode??`inline`,onDisplayMode:n.availableDisplayModes?.includes(`fullscreen`)?async t=>(await e.requestDisplayMode({mode:t})).mode===t:void 0})]}):c?(0,R.jsx)(Sd,{color:`bad`,m:`md`,children:c}):(0,R.jsx)(zf,{mih:180,children:(0,R.jsx)(tl,{size:`sm`,"aria-label":`Loading panel view`})})})})})}(0,wee.createRoot)(document.getElementById(`root`)).render((0,R.jsx)(A.StrictMode,{children:(0,R.jsx)(aFe,{})}));
diff --git a/internal/ui/dist/assets/Tooltip-B3r3s_B9.js b/internal/ui/dist/assets/Tooltip-B3r3s_B9.js new file mode 100644 index 000000000..7de24c521 --- /dev/null +++ b/internal/ui/dist/assets/Tooltip-B3r3s_B9.js @@ -0,0 +1 @@ +import{i as e,r as t,s as n}from"./useRouter-ByJ6_rwb.js";import{$ as r,A as i,C as a,K as o,M as s,P as c,T as l,X as u,Y as d,Z as f,_t as p,b as m,it as h,mt as g,nt as _,st as v,tt as y,z as b}from"./brand-DUaZkIz1.js";var x=n(e(),1);function S(e){let t=(0,x.createContext)(null);return[t,()=>{let n=(0,x.use)(t);if(n===null)throw Error(e);return n}]}var C=n(p(),1),w=t(),T={app:100,modal:200,popover:300,overlay:400,max:9999};function E(e){return T[e]}function D(e){let t=(0,x.useRef)(e);return(0,x.useEffect)(()=>{t.current=e}),(0,x.useMemo)(()=>((...e)=>t.current?.(...e)),[])}function O(e,t){let{delay:n,flushOnUnmount:r,leading:i,maxWait:a}=typeof t==`number`?{delay:t,flushOnUnmount:!1,leading:!1,maxWait:void 0}:t,o=D(e),s=(0,x.useRef)(0),c=(0,x.useRef)(0),l=(0,x.useRef)(null),u=(0,x.useMemo)(()=>{let e=Object.assign((...t)=>{window.clearTimeout(s.current),l.current=t;let r=e._isFirstCall;e._isFirstCall=!1;function u(){window.clearTimeout(s.current),window.clearTimeout(c.current),s.current=0,c.current=0,e._isFirstCall=!0,e._hasPendingCallback=!1}function d(){a!==void 0&&c.current===0&&(c.current=window.setTimeout(()=>{if(c.current=0,s.current!==0&&e._hasPendingCallback){let e=l.current;u(),o(...e)}},a))}if(i&&r){o(...t),e.flush=()=>{s.current!==0&&u()},e.cancel=()=>{u()},s.current=window.setTimeout(()=>{u()},n),d();return}if(i&&!r){e._hasPendingCallback=!0,e.flush=()=>{s.current!==0&&(u(),o(...t))},e.cancel=()=>{u()},s.current=window.setTimeout(()=>{u()},n),d();return}e._hasPendingCallback=!0;let f=()=>{s.current!==0&&(u(),o(...t))};e.flush=f,e.cancel=()=>{u()},s.current=window.setTimeout(f,n),d()},{flush:()=>{},cancel:()=>{},isPending:()=>e._hasPendingCallback,_isFirstCall:!0,_hasPendingCallback:!1});return e},[o,n,i,a]);return(0,x.useEffect)(()=>()=>{r?u.flush():u.cancel()},[u,r]),u}function k(e){return e?.props?.ref}function A(e,t){return Array.isArray(e)?[...e].reduce((e,n)=>({...e,...A(n,t)}),{}):typeof e==`function`?e(t):e??{}}var j=(0,x.createContext)({dir:`ltr`,toggleDirection:()=>{},setDirection:()=>{}});function M(){return(0,x.use)(j)}var[N,P]=S(`ScrollArea.Root component was not found in tree`);function F(e,t){let n=(0,x.useEffectEvent)(t);h(()=>{let t=0;if(e){let r=new ResizeObserver(()=>{cancelAnimationFrame(t),t=window.requestAnimationFrame(n)});return r.observe(e),()=>{window.cancelAnimationFrame(t),r.unobserve(e)}}},[e])}function ee(e){let{style:t,...n}=e,r=P(),[i,a]=(0,x.useState)(0),[o,s]=(0,x.useState)(0),c=!!(i&&o);return F(r.scrollbarX,()=>{let e=r.scrollbarX?.offsetHeight||0;r.onCornerHeightChange(e),s(e)}),F(r.scrollbarY,()=>{let e=r.scrollbarY?.offsetWidth||0;r.onCornerWidthChange(e),a(e)}),c?(0,w.jsx)(`div`,{...n,style:{...t,width:i,height:o}}):null}function te(e){let t=P(),n=!!(t.scrollbarX&&t.scrollbarY);return t.type!==`scroll`&&n?(0,w.jsx)(ee,{...e}):null}var ne={scrollHideDelay:1e3,type:`hover`};function re(e){let{type:t,scrollHideDelay:n,scrollbars:r,getStyles:i,ref:o,...c}=s(`ScrollAreaRoot`,ne,e),[l,u]=(0,x.useState)(null),[d,f]=(0,x.useState)(null),[p,m]=(0,x.useState)(null),[h,g]=(0,x.useState)(null),[_,v]=(0,x.useState)(null),[b,S]=(0,x.useState)(0),[C,T]=(0,x.useState)(0),[E,D]=(0,x.useState)(!1),[O,k]=(0,x.useState)(!1),A=y(o,u);return(0,w.jsx)(N,{value:{type:t,scrollHideDelay:n,scrollArea:l,viewport:d,onViewportChange:f,content:p,onContentChange:m,scrollbarX:h,onScrollbarXChange:g,scrollbarXEnabled:E,onScrollbarXEnabledChange:D,scrollbarY:_,onScrollbarYChange:v,scrollbarYEnabled:O,onScrollbarYEnabledChange:k,onCornerWidthChange:S,onCornerHeightChange:T,getStyles:i},children:(0,w.jsx)(a,{...c,ref:A,__vars:{"--sa-corner-width":r===`xy`?`${b}px`:`0px`,"--sa-corner-height":r===`xy`?`${C}px`:`0px`}})})}re.displayName=`@mantine/core/ScrollAreaRoot`;function ie(e,t){let n=e/t;return Number.isNaN(n)?0:n}function I(e){let t=ie(e.viewport,e.content),n=e.scrollbar.paddingStart+e.scrollbar.paddingEnd,r=(e.scrollbar.size-n)*t;return Math.max(r,18)}function ae(e,t){return n=>{if(e[0]===e[1]||t[0]===t[1])return t[0];let r=(t[1]-t[0])/(e[1]-e[0]);return t[0]+r*(n-e[0])}}function oe(e,[t,n]){return Math.min(n,Math.max(t,e))}function L(e,t,n=`ltr`){let r=I(t),i=t.scrollbar.paddingStart+t.scrollbar.paddingEnd,a=t.scrollbar.size-i,o=t.content-t.viewport,s=a-r,c=oe(e,n===`ltr`?[0,o]:[o*-1,0]);return ae([0,o],[0,s])(c)}function se(e,t,n,r=`ltr`){let i=I(n),a=i/2,o=t||a,s=i-o,c=n.scrollbar.paddingStart+o,l=n.scrollbar.size-n.scrollbar.paddingEnd-s,u=n.content-n.viewport,d=r===`ltr`?[0,u]:[u*-1,0];return ae([c,l],d)(e)}function ce(e,t){return e>0&&e{e?.(r),(n===!1||!r.defaultPrevented)&&t?.(r)}}var[ue,de]=S(`ScrollAreaScrollbar was not found in tree`);function fe(e){let{sizes:t,hasThumb:n,onThumbChange:r,onThumbPointerUp:i,onThumbPointerDown:a,onThumbPositionChange:o,onDragScroll:s,onWheelScroll:c,onResize:l,ref:u,...d}=e,f=P(),[p,m]=(0,x.useState)(null),h=y(u,m),g=(0,x.useRef)(null),_=(0,x.useRef)(``),v=t.content-t.viewport,b=(0,x.useEffectEvent)(e=>c(e,v)),S=D(o),C=O(l,10),T=e=>{if(g.current){let t=e.clientX-g.current.left,n=e.clientY-g.current.top;s({x:t,y:n})}};return(0,x.useEffect)(()=>{if(!p)return;let e=e=>b(e);return p.addEventListener(`wheel`,e,{passive:!1}),()=>p.removeEventListener(`wheel`,e)},[p]),(0,x.useEffect)(S,[t,S]),F(p,C),F(f.content,C),(0,w.jsx)(ue,{value:{scrollbar:p,hasThumb:n,onThumbChange:D(r),onThumbPointerUp:D(i),onThumbPositionChange:S,onThumbPointerDown:D(a)},children:(0,w.jsx)(`div`,{...d,ref:h,"data-mantine-scrollbar":!0,style:{position:`absolute`,...d.style},onPointerDown:R(e.onPointerDown,e=>{e.preventDefault(),e.button===0&&(e.target.setPointerCapture(e.pointerId),g.current=p.getBoundingClientRect(),_.current=document.body.style.webkitUserSelect,document.body.style.webkitUserSelect=`none`,T(e))}),onPointerMove:R(e.onPointerMove,T),onPointerUp:R(e.onPointerUp,e=>{let t=e.target;t.hasPointerCapture(e.pointerId)&&(e.preventDefault(),t.releasePointerCapture(e.pointerId))}),onLostPointerCapture:()=>{document.body.style.webkitUserSelect=_.current,g.current=null}})})}var pe=e=>{let{sizes:t,onSizesChange:n,style:r,ref:i,...a}=e,o=P(),[s,c]=(0,x.useState)(),l=(0,x.useRef)(null),u=y(i,l,o.onScrollbarXChange);return(0,x.useEffect)(()=>{l.current&&c(getComputedStyle(l.current))},[l]),(0,w.jsx)(fe,{"data-orientation":`horizontal`,...a,ref:u,sizes:t,style:{...r,"--sa-thumb-width":`${I(t)}px`},onThumbPointerDown:t=>e.onThumbPointerDown(t.x),onDragScroll:t=>e.onDragScroll(t.x),onWheelScroll:(t,n)=>{if(o.viewport){let r=o.viewport.scrollLeft+t.deltaX;e.onWheelScroll(r),ce(r,n)&&t.preventDefault()}},onResize:()=>{l.current&&o.viewport&&s&&n({content:o.viewport.scrollWidth,viewport:o.viewport.offsetWidth,scrollbar:{size:l.current.clientWidth,paddingStart:le(s.paddingLeft),paddingEnd:le(s.paddingRight)}})}})};pe.displayName=`@mantine/core/ScrollAreaScrollbarX`;function me(e){let{sizes:t,onSizesChange:n,style:r,ref:i,...a}=e,o=P(),[s,c]=(0,x.useState)(),l=(0,x.useRef)(null),u=y(i,l,o.onScrollbarYChange);return(0,x.useEffect)(()=>{l.current&&c(window.getComputedStyle(l.current))},[]),(0,w.jsx)(fe,{...a,"data-orientation":`vertical`,ref:u,sizes:t,style:{"--sa-thumb-height":`${I(t)}px`,...r},onThumbPointerDown:t=>e.onThumbPointerDown(t.y),onDragScroll:t=>e.onDragScroll(t.y),onWheelScroll:(t,n)=>{if(o.viewport){let r=o.viewport.scrollTop+t.deltaY;e.onWheelScroll(r),ce(r,n)&&t.preventDefault()}},onResize:()=>{l.current&&o.viewport&&s&&n({content:o.viewport.scrollHeight,viewport:o.viewport.offsetHeight,scrollbar:{size:l.current.clientHeight,paddingStart:le(s.paddingTop),paddingEnd:le(s.paddingBottom)}})}})}me.displayName=`@mantine/core/ScrollAreaScrollbarY`;function he(e){let{orientation:t=`vertical`,...n}=e,{dir:r}=M(),i=P(),a=(0,x.useRef)(null),o=(0,x.useRef)(0),[s,c]=(0,x.useState)({content:0,viewport:0,scrollbar:{size:0,paddingStart:0,paddingEnd:0}}),l=ie(s.viewport,s.content),u={...n,sizes:s,onSizesChange:c,hasThumb:l>0&&l<1,onThumbChange:e=>{a.current=e},onThumbPointerUp:()=>{o.current=0},onThumbPointerDown:e=>{o.current=e}},d=(e,t)=>se(e,o.current,s,t);return t===`horizontal`?(0,w.jsx)(pe,{...u,onThumbPositionChange:()=>{if(i.viewport&&a.current){let e=i.viewport.scrollLeft,t=L(e,s,r);a.current.style.transform=`translate3d(${t}px, 0, 0)`}},onWheelScroll:e=>{i.viewport&&(i.viewport.scrollLeft=e)},onDragScroll:e=>{i.viewport&&(i.viewport.scrollLeft=d(e,r))}}):t===`vertical`?(0,w.jsx)(me,{...u,onThumbPositionChange:()=>{if(i.viewport&&a.current){let e=i.viewport.scrollTop,t=L(e,s);s.scrollbar.size===0?a.current.style.setProperty(`--thumb-opacity`,`0`):a.current.style.setProperty(`--thumb-opacity`,`1`),a.current.style.transform=`translate3d(0, ${t}px, 0)`}},onWheelScroll:e=>{i.viewport&&(i.viewport.scrollTop=e)},onDragScroll:e=>{i.viewport&&(i.viewport.scrollTop=d(e))}}):null}he.displayName=`@mantine/core/ScrollAreaScrollbarVisible`;function z(e){let t=P(),{forceMount:n,...r}=e,[i,a]=(0,x.useState)(!1),o=e.orientation===`horizontal`,s=O(()=>{if(t.viewport){let e=t.viewport.offsetWidth{let{scrollArea:e}=r,t=0;if(e){let n=()=>{window.clearTimeout(t),a(!0)},i=()=>{t=window.setTimeout(()=>a(!1),r.scrollHideDelay)};return e.addEventListener(`pointerenter`,n),e.addEventListener(`pointerleave`,i),()=>{window.clearTimeout(t),e.removeEventListener(`pointerenter`,n),e.removeEventListener(`pointerleave`,i)}}},[r.scrollArea,r.scrollHideDelay]),t||i?(0,w.jsx)(z,{"data-state":i?`visible`:`hidden`,...n}):null}ge.displayName=`@mantine/core/ScrollAreaScrollbarHover`;function _e(e){let{forceMount:t,...n}=e,r=P(),i=e.orientation===`horizontal`,[a,o]=(0,x.useState)(`hidden`),s=O(()=>o(`idle`),100);return(0,x.useEffect)(()=>{if(a===`idle`){let e=window.setTimeout(()=>o(`hidden`),r.scrollHideDelay);return()=>window.clearTimeout(e)}},[a,r.scrollHideDelay]),(0,x.useEffect)(()=>{let{viewport:e}=r,t=i?`scrollLeft`:`scrollTop`;if(e){let n=e[t],r=()=>{let r=e[t];n!==r&&(o(`scrolling`),s()),n=r};return e.addEventListener(`scroll`,r),()=>e.removeEventListener(`scroll`,r)}},[r.viewport,i,s]),t||a!==`hidden`?(0,w.jsx)(he,{"data-state":a===`hidden`?`hidden`:`visible`,...n,onPointerEnter:R(e.onPointerEnter,()=>o(`interacting`)),onPointerLeave:R(e.onPointerLeave,()=>o(`idle`))}):null}function ve(e){let{forceMount:t,...n}=e,r=P(),{onScrollbarXEnabledChange:i,onScrollbarYEnabledChange:a}=r,o=e.orientation===`horizontal`;return(0,x.useEffect)(()=>(o?i(!0):a(!0),()=>{o?i(!1):a(!1)}),[o,i,a]),r.type===`hover`?(0,w.jsx)(ge,{...n,forceMount:t}):r.type===`scroll`?(0,w.jsx)(_e,{...n,forceMount:t}):r.type===`auto`?(0,w.jsx)(z,{...n,forceMount:t}):r.type===`always`?(0,w.jsx)(he,{...n}):null}ve.displayName=`@mantine/core/ScrollAreaScrollbar`;function ye(e,t=()=>{}){let n={left:e.scrollLeft,top:e.scrollTop},r=0;return(function i(){let a={left:e.scrollLeft,top:e.scrollTop},o=n.left!==a.left,s=n.top!==a.top;(o||s)&&t(),n=a,r=window.requestAnimationFrame(i)})(),()=>window.cancelAnimationFrame(r)}function be(e){let{style:t,ref:n,...r}=e,i=P(),a=de(),{onThumbPositionChange:o}=a,s=y(n,a.onThumbChange),c=(0,x.useRef)(void 0),l=O(()=>{c.current&&=(c.current(),void 0)},100);return(0,x.useEffect)(()=>{let{viewport:e}=i;if(e){let t=()=>{if(l(),!c.current){let t=ye(e,o);c.current=t,o()}};return o(),e.addEventListener(`scroll`,t),()=>e.removeEventListener(`scroll`,t)}},[i.viewport,l,o]),(0,w.jsx)(`div`,{"data-state":a.hasThumb?`visible`:`hidden`,...r,ref:s,style:{width:`var(--sa-thumb-width)`,height:`var(--sa-thumb-height)`,...t},onPointerDownCapture:R(e.onPointerDownCapture,e=>{let t=e.target.getBoundingClientRect(),n=e.clientX-t.left,r=e.clientY-t.top;a.onThumbPointerDown({x:n,y:r})}),onPointerUp:R(e.onPointerUp,a.onThumbPointerUp)})}be.displayName=`@mantine/core/ScrollAreaThumb`;function B(e){let{forceMount:t,...n}=e,r=de();return t||r.hasThumb?(0,w.jsx)(be,{...n}):null}B.displayName=`@mantine/core/ScrollAreaThumb`;function xe({children:e,style:t,ref:n,onWheel:r,...i}){let o=P(),s=y(n,o.onViewportChange),c=e=>{if(r?.(e),o.scrollbarXEnabled&&o.viewport&&e.shiftKey){let{scrollTop:t,scrollHeight:n,clientHeight:r,scrollWidth:i,clientWidth:a}=o.viewport,s=t<1,c=t>=n-r-1;i>a&&(s||c)&&e.stopPropagation()}};return(0,w.jsx)(a,{...i,ref:s,onWheel:c,"data-scrollarea-viewport":!0,style:{overflowX:o.scrollbarXEnabled?`scroll`:`hidden`,overflowY:o.scrollbarYEnabled?`scroll`:`hidden`,...t},children:(0,w.jsx)(`div`,{...o.getStyles(`content`),ref:o.onContentChange,children:e})})}xe.displayName=`@mantine/core/ScrollAreaViewport`;var Se={root:`m_d57069b5`,content:`m_b1336c6`,viewport:`m_c0783ff9`,viewportInner:`m_f8f631dd`,scrollbar:`m_c44ba933`,thumb:`m_d8b5e363`,corner:`m_21657268`};function Ce(){return typeof window<`u`}function we(e){return Te(e)?(e.nodeName||``).toLowerCase():`#document`}function V(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function H(e){return((Te(e)?e.ownerDocument:e.document)||window.document)?.documentElement}function Te(e){return Ce()?e instanceof Node||e instanceof V(e).Node:!1}function U(e){return Ce()?e instanceof Element||e instanceof V(e).Element:!1}function W(e){return Ce()?e instanceof HTMLElement||e instanceof V(e).HTMLElement:!1}function Ee(e){return!Ce()||typeof ShadowRoot>`u`?!1:e instanceof ShadowRoot||e instanceof V(e).ShadowRoot}function De(e){let{overflow:t,overflowX:n,overflowY:r,display:i}=G(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&i!==`inline`&&i!==`contents`}function Oe(e){return/^(table|td|th)$/.test(we(e))}function ke(e){try{if(e.matches(`:popover-open`))return!0}catch{}try{return e.matches(`:modal`)}catch{return!1}}var Ae=/transform|translate|scale|rotate|perspective|filter/,je=/paint|layout|strict|content/,Me=e=>!!e&&e!==`none`,Ne;function Pe(e){let t=U(e)?G(e):e;return Me(t.transform)||Me(t.translate)||Me(t.scale)||Me(t.rotate)||Me(t.perspective)||!Ie()&&(Me(t.backdropFilter)||Me(t.filter))||Ae.test(t.willChange||``)||je.test(t.contain||``)}function Fe(e){let t=ze(e);for(;W(t)&&!Le(t);){if(Pe(t))return t;if(ke(t))return null;t=ze(t)}return null}function Ie(){return Ne??=typeof CSS<`u`&&CSS.supports&&CSS.supports(`-webkit-backdrop-filter`,`none`),Ne}function Le(e){return/^(html|body|#document)$/.test(we(e))}function G(e){return V(e).getComputedStyle(e)}function Re(e){return U(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function ze(e){if(we(e)===`html`)return e;let t=e.assignedSlot||e.parentNode||Ee(e)&&e.host||H(e);return Ee(t)?t.host:t}function Be(e){let t=ze(e);return Le(t)?(e.ownerDocument||e).body:W(t)&&De(t)?t:Be(t)}function Ve(e,t,n){t===void 0&&(t=[]),n===void 0&&(n=!0);let r=Be(e),i=r===e.ownerDocument?.body,a=V(r);if(i){let e=He(a);return t.concat(a,a.visualViewport||[],De(r)?r:[],e&&n?Ve(e):[])}return t.concat(r,Ve(r,[],n))}function He(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}var Ue=[`top`,`right`,`bottom`,`left`],K=Math.min,q=Math.max,We=Math.round,Ge=Math.floor,Ke=e=>({x:e,y:e}),qe={left:`right`,right:`left`,bottom:`top`,top:`bottom`};function Je(e,t,n){return q(e,K(t,n))}function J(e,t){return typeof e==`function`?e(t):e}function Y(e){return e.split(`-`)[0]}function Ye(e){return e.split(`-`)[1]}function Xe(e){return e===`x`?`y`:`x`}function Ze(e){return e===`y`?`height`:`width`}function X(e){let t=e[0];return t===`t`||t===`b`?`y`:`x`}function Qe(e){return Xe(X(e))}function $e(e,t,n){n===void 0&&(n=!1);let r=Ye(e),i=Qe(e),a=Ze(i),o=i===`x`?r===(n?`end`:`start`)?`right`:`left`:r===`start`?`bottom`:`top`;return t.reference[a]>t.floating[a]&&(o=ct(o)),[o,ct(o)]}function et(e){let t=ct(e);return[tt(e),t,tt(t)]}function tt(e){return e.includes(`start`)?e.replace(`start`,`end`):e.replace(`end`,`start`)}var nt=[`left`,`right`],rt=[`right`,`left`],it=[`top`,`bottom`],at=[`bottom`,`top`];function ot(e,t,n){switch(e){case`top`:case`bottom`:return n?t?rt:nt:t?nt:rt;case`left`:case`right`:return t?it:at;default:return[]}}function st(e,t,n,r){let i=Ye(e),a=ot(Y(e),n===`start`,r);return i&&(a=a.map(e=>e+`-`+i),t&&(a=a.concat(a.map(tt)))),a}function ct(e){let t=Y(e);return qe[t]+e.slice(t.length)}function lt(e){return{top:e.top??0,right:e.right??0,bottom:e.bottom??0,left:e.left??0}}function ut(e){return typeof e==`number`?{top:e,right:e,bottom:e,left:e}:lt(e)}function dt(e){let{x:t,y:n,width:r,height:i}=e;return{width:r,height:i,top:n,left:t,right:t+r,bottom:n+i,x:t,y:n}}function ft(){let e=navigator.userAgentData;return e!=null&&e.platform?e.platform:navigator.platform}function pt(){let e=navigator.userAgentData;return e&&Array.isArray(e.brands)?e.brands.map(e=>{let{brand:t,version:n}=e;return t+`/`+n}).join(` `):navigator.userAgent}function mt(){return/apple/i.test(navigator.vendor)}function ht(){return ft().toLowerCase().startsWith(`mac`)&&!navigator.maxTouchPoints}function gt(){return pt().includes(`jsdom/`)}var _t=`data-floating-ui-focusable`,vt=`input:not([type='hidden']):not([disabled]),[contenteditable]:not([contenteditable='false']),textarea:not([disabled])`;function yt(e){let t=e.activeElement;for(;((n=t)==null||(n=n.shadowRoot)==null?void 0:n.activeElement)!=null;){var n;t=t.shadowRoot.activeElement}return t}function bt(e,t){if(!e||!t)return!1;let n=t.getRootNode==null?void 0:t.getRootNode();if(e.contains(t))return!0;if(n&&Ee(n)){let n=t;for(;n;){if(e===n)return!0;n=n.parentNode||n.host}}return!1}function xt(e){return`composedPath`in e?e.composedPath()[0]:e.target}function St(e,t){if(t==null)return!1;if(`composedPath`in e)return e.composedPath().includes(t);let n=e;return n.target!=null&&t.contains(n.target)}function Ct(e){return e.matches(`html,body`)}function wt(e){return e?.ownerDocument||document}function Tt(e){return W(e)&&e.matches(vt)}function Et(e){if(!e||gt())return!0;try{return e.matches(`:focus-visible`)}catch{return!0}}function Dt(e){return e?e.hasAttribute(_t)?e:e.querySelector(`[`+_t+`]`)||e:null}function Ot(e,t,n){return n===void 0&&(n=!0),e.filter(e=>e.parentId===t&&(!n||e.context?.open)).flatMap(t=>[t,...Ot(e,t.id,n)])}function kt(e){return`nativeEvent`in e}function At(e,t){let n=[`mouse`,`pen`];return t||n.push(``,void 0),n.includes(e)}var Z=typeof document<`u`?x.useLayoutEffect:function(){},jt={...x};function Mt(e){let t=x.useRef(e);return Z(()=>{t.current=e}),t}var Nt=jt.useInsertionEffect||(e=>e());function Q(e){let t=x.useRef(()=>{});return Nt(()=>{t.current=e}),x.useCallback(function(){var e=[...arguments];return t.current==null?void 0:t.current(...e)},[])}function Pt(e,t,n){let{reference:r,floating:i}=e,a=X(t),o=Qe(t),s=Ze(o),c=Y(t),l=a===`y`,u=r.x+r.width/2-i.width/2,d=r.y+r.height/2-i.height/2,f=r[s]/2-i[s]/2,p;switch(c){case`top`:p={x:u,y:r.y-i.height};break;case`bottom`:p={x:u,y:r.y+r.height};break;case`right`:p={x:r.x+r.width,y:d};break;case`left`:p={x:r.x-i.width,y:d};break;default:p={x:r.x,y:r.y}}let m=Ye(t);return m&&(p[o]+=f*(m===`end`?1:-1)*(n&&l?-1:1)),p}async function Ft(e,t){t===void 0&&(t={});let{x:n,y:r,platform:i,rects:a,elements:o,strategy:s}=e,{boundary:c=`clippingAncestors`,rootBoundary:l=`viewport`,elementContext:u=`floating`,altBoundary:d=!1,padding:f=0}=J(t,e),p=ut(f),m=o[d?u===`floating`?`reference`:`floating`:u],h=dt(await i.getClippingRect({element:await(i.isElement==null?void 0:i.isElement(m))??!0?m:m.contextElement||await(i.getDocumentElement==null?void 0:i.getDocumentElement(o.floating)),boundary:c,rootBoundary:l,strategy:s})),g=u===`floating`?{x:n,y:r,width:a.floating.width,height:a.floating.height}:a.reference,_=await(i.getOffsetParent==null?void 0:i.getOffsetParent(o.floating)),v=await(i.isElement==null?void 0:i.isElement(_))&&await(i.getScale==null?void 0:i.getScale(_))||{x:1,y:1},y=dt(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({elements:o,rect:g,offsetParent:_,strategy:s}):g);return{top:(h.top-y.top+p.top)/v.y,bottom:(y.bottom-h.bottom+p.bottom)/v.y,left:(h.left-y.left+p.left)/v.x,right:(y.right-h.right+p.right)/v.x}}var It=50,Lt=async(e,t,n)=>{let{placement:r=`bottom`,strategy:i=`absolute`,middleware:a=[],platform:o}=n,s=o.detectOverflow?o:{...o,detectOverflow:Ft},c=await(o.isRTL==null?void 0:o.isRTL(t)),l=await o.getElementRects({reference:e,floating:t,strategy:i}),{x:u,y:d}=Pt(l,r,c),f=r,p=0,m={};for(let n=0;n({name:`arrow`,options:e,async fn(t){let{x:n,y:r,placement:i,rects:a,platform:o,elements:s,middlewareData:c}=t,{element:l,padding:u=0}=J(e,t)||{};if(l==null)return{};let d=ut(u),f={x:n,y:r},p=Qe(i),m=Ze(p),h=await o.getDimensions(l),g=p===`y`,_=g?`top`:`left`,v=g?`bottom`:`right`,y=g?`clientHeight`:`clientWidth`,b=a.reference[m]+a.reference[p]-f[p]-a.floating[m],x=f[p]-a.reference[p],S=await(o.getOffsetParent==null?void 0:o.getOffsetParent(l)),C=S?S[y]:0;(!C||!await(o.isElement==null?void 0:o.isElement(S)))&&(C=s.floating[y]||a.floating[m]);let w=b/2-x/2,T=C/2-h[m]/2-1,E=K(d[_],T),D=K(d[v],T),O=C-h[m]-D,k=C/2-h[m]/2+w,A=Je(E,k,O),j=!c.arrow&&Ye(i)!=null&&k!==A&&a.reference[m]/2-(ke<=0)){let e=(i.flip?.index||0)+1,t=S[e];if(t&&(u!==`alignment`||_===X(t)||T.every(e=>X(e.placement)!==_||e.overflows[0]>0)))return{data:{index:e,overflows:T},reset:{placement:t}};let n=T.filter(e=>e.overflows[0]<=0).sort((e,t)=>e.overflows[1]-t.overflows[1])[0]?.placement;if(!n)switch(f){case`bestFit`:{let e=T.filter(e=>{if(x){let t=X(e.placement);return t===_||t===`y`}return!0}).map(e=>[e.placement,e.overflows.filter(e=>e>0).reduce((e,t)=>e+t,0)]).sort((e,t)=>e[1]-t[1])[0]?.[0];e&&(n=e);break}case`initialPlacement`:n=o}if(r!==n)return{reset:{placement:n}}}return{}}}};function Bt(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function Vt(e){return Ue.some(t=>e[t]>=0)}var Ht=function(e){return e===void 0&&(e={}),{name:`hide`,options:e,async fn(t){let{rects:n,platform:r}=t,{strategy:i=`referenceHidden`,...a}=J(e,t);switch(i){case`referenceHidden`:{let e=Bt(await r.detectOverflow(t,{...a,elementContext:`reference`}),n.reference);return{data:{referenceHiddenOffsets:e,referenceHidden:Vt(e)}}}case`escaped`:{let e=Bt(await r.detectOverflow(t,{...a,altBoundary:!0}),n.floating);return{data:{escapedOffsets:e,escaped:Vt(e)}}}default:return{}}}}};function Ut(e){let t=K(...e.map(e=>e.left)),n=K(...e.map(e=>e.top)),r=q(...e.map(e=>e.right)),i=q(...e.map(e=>e.bottom));return{x:t,y:n,width:r-t,height:i-n}}function Wt(e){let t=e.slice().sort((e,t)=>e.y-t.y),n=[],r=null;for(let e=0;er.height/2?n.push([i]):n[n.length-1].push(i),r=i}return n.map(e=>dt(Ut(e)))}var Gt=function(e){return e===void 0&&(e={}),{name:`inline`,options:e,async fn(t){let{placement:n,elements:r,rects:i,platform:a,strategy:o}=t,{padding:s=2,x:c,y:l}=J(e,t),u=Array.from(await(a.getClientRects==null?void 0:a.getClientRects(r.reference))||[]);if(!u.length)return{};let d=Wt(u),f=dt(Ut(u)),p=ut(s);function m(){if(d.length===2&&(d[0].left>d[1].right||d[1].left>d[0].right)&&c!=null&&l!=null)return d.find(e=>c>e.left-p.left&&ce.top-p.top&&l=2){if(X(n)===`y`){let e=d[0],t=d[d.length-1],r=Y(n)===`top`,i=e.top,a=t.bottom,o=r?e.left:t.left;return dt({x:o,y:i,width:(r?e.right:t.right)-o,height:a-i})}let e=Y(n)===`left`,t=q(...d.map(e=>e.right)),r=K(...d.map(e=>e.left)),i=d.filter(n=>e?n.left===r:n.right===t),a=i[0].top,o=i[i.length-1].bottom;return dt({x:r,y:a,width:t-r,height:o-a})}return f}let h=await a.getElementRects({reference:{getBoundingClientRect:m},floating:r.floating,strategy:o});return i.reference.x!==h.reference.x||i.reference.y!==h.reference.y||i.reference.width!==h.reference.width||i.reference.height!==h.reference.height?{reset:{rects:h}}:{}}}},Kt=new Set([`left`,`top`]);async function qt(e,t){let{placement:n,platform:r,elements:i}=e,a=await(r.isRTL==null?void 0:r.isRTL(i.floating)),o=Y(n),s=Ye(n),c=X(n)===`y`,l=Kt.has(o)?-1:1,u=a&&c?-1:1,d=J(t,e),{mainAxis:f,crossAxis:p,alignmentAxis:m}=typeof d==`number`?{mainAxis:d,crossAxis:0,alignmentAxis:null}:{mainAxis:d.mainAxis||0,crossAxis:d.crossAxis||0,alignmentAxis:d.alignmentAxis};return s&&typeof m==`number`&&(p=s===`end`?m*-1:m),c?{x:p*u,y:f*l}:{x:f*l,y:p*u}}var Jt=function(e){return e===void 0&&(e=0),{name:`offset`,options:e,async fn(t){var n;let{x:r,y:i,placement:a,middlewareData:o}=t,s=await qt(t,e);return a===o.offset?.placement&&(n=o.arrow)!=null&&n.alignmentOffset?{}:{x:r+s.x,y:i+s.y,data:{...s,placement:a}}}}},Yt=function(e){return e===void 0&&(e={}),{name:`shift`,options:e,async fn(t){let{x:n,y:r,placement:i,platform:a}=t,{mainAxis:o=!0,crossAxis:s=!1,limiter:c={fn:e=>{let{x:t,y:n}=e;return{x:t,y:n}}},...l}=J(e,t),u={x:n,y:r},d=await a.detectOverflow(t,l),f=X(i),p=Xe(f),m=u[p],h=u[f],g=(e,t)=>Je(t+d[e===`y`?`top`:`left`],t,t-d[e===`y`?`bottom`:`right`]);o&&(m=g(p,m)),s&&(h=g(f,h));let _=c.fn({...t,[p]:m,[f]:h});return{..._,data:{x:_.x-n,y:_.y-r,enabled:{[p]:o,[f]:s}}}}}},Xt=function(e){return e===void 0&&(e={}),{options:e,fn(t){let{x:n,y:r,placement:i,rects:a,middlewareData:o}=t,{offset:s=0,mainAxis:c=!0,crossAxis:l=!0}=J(e,t),u={x:n,y:r},d=X(i),f=Xe(d),p=u[f],m=u[d],h=J(s,t),g=typeof h==`number`?{mainAxis:h,crossAxis:0}:{mainAxis:h.mainAxis??0,crossAxis:h.crossAxis??0};if(c){let e=f===`y`?`height`:`width`,t=a.reference[f]-a.floating[e]+g.mainAxis,n=a.reference[f]+a.reference[e]-g.mainAxis;pn&&(p=n)}if(l){let e=f===`y`?`width`:`height`,t=Kt.has(Y(i)),n=a.reference[d]-a.floating[e]+(t&&o.offset?.[d]||0)+(t?0:g.crossAxis),r=a.reference[d]+a.reference[e]+(t?0:o.offset?.[d]||0)-(t?g.crossAxis:0);mr&&(m=r)}return{[f]:p,[d]:m}}}},Zt=function(e){return e===void 0&&(e={}),{name:`size`,options:e,async fn(t){let{placement:n,rects:r,platform:i,elements:a}=t,{apply:o=()=>{},...s}=J(e,t),c=await i.detectOverflow(t,s),l=Y(n),u=Ye(n),d=X(n)===`y`,{width:f,height:p}=r.floating,m,h;l===`top`||l===`bottom`?(m=l,h=u===(await(i.isRTL==null?void 0:i.isRTL(a.floating))?`start`:`end`)?`left`:`right`):(h=l,m=u===`end`?`top`:`bottom`);let g=p-c.top-c.bottom,_=f-c.left-c.right,v=K(p-c[m],g),y=K(f-c[h],_),b=t.middlewareData.shift,x=!b,S=v,C=y;b!=null&&b.enabled.x&&(C=_),b!=null&&b.enabled.y&&(S=g),x&&!u&&(d?C=f-2*q(c.left,c.right):S=p-2*q(c.top,c.bottom)),await o({...t,availableWidth:C,availableHeight:S});let w=await i.getDimensions(a.floating);return f!==w.width||p!==w.height?{reset:{rects:!0}}:{}}}};function Qt(e){let t=G(e),n=parseFloat(t.width)||0,r=parseFloat(t.height)||0,i=W(e),a=i?e.offsetWidth:n,o=i?e.offsetHeight:r,s=We(n)!==a||We(r)!==o;return s&&(n=a,r=o),{width:n,height:r,$:s}}function $t(e){return U(e)?e:e.contextElement}function en(e){let t=$t(e);if(!W(t))return Ke(1);let n=t.getBoundingClientRect(),{width:r,height:i,$:a}=Qt(t),o=(a?We(n.width):n.width)/r,s=(a?We(n.height):n.height)/i;return(!o||!Number.isFinite(o))&&(o=1),(!s||!Number.isFinite(s))&&(s=1),{x:o,y:s}}var tn=Ke(0);function nn(e){let t=V(e);return!Ie()||!t.visualViewport?tn:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function rn(e,t,n){return t===void 0&&(t=!1),!!n&&t&&n===V(e)}function an(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);let i=e.getBoundingClientRect(),a=$t(e),o=Ke(1);t&&(r?U(r)&&(o=en(r)):o=en(e));let s=rn(a,n,r)?nn(a):Ke(0),c=(i.left+s.x)/o.x,l=(i.top+s.y)/o.y,u=i.width/o.x,d=i.height/o.y;if(a&&r){let e=V(a),t=U(r)?V(r):r,n=e,i=He(n);for(;i&&t!==n;){let e=en(i),t=i.getBoundingClientRect(),r=G(i),a=t.left+(i.clientLeft+parseFloat(r.paddingLeft))*e.x,o=t.top+(i.clientTop+parseFloat(r.paddingTop))*e.y;c*=e.x,l*=e.y,u*=e.x,d*=e.y,c+=a,l+=o,n=V(i),i=He(n)}}return dt({width:u,height:d,x:c,y:l})}function on(e,t){let n=Re(e).scrollLeft;return t?t.left+n:an(H(e)).left+n}function sn(e,t){let n=e.getBoundingClientRect();return{x:n.left+t.scrollLeft-on(e,n),y:n.top+t.scrollTop}}function cn(e){let{elements:t,rect:n,offsetParent:r,strategy:i}=e,a=i===`fixed`,o=H(r),s=t?ke(t.floating):!1;if(r===o||s&&a)return n;let c={scrollLeft:0,scrollTop:0},l=Ke(1),u=Ke(0),d=W(r);if((d||!a)&&((we(r)!==`body`||De(o))&&(c=Re(r)),d)){let e=an(r);l=en(r),u.x=e.x+r.clientLeft,u.y=e.y+r.clientTop}let f=o&&!d&&!a?sn(o,c):Ke(0);return{width:n.width*l.x,height:n.height*l.y,x:n.x*l.x-c.scrollLeft*l.x+u.x+f.x,y:n.y*l.y-c.scrollTop*l.y+u.y+f.y}}function ln(e){return e.getClientRects?Array.from(e.getClientRects()):[]}function un(e){let t=Re(e),n=e.ownerDocument.body,r=q(e.scrollWidth,e.clientWidth,n.scrollWidth,n.clientWidth),i=q(e.scrollHeight,e.clientHeight,n.scrollHeight,n.clientHeight),a=-t.scrollLeft+on(e),o=-t.scrollTop;return G(n).direction===`rtl`&&(a+=q(e.clientWidth,n.clientWidth)-r),{width:r,height:i,x:a,y:o}}var dn=25;function fn(e,t,n){n===void 0&&(n=`viewport`);let r=n===`layoutViewport`,i=V(e),a=H(e),o=i.visualViewport,s=a.clientWidth,c=a.clientHeight,l=0,u=0;if(o){let e=!Ie()||t===`fixed`;r?e||(l=-o.offsetLeft,u=-o.offsetTop):(s=o.width,c=o.height,e&&(l=o.offsetLeft,u=o.offsetTop))}if(on(a)<=0){let e=a.ownerDocument,t=e.body,n=getComputedStyle(t),r=e.compatMode===`CSS1Compat`&&parseFloat(n.marginLeft)+parseFloat(n.marginRight)||0,i=Math.abs(a.clientWidth-t.clientWidth-r),o=getComputedStyle(a).scrollbarGutter===`stable both-edges`?i/2:i;o<=dn&&(s-=o)}return{width:s,height:c,x:l,y:u}}function pn(e,t){let n=an(e,!0,t===`fixed`),r=n.top+e.clientTop,i=n.left+e.clientLeft,a=en(e);return{width:e.clientWidth*a.x,height:e.clientHeight*a.y,x:i*a.x,y:r*a.y}}function mn(e,t,n){let r;if(t===`viewport`||t===`layoutViewport`)r=fn(e,n,t);else if(t===`document`)r=un(H(e));else if(U(t))r=pn(t,n);else{let n=nn(e);r={x:t.x-n.x,y:t.y-n.y,width:t.width,height:t.height}}return dt(r)}function hn(e,t){let n=t.get(e);if(n)return n;let r=Ve(e,[],!1).filter(e=>U(e)&&we(e)!==`body`),i=null,a=G(e).position===`fixed`,o=a?ze(e):e;for(;U(o)&&!Le(o);){let e=G(o),t=Pe(o),n=i?i.position:a?`fixed`:``;!t&&(n===`fixed`||n===`absolute`&&e.position===`static`)?r=r.filter(e=>e!==o):i=e,o=ze(o)}return t.set(e,r),r}function gn(e){let{element:t,boundary:n,rootBoundary:r,strategy:i}=e,a=[...n===`clippingAncestors`?ke(t)?[]:hn(t,this._c):[].concat(n),r],o=mn(t,a[0],i),s=o.top,c=o.right,l=o.bottom,u=o.left;for(let e=1;e{s(!1,1e-7)},1e3)}y=!1}try{r=new IntersectionObserver(b,{...v,root:a.ownerDocument})}catch{r=new IntersectionObserver(b,v)}r.observe(e)}let c=V(e),l=()=>s(n);return c.addEventListener(`resize`,l),s(!0),()=>{c.removeEventListener(`resize`,l),o()}}function Dn(e,t,n,r){r===void 0&&(r={});let{ancestorScroll:i=!0,ancestorResize:a=!0,elementResize:o=typeof ResizeObserver==`function`,layoutShift:s=typeof IntersectionObserver==`function`,animationFrame:c=!1}=r,l=$t(e),u=i||a?[...l?Ve(l):[],...t?Ve(t):[]]:[];u.forEach(e=>{i&&e.addEventListener(`scroll`,n),a&&e.addEventListener(`resize`,n)});let d=l&&s?En(l,n,a):null,f=-1,p=null;o&&(p=new ResizeObserver(e=>{let[r]=e;r&&r.target===l&&p&&t&&(p.unobserve(t),cancelAnimationFrame(f),f=requestAnimationFrame(()=>{var e;(e=p)==null||e.observe(t)})),n()}),l&&!c&&p.observe(l),t&&p.observe(t));let m,h=c?an(e):null;c&&g();function g(){let t=an(e);h&&!Tn(h,t)&&n(),h=t,m=requestAnimationFrame(g)}return n(),()=>{var e;u.forEach(e=>{i&&e.removeEventListener(`scroll`,n),a&&e.removeEventListener(`resize`,n)}),d?.(),(e=p)==null||e.disconnect(),p=null,c&&cancelAnimationFrame(m)}}var On=Jt,kn=Yt,An=zt,jn=Zt,Mn=Ht,Nn=Rt,Pn=Gt,Fn=Xt,In=(e,t,n)=>{let r=new Map,i=n??{},a={...wn,...i.platform,_c:r};return Lt(e,t,{...i,platform:a})},Ln=typeof document<`u`?x.useLayoutEffect:function(){};function Rn(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(typeof e==`function`&&e.toString()===t.toString())return!0;let n,r,i;if(e&&t&&typeof e==`object`){if(Array.isArray(e)){if(n=e.length,n!==t.length)return!1;for(r=n;r--!==0;)if(!Rn(e[r],t[r]))return!1;return!0}if(i=Object.keys(e),n=i.length,n!==Object.keys(t).length)return!1;for(r=n;r--!==0;)if(!{}.hasOwnProperty.call(t,i[r]))return!1;for(r=n;r--!==0;){let n=i[r];if(!(n===`_owner`&&e.$$typeof)&&!Rn(e[n],t[n]))return!1}return!0}return e!==e&&t!==t}function zn(e){return typeof window>`u`?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function Bn(e,t){let n=zn(e);return Math.round(t*n)/n}function Vn(e){let t=x.useRef(e);return Ln(()=>{t.current=e}),t}function Hn(e){e===void 0&&(e={});let{placement:t=`bottom`,strategy:n=`absolute`,middleware:r=[],platform:i,elements:{reference:a,floating:o}={},transform:s=!0,whileElementsMounted:c,open:l}=e,[u,d]=x.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[f,p]=x.useState(r);Rn(f,r)||p(r);let[m,h]=x.useState(null),[g,_]=x.useState(null),v=x.useCallback(e=>{e!==w.current&&(w.current=e,h(e))},[]),y=x.useCallback(e=>{e!==T.current&&(T.current=e,_(e))},[]),b=a||m,S=o||g,w=x.useRef(null),T=x.useRef(null),E=x.useRef(u),D=c!=null,O=Vn(c),k=Vn(i),A=Vn(l),j=x.useCallback(()=>{if(!w.current||!T.current)return;let e={placement:t,strategy:n,middleware:f};k.current&&(e.platform=k.current),In(w.current,T.current,e).then(e=>{let t={...e,isPositioned:A.current!==!1};M.current&&!Rn(E.current,t)&&(E.current=t,C.flushSync(()=>{d(t)}))})},[f,t,n,k,A]);Ln(()=>{l===!1&&E.current.isPositioned&&(E.current.isPositioned=!1,d(e=>({...e,isPositioned:!1})))},[l]);let M=x.useRef(!1);Ln(()=>(M.current=!0,()=>{M.current=!1}),[]),Ln(()=>{if(b&&(w.current=b),S&&(T.current=S),b&&S){if(O.current)return O.current(b,S,j);j()}},[b,S,j,O,D]);let N=x.useMemo(()=>({reference:w,floating:T,setReference:v,setFloating:y}),[v,y]),P=x.useMemo(()=>({reference:b,floating:S}),[b,S]),F=x.useMemo(()=>{let e={position:n,left:0,top:0};if(!P.floating)return e;let t=Bn(P.floating,u.x),r=Bn(P.floating,u.y);return s?{...e,transform:`translate(`+t+`px, `+r+`px)`,...zn(P.floating)>=1.5&&{willChange:`transform`}}:{position:n,left:t,top:r}},[n,s,P.floating,u.x,u.y]);return x.useMemo(()=>({...u,update:j,refs:N,elements:P,floatingStyles:F}),[u,j,N,P,F])}var Un=e=>{function t(e){return{}.hasOwnProperty.call(e,`current`)}return{name:`arrow`,options:e,fn(n){let{element:r,padding:i}=typeof e==`function`?e(n):e;return r&&t(r)?r.current==null?{}:Nn({element:r.current,padding:i}).fn(n):r?Nn({element:r,padding:i}).fn(n):{}}}},Wn=(e,t)=>{let n=On(e);return{name:n.name,fn:n.fn,options:[e,t]}},Gn=(e,t)=>{let n=kn(e);return{name:n.name,fn:n.fn,options:[e,t]}},Kn=(e,t)=>({fn:Fn(e).fn,options:[e,t]}),qn=(e,t)=>{let n=An(e);return{name:n.name,fn:n.fn,options:[e,t]}},Jn=(e,t)=>{let n=jn(e);return{name:n.name,fn:n.fn,options:[e,t]}},Yn=(e,t)=>{let n=Mn(e);return{name:n.name,fn:n.fn,options:[e,t]}},Xn=(e,t)=>{let n=Pn(e);return{name:n.name,fn:n.fn,options:[e,t]}},Zn=(e,t)=>{let n=Un(e);return{name:n.name,fn:n.fn,options:[e,t]}};function Qn(e){let t=x.useRef(void 0),n=x.useCallback(t=>{let n=e.map(e=>{if(e!=null){if(typeof e==`function`){let n=e,r=n(t);return typeof r==`function`?r:()=>{n(null)}}return e.current=t,()=>{e.current=null}}});return()=>{n.forEach(e=>e?.())}},e);return x.useMemo(()=>e.every(e=>e==null)?null:e=>{t.current&&=(t.current(),void 0),e!=null&&(t.current=n(e))},e)}var $n=`data-floating-ui-focusable`,er=`active`,tr=`selected`,nr=`ArrowLeft`,rr=`ArrowRight`,ir=`ArrowUp`,ar=`ArrowDown`,or=[nr,rr],sr=[ir,ar];[...or,...sr];var cr={...x},lr=!1,ur=0,dr=()=>`floating-ui-`+Math.random().toString(36).slice(2,6)+ur++;function fr(){let[e,t]=x.useState(()=>lr?dr():void 0);return Z(()=>{e??t(dr())},[]),x.useEffect(()=>{lr=!0},[]),e}var pr=cr.useId||fr;function mr(){let e=new Map;return{emit(t,n){var r;(r=e.get(t))==null||r.forEach(e=>e(n))},on(t,n){e.has(t)||e.set(t,new Set),e.get(t).add(n)},off(t,n){var r;(r=e.get(t))==null||r.delete(n)}}}var hr=x.createContext(null),gr=x.createContext(null),_r=()=>x.useContext(hr)?.id||null,vr=()=>x.useContext(gr);function yr(e){return`data-floating-ui-`+e}function $(e){e.current!==-1&&(clearTimeout(e.current),e.current=-1)}var br=yr(`safe-polygon`);function xr(e,t,n){if(n&&!At(n))return 0;if(typeof e==`number`)return e;if(typeof e==`function`){let n=e();return typeof n==`number`?n:n?.[t]}return e?.[t]}function Sr(e){return typeof e==`function`?e():e}function Cr(e,t){t===void 0&&(t={});let{open:n,onOpenChange:r,dataRef:i,events:a,elements:o}=e,{enabled:s=!0,delay:c=0,handleClose:l=null,mouseOnly:u=!1,restMs:d=0,move:f=!0}=t,p=vr(),m=_r(),h=Mt(l),g=Mt(c),_=Mt(n),v=Mt(d),y=x.useRef(),b=x.useRef(-1),S=x.useRef(),C=x.useRef(-1),w=x.useRef(!0),T=x.useRef(!1),E=x.useRef(()=>{}),D=x.useRef(!1),O=Q(()=>{let e=i.current.openEvent?.type;return e?.includes(`mouse`)&&e!==`mousedown`});x.useEffect(()=>{if(!s)return;function e(e){let{open:t}=e;t||($(b),$(C),w.current=!0,D.current=!1)}return a.on(`openchange`,e),()=>{a.off(`openchange`,e)}},[s,a]),x.useEffect(()=>{if(!s||!h.current||!n)return;function e(e){O()&&r(!1,e,`hover`)}let t=wt(o.floating).documentElement;return t.addEventListener(`mouseleave`,e),()=>{t.removeEventListener(`mouseleave`,e)}},[o.floating,n,r,s,h,O]);let k=x.useCallback(function(e,t,n){t===void 0&&(t=!0),n===void 0&&(n=`hover`);let i=xr(g.current,`close`,y.current);i&&!S.current?($(b),b.current=window.setTimeout(()=>r(!1,e,n),i)):t&&($(b),r(!1,e,n))},[g,r]),A=Q(()=>{E.current(),S.current=void 0}),j=Q(()=>{if(T.current){let e=wt(o.floating).body;e.style.pointerEvents=``,e.removeAttribute(br),T.current=!1}}),M=Q(()=>i.current.openEvent?[`click`,`mousedown`].includes(i.current.openEvent.type):!1);x.useEffect(()=>{if(!s)return;function e(e){if($(b),w.current=!1,u&&!At(y.current)||Sr(v.current)>0&&!xr(g.current,`open`))return;let t=xr(g.current,`open`,y.current);t?b.current=window.setTimeout(()=>{_.current||r(!0,e,`hover`)},t):n||r(!0,e,`hover`)}function t(e){if(M()){j();return}E.current();let t=wt(o.floating);if($(C),D.current=!1,h.current&&i.current.floatingContext){n||$(b),S.current=h.current({...i.current.floatingContext,tree:p,x:e.clientX,y:e.clientY,onClose(){j(),A(),M()||k(e,!0,`safe-polygon`)}});let r=S.current;t.addEventListener(`mousemove`,r),E.current=()=>{t.removeEventListener(`mousemove`,r)};return}(y.current!==`touch`||!bt(o.floating,e.relatedTarget))&&k(e)}function a(e){M()||i.current.floatingContext&&(h.current==null||h.current({...i.current.floatingContext,tree:p,x:e.clientX,y:e.clientY,onClose(){j(),A(),M()||k(e)}})(e))}function c(){$(b)}function l(e){M()||k(e,!1)}if(U(o.domReference)){let r=o.domReference,i=o.floating;return n&&r.addEventListener(`mouseleave`,a),f&&r.addEventListener(`mousemove`,e,{once:!0}),r.addEventListener(`mouseenter`,e),r.addEventListener(`mouseleave`,t),i&&(i.addEventListener(`mouseleave`,a),i.addEventListener(`mouseenter`,c),i.addEventListener(`mouseleave`,l)),()=>{n&&r.removeEventListener(`mouseleave`,a),f&&r.removeEventListener(`mousemove`,e),r.removeEventListener(`mouseenter`,e),r.removeEventListener(`mouseleave`,t),i&&(i.removeEventListener(`mouseleave`,a),i.removeEventListener(`mouseenter`,c),i.removeEventListener(`mouseleave`,l))}}},[o,s,e,u,f,k,A,j,r,n,_,p,g,h,i,M,v]),Z(()=>{var e;if(s&&n&&(e=h.current)!=null&&(e=e.__options)!=null&&e.blockPointerEvents&&O()){T.current=!0;let e=o.floating;if(U(o.domReference)&&e){var t;let n=wt(o.floating).body;n.setAttribute(br,``);let r=o.domReference,i=p==null||(t=p.nodesRef.current.find(e=>e.id===m))==null||(t=t.context)==null?void 0:t.elements.floating;return i&&(i.style.pointerEvents=``),n.style.pointerEvents=`none`,r.style.pointerEvents=`auto`,e.style.pointerEvents=`auto`,()=>{n.style.pointerEvents=``,r.style.pointerEvents=``,e.style.pointerEvents=``}}}},[s,n,m,o,p,h,O]),Z(()=>{n||(y.current=void 0,D.current=!1,A(),j())},[n,A,j]),x.useEffect(()=>()=>{A(),$(b),$(C),j()},[s,o.domReference,A,j]);let N=x.useMemo(()=>{function e(e){y.current=e.pointerType}return{onPointerDown:e,onPointerEnter:e,onMouseMove(e){let{nativeEvent:t}=e;function i(){!w.current&&!_.current&&r(!0,t,`hover`)}(!u||At(y.current))&&(n||Sr(v.current)===0||D.current&&e.movementX**2+e.movementY**2<2||($(C),y.current===`touch`?i():(D.current=!0,C.current=window.setTimeout(i,Sr(v.current)))))}}},[u,r,n,_,v]);return x.useMemo(()=>s?{reference:N}:{},[s,N])}var wr=()=>{},Tr=x.createContext({delay:0,initialDelay:0,timeoutMs:0,currentId:null,setCurrentId:wr,setState:wr,isInstantPhase:!1}),Er=()=>x.useContext(Tr);function Dr(e){let{children:t,delay:n,timeoutMs:r=0}=e,[i,a]=x.useReducer((e,t)=>({...e,...t}),{delay:n,timeoutMs:r,initialDelay:n,currentId:null,isInstantPhase:!1}),o=x.useRef(null),s=x.useCallback(e=>{a({currentId:e})},[]);return Z(()=>{i.currentId?o.current===null?o.current=i.currentId:i.isInstantPhase||a({isInstantPhase:!0}):(i.isInstantPhase&&a({isInstantPhase:!1}),o.current=null)},[i.currentId,i.isInstantPhase]),(0,w.jsx)(Tr.Provider,{value:x.useMemo(()=>({...i,setState:a,setCurrentId:s}),[i,s]),children:t})}function Or(e,t){t===void 0&&(t={});let{open:n,onOpenChange:r,floatingId:i}=e,{id:a,enabled:o=!0}=t,s=a??i,c=Er(),{currentId:l,setCurrentId:u,initialDelay:d,setState:f,timeoutMs:p}=c;return Z(()=>{o&&l&&(f({delay:{open:1,close:xr(d,`close`)}}),l!==s&&r(!1))},[o,s,r,f,l,d]),Z(()=>{function e(){r(!1),f({delay:d,currentId:null})}if(o&&l&&!n&&l===s){if(p){let t=window.setTimeout(e,p);return()=>{clearTimeout(t)}}e()}},[o,n,f,l,s,r,d,p]),Z(()=>{o&&u!==wr&&n&&u(s)},[o,n,u,s]),c}function kr(e,t){if(!e||!t)return!1;let n=t.getRootNode==null?void 0:t.getRootNode();if(e.contains(t))return!0;if(n&&Ee(n)){let n=t;for(;n;){if(e===n)return!0;n=n.parentNode||n.host}}return!1}function Ar(e){return`composedPath`in e?e.composedPath()[0]:e.target}var jr={pointerdown:`onPointerDown`,mousedown:`onMouseDown`,click:`onClick`},Mr={pointerdown:`onPointerDownCapture`,mousedown:`onMouseDownCapture`,click:`onClickCapture`},Nr=e=>({escapeKey:typeof e==`boolean`?e:e?.escapeKey??!1,outsidePress:typeof e==`boolean`?e:e?.outsidePress??!0});function Pr(e,t){t===void 0&&(t={});let{open:n,onOpenChange:r,elements:i,dataRef:a}=e,{enabled:o=!0,escapeKey:s=!0,outsidePress:c=!0,outsidePressEvent:l=`pointerdown`,referencePress:u=!1,referencePressEvent:d=`pointerdown`,ancestorScroll:f=!1,bubbles:p,capture:m}=t,h=vr(),g=Q(typeof c==`function`?c:()=>!1),_=typeof c==`function`?g:c,v=x.useRef(!1),{escapeKey:y,outsidePress:b}=Nr(p),{escapeKey:S,outsidePress:C}=Nr(m),w=x.useRef(!1),T=Q(e=>{if(!n||!o||!s||e.key!==`Escape`||w.current)return;let t=a.current.floatingContext?.nodeId,i=h?Ot(h.nodesRef.current,t):[];if(!y&&(e.stopPropagation(),i.length>0)){let e=!0;if(i.forEach(t=>{var n;if((n=t.context)!=null&&n.open&&!t.context.dataRef.current.__escapeKeyBubbles){e=!1;return}}),!e)return}r(!1,kt(e)?e.nativeEvent:e,`escape-key`)}),E=Q(e=>{var t;let n=()=>{var t;T(e),(t=xt(e))==null||t.removeEventListener(`keydown`,n)};(t=xt(e))==null||t.addEventListener(`keydown`,n)}),D=Q(e=>{let t=a.current.insideReactTree;a.current.insideReactTree=!1;let n=v.current;if(v.current=!1,l===`click`&&n||t||typeof _==`function`&&!_(e))return;let o=xt(e),s=`[`+yr(`inert`)+`]`,c=wt(i.floating).querySelectorAll(s),u=U(o)?o:null;for(;u&&!Le(u);){let e=ze(u);if(Le(e)||!U(e))break;u=e}if(c.length&&U(o)&&!Ct(o)&&!bt(o,i.floating)&&Array.from(c).every(e=>!bt(u,e)))return;if(W(o)&&A){let t=Le(o),n=G(o),r=/auto|scroll/,i=t||r.test(n.overflowX),a=t||r.test(n.overflowY),s=i&&o.clientWidth>0&&o.scrollWidth>o.clientWidth,c=a&&o.clientHeight>0&&o.scrollHeight>o.clientHeight,l=n.direction===`rtl`,u=c&&(l?e.offsetX<=o.offsetWidth-o.clientWidth:e.offsetX>o.clientWidth),d=s&&e.offsetY>o.clientHeight;if(u||d)return}let d=a.current.floatingContext?.nodeId,f=h&&Ot(h.nodesRef.current,d).some(t=>St(e,t.context?.elements.floating));if(St(e,i.floating)||St(e,i.domReference)||f)return;let p=h?Ot(h.nodesRef.current,d):[];if(p.length>0){let e=!0;if(p.forEach(t=>{var n;if((n=t.context)!=null&&n.open&&!t.context.dataRef.current.__outsidePressBubbles){e=!1;return}}),!e)return}r(!1,e,`outside-press`)}),O=Q(e=>{var t;let n=()=>{var t;D(e),(t=xt(e))==null||t.removeEventListener(l,n)};(t=xt(e))==null||t.addEventListener(l,n)});x.useEffect(()=>{if(!n||!o)return;a.current.__escapeKeyBubbles=y,a.current.__outsidePressBubbles=b;let e=-1;function t(e){r(!1,e,`ancestor-scroll`)}function c(){window.clearTimeout(e),w.current=!0}function u(){e=window.setTimeout(()=>{w.current=!1},Ie()?5:0)}let d=wt(i.floating);s&&(d.addEventListener(`keydown`,S?E:T,S),d.addEventListener(`compositionstart`,c),d.addEventListener(`compositionend`,u)),_&&d.addEventListener(l,C?O:D,C);let p=[];return f&&(U(i.domReference)&&(p=Ve(i.domReference)),U(i.floating)&&(p=p.concat(Ve(i.floating))),!U(i.reference)&&i.reference&&i.reference.contextElement&&(p=p.concat(Ve(i.reference.contextElement)))),p=p.filter(e=>e!==d.defaultView?.visualViewport),p.forEach(e=>{e.addEventListener(`scroll`,t)}),()=>{s&&(d.removeEventListener(`keydown`,S?E:T,S),d.removeEventListener(`compositionstart`,c),d.removeEventListener(`compositionend`,u)),_&&d.removeEventListener(l,C?O:D,C),p.forEach(e=>{e.removeEventListener(`scroll`,t)}),window.clearTimeout(e)}},[a,i,s,_,l,n,r,f,o,y,b,T,S,E,D,C,O]),x.useEffect(()=>{a.current.insideReactTree=!1},[a,_,l]);let k=x.useMemo(()=>({onKeyDown:T,...u&&{[jr[d]]:e=>{r(!1,e.nativeEvent,`reference-press`)},...d!==`click`&&{onClick(e){r(!1,e.nativeEvent,`reference-press`)}}}}),[T,r,u,d]),A=x.useMemo(()=>{function e(e){e.button===0&&(v.current=!0)}return{onKeyDown:T,onMouseDown:e,onMouseUp:e,[Mr[l]]:()=>{a.current.insideReactTree=!0}}},[T,l,a]);return x.useMemo(()=>o?{reference:k,floating:A}:{},[o,k,A])}function Fr(e){let{open:t=!1,onOpenChange:n,elements:r}=e,i=pr(),a=x.useRef({}),[o]=x.useState(()=>mr()),s=_r()!=null,[c,l]=x.useState(r.reference),u=Q((e,t,r)=>{a.current.openEvent=e?t:void 0,o.emit(`openchange`,{open:e,event:t,reason:r,nested:s}),n?.(e,t,r)}),d=x.useMemo(()=>({setPositionReference:l}),[]),f=x.useMemo(()=>({reference:c||r.reference||null,floating:r.floating||null,domReference:r.reference}),[c,r.reference,r.floating]);return x.useMemo(()=>({dataRef:a,open:t,onOpenChange:u,elements:f,events:o,floatingId:i,refs:d}),[t,u,f,o,i,d])}function Ir(e){let{elements:t,...n}=e===void 0?{}:e,{nodeId:r}=n,i=Fr({...n,elements:{reference:t?.reference??null,floating:t?.floating??null}}),a=n.rootContext||i,o=a.elements,[s,c]=x.useState(null),[l,u]=x.useState(null),d=o?.domReference||s,f=x.useRef(null),p=vr();Z(()=>{d&&(f.current=d)},[d]);let m=Hn({...n,elements:{...o,...l&&{reference:l}}}),h=x.useCallback(e=>{let t=U(e)?{getBoundingClientRect:()=>e.getBoundingClientRect(),getClientRects:()=>e.getClientRects(),contextElement:e}:e;u(t),m.refs.setReference(t)},[m.refs]),g=x.useCallback(e=>{(U(e)||e===null)&&(f.current=e,c(e)),(U(m.refs.reference.current)||m.refs.reference.current===null||e!==null&&!U(e))&&m.refs.setReference(e)},[m.refs]),_=x.useMemo(()=>({...m.refs,setReference:g,setPositionReference:h,domReference:f}),[m.refs,g,h]),v=x.useMemo(()=>({...m.elements,domReference:d}),[m.elements,d]),y=x.useMemo(()=>({...m,...a,refs:_,elements:v,nodeId:r}),[m,_,v,r,a]);return Z(()=>{a.dataRef.current.floatingContext=y;let e=p?.nodesRef.current.find(e=>e.id===r);e&&(e.context=y)}),x.useMemo(()=>({...m,context:y,refs:_,elements:v}),[m,_,v,y])}function Lr(){return ht()&&mt()}function Rr(e,t){t===void 0&&(t={});let{open:n,onOpenChange:r,events:i,dataRef:a,elements:o}=e,{enabled:s=!0,visibleOnly:c=!0}=t,l=x.useRef(!1),u=x.useRef(-1),d=x.useRef(!0);x.useEffect(()=>{if(!s)return;let e=V(o.domReference);function t(){!n&&W(o.domReference)&&o.domReference===yt(wt(o.domReference))&&(l.current=!0)}function r(){d.current=!0}function i(){d.current=!1}return e.addEventListener(`blur`,t),Lr()&&(e.addEventListener(`keydown`,r,!0),e.addEventListener(`pointerdown`,i,!0)),()=>{e.removeEventListener(`blur`,t),Lr()&&(e.removeEventListener(`keydown`,r,!0),e.removeEventListener(`pointerdown`,i,!0))}},[o.domReference,n,s]),x.useEffect(()=>{if(!s)return;function e(e){let{reason:t}=e;(t===`reference-press`||t===`escape-key`)&&(l.current=!0)}return i.on(`openchange`,e),()=>{i.off(`openchange`,e)}},[i,s]),x.useEffect(()=>()=>{$(u)},[]);let f=x.useMemo(()=>({onMouseLeave(){l.current=!1},onFocus(e){if(l.current)return;let t=xt(e.nativeEvent);if(c&&U(t)){if(Lr()&&!e.relatedTarget){if(!d.current&&!Tt(t))return}else if(!Et(t))return}r(!0,e.nativeEvent,`focus`)},onBlur(e){l.current=!1;let t=e.relatedTarget,n=e.nativeEvent,i=U(t)&&t.hasAttribute(yr(`focus-guard`))&&t.getAttribute(`data-type`)===`outside`;u.current=window.setTimeout(()=>{let e=yt(o.domReference?o.domReference.ownerDocument:document);(t||e!==o.domReference)&&(bt(a.current.floatingContext?.refs.floating.current,e)||bt(o.domReference,e)||i||r(!1,n,`focus`))})}}),[a,o.domReference,r,c]);return x.useMemo(()=>s?{reference:f}:{},[s,f])}function zr(e,t,n){let r=new Map,i=n===`item`,a=e;if(i&&e){let{[er]:t,[tr]:n,...r}=e;a=r}return{...n===`floating`&&{tabIndex:-1,[$n]:``},...a,...t.map(t=>{let r=t?t[n]:null;return typeof r==`function`?e?r(e):null:r}).concat(e).reduce((e,t)=>(t&&Object.entries(t).forEach(t=>{let[n,a]=t;if(!(i&&[er,tr].includes(n))){if(n.indexOf(`on`)===0){if(r.has(n)||r.set(n,[]),typeof a==`function`){var o;(o=r.get(n))==null||o.push(a),e[n]=function(){var e=[...arguments];return r.get(n)?.map(t=>t(...e)).find(e=>e!==void 0)}}}else e[n]=a}}),e),{})}}function Br(e){e===void 0&&(e=[]);let t=e.map(e=>e?.reference),n=e.map(e=>e?.floating),r=e.map(e=>e?.item),i=x.useCallback(t=>zr(t,e,`reference`),t),a=x.useCallback(t=>zr(t,e,`floating`),n),o=x.useCallback(t=>zr(t,e,`item`),r);return x.useMemo(()=>({getReferenceProps:i,getFloatingProps:a,getItemProps:o}),[i,a,o])}var Vr=new Map([[`select`,`listbox`],[`combobox`,`listbox`],[`label`,!1]]);function Hr(e,t){t===void 0&&(t={});let{open:n,elements:r,floatingId:i}=e,{enabled:a=!0,role:o=`dialog`}=t,s=pr(),c=r.domReference?.id||s,l=x.useMemo(()=>Dt(r.floating)?.id||i,[r.floating,i]),u=Vr.get(o)??o,d=_r()!=null,f=x.useMemo(()=>u===`tooltip`||o===`label`?{[`aria-`+(o===`label`?`labelledby`:`describedby`)]:n?l:void 0}:{"aria-expanded":n?`true`:`false`,"aria-haspopup":u===`alertdialog`?`dialog`:u,"aria-controls":n?l:void 0,...u===`listbox`&&{role:`combobox`},...u===`menu`&&{id:c},...u===`menu`&&d&&{role:`menuitem`},...o===`select`&&{"aria-autocomplete":`none`},...o===`combobox`&&{"aria-autocomplete":`list`}},[u,l,d,n,c,o]),p=x.useMemo(()=>{let e={id:l,...u&&{role:u}};return u===`tooltip`||o===`label`?e:{...e,...u===`menu`&&{"aria-labelledby":c}}},[u,l,c,o]),m=x.useCallback(e=>{let{active:t,selected:n}=e,r={role:`option`,...t&&{id:l+`-fui-option`}};switch(o){case`select`:case`combobox`:return{...r,"aria-selected":n}}return{}},[l,o]);return x.useMemo(()=>a?{reference:f,floating:p,item:m}:{},[a,f,p,m])}function Ur(e,t,n){return n===void 0&&(n=!0),e.filter(e=>e.parentId===t&&(!n||e.context?.open)).flatMap(t=>[t,...Ur(e,t.id,n)])}function Wr(e,t){let[n,r]=e,i=!1,a=t.length;for(let e=0,o=a-1;e=r!=l>=r&&n<=(c-a)*(r-s)/(l-s)+a&&(i=!i)}return i}function Gr(e,t){return e[0]>=t.x&&e[0]<=t.x+t.width&&e[1]>=t.y&&e[1]<=t.y+t.height}function Kr(e){e===void 0&&(e={});let{buffer:t=.5,blockPointerEvents:n=!1,requireIntent:r=!0}=e,i={current:-1},a=!1,o=null,s=null,c=typeof performance<`u`?performance.now():0;function l(e,t){let n=performance.now(),r=n-c;if(o===null||s===null||r===0)return o=e,s=t,c=n,null;let i=e-o,a=t-s,l=Math.sqrt(i*i+a*a)/r;return o=e,s=t,c=n,l}let u=e=>{let{x:n,y:o,placement:s,elements:c,onClose:u,nodeId:d,tree:f}=e;return function(e){function p(){$(i),u()}if($(i),!c.domReference||!c.floating||s==null||n==null||o==null)return;let{clientX:m,clientY:h}=e,g=[m,h],_=Ar(e),v=e.type===`mouseleave`,y=kr(c.floating,_),b=kr(c.domReference,_),x=c.domReference.getBoundingClientRect(),S=c.floating.getBoundingClientRect(),C=s.split(`-`)[0],w=n>S.right-S.width/2,T=o>S.bottom-S.height/2,E=Gr(g,x),D=S.width>x.width,O=S.height>x.height,k=(D?x:S).left,A=(D?x:S).right,j=(O?x:S).top,M=(O?x:S).bottom;if(y&&(a=!0,!v))return;if(b&&(a=!1),b&&!v){a=!0;return}if(v&&U(e.relatedTarget)&&kr(c.floating,e.relatedTarget)||f&&Ur(f.nodesRef.current,d).length)return;if(C===`top`&&o>=x.bottom-1||C===`bottom`&&o<=x.top+1||C===`left`&&n>=x.right-1||C===`right`&&n<=x.left+1)return p();let N=[];switch(C){case`top`:N=[[k,x.top+1],[k,S.bottom-1],[A,S.bottom-1],[A,x.top+1]];break;case`bottom`:N=[[k,S.top+1],[k,x.bottom-1],[A,x.bottom-1],[A,S.top+1]];break;case`left`:N=[[S.right-1,M],[S.right-1,j],[x.left+1,j],[x.left+1,M]];break;case`right`:N=[[x.right-1,M],[x.right-1,j],[S.left+1,j],[S.left+1,M]]}function P(e){let[n,r]=e;switch(C){case`top`:return[[D?n+t/2:w?n+t*4:n-t*4,r+t+1],[D?n-t/2:w?n+t*4:n-t*4,r+t+1],[S.left,w||D?S.bottom-t:S.top],[S.right,w?D?S.bottom-t:S.top:S.bottom-t]];case`bottom`:return[[D?n+t/2:w?n+t*4:n-t*4,r-t],[D?n-t/2:w?n+t*4:n-t*4,r-t],[S.left,w||D?S.top+t:S.bottom],[S.right,w?D?S.top+t:S.bottom:S.top+t]];case`left`:{let e=[n+t+1,O?r+t/2:T?r+t*4:r-t*4],i=[n+t+1,O?r-t/2:T?r+t*4:r-t*4];return[[T||O?S.right-t:S.left,S.top],[T?O?S.right-t:S.left:S.right-t,S.bottom],e,i]}case`right`:return[[n-t,O?r+t/2:T?r+t*4:r-t*4],[n-t,O?r-t/2:T?r+t*4:r-t*4],[T||O?S.left+t:S.right,S.top],[T?O?S.left+t:S.right:S.left+t,S.bottom]]}}if(!Wr([m,h],N)){if(a&&!E)return p();if(!v&&r){let t=l(e.clientX,e.clientY);if(t!==null&&t<.1)return p()}Wr([m,h],P([n,o]))?!a&&r&&(i.current=window.setTimeout(p,40)):p()}}};return u.__options={blockPointerEvents:n},u}var qr={scrollHideDelay:1e3,type:`hover`,scrollbars:`xy`},Jr=u((e,{scrollbarSize:t,overscrollBehavior:n,scrollbars:r})=>{let i=n;return n&&r&&(r===`x`?i=`${n} auto`:r===`y`&&(i=`auto ${n}`)),{root:{"--scrollarea-scrollbar-size":g(t),"--scrollarea-over-scroll-behavior":i}}}),Yr=l(e=>{let t=s(`ScrollArea`,qr,e),{classNames:n,className:r,style:a,styles:o,unstyled:c,scrollbarSize:l,vars:u,type:d,scrollHideDelay:f,viewportProps:p,viewportRef:m,onScrollPositionChange:g,children:_,offsetScrollbars:v,scrollbars:y,onBottomReached:b,onTopReached:S,onLeftReached:C,onRightReached:T,overscrollBehavior:E,startScrollPosition:D,verticalScrollbarPosition:O,attributes:k,...A}=t,[j,M]=(0,x.useState)(!1),[N,P]=(0,x.useState)(!1),[ee,ne]=(0,x.useState)(!1),ie=(0,x.useRef)(!0),I=(0,x.useRef)(!1),ae=(0,x.useRef)(!0),oe=(0,x.useRef)(!1),L=i({name:`ScrollArea`,props:t,classes:Se,className:r,style:a,classNames:n,styles:o,unstyled:c,attributes:k,vars:u,varsResolver:Jr}),se=(0,x.useRef)(null),[ce,le]=(0,x.useState)(null),R=Qn([m,se,(0,x.useCallback)(e=>{le(t=>t===e?t:e)},[])]);return F(v===`present`?ce:null,()=>{let e=se.current;e&&(P(e.scrollHeight>e.clientHeight),ne(e.scrollWidth>e.clientWidth))}),h(()=>{D&&se.current&&se.current.scrollTo({left:D.x??0,top:D.y??0})},[]),(0,w.jsxs)(re,{getStyles:L,type:d===`never`?`always`:d,scrollHideDelay:f,scrollbars:y,...L(`root`),...A,children:[(0,w.jsx)(xe,{...p,...L(`viewport`,{style:p?.style}),ref:R,"data-offset-scrollbars":v===!0?`xy`:v||void 0,"data-scrollbars":y||void 0,"data-vertical-scrollbar-position":O||void 0,"data-horizontal-hidden":v===`present`&&!ee?`true`:void 0,"data-vertical-hidden":v===`present`&&!N?`true`:void 0,onScroll:e=>{p?.onScroll?.(e),g?.({x:e.currentTarget.scrollLeft,y:e.currentTarget.scrollTop});let{scrollTop:t,scrollHeight:n,clientHeight:r,scrollLeft:i,scrollWidth:a,clientWidth:o}=e.currentTarget,s=t-(n-r)>=-.8,c=t===0;s&&!I.current&&b?.(),c&&!ie.current&&S?.(),I.current=s,ie.current=c;let l=i-(a-o)>=-.8,u=i===0;l&&!oe.current&&T?.(),u&&!ae.current&&C?.(),oe.current=l,ae.current=u},children:_}),(y===`xy`||y===`x`)&&(0,w.jsx)(ve,{...L(`scrollbar`),orientation:`horizontal`,"data-vertical-scrollbar-position":O||void 0,"data-hidden":d===`never`||v===`present`&&!ee||void 0,forceMount:!0,onMouseEnter:()=>M(!0),onMouseLeave:()=>M(!1),children:(0,w.jsx)(B,{...L(`thumb`)})}),(y===`xy`||y===`y`)&&(0,w.jsx)(ve,{...L(`scrollbar`),orientation:`vertical`,"data-vertical-scrollbar-position":O||void 0,"data-hidden":d===`never`||v===`present`&&!N||void 0,forceMount:!0,onMouseEnter:()=>M(!0),onMouseLeave:()=>M(!1),children:(0,w.jsx)(B,{...L(`thumb`)})}),(0,w.jsx)(te,{...L(`corner`),"data-vertical-scrollbar-position":O||void 0,"data-hovered":j||void 0,"data-hidden":d===`never`||void 0})]})});Yr.displayName=`@mantine/core/ScrollArea`;var Xr=l(e=>{let{children:t,classNames:n,styles:r,scrollbarSize:i,scrollHideDelay:o,type:c,dir:l,offsetScrollbars:u,overscrollBehavior:d,viewportRef:f,onScrollPositionChange:p,unstyled:m,variant:h,viewportProps:g,scrollbars:_,style:v,vars:y,onBottomReached:b,onTopReached:S,startScrollPosition:C,verticalScrollbarPosition:T,onOverflowChange:E,...D}=s(`ScrollAreaAutosize`,qr,e),O=(0,x.useRef)(null),[k,A]=(0,x.useState)(null),j=Qn([f,O,(0,x.useCallback)(e=>{A(t=>t===e?t:e)},[])]),M=(0,x.useRef)(!1),N=(0,x.useRef)(!1),P=(0,x.useEffectEvent)(()=>{let e=O.current;if(!e||!E)return;let t=e.scrollHeight>e.clientHeight;t!==M.current&&(N.current?E(t):(N.current=!0,t&&E(!0)),M.current=t)});return F(E?k:null,P),(0,w.jsx)(a,{...D,variant:h,style:[{display:`flex`,overflow:`hidden`},v],children:(0,w.jsx)(a,{style:{display:`flex`,flexDirection:`column`,flex:1,overflow:`hidden`,..._===`y`&&{minWidth:0},..._===`x`&&{minHeight:0},..._===`xy`&&{minWidth:0,minHeight:0},..._===!1&&{minWidth:0,minHeight:0}},children:(0,w.jsx)(Yr,{classNames:n,styles:r,scrollHideDelay:o,scrollbarSize:i,type:c,dir:l,offsetScrollbars:u,overscrollBehavior:d,viewportRef:j,onScrollPositionChange:p,unstyled:m,variant:h,viewportProps:g,vars:y,scrollbars:_,onBottomReached:b,onTopReached:S,startScrollPosition:C,verticalScrollbarPosition:T,"data-autosize":`true`,children:t})})})});Yr.classes=Se,Yr.varsResolver=Jr,Xr.displayName=`@mantine/core/ScrollAreaAutosize`,Xr.classes=Se,Yr.Autosize=Xr;function Zr(e,t,n,r){return e===`center`||r===`center`?{top:t}:e===`end`?{bottom:n}:e===`start`?{top:n}:{}}function Qr(e,t,n,r,i){return e===`center`||r===`center`?{left:t}:e===`end`?{[i===`ltr`?`right`:`left`]:n}:e===`start`?{[i===`ltr`?`left`:`right`]:n}:{}}var $r={bottom:`borderTopLeftRadius`,left:`borderTopRightRadius`,right:`borderBottomLeftRadius`,top:`borderBottomRightRadius`};function ei({position:e,arrowSize:t,dir:n}){let[r,i]=e.split(`-`);if(!i)return;let a={width:t,height:t,position:`absolute`};if(r===`bottom`){let e=i===`start`,r=e?n===`ltr`?`left`:`right`:n===`ltr`?`right`:`left`;return{...a,top:-t,[r]:0,clipPath:e===(n===`rtl`)?`polygon(100% 0%, 0% 100%, 100% 100%)`:`polygon(0% 0%, 0% 100%, 100% 100%)`}}if(r===`top`){let e=i===`start`,r=e?n===`ltr`?`left`:`right`:n===`ltr`?`right`:`left`;return{...a,bottom:-t,[r]:0,clipPath:e===(n===`rtl`)?`polygon(0% 0%, 100% 0%, 100% 100%)`:`polygon(0% 0%, 100% 0%, 0% 100%)`}}if(r===`left`)return{...a,right:-t,[i===`start`?`top`:`bottom`]:0,clipPath:i===`start`?`polygon(0% 0%, 100% 0%, 0% 100%)`:`polygon(0% 0%, 0% 100%, 100% 100%)`};if(r===`right`)return{...a,left:-t,[i===`start`?`top`:`bottom`]:0,clipPath:i===`start`?`polygon(0% 0%, 100% 0%, 100% 100%)`:`polygon(100% 0%, 0% 100%, 100% 100%)`}}function ti({position:e,arrowSize:t,arrowOffset:n,arrowRadius:r,arrowPosition:i,arrowX:a,arrowY:o,dir:s}){if(i===`merge`){let n=ei({position:e,arrowSize:t,dir:s});if(n)return n}let[c,l=`center`]=e.split(`-`),u={width:t,height:t,transform:`rotate(45deg)`,position:`absolute`,[$r[c]]:r},d=-t/2;return c===`left`?{...u,...Zr(l,o,n,i),right:d,borderLeftColor:`transparent`,borderBottomColor:`transparent`,clipPath:`polygon(100% 0, 0 0, 100% 100%)`}:c===`right`?{...u,...Zr(l,o,n,i),left:d,borderRightColor:`transparent`,borderTopColor:`transparent`,clipPath:`polygon(0 100%, 0 0, 100% 100%)`}:c===`top`?{...u,...Qr(l,a,n,i,s),bottom:d,borderTopColor:`transparent`,borderLeftColor:`transparent`,clipPath:`polygon(0 100%, 100% 100%, 100% 0)`}:c===`bottom`?{...u,...Qr(l,a,n,i,s),top:d,borderBottomColor:`transparent`,borderRightColor:`transparent`,clipPath:`polygon(0 100%, 0 0, 100% 0)`}:{}}function ni({position:e,dir:t}){let[n,r]=e.split(`-`);if(!r)return;let i=r===`start`&&t===`ltr`||r===`end`&&t===`rtl`;if(n===`bottom`)return i?{borderTopLeftRadius:0}:{borderTopRightRadius:0};if(n===`top`)return i?{borderBottomLeftRadius:0}:{borderBottomRightRadius:0};if(n===`left`)return r===`start`?{borderTopRightRadius:0}:{borderBottomRightRadius:0};if(n===`right`)return r===`start`?{borderTopLeftRadius:0}:{borderBottomLeftRadius:0}}function ri({position:e,arrowSize:t,arrowOffset:n,arrowRadius:r,arrowPosition:i,visible:a,arrowX:o,arrowY:s,style:c,...l}){let{dir:u}=M();return a?(0,w.jsx)(`div`,{role:`presentation`,...l,style:{...c,...ti({position:e,arrowSize:t,arrowOffset:n,arrowRadius:r,arrowPosition:i,dir:u,arrowX:o,arrowY:s})}}):null}ri.displayName=`@mantine/core/FloatingArrow`;function ii(e,t){if(e===`rtl`&&(t.includes(`right`)||t.includes(`left`))){let[e,n]=t.split(`-`),r=e===`right`?`left`:`right`;return n===void 0?r:`${r}-${n}`}return t}function ai(e){let t=document.createElement(`div`);return t.setAttribute(`data-portal`,`true`),typeof e.className==`string`&&t.classList.add(...e.className.split(` `).filter(Boolean)),typeof e.style==`object`&&Object.assign(t.style,e.style),typeof e.id==`string`&&t.setAttribute(`id`,e.id),t}var oi=null;function si({target:e,reuseTargetNode:t,...n}){if(e)return typeof e==`string`?document.querySelector(e)||ai(n):e;if(t){if(oi){if(document.body.contains(oi))return oi;oi=null}let e=document.querySelector(`[data-mantine-shared-portal-node]`);if(e)return oi=e,e;let t=ai(n);return t.setAttribute(`data-mantine-shared-portal-node`,`true`),document.body.appendChild(t),oi=t,t}return ai(n)}var ci={reuseTargetNode:!0},li=l(e=>{let{children:t,target:n,reuseTargetNode:i,ref:a,...o}=s(`Portal`,ci,e),[c,l]=(0,x.useState)(!1),u=(0,x.useRef)(null);return h(()=>(l(!0),u.current=si({target:n,reuseTargetNode:i,...o}),r(a,u.current),!n&&!i&&u.current&&document.body.appendChild(u.current),()=>{!n&&!i&&u.current&&document.body.removeChild(u.current)}),[n]),!c||!u.current?null:(0,C.createPortal)((0,w.jsx)(w.Fragment,{children:t}),u.current)});li.displayName=`@mantine/core/Portal`;var ui=l(({withinPortal:e=!0,children:t,...n})=>b()===`test`||!e?(0,w.jsx)(w.Fragment,{children:t}):(0,w.jsx)(li,{...n,children:t}));ui.displayName=`@mantine/core/OptionalPortal`;var di={duration:100,transition:`fade`};function fi(e,t){return{...di,...t,...e}}function pi({offset:e,position:t,defaultOpened:n}){let[r,i]=(0,x.useState)(n),a=(0,x.useRef)(null),{x:o,y:s,elements:c,refs:l,update:u,placement:d}=Ir({placement:t,middleware:[Gn({crossAxis:!0,padding:5,rootBoundary:`document`})]}),f=d.includes(`right`)?e:t.includes(`left`)?e*-1:0,p=d.includes(`bottom`)?e:t.includes(`top`)?e*-1:0,m=(0,x.useCallback)(({clientX:e,clientY:t})=>{Number.isFinite(e)&&Number.isFinite(t)&&l.setPositionReference({getBoundingClientRect(){return{width:0,height:0,x:e,y:t,left:e+f,top:t+p,right:e,bottom:t}}})},[c.reference]);return(0,x.useEffect)(()=>{if(l.floating.current){let e=a.current;e.addEventListener(`mousemove`,m);let t=Ve(l.floating.current);return t.forEach(e=>{e.addEventListener(`scroll`,u)}),()=>{e.removeEventListener(`mousemove`,m),t.forEach(e=>{e.removeEventListener(`scroll`,u)})}}},[c.reference,l.floating.current,u,m,r]),{handleMouseMove:m,x:o,y:s,opened:r,setOpened:i,boundaryRef:a,floating:l.setFloating}}var mi={tooltip:`m_1b3c8819`,arrow:`m_f898399f`},hi={refProp:`ref`,withinPortal:!0,offset:10,position:`right`,zIndex:E(`popover`)},gi=u((e,{radius:t,color:n})=>({tooltip:{"--tooltip-radius":t===void 0?void 0:v(t),"--tooltip-bg":n?o(n,e):void 0,"--tooltip-color":n?`var(--mantine-color-white)`:void 0}})),_i=l(e=>{let t=s(`TooltipFloating`,hi,e),{children:n,refProp:r,withinPortal:o,style:l,className:u,classNames:d,styles:p,unstyled:m,radius:h,color:g,label:_,offset:v,position:b,multiline:S,zIndex:C,disabled:T,defaultOpened:E,variant:D,vars:O,portalProps:j,attributes:M,ref:N,...P}=t,F=c(),ee=i({name:`TooltipFloating`,props:t,classes:mi,className:u,style:l,classNames:d,styles:p,unstyled:m,attributes:M,rootSelector:`tooltip`,vars:O,varsResolver:gi}),{handleMouseMove:te,x:ne,y:re,opened:ie,boundaryRef:I,floating:ae,setOpened:oe}=pi({offset:v,position:b,defaultOpened:E}),L=f(n);if(!L)throw Error(`[@mantine/core] Tooltip.Floating component children should be an element or a component that accepts ref, fragments, strings, numbers and other primitive values are not supported`);let se=y(I,k(L),N),ce=L.props,le=e=>{ce.onMouseEnter?.(e),te(e),oe(!0)},R=e=>{ce.onMouseLeave?.(e),oe(!1)};return(0,w.jsxs)(w.Fragment,{children:[(0,w.jsx)(ui,{...j,withinPortal:o,children:(0,w.jsx)(a,{...P,...ee(`tooltip`,{style:{...A(l,F),zIndex:C,display:!T&&ie?`block`:`none`,top:Number.isFinite(re)?Math.round(re):``,left:Number.isFinite(ne)?Math.round(ne):``}}),variant:D,ref:ae,mod:{multiline:S},children:_})}),(0,x.cloneElement)(L,{...ce,[r]:se,onMouseEnter:le,onMouseLeave:R})]})});_i.classes=mi,_i.varsResolver=gi,_i.displayName=`@mantine/core/TooltipFloating`;var vi=(0,x.createContext)({withinGroup:!1}),yi={openDelay:0,closeDelay:0};function bi(e){let{openDelay:t,closeDelay:n,children:r}=s(`TooltipGroup`,yi,e);return(0,w.jsx)(vi,{value:{withinGroup:!0},children:(0,w.jsx)(Dr,{delay:{open:t,close:n},children:r})})}bi.displayName=`@mantine/core/TooltipGroup`,bi.extend=e=>e;function xi(e){if(e===void 0)return{shift:!0,flip:!0};let t={...e};return e.shift===void 0&&(t.shift=!0),e.flip===void 0&&(t.flip=!0),t}function Si(e){let t=xi(e.middlewares),n=[Wn(e.offset),Yn()];return t.shift&&n.push(Gn(typeof t.shift==`boolean`?{padding:8}:{padding:8,...t.shift})),t.flip&&n.push(typeof t.flip==`boolean`?qn():qn(t.flip)),n.push(Zn({element:e.arrowRef,padding:e.arrowOffset})),t.inline?n.push(typeof t.inline==`boolean`?Xn():Xn(t.inline)):e.inline&&n.push(Xn()),n}function Ci(e){let[t,n]=(0,x.useState)(e.defaultOpened),r=typeof e.opened==`boolean`,i=!e.disabled&&(r?e.opened:t);(0,x.useEffect)(()=>{e.disabled&&n(!1)},[e.disabled]);let a=(0,x.use)(vi).withinGroup,o=_(),s=b(),c=(0,x.useCallback)(e=>{n(e),e&&C(o)},[o]),{x:l,y:u,context:d,refs:f,placement:p,middlewareData:{arrow:{x:m,y:g}={},hide:v}}=Ir({strategy:e.strategy,placement:e.position,open:i,onOpenChange:c,middleware:Si(e),whileElementsMounted:Dn}),{delay:y,currentId:S,setCurrentId:C}=Or(d,{id:o}),{getReferenceProps:w,getFloatingProps:T}=Br([Cr(d,{enabled:!e.disabled&&e.events?.hover,delay:a?y:{open:e.openDelay,close:e.closeDelay},mouseOnly:!e.events?.touch,handleClose:e.interactive?Kr():null}),Rr(d,{enabled:!e.disabled&&e.events?.focus,visibleOnly:!0}),Hr(d,{role:`tooltip`}),Pr(d,{enabled:e.opened===void 0})]),E=(0,x.useRef)(p);h(()=>{E.current!==p&&(E.current=p,e.onPositionChange?.(p))},[p]);let D=i&&S&&S!==o;return{x:l,y:u,arrowX:m,arrowY:g,reference:f.setReference,floating:f.setFloating,getFloatingProps:T,getReferenceProps:w,isGroupPhase:D,opened:i,placement:p,referenceHidden:e.hideDetached&&s!==`test`?v?.referenceHidden:!1}}var wi={position:`top`,refProp:`ref`,withinPortal:!0,arrowSize:4,arrowOffset:5,arrowRadius:0,arrowPosition:`side`,offset:5,transitionProps:{duration:100,transition:`fade`},events:{hover:!0,focus:!1,touch:!1},zIndex:E(`popover`),middlewares:{flip:!0,shift:!0,inline:!1},hideDetached:!0},Ti=u((e,{radius:t,color:n,variant:r,autoContrast:i})=>{let a=e.variantColorResolver({theme:e,color:n||e.primaryColor,autoContrast:i,variant:r||`filled`});return{tooltip:{"--tooltip-radius":t===void 0?void 0:v(t),"--tooltip-bg":n?a.background:void 0,"--tooltip-color":n?a.color:void 0}}}),Ei=l(e=>{let t=s(`Tooltip`,wi,e),{children:n,position:r,refProp:o,label:c,openDelay:l,closeDelay:u,onPositionChange:p,opened:h,defaultOpened:g,withinPortal:_,radius:v,color:b,classNames:S,styles:C,unstyled:T,style:E,className:D,withArrow:O,arrowSize:A,arrowOffset:j,arrowRadius:N,arrowPosition:P,offset:F,transitionProps:ee,multiline:te,events:ne,interactive:re,zIndex:ie,disabled:I,onClick:ae,onMouseEnter:oe,onMouseLeave:L,inline:se,variant:ce,keepMounted:le,vars:R,portalProps:ue,mod:de,floatingStrategy:fe,middlewares:pe,autoContrast:me,attributes:he,target:z,hideDetached:ge,ref:_e,...ve}=t,{dir:ye}=M(),be=(0,x.useRef)(null),B=Ci({position:ii(ye,r),closeDelay:u,openDelay:l,onPositionChange:p,opened:h,defaultOpened:g,disabled:I,events:ne,interactive:re,arrowRef:be,arrowOffset:j,offset:typeof F==`number`?F+(O?A/2:0):F,inline:se,strategy:fe,middlewares:pe,hideDetached:ge});(0,x.useEffect)(()=>{let e=z instanceof HTMLElement?z:typeof z==`string`?document.querySelector(z):z?.current||null;e&&B.reference(e)},[z,B]);let xe=i({name:`Tooltip`,props:t,classes:mi,className:D,style:E,classNames:S,styles:C,unstyled:T,attributes:he,rootSelector:`tooltip`,vars:R,varsResolver:Ti}),Se=f(n);if(!z&&!Se)throw Error(`[@mantine/core] Tooltip component children should be an element or a component that accepts ref, fragments, strings, numbers and other primitive values are not supported`);let Ce=xe(`tooltip`),we=re&&!I&&!!B.opened,V=P===`merge`&&O?ni({position:B.placement,dir:ye}):void 0;if(z){let e=fi(ee,{duration:100,transition:`fade`});return(0,w.jsx)(w.Fragment,{children:(0,w.jsx)(ui,{...ue,withinPortal:_,children:(0,w.jsx)(m,{...e,keepMounted:le,mounted:!I&&!!B.opened,duration:B.isGroupPhase?10:e.duration,children:e=>(0,w.jsxs)(a,{...ve,"data-fixed":fe===`fixed`||void 0,variant:ce,mod:[{multiline:te,interactive:we},de],...Ce,...B.getFloatingProps({ref:B.floating,className:Ce.className,style:{...Ce.style,...e,...V,zIndex:ie,top:B.y??0,left:B.x??0,...B.referenceHidden?{display:`none`}:null}}),children:[c,(0,w.jsx)(ri,{ref:be,arrowX:B.arrowX,arrowY:B.arrowY,visible:O,position:B.placement,arrowSize:A,arrowOffset:j,arrowRadius:N,arrowPosition:P,...xe(`arrow`)})]})})})})}let H=Se.props,Te=y(B.reference,k(Se),_e),U=fi(ee,{duration:100,transition:`fade`});return(0,w.jsxs)(w.Fragment,{children:[(0,w.jsx)(ui,{...ue,withinPortal:_,children:(0,w.jsx)(m,{...U,keepMounted:le,mounted:!I&&!!B.opened,duration:B.isGroupPhase?10:U.duration,children:e=>(0,w.jsxs)(a,{...ve,"data-fixed":fe===`fixed`||void 0,variant:ce,mod:[{multiline:te,interactive:we},de],...B.getFloatingProps({ref:B.floating,className:xe(`tooltip`).className,style:{...xe(`tooltip`).style,...e,...V,zIndex:ie,top:B.y??0,left:B.x??0,...B.referenceHidden?{display:`none`}:null}}),children:[c,(0,w.jsx)(ri,{ref:be,arrowX:B.arrowX,arrowY:B.arrowY,visible:O,position:B.placement,arrowSize:A,arrowOffset:j,arrowRadius:N,arrowPosition:P,...xe(`arrow`)})]})})}),(0,x.cloneElement)(Se,B.getReferenceProps({onClick:ae,onMouseEnter:oe,onMouseLeave:L,onMouseMove:t.onMouseMove,onPointerDown:t.onPointerDown,onPointerEnter:t.onPointerEnter,...H,className:d(D,H.className),[o]:Te}))]})});Ei.classes=mi,Ei.varsResolver=Ti,Ei.displayName=`@mantine/core/Tooltip`,Ei.Floating=_i,Ei.Group=bi;export{k as C,S as E,A as S,E as T,Gn as _,ni as a,le as b,Ir as c,Zn as d,qn as f,Wn as g,Kn as h,ri as i,Cr as l,Xn as m,ui as n,Yr as o,Yn as p,ii as r,Kr as s,Ei as t,Br as u,Jn as v,D as w,M as x,Dn as y}; \ No newline at end of file diff --git a/internal/ui/dist/assets/Tooltip-DhnGSmh7.js b/internal/ui/dist/assets/Tooltip-DhnGSmh7.js deleted file mode 100644 index 899f4c748..000000000 --- a/internal/ui/dist/assets/Tooltip-DhnGSmh7.js +++ /dev/null @@ -1 +0,0 @@ -import{i as e,r as t,s as n}from"./useRouter-ByJ6_rwb.js";import{$ as r,A as i,C as a,K as o,M as s,P as c,T as l,X as u,Y as d,Z as f,_t as p,b as m,it as h,mt as g,nt as _,st as v,tt as y,z as b}from"./brand-Bcp2Tp5I.js";var x=n(e(),1);function S(e){let t=(0,x.createContext)(null);return[t,()=>{let n=(0,x.use)(t);if(n===null)throw Error(e);return n}]}var C=n(p(),1),w=t(),T={app:100,modal:200,popover:300,overlay:400,max:9999};function E(e){return T[e]}function D(e){let t=(0,x.useRef)(e);return(0,x.useEffect)(()=>{t.current=e}),(0,x.useMemo)(()=>((...e)=>t.current?.(...e)),[])}function O(e,t){let{delay:n,flushOnUnmount:r,leading:i,maxWait:a}=typeof t==`number`?{delay:t,flushOnUnmount:!1,leading:!1,maxWait:void 0}:t,o=D(e),s=(0,x.useRef)(0),c=(0,x.useRef)(0),l=(0,x.useRef)(null),u=(0,x.useMemo)(()=>{let e=Object.assign((...t)=>{window.clearTimeout(s.current),l.current=t;let r=e._isFirstCall;e._isFirstCall=!1;function u(){window.clearTimeout(s.current),window.clearTimeout(c.current),s.current=0,c.current=0,e._isFirstCall=!0,e._hasPendingCallback=!1}function d(){a!==void 0&&c.current===0&&(c.current=window.setTimeout(()=>{if(s.current!==0){let e=l.current;u(),o(...e)}},a))}if(i&&r){o(...t),e.flush=()=>{s.current!==0&&(u(),o(...t))},e.cancel=()=>{u()},s.current=window.setTimeout(()=>{u()},n),d();return}if(i&&!r){e._hasPendingCallback=!0,e.flush=()=>{s.current!==0&&(u(),o(...t))},e.cancel=()=>{u()},s.current=window.setTimeout(()=>{u()},n),d();return}e._hasPendingCallback=!0;let f=()=>{s.current!==0&&(u(),o(...t))};e.flush=f,e.cancel=()=>{u()},s.current=window.setTimeout(f,n),d()},{flush:()=>{},cancel:()=>{},isPending:()=>e._hasPendingCallback,_isFirstCall:!0,_hasPendingCallback:!1});return e},[o,n,i,a]);return(0,x.useEffect)(()=>()=>{r?u.flush():u.cancel()},[u,r]),u}function k(e){return e?.props?.ref}function A(e,t){return Array.isArray(e)?[...e].reduce((e,n)=>({...e,...A(n,t)}),{}):typeof e==`function`?e(t):e??{}}var j=(0,x.createContext)({dir:`ltr`,toggleDirection:()=>{},setDirection:()=>{}});function M(){return(0,x.use)(j)}var[N,P]=S(`ScrollArea.Root component was not found in tree`);function F(e,t){let n=(0,x.useEffectEvent)(t);h(()=>{let t=0;if(e){let r=new ResizeObserver(()=>{cancelAnimationFrame(t),t=window.requestAnimationFrame(n)});return r.observe(e),()=>{window.cancelAnimationFrame(t),r.unobserve(e)}}},[e])}function ee(e){let{style:t,...n}=e,r=P(),[i,a]=(0,x.useState)(0),[o,s]=(0,x.useState)(0),c=!!(i&&o);return F(r.scrollbarX,()=>{let e=r.scrollbarX?.offsetHeight||0;r.onCornerHeightChange(e),s(e)}),F(r.scrollbarY,()=>{let e=r.scrollbarY?.offsetWidth||0;r.onCornerWidthChange(e),a(e)}),c?(0,w.jsx)(`div`,{...n,style:{...t,width:i,height:o}}):null}function te(e){let t=P(),n=!!(t.scrollbarX&&t.scrollbarY);return t.type!==`scroll`&&n?(0,w.jsx)(ee,{...e}):null}var ne={scrollHideDelay:1e3,type:`hover`};function re(e){let{type:t,scrollHideDelay:n,scrollbars:r,getStyles:i,ref:o,...c}=s(`ScrollAreaRoot`,ne,e),[l,u]=(0,x.useState)(null),[d,f]=(0,x.useState)(null),[p,m]=(0,x.useState)(null),[h,g]=(0,x.useState)(null),[_,v]=(0,x.useState)(null),[b,S]=(0,x.useState)(0),[C,T]=(0,x.useState)(0),[E,D]=(0,x.useState)(!1),[O,k]=(0,x.useState)(!1),A=y(o,u);return(0,w.jsx)(N,{value:{type:t,scrollHideDelay:n,scrollArea:l,viewport:d,onViewportChange:f,content:p,onContentChange:m,scrollbarX:h,onScrollbarXChange:g,scrollbarXEnabled:E,onScrollbarXEnabledChange:D,scrollbarY:_,onScrollbarYChange:v,scrollbarYEnabled:O,onScrollbarYEnabledChange:k,onCornerWidthChange:S,onCornerHeightChange:T,getStyles:i},children:(0,w.jsx)(a,{...c,ref:A,__vars:{"--sa-corner-width":r===`xy`?`${b}px`:`0px`,"--sa-corner-height":r===`xy`?`${C}px`:`0px`}})})}re.displayName=`@mantine/core/ScrollAreaRoot`;function ie(e,t){let n=e/t;return Number.isNaN(n)?0:n}function I(e){let t=ie(e.viewport,e.content),n=e.scrollbar.paddingStart+e.scrollbar.paddingEnd,r=(e.scrollbar.size-n)*t;return Math.max(r,18)}function ae(e,t){return n=>{if(e[0]===e[1]||t[0]===t[1])return t[0];let r=(t[1]-t[0])/(e[1]-e[0]);return t[0]+r*(n-e[0])}}function oe(e,[t,n]){return Math.min(n,Math.max(t,e))}function L(e,t,n=`ltr`){let r=I(t),i=t.scrollbar.paddingStart+t.scrollbar.paddingEnd,a=t.scrollbar.size-i,o=t.content-t.viewport,s=a-r,c=oe(e,n===`ltr`?[0,o]:[o*-1,0]);return ae([0,o],[0,s])(c)}function se(e,t,n,r=`ltr`){let i=I(n),a=i/2,o=t||a,s=i-o,c=n.scrollbar.paddingStart+o,l=n.scrollbar.size-n.scrollbar.paddingEnd-s,u=n.content-n.viewport,d=r===`ltr`?[0,u]:[u*-1,0];return ae([c,l],d)(e)}function ce(e,t){return e>0&&e{e?.(r),(n===!1||!r.defaultPrevented)&&t?.(r)}}var[ue,de]=S(`ScrollAreaScrollbar was not found in tree`);function fe(e){let{sizes:t,hasThumb:n,onThumbChange:r,onThumbPointerUp:i,onThumbPointerDown:a,onThumbPositionChange:o,onDragScroll:s,onWheelScroll:c,onResize:l,ref:u,...d}=e,f=P(),[p,m]=(0,x.useState)(null),h=y(u,m),g=(0,x.useRef)(null),_=(0,x.useRef)(``),v=t.content-t.viewport,b=(0,x.useEffectEvent)(e=>c(e,v)),S=D(o),C=O(l,10),T=e=>{if(g.current){let t=e.clientX-g.current.left,n=e.clientY-g.current.top;s({x:t,y:n})}};return(0,x.useEffect)(()=>{if(!p)return;let e=e=>b(e);return p.addEventListener(`wheel`,e,{passive:!1}),()=>p.removeEventListener(`wheel`,e)},[p]),(0,x.useEffect)(S,[t,S]),F(p,C),F(f.content,C),(0,w.jsx)(ue,{value:{scrollbar:p,hasThumb:n,onThumbChange:D(r),onThumbPointerUp:D(i),onThumbPositionChange:S,onThumbPointerDown:D(a)},children:(0,w.jsx)(`div`,{...d,ref:h,"data-mantine-scrollbar":!0,style:{position:`absolute`,...d.style},onPointerDown:R(e.onPointerDown,e=>{e.preventDefault(),e.button===0&&(e.target.setPointerCapture(e.pointerId),g.current=p.getBoundingClientRect(),_.current=document.body.style.webkitUserSelect,document.body.style.webkitUserSelect=`none`,T(e))}),onPointerMove:R(e.onPointerMove,T),onPointerUp:R(e.onPointerUp,e=>{let t=e.target;t.hasPointerCapture(e.pointerId)&&(e.preventDefault(),t.releasePointerCapture(e.pointerId))}),onLostPointerCapture:()=>{document.body.style.webkitUserSelect=_.current,g.current=null}})})}var pe=e=>{let{sizes:t,onSizesChange:n,style:r,ref:i,...a}=e,o=P(),[s,c]=(0,x.useState)(),l=(0,x.useRef)(null),u=y(i,l,o.onScrollbarXChange);return(0,x.useEffect)(()=>{l.current&&c(getComputedStyle(l.current))},[l]),(0,w.jsx)(fe,{"data-orientation":`horizontal`,...a,ref:u,sizes:t,style:{...r,"--sa-thumb-width":`${I(t)}px`},onThumbPointerDown:t=>e.onThumbPointerDown(t.x),onDragScroll:t=>e.onDragScroll(t.x),onWheelScroll:(t,n)=>{if(o.viewport){let r=o.viewport.scrollLeft+t.deltaX;e.onWheelScroll(r),ce(r,n)&&t.preventDefault()}},onResize:()=>{l.current&&o.viewport&&s&&n({content:o.viewport.scrollWidth,viewport:o.viewport.offsetWidth,scrollbar:{size:l.current.clientWidth,paddingStart:le(s.paddingLeft),paddingEnd:le(s.paddingRight)}})}})};pe.displayName=`@mantine/core/ScrollAreaScrollbarX`;function me(e){let{sizes:t,onSizesChange:n,style:r,ref:i,...a}=e,o=P(),[s,c]=(0,x.useState)(),l=(0,x.useRef)(null),u=y(i,l,o.onScrollbarYChange);return(0,x.useEffect)(()=>{l.current&&c(window.getComputedStyle(l.current))},[]),(0,w.jsx)(fe,{...a,"data-orientation":`vertical`,ref:u,sizes:t,style:{"--sa-thumb-height":`${I(t)}px`,...r},onThumbPointerDown:t=>e.onThumbPointerDown(t.y),onDragScroll:t=>e.onDragScroll(t.y),onWheelScroll:(t,n)=>{if(o.viewport){let r=o.viewport.scrollTop+t.deltaY;e.onWheelScroll(r),ce(r,n)&&t.preventDefault()}},onResize:()=>{l.current&&o.viewport&&s&&n({content:o.viewport.scrollHeight,viewport:o.viewport.offsetHeight,scrollbar:{size:l.current.clientHeight,paddingStart:le(s.paddingTop),paddingEnd:le(s.paddingBottom)}})}})}me.displayName=`@mantine/core/ScrollAreaScrollbarY`;function he(e){let{orientation:t=`vertical`,...n}=e,{dir:r}=M(),i=P(),a=(0,x.useRef)(null),o=(0,x.useRef)(0),[s,c]=(0,x.useState)({content:0,viewport:0,scrollbar:{size:0,paddingStart:0,paddingEnd:0}}),l=ie(s.viewport,s.content),u={...n,sizes:s,onSizesChange:c,hasThumb:l>0&&l<1,onThumbChange:e=>{a.current=e},onThumbPointerUp:()=>{o.current=0},onThumbPointerDown:e=>{o.current=e}},d=(e,t)=>se(e,o.current,s,t);return t===`horizontal`?(0,w.jsx)(pe,{...u,onThumbPositionChange:()=>{if(i.viewport&&a.current){let e=i.viewport.scrollLeft,t=L(e,s,r);a.current.style.transform=`translate3d(${t}px, 0, 0)`}},onWheelScroll:e=>{i.viewport&&(i.viewport.scrollLeft=e)},onDragScroll:e=>{i.viewport&&(i.viewport.scrollLeft=d(e,r))}}):t===`vertical`?(0,w.jsx)(me,{...u,onThumbPositionChange:()=>{if(i.viewport&&a.current){let e=i.viewport.scrollTop,t=L(e,s);s.scrollbar.size===0?a.current.style.setProperty(`--thumb-opacity`,`0`):a.current.style.setProperty(`--thumb-opacity`,`1`),a.current.style.transform=`translate3d(0, ${t}px, 0)`}},onWheelScroll:e=>{i.viewport&&(i.viewport.scrollTop=e)},onDragScroll:e=>{i.viewport&&(i.viewport.scrollTop=d(e))}}):null}he.displayName=`@mantine/core/ScrollAreaScrollbarVisible`;function z(e){let t=P(),{forceMount:n,...r}=e,[i,a]=(0,x.useState)(!1),o=e.orientation===`horizontal`,s=O(()=>{if(t.viewport){let e=t.viewport.offsetWidth{let{scrollArea:e}=r,t=0;if(e){let n=()=>{window.clearTimeout(t),a(!0)},i=()=>{t=window.setTimeout(()=>a(!1),r.scrollHideDelay)};return e.addEventListener(`pointerenter`,n),e.addEventListener(`pointerleave`,i),()=>{window.clearTimeout(t),e.removeEventListener(`pointerenter`,n),e.removeEventListener(`pointerleave`,i)}}},[r.scrollArea,r.scrollHideDelay]),t||i?(0,w.jsx)(z,{"data-state":i?`visible`:`hidden`,...n}):null}ge.displayName=`@mantine/core/ScrollAreaScrollbarHover`;function _e(e){let{forceMount:t,...n}=e,r=P(),i=e.orientation===`horizontal`,[a,o]=(0,x.useState)(`hidden`),s=O(()=>o(`idle`),100);return(0,x.useEffect)(()=>{if(a===`idle`){let e=window.setTimeout(()=>o(`hidden`),r.scrollHideDelay);return()=>window.clearTimeout(e)}},[a,r.scrollHideDelay]),(0,x.useEffect)(()=>{let{viewport:e}=r,t=i?`scrollLeft`:`scrollTop`;if(e){let n=e[t],r=()=>{let r=e[t];n!==r&&(o(`scrolling`),s()),n=r};return e.addEventListener(`scroll`,r),()=>e.removeEventListener(`scroll`,r)}},[r.viewport,i,s]),t||a!==`hidden`?(0,w.jsx)(he,{"data-state":a===`hidden`?`hidden`:`visible`,...n,onPointerEnter:R(e.onPointerEnter,()=>o(`interacting`)),onPointerLeave:R(e.onPointerLeave,()=>o(`idle`))}):null}function ve(e){let{forceMount:t,...n}=e,r=P(),{onScrollbarXEnabledChange:i,onScrollbarYEnabledChange:a}=r,o=e.orientation===`horizontal`;return(0,x.useEffect)(()=>(o?i(!0):a(!0),()=>{o?i(!1):a(!1)}),[o,i,a]),r.type===`hover`?(0,w.jsx)(ge,{...n,forceMount:t}):r.type===`scroll`?(0,w.jsx)(_e,{...n,forceMount:t}):r.type===`auto`?(0,w.jsx)(z,{...n,forceMount:t}):r.type===`always`?(0,w.jsx)(he,{...n}):null}ve.displayName=`@mantine/core/ScrollAreaScrollbar`;function ye(e,t=()=>{}){let n={left:e.scrollLeft,top:e.scrollTop},r=0;return(function i(){let a={left:e.scrollLeft,top:e.scrollTop},o=n.left!==a.left,s=n.top!==a.top;(o||s)&&t(),n=a,r=window.requestAnimationFrame(i)})(),()=>window.cancelAnimationFrame(r)}function be(e){let{style:t,ref:n,...r}=e,i=P(),a=de(),{onThumbPositionChange:o}=a,s=y(n,a.onThumbChange),c=(0,x.useRef)(void 0),l=O(()=>{c.current&&=(c.current(),void 0)},100);return(0,x.useEffect)(()=>{let{viewport:e}=i;if(e){let t=()=>{if(l(),!c.current){let t=ye(e,o);c.current=t,o()}};return o(),e.addEventListener(`scroll`,t),()=>e.removeEventListener(`scroll`,t)}},[i.viewport,l,o]),(0,w.jsx)(`div`,{"data-state":a.hasThumb?`visible`:`hidden`,...r,ref:s,style:{width:`var(--sa-thumb-width)`,height:`var(--sa-thumb-height)`,...t},onPointerDownCapture:R(e.onPointerDownCapture,e=>{let t=e.target.getBoundingClientRect(),n=e.clientX-t.left,r=e.clientY-t.top;a.onThumbPointerDown({x:n,y:r})}),onPointerUp:R(e.onPointerUp,a.onThumbPointerUp)})}be.displayName=`@mantine/core/ScrollAreaThumb`;function B(e){let{forceMount:t,...n}=e,r=de();return t||r.hasThumb?(0,w.jsx)(be,{...n}):null}B.displayName=`@mantine/core/ScrollAreaThumb`;function xe({children:e,style:t,ref:n,onWheel:r,...i}){let o=P(),s=y(n,o.onViewportChange),c=e=>{if(r?.(e),o.scrollbarXEnabled&&o.viewport&&e.shiftKey){let{scrollTop:t,scrollHeight:n,clientHeight:r,scrollWidth:i,clientWidth:a}=o.viewport,s=t<1,c=t>=n-r-1;i>a&&(s||c)&&e.stopPropagation()}};return(0,w.jsx)(a,{...i,ref:s,onWheel:c,"data-scrollarea-viewport":!0,style:{overflowX:o.scrollbarXEnabled?`scroll`:`hidden`,overflowY:o.scrollbarYEnabled?`scroll`:`hidden`,...t},children:(0,w.jsx)(`div`,{...o.getStyles(`content`),ref:o.onContentChange,children:e})})}xe.displayName=`@mantine/core/ScrollAreaViewport`;var Se={root:`m_d57069b5`,content:`m_b1336c6`,viewport:`m_c0783ff9`,viewportInner:`m_f8f631dd`,scrollbar:`m_c44ba933`,thumb:`m_d8b5e363`,corner:`m_21657268`};function Ce(){return typeof window<`u`}function we(e){return Te(e)?(e.nodeName||``).toLowerCase():`#document`}function V(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function H(e){return((Te(e)?e.ownerDocument:e.document)||window.document)?.documentElement}function Te(e){return Ce()?e instanceof Node||e instanceof V(e).Node:!1}function U(e){return Ce()?e instanceof Element||e instanceof V(e).Element:!1}function W(e){return Ce()?e instanceof HTMLElement||e instanceof V(e).HTMLElement:!1}function Ee(e){return!Ce()||typeof ShadowRoot>`u`?!1:e instanceof ShadowRoot||e instanceof V(e).ShadowRoot}function De(e){let{overflow:t,overflowX:n,overflowY:r,display:i}=G(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&i!==`inline`&&i!==`contents`}function Oe(e){return/^(table|td|th)$/.test(we(e))}function ke(e){try{if(e.matches(`:popover-open`))return!0}catch{}try{return e.matches(`:modal`)}catch{return!1}}var Ae=/transform|translate|scale|rotate|perspective|filter/,je=/paint|layout|strict|content/,Me=e=>!!e&&e!==`none`,Ne;function Pe(e){let t=U(e)?G(e):e;return Me(t.transform)||Me(t.translate)||Me(t.scale)||Me(t.rotate)||Me(t.perspective)||!Ie()&&(Me(t.backdropFilter)||Me(t.filter))||Ae.test(t.willChange||``)||je.test(t.contain||``)}function Fe(e){let t=ze(e);for(;W(t)&&!Le(t);){if(Pe(t))return t;if(ke(t))return null;t=ze(t)}return null}function Ie(){return Ne??=typeof CSS<`u`&&CSS.supports&&CSS.supports(`-webkit-backdrop-filter`,`none`),Ne}function Le(e){return/^(html|body|#document)$/.test(we(e))}function G(e){return V(e).getComputedStyle(e)}function Re(e){return U(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function ze(e){if(we(e)===`html`)return e;let t=e.assignedSlot||e.parentNode||Ee(e)&&e.host||H(e);return Ee(t)?t.host:t}function Be(e){let t=ze(e);return Le(t)?(e.ownerDocument||e).body:W(t)&&De(t)?t:Be(t)}function Ve(e,t,n){t===void 0&&(t=[]),n===void 0&&(n=!0);let r=Be(e),i=r===e.ownerDocument?.body,a=V(r);if(i){let e=He(a);return t.concat(a,a.visualViewport||[],De(r)?r:[],e&&n?Ve(e):[])}return t.concat(r,Ve(r,[],n))}function He(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}var Ue=[`top`,`right`,`bottom`,`left`],K=Math.min,q=Math.max,We=Math.round,Ge=Math.floor,Ke=e=>({x:e,y:e}),qe={left:`right`,right:`left`,bottom:`top`,top:`bottom`};function Je(e,t,n){return q(e,K(t,n))}function J(e,t){return typeof e==`function`?e(t):e}function Y(e){return e.split(`-`)[0]}function Ye(e){return e.split(`-`)[1]}function Xe(e){return e===`x`?`y`:`x`}function Ze(e){return e===`y`?`height`:`width`}function X(e){let t=e[0];return t===`t`||t===`b`?`y`:`x`}function Qe(e){return Xe(X(e))}function $e(e,t,n){n===void 0&&(n=!1);let r=Ye(e),i=Qe(e),a=Ze(i),o=i===`x`?r===(n?`end`:`start`)?`right`:`left`:r===`start`?`bottom`:`top`;return t.reference[a]>t.floating[a]&&(o=ct(o)),[o,ct(o)]}function et(e){let t=ct(e);return[tt(e),t,tt(t)]}function tt(e){return e.includes(`start`)?e.replace(`start`,`end`):e.replace(`end`,`start`)}var nt=[`left`,`right`],rt=[`right`,`left`],it=[`top`,`bottom`],at=[`bottom`,`top`];function ot(e,t,n){switch(e){case`top`:case`bottom`:return n?t?rt:nt:t?nt:rt;case`left`:case`right`:return t?it:at;default:return[]}}function st(e,t,n,r){let i=Ye(e),a=ot(Y(e),n===`start`,r);return i&&(a=a.map(e=>e+`-`+i),t&&(a=a.concat(a.map(tt)))),a}function ct(e){let t=Y(e);return qe[t]+e.slice(t.length)}function lt(e){return{top:e.top??0,right:e.right??0,bottom:e.bottom??0,left:e.left??0}}function ut(e){return typeof e==`number`?{top:e,right:e,bottom:e,left:e}:lt(e)}function dt(e){let{x:t,y:n,width:r,height:i}=e;return{width:r,height:i,top:n,left:t,right:t+r,bottom:n+i,x:t,y:n}}function ft(){let e=navigator.userAgentData;return e!=null&&e.platform?e.platform:navigator.platform}function pt(){let e=navigator.userAgentData;return e&&Array.isArray(e.brands)?e.brands.map(e=>{let{brand:t,version:n}=e;return t+`/`+n}).join(` `):navigator.userAgent}function mt(){return/apple/i.test(navigator.vendor)}function ht(){return ft().toLowerCase().startsWith(`mac`)&&!navigator.maxTouchPoints}function gt(){return pt().includes(`jsdom/`)}var _t=`data-floating-ui-focusable`,vt=`input:not([type='hidden']):not([disabled]),[contenteditable]:not([contenteditable='false']),textarea:not([disabled])`;function yt(e){let t=e.activeElement;for(;((n=t)==null||(n=n.shadowRoot)==null?void 0:n.activeElement)!=null;){var n;t=t.shadowRoot.activeElement}return t}function bt(e,t){if(!e||!t)return!1;let n=t.getRootNode==null?void 0:t.getRootNode();if(e.contains(t))return!0;if(n&&Ee(n)){let n=t;for(;n;){if(e===n)return!0;n=n.parentNode||n.host}}return!1}function xt(e){return`composedPath`in e?e.composedPath()[0]:e.target}function St(e,t){if(t==null)return!1;if(`composedPath`in e)return e.composedPath().includes(t);let n=e;return n.target!=null&&t.contains(n.target)}function Ct(e){return e.matches(`html,body`)}function wt(e){return e?.ownerDocument||document}function Tt(e){return W(e)&&e.matches(vt)}function Et(e){if(!e||gt())return!0;try{return e.matches(`:focus-visible`)}catch{return!0}}function Dt(e){return e?e.hasAttribute(_t)?e:e.querySelector(`[`+_t+`]`)||e:null}function Ot(e,t,n){return n===void 0&&(n=!0),e.filter(e=>e.parentId===t&&(!n||e.context?.open)).flatMap(t=>[t,...Ot(e,t.id,n)])}function kt(e){return`nativeEvent`in e}function At(e,t){let n=[`mouse`,`pen`];return t||n.push(``,void 0),n.includes(e)}var Z=typeof document<`u`?x.useLayoutEffect:function(){},jt={...x};function Mt(e){let t=x.useRef(e);return Z(()=>{t.current=e}),t}var Nt=jt.useInsertionEffect||(e=>e());function Q(e){let t=x.useRef(()=>{});return Nt(()=>{t.current=e}),x.useCallback(function(){var e=[...arguments];return t.current==null?void 0:t.current(...e)},[])}function Pt(e,t,n){let{reference:r,floating:i}=e,a=X(t),o=Qe(t),s=Ze(o),c=Y(t),l=a===`y`,u=r.x+r.width/2-i.width/2,d=r.y+r.height/2-i.height/2,f=r[s]/2-i[s]/2,p;switch(c){case`top`:p={x:u,y:r.y-i.height};break;case`bottom`:p={x:u,y:r.y+r.height};break;case`right`:p={x:r.x+r.width,y:d};break;case`left`:p={x:r.x-i.width,y:d};break;default:p={x:r.x,y:r.y}}let m=Ye(t);return m&&(p[o]+=f*(m===`end`?1:-1)*(n&&l?-1:1)),p}async function Ft(e,t){t===void 0&&(t={});let{x:n,y:r,platform:i,rects:a,elements:o,strategy:s}=e,{boundary:c=`clippingAncestors`,rootBoundary:l=`viewport`,elementContext:u=`floating`,altBoundary:d=!1,padding:f=0}=J(t,e),p=ut(f),m=o[d?u===`floating`?`reference`:`floating`:u],h=dt(await i.getClippingRect({element:await(i.isElement==null?void 0:i.isElement(m))??!0?m:m.contextElement||await(i.getDocumentElement==null?void 0:i.getDocumentElement(o.floating)),boundary:c,rootBoundary:l,strategy:s})),g=u===`floating`?{x:n,y:r,width:a.floating.width,height:a.floating.height}:a.reference,_=await(i.getOffsetParent==null?void 0:i.getOffsetParent(o.floating)),v=await(i.isElement==null?void 0:i.isElement(_))&&await(i.getScale==null?void 0:i.getScale(_))||{x:1,y:1},y=dt(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({elements:o,rect:g,offsetParent:_,strategy:s}):g);return{top:(h.top-y.top+p.top)/v.y,bottom:(y.bottom-h.bottom+p.bottom)/v.y,left:(h.left-y.left+p.left)/v.x,right:(y.right-h.right+p.right)/v.x}}var It=50,Lt=async(e,t,n)=>{let{placement:r=`bottom`,strategy:i=`absolute`,middleware:a=[],platform:o}=n,s=o.detectOverflow?o:{...o,detectOverflow:Ft},c=await(o.isRTL==null?void 0:o.isRTL(t)),l=await o.getElementRects({reference:e,floating:t,strategy:i}),{x:u,y:d}=Pt(l,r,c),f=r,p=0,m={};for(let n=0;n({name:`arrow`,options:e,async fn(t){let{x:n,y:r,placement:i,rects:a,platform:o,elements:s,middlewareData:c}=t,{element:l,padding:u=0}=J(e,t)||{};if(l==null)return{};let d=ut(u),f={x:n,y:r},p=Qe(i),m=Ze(p),h=await o.getDimensions(l),g=p===`y`,_=g?`top`:`left`,v=g?`bottom`:`right`,y=g?`clientHeight`:`clientWidth`,b=a.reference[m]+a.reference[p]-f[p]-a.floating[m],x=f[p]-a.reference[p],S=await(o.getOffsetParent==null?void 0:o.getOffsetParent(l)),C=S?S[y]:0;(!C||!await(o.isElement==null?void 0:o.isElement(S)))&&(C=s.floating[y]||a.floating[m]);let w=b/2-x/2,T=C/2-h[m]/2-1,E=K(d[_],T),D=K(d[v],T),O=C-h[m]-D,k=C/2-h[m]/2+w,A=Je(E,k,O),j=!c.arrow&&Ye(i)!=null&&k!==A&&a.reference[m]/2-(ke<=0)){let e=(i.flip?.index||0)+1,t=S[e];if(t&&(u!==`alignment`||_===X(t)||T.every(e=>X(e.placement)!==_||e.overflows[0]>0)))return{data:{index:e,overflows:T},reset:{placement:t}};let n=T.filter(e=>e.overflows[0]<=0).sort((e,t)=>e.overflows[1]-t.overflows[1])[0]?.placement;if(!n)switch(f){case`bestFit`:{let e=T.filter(e=>{if(x){let t=X(e.placement);return t===_||t===`y`}return!0}).map(e=>[e.placement,e.overflows.filter(e=>e>0).reduce((e,t)=>e+t,0)]).sort((e,t)=>e[1]-t[1])[0]?.[0];e&&(n=e);break}case`initialPlacement`:n=o}if(r!==n)return{reset:{placement:n}}}return{}}}};function Bt(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function Vt(e){return Ue.some(t=>e[t]>=0)}var Ht=function(e){return e===void 0&&(e={}),{name:`hide`,options:e,async fn(t){let{rects:n,platform:r}=t,{strategy:i=`referenceHidden`,...a}=J(e,t);switch(i){case`referenceHidden`:{let e=Bt(await r.detectOverflow(t,{...a,elementContext:`reference`}),n.reference);return{data:{referenceHiddenOffsets:e,referenceHidden:Vt(e)}}}case`escaped`:{let e=Bt(await r.detectOverflow(t,{...a,altBoundary:!0}),n.floating);return{data:{escapedOffsets:e,escaped:Vt(e)}}}default:return{}}}}};function Ut(e){let t=K(...e.map(e=>e.left)),n=K(...e.map(e=>e.top)),r=q(...e.map(e=>e.right)),i=q(...e.map(e=>e.bottom));return{x:t,y:n,width:r-t,height:i-n}}function Wt(e){let t=e.slice().sort((e,t)=>e.y-t.y),n=[],r=null;for(let e=0;er.height/2?n.push([i]):n[n.length-1].push(i),r=i}return n.map(e=>dt(Ut(e)))}var Gt=function(e){return e===void 0&&(e={}),{name:`inline`,options:e,async fn(t){let{placement:n,elements:r,rects:i,platform:a,strategy:o}=t,{padding:s=2,x:c,y:l}=J(e,t),u=Array.from(await(a.getClientRects==null?void 0:a.getClientRects(r.reference))||[]);if(!u.length)return{};let d=Wt(u),f=dt(Ut(u)),p=ut(s);function m(){if(d.length===2&&(d[0].left>d[1].right||d[1].left>d[0].right)&&c!=null&&l!=null)return d.find(e=>c>e.left-p.left&&ce.top-p.top&&l=2){if(X(n)===`y`){let e=d[0],t=d[d.length-1],r=Y(n)===`top`,i=e.top,a=t.bottom,o=r?e.left:t.left;return dt({x:o,y:i,width:(r?e.right:t.right)-o,height:a-i})}let e=Y(n)===`left`,t=q(...d.map(e=>e.right)),r=K(...d.map(e=>e.left)),i=d.filter(n=>e?n.left===r:n.right===t),a=i[0].top,o=i[i.length-1].bottom;return dt({x:r,y:a,width:t-r,height:o-a})}return f}let h=await a.getElementRects({reference:{getBoundingClientRect:m},floating:r.floating,strategy:o});return i.reference.x!==h.reference.x||i.reference.y!==h.reference.y||i.reference.width!==h.reference.width||i.reference.height!==h.reference.height?{reset:{rects:h}}:{}}}},Kt=new Set([`left`,`top`]);async function qt(e,t){let{placement:n,platform:r,elements:i}=e,a=await(r.isRTL==null?void 0:r.isRTL(i.floating)),o=Y(n),s=Ye(n),c=X(n)===`y`,l=Kt.has(o)?-1:1,u=a&&c?-1:1,d=J(t,e),{mainAxis:f,crossAxis:p,alignmentAxis:m}=typeof d==`number`?{mainAxis:d,crossAxis:0,alignmentAxis:null}:{mainAxis:d.mainAxis||0,crossAxis:d.crossAxis||0,alignmentAxis:d.alignmentAxis};return s&&typeof m==`number`&&(p=s===`end`?m*-1:m),c?{x:p*u,y:f*l}:{x:f*l,y:p*u}}var Jt=function(e){return e===void 0&&(e=0),{name:`offset`,options:e,async fn(t){var n;let{x:r,y:i,placement:a,middlewareData:o}=t,s=await qt(t,e);return a===o.offset?.placement&&(n=o.arrow)!=null&&n.alignmentOffset?{}:{x:r+s.x,y:i+s.y,data:{...s,placement:a}}}}},Yt=function(e){return e===void 0&&(e={}),{name:`shift`,options:e,async fn(t){let{x:n,y:r,placement:i,platform:a}=t,{mainAxis:o=!0,crossAxis:s=!1,limiter:c={fn:e=>{let{x:t,y:n}=e;return{x:t,y:n}}},...l}=J(e,t),u={x:n,y:r},d=await a.detectOverflow(t,l),f=X(i),p=Xe(f),m=u[p],h=u[f],g=(e,t)=>Je(t+d[e===`y`?`top`:`left`],t,t-d[e===`y`?`bottom`:`right`]);o&&(m=g(p,m)),s&&(h=g(f,h));let _=c.fn({...t,[p]:m,[f]:h});return{..._,data:{x:_.x-n,y:_.y-r,enabled:{[p]:o,[f]:s}}}}}},Xt=function(e){return e===void 0&&(e={}),{options:e,fn(t){let{x:n,y:r,placement:i,rects:a,middlewareData:o}=t,{offset:s=0,mainAxis:c=!0,crossAxis:l=!0}=J(e,t),u={x:n,y:r},d=X(i),f=Xe(d),p=u[f],m=u[d],h=J(s,t),g=typeof h==`number`?{mainAxis:h,crossAxis:0}:{mainAxis:h.mainAxis??0,crossAxis:h.crossAxis??0};if(c){let e=f===`y`?`height`:`width`,t=a.reference[f]-a.floating[e]+g.mainAxis,n=a.reference[f]+a.reference[e]-g.mainAxis;pn&&(p=n)}if(l){let e=f===`y`?`width`:`height`,t=Kt.has(Y(i)),n=a.reference[d]-a.floating[e]+(t&&o.offset?.[d]||0)+(t?0:g.crossAxis),r=a.reference[d]+a.reference[e]+(t?0:o.offset?.[d]||0)-(t?g.crossAxis:0);mr&&(m=r)}return{[f]:p,[d]:m}}}},Zt=function(e){return e===void 0&&(e={}),{name:`size`,options:e,async fn(t){let{placement:n,rects:r,platform:i,elements:a}=t,{apply:o=()=>{},...s}=J(e,t),c=await i.detectOverflow(t,s),l=Y(n),u=Ye(n),d=X(n)===`y`,{width:f,height:p}=r.floating,m,h;l===`top`||l===`bottom`?(m=l,h=u===(await(i.isRTL==null?void 0:i.isRTL(a.floating))?`start`:`end`)?`left`:`right`):(h=l,m=u===`end`?`top`:`bottom`);let g=p-c.top-c.bottom,_=f-c.left-c.right,v=K(p-c[m],g),y=K(f-c[h],_),b=t.middlewareData.shift,x=!b,S=v,C=y;b!=null&&b.enabled.x&&(C=_),b!=null&&b.enabled.y&&(S=g),x&&!u&&(d?C=f-2*q(c.left,c.right):S=p-2*q(c.top,c.bottom)),await o({...t,availableWidth:C,availableHeight:S});let w=await i.getDimensions(a.floating);return f!==w.width||p!==w.height?{reset:{rects:!0}}:{}}}};function Qt(e){let t=G(e),n=parseFloat(t.width)||0,r=parseFloat(t.height)||0,i=W(e),a=i?e.offsetWidth:n,o=i?e.offsetHeight:r,s=We(n)!==a||We(r)!==o;return s&&(n=a,r=o),{width:n,height:r,$:s}}function $t(e){return U(e)?e:e.contextElement}function en(e){let t=$t(e);if(!W(t))return Ke(1);let n=t.getBoundingClientRect(),{width:r,height:i,$:a}=Qt(t),o=(a?We(n.width):n.width)/r,s=(a?We(n.height):n.height)/i;return(!o||!Number.isFinite(o))&&(o=1),(!s||!Number.isFinite(s))&&(s=1),{x:o,y:s}}var tn=Ke(0);function nn(e){let t=V(e);return!Ie()||!t.visualViewport?tn:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function rn(e,t,n){return t===void 0&&(t=!1),!!n&&t&&n===V(e)}function an(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);let i=e.getBoundingClientRect(),a=$t(e),o=Ke(1);t&&(r?U(r)&&(o=en(r)):o=en(e));let s=rn(a,n,r)?nn(a):Ke(0),c=(i.left+s.x)/o.x,l=(i.top+s.y)/o.y,u=i.width/o.x,d=i.height/o.y;if(a&&r){let e=V(a),t=U(r)?V(r):r,n=e,i=He(n);for(;i&&t!==n;){let e=en(i),t=i.getBoundingClientRect(),r=G(i),a=t.left+(i.clientLeft+parseFloat(r.paddingLeft))*e.x,o=t.top+(i.clientTop+parseFloat(r.paddingTop))*e.y;c*=e.x,l*=e.y,u*=e.x,d*=e.y,c+=a,l+=o,n=V(i),i=He(n)}}return dt({width:u,height:d,x:c,y:l})}function on(e,t){let n=Re(e).scrollLeft;return t?t.left+n:an(H(e)).left+n}function sn(e,t){let n=e.getBoundingClientRect();return{x:n.left+t.scrollLeft-on(e,n),y:n.top+t.scrollTop}}function cn(e){let{elements:t,rect:n,offsetParent:r,strategy:i}=e,a=i===`fixed`,o=H(r),s=t?ke(t.floating):!1;if(r===o||s&&a)return n;let c={scrollLeft:0,scrollTop:0},l=Ke(1),u=Ke(0),d=W(r);if((d||!a)&&((we(r)!==`body`||De(o))&&(c=Re(r)),d)){let e=an(r);l=en(r),u.x=e.x+r.clientLeft,u.y=e.y+r.clientTop}let f=o&&!d&&!a?sn(o,c):Ke(0);return{width:n.width*l.x,height:n.height*l.y,x:n.x*l.x-c.scrollLeft*l.x+u.x+f.x,y:n.y*l.y-c.scrollTop*l.y+u.y+f.y}}function ln(e){return e.getClientRects?Array.from(e.getClientRects()):[]}function un(e){let t=Re(e),n=e.ownerDocument.body,r=q(e.scrollWidth,e.clientWidth,n.scrollWidth,n.clientWidth),i=q(e.scrollHeight,e.clientHeight,n.scrollHeight,n.clientHeight),a=-t.scrollLeft+on(e),o=-t.scrollTop;return G(n).direction===`rtl`&&(a+=q(e.clientWidth,n.clientWidth)-r),{width:r,height:i,x:a,y:o}}var dn=25;function fn(e,t,n){n===void 0&&(n=`viewport`);let r=n===`layoutViewport`,i=V(e),a=H(e),o=i.visualViewport,s=a.clientWidth,c=a.clientHeight,l=0,u=0;if(o){let e=!Ie()||t===`fixed`;r?e||(l=-o.offsetLeft,u=-o.offsetTop):(s=o.width,c=o.height,e&&(l=o.offsetLeft,u=o.offsetTop))}if(on(a)<=0){let e=a.ownerDocument,t=e.body,n=getComputedStyle(t),r=e.compatMode===`CSS1Compat`&&parseFloat(n.marginLeft)+parseFloat(n.marginRight)||0,i=Math.abs(a.clientWidth-t.clientWidth-r),o=getComputedStyle(a).scrollbarGutter===`stable both-edges`?i/2:i;o<=dn&&(s-=o)}return{width:s,height:c,x:l,y:u}}function pn(e,t){let n=an(e,!0,t===`fixed`),r=n.top+e.clientTop,i=n.left+e.clientLeft,a=en(e);return{width:e.clientWidth*a.x,height:e.clientHeight*a.y,x:i*a.x,y:r*a.y}}function mn(e,t,n){let r;if(t===`viewport`||t===`layoutViewport`)r=fn(e,n,t);else if(t===`document`)r=un(H(e));else if(U(t))r=pn(t,n);else{let n=nn(e);r={x:t.x-n.x,y:t.y-n.y,width:t.width,height:t.height}}return dt(r)}function hn(e,t){let n=t.get(e);if(n)return n;let r=Ve(e,[],!1).filter(e=>U(e)&&we(e)!==`body`),i=null,a=G(e).position===`fixed`,o=a?ze(e):e;for(;U(o)&&!Le(o);){let e=G(o),t=Pe(o),n=i?i.position:a?`fixed`:``;!t&&(n===`fixed`||n===`absolute`&&e.position===`static`)?r=r.filter(e=>e!==o):i=e,o=ze(o)}return t.set(e,r),r}function gn(e){let{element:t,boundary:n,rootBoundary:r,strategy:i}=e,a=[...n===`clippingAncestors`?ke(t)?[]:hn(t,this._c):[].concat(n),r],o=mn(t,a[0],i),s=o.top,c=o.right,l=o.bottom,u=o.left;for(let e=1;e{s(!1,1e-7)},1e3)}y=!1}try{r=new IntersectionObserver(b,{...v,root:a.ownerDocument})}catch{r=new IntersectionObserver(b,v)}r.observe(e)}let c=V(e),l=()=>s(n);return c.addEventListener(`resize`,l),s(!0),()=>{c.removeEventListener(`resize`,l),o()}}function Dn(e,t,n,r){r===void 0&&(r={});let{ancestorScroll:i=!0,ancestorResize:a=!0,elementResize:o=typeof ResizeObserver==`function`,layoutShift:s=typeof IntersectionObserver==`function`,animationFrame:c=!1}=r,l=$t(e),u=i||a?[...l?Ve(l):[],...t?Ve(t):[]]:[];u.forEach(e=>{i&&e.addEventListener(`scroll`,n),a&&e.addEventListener(`resize`,n)});let d=l&&s?En(l,n,a):null,f=-1,p=null;o&&(p=new ResizeObserver(e=>{let[r]=e;r&&r.target===l&&p&&t&&(p.unobserve(t),cancelAnimationFrame(f),f=requestAnimationFrame(()=>{var e;(e=p)==null||e.observe(t)})),n()}),l&&!c&&p.observe(l),t&&p.observe(t));let m,h=c?an(e):null;c&&g();function g(){let t=an(e);h&&!Tn(h,t)&&n(),h=t,m=requestAnimationFrame(g)}return n(),()=>{var e;u.forEach(e=>{i&&e.removeEventListener(`scroll`,n),a&&e.removeEventListener(`resize`,n)}),d?.(),(e=p)==null||e.disconnect(),p=null,c&&cancelAnimationFrame(m)}}var On=Jt,kn=Yt,An=zt,jn=Zt,Mn=Ht,Nn=Rt,Pn=Gt,Fn=Xt,In=(e,t,n)=>{let r=new Map,i=n??{},a={...wn,...i.platform,_c:r};return Lt(e,t,{...i,platform:a})},Ln=typeof document<`u`?x.useLayoutEffect:function(){};function Rn(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(typeof e==`function`&&e.toString()===t.toString())return!0;let n,r,i;if(e&&t&&typeof e==`object`){if(Array.isArray(e)){if(n=e.length,n!==t.length)return!1;for(r=n;r--!==0;)if(!Rn(e[r],t[r]))return!1;return!0}if(i=Object.keys(e),n=i.length,n!==Object.keys(t).length)return!1;for(r=n;r--!==0;)if(!{}.hasOwnProperty.call(t,i[r]))return!1;for(r=n;r--!==0;){let n=i[r];if(!(n===`_owner`&&e.$$typeof)&&!Rn(e[n],t[n]))return!1}return!0}return e!==e&&t!==t}function zn(e){return typeof window>`u`?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function Bn(e,t){let n=zn(e);return Math.round(t*n)/n}function Vn(e){let t=x.useRef(e);return Ln(()=>{t.current=e}),t}function Hn(e){e===void 0&&(e={});let{placement:t=`bottom`,strategy:n=`absolute`,middleware:r=[],platform:i,elements:{reference:a,floating:o}={},transform:s=!0,whileElementsMounted:c,open:l}=e,[u,d]=x.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[f,p]=x.useState(r);Rn(f,r)||p(r);let[m,h]=x.useState(null),[g,_]=x.useState(null),v=x.useCallback(e=>{e!==w.current&&(w.current=e,h(e))},[]),y=x.useCallback(e=>{e!==T.current&&(T.current=e,_(e))},[]),b=a||m,S=o||g,w=x.useRef(null),T=x.useRef(null),E=x.useRef(u),D=c!=null,O=Vn(c),k=Vn(i),A=Vn(l),j=x.useCallback(()=>{if(!w.current||!T.current)return;let e={placement:t,strategy:n,middleware:f};k.current&&(e.platform=k.current),In(w.current,T.current,e).then(e=>{let t={...e,isPositioned:A.current!==!1};M.current&&!Rn(E.current,t)&&(E.current=t,C.flushSync(()=>{d(t)}))})},[f,t,n,k,A]);Ln(()=>{l===!1&&E.current.isPositioned&&(E.current.isPositioned=!1,d(e=>({...e,isPositioned:!1})))},[l]);let M=x.useRef(!1);Ln(()=>(M.current=!0,()=>{M.current=!1}),[]),Ln(()=>{if(b&&(w.current=b),S&&(T.current=S),b&&S){if(O.current)return O.current(b,S,j);j()}},[b,S,j,O,D]);let N=x.useMemo(()=>({reference:w,floating:T,setReference:v,setFloating:y}),[v,y]),P=x.useMemo(()=>({reference:b,floating:S}),[b,S]),F=x.useMemo(()=>{let e={position:n,left:0,top:0};if(!P.floating)return e;let t=Bn(P.floating,u.x),r=Bn(P.floating,u.y);return s?{...e,transform:`translate(`+t+`px, `+r+`px)`,...zn(P.floating)>=1.5&&{willChange:`transform`}}:{position:n,left:t,top:r}},[n,s,P.floating,u.x,u.y]);return x.useMemo(()=>({...u,update:j,refs:N,elements:P,floatingStyles:F}),[u,j,N,P,F])}var Un=e=>{function t(e){return{}.hasOwnProperty.call(e,`current`)}return{name:`arrow`,options:e,fn(n){let{element:r,padding:i}=typeof e==`function`?e(n):e;return r&&t(r)?r.current==null?{}:Nn({element:r.current,padding:i}).fn(n):r?Nn({element:r,padding:i}).fn(n):{}}}},Wn=(e,t)=>{let n=On(e);return{name:n.name,fn:n.fn,options:[e,t]}},Gn=(e,t)=>{let n=kn(e);return{name:n.name,fn:n.fn,options:[e,t]}},Kn=(e,t)=>({fn:Fn(e).fn,options:[e,t]}),qn=(e,t)=>{let n=An(e);return{name:n.name,fn:n.fn,options:[e,t]}},Jn=(e,t)=>{let n=jn(e);return{name:n.name,fn:n.fn,options:[e,t]}},Yn=(e,t)=>{let n=Mn(e);return{name:n.name,fn:n.fn,options:[e,t]}},Xn=(e,t)=>{let n=Pn(e);return{name:n.name,fn:n.fn,options:[e,t]}},Zn=(e,t)=>{let n=Un(e);return{name:n.name,fn:n.fn,options:[e,t]}};function Qn(e){let t=x.useRef(void 0),n=x.useCallback(t=>{let n=e.map(e=>{if(e!=null){if(typeof e==`function`){let n=e,r=n(t);return typeof r==`function`?r:()=>{n(null)}}return e.current=t,()=>{e.current=null}}});return()=>{n.forEach(e=>e?.())}},e);return x.useMemo(()=>e.every(e=>e==null)?null:e=>{t.current&&=(t.current(),void 0),e!=null&&(t.current=n(e))},e)}var $n=`data-floating-ui-focusable`,er=`active`,tr=`selected`,nr=`ArrowLeft`,rr=`ArrowRight`,ir=`ArrowUp`,ar=`ArrowDown`,or=[nr,rr],sr=[ir,ar];[...or,...sr];var cr={...x},lr=!1,ur=0,dr=()=>`floating-ui-`+Math.random().toString(36).slice(2,6)+ur++;function fr(){let[e,t]=x.useState(()=>lr?dr():void 0);return Z(()=>{e??t(dr())},[]),x.useEffect(()=>{lr=!0},[]),e}var pr=cr.useId||fr;function mr(){let e=new Map;return{emit(t,n){var r;(r=e.get(t))==null||r.forEach(e=>e(n))},on(t,n){e.has(t)||e.set(t,new Set),e.get(t).add(n)},off(t,n){var r;(r=e.get(t))==null||r.delete(n)}}}var hr=x.createContext(null),gr=x.createContext(null),_r=()=>x.useContext(hr)?.id||null,vr=()=>x.useContext(gr);function yr(e){return`data-floating-ui-`+e}function $(e){e.current!==-1&&(clearTimeout(e.current),e.current=-1)}var br=yr(`safe-polygon`);function xr(e,t,n){if(n&&!At(n))return 0;if(typeof e==`number`)return e;if(typeof e==`function`){let n=e();return typeof n==`number`?n:n?.[t]}return e?.[t]}function Sr(e){return typeof e==`function`?e():e}function Cr(e,t){t===void 0&&(t={});let{open:n,onOpenChange:r,dataRef:i,events:a,elements:o}=e,{enabled:s=!0,delay:c=0,handleClose:l=null,mouseOnly:u=!1,restMs:d=0,move:f=!0}=t,p=vr(),m=_r(),h=Mt(l),g=Mt(c),_=Mt(n),v=Mt(d),y=x.useRef(),b=x.useRef(-1),S=x.useRef(),C=x.useRef(-1),w=x.useRef(!0),T=x.useRef(!1),E=x.useRef(()=>{}),D=x.useRef(!1),O=Q(()=>{let e=i.current.openEvent?.type;return e?.includes(`mouse`)&&e!==`mousedown`});x.useEffect(()=>{if(!s)return;function e(e){let{open:t}=e;t||($(b),$(C),w.current=!0,D.current=!1)}return a.on(`openchange`,e),()=>{a.off(`openchange`,e)}},[s,a]),x.useEffect(()=>{if(!s||!h.current||!n)return;function e(e){O()&&r(!1,e,`hover`)}let t=wt(o.floating).documentElement;return t.addEventListener(`mouseleave`,e),()=>{t.removeEventListener(`mouseleave`,e)}},[o.floating,n,r,s,h,O]);let k=x.useCallback(function(e,t,n){t===void 0&&(t=!0),n===void 0&&(n=`hover`);let i=xr(g.current,`close`,y.current);i&&!S.current?($(b),b.current=window.setTimeout(()=>r(!1,e,n),i)):t&&($(b),r(!1,e,n))},[g,r]),A=Q(()=>{E.current(),S.current=void 0}),j=Q(()=>{if(T.current){let e=wt(o.floating).body;e.style.pointerEvents=``,e.removeAttribute(br),T.current=!1}}),M=Q(()=>i.current.openEvent?[`click`,`mousedown`].includes(i.current.openEvent.type):!1);x.useEffect(()=>{if(!s)return;function e(e){if($(b),w.current=!1,u&&!At(y.current)||Sr(v.current)>0&&!xr(g.current,`open`))return;let t=xr(g.current,`open`,y.current);t?b.current=window.setTimeout(()=>{_.current||r(!0,e,`hover`)},t):n||r(!0,e,`hover`)}function t(e){if(M()){j();return}E.current();let t=wt(o.floating);if($(C),D.current=!1,h.current&&i.current.floatingContext){n||$(b),S.current=h.current({...i.current.floatingContext,tree:p,x:e.clientX,y:e.clientY,onClose(){j(),A(),M()||k(e,!0,`safe-polygon`)}});let r=S.current;t.addEventListener(`mousemove`,r),E.current=()=>{t.removeEventListener(`mousemove`,r)};return}(y.current!==`touch`||!bt(o.floating,e.relatedTarget))&&k(e)}function a(e){M()||i.current.floatingContext&&(h.current==null||h.current({...i.current.floatingContext,tree:p,x:e.clientX,y:e.clientY,onClose(){j(),A(),M()||k(e)}})(e))}function c(){$(b)}function l(e){M()||k(e,!1)}if(U(o.domReference)){let r=o.domReference,i=o.floating;return n&&r.addEventListener(`mouseleave`,a),f&&r.addEventListener(`mousemove`,e,{once:!0}),r.addEventListener(`mouseenter`,e),r.addEventListener(`mouseleave`,t),i&&(i.addEventListener(`mouseleave`,a),i.addEventListener(`mouseenter`,c),i.addEventListener(`mouseleave`,l)),()=>{n&&r.removeEventListener(`mouseleave`,a),f&&r.removeEventListener(`mousemove`,e),r.removeEventListener(`mouseenter`,e),r.removeEventListener(`mouseleave`,t),i&&(i.removeEventListener(`mouseleave`,a),i.removeEventListener(`mouseenter`,c),i.removeEventListener(`mouseleave`,l))}}},[o,s,e,u,f,k,A,j,r,n,_,p,g,h,i,M,v]),Z(()=>{var e;if(s&&n&&(e=h.current)!=null&&(e=e.__options)!=null&&e.blockPointerEvents&&O()){T.current=!0;let e=o.floating;if(U(o.domReference)&&e){var t;let n=wt(o.floating).body;n.setAttribute(br,``);let r=o.domReference,i=p==null||(t=p.nodesRef.current.find(e=>e.id===m))==null||(t=t.context)==null?void 0:t.elements.floating;return i&&(i.style.pointerEvents=``),n.style.pointerEvents=`none`,r.style.pointerEvents=`auto`,e.style.pointerEvents=`auto`,()=>{n.style.pointerEvents=``,r.style.pointerEvents=``,e.style.pointerEvents=``}}}},[s,n,m,o,p,h,O]),Z(()=>{n||(y.current=void 0,D.current=!1,A(),j())},[n,A,j]),x.useEffect(()=>()=>{A(),$(b),$(C),j()},[s,o.domReference,A,j]);let N=x.useMemo(()=>{function e(e){y.current=e.pointerType}return{onPointerDown:e,onPointerEnter:e,onMouseMove(e){let{nativeEvent:t}=e;function i(){!w.current&&!_.current&&r(!0,t,`hover`)}(!u||At(y.current))&&(n||Sr(v.current)===0||D.current&&e.movementX**2+e.movementY**2<2||($(C),y.current===`touch`?i():(D.current=!0,C.current=window.setTimeout(i,Sr(v.current)))))}}},[u,r,n,_,v]);return x.useMemo(()=>s?{reference:N}:{},[s,N])}var wr=()=>{},Tr=x.createContext({delay:0,initialDelay:0,timeoutMs:0,currentId:null,setCurrentId:wr,setState:wr,isInstantPhase:!1}),Er=()=>x.useContext(Tr);function Dr(e){let{children:t,delay:n,timeoutMs:r=0}=e,[i,a]=x.useReducer((e,t)=>({...e,...t}),{delay:n,timeoutMs:r,initialDelay:n,currentId:null,isInstantPhase:!1}),o=x.useRef(null),s=x.useCallback(e=>{a({currentId:e})},[]);return Z(()=>{i.currentId?o.current===null?o.current=i.currentId:i.isInstantPhase||a({isInstantPhase:!0}):(i.isInstantPhase&&a({isInstantPhase:!1}),o.current=null)},[i.currentId,i.isInstantPhase]),(0,w.jsx)(Tr.Provider,{value:x.useMemo(()=>({...i,setState:a,setCurrentId:s}),[i,s]),children:t})}function Or(e,t){t===void 0&&(t={});let{open:n,onOpenChange:r,floatingId:i}=e,{id:a,enabled:o=!0}=t,s=a??i,c=Er(),{currentId:l,setCurrentId:u,initialDelay:d,setState:f,timeoutMs:p}=c;return Z(()=>{o&&l&&(f({delay:{open:1,close:xr(d,`close`)}}),l!==s&&r(!1))},[o,s,r,f,l,d]),Z(()=>{function e(){r(!1),f({delay:d,currentId:null})}if(o&&l&&!n&&l===s){if(p){let t=window.setTimeout(e,p);return()=>{clearTimeout(t)}}e()}},[o,n,f,l,s,r,d,p]),Z(()=>{o&&u!==wr&&n&&u(s)},[o,n,u,s]),c}function kr(e,t){if(!e||!t)return!1;let n=t.getRootNode==null?void 0:t.getRootNode();if(e.contains(t))return!0;if(n&&Ee(n)){let n=t;for(;n;){if(e===n)return!0;n=n.parentNode||n.host}}return!1}function Ar(e){return`composedPath`in e?e.composedPath()[0]:e.target}var jr={pointerdown:`onPointerDown`,mousedown:`onMouseDown`,click:`onClick`},Mr={pointerdown:`onPointerDownCapture`,mousedown:`onMouseDownCapture`,click:`onClickCapture`},Nr=e=>({escapeKey:typeof e==`boolean`?e:e?.escapeKey??!1,outsidePress:typeof e==`boolean`?e:e?.outsidePress??!0});function Pr(e,t){t===void 0&&(t={});let{open:n,onOpenChange:r,elements:i,dataRef:a}=e,{enabled:o=!0,escapeKey:s=!0,outsidePress:c=!0,outsidePressEvent:l=`pointerdown`,referencePress:u=!1,referencePressEvent:d=`pointerdown`,ancestorScroll:f=!1,bubbles:p,capture:m}=t,h=vr(),g=Q(typeof c==`function`?c:()=>!1),_=typeof c==`function`?g:c,v=x.useRef(!1),{escapeKey:y,outsidePress:b}=Nr(p),{escapeKey:S,outsidePress:C}=Nr(m),w=x.useRef(!1),T=Q(e=>{if(!n||!o||!s||e.key!==`Escape`||w.current)return;let t=a.current.floatingContext?.nodeId,i=h?Ot(h.nodesRef.current,t):[];if(!y&&(e.stopPropagation(),i.length>0)){let e=!0;if(i.forEach(t=>{var n;if((n=t.context)!=null&&n.open&&!t.context.dataRef.current.__escapeKeyBubbles){e=!1;return}}),!e)return}r(!1,kt(e)?e.nativeEvent:e,`escape-key`)}),E=Q(e=>{var t;let n=()=>{var t;T(e),(t=xt(e))==null||t.removeEventListener(`keydown`,n)};(t=xt(e))==null||t.addEventListener(`keydown`,n)}),D=Q(e=>{let t=a.current.insideReactTree;a.current.insideReactTree=!1;let n=v.current;if(v.current=!1,l===`click`&&n||t||typeof _==`function`&&!_(e))return;let o=xt(e),s=`[`+yr(`inert`)+`]`,c=wt(i.floating).querySelectorAll(s),u=U(o)?o:null;for(;u&&!Le(u);){let e=ze(u);if(Le(e)||!U(e))break;u=e}if(c.length&&U(o)&&!Ct(o)&&!bt(o,i.floating)&&Array.from(c).every(e=>!bt(u,e)))return;if(W(o)&&A){let t=Le(o),n=G(o),r=/auto|scroll/,i=t||r.test(n.overflowX),a=t||r.test(n.overflowY),s=i&&o.clientWidth>0&&o.scrollWidth>o.clientWidth,c=a&&o.clientHeight>0&&o.scrollHeight>o.clientHeight,l=n.direction===`rtl`,u=c&&(l?e.offsetX<=o.offsetWidth-o.clientWidth:e.offsetX>o.clientWidth),d=s&&e.offsetY>o.clientHeight;if(u||d)return}let d=a.current.floatingContext?.nodeId,f=h&&Ot(h.nodesRef.current,d).some(t=>St(e,t.context?.elements.floating));if(St(e,i.floating)||St(e,i.domReference)||f)return;let p=h?Ot(h.nodesRef.current,d):[];if(p.length>0){let e=!0;if(p.forEach(t=>{var n;if((n=t.context)!=null&&n.open&&!t.context.dataRef.current.__outsidePressBubbles){e=!1;return}}),!e)return}r(!1,e,`outside-press`)}),O=Q(e=>{var t;let n=()=>{var t;D(e),(t=xt(e))==null||t.removeEventListener(l,n)};(t=xt(e))==null||t.addEventListener(l,n)});x.useEffect(()=>{if(!n||!o)return;a.current.__escapeKeyBubbles=y,a.current.__outsidePressBubbles=b;let e=-1;function t(e){r(!1,e,`ancestor-scroll`)}function c(){window.clearTimeout(e),w.current=!0}function u(){e=window.setTimeout(()=>{w.current=!1},Ie()?5:0)}let d=wt(i.floating);s&&(d.addEventListener(`keydown`,S?E:T,S),d.addEventListener(`compositionstart`,c),d.addEventListener(`compositionend`,u)),_&&d.addEventListener(l,C?O:D,C);let p=[];return f&&(U(i.domReference)&&(p=Ve(i.domReference)),U(i.floating)&&(p=p.concat(Ve(i.floating))),!U(i.reference)&&i.reference&&i.reference.contextElement&&(p=p.concat(Ve(i.reference.contextElement)))),p=p.filter(e=>e!==d.defaultView?.visualViewport),p.forEach(e=>{e.addEventListener(`scroll`,t)}),()=>{s&&(d.removeEventListener(`keydown`,S?E:T,S),d.removeEventListener(`compositionstart`,c),d.removeEventListener(`compositionend`,u)),_&&d.removeEventListener(l,C?O:D,C),p.forEach(e=>{e.removeEventListener(`scroll`,t)}),window.clearTimeout(e)}},[a,i,s,_,l,n,r,f,o,y,b,T,S,E,D,C,O]),x.useEffect(()=>{a.current.insideReactTree=!1},[a,_,l]);let k=x.useMemo(()=>({onKeyDown:T,...u&&{[jr[d]]:e=>{r(!1,e.nativeEvent,`reference-press`)},...d!==`click`&&{onClick(e){r(!1,e.nativeEvent,`reference-press`)}}}}),[T,r,u,d]),A=x.useMemo(()=>{function e(e){e.button===0&&(v.current=!0)}return{onKeyDown:T,onMouseDown:e,onMouseUp:e,[Mr[l]]:()=>{a.current.insideReactTree=!0}}},[T,l,a]);return x.useMemo(()=>o?{reference:k,floating:A}:{},[o,k,A])}function Fr(e){let{open:t=!1,onOpenChange:n,elements:r}=e,i=pr(),a=x.useRef({}),[o]=x.useState(()=>mr()),s=_r()!=null,[c,l]=x.useState(r.reference),u=Q((e,t,r)=>{a.current.openEvent=e?t:void 0,o.emit(`openchange`,{open:e,event:t,reason:r,nested:s}),n?.(e,t,r)}),d=x.useMemo(()=>({setPositionReference:l}),[]),f=x.useMemo(()=>({reference:c||r.reference||null,floating:r.floating||null,domReference:r.reference}),[c,r.reference,r.floating]);return x.useMemo(()=>({dataRef:a,open:t,onOpenChange:u,elements:f,events:o,floatingId:i,refs:d}),[t,u,f,o,i,d])}function Ir(e){let{elements:t,...n}=e===void 0?{}:e,{nodeId:r}=n,i=Fr({...n,elements:{reference:t?.reference??null,floating:t?.floating??null}}),a=n.rootContext||i,o=a.elements,[s,c]=x.useState(null),[l,u]=x.useState(null),d=o?.domReference||s,f=x.useRef(null),p=vr();Z(()=>{d&&(f.current=d)},[d]);let m=Hn({...n,elements:{...o,...l&&{reference:l}}}),h=x.useCallback(e=>{let t=U(e)?{getBoundingClientRect:()=>e.getBoundingClientRect(),getClientRects:()=>e.getClientRects(),contextElement:e}:e;u(t),m.refs.setReference(t)},[m.refs]),g=x.useCallback(e=>{(U(e)||e===null)&&(f.current=e,c(e)),(U(m.refs.reference.current)||m.refs.reference.current===null||e!==null&&!U(e))&&m.refs.setReference(e)},[m.refs]),_=x.useMemo(()=>({...m.refs,setReference:g,setPositionReference:h,domReference:f}),[m.refs,g,h]),v=x.useMemo(()=>({...m.elements,domReference:d}),[m.elements,d]),y=x.useMemo(()=>({...m,...a,refs:_,elements:v,nodeId:r}),[m,_,v,r,a]);return Z(()=>{a.dataRef.current.floatingContext=y;let e=p?.nodesRef.current.find(e=>e.id===r);e&&(e.context=y)}),x.useMemo(()=>({...m,context:y,refs:_,elements:v}),[m,_,v,y])}function Lr(){return ht()&&mt()}function Rr(e,t){t===void 0&&(t={});let{open:n,onOpenChange:r,events:i,dataRef:a,elements:o}=e,{enabled:s=!0,visibleOnly:c=!0}=t,l=x.useRef(!1),u=x.useRef(-1),d=x.useRef(!0);x.useEffect(()=>{if(!s)return;let e=V(o.domReference);function t(){!n&&W(o.domReference)&&o.domReference===yt(wt(o.domReference))&&(l.current=!0)}function r(){d.current=!0}function i(){d.current=!1}return e.addEventListener(`blur`,t),Lr()&&(e.addEventListener(`keydown`,r,!0),e.addEventListener(`pointerdown`,i,!0)),()=>{e.removeEventListener(`blur`,t),Lr()&&(e.removeEventListener(`keydown`,r,!0),e.removeEventListener(`pointerdown`,i,!0))}},[o.domReference,n,s]),x.useEffect(()=>{if(!s)return;function e(e){let{reason:t}=e;(t===`reference-press`||t===`escape-key`)&&(l.current=!0)}return i.on(`openchange`,e),()=>{i.off(`openchange`,e)}},[i,s]),x.useEffect(()=>()=>{$(u)},[]);let f=x.useMemo(()=>({onMouseLeave(){l.current=!1},onFocus(e){if(l.current)return;let t=xt(e.nativeEvent);if(c&&U(t)){if(Lr()&&!e.relatedTarget){if(!d.current&&!Tt(t))return}else if(!Et(t))return}r(!0,e.nativeEvent,`focus`)},onBlur(e){l.current=!1;let t=e.relatedTarget,n=e.nativeEvent,i=U(t)&&t.hasAttribute(yr(`focus-guard`))&&t.getAttribute(`data-type`)===`outside`;u.current=window.setTimeout(()=>{let e=yt(o.domReference?o.domReference.ownerDocument:document);(t||e!==o.domReference)&&(bt(a.current.floatingContext?.refs.floating.current,e)||bt(o.domReference,e)||i||r(!1,n,`focus`))})}}),[a,o.domReference,r,c]);return x.useMemo(()=>s?{reference:f}:{},[s,f])}function zr(e,t,n){let r=new Map,i=n===`item`,a=e;if(i&&e){let{[er]:t,[tr]:n,...r}=e;a=r}return{...n===`floating`&&{tabIndex:-1,[$n]:``},...a,...t.map(t=>{let r=t?t[n]:null;return typeof r==`function`?e?r(e):null:r}).concat(e).reduce((e,t)=>(t&&Object.entries(t).forEach(t=>{let[n,a]=t;if(!(i&&[er,tr].includes(n))){if(n.indexOf(`on`)===0){if(r.has(n)||r.set(n,[]),typeof a==`function`){var o;(o=r.get(n))==null||o.push(a),e[n]=function(){var e=[...arguments];return r.get(n)?.map(t=>t(...e)).find(e=>e!==void 0)}}}else e[n]=a}}),e),{})}}function Br(e){e===void 0&&(e=[]);let t=e.map(e=>e?.reference),n=e.map(e=>e?.floating),r=e.map(e=>e?.item),i=x.useCallback(t=>zr(t,e,`reference`),t),a=x.useCallback(t=>zr(t,e,`floating`),n),o=x.useCallback(t=>zr(t,e,`item`),r);return x.useMemo(()=>({getReferenceProps:i,getFloatingProps:a,getItemProps:o}),[i,a,o])}var Vr=new Map([[`select`,`listbox`],[`combobox`,`listbox`],[`label`,!1]]);function Hr(e,t){t===void 0&&(t={});let{open:n,elements:r,floatingId:i}=e,{enabled:a=!0,role:o=`dialog`}=t,s=pr(),c=r.domReference?.id||s,l=x.useMemo(()=>Dt(r.floating)?.id||i,[r.floating,i]),u=Vr.get(o)??o,d=_r()!=null,f=x.useMemo(()=>u===`tooltip`||o===`label`?{[`aria-`+(o===`label`?`labelledby`:`describedby`)]:n?l:void 0}:{"aria-expanded":n?`true`:`false`,"aria-haspopup":u===`alertdialog`?`dialog`:u,"aria-controls":n?l:void 0,...u===`listbox`&&{role:`combobox`},...u===`menu`&&{id:c},...u===`menu`&&d&&{role:`menuitem`},...o===`select`&&{"aria-autocomplete":`none`},...o===`combobox`&&{"aria-autocomplete":`list`}},[u,l,d,n,c,o]),p=x.useMemo(()=>{let e={id:l,...u&&{role:u}};return u===`tooltip`||o===`label`?e:{...e,...u===`menu`&&{"aria-labelledby":c}}},[u,l,c,o]),m=x.useCallback(e=>{let{active:t,selected:n}=e,r={role:`option`,...t&&{id:l+`-fui-option`}};switch(o){case`select`:case`combobox`:return{...r,"aria-selected":n}}return{}},[l,o]);return x.useMemo(()=>a?{reference:f,floating:p,item:m}:{},[a,f,p,m])}function Ur(e,t,n){return n===void 0&&(n=!0),e.filter(e=>e.parentId===t&&(!n||e.context?.open)).flatMap(t=>[t,...Ur(e,t.id,n)])}function Wr(e,t){let[n,r]=e,i=!1,a=t.length;for(let e=0,o=a-1;e=r!=l>=r&&n<=(c-a)*(r-s)/(l-s)+a&&(i=!i)}return i}function Gr(e,t){return e[0]>=t.x&&e[0]<=t.x+t.width&&e[1]>=t.y&&e[1]<=t.y+t.height}function Kr(e){e===void 0&&(e={});let{buffer:t=.5,blockPointerEvents:n=!1,requireIntent:r=!0}=e,i={current:-1},a=!1,o=null,s=null,c=typeof performance<`u`?performance.now():0;function l(e,t){let n=performance.now(),r=n-c;if(o===null||s===null||r===0)return o=e,s=t,c=n,null;let i=e-o,a=t-s,l=Math.sqrt(i*i+a*a)/r;return o=e,s=t,c=n,l}let u=e=>{let{x:n,y:o,placement:s,elements:c,onClose:u,nodeId:d,tree:f}=e;return function(e){function p(){$(i),u()}if($(i),!c.domReference||!c.floating||s==null||n==null||o==null)return;let{clientX:m,clientY:h}=e,g=[m,h],_=Ar(e),v=e.type===`mouseleave`,y=kr(c.floating,_),b=kr(c.domReference,_),x=c.domReference.getBoundingClientRect(),S=c.floating.getBoundingClientRect(),C=s.split(`-`)[0],w=n>S.right-S.width/2,T=o>S.bottom-S.height/2,E=Gr(g,x),D=S.width>x.width,O=S.height>x.height,k=(D?x:S).left,A=(D?x:S).right,j=(O?x:S).top,M=(O?x:S).bottom;if(y&&(a=!0,!v))return;if(b&&(a=!1),b&&!v){a=!0;return}if(v&&U(e.relatedTarget)&&kr(c.floating,e.relatedTarget)||f&&Ur(f.nodesRef.current,d).length)return;if(C===`top`&&o>=x.bottom-1||C===`bottom`&&o<=x.top+1||C===`left`&&n>=x.right-1||C===`right`&&n<=x.left+1)return p();let N=[];switch(C){case`top`:N=[[k,x.top+1],[k,S.bottom-1],[A,S.bottom-1],[A,x.top+1]];break;case`bottom`:N=[[k,S.top+1],[k,x.bottom-1],[A,x.bottom-1],[A,S.top+1]];break;case`left`:N=[[S.right-1,M],[S.right-1,j],[x.left+1,j],[x.left+1,M]];break;case`right`:N=[[x.right-1,M],[x.right-1,j],[S.left+1,j],[S.left+1,M]]}function P(e){let[n,r]=e;switch(C){case`top`:return[[D?n+t/2:w?n+t*4:n-t*4,r+t+1],[D?n-t/2:w?n+t*4:n-t*4,r+t+1],[S.left,w||D?S.bottom-t:S.top],[S.right,w?D?S.bottom-t:S.top:S.bottom-t]];case`bottom`:return[[D?n+t/2:w?n+t*4:n-t*4,r-t],[D?n-t/2:w?n+t*4:n-t*4,r-t],[S.left,w||D?S.top+t:S.bottom],[S.right,w?D?S.top+t:S.bottom:S.top+t]];case`left`:{let e=[n+t+1,O?r+t/2:T?r+t*4:r-t*4],i=[n+t+1,O?r-t/2:T?r+t*4:r-t*4];return[[T||O?S.right-t:S.left,S.top],[T?O?S.right-t:S.left:S.right-t,S.bottom],e,i]}case`right`:return[[n-t,O?r+t/2:T?r+t*4:r-t*4],[n-t,O?r-t/2:T?r+t*4:r-t*4],[T||O?S.left+t:S.right,S.top],[T?O?S.left+t:S.right:S.left+t,S.bottom]]}}if(!Wr([m,h],N)){if(a&&!E)return p();if(!v&&r){let t=l(e.clientX,e.clientY);if(t!==null&&t<.1)return p()}Wr([m,h],P([n,o]))?!a&&r&&(i.current=window.setTimeout(p,40)):p()}}};return u.__options={blockPointerEvents:n},u}var qr={scrollHideDelay:1e3,type:`hover`,scrollbars:`xy`},Jr=u((e,{scrollbarSize:t,overscrollBehavior:n,scrollbars:r})=>{let i=n;return n&&r&&(r===`x`?i=`${n} auto`:r===`y`&&(i=`auto ${n}`)),{root:{"--scrollarea-scrollbar-size":g(t),"--scrollarea-over-scroll-behavior":i}}}),Yr=l(e=>{let t=s(`ScrollArea`,qr,e),{classNames:n,className:r,style:a,styles:o,unstyled:c,scrollbarSize:l,vars:u,type:d,scrollHideDelay:f,viewportProps:p,viewportRef:m,onScrollPositionChange:g,children:_,offsetScrollbars:v,scrollbars:y,onBottomReached:b,onTopReached:S,onLeftReached:C,onRightReached:T,overscrollBehavior:E,startScrollPosition:D,verticalScrollbarPosition:O,attributes:k,...A}=t,[j,M]=(0,x.useState)(!1),[N,P]=(0,x.useState)(!1),[ee,ne]=(0,x.useState)(!1),ie=(0,x.useRef)(!0),I=(0,x.useRef)(!1),ae=(0,x.useRef)(!0),oe=(0,x.useRef)(!1),L=i({name:`ScrollArea`,props:t,classes:Se,className:r,style:a,classNames:n,styles:o,unstyled:c,attributes:k,vars:u,varsResolver:Jr}),se=(0,x.useRef)(null),[ce,le]=(0,x.useState)(null),R=Qn([m,se,(0,x.useCallback)(e=>{le(t=>t===e?t:e)},[])]);return F(v===`present`?ce:null,()=>{let e=se.current;e&&(P(e.scrollHeight>e.clientHeight),ne(e.scrollWidth>e.clientWidth))}),h(()=>{D&&se.current&&se.current.scrollTo({left:D.x??0,top:D.y??0})},[]),(0,w.jsxs)(re,{getStyles:L,type:d===`never`?`always`:d,scrollHideDelay:f,scrollbars:y,...L(`root`),...A,children:[(0,w.jsx)(xe,{...p,...L(`viewport`,{style:p?.style}),ref:R,"data-offset-scrollbars":v===!0?`xy`:v||void 0,"data-scrollbars":y||void 0,"data-vertical-scrollbar-position":O||void 0,"data-horizontal-hidden":v===`present`&&!ee?`true`:void 0,"data-vertical-hidden":v===`present`&&!N?`true`:void 0,onScroll:e=>{p?.onScroll?.(e),g?.({x:e.currentTarget.scrollLeft,y:e.currentTarget.scrollTop});let{scrollTop:t,scrollHeight:n,clientHeight:r,scrollLeft:i,scrollWidth:a,clientWidth:o}=e.currentTarget,s=t-(n-r)>=-.8,c=t===0;s&&!I.current&&b?.(),c&&!ie.current&&S?.(),I.current=s,ie.current=c;let l=i-(a-o)>=-.8,u=i===0;l&&!oe.current&&T?.(),u&&!ae.current&&C?.(),oe.current=l,ae.current=u},children:_}),(y===`xy`||y===`x`)&&(0,w.jsx)(ve,{...L(`scrollbar`),orientation:`horizontal`,"data-vertical-scrollbar-position":O||void 0,"data-hidden":d===`never`||v===`present`&&!ee||void 0,forceMount:!0,onMouseEnter:()=>M(!0),onMouseLeave:()=>M(!1),children:(0,w.jsx)(B,{...L(`thumb`)})}),(y===`xy`||y===`y`)&&(0,w.jsx)(ve,{...L(`scrollbar`),orientation:`vertical`,"data-vertical-scrollbar-position":O||void 0,"data-hidden":d===`never`||v===`present`&&!N||void 0,forceMount:!0,onMouseEnter:()=>M(!0),onMouseLeave:()=>M(!1),children:(0,w.jsx)(B,{...L(`thumb`)})}),(0,w.jsx)(te,{...L(`corner`),"data-vertical-scrollbar-position":O||void 0,"data-hovered":j||void 0,"data-hidden":d===`never`||void 0})]})});Yr.displayName=`@mantine/core/ScrollArea`;var Xr=l(e=>{let{children:t,classNames:n,styles:r,scrollbarSize:i,scrollHideDelay:o,type:c,dir:l,offsetScrollbars:u,overscrollBehavior:d,viewportRef:f,onScrollPositionChange:p,unstyled:m,variant:h,viewportProps:g,scrollbars:_,style:v,vars:y,onBottomReached:b,onTopReached:S,startScrollPosition:C,verticalScrollbarPosition:T,onOverflowChange:E,...D}=s(`ScrollAreaAutosize`,qr,e),O=(0,x.useRef)(null),[k,A]=(0,x.useState)(null),j=Qn([f,O,(0,x.useCallback)(e=>{A(t=>t===e?t:e)},[])]),M=(0,x.useRef)(!1),N=(0,x.useRef)(!1),P=(0,x.useEffectEvent)(()=>{let e=O.current;if(!e||!E)return;let t=e.scrollHeight>e.clientHeight;t!==M.current&&(N.current?E(t):(N.current=!0,t&&E(!0)),M.current=t)});return F(E?k:null,P),(0,w.jsx)(a,{...D,variant:h,style:[{display:`flex`,overflow:`hidden`},v],children:(0,w.jsx)(a,{style:{display:`flex`,flexDirection:`column`,flex:1,overflow:`hidden`,..._===`y`&&{minWidth:0},..._===`x`&&{minHeight:0},..._===`xy`&&{minWidth:0,minHeight:0},..._===!1&&{minWidth:0,minHeight:0}},children:(0,w.jsx)(Yr,{classNames:n,styles:r,scrollHideDelay:o,scrollbarSize:i,type:c,dir:l,offsetScrollbars:u,overscrollBehavior:d,viewportRef:j,onScrollPositionChange:p,unstyled:m,variant:h,viewportProps:g,vars:y,scrollbars:_,onBottomReached:b,onTopReached:S,startScrollPosition:C,verticalScrollbarPosition:T,"data-autosize":`true`,children:t})})})});Yr.classes=Se,Yr.varsResolver=Jr,Xr.displayName=`@mantine/core/ScrollAreaAutosize`,Xr.classes=Se,Yr.Autosize=Xr;function Zr(e,t,n,r){return e===`center`||r===`center`?{top:t}:e===`end`?{bottom:n}:e===`start`?{top:n}:{}}function Qr(e,t,n,r,i){return e===`center`||r===`center`?{left:t}:e===`end`?{[i===`ltr`?`right`:`left`]:n}:e===`start`?{[i===`ltr`?`left`:`right`]:n}:{}}var $r={bottom:`borderTopLeftRadius`,left:`borderTopRightRadius`,right:`borderBottomLeftRadius`,top:`borderBottomRightRadius`};function ei({position:e,arrowSize:t,dir:n}){let[r,i]=e.split(`-`);if(!i)return;let a={width:t,height:t,position:`absolute`};if(r===`bottom`){let e=i===`start`,r=e?n===`ltr`?`left`:`right`:n===`ltr`?`right`:`left`;return{...a,top:-t,[r]:0,clipPath:e===(n===`rtl`)?`polygon(100% 0%, 0% 100%, 100% 100%)`:`polygon(0% 0%, 0% 100%, 100% 100%)`}}if(r===`top`){let e=i===`start`,r=e?n===`ltr`?`left`:`right`:n===`ltr`?`right`:`left`;return{...a,bottom:-t,[r]:0,clipPath:e===(n===`rtl`)?`polygon(0% 0%, 100% 0%, 100% 100%)`:`polygon(0% 0%, 100% 0%, 0% 100%)`}}if(r===`left`)return{...a,right:-t,[i===`start`?`top`:`bottom`]:0,clipPath:i===`start`?`polygon(0% 0%, 100% 0%, 0% 100%)`:`polygon(0% 0%, 0% 100%, 100% 100%)`};if(r===`right`)return{...a,left:-t,[i===`start`?`top`:`bottom`]:0,clipPath:i===`start`?`polygon(0% 0%, 100% 0%, 100% 100%)`:`polygon(100% 0%, 0% 100%, 100% 100%)`}}function ti({position:e,arrowSize:t,arrowOffset:n,arrowRadius:r,arrowPosition:i,arrowX:a,arrowY:o,dir:s}){if(i===`merge`){let n=ei({position:e,arrowSize:t,dir:s});if(n)return n}let[c,l=`center`]=e.split(`-`),u={width:t,height:t,transform:`rotate(45deg)`,position:`absolute`,[$r[c]]:r},d=-t/2;return c===`left`?{...u,...Zr(l,o,n,i),right:d,borderLeftColor:`transparent`,borderBottomColor:`transparent`,clipPath:`polygon(100% 0, 0 0, 100% 100%)`}:c===`right`?{...u,...Zr(l,o,n,i),left:d,borderRightColor:`transparent`,borderTopColor:`transparent`,clipPath:`polygon(0 100%, 0 0, 100% 100%)`}:c===`top`?{...u,...Qr(l,a,n,i,s),bottom:d,borderTopColor:`transparent`,borderLeftColor:`transparent`,clipPath:`polygon(0 100%, 100% 100%, 100% 0)`}:c===`bottom`?{...u,...Qr(l,a,n,i,s),top:d,borderBottomColor:`transparent`,borderRightColor:`transparent`,clipPath:`polygon(0 100%, 0 0, 100% 0)`}:{}}function ni({position:e,dir:t}){let[n,r]=e.split(`-`);if(!r)return;let i=r===`start`&&t===`ltr`||r===`end`&&t===`rtl`;if(n===`bottom`)return i?{borderTopLeftRadius:0}:{borderTopRightRadius:0};if(n===`top`)return i?{borderBottomLeftRadius:0}:{borderBottomRightRadius:0};if(n===`left`)return r===`start`?{borderTopRightRadius:0}:{borderBottomRightRadius:0};if(n===`right`)return r===`start`?{borderTopLeftRadius:0}:{borderBottomLeftRadius:0}}function ri({position:e,arrowSize:t,arrowOffset:n,arrowRadius:r,arrowPosition:i,visible:a,arrowX:o,arrowY:s,style:c,...l}){let{dir:u}=M();return a?(0,w.jsx)(`div`,{role:`presentation`,...l,style:{...c,...ti({position:e,arrowSize:t,arrowOffset:n,arrowRadius:r,arrowPosition:i,dir:u,arrowX:o,arrowY:s})}}):null}ri.displayName=`@mantine/core/FloatingArrow`;function ii(e,t){if(e===`rtl`&&(t.includes(`right`)||t.includes(`left`))){let[e,n]=t.split(`-`),r=e===`right`?`left`:`right`;return n===void 0?r:`${r}-${n}`}return t}function ai(e){let t=document.createElement(`div`);return t.setAttribute(`data-portal`,`true`),typeof e.className==`string`&&t.classList.add(...e.className.split(` `).filter(Boolean)),typeof e.style==`object`&&Object.assign(t.style,e.style),typeof e.id==`string`&&t.setAttribute(`id`,e.id),t}var oi=null;function si({target:e,reuseTargetNode:t,...n}){if(e)return typeof e==`string`?document.querySelector(e)||ai(n):e;if(t){if(oi){if(document.body.contains(oi))return oi;oi=null}let e=document.querySelector(`[data-mantine-shared-portal-node]`);if(e)return oi=e,e;let t=ai(n);return t.setAttribute(`data-mantine-shared-portal-node`,`true`),document.body.appendChild(t),oi=t,t}return ai(n)}var ci={reuseTargetNode:!0},li=l(e=>{let{children:t,target:n,reuseTargetNode:i,ref:a,...o}=s(`Portal`,ci,e),[c,l]=(0,x.useState)(!1),u=(0,x.useRef)(null);return h(()=>(l(!0),u.current=si({target:n,reuseTargetNode:i,...o}),r(a,u.current),!n&&!i&&u.current&&document.body.appendChild(u.current),()=>{!n&&!i&&u.current&&document.body.removeChild(u.current)}),[n]),!c||!u.current?null:(0,C.createPortal)((0,w.jsx)(w.Fragment,{children:t}),u.current)});li.displayName=`@mantine/core/Portal`;var ui=l(({withinPortal:e=!0,children:t,...n})=>b()===`test`||!e?(0,w.jsx)(w.Fragment,{children:t}):(0,w.jsx)(li,{...n,children:t}));ui.displayName=`@mantine/core/OptionalPortal`;var di={duration:100,transition:`fade`};function fi(e,t){return{...di,...t,...e}}function pi({offset:e,position:t,defaultOpened:n}){let[r,i]=(0,x.useState)(n),a=(0,x.useRef)(null),{x:o,y:s,elements:c,refs:l,update:u,placement:d}=Ir({placement:t,middleware:[Gn({crossAxis:!0,padding:5,rootBoundary:`document`})]}),f=d.includes(`right`)?e:t.includes(`left`)?e*-1:0,p=d.includes(`bottom`)?e:t.includes(`top`)?e*-1:0,m=(0,x.useCallback)(({clientX:e,clientY:t})=>{Number.isFinite(e)&&Number.isFinite(t)&&l.setPositionReference({getBoundingClientRect(){return{width:0,height:0,x:e,y:t,left:e+f,top:t+p,right:e,bottom:t}}})},[c.reference]);return(0,x.useEffect)(()=>{if(l.floating.current){let e=a.current;e.addEventListener(`mousemove`,m);let t=Ve(l.floating.current);return t.forEach(e=>{e.addEventListener(`scroll`,u)}),()=>{e.removeEventListener(`mousemove`,m),t.forEach(e=>{e.removeEventListener(`scroll`,u)})}}},[c.reference,l.floating.current,u,m,r]),{handleMouseMove:m,x:o,y:s,opened:r,setOpened:i,boundaryRef:a,floating:l.setFloating}}var mi={tooltip:`m_1b3c8819`,arrow:`m_f898399f`},hi={refProp:`ref`,withinPortal:!0,offset:10,position:`right`,zIndex:E(`popover`)},gi=u((e,{radius:t,color:n})=>({tooltip:{"--tooltip-radius":t===void 0?void 0:v(t),"--tooltip-bg":n?o(n,e):void 0,"--tooltip-color":n?`var(--mantine-color-white)`:void 0}})),_i=l(e=>{let t=s(`TooltipFloating`,hi,e),{children:n,refProp:r,withinPortal:o,style:l,className:u,classNames:d,styles:p,unstyled:m,radius:h,color:g,label:_,offset:v,position:b,multiline:S,zIndex:C,disabled:T,defaultOpened:E,variant:D,vars:O,portalProps:j,attributes:M,ref:N,...P}=t,F=c(),ee=i({name:`TooltipFloating`,props:t,classes:mi,className:u,style:l,classNames:d,styles:p,unstyled:m,attributes:M,rootSelector:`tooltip`,vars:O,varsResolver:gi}),{handleMouseMove:te,x:ne,y:re,opened:ie,boundaryRef:I,floating:ae,setOpened:oe}=pi({offset:v,position:b,defaultOpened:E}),L=f(n);if(!L)throw Error(`[@mantine/core] Tooltip.Floating component children should be an element or a component that accepts ref, fragments, strings, numbers and other primitive values are not supported`);let se=y(I,k(L),N),ce=L.props,le=e=>{ce.onMouseEnter?.(e),te(e),oe(!0)},R=e=>{ce.onMouseLeave?.(e),oe(!1)};return(0,w.jsxs)(w.Fragment,{children:[(0,w.jsx)(ui,{...j,withinPortal:o,children:(0,w.jsx)(a,{...P,...ee(`tooltip`,{style:{...A(l,F),zIndex:C,display:!T&&ie?`block`:`none`,top:Number.isFinite(re)?Math.round(re):``,left:Number.isFinite(ne)?Math.round(ne):``}}),variant:D,ref:ae,mod:{multiline:S},children:_})}),(0,x.cloneElement)(L,{...ce,[r]:se,onMouseEnter:le,onMouseLeave:R})]})});_i.classes=mi,_i.varsResolver=gi,_i.displayName=`@mantine/core/TooltipFloating`;var vi=(0,x.createContext)({withinGroup:!1}),yi={openDelay:0,closeDelay:0};function bi(e){let{openDelay:t,closeDelay:n,children:r}=s(`TooltipGroup`,yi,e);return(0,w.jsx)(vi,{value:{withinGroup:!0},children:(0,w.jsx)(Dr,{delay:{open:t,close:n},children:r})})}bi.displayName=`@mantine/core/TooltipGroup`,bi.extend=e=>e;function xi(e){if(e===void 0)return{shift:!0,flip:!0};let t={...e};return e.shift===void 0&&(t.shift=!0),e.flip===void 0&&(t.flip=!0),t}function Si(e){let t=xi(e.middlewares),n=[Wn(e.offset),Yn()];return t.shift&&n.push(Gn(typeof t.shift==`boolean`?{padding:8}:{padding:8,...t.shift})),t.flip&&n.push(typeof t.flip==`boolean`?qn():qn(t.flip)),n.push(Zn({element:e.arrowRef,padding:e.arrowOffset})),t.inline?n.push(typeof t.inline==`boolean`?Xn():Xn(t.inline)):e.inline&&n.push(Xn()),n}function Ci(e){let[t,n]=(0,x.useState)(e.defaultOpened),r=typeof e.opened==`boolean`?e.opened:t,i=(0,x.use)(vi).withinGroup,a=_(),o=b(),s=(0,x.useCallback)(e=>{n(e),e&&S(a)},[a]),{x:c,y:l,context:u,refs:d,placement:f,middlewareData:{arrow:{x:p,y:m}={},hide:g}}=Ir({strategy:e.strategy,placement:e.position,open:r,onOpenChange:s,middleware:Si(e),whileElementsMounted:Dn}),{delay:v,currentId:y,setCurrentId:S}=Or(u,{id:a}),{getReferenceProps:C,getFloatingProps:w}=Br([Cr(u,{enabled:e.events?.hover,delay:i?v:{open:e.openDelay,close:e.closeDelay},mouseOnly:!e.events?.touch,handleClose:e.interactive?Kr():null}),Rr(u,{enabled:e.events?.focus,visibleOnly:!0}),Hr(u,{role:`tooltip`}),Pr(u,{enabled:e.opened===void 0})]),T=(0,x.useRef)(f);h(()=>{T.current!==f&&(T.current=f,e.onPositionChange?.(f))},[f]);let E=r&&y&&y!==a;return{x:c,y:l,arrowX:p,arrowY:m,reference:d.setReference,floating:d.setFloating,getFloatingProps:w,getReferenceProps:C,isGroupPhase:E,opened:r,placement:f,referenceHidden:e.hideDetached&&o!==`test`?g?.referenceHidden:!1}}var wi={position:`top`,refProp:`ref`,withinPortal:!0,arrowSize:4,arrowOffset:5,arrowRadius:0,arrowPosition:`side`,offset:5,transitionProps:{duration:100,transition:`fade`},events:{hover:!0,focus:!1,touch:!1},zIndex:E(`popover`),middlewares:{flip:!0,shift:!0,inline:!1},hideDetached:!0},Ti=u((e,{radius:t,color:n,variant:r,autoContrast:i})=>{let a=e.variantColorResolver({theme:e,color:n||e.primaryColor,autoContrast:i,variant:r||`filled`});return{tooltip:{"--tooltip-radius":t===void 0?void 0:v(t),"--tooltip-bg":n?a.background:void 0,"--tooltip-color":n?a.color:void 0}}}),Ei=l(e=>{let t=s(`Tooltip`,wi,e),{children:n,position:r,refProp:o,label:c,openDelay:l,closeDelay:u,onPositionChange:p,opened:h,defaultOpened:g,withinPortal:_,radius:v,color:b,classNames:S,styles:C,unstyled:T,style:E,className:D,withArrow:O,arrowSize:A,arrowOffset:j,arrowRadius:N,arrowPosition:P,offset:F,transitionProps:ee,multiline:te,events:ne,interactive:re,zIndex:ie,disabled:I,onClick:ae,onMouseEnter:oe,onMouseLeave:L,inline:se,variant:ce,keepMounted:le,vars:R,portalProps:ue,mod:de,floatingStrategy:fe,middlewares:pe,autoContrast:me,attributes:he,target:z,hideDetached:ge,ref:_e,...ve}=t,{dir:ye}=M(),be=(0,x.useRef)(null),B=Ci({position:ii(ye,r),closeDelay:u,openDelay:l,onPositionChange:p,opened:h,defaultOpened:g,events:ne,interactive:re,arrowRef:be,arrowOffset:j,offset:typeof F==`number`?F+(O?A/2:0):F,inline:se,strategy:fe,middlewares:pe,hideDetached:ge});(0,x.useEffect)(()=>{let e=z instanceof HTMLElement?z:typeof z==`string`?document.querySelector(z):z?.current||null;e&&B.reference(e)},[z,B]);let xe=i({name:`Tooltip`,props:t,classes:mi,className:D,style:E,classNames:S,styles:C,unstyled:T,attributes:he,rootSelector:`tooltip`,vars:R,varsResolver:Ti}),Se=f(n);if(!z&&!Se)throw Error(`[@mantine/core] Tooltip component children should be an element or a component that accepts ref, fragments, strings, numbers and other primitive values are not supported`);let Ce=xe(`tooltip`),we=re&&!I&&!!B.opened,V=P===`merge`&&O?ni({position:B.placement,dir:ye}):void 0;if(z){let e=fi(ee,{duration:100,transition:`fade`});return(0,w.jsx)(w.Fragment,{children:(0,w.jsx)(ui,{...ue,withinPortal:_,children:(0,w.jsx)(m,{...e,keepMounted:le,mounted:!I&&!!B.opened,duration:B.isGroupPhase?10:e.duration,children:e=>(0,w.jsxs)(a,{...ve,"data-fixed":fe===`fixed`||void 0,variant:ce,mod:[{multiline:te,interactive:we},de],...Ce,...B.getFloatingProps({ref:B.floating,className:Ce.className,style:{...Ce.style,...e,...V,zIndex:ie,top:B.y??0,left:B.x??0,...B.referenceHidden?{display:`none`}:null}}),children:[c,(0,w.jsx)(ri,{ref:be,arrowX:B.arrowX,arrowY:B.arrowY,visible:O,position:B.placement,arrowSize:A,arrowOffset:j,arrowRadius:N,arrowPosition:P,...xe(`arrow`)})]})})})})}let H=Se.props,Te=y(B.reference,k(Se),_e),U=fi(ee,{duration:100,transition:`fade`});return(0,w.jsxs)(w.Fragment,{children:[(0,w.jsx)(ui,{...ue,withinPortal:_,children:(0,w.jsx)(m,{...U,keepMounted:le,mounted:!I&&!!B.opened,duration:B.isGroupPhase?10:U.duration,children:e=>(0,w.jsxs)(a,{...ve,"data-fixed":fe===`fixed`||void 0,variant:ce,mod:[{multiline:te,interactive:we},de],...B.getFloatingProps({ref:B.floating,className:xe(`tooltip`).className,style:{...xe(`tooltip`).style,...e,...V,zIndex:ie,top:B.y??0,left:B.x??0,...B.referenceHidden?{display:`none`}:null}}),children:[c,(0,w.jsx)(ri,{ref:be,arrowX:B.arrowX,arrowY:B.arrowY,visible:O,position:B.placement,arrowSize:A,arrowOffset:j,arrowRadius:N,arrowPosition:P,...xe(`arrow`)})]})})}),(0,x.cloneElement)(Se,B.getReferenceProps({onClick:ae,onMouseEnter:oe,onMouseLeave:L,onMouseMove:t.onMouseMove,onPointerDown:t.onPointerDown,onPointerEnter:t.onPointerEnter,...H,className:d(D,H.className),[o]:Te}))]})});Ei.classes=mi,Ei.varsResolver=Ti,Ei.displayName=`@mantine/core/Tooltip`,Ei.Floating=_i,Ei.Group=bi;export{k as C,S as E,A as S,E as T,Gn as _,ni as a,le as b,Ir as c,Zn as d,qn as f,Wn as g,Kn as h,ri as i,Cr as l,Xn as m,ui as n,Yr as o,Yn as p,ii as r,Kr as s,Ei as t,Br as u,Jn as v,D as w,M as x,Dn as y}; \ No newline at end of file diff --git a/internal/ui/dist/assets/WarningCircle.es-CQHtdoVp.js b/internal/ui/dist/assets/WarningCircle.es-CQHtdoVp.js deleted file mode 100644 index 882938c20..000000000 --- a/internal/ui/dist/assets/WarningCircle.es-CQHtdoVp.js +++ /dev/null @@ -1 +0,0 @@ -import{i as e,r as t,s as n}from"./useRouter-ByJ6_rwb.js";import{M as r,Y as i,a,f as o,w as s}from"./brand-Bcp2Tp5I.js";import{S as c,T as l,f as u,i as d,m as f,u as p,v as m,x as h}from"./useQuery-CEXOTfck.js";var g={root:`m_849cf0da`},_=t(),v={underline:`hover`},y=s(e=>{let{underline:t,className:n,unstyled:a,mod:s,...c}=r(`Anchor`,v,e);return(0,_.jsx)(o,{component:`a`,className:i({[g.root]:!a},n),...c,mod:[{underline:t},s],__staticSelector:`Anchor`,unstyled:a})});y.classes=g,y.displayName=`@mantine/core/Anchor`;var b=class extends u{#e;#t=void 0;#n;#r;constructor(e,t){super(),this.#e=e,this.setOptions(t),this.bindMethods(),this.#i()}bindMethods(){this.mutate=this.mutate.bind(this),this.reset=this.reset.bind(this)}setOptions(e){let t=this.options;this.options=this.#e.defaultMutationOptions(e),h(this.options,t)||this.#e.getMutationCache().notify({type:`observerOptionsUpdated`,mutation:this.#n,observer:this}),t?.mutationKey&&this.options.mutationKey&&f(t.mutationKey)!==f(this.options.mutationKey)?this.reset():this.#n?.state.status===`pending`&&this.#n.setOptions(this.options)}onSubscribe(){this.listeners.size===1&&this.#n&&(this.#n.addObserver(this),this.#i())}onUnsubscribe(){this.hasListeners()||this.#n?.removeObserver(this)}onMutationUpdate(e){this.#i(),this.#a(e)}getCurrentResult(){return this.#t}reset(){this.#n?.removeObserver(this),this.#n=void 0,this.#i(),this.#a()}mutate(e,t){return this.#r=t,this.#n?.removeObserver(this),this.#n=this.#e.getMutationCache().build(this.#e,this.options),this.#n.addObserver(this),this.#n.execute(e)}#i(){let e=this.#n?.state??d();this.#t={...e,isPending:e.status===`pending`,isSuccess:e.status===`success`,isError:e.status===`error`,isIdle:e.status===`idle`,mutate:this.mutate,reset:this.reset}}#a(e){p.batch(()=>{if(this.#r&&this.hasListeners()){let t=this.#t.variables,n=this.#t.context,r={client:this.#e,meta:this.options.meta,mutationKey:this.options.mutationKey};if(e?.type===`success`){try{this.#r.onSuccess?.(e.data,t,n,r)}catch(e){Promise.reject(e)}try{this.#r.onSettled?.(e.data,null,t,n,r)}catch(e){Promise.reject(e)}}else if(e?.type===`error`){try{this.#r.onError?.(e.error,t,n,r)}catch(e){Promise.reject(e)}try{this.#r.onSettled?.(void 0,e.error,t,n,r)}catch(e){Promise.reject(e)}}}this.listeners.forEach(e=>{e(this.#t)})})}},x=n(e(),1);function S(e,t){let n=l(t),[r]=x.useState(()=>new b(n,e));x.useEffect(()=>{r.setOptions(e)},[r,e]);let i=x.useSyncExternalStore(x.useCallback(e=>r.subscribe(p.batchCalls(e)),[r]),()=>r.getCurrentResult(),()=>r.getCurrentResult()),a=x.useCallback((...e)=>{r.mutate(e[0],e[1]).catch(m)},[r]);if(i.error&&c(r.options.throwOnError,[i.error]))throw i.error;return{...i,mutate:a,mutateAsync:i.mutate}}var C=new Map([[`bold`,x.createElement(x.Fragment,null,x.createElement(`path`,{d:`M128,20A108,108,0,1,0,236,128,108.12,108.12,0,0,0,128,20Zm0,192a84,84,0,1,1,84-84A84.09,84.09,0,0,1,128,212Zm-12-80V80a12,12,0,0,1,24,0v52a12,12,0,0,1-24,0Zm28,40a16,16,0,1,1-16-16A16,16,0,0,1,144,172Z`}))],[`duotone`,x.createElement(x.Fragment,null,x.createElement(`path`,{d:`M224,128a96,96,0,1,1-96-96A96,96,0,0,1,224,128Z`,opacity:`0.2`}),x.createElement(`path`,{d:`M128,24A104,104,0,1,0,232,128,104.11,104.11,0,0,0,128,24Zm0,192a88,88,0,1,1,88-88A88.1,88.1,0,0,1,128,216Zm-8-80V80a8,8,0,0,1,16,0v56a8,8,0,0,1-16,0Zm20,36a12,12,0,1,1-12-12A12,12,0,0,1,140,172Z`}))],[`fill`,x.createElement(x.Fragment,null,x.createElement(`path`,{d:`M128,24A104,104,0,1,0,232,128,104.11,104.11,0,0,0,128,24Zm-8,56a8,8,0,0,1,16,0v56a8,8,0,0,1-16,0Zm8,104a12,12,0,1,1,12-12A12,12,0,0,1,128,184Z`}))],[`light`,x.createElement(x.Fragment,null,x.createElement(`path`,{d:`M128,26A102,102,0,1,0,230,128,102.12,102.12,0,0,0,128,26Zm0,192a90,90,0,1,1,90-90A90.1,90.1,0,0,1,128,218Zm-6-82V80a6,6,0,0,1,12,0v56a6,6,0,0,1-12,0Zm16,36a10,10,0,1,1-10-10A10,10,0,0,1,138,172Z`}))],[`regular`,x.createElement(x.Fragment,null,x.createElement(`path`,{d:`M128,24A104,104,0,1,0,232,128,104.11,104.11,0,0,0,128,24Zm0,192a88,88,0,1,1,88-88A88.1,88.1,0,0,1,128,216Zm-8-80V80a8,8,0,0,1,16,0v56a8,8,0,0,1-16,0Zm20,36a12,12,0,1,1-12-12A12,12,0,0,1,140,172Z`}))],[`thin`,x.createElement(x.Fragment,null,x.createElement(`path`,{d:`M128,28A100,100,0,1,0,228,128,100.11,100.11,0,0,0,128,28Zm0,192a92,92,0,1,1,92-92A92.1,92.1,0,0,1,128,220Zm-4-84V80a4,4,0,0,1,8,0v56a4,4,0,0,1-8,0Zm12,36a8,8,0,1,1-8-8A8,8,0,0,1,136,172Z`}))]]),w=x.forwardRef((e,t)=>x.createElement(a,{ref:t,...e,weights:C}));w.displayName=`WarningCircleIcon`;var T=w;export{S as n,y as r,T as t}; \ No newline at end of file diff --git a/internal/ui/dist/assets/WarningCircle.es-DMCNfIHa.js b/internal/ui/dist/assets/WarningCircle.es-DMCNfIHa.js new file mode 100644 index 000000000..fb51c6ea8 --- /dev/null +++ b/internal/ui/dist/assets/WarningCircle.es-DMCNfIHa.js @@ -0,0 +1 @@ +import{i as e,r as t,s as n}from"./useRouter-ByJ6_rwb.js";import{M as r,Y as i,a,f as o,w as s}from"./brand-DUaZkIz1.js";import{G as c,J as l,K as u,W as d,X as f,Y as p,Z as m,q as h}from"./index-D1TEoZWj.js";var g={root:`m_849cf0da`},_=t(),v={underline:`hover`},y=s(e=>{let{underline:t,className:n,unstyled:a,mod:s,...c}=r(`Anchor`,v,e);return(0,_.jsx)(o,{component:`a`,className:i({[g.root]:!a},n),...c,mod:[{underline:t},s],__staticSelector:`Anchor`,unstyled:a})});y.classes=g,y.displayName=`@mantine/core/Anchor`;var b=class extends u{#e;#t=void 0;#n;#r;constructor(e,t){super(),this.#e=e,this.setOptions(t),this.bindMethods(),this.#i()}bindMethods(){this.mutate=this.mutate.bind(this),this.reset=this.reset.bind(this)}setOptions(e){let t=this.options;this.options=this.#e.defaultMutationOptions(e),p(this.options,t)||this.#e.getMutationCache().notify({type:`observerOptionsUpdated`,mutation:this.#n,observer:this}),t?.mutationKey&&this.options.mutationKey&&h(t.mutationKey)!==h(this.options.mutationKey)?this.reset():this.#n?.state.status===`pending`&&this.#n.setOptions(this.options)}onSubscribe(){this.listeners.size===1&&this.#n&&(this.#n.addObserver(this),this.#i())}onUnsubscribe(){this.hasListeners()||this.#n?.removeObserver(this)}onMutationUpdate(e){this.#i(),this.#a(e)}getCurrentResult(){return this.#t}reset(){this.#n?.removeObserver(this),this.#n=void 0,this.#i(),this.#a()}mutate(e,t){return this.#r=t,this.#n?.removeObserver(this),this.#n=this.#e.getMutationCache().build(this.#e,this.options),this.#n.addObserver(this),this.#n.execute(e)}#i(){let e=this.#n?.state??d();this.#t={...e,isPending:e.status===`pending`,isSuccess:e.status===`success`,isError:e.status===`error`,isIdle:e.status===`idle`,mutate:this.mutate,reset:this.reset}}#a(e){c.batch(()=>{let t=this.#r;if(t&&this.hasListeners()){let n=this.#t.variables,r=this.#t.context,i={client:this.#e,meta:this.options.meta,mutationKey:this.options.mutationKey};if(e?.type===`success`){try{t.onSuccess?.(e.data,n,r,i)}catch(e){Promise.reject(e)}try{t.onSettled?.(e.data,null,n,r,i)}catch(e){Promise.reject(e)}}else if(e?.type===`error`){try{t.onError?.(e.error,n,r,i)}catch(e){Promise.reject(e)}try{t.onSettled?.(void 0,e.error,n,r,i)}catch(e){Promise.reject(e)}}}this.listeners.forEach(e=>{e(this.#t)})})}},x=n(e(),1);function S(e,t){let n=m(t),[r]=x.useState(()=>new b(n,e));x.useEffect(()=>{r.setOptions(e)},[r,e]);let i=x.useSyncExternalStore(x.useCallback(e=>r.subscribe(c.batchCalls(e)),[r]),()=>r.getCurrentResult(),()=>r.getCurrentResult()),a=x.useCallback((...e)=>{r.mutate(e[0],e[1]).catch(l)},[r]);if(i.error&&f(r.options.throwOnError,[i.error]))throw i.error;return{...i,mutate:a,mutateAsync:i.mutate}}var C=new Map([[`bold`,x.createElement(x.Fragment,null,x.createElement(`path`,{d:`M128,20A108,108,0,1,0,236,128,108.12,108.12,0,0,0,128,20Zm0,192a84,84,0,1,1,84-84A84.09,84.09,0,0,1,128,212Zm-12-80V80a12,12,0,0,1,24,0v52a12,12,0,0,1-24,0Zm28,40a16,16,0,1,1-16-16A16,16,0,0,1,144,172Z`}))],[`duotone`,x.createElement(x.Fragment,null,x.createElement(`path`,{d:`M224,128a96,96,0,1,1-96-96A96,96,0,0,1,224,128Z`,opacity:`0.2`}),x.createElement(`path`,{d:`M128,24A104,104,0,1,0,232,128,104.11,104.11,0,0,0,128,24Zm0,192a88,88,0,1,1,88-88A88.1,88.1,0,0,1,128,216Zm-8-80V80a8,8,0,0,1,16,0v56a8,8,0,0,1-16,0Zm20,36a12,12,0,1,1-12-12A12,12,0,0,1,140,172Z`}))],[`fill`,x.createElement(x.Fragment,null,x.createElement(`path`,{d:`M128,24A104,104,0,1,0,232,128,104.11,104.11,0,0,0,128,24Zm-8,56a8,8,0,0,1,16,0v56a8,8,0,0,1-16,0Zm8,104a12,12,0,1,1,12-12A12,12,0,0,1,128,184Z`}))],[`light`,x.createElement(x.Fragment,null,x.createElement(`path`,{d:`M128,26A102,102,0,1,0,230,128,102.12,102.12,0,0,0,128,26Zm0,192a90,90,0,1,1,90-90A90.1,90.1,0,0,1,128,218Zm-6-82V80a6,6,0,0,1,12,0v56a6,6,0,0,1-12,0Zm16,36a10,10,0,1,1-10-10A10,10,0,0,1,138,172Z`}))],[`regular`,x.createElement(x.Fragment,null,x.createElement(`path`,{d:`M128,24A104,104,0,1,0,232,128,104.11,104.11,0,0,0,128,24Zm0,192a88,88,0,1,1,88-88A88.1,88.1,0,0,1,128,216Zm-8-80V80a8,8,0,0,1,16,0v56a8,8,0,0,1-16,0Zm20,36a12,12,0,1,1-12-12A12,12,0,0,1,140,172Z`}))],[`thin`,x.createElement(x.Fragment,null,x.createElement(`path`,{d:`M128,28A100,100,0,1,0,228,128,100.11,100.11,0,0,0,128,28Zm0,192a92,92,0,1,1,92-92A92.1,92.1,0,0,1,128,220Zm-4-84V80a4,4,0,0,1,8,0v56a4,4,0,0,1-8,0Zm12,36a8,8,0,1,1-8-8A8,8,0,0,1,136,172Z`}))]]),w=x.forwardRef((e,t)=>x.createElement(a,{ref:t,...e,weights:C}));w.displayName=`WarningCircleIcon`;var T=w;export{S as n,y as r,T as t}; \ No newline at end of file diff --git a/internal/ui/dist/assets/auth-C8kS8ur3.js b/internal/ui/dist/assets/auth-C8kS8ur3.js deleted file mode 100644 index 2032d9925..000000000 --- a/internal/ui/dist/assets/auth-C8kS8ur3.js +++ /dev/null @@ -1 +0,0 @@ -import{i as e,r as t,s as n}from"./useRouter-ByJ6_rwb.js";import{$ as r,A as i,C as a,K as o,M as s,T as c,X as l,Z as u,_ as d,a as f,c as p,d as m,f as h,h as ee,i as te,j as g,l as ne,lt as _,m as re,nt as ie,o as v,p as y,r as ae,t as b,tt as oe,u as se,x,y as ce}from"./brand-Bcp2Tp5I.js";import{n as S}from"./useNavigate-B1zgPEUp.js";var le=/input|select|textarea|button|object/,C=`a, input, select, textarea, button, object, [tabindex]`;function w(e){return e.style.display===`none`}function T(e){if(e.getAttribute(`aria-hidden`)||e.getAttribute(`hidden`)||e.getAttribute(`type`)===`hidden`)return!1;let t=e;for(;t&&t!==document.body&&t.nodeType!==11;){if(w(t))return!1;t=t.parentNode}return!0}function E(e){let t=e.getAttribute(`tabindex`);return t===null&&(t=void 0),parseInt(t,10)}function D(e){let t=e.nodeName.toLowerCase(),n=!Number.isNaN(E(e));return(le.test(t)&&!e.disabled||e instanceof HTMLAnchorElement&&e.href||n)&&T(e)}function O(e){let t=E(e);return(Number.isNaN(t)||t>=0)&&D(e)}function ue(e){return Array.from(e.querySelectorAll(C)).filter(O)}function de(e,t){let n=ue(e);if(!n.length){t.preventDefault();return}let r=n[t.shiftKey?0:n.length-1],i=e.getRootNode(),a=r===i.activeElement||e===i.activeElement,o=i.activeElement;if(o.tagName===`INPUT`&&o.getAttribute(`type`)===`radio`&&(a=n.filter(e=>e.getAttribute(`type`)===`radio`&&e.getAttribute(`name`)===o.getAttribute(`name`)).includes(r)),!a)return;t.preventDefault();let s=n[t.shiftKey?n.length-1:0];s&&s.focus()}var k=n(e(),1);function A(e=!0){let t=(0,k.useRef)(null),n=e=>{let t=e.querySelector(`[data-autofocus]`);if(!t){let n=Array.from(e.querySelectorAll(C));t=n.find(O)||n.find(D)||null,!t&&D(e)&&(t=e)}t?t.focus({preventScroll:!0}):console.warn(`[@mantine/hooks/use-focus-trap] Failed to find focusable element within provided node`,e)},r=(0,k.useCallback)(r=>{if(e){if(r===null){t.current=null;return}t.current!==r&&(setTimeout(()=>{r.getRootNode()?n(r):console.warn(`[@mantine/hooks/use-focus-trap] Ref node is not part of the dom`,r)}),t.current=r)}},[e]);return(0,k.useEffect)(()=>{if(!e)return;t.current&&setTimeout(()=>{t.current&&n(t.current)});let r=e=>{e.key===`Tab`&&t.current&&de(t.current,e)};return document.addEventListener(`keydown`,r),()=>document.removeEventListener(`keydown`,r)},[e]),r}function j({value:e,defaultValue:t,finalValue:n,onChange:r=()=>{}}){let[i,a]=(0,k.useState)(t===void 0?n:t);return e===void 0?[i,(e,...t)=>{a(e),r?.(e,...t)},!1]:[e,r,!0]}var M={root:`m_515a97f8`},N=t(),P=c(e=>{let t=s(`VisuallyHidden`,null,e),{classNames:n,className:r,style:o,styles:c,unstyled:l,vars:u,attributes:d,...f}=t,p=i({name:`VisuallyHidden`,classes:M,props:t,className:r,style:o,classNames:n,styles:c,unstyled:l,attributes:d});return(0,N.jsx)(a,{component:`span`,...p(`root`),...f})});P.classes=M,P.displayName=`@mantine/core/VisuallyHidden`;function F({children:e,active:t=!0,refProp:n=`ref`,innerRef:r}){let i=A(t),a=oe(i,r),o=u(e);return o?(0,k.cloneElement)(o,{[n]:a}):e}function I(e){return(0,N.jsx)(P,{tabIndex:-1,"data-autofocus":!0,...e})}F.displayName=`@mantine/core/FocusTrap`,I.displayName=`@mantine/core/FocusTrapInitialFocus`,F.InitialFocus=I;var L={root:`m_b183c0a2`},fe=l((e,{color:t})=>({root:{"--code-bg":t?o(t,e):void 0}})),R=c(e=>{let t=s(`Code`,null,e),{classNames:n,className:r,style:o,styles:c,unstyled:l,vars:u,color:d,block:f,mod:p,attributes:m,...h}=t,ee=i({name:`Code`,props:t,classes:L,className:r,style:o,classNames:n,styles:c,unstyled:l,attributes:m,vars:u,varsResolver:fe});return(0,N.jsx)(a,{component:f?`pre`:`code`,mod:[{block:f},p],...ee(`root`),...h,dir:`ltr`})});R.classes=L,R.varsResolver=fe,R.displayName=`@mantine/core/Code`;function z(e,t){if(e<1)return[];let n=Array(e).fill(``);if(t){let r=t.trim().split(``);for(let t=0;t({root:{"--pin-input-size":_(t??`sm`,`pin-input-size`)}})),U=c(e=>{let{name:t,form:n,className:a,value:o,defaultValue:c,variant:l,gap:u,style:f,size:p,classNames:m,styles:h,unstyled:te,length:ne,onChange:_,onComplete:re,manageFocus:v,autoFocus:y,error:ae,success:b,radius:oe,disabled:se,oneTimeCode:x,placeholder:ce,type:S,mask:le,readOnly:C,inputType:w,inputMode:T,ariaLabel:E,vars:D,id:O,hiddenInputProps:ue,rootRef:de,getInputProps:A,attributes:M,ref:P,...F}=s([`Input`,`PinInput`],pe,e),I=ie(O),L=i({name:`PinInput`,classes:B,props:e,className:a,style:f,classNames:m,styles:h,unstyled:te,attributes:M,vars:D,varsResolver:H}),{resolvedClassNames:fe,resolvedStyles:R}=g({classNames:m,styles:h,props:e}),[U,W]=(0,k.useState)(-1),G=(0,k.useRef)([]),K=ne??4,q=(0,k.useRef)(!1),[J,me]=j({value:o===void 0?void 0:z(K,o),defaultValue:c?.split(``).slice(0,K),finalValue:z(K,``),onChange:e=>{let t=e.join(``).trim();_?.(t),t.length===K&&!q.current?(q.current=!0,re?.(t)):t.length(S instanceof RegExp?S:S&&S in V?V[S]:null)?.test(e),Z=(e,t)=>{if(v){if(e===`next`){let e=t+1;e=0&&G.current[e]?.focus()}}},Q=(e,t)=>{let n=[...Y];return n[t]=e,me(n),n},ge=(e,t)=>{let n=e.target.value;if(n.length>1){if(n.length>2){if(X(n)){me(z(K,n));let e=Math.min(n.length,K);e{let{ctrlKey:n,metaKey:r,key:i,shiftKey:a,target:o}=e,s=o.value;if(T===`numeric`){let t=[`Backspace`,`Tab`,`Control`,`Delete`,`ArrowLeft`,`ArrowRight`],a=n||r;if(!(t.includes(i)||a||!Number.isNaN(Number(i)))){e.preventDefault();return}}switch(i){case`ArrowLeft`:e.preventDefault(),Z(`prev`,t);break;case`ArrowRight`:e.preventDefault(),Z(`next`,t);break;case`Tab`:a&&t>0&&v&&(e.preventDefault(),Z(`prev`,t));break;case` `:e.preventDefault(),Z(`next`,t);break;case`Delete`:e.preventDefault(),Q(``,t);break;case`Backspace`:s===``?(e.preventDefault(),Z(`prev`,t)):(Q(``,t),t0&&i===Y[t]&&(e.preventDefault(),Z(`next`,t))}},ve=(e,t)=>{e.target.select(),W(t)},ye=()=>{W(-1)},$=e=>{e.preventDefault();let t=e.clipboardData.getData(`text/plain`).replace(/[\n\r\s]+/g,``);if(X(t.trim())){let e=z(K,t);me(e);let n=e.filter(e=>e!==``).length;n>=K?G.current[K-1]?.focus():G.current[n]?.focus()}};return(0,N.jsxs)(N.Fragment,{children:[(0,N.jsx)(d,{...F,...L(`root`),ref:de,role:`group`,id:I,gap:u,unstyled:te,wrap:`nowrap`,variant:l,__size:p,dir:`ltr`,children:Y.map((e,t)=>(0,k.createElement)(ee,{component:`input`,...L(`pinInput`,{style:{"--input-padding":`0`,"--input-text-align":`center`}}),classNames:fe,styles:R,size:p,__staticSelector:`PinInput`,id:`${I}-${t+1}`,key:`${I}-${t}`,inputMode:T||(S===`number`?`numeric`:`text`),onChange:e=>ge(e,t),onKeyDown:e=>_e(e,t),onFocus:e=>ve(e,t),onBlur:ye,onPaste:$,type:w||(le?`password`:S===`number`?`tel`:`text`),radius:oe,error:ae,success:b,variant:l,disabled:se,ref:e=>{e&&(t===0&&r(P,e),G.current[t]=e)},autoComplete:x?`one-time-code`:`off`,placeholder:U===t?``:ce,value:e,autoFocus:y&&t===0,unstyled:te,"aria-label":E,readOnly:C,...A?.(t)}))}),(0,N.jsx)(`input`,{type:`hidden`,name:t,form:n,value:he,...ue})]})});U.classes={...B,...re.classes},U.varsResolver=H,U.displayName=`@mantine/core/PinInput`;var W=c(e=>{let t=s([`Input`,`InputWrapper`,`TextInput`],null,e);return(0,N.jsx)(re,{component:`input`,...t,__staticSelector:`TextInput`})});W.classes=re.classes,W.displayName=`@mantine/core/TextInput`;var G=new Map([[`bold`,k.createElement(k.Fragment,null,k.createElement(`path`,{d:`M228,128a12,12,0,0,1-12,12H69l51.52,51.51a12,12,0,0,1-17,17l-72-72a12,12,0,0,1,0-17l72-72a12,12,0,0,1,17,17L69,116H216A12,12,0,0,1,228,128Z`}))],[`duotone`,k.createElement(k.Fragment,null,k.createElement(`path`,{d:`M112,56V200L40,128Z`,opacity:`0.2`}),k.createElement(`path`,{d:`M216,120H120V56a8,8,0,0,0-13.66-5.66l-72,72a8,8,0,0,0,0,11.32l72,72A8,8,0,0,0,120,200V136h96a8,8,0,0,0,0-16ZM104,180.69,51.31,128,104,75.31Z`}))],[`fill`,k.createElement(k.Fragment,null,k.createElement(`path`,{d:`M224,128a8,8,0,0,1-8,8H120v64a8,8,0,0,1-13.66,5.66l-72-72a8,8,0,0,1,0-11.32l72-72A8,8,0,0,1,120,56v64h96A8,8,0,0,1,224,128Z`}))],[`light`,k.createElement(k.Fragment,null,k.createElement(`path`,{d:`M222,128a6,6,0,0,1-6,6H54.49l61.75,61.76a6,6,0,1,1-8.48,8.48l-72-72a6,6,0,0,1,0-8.48l72-72a6,6,0,0,1,8.48,8.48L54.49,122H216A6,6,0,0,1,222,128Z`}))],[`regular`,k.createElement(k.Fragment,null,k.createElement(`path`,{d:`M224,128a8,8,0,0,1-8,8H59.31l58.35,58.34a8,8,0,0,1-11.32,11.32l-72-72a8,8,0,0,1,0-11.32l72-72a8,8,0,0,1,11.32,11.32L59.31,120H216A8,8,0,0,1,224,128Z`}))],[`thin`,k.createElement(k.Fragment,null,k.createElement(`path`,{d:`M220,128a4,4,0,0,1-4,4H49.66l65.17,65.17a4,4,0,0,1-5.66,5.66l-72-72a4,4,0,0,1,0-5.66l72-72a4,4,0,0,1,5.66,5.66L49.66,124H216A4,4,0,0,1,220,128Z`}))]]),K=new Map([[`bold`,k.createElement(k.Fragment,null,k.createElement(`path`,{d:`M224.49,136.49l-72,72a12,12,0,0,1-17-17L187,140H40a12,12,0,0,1,0-24H187L135.51,64.48a12,12,0,0,1,17-17l72,72A12,12,0,0,1,224.49,136.49Z`}))],[`duotone`,k.createElement(k.Fragment,null,k.createElement(`path`,{d:`M216,128l-72,72V56Z`,opacity:`0.2`}),k.createElement(`path`,{d:`M221.66,122.34l-72-72A8,8,0,0,0,136,56v64H40a8,8,0,0,0,0,16h96v64a8,8,0,0,0,13.66,5.66l72-72A8,8,0,0,0,221.66,122.34ZM152,180.69V75.31L204.69,128Z`}))],[`fill`,k.createElement(k.Fragment,null,k.createElement(`path`,{d:`M221.66,133.66l-72,72A8,8,0,0,1,136,200V136H40a8,8,0,0,1,0-16h96V56a8,8,0,0,1,13.66-5.66l72,72A8,8,0,0,1,221.66,133.66Z`}))],[`light`,k.createElement(k.Fragment,null,k.createElement(`path`,{d:`M220.24,132.24l-72,72a6,6,0,0,1-8.48-8.48L201.51,134H40a6,6,0,0,1,0-12H201.51L139.76,60.24a6,6,0,0,1,8.48-8.48l72,72A6,6,0,0,1,220.24,132.24Z`}))],[`regular`,k.createElement(k.Fragment,null,k.createElement(`path`,{d:`M221.66,133.66l-72,72a8,8,0,0,1-11.32-11.32L196.69,136H40a8,8,0,0,1,0-16H196.69L138.34,61.66a8,8,0,0,1,11.32-11.32l72,72A8,8,0,0,1,221.66,133.66Z`}))],[`thin`,k.createElement(k.Fragment,null,k.createElement(`path`,{d:`M218.83,130.83l-72,72a4,4,0,0,1-5.66-5.66L206.34,132H40a4,4,0,0,1,0-8H206.34L141.17,58.83a4,4,0,0,1,5.66-5.66l72,72A4,4,0,0,1,218.83,130.83Z`}))]]),q=new Map([[`bold`,k.createElement(k.Fragment,null,k.createElement(`path`,{d:`M256,136a12,12,0,0,1-12,12h-8v8a12,12,0,0,1-24,0v-8h-8a12,12,0,0,1,0-24h8v-8a12,12,0,0,1,24,0v8h8A12,12,0,0,1,256,136Zm-54.81,56.28a12,12,0,1,1-18.38,15.44C169.12,191.42,145,172,108,172c-28.89,0-55.46,12.68-74.81,35.72a12,12,0,0,1-18.38-15.44A124.08,124.08,0,0,1,63.5,156.53a72,72,0,1,1,89,0A124,124,0,0,1,201.19,192.28ZM108,148a48,48,0,1,0-48-48A48.05,48.05,0,0,0,108,148Z`}))],[`duotone`,k.createElement(k.Fragment,null,k.createElement(`path`,{d:`M168,100a60,60,0,1,1-60-60A60,60,0,0,1,168,100Z`,opacity:`0.2`}),k.createElement(`path`,{d:`M256,136a8,8,0,0,1-8,8H232v16a8,8,0,0,1-16,0V144H200a8,8,0,0,1,0-16h16V112a8,8,0,0,1,16,0v16h16A8,8,0,0,1,256,136Zm-57.87,58.85a8,8,0,0,1-12.26,10.3C165.75,181.19,138.09,168,108,168s-57.75,13.19-77.87,37.15a8,8,0,0,1-12.25-10.3c14.94-17.78,33.52-30.41,54.17-37.17a68,68,0,1,1,71.9,0C164.6,164.44,183.18,177.07,198.13,194.85ZM108,152a52,52,0,1,0-52-52A52.06,52.06,0,0,0,108,152Z`}))],[`fill`,k.createElement(k.Fragment,null,k.createElement(`path`,{d:`M256,136a8,8,0,0,1-8,8H232v16a8,8,0,0,1-16,0V144H200a8,8,0,0,1,0-16h16V112a8,8,0,0,1,16,0v16h16A8,8,0,0,1,256,136ZM144,157.68a68,68,0,1,0-71.9,0c-20.65,6.76-39.23,19.39-54.17,37.17A8,8,0,0,0,24,208H192a8,8,0,0,0,6.13-13.15C183.18,177.07,164.6,164.44,144,157.68Z`}))],[`light`,k.createElement(k.Fragment,null,k.createElement(`path`,{d:`M254,136a6,6,0,0,1-6,6H230v18a6,6,0,0,1-12,0V142H200a6,6,0,0,1,0-12h18V112a6,6,0,0,1,12,0v18h18A6,6,0,0,1,254,136Zm-57.41,60.14a6,6,0,1,1-9.18,7.72C166.9,179.45,138.69,166,108,166s-58.89,13.45-79.41,37.86a6,6,0,0,1-9.18-7.72C35.14,177.41,55,164.48,77,158.25a66,66,0,1,1,62,0C161,164.48,180.86,177.41,196.59,196.14ZM108,154a54,54,0,1,0-54-54A54.06,54.06,0,0,0,108,154Z`}))],[`regular`,k.createElement(k.Fragment,null,k.createElement(`path`,{d:`M256,136a8,8,0,0,1-8,8H232v16a8,8,0,0,1-16,0V144H200a8,8,0,0,1,0-16h16V112a8,8,0,0,1,16,0v16h16A8,8,0,0,1,256,136Zm-57.87,58.85a8,8,0,0,1-12.26,10.3C165.75,181.19,138.09,168,108,168s-57.75,13.19-77.87,37.15a8,8,0,0,1-12.25-10.3c14.94-17.78,33.52-30.41,54.17-37.17a68,68,0,1,1,71.9,0C164.6,164.44,183.18,177.07,198.13,194.85ZM108,152a52,52,0,1,0-52-52A52.06,52.06,0,0,0,108,152Z`}))],[`thin`,k.createElement(k.Fragment,null,k.createElement(`path`,{d:`M252,136a4,4,0,0,1-4,4H228v20a4,4,0,0,1-8,0V140H200a4,4,0,0,1,0-8h20V112a4,4,0,0,1,8,0v20h20A4,4,0,0,1,252,136Zm-56.94,61.43a4,4,0,0,1-6.12,5.14C168,177.7,139.3,164,108,164s-60,13.7-80.94,38.57a4,4,0,1,1-6.12-5.14c16.71-19.9,38.13-33.13,61.89-38.59a64,64,0,1,1,50.34,0C156.93,164.3,178.35,177.53,195.06,197.43ZM108,156a56,56,0,1,0-56-56A56.06,56.06,0,0,0,108,156Z`}))]]),J=k.forwardRef((e,t)=>k.createElement(f,{ref:t,...e,weights:G}));J.displayName=`ArrowLeftIcon`;var me=J,Y=k.forwardRef((e,t)=>k.createElement(f,{ref:t,...e,weights:K}));Y.displayName=`ArrowRightIcon`;var he=Y,X=k.forwardRef((e,t)=>k.createElement(f,{ref:t,...e,weights:q}));X.displayName=`UserPlusIcon`;var Z=X,Q=class extends Error{status;problems;code;constructor(e,t,n=[],r=``){super(e),this.status=t,this.problems=n,this.code=r}},ge=`fanout:unauthorized`;function _e(){let e=new URLSearchParams(window.location.search).get(`return_to`);if(!e)return``;let t=new URL(e,window.location.origin);return t.origin!==window.location.origin||t.pathname!==`/api/auth/oauth/authorize`?``:`${t.pathname}${t.search}`}function ve(e){return!e||typeof e!=`object`||!(`id`in e)||typeof e.id!=`string`||e.id===``?`none`:`user`}function ye(){window.dispatchEvent(new Event(ge))}async function $(e,t={}){let n=new Headers(t.headers);n.set(`Fanout-Request`,`1`);let r=await fetch(e,{...t,headers:n,credentials:`same-origin`});if(r.status===401&&ye(),r.status===403){let e=await r.clone().json().catch(()=>({}));throw new Q(e.message??`You do not have permission to perform this action.`,r.status,[],e.code??``)}return r}async function be(){let e=await $(`/api/auth/logout`,{method:`POST`});if(!e.ok&&e.status!==401)throw Error(`Sign-out failed — your session is still active.`);e.status!==401&&ye(),window.location.assign(`/`)}var xe=(0,k.createContext)(null);function Se(){let e=(0,k.useContext)(xe);if(!e)throw Error(`Fanout runtime status is unavailable`);return e}var Ce=(0,k.createContext)(null);function we(){let e=(0,k.useContext)(Ce);if(!e)throw Error(`Fanout viewer is unavailable`);return e}function Te(e){if(!e||typeof e!=`object`)return null;let t=e;return typeof t.id!=`string`||t.id===``||t.status!==`active`&&t.status!==`suspended`?null:{id:t.id,email:typeof t.email==`string`?t.email:``,display_name:typeof t.display_name==`string`?t.display_name:``,status:t.status,role:typeof t.role==`string`?t.role:``}}async function Ee(e,t){let n=await fetch(e,{method:t===void 0?`GET`:`POST`,headers:t===void 0?void 0:{"Content-Type":`application/json`},body:t===void 0?void 0:JSON.stringify(t),credentials:`same-origin`}),r=await n.json().catch(()=>({}));if(!n.ok)throw Error(r.message??`Request failed (${n.status})`);return r}function De({children:e,wide:t=!1}){return(0,N.jsx)(a,{mih:`100dvh`,style:{background:`radial-gradient(circle at 50% -12%, var(--mantine-color-brand-light), transparent 38%), linear-gradient(180deg, var(--mantine-color-default-hover), var(--mantine-color-body) 62%)`},children:(0,N.jsx)(se,{mih:`100dvh`,px:`md`,py:48,children:(0,N.jsx)(ne,{size:t?680:480,w:`100%`,children:(0,N.jsx)(x,{radius:28,p:{base:24,sm:40},style:{background:`var(--mantine-color-body)`,border:`1px solid var(--mantine-color-default-border)`,boxShadow:`var(--mantine-shadow-xl)`},children:e})})})})}function Oe(){return typeof window>`u`?``:new URLSearchParams(window.location.search).get(`setup_token`)??``}function ke(){return typeof window>`u`?``:new URLSearchParams(window.location.search).get(`login_token`)??``}function Ae({children:e}){let t=S(),[n,r]=(0,k.useState)(null),[i,o]=(0,k.useState)(!1),[s,c]=(0,k.useState)(`none`),[l,u]=(0,k.useState)(null),[f,ee]=(0,k.useState)(!1),[g,ne]=(0,k.useState)(``),[_,re]=(0,k.useState)(``),[ie,oe]=(0,k.useState)(Oe),[x,le]=(0,k.useState)(ke),[C,w]=(0,k.useState)(``),[T,E]=(0,k.useState)(!1),[D,O]=(0,k.useState)(0),[ue,de]=(0,k.useState)(()=>Date.now()),[A,j]=(0,k.useState)(!1),[M,P]=(0,k.useState)(``),[F,I]=(0,k.useState)(null),[L,fe]=(0,k.useState)(!1),z=(0,k.useRef)(null),B=_e(),V=s===`user`;async function pe(){let e=await fetch(`/api/auth/me`,{credentials:`same-origin`});if(!e.ok){c(`none`),u(null);return}let t=await e.json().catch(()=>null);c(ve(t)),u(Te(t))}async function H(){try{let e=await fetch(`/api/auth/me`,{credentials:`same-origin`});if(!e.ok)return;u(Te(await e.json().catch(()=>null)))}catch{}}(0,k.useEffect)(()=>{let e=new URL(window.location.href);(e.searchParams.has(`setup_token`)||e.searchParams.has(`login_token`))&&(e.searchParams.delete(`setup_token`),e.searchParams.delete(`login_token`),t({href:e.pathname+e.search+e.hash,replace:!0}))},[t]),(0,k.useEffect)(()=>{Ee(`/api/auth/status`).then(r).catch(e=>P(String(e))).finally(()=>o(!0)),pe().catch(()=>c(`none`)).finally(()=>ee(!0));let e=()=>{c(`none`),u(null)};return window.addEventListener(ge,e),()=>window.removeEventListener(ge,e)},[]),(0,k.useEffect)(()=>{f&&s===`none`&&x&&(j(!0),P(``),Ee(`/api/auth/link/verify`,{token:x}).then(()=>{c(`user`),H()}).catch(e=>P(e instanceof Error?e.message:String(e))).finally(()=>{le(``),j(!1)}))},[x,f,s]),(0,k.useEffect)(()=>{V&&f&&B&&window.location.replace(B)},[V,B,f]),(0,k.useEffect)(()=>{if(D<=Date.now())return;let e=setInterval(()=>{de(Date.now()),Date.now()>=D&&clearInterval(e)},1e3);return()=>clearInterval(e)},[D]);let G=Math.max(0,Math.ceil((D-ue)/1e3));(0,k.useEffect)(()=>{T&&!A&&M&&z.current?.querySelector(`input`)?.focus()},[A,T,M]);async function K(e){try{await navigator.clipboard.writeText(e),fe(!0)}catch{P(`Clipboard access failed. Select and copy the token manually.`)}}if(F?.ingest_token)return(0,N.jsx)(De,{wide:!0,children:(0,N.jsxs)(p,{gap:`lg`,children:[(0,N.jsx)(b,{}),(0,N.jsxs)(`div`,{children:[(0,N.jsx)(h,{c:`brand`,fw:700,size:`xs`,tt:`uppercase`,lts:`0.12em`,children:`Setup complete`}),(0,N.jsx)(v,{order:1,mt:`xs`,fz:{base:28,sm:32},lh:1.08,children:`Save your ingest token`})]}),(0,N.jsx)(h,{c:`dimmed`,children:`Fanout shows this token once. Store it with your collector secrets before continuing.`}),(0,N.jsxs)(p,{gap:`xs`,children:[(0,N.jsx)(h,{size:`sm`,fw:600,children:`OTLP endpoint`}),(0,N.jsx)(R,{block:!0,children:F.suggested_endpoint??window.location.origin})]}),(0,N.jsxs)(p,{gap:`xs`,children:[(0,N.jsx)(h,{size:`sm`,fw:600,children:`Header`}),(0,N.jsxs)(R,{block:!0,children:[F.ingest_header_name??`Authorization`,`: Bearer `,F.ingest_token]})]}),M&&(0,N.jsx)(y,{color:`bad`,radius:`md`,children:M}),(0,N.jsxs)(d,{grow:!0,align:`stretch`,children:[(0,N.jsx)(m,{variant:`light`,radius:`md`,leftSection:L?(0,N.jsx)(te,{size:16,weight:`bold`}):(0,N.jsx)(ae,{size:16}),onClick:()=>void K(`${F.ingest_header_name??`Authorization`}: Bearer ${F.ingest_token}`),children:L?`Copied`:`Copy header`}),(0,N.jsx)(m,{radius:`md`,rightSection:(0,N.jsx)(he,{size:16,weight:`bold`}),onClick:()=>{c(`user`),I(null),H()},children:`Continue to Fanout`})]}),(0,N.jsx)(m,{variant:`subtle`,size:`compact-xs`,onClick:()=>void K(F.ingest_token??``),children:`Copy token only`})]})});if(!f||!i||x)return(0,N.jsx)(se,{mih:`100dvh`,children:(0,N.jsx)(ce,{size:`sm`})});if(!n)return(0,N.jsx)(De,{children:(0,N.jsxs)(p,{gap:`lg`,children:[(0,N.jsx)(b,{}),(0,N.jsx)(v,{order:1,children:`Fanout is unavailable`}),(0,N.jsx)(y,{color:`bad`,radius:`md`,children:M||`Authentication status could not be loaded.`})]})});if(V&&B)return null;if(V)return(0,N.jsx)(xe.Provider,{value:n,children:(0,N.jsx)(Ce.Provider,{value:l??{id:``,email:g,display_name:_,status:`active`,role:``},children:e})});if(n&&!n.setup_required&&n.auth_mode===`oidc`){let e=B?`/api/auth/oidc/start?return_to=${encodeURIComponent(B)}`:`/api/auth/oidc/start`;return(0,N.jsx)(De,{children:(0,N.jsxs)(p,{gap:28,children:[(0,N.jsx)(b,{}),(0,N.jsxs)(p,{gap:10,children:[(0,N.jsx)(h,{c:`brand`,fw:700,size:`xs`,tt:`uppercase`,lts:`0.12em`,children:`Secure workspace`}),(0,N.jsx)(v,{order:1,fz:{base:28,sm:32},lh:1.08,children:`Sign in`}),(0,N.jsx)(h,{c:`dimmed`,size:`md`,lh:1.6,children:`Use your organization's identity provider to continue.`})]}),M&&(0,N.jsx)(y,{color:`bad`,radius:`md`,children:M}),(0,N.jsx)(m,{component:`a`,href:e,size:`md`,radius:`md`,rightSection:(0,N.jsx)(he,{size:17,weight:`bold`}),children:`Continue with SSO`})]})})}async function q(){j(!0),P(``);try{await Ee(`/api/auth/code/send`,{email:g}),E(!0),w(``),O(Date.now()+3e4),de(Date.now())}catch(e){P(e instanceof Error?e.message:String(e))}finally{j(!1)}}async function J(e){j(!0),P(``);try{await Ee(`/api/auth/code/verify`,{email:g,code:e}),c(`user`),E(!1),w(``),O(0),H()}catch(e){w(``),P(e instanceof Error?e.message:String(e))}finally{j(!1)}}function Y(){E(!1),w(``),P(``)}async function X(e){e.preventDefault(),j(!0),P(``);try{if(n?.setup_required){let e=await Ee(`/api/auth/setup`,{email:g,display_name:_,setup_token:ie});e.ingest_token?I(e):(c(`user`),H())}else if(T){await J(C);return}else{await q();return}}catch(e){P(e instanceof Error?e.message:String(e))}finally{j(!1)}}let Q=T&&!n?.setup_required,ye=n?.setup_required?`Create the first admin`:Q?`Check your email`:n?.self_signup?`Sign in or create an account`:`Sign in`,$=n?.setup_required?`Use the one-time token printed by the Fanout process.`:n?.smtp_configured?Q?`We sent a code to ${g}.`:n?.self_signup?`Enter your email to sign in or create a viewer account. No password needed.`:`Enter your email and we’ll send a short verification code. No password needed.`:`Email delivery is not configured. Ask the operator to run fanout login-link with your email address.`;return(0,N.jsx)(De,{children:(0,N.jsxs)(p,{gap:28,children:[(0,N.jsx)(b,{}),(0,N.jsxs)(p,{gap:10,children:[(0,N.jsx)(h,{c:`brand`,fw:700,size:`xs`,tt:`uppercase`,lts:`0.12em`,children:n?.setup_required?`One-time setup`:`Secure workspace`}),(0,N.jsx)(v,{order:1,fz:{base:28,sm:32},lh:1.08,children:ye}),$&&(0,N.jsx)(h,{c:`dimmed`,size:`md`,lh:1.6,maw:390,children:$})]}),(0,N.jsx)(`form`,{onSubmit:X,children:(0,N.jsxs)(p,{gap:`md`,children:[(0,N.jsx)(W,{label:`Email`,placeholder:`you@company.com`,type:`email`,required:!0,value:g,onChange:e=>ne(e.currentTarget.value),disabled:T,variant:`filled`,radius:`md`,size:`md`,autoFocus:!T}),n?.setup_required&&(0,N.jsx)(W,{label:`Display name`,placeholder:`Your display name`,value:_,onChange:e=>re(e.currentTarget.value),variant:`filled`,radius:`md`,size:`md`}),n?.setup_required&&(0,N.jsx)(W,{label:`Setup token`,placeholder:`from the setup URL printed at startup`,required:!0,value:ie,onChange:e=>oe(e.currentTarget.value),autoComplete:`one-time-code`,variant:`filled`,radius:`md`,size:`md`}),Q&&(0,N.jsxs)(p,{gap:`xs`,children:[(0,N.jsx)(h,{size:`sm`,fw:600,children:`Verification code`}),(0,N.jsx)(a,{ref:z,children:(0,N.jsx)(U,{length:6,type:`number`,oneTimeCode:!0,autoFocus:!0,value:C,onChange:w,onComplete:e=>void J(e),disabled:A,error:!!M,size:`md`,radius:`md`,"aria-label":`Verification code`,getInputProps:e=>({"aria-label":`Digit ${e+1}`})})}),(0,N.jsxs)(d,{justify:`space-between`,gap:`xs`,children:[(0,N.jsxs)(h,{c:`dimmed`,size:`xs`,children:[`Sent to `,g]}),(0,N.jsx)(m,{variant:`subtle`,size:`compact-xs`,leftSection:(0,N.jsx)(me,{size:12,weight:`bold`}),onClick:Y,disabled:A,children:`Change email`})]}),(0,N.jsxs)(d,{justify:`space-between`,gap:`xs`,children:[(0,N.jsx)(h,{c:`dimmed`,size:`xs`,children:`Codes expire in 5 minutes`}),(0,N.jsx)(m,{variant:`subtle`,size:`compact-xs`,onClick:()=>void q(),disabled:A||G>0,children:G>0?`Resend in ${G}s`:`Resend code`})]})]}),M&&(0,N.jsx)(y,{color:`bad`,radius:`md`,children:M}),Q?(0,N.jsx)(m,{type:`submit`,size:`md`,radius:`md`,mt:4,loading:A,disabled:A||C.length<6,rightSection:(0,N.jsx)(he,{size:17,weight:`bold`}),children:`Verify code`}):(0,N.jsx)(m,{type:`submit`,size:`md`,radius:`md`,mt:4,loading:A,disabled:!n||!n.setup_required&&!n.smtp_configured,leftSection:n?.setup_required?(0,N.jsx)(Z,{size:17,weight:`bold`}):void 0,rightSection:n?.setup_required?void 0:(0,N.jsx)(he,{size:17,weight:`bold`}),children:n?.setup_required?`Create admin`:`Send code`})]})})]})})}export{be as a,R as c,j as d,$ as i,F as l,Se as n,Q as o,we as r,W as s,Ae as t,P as u}; \ No newline at end of file diff --git a/internal/ui/dist/assets/brand-Bcp2Tp5I.js b/internal/ui/dist/assets/brand-DUaZkIz1.js similarity index 54% rename from internal/ui/dist/assets/brand-Bcp2Tp5I.js rename to internal/ui/dist/assets/brand-DUaZkIz1.js index 6ce5fe83b..7a5fe14e7 100644 --- a/internal/ui/dist/assets/brand-Bcp2Tp5I.js +++ b/internal/ui/dist/assets/brand-DUaZkIz1.js @@ -1 +1 @@ -import{a as e,i as t,r as n,s as r}from"./useRouter-ByJ6_rwb.js";var i=e((e=>{var n=t();function r(e){var t=`https://react.dev/errors/`+e;if(1{function n(){if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<`u`&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE==`function`)try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(n)}catch(e){console.error(e)}}n(),t.exports=i()})),o=r(t(),1),s=n();function c(e){return Object.keys(e)}function l(e){return e&&typeof e==`object`&&!Array.isArray(e)}function u(e,t){let n={...e},r=t;return l(e)&&l(t)&&Object.keys(t).forEach(t=>{l(r[t])&&t in e?n[t]=u(n[t],r[t]):n[t]=r[t]}),n}function d(e){return e.replace(/[A-Z]/g,e=>`-${e.toLowerCase()}`)}function f(e){return e===`0rem`?`0rem`:`calc(${e} * var(--mantine-scale))`}function p(e,{shouldScale:t=!1}={}){function n(r){if(r===0||r===`0`)return`0${e}`;if(typeof r==`number`){let n=`${r/16}${e}`;return t?f(n):n}if(typeof r==`string`){if(r===``||r.startsWith(`calc(`)||r.startsWith(`clamp(`)||r.includes(`rgba(`))return r;if(r.includes(`,`))return r.split(`,`).map(e=>n(e)).join(`,`);if(r.includes(` `))return r.split(` `).map(e=>n(e)).join(` `);let i=r.replace(`px`,``);if(!Number.isNaN(Number(i))){let n=`${Number(i)/16}${e}`;return t?f(n):n}}return r}return n}var m=p(`rem`,{shouldScale:!0}),h=p(`em`);function g(e){return Object.keys(e).reduce((t,n)=>(e[n]!==void 0&&(t[n]=e[n]),t),{})}function _(e){if(typeof e==`number`)return!0;if(typeof e==`string`){if(e.startsWith(`calc(`)||e.startsWith(`var(`)||e.includes(` `)&&e.trim()!==``)return!0;let t=/^[+-]?[0-9]+(\.[0-9]+)?(px|em|rem|ex|ch|lh|rlh|vw|vh|vmin|vmax|vb|vi|svw|svh|lvw|lvh|dvw|dvh|cm|mm|in|pt|pc|q|cqw|cqh|cqi|cqb|cqmin|cqmax|%)?$/;return e.trim().split(/\s+/).every(e=>t.test(e))}return!1}function v(e){return Array.isArray(e)||e===null?!1:typeof e==`object`&&e.type!==o.Fragment}function y(e,t=`size`,n=!0){if(e!==void 0)return _(e)?n?m(e):e:`var(--${t}-${e})`}function b(e){return y(e,`mantine-spacing`)}function x(e){return e===void 0?`var(--mantine-radius-default)`:y(e,`mantine-radius`)}function S(e){return y(e,`mantine-font-size`)}function C(e){return y(e,`mantine-line-height`,!1)}function w(e){if(e)return y(e,`mantine-shadow`,!1)}function T(e=`mantine-`){return`${e}${Math.random().toString(36).slice(2,11)}`}function E(e,t){if(typeof t==`boolean`)return t;if(typeof window<`u`&&`matchMedia`in window)try{return window.matchMedia(e).matches}catch{return!1}return!1}function ee(e,t,{getInitialValueInEffect:n}={getInitialValueInEffect:!0}){let[r,i]=(0,o.useState)(n?t:E(e));return(0,o.useEffect)(()=>{try{if(`matchMedia`in window){let t=window.matchMedia(e);i(t.matches);let n=e=>i(e.matches);return t.addEventListener(`change`,n),()=>{t.removeEventListener(`change`,n)}}}catch{return}},[e]),r||!1}var te=typeof document<`u`?o.useLayoutEffect:o.useEffect;function ne(e,t){return e.length!==t.length||t.some((t,n)=>!Object.is(t,e[n]))}function re(e,t){let n=(0,o.useRef)(!1),r=(0,o.useRef)(null),i=(0,o.useRef)(void 0),a={};(0,o.useEffect)(()=>{let o=r.current===a,s=i.current;if(r.current=a,i.current=t,!n.current){n.current=!0;return}if(!o&&!(t&&s&&!ne(s,t)))return e()},t)}function ie(e){let t=(0,o.useId)(),[n,r]=(0,o.useState)(`mantine-${t.replace(/:/g,``)}`),i=(0,o.useRef)(!1);return te(()=>{i.current||(i.current=!0,r(T()))},[]),typeof e==`string`?e:n}function D(e,t){if(typeof e==`function`)return e(t);typeof e==`object`&&e&&`current`in e&&(e.current=t)}function O(...e){let t=new Map;return n=>{if(e.forEach(e=>{let r=D(e,n);r&&t.set(e,r)}),t.size>0)return()=>{e.forEach(e=>{let n=t.get(e);n&&typeof n==`function`?n():D(e,null)}),t.clear()}}}function k(...e){return(0,o.useCallback)(O(...e),e)}function A(e,t){return ee(`(prefers-reduced-motion: reduce)`,e,t)}function ae(e){let t=o.Children.toArray(e);return t.length!==1||!v(t[0])?null:t[0]}function j(e){return e}function oe(e){var t,n,r=``;if(typeof e==`string`||typeof e==`number`)r+=e;else if(typeof e==`object`){if(Array.isArray(e)){var i=e.length;for(t=0;t{Object.entries(e).forEach(([e,n])=>{t[e]?t[e]=M(t[e],n):t[e]=n})}),t}function P({theme:e,classNames:t,props:n,stylesCtx:r}){return N((Array.isArray(t)?t:[t]).map(t=>typeof t==`function`?t(e,n,r):t||se))}function F({theme:e,styles:t,props:n,stylesCtx:r}){let i=Array.isArray(t)?t:[t],a={};for(let t of i)typeof t==`function`?Object.assign(a,t(e,n,r)):t&&Object.assign(a,t);return a}function I(e,t){return typeof e.primaryShade==`number`?e.primaryShade:t===`dark`?e.primaryShade.dark:e.primaryShade.light}function ce(e){return/^#?([0-9A-F]{3}){1,2}([0-9A-F]{2})?$/i.test(e)}function le(e){let t=e.replace(`#`,``);if(t.length===3){let e=t.split(``);t=[e[0],e[0],e[1],e[1],e[2],e[2]].join(``)}if(t.length===8){let e=parseInt(t.slice(6,8),16)/255;return{r:parseInt(t.slice(0,2),16),g:parseInt(t.slice(2,4),16),b:parseInt(t.slice(4,6),16),a:e}}let n=parseInt(t,16);return{r:n>>16&255,g:n>>8&255,b:n&255,a:1}}function ue(e){let[t,n,r,i]=e.replace(/[^0-9,./]/g,``).split(/[/,]/).map(Number);return{r:t,g:n,b:r,a:i===void 0?1:i}}function de(e){let t=e.match(/^hsla?\(\s*(\d+)\s*,\s*(\d+%)\s*,\s*(\d+%)\s*(,\s*(0?\.\d+|\d+(\.\d+)?))?\s*\)$/i);if(!t)return{r:0,g:0,b:0,a:1};let n=parseInt(t[1],10),r=parseInt(t[2],10)/100,i=parseInt(t[3],10)/100,a=t[5]?parseFloat(t[5]):void 0,o=(1-Math.abs(2*i-1))*r,s=n/60,c=o*(1-Math.abs(s%2-1)),l=i-o/2,u,d,f;return s>=0&&s<1?(u=o,d=c,f=0):s>=1&&s<2?(u=c,d=o,f=0):s>=2&&s<3?(u=0,d=o,f=c):s>=3&&s<4?(u=0,d=c,f=o):s>=4&&s<5?(u=c,d=0,f=o):(u=o,d=0,f=c),{r:Math.round((u+l)*255),g:Math.round((d+l)*255),b:Math.round((f+l)*255),a:a||1}}function L(e){return ce(e)?le(e):e.startsWith(`rgb`)?ue(e):e.startsWith(`hsl`)?de(e):{r:0,g:0,b:0,a:1}}function R(e){return e<=.03928?e/12.92:((e+.055)/1.055)**2.4}function fe(e){let t=e.match(/oklch\((.*?)%\s/);return t?parseFloat(t[1]):null}function z(e){if(e.startsWith(`oklch(`))return(fe(e)||0)/100;let{r:t,g:n,b:r}=L(e),i=t/255,a=n/255,o=r/255,s=R(i),c=R(a),l=R(o);return .2126*s+.7152*c+.0722*l}function B(e,t=.179){return!e.startsWith(`var(`)&&z(e)>t}function V({color:e,theme:t,colorScheme:n}){if(typeof e!=`string`)throw Error(`[@mantine/core] Failed to parse color. Expected color to be a string, instead got ${typeof e}`);if(e===`bright`)return{color:e,value:n===`dark`?t.white:t.black,shade:void 0,isThemeColor:!1,isLight:B(n===`dark`?t.white:t.black,t.luminanceThreshold),variable:`--mantine-color-bright`};if(e===`dimmed`)return{color:e,value:n===`dark`?t.colors.dark[2]:t.colors.gray[7],shade:void 0,isThemeColor:!1,isLight:B(n===`dark`?t.colors.dark[2]:t.colors.gray[6],t.luminanceThreshold),variable:`--mantine-color-dimmed`};if(e===`white`||e===`black`)return{color:e,value:e===`white`?t.white:t.black,shade:void 0,isThemeColor:!1,isLight:B(e===`white`?t.white:t.black,t.luminanceThreshold),variable:`--mantine-color-${e}`};let[r,i]=e.split(`.`),a=i?Number(i):void 0,o=r in t.colors;if(o){let e=a===void 0?t.colors[r][I(t,n||`light`)]:t.colors[r][a];return{color:r,value:e,shade:a,isThemeColor:o,isLight:B(e,t.luminanceThreshold),variable:i?`--mantine-color-${r}-${a}`:`--mantine-color-${r}-filled`}}return{color:e,value:e,isThemeColor:o,isLight:B(e,t.luminanceThreshold),shade:a,variable:void 0}}function H(e,t){let n=V({color:e||t.primaryColor,theme:t});return n.variable?`var(${n.variable})`:e}function pe(e){return!!e&&typeof e==`object`&&`mantine-virtual-color`in e}function U(e,t){if(e.startsWith(`var(`))return`color-mix(in srgb, ${e}, black ${t*100}%)`;let{r:n,g:r,b:i,a}=L(e),o=1-t,s=e=>Math.round(e*o);return`rgba(${s(n)}, ${s(r)}, ${s(i)}, ${a})`}function me(e,t){let n={from:e?.from||t.defaultGradient.from,to:e?.to||t.defaultGradient.to,deg:e?.deg??t.defaultGradient.deg??0},r=H(n.from,t),i=H(n.to,t);return`linear-gradient(${n.deg}deg, ${r} 0%, ${i} 100%)`}function W(e,t){if(typeof e!=`string`||t>1||t<0)return`rgba(0, 0, 0, 1)`;if(e.startsWith(`var(`))return`color-mix(in srgb, ${e}, transparent ${(1-t)*100}%)`;if(e.startsWith(`oklch`))return e.includes(`/`)?e.replace(/\/\s*[\d.]+\s*\)/,`/ ${t})`):e.replace(`)`,` / ${t})`);let{r:n,g:r,b:i}=L(e);return`rgba(${n}, ${r}, ${i}, ${t})`}var he=W,ge=({color:e,theme:t,variant:n,gradient:r,autoContrast:i})=>{let a=V({color:e,theme:t}),o=typeof i==`boolean`?i:t.autoContrast;if(n===`none`)return{background:`transparent`,hover:`transparent`,color:`inherit`,border:`none`};if(n===`filled`){let n=a.isThemeColor&&a.shade===void 0&&pe(t.colors[a.color]),r=o?n?`var(--mantine-color-${a.color}-contrast)`:a.isLight?`var(--mantine-color-black)`:`var(--mantine-color-white)`:`var(--mantine-color-white)`;return a.isThemeColor?a.shade===void 0?{background:`var(--mantine-color-${e}-filled)`,hover:`var(--mantine-color-${e}-filled-hover)`,color:r,border:`${m(1)} solid transparent`}:{background:`var(--mantine-color-${a.color}-${a.shade})`,hover:`var(--mantine-color-${a.color}-${a.shade===9?8:a.shade+1})`,color:r,border:`${m(1)} solid transparent`}:{background:e,hover:U(e,.1),color:r,border:`${m(1)} solid transparent`}}if(n===`light`){if(a.isThemeColor){if(a.shade===void 0)return{background:`var(--mantine-color-${e}-light)`,hover:`var(--mantine-color-${e}-light-hover)`,color:`var(--mantine-color-${e}-light-color)`,border:`${m(1)} solid transparent`};let n=t.colors[a.color][a.shade];return{background:n,hover:U(n,.1),color:`var(--mantine-color-${a.color}-light-color)`,border:`${m(1)} solid transparent`}}return{background:W(e,.1),hover:W(e,.12),color:e,border:`${m(1)} solid transparent`}}if(n===`outline`)return a.isThemeColor?a.shade===void 0?{background:`transparent`,hover:`var(--mantine-color-${e}-outline-hover)`,color:`var(--mantine-color-${e}-outline)`,border:`${m(1)} solid var(--mantine-color-${e}-outline)`}:{background:`transparent`,hover:W(t.colors[a.color][a.shade],.05),color:`var(--mantine-color-${a.color}-${a.shade})`,border:`${m(1)} solid var(--mantine-color-${a.color}-${a.shade})`}:{background:`transparent`,hover:W(e,.05),color:e,border:`${m(1)} solid ${e}`};if(n===`subtle`){if(a.isThemeColor){if(a.shade===void 0)return{background:`transparent`,hover:`var(--mantine-color-${e}-light-hover)`,color:`var(--mantine-color-${e}-light-color)`,border:`${m(1)} solid transparent`};let n=t.colors[a.color][a.shade];return{background:`transparent`,hover:W(n,.12),color:`var(--mantine-color-${a.color}-${Math.min(a.shade,6)})`,border:`${m(1)} solid transparent`}}return{background:`transparent`,hover:W(e,.12),color:e,border:`${m(1)} solid transparent`}}return n===`transparent`?a.isThemeColor?a.shade===void 0?{background:`transparent`,hover:`transparent`,color:`var(--mantine-color-${e}-light-color)`,border:`${m(1)} solid transparent`}:{background:`transparent`,hover:`transparent`,color:`var(--mantine-color-${a.color}-${Math.min(a.shade,6)})`,border:`${m(1)} solid transparent`}:{background:`transparent`,hover:`transparent`,color:e,border:`${m(1)} solid transparent`}:n===`white`?a.isThemeColor?a.shade===void 0?{background:`var(--mantine-color-white)`,hover:U(t.white,.01),color:`var(--mantine-color-${e}-filled)`,border:`${m(1)} solid transparent`}:{background:`var(--mantine-color-white)`,hover:U(t.white,.01),color:`var(--mantine-color-${a.color}-${a.shade})`,border:`${m(1)} solid transparent`}:{background:`var(--mantine-color-white)`,hover:U(t.white,.01),color:e,border:`${m(1)} solid transparent`}:n===`gradient`?{background:me(r,t),hover:me(r,t),color:`var(--mantine-color-white)`,border:`none`}:n==="default"?{background:`var(--mantine-color-default)`,hover:`var(--mantine-color-default-hover)`,color:`var(--mantine-color-default-color)`,border:`${m(1)} solid var(--mantine-color-default-border)`}:{}},_e=(0,o.createContext)(null);function G(){let e=(0,o.use)(_e);if(!e)throw Error(`[@mantine/core] MantineProvider was not found in tree`);return e}function ve(){return G().cssVariablesResolver}function ye(){return G().classNamesPrefix}function be(){return G().getStyleNonce}function xe(){return G().withStaticClasses}function Se(){return G().headless}function Ce(){return G().stylesTransform?.sx}function we(){return G().stylesTransform?.styles}function Te(){return G().env||`default`}function Ee(){return G().deduplicateInlineStyles}var De={dark:[`#C9C9C9`,`#b8b8b8`,`#828282`,`#696969`,`#424242`,`#3b3b3b`,`#2e2e2e`,`#242424`,`#1f1f1f`,`#141414`],gray:[`#f8f9fa`,`#f1f3f5`,`#e9ecef`,`#dee2e6`,`#ced4da`,`#adb5bd`,`#868e96`,`#495057`,`#343a40`,`#212529`],red:[`#fff5f5`,`#ffe3e3`,`#ffc9c9`,`#ffa8a8`,`#ff8787`,`#ff6b6b`,`#fa5252`,`#f03e3e`,`#e03131`,`#c92a2a`],pink:[`#fff0f6`,`#ffdeeb`,`#fcc2d7`,`#faa2c1`,`#f783ac`,`#f06595`,`#e64980`,`#d6336c`,`#c2255c`,`#a61e4d`],grape:[`#f8f0fc`,`#f3d9fa`,`#eebefa`,`#e599f7`,`#da77f2`,`#cc5de8`,`#be4bdb`,`#ae3ec9`,`#9c36b5`,`#862e9c`],violet:[`#f3f0ff`,`#e5dbff`,`#d0bfff`,`#b197fc`,`#9775fa`,`#845ef7`,`#7950f2`,`#7048e8`,`#6741d9`,`#5f3dc4`],indigo:[`#edf2ff`,`#dbe4ff`,`#bac8ff`,`#91a7ff`,`#748ffc`,`#5c7cfa`,`#4c6ef5`,`#4263eb`,`#3b5bdb`,`#364fc7`],blue:[`#e7f5ff`,`#d0ebff`,`#a5d8ff`,`#74c0fc`,`#4dabf7`,`#339af0`,`#228be6`,`#1c7ed6`,`#1971c2`,`#1864ab`],cyan:[`#e3fafc`,`#c5f6fa`,`#99e9f2`,`#66d9e8`,`#3bc9db`,`#22b8cf`,`#15aabf`,`#1098ad`,`#0c8599`,`#0b7285`],teal:[`#e6fcf5`,`#c3fae8`,`#96f2d7`,`#63e6be`,`#38d9a9`,`#20c997`,`#12b886`,`#0ca678`,`#099268`,`#087f5b`],green:[`#ebfbee`,`#d3f9d8`,`#b2f2bb`,`#8ce99a`,`#69db7c`,`#51cf66`,`#40c057`,`#37b24d`,`#2f9e44`,`#2b8a3e`],lime:[`#f4fce3`,`#e9fac8`,`#d8f5a2`,`#c0eb75`,`#a9e34b`,`#94d82d`,`#82c91e`,`#74b816`,`#66a80f`,`#5c940d`],yellow:[`#fff9db`,`#fff3bf`,`#ffec99`,`#ffe066`,`#ffd43b`,`#fcc419`,`#fab005`,`#f59f00`,`#f08c00`,`#e67700`],orange:[`#fff4e6`,`#ffe8cc`,`#ffd8a8`,`#ffc078`,`#ffa94d`,`#ff922b`,`#fd7e14`,`#f76707`,`#e8590c`,`#d9480f`]},Oe=`-apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Helvetica, Arial, sans-serif, Apple Color Emoji, Segoe UI Emoji`,ke={scale:1,fontSmoothing:!0,focusRing:`auto`,white:`#fff`,black:`#000`,colors:De,primaryShade:{light:6,dark:8},primaryColor:`blue`,variantColorResolver:ge,autoContrast:!1,luminanceThreshold:.3,fontFamily:Oe,fontFamilyMonospace:`ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, Liberation Mono, Courier New, monospace`,respectReducedMotion:!1,cursorType:`default`,defaultGradient:{from:`blue`,to:`cyan`,deg:45},defaultRadius:`md`,activeClassName:`mantine-active`,focusClassName:``,headings:{fontFamily:Oe,fontWeight:`700`,textWrap:`wrap`,sizes:{h1:{fontSize:m(34),lineHeight:`1.3`},h2:{fontSize:m(26),lineHeight:`1.35`},h3:{fontSize:m(22),lineHeight:`1.4`},h4:{fontSize:m(18),lineHeight:`1.45`},h5:{fontSize:m(16),lineHeight:`1.5`},h6:{fontSize:m(14),lineHeight:`1.5`}}},fontSizes:{xs:m(12),sm:m(14),md:m(16),lg:m(18),xl:m(20)},lineHeights:{xs:`1.4`,sm:`1.45`,md:`1.55`,lg:`1.6`,xl:`1.65`},fontWeights:{regular:`400`,medium:`600`,bold:`700`},radius:{xs:m(2),sm:m(4),md:m(8),lg:m(16),xl:m(32)},spacing:{xs:m(10),sm:m(12),md:m(16),lg:m(20),xl:m(32)},breakpoints:{xs:`36em`,sm:`48em`,md:`62em`,lg:`75em`,xl:`88em`},shadows:{xs:`0 ${m(1)} ${m(3)} rgba(0, 0, 0, 0.05), 0 ${m(1)} ${m(2)} rgba(0, 0, 0, 0.1)`,sm:`0 ${m(1)} ${m(3)} rgba(0, 0, 0, 0.05), rgba(0, 0, 0, 0.05) 0 ${m(10)} ${m(15)} ${m(-5)}, rgba(0, 0, 0, 0.04) 0 ${m(7)} ${m(7)} ${m(-5)}`,md:`0 ${m(1)} ${m(3)} rgba(0, 0, 0, 0.05), rgba(0, 0, 0, 0.05) 0 ${m(20)} ${m(25)} ${m(-5)}, rgba(0, 0, 0, 0.04) 0 ${m(10)} ${m(10)} ${m(-5)}`,lg:`0 ${m(1)} ${m(3)} rgba(0, 0, 0, 0.05), rgba(0, 0, 0, 0.05) 0 ${m(28)} ${m(23)} ${m(-7)}, rgba(0, 0, 0, 0.04) 0 ${m(12)} ${m(12)} ${m(-7)}`,xl:`0 ${m(1)} ${m(3)} rgba(0, 0, 0, 0.05), rgba(0, 0, 0, 0.05) 0 ${m(36)} ${m(28)} ${m(-7)}, rgba(0, 0, 0, 0.04) 0 ${m(17)} ${m(17)} ${m(-7)}`},other:{},components:{}},Ae=`[@mantine/core] MantineProvider: Invalid theme.primaryColor, it accepts only key of theme.colors, learn more – https://mantine.dev/theming/colors/#primary-color`,je=`[@mantine/core] MantineProvider: Invalid theme.primaryShade, it accepts only 0-9 integers or an object { light: 0-9, dark: 0-9 }`;function Me(e){return e<0||e>9?!1:parseInt(e.toString(),10)===e}function Ne(e){if(!(e.primaryColor in e.colors))throw Error(Ae);if(typeof e.primaryShade==`object`&&(!Me(e.primaryShade.dark)||!Me(e.primaryShade.light))||typeof e.primaryShade==`number`&&!Me(e.primaryShade))throw Error(je)}function Pe(e,t){if(!t)return Ne(e),e;let n=u(e,t);return t.fontFamily&&!t.headings?.fontFamily&&(n.headings={...n.headings,fontFamily:t.fontFamily}),Ne(n),n}var Fe=(0,o.createContext)(null),Ie=()=>(0,o.use)(Fe)||ke;function Le(){let e=(0,o.use)(Fe);if(!e)throw Error(`@mantine/core: MantineProvider was not found in component tree, make sure you have it in your app`);return e}function Re({theme:e,children:t,inherit:n=!0}){let r=Ie(),i=(0,o.useMemo)(()=>Pe(n?r:ke,e),[e,r,n]);return(0,s.jsx)(Fe,{value:i,children:t})}Re.displayName=`@mantine/core/MantineThemeProvider`;function K(e,t,n){let r=Le(),i=(Array.isArray(e)?e:[e]).filter(Boolean),a={};for(let e of i){let t=r.components[e]?.defaultProps,n=typeof t==`function`?t(r):t;n&&(a={...a,...n})}return{...t,...a,...g(n)}}function ze({classNames:e,styles:t,props:n,stylesCtx:r}){let i=Le();return{resolvedClassNames:e===void 0?void 0:P({theme:i,classNames:e,props:n,stylesCtx:r||void 0}),resolvedStyles:t===void 0?void 0:F({theme:i,styles:t,props:n,stylesCtx:r||void 0})}}var Be={always:`mantine-focus-always`,auto:`mantine-focus-auto`,never:`mantine-focus-never`};function Ve({theme:e,options:t,unstyled:n}){return M(t?.focusable&&!n&&(e.focusClassName||Be[e.focusRing]),t?.active&&!n&&e.activeClassName)}function He(e,t,n=1){if(Object.is(e,t))return!0;if(n===0||typeof e!=`object`||typeof t!=`object`||e===null||t===null)return!1;if(Array.isArray(e)||Array.isArray(t)){if(!Array.isArray(e)||!Array.isArray(t)||e.length!==t.length)return!1;for(let r=0;r`${t}-${e}-${n}`)}function Je({options:e,classes:t,selector:n,unstyled:r}){return e?.variant&&!r?t[`${n}--${e.variant}`]:void 0}function Ye({theme:e,options:t,themeName:n,selector:r,classNamesPrefix:i,resolvedClassNames:a,resolvedThemeClassNames:o,classes:s,unstyled:c,className:l,rootSelector:u,props:d,stylesCtx:f,withStaticClasses:p,headless:m,transformedStyles:h}){return M(Ve({theme:e,options:t,unstyled:c||m}),o.map(e=>e[r]),Je({options:t,classes:s,selector:r,unstyled:c||m}),a[r],We({selector:r,stylesCtx:f,theme:e,classNames:h,props:d}),Ue({selector:r,stylesCtx:f,options:t,props:d,theme:e}),Ge({rootSelector:u,selector:r,className:l}),Ke({selector:r,classes:s,unstyled:c||m}),p&&!m&&qe({themeName:n,classNamesPrefix:i,selector:r,withStaticClass:t?.withStaticClass}),t?.className)}function Xe({style:e,theme:t}){return Array.isArray(e)?e.reduce((e,n)=>({...e,...Xe({style:n,theme:t})}),{}):typeof e==`function`?e(t):e??{}}function Ze({theme:e,selector:t,options:n,props:r,stylesCtx:i,rootSelector:a,withStylesTransform:o,resolvedStyles:s,resolvedThemeStyles:c,resolvedVars:l,resolvedRootStyle:u}){return{...c[t],...s[t],...!o&&F({theme:e,styles:n?.styles,props:n?.props||r,stylesCtx:i})[t],...l[t],...a===t?u:null,...Xe({style:n?.style,theme:e})}}function Qe(e){return e.reduce((e,t)=>(t&&Object.keys(t).forEach(n=>{e[n]={...e[n],...g(t[n])}}),e),{})}function $e({props:e,stylesCtx:t,themeName:n,theme:r}){let i=we()?.();return{getTransformedStyles:a=>i?[...a.map(n=>i(n,{props:e,theme:r,ctx:t})),...n.map(n=>i(r.components[n]?.styles,{props:e,theme:r,ctx:t}))].filter(Boolean):[],withStylesTransform:!!i}}function q({name:e,classes:t,props:n,stylesCtx:r,className:i,style:a,rootSelector:o=`root`,unstyled:s,classNames:c,styles:l,vars:u,varsResolver:d,attributes:f,stable:p}){let m=Le(),h=ye(),g=xe(),_=Se(),v=(Array.isArray(e)?e:[e]).filter(e=>e),{withStylesTransform:y,getTransformedStyles:b}=$e({props:n,stylesCtx:r,themeName:v,theme:m}),x=P({theme:m,classNames:c,props:n,stylesCtx:r}),S=v.map(e=>P({theme:m,classNames:m.components[e]?.classNames,props:n,stylesCtx:r})),C=y?{}:F({theme:m,styles:l,props:n,stylesCtx:r}),w={};if(!y)for(let e of v){let t=F({theme:m,styles:m.components[e]?.styles,props:n,stylesCtx:r});for(let e of Object.keys(t))w[e]={...w[e],...t[e]}}let T=Qe([_?{}:d?.(m,n,r),...v.map(e=>m.components?.[e]?.vars?.(m,n,r)),u?.(m,n,r)]),E=Xe({style:a,theme:m});return et((e,a)=>({...f?.[e],className:Ye({theme:m,options:a,themeName:v,selector:e,classNamesPrefix:h,resolvedClassNames:x,resolvedThemeClassNames:S,classes:t,unstyled:s,className:i,rootSelector:o,props:n,stylesCtx:r,withStaticClasses:g,headless:_,transformedStyles:b([a?.styles,l])}),style:Ze({theme:m,selector:e,options:a,props:n,stylesCtx:r,rootSelector:o,withStylesTransform:y,resolvedStyles:C,resolvedThemeStyles:w,resolvedVars:T,resolvedRootStyle:E})}),!!p,[m,h,g,_,y?n:null,t,s,i,o,f,r,x,S,C,w,T,E])}function et(e,t,n){let r=(0,o.useRef)(null);return t?((!r.current||!He(r.current.deps,n,3))&&(r.current={deps:n,getStyles:e}),r.current.getStyles):e}function tt(e){return c(e).reduce((t,n)=>e[n]===void 0?t:`${t}${d(n)}:${e[n]};`,``).trim()}function nt({selector:e,styles:t,media:n,container:r}){let i=t?tt(t):``,a=Array.isArray(n)?n.map(t=>`@media${t.query}{${e}{${tt(t.styles)}}}`):[],o=Array.isArray(r)?r.map(t=>`@container ${t.query}{${e}{${tt(t.styles)}}}`):[];return`${i?`${e}{${i}}`:``}${a.join(``)}${o.join(``)}`.trim()}function rt(e){let t=5381;for(let n=0;n>>0).toString(36)}function it({deduplicate:e,...t}){let n=be(),r=nt(t);return e?(0,s.jsx)(`style`,{href:`mantine-${rt(r)}`,precedence:`mantine`,nonce:n?.(),children:r}):(0,s.jsx)(`style`,{"data-mantine-styles":`inline`,nonce:n?.(),dangerouslySetInnerHTML:{__html:r}})}function at(e){let t=5381;for(let n=0;n>>0).toString(36)}function ot(e,t){return`__mdi__-${at(`${e?tt(e):``}|${Array.isArray(t)?t.map(e=>`${e.query}:${tt(e.styles)}`).join(`|`):``}`)}`}function st(e){let{m:t,mx:n,my:r,mt:i,mb:a,ml:o,mr:s,me:c,ms:l,mis:u,mie:d,p:f,px:p,py:m,pt:h,pb:_,pl:v,pr:y,pe:b,ps:x,pis:S,pie:C,bd:w,bdrs:T,bg:E,c:ee,opacity:te,ff:ne,fz:re,fw:ie,lts:D,ta:O,lh:k,fs:A,tt:ae,td:j,w:oe,miw:M,maw:se,h:N,mih:P,mah:F,bgsz:I,bgp:ce,bgr:le,bga:ue,pos:de,top:L,left:R,bottom:fe,right:z,inset:B,display:V,flex:H,hiddenFrom:pe,visibleFrom:U,lightHidden:me,darkHidden:W,sx:he,...ge}=e;return{styleProps:g({m:t,mx:n,my:r,mt:i,mb:a,ml:o,mr:s,me:c,ms:l,mis:u,mie:d,p:f,px:p,py:m,pt:h,pb:_,pl:v,pr:y,pis:S,pie:C,pe:b,ps:x,bd:w,bg:E,c:ee,opacity:te,ff:ne,fz:re,fw:ie,lts:D,ta:O,lh:k,fs:A,tt:ae,td:j,w:oe,miw:M,maw:se,h:N,mih:P,mah:F,bgsz:I,bgp:ce,bgr:le,bga:ue,pos:de,top:L,left:R,bottom:fe,right:z,inset:B,display:V,flex:H,bdrs:T,hiddenFrom:pe,visibleFrom:U,lightHidden:me,darkHidden:W,sx:he}),rest:ge}}var ct={m:{type:`spacing`,property:`margin`},mt:{type:`spacing`,property:`marginTop`},mb:{type:`spacing`,property:`marginBottom`},ml:{type:`spacing`,property:`marginLeft`},mr:{type:`spacing`,property:`marginRight`},ms:{type:`spacing`,property:`marginInlineStart`},me:{type:`spacing`,property:`marginInlineEnd`},mis:{type:`spacing`,property:`marginInlineStart`},mie:{type:`spacing`,property:`marginInlineEnd`},mx:{type:`spacing`,property:`marginInline`},my:{type:`spacing`,property:`marginBlock`},p:{type:`spacing`,property:`padding`},pt:{type:`spacing`,property:`paddingTop`},pb:{type:`spacing`,property:`paddingBottom`},pl:{type:`spacing`,property:`paddingLeft`},pr:{type:`spacing`,property:`paddingRight`},ps:{type:`spacing`,property:`paddingInlineStart`},pe:{type:`spacing`,property:`paddingInlineEnd`},pis:{type:`spacing`,property:`paddingInlineStart`},pie:{type:`spacing`,property:`paddingInlineEnd`},px:{type:`spacing`,property:`paddingInline`},py:{type:`spacing`,property:`paddingBlock`},bd:{type:`border`,property:`border`},bdrs:{type:`radius`,property:`borderRadius`},bg:{type:`color`,property:`background`},c:{type:`textColor`,property:`color`},opacity:{type:`identity`,property:`opacity`},ff:{type:`fontFamily`,property:`fontFamily`},fz:{type:`fontSize`,property:`fontSize`},fw:{type:`identity`,property:`fontWeight`},lts:{type:`size`,property:`letterSpacing`},ta:{type:`identity`,property:`textAlign`},lh:{type:`lineHeight`,property:`lineHeight`},fs:{type:`identity`,property:`fontStyle`},tt:{type:`identity`,property:`textTransform`},td:{type:`identity`,property:`textDecoration`},w:{type:`spacing`,property:`width`},miw:{type:`spacing`,property:`minWidth`},maw:{type:`spacing`,property:`maxWidth`},h:{type:`spacing`,property:`height`},mih:{type:`spacing`,property:`minHeight`},mah:{type:`spacing`,property:`maxHeight`},bgsz:{type:`size`,property:`backgroundSize`},bgp:{type:`identity`,property:`backgroundPosition`},bgr:{type:`identity`,property:`backgroundRepeat`},bga:{type:`identity`,property:`backgroundAttachment`},pos:{type:`identity`,property:`position`},top:{type:`size`,property:`top`},left:{type:`size`,property:`left`},bottom:{type:`size`,property:`bottom`},right:{type:`size`,property:`right`},inset:{type:`size`,property:`inset`},display:{type:`identity`,property:`display`},flex:{type:`identity`,property:`flex`}};function lt(e,t){let n=V({color:e,theme:t});return n.color===`dimmed`?`var(--mantine-color-dimmed)`:n.color===`bright`?`var(--mantine-color-bright)`:n.variable?`var(${n.variable})`:n.color}function ut(e,t){let n=V({color:e,theme:t});return n.isThemeColor&&n.shade===void 0?`var(--mantine-color-${n.color}-text)`:lt(e,t)}function dt(e,t){if(typeof e==`number`)return m(e);if(typeof e==`string`){let[n,r,...i]=e.split(` `).filter(e=>e.trim()!==``),a=`${m(n)}`;return r&&(a+=` ${r}`),i.length>0&&(a+=` ${lt(i.join(` `),t)}`),a.trim()}return e}var ft={text:`var(--mantine-font-family)`,mono:`var(--mantine-font-family-monospace)`,monospace:`var(--mantine-font-family-monospace)`,heading:`var(--mantine-font-family-headings)`,headings:`var(--mantine-font-family-headings)`};function pt(e){return typeof e==`string`&&e in ft?ft[e]:e}var mt=[`h1`,`h2`,`h3`,`h4`,`h5`,`h6`];function ht(e,t){return typeof e==`string`&&e in t.fontSizes?`var(--mantine-font-size-${e})`:typeof e==`string`&&mt.includes(e)?`var(--mantine-${e}-font-size)`:typeof e==`number`||typeof e==`string`?m(e):e}function gt(e){return e}var _t=[`h1`,`h2`,`h3`,`h4`,`h5`,`h6`];function vt(e,t){return typeof e==`string`&&e in t.lineHeights?`var(--mantine-line-height-${e})`:typeof e==`string`&&_t.includes(e)?`var(--mantine-${e}-line-height)`:e}function yt(e,t){return typeof e==`string`&&e in t.radius?`var(--mantine-radius-${e})`:typeof e==`number`||typeof e==`string`?m(e):e}function bt(e){return typeof e==`number`?m(e):e}function xt(e,t){if(typeof e==`number`)return m(e);if(typeof e==`string`){let n=e.replace(`-`,``);if(!(n in t.spacing))return m(e);let r=`--mantine-spacing-${n}`;return e.startsWith(`-`)?`calc(var(${r}) * -1)`:`var(${r})`}return e}var St={color:lt,textColor:ut,fontSize:ht,spacing:xt,radius:yt,identity:gt,size:bt,lineHeight:vt,fontFamily:pt,border:dt};function Ct(e){return e.replace(`(min-width: `,``).replace(`em)`,``)}function wt({media:e,...t}){let n=Object.keys(e).sort((e,t)=>Number(Ct(e))-Number(Ct(t))).map(t=>({query:t,styles:e[t]}));return{...t,media:n}}function Tt(e){if(typeof e!=`object`||!e)return!1;let t=Object.keys(e);return t.length!==1||t[0]!==`base`}function Et(e){return typeof e==`object`&&e?`base`in e?e.base:void 0:e}function Dt(e){return typeof e==`object`&&e?c(e).filter(e=>e!==`base`):[]}function Ot(e,t){return typeof e==`object`&&e&&t in e?e[t]:e}function kt({styleProps:e,data:t,theme:n}){return wt(c(e).reduce((r,i)=>{if(i===`hiddenFrom`||i===`visibleFrom`||i===`sx`)return r;let a=t[i],o=Array.isArray(a.property)?a.property:[a.property],s=Et(e[i]);if(!Tt(e[i]))return o.forEach(e=>{r.inlineStyles[e]=St[a.type](s,n)}),r;r.hasResponsiveStyles=!0;let c=Dt(e[i]);return o.forEach(t=>{s!=null&&(r.styles[t]=St[a.type](s,n)),c.forEach(o=>{let s=`(min-width: ${n.breakpoints[o]})`;r.media[s]={...r.media[s],[t]:St[a.type](Ot(e[i],o),n)}})}),r},{hasResponsiveStyles:!1,styles:{},inlineStyles:{},media:{}}))}function At(){return`__m__-${(0,o.useId)().replace(/[:«»]/g,``)}`}function jt(e){return e}var Mt=jt;function Nt(e){return e}function J(e){let t=e;return t.extend=Nt,t.withProps=e=>{let n=n=>(0,s.jsx)(t,{...e,...n});return n.extend=t.extend,n.displayName=`WithProps(${t.displayName})`,n},t}function Pt(e){return J(e)}function Y(e){let t=e;return t.withProps=e=>{let n=n=>(0,s.jsx)(t,{...e,...n});return n.extend=t.extend,n.displayName=`WithProps(${t.displayName})`,n},t.extend=Nt,t}function Ft(e){return`data-${(e.startsWith(`data-`)?e.slice(5):e).replace(/([a-z])([A-Z])/g,`$1-$2`).toLowerCase()}`}function It(e){return Object.keys(e).reduce((t,n)=>{let r=e[n];return r===void 0||r===``||r===!1||r===null||(t[Ft(n)]=e[n]),t},{})}function Lt(e){return e?typeof e==`string`?{[Ft(e)]:!0}:Array.isArray(e)?[...e].reduce((e,t)=>({...e,...Lt(t)}),{}):It(e):null}function Rt(e,t){return Array.isArray(e)?[...e].reduce((e,n)=>({...e,...Rt(n,t)}),{}):typeof e==`function`?e(t):e??{}}function zt({theme:e,style:t,vars:n,styleProps:r}){let i=Rt(t,e),a=Rt(n,e);return{...i,...a,...r}}function Bt({component:e,style:t,__vars:n,className:r,variant:i,mod:a,size:o,hiddenFrom:c,visibleFrom:l,lightHidden:u,darkHidden:d,renderRoot:f,__size:p,ref:m,...h}){let g=Le(),v=e||`div`,{styleProps:y,rest:b}=st(h),x=Ce()?.()?.(y.sx),S=At(),C=kt({styleProps:y,theme:g,data:ct}),w=Ee(),T=w&&C.hasResponsiveStyles?ot(C.styles,C.media):S,E={ref:m,style:zt({theme:g,style:t,vars:n,styleProps:C.inlineStyles}),className:M(r,x,{[T]:C.hasResponsiveStyles,"mantine-light-hidden":u,"mantine-dark-hidden":d,[`mantine-hidden-from-${c}`]:c,[`mantine-visible-from-${l}`]:l}),"data-variant":i,"data-size":_(o)?void 0:o||void 0,size:p,...Lt(a),...b};return(0,s.jsxs)(s.Fragment,{children:[C.hasResponsiveStyles&&(0,s.jsx)(it,{selector:`.${T}`,styles:C.styles,media:C.media,deduplicate:w}),typeof f==`function`?f(E):(0,s.jsx)(v,{...E})]})}Bt.displayName=`@mantine/core/Box`;var X=Mt(Bt),Vt={root:`m_87cf2631`},Ht={__staticSelector:`UnstyledButton`},Ut=Y(e=>{let t=K(`UnstyledButton`,Ht,e),{className:n,component:r=`button`,__staticSelector:i,unstyled:a,classNames:o,styles:c,style:l,attributes:u,...d}=t,f=q({name:i,props:t,classes:Vt,className:n,style:l,classNames:o,styles:c,unstyled:a,attributes:u});return(0,s.jsx)(X,{...f(`root`,{focusable:!0}),component:r,type:r===`button`?`button`:void 0,...d})});Ut.classes=Vt,Ut.displayName=`@mantine/core/UnstyledButton`;var Wt={root:`m_1b7284a3`},Gt=j((e,{radius:t,shadow:n})=>({root:{"--paper-radius":t===void 0?void 0:x(t),"--paper-shadow":w(n)}})),Kt=Y(e=>{let t=K(`Paper`,null,e),{classNames:n,className:r,style:i,styles:a,unstyled:o,withBorder:c,vars:l,radius:u,shadow:d,variant:f,mod:p,attributes:m,...h}=t,g=q({name:`Paper`,props:t,classes:Wt,className:r,style:i,classNames:n,styles:a,unstyled:o,attributes:m,vars:l,varsResolver:Gt});return(0,s.jsx)(X,{mod:[{withBorder:c},p],...g(`root`),variant:f,...h})});Kt.classes=Wt,Kt.varsResolver=Gt,Kt.displayName=`@mantine/core/Paper`;var qt=e=>({in:{opacity:1,transform:`scale(1)`},out:{opacity:0,transform:`scale(.9) translateY(${e===`bottom`?10:-10}px)`},transitionProperty:`transform, opacity`}),Jt={fade:{in:{opacity:1},out:{opacity:0},transitionProperty:`opacity`},"fade-up":{in:{opacity:1,transform:`translateY(0)`},out:{opacity:0,transform:`translateY(30px)`},transitionProperty:`opacity, transform`},"fade-down":{in:{opacity:1,transform:`translateY(0)`},out:{opacity:0,transform:`translateY(-30px)`},transitionProperty:`opacity, transform`},"fade-left":{in:{opacity:1,transform:`translateX(0)`},out:{opacity:0,transform:`translateX(30px)`},transitionProperty:`opacity, transform`},"fade-right":{in:{opacity:1,transform:`translateX(0)`},out:{opacity:0,transform:`translateX(-30px)`},transitionProperty:`opacity, transform`},scale:{in:{opacity:1,transform:`scale(1)`},out:{opacity:0,transform:`scale(0)`},common:{transformOrigin:`top`},transitionProperty:`transform, opacity`},"scale-y":{in:{opacity:1,transform:`scaleY(1)`},out:{opacity:0,transform:`scaleY(0)`},common:{transformOrigin:`top`},transitionProperty:`transform, opacity`},"scale-x":{in:{opacity:1,transform:`scaleX(1)`},out:{opacity:0,transform:`scaleX(0)`},common:{transformOrigin:`left`},transitionProperty:`transform, opacity`},"skew-up":{in:{opacity:1,transform:`translateY(0) skew(0deg, 0deg)`},out:{opacity:0,transform:`translateY(-20px) skew(-10deg, -5deg)`},common:{transformOrigin:`top`},transitionProperty:`transform, opacity`},"skew-down":{in:{opacity:1,transform:`translateY(0) skew(0deg, 0deg)`},out:{opacity:0,transform:`translateY(20px) skew(-10deg, -5deg)`},common:{transformOrigin:`bottom`},transitionProperty:`transform, opacity`},"rotate-left":{in:{opacity:1,transform:`translateY(0) rotate(0deg)`},out:{opacity:0,transform:`translateY(20px) rotate(-5deg)`},common:{transformOrigin:`bottom`},transitionProperty:`transform, opacity`},"rotate-right":{in:{opacity:1,transform:`translateY(0) rotate(0deg)`},out:{opacity:0,transform:`translateY(20px) rotate(5deg)`},common:{transformOrigin:`top`},transitionProperty:`transform, opacity`},"slide-down":{in:{opacity:1,transform:`translateY(0)`},out:{opacity:0,transform:`translateY(-100%)`},common:{transformOrigin:`top`},transitionProperty:`transform, opacity`},"slide-up":{in:{opacity:1,transform:`translateY(0)`},out:{opacity:0,transform:`translateY(100%)`},common:{transformOrigin:`bottom`},transitionProperty:`transform, opacity`},"slide-left":{in:{opacity:1,transform:`translateX(0)`},out:{opacity:0,transform:`translateX(100%)`},common:{transformOrigin:`left`},transitionProperty:`transform, opacity`},"slide-right":{in:{opacity:1,transform:`translateX(0)`},out:{opacity:0,transform:`translateX(-100%)`},common:{transformOrigin:`right`},transitionProperty:`transform, opacity`},pop:{...qt(`bottom`),common:{transformOrigin:`center center`}},"pop-bottom-left":{...qt(`bottom`),common:{transformOrigin:`bottom left`}},"pop-bottom-right":{...qt(`bottom`),common:{transformOrigin:`bottom right`}},"pop-top-left":{...qt(`top`),common:{transformOrigin:`top left`}},"pop-top-right":{...qt(`top`),common:{transformOrigin:`top right`}}},Yt={entering:`in`,entered:`in`,exiting:`out`,exited:`out`,"pre-exiting":`out`,"pre-entering":`out`};function Xt({transition:e,state:t,duration:n,timingFunction:r}){let i={WebkitBackfaceVisibility:`hidden`,transitionDuration:`${n}ms`,transitionTimingFunction:r};return typeof e==`string`?e in Jt?{transitionProperty:Jt[e].transitionProperty,...i,...Jt[e].common,...Jt[e][Yt[t]]}:{}:{transitionProperty:e.transitionProperty,...i,...e.common,...e[Yt[t]]}}var Zt=r(a(),1);function Qt({duration:e,exitDuration:t,timingFunction:n,mounted:r,onEnter:i,onExit:a,onEntered:s,onExited:c,enterDelay:l,exitDelay:u}){let d=Le(),f=A(),p=d.respectReducedMotion?f:!1,[m,h]=(0,o.useState)(p?0:e),[g,_]=(0,o.useState)(r?`entered`:`exited`),v=(0,o.useRef)(-1),y=(0,o.useRef)(-1),b=(0,o.useRef)(-1);function x(){window.clearTimeout(v.current),window.clearTimeout(y.current),cancelAnimationFrame(b.current)}let S=n=>{x();let r=n?i:a,o=n?s:c,l=p?0:n?e:t;h(l),l===0?(typeof r==`function`&&r(),typeof o==`function`&&o(),_(n?`entered`:`exited`)):b.current=requestAnimationFrame(()=>{Zt.flushSync(()=>{_(n?`pre-entering`:`pre-exiting`)}),b.current=requestAnimationFrame(()=>{typeof r==`function`&&r(),_(n?`entering`:`exiting`),v.current=window.setTimeout(()=>{typeof o==`function`&&o(),_(n?`entered`:`exited`)},l)})})},C=e=>{if(x(),typeof(e?l:u)!=`number`){S(e);return}y.current=window.setTimeout(()=>{S(e)},e?l:u)};return re(()=>{C(r)},[r]),(0,o.useEffect)(()=>()=>{x()},[]),{transitionDuration:m,transitionStatus:g,transitionTimingFunction:n||`ease`}}function $t({keepMounted:e,keepMountedMode:t=`activity`,transition:n=`fade`,duration:r=250,exitDuration:i=r,mounted:a,children:c,timingFunction:l=`ease`,onExit:u,onEntered:d,onEnter:f,onExited:p,enterDelay:m,exitDelay:h}){let g=Te(),{transitionDuration:_,transitionStatus:v,transitionTimingFunction:y}=Qt({mounted:a,exitDuration:i,duration:r,timingFunction:l,onExit:u,onEntered:d,onEnter:f,onExited:p,enterDelay:m,exitDelay:h});if(g===`test`)return a?(0,s.jsx)(s.Fragment,{children:c({})}):e?c({display:`none`}):null;if(_===0)return e?t===`display-none`?a?(0,s.jsx)(s.Fragment,{children:c({})}):c({display:`none`}):(0,s.jsx)(o.Activity,{mode:a?`visible`:`hidden`,children:c({})}):a?(0,s.jsx)(s.Fragment,{children:c({})}):null;let b=v===`exited`;if(e){let e=c(b?t===`display-none`?{display:`none`}:{}:Xt({transition:n,duration:_,state:v,timingFunction:y}));return t===`display-none`?e:(0,s.jsx)(o.Activity,{mode:b?`hidden`:`visible`,children:e})}return b?null:(0,s.jsx)(s.Fragment,{children:c(Xt({transition:n,duration:_,state:v,timingFunction:y}))})}$t.displayName=`@mantine/core/Transition`;var Z={root:`m_5ae2e3c`,barsLoader:`m_7a2bd4cd`,bar:`m_870bb79`,"bars-loader-animation":`m_5d2b3b9d`,dotsLoader:`m_4e3f22d7`,dot:`m_870c4af`,"loader-dots-animation":`m_aac34a1`,ovalLoader:`m_b34414df`,"oval-loader-animation":`m_f8e89c4b`},en=({className:e,...t})=>(0,s.jsxs)(X,{component:`span`,className:M(Z.barsLoader,e),...t,children:[(0,s.jsx)(`span`,{className:Z.bar}),(0,s.jsx)(`span`,{className:Z.bar}),(0,s.jsx)(`span`,{className:Z.bar})]});en.displayName=`@mantine/core/Bars`;var tn=({className:e,...t})=>(0,s.jsxs)(X,{component:`span`,className:M(Z.dotsLoader,e),...t,children:[(0,s.jsx)(`span`,{className:Z.dot}),(0,s.jsx)(`span`,{className:Z.dot}),(0,s.jsx)(`span`,{className:Z.dot})]});tn.displayName=`@mantine/core/Dots`;var nn=({className:e,...t})=>(0,s.jsx)(X,{component:`span`,className:M(Z.ovalLoader,e),...t});nn.displayName=`@mantine/core/Oval`;var rn={bars:en,oval:nn,dots:tn},an={loaders:rn,type:`oval`},on=j((e,{size:t,color:n})=>({root:{"--loader-size":y(t,`loader-size`),"--loader-color":n?H(n,e):void 0}})),sn=J(e=>{let t=K(`Loader`,an,e),{size:n,color:r,type:i,vars:a,className:o,style:c,classNames:l,styles:u,unstyled:d,loaders:f,variant:p,children:m,attributes:h,...g}=t,_=q({name:`Loader`,props:t,classes:Z,className:o,style:c,classNames:l,styles:u,unstyled:d,attributes:h,vars:a,varsResolver:on});return m?(0,s.jsx)(X,{..._(`root`),...g,children:m}):(0,s.jsx)(X,{..._(`root`),component:f[i],variant:p,size:n,...g})});sn.defaultLoaders=rn,sn.classes=Z,sn.varsResolver=on,sn.displayName=`@mantine/core/Loader`;function cn({size:e=`var(--cb-icon-size, 70%)`,style:t,...n}){return(0,s.jsx)(`svg`,{viewBox:`0 0 15 15`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`,style:{...t,width:e,height:e},...n,children:(0,s.jsx)(`path`,{d:`M11.7816 4.03157C12.0062 3.80702 12.0062 3.44295 11.7816 3.2184C11.5571 2.99385 11.193 2.99385 10.9685 3.2184L7.50005 6.68682L4.03164 3.2184C3.80708 2.99385 3.44301 2.99385 3.21846 3.2184C2.99391 3.44295 2.99391 3.80702 3.21846 4.03157L6.68688 7.49999L3.21846 10.9684C2.99391 11.193 2.99391 11.557 3.21846 11.7816C3.44301 12.0061 3.80708 12.0061 4.03164 11.7816L7.50005 8.31316L10.9685 11.7816C11.193 12.0061 11.5571 12.0061 11.7816 11.7816C12.0062 11.557 12.0062 11.193 11.7816 10.9684L8.31322 7.49999L11.7816 4.03157Z`,fill:`currentColor`,fillRule:`evenodd`,clipRule:`evenodd`})})}cn.displayName=`@mantine/core/CloseIcon`;var ln={root:`m_86a44da5`,"root--subtle":`m_220c80f2`},un={variant:`subtle`},dn=j((e,{size:t,radius:n,iconSize:r})=>({root:{"--cb-size":y(t,`cb-size`),"--cb-radius":n===void 0?void 0:x(n),"--cb-icon-size":m(r)}})),fn=Y(e=>{let t=K(`CloseButton`,un,e),{iconSize:n,children:r,vars:i,radius:a,className:o,classNames:c,style:l,styles:u,unstyled:d,"data-disabled":f,disabled:p,variant:m,icon:h,mod:g,attributes:_,__staticSelector:v,...y}=t,b=q({name:v||`CloseButton`,props:t,className:o,style:l,classes:ln,classNames:c,styles:u,unstyled:d,attributes:_,vars:i,varsResolver:dn});return(0,s.jsxs)(Ut,{...y,unstyled:d,variant:m,disabled:p,mod:[{disabled:p||f},g],...b(`root`,{variant:m,active:!p&&!f}),children:[h||(0,s.jsx)(cn,{}),r]})});fn.classes=ln,fn.varsResolver=dn,fn.displayName=`@mantine/core/CloseButton`;function pn(e){return o.Children.toArray(e).filter(Boolean)}var mn={root:`m_4081bf90`},hn={preventGrowOverflow:!0,gap:`md`,align:`center`,justify:`flex-start`,wrap:`wrap`},gn=j((e,{grow:t,preventGrowOverflow:n,gap:r,align:i,justify:a,wrap:o},{childWidth:s})=>({root:{"--group-child-width":t&&n?s:void 0,"--group-gap":b(r),"--group-align":i,"--group-justify":a,"--group-wrap":o}})),_n=J(e=>{let t=K(`Group`,hn,e),{classNames:n,className:r,style:i,styles:a,unstyled:o,children:c,gap:l,align:u,justify:d,wrap:f,grow:p,preventGrowOverflow:m,vars:h,variant:g,__size:_,mod:v,attributes:y,...x}=t,S=pn(c),C=S.length,w=b(l??`md`),T=q({name:`Group`,props:t,stylesCtx:{childWidth:`calc(${100/C}% - (${w} - ${w} / ${C}))`},className:r,style:i,classes:mn,classNames:n,styles:a,unstyled:o,attributes:y,vars:h,varsResolver:gn});return(0,s.jsx)(X,{...T(`root`),variant:g,mod:[{grow:p},v],size:_,...x,children:S})});_n.classes=mn,_n.varsResolver=gn,_n.displayName=`@mantine/core/Group`;var vn=(0,o.createContext)({size:`sm`}),yn=J(e=>{let t=K(`InputClearButton`,null,e),{size:n,variant:r,vars:i,classNames:a,styles:c,...l}=t,u=(0,o.use)(vn),{resolvedClassNames:d,resolvedStyles:f}=ze({classNames:a,styles:c,props:t});return(0,s.jsx)(fn,{variant:r||`transparent`,size:n||u?.size||`sm`,classNames:d,styles:f,__staticSelector:`InputClearButton`,style:{pointerEvents:`all`,background:`var(--input-bg)`,...l.style},...l})});yn.displayName=`@mantine/core/InputClearButton`;var bn={xs:7,sm:8,md:10,lg:12,xl:15};function xn({__clearable:e,__clearSection:t,rightSection:n,__defaultRightSection:r,size:i=`sm`,__clearSectionMode:a=`both`}){let o=e&&t;return a===`rightSection`?n===null?null:n||r:a===`clear`?n===null?null:o||r:o&&(n||r)?(0,s.jsxs)(`div`,{"data-combined-clear-section":!0,style:{display:`flex`,gap:2,alignItems:`center`,paddingInlineEnd:bn[i]},children:[o,n||r]}):n===null?null:n||o||r}var Sn=(0,o.createContext)({offsetBottom:!1,offsetTop:!1,describedBy:void 0,getStyles:null,inputId:void 0,labelId:void 0}),Q={wrapper:`m_6c018570`,input:`m_8fb7ebe7`,bottomSection:`m_93f4ed57`,section:`m_82577fc2`,placeholder:`m_88bacfd0`,root:`m_46b77525`,label:`m_8fdc1311`,required:`m_78a94662`,error:`m_8f816625`,success:`m_9d9d40e0`,description:`m_fe47ce59`},Cn=j((e,{size:t})=>({description:{"--input-description-size":t===void 0?void 0:`calc(${S(t)} - ${m(2)})`}})),wn=J(e=>{let t=K(`InputDescription`,null,e),{classNames:n,className:r,style:i,styles:a,unstyled:c,vars:l,__staticSelector:u,__inheritStyles:d=!0,attributes:f,...p}=K(`InputDescription`,null,t),m=(0,o.use)(Sn),h=q({name:[`InputWrapper`,u],props:t,classes:Q,className:r,style:i,classNames:n,styles:a,unstyled:c,attributes:f,rootSelector:`description`,vars:l,varsResolver:Cn}),g=d&&m?.getStyles||h;return(0,s.jsx)(X,{component:`p`,...g(`description`,m?.getStyles?{className:r,style:i}:void 0),...p})});wn.classes=Q,wn.varsResolver=Cn,wn.displayName=`@mantine/core/InputDescription`;var Tn=j((e,{size:t})=>({error:{"--input-error-size":t===void 0?void 0:`calc(${S(t)} - ${m(2)})`}})),En=J(e=>{let t=K(`InputError`,null,e),{classNames:n,className:r,style:i,styles:a,unstyled:c,vars:l,attributes:u,__staticSelector:d,__inheritStyles:f=!0,...p}=t,m=q({name:[`InputWrapper`,d],props:t,classes:Q,className:r,style:i,classNames:n,styles:a,unstyled:c,attributes:u,rootSelector:`error`,vars:l,varsResolver:Tn}),h=(0,o.use)(Sn),g=f&&h?.getStyles||m;return(0,s.jsx)(X,{component:`p`,...g(`error`,h?.getStyles?{className:r,style:i}:void 0),...p})});En.classes=Q,En.varsResolver=Tn,En.displayName=`@mantine/core/InputError`;var Dn={labelElement:`label`},On=j((e,{size:t})=>({label:{"--input-label-size":S(t),"--input-asterisk-color":void 0}})),kn=J(e=>{let t=K(`InputLabel`,Dn,e),{classNames:n,className:r,style:i,styles:a,unstyled:c,vars:l,labelElement:u,required:d,htmlFor:f,onMouseDown:p,children:m,__staticSelector:h,mod:g,attributes:_,...v}=t,y=q({name:[`InputWrapper`,h],props:t,classes:Q,className:r,style:i,classNames:n,styles:a,unstyled:c,attributes:_,rootSelector:`label`,vars:l,varsResolver:On}),b=(0,o.use)(Sn),x=b?.getStyles||y,S=v.component||u,C=typeof S!=`string`||S===`label`;return(0,s.jsxs)(X,{...x(`label`,b?.getStyles?{className:r,style:i}:void 0),component:u,htmlFor:C?f:void 0,mod:[{required:d},g],onMouseDown:e=>{p?.(e),!e.defaultPrevented&&e.detail>1&&e.preventDefault()},...v,children:[m,d&&(0,s.jsx)(`span`,{...x(`required`),"aria-hidden":!0,children:` *`})]})});kn.classes=Q,kn.varsResolver=On,kn.displayName=`@mantine/core/InputLabel`;var An=J(e=>{let t=K(`InputPlaceholder`,null,e),{classNames:n,className:r,style:i,styles:a,unstyled:o,vars:c,__staticSelector:l,error:u,mod:d,attributes:f,...p}=t,m=q({name:[`InputPlaceholder`,l],props:t,classes:Q,className:r,style:i,classNames:n,styles:a,unstyled:o,attributes:f,rootSelector:`placeholder`});return(0,s.jsx)(X,{...m(`placeholder`),mod:[{error:!!u},d],component:`span`,...p})});An.classes=Q,An.displayName=`@mantine/core/InputPlaceholder`;var jn=j((e,{size:t})=>({success:{"--input-success-size":t===void 0?void 0:`calc(${S(t)} - ${m(2)})`}})),Mn=J(e=>{let t=K(`InputSuccess`,null,e),{classNames:n,className:r,style:i,styles:a,unstyled:c,vars:l,attributes:u,__staticSelector:d,__inheritStyles:f=!0,...p}=t,m=q({name:[`InputWrapper`,d],props:t,classes:Q,className:r,style:i,classNames:n,styles:a,unstyled:c,attributes:u,rootSelector:`success`,vars:l,varsResolver:jn}),h=(0,o.use)(Sn),g=f&&h?.getStyles||m;return(0,s.jsx)(X,{component:`p`,...g(`success`,h?.getStyles?{className:r,style:i}:void 0),...p})});Mn.classes=Q,Mn.varsResolver=jn,Mn.displayName=`@mantine/core/InputSuccess`;function Nn(e,{hasDescription:t,hasError:n}){let r=e.findIndex(e=>e===`input`),i=e.slice(0,r),a=e.slice(r+1),o=t&&i.includes(`description`)||n&&i.includes(`error`);return{offsetBottom:t&&a.includes(`description`)||n&&a.includes(`error`),offsetTop:o}}var Pn={labelElement:`label`,inputContainer:e=>e,inputWrapperOrder:[`label`,`description`,`input`,`error`]},Fn=j((e,{size:t})=>({label:{"--input-label-size":S(t),"--input-asterisk-color":void 0},error:{"--input-error-size":t===void 0?void 0:`calc(${S(t)} - ${m(2)})`},success:{"--input-success-size":t===void 0?void 0:`calc(${S(t)} - ${m(2)})`},description:{"--input-description-size":t===void 0?void 0:`calc(${S(t)} - ${m(2)})`}})),In=J(e=>{let t=K(`InputWrapper`,Pn,e),{classNames:n,className:r,style:i,styles:a,unstyled:c,vars:l,size:u,variant:d,__staticSelector:f,inputContainer:p,inputWrapperOrder:m,label:h,error:g,success:_,description:v,labelProps:y,descriptionProps:b,errorProps:x,successProps:S,labelElement:C,children:w,withAsterisk:T,id:E,required:ee,__stylesApiProps:te,mod:ne,attributes:re,...D}=t,O=q({name:[`InputWrapper`,f],props:te||t,classes:Q,className:r,style:i,classNames:n,styles:a,unstyled:c,attributes:re,vars:l,varsResolver:Fn}),k={size:u,variant:d,__staticSelector:f},A=ie(E),ae=typeof T==`boolean`?T:ee,j=x?.id||`${A}-error`,oe=S?.id||`${A}-success`,M=b?.id||`${A}-description`,se=A,N=!!g&&typeof g!=`boolean`,P=!!_&&typeof _!=`boolean`&&!g,F=!!v,I=N&&m.includes(`error`),ce=P&&m.includes(`error`),le=F&&m.includes(`description`),ue=`${I?j:``} ${ce?oe:``} ${le?M:``}`,de=ue.trim().length>0?ue.trim():void 0,L=y?.id||`${A}-label`,R=h&&(0,s.jsx)(kn,{labelElement:C,id:L,htmlFor:se,required:ae,...k,...y,children:h},`label`),fe=F&&(0,s.jsx)(wn,{...b,...k,size:b?.size||k.size,id:b?.id||M,children:v},`description`),z=(0,s.jsx)(o.Fragment,{children:p(w)},`input`),B=N&&(0,o.createElement)(En,{...x,...k,size:x?.size||k.size,key:`error`,id:x?.id||j},g),V=P&&(0,o.createElement)(Mn,{...S,...k,size:S?.size||k.size,key:`success`,id:S?.id||oe},_),H=m.map(e=>{switch(e){case`label`:return R;case`input`:return z;case`description`:return fe;case`error`:return B||V;default:return null}});return(0,s.jsx)(Sn,{value:{getStyles:O,describedBy:de,inputId:se,labelId:R&&m.includes(`label`)?L:void 0,...Nn(m,{hasDescription:F,hasError:N||P})},children:(0,s.jsx)(X,{variant:d,size:u,mod:[{error:!!g,success:!!_&&!g},ne],id:C===`label`?void 0:E,...O(`root`),...D,children:H})})});In.classes=Q,In.varsResolver=Fn,In.displayName=`@mantine/core/InputWrapper`;var Ln={variant:`default`,leftSectionPointerEvents:`none`,rightSectionPointerEvents:`none`,withAria:!0,withErrorStyles:!0,withSuccessStyles:!0,size:`sm`,loading:!1,loadingPosition:`right`},Rn=j((e,t,n)=>({wrapper:{"--input-margin-top":n.offsetTop?`calc(var(--mantine-spacing-xs) / 2)`:void 0,"--input-margin-bottom":n.offsetBottom?`calc(var(--mantine-spacing-xs) / 2)`:void 0,"--input-height":y(t.size,`input-height`),"--input-fz":S(t.size),"--input-radius":t.radius===void 0?void 0:x(t.radius),"--input-left-section-width":t.leftSectionWidth===void 0?void 0:m(t.leftSectionWidth),"--input-right-section-width":t.rightSectionWidth===void 0?void 0:m(t.rightSectionWidth),"--input-padding-y":t.multiline?y(t.size,`input-padding-y`):void 0,"--input-left-section-pointer-events":t.leftSectionPointerEvents,"--input-right-section-pointer-events":t.rightSectionPointerEvents}})),$=Y(e=>{let t=K(`Input`,Ln,e),{classNames:n,className:r,style:i,styles:a,unstyled:c,required:l,__staticSelector:u,__stylesApiProps:d,size:f,wrapperProps:p,error:m,success:h,disabled:g,leftSection:_,leftSectionProps:v,leftSectionWidth:y,rightSection:b,rightSectionProps:x,rightSectionWidth:S,rightSectionPointerEvents:C,leftSectionPointerEvents:w,variant:T,vars:E,pointer:ee,multiline:te,radius:ne,id:re,withAria:ie,withErrorStyles:D,withSuccessStyles:O,mod:k,inputSize:A,attributes:ae,__clearSection:j,__clearable:oe,__clearSectionMode:M,__defaultRightSection:se,loading:N,loadingPosition:P,__bottomSection:F,__bottomSectionProps:I,rootRef:ce,dir:le,...ue}=t,{styleProps:de,rest:L}=st(ue),R=(0,o.use)(Sn),fe={offsetBottom:R?.offsetBottom,offsetTop:R?.offsetTop},z=q({name:[`Input`,u],props:d||t,classes:Q,className:r,style:i,classNames:n,styles:a,unstyled:c,attributes:ae,stylesCtx:fe,rootSelector:`wrapper`,vars:E,varsResolver:Rn}),B=ie?{required:l,disabled:g,"aria-invalid":m?!0:void 0,"aria-describedby":R?.describedBy,id:R?.inputId||re}:{},V=N?(0,s.jsx)(sn,{size:P===`left`?`calc(var(--input-left-section-size) / 2)`:`calc(var(--input-right-section-size) / 2)`}):null,H=N&&P===`left`?V:_,pe=xn({__clearable:oe,__clearSection:j,rightSection:N&&P===`right`?V:b,__defaultRightSection:se,size:f,__clearSectionMode:M});return(0,s.jsx)(vn,{value:{size:f||`sm`},children:(0,s.jsxs)(X,{ref:ce,dir:le,...z(`wrapper`),...de,...p,mod:[{error:!!m&&D,success:!!h&&!m&&O,pointer:ee,disabled:g,multiline:te,withRightSection:!!pe,withLeftSection:!!H,withBottomSection:!!F},k],variant:T,size:f,children:[H&&(0,s.jsx)(`div`,{...v,"data-position":`left`,...z(`section`,{className:v?.className,style:v?.style}),children:H}),(0,s.jsx)(X,{component:`input`,...L,...B,required:l,mod:{disabled:g,error:!!m&&D,success:!!h&&!m&&O},variant:T,__size:A,...z(`input`)}),F&&(0,s.jsx)(`div`,{...I,...z(`bottomSection`,{className:I?.className,style:I?.style}),children:F}),pe&&(0,s.jsx)(`div`,{...x,"data-position":`right`,...z(`section`,{className:x?.className,style:x?.style}),children:pe})]})})});$.classes=Q,$.varsResolver=Rn,$.Wrapper=In,$.Label=kn,$.Error=En,$.Success=Mn,$.Description=wn,$.Placeholder=An,$.ClearButton=yn,$.displayName=`@mantine/core/Input`;function zn(e,t,n){let r=K([`Input`,`InputWrapper`,e],t,n),{label:i,description:a,error:o,success:s,required:c,classNames:l,styles:u,className:d,unstyled:f,__staticSelector:p,__stylesApiProps:m,errorProps:h,successProps:g,labelProps:_,descriptionProps:v,wrapperProps:y,id:b,size:x,style:S,inputContainer:C,inputWrapperOrder:w,withAsterisk:T,variant:E,vars:ee,mod:te,attributes:ne,...re}=r,{styleProps:ie,rest:D}=st(re),O={label:i,description:a,error:o,success:s,required:c,classNames:l,className:d,__staticSelector:p,__stylesApiProps:m||r,errorProps:h,successProps:g,labelProps:_,descriptionProps:v,unstyled:f,styles:u,size:x,style:S,inputContainer:C,inputWrapperOrder:w,withAsterisk:T,variant:E,id:b,mod:te,attributes:ne,...y};return{...D,classNames:l,styles:u,unstyled:f,wrapperProps:{...O,...ie},inputProps:{required:c,classNames:l,styles:u,unstyled:f,size:x,__staticSelector:p,__stylesApiProps:m||r,error:o,success:s,variant:E,id:b,attributes:ne}}}var Bn={__staticSelector:`InputBase`,withAria:!0,size:`sm`},Vn=Y(e=>{let{inputProps:t,wrapperProps:n,...r}=zn(`InputBase`,Bn,e);return(0,s.jsx)($.Wrapper,{...n,children:(0,s.jsx)($,{...t,...r})})});Vn.classes={...$.classes,...$.Wrapper.classes},Vn.displayName=`@mantine/core/InputBase`;var Hn={root:`m_66836ed3`,wrapper:`m_a5d60502`,body:`m_667c2793`,title:`m_6a03f287`,label:`m_698f4f23`,icon:`m_667f2a6a`,message:`m_7fa78076`,closeButton:`m_87f54839`},Un=j((e,{radius:t,color:n,variant:r,autoContrast:i})=>{let a=e.variantColorResolver({color:n||e.primaryColor,theme:e,variant:r||`light`,autoContrast:i});return{root:{"--alert-radius":t===void 0?void 0:x(t),"--alert-bg":n||r?a.background:void 0,"--alert-color":a.color,"--alert-bd":n||r?a.border:void 0}}}),Wn=J(e=>{let t=K(`Alert`,null,e),{classNames:n,className:r,style:i,styles:a,unstyled:o,vars:c,radius:l,color:u,title:d,children:f,id:p,icon:m,withCloseButton:h,onClose:g,closeButtonLabel:_,variant:v,autoContrast:y,role:b,attributes:x,...S}=t,C=q({name:`Alert`,classes:Hn,props:t,className:r,style:i,classNames:n,styles:a,unstyled:o,attributes:x,vars:c,varsResolver:Un}),w=ie(p),T=d&&`${w}-title`||void 0,E=`${w}-body`;return(0,s.jsx)(X,{id:w,...C(`root`,{variant:v}),variant:v,...S,role:b||`alert`,"aria-describedby":f?E:void 0,"aria-labelledby":d?T:void 0,children:(0,s.jsxs)(`div`,{...C(`wrapper`),children:[m&&(0,s.jsx)(`div`,{...C(`icon`),children:m}),(0,s.jsxs)(`div`,{...C(`body`),children:[d&&(0,s.jsx)(`div`,{...C(`title`),"data-with-close-button":h||void 0,children:(0,s.jsx)(`span`,{id:T,...C(`label`),children:d})}),f&&(0,s.jsx)(`div`,{id:E,...C(`message`),"data-variant":v,children:f})]}),h&&(0,s.jsx)(fn,{...C(`closeButton`),onClick:g,variant:`transparent`,size:16,iconSize:16,"aria-label":_,unstyled:o})]})})});Wn.classes=Hn,Wn.varsResolver=Un,Wn.displayName=`@mantine/core/Alert`;var Gn={root:`m_b6d8b162`};function Kn(e){if(e===`start`)return`start`;if(e===`end`||e)return`end`}var qn={inherit:!1},Jn=j((e,{variant:t,lineClamp:n,gradient:r,size:i,textWrap:a})=>({root:{"--text-fz":S(i),"--text-lh":C(i),"--text-gradient":t===`gradient`?me(r,e):void 0,"--text-line-clamp":typeof n==`number`?n.toString():void 0,"--text-text-wrap":a}})),Yn=Y(e=>{let t=K(`Text`,qn,e),{lineClamp:n,truncate:r,inline:i,inherit:a,gradient:o,span:c,textWrap:l,__staticSelector:u,vars:d,className:f,style:p,classNames:m,styles:h,unstyled:g,variant:_,mod:v,size:y,attributes:b,...x}=t,S=q({name:[`Text`,u],props:t,classes:Gn,className:f,style:p,classNames:m,styles:h,unstyled:g,attributes:b,vars:d,varsResolver:Jn});return(0,s.jsx)(X,{...S(`root`,{focusable:!0}),component:c?`span`:`p`,variant:_,mod:[{truncate:Kn(r),lineClamp:typeof n==`number`,inline:i,inherit:a},v],size:y,...x})});Yn.classes=Gn,Yn.varsResolver=Jn,Yn.displayName=`@mantine/core/Text`;var Xn={root:`m_77c9d27d`,inner:`m_80f1301b`,label:`m_811560b9`,section:`m_a74036a`,loader:`m_a25b86ee`,group:`m_80d6d844`,groupSection:`m_70be2a01`},Zn={orientation:`horizontal`},Qn=j((e,{borderWidth:t})=>({group:{"--button-border-width":m(t)}})),$n=J(e=>{let t=K(`ButtonGroup`,Zn,e),{className:n,style:r,classNames:i,styles:a,unstyled:o,orientation:c,vars:l,borderWidth:u,mod:d,attributes:f,...p}=K(`ButtonGroup`,Zn,e),m=q({name:`ButtonGroup`,props:t,classes:Xn,className:n,style:r,classNames:i,styles:a,unstyled:o,attributes:f,vars:l,varsResolver:Qn,rootSelector:`group`});return(0,s.jsx)(X,{...m(`group`),mod:[{orientation:c},d],role:`group`,...p})});$n.classes=Xn,$n.varsResolver=Qn,$n.displayName=`@mantine/core/ButtonGroup`;var er=j((e,{radius:t,color:n,gradient:r,variant:i,autoContrast:a,size:o})=>{let s=e.variantColorResolver({color:n||e.primaryColor,theme:e,gradient:r,variant:i||`filled`,autoContrast:a});return{groupSection:{"--section-height":y(o,`section-height`),"--section-padding-x":y(o,`section-padding-x`),"--section-fz":o?.includes(`compact`)?S(o.replace(`compact-`,``)):S(o),"--section-radius":t===void 0?void 0:x(t),"--section-bg":n||i?s.background:void 0,"--section-color":s.color,"--section-bd":n||i?s.border:void 0}}}),tr=J(e=>{let t=K(`ButtonGroupSection`,null,e),{className:n,style:r,classNames:i,styles:a,unstyled:o,vars:c,gradient:l,radius:u,autoContrast:d,attributes:f,...p}=t,m=q({name:`ButtonGroupSection`,props:t,classes:Xn,className:n,style:r,classNames:i,styles:a,unstyled:o,attributes:f,vars:c,varsResolver:er,rootSelector:`groupSection`});return(0,s.jsx)(X,{...m(`groupSection`),...p})});tr.classes=Xn,tr.varsResolver=er,tr.displayName=`@mantine/core/ButtonGroupSection`;var nr={in:{opacity:1,transform:`translate(-50%, calc(-50% + ${m(1)}))`},out:{opacity:0,transform:`translate(-50%, -200%)`},common:{transformOrigin:`center`},transitionProperty:`transform, opacity`},rr=j((e,{radius:t,color:n,gradient:r,variant:i,size:a,justify:o,autoContrast:s})=>{let c=e.variantColorResolver({color:n||e.primaryColor,theme:e,gradient:r,variant:i||`filled`,autoContrast:s});return{root:{"--button-justify":o,"--button-height":y(a,`button-height`),"--button-padding-x":y(a,`button-padding-x`),"--button-fz":a?.includes(`compact`)?S(a.replace(`compact-`,``)):S(a),"--button-radius":t===void 0?void 0:x(t),"--button-bg":n||i?c.background:void 0,"--button-hover":n||i?c.hover:void 0,"--button-color":c.color,"--button-bd":n||i?c.border:void 0,"--button-hover-color":n||i?c.hoverColor:void 0}}}),ir=Y(e=>{let t=K(`Button`,null,e),{style:n,vars:r,className:i,color:a,disabled:o,children:c,leftSection:l,rightSection:u,fullWidth:d,variant:f,radius:p,loading:m,loaderProps:h,gradient:g,classNames:_,styles:v,unstyled:y,"data-disabled":b,autoContrast:x,mod:S,attributes:C,...w}=t,T=q({name:`Button`,props:t,classes:Xn,className:i,style:n,classNames:_,styles:v,unstyled:y,attributes:C,vars:r,varsResolver:rr}),E=!!l,ee=!!u;return(0,s.jsxs)(Ut,{...T(`root`,{active:!o&&!m&&!b}),unstyled:y,variant:f,disabled:o||m,mod:[{disabled:o||b,loading:m,block:d,"with-left-section":E,"with-right-section":ee},S],...w,children:[typeof m==`boolean`&&(0,s.jsx)($t,{mounted:m,transition:nr,duration:150,children:e=>(0,s.jsx)(X,{component:`span`,...T(`loader`,{style:e}),"aria-hidden":!0,children:(0,s.jsx)(sn,{color:`var(--button-color)`,size:`calc(var(--button-height) / 1.8)`,...h})})}),(0,s.jsxs)(`span`,{...T(`inner`),children:[l&&(0,s.jsx)(X,{component:`span`,...T(`section`),mod:{position:`left`},children:l}),(0,s.jsx)(X,{component:`span`,mod:{loading:m},...T(`label`),children:c}),u&&(0,s.jsx)(X,{component:`span`,...T(`section`),mod:{position:`right`},children:u})]})]})});ir.classes=Xn,ir.varsResolver=rr,ir.displayName=`@mantine/core/Button`,ir.Group=$n,ir.GroupSection=tr;var ar={root:`m_4451eb3a`},or=Y(e=>{let t=K(`Center`,null,e),{classNames:n,className:r,style:i,styles:a,unstyled:o,vars:c,inline:l,mod:u,attributes:d,...f}=t,p=q({name:`Center`,props:t,classes:ar,className:r,style:i,classNames:n,styles:a,unstyled:o,attributes:d,vars:c});return(0,s.jsx)(X,{mod:[{inline:l},u],...p(`root`),...f})});or.classes=ar,or.displayName=`@mantine/core/Center`;var sr={root:`m_7485cace`},cr={strategy:`block`},lr=j((e,{size:t,fluid:n})=>({root:{"--container-size":n?void 0:y(t,`container-size`)}})),ur=J(e=>{let t=K(`Container`,cr,e),{classNames:n,className:r,style:i,styles:a,unstyled:o,vars:c,fluid:l,mod:u,attributes:d,strategy:f,...p}=t,m=q({name:`Container`,classes:sr,props:t,className:r,style:i,classNames:n,styles:a,unstyled:o,attributes:d,vars:c,varsResolver:lr});return(0,s.jsx)(X,{mod:[{fluid:l,strategy:f},u],...m(`root`),...p})});ur.classes=sr,ur.varsResolver=lr,ur.displayName=`@mantine/core/Container`;var dr={root:`m_6d731127`},fr={gap:`md`,align:`stretch`,justify:`flex-start`},pr=j((e,{gap:t,align:n,justify:r})=>({root:{"--stack-gap":b(t),"--stack-align":n,"--stack-justify":r}})),mr=J(e=>{let t=K(`Stack`,fr,e),{classNames:n,className:r,style:i,styles:a,unstyled:o,vars:c,align:l,justify:u,gap:d,variant:f,attributes:p,...m}=t,h=q({name:`Stack`,props:t,classes:dr,className:r,style:i,classNames:n,styles:a,unstyled:o,attributes:p,vars:c,varsResolver:pr});return(0,s.jsx)(X,{...h(`root`),variant:f,...m})});mr.classes=dr,mr.varsResolver=pr,mr.displayName=`@mantine/core/Stack`;var hr={root:`m_7341320d`},gr=j((e,{size:t,radius:n,variant:r,gradient:i,color:a,autoContrast:o})=>{let s=e.variantColorResolver({color:a||e.primaryColor,theme:e,gradient:i,variant:r||`filled`,autoContrast:o});return{root:{"--ti-size":y(t,`ti-size`),"--ti-radius":n===void 0?void 0:x(n),"--ti-bg":a||r?s.background:void 0,"--ti-color":a||r?s.color:void 0,"--ti-bd":a||r?s.border:void 0}}}),_r=J(e=>{let t=K(`ThemeIcon`,null,e),{classNames:n,className:r,style:i,styles:a,unstyled:o,vars:c,autoContrast:l,attributes:u,...d}=t,f=q({name:`ThemeIcon`,classes:hr,props:t,className:r,style:i,classNames:n,styles:a,unstyled:o,attributes:u,vars:c,varsResolver:gr});return(0,s.jsx)(X,{...f(`root`),...d})});_r.classes=hr,_r.varsResolver=gr,_r.displayName=`@mantine/core/ThemeIcon`;var vr=[`h1`,`h2`,`h3`,`h4`,`h5`,`h6`],yr=[`xs`,`sm`,`md`,`lg`,`xl`];function br(e,t){let n=t===void 0?`h${e}`:t;return vr.includes(n)?{fontSize:`var(--mantine-${n}-font-size)`,fontWeight:`var(--mantine-${n}-font-weight)`,lineHeight:`var(--mantine-${n}-line-height)`}:yr.includes(n)?{fontSize:`var(--mantine-font-size-${n})`,fontWeight:`var(--mantine-h${e}-font-weight)`,lineHeight:`var(--mantine-h${e}-line-height)`}:{fontSize:m(n),fontWeight:`var(--mantine-h${e}-font-weight)`,lineHeight:`var(--mantine-h${e}-line-height)`}}var xr={root:`m_8a5d1357`},Sr={order:1},Cr=j((e,{order:t,size:n,lineClamp:r,textWrap:i})=>{let a=br(t||1,n);return{root:{"--title-fw":a.fontWeight,"--title-lh":a.lineHeight,"--title-fz":a.fontSize,"--title-line-clamp":typeof r==`number`?r.toString():void 0,"--title-text-wrap":i}}}),wr=J(e=>{let t=K(`Title`,Sr,e),{classNames:n,className:r,style:i,styles:a,unstyled:o,order:c,vars:l,size:u,variant:d,lineClamp:f,textWrap:p,mod:m,attributes:h,...g}=t,_=q({name:`Title`,props:t,classes:xr,className:r,style:i,classNames:n,styles:a,unstyled:o,attributes:h,vars:l,varsResolver:Cr});return[1,2,3,4,5,6].includes(c)?(0,s.jsx)(X,{..._(`root`),component:`h${c}`,variant:d,mod:[{order:c,lineClamp:typeof f==`number`},m],size:u,...g}):null});wr.classes=xr,wr.varsResolver=Cr,wr.displayName=`@mantine/core/Title`;var Tr=new Map([[`bold`,o.createElement(o.Fragment,null,o.createElement(`path`,{d:`M232.49,80.49l-128,128a12,12,0,0,1-17,0l-56-56a12,12,0,1,1,17-17L96,183,215.51,63.51a12,12,0,0,1,17,17Z`}))],[`duotone`,o.createElement(o.Fragment,null,o.createElement(`path`,{d:`M232,56V200a16,16,0,0,1-16,16H40a16,16,0,0,1-16-16V56A16,16,0,0,1,40,40H216A16,16,0,0,1,232,56Z`,opacity:`0.2`}),o.createElement(`path`,{d:`M205.66,85.66l-96,96a8,8,0,0,1-11.32,0l-40-40a8,8,0,0,1,11.32-11.32L104,164.69l90.34-90.35a8,8,0,0,1,11.32,11.32Z`}))],[`fill`,o.createElement(o.Fragment,null,o.createElement(`path`,{d:`M216,40H40A16,16,0,0,0,24,56V200a16,16,0,0,0,16,16H216a16,16,0,0,0,16-16V56A16,16,0,0,0,216,40ZM205.66,85.66l-96,96a8,8,0,0,1-11.32,0l-40-40a8,8,0,0,1,11.32-11.32L104,164.69l90.34-90.35a8,8,0,0,1,11.32,11.32Z`}))],[`light`,o.createElement(o.Fragment,null,o.createElement(`path`,{d:`M228.24,76.24l-128,128a6,6,0,0,1-8.48,0l-56-56a6,6,0,0,1,8.48-8.48L96,191.51,219.76,67.76a6,6,0,0,1,8.48,8.48Z`}))],[`regular`,o.createElement(o.Fragment,null,o.createElement(`path`,{d:`M229.66,77.66l-128,128a8,8,0,0,1-11.32,0l-56-56a8,8,0,0,1,11.32-11.32L96,188.69,218.34,66.34a8,8,0,0,1,11.32,11.32Z`}))],[`thin`,o.createElement(o.Fragment,null,o.createElement(`path`,{d:`M226.83,74.83l-128,128a4,4,0,0,1-5.66,0l-56-56a4,4,0,0,1,5.66-5.66L96,194.34,221.17,69.17a4,4,0,1,1,5.66,5.66Z`}))]]),Er=new Map([[`bold`,o.createElement(o.Fragment,null,o.createElement(`path`,{d:`M216,28H88A12,12,0,0,0,76,40V76H40A12,12,0,0,0,28,88V216a12,12,0,0,0,12,12H168a12,12,0,0,0,12-12V180h36a12,12,0,0,0,12-12V40A12,12,0,0,0,216,28ZM156,204H52V100H156Zm48-48H180V88a12,12,0,0,0-12-12H100V52H204Z`}))],[`duotone`,o.createElement(o.Fragment,null,o.createElement(`path`,{d:`M216,40V168H168V88H88V40Z`,opacity:`0.2`}),o.createElement(`path`,{d:`M216,32H88a8,8,0,0,0-8,8V80H40a8,8,0,0,0-8,8V216a8,8,0,0,0,8,8H168a8,8,0,0,0,8-8V176h40a8,8,0,0,0,8-8V40A8,8,0,0,0,216,32ZM160,208H48V96H160Zm48-48H176V88a8,8,0,0,0-8-8H96V48H208Z`}))],[`fill`,o.createElement(o.Fragment,null,o.createElement(`path`,{d:`M216,32H88a8,8,0,0,0-8,8V80H40a8,8,0,0,0-8,8V216a8,8,0,0,0,8,8H168a8,8,0,0,0,8-8V176h40a8,8,0,0,0,8-8V40A8,8,0,0,0,216,32Zm-8,128H176V88a8,8,0,0,0-8-8H96V48H208Z`}))],[`light`,o.createElement(o.Fragment,null,o.createElement(`path`,{d:`M216,34H88a6,6,0,0,0-6,6V82H40a6,6,0,0,0-6,6V216a6,6,0,0,0,6,6H168a6,6,0,0,0,6-6V174h42a6,6,0,0,0,6-6V40A6,6,0,0,0,216,34ZM162,210H46V94H162Zm48-48H174V88a6,6,0,0,0-6-6H94V46H210Z`}))],[`regular`,o.createElement(o.Fragment,null,o.createElement(`path`,{d:`M216,32H88a8,8,0,0,0-8,8V80H40a8,8,0,0,0-8,8V216a8,8,0,0,0,8,8H168a8,8,0,0,0,8-8V176h40a8,8,0,0,0,8-8V40A8,8,0,0,0,216,32ZM160,208H48V96H160Zm48-48H176V88a8,8,0,0,0-8-8H96V48H208Z`}))],[`thin`,o.createElement(o.Fragment,null,o.createElement(`path`,{d:`M216,36H88a4,4,0,0,0-4,4V84H40a4,4,0,0,0-4,4V216a4,4,0,0,0,4,4H168a4,4,0,0,0,4-4V172h44a4,4,0,0,0,4-4V40A4,4,0,0,0,216,36ZM164,212H44V92H164Zm48-48H172V88a4,4,0,0,0-4-4H92V44H212Z`}))]]),Dr=(0,o.createContext)({color:`currentColor`,size:`1em`,weight:`regular`,mirrored:!1}),Or=o.forwardRef((e,t)=>{let{alt:n,color:r,size:i,weight:a,mirrored:s,children:c,weights:l,...u}=e,{color:d=`currentColor`,size:f,weight:p=`regular`,mirrored:m=!1,...h}=o.useContext(Dr);return o.createElement(`svg`,{ref:t,xmlns:`http://www.w3.org/2000/svg`,width:i??f,height:i??f,fill:r??d,viewBox:`0 0 256 256`,transform:s||m?`scale(-1, 1)`:void 0,...h,...u},!!n&&o.createElement(`title`,null,n),c,l.get(a??p))});Or.displayName=`IconBase`;var kr=o.forwardRef((e,t)=>o.createElement(Or,{ref:t,...e,weights:Tr}));kr.displayName=`CheckIcon`;var Ar=kr,jr=o.forwardRef((e,t)=>o.createElement(Or,{ref:t,...e,weights:Er}));jr.displayName=`CopyIcon`;var Mr=jr,Nr={small:{fontSize:15,gap:12,tracking:`0.16em`},regular:{fontSize:18,gap:14,tracking:`0.17em`},large:{fontSize:22,gap:16,tracking:`0.18em`}};function Pr({size:e=`regular`}){let t=Nr[e];return(0,s.jsxs)(_n,{component:`span`,gap:t.gap,wrap:`nowrap`,"aria-label":`Fanout`,children:[(0,s.jsx)(Fr,{size:e}),(0,s.jsx)(Yn,{component:`span`,fz:t.fontSize,fw:800,lh:1,lts:t.tracking,tt:`uppercase`,children:`Fanout`})]})}function Fr({size:e=`regular`}){let t={small:32,regular:46,large:50}[e];return(0,s.jsx)(_r,{size:t,variant:`transparent`,"aria-hidden":`true`,children:(0,s.jsx)(Ir,{})})}function Ir(){let e=(0,o.useId)().replace(/[^a-zA-Z0-9-]/g,``),t=`fo-top-${e}`,n=`fo-mid-${e}`,r=`fo-bot-${e}`;return(0,s.jsxs)(`svg`,{viewBox:`35 44 200 200`,width:`100%`,height:`100%`,"aria-hidden":`true`,children:[(0,s.jsxs)(`defs`,{children:[(0,s.jsxs)(`linearGradient`,{id:t,x1:`54`,y1:`52`,x2:`210`,y2:`104`,gradientUnits:`userSpaceOnUse`,children:[(0,s.jsx)(`stop`,{offset:`0`,stopColor:`#5FE8CE`}),(0,s.jsx)(`stop`,{offset:`0.55`,stopColor:`#81E4B9`}),(0,s.jsx)(`stop`,{offset:`1`,stopColor:`#D9F276`})]}),(0,s.jsxs)(`linearGradient`,{id:n,x1:`58`,y1:`112`,x2:`176`,y2:`154`,gradientUnits:`userSpaceOnUse`,children:[(0,s.jsx)(`stop`,{offset:`0`,stopColor:`#536FFF`}),(0,s.jsx)(`stop`,{offset:`0.52`,stopColor:`#41B6F8`}),(0,s.jsx)(`stop`,{offset:`1`,stopColor:`#66D0EE`})]}),(0,s.jsxs)(`linearGradient`,{id:r,x1:`58`,y1:`166`,x2:`145`,y2:`220`,gradientUnits:`userSpaceOnUse`,children:[(0,s.jsx)(`stop`,{offset:`0`,stopColor:`#725BFF`}),(0,s.jsx)(`stop`,{offset:`0.52`,stopColor:`#9A50F4`}),(0,s.jsx)(`stop`,{offset:`1`,stopColor:`#CB55E8`})]})]}),(0,s.jsx)(`path`,{d:`M58 116V88C58 67 75 52 96 52H191C204 52 212 61 212 72C212 84 203 94 191 94H101C82 94 67 102 58 116Z`,fill:`url(#${t})`}),(0,s.jsx)(`path`,{d:`M58 170V139C58 120 72 107 91 107H162C174 107 182 115 182 126C182 137 174 145 162 145H99C79 145 66 154 58 170Z`,fill:`url(#${n})`}),(0,s.jsx)(`path`,{d:`M58 219V188C58 170 71 157 89 157H126C138 157 146 165 146 176C146 187 138 195 126 195H100C89 195 84 200 84 211C84 225 74 235 61 235H58Z`,fill:`url(#${r})`})]})}export{D as $,q as A,be as B,X as C,At as D,Pt as E,ke as F,pe as G,he as H,_e as I,I as J,H as K,G as L,K as M,Re as N,st as O,Le as P,A as Q,ve as R,Ut as S,J as T,W as U,ge as V,U as W,j as X,M as Y,ae as Z,_n as _,a as _t,Or as a,ee as at,$t as b,mr as c,w as ct,ir as d,v as dt,O as et,Yn as f,g as ft,Sn as g,c as gt,$ as h,u as ht,Ar as i,te as it,ze as j,it as k,ur as l,y as lt,Vn as m,m as mt,Fr as n,ie as nt,wr as o,S as ot,Wn as p,h as pt,V as q,Mr as r,re as rt,_r as s,x as st,Pr as t,k as tt,or as u,b as ut,fn as v,Y as w,Kt as x,sn as y,Te as z}; \ No newline at end of file +import{a as e,i as t,r as n,s as r}from"./useRouter-ByJ6_rwb.js";var i=e((e=>{var n=t();function r(e){var t=`https://react.dev/errors/`+e;if(1{function n(){if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<`u`&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE==`function`)try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(n)}catch(e){console.error(e)}}n(),t.exports=i()})),o=r(t(),1),s=n();function c(e){return Object.keys(e)}function l(e){return e&&typeof e==`object`&&!Array.isArray(e)}function u(e,t){let n={...e},r=t;return l(e)&&l(t)&&Object.keys(t).forEach(t=>{l(r[t])&&t in e?n[t]=u(n[t],r[t]):n[t]=r[t]}),n}function d(e){return e.replace(/[A-Z]/g,e=>`-${e.toLowerCase()}`)}function f(e){return e===`0rem`?`0rem`:`calc(${e} * var(--mantine-scale))`}function p(e,{shouldScale:t=!1}={}){function n(r){if(r===0||r===`0`)return`0${e}`;if(typeof r==`number`){let n=`${r/16}${e}`;return t?f(n):n}if(typeof r==`string`){if(r===``||r.startsWith(`calc(`)||r.startsWith(`clamp(`)||r.includes(`rgba(`))return r;if(r.includes(`,`))return r.split(`,`).map(e=>n(e)).join(`,`);if(r.includes(` `))return r.split(` `).map(e=>n(e)).join(` `);let i=r.replace(`px`,``);if(!Number.isNaN(Number(i))){let n=`${Number(i)/16}${e}`;return t?f(n):n}}return r}return n}var m=p(`rem`,{shouldScale:!0}),h=p(`em`);function g(e){return Object.keys(e).reduce((t,n)=>(e[n]!==void 0&&(t[n]=e[n]),t),{})}function _(e){if(typeof e==`number`)return!0;if(typeof e==`string`){if(e.startsWith(`calc(`)||e.startsWith(`var(`)||e.includes(` `)&&e.trim()!==``)return!0;let t=/^[+-]?[0-9]+(\.[0-9]+)?(px|em|rem|ex|ch|lh|rlh|vw|vh|vmin|vmax|vb|vi|svw|svh|lvw|lvh|dvw|dvh|cm|mm|in|pt|pc|q|cqw|cqh|cqi|cqb|cqmin|cqmax|%)?$/;return e.trim().split(/\s+/).every(e=>t.test(e))}return!1}function v(e){return Array.isArray(e)||e===null?!1:typeof e==`object`&&e.type!==o.Fragment}function y(e,t=`size`,n=!0){if(e!==void 0)return _(e)?n?m(e):e:`var(--${t}-${e})`}function b(e){return y(e,`mantine-spacing`)}function x(e){return e===void 0?`var(--mantine-radius-default)`:y(e,`mantine-radius`)}function S(e){return y(e,`mantine-font-size`)}function C(e){return y(e,`mantine-line-height`,!1)}function w(e){if(e)return y(e,`mantine-shadow`,!1)}function T(e=`mantine-`){return`${e}${Math.random().toString(36).slice(2,11)}`}function E(e,t){if(typeof t==`boolean`)return t;if(typeof window<`u`&&`matchMedia`in window)try{return window.matchMedia(e).matches}catch{return!1}return!1}function ee(e,t,{getInitialValueInEffect:n}={getInitialValueInEffect:!0}){let[r,i]=(0,o.useState)(n?t:E(e));return(0,o.useEffect)(()=>{try{if(`matchMedia`in window){let t=window.matchMedia(e);i(t.matches);let n=e=>i(e.matches);return t.addEventListener(`change`,n),()=>{t.removeEventListener(`change`,n)}}}catch{return}},[e]),r||!1}var te=typeof document<`u`?o.useLayoutEffect:o.useEffect;function ne(e,t){return e.length!==t.length||t.some((t,n)=>!Object.is(t,e[n]))}function re(e,t){let n=(0,o.useRef)(!1),r=(0,o.useRef)(null),i=(0,o.useRef)(void 0),a={};(0,o.useEffect)(()=>{let o=r.current===a,s=i.current;if(r.current=a,i.current=t,!n.current){n.current=!0;return}if(!o&&!(t&&s&&!ne(s,t)))return e()},t)}function ie(e){let t=(0,o.useId)(),[n,r]=(0,o.useState)(`mantine-${t.replace(/:/g,``)}`),i=(0,o.useRef)(!1);return te(()=>{i.current||(i.current=!0,r(T()))},[]),typeof e==`string`?e:n}function D(e,t){if(typeof e==`function`)return e(t);typeof e==`object`&&e&&`current`in e&&(e.current=t)}function O(...e){let t=new Map;return n=>{if(e.forEach(e=>{let r=D(e,n);r&&t.set(e,r)}),t.size>0)return()=>{e.forEach(e=>{let n=t.get(e);n&&typeof n==`function`?n():D(e,null)}),t.clear()}}}function k(...e){return(0,o.useCallback)(O(...e),e)}function A(e,t){return ee(`(prefers-reduced-motion: reduce)`,e,t)}function ae(e){let t=o.Children.toArray(e);return t.length!==1||!v(t[0])?null:t[0]}function j(e){return e}function oe(e){var t,n,r=``;if(typeof e==`string`||typeof e==`number`)r+=e;else if(typeof e==`object`){if(Array.isArray(e)){var i=e.length;for(t=0;t{Object.entries(e).forEach(([e,n])=>{t[e]?t[e]=M(t[e],n):t[e]=n})}),t}function P({theme:e,classNames:t,props:n,stylesCtx:r}){return N((Array.isArray(t)?t:[t]).map(t=>typeof t==`function`?t(e,n,r):t||se))}function F({theme:e,styles:t,props:n,stylesCtx:r}){let i=Array.isArray(t)?t:[t],a={};for(let t of i)typeof t==`function`?Object.assign(a,t(e,n,r)):t&&Object.assign(a,t);return a}function I(e,t){return typeof e.primaryShade==`number`?e.primaryShade:t===`dark`?e.primaryShade.dark:e.primaryShade.light}function ce(e){return/^#?([0-9A-F]{3}){1,2}([0-9A-F]{2})?$/i.test(e)}function le(e){let t=e.replace(`#`,``);if(t.length===3){let e=t.split(``);t=[e[0],e[0],e[1],e[1],e[2],e[2]].join(``)}if(t.length===8){let e=parseInt(t.slice(6,8),16)/255;return{r:parseInt(t.slice(0,2),16),g:parseInt(t.slice(2,4),16),b:parseInt(t.slice(4,6),16),a:e}}let n=parseInt(t,16);return{r:n>>16&255,g:n>>8&255,b:n&255,a:1}}function ue(e){let[t,n,r,i]=e.replace(/[^0-9,./]/g,``).split(/[/,]/).map(Number);return{r:t,g:n,b:r,a:i===void 0?1:i}}function de(e){let t=e.match(/^hsla?\(\s*(\d+)\s*,\s*(\d+%)\s*,\s*(\d+%)\s*(,\s*(0?\.\d+|\d+(\.\d+)?))?\s*\)$/i);if(!t)return{r:0,g:0,b:0,a:1};let n=parseInt(t[1],10),r=parseInt(t[2],10)/100,i=parseInt(t[3],10)/100,a=t[5]?parseFloat(t[5]):void 0,o=(1-Math.abs(2*i-1))*r,s=n/60,c=o*(1-Math.abs(s%2-1)),l=i-o/2,u,d,f;return s>=0&&s<1?(u=o,d=c,f=0):s>=1&&s<2?(u=c,d=o,f=0):s>=2&&s<3?(u=0,d=o,f=c):s>=3&&s<4?(u=0,d=c,f=o):s>=4&&s<5?(u=c,d=0,f=o):(u=o,d=0,f=c),{r:Math.round((u+l)*255),g:Math.round((d+l)*255),b:Math.round((f+l)*255),a:a||1}}function L(e){return ce(e)?le(e):e.startsWith(`rgb`)?ue(e):e.startsWith(`hsl`)?de(e):{r:0,g:0,b:0,a:1}}function R(e){return e<=.03928?e/12.92:((e+.055)/1.055)**2.4}function fe(e){let t=e.match(/oklch\((.*?)%\s/);return t?parseFloat(t[1]):null}function z(e){if(e.startsWith(`oklch(`))return(fe(e)||0)/100;let{r:t,g:n,b:r}=L(e),i=t/255,a=n/255,o=r/255,s=R(i),c=R(a),l=R(o);return .2126*s+.7152*c+.0722*l}function B(e,t=.179){return!e.startsWith(`var(`)&&z(e)>t}function V({color:e,theme:t,colorScheme:n}){if(typeof e!=`string`)throw Error(`[@mantine/core] Failed to parse color. Expected color to be a string, instead got ${typeof e}`);if(e===`bright`)return{color:e,value:n===`dark`?t.white:t.black,shade:void 0,isThemeColor:!1,isLight:B(n===`dark`?t.white:t.black,t.luminanceThreshold),variable:`--mantine-color-bright`};if(e===`dimmed`)return{color:e,value:n===`dark`?t.colors.dark[2]:t.colors.gray[7],shade:void 0,isThemeColor:!1,isLight:B(n===`dark`?t.colors.dark[2]:t.colors.gray[6],t.luminanceThreshold),variable:`--mantine-color-dimmed`};if(e===`white`||e===`black`)return{color:e,value:e===`white`?t.white:t.black,shade:void 0,isThemeColor:!1,isLight:B(e===`white`?t.white:t.black,t.luminanceThreshold),variable:`--mantine-color-${e}`};let[r,i]=e.split(`.`),a=i?Number(i):void 0,o=r in t.colors;if(o){let e=a===void 0?t.colors[r][I(t,n||`light`)]:t.colors[r][a];return{color:r,value:e,shade:a,isThemeColor:o,isLight:B(e,t.luminanceThreshold),variable:i?`--mantine-color-${r}-${a}`:`--mantine-color-${r}-filled`}}return{color:e,value:e,isThemeColor:o,isLight:B(e,t.luminanceThreshold),shade:a,variable:void 0}}function H(e,t){let n=V({color:e||t.primaryColor,theme:t});return n.variable?`var(${n.variable})`:e}function pe(e){return!!e&&typeof e==`object`&&`mantine-virtual-color`in e}function U(e,t){if(e.startsWith(`var(`))return`color-mix(in srgb, ${e}, black ${t*100}%)`;let{r:n,g:r,b:i,a}=L(e),o=1-t,s=e=>Math.round(e*o);return`rgba(${s(n)}, ${s(r)}, ${s(i)}, ${a})`}function me(e,t){let n={from:e?.from||t.defaultGradient.from,to:e?.to||t.defaultGradient.to,deg:e?.deg??t.defaultGradient.deg??0},r=H(n.from,t),i=H(n.to,t);return`linear-gradient(${n.deg}deg, ${r} 0%, ${i} 100%)`}function W(e,t){if(typeof e!=`string`||t>1||t<0)return`rgba(0, 0, 0, 1)`;if(e.startsWith(`var(`))return`color-mix(in srgb, ${e}, transparent ${(1-t)*100}%)`;if(e.startsWith(`oklch`))return e.includes(`/`)?e.replace(/\/\s*[\d.]+\s*\)/,`/ ${t})`):e.replace(`)`,` / ${t})`);let{r:n,g:r,b:i}=L(e);return`rgba(${n}, ${r}, ${i}, ${t})`}var he=W,ge=({color:e,theme:t,variant:n,gradient:r,autoContrast:i})=>{let a=V({color:e,theme:t}),o=typeof i==`boolean`?i:t.autoContrast;if(n===`none`)return{background:`transparent`,hover:`transparent`,color:`inherit`,border:`none`};if(n===`filled`){let n=a.isThemeColor&&a.shade===void 0&&pe(t.colors[a.color]),r=o?n?`var(--mantine-color-${a.color}-contrast)`:a.isLight?`var(--mantine-color-black)`:`var(--mantine-color-white)`:`var(--mantine-color-white)`;return a.isThemeColor?a.shade===void 0?{background:`var(--mantine-color-${e}-filled)`,hover:`var(--mantine-color-${e}-filled-hover)`,color:r,border:`${m(1)} solid transparent`}:{background:`var(--mantine-color-${a.color}-${a.shade})`,hover:`var(--mantine-color-${a.color}-${a.shade===9?8:a.shade+1})`,color:r,border:`${m(1)} solid transparent`}:{background:e,hover:U(e,.1),color:r,border:`${m(1)} solid transparent`}}if(n===`light`){if(a.isThemeColor){if(a.shade===void 0)return{background:`var(--mantine-color-${e}-light)`,hover:`var(--mantine-color-${e}-light-hover)`,color:`var(--mantine-color-${e}-light-color)`,border:`${m(1)} solid transparent`};let n=t.colors[a.color][a.shade];return{background:n,hover:U(n,.1),color:`var(--mantine-color-${a.color}-light-color)`,border:`${m(1)} solid transparent`}}return{background:W(e,.1),hover:W(e,.12),color:e,border:`${m(1)} solid transparent`}}if(n===`outline`)return a.isThemeColor?a.shade===void 0?{background:`transparent`,hover:`var(--mantine-color-${e}-outline-hover)`,color:`var(--mantine-color-${e}-outline)`,border:`${m(1)} solid var(--mantine-color-${e}-outline)`}:{background:`transparent`,hover:W(t.colors[a.color][a.shade],.05),color:`var(--mantine-color-${a.color}-${a.shade})`,border:`${m(1)} solid var(--mantine-color-${a.color}-${a.shade})`}:{background:`transparent`,hover:W(e,.05),color:e,border:`${m(1)} solid ${e}`};if(n===`subtle`){if(a.isThemeColor){if(a.shade===void 0)return{background:`transparent`,hover:`var(--mantine-color-${e}-light-hover)`,color:`var(--mantine-color-${e}-light-color)`,border:`${m(1)} solid transparent`};let n=t.colors[a.color][a.shade];return{background:`transparent`,hover:W(n,.12),color:`var(--mantine-color-${a.color}-${Math.min(a.shade,6)})`,border:`${m(1)} solid transparent`}}return{background:`transparent`,hover:W(e,.12),color:e,border:`${m(1)} solid transparent`}}return n===`transparent`?a.isThemeColor?a.shade===void 0?{background:`transparent`,hover:`transparent`,color:`var(--mantine-color-${e}-light-color)`,border:`${m(1)} solid transparent`}:{background:`transparent`,hover:`transparent`,color:`var(--mantine-color-${a.color}-${Math.min(a.shade,6)})`,border:`${m(1)} solid transparent`}:{background:`transparent`,hover:`transparent`,color:e,border:`${m(1)} solid transparent`}:n===`white`?a.isThemeColor?a.shade===void 0?{background:`var(--mantine-color-white)`,hover:U(t.white,.01),color:`var(--mantine-color-${e}-filled)`,border:`${m(1)} solid transparent`}:{background:`var(--mantine-color-white)`,hover:U(t.white,.01),color:`var(--mantine-color-${a.color}-${a.shade})`,border:`${m(1)} solid transparent`}:{background:`var(--mantine-color-white)`,hover:U(t.white,.01),color:e,border:`${m(1)} solid transparent`}:n===`gradient`?{background:me(r,t),hover:me(r,t),color:`var(--mantine-color-white)`,border:`none`}:n==="default"?{background:`var(--mantine-color-default)`,hover:`var(--mantine-color-default-hover)`,color:`var(--mantine-color-default-color)`,border:`${m(1)} solid var(--mantine-color-default-border)`}:{}},_e=(0,o.createContext)(null);function G(){let e=(0,o.use)(_e);if(!e)throw Error(`[@mantine/core] MantineProvider was not found in tree`);return e}function ve(){return G().cssVariablesResolver}function ye(){return G().classNamesPrefix}function be(){return G().getStyleNonce}function xe(){return G().withStaticClasses}function Se(){return G().headless}function Ce(){return G().stylesTransform?.sx}function we(){return G().stylesTransform?.styles}function Te(){return G().env||`default`}function Ee(){return G().deduplicateInlineStyles}var De={dark:[`#C9C9C9`,`#b8b8b8`,`#828282`,`#696969`,`#424242`,`#3b3b3b`,`#2e2e2e`,`#242424`,`#1f1f1f`,`#141414`],gray:[`#f8f9fa`,`#f1f3f5`,`#e9ecef`,`#dee2e6`,`#ced4da`,`#adb5bd`,`#868e96`,`#495057`,`#343a40`,`#212529`],red:[`#fff5f5`,`#ffe3e3`,`#ffc9c9`,`#ffa8a8`,`#ff8787`,`#ff6b6b`,`#fa5252`,`#f03e3e`,`#e03131`,`#c92a2a`],pink:[`#fff0f6`,`#ffdeeb`,`#fcc2d7`,`#faa2c1`,`#f783ac`,`#f06595`,`#e64980`,`#d6336c`,`#c2255c`,`#a61e4d`],grape:[`#f8f0fc`,`#f3d9fa`,`#eebefa`,`#e599f7`,`#da77f2`,`#cc5de8`,`#be4bdb`,`#ae3ec9`,`#9c36b5`,`#862e9c`],violet:[`#f3f0ff`,`#e5dbff`,`#d0bfff`,`#b197fc`,`#9775fa`,`#845ef7`,`#7950f2`,`#7048e8`,`#6741d9`,`#5f3dc4`],indigo:[`#edf2ff`,`#dbe4ff`,`#bac8ff`,`#91a7ff`,`#748ffc`,`#5c7cfa`,`#4c6ef5`,`#4263eb`,`#3b5bdb`,`#364fc7`],blue:[`#e7f5ff`,`#d0ebff`,`#a5d8ff`,`#74c0fc`,`#4dabf7`,`#339af0`,`#228be6`,`#1c7ed6`,`#1971c2`,`#1864ab`],cyan:[`#e3fafc`,`#c5f6fa`,`#99e9f2`,`#66d9e8`,`#3bc9db`,`#22b8cf`,`#15aabf`,`#1098ad`,`#0c8599`,`#0b7285`],teal:[`#e6fcf5`,`#c3fae8`,`#96f2d7`,`#63e6be`,`#38d9a9`,`#20c997`,`#12b886`,`#0ca678`,`#099268`,`#087f5b`],green:[`#ebfbee`,`#d3f9d8`,`#b2f2bb`,`#8ce99a`,`#69db7c`,`#51cf66`,`#40c057`,`#37b24d`,`#2f9e44`,`#2b8a3e`],lime:[`#f4fce3`,`#e9fac8`,`#d8f5a2`,`#c0eb75`,`#a9e34b`,`#94d82d`,`#82c91e`,`#74b816`,`#66a80f`,`#5c940d`],yellow:[`#fff9db`,`#fff3bf`,`#ffec99`,`#ffe066`,`#ffd43b`,`#fcc419`,`#fab005`,`#f59f00`,`#f08c00`,`#e67700`],orange:[`#fff4e6`,`#ffe8cc`,`#ffd8a8`,`#ffc078`,`#ffa94d`,`#ff922b`,`#fd7e14`,`#f76707`,`#e8590c`,`#d9480f`]},Oe=`-apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Helvetica, Arial, sans-serif, Apple Color Emoji, Segoe UI Emoji`,ke={scale:1,fontSmoothing:!0,focusRing:`auto`,white:`#fff`,black:`#000`,colors:De,primaryShade:{light:6,dark:8},primaryColor:`blue`,variantColorResolver:ge,autoContrast:!1,luminanceThreshold:.3,fontFamily:Oe,fontFamilyMonospace:`ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, Liberation Mono, Courier New, monospace`,respectReducedMotion:!1,cursorType:`default`,defaultGradient:{from:`blue`,to:`cyan`,deg:45},defaultRadius:`md`,activeClassName:`mantine-active`,focusClassName:``,headings:{fontFamily:Oe,fontWeight:`700`,textWrap:`wrap`,sizes:{h1:{fontSize:m(34),lineHeight:`1.3`},h2:{fontSize:m(26),lineHeight:`1.35`},h3:{fontSize:m(22),lineHeight:`1.4`},h4:{fontSize:m(18),lineHeight:`1.45`},h5:{fontSize:m(16),lineHeight:`1.5`},h6:{fontSize:m(14),lineHeight:`1.5`}}},fontSizes:{xs:m(12),sm:m(14),md:m(16),lg:m(18),xl:m(20)},lineHeights:{xs:`1.4`,sm:`1.45`,md:`1.55`,lg:`1.6`,xl:`1.65`},fontWeights:{regular:`400`,medium:`600`,bold:`700`},radius:{xs:m(2),sm:m(4),md:m(8),lg:m(16),xl:m(32)},spacing:{xs:m(10),sm:m(12),md:m(16),lg:m(20),xl:m(32)},breakpoints:{xs:`36em`,sm:`48em`,md:`62em`,lg:`75em`,xl:`88em`},shadows:{xs:`0 ${m(1)} ${m(3)} rgba(0, 0, 0, 0.05), 0 ${m(1)} ${m(2)} rgba(0, 0, 0, 0.1)`,sm:`0 ${m(1)} ${m(3)} rgba(0, 0, 0, 0.05), rgba(0, 0, 0, 0.05) 0 ${m(10)} ${m(15)} ${m(-5)}, rgba(0, 0, 0, 0.04) 0 ${m(7)} ${m(7)} ${m(-5)}`,md:`0 ${m(1)} ${m(3)} rgba(0, 0, 0, 0.05), rgba(0, 0, 0, 0.05) 0 ${m(20)} ${m(25)} ${m(-5)}, rgba(0, 0, 0, 0.04) 0 ${m(10)} ${m(10)} ${m(-5)}`,lg:`0 ${m(1)} ${m(3)} rgba(0, 0, 0, 0.05), rgba(0, 0, 0, 0.05) 0 ${m(28)} ${m(23)} ${m(-7)}, rgba(0, 0, 0, 0.04) 0 ${m(12)} ${m(12)} ${m(-7)}`,xl:`0 ${m(1)} ${m(3)} rgba(0, 0, 0, 0.05), rgba(0, 0, 0, 0.05) 0 ${m(36)} ${m(28)} ${m(-7)}, rgba(0, 0, 0, 0.04) 0 ${m(17)} ${m(17)} ${m(-7)}`},other:{},components:{}},Ae=`[@mantine/core] MantineProvider: Invalid theme.primaryColor, it accepts only key of theme.colors, learn more – https://mantine.dev/theming/colors/#primary-color`,je=`[@mantine/core] MantineProvider: Invalid theme.primaryShade, it accepts only 0-9 integers or an object { light: 0-9, dark: 0-9 }`;function Me(e){return e<0||e>9?!1:parseInt(e.toString(),10)===e}function Ne(e){if(!(e.primaryColor in e.colors))throw Error(Ae);if(typeof e.primaryShade==`object`&&(!Me(e.primaryShade.dark)||!Me(e.primaryShade.light))||typeof e.primaryShade==`number`&&!Me(e.primaryShade))throw Error(je)}function Pe(e,t){if(!t)return Ne(e),e;let n=u(e,t);return t.fontFamily&&!t.headings?.fontFamily&&(n.headings={...n.headings,fontFamily:t.fontFamily}),Ne(n),n}var Fe=(0,o.createContext)(null),Ie=()=>(0,o.use)(Fe)||ke;function Le(){let e=(0,o.use)(Fe);if(!e)throw Error(`@mantine/core: MantineProvider was not found in component tree, make sure you have it in your app`);return e}function Re({theme:e,children:t,inherit:n=!0}){let r=Ie(),i=(0,o.useMemo)(()=>Pe(n?r:ke,e),[e,r,n]);return(0,s.jsx)(Fe,{value:i,children:t})}Re.displayName=`@mantine/core/MantineThemeProvider`;function K(e,t,n){let r=Le(),i=(Array.isArray(e)?e:[e]).filter(Boolean),a={};for(let e of i){let t=r.components[e]?.defaultProps,n=typeof t==`function`?t(r):t;n&&(a={...a,...n})}return{...t,...a,...g(n)}}function ze({classNames:e,styles:t,props:n,stylesCtx:r}){let i=Le();return{resolvedClassNames:e===void 0?void 0:P({theme:i,classNames:e,props:n,stylesCtx:r||void 0}),resolvedStyles:t===void 0?void 0:F({theme:i,styles:t,props:n,stylesCtx:r||void 0})}}var Be={always:`mantine-focus-always`,auto:`mantine-focus-auto`,never:`mantine-focus-never`};function Ve({theme:e,options:t,unstyled:n}){return M(t?.focusable&&!n&&(e.focusClassName||Be[e.focusRing]),t?.active&&!n&&e.activeClassName)}function He(e,t,n=1){if(Object.is(e,t))return!0;if(n===0||typeof e!=`object`||typeof t!=`object`||e===null||t===null)return!1;if(Array.isArray(e)||Array.isArray(t)){if(!Array.isArray(e)||!Array.isArray(t)||e.length!==t.length)return!1;for(let r=0;r`${t}-${e}-${n}`)}function Je({options:e,classes:t,selector:n,unstyled:r}){return e?.variant&&!r?t[`${n}--${e.variant}`]:void 0}function Ye({theme:e,options:t,themeName:n,selector:r,classNamesPrefix:i,resolvedClassNames:a,resolvedThemeClassNames:o,classes:s,unstyled:c,className:l,rootSelector:u,props:d,stylesCtx:f,withStaticClasses:p,headless:m,transformedStyles:h}){return M(Ve({theme:e,options:t,unstyled:c||m}),o.map(e=>e[r]),Je({options:t,classes:s,selector:r,unstyled:c||m}),a[r],We({selector:r,stylesCtx:f,theme:e,classNames:h,props:d}),Ue({selector:r,stylesCtx:f,options:t,props:d,theme:e}),Ge({rootSelector:u,selector:r,className:l}),Ke({selector:r,classes:s,unstyled:c||m}),p&&!m&&qe({themeName:n,classNamesPrefix:i,selector:r,withStaticClass:t?.withStaticClass}),t?.className)}function Xe({style:e,theme:t}){return Array.isArray(e)?e.reduce((e,n)=>({...e,...Xe({style:n,theme:t})}),{}):typeof e==`function`?e(t):e??{}}function Ze({theme:e,selector:t,options:n,props:r,stylesCtx:i,rootSelector:a,withStylesTransform:o,resolvedStyles:s,resolvedThemeStyles:c,resolvedVars:l,resolvedRootStyle:u}){return{...c[t],...s[t],...!o&&F({theme:e,styles:n?.styles,props:n?.props||r,stylesCtx:i})[t],...l[t],...a===t?u:null,...Xe({style:n?.style,theme:e})}}function Qe(e){return e.reduce((e,t)=>(t&&Object.keys(t).forEach(n=>{e[n]={...e[n],...g(t[n])}}),e),{})}function $e({props:e,stylesCtx:t,themeName:n,theme:r}){let i=we()?.();return{getTransformedStyles:a=>i?[...a.map(n=>i(n,{props:e,theme:r,ctx:t})),...n.map(n=>i(r.components[n]?.styles,{props:e,theme:r,ctx:t}))].filter(Boolean):[],withStylesTransform:!!i}}function q({name:e,classes:t,props:n,stylesCtx:r,className:i,style:a,rootSelector:o=`root`,unstyled:s,classNames:c,styles:l,vars:u,varsResolver:d,attributes:f,stable:p}){let m=Le(),h=ye(),g=xe(),_=Se(),v=(Array.isArray(e)?e:[e]).filter(e=>e),{withStylesTransform:y,getTransformedStyles:b}=$e({props:n,stylesCtx:r,themeName:v,theme:m}),x=P({theme:m,classNames:c,props:n,stylesCtx:r}),S=v.map(e=>P({theme:m,classNames:m.components[e]?.classNames,props:n,stylesCtx:r})),C=y?{}:F({theme:m,styles:l,props:n,stylesCtx:r}),w={};if(!y)for(let e of v){let t=F({theme:m,styles:m.components[e]?.styles,props:n,stylesCtx:r});for(let e of Object.keys(t))w[e]={...w[e],...t[e]}}let T=Qe([_?{}:d?.(m,n,r),...v.map(e=>m.components?.[e]?.vars?.(m,n,r)),u?.(m,n,r)]),E=Xe({style:a,theme:m});return et((e,a)=>({...f?.[e],className:Ye({theme:m,options:a,themeName:v,selector:e,classNamesPrefix:h,resolvedClassNames:x,resolvedThemeClassNames:S,classes:t,unstyled:s,className:i,rootSelector:o,props:n,stylesCtx:r,withStaticClasses:g,headless:_,transformedStyles:b([a?.styles,l])}),style:Ze({theme:m,selector:e,options:a,props:n,stylesCtx:r,rootSelector:o,withStylesTransform:y,resolvedStyles:C,resolvedThemeStyles:w,resolvedVars:T,resolvedRootStyle:E})}),!!p,[m,h,g,_,y?n:null,t,s,i,o,f,r,x,S,C,w,T,E])}function et(e,t,n){let r=(0,o.useRef)(null);return t?((!r.current||!He(r.current.deps,n,3))&&(r.current={deps:n,getStyles:e}),r.current.getStyles):e}function tt(e){return c(e).reduce((t,n)=>e[n]===void 0?t:`${t}${d(n)}:${e[n]};`,``).trim()}function nt({selector:e,styles:t,media:n,container:r}){let i=t?tt(t):``,a=Array.isArray(n)?n.map(t=>`@media${t.query}{${e}{${tt(t.styles)}}}`):[],o=Array.isArray(r)?r.map(t=>`@container ${t.query}{${e}{${tt(t.styles)}}}`):[];return`${i?`${e}{${i}}`:``}${a.join(``)}${o.join(``)}`.trim()}function rt(e){let t=5381;for(let n=0;n>>0).toString(36)}function it({deduplicate:e,...t}){let n=be(),r=nt(t);return e?(0,s.jsx)(`style`,{href:`mantine-${rt(r)}`,precedence:`mantine`,nonce:n?.(),children:r}):(0,s.jsx)(`style`,{"data-mantine-styles":`inline`,nonce:n?.(),dangerouslySetInnerHTML:{__html:r}})}function at(e){let t=5381;for(let n=0;n>>0).toString(36)}function ot(e,t){return`__mdi__-${at(`${e?tt(e):``}|${Array.isArray(t)?t.map(e=>`${e.query}:${tt(e.styles)}`).join(`|`):``}`)}`}function st(e){let{m:t,mx:n,my:r,mt:i,mb:a,ml:o,mr:s,me:c,ms:l,mis:u,mie:d,p:f,px:p,py:m,pt:h,pb:_,pl:v,pr:y,pe:b,ps:x,pis:S,pie:C,bd:w,bdrs:T,bg:E,c:ee,opacity:te,ff:ne,fz:re,fw:ie,lts:D,ta:O,lh:k,fs:A,tt:ae,td:j,w:oe,miw:M,maw:se,h:N,mih:P,mah:F,bgsz:I,bgp:ce,bgr:le,bga:ue,pos:de,top:L,left:R,bottom:fe,right:z,inset:B,display:V,flex:H,hiddenFrom:pe,visibleFrom:U,lightHidden:me,darkHidden:W,sx:he,...ge}=e;return{styleProps:g({m:t,mx:n,my:r,mt:i,mb:a,ml:o,mr:s,me:c,ms:l,mis:u,mie:d,p:f,px:p,py:m,pt:h,pb:_,pl:v,pr:y,pis:S,pie:C,pe:b,ps:x,bd:w,bg:E,c:ee,opacity:te,ff:ne,fz:re,fw:ie,lts:D,ta:O,lh:k,fs:A,tt:ae,td:j,w:oe,miw:M,maw:se,h:N,mih:P,mah:F,bgsz:I,bgp:ce,bgr:le,bga:ue,pos:de,top:L,left:R,bottom:fe,right:z,inset:B,display:V,flex:H,bdrs:T,hiddenFrom:pe,visibleFrom:U,lightHidden:me,darkHidden:W,sx:he}),rest:ge}}var ct={m:{type:`spacing`,property:`margin`},mt:{type:`spacing`,property:`marginTop`},mb:{type:`spacing`,property:`marginBottom`},ml:{type:`spacing`,property:`marginLeft`},mr:{type:`spacing`,property:`marginRight`},ms:{type:`spacing`,property:`marginInlineStart`},me:{type:`spacing`,property:`marginInlineEnd`},mis:{type:`spacing`,property:`marginInlineStart`},mie:{type:`spacing`,property:`marginInlineEnd`},mx:{type:`spacing`,property:`marginInline`},my:{type:`spacing`,property:`marginBlock`},p:{type:`spacing`,property:`padding`},pt:{type:`spacing`,property:`paddingTop`},pb:{type:`spacing`,property:`paddingBottom`},pl:{type:`spacing`,property:`paddingLeft`},pr:{type:`spacing`,property:`paddingRight`},ps:{type:`spacing`,property:`paddingInlineStart`},pe:{type:`spacing`,property:`paddingInlineEnd`},pis:{type:`spacing`,property:`paddingInlineStart`},pie:{type:`spacing`,property:`paddingInlineEnd`},px:{type:`spacing`,property:`paddingInline`},py:{type:`spacing`,property:`paddingBlock`},bd:{type:`border`,property:`border`},bdrs:{type:`radius`,property:`borderRadius`},bg:{type:`color`,property:`background`},c:{type:`textColor`,property:`color`},opacity:{type:`identity`,property:`opacity`},ff:{type:`fontFamily`,property:`fontFamily`},fz:{type:`fontSize`,property:`fontSize`},fw:{type:`identity`,property:`fontWeight`},lts:{type:`size`,property:`letterSpacing`},ta:{type:`identity`,property:`textAlign`},lh:{type:`lineHeight`,property:`lineHeight`},fs:{type:`identity`,property:`fontStyle`},tt:{type:`identity`,property:`textTransform`},td:{type:`identity`,property:`textDecoration`},w:{type:`spacing`,property:`width`},miw:{type:`spacing`,property:`minWidth`},maw:{type:`spacing`,property:`maxWidth`},h:{type:`spacing`,property:`height`},mih:{type:`spacing`,property:`minHeight`},mah:{type:`spacing`,property:`maxHeight`},bgsz:{type:`size`,property:`backgroundSize`},bgp:{type:`identity`,property:`backgroundPosition`},bgr:{type:`identity`,property:`backgroundRepeat`},bga:{type:`identity`,property:`backgroundAttachment`},pos:{type:`identity`,property:`position`},top:{type:`size`,property:`top`},left:{type:`size`,property:`left`},bottom:{type:`size`,property:`bottom`},right:{type:`size`,property:`right`},inset:{type:`size`,property:`inset`},display:{type:`identity`,property:`display`},flex:{type:`identity`,property:`flex`}};function lt(e,t){let n=V({color:e,theme:t});return n.color===`dimmed`?`var(--mantine-color-dimmed)`:n.color===`bright`?`var(--mantine-color-bright)`:n.variable?`var(${n.variable})`:n.color}function ut(e,t){let n=V({color:e,theme:t});return n.isThemeColor&&n.shade===void 0?`var(--mantine-color-${n.color}-text)`:lt(e,t)}function dt(e,t){if(typeof e==`number`)return m(e);if(typeof e==`string`){let[n,r,...i]=e.split(` `).filter(e=>e.trim()!==``),a=`${m(n)}`;return r&&(a+=` ${r}`),i.length>0&&(a+=` ${lt(i.join(` `),t)}`),a.trim()}return e}var ft={text:`var(--mantine-font-family)`,mono:`var(--mantine-font-family-monospace)`,monospace:`var(--mantine-font-family-monospace)`,heading:`var(--mantine-font-family-headings)`,headings:`var(--mantine-font-family-headings)`};function pt(e){return typeof e==`string`&&e in ft?ft[e]:e}var mt=[`h1`,`h2`,`h3`,`h4`,`h5`,`h6`];function ht(e,t){return typeof e==`string`&&e in t.fontSizes?`var(--mantine-font-size-${e})`:typeof e==`string`&&mt.includes(e)?`var(--mantine-${e}-font-size)`:typeof e==`number`||typeof e==`string`?m(e):e}function gt(e){return e}var _t=[`h1`,`h2`,`h3`,`h4`,`h5`,`h6`];function vt(e,t){return typeof e==`string`&&e in t.lineHeights?`var(--mantine-line-height-${e})`:typeof e==`string`&&_t.includes(e)?`var(--mantine-${e}-line-height)`:e}function yt(e,t){return typeof e==`string`&&e in t.radius?`var(--mantine-radius-${e})`:typeof e==`number`||typeof e==`string`?m(e):e}function bt(e){return typeof e==`number`?m(e):e}function xt(e,t){if(typeof e==`number`)return m(e);if(typeof e==`string`){let n=e.replace(`-`,``);if(!(n in t.spacing))return m(e);let r=`--mantine-spacing-${n}`;return e.startsWith(`-`)?`calc(var(${r}) * -1)`:`var(${r})`}return e}var St={color:lt,textColor:ut,fontSize:ht,spacing:xt,radius:yt,identity:gt,size:bt,lineHeight:vt,fontFamily:pt,border:dt};function Ct(e){return e.replace(`(min-width: `,``).replace(`em)`,``)}function wt({media:e,...t}){let n=Object.keys(e).sort((e,t)=>Number(Ct(e))-Number(Ct(t))).map(t=>({query:t,styles:e[t]}));return{...t,media:n}}function Tt(e){if(typeof e!=`object`||!e)return!1;let t=Object.keys(e);return t.length!==1||t[0]!==`base`}function Et(e){return typeof e==`object`&&e?`base`in e?e.base:void 0:e}function Dt(e){return typeof e==`object`&&e?c(e).filter(e=>e!==`base`):[]}function Ot(e,t){return typeof e==`object`&&e&&t in e?e[t]:e}function kt({styleProps:e,data:t,theme:n}){return wt(c(e).reduce((r,i)=>{if(i===`hiddenFrom`||i===`visibleFrom`||i===`sx`)return r;let a=t[i],o=Array.isArray(a.property)?a.property:[a.property],s=Et(e[i]);if(!Tt(e[i]))return o.forEach(e=>{r.inlineStyles[e]=St[a.type](s,n)}),r;r.hasResponsiveStyles=!0;let c=Dt(e[i]);return o.forEach(t=>{s!=null&&(r.styles[t]=St[a.type](s,n)),c.forEach(o=>{let s=`(min-width: ${n.breakpoints[o]})`;r.media[s]={...r.media[s],[t]:St[a.type](Ot(e[i],o),n)}})}),r},{hasResponsiveStyles:!1,styles:{},inlineStyles:{},media:{}}))}function At(){return`__m__-${(0,o.useId)().replace(/[:«»]/g,``)}`}function jt(e){return e}var Mt=jt;function Nt(e){return e}function J(e){let t=e;return t.extend=Nt,t.withProps=e=>{let n=n=>(0,s.jsx)(t,{...e,...n});return n.extend=t.extend,n.displayName=`WithProps(${t.displayName})`,n},t}function Pt(e){return J(e)}function Y(e){let t=e;return t.withProps=e=>{let n=n=>(0,s.jsx)(t,{...e,...n});return n.extend=t.extend,n.displayName=`WithProps(${t.displayName})`,n},t.extend=Nt,t}function Ft(e){return`data-${(e.startsWith(`data-`)?e.slice(5):e).replace(/([a-z])([A-Z])/g,`$1-$2`).toLowerCase()}`}function It(e){return Object.keys(e).reduce((t,n)=>{let r=e[n];return r===void 0||r===``||r===!1||r===null||(t[Ft(n)]=e[n]),t},{})}function Lt(e){return e?typeof e==`string`?{[Ft(e)]:!0}:Array.isArray(e)?[...e].reduce((e,t)=>({...e,...Lt(t)}),{}):It(e):null}function Rt(e,t){return Array.isArray(e)?[...e].reduce((e,n)=>({...e,...Rt(n,t)}),{}):typeof e==`function`?e(t):e??{}}function zt({theme:e,style:t,vars:n,styleProps:r}){let i=Rt(t,e),a=Rt(n,e);return{...i,...a,...r}}function Bt({component:e,style:t,__vars:n,className:r,variant:i,mod:a,size:o,hiddenFrom:c,visibleFrom:l,lightHidden:u,darkHidden:d,renderRoot:f,__size:p,ref:m,...h}){let g=Le(),v=e||`div`,{styleProps:y,rest:b}=st(h),x=Ce()?.()?.(y.sx),S=At(),C=kt({styleProps:y,theme:g,data:ct}),w=Ee(),T=w&&C.hasResponsiveStyles?ot(C.styles,C.media):S,E={ref:m,style:zt({theme:g,style:t,vars:n,styleProps:C.inlineStyles}),className:M(r,x,{[T]:C.hasResponsiveStyles,"mantine-light-hidden":u,"mantine-dark-hidden":d,[`mantine-hidden-from-${c}`]:c,[`mantine-visible-from-${l}`]:l}),"data-variant":i,"data-size":_(o)?void 0:o||void 0,size:p,...Lt(a),...b};return(0,s.jsxs)(s.Fragment,{children:[C.hasResponsiveStyles&&(0,s.jsx)(it,{selector:`.${T}`,styles:C.styles,media:C.media,deduplicate:w}),typeof f==`function`?f(E):(0,s.jsx)(v,{...E})]})}Bt.displayName=`@mantine/core/Box`;var X=Mt(Bt),Vt={root:`m_87cf2631`},Ht={__staticSelector:`UnstyledButton`},Ut=Y(e=>{let t=K(`UnstyledButton`,Ht,e),{className:n,component:r=`button`,__staticSelector:i,unstyled:a,classNames:o,styles:c,style:l,attributes:u,...d}=t,f=q({name:i,props:t,classes:Vt,className:n,style:l,classNames:o,styles:c,unstyled:a,attributes:u});return(0,s.jsx)(X,{...f(`root`,{focusable:!0}),component:r,type:r===`button`?`button`:void 0,...d})});Ut.classes=Vt,Ut.displayName=`@mantine/core/UnstyledButton`;var Wt={root:`m_1b7284a3`},Gt=j((e,{radius:t,shadow:n})=>({root:{"--paper-radius":t===void 0?void 0:x(t),"--paper-shadow":w(n)}})),Kt=Y(e=>{let t=K(`Paper`,null,e),{classNames:n,className:r,style:i,styles:a,unstyled:o,withBorder:c,vars:l,radius:u,shadow:d,variant:f,mod:p,attributes:m,...h}=t,g=q({name:`Paper`,props:t,classes:Wt,className:r,style:i,classNames:n,styles:a,unstyled:o,attributes:m,vars:l,varsResolver:Gt});return(0,s.jsx)(X,{mod:[{withBorder:c},p],...g(`root`),variant:f,...h})});Kt.classes=Wt,Kt.varsResolver=Gt,Kt.displayName=`@mantine/core/Paper`;var qt=e=>({in:{opacity:1,transform:`scale(1)`},out:{opacity:0,transform:`scale(.9) translateY(${e===`bottom`?10:-10}px)`},transitionProperty:`transform, opacity`}),Jt={fade:{in:{opacity:1},out:{opacity:0},transitionProperty:`opacity`},"fade-up":{in:{opacity:1,transform:`translateY(0)`},out:{opacity:0,transform:`translateY(30px)`},transitionProperty:`opacity, transform`},"fade-down":{in:{opacity:1,transform:`translateY(0)`},out:{opacity:0,transform:`translateY(-30px)`},transitionProperty:`opacity, transform`},"fade-left":{in:{opacity:1,transform:`translateX(0)`},out:{opacity:0,transform:`translateX(30px)`},transitionProperty:`opacity, transform`},"fade-right":{in:{opacity:1,transform:`translateX(0)`},out:{opacity:0,transform:`translateX(-30px)`},transitionProperty:`opacity, transform`},scale:{in:{opacity:1,transform:`scale(1)`},out:{opacity:0,transform:`scale(0)`},common:{transformOrigin:`top`},transitionProperty:`transform, opacity`},"scale-y":{in:{opacity:1,transform:`scaleY(1)`},out:{opacity:0,transform:`scaleY(0)`},common:{transformOrigin:`top`},transitionProperty:`transform, opacity`},"scale-x":{in:{opacity:1,transform:`scaleX(1)`},out:{opacity:0,transform:`scaleX(0)`},common:{transformOrigin:`left`},transitionProperty:`transform, opacity`},"skew-up":{in:{opacity:1,transform:`translateY(0) skew(0deg, 0deg)`},out:{opacity:0,transform:`translateY(-20px) skew(-10deg, -5deg)`},common:{transformOrigin:`top`},transitionProperty:`transform, opacity`},"skew-down":{in:{opacity:1,transform:`translateY(0) skew(0deg, 0deg)`},out:{opacity:0,transform:`translateY(20px) skew(-10deg, -5deg)`},common:{transformOrigin:`bottom`},transitionProperty:`transform, opacity`},"rotate-left":{in:{opacity:1,transform:`translateY(0) rotate(0deg)`},out:{opacity:0,transform:`translateY(20px) rotate(-5deg)`},common:{transformOrigin:`bottom`},transitionProperty:`transform, opacity`},"rotate-right":{in:{opacity:1,transform:`translateY(0) rotate(0deg)`},out:{opacity:0,transform:`translateY(20px) rotate(5deg)`},common:{transformOrigin:`top`},transitionProperty:`transform, opacity`},"slide-down":{in:{opacity:1,transform:`translateY(0)`},out:{opacity:0,transform:`translateY(-100%)`},common:{transformOrigin:`top`},transitionProperty:`transform, opacity`},"slide-up":{in:{opacity:1,transform:`translateY(0)`},out:{opacity:0,transform:`translateY(100%)`},common:{transformOrigin:`bottom`},transitionProperty:`transform, opacity`},"slide-left":{in:{opacity:1,transform:`translateX(0)`},out:{opacity:0,transform:`translateX(100%)`},common:{transformOrigin:`left`},transitionProperty:`transform, opacity`},"slide-right":{in:{opacity:1,transform:`translateX(0)`},out:{opacity:0,transform:`translateX(-100%)`},common:{transformOrigin:`right`},transitionProperty:`transform, opacity`},pop:{...qt(`bottom`),common:{transformOrigin:`center center`}},"pop-bottom-left":{...qt(`bottom`),common:{transformOrigin:`bottom left`}},"pop-bottom-right":{...qt(`bottom`),common:{transformOrigin:`bottom right`}},"pop-top-left":{...qt(`top`),common:{transformOrigin:`top left`}},"pop-top-right":{...qt(`top`),common:{transformOrigin:`top right`}}},Yt={entering:`in`,entered:`in`,exiting:`out`,exited:`out`,"pre-exiting":`out`,"pre-entering":`out`};function Xt({transition:e,state:t,duration:n,timingFunction:r}){let i={WebkitBackfaceVisibility:`hidden`,transitionDuration:`${n}ms`,transitionTimingFunction:r};return typeof e==`string`?e in Jt?{transitionProperty:Jt[e].transitionProperty,...i,...Jt[e].common,...Jt[e][Yt[t]]}:{}:{transitionProperty:e.transitionProperty,...i,...e.common,...e[Yt[t]]}}var Zt=r(a(),1);function Qt({duration:e,exitDuration:t,timingFunction:n,mounted:r,onEnter:i,onExit:a,onEntered:s,onExited:c,enterDelay:l,exitDelay:u}){let d=Le(),f=A(),p=d.respectReducedMotion?f:!1,[m,h]=(0,o.useState)(p?0:e),[g,_]=(0,o.useState)(r?`entered`:`exited`),v=(0,o.useRef)(-1),y=(0,o.useRef)(-1),b=(0,o.useRef)(-1);function x(){window.clearTimeout(v.current),window.clearTimeout(y.current),cancelAnimationFrame(b.current),b.current=-1}let S=n=>{x();let r=n?i:a,o=n?s:c,l=p?0:n?e:t;if(h(l),l===0)typeof r==`function`&&r(),typeof o==`function`&&o(),_(n?`entered`:`exited`);else{let e=requestAnimationFrame(()=>{Zt.flushSync(()=>{_(n?`pre-entering`:`pre-exiting`)}),b.current===e&&(b.current=requestAnimationFrame(()=>{typeof r==`function`&&r(),_(n?`entering`:`exiting`),v.current=window.setTimeout(()=>{typeof o==`function`&&o(),_(n?`entered`:`exited`)},l)}))});b.current=e}},C=e=>{if(x(),typeof(e?l:u)!=`number`){S(e);return}y.current=window.setTimeout(()=>{S(e)},e?l:u)};return re(()=>{C(r)},[r]),(0,o.useEffect)(()=>()=>{x()},[]),{transitionDuration:m,transitionStatus:g,transitionTimingFunction:n||`ease`}}function $t({keepMounted:e,keepMountedMode:t=`activity`,transition:n=`fade`,duration:r=250,exitDuration:i=r,mounted:a,children:c,timingFunction:l=`ease`,onExit:u,onEntered:d,onEnter:f,onExited:p,enterDelay:m,exitDelay:h}){let g=Te(),{transitionDuration:_,transitionStatus:v,transitionTimingFunction:y}=Qt({mounted:a,exitDuration:i,duration:r,timingFunction:l,onExit:u,onEntered:d,onEnter:f,onExited:p,enterDelay:m,exitDelay:h});if(g===`test`)return a?(0,s.jsx)(s.Fragment,{children:c({})}):e?c({display:`none`}):null;if(_===0)return e?t===`display-none`?a?(0,s.jsx)(s.Fragment,{children:c({})}):c({display:`none`}):(0,s.jsx)(o.Activity,{mode:a?`visible`:`hidden`,children:c({})}):a?(0,s.jsx)(s.Fragment,{children:c({})}):null;let b=v===`exited`;if(e){let e=c(b?t===`display-none`?{display:`none`}:{}:Xt({transition:n,duration:_,state:v,timingFunction:y}));return t===`display-none`?e:(0,s.jsx)(o.Activity,{mode:b?`hidden`:`visible`,children:e})}return b?null:(0,s.jsx)(s.Fragment,{children:c(Xt({transition:n,duration:_,state:v,timingFunction:y}))})}$t.displayName=`@mantine/core/Transition`;var Z={root:`m_5ae2e3c`,barsLoader:`m_7a2bd4cd`,bar:`m_870bb79`,"bars-loader-animation":`m_5d2b3b9d`,dotsLoader:`m_4e3f22d7`,dot:`m_870c4af`,"loader-dots-animation":`m_aac34a1`,ovalLoader:`m_b34414df`,"oval-loader-animation":`m_f8e89c4b`},en=({className:e,...t})=>(0,s.jsxs)(X,{component:`span`,className:M(Z.barsLoader,e),...t,children:[(0,s.jsx)(`span`,{className:Z.bar}),(0,s.jsx)(`span`,{className:Z.bar}),(0,s.jsx)(`span`,{className:Z.bar})]});en.displayName=`@mantine/core/Bars`;var tn=({className:e,...t})=>(0,s.jsxs)(X,{component:`span`,className:M(Z.dotsLoader,e),...t,children:[(0,s.jsx)(`span`,{className:Z.dot}),(0,s.jsx)(`span`,{className:Z.dot}),(0,s.jsx)(`span`,{className:Z.dot})]});tn.displayName=`@mantine/core/Dots`;var nn=({className:e,...t})=>(0,s.jsx)(X,{component:`span`,className:M(Z.ovalLoader,e),...t});nn.displayName=`@mantine/core/Oval`;var rn={bars:en,oval:nn,dots:tn},an={loaders:rn,type:`oval`},on=j((e,{size:t,color:n})=>({root:{"--loader-size":y(t,`loader-size`),"--loader-color":n?H(n,e):void 0}})),sn=J(e=>{let t=K(`Loader`,an,e),{size:n,color:r,type:i,vars:a,className:o,style:c,classNames:l,styles:u,unstyled:d,loaders:f,variant:p,children:m,attributes:h,...g}=t,_=q({name:`Loader`,props:t,classes:Z,className:o,style:c,classNames:l,styles:u,unstyled:d,attributes:h,vars:a,varsResolver:on});return m?(0,s.jsx)(X,{..._(`root`),...g,children:m}):(0,s.jsx)(X,{..._(`root`),component:f[i],variant:p,size:n,...g})});sn.defaultLoaders=rn,sn.classes=Z,sn.varsResolver=on,sn.displayName=`@mantine/core/Loader`;function cn({size:e=`var(--cb-icon-size, 70%)`,style:t,...n}){return(0,s.jsx)(`svg`,{viewBox:`0 0 15 15`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`,style:{...t,width:e,height:e},...n,children:(0,s.jsx)(`path`,{d:`M11.7816 4.03157C12.0062 3.80702 12.0062 3.44295 11.7816 3.2184C11.5571 2.99385 11.193 2.99385 10.9685 3.2184L7.50005 6.68682L4.03164 3.2184C3.80708 2.99385 3.44301 2.99385 3.21846 3.2184C2.99391 3.44295 2.99391 3.80702 3.21846 4.03157L6.68688 7.49999L3.21846 10.9684C2.99391 11.193 2.99391 11.557 3.21846 11.7816C3.44301 12.0061 3.80708 12.0061 4.03164 11.7816L7.50005 8.31316L10.9685 11.7816C11.193 12.0061 11.5571 12.0061 11.7816 11.7816C12.0062 11.557 12.0062 11.193 11.7816 10.9684L8.31322 7.49999L11.7816 4.03157Z`,fill:`currentColor`,fillRule:`evenodd`,clipRule:`evenodd`})})}cn.displayName=`@mantine/core/CloseIcon`;var ln={root:`m_86a44da5`,"root--subtle":`m_220c80f2`},un={variant:`subtle`},dn=j((e,{size:t,radius:n,iconSize:r})=>({root:{"--cb-size":y(t,`cb-size`),"--cb-radius":n===void 0?void 0:x(n),"--cb-icon-size":m(r)}})),fn=Y(e=>{let t=K(`CloseButton`,un,e),{iconSize:n,children:r,vars:i,radius:a,className:o,classNames:c,style:l,styles:u,unstyled:d,"data-disabled":f,disabled:p,variant:m,icon:h,mod:g,attributes:_,__staticSelector:v,...y}=t,b=q({name:v||`CloseButton`,props:t,className:o,style:l,classes:ln,classNames:c,styles:u,unstyled:d,attributes:_,vars:i,varsResolver:dn});return(0,s.jsxs)(Ut,{...y,unstyled:d,variant:m,disabled:p,mod:[{disabled:p||f},g],...b(`root`,{variant:m,active:!p&&!f}),children:[h||(0,s.jsx)(cn,{}),r]})});fn.classes=ln,fn.varsResolver=dn,fn.displayName=`@mantine/core/CloseButton`;function pn(e){return o.Children.toArray(e).filter(Boolean)}var mn={root:`m_4081bf90`},hn={preventGrowOverflow:!0,gap:`md`,align:`center`,justify:`flex-start`,wrap:`wrap`},gn=j((e,{grow:t,preventGrowOverflow:n,gap:r,align:i,justify:a,wrap:o},{childWidth:s})=>({root:{"--group-child-width":t&&n?s:void 0,"--group-gap":b(r),"--group-align":i,"--group-justify":a,"--group-wrap":o}})),_n=J(e=>{let t=K(`Group`,hn,e),{classNames:n,className:r,style:i,styles:a,unstyled:o,children:c,gap:l,align:u,justify:d,wrap:f,grow:p,preventGrowOverflow:m,vars:h,variant:g,__size:_,mod:v,attributes:y,...x}=t,S=pn(c),C=S.length,w=b(l??`md`),T=q({name:`Group`,props:t,stylesCtx:{childWidth:`calc(${100/C}% - (${w} - ${w} / ${C}))`},className:r,style:i,classes:mn,classNames:n,styles:a,unstyled:o,attributes:y,vars:h,varsResolver:gn});return(0,s.jsx)(X,{...T(`root`),variant:g,mod:[{grow:p},v],size:_,...x,children:S})});_n.classes=mn,_n.varsResolver=gn,_n.displayName=`@mantine/core/Group`;var vn=(0,o.createContext)({size:`sm`}),yn=J(e=>{let t=K(`InputClearButton`,null,e),{size:n,variant:r,vars:i,classNames:a,styles:c,...l}=t,u=(0,o.use)(vn),{resolvedClassNames:d,resolvedStyles:f}=ze({classNames:a,styles:c,props:t});return(0,s.jsx)(fn,{variant:r||`transparent`,size:n||u?.size||`sm`,classNames:d,styles:f,__staticSelector:`InputClearButton`,style:{pointerEvents:`all`,background:`var(--input-bg)`,...l.style},...l})});yn.displayName=`@mantine/core/InputClearButton`;var bn={xs:7,sm:8,md:10,lg:12,xl:15};function xn({__clearable:e,__clearSection:t,rightSection:n,__defaultRightSection:r,size:i=`sm`,__clearSectionMode:a=`both`}){let o=e&&t;return a===`rightSection`?n===null?null:n||r:a===`clear`?n===null?null:o||r:o&&(n||r)?(0,s.jsxs)(`div`,{"data-combined-clear-section":!0,style:{display:`flex`,gap:2,alignItems:`center`,paddingInlineEnd:bn[i]},children:[o,n||r]}):n===null?null:n||o||r}var Sn=(0,o.createContext)({offsetBottom:!1,offsetTop:!1,describedBy:void 0,getStyles:null,inputId:void 0,labelId:void 0}),Q={wrapper:`m_6c018570`,input:`m_8fb7ebe7`,bottomSection:`m_93f4ed57`,section:`m_82577fc2`,placeholder:`m_88bacfd0`,root:`m_46b77525`,label:`m_8fdc1311`,required:`m_78a94662`,error:`m_8f816625`,success:`m_9d9d40e0`,description:`m_fe47ce59`},Cn=j((e,{size:t})=>({description:{"--input-description-size":t===void 0?void 0:`calc(${S(t)} - ${m(2)})`}})),wn=J(e=>{let t=K(`InputDescription`,null,e),{classNames:n,className:r,style:i,styles:a,unstyled:c,vars:l,__staticSelector:u,__inheritStyles:d=!0,attributes:f,...p}=K(`InputDescription`,null,t),m=(0,o.use)(Sn),h=q({name:[`InputWrapper`,u],props:t,classes:Q,className:r,style:i,classNames:n,styles:a,unstyled:c,attributes:f,rootSelector:`description`,vars:l,varsResolver:Cn}),g=d&&m?.getStyles||h;return(0,s.jsx)(X,{component:`p`,...g(`description`,m?.getStyles?{className:r,style:i}:void 0),...p})});wn.classes=Q,wn.varsResolver=Cn,wn.displayName=`@mantine/core/InputDescription`;var Tn=j((e,{size:t})=>({error:{"--input-error-size":t===void 0?void 0:`calc(${S(t)} - ${m(2)})`}})),En=J(e=>{let t=K(`InputError`,null,e),{classNames:n,className:r,style:i,styles:a,unstyled:c,vars:l,attributes:u,__staticSelector:d,__inheritStyles:f=!0,...p}=t,m=q({name:[`InputWrapper`,d],props:t,classes:Q,className:r,style:i,classNames:n,styles:a,unstyled:c,attributes:u,rootSelector:`error`,vars:l,varsResolver:Tn}),h=(0,o.use)(Sn),g=f&&h?.getStyles||m;return(0,s.jsx)(X,{component:`p`,...g(`error`,h?.getStyles?{className:r,style:i}:void 0),...p})});En.classes=Q,En.varsResolver=Tn,En.displayName=`@mantine/core/InputError`;var Dn={labelElement:`label`},On=j((e,{size:t})=>({label:{"--input-label-size":S(t),"--input-asterisk-color":void 0}})),kn=J(e=>{let t=K(`InputLabel`,Dn,e),{classNames:n,className:r,style:i,styles:a,unstyled:c,vars:l,labelElement:u,required:d,htmlFor:f,onMouseDown:p,children:m,__staticSelector:h,mod:g,attributes:_,...v}=t,y=q({name:[`InputWrapper`,h],props:t,classes:Q,className:r,style:i,classNames:n,styles:a,unstyled:c,attributes:_,rootSelector:`label`,vars:l,varsResolver:On}),b=(0,o.use)(Sn),x=b?.getStyles||y,S=v.component||u,C=typeof S!=`string`||S===`label`;return(0,s.jsxs)(X,{...x(`label`,b?.getStyles?{className:r,style:i}:void 0),component:u,htmlFor:C?f:void 0,mod:[{required:d},g],onMouseDown:e=>{p?.(e),!e.defaultPrevented&&e.detail>1&&e.preventDefault()},...v,children:[m,d&&(0,s.jsx)(`span`,{...x(`required`),"aria-hidden":!0,children:` *`})]})});kn.classes=Q,kn.varsResolver=On,kn.displayName=`@mantine/core/InputLabel`;var An=J(e=>{let t=K(`InputPlaceholder`,null,e),{classNames:n,className:r,style:i,styles:a,unstyled:o,vars:c,__staticSelector:l,error:u,mod:d,attributes:f,...p}=t,m=q({name:[`InputPlaceholder`,l],props:t,classes:Q,className:r,style:i,classNames:n,styles:a,unstyled:o,attributes:f,rootSelector:`placeholder`});return(0,s.jsx)(X,{...m(`placeholder`),mod:[{error:!!u},d],component:`span`,...p})});An.classes=Q,An.displayName=`@mantine/core/InputPlaceholder`;var jn=j((e,{size:t})=>({success:{"--input-success-size":t===void 0?void 0:`calc(${S(t)} - ${m(2)})`}})),Mn=J(e=>{let t=K(`InputSuccess`,null,e),{classNames:n,className:r,style:i,styles:a,unstyled:c,vars:l,attributes:u,__staticSelector:d,__inheritStyles:f=!0,...p}=t,m=q({name:[`InputWrapper`,d],props:t,classes:Q,className:r,style:i,classNames:n,styles:a,unstyled:c,attributes:u,rootSelector:`success`,vars:l,varsResolver:jn}),h=(0,o.use)(Sn),g=f&&h?.getStyles||m;return(0,s.jsx)(X,{component:`p`,...g(`success`,h?.getStyles?{className:r,style:i}:void 0),...p})});Mn.classes=Q,Mn.varsResolver=jn,Mn.displayName=`@mantine/core/InputSuccess`;function Nn(e,{hasDescription:t,hasError:n}){let r=e.findIndex(e=>e===`input`),i=e.slice(0,r),a=e.slice(r+1),o=t&&i.includes(`description`)||n&&i.includes(`error`);return{offsetBottom:t&&a.includes(`description`)||n&&a.includes(`error`),offsetTop:o}}var Pn={labelElement:`label`,inputContainer:e=>e,inputWrapperOrder:[`label`,`description`,`input`,`error`]},Fn=j((e,{size:t})=>({label:{"--input-label-size":S(t),"--input-asterisk-color":void 0},error:{"--input-error-size":t===void 0?void 0:`calc(${S(t)} - ${m(2)})`},success:{"--input-success-size":t===void 0?void 0:`calc(${S(t)} - ${m(2)})`},description:{"--input-description-size":t===void 0?void 0:`calc(${S(t)} - ${m(2)})`}})),In=J(e=>{let t=K(`InputWrapper`,Pn,e),{classNames:n,className:r,style:i,styles:a,unstyled:c,vars:l,size:u,variant:d,__staticSelector:f,inputContainer:p,inputWrapperOrder:m,label:h,error:g,success:_,description:v,labelProps:y,descriptionProps:b,errorProps:x,successProps:S,labelElement:C,children:w,withAsterisk:T,id:E,required:ee,__stylesApiProps:te,mod:ne,attributes:re,...D}=t,O=q({name:[`InputWrapper`,f],props:te||t,classes:Q,className:r,style:i,classNames:n,styles:a,unstyled:c,attributes:re,vars:l,varsResolver:Fn}),k={size:u,variant:d,__staticSelector:f},A=ie(E),ae=typeof T==`boolean`?T:ee,j=x?.id||`${A}-error`,oe=S?.id||`${A}-success`,M=b?.id||`${A}-description`,se=A,N=!!g&&typeof g!=`boolean`,P=!!_&&typeof _!=`boolean`&&!g,F=!!v,I=N&&m.includes(`error`),ce=P&&m.includes(`error`),le=F&&m.includes(`description`),ue=`${I?j:``} ${ce?oe:``} ${le?M:``}`,de=ue.trim().length>0?ue.trim():void 0,L=y?.id||`${A}-label`,R=h&&(0,s.jsx)(kn,{labelElement:C,id:L,htmlFor:se,required:ae,...k,...y,children:h},`label`),fe=F&&(0,s.jsx)(wn,{...b,...k,size:b?.size||k.size,id:b?.id||M,children:v},`description`),z=(0,s.jsx)(o.Fragment,{children:p(w)},`input`),B=N&&(0,o.createElement)(En,{...x,...k,size:x?.size||k.size,key:`error`,id:x?.id||j},g),V=P&&(0,o.createElement)(Mn,{...S,...k,size:S?.size||k.size,key:`success`,id:S?.id||oe},_),H=m.map(e=>{switch(e){case`label`:return R;case`input`:return z;case`description`:return fe;case`error`:return B||V;default:return null}});return(0,s.jsx)(Sn,{value:{getStyles:O,describedBy:de,inputId:se,labelId:R&&m.includes(`label`)?L:void 0,...Nn(m,{hasDescription:F,hasError:N||P})},children:(0,s.jsx)(X,{variant:d,size:u,mod:[{error:!!g,success:!!_&&!g},ne],id:C===`label`?void 0:E,...O(`root`),...D,children:H})})});In.classes=Q,In.varsResolver=Fn,In.displayName=`@mantine/core/InputWrapper`;var Ln={variant:`default`,leftSectionPointerEvents:`none`,rightSectionPointerEvents:`none`,withAria:!0,withErrorStyles:!0,withSuccessStyles:!0,size:`sm`,loading:!1,loadingPosition:`right`},Rn=j((e,t,n)=>({wrapper:{"--input-margin-top":n.offsetTop?`calc(var(--mantine-spacing-xs) / 2)`:void 0,"--input-margin-bottom":n.offsetBottom?`calc(var(--mantine-spacing-xs) / 2)`:void 0,"--input-height":y(t.size,`input-height`),"--input-fz":S(t.size),"--input-radius":t.radius===void 0?void 0:x(t.radius),"--input-left-section-width":t.leftSectionWidth===void 0?void 0:m(t.leftSectionWidth),"--input-right-section-width":t.rightSectionWidth===void 0?void 0:m(t.rightSectionWidth),"--input-padding-y":t.multiline?y(t.size,`input-padding-y`):void 0,"--input-left-section-pointer-events":t.leftSectionPointerEvents,"--input-right-section-pointer-events":t.rightSectionPointerEvents}})),$=Y(e=>{let t=K(`Input`,Ln,e),{classNames:n,className:r,style:i,styles:a,unstyled:c,required:l,__staticSelector:u,__stylesApiProps:d,size:f,wrapperProps:p,error:m,success:h,disabled:g,leftSection:_,leftSectionProps:v,leftSectionWidth:y,rightSection:b,rightSectionProps:x,rightSectionWidth:S,rightSectionPointerEvents:C,leftSectionPointerEvents:w,variant:T,vars:E,pointer:ee,multiline:te,radius:ne,id:re,withAria:ie,withErrorStyles:D,withSuccessStyles:O,mod:k,inputSize:A,attributes:ae,__clearSection:j,__clearable:oe,__clearSectionMode:M,__defaultRightSection:se,loading:N,loadingPosition:P,__bottomSection:F,__bottomSectionProps:I,rootRef:ce,dir:le,...ue}=t,{styleProps:de,rest:L}=st(ue),R=(0,o.use)(Sn),fe={offsetBottom:R?.offsetBottom,offsetTop:R?.offsetTop},z=q({name:[`Input`,u],props:d||t,classes:Q,className:r,style:i,classNames:n,styles:a,unstyled:c,attributes:ae,stylesCtx:fe,rootSelector:`wrapper`,vars:E,varsResolver:Rn}),B=ie?{required:l,disabled:g,"aria-invalid":m?!0:void 0,"aria-describedby":R?.describedBy,id:R?.inputId||re}:{},V=N?(0,s.jsx)(sn,{size:P===`left`?`calc(var(--input-left-section-size) / 2)`:`calc(var(--input-right-section-size) / 2)`}):null,H=N&&P===`left`?V:_,pe=xn({__clearable:oe,__clearSection:j,rightSection:N&&P===`right`?V:b,__defaultRightSection:se,size:f,__clearSectionMode:M});return(0,s.jsx)(vn,{value:{size:f||`sm`},children:(0,s.jsxs)(X,{ref:ce,dir:le,...z(`wrapper`),...de,...p,mod:[{error:!!m&&D,success:!!h&&!m&&O,pointer:ee,disabled:g,multiline:te,withRightSection:!!pe,withLeftSection:!!H,withBottomSection:!!F},k],variant:T,size:f,children:[H&&(0,s.jsx)(`div`,{...v,"data-position":`left`,...z(`section`,{className:v?.className,style:v?.style}),children:H}),(0,s.jsx)(X,{component:`input`,...L,...B,required:l,mod:{disabled:g,error:!!m&&D,success:!!h&&!m&&O},variant:T,__size:A,...z(`input`)}),F&&(0,s.jsx)(`div`,{...I,...z(`bottomSection`,{className:I?.className,style:I?.style}),children:F}),pe&&(0,s.jsx)(`div`,{...x,"data-position":`right`,...z(`section`,{className:x?.className,style:x?.style}),children:pe})]})})});$.classes=Q,$.varsResolver=Rn,$.Wrapper=In,$.Label=kn,$.Error=En,$.Success=Mn,$.Description=wn,$.Placeholder=An,$.ClearButton=yn,$.displayName=`@mantine/core/Input`;function zn(e,t,n){let r=K([`Input`,`InputWrapper`,e],t,n),{label:i,description:a,error:o,success:s,required:c,classNames:l,styles:u,className:d,unstyled:f,__staticSelector:p,__stylesApiProps:m,errorProps:h,successProps:g,labelProps:_,descriptionProps:v,wrapperProps:y,id:b,size:x,style:S,inputContainer:C,inputWrapperOrder:w,withAsterisk:T,variant:E,vars:ee,mod:te,attributes:ne,...re}=r,{styleProps:ie,rest:D}=st(re),O={label:i,description:a,error:o,success:s,required:c,classNames:l,className:d,__staticSelector:p,__stylesApiProps:m||r,errorProps:h,successProps:g,labelProps:_,descriptionProps:v,unstyled:f,styles:u,size:x,style:S,inputContainer:C,inputWrapperOrder:w,withAsterisk:T,variant:E,id:b,mod:te,attributes:ne,...y};return{...D,classNames:l,styles:u,unstyled:f,wrapperProps:{...O,...ie},inputProps:{required:c,classNames:l,styles:u,unstyled:f,size:x,__staticSelector:p,__stylesApiProps:m||r,error:o,success:s,variant:E,id:b,attributes:ne}}}var Bn={__staticSelector:`InputBase`,withAria:!0,size:`sm`},Vn=Y(e=>{let{inputProps:t,wrapperProps:n,...r}=zn(`InputBase`,Bn,e);return(0,s.jsx)($.Wrapper,{...n,children:(0,s.jsx)($,{...t,...r})})});Vn.classes={...$.classes,...$.Wrapper.classes},Vn.displayName=`@mantine/core/InputBase`;var Hn={root:`m_66836ed3`,wrapper:`m_a5d60502`,body:`m_667c2793`,title:`m_6a03f287`,label:`m_698f4f23`,icon:`m_667f2a6a`,message:`m_7fa78076`,closeButton:`m_87f54839`},Un=j((e,{radius:t,color:n,variant:r,autoContrast:i})=>{let a=e.variantColorResolver({color:n||e.primaryColor,theme:e,variant:r||`light`,autoContrast:i});return{root:{"--alert-radius":t===void 0?void 0:x(t),"--alert-bg":n||r?a.background:void 0,"--alert-color":a.color,"--alert-bd":n||r?a.border:void 0}}}),Wn=J(e=>{let t=K(`Alert`,null,e),{classNames:n,className:r,style:i,styles:a,unstyled:o,vars:c,radius:l,color:u,title:d,children:f,id:p,icon:m,withCloseButton:h,onClose:g,closeButtonLabel:_,variant:v,autoContrast:y,role:b,attributes:x,...S}=t,C=q({name:`Alert`,classes:Hn,props:t,className:r,style:i,classNames:n,styles:a,unstyled:o,attributes:x,vars:c,varsResolver:Un}),w=ie(p),T=d&&`${w}-title`||void 0,E=`${w}-body`;return(0,s.jsx)(X,{id:w,...C(`root`,{variant:v}),variant:v,...S,role:b||`alert`,"aria-describedby":f?E:void 0,"aria-labelledby":d?T:void 0,children:(0,s.jsxs)(`div`,{...C(`wrapper`),children:[m&&(0,s.jsx)(`div`,{...C(`icon`),children:m}),(0,s.jsxs)(`div`,{...C(`body`),children:[d&&(0,s.jsx)(`div`,{...C(`title`),"data-with-close-button":h||void 0,children:(0,s.jsx)(`span`,{id:T,...C(`label`),children:d})}),f&&(0,s.jsx)(`div`,{id:E,...C(`message`),"data-variant":v,children:f})]}),h&&(0,s.jsx)(fn,{...C(`closeButton`),onClick:g,variant:`transparent`,size:16,iconSize:16,"aria-label":_,unstyled:o})]})})});Wn.classes=Hn,Wn.varsResolver=Un,Wn.displayName=`@mantine/core/Alert`;var Gn={root:`m_b6d8b162`};function Kn(e){if(e===`start`)return`start`;if(e===`end`||e)return`end`}var qn={inherit:!1},Jn=j((e,{variant:t,lineClamp:n,gradient:r,size:i,textWrap:a})=>({root:{"--text-fz":S(i),"--text-lh":C(i),"--text-gradient":t===`gradient`?me(r,e):void 0,"--text-line-clamp":typeof n==`number`?n.toString():void 0,"--text-text-wrap":a}})),Yn=Y(e=>{let t=K(`Text`,qn,e),{lineClamp:n,truncate:r,inline:i,inherit:a,gradient:o,span:c,textWrap:l,__staticSelector:u,vars:d,className:f,style:p,classNames:m,styles:h,unstyled:g,variant:_,mod:v,size:y,attributes:b,...x}=t,S=q({name:[`Text`,u],props:t,classes:Gn,className:f,style:p,classNames:m,styles:h,unstyled:g,attributes:b,vars:d,varsResolver:Jn});return(0,s.jsx)(X,{...S(`root`,{focusable:!0}),component:c?`span`:`p`,variant:_,mod:[{truncate:Kn(r),lineClamp:typeof n==`number`,inline:i,inherit:a},v],size:y,...x})});Yn.classes=Gn,Yn.varsResolver=Jn,Yn.displayName=`@mantine/core/Text`;var Xn={root:`m_77c9d27d`,inner:`m_80f1301b`,label:`m_811560b9`,section:`m_a74036a`,loader:`m_a25b86ee`,group:`m_80d6d844`,groupSection:`m_70be2a01`},Zn={orientation:`horizontal`},Qn=j((e,{borderWidth:t})=>({group:{"--button-border-width":m(t)}})),$n=J(e=>{let t=K(`ButtonGroup`,Zn,e),{className:n,style:r,classNames:i,styles:a,unstyled:o,orientation:c,vars:l,borderWidth:u,mod:d,attributes:f,...p}=K(`ButtonGroup`,Zn,e),m=q({name:`ButtonGroup`,props:t,classes:Xn,className:n,style:r,classNames:i,styles:a,unstyled:o,attributes:f,vars:l,varsResolver:Qn,rootSelector:`group`});return(0,s.jsx)(X,{...m(`group`),mod:[{orientation:c},d],role:`group`,...p})});$n.classes=Xn,$n.varsResolver=Qn,$n.displayName=`@mantine/core/ButtonGroup`;var er=j((e,{radius:t,color:n,gradient:r,variant:i,autoContrast:a,size:o})=>{let s=e.variantColorResolver({color:n||e.primaryColor,theme:e,gradient:r,variant:i||`filled`,autoContrast:a});return{groupSection:{"--section-height":y(o,`section-height`),"--section-padding-x":y(o,`section-padding-x`),"--section-fz":o?.includes(`compact`)?S(o.replace(`compact-`,``)):S(o),"--section-radius":t===void 0?void 0:x(t),"--section-bg":n||i?s.background:void 0,"--section-color":s.color,"--section-bd":n||i?s.border:void 0}}}),tr=J(e=>{let t=K(`ButtonGroupSection`,null,e),{className:n,style:r,classNames:i,styles:a,unstyled:o,vars:c,gradient:l,radius:u,autoContrast:d,attributes:f,...p}=t,m=q({name:`ButtonGroupSection`,props:t,classes:Xn,className:n,style:r,classNames:i,styles:a,unstyled:o,attributes:f,vars:c,varsResolver:er,rootSelector:`groupSection`});return(0,s.jsx)(X,{...m(`groupSection`),...p})});tr.classes=Xn,tr.varsResolver=er,tr.displayName=`@mantine/core/ButtonGroupSection`;var nr={in:{opacity:1,transform:`translate(-50%, calc(-50% + ${m(1)}))`},out:{opacity:0,transform:`translate(-50%, -200%)`},common:{transformOrigin:`center`},transitionProperty:`transform, opacity`},rr=j((e,{radius:t,color:n,gradient:r,variant:i,size:a,justify:o,autoContrast:s})=>{let c=e.variantColorResolver({color:n||e.primaryColor,theme:e,gradient:r,variant:i||`filled`,autoContrast:s});return{root:{"--button-justify":o,"--button-height":y(a,`button-height`),"--button-padding-x":y(a,`button-padding-x`),"--button-fz":a?.includes(`compact`)?S(a.replace(`compact-`,``)):S(a),"--button-radius":t===void 0?void 0:x(t),"--button-bg":n||i?c.background:void 0,"--button-hover":n||i?c.hover:void 0,"--button-color":c.color,"--button-bd":n||i?c.border:void 0,"--button-hover-color":n||i?c.hoverColor:void 0}}}),ir=Y(e=>{let t=K(`Button`,null,e),{style:n,vars:r,className:i,color:a,disabled:o,children:c,leftSection:l,rightSection:u,fullWidth:d,variant:f,radius:p,loading:m,loaderProps:h,gradient:g,classNames:_,styles:v,unstyled:y,"data-disabled":b,autoContrast:x,mod:S,attributes:C,...w}=t,T=q({name:`Button`,props:t,classes:Xn,className:i,style:n,classNames:_,styles:v,unstyled:y,attributes:C,vars:r,varsResolver:rr}),E=!!l,ee=!!u;return(0,s.jsxs)(Ut,{...T(`root`,{active:!o&&!m&&!b}),unstyled:y,variant:f,disabled:o||m,mod:[{disabled:o||b,loading:m,block:d,"with-left-section":E,"with-right-section":ee},S],...w,children:[typeof m==`boolean`&&(0,s.jsx)($t,{mounted:m,transition:nr,duration:150,children:e=>(0,s.jsx)(X,{component:`span`,...T(`loader`,{style:e}),"aria-hidden":!0,children:(0,s.jsx)(sn,{color:`var(--button-color)`,size:`calc(var(--button-height) / 1.8)`,...h})})}),(0,s.jsxs)(`span`,{...T(`inner`),children:[l&&(0,s.jsx)(X,{component:`span`,...T(`section`),mod:{position:`left`},children:l}),(0,s.jsx)(X,{component:`span`,mod:{loading:m},...T(`label`),children:c}),u&&(0,s.jsx)(X,{component:`span`,...T(`section`),mod:{position:`right`},children:u})]})]})});ir.classes=Xn,ir.varsResolver=rr,ir.displayName=`@mantine/core/Button`,ir.Group=$n,ir.GroupSection=tr;var ar={root:`m_4451eb3a`},or=Y(e=>{let t=K(`Center`,null,e),{classNames:n,className:r,style:i,styles:a,unstyled:o,vars:c,inline:l,mod:u,attributes:d,...f}=t,p=q({name:`Center`,props:t,classes:ar,className:r,style:i,classNames:n,styles:a,unstyled:o,attributes:d,vars:c});return(0,s.jsx)(X,{mod:[{inline:l},u],...p(`root`),...f})});or.classes=ar,or.displayName=`@mantine/core/Center`;var sr={root:`m_7485cace`},cr={strategy:`block`},lr=j((e,{size:t,fluid:n})=>({root:{"--container-size":n?void 0:y(t,`container-size`)}})),ur=J(e=>{let t=K(`Container`,cr,e),{classNames:n,className:r,style:i,styles:a,unstyled:o,vars:c,fluid:l,mod:u,attributes:d,strategy:f,...p}=t,m=q({name:`Container`,classes:sr,props:t,className:r,style:i,classNames:n,styles:a,unstyled:o,attributes:d,vars:c,varsResolver:lr});return(0,s.jsx)(X,{mod:[{fluid:l,strategy:f},u],...m(`root`),...p})});ur.classes=sr,ur.varsResolver=lr,ur.displayName=`@mantine/core/Container`;var dr={root:`m_6d731127`},fr={gap:`md`,align:`stretch`,justify:`flex-start`},pr=j((e,{gap:t,align:n,justify:r})=>({root:{"--stack-gap":b(t),"--stack-align":n,"--stack-justify":r}})),mr=J(e=>{let t=K(`Stack`,fr,e),{classNames:n,className:r,style:i,styles:a,unstyled:o,vars:c,align:l,justify:u,gap:d,variant:f,attributes:p,...m}=t,h=q({name:`Stack`,props:t,classes:dr,className:r,style:i,classNames:n,styles:a,unstyled:o,attributes:p,vars:c,varsResolver:pr});return(0,s.jsx)(X,{...h(`root`),variant:f,...m})});mr.classes=dr,mr.varsResolver=pr,mr.displayName=`@mantine/core/Stack`;var hr={root:`m_7341320d`},gr=j((e,{size:t,radius:n,variant:r,gradient:i,color:a,autoContrast:o})=>{let s=e.variantColorResolver({color:a||e.primaryColor,theme:e,gradient:i,variant:r||`filled`,autoContrast:o});return{root:{"--ti-size":y(t,`ti-size`),"--ti-radius":n===void 0?void 0:x(n),"--ti-bg":a||r?s.background:void 0,"--ti-color":a||r?s.color:void 0,"--ti-bd":a||r?s.border:void 0}}}),_r=J(e=>{let t=K(`ThemeIcon`,null,e),{classNames:n,className:r,style:i,styles:a,unstyled:o,vars:c,autoContrast:l,attributes:u,...d}=t,f=q({name:`ThemeIcon`,classes:hr,props:t,className:r,style:i,classNames:n,styles:a,unstyled:o,attributes:u,vars:c,varsResolver:gr});return(0,s.jsx)(X,{...f(`root`),...d})});_r.classes=hr,_r.varsResolver=gr,_r.displayName=`@mantine/core/ThemeIcon`;var vr=[`h1`,`h2`,`h3`,`h4`,`h5`,`h6`],yr=[`xs`,`sm`,`md`,`lg`,`xl`];function br(e,t){let n=t===void 0?`h${e}`:t;return vr.includes(n)?{fontSize:`var(--mantine-${n}-font-size)`,fontWeight:`var(--mantine-${n}-font-weight)`,lineHeight:`var(--mantine-${n}-line-height)`}:yr.includes(n)?{fontSize:`var(--mantine-font-size-${n})`,fontWeight:`var(--mantine-h${e}-font-weight)`,lineHeight:`var(--mantine-h${e}-line-height)`}:{fontSize:m(n),fontWeight:`var(--mantine-h${e}-font-weight)`,lineHeight:`var(--mantine-h${e}-line-height)`}}var xr={root:`m_8a5d1357`},Sr={order:1},Cr=j((e,{order:t,size:n,lineClamp:r,textWrap:i})=>{let a=br(t||1,n);return{root:{"--title-fw":a.fontWeight,"--title-lh":a.lineHeight,"--title-fz":a.fontSize,"--title-line-clamp":typeof r==`number`?r.toString():void 0,"--title-text-wrap":i}}}),wr=J(e=>{let t=K(`Title`,Sr,e),{classNames:n,className:r,style:i,styles:a,unstyled:o,order:c,vars:l,size:u,variant:d,lineClamp:f,textWrap:p,mod:m,attributes:h,...g}=t,_=q({name:`Title`,props:t,classes:xr,className:r,style:i,classNames:n,styles:a,unstyled:o,attributes:h,vars:l,varsResolver:Cr});return[1,2,3,4,5,6].includes(c)?(0,s.jsx)(X,{..._(`root`),component:`h${c}`,variant:d,mod:[{order:c,lineClamp:typeof f==`number`},m],size:u,...g}):null});wr.classes=xr,wr.varsResolver=Cr,wr.displayName=`@mantine/core/Title`;var Tr=new Map([[`bold`,o.createElement(o.Fragment,null,o.createElement(`path`,{d:`M232.49,80.49l-128,128a12,12,0,0,1-17,0l-56-56a12,12,0,1,1,17-17L96,183,215.51,63.51a12,12,0,0,1,17,17Z`}))],[`duotone`,o.createElement(o.Fragment,null,o.createElement(`path`,{d:`M232,56V200a16,16,0,0,1-16,16H40a16,16,0,0,1-16-16V56A16,16,0,0,1,40,40H216A16,16,0,0,1,232,56Z`,opacity:`0.2`}),o.createElement(`path`,{d:`M205.66,85.66l-96,96a8,8,0,0,1-11.32,0l-40-40a8,8,0,0,1,11.32-11.32L104,164.69l90.34-90.35a8,8,0,0,1,11.32,11.32Z`}))],[`fill`,o.createElement(o.Fragment,null,o.createElement(`path`,{d:`M216,40H40A16,16,0,0,0,24,56V200a16,16,0,0,0,16,16H216a16,16,0,0,0,16-16V56A16,16,0,0,0,216,40ZM205.66,85.66l-96,96a8,8,0,0,1-11.32,0l-40-40a8,8,0,0,1,11.32-11.32L104,164.69l90.34-90.35a8,8,0,0,1,11.32,11.32Z`}))],[`light`,o.createElement(o.Fragment,null,o.createElement(`path`,{d:`M228.24,76.24l-128,128a6,6,0,0,1-8.48,0l-56-56a6,6,0,0,1,8.48-8.48L96,191.51,219.76,67.76a6,6,0,0,1,8.48,8.48Z`}))],[`regular`,o.createElement(o.Fragment,null,o.createElement(`path`,{d:`M229.66,77.66l-128,128a8,8,0,0,1-11.32,0l-56-56a8,8,0,0,1,11.32-11.32L96,188.69,218.34,66.34a8,8,0,0,1,11.32,11.32Z`}))],[`thin`,o.createElement(o.Fragment,null,o.createElement(`path`,{d:`M226.83,74.83l-128,128a4,4,0,0,1-5.66,0l-56-56a4,4,0,0,1,5.66-5.66L96,194.34,221.17,69.17a4,4,0,1,1,5.66,5.66Z`}))]]),Er=new Map([[`bold`,o.createElement(o.Fragment,null,o.createElement(`path`,{d:`M216,28H88A12,12,0,0,0,76,40V76H40A12,12,0,0,0,28,88V216a12,12,0,0,0,12,12H168a12,12,0,0,0,12-12V180h36a12,12,0,0,0,12-12V40A12,12,0,0,0,216,28ZM156,204H52V100H156Zm48-48H180V88a12,12,0,0,0-12-12H100V52H204Z`}))],[`duotone`,o.createElement(o.Fragment,null,o.createElement(`path`,{d:`M216,40V168H168V88H88V40Z`,opacity:`0.2`}),o.createElement(`path`,{d:`M216,32H88a8,8,0,0,0-8,8V80H40a8,8,0,0,0-8,8V216a8,8,0,0,0,8,8H168a8,8,0,0,0,8-8V176h40a8,8,0,0,0,8-8V40A8,8,0,0,0,216,32ZM160,208H48V96H160Zm48-48H176V88a8,8,0,0,0-8-8H96V48H208Z`}))],[`fill`,o.createElement(o.Fragment,null,o.createElement(`path`,{d:`M216,32H88a8,8,0,0,0-8,8V80H40a8,8,0,0,0-8,8V216a8,8,0,0,0,8,8H168a8,8,0,0,0,8-8V176h40a8,8,0,0,0,8-8V40A8,8,0,0,0,216,32Zm-8,128H176V88a8,8,0,0,0-8-8H96V48H208Z`}))],[`light`,o.createElement(o.Fragment,null,o.createElement(`path`,{d:`M216,34H88a6,6,0,0,0-6,6V82H40a6,6,0,0,0-6,6V216a6,6,0,0,0,6,6H168a6,6,0,0,0,6-6V174h42a6,6,0,0,0,6-6V40A6,6,0,0,0,216,34ZM162,210H46V94H162Zm48-48H174V88a6,6,0,0,0-6-6H94V46H210Z`}))],[`regular`,o.createElement(o.Fragment,null,o.createElement(`path`,{d:`M216,32H88a8,8,0,0,0-8,8V80H40a8,8,0,0,0-8,8V216a8,8,0,0,0,8,8H168a8,8,0,0,0,8-8V176h40a8,8,0,0,0,8-8V40A8,8,0,0,0,216,32ZM160,208H48V96H160Zm48-48H176V88a8,8,0,0,0-8-8H96V48H208Z`}))],[`thin`,o.createElement(o.Fragment,null,o.createElement(`path`,{d:`M216,36H88a4,4,0,0,0-4,4V84H40a4,4,0,0,0-4,4V216a4,4,0,0,0,4,4H168a4,4,0,0,0,4-4V172h44a4,4,0,0,0,4-4V40A4,4,0,0,0,216,36ZM164,212H44V92H164Zm48-48H172V88a4,4,0,0,0-4-4H92V44H212Z`}))]]),Dr=(0,o.createContext)({color:`currentColor`,size:`1em`,weight:`regular`,mirrored:!1}),Or=o.forwardRef((e,t)=>{let{alt:n,color:r,size:i,weight:a,mirrored:s,children:c,weights:l,...u}=e,{color:d=`currentColor`,size:f,weight:p=`regular`,mirrored:m=!1,...h}=o.useContext(Dr);return o.createElement(`svg`,{ref:t,xmlns:`http://www.w3.org/2000/svg`,width:i??f,height:i??f,fill:r??d,viewBox:`0 0 256 256`,transform:s||m?`scale(-1, 1)`:void 0,...h,...u},!!n&&o.createElement(`title`,null,n),c,l.get(a??p))});Or.displayName=`IconBase`;var kr=o.forwardRef((e,t)=>o.createElement(Or,{ref:t,...e,weights:Tr}));kr.displayName=`CheckIcon`;var Ar=kr,jr=o.forwardRef((e,t)=>o.createElement(Or,{ref:t,...e,weights:Er}));jr.displayName=`CopyIcon`;var Mr=jr,Nr={small:{fontSize:15,gap:12,tracking:`0.16em`},regular:{fontSize:18,gap:14,tracking:`0.17em`},large:{fontSize:22,gap:16,tracking:`0.18em`}};function Pr({size:e=`regular`}){let t=Nr[e];return(0,s.jsxs)(_n,{component:`span`,gap:t.gap,wrap:`nowrap`,"aria-label":`Fanout`,children:[(0,s.jsx)(Fr,{size:e}),(0,s.jsx)(Yn,{component:`span`,fz:t.fontSize,fw:800,lh:1,lts:t.tracking,tt:`uppercase`,children:`Fanout`})]})}function Fr({size:e=`regular`}){let t={small:32,regular:46,large:50}[e];return(0,s.jsx)(_r,{size:t,variant:`transparent`,"aria-hidden":`true`,children:(0,s.jsx)(Ir,{})})}function Ir(){let e=(0,o.useId)().replace(/[^a-zA-Z0-9-]/g,``),t=`fo-top-${e}`,n=`fo-mid-${e}`,r=`fo-bot-${e}`;return(0,s.jsxs)(`svg`,{viewBox:`35 44 200 200`,width:`100%`,height:`100%`,"aria-hidden":`true`,children:[(0,s.jsxs)(`defs`,{children:[(0,s.jsxs)(`linearGradient`,{id:t,x1:`54`,y1:`52`,x2:`210`,y2:`104`,gradientUnits:`userSpaceOnUse`,children:[(0,s.jsx)(`stop`,{offset:`0`,stopColor:`#5FE8CE`}),(0,s.jsx)(`stop`,{offset:`0.55`,stopColor:`#81E4B9`}),(0,s.jsx)(`stop`,{offset:`1`,stopColor:`#D9F276`})]}),(0,s.jsxs)(`linearGradient`,{id:n,x1:`58`,y1:`112`,x2:`176`,y2:`154`,gradientUnits:`userSpaceOnUse`,children:[(0,s.jsx)(`stop`,{offset:`0`,stopColor:`#536FFF`}),(0,s.jsx)(`stop`,{offset:`0.52`,stopColor:`#41B6F8`}),(0,s.jsx)(`stop`,{offset:`1`,stopColor:`#66D0EE`})]}),(0,s.jsxs)(`linearGradient`,{id:r,x1:`58`,y1:`166`,x2:`145`,y2:`220`,gradientUnits:`userSpaceOnUse`,children:[(0,s.jsx)(`stop`,{offset:`0`,stopColor:`#725BFF`}),(0,s.jsx)(`stop`,{offset:`0.52`,stopColor:`#9A50F4`}),(0,s.jsx)(`stop`,{offset:`1`,stopColor:`#CB55E8`})]})]}),(0,s.jsx)(`path`,{d:`M58 116V88C58 67 75 52 96 52H191C204 52 212 61 212 72C212 84 203 94 191 94H101C82 94 67 102 58 116Z`,fill:`url(#${t})`}),(0,s.jsx)(`path`,{d:`M58 170V139C58 120 72 107 91 107H162C174 107 182 115 182 126C182 137 174 145 162 145H99C79 145 66 154 58 170Z`,fill:`url(#${n})`}),(0,s.jsx)(`path`,{d:`M58 219V188C58 170 71 157 89 157H126C138 157 146 165 146 176C146 187 138 195 126 195H100C89 195 84 200 84 211C84 225 74 235 61 235H58Z`,fill:`url(#${r})`})]})}export{D as $,q as A,be as B,X as C,At as D,Pt as E,ke as F,pe as G,he as H,_e as I,I as J,H as K,G as L,K as M,Re as N,st as O,Le as P,A as Q,ve as R,Ut as S,J as T,W as U,ge as V,U as W,j as X,M as Y,ae as Z,_n as _,a as _t,Or as a,ee as at,$t as b,mr as c,w as ct,ir as d,v as dt,O as et,Yn as f,g as ft,Sn as g,c as gt,$ as h,u as ht,Ar as i,te as it,ze as j,it as k,ur as l,y as lt,Vn as m,m as mt,Fr as n,ie as nt,wr as o,S as ot,Wn as p,h as pt,V as q,Mr as r,re as rt,_r as s,x as st,Pr as t,k as tt,or as u,b as ut,fn as v,Y as w,Kt as x,sn as y,Te as z}; \ No newline at end of file diff --git a/internal/ui/dist/assets/chat-_owdy9Bf.js b/internal/ui/dist/assets/chat-CAy267fh.js similarity index 57% rename from internal/ui/dist/assets/chat-_owdy9Bf.js rename to internal/ui/dist/assets/chat-CAy267fh.js index c333d6e28..6eee3c0bd 100644 --- a/internal/ui/dist/assets/chat-_owdy9Bf.js +++ b/internal/ui/dist/assets/chat-CAy267fh.js @@ -1,2 +1,2 @@ -const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/mcp-app-frame-tweTxib0.js","assets/useRouter-ByJ6_rwb.js","assets/brand-Bcp2Tp5I.js","assets/use-computed-color-scheme-BIja2o3c.js","assets/auth-C8kS8ur3.js","assets/useNavigate-B1zgPEUp.js","assets/index-CNsdEvGl.js","assets/preload-helper-DpsUT6aH.js","assets/theme-DdznftKI.js","assets/Tooltip-DhnGSmh7.js","assets/useQuery-CEXOTfck.js","assets/index-ByVYR1iM.css"])))=>i.map(i=>d[i]); -import{i as e,r as t,s as n}from"./useRouter-ByJ6_rwb.js";import{A as r,C as i,M as a,S as o,T as s,_ as c,a as l,c as u,d,f,i as p,l as m,m as h,n as g,o as ee,p as _,r as v,tt as y,u as b,x,y as S}from"./brand-Bcp2Tp5I.js";import{c as C,d as w,f as T,g as E,h as D,l as O,o as te,p as k,s as A,t as j}from"./preload-helper-DpsUT6aH.js";import{t as M}from"./Tooltip-DhnGSmh7.js";import{c as N,d as P,l as F,o as I,r as ne,s as re,t as ie,u as ae}from"./dashboard-change-chips-C08J6wNb.js";var L=n(e(),1),R=t(),oe=[`borderBottomWidth`,`borderLeftWidth`,`borderRightWidth`,`borderTopWidth`,`boxSizing`,`fontFamily`,`fontSize`,`fontStyle`,`fontWeight`,`letterSpacing`,`lineHeight`,`paddingBottom`,`paddingLeft`,`paddingRight`,`paddingTop`,`tabSize`,`textIndent`,`textRendering`,`textTransform`,`width`,`wordBreak`,`wordSpacing`,`scrollbarGutter`],z={"min-height":`0`,"max-height":`none`,height:`0`,visibility:`hidden`,overflow:`hidden`,position:`absolute`,"z-index":`-1000`,top:`0`,right:`0`,display:`block`};function B(e){Object.keys(z).forEach(t=>{e.style.setProperty(t,z[t],`important`)})}function se(e){let t=window.getComputedStyle(e);if(t===null)return null;let n={};for(let e of oe)n[e]=t[e];return n.boxSizing===``?null:{sizingStyle:n,paddingSize:parseFloat(n.paddingBottom)+parseFloat(n.paddingTop),borderSize:parseFloat(n.borderBottomWidth)+parseFloat(n.borderTopWidth)}}var V=null;function ce(e,t,n=1,r=1/0){V||(V=document.createElement(`textarea`),V.setAttribute(`tabindex`,`-1`),V.setAttribute(`aria-hidden`,`true`),V.setAttribute(`aria-label`,`autosize measurement`),B(V)),V.parentNode===null&&document.body.appendChild(V);let{paddingSize:i,borderSize:a,sizingStyle:o}=e,{boxSizing:s}=o;Object.keys(o).forEach(e=>{V.style[e]=o[e]}),B(V),V.value=t;let c=s===`border-box`?V.scrollHeight+a:V.scrollHeight-i;V.value=t,c=s===`border-box`?V.scrollHeight+a:V.scrollHeight-i,V.value=`x`;let l=V.scrollHeight-i,u=l*n;s===`border-box`&&(u=u+i+a),c=Math.max(u,c);let d=l*r;return s===`border-box`&&(d=d+i+a),c=Math.min(d,c),[c,l]}function le({maxRows:e,minRows:t,onChange:n,ref:r,...i}){let a=i.value!==void 0,o=(0,L.useRef)(null),s=y(o,r),c=(0,L.useRef)(0),l=(0,L.useRef)(0),u=()=>{let n=o.current;if(!n)return;let r=se(n);if(!r)return;let[i]=ce(r,n.value||n.placeholder||`x`,t,e);c.current!==i&&(c.current=i,n.style.setProperty(`height`,`${i}px`,`important`))},d=(0,L.useEffectEvent)(u),f=e=>{a||u(),n?.(e)};return(0,L.useLayoutEffect)(u),(0,L.useEffect)(()=>{let e=()=>u();return window.addEventListener(`resize`,e),()=>window.removeEventListener(`resize`,e)},[]),(0,L.useEffect)(()=>{let e=o.current;if(!e||typeof ResizeObserver>`u`)return;l.current=e.offsetWidth;let t=0,n=new ResizeObserver(()=>{o.current&&o.current.offsetWidth!==l.current&&(l.current=o.current.offsetWidth,cancelAnimationFrame(t),t=requestAnimationFrame(d))});return n.observe(e),()=>{cancelAnimationFrame(t),n.disconnect()}},[]),(0,L.useEffect)(()=>{let e=()=>u();return document.fonts.addEventListener(`loadingdone`,e),()=>document.fonts.removeEventListener(`loadingdone`,e)},[]),(0,L.useEffect)(()=>{let e=e=>{if(o.current?.form===e.target&&!a){let e=o.current.value;requestAnimationFrame(()=>{o.current&&e!==o.current.value&&u()})}};return document.body.addEventListener(`reset`,e),()=>document.body.removeEventListener(`reset`,e)},[a]),(0,R.jsx)(`textarea`,{rows:t,...i,onChange:f,ref:s})}var H=s(e=>{let{autosize:t,maxRows:n,minRows:r,__staticSelector:i,resize:o,bottomSection:s,bottomSectionProps:c,...l}=a([`Input`,`InputWrapper`,`Textarea`],null,e),u=t&&P()!==`test`,d=u?{maxRows:n,minRows:r}:{};return(0,R.jsx)(h,{component:u?le:`textarea`,...l,__staticSelector:i||`Textarea`,__bottomSection:s,__bottomSectionProps:c,multiline:!0,"data-no-overflow":t&&n===void 0||void 0,__vars:{"--input-resize":o},...d})});H.classes=h.classes,H.displayName=`@mantine/core/Textarea`;var U={root:`m_d08caa0`},W=s(e=>{let t=a(`Typography`,null,e),{classNames:n,className:o,style:s,styles:c,unstyled:l,attributes:u,...d}=t,f=r({name:`Typography`,classes:U,props:t,className:o,style:s,classNames:n,styles:c,unstyled:l,attributes:u});return(0,R.jsx)(i,{...f(`root`),...d})});W.classes=U,W.displayName=`@mantine/core/Typography`;var ue=new Map([[`bold`,L.createElement(L.Fragment,null,L.createElement(`path`,{d:`M184.49,136.49l-80,80a12,12,0,0,1-17-17L159,128,87.51,56.49a12,12,0,1,1,17-17l80,80A12,12,0,0,1,184.49,136.49Z`}))],[`duotone`,L.createElement(L.Fragment,null,L.createElement(`path`,{d:`M176,128,96,208V48Z`,opacity:`0.2`}),L.createElement(`path`,{d:`M181.66,122.34l-80-80A8,8,0,0,0,88,48V208a8,8,0,0,0,13.66,5.66l80-80A8,8,0,0,0,181.66,122.34ZM104,188.69V67.31L164.69,128Z`}))],[`fill`,L.createElement(L.Fragment,null,L.createElement(`path`,{d:`M181.66,133.66l-80,80A8,8,0,0,1,88,208V48a8,8,0,0,1,13.66-5.66l80,80A8,8,0,0,1,181.66,133.66Z`}))],[`light`,L.createElement(L.Fragment,null,L.createElement(`path`,{d:`M180.24,132.24l-80,80a6,6,0,0,1-8.48-8.48L167.51,128,91.76,52.24a6,6,0,0,1,8.48-8.48l80,80A6,6,0,0,1,180.24,132.24Z`}))],[`regular`,L.createElement(L.Fragment,null,L.createElement(`path`,{d:`M181.66,133.66l-80,80a8,8,0,0,1-11.32-11.32L164.69,128,90.34,53.66a8,8,0,0,1,11.32-11.32l80,80A8,8,0,0,1,181.66,133.66Z`}))],[`thin`,L.createElement(L.Fragment,null,L.createElement(`path`,{d:`M178.83,130.83l-80,80a4,4,0,0,1-5.66-5.66L170.34,128,93.17,50.83a4,4,0,0,1,5.66-5.66l80,80A4,4,0,0,1,178.83,130.83Z`}))]]),de=new Map([[`bold`,L.createElement(L.Fragment,null,L.createElement(`path`,{d:`M230.14,25.86a20,20,0,0,0-19.57-5.11l-.22.07L18.44,79a20,20,0,0,0-3.06,37.25L99,157l40.71,83.65a19.81,19.81,0,0,0,18,11.38c.57,0,1.15,0,1.73-.07A19.82,19.82,0,0,0,177,237.56L235.18,45.65a1.42,1.42,0,0,0,.07-.22A20,20,0,0,0,230.14,25.86ZM156.91,221.07l-34.37-70.64,46-45.95a12,12,0,0,0-17-17l-46,46L34.93,99.09,210,46Z`}))],[`duotone`,L.createElement(L.Fragment,null,L.createElement(`path`,{d:`M223.69,42.18l-58.22,192a8,8,0,0,1-14.92,1.25L108,148,20.58,105.45a8,8,0,0,1,1.25-14.92l192-58.22A8,8,0,0,1,223.69,42.18Z`,opacity:`0.2`}),L.createElement(`path`,{d:`M227.32,28.68a16,16,0,0,0-15.66-4.08l-.15,0L19.57,82.84a16,16,0,0,0-2.49,29.8L102,154l41.3,84.87A15.86,15.86,0,0,0,157.74,248q.69,0,1.38-.06a15.88,15.88,0,0,0,14-11.51l58.2-191.94c0-.05,0-.1,0-.15A16,16,0,0,0,227.32,28.68ZM157.83,231.85l-.05.14,0-.07-40.06-82.3,48-48a8,8,0,0,0-11.31-11.31l-48,48L24.08,98.25l-.07,0,.14,0L216,40Z`}))],[`fill`,L.createElement(L.Fragment,null,L.createElement(`path`,{d:`M231.4,44.34s0,.1,0,.15l-58.2,191.94a15.88,15.88,0,0,1-14,11.51q-.69.06-1.38.06a15.86,15.86,0,0,1-14.42-9.15L107,164.15a4,4,0,0,1,.77-4.58l57.92-57.92a8,8,0,0,0-11.31-11.31L96.43,148.26a4,4,0,0,1-4.58.77L17.08,112.64a16,16,0,0,1,2.49-29.8l191.94-58.2.15,0A16,16,0,0,1,231.4,44.34Z`}))],[`light`,L.createElement(L.Fragment,null,L.createElement(`path`,{d:`M225.88,30.12a13.83,13.83,0,0,0-13.7-3.58l-.11,0L20.14,84.77A14,14,0,0,0,18,110.85l85.56,41.64L145.12,238a13.87,13.87,0,0,0,12.61,8c.4,0,.81,0,1.21-.05a13.9,13.9,0,0,0,12.29-10.09l58.2-191.93,0-.11A13.83,13.83,0,0,0,225.88,30.12Zm-8,10.4L159.73,232.43l0,.11a2,2,0,0,1-3.76.26l-40.68-83.58,49-49a6,6,0,1,0-8.49-8.49l-49,49L23.15,100a2,2,0,0,1,.31-3.74l.11,0L215.48,38.08a1.94,1.94,0,0,1,1.92.52A2,2,0,0,1,217.92,40.52Z`}))],[`regular`,L.createElement(L.Fragment,null,L.createElement(`path`,{d:`M227.32,28.68a16,16,0,0,0-15.66-4.08l-.15,0L19.57,82.84a16,16,0,0,0-2.49,29.8L102,154l41.3,84.87A15.86,15.86,0,0,0,157.74,248q.69,0,1.38-.06a15.88,15.88,0,0,0,14-11.51l58.2-191.94c0-.05,0-.1,0-.15A16,16,0,0,0,227.32,28.68ZM157.83,231.85l-.05.14,0-.07-40.06-82.3,48-48a8,8,0,0,0-11.31-11.31l-48,48L24.08,98.25l-.07,0,.14,0L216,40Z`}))],[`thin`,L.createElement(L.Fragment,null,L.createElement(`path`,{d:`M224.47,31.52a11.87,11.87,0,0,0-11.82-3L20.74,86.67a12,12,0,0,0-1.91,22.38L105,151l41.92,86.15A11.88,11.88,0,0,0,157.74,244c.34,0,.69,0,1,0a11.89,11.89,0,0,0,10.52-8.63l58.21-192,0-.08A11.85,11.85,0,0,0,224.47,31.52Zm-4.62,9.54-58.23,192a4,4,0,0,1-7.48.59l-41.3-84.86,50-50a4,4,0,1,0-5.66-5.66l-50,50-84.9-41.31a3.88,3.88,0,0,1-2.27-4,3.93,3.93,0,0,1,3-3.54L214.9,36.16A3.93,3.93,0,0,1,216,36a4,4,0,0,1,2.79,1.19A3.93,3.93,0,0,1,219.85,41.06Z`}))]]),fe=new Map([[`bold`,L.createElement(L.Fragment,null,L.createElement(`path`,{d:`M200,36H56A20,20,0,0,0,36,56V200a20,20,0,0,0,20,20H200a20,20,0,0,0,20-20V56A20,20,0,0,0,200,36Zm-4,160H60V60H196Z`}))],[`duotone`,L.createElement(L.Fragment,null,L.createElement(`path`,{d:`M208,56V200a8,8,0,0,1-8,8H56a8,8,0,0,1-8-8V56a8,8,0,0,1,8-8H200A8,8,0,0,1,208,56Z`,opacity:`0.2`}),L.createElement(`path`,{d:`M200,40H56A16,16,0,0,0,40,56V200a16,16,0,0,0,16,16H200a16,16,0,0,0,16-16V56A16,16,0,0,0,200,40Zm0,160H56V56H200V200Z`}))],[`fill`,L.createElement(L.Fragment,null,L.createElement(`path`,{d:`M216,56V200a16,16,0,0,1-16,16H56a16,16,0,0,1-16-16V56A16,16,0,0,1,56,40H200A16,16,0,0,1,216,56Z`}))],[`light`,L.createElement(L.Fragment,null,L.createElement(`path`,{d:`M200,42H56A14,14,0,0,0,42,56V200a14,14,0,0,0,14,14H200a14,14,0,0,0,14-14V56A14,14,0,0,0,200,42Zm2,158a2,2,0,0,1-2,2H56a2,2,0,0,1-2-2V56a2,2,0,0,1,2-2H200a2,2,0,0,1,2,2Z`}))],[`regular`,L.createElement(L.Fragment,null,L.createElement(`path`,{d:`M200,40H56A16,16,0,0,0,40,56V200a16,16,0,0,0,16,16H200a16,16,0,0,0,16-16V56A16,16,0,0,0,200,40Zm0,160H56V56H200V200Z`}))],[`thin`,L.createElement(L.Fragment,null,L.createElement(`path`,{d:`M200,44H56A12,12,0,0,0,44,56V200a12,12,0,0,0,12,12H200a12,12,0,0,0,12-12V56A12,12,0,0,0,200,44Zm4,156a4,4,0,0,1-4,4H56a4,4,0,0,1-4-4V56a4,4,0,0,1,4-4H200a4,4,0,0,1,4,4Z`}))]]),G=L.forwardRef((e,t)=>L.createElement(l,{ref:t,...e,weights:ue}));G.displayName=`CaretRightIcon`;var K=G,q=L.forwardRef((e,t)=>L.createElement(l,{ref:t,...e,weights:de}));q.displayName=`PaperPlaneTiltIcon`;var pe=q,J=L.forwardRef((e,t)=>L.createElement(l,{ref:t,...e,weights:fe}));J.displayName=`StopIcon`;var me=J;function he(e){return e.dashboard.panels.length===1?e.dashboard.panels[0].title:e.dashboard.name}function ge(e){if(!e||typeof e!=`object`||Array.isArray(e))throw Error(`Missing panel view`);let t=e;if(!t.view||![`preset`,`query`].includes(t.view.kind)||!/^[a-f0-9]{64}$/.test(t.view.key))throw Error(`Invalid panel view identity`);if(t.dashboard?.version!==1||!Array.isArray(t.dashboard.panels)||!t.dashboard.panels.length||t.dashboard.panels.length>40||!Array.isArray(t.results)||t.dashboard.panels.some(e=>!e||typeof e.id!=`string`||!e.id)||t.results.some(e=>!e||typeof e.id!=`string`))throw Error(`Invalid panel view`);let n=new Set(t.dashboard.panels.map(e=>e.id));if(n.size!==t.dashboard.panels.length||t.results.length!==n.size||new Set(t.results.map(e=>e.id)).size!==n.size||t.results.some(e=>!n.has(e.id)||![`ok`,`empty`,`error`].includes(e.status)))throw Error(`Panel results do not match the view`);if(t.vars!==void 0&&(!t.vars||typeof t.vars!=`object`||Array.isArray(t.vars)||Object.values(t.vars).some(e=>typeof e!=`string`&&!(Array.isArray(e)&&e.every(e=>typeof e==`string`)))))throw Error(`Invalid panel variables`);if(t.trace!==void 0&&(!t.trace?.data||!Array.isArray(t.trace.data.spans)||!Array.isArray(t.trace.data.logs)||!Array.isArray(t.trace.data.services)))throw Error(`Invalid trace detail`);return t}var Y=new WeakSet;function X(e){if(!e||typeof e!=`object`||Array.isArray(e))return;if(Y.has(e))return e;let t=e;if(Object.keys(t).sort().join(`,`)===`is_error,resource_uri,tool_input,tool_name,tool_result`&&t.resource_uri===`ui://fanout/panels.html`&&typeof t.tool_name==`string`&&t.tool_name&&typeof t.is_error==`boolean`&&t.tool_input&&typeof t.tool_input==`object`&&!Array.isArray(t.tool_input)){try{ge(t.tool_result)}catch{return}return Y.add(t),t}}var _e=64,ve=300;function ye(){let e=(0,L.useRef)(null),t=(0,L.useRef)(!0),n=(0,L.useRef)(()=>{}),r=(0,L.useRef)(null),i=(0,L.useRef)(null),a=(0,L.useCallback)(()=>{let t=e.current;if(!t)return;let n=t.getBoundingClientRect().top,r=[...t.querySelectorAll(`[data-chat-anchor]`)].find(e=>e.getBoundingClientRect().bottom>n);i.current=r?{node:r,top:r.getBoundingClientRect().top}:null},[]),o=(0,L.useCallback)(()=>{let n=e.current;n&&t.current?n.scrollTop=n.scrollHeight:n&&i.current?.node.isConnected&&(n.scrollTop+=i.current.node.getBoundingClientRect().top-i.current.top),a()},[a]);return{scrollRef:(0,L.useCallback)(r=>{if(n.current(),e.current=r,!r)return;let o=0,s=!1,c=()=>{o=Date.now()},l=()=>{s=!0},u=()=>{s=!1},d=()=>{r.scrollHeight-r.clientHeight-r.scrollTop<=_e?t.current=!0:(s||Date.now()-o{r.removeEventListener(`scroll`,d),r.removeEventListener(`wheel`,c),r.removeEventListener(`touchmove`,c),r.removeEventListener(`keydown`,c),r.removeEventListener(`pointerdown`,l),window.removeEventListener(`pointerup`,u),n.current=()=>{}},t.current=!0,r.scrollTop=r.scrollHeight,i.current=null},[a]),contentRef:(0,L.useCallback)(e=>{r.current?.disconnect(),r.current=null,e&&(r.current=new ResizeObserver(o),r.current.observe(e))},[o]),toBottom:(0,L.useCallback)(()=>{t.current=!0,o()},[o])}}function be(e=1500){let[t,n]=(0,L.useState)(`idle`),r=(0,L.useRef)(null);(0,L.useEffect)(()=>()=>{r.current&&clearTimeout(r.current)},[]);function i(t){r.current&&clearTimeout(r.current),n(`idle`),(navigator.clipboard?navigator.clipboard.writeText(t):Promise.reject(Error(`clipboard unavailable`))).then(()=>n(`copied`),()=>n(`failed`)).finally(()=>{r.current=setTimeout(()=>n(`idle`),e)})}return{state:t,copy:i}}var xe={schema:`Telemetry`,context:`Context`,draft:`Draft`,validation:`Validation`,preview:`Preview`,save:`Save`},Z=e=>`${(e/1e3).toFixed(1)} s`;function Se({receipt:e,running:t=!1,activity:n=``,awaitingAnswer:r=!1}){let[i,a]=(0,L.useState)(!1),o=(0,L.useId)(),s=e.saved,l=s?.receipt.save_check,p=Object.values(e.stages).filter(e=>e.state===`complete`).length,m=[e.stages.schema.state===`complete`?`Read telemetry`:void 0,e.panel_count===void 0?void 0:`${e.panel_count} ${e.panel_count===1?`panel`:`panels`}`,l?.checked?`Checked in ${Z(l.elapsed_ms)}`:void 0,s?`Saved v${s.version}`:void 0].filter(Boolean).join(` · `)||`Building dashboard`,h=[...s?C(s.receipt):[],...e.corrections.map(e=>`Fixed ${e.panel_id}.${e.path.replace(/^panels\[\d+\]\./,``)}`)];return(0,R.jsx)(x,{"data-build-receipt":e.turn_id,"data-dashboard-result":s?.id,"data-chat-anchor":!0,withBorder:!0,radius:`md`,p:`sm`,children:(0,R.jsxs)(u,{gap:6,children:[(0,R.jsxs)(c,{gap:`xs`,justify:`space-between`,children:[(0,R.jsxs)(f,{size:`sm`,role:`status`,"aria-live":`polite`,"aria-atomic":`true`,children:[m,(0,R.jsxs)(f,{span:!0,c:`dimmed`,size:`xs`,children:[` · `,p,` stages complete`]})]}),(0,R.jsxs)(d,{component:`button`,variant:`subtle`,color:`gray`,size:`compact-xs`,"aria-expanded":i,"aria-controls":o,onClick:()=>a(e=>!e),children:[`Details`,h.length>4?` (+${h.length-4})`:``]})]}),t&&r&&(0,R.jsxs)(c,{gap:`xs`,"data-build-running":!0,children:[(0,R.jsx)(S,{type:`dots`,size:`sm`}),(0,R.jsx)(f,{c:`dimmed`,size:`sm`,children:n||`Analyzing your system`})]}),(0,R.jsx)(ie,{labels:h.slice(0,4)}),e.explanations.map(e=>t?e.split(` · `).filter(e=>!e.endsWith(`: incomplete`)).join(` · `):e).filter(Boolean).map((e,t)=>(0,R.jsx)(f,{size:`xs`,c:`dimmed`,"data-receipt-attention":!0,children:e},t)),s&&(0,R.jsx)(d,{renderRoot:e=>(0,R.jsx)(E,{...e,to:`/dashboards/$dashboardId`,params:{dashboardId:s.id},search:{}}),variant:`subtle`,size:`compact-sm`,color:`gray`,style:{alignSelf:`flex-start`},children:`Open dashboard`}),(0,R.jsx)(ae,{expanded:i,id:o,children:(0,R.jsxs)(u,{gap:4,children:[s&&(0,R.jsxs)(f,{size:`xs`,children:[s.label,` `,s.name,` · opens the current dashboard`]}),Object.entries(e.stages).map(([e,n])=>(0,R.jsxs)(f,{size:`xs`,c:`dimmed`,children:[xe[e],`: `,t&&n.state===`incomplete`?`in progress`:n.state,n.elapsed_ms===void 0?``:` · ${Z(n.elapsed_ms)}`]},e)),e.save_attempts.map((e,t)=>e.state===`retried`&&(0,R.jsxs)(f,{size:`xs`,c:`dimmed`,children:[`Save attempt `,t+1,`: retried`]},e.call_id)),!!e.context_counts.deploys&&(0,R.jsxs)(f,{size:`xs`,children:[e.context_counts.deploys,` deploys observed`]}),!!e.context_counts.anomalies&&(0,R.jsxs)(f,{size:`xs`,children:[e.context_counts.anomalies,` anomalies observed`]}),e.panels.map(e=>(0,R.jsxs)(f,{size:`xs`,children:[`Preview · `,e.id,`: `,e.status,e.elapsed_ms===void 0?``:` · ${Z(e.elapsed_ms)}`]},e.id)),l&&(0,R.jsxs)(f,{size:`xs`,children:[`Save check: `,l.checked?`checked`:`incomplete`,` · `,Z(l.elapsed_ms)]}),l?.panels.map(e=>(0,R.jsxs)(f,{size:`xs`,children:[`Save · `,e.id,`: `,e.status,` · `,e.rows??0,` rows`,e.elapsed_ms===void 0?``:` · ${Z(e.elapsed_ms)}`]},e.id)),h.slice(4).map((e,t)=>(0,R.jsx)(f,{size:`xs`,children:e},t)),e.corrections.map((e,t)=>(0,R.jsxs)(f,{size:`xs`,children:[`Fixed `,e.panel_id,`.`,e.path,`: `,e.message]},t))]})})]})})}var Ce=(0,L.lazy)(()=>j(()=>import(`./mcp-app-frame-tweTxib0.js`),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11]))),Q=e=>e.tool_result.view.kind===`preset`;function we(e){let t=new Map,n=new Set,r=[],i=()=>{let e=new Map;for(let t of r){let n=t.content.tool_result.view.key;e.set(n,t)}let i=new Set([...e.values()].map(e=>e.id)),a=[...e.values()].some(e=>Q(e.content)),o=r.filter(e=>i.has(e.id)).at(-1)?.id;for(let e of r)i.has(e.id)?t.set(e.id,{content:e.content,expanded:Q(e.content)||!a&&e.id===o}):n.add(e.id);r=[]};for(let t of e)if(t.role===`user`&&i(),t.role===`activity`&&t.activityType===`mcp-app`){let e=X(t.content);e&&r.push({id:t.id,content:e})}return i(),{views:t,duplicates:n}}function Te(e){let t=new Map,n=new Map,r=new Map,i=`unattributed`;for(let a of e){if(a.role===`user`&&(n.clear(),r.clear(),i=a.id),a.role===`assistant`){i=a.id;for(let e of a.toolCalls??[])n.set(e.id,{assistant:i,name:e.function.name})}if(a.role===`tool`){let e=w(a.content);if(!a.error&&!e?.error&&e?.isError!==!0)continue;let o=n.get(a.toolCallId);if(o&&T.has(o.name)&&O(a))continue;let s=o?.assistant??i,c=r.get(s)??a.id;r.set(s,c);let l=t.get(c)??[],u=k(e?.error)?e?.error:void 0,d=typeof u?.message==`string`?u.message:typeof a.error==`string`&&a.error?a.error:`Tool execution failed`;l.push({name:o?.name??`Tool`,message:d,readOnly:u?.code===`answer_only`}),t.set(c,l)}}return t}function Ee({failures:e}){let[t,n]=(0,L.useState)(!1),r=e.filter(e=>!e.readOnly);return(0,R.jsxs)(i,{"data-chat-anchor":!0,children:[e.some(e=>e.readOnly)&&(0,R.jsx)(f,{size:`sm`,c:`dimmed`,children:`Not saved: Explain is read-only`}),r.length>0&&(0,R.jsxs)(R.Fragment,{children:[(0,R.jsxs)(o,{className:`chat-app-toggle`,"aria-expanded":t,onClick:()=>n(e=>!e),style:{color:`var(--mantine-color-dimmed)`},children:[(0,R.jsx)(`span`,{className:`chat-app-chevron`,"aria-hidden":`true`,children:t?(0,R.jsx)(N,{size:14}):(0,R.jsx)(K,{size:14})}),(0,R.jsxs)(`span`,{className:`chat-app-summary`,children:[r.length,` tool `,r.length===1?`call`:`calls`,` failed`]})]}),t&&(0,R.jsx)(u,{gap:`xs`,pl:`md`,children:r.map((e,t)=>(0,R.jsxs)(f,{size:`sm`,c:`dimmed`,style:{whiteSpace:`pre-wrap`,overflowWrap:`anywhere`},children:[e.name,`: `,e.message]},t))})]})]})}function De({view:e}){let[t,n]=(0,L.useState)(e.expanded);(0,L.useEffect)(()=>n(e.expanded),[e.expanded]);let r=e.content.tool_result,i=he(r),a=[...new Set(r.dashboard.panels.map(e=>e.viz===`timeseries`?`time series`:e.viz.replaceAll(`_`,` `)))].join(`, `),s=r.results.reduce((e,t)=>e+(t.frame?.rows??0),0),c=new Map;for(let e of r.results)e.status!==`ok`&&c.set(e.status,(c.get(e.status)??0)+1);let l=r.dashboard.panels.length>1?[`${r.dashboard.panels.length} panels`,...Array.from(c,([e,t])=>`${t} ${e}`)].join(` · `):c.size?[...c.keys()].join(`, `):`${s} ${s===1?`row`:`rows`}`;return(0,R.jsxs)(x,{"data-chat-app":!0,"data-chat-anchor":!0,withBorder:!0,radius:`lg`,style:{overflow:`hidden`},children:[(0,R.jsxs)(o,{className:`chat-app-toggle`,"aria-expanded":t,onClick:()=>n(e=>!e),children:[(0,R.jsx)(`span`,{className:`chat-app-chevron`,"aria-hidden":`true`,children:t?(0,R.jsx)(N,{size:14}):(0,R.jsx)(K,{size:14})}),(0,R.jsxs)(`span`,{className:`chat-app-summary`,children:[i,` · `,a,` · `,l]})]}),t&&(0,R.jsx)(L.Suspense,{fallback:(0,R.jsx)(b,{mih:180,children:(0,R.jsx)(S,{size:`sm`})}),children:(0,R.jsx)(Ce,{content:e.content})})]})}var Oe=[`Summarize system health for the last hour`,`Find the source of elevated errors`,`Map the current service dependencies`,`Show the slowest endpoints`];function ke(){let{agentAvailable:e,messages:t,messageTimes:n,ready:r,running:a,activity:o,provisional:s,stopped:l,error:p,threadMissing:h,send:g,retry:v,reloadThread:y,newThread:C}=A(),{scrollRef:w,contentRef:T,toBottom:E}=ye(),D=te(t),O=t.filter(e=>e.role===`user`).at(-1)?.id;if((0,L.useEffect)(()=>{O&&E()},[O,E]),!e)return(0,R.jsx)(m,{size:`sm`,py:96,children:(0,R.jsx)(x,{withBorder:!0,radius:`lg`,p:{base:`xl`,sm:40},children:(0,R.jsxs)(u,{gap:`md`,children:[(0,R.jsx)(f,{c:`brand`,fw:700,size:`xs`,tt:`uppercase`,lts:`0.12em`,children:`Optional capability`}),(0,R.jsx)(ee,{order:1,fz:28,children:`Chat is not configured`}),(0,R.jsx)(f,{c:`dimmed`,children:`Add an AI provider key to enable chat. Telemetry ingest, dashboards, traces, logs, and metrics remain available without it.`}),(0,R.jsx)(d,{component:`a`,href:`/dashboards`,variant:`light`,mt:`sm`,children:`Open dashboards`})]})})});let k=we(t),j=Te(t),M=t.filter(e=>k.duplicates.has(e.id)?!1:e.role===`tool`?j.has(e.id):e.role===`assistant`?!e.toolCalls?.length&&typeof e.content==`string`&&e.content.trim().length>0:e.role===`activity`?e.activityType===`mcp-app`||e.activityType===`agent-outcome`:e.role===`user`),N=t.findIndex(e=>e.id===O),P=t.slice(N+1).some(e=>e.role===`assistant`&&!e.toolCalls?.length&&typeof e.content==`string`&&e.content.length>0),F=t.slice(N+1).filter(e=>e.role===`assistant`&&!e.toolCalls?.length&&typeof e.content==`string`&&e.content.trim().length>0).at(-1),I=a&&s&&!s.collapsed&&s.text&&!P;return(0,R.jsxs)(i,{className:`chat-pane`,children:[(0,R.jsx)(i,{className:`chat-scroll`,ref:w,tabIndex:0,role:`log`,"aria-label":`Conversation`,children:(0,R.jsxs)(m,{size:880,px:{base:`md`,sm:`xl`},py:`lg`,ref:T,children:[h&&(0,R.jsx)(_,{color:`warn`,radius:`lg`,title:`This chat no longer exists`,children:(0,R.jsxs)(c,{justify:`space-between`,children:[(0,R.jsx)(f,{size:`sm`,children:`It was deleted, or the link is wrong.`}),(0,R.jsx)(d,{size:`compact-sm`,variant:`light`,onClick:C,children:`New chat`})]})}),!h&&!r&&p&&(0,R.jsx)(Ae,{message:p,onRetry:y,onNewThread:C}),!h&&!r&&!p&&(0,R.jsxs)(b,{mih:`40vh`,children:[(0,R.jsx)(S,{size:`sm`}),(0,R.jsx)(f,{c:`dimmed`,size:`sm`,ml:`sm`,children:`Loading chat`})]}),!h&&r&&(0,R.jsxs)(R.Fragment,{children:[M.length===0&&(0,R.jsx)(Me,{onSelect:g}),(0,R.jsxs)(u,{gap:`lg`,children:[M.filter(e=>e.id!==F?.id).map(e=>j.has(e.id)?(0,R.jsx)(Ee,{failures:j.get(e.id)},e.id):(0,R.jsxs)(i,{children:[(0,R.jsx)(Ne,{message:e,time:n[e.id],appView:k.views.get(e.id)}),D.has(e.id)&&(0,R.jsx)(i,{mt:`sm`,children:(0,R.jsx)(Se,{receipt:D.get(e.id),running:a&&e.id===O,awaitingAnswer:!P&&!I,activity:o})})]},e.id)),(F||I)&&(0,R.jsx)(i,{"data-answer-position":!0,children:(0,R.jsx)(Ne,{message:I?{id:s.id,role:`assistant`,content:s.text}:F,provisional:!!I,time:I?void 0:n[F.id]})},`answer-${O??`draft`}`),a&&!P&&!I&&!D.has(O??``)&&(0,R.jsxs)(c,{gap:`xs`,role:`status`,children:[(0,R.jsx)(S,{type:`dots`,size:`sm`}),(0,R.jsx)(f,{c:`dimmed`,size:`sm`,children:o||`Analyzing your system`})]}),l&&(0,R.jsx)(f,{c:`dimmed`,size:`sm`,children:`Stopped`}),p&&(0,R.jsx)(Ae,{message:p,onRetry:v})]})]})]})}),!h&&(0,R.jsx)(je,{})]})}function Ae({message:e,onRetry:t,onNewThread:n}){return(0,R.jsx)(_,{color:`bad`,radius:`lg`,title:`Something went wrong`,children:(0,R.jsxs)(c,{justify:`space-between`,gap:`sm`,wrap:`nowrap`,children:[(0,R.jsx)(f,{size:`sm`,children:e}),(0,R.jsxs)(c,{gap:`xs`,wrap:`nowrap`,children:[n&&(0,R.jsx)(d,{size:`compact-sm`,variant:`subtle`,color:`bad`,onClick:n,children:`New chat`}),(0,R.jsx)(d,{size:`compact-sm`,variant:`light`,color:`bad`,onClick:t,children:`Retry`})]})]})})}function je(){let{input:e,setInput:t,inputRef:n,submit:r,send:a,stop:o,ready:s,running:l}=A();return(0,R.jsx)(i,{className:`chat-composer`,children:(0,R.jsxs)(m,{size:880,px:{base:`md`,sm:`xl`},children:[(0,R.jsx)(x,{component:`form`,onSubmit:r,className:`chat-composer-field`,withBorder:!0,radius:24,py:6,pl:`lg`,pr:6,children:(0,R.jsxs)(c,{align:`flex-end`,gap:`xs`,wrap:`nowrap`,children:[(0,R.jsx)(H,{ref:n,"aria-label":`Message Fanout`,value:e,onChange:e=>t(e.currentTarget.value),onKeyDown:t=>{t.key===`Enter`&&!t.shiftKey&&(t.preventDefault(),a(e))},placeholder:l?`Fanout is working…`:`Ask about health, errors, or latency…`,disabled:!s,autosize:!0,minRows:1,maxRows:8,variant:`unstyled`,flex:1}),l?(0,R.jsx)(M,{label:`Stop`,children:(0,R.jsx)(D,{type:`button`,variant:`default`,size:40,radius:`xl`,"aria-label":`Stop`,onClick:o,children:(0,R.jsx)(me,{size:16,weight:`fill`})})}):(0,R.jsx)(D,{type:`submit`,variant:`filled`,size:40,radius:`xl`,disabled:!e.trim()||!s,"aria-label":`Send message`,children:(0,R.jsx)(pe,{size:17,weight:`fill`})})]})}),(0,R.jsx)(f,{c:`dimmed`,size:`xs`,ta:`center`,mt:6,children:`Enter to send, Shift+Enter for a new line`})]})})}function Me({onSelect:e}){return(0,R.jsxs)(u,{align:`center`,gap:`md`,pt:{base:32,sm:88},pb:`xl`,ta:`center`,children:[(0,R.jsx)(g,{size:`large`}),(0,R.jsx)(ee,{order:1,fz:24,fw:500,lh:1.25,maw:560,children:`What do you want to know about your system?`}),(0,R.jsx)(c,{justify:`center`,gap:`xs`,mt:`xs`,maw:720,children:Oe.map(t=>(0,R.jsx)(d,{variant:`default`,size:`sm`,radius:`xl`,onClick:()=>void e(t),children:t},t))})]})}function Ne({message:e,time:t,appView:n,provisional:r=!1}){if(e.role===`activity`)return e.activityType===`agent-outcome`&&e.content&&typeof e.content==`object`&&`message`in e.content&&typeof e.content.message==`string`?`status`in e.content&&e.content.status===`stopped`?(0,R.jsx)(f,{c:`dimmed`,size:`sm`,"data-chat-anchor":!0,children:e.content.message}):(0,R.jsx)(_,{color:`bad`,title:`Something went wrong`,"data-chat-anchor":!0,children:e.content.message}):e.activityType===`mcp-app`?n?(0,R.jsx)(De,{view:n}):(0,R.jsx)(_,{color:`bad`,"data-chat-anchor":!0,children:`This view could not be loaded. Please try again.`}):null;if(e.role===`assistant`&&e.toolCalls?.length)return null;let a=typeof e.content==`string`?e.content:JSON.stringify(e.content);if(!a&&e.role===`assistant`)return null;let o=e.role===`user`,s=t?new Intl.DateTimeFormat(void 0,{hour:`numeric`,minute:`2-digit`}).format(new Date(t)):``;return(0,R.jsxs)(i,{className:`chat-message${r?` chat-message--provisional`:``}`,"data-chat-anchor":!0,"data-role":o?`user`:`assistant`,children:[o?(0,R.jsx)(x,{radius:`lg`,px:`md`,py:`sm`,bg:`var(--mantine-color-brand-light)`,maw:`70%`,ml:`auto`,w:`fit-content`,children:(0,R.jsx)(f,{style:{whiteSpace:`pre-wrap`},children:a})}):(0,R.jsx)(W,{className:`chat-markdown${r?` chat-markdown--provisional`:``}`,"data-provisional":r||void 0,children:(0,R.jsx)(re,{remarkPlugins:[I],components:Fe,children:a})}),(r||s||!o)&&(0,R.jsx)(c,{className:`chat-message-meta`,gap:6,justify:o?`flex-end`:`flex-start`,mt:4,h:24,children:r?(0,R.jsx)(S,{type:`dots`,size:20}):(0,R.jsxs)(R.Fragment,{children:[s&&t&&(0,R.jsx)(f,{c:`dimmed`,size:`xs`,title:ne(t),children:s}),!o&&(0,R.jsx)(Pe,{text:a,label:`Copy message`})]})})]})}function Pe({text:e,label:t}){let{state:n,copy:r}=be();return(0,R.jsx)(M,{label:n===`failed`?`Could not copy`:n===`copied`?`Copied`:t,children:(0,R.jsx)(D,{variant:`subtle`,color:`gray`,size:`sm`,"aria-label":t,"data-state":n===`idle`?void 0:n,onClick:()=>r(e),children:n===`copied`?(0,R.jsx)(p,{size:13,weight:`bold`}):(0,R.jsx)(v,{size:13})})})}var Fe={table:({children:e})=>(0,R.jsx)(i,{className:`chat-table`,children:(0,R.jsx)(F,{striped:!0,highlightOnHover:!0,withTableBorder:!0,verticalSpacing:`xs`,fz:`sm`,children:e})}),thead:({children:e})=>(0,R.jsx)(F.Thead,{children:e}),tbody:({children:e})=>(0,R.jsx)(F.Tbody,{children:e}),tr:({children:e})=>(0,R.jsx)(F.Tr,{children:e}),th:({children:e})=>(0,R.jsx)(F.Th,{children:e}),td:({children:e})=>(0,R.jsx)(F.Td,{children:e}),pre:({children:e})=>(0,R.jsx)(Ie,{children:e}),a:({href:e,children:t})=>(0,R.jsx)(`a`,{href:e,target:`_blank`,rel:`noopener noreferrer`,children:t})};function Ie({children:e}){let t=$(e);return(0,R.jsxs)(i,{className:`chat-code`,pos:`relative`,children:[(0,R.jsx)(i,{className:`chat-code-actions`,pos:`absolute`,top:6,right:6,children:(0,R.jsx)(Pe,{text:t,label:`Copy code`})}),(0,R.jsx)(`pre`,{children:e})]})}function $(e){return typeof e==`string`?e:Array.isArray(e)?e.map($).join(``):e&&typeof e==`object`&&`props`in e?$(e.props.children):``}export{X as n,ke as t}; \ No newline at end of file +const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/mcp-app-frame-XtROHu70.js","assets/useRouter-ByJ6_rwb.js","assets/brand-DUaZkIz1.js","assets/index-D1TEoZWj.js","assets/useNavigate-B1zgPEUp.js","assets/preload-helper-FMCtZeYw.js","assets/Tooltip-B3r3s_B9.js","assets/index-ByVYR1iM.css"])))=>i.map(i=>d[i]); +import{i as e,r as t,s as n}from"./useRouter-ByJ6_rwb.js";import{A as r,C as i,M as a,S as o,T as s,_ as c,a as l,c as u,d,f,i as p,l as m,m as h,n as g,o as ee,p as _,r as v,tt as y,u as b,x,y as S}from"./brand-DUaZkIz1.js";import{c as C,d as w,f as T,g as E,h as D,l as O,o as te,p as k,s as A,t as j}from"./preload-helper-FMCtZeYw.js";import{t as M}from"./Tooltip-B3r3s_B9.js";import{c as N,d as P,l as F,o as I,r as ne,s as re,t as ie,u as ae}from"./dashboard-change-chips-BKnD9tpX.js";var L=n(e(),1),R=t(),oe=[`borderBottomWidth`,`borderLeftWidth`,`borderRightWidth`,`borderTopWidth`,`boxSizing`,`fontFamily`,`fontSize`,`fontStyle`,`fontWeight`,`letterSpacing`,`lineHeight`,`paddingBottom`,`paddingLeft`,`paddingRight`,`paddingTop`,`tabSize`,`textIndent`,`textRendering`,`textTransform`,`width`,`wordBreak`,`wordSpacing`,`scrollbarGutter`],z={"min-height":`0`,"max-height":`none`,height:`0`,visibility:`hidden`,overflow:`hidden`,position:`absolute`,"z-index":`-1000`,top:`0`,right:`0`,display:`block`};function B(e){Object.keys(z).forEach(t=>{e.style.setProperty(t,z[t],`important`)})}function se(e){let t=window.getComputedStyle(e);if(t===null)return null;let n={};for(let e of oe)n[e]=t[e];return n.boxSizing===``?null:{sizingStyle:n,paddingSize:parseFloat(n.paddingBottom)+parseFloat(n.paddingTop),borderSize:parseFloat(n.borderBottomWidth)+parseFloat(n.borderTopWidth)}}var V=null;function ce(e,t,n=1,r=1/0){V||(V=document.createElement(`textarea`),V.setAttribute(`tabindex`,`-1`),V.setAttribute(`aria-hidden`,`true`),V.setAttribute(`aria-label`,`autosize measurement`),B(V)),V.parentNode===null&&document.body.appendChild(V);let{paddingSize:i,borderSize:a,sizingStyle:o}=e,{boxSizing:s}=o;Object.keys(o).forEach(e=>{V.style[e]=o[e]}),B(V),V.value=t;let c=s===`border-box`?V.scrollHeight+a:V.scrollHeight-i;V.value=t,c=s===`border-box`?V.scrollHeight+a:V.scrollHeight-i,V.value=`x`;let l=V.scrollHeight-i,u=l*n;s===`border-box`&&(u=u+i+a),c=Math.max(u,c);let d=l*r;return s===`border-box`&&(d=d+i+a),c=Math.min(d,c),[c,l]}function le({maxRows:e,minRows:t,onChange:n,ref:r,...i}){let a=i.value!==void 0,o=(0,L.useRef)(null),s=y(o,r),c=(0,L.useRef)(0),l=(0,L.useRef)(0),u=()=>{let n=o.current;if(!n)return;let r=se(n);if(!r)return;let[i]=ce(r,n.value||n.placeholder||`x`,t,e);c.current!==i&&(c.current=i,n.style.setProperty(`height`,`${i}px`,`important`))},d=(0,L.useEffectEvent)(u),f=e=>{a||u(),n?.(e)};return(0,L.useLayoutEffect)(u),(0,L.useEffect)(()=>{let e=()=>u();return window.addEventListener(`resize`,e),()=>window.removeEventListener(`resize`,e)},[]),(0,L.useEffect)(()=>{let e=o.current;if(!e||typeof ResizeObserver>`u`)return;l.current=e.offsetWidth;let t=0,n=new ResizeObserver(()=>{o.current&&o.current.offsetWidth!==l.current&&(l.current=o.current.offsetWidth,cancelAnimationFrame(t),t=requestAnimationFrame(d))});return n.observe(e),()=>{cancelAnimationFrame(t),n.disconnect()}},[]),(0,L.useEffect)(()=>{let e=()=>u();return document.fonts.addEventListener(`loadingdone`,e),()=>document.fonts.removeEventListener(`loadingdone`,e)},[]),(0,L.useEffect)(()=>{let e=e=>{if(o.current?.form===e.target&&!a){let e=o.current.value;requestAnimationFrame(()=>{o.current&&e!==o.current.value&&u()})}};return document.body.addEventListener(`reset`,e),()=>document.body.removeEventListener(`reset`,e)},[a]),(0,R.jsx)(`textarea`,{rows:t,...i,onChange:f,ref:s})}var H=s(e=>{let{autosize:t,maxRows:n,minRows:r,__staticSelector:i,resize:o,bottomSection:s,bottomSectionProps:c,...l}=a([`Input`,`InputWrapper`,`Textarea`],null,e),u=t&&P()!==`test`,d=u?{maxRows:n,minRows:r}:{};return(0,R.jsx)(h,{component:u?le:`textarea`,...l,__staticSelector:i||`Textarea`,__bottomSection:s,__bottomSectionProps:c,multiline:!0,"data-no-overflow":t&&n===void 0||void 0,__vars:{"--input-resize":o},...d})});H.classes=h.classes,H.displayName=`@mantine/core/Textarea`;var U={root:`m_d08caa0`},W=s(e=>{let t=a(`Typography`,null,e),{classNames:n,className:o,style:s,styles:c,unstyled:l,attributes:u,...d}=t,f=r({name:`Typography`,classes:U,props:t,className:o,style:s,classNames:n,styles:c,unstyled:l,attributes:u});return(0,R.jsx)(i,{...f(`root`),...d})});W.classes=U,W.displayName=`@mantine/core/Typography`;var ue=new Map([[`bold`,L.createElement(L.Fragment,null,L.createElement(`path`,{d:`M184.49,136.49l-80,80a12,12,0,0,1-17-17L159,128,87.51,56.49a12,12,0,1,1,17-17l80,80A12,12,0,0,1,184.49,136.49Z`}))],[`duotone`,L.createElement(L.Fragment,null,L.createElement(`path`,{d:`M176,128,96,208V48Z`,opacity:`0.2`}),L.createElement(`path`,{d:`M181.66,122.34l-80-80A8,8,0,0,0,88,48V208a8,8,0,0,0,13.66,5.66l80-80A8,8,0,0,0,181.66,122.34ZM104,188.69V67.31L164.69,128Z`}))],[`fill`,L.createElement(L.Fragment,null,L.createElement(`path`,{d:`M181.66,133.66l-80,80A8,8,0,0,1,88,208V48a8,8,0,0,1,13.66-5.66l80,80A8,8,0,0,1,181.66,133.66Z`}))],[`light`,L.createElement(L.Fragment,null,L.createElement(`path`,{d:`M180.24,132.24l-80,80a6,6,0,0,1-8.48-8.48L167.51,128,91.76,52.24a6,6,0,0,1,8.48-8.48l80,80A6,6,0,0,1,180.24,132.24Z`}))],[`regular`,L.createElement(L.Fragment,null,L.createElement(`path`,{d:`M181.66,133.66l-80,80a8,8,0,0,1-11.32-11.32L164.69,128,90.34,53.66a8,8,0,0,1,11.32-11.32l80,80A8,8,0,0,1,181.66,133.66Z`}))],[`thin`,L.createElement(L.Fragment,null,L.createElement(`path`,{d:`M178.83,130.83l-80,80a4,4,0,0,1-5.66-5.66L170.34,128,93.17,50.83a4,4,0,0,1,5.66-5.66l80,80A4,4,0,0,1,178.83,130.83Z`}))]]),de=new Map([[`bold`,L.createElement(L.Fragment,null,L.createElement(`path`,{d:`M230.14,25.86a20,20,0,0,0-19.57-5.11l-.22.07L18.44,79a20,20,0,0,0-3.06,37.25L99,157l40.71,83.65a19.81,19.81,0,0,0,18,11.38c.57,0,1.15,0,1.73-.07A19.82,19.82,0,0,0,177,237.56L235.18,45.65a1.42,1.42,0,0,0,.07-.22A20,20,0,0,0,230.14,25.86ZM156.91,221.07l-34.37-70.64,46-45.95a12,12,0,0,0-17-17l-46,46L34.93,99.09,210,46Z`}))],[`duotone`,L.createElement(L.Fragment,null,L.createElement(`path`,{d:`M223.69,42.18l-58.22,192a8,8,0,0,1-14.92,1.25L108,148,20.58,105.45a8,8,0,0,1,1.25-14.92l192-58.22A8,8,0,0,1,223.69,42.18Z`,opacity:`0.2`}),L.createElement(`path`,{d:`M227.32,28.68a16,16,0,0,0-15.66-4.08l-.15,0L19.57,82.84a16,16,0,0,0-2.49,29.8L102,154l41.3,84.87A15.86,15.86,0,0,0,157.74,248q.69,0,1.38-.06a15.88,15.88,0,0,0,14-11.51l58.2-191.94c0-.05,0-.1,0-.15A16,16,0,0,0,227.32,28.68ZM157.83,231.85l-.05.14,0-.07-40.06-82.3,48-48a8,8,0,0,0-11.31-11.31l-48,48L24.08,98.25l-.07,0,.14,0L216,40Z`}))],[`fill`,L.createElement(L.Fragment,null,L.createElement(`path`,{d:`M231.4,44.34s0,.1,0,.15l-58.2,191.94a15.88,15.88,0,0,1-14,11.51q-.69.06-1.38.06a15.86,15.86,0,0,1-14.42-9.15L107,164.15a4,4,0,0,1,.77-4.58l57.92-57.92a8,8,0,0,0-11.31-11.31L96.43,148.26a4,4,0,0,1-4.58.77L17.08,112.64a16,16,0,0,1,2.49-29.8l191.94-58.2.15,0A16,16,0,0,1,231.4,44.34Z`}))],[`light`,L.createElement(L.Fragment,null,L.createElement(`path`,{d:`M225.88,30.12a13.83,13.83,0,0,0-13.7-3.58l-.11,0L20.14,84.77A14,14,0,0,0,18,110.85l85.56,41.64L145.12,238a13.87,13.87,0,0,0,12.61,8c.4,0,.81,0,1.21-.05a13.9,13.9,0,0,0,12.29-10.09l58.2-191.93,0-.11A13.83,13.83,0,0,0,225.88,30.12Zm-8,10.4L159.73,232.43l0,.11a2,2,0,0,1-3.76.26l-40.68-83.58,49-49a6,6,0,1,0-8.49-8.49l-49,49L23.15,100a2,2,0,0,1,.31-3.74l.11,0L215.48,38.08a1.94,1.94,0,0,1,1.92.52A2,2,0,0,1,217.92,40.52Z`}))],[`regular`,L.createElement(L.Fragment,null,L.createElement(`path`,{d:`M227.32,28.68a16,16,0,0,0-15.66-4.08l-.15,0L19.57,82.84a16,16,0,0,0-2.49,29.8L102,154l41.3,84.87A15.86,15.86,0,0,0,157.74,248q.69,0,1.38-.06a15.88,15.88,0,0,0,14-11.51l58.2-191.94c0-.05,0-.1,0-.15A16,16,0,0,0,227.32,28.68ZM157.83,231.85l-.05.14,0-.07-40.06-82.3,48-48a8,8,0,0,0-11.31-11.31l-48,48L24.08,98.25l-.07,0,.14,0L216,40Z`}))],[`thin`,L.createElement(L.Fragment,null,L.createElement(`path`,{d:`M224.47,31.52a11.87,11.87,0,0,0-11.82-3L20.74,86.67a12,12,0,0,0-1.91,22.38L105,151l41.92,86.15A11.88,11.88,0,0,0,157.74,244c.34,0,.69,0,1,0a11.89,11.89,0,0,0,10.52-8.63l58.21-192,0-.08A11.85,11.85,0,0,0,224.47,31.52Zm-4.62,9.54-58.23,192a4,4,0,0,1-7.48.59l-41.3-84.86,50-50a4,4,0,1,0-5.66-5.66l-50,50-84.9-41.31a3.88,3.88,0,0,1-2.27-4,3.93,3.93,0,0,1,3-3.54L214.9,36.16A3.93,3.93,0,0,1,216,36a4,4,0,0,1,2.79,1.19A3.93,3.93,0,0,1,219.85,41.06Z`}))]]),fe=new Map([[`bold`,L.createElement(L.Fragment,null,L.createElement(`path`,{d:`M200,36H56A20,20,0,0,0,36,56V200a20,20,0,0,0,20,20H200a20,20,0,0,0,20-20V56A20,20,0,0,0,200,36Zm-4,160H60V60H196Z`}))],[`duotone`,L.createElement(L.Fragment,null,L.createElement(`path`,{d:`M208,56V200a8,8,0,0,1-8,8H56a8,8,0,0,1-8-8V56a8,8,0,0,1,8-8H200A8,8,0,0,1,208,56Z`,opacity:`0.2`}),L.createElement(`path`,{d:`M200,40H56A16,16,0,0,0,40,56V200a16,16,0,0,0,16,16H200a16,16,0,0,0,16-16V56A16,16,0,0,0,200,40Zm0,160H56V56H200V200Z`}))],[`fill`,L.createElement(L.Fragment,null,L.createElement(`path`,{d:`M216,56V200a16,16,0,0,1-16,16H56a16,16,0,0,1-16-16V56A16,16,0,0,1,56,40H200A16,16,0,0,1,216,56Z`}))],[`light`,L.createElement(L.Fragment,null,L.createElement(`path`,{d:`M200,42H56A14,14,0,0,0,42,56V200a14,14,0,0,0,14,14H200a14,14,0,0,0,14-14V56A14,14,0,0,0,200,42Zm2,158a2,2,0,0,1-2,2H56a2,2,0,0,1-2-2V56a2,2,0,0,1,2-2H200a2,2,0,0,1,2,2Z`}))],[`regular`,L.createElement(L.Fragment,null,L.createElement(`path`,{d:`M200,40H56A16,16,0,0,0,40,56V200a16,16,0,0,0,16,16H200a16,16,0,0,0,16-16V56A16,16,0,0,0,200,40Zm0,160H56V56H200V200Z`}))],[`thin`,L.createElement(L.Fragment,null,L.createElement(`path`,{d:`M200,44H56A12,12,0,0,0,44,56V200a12,12,0,0,0,12,12H200a12,12,0,0,0,12-12V56A12,12,0,0,0,200,44Zm4,156a4,4,0,0,1-4,4H56a4,4,0,0,1-4-4V56a4,4,0,0,1,4-4H200a4,4,0,0,1,4,4Z`}))]]),G=L.forwardRef((e,t)=>L.createElement(l,{ref:t,...e,weights:ue}));G.displayName=`CaretRightIcon`;var K=G,q=L.forwardRef((e,t)=>L.createElement(l,{ref:t,...e,weights:de}));q.displayName=`PaperPlaneTiltIcon`;var pe=q,J=L.forwardRef((e,t)=>L.createElement(l,{ref:t,...e,weights:fe}));J.displayName=`StopIcon`;var me=J;function he(e){return e.dashboard.panels.length===1?e.dashboard.panels[0].title:e.dashboard.name}function ge(e){if(!e||typeof e!=`object`||Array.isArray(e))throw Error(`Missing panel view`);let t=e;if(!t.view||![`preset`,`query`].includes(t.view.kind)||!/^[a-f0-9]{64}$/.test(t.view.key))throw Error(`Invalid panel view identity`);if(t.dashboard?.version!==1||!Array.isArray(t.dashboard.panels)||!t.dashboard.panels.length||t.dashboard.panels.length>40||!Array.isArray(t.results)||t.dashboard.panels.some(e=>!e||typeof e.id!=`string`||!e.id)||t.results.some(e=>!e||typeof e.id!=`string`))throw Error(`Invalid panel view`);let n=new Set(t.dashboard.panels.map(e=>e.id));if(n.size!==t.dashboard.panels.length||t.results.length!==n.size||new Set(t.results.map(e=>e.id)).size!==n.size||t.results.some(e=>!n.has(e.id)||![`ok`,`empty`,`error`].includes(e.status)))throw Error(`Panel results do not match the view`);if(t.vars!==void 0&&(!t.vars||typeof t.vars!=`object`||Array.isArray(t.vars)||Object.values(t.vars).some(e=>typeof e!=`string`&&!(Array.isArray(e)&&e.every(e=>typeof e==`string`)))))throw Error(`Invalid panel variables`);if(t.trace!==void 0&&(!t.trace?.data||!Array.isArray(t.trace.data.spans)||!Array.isArray(t.trace.data.logs)||!Array.isArray(t.trace.data.services)))throw Error(`Invalid trace detail`);return t}var Y=new WeakSet;function X(e){if(!e||typeof e!=`object`||Array.isArray(e))return;if(Y.has(e))return e;let t=e;if(Object.keys(t).sort().join(`,`)===`is_error,resource_uri,tool_input,tool_name,tool_result`&&t.resource_uri===`ui://fanout/panels.html`&&typeof t.tool_name==`string`&&t.tool_name&&typeof t.is_error==`boolean`&&t.tool_input&&typeof t.tool_input==`object`&&!Array.isArray(t.tool_input)){try{ge(t.tool_result)}catch{return}return Y.add(t),t}}var _e=64,ve=300;function ye(){let e=(0,L.useRef)(null),t=(0,L.useRef)(!0),n=(0,L.useRef)(()=>{}),r=(0,L.useRef)(null),i=(0,L.useRef)(null),a=(0,L.useCallback)(()=>{let t=e.current;if(!t)return;let n=t.getBoundingClientRect().top,r=[...t.querySelectorAll(`[data-chat-anchor]`)].find(e=>e.getBoundingClientRect().bottom>n);i.current=r?{node:r,top:r.getBoundingClientRect().top}:null},[]),o=(0,L.useCallback)(()=>{let n=e.current;n&&t.current?n.scrollTop=n.scrollHeight:n&&i.current?.node.isConnected&&(n.scrollTop+=i.current.node.getBoundingClientRect().top-i.current.top),a()},[a]);return{scrollRef:(0,L.useCallback)(r=>{if(n.current(),e.current=r,!r)return;let o=0,s=!1,c=()=>{o=Date.now()},l=()=>{s=!0},u=()=>{s=!1},d=()=>{r.scrollHeight-r.clientHeight-r.scrollTop<=_e?t.current=!0:(s||Date.now()-o{r.removeEventListener(`scroll`,d),r.removeEventListener(`wheel`,c),r.removeEventListener(`touchmove`,c),r.removeEventListener(`keydown`,c),r.removeEventListener(`pointerdown`,l),window.removeEventListener(`pointerup`,u),n.current=()=>{}},t.current=!0,r.scrollTop=r.scrollHeight,i.current=null},[a]),contentRef:(0,L.useCallback)(e=>{r.current?.disconnect(),r.current=null,e&&(r.current=new ResizeObserver(o),r.current.observe(e))},[o]),toBottom:(0,L.useCallback)(()=>{t.current=!0,o()},[o])}}function be(e=1500){let[t,n]=(0,L.useState)(`idle`),r=(0,L.useRef)(null);(0,L.useEffect)(()=>()=>{r.current&&clearTimeout(r.current)},[]);function i(t){r.current&&clearTimeout(r.current),n(`idle`),(navigator.clipboard?navigator.clipboard.writeText(t):Promise.reject(Error(`clipboard unavailable`))).then(()=>n(`copied`),()=>n(`failed`)).finally(()=>{r.current=setTimeout(()=>n(`idle`),e)})}return{state:t,copy:i}}var xe={schema:`Telemetry`,context:`Context`,draft:`Draft`,validation:`Validation`,preview:`Preview`,save:`Save`},Z=e=>`${(e/1e3).toFixed(1)} s`;function Se({receipt:e,running:t=!1,activity:n=``,awaitingAnswer:r=!1}){let[i,a]=(0,L.useState)(!1),o=(0,L.useId)(),s=e.saved,l=s?.receipt.save_check,p=Object.values(e.stages).filter(e=>e.state===`complete`).length,m=[e.stages.schema.state===`complete`?`Read telemetry`:void 0,e.panel_count===void 0?void 0:`${e.panel_count} ${e.panel_count===1?`panel`:`panels`}`,l?.checked?`Checked in ${Z(l.elapsed_ms)}`:void 0,s?`Saved v${s.version}`:void 0].filter(Boolean).join(` · `)||`Building dashboard`,h=[...s?C(s.receipt):[],...e.corrections.map(e=>`Fixed ${e.panel_id}.${e.path.replace(/^panels\[\d+\]\./,``)}`)];return(0,R.jsx)(x,{"data-build-receipt":e.turn_id,"data-dashboard-result":s?.id,"data-chat-anchor":!0,withBorder:!0,radius:`md`,p:`sm`,children:(0,R.jsxs)(u,{gap:6,children:[(0,R.jsxs)(c,{gap:`xs`,justify:`space-between`,children:[(0,R.jsxs)(f,{size:`sm`,role:`status`,"aria-live":`polite`,"aria-atomic":`true`,children:[m,(0,R.jsxs)(f,{span:!0,c:`dimmed`,size:`xs`,children:[` · `,p,` stages complete`]})]}),(0,R.jsxs)(d,{component:`button`,variant:`subtle`,color:`gray`,size:`compact-xs`,"aria-expanded":i,"aria-controls":o,onClick:()=>a(e=>!e),children:[`Details`,h.length>4?` (+${h.length-4})`:``]})]}),t&&r&&(0,R.jsxs)(c,{gap:`xs`,"data-build-running":!0,children:[(0,R.jsx)(S,{type:`dots`,size:`sm`}),(0,R.jsx)(f,{c:`dimmed`,size:`sm`,children:n||`Analyzing your system`})]}),(0,R.jsx)(ie,{labels:h.slice(0,4)}),e.explanations.map(e=>t?e.split(` · `).filter(e=>!e.endsWith(`: incomplete`)).join(` · `):e).filter(Boolean).map((e,t)=>(0,R.jsx)(f,{size:`xs`,c:`dimmed`,"data-receipt-attention":!0,children:e},t)),s&&(0,R.jsx)(d,{renderRoot:e=>(0,R.jsx)(E,{...e,to:`/dashboards/$dashboardId`,params:{dashboardId:s.id},search:{}}),variant:`subtle`,size:`compact-sm`,color:`gray`,style:{alignSelf:`flex-start`},children:`Open dashboard`}),(0,R.jsx)(ae,{expanded:i,id:o,children:(0,R.jsxs)(u,{gap:4,children:[s&&(0,R.jsxs)(f,{size:`xs`,children:[s.label,` `,s.name,` · opens the current dashboard`]}),Object.entries(e.stages).map(([e,n])=>(0,R.jsxs)(f,{size:`xs`,c:`dimmed`,children:[xe[e],`: `,t&&n.state===`incomplete`?`in progress`:n.state,n.elapsed_ms===void 0?``:` · ${Z(n.elapsed_ms)}`]},e)),e.save_attempts.map((e,t)=>e.state===`retried`&&(0,R.jsxs)(f,{size:`xs`,c:`dimmed`,children:[`Save attempt `,t+1,`: retried`]},e.call_id)),!!e.context_counts.deploys&&(0,R.jsxs)(f,{size:`xs`,children:[e.context_counts.deploys,` deploys observed`]}),!!e.context_counts.anomalies&&(0,R.jsxs)(f,{size:`xs`,children:[e.context_counts.anomalies,` anomalies observed`]}),e.panels.map(e=>(0,R.jsxs)(f,{size:`xs`,children:[`Preview · `,e.id,`: `,e.status,e.elapsed_ms===void 0?``:` · ${Z(e.elapsed_ms)}`]},e.id)),l&&(0,R.jsxs)(f,{size:`xs`,children:[`Save check: `,l.checked?`checked`:`incomplete`,` · `,Z(l.elapsed_ms)]}),l?.panels.map(e=>(0,R.jsxs)(f,{size:`xs`,children:[`Save · `,e.id,`: `,e.status,` · `,e.rows??0,` rows`,e.elapsed_ms===void 0?``:` · ${Z(e.elapsed_ms)}`]},e.id)),h.slice(4).map((e,t)=>(0,R.jsx)(f,{size:`xs`,children:e},t)),e.corrections.map((e,t)=>(0,R.jsxs)(f,{size:`xs`,children:[`Fixed `,e.panel_id,`.`,e.path,`: `,e.message]},t))]})})]})})}var Ce=(0,L.lazy)(()=>j(()=>import(`./mcp-app-frame-XtROHu70.js`),__vite__mapDeps([0,1,2,3,4,5,6,7]))),Q=e=>e.tool_result.view.kind===`preset`;function we(e){let t=new Map,n=new Set,r=[],i=()=>{let e=new Map;for(let t of r){let n=t.content.tool_result.view.key;e.set(n,t)}let i=new Set([...e.values()].map(e=>e.id)),a=[...e.values()].some(e=>Q(e.content)),o=r.filter(e=>i.has(e.id)).at(-1)?.id;for(let e of r)i.has(e.id)?t.set(e.id,{content:e.content,expanded:Q(e.content)||!a&&e.id===o}):n.add(e.id);r=[]};for(let t of e)if(t.role===`user`&&i(),t.role===`activity`&&t.activityType===`mcp-app`){let e=X(t.content);e&&r.push({id:t.id,content:e})}return i(),{views:t,duplicates:n}}function Te(e){let t=new Map,n=new Map,r=new Map,i=`unattributed`;for(let a of e){if(a.role===`user`&&(n.clear(),r.clear(),i=a.id),a.role===`assistant`){i=a.id;for(let e of a.toolCalls??[])n.set(e.id,{assistant:i,name:e.function.name})}if(a.role===`tool`){let e=w(a.content);if(!a.error&&!e?.error&&e?.isError!==!0)continue;let o=n.get(a.toolCallId);if(o&&T.has(o.name)&&O(a))continue;let s=o?.assistant??i,c=r.get(s)??a.id;r.set(s,c);let l=t.get(c)??[],u=k(e?.error)?e?.error:void 0,d=typeof u?.message==`string`?u.message:typeof a.error==`string`&&a.error?a.error:`Tool execution failed`;l.push({name:o?.name??`Tool`,message:d,readOnly:u?.code===`answer_only`}),t.set(c,l)}}return t}function Ee({failures:e}){let[t,n]=(0,L.useState)(!1),r=e.filter(e=>!e.readOnly);return(0,R.jsxs)(i,{"data-chat-anchor":!0,children:[e.some(e=>e.readOnly)&&(0,R.jsx)(f,{size:`sm`,c:`dimmed`,children:`Not saved: Explain is read-only`}),r.length>0&&(0,R.jsxs)(R.Fragment,{children:[(0,R.jsxs)(o,{className:`chat-app-toggle`,"aria-expanded":t,onClick:()=>n(e=>!e),style:{color:`var(--mantine-color-dimmed)`},children:[(0,R.jsx)(`span`,{className:`chat-app-chevron`,"aria-hidden":`true`,children:t?(0,R.jsx)(N,{size:14}):(0,R.jsx)(K,{size:14})}),(0,R.jsxs)(`span`,{className:`chat-app-summary`,children:[r.length,` tool `,r.length===1?`call`:`calls`,` failed`]})]}),t&&(0,R.jsx)(u,{gap:`xs`,pl:`md`,children:r.map((e,t)=>(0,R.jsxs)(f,{size:`sm`,c:`dimmed`,style:{whiteSpace:`pre-wrap`,overflowWrap:`anywhere`},children:[e.name,`: `,e.message]},t))})]})]})}function De({view:e}){let[t,n]=(0,L.useState)(e.expanded);(0,L.useEffect)(()=>n(e.expanded),[e.expanded]);let r=e.content.tool_result,i=he(r),a=[...new Set(r.dashboard.panels.map(e=>e.viz===`timeseries`?`time series`:e.viz.replaceAll(`_`,` `)))].join(`, `),s=r.results.reduce((e,t)=>e+(t.frame?.rows??0),0),c=new Map;for(let e of r.results)e.status!==`ok`&&c.set(e.status,(c.get(e.status)??0)+1);let l=r.dashboard.panels.length>1?[`${r.dashboard.panels.length} panels`,...Array.from(c,([e,t])=>`${t} ${e}`)].join(` · `):c.size?[...c.keys()].join(`, `):`${s} ${s===1?`row`:`rows`}`;return(0,R.jsxs)(x,{"data-chat-app":!0,"data-chat-anchor":!0,withBorder:!0,radius:`lg`,style:{overflow:`hidden`},children:[(0,R.jsxs)(o,{className:`chat-app-toggle`,"aria-expanded":t,onClick:()=>n(e=>!e),children:[(0,R.jsx)(`span`,{className:`chat-app-chevron`,"aria-hidden":`true`,children:t?(0,R.jsx)(N,{size:14}):(0,R.jsx)(K,{size:14})}),(0,R.jsxs)(`span`,{className:`chat-app-summary`,children:[i,` · `,a,` · `,l]})]}),t&&(0,R.jsx)(L.Suspense,{fallback:(0,R.jsx)(b,{mih:180,children:(0,R.jsx)(S,{size:`sm`})}),children:(0,R.jsx)(Ce,{content:e.content})})]})}var Oe=[`Summarize system health for the last hour`,`Find the source of elevated errors`,`Map the current service dependencies`,`Show the slowest endpoints`];function ke(){let{agentAvailable:e,messages:t,messageTimes:n,ready:r,running:a,activity:o,provisional:s,stopped:l,error:p,threadMissing:h,send:g,retry:v,reloadThread:y,newThread:C}=A(),{scrollRef:w,contentRef:T,toBottom:E}=ye(),D=te(t),O=t.filter(e=>e.role===`user`).at(-1)?.id;if((0,L.useEffect)(()=>{O&&E()},[O,E]),!e)return(0,R.jsx)(m,{size:`sm`,py:96,children:(0,R.jsx)(x,{withBorder:!0,radius:`lg`,p:{base:`xl`,sm:40},children:(0,R.jsxs)(u,{gap:`md`,children:[(0,R.jsx)(f,{c:`brand`,fw:700,size:`xs`,tt:`uppercase`,lts:`0.12em`,children:`Optional capability`}),(0,R.jsx)(ee,{order:1,fz:28,children:`Chat is not configured`}),(0,R.jsx)(f,{c:`dimmed`,children:`Add an AI provider key to enable chat. Telemetry ingest, dashboards, traces, logs, and metrics remain available without it.`}),(0,R.jsx)(d,{component:`a`,href:`/dashboards`,variant:`light`,mt:`sm`,children:`Open dashboards`})]})})});let k=we(t),j=Te(t),M=t.filter(e=>k.duplicates.has(e.id)?!1:e.role===`tool`?j.has(e.id):e.role===`assistant`?!e.toolCalls?.length&&typeof e.content==`string`&&e.content.trim().length>0:e.role===`activity`?e.activityType===`mcp-app`||e.activityType===`agent-outcome`:e.role===`user`),N=t.findIndex(e=>e.id===O),P=t.slice(N+1).some(e=>e.role===`assistant`&&!e.toolCalls?.length&&typeof e.content==`string`&&e.content.length>0),F=t.slice(N+1).filter(e=>e.role===`assistant`&&!e.toolCalls?.length&&typeof e.content==`string`&&e.content.trim().length>0).at(-1),I=a&&s&&!s.collapsed&&s.text&&!P;return(0,R.jsxs)(i,{className:`chat-pane`,children:[(0,R.jsx)(i,{className:`chat-scroll`,ref:w,tabIndex:0,role:`log`,"aria-label":`Conversation`,children:(0,R.jsxs)(m,{size:880,px:{base:`md`,sm:`xl`},py:`lg`,ref:T,children:[h&&(0,R.jsx)(_,{color:`warn`,radius:`lg`,title:`This chat no longer exists`,children:(0,R.jsxs)(c,{justify:`space-between`,children:[(0,R.jsx)(f,{size:`sm`,children:`It was deleted, or the link is wrong.`}),(0,R.jsx)(d,{size:`compact-sm`,variant:`light`,onClick:C,children:`New chat`})]})}),!h&&!r&&p&&(0,R.jsx)(Ae,{message:p,onRetry:y,onNewThread:C}),!h&&!r&&!p&&(0,R.jsxs)(b,{mih:`40vh`,children:[(0,R.jsx)(S,{size:`sm`}),(0,R.jsx)(f,{c:`dimmed`,size:`sm`,ml:`sm`,children:`Loading chat`})]}),!h&&r&&(0,R.jsxs)(R.Fragment,{children:[M.length===0&&(0,R.jsx)(Me,{onSelect:g}),(0,R.jsxs)(u,{gap:`lg`,children:[M.filter(e=>e.id!==F?.id).map(e=>j.has(e.id)?(0,R.jsx)(Ee,{failures:j.get(e.id)},e.id):(0,R.jsxs)(i,{children:[(0,R.jsx)(Ne,{message:e,time:n[e.id],appView:k.views.get(e.id)}),D.has(e.id)&&(0,R.jsx)(i,{mt:`sm`,children:(0,R.jsx)(Se,{receipt:D.get(e.id),running:a&&e.id===O,awaitingAnswer:!P&&!I,activity:o})})]},e.id)),(F||I)&&(0,R.jsx)(i,{"data-answer-position":!0,children:(0,R.jsx)(Ne,{message:I?{id:s.id,role:`assistant`,content:s.text}:F,provisional:!!I,time:I?void 0:n[F.id]})},`answer-${O??`draft`}`),a&&!P&&!I&&!D.has(O??``)&&(0,R.jsxs)(c,{gap:`xs`,role:`status`,children:[(0,R.jsx)(S,{type:`dots`,size:`sm`}),(0,R.jsx)(f,{c:`dimmed`,size:`sm`,children:o||`Analyzing your system`})]}),l&&(0,R.jsx)(f,{c:`dimmed`,size:`sm`,children:`Stopped`}),p&&(0,R.jsx)(Ae,{message:p,onRetry:v})]})]})]})}),!h&&(0,R.jsx)(je,{})]})}function Ae({message:e,onRetry:t,onNewThread:n}){return(0,R.jsx)(_,{color:`bad`,radius:`lg`,title:`Something went wrong`,children:(0,R.jsxs)(c,{justify:`space-between`,gap:`sm`,wrap:`nowrap`,children:[(0,R.jsx)(f,{size:`sm`,children:e}),(0,R.jsxs)(c,{gap:`xs`,wrap:`nowrap`,children:[n&&(0,R.jsx)(d,{size:`compact-sm`,variant:`subtle`,color:`bad`,onClick:n,children:`New chat`}),(0,R.jsx)(d,{size:`compact-sm`,variant:`light`,color:`bad`,onClick:t,children:`Retry`})]})]})})}function je(){let{input:e,setInput:t,inputRef:n,submit:r,send:a,stop:o,ready:s,running:l}=A();return(0,R.jsx)(i,{className:`chat-composer`,children:(0,R.jsxs)(m,{size:880,px:{base:`md`,sm:`xl`},children:[(0,R.jsx)(x,{component:`form`,onSubmit:r,className:`chat-composer-field`,withBorder:!0,radius:24,py:6,pl:`lg`,pr:6,children:(0,R.jsxs)(c,{align:`flex-end`,gap:`xs`,wrap:`nowrap`,children:[(0,R.jsx)(H,{ref:n,"aria-label":`Message Fanout`,value:e,onChange:e=>t(e.currentTarget.value),onKeyDown:t=>{t.key===`Enter`&&!t.shiftKey&&(t.preventDefault(),a(e))},placeholder:l?`Fanout is working…`:`Ask about health, errors, or latency…`,disabled:!s,autosize:!0,minRows:1,maxRows:8,variant:`unstyled`,flex:1}),l?(0,R.jsx)(M,{label:`Stop`,children:(0,R.jsx)(D,{type:`button`,variant:`default`,size:40,radius:`xl`,"aria-label":`Stop`,onClick:o,children:(0,R.jsx)(me,{size:16,weight:`fill`})})}):(0,R.jsx)(D,{type:`submit`,variant:`filled`,size:40,radius:`xl`,disabled:!e.trim()||!s,"aria-label":`Send message`,children:(0,R.jsx)(pe,{size:17,weight:`fill`})})]})}),(0,R.jsx)(f,{c:`dimmed`,size:`xs`,ta:`center`,mt:6,children:`Enter to send, Shift+Enter for a new line`})]})})}function Me({onSelect:e}){return(0,R.jsxs)(u,{align:`center`,gap:`md`,pt:{base:32,sm:88},pb:`xl`,ta:`center`,children:[(0,R.jsx)(g,{size:`large`}),(0,R.jsx)(ee,{order:1,fz:24,fw:500,lh:1.25,maw:560,children:`What do you want to know about your system?`}),(0,R.jsx)(c,{justify:`center`,gap:`xs`,mt:`xs`,maw:720,children:Oe.map(t=>(0,R.jsx)(d,{variant:`default`,size:`sm`,radius:`xl`,onClick:()=>void e(t),children:t},t))})]})}function Ne({message:e,time:t,appView:n,provisional:r=!1}){if(e.role===`activity`)return e.activityType===`agent-outcome`&&e.content&&typeof e.content==`object`&&`message`in e.content&&typeof e.content.message==`string`?`status`in e.content&&e.content.status===`stopped`?(0,R.jsx)(f,{c:`dimmed`,size:`sm`,"data-chat-anchor":!0,children:e.content.message}):(0,R.jsx)(_,{color:`bad`,title:`Something went wrong`,"data-chat-anchor":!0,children:e.content.message}):e.activityType===`mcp-app`?n?(0,R.jsx)(De,{view:n}):(0,R.jsx)(_,{color:`bad`,"data-chat-anchor":!0,children:`This view could not be loaded. Please try again.`}):null;if(e.role===`assistant`&&e.toolCalls?.length)return null;let a=typeof e.content==`string`?e.content:JSON.stringify(e.content);if(!a&&e.role===`assistant`)return null;let o=e.role===`user`,s=t?new Intl.DateTimeFormat(void 0,{hour:`numeric`,minute:`2-digit`}).format(new Date(t)):``;return(0,R.jsxs)(i,{className:`chat-message${r?` chat-message--provisional`:``}`,"data-chat-anchor":!0,"data-role":o?`user`:`assistant`,children:[o?(0,R.jsx)(x,{radius:`lg`,px:`md`,py:`sm`,bg:`var(--mantine-color-brand-light)`,maw:`70%`,ml:`auto`,w:`fit-content`,children:(0,R.jsx)(f,{style:{whiteSpace:`pre-wrap`},children:a})}):(0,R.jsx)(W,{className:`chat-markdown${r?` chat-markdown--provisional`:``}`,"data-provisional":r||void 0,children:(0,R.jsx)(re,{remarkPlugins:[I],components:Fe,children:a})}),(r||s||!o)&&(0,R.jsx)(c,{className:`chat-message-meta`,gap:6,justify:o?`flex-end`:`flex-start`,mt:4,h:24,children:r?(0,R.jsx)(S,{type:`dots`,size:20}):(0,R.jsxs)(R.Fragment,{children:[s&&t&&(0,R.jsx)(f,{c:`dimmed`,size:`xs`,title:ne(t),children:s}),!o&&(0,R.jsx)(Pe,{text:a,label:`Copy message`})]})})]})}function Pe({text:e,label:t}){let{state:n,copy:r}=be();return(0,R.jsx)(M,{label:n===`failed`?`Could not copy`:n===`copied`?`Copied`:t,children:(0,R.jsx)(D,{variant:`subtle`,color:`gray`,size:`sm`,"aria-label":t,"data-state":n===`idle`?void 0:n,onClick:()=>r(e),children:n===`copied`?(0,R.jsx)(p,{size:13,weight:`bold`}):(0,R.jsx)(v,{size:13})})})}var Fe={table:({children:e})=>(0,R.jsx)(i,{className:`chat-table`,children:(0,R.jsx)(F,{striped:!0,highlightOnHover:!0,withTableBorder:!0,verticalSpacing:`xs`,fz:`sm`,children:e})}),thead:({children:e})=>(0,R.jsx)(F.Thead,{children:e}),tbody:({children:e})=>(0,R.jsx)(F.Tbody,{children:e}),tr:({children:e})=>(0,R.jsx)(F.Tr,{children:e}),th:({children:e})=>(0,R.jsx)(F.Th,{children:e}),td:({children:e})=>(0,R.jsx)(F.Td,{children:e}),pre:({children:e})=>(0,R.jsx)(Ie,{children:e}),a:({href:e,children:t})=>(0,R.jsx)(`a`,{href:e,target:`_blank`,rel:`noopener noreferrer`,children:t})};function Ie({children:e}){let t=$(e);return(0,R.jsxs)(i,{className:`chat-code`,pos:`relative`,children:[(0,R.jsx)(i,{className:`chat-code-actions`,pos:`absolute`,top:6,right:6,children:(0,R.jsx)(Pe,{text:t,label:`Copy code`})}),(0,R.jsx)(`pre`,{children:e})]})}function $(e){return typeof e==`string`?e:Array.isArray(e)?e.map($).join(``):e&&typeof e==`object`&&`props`in e?$(e.props.children):``}export{X as n,ke as t}; \ No newline at end of file diff --git a/internal/ui/dist/assets/chat._threadId-CybsW_0R.js b/internal/ui/dist/assets/chat._threadId-CybsW_0R.js new file mode 100644 index 000000000..6edc84dfa --- /dev/null +++ b/internal/ui/dist/assets/chat._threadId-CybsW_0R.js @@ -0,0 +1 @@ +import{t as e}from"./chat-CAy267fh.js";var t=e;export{t as component}; \ No newline at end of file diff --git a/internal/ui/dist/assets/chat._threadId-eVfsC4Jb.js b/internal/ui/dist/assets/chat._threadId-eVfsC4Jb.js deleted file mode 100644 index 40445052d..000000000 --- a/internal/ui/dist/assets/chat._threadId-eVfsC4Jb.js +++ /dev/null @@ -1 +0,0 @@ -import{t as e}from"./chat-_owdy9Bf.js";var t=e;export{t as component}; \ No newline at end of file diff --git a/internal/ui/dist/assets/chat.index-CybsW_0R.js b/internal/ui/dist/assets/chat.index-CybsW_0R.js new file mode 100644 index 000000000..6edc84dfa --- /dev/null +++ b/internal/ui/dist/assets/chat.index-CybsW_0R.js @@ -0,0 +1 @@ +import{t as e}from"./chat-CAy267fh.js";var t=e;export{t as component}; \ No newline at end of file diff --git a/internal/ui/dist/assets/chat.index-eVfsC4Jb.js b/internal/ui/dist/assets/chat.index-eVfsC4Jb.js deleted file mode 100644 index 40445052d..000000000 --- a/internal/ui/dist/assets/chat.index-eVfsC4Jb.js +++ /dev/null @@ -1 +0,0 @@ -import{t as e}from"./chat-_owdy9Bf.js";var t=e;export{t as component}; \ No newline at end of file diff --git a/internal/ui/dist/assets/dashboard-change-chips-C08J6wNb.js b/internal/ui/dist/assets/dashboard-change-chips-BKnD9tpX.js similarity index 99% rename from internal/ui/dist/assets/dashboard-change-chips-C08J6wNb.js rename to internal/ui/dist/assets/dashboard-change-chips-BKnD9tpX.js index 3fe4c1bad..eb6d942c5 100644 --- a/internal/ui/dist/assets/dashboard-change-chips-C08J6wNb.js +++ b/internal/ui/dist/assets/dashboard-change-chips-BKnD9tpX.js @@ -1,4 +1,4 @@ -import{a as e,i as t,o as n,r,s as i}from"./useRouter-ByJ6_rwb.js";import{A as a,C as o,K as s,M as c,P as l,Q as u,T as d,X as f,_ as p,_t as m,a as h,et as g,mt as _,rt as v,ut as y,z as b}from"./brand-Bcp2Tp5I.js";import{m as x}from"./preload-helper-DpsUT6aH.js";import{E as S,S as C,o as w}from"./Tooltip-DhnGSmh7.js";var T=i(t(),1),E=i(m(),1);function D(e){if(!e||typeof e==`string`)return 0;let t=e/36;return Math.round((4+15*t**.25+t/5)*10)}function O(e){return e.current?e.current.scrollHeight:`auto`}function k(e){return typeof e==`number`&&e>0}function ee({transitionDuration:e,transitionTimingFunction:t=`ease`,onTransitionEnd:n,onTransitionStart:r,expanded:i,keepMounted:a}){let o={height:0,overflow:`hidden`,...a?{}:{display:`none`}},s=(0,T.useEffectEvent)(()=>r?.()),c=(0,T.useEffectEvent)(()=>n?.()),l=(0,T.useRef)(null),[u,d]=(0,T.useState)(i?{}:o),[f,p]=(0,T.useState)(i?`entered`:`exited`),m=e=>{(0,E.flushSync)(()=>d(e))},h=e=>{m(t=>({...t,...e}))},_=n=>{let r=e??D(n);return{transition:`height ${r}ms ${t}, opacity ${r}ms ${t}`}},y=(0,T.useRef)(0);v(()=>{y.current+=1;let t=y.current,n=()=>y.current===t;e!==0&&s(),i?window.requestAnimationFrame(()=>{n()&&l.current&&((0,E.flushSync)(()=>p(`entering`)),h({willChange:`height`,display:`block`,overflow:`hidden`}),window.requestAnimationFrame(()=>{if(!n()||!l.current)return;let e=O(l);if(!k(e)){m({}),p(`entered`),c();return}h({..._(e),height:e})}))}):window.requestAnimationFrame(()=>{if(!n()||!l.current)return;(0,E.flushSync)(()=>p(`exiting`));let e=O(l);if(!k(e)){m(o),p(`exited`),c();return}h({..._(e),willChange:`height`,height:e}),window.requestAnimationFrame(()=>{n()&&l.current&&h({height:0,overflow:`hidden`})})})},[i]);let b=e=>{if(e.target===l.current&&e.propertyName===`height`){if(i){let e=O(l);e===u.height?m({}):h({height:e}),p(`entered`),c()}else u.height===0&&(m(o),p(`exited`),c())}};return{state:f,getCollapseProps:e=>({"aria-hidden":!i,inert:!i,ref:g(l,e?.ref),onTransitionEnd:b,style:{boxSizing:`border-box`,...e?.style,...u}})}}function te(e){if(!e||typeof e==`string`)return 0;let t=e/36;return Math.round((4+15*t**.25+t/5)*10)}function A(e){return e.current?e.current.scrollWidth:`auto`}function j({transitionDuration:e,transitionTimingFunction:t=`ease`,onTransitionEnd:n,onTransitionStart:r,expanded:i,keepMounted:a}){let o={width:0,overflow:`hidden`,...a?{}:{display:`none`}},s=(0,T.useEffectEvent)(()=>r?.()),c=(0,T.useEffectEvent)(()=>n?.()),l=(0,T.useRef)(null),[u,d]=(0,T.useState)(i?{}:o),[f,p]=(0,T.useState)(i?`entered`:`exited`),m=e=>{(0,E.flushSync)(()=>d(e))},h=e=>{m(t=>({...t,...e}))},_=n=>{let r=e??te(n);return{transition:`width ${r}ms ${t}, opacity ${r}ms ${t}`}},y=(0,T.useRef)(0);v(()=>{y.current+=1;let t=y.current,n=()=>y.current===t;e!==0&&s(),i?window.requestAnimationFrame(()=>{n()&&l.current&&((0,E.flushSync)(()=>p(`entering`)),h({willChange:`width`,display:`block`,overflow:`hidden`}),window.requestAnimationFrame(()=>{if(!n()||!l.current)return;let e=A(l);if(!k(e)){m({}),p(`entered`),c();return}h({..._(e),width:e})}))}):window.requestAnimationFrame(()=>{if(!n()||!l.current)return;(0,E.flushSync)(()=>p(`exiting`));let e=A(l);if(!k(e)){m(o),p(`exited`),c();return}h({..._(e),willChange:`width`,width:e}),window.requestAnimationFrame(()=>{n()&&l.current&&h({width:0,overflow:`hidden`})})})},[i]);let b=e=>{if(e.target===l.current&&e.propertyName===`width`){if(i){let e=A(l);e===u.width?m({}):h({width:e}),p(`entered`),c()}else u.width===0&&(m(o),p(`exited`),c())}};return{state:f,getCollapseProps:e=>({"aria-hidden":!i,inert:!i,ref:g(l,e?.ref),onTransitionEnd:b,style:{boxSizing:`border-box`,...e?.style,...u}})}}function ne(){return`development`}var M=r(),N={transitionDuration:200,transitionTimingFunction:`ease`,animateOpacity:!0,orientation:`vertical`,keepMounted:!0,keepMountedMode:`activity`},re=d(e=>{let{children:t,expanded:n,transitionDuration:r,transitionTimingFunction:i,style:a,onTransitionEnd:s,onTransitionStart:d,animateOpacity:f,keepMounted:p,keepMountedMode:m,ref:h,orientation:g,..._}=c(`Collapse`,N,e),v=b(),y=l(),x=u(),S=y.respectReducedMotion&&x?0:r,w=(g===`horizontal`?j:ee)({expanded:n,transitionDuration:S,transitionTimingFunction:i,onTransitionEnd:s,onTransitionStart:d,keepMounted:!1});if(S===0)return p===!0&&(m===`display-none`||v!==`test`)?m===`display-none`?(0,M.jsx)(o,{..._,style:{...C(a,y),...n?{}:{display:`none`}},ref:h,children:t}):(0,M.jsx)(T.Activity,{mode:n?`visible`:`hidden`,children:(0,M.jsx)(o,{..._,style:a,ref:h,children:t})}):n?(0,M.jsx)(o,{..._,style:a,ref:h,children:t}):null;let E=w.state===`exited`,D;return D=p===!1?E?null:t:p===!0?m===`display-none`?t:(0,M.jsx)(T.Activity,{mode:E?`hidden`:`visible`,children:t}):t,(0,M.jsx)(o,{..._,...w.getCollapseProps({style:{opacity:n||!f?1:0,transition:f?`opacity ${S}ms ${i}`:`none`,...C(a,y),...p&&m===`display-none`&&E?{display:`none`}:{}},ref:h}),children:D})});re.displayName=`@mantine/core/Collapse`;var[ie,ae]=S(`Table component was not found in the tree`),oe={table:`m_b23fa0ef`,th:`m_4e7aa4f3`,tr:`m_4e7aa4fd`,td:`m_4e7aa4ef`,tbody:`m_b2404537`,thead:`m_b242d975`,caption:`m_9e5a3ac7`,scrollContainer:`m_a100c15`,scrollContainerInner:`m_62259741`};function se(e,t){if(!t)return;let n={};return t.columnBorder&&e.withColumnBorders&&(n[`data-with-column-border`]=!0),t.rowBorder&&e.withRowBorders&&(n[`data-with-row-border`]=!0),t.striped&&e.striped&&(n[`data-striped`]=e.striped),t.highlightOnHover&&e.highlightOnHover&&(n[`data-hover`]=!0),t.captionSide&&e.captionSide&&(n[`data-side`]=e.captionSide),t.stickyHeader&&e.stickyHeader&&(n[`data-sticky`]=!0),n}function ce(e,t){let n=`Table${e.charAt(0).toUpperCase()}${e.slice(1)}`,r=d(r=>{let i=c(n,{},r),{classNames:a,className:s,style:l,styles:u,...d}=i,f=ae();return(0,M.jsx)(o,{component:e,...se(f,t),...f.getStyles(e,{className:s,classNames:a,style:l,styles:u,props:i}),...d})});return r.displayName=`@mantine/core/${n}`,r.classes=oe,r}var le=ce(`th`,{columnBorder:!0}),ue=ce(`td`,{columnBorder:!0}),de=ce(`tr`,{rowBorder:!0,striped:!0,highlightOnHover:!0}),fe=ce(`thead`,{stickyHeader:!0}),pe=ce(`tbody`),me=ce(`tfoot`),he=ce(`caption`,{captionSide:!0}),ge={type:`scrollarea`},_e=f((e,{minWidth:t,maxHeight:n,type:r})=>({scrollContainer:{"--table-min-width":_(t),"--table-max-height":_(n),"--table-overflow":r===`native`?`auto`:void 0}})),ve=d(e=>{let t=c(`TableScrollContainer`,ge,e),{classNames:n,className:r,style:i,styles:s,unstyled:l,vars:u,children:d,minWidth:f,maxHeight:p,type:m,scrollAreaProps:h,attributes:g,..._}=t,v=a({name:`TableScrollContainer`,classes:oe,props:t,className:r,style:i,classNames:n,styles:s,unstyled:l,attributes:g,vars:u,varsResolver:_e,rootSelector:`scrollContainer`});return(0,M.jsx)(o,{component:m===`scrollarea`?w:`div`,...m===`scrollarea`?p?{offsetScrollbars:`xy`,...h}:{offsetScrollbars:`x`,...h}:{},...v(`scrollContainer`),..._,children:(0,M.jsx)(`div`,{...v(`scrollContainerInner`),children:d})})});ve.classes=oe,ve.varsResolver=_e,ve.displayName=`@mantine/core/TableScrollContainer`;function ye({data:e}){return(0,M.jsxs)(M.Fragment,{children:[e.caption&&(0,M.jsx)(he,{children:e.caption}),e.head&&(0,M.jsx)(fe,{children:(0,M.jsx)(de,{children:e.head.map((e,t)=>(0,M.jsx)(le,{children:e},t))})}),e.body&&(0,M.jsx)(pe,{children:e.body.map((e,t)=>(0,M.jsx)(de,{children:e.map((e,t)=>(0,M.jsx)(ue,{children:e},t))},t))}),e.foot&&(0,M.jsx)(me,{children:(0,M.jsx)(de,{children:e.foot.map((e,t)=>(0,M.jsx)(le,{children:e},t))})})]})}ye.displayName=`@mantine/core/TableDataRenderer`;var be={withRowBorders:!0,verticalSpacing:7},xe=f((e,{layout:t,captionSide:n,horizontalSpacing:r,verticalSpacing:i,borderColor:a,stripedColor:o,highlightOnHoverColor:c,striped:l,highlightOnHover:u,stickyHeaderOffset:d,stickyHeader:f})=>({table:{"--table-layout":t,"--table-caption-side":n,"--table-horizontal-spacing":y(r),"--table-vertical-spacing":y(i),"--table-border-color":a?s(a,e):void 0,"--table-striped-color":l&&o?s(o,e):void 0,"--table-highlight-on-hover-color":u&&c?s(c,e):void 0,"--table-sticky-header-offset":f?_(d):void 0}})),P=d(e=>{let t=c(`Table`,be,e),{classNames:n,className:r,style:i,styles:s,unstyled:l,vars:u,horizontalSpacing:d,verticalSpacing:f,captionSide:p,stripedColor:m,highlightOnHoverColor:h,striped:g,highlightOnHover:_,withColumnBorders:v,withRowBorders:y,withTableBorder:b,borderColor:x,layout:S,data:C,children:w,stickyHeader:E,stickyHeaderOffset:D,mod:O,tabularNums:k,attributes:ee,...te}=t,A=a({name:`Table`,props:t,className:r,style:i,classes:oe,classNames:n,styles:s,unstyled:l,attributes:ee,rootSelector:`table`,vars:u,varsResolver:xe,stable:!0}),j=g===!0?`odd`:g||void 0,ne=p||`bottom`,N=(0,T.useMemo)(()=>({getStyles:A,stickyHeader:E,striped:j,highlightOnHover:_,withColumnBorders:v,withRowBorders:y,captionSide:ne}),[A,E,j,_,v,y,ne]);return(0,M.jsx)(ie,{value:N,children:(0,M.jsx)(o,{component:`table`,mod:[{withTableBorder:b,tabularNums:k},O],...A(`table`),...te,children:w||!!C&&(0,M.jsx)(ye,{data:C})})})});P.classes=oe,P.varsResolver=xe,P.displayName=`@mantine/core/Table`,P.Td=ue,P.Th=le,P.Tr=de,P.Thead=fe,P.Tbody=pe,P.Tfoot=me,P.Caption=he,P.ScrollContainer=ve,P.DataRenderer=ye;var Se=new Map([[`bold`,T.createElement(T.Fragment,null,T.createElement(`path`,{d:`M216.49,104.49l-80,80a12,12,0,0,1-17,0l-80-80a12,12,0,0,1,17-17L128,159l71.51-71.52a12,12,0,0,1,17,17Z`}))],[`duotone`,T.createElement(T.Fragment,null,T.createElement(`path`,{d:`M208,96l-80,80L48,96Z`,opacity:`0.2`}),T.createElement(`path`,{d:`M215.39,92.94A8,8,0,0,0,208,88H48a8,8,0,0,0-5.66,13.66l80,80a8,8,0,0,0,11.32,0l80-80A8,8,0,0,0,215.39,92.94ZM128,164.69,67.31,104H188.69Z`}))],[`fill`,T.createElement(T.Fragment,null,T.createElement(`path`,{d:`M213.66,101.66l-80,80a8,8,0,0,1-11.32,0l-80-80A8,8,0,0,1,48,88H208a8,8,0,0,1,5.66,13.66Z`}))],[`light`,T.createElement(T.Fragment,null,T.createElement(`path`,{d:`M212.24,100.24l-80,80a6,6,0,0,1-8.48,0l-80-80a6,6,0,0,1,8.48-8.48L128,167.51l75.76-75.75a6,6,0,0,1,8.48,8.48Z`}))],[`regular`,T.createElement(T.Fragment,null,T.createElement(`path`,{d:`M213.66,101.66l-80,80a8,8,0,0,1-11.32,0l-80-80A8,8,0,0,1,53.66,90.34L128,164.69l74.34-74.35a8,8,0,0,1,11.32,11.32Z`}))],[`thin`,T.createElement(T.Fragment,null,T.createElement(`path`,{d:`M210.83,98.83l-80,80a4,4,0,0,1-5.66,0l-80-80a4,4,0,0,1,5.66-5.66L128,170.34l77.17-77.17a4,4,0,1,1,5.66,5.66Z`}))]]),Ce=T.forwardRef((e,t)=>T.createElement(h,{ref:t,...e,weights:Se}));Ce.displayName=`CaretDownIcon`;var we=Ce;function Te(e,t){let n=t||{};return(e[e.length-1]===``?[...e,``]:e).join((n.padRight?` `:``)+`,`+(n.padLeft===!1?``:` `)).trim()}var Ee=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,De=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,Oe={};function ke(e,t){return((t||Oe).jsx?De:Ee).test(e)}var Ae=/[ \t\n\f\r]/g;function je(e){return typeof e==`object`?e.type===`text`&&Me(e.value):Me(e)}function Me(e){return e.replace(Ae,``)===``}var Ne=class{constructor(e,t,n){this.normal=t,this.property=e,n&&(this.space=n)}};Ne.prototype.normal={},Ne.prototype.property={},Ne.prototype.space=void 0;function Pe(e,t){let n={},r={};for(let t of e)Object.assign(n,t.property),Object.assign(r,t.normal);return new Ne(n,r,t)}function Fe(e){return e.toLowerCase()}var F=class{constructor(e,t){this.attribute=t,this.property=e}};F.prototype.attribute=``,F.prototype.booleanish=!1,F.prototype.boolean=!1,F.prototype.commaOrSpaceSeparated=!1,F.prototype.commaSeparated=!1,F.prototype.defined=!1,F.prototype.mustUseProperty=!1,F.prototype.number=!1,F.prototype.overloadedBoolean=!1,F.prototype.property=``,F.prototype.spaceSeparated=!1,F.prototype.space=void 0;var Ie=n({boolean:()=>I,booleanish:()=>L,commaOrSpaceSeparated:()=>B,commaSeparated:()=>ze,number:()=>R,overloadedBoolean:()=>Re,spaceSeparated:()=>z}),Le=0,I=Be(),L=Be(),Re=Be(),R=Be(),z=Be(),ze=Be(),B=Be();function Be(){return 2**++Le}var Ve=Object.keys(Ie),He=class extends F{constructor(e,t,n,r){let i=-1;if(super(e,t),Ue(this,`space`,r),typeof n==`number`)for(;++i4&&n.slice(0,4)===`data`&&nt.test(t)){if(t.charAt(4)===`-`){let e=t.slice(5).replace(tt,at);r=`data`+e.charAt(0).toUpperCase()+e.slice(1)}else{let e=t.slice(4);if(!tt.test(e)){let n=e.replace(et,it);n.charAt(0)!==`-`&&(n=`-`+n),t=`data`+n}}i=He}return new i(r,t)}function it(e){return`-`+e.toLowerCase()}function at(e){return e.charAt(1).toUpperCase()}var ot=Pe([Ge,Je,Xe,Ze,Qe],`html`),st=Pe([Ge,Ye,Xe,Ze,Qe],`svg`);function ct(e){return e.join(` `).trim()}var lt=e(((e,t)=>{var n=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,r=/\n/g,i=/^\s*/,a=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,o=/^:\s*/,s=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,c=/^[;\s]*/,l=/^\s+|\s+$/g;function u(e,t){if(typeof e!=`string`)throw TypeError(`First argument must be a string`);if(!e)return[];t||={};var l=1,u=1;function f(e){var t=e.match(r);t&&(l+=t.length);var n=e.lastIndexOf(` +import{a as e,i as t,o as n,r,s as i}from"./useRouter-ByJ6_rwb.js";import{A as a,C as o,K as s,M as c,P as l,Q as u,T as d,X as f,_ as p,_t as m,a as h,et as g,mt as _,rt as v,ut as y,z as b}from"./brand-DUaZkIz1.js";import{m as x}from"./preload-helper-FMCtZeYw.js";import{E as S,S as C,o as w}from"./Tooltip-B3r3s_B9.js";var T=i(t(),1),E=i(m(),1);function D(e){if(!e||typeof e==`string`)return 0;let t=e/36;return Math.round((4+15*t**.25+t/5)*10)}function O(e){return e.current?e.current.scrollHeight:`auto`}function k(e){return typeof e==`number`&&e>0}function ee({transitionDuration:e,transitionTimingFunction:t=`ease`,onTransitionEnd:n,onTransitionStart:r,expanded:i,keepMounted:a}){let o={height:0,overflow:`hidden`,...a?{}:{display:`none`}},s=(0,T.useEffectEvent)(()=>r?.()),c=(0,T.useEffectEvent)(()=>n?.()),l=(0,T.useRef)(null),[u,d]=(0,T.useState)(i?{}:o),[f,p]=(0,T.useState)(i?`entered`:`exited`),m=e=>{(0,E.flushSync)(()=>d(e))},h=e=>{m(t=>({...t,...e}))},_=n=>{let r=e??D(n);return{transition:`height ${r}ms ${t}, opacity ${r}ms ${t}`}},y=(0,T.useRef)(0);v(()=>{y.current+=1;let t=y.current,n=()=>y.current===t;e!==0&&s(),i?window.requestAnimationFrame(()=>{n()&&l.current&&((0,E.flushSync)(()=>p(`entering`)),h({willChange:`height`,display:`block`,overflow:`hidden`}),window.requestAnimationFrame(()=>{if(!n()||!l.current)return;let e=O(l);if(!k(e)){m({}),p(`entered`),c();return}h({..._(e),height:e})}))}):window.requestAnimationFrame(()=>{if(!n()||!l.current)return;(0,E.flushSync)(()=>p(`exiting`));let e=O(l);if(!k(e)){m(o),p(`exited`),c();return}h({..._(e),willChange:`height`,height:e}),window.requestAnimationFrame(()=>{n()&&l.current&&h({height:0,overflow:`hidden`})})})},[i]);let b=e=>{if(e.target===l.current&&e.propertyName===`height`){if(i){let e=O(l);e===u.height?m({}):h({height:e}),p(`entered`),c()}else u.height===0&&(m(o),p(`exited`),c())}};return{state:f,getCollapseProps:e=>({"aria-hidden":!i,inert:!i,ref:g(l,e?.ref),onTransitionEnd:b,style:{boxSizing:`border-box`,...e?.style,...u}})}}function te(e){if(!e||typeof e==`string`)return 0;let t=e/36;return Math.round((4+15*t**.25+t/5)*10)}function A(e){return e.current?e.current.scrollWidth:`auto`}function j({transitionDuration:e,transitionTimingFunction:t=`ease`,onTransitionEnd:n,onTransitionStart:r,expanded:i,keepMounted:a}){let o={width:0,overflow:`hidden`,...a?{}:{display:`none`}},s=(0,T.useEffectEvent)(()=>r?.()),c=(0,T.useEffectEvent)(()=>n?.()),l=(0,T.useRef)(null),[u,d]=(0,T.useState)(i?{}:o),[f,p]=(0,T.useState)(i?`entered`:`exited`),m=e=>{(0,E.flushSync)(()=>d(e))},h=e=>{m(t=>({...t,...e}))},_=n=>{let r=e??te(n);return{transition:`width ${r}ms ${t}, opacity ${r}ms ${t}`}},y=(0,T.useRef)(0);v(()=>{y.current+=1;let t=y.current,n=()=>y.current===t;e!==0&&s(),i?window.requestAnimationFrame(()=>{n()&&l.current&&((0,E.flushSync)(()=>p(`entering`)),h({willChange:`width`,display:`block`,overflow:`hidden`}),window.requestAnimationFrame(()=>{if(!n()||!l.current)return;let e=A(l);if(!k(e)){m({}),p(`entered`),c();return}h({..._(e),width:e})}))}):window.requestAnimationFrame(()=>{if(!n()||!l.current)return;(0,E.flushSync)(()=>p(`exiting`));let e=A(l);if(!k(e)){m(o),p(`exited`),c();return}h({..._(e),willChange:`width`,width:e}),window.requestAnimationFrame(()=>{n()&&l.current&&h({width:0,overflow:`hidden`})})})},[i]);let b=e=>{if(e.target===l.current&&e.propertyName===`width`){if(i){let e=A(l);e===u.width?m({}):h({width:e}),p(`entered`),c()}else u.width===0&&(m(o),p(`exited`),c())}};return{state:f,getCollapseProps:e=>({"aria-hidden":!i,inert:!i,ref:g(l,e?.ref),onTransitionEnd:b,style:{boxSizing:`border-box`,...e?.style,...u}})}}function ne(){return`development`}var M=r(),N={transitionDuration:200,transitionTimingFunction:`ease`,animateOpacity:!0,orientation:`vertical`,keepMounted:!0,keepMountedMode:`activity`},re=d(e=>{let{children:t,expanded:n,transitionDuration:r,transitionTimingFunction:i,style:a,onTransitionEnd:s,onTransitionStart:d,animateOpacity:f,keepMounted:p,keepMountedMode:m,ref:h,orientation:g,..._}=c(`Collapse`,N,e),v=b(),y=l(),x=u(),S=y.respectReducedMotion&&x?0:r,w=(g===`horizontal`?j:ee)({expanded:n,transitionDuration:S,transitionTimingFunction:i,onTransitionEnd:s,onTransitionStart:d,keepMounted:!1});if(S===0)return p===!0&&(m===`display-none`||v!==`test`)?m===`display-none`?(0,M.jsx)(o,{..._,style:{...C(a,y),...n?{}:{display:`none`}},ref:h,children:t}):(0,M.jsx)(T.Activity,{mode:n?`visible`:`hidden`,children:(0,M.jsx)(o,{..._,style:a,ref:h,children:t})}):n?(0,M.jsx)(o,{..._,style:a,ref:h,children:t}):null;let E=w.state===`exited`,D;return D=p===!1?E?null:t:p===!0?m===`display-none`?t:(0,M.jsx)(T.Activity,{mode:E?`hidden`:`visible`,children:t}):t,(0,M.jsx)(o,{..._,...w.getCollapseProps({style:{opacity:n||!f?1:0,transition:f?`opacity ${S}ms ${i}`:`none`,...C(a,y),...p&&m===`display-none`&&E?{display:`none`}:{}},ref:h}),children:D})});re.displayName=`@mantine/core/Collapse`;var[ie,ae]=S(`Table component was not found in the tree`),oe={table:`m_b23fa0ef`,th:`m_4e7aa4f3`,tr:`m_4e7aa4fd`,td:`m_4e7aa4ef`,tbody:`m_b2404537`,thead:`m_b242d975`,caption:`m_9e5a3ac7`,scrollContainer:`m_a100c15`,scrollContainerInner:`m_62259741`};function se(e,t){if(!t)return;let n={};return t.columnBorder&&e.withColumnBorders&&(n[`data-with-column-border`]=!0),t.rowBorder&&e.withRowBorders&&(n[`data-with-row-border`]=!0),t.striped&&e.striped&&(n[`data-striped`]=e.striped),t.highlightOnHover&&e.highlightOnHover&&(n[`data-hover`]=!0),t.captionSide&&e.captionSide&&(n[`data-side`]=e.captionSide),t.stickyHeader&&e.stickyHeader&&(n[`data-sticky`]=!0),n}function ce(e,t){let n=`Table${e.charAt(0).toUpperCase()}${e.slice(1)}`,r=d(r=>{let i=c(n,{},r),{classNames:a,className:s,style:l,styles:u,...d}=i,f=ae();return(0,M.jsx)(o,{component:e,...se(f,t),...f.getStyles(e,{className:s,classNames:a,style:l,styles:u,props:i}),...d})});return r.displayName=`@mantine/core/${n}`,r.classes=oe,r}var le=ce(`th`,{columnBorder:!0}),ue=ce(`td`,{columnBorder:!0}),de=ce(`tr`,{rowBorder:!0,striped:!0,highlightOnHover:!0}),fe=ce(`thead`,{stickyHeader:!0}),pe=ce(`tbody`),me=ce(`tfoot`),he=ce(`caption`,{captionSide:!0}),ge={type:`scrollarea`},_e=f((e,{minWidth:t,maxHeight:n,type:r})=>({scrollContainer:{"--table-min-width":_(t),"--table-max-height":_(n),"--table-overflow":r===`native`?`auto`:void 0}})),ve=d(e=>{let t=c(`TableScrollContainer`,ge,e),{classNames:n,className:r,style:i,styles:s,unstyled:l,vars:u,children:d,minWidth:f,maxHeight:p,type:m,scrollAreaProps:h,attributes:g,..._}=t,v=a({name:`TableScrollContainer`,classes:oe,props:t,className:r,style:i,classNames:n,styles:s,unstyled:l,attributes:g,vars:u,varsResolver:_e,rootSelector:`scrollContainer`});return(0,M.jsx)(o,{component:m===`scrollarea`?w:`div`,...m===`scrollarea`?p?{offsetScrollbars:`xy`,...h}:{offsetScrollbars:`x`,...h}:{},...v(`scrollContainer`),..._,children:(0,M.jsx)(`div`,{...v(`scrollContainerInner`),children:d})})});ve.classes=oe,ve.varsResolver=_e,ve.displayName=`@mantine/core/TableScrollContainer`;function ye({data:e}){return(0,M.jsxs)(M.Fragment,{children:[e.caption&&(0,M.jsx)(he,{children:e.caption}),e.head&&(0,M.jsx)(fe,{children:(0,M.jsx)(de,{children:e.head.map((e,t)=>(0,M.jsx)(le,{children:e},t))})}),e.body&&(0,M.jsx)(pe,{children:e.body.map((e,t)=>(0,M.jsx)(de,{children:e.map((e,t)=>(0,M.jsx)(ue,{children:e},t))},t))}),e.foot&&(0,M.jsx)(me,{children:(0,M.jsx)(de,{children:e.foot.map((e,t)=>(0,M.jsx)(le,{children:e},t))})})]})}ye.displayName=`@mantine/core/TableDataRenderer`;var be={withRowBorders:!0,verticalSpacing:7},xe=f((e,{layout:t,captionSide:n,horizontalSpacing:r,verticalSpacing:i,borderColor:a,stripedColor:o,highlightOnHoverColor:c,striped:l,highlightOnHover:u,stickyHeaderOffset:d,stickyHeader:f})=>({table:{"--table-layout":t,"--table-caption-side":n,"--table-horizontal-spacing":y(r),"--table-vertical-spacing":y(i),"--table-border-color":a?s(a,e):void 0,"--table-striped-color":l&&o?s(o,e):void 0,"--table-highlight-on-hover-color":u&&c?s(c,e):void 0,"--table-sticky-header-offset":f?_(d):void 0}})),P=d(e=>{let t=c(`Table`,be,e),{classNames:n,className:r,style:i,styles:s,unstyled:l,vars:u,horizontalSpacing:d,verticalSpacing:f,captionSide:p,stripedColor:m,highlightOnHoverColor:h,striped:g,highlightOnHover:_,withColumnBorders:v,withRowBorders:y,withTableBorder:b,borderColor:x,layout:S,data:C,children:w,stickyHeader:E,stickyHeaderOffset:D,mod:O,tabularNums:k,attributes:ee,...te}=t,A=a({name:`Table`,props:t,className:r,style:i,classes:oe,classNames:n,styles:s,unstyled:l,attributes:ee,rootSelector:`table`,vars:u,varsResolver:xe,stable:!0}),j=g===!0?`odd`:g||void 0,ne=p||`bottom`,N=(0,T.useMemo)(()=>({getStyles:A,stickyHeader:E,striped:j,highlightOnHover:_,withColumnBorders:v,withRowBorders:y,captionSide:ne}),[A,E,j,_,v,y,ne]);return(0,M.jsx)(ie,{value:N,children:(0,M.jsx)(o,{component:`table`,mod:[{withTableBorder:b,tabularNums:k},O],...A(`table`),...te,children:w||!!C&&(0,M.jsx)(ye,{data:C})})})});P.classes=oe,P.varsResolver=xe,P.displayName=`@mantine/core/Table`,P.Td=ue,P.Th=le,P.Tr=de,P.Thead=fe,P.Tbody=pe,P.Tfoot=me,P.Caption=he,P.ScrollContainer=ve,P.DataRenderer=ye;var Se=new Map([[`bold`,T.createElement(T.Fragment,null,T.createElement(`path`,{d:`M216.49,104.49l-80,80a12,12,0,0,1-17,0l-80-80a12,12,0,0,1,17-17L128,159l71.51-71.52a12,12,0,0,1,17,17Z`}))],[`duotone`,T.createElement(T.Fragment,null,T.createElement(`path`,{d:`M208,96l-80,80L48,96Z`,opacity:`0.2`}),T.createElement(`path`,{d:`M215.39,92.94A8,8,0,0,0,208,88H48a8,8,0,0,0-5.66,13.66l80,80a8,8,0,0,0,11.32,0l80-80A8,8,0,0,0,215.39,92.94ZM128,164.69,67.31,104H188.69Z`}))],[`fill`,T.createElement(T.Fragment,null,T.createElement(`path`,{d:`M213.66,101.66l-80,80a8,8,0,0,1-11.32,0l-80-80A8,8,0,0,1,48,88H208a8,8,0,0,1,5.66,13.66Z`}))],[`light`,T.createElement(T.Fragment,null,T.createElement(`path`,{d:`M212.24,100.24l-80,80a6,6,0,0,1-8.48,0l-80-80a6,6,0,0,1,8.48-8.48L128,167.51l75.76-75.75a6,6,0,0,1,8.48,8.48Z`}))],[`regular`,T.createElement(T.Fragment,null,T.createElement(`path`,{d:`M213.66,101.66l-80,80a8,8,0,0,1-11.32,0l-80-80A8,8,0,0,1,53.66,90.34L128,164.69l74.34-74.35a8,8,0,0,1,11.32,11.32Z`}))],[`thin`,T.createElement(T.Fragment,null,T.createElement(`path`,{d:`M210.83,98.83l-80,80a4,4,0,0,1-5.66,0l-80-80a4,4,0,0,1,5.66-5.66L128,170.34l77.17-77.17a4,4,0,1,1,5.66,5.66Z`}))]]),Ce=T.forwardRef((e,t)=>T.createElement(h,{ref:t,...e,weights:Se}));Ce.displayName=`CaretDownIcon`;var we=Ce;function Te(e,t){let n=t||{};return(e[e.length-1]===``?[...e,``]:e).join((n.padRight?` `:``)+`,`+(n.padLeft===!1?``:` `)).trim()}var Ee=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,De=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,Oe={};function ke(e,t){return((t||Oe).jsx?De:Ee).test(e)}var Ae=/[ \t\n\f\r]/g;function je(e){return typeof e==`object`?e.type===`text`&&Me(e.value):Me(e)}function Me(e){return e.replace(Ae,``)===``}var Ne=class{constructor(e,t,n){this.normal=t,this.property=e,n&&(this.space=n)}};Ne.prototype.normal={},Ne.prototype.property={},Ne.prototype.space=void 0;function Pe(e,t){let n={},r={};for(let t of e)Object.assign(n,t.property),Object.assign(r,t.normal);return new Ne(n,r,t)}function Fe(e){return e.toLowerCase()}var F=class{constructor(e,t){this.attribute=t,this.property=e}};F.prototype.attribute=``,F.prototype.booleanish=!1,F.prototype.boolean=!1,F.prototype.commaOrSpaceSeparated=!1,F.prototype.commaSeparated=!1,F.prototype.defined=!1,F.prototype.mustUseProperty=!1,F.prototype.number=!1,F.prototype.overloadedBoolean=!1,F.prototype.property=``,F.prototype.spaceSeparated=!1,F.prototype.space=void 0;var Ie=n({boolean:()=>I,booleanish:()=>L,commaOrSpaceSeparated:()=>B,commaSeparated:()=>ze,number:()=>R,overloadedBoolean:()=>Re,spaceSeparated:()=>z}),Le=0,I=Be(),L=Be(),Re=Be(),R=Be(),z=Be(),ze=Be(),B=Be();function Be(){return 2**++Le}var Ve=Object.keys(Ie),He=class extends F{constructor(e,t,n,r){let i=-1;if(super(e,t),Ue(this,`space`,r),typeof n==`number`)for(;++i4&&n.slice(0,4)===`data`&&nt.test(t)){if(t.charAt(4)===`-`){let e=t.slice(5).replace(tt,at);r=`data`+e.charAt(0).toUpperCase()+e.slice(1)}else{let e=t.slice(4);if(!tt.test(e)){let n=e.replace(et,it);n.charAt(0)!==`-`&&(n=`-`+n),t=`data`+n}}i=He}return new i(r,t)}function it(e){return`-`+e.toLowerCase()}function at(e){return e.charAt(1).toUpperCase()}var ot=Pe([Ge,Je,Xe,Ze,Qe],`html`),st=Pe([Ge,Ye,Xe,Ze,Qe],`svg`);function ct(e){return e.join(` `).trim()}var lt=e(((e,t)=>{var n=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,r=/\n/g,i=/^\s*/,a=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,o=/^:\s*/,s=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,c=/^[;\s]*/,l=/^\s+|\s+$/g;function u(e,t){if(typeof e!=`string`)throw TypeError(`First argument must be a string`);if(!e)return[];t||={};var l=1,u=1;function f(e){var t=e.match(r);t&&(l+=t.length);var n=e.lastIndexOf(` `);u=~n?e.length-n:u+e.length}function p(){var e={line:l,column:u};return function(t){return t.position=new m(e),_(),t}}function m(e){this.start=e,this.end={line:l,column:u},this.source=t.source}m.prototype.content=e;function h(n){var r=Error(t.source+`:`+l+`:`+u+`: `+n);if(r.reason=n,r.filename=t.source,r.line=l,r.column=u,r.source=e,!t.silent)throw r}function g(t){var n=t.exec(e);if(n){var r=n[0];return f(r),e=e.slice(r.length),n}}function _(){g(i)}function v(e){var t;for(e||=[];t=y();)t!==!1&&e.push(t);return e}function y(){var t=p();if(e.charAt(0)==`/`&&e.charAt(1)==`*`){for(var n=2;e.charAt(n)!=``&&(e.charAt(n)!=`*`||e.charAt(n+1)!=`/`);)++n;if(n+=2,e.charAt(n-1)===``)return h(`End of comment missing`);var r=e.slice(2,n-2);return u+=2,f(r),e=e.slice(n),u+=2,t({type:`comment`,comment:r})}}function b(){var e=p(),t=g(a);if(t){if(y(),!g(o))return h(`property missing ':'`);var r=g(s),i=e({type:`declaration`,property:d(t[0].replace(n,``)),value:r?d(r[0].replace(n,``)):``});return g(c),i}}function x(){var e=[];v(e);for(var t;t=b();)t!==!1&&(e.push(t),v(e));return e}return _(),x()}function d(e){return e?e.replace(l,``):``}t.exports=u})),ut=e((e=>{var t=e&&e.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(e,"__esModule",{value:!0}),e.default=r;var n=t(lt());function r(e,t){let r=null;if(!e||typeof e!=`string`)return r;let i=(0,n.default)(e),a=typeof t==`function`;return i.forEach(e=>{if(e.type!==`declaration`)return;let{property:n,value:i}=e;a?t(n,i,e):i&&(r||={},r[n]=i)}),r}})),dt=e((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.camelCase=void 0;var t=/^--[a-zA-Z0-9_-]+$/,n=/-([a-z])/g,r=/^[^-]+$/,i=/^-(webkit|moz|ms|o|khtml)-/,a=/^-(ms)-/,o=function(e){return!e||r.test(e)||t.test(e)},s=function(e,t){return t.toUpperCase()},c=function(e,t){return`${t}-`};e.camelCase=function(e,t){return t===void 0&&(t={}),o(e)?e:(e=e.toLowerCase(),e=t.reactCompat?e.replace(a,c):e.replace(i,c),e.replace(n,s))}})),ft=e(((e,t)=>{var n=(e&&e.__importDefault||function(e){return e&&e.__esModule?e:{default:e}})(ut()),r=dt();function i(e,t){var i={};return!e||typeof e!=`string`||(0,n.default)(e,function(e,n){e&&n&&(i[(0,r.camelCase)(e,t)]=n)}),i}i.default=i,t.exports=i})),pt=ht(`end`),mt=ht(`start`);function ht(e){return t;function t(t){let n=t&&t.position&&t.position[e]||{};if(typeof n.line==`number`&&n.line>0&&typeof n.column==`number`&&n.column>0)return{line:n.line,column:n.column,offset:typeof n.offset==`number`&&n.offset>-1?n.offset:void 0}}}function gt(e){let t=mt(e),n=pt(e);if(t&&n)return{start:t,end:n}}function _t(e){return!e||typeof e!=`object`?``:`position`in e||`type`in e?yt(e.position):`start`in e||`end`in e?yt(e):`line`in e||`column`in e?vt(e):``}function vt(e){return bt(e&&e.line)+`:`+bt(e&&e.column)}function yt(e){return vt(e&&e.start)+`-`+vt(e&&e.end)}function bt(e){return e&&typeof e==`number`?e:1}var V=class extends Error{constructor(e,t,n){super(),typeof t==`string`&&(n=t,t=void 0);let r=``,i={},a=!1;if(t&&(i=`line`in t&&`column`in t||`start`in t&&`end`in t?{place:t}:`type`in t?{ancestors:[t],place:t.position}:{...t}),typeof e==`string`?r=e:!i.cause&&e&&(a=!0,r=e.message,i.cause=e),!i.ruleId&&!i.source&&typeof n==`string`){let e=n.indexOf(`:`);e===-1?i.ruleId=n:(i.source=n.slice(0,e),i.ruleId=n.slice(e+1))}if(!i.place&&i.ancestors&&i.ancestors){let e=i.ancestors[i.ancestors.length-1];e&&(i.place=e.position)}let o=i.place&&`start`in i.place?i.place.start:i.place;this.ancestors=i.ancestors||void 0,this.cause=i.cause||void 0,this.column=o?o.column:void 0,this.fatal=void 0,this.file=``,this.message=r,this.line=o?o.line:void 0,this.name=_t(i.place)||`1:1`,this.place=i.place||void 0,this.reason=this.message,this.ruleId=i.ruleId||void 0,this.source=i.source||void 0,this.stack=a&&i.cause&&typeof i.cause.stack==`string`?i.cause.stack:``,this.actual=void 0,this.expected=void 0,this.note=void 0,this.url=void 0}};V.prototype.file=``,V.prototype.name=``,V.prototype.reason=``,V.prototype.message=``,V.prototype.stack=``,V.prototype.column=void 0,V.prototype.line=void 0,V.prototype.ancestors=void 0,V.prototype.cause=void 0,V.prototype.fatal=void 0,V.prototype.place=void 0,V.prototype.ruleId=void 0,V.prototype.source=void 0;var xt=i(ft(),1),St={}.hasOwnProperty,Ct=new Map,wt=/[A-Z]/g,Tt=new Set([`table`,`tbody`,`thead`,`tfoot`,`tr`]),Et=new Set([`td`,`th`]),Dt=`https://github.com/syntax-tree/hast-util-to-jsx-runtime`;function Ot(e,t){if(!t||t.Fragment===void 0)throw TypeError("Expected `Fragment` in options");let n=t.filePath||void 0,r;if(t.development){if(typeof t.jsxDEV!=`function`)throw TypeError("Expected `jsxDEV` in options when `development: true`");r=zt(n,t.jsxDEV)}else{if(typeof t.jsx!=`function`)throw TypeError("Expected `jsx` in production options");if(typeof t.jsxs!=`function`)throw TypeError("Expected `jsxs` in production options");r=Rt(n,t.jsx,t.jsxs)}let i={Fragment:t.Fragment,ancestors:[],components:t.components||{},create:r,elementAttributeNameCase:t.elementAttributeNameCase||`react`,evaluater:t.createEvaluater?t.createEvaluater():void 0,filePath:n,ignoreInvalidStyle:t.ignoreInvalidStyle||!1,passKeys:t.passKeys!==!1,passNode:t.passNode||!1,schema:t.space===`svg`?st:ot,stylePropertyNameCase:t.stylePropertyNameCase||`dom`,tableCellAlignToStyle:t.tableCellAlignToStyle!==!1},a=kt(i,e,void 0);return a&&typeof a!=`string`?a:i.create(e,i.Fragment,{children:a||void 0},void 0)}function kt(e,t,n){if(t.type===`element`)return At(e,t,n);if(t.type===`mdxFlowExpression`||t.type===`mdxTextExpression`)return jt(e,t);if(t.type===`mdxJsxFlowElement`||t.type===`mdxJsxTextElement`)return Nt(e,t,n);if(t.type===`mdxjsEsm`)return Mt(e,t);if(t.type===`root`)return Pt(e,t,n);if(t.type===`text`)return Ft(e,t)}function At(e,t,n){let r=e.schema,i=r;t.tagName.toLowerCase()===`svg`&&r.space===`html`&&(i=st,e.schema=i),e.ancestors.push(t);let a=Gt(e,t.tagName,!1),o=Bt(e,t),s=Ht(e,t);return Tt.has(t.tagName)&&(s=s.filter(function(e){return typeof e!=`string`||!je(e)})),It(e,o,a,t),Lt(o,s),e.ancestors.pop(),e.schema=r,e.create(t,a,o,n)}function jt(e,t){if(t.data&&t.data.estree&&e.evaluater){let n=t.data.estree.body[0];return n.type,e.evaluater.evaluateExpression(n.expression)}Kt(e,t.position)}function Mt(e,t){if(t.data&&t.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(t.data.estree);Kt(e,t.position)}function Nt(e,t,n){let r=e.schema,i=r;t.name===`svg`&&r.space===`html`&&(i=st,e.schema=i),e.ancestors.push(t);let a=t.name===null?e.Fragment:Gt(e,t.name,!0),o=Vt(e,t),s=Ht(e,t);return It(e,o,a,t),Lt(o,s),e.ancestors.pop(),e.schema=r,e.create(t,a,o,n)}function Pt(e,t,n){let r={};return Lt(r,Ht(e,t)),e.create(t,e.Fragment,r,n)}function Ft(e,t){return t.value}function It(e,t,n,r){typeof n!=`string`&&n!==e.Fragment&&e.passNode&&(t.node=r)}function Lt(e,t){if(t.length>0){let n=t.length>1?t:t[0];n&&(e.children=n)}}function Rt(e,t,n){return r;function r(e,r,i,a){let o=Array.isArray(i.children)?n:t;return a?o(r,i,a):o(r,i)}}function zt(e,t){return n;function n(n,r,i,a){let o=Array.isArray(i.children),s=mt(n);return t(r,i,a,o,{columnNumber:s?s.column-1:void 0,fileName:e,lineNumber:s?s.line:void 0},void 0)}}function Bt(e,t){let n={},r,i;for(i in t.properties)if(i!==`children`&&St.call(t.properties,i)){let a=Ut(e,i,t.properties[i]);if(a){let[i,o]=a;e.tableCellAlignToStyle&&i===`align`&&typeof o==`string`&&Et.has(t.tagName)?r=o:n[i]=o}}if(r){let t=n.style||={};t[e.stylePropertyNameCase===`css`?`text-align`:`textAlign`]=r}return n}function Vt(e,t){let n={};for(let r of t.attributes)if(r.type===`mdxJsxExpressionAttribute`){if(r.data&&r.data.estree&&e.evaluater){let t=r.data.estree.body[0];t.type;let i=t.expression;i.type;let a=i.properties[0];a.type,Object.assign(n,e.evaluater.evaluateExpression(a.argument))}else Kt(e,t.position)}else{let i=r.name,a;if(r.value&&typeof r.value==`object`){if(r.value.data&&r.value.data.estree&&e.evaluater){let t=r.value.data.estree.body[0];t.type,a=e.evaluater.evaluateExpression(t.expression)}else Kt(e,t.position)}else a=r.value===null||r.value;n[i]=a}return n}function Ht(e,t){let n=[],r=-1,i=e.passKeys?new Map:Ct;for(;++ri?0:i+t:t>i?i:t,n=n>0?n:0,r.length<1e4)o=Array.from(r),o.unshift(t,n),e.splice(...o);else for(n&&e.splice(t,n);a0?(H(e,e.length,0,t),e):t}var an={}.hasOwnProperty;function on(e){let t={},n=-1;for(;++n13&&n<32||n>126&&n<160||n>55295&&n<57344||n>64975&&n<65008||(n&65535)==65535||(n&65535)==65534||n>1114111?`�`:String.fromCodePoint(n)}function W(e){return e.replace(/[\t\n\r ]+/g,` `).replace(/^ | $/g,``).toLowerCase().toUpperCase()}var G=_n(/[A-Za-z]/),K=_n(/[\dA-Za-z]/),un=_n(/[#-'*+\--9=?A-Z^-~]/);function dn(e){return e!==null&&(e<32||e===127)}var fn=_n(/\d/),pn=_n(/[\dA-Fa-f]/),mn=_n(/[!-/:-@[-`{-~]/);function q(e){return e!==null&&e<-2}function J(e){return e!==null&&(e<0||e===32)}function Y(e){return e===-2||e===-1||e===32}var hn=_n(/\p{P}|\p{S}/u),gn=_n(/\s/);function _n(e){return t;function t(t){return t!==null&&t>-1&&e.test(String.fromCharCode(t))}}function vn(e){let t=[],n=-1,r=0,i=0;for(;++n55295&&a<57344){let t=e.charCodeAt(n+1);a<56320&&t>56319&&t<57344?(o=String.fromCharCode(a,t),i=1):o=`�`}else o=String.fromCharCode(a);o&&=(t.push(e.slice(r,n),encodeURIComponent(o)),r=n+i+1,``),i&&=(n+=i,0)}return t.join(``)+e.slice(r)}function X(e,t,n,r){let i=r?r-1:1/0,a=0;return o;function o(r){return Y(r)?(e.enter(n),s(r)):t(r)}function s(r){return Y(r)&&a++0&&Y(t)?(e.enter(r),c(t)):l(t)}function c(t){return Y(t)&&o=i?t(e):n(e)}}var bn={tokenize:xn};function xn(e){let t=e.attempt(this.parser.constructs.contentInitial,r,i),n;return t;function r(n){if(n===null){e.consume(n);return}return e.enter(`lineEnding`),e.consume(n),e.exit(`lineEnding`),X(e,t,`linePrefix`)}function i(t){return e.enter(`paragraph`),a(t)}function a(t){let r=e.enter(`chunkText`,{contentType:`text`,previous:n});return n&&(n.next=r),n=r,o(t)}function o(t){if(t===null){e.exit(`chunkText`),e.exit(`paragraph`),e.consume(t);return}return q(t)?(e.consume(t),e.exit(`chunkText`),a):(e.consume(t),o)}}var Sn=class{constructor(){this.index=new Map,this.map=[]}add(e,t,n){Cn(this,e,t,n,!1)}addBefore(e,t,n){Cn(this,e,t,n,!0)}consume(e){if(this.map.sort(function(e,t){return e[0]-t[0]}),this.map.length===0)return;let t=this.map.length,n=[];for(;t>0;)--t,n.push(e.slice(this.map[t][0]+this.map[t][1]),this.map[t][2]),e.length=this.map[t][0];n.push(e.slice()),e.length=0;let r=n.pop();for(;r;){for(let t of r)e.push(t);r=n.pop()}this.map.length=0,this.index.clear()}};function Cn(e,t,n,r,i){if(n===0&&r.length===0)return;let a=e.index.get(t);if(a){a[1]+=n,i?(r.push(...a[2]),a[2]=r):a[2].push(...r);return}let o=[t,n,r];e.map.push(o),e.index.set(t,o)}var wn={tokenize:En},Tn={tokenize:Dn};function En(e){let t=this,n=[],r=0,i,a,o;return s;function s(i){if(ro))return;let n=t.events.length,a=n,s,c;for(;a--;)if(t.events[a][0]===`exit`&&t.events[a][1].type===`chunkFlow`){if(s){c=t.events[a][1].end;break}s=!0}for(_(r),e=n;er;){let r=n[i];t.containerState=r[1],r[0].exit.call(t,e)}n.length=r}function v(){i.write([null]),a=void 0,i=void 0,t.containerState._closeFlow=void 0}}function Dn(e,t,n){return X(e,e.attempt(this.parser.constructs.document,t,n),`linePrefix`,this.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4)}function On(e){if(e===null||J(e)||gn(e))return 1;if(hn(e))return 2}function kn(e,t,n){let r=[],i=-1;for(;++i1&&e[n][1].end.offset-e[n][1].start.offset>1?2:1,o={...e[i][1].end},s={...e[n][1].start};Nn(o,-a),Nn(s,a);let c={type:a>1?`strongSequence`:`emphasisSequence`,start:o,end:{...e[i][1].end}},l={type:a>1?`strongSequence`:`emphasisSequence`,start:{...e[n][1].start},end:s},u={type:a>1?`strongText`:`emphasisText`,start:{...e[i][1].end},end:{...e[n][1].start}},d={type:a>1?`strong`:`emphasis`,start:{...c.start},end:{...l.end}};e[i][1].end={...c.start},e[n][1].start={...l.end},r=[],e[i][1].end.offset-e[i][1].start.offset&&(r=U(r,[[`enter`,e[i][1],t],[`exit`,e[i][1],t]])),r=U(r,[[`enter`,d,t],[`enter`,c,t],[`exit`,c,t],[`enter`,u,t]]),r=U(r,kn(t.parser.constructs.insideSpan.null,e.slice(i+1,n),t)),r=U(r,[[`exit`,u,t],[`enter`,l,t],[`exit`,l,t],[`exit`,d,t]]);let f=0;e[n][1].end.offset-e[n][1].start.offset&&(f=2,r=U(r,[[`enter`,e[n][1],t],[`exit`,e[n][1],t]])),H(e,i-1,n-i+3,r),n=i+r.length-f-2;break}}for(n=-1;++n0&&Y(t)?X(e,v,`linePrefix`,a+1)(t):v(t)}function v(t){return t===null||q(t)?e.check(Kn,h,b)(t):(e.enter(`codeFlowValue`),y(t))}function y(t){return t===null||q(t)?(e.exit(`codeFlowValue`),v(t)):(e.consume(t),y)}function b(n){return e.exit(`codeFenced`),t(n)}function x(e,t,n){let i=0;return a;function a(t){return e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),c}function c(t){return e.enter(`codeFencedFence`),Y(t)?X(e,l,`linePrefix`,r.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4)(t):l(t)}function l(t){return t===s?(e.enter(`codeFencedFenceSequence`),u(t)):n(t)}function u(t){return t===s?(i++,e.consume(t),u):i>=o?(e.exit(`codeFencedFenceSequence`),Y(t)?X(e,d,`whitespace`)(t):d(t)):n(t)}function d(r){return r===null||q(r)?(e.exit(`codeFencedFence`),t(r)):n(r)}}}var Xn={name:`codeIndented`,tokenize:Qn},Zn={partial:!0,tokenize:$n};function Qn(e,t,n){return r;function r(t){return e.enter(`codeIndented`),yn(e,i,n,`linePrefix`,4,4)(t)}function i(t){return t===null?o(t):q(t)?e.attempt(Zn,i,o)(t):(e.enter(`codeFlowValue`),a(t))}function a(t){return t===null||q(t)?(e.exit(`codeFlowValue`),i(t)):(e.consume(t),a)}function o(n){return e.exit(`codeIndented`),t(n)}}function $n(e,t,n){let r=this;return i;function i(o){return r.parser.lazy[r.now().line]?n(o):q(o)?(e.enter(`lineEnding`),e.consume(o),e.exit(`lineEnding`),i):yn(e,t,a,`linePrefix`,4,4)(o)}function a(e){return q(e)?i(e):n(e)}}var er={name:`codeText`,previous:nr,resolve:tr,tokenize:rr};function tr(e){let t=e.length-4,n=3,r,i;if((e[n][1].type===`lineEnding`||e[n][1].type===`space`)&&(e[t][1].type===`lineEnding`||e[t][1].type===`space`)){for(r=n;++r=this.left.length+this.right.length)throw RangeError("Cannot access index `"+e+"` in a splice buffer of size `"+(this.left.length+this.right.length)+"`");return ethis.left.length?this.right.slice(this.right.length-n+this.left.length,this.right.length-e+this.left.length).reverse():this.left.slice(e).concat(this.right.slice(this.right.length-n+this.left.length).reverse())}splice(e,t,n){let r=t||0;this.setCursor(Math.trunc(e));let i=this.right.splice(this.right.length-r,1/0);return n&&ar(this.left,n),i.reverse()}pop(){return this.setCursor(1/0),this.left.pop()}push(e){this.setCursor(1/0),this.left.push(e)}pushMany(e){this.setCursor(1/0),ar(this.left,e)}unshift(e){this.setCursor(0),this.right.push(e)}unshiftMany(e){this.setCursor(0),ar(this.right,e.reverse())}setCursor(e){if(!(e===this.left.length||e>this.left.length&&this.right.length===0||e<0&&this.left.length===0)){if(e=4?t(i):e.interrupt(r.parser.constructs.flow,n,t)(i)}}function pr(e,t,n,r,i,a,o,s,c){let l=c||1/0,u=0;return d;function d(t){return t===60?(e.enter(r),e.enter(i),e.enter(a),e.consume(t),e.exit(a),f):t===null||t===32||t===41||dn(t)?n(t):(e.enter(r),e.enter(o),e.enter(s),e.enter(`chunkString`,{contentType:`string`}),h(t))}function f(n){return n===62?(e.enter(a),e.consume(n),e.exit(a),e.exit(i),e.exit(r),t):(e.enter(s),e.enter(`chunkString`,{contentType:`string`}),p(n))}function p(t){return t===62?(e.exit(`chunkString`),e.exit(s),f(t)):t===null||t===60||q(t)?n(t):(e.consume(t),t===92?m:p)}function m(t){return t===60||t===62||t===92?(e.consume(t),p):p(t)}function h(i){return!u&&(i===null||i===41||J(i))?(e.exit(`chunkString`),e.exit(s),e.exit(o),e.exit(r),t(i)):u999||l===null||l===91||l===93&&!c||l===94&&!s&&`_hiddenFootnoteSupport`in o.parser.constructs?n(l):l===93?(e.exit(a),e.enter(i),e.consume(l),e.exit(i),e.exit(r),t):q(l)?(e.enter(`lineEnding`),e.consume(l),e.exit(`lineEnding`),u):(e.enter(`chunkString`,{contentType:`string`}),d(l))}function d(t){return t===null||t===91||t===93||q(t)||s++>999?(e.exit(`chunkString`),u(t)):(e.consume(t),c||=!Y(t),t===92?f:d)}function f(t){return t===91||t===92||t===93?(e.consume(t),s++,d):d(t)}}function hr(e,t,n,r,i,a){let o;return s;function s(t){return t===34||t===39||t===40?(e.enter(r),e.enter(i),e.consume(t),e.exit(i),o=t===40?41:t,c):n(t)}function c(n){return n===o?(e.enter(i),e.consume(n),e.exit(i),e.exit(r),t):(e.enter(a),l(n))}function l(t){return t===o?(e.exit(a),c(o)):t===null?n(t):q(t)?(e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),X(e,l,`linePrefix`)):(e.enter(`chunkString`,{contentType:`string`}),u(t))}function u(t){return t===o||t===null||q(t)?(e.exit(`chunkString`),l(t)):(e.consume(t),t===92?d:u)}function d(t){return t===o||t===92?(e.consume(t),u):u(t)}}function gr(e,t){let n;return r;function r(i){return q(i)?(e.enter(`lineEnding`),e.consume(i),e.exit(`lineEnding`),n=!0,r):Y(i)?X(e,r,n?`linePrefix`:`lineSuffix`)(i):t(i)}}var _r={name:`definition`,tokenize:yr},vr={partial:!0,tokenize:br};function yr(e,t,n){let r=this,i;return a;function a(t){return e.enter(`definition`),o(t)}function o(t){return mr.call(r,e,s,n,`definitionLabel`,`definitionLabelMarker`,`definitionLabelString`)(t)}function s(t){return i=W(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)),t===58?(e.enter(`definitionMarker`),e.consume(t),e.exit(`definitionMarker`),c):n(t)}function c(t){return J(t)?gr(e,l)(t):l(t)}function l(t){return pr(e,u,n,`definitionDestination`,`definitionDestinationLiteral`,`definitionDestinationLiteralMarker`,`definitionDestinationRaw`,`definitionDestinationString`)(t)}function u(t){return e.attempt(vr,d,d)(t)}function d(t){return Y(t)?X(e,f,`whitespace`)(t):f(t)}function f(a){return a===null||q(a)?(e.exit(`definition`),r.parser.defined.push(i),t(a)):n(a)}}function br(e,t,n){return r;function r(t){return J(t)?gr(e,i)(t):n(t)}function i(t){return hr(e,a,n,`definitionTitle`,`definitionTitleMarker`,`definitionTitleString`)(t)}function a(t){return Y(t)?X(e,o,`whitespace`)(t):o(t)}function o(e){return e===null||q(e)?t(e):n(e)}}var xr={name:`hardBreakEscape`,tokenize:Sr};function Sr(e,t,n){return r;function r(t){return e.enter(`hardBreakEscape`),e.consume(t),i}function i(r){return q(r)?(e.exit(`hardBreakEscape`),t(r)):n(r)}}var Cr={name:`headingAtx`,resolve:wr,tokenize:Tr};function wr(e,t){let n=e.length-2,r=3;if(e[r][1].type===`whitespace`&&(r+=2),n-2>r&&e[n][1].type===`whitespace`&&(n-=2),e[n][1].type===`atxHeadingSequence`&&(r===n-1||n-4>r&&e[n-2][1].type===`whitespace`)&&(n-=r+1===n?2:4),n>r){let i={type:`atxHeadingText`,start:e[r][1].start,end:e[n][1].end},a={type:`chunkText`,start:e[r][1].start,end:e[n][1].end,contentType:`text`};H(e,r,n-r+1,[[`enter`,i,t],[`enter`,a,t],[`exit`,a,t],[`exit`,i,t]])}return e}function Tr(e,t,n){let r=0;return i;function i(t){return e.enter(`atxHeading`),a(t)}function a(t){return e.enter(`atxHeadingSequence`),o(t)}function o(t){return t===35&&r++<6?(e.consume(t),o):t===null||J(t)?(e.exit(`atxHeadingSequence`),s(t)):n(t)}function s(n){return n===35?(e.enter(`atxHeadingSequence`),c(n)):n===null||q(n)?(e.exit(`atxHeading`),t(n)):Y(n)?X(e,s,`whitespace`)(n):(e.enter(`atxHeadingText`),l(n))}function c(t){return t===35?(e.consume(t),c):(e.exit(`atxHeadingSequence`),s(t))}function l(t){return t===null||t===35||J(t)?(e.exit(`atxHeadingText`),s(t)):(e.consume(t),l)}}var Er=`address.article.aside.base.basefont.blockquote.body.caption.center.col.colgroup.dd.details.dialog.dir.div.dl.dt.fieldset.figcaption.figure.footer.form.frame.frameset.h1.h2.h3.h4.h5.h6.head.header.hr.html.iframe.legend.li.link.main.menu.menuitem.nav.noframes.ol.optgroup.option.p.param.search.section.summary.table.tbody.td.tfoot.th.thead.title.tr.track.ul`.split(`.`),Dr=[`pre`,`script`,`style`,`textarea`],Or={concrete:!0,name:`htmlFlow`,resolveTo:Ar,tokenize:jr},kr={partial:!0,tokenize:Mr};function Ar(e){let t=e.length;for(;t--&&(e[t][0]!==`enter`||e[t][1].type!==`htmlFlow`););return t>1&&e[t-2][1].type===`linePrefix`&&(e[t][1].start=e[t-2][1].start,e[t+1][1].start=e[t-2][1].start,e.splice(t-2,2)),e}function jr(e,t,n){let r=this,i,a,o,s,c;return l;function l(e){return u(e)}function u(t){return e.enter(`htmlFlow`),e.enter(`htmlFlowData`),e.consume(t),d}function d(s){return s===33?(e.consume(s),f):s===47?(e.consume(s),a=!0,h):s===63?(e.consume(s),i=3,r.interrupt?t:N):G(s)?(e.consume(s),o=String.fromCharCode(s),g):n(s)}function f(a){return a===45?(e.consume(a),i=2,p):a===91?(e.consume(a),i=5,s=0,m):G(a)?(e.consume(a),i=4,r.interrupt?t:N):n(a)}function p(i){return i===45?(e.consume(i),r.interrupt?t:N):n(i)}function m(i){return i===`CDATA[`.charCodeAt(s++)?(e.consume(i),s===6?r.interrupt?t:O:m):n(i)}function h(t){return G(t)?(e.consume(t),o=String.fromCharCode(t),g):n(t)}function g(s){if(s===null||s===47||s===62||J(s)){let c=s===47,l=o.toLowerCase();return!c&&!a&&Dr.includes(l)?(i=1,r.interrupt?t(s):O(s)):Er.includes(o.toLowerCase())?(i=6,c?(e.consume(s),_):r.interrupt?t(s):O(s)):(i=7,r.interrupt&&!r.parser.lazy[r.now().line]?n(s):a?v(s):y(s))}return s===45||K(s)?(e.consume(s),o+=String.fromCharCode(s),g):n(s)}function _(i){return i===62?(e.consume(i),r.interrupt?t:O):n(i)}function v(t){return Y(t)?(e.consume(t),v):E(t)}function y(t){return t===47?(e.consume(t),E):t===58||t===95||G(t)?(e.consume(t),b):Y(t)?(e.consume(t),y):E(t)}function b(t){return t===45||t===46||t===58||t===95||K(t)?(e.consume(t),b):x(t)}function x(t){return t===61?(e.consume(t),S):Y(t)?(e.consume(t),x):y(t)}function S(t){return t===null||t===60||t===61||t===62||t===96?n(t):t===34||t===39?(e.consume(t),c=t,C):Y(t)?(e.consume(t),S):w(t)}function C(t){return t===c?(e.consume(t),c=null,T):t===null||q(t)?n(t):(e.consume(t),C)}function w(t){return t===null||t===34||t===39||t===47||t===60||t===61||t===62||t===96||J(t)?x(t):(e.consume(t),w)}function T(e){return e===47||e===62||Y(e)?y(e):n(e)}function E(t){return t===62?(e.consume(t),D):n(t)}function D(t){return t===null||q(t)?O(t):Y(t)?(e.consume(t),D):n(t)}function O(t){return t===45&&i===2?(e.consume(t),A):t===60&&i===1?(e.consume(t),j):t===62&&i===4?(e.consume(t),re):t===63&&i===3?(e.consume(t),N):t===93&&i===5?(e.consume(t),M):q(t)&&(i===6||i===7)?(e.exit(`htmlFlowData`),e.check(kr,ie,k)(t)):t===null||q(t)?(e.exit(`htmlFlowData`),k(t)):(e.consume(t),O)}function k(t){return e.check(Kn,ee,ie)(t)}function ee(t){return e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),te}function te(t){return t===null||q(t)?k(t):(e.enter(`htmlFlowData`),O(t))}function A(t){return t===45?(e.consume(t),N):O(t)}function j(t){return t===47?(e.consume(t),o=``,ne):O(t)}function ne(t){if(t===62){let n=o.toLowerCase();return Dr.includes(n)?(e.consume(t),re):O(t)}return G(t)&&o.length<8?(e.consume(t),o+=String.fromCharCode(t),ne):O(t)}function M(t){return t===93?(e.consume(t),N):O(t)}function N(t){return t===62?(e.consume(t),re):t===45&&i===2?(e.consume(t),N):O(t)}function re(t){return t===null||q(t)?(e.exit(`htmlFlowData`),ie(t)):(e.consume(t),re)}function ie(n){return e.exit(`htmlFlow`),t(n)}}function Mr(e,t,n){return r;function r(r){return e.enter(`lineEnding`),e.consume(r),e.exit(`lineEnding`),e.attempt(In,t,n)}}var Nr={name:`htmlText`,tokenize:Pr};function Pr(e,t,n){let r=this,i,a,o;return s;function s(t){return e.enter(`htmlText`),e.enter(`htmlTextData`),e.consume(t),c}function c(t){return t===33?(e.consume(t),l):t===47?(e.consume(t),x):t===63?(e.consume(t),y):G(t)?(e.consume(t),w):n(t)}function l(t){return t===45?(e.consume(t),u):t===91?(e.consume(t),a=0,m):G(t)?(e.consume(t),v):n(t)}function u(t){return t===45?(e.consume(t),p):n(t)}function d(t){return t===null?n(t):t===45?(e.consume(t),f):q(t)?(o=d,j(t)):(e.consume(t),d)}function f(t){return t===45?(e.consume(t),p):d(t)}function p(e){return e===62?A(e):e===45?f(e):d(e)}function m(t){return t===`CDATA[`.charCodeAt(a++)?(e.consume(t),a===6?h:m):n(t)}function h(t){return t===null?n(t):t===93?(e.consume(t),g):q(t)?(o=h,j(t)):(e.consume(t),h)}function g(t){return t===93?(e.consume(t),_):h(t)}function _(t){return t===62?A(t):t===93?(e.consume(t),_):h(t)}function v(t){return t===null||t===62?A(t):q(t)?(o=v,j(t)):(e.consume(t),v)}function y(t){return t===null?n(t):t===63?(e.consume(t),b):q(t)?(o=y,j(t)):(e.consume(t),y)}function b(e){return e===62?A(e):y(e)}function x(t){return G(t)?(e.consume(t),S):n(t)}function S(t){return t===45||K(t)?(e.consume(t),S):C(t)}function C(t){return q(t)?(o=C,j(t)):Y(t)?(e.consume(t),C):A(t)}function w(t){return t===45||K(t)?(e.consume(t),w):t===47||t===62||J(t)?T(t):n(t)}function T(t){return t===47?(e.consume(t),A):t===58||t===95||G(t)?(e.consume(t),E):q(t)?(o=T,j(t)):Y(t)?(e.consume(t),T):A(t)}function E(t){return t===45||t===46||t===58||t===95||K(t)?(e.consume(t),E):D(t)}function D(t){return t===61?(e.consume(t),O):q(t)?(o=D,j(t)):Y(t)?(e.consume(t),D):T(t)}function O(t){return t===null||t===60||t===61||t===62||t===96?n(t):t===34||t===39?(e.consume(t),i=t,k):q(t)?(o=O,j(t)):Y(t)?(e.consume(t),O):(e.consume(t),ee)}function k(t){return t===i?(e.consume(t),i=void 0,te):t===null?n(t):q(t)?(o=k,j(t)):(e.consume(t),k)}function ee(t){return t===null||t===34||t===39||t===60||t===61||t===96?n(t):t===47||t===62||J(t)?T(t):(e.consume(t),ee)}function te(e){return e===47||e===62||J(e)?T(e):n(e)}function A(r){return r===62?(e.consume(r),e.exit(`htmlTextData`),e.exit(`htmlText`),t):n(r)}function j(t){return e.exit(`htmlTextData`),e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),ne}function ne(t){return Y(t)?X(e,M,`linePrefix`,r.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4)(t):M(t)}function M(t){return e.enter(`htmlTextData`),o(t)}}var Fr={name:`labelEnd`,resolveAll:zr,resolveTo:Br,tokenize:Vr},Ir={tokenize:Hr},Lr={tokenize:Ur},Rr={tokenize:Wr};function zr(e){let t=-1,n=[];for(;++t0&&i[i.length-1]._balanced;)i.pop();a=i[i.length-1]}return s;function s(t){return a?a._inactive?d(t):(o=r.parser.defined.includes(W(r.sliceSerialize({start:a.end,end:r.now()}))),e.enter(`labelEnd`),e.enter(`labelMarker`),e.consume(t),e.exit(`labelMarker`),e.exit(`labelEnd`),c):n(t)}function c(t){return t===40?e.attempt(Ir,u,o?u:d)(t):t===91?e.attempt(Lr,u,o?l:d)(t):o?u(t):d(t)}function l(t){return e.attempt(Rr,u,d)(t)}function u(e){return i.pop(),t(e)}function d(e){return a._balanced=!0,n(e)}}function Hr(e,t,n){return r;function r(t){return e.enter(`resource`),e.enter(`resourceMarker`),e.consume(t),e.exit(`resourceMarker`),i}function i(t){return J(t)?gr(e,a)(t):a(t)}function a(t){return t===41?u(t):pr(e,o,s,`resourceDestination`,`resourceDestinationLiteral`,`resourceDestinationLiteralMarker`,`resourceDestinationRaw`,`resourceDestinationString`,32)(t)}function o(t){return J(t)?gr(e,c)(t):u(t)}function s(e){return n(e)}function c(t){return t===34||t===39||t===40?hr(e,l,n,`resourceTitle`,`resourceTitleMarker`,`resourceTitleString`)(t):u(t)}function l(t){return J(t)?gr(e,u)(t):u(t)}function u(r){return r===41?(e.enter(`resourceMarker`),e.consume(r),e.exit(`resourceMarker`),e.exit(`resource`),t):n(r)}}function Ur(e,t,n){let r=this;return i;function i(t){return mr.call(r,e,a,o,`reference`,`referenceMarker`,`referenceString`)(t)}function a(e){return r.parser.defined.includes(W(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)))?t(e):n(e)}function o(e){return n(e)}}function Wr(e,t,n){return r;function r(t){return e.enter(`reference`),e.enter(`referenceMarker`),e.consume(t),e.exit(`referenceMarker`),i}function i(r){return r===93?(e.enter(`referenceMarker`),e.consume(r),e.exit(`referenceMarker`),e.exit(`reference`),t):n(r)}}var Gr={name:`labelStartImage`,resolveAll:Fr.resolveAll,tokenize:Kr};function Kr(e,t,n){let r=this,i;return a;function a(t){return e.enter(`labelImage`),e.enter(`labelImageMarker`),e.consume(t),e.exit(`labelImageMarker`),o}function o(t){return t===91?(e.enter(`labelMarker`),e.consume(t),e.exit(`labelMarker`),i=e.exit(`labelImage`),s):n(t)}function s(e){return e===94&&`_hiddenFootnoteSupport`in r.parser.constructs?n(e):(r._labelStarts=r._labelStarts||[],r._labelStarts.push(i),t(e))}}var qr={name:`labelStartLink`,resolveAll:Fr.resolveAll,tokenize:Jr};function Jr(e,t,n){let r=this,i;return a;function a(t){return e.enter(`labelLink`),e.enter(`labelMarker`),e.consume(t),e.exit(`labelMarker`),i=e.exit(`labelLink`),o}function o(e){return e===94&&`_hiddenFootnoteSupport`in r.parser.constructs?n(e):(r._labelStarts=r._labelStarts||[],r._labelStarts.push(i),t(e))}}var Yr={name:`lineEnding`,tokenize:Xr};function Xr(e,t){return n;function n(n){return e.enter(`lineEnding`),e.consume(n),e.exit(`lineEnding`),X(e,t,`linePrefix`)}}var Zr={name:`thematicBreak`,tokenize:Qr};function Qr(e,t,n){let r=0,i;return a;function a(t){return e.enter(`thematicBreak`),o(t)}function o(e){return i=e,s(e)}function s(a){return a===i?(e.enter(`thematicBreakSequence`),c(a)):r>=3&&(a===null||q(a))?(e.exit(`thematicBreak`),t(a)):n(a)}function c(t){return t===i?(e.consume(t),r++,c):(e.exit(`thematicBreakSequence`),Y(t)?X(e,s,`whitespace`)(t):s(t))}}var Z={continuation:{tokenize:ni},exit:ii,name:`list`,tokenize:ti},$r={partial:!0,tokenize:ai},ei={partial:!0,tokenize:ri};function ti(e,t,n){let r=this,i=r.events[r.events.length-1],a=i&&i[1].type===`linePrefix`?i[2].sliceSerialize(i[1],!0).length:0,o=0;return s;function s(t){let i=r.containerState.type||(t===42||t===43||t===45?`listUnordered`:`listOrdered`);if(i===`listUnordered`?!r.containerState.marker||t===r.containerState.marker:fn(t)){if(r.containerState.type||(r.containerState.type=i,e.enter(i,{_container:!0})),i===`listUnordered`)return e.enter(`listItemPrefix`),t===42||t===45?e.check(Zr,n,l)(t):l(t);if(!r.interrupt||t===49)return e.enter(`listItemPrefix`),e.enter(`listItemValue`),c(t)}return n(t)}function c(t){return fn(t)&&++o<10?(e.consume(t),c):(!r.interrupt||o<2)&&(r.containerState.marker?t===r.containerState.marker:t===41||t===46)?(e.exit(`listItemValue`),l(t)):n(t)}function l(t){return e.enter(`listItemMarker`),e.consume(t),e.exit(`listItemMarker`),r.containerState.marker=r.containerState.marker||t,e.check(In,r.interrupt?n:u,e.attempt($r,f,d))}function u(e){return r.containerState.initialBlankLine=!0,a++,f(e)}function d(t){return Y(t)?(e.enter(`listItemPrefixWhitespace`),e.consume(t),e.exit(`listItemPrefixWhitespace`),f):n(t)}function f(n){return r.containerState.size=a+r.sliceSerialize(e.exit(`listItemPrefix`),!0).length,t(n)}}function ni(e,t,n){let r=this;return r.containerState._closeFlow=void 0,e.check(In,i,a);function i(n){return r.containerState.furtherBlankLines=r.containerState.furtherBlankLines||r.containerState.initialBlankLine,X(e,t,`listItemIndent`,r.containerState.size+1)(n)}function a(n){return r.containerState.furtherBlankLines||!Y(n)?(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,o(n)):(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,e.attempt(ei,t,o)(n))}function o(i){return r.containerState._closeFlow=!0,r.interrupt=void 0,X(e,e.attempt(Z,t,n),`linePrefix`,r.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4)(i)}}function ri(e,t,n){let r=this;return X(e,i,`listItemIndent`,r.containerState.size+1);function i(e){let i=r.events[r.events.length-1];return i&&i[1].type===`listItemIndent`&&i[2].sliceSerialize(i[1],!0).length===r.containerState.size?t(e):n(e)}}function ii(e){e.exit(this.containerState.type)}function ai(e,t,n){let r=this;return X(e,i,`listItemPrefixWhitespace`,r.parser.constructs.disable.null.includes(`codeIndented`)?void 0:5);function i(e){let i=r.events[r.events.length-1];return!Y(e)&&i&&i[1].type===`listItemPrefixWhitespace`?t(e):n(e)}}var oi={name:`setextUnderline`,resolveTo:si,tokenize:ci};function si(e,t){let n=new Sn,r=e.length,i,a,o;for(;r--;)if(e[r][0]===`enter`){if(e[r][1].type===`content`){i=r;break}e[r][1].type===`paragraph`&&(a=r)}else e[r][1].type===`content`&&n.add(r,1,[]),!o&&e[r][1].type===`definition`&&(o=r);let s={type:`setextHeading`,start:{...e[i][1].start},end:{...e[e.length-1][1].end}};return e[a][1].type=`setextHeadingText`,o?(n.add(a,0,[[`enter`,s,t]]),n.add(o+1,0,[[`exit`,e[i][1],t]]),e[i][1].end={...e[o][1].end}):e[i][1]=s,n.add(e.length,0,[[`exit`,s,t]]),n.consume(e),e}function ci(e,t,n){let r=this,i;return a;function a(t){let a=r.events.length,s;for(;a--;)if(r.events[a][1].type!==`lineEnding`&&r.events[a][1].type!==`linePrefix`&&r.events[a][1].type!==`content`){s=r.events[a][1].type===`paragraph`;break}return!r.parser.lazy[r.now().line]&&(r.interrupt||s)?(e.enter(`setextHeadingLine`),i=t,o(t)):n(t)}function o(t){return e.enter(`setextHeadingLineSequence`),s(t)}function s(t){return t===i?(e.consume(t),s):(e.exit(`setextHeadingLineSequence`),Y(t)?X(e,c,`lineSuffix`)(t):c(t))}function c(r){return r===null||q(r)?(e.exit(`setextHeadingLine`),t(r)):n(r)}}var li={tokenize:ui};function ui(e){let t=this,n=e.attempt(In,r,e.attempt(this.parser.constructs.flowInitial,i,X(e,e.attempt(this.parser.constructs.flow,i,e.attempt(cr,i)),`linePrefix`)));return n;function r(r){if(r===null){e.consume(r);return}return e.enter(`lineEndingBlank`),e.consume(r),e.exit(`lineEndingBlank`),t.currentConstruct=void 0,n}function i(r){if(r===null){e.consume(r);return}return e.enter(`lineEnding`),e.consume(r),e.exit(`lineEnding`),t.currentConstruct=void 0,n}}var di={resolveAll:hi()},fi=mi(`string`),pi=mi(`text`);function mi(e){return{resolveAll:hi(e===`text`?gi:void 0),tokenize:t};function t(t){let n=this,r=this.parser.constructs[e],i=t.attempt(r,a,o);return a;function a(e){return c(e)?i(e):o(e)}function o(e){if(e===null){t.consume(e);return}return t.enter(`data`),t.consume(e),s}function s(e){return c(e)?(t.exit(`data`),i(e)):(t.consume(e),s)}function c(e){if(e===null)return!0;let t=r[e],i=-1;if(t)for(;++iTi,contentInitial:()=>yi,disable:()=>Ei,document:()=>vi,flow:()=>xi,flowInitial:()=>bi,insideSpan:()=>wi,string:()=>Si,text:()=>Ci}),vi={42:Z,43:Z,45:Z,48:Z,49:Z,50:Z,51:Z,52:Z,53:Z,54:Z,55:Z,56:Z,57:Z,62:Rn},yi={91:_r},bi={[-2]:Xn,[-1]:Xn,32:Xn},xi={35:Cr,42:Zr,45:[oi,Zr],60:Or,61:oi,95:Zr,96:Jn,126:Jn},Si={38:Wn,92:Hn},Ci={[-5]:Yr,[-4]:Yr,[-3]:Yr,33:Gr,38:Wn,42:An,60:[Pn,Nr],91:qr,92:[xr,Hn],93:Fr,95:An,96:er},wi={null:[An,di]},Ti={null:[42,95]},Ei={null:[]};function Di(e,t,n){let r={_bufferIndex:-1,_index:0,line:n&&n.line||1,column:n&&n.column||1,offset:n&&n.offset||0},i={},a=[],o=[],s=[],c={attempt:C(x),check:C(S),consume:v,enter:y,exit:b,interrupt:C(S,{interrupt:!0})},l={code:null,containerState:{},defineSkip:h,events:[],now:m,parser:e,previous:null,sliceSerialize:f,sliceStream:p,write:d},u=t.tokenize.call(l,c);return t.resolveAll&&a.push(t),l;function d(e){return o=U(o,e),g(),o[o.length-1]===null?(w(t,0),l.events=kn(a,l.events,l),l.events):[]}function f(e,t){return ki(p(e),t)}function p(e){return Oi(o,e)}function m(){let{_bufferIndex:e,_index:t,line:n,column:i,offset:a}=r;return{_bufferIndex:e,_index:t,line:n,column:i,offset:a}}function h(e){i[e.line]=e.column,E()}function g(){for(;r._index-1){let e=o[0];typeof e==`string`?o[0]=e.slice(r):o.shift()}a>0&&o.push(e[i].slice(0,a))}return o}function ki(e,t){let n=-1,r=[],i;for(;++n0){let e=a.tokenStack[a.tokenStack.length-1];(e[1]||Ui).call(a,void 0,e[0])}for(r.position={start:Bi(e.length>0?e[0][1].start:{line:1,column:1,offset:0}),end:Bi(e.length>0?e[e.length-2][1].end:{line:1,column:1,offset:0})},d=-1;++dvoid c({to:`/dashboards/$dashboardId`,params:{dashboardId:t},search:r(n),replace:i,resetScroll:t!==e});return(0,o.jsx)(i,{dashboardId:e,search:s,onSearch:(t,n)=>l(e,t,n),onOpen:(e,t)=>l(e,{},t)})}export{s as component}; \ No newline at end of file diff --git a/internal/ui/dist/assets/dashboards._dashboardId-CGcM78tU.js b/internal/ui/dist/assets/dashboards._dashboardId-CGcM78tU.js new file mode 100644 index 000000000..7171c31fe --- /dev/null +++ b/internal/ui/dist/assets/dashboards._dashboardId-CGcM78tU.js @@ -0,0 +1 @@ +import{r as e}from"./useRouter-ByJ6_rwb.js";import{n as t}from"./useNavigate-B1zgPEUp.js";import{t as n}from"./page-BaMlOBRS.js";import{f as r,g as i,y as a}from"./index-D1TEoZWj.js";var o=e();function s(){let{dashboardId:e}=r.useParams(),s=i(r.useSearch()),c=t(),l=(t,n,r)=>void c({to:`/dashboards/$dashboardId`,params:{dashboardId:t},search:a(n),replace:r,resetScroll:t!==e});return(0,o.jsx)(n,{dashboardId:e,search:s,onSearch:(t,n)=>l(e,t,n),onOpen:(e,t)=>l(e,{},t)})}export{s as component}; \ No newline at end of file diff --git a/internal/ui/dist/assets/dashboards.index-BGm8G1FV.js b/internal/ui/dist/assets/dashboards.index-BGm8G1FV.js new file mode 100644 index 000000000..eef525c9b --- /dev/null +++ b/internal/ui/dist/assets/dashboards.index-BGm8G1FV.js @@ -0,0 +1 @@ +import{r as e}from"./useRouter-ByJ6_rwb.js";import{n as t}from"./useNavigate-B1zgPEUp.js";import{t as n}from"./page-BaMlOBRS.js";import{g as r,p as i,y as a}from"./index-D1TEoZWj.js";var o=e();function s(){let e=r(i.useSearch()),s=t();return(0,o.jsx)(n,{search:e,onSearch:()=>void 0,onOpen:(t,n)=>void s({to:`/dashboards/$dashboardId`,params:{dashboardId:t},search:a(e),replace:n})})}export{s as component}; \ No newline at end of file diff --git a/internal/ui/dist/assets/dashboards.index-mQSdDlyY.js b/internal/ui/dist/assets/dashboards.index-mQSdDlyY.js deleted file mode 100644 index 51fc15318..000000000 --- a/internal/ui/dist/assets/dashboards.index-mQSdDlyY.js +++ /dev/null @@ -1 +0,0 @@ -import{r as e}from"./useRouter-ByJ6_rwb.js";import{n as t}from"./useNavigate-B1zgPEUp.js";import{_ as n,b as r}from"./theme-DdznftKI.js";import{t as i}from"./page-vAmZFsvk.js";import{n as a}from"./index-CNsdEvGl.js";var o=e();function s(){let e=n(a.useSearch()),s=t();return(0,o.jsx)(i,{search:e,onSearch:()=>void 0,onOpen:(t,n)=>void s({to:`/dashboards/$dashboardId`,params:{dashboardId:t},search:r(e),replace:n})})}export{s as component}; \ No newline at end of file diff --git a/internal/ui/dist/assets/index-CNsdEvGl.js b/internal/ui/dist/assets/index-CNsdEvGl.js deleted file mode 100644 index a475a6b94..000000000 --- a/internal/ui/dist/assets/index-CNsdEvGl.js +++ /dev/null @@ -1,97 +0,0 @@ -const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/routes-D2AdaqvY.js","assets/useRouter-ByJ6_rwb.js","assets/useNavigate-B1zgPEUp.js","assets/settings-BnFwabAq.js","assets/brand-Bcp2Tp5I.js","assets/Tooltip-DhnGSmh7.js","assets/useQuery-CEXOTfck.js","assets/auth-C8kS8ur3.js","assets/WarningCircle.es-CQHtdoVp.js","assets/chat.index-eVfsC4Jb.js","assets/chat-_owdy9Bf.js","assets/preload-helper-DpsUT6aH.js","assets/dashboard-change-chips-C08J6wNb.js","assets/chat._threadId-eVfsC4Jb.js","assets/dashboards.index-mQSdDlyY.js","assets/theme-DdznftKI.js","assets/use-computed-color-scheme-BIja2o3c.js","assets/page-vAmZFsvk.js","assets/dashboards._dashboardId-09220iIf.js"])))=>i.map(i=>d[i]); -import{a as e,i as t,n,o as r,r as i,s as a,t as o}from"./useRouter-ByJ6_rwb.js";import{A as s,B as c,C as l,F as u,G as d,H as f,I as p,J as m,K as h,L as g,M as _,N as v,P as y,R as b,S as ee,T as x,V as S,W as te,X as C,Y as ne,_ as re,_t as ie,a as w,at as ae,c as oe,d as se,f as ce,gt as le,ht as ue,it as de,k as fe,lt as pe,mt as T,nt as me,p as he,pt as ge,st as _e,t as ve,tt as ye,u as be,ut as xe,w as Se,y as Ce}from"./brand-Bcp2Tp5I.js";import{i as E,n as we,t as Te}from"./useNavigate-B1zgPEUp.js";import{A as Ee,B as De,C as Oe,D as ke,E as Ae,F as je,I as Me,M as Ne,N as Pe,O as Fe,P as Ie,R as Le,S as Re,T as ze,V as Be,_ as Ve,a as He,b as Ue,h as We,i as Ge,j as Ke,k as qe,m as Je,n as Ye,r as Xe,s as Ze,t as Qe,u as $e,v as et,x as tt,y as nt,z as rt}from"./preload-helper-DpsUT6aH.js";import{A as it,B as at,E as ot,H as st,Q as ct,S as lt,T as ut,U as dt,V as ft,W as pt,X as mt,Y as ht,Z as gt,_ as _t,a as vt,at as yt,b as bt,ct as xt,dt as St,et as Ct,it as wt,lt as Tt,n as Et,nt as Dt,ot as Ot,rt as kt,st as At,t as jt,tt as Mt,ut as Nt,x as Pt,z as Ft}from"./theme-DdznftKI.js";import{E as It,T as Lt,o as Rt,t as zt,x as Bt}from"./Tooltip-DhnGSmh7.js";import{n as Vt,t as Ht}from"./use-computed-color-scheme-BIja2o3c.js";import{C as Ut,E as Wt,F as Gt,L as Kt,T as qt,_ as Jt,a as Yt,b as Xt,c as Zt,d as Qt,f as $t,g as en,h as tn,l as nn,m as rn,n as an,o as on,p as sn,r as cn,s as ln,t as un,u as dn,v as fn,w as pn,y as mn}from"./useQuery-CEXOTfck.js";import{a as hn,i as gn,n as _n,r as vn,s as yn,t as bn}from"./auth-C8kS8ur3.js";(function(){let e=document.createElement(`link`).relList;if(e&&e.supports&&e.supports(`modulepreload`))return;for(let e of document.querySelectorAll(`link[rel="modulepreload"]`))n(e);new MutationObserver(e=>{for(let t of e)if(t.type===`childList`)for(let e of t.addedNodes)e.tagName===`LINK`&&e.rel===`modulepreload`&&n(e)}).observe(document,{childList:!0,subtree:!0});function t(e){let t={};return e.integrity&&(t.integrity=e.integrity),e.referrerPolicy&&(t.referrerPolicy=e.referrerPolicy),t.credentials=e.crossOrigin===`use-credentials`?`include`:e.crossOrigin===`anonymous`?`omit`:`same-origin`,t}function n(e){if(e.ep)return;e.ep=!0;let n=t(e);fetch(e.href,n)}})();var xn=e((e=>{function t(e,t){var n=e.length;e.push(t);a:for(;0>>1,a=e[r];if(0>>1;ri(c,n))li(u,c)?(e[r]=u,e[l]=n,r=l):(e[r]=c,e[s]=n,r=s);else if(li(u,n))e[r]=u,e[l]=n,r=l;else break a}}return t}function i(e,t){var n=e.sortIndex-t.sortIndex;return n===0?e.id-t.id:n}if(e.unstable_now=void 0,typeof performance==`object`&&typeof performance.now==`function`){var a=performance;e.unstable_now=function(){return a.now()}}else{var o=Date,s=o.now();e.unstable_now=function(){return o.now()-s}}var c=[],l=[],u=1,d=null,f=3,p=!1,m=!1,h=!1,g=!1,_=typeof setTimeout==`function`?setTimeout:null,v=typeof clearTimeout==`function`?clearTimeout:null,y=typeof setImmediate<`u`?setImmediate:null;function b(e){for(var i=n(l);i!==null;){if(i.callback===null)r(l);else if(i.startTime<=e)r(l),i.sortIndex=i.expirationTime,t(c,i);else break;i=n(l)}}function ee(e){if(h=!1,b(e),!m){if(n(c)!==null)m=!0,x||(x=!0,ie());else{var t=n(l);t!==null&&oe(ee,t.startTime-e)}}}var x=!1,S=-1,te=5,C=-1;function ne(){return g?!0:!(e.unstable_now()-Ct&&ne());){var o=d.callback;if(typeof o==`function`){d.callback=null,f=d.priorityLevel;var s=o(d.expirationTime<=t);if(t=e.unstable_now(),typeof s==`function`){d.callback=s,b(t),i=!0;break b}d===n(c)&&r(c),b(t)}else r(c);d=n(c)}if(d!==null)i=!0;else{var u=n(l);u!==null&&oe(ee,u.startTime-t),i=!1}}break a}finally{d=null,f=a,p=!1}i=void 0}}finally{i?ie():x=!1}}}var ie;if(typeof y==`function`)ie=function(){y(re)};else if(typeof MessageChannel<`u`){var w=new MessageChannel,ae=w.port2;w.port1.onmessage=re,ie=function(){ae.postMessage(null)}}else ie=function(){_(re,0)};function oe(t,n){S=_(function(){t(e.unstable_now())},n)}e.unstable_IdlePriority=5,e.unstable_ImmediatePriority=1,e.unstable_LowPriority=4,e.unstable_NormalPriority=3,e.unstable_Profiling=null,e.unstable_UserBlockingPriority=2,e.unstable_cancelCallback=function(e){e.callback=null},e.unstable_forceFrameRate=function(e){0>e||125o?(r.sortIndex=a,t(l,r),n(c)===null&&r===n(l)&&(h?(v(S),S=-1):h=!0,oe(ee,a-o))):(r.sortIndex=s,t(c,r),m||p||(m=!0,x||(x=!0,ie()))),r},e.unstable_shouldYield=ne,e.unstable_wrapCallback=function(e){var t=f;return function(){var n=f;f=t;try{return e.apply(this,arguments)}finally{f=n}}}})),Sn=e(((e,t)=>{t.exports=xn()})),Cn=e((e=>{var n=Sn(),r=t(),i=ie();function a(e){var t=`https://react.dev/errors/`+e;if(1De||(e.current=Ee[De],Ee[De]=null,De--)}function Ae(e,t){De++,Ee[De]=e.current,e.current=t}var je=Oe(null),Me=Oe(null),Ne=Oe(null),Pe=Oe(null);function Fe(e,t){switch(Ae(Ne,t),Ae(Me,e),Ae(je,null),t.nodeType){case 9:case 11:e=(e=t.documentElement)&&(e=e.namespaceURI)?Cp(e):0;break;default:if(e=t.tagName,t=t.namespaceURI)t=Cp(t),e=wp(t,e);else switch(e){case`svg`:e=1;break;case`math`:e=2;break;default:e=0}}ke(je),Ae(je,e)}function Ie(){ke(je),ke(Me),ke(Ne)}function Le(e){var t=e.memoizedState;t!==null&&(bh._currentValue=t.memoizedState,Ae(Pe,e)),t=je.current;var n=wp(t,e.type);t!==n&&(Ae(Me,e),Ae(je,n))}function Re(e){Me.current===e&&(ke(je),ke(Me)),Pe.current===e&&(ke(Pe),bh._currentValue=Te)}var ze,Be;function Ve(e){if(ze===void 0)try{throw Error()}catch(e){var t=e.stack.trim().match(/\n( *(at )?)/);ze=t&&t[1]||``,Be=-1)`:-1i||c[r]!==l[i]){var u=` -`+c[r].replace(` at new `,` at `);return e.displayName&&u.includes(``)&&(u=u.replace(``,e.displayName)),u}while(1<=r&&0<=i);break}}}finally{He=!1,Error.prepareStackTrace=n}return(n=e?e.displayName||e.name:``)?Ve(n):``}function We(e,t){switch(e.tag){case 26:case 27:case 5:return Ve(e.type);case 16:return Ve(`Lazy`);case 13:return e.child!==t&&t!==null?Ve(`Suspense Fallback`):Ve(`Suspense`);case 19:return Ve(`SuspenseList`);case 0:case 15:return Ue(e.type,!1);case 11:return Ue(e.type.render,!1);case 1:return Ue(e.type,!0);case 31:return Ve(`Activity`);case 30:return Ve(`ViewTransition`);default:return``}}function Ge(e){try{var t=``,n=null;do t+=We(e,n),n=e,e=e.return;while(e);return t}catch(e){return` -Error generating stack: `+e.message+` -`+e.stack}}var Ke=Object.prototype.hasOwnProperty,qe=n.unstable_scheduleCallback,Je=n.unstable_cancelCallback,Ye=n.unstable_shouldYield,Xe=n.unstable_requestPaint,Ze=n.unstable_now,Qe=n.unstable_getCurrentPriorityLevel,$e=n.unstable_ImmediatePriority,et=n.unstable_UserBlockingPriority,tt=n.unstable_NormalPriority,nt=n.unstable_LowPriority,rt=n.unstable_IdlePriority,it=n.log,at=n.unstable_setDisableYieldValue,ot=null,st=null;function ct(e){if(typeof it==`function`&&at(e),st&&typeof st.setStrictMode==`function`)try{st.setStrictMode(ot,e)}catch{}}var lt=Math.clz32?Math.clz32:ft,ut=Math.log,dt=Math.LN2;function ft(e){return e>>>=0,e===0?32:31-(ut(e)/dt|0)|0}var pt=256,mt=262144,ht=4194304;function gt(e){var t=e&42;if(t!==0)return t;switch(e&-e){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:return 64;case 128:return 128;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:return e&-e;case 262144:case 524288:case 1048576:case 2097152:return e&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return e&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return e}}function _t(e,t,n){var r=e.pendingLanes;if(r===0)return 0;var i=0,a=e.suspendedLanes,o=e.pingedLanes;e=e.warmLanes;var s=r&134217727;return s===0?(s=r&~a,s===0?o===0?n||(n=r&~e,n!==0&&(i=gt(n))):i=gt(o):i=gt(s)):(r=s&~a,r===0?(o&=s,o===0?n||(n=s&~e,n!==0&&(i=gt(n))):i=gt(o)):i=gt(r)),i===0?0:t!==0&&t!==i&&(t&a)===0&&(a=i&-i,n=t&-t,a>=n||a===32&&n&4194048)?t:i}function vt(e,t){return(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&t)===0}function yt(e,t){t&8&&(t|=t&32);var n=e.entangledLanes;if(n!==0)for(e=e.entanglements,n&=t;0n;n++)t.push(e);return t}function Ct(e,t){e.pendingLanes|=t,t!==268435456&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function wt(e,t,n,r,i,a){var o=e.pendingLanes;e.pendingLanes=n,e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0,e.expiredLanes&=n,e.entangledLanes&=n,e.errorRecoveryDisabledLanes&=n,e.shellSuspendCounter=0;var s=e.entanglements,c=e.expirationTimes,l=e.hiddenUpdates;for(n=o&~n;0=Tr),Or=` `,kr=!1;function Ar(e,t){switch(e){case`keyup`:return Cr.indexOf(t.keyCode)!==-1;case`keydown`:return t.keyCode!==229;case`keypress`:case`mousedown`:case`focusout`:return!0;default:return!1}}function jr(e){return e=e.detail,typeof e==`object`&&`data`in e?e.data:null}var Mr=!1;function Nr(e,t){switch(e){case`compositionend`:return jr(t);case`keypress`:return t.which===32?(kr=!0,Or):null;case`textInput`:return e=t.data,e===Or&&kr?null:e;default:return null}}function Pr(e,t){if(Mr)return e===`compositionend`||!wr&&Ar(e,t)?(e=Kn(),Gn=Wn=Un=null,Mr=!1,e):null;switch(e){case`paste`:return null;case`keypress`:if(!(t.ctrlKey||t.altKey||t.metaKey)||t.ctrlKey&&t.altKey){if(t.char&&1=t)return{node:n,offset:t-e};e=r}a:{for(;n;){if(n.nextSibling){n=n.nextSibling;break a}n=n.parentNode}n=void 0}n=ri(n)}}function ai(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?ai(e,t.parentNode):`contains`in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function oi(e){e=e!=null&&e.ownerDocument!=null&&e.ownerDocument.defaultView!=null?e.ownerDocument.defaultView:window;for(var t=ni(e.document);t instanceof e.HTMLIFrameElement;){try{var n=typeof t.contentWindow.location.href==`string`}catch{n=!1}if(n)e=t.contentWindow;else break;t=ni(e.document)}return t}function si(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&(t===`input`&&(e.type===`text`||e.type===`search`||e.type===`tel`||e.type===`url`||e.type===`password`)||t===`textarea`||e.contentEditable===`true`)}var ci=Bn&&`documentMode`in document&&11>=document.documentMode,li=null,ui=null,di=null,fi=!1;function pi(e,t,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;fi||li==null||li!==ni(r)||(r=li,`selectionStart`in r&&si(r)?r={start:r.selectionStart,end:r.selectionEnd}:(r=(r.ownerDocument&&r.ownerDocument.defaultView||window).getSelection(),r={anchorNode:r.anchorNode,anchorOffset:r.anchorOffset,focusNode:r.focusNode,focusOffset:r.focusOffset}),di&&ti(di,r)||(di=r,r=op(ui,`onSelect`),0>=o,i-=o,sa=1<<32-lt(t)+i|n<h?(g=d,d=null):g=d.sibling;var _=p(i,d,s[h],c);if(_===null){d===null&&(d=g);break}e&&d&&_.alternate===null&&t(i,d),a=o(_,a,h),u===null?l=_:u.sibling=_,u=_,d=g}if(h===s.length)return n(i,d),k&&la(i,h),l;if(d===null){for(;hg?(_=h,h=null):_=h.sibling;var y=p(i,h,v.value,l);if(y===null){h===null&&(h=_);break}e&&h&&y.alternate===null&&t(i,h),s=o(y,s,g),d===null?u=y:d.sibling=y,d=y,h=_}if(v.done)return n(i,h),k&&la(i,g),u;if(h===null){for(;!v.done;g++,v=c.next())v=f(i,v.value,l),v!==null&&(s=o(v,s,g),d===null?u=v:d.sibling=v,d=v);return k&&la(i,g),u}for(h=r(h);!v.done;g++,v=c.next())v=m(h,i,g,v.value,l),v!==null&&(e&&(_=v.alternate,_!==null&&h.delete(_.key===null?g:_.key)),s=o(v,s,g),d===null?u=v:d.sibling=v,d=v);return e&&h.forEach(function(e){return t(i,e)}),k&&la(i,g),u}function _(e,r,o,c){if(typeof o==`object`&&o&&o.type===ae&&o.key===null&&o.props.ref===void 0&&(o=o.props.children),typeof o==`object`&&o){switch(o.$$typeof){case re:a:{for(var l=o.key;r!==null;){if(r.key===l){if(l=o.type,l===ae){if(r.tag===7){n(e,r.sibling),c=i(r,o.props.children),bo(c,o),c.return=e,e=c;break a}}else if(r.elementType===l||typeof l==`object`&&l&&l.$$typeof===T&&po(l)===r.type){n(e,r.sibling),c=i(r,o.props),bo(c,o),c.return=e,e=c;break a}n(e,r);break}t(e,r),r=r.sibling}o.type===ae?(c=Ji(o.props.children,e.mode,c,o.key),bo(c,o),c.return=e,e=c):(c=qi(o.type,o.key,o.props,null,e.mode,c),bo(c,o),c.return=e,e=c)}return s(e);case w:a:{for(l=o.key;r!==null;){if(r.key===l){if(r.tag===4&&r.stateNode.containerInfo===o.containerInfo&&r.stateNode.implementation===o.implementation){n(e,r.sibling),c=i(r,o.children||[]),c.return=e,e=c;break a}n(e,r);break}t(e,r),r=r.sibling}c=Zi(o,e.mode,c),c.return=e,e=c}return s(e);case T:return o=po(o),_(e,r,o,c)}if(Ce(o))return h(e,r,o,c);if(be(o)){if(l=be(o),typeof l!=`function`)throw Error(a(150));return o=l.call(o),g(e,r,o,c)}if(typeof o.then==`function`)return _(e,r,yo(o),c);if(o.$$typeof===le)return _(e,r,La(e,o),c);xo(e,o)}return typeof o==`string`&&o!==``||typeof o==`number`||typeof o==`bigint`?(o=``+o,r!==null&&r.tag===6?(n(e,r.sibling),c=i(r,o),c.return=e,e=c):(n(e,r),c=Yi(o,e.mode,c),c.return=e,e=c),s(e)):n(e,r)}return function(e,t,n,r){try{vo=0;var i=_(e,t,n,r);return _o=null,i}catch(t){if(t===oo||t===co)throw t;var a=Ui(29,t,null,e.mode);return a.lanes=r,a.return=e,a}}}var Co=So(!0),wo=So(!1),To=!1;function Eo(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function Do(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,callbacks:null})}function Oo(e){return{lane:e,tag:0,payload:null,callback:null,next:null}}function ko(e,t,n){var r=e.updateQueue;if(r===null)return null;if(r=r.shared,cd&2){var i=r.pending;return i===null?t.next=t:(t.next=i.next,i.next=t),r.pending=t,t=Bi(e),O(e,null,n),t}return Ri(e,r,t,n),Bi(e)}function Ao(e,t,n){if(t=t.updateQueue,t!==null&&(t=t.shared,n&4194048)){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,Et(e,n)}}function jo(e,t){var n=e.updateQueue,r=e.alternate;if(r!==null&&(r=r.updateQueue,n===r)){var i=null,a=null;if(n=n.firstBaseUpdate,n!==null){do{var o={lane:n.lane,tag:n.tag,payload:n.payload,callback:null,next:null};a===null?i=a=o:a=a.next=o,n=n.next}while(n!==null);a===null?i=a=t:a=a.next=t}else i=a=t;n={baseState:r.baseState,firstBaseUpdate:i,lastBaseUpdate:a,shared:r.shared,callbacks:r.callbacks},e.updateQueue=n;return}e=n.lastBaseUpdate,e===null?n.firstBaseUpdate=t:e.next=t,n.lastBaseUpdate=t}var Mo=!1;function No(){if(Mo){var e=Za;if(e!==null)throw e}}function Po(e,t,n,r){Mo=!1;var i=e.updateQueue;To=!1;var a=i.firstBaseUpdate,o=i.lastBaseUpdate,s=i.shared.pending;if(s!==null){i.shared.pending=null;var c=s,l=c.next;c.next=null,o===null?a=l:o.next=l,o=c;var u=e.alternate;u!==null&&(u=u.updateQueue,s=u.lastBaseUpdate,s!==o&&(s===null?u.firstBaseUpdate=l:s.next=l,u.lastBaseUpdate=c))}if(a!==null){var d=i.baseState;o=0,u=l=c=null,s=a;do{var f=s.lane&-536870913,p=f!==s.lane;if(p?(z&f)===f:(r&f)===f){f!==0&&f===Xa&&(Mo=!0),u!==null&&(u=u.next={lane:0,tag:s.tag,payload:s.payload,callback:null,next:null});a:{var m=e,h=s;f=t;var g=n;switch(h.tag){case 1:if(m=h.payload,typeof m==`function`){d=m.call(g,d,f);break a}d=m;break a;case 3:m.flags=m.flags&-65537|128;case 0:if(m=h.payload,f=typeof m==`function`?m.call(g,d,f):m,f==null)break a;d=C({},d,f);break a;case 2:To=!0}}f=s.callback,f!==null&&(e.flags|=64,p&&(e.flags|=8192),p=i.callbacks,p===null?i.callbacks=[f]:p.push(f))}else p={lane:f,tag:s.tag,payload:s.payload,callback:s.callback,next:null},u===null?(l=u=p,c=d):u=u.next=p,o|=f;if(s=s.next,s===null){if(s=i.shared.pending,s===null)break;p=s,s=p.next,p.next=null,i.lastBaseUpdate=p,i.shared.pending=null}}while(1);u===null&&(c=d),i.baseState=c,i.firstBaseUpdate=l,i.lastBaseUpdate=u,a===null&&(i.shared.lanes=0),_d|=o,e.lanes=o,e.memoizedState=d}}function Fo(e,t){if(typeof e!=`function`)throw Error(a(191,e));e.call(t)}function A(e,t){var n=e.callbacks;if(n!==null)for(e.callbacks=null,e=0;ea?a:8;var o=E.T,s={};s.types=o===null?null:o.types,E.T=s,xc(e,!1,t,n);try{var c=i(),l=E.S;l!==null&&l(s,c),typeof c==`object`&&c&&typeof c.then==`function`?bc(e,t,eo(c,r),Hd(e)):bc(e,t,r,Hd(e))}catch(n){bc(e,t,{then:function(){},status:`rejected`,reason:n},Hd())}finally{we.p=a,o!==null&&s.types!==null&&(o.types=s.types),E.T=o}}function uc(){}function dc(e,t,n,r){if(e.tag!==5)throw Error(a(476));var i=fc(e).queue;lc(e,i,t,Te,n===null?uc:function(){return pc(e),n(r)})}function fc(e){var t=e.memoizedState;if(t!==null)return t;t={memoizedState:Te,baseState:Te,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Ss,lastRenderedState:Te},next:null};var n={};return t.next={memoizedState:n,baseState:n,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Ss,lastRenderedState:n},next:null},e.memoizedState=t,e=e.alternate,e!==null&&(e.memoizedState=t),t}function pc(e){var t=fc(e);t.next===null&&(t=e.alternate.memoizedState),bc(e,t.next.queue,{},Hd())}function mc(){return Ia(bh)}function hc(){return _s().memoizedState}function gc(){return _s().memoizedState}function _c(e){for(var t=e.return;t!==null;){switch(t.tag){case 24:case 3:var n=Hd();e=Oo(n);var r=ko(t,e,n);r!==null&&(Gd(r,t,n),Ao(r,t,n)),t={cache:Ua()},e.payload=t;return}t=t.return}}function vc(e,t,n){var r=Hd();n={lane:r,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null},Sc(e)?Cc(t,n):(n=zi(e,t,n,r),n!==null&&(Gd(n,e,r),wc(n,t,r)))}function yc(e,t,n){bc(e,t,n,Hd())}function bc(e,t,n,r){var i={lane:r,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null};if(Sc(e))Cc(t,i);else{var a=e.alternate;if(e.lanes===0&&(a===null||a.lanes===0)&&(a=t.lastRenderedReducer,a!==null))try{var o=t.lastRenderedState,s=a(o,n);if(i.hasEagerState=!0,i.eagerState=s,ei(s,o))return Ri(e,t,i,0),ld===null&&Li(),!1}catch{}if(n=zi(e,t,i,r),n!==null)return Gd(n,e,r),wc(n,t,r),!0}return!1}function xc(e,t,n,r){if(r={lane:2,revertLane:Kf(),gesture:null,action:r,hasEagerState:!1,eagerState:null,next:null},Sc(e)){if(t)throw Error(a(479))}else t=zi(e,n,r,2),t!==null&&Gd(t,e,2)}function Sc(e){var t=e.alternate;return e===M||t!==null&&t===M}function Cc(e,t){ts=es=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function wc(e,t,n){if(n&4194048){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,Et(e,n)}}var Tc={readContext:Ia,use:bs,useCallback:ss,useContext:ss,useEffect:ss,useImperativeHandle:ss,useLayoutEffect:ss,useInsertionEffect:ss,useMemo:ss,useReducer:ss,useRef:ss,useState:ss,useDebugValue:ss,useDeferredValue:ss,useTransition:ss,useSyncExternalStore:ss,useId:ss,useHostTransitionStatus:ss,useFormState:ss,useActionState:ss,useOptimistic:ss,useMemoCache:ss,useCacheRefresh:ss,useEffectEvent:ss},Ec={readContext:Ia,use:bs,useCallback:function(e,t){return gs().memoizedState=[e,t===void 0?null:t],e},useContext:Ia,useEffect:Xs,useImperativeHandle:function(e,t,n){n=n==null?null:n.concat([e]),Js(4194308,4,nc.bind(null,t,e),n)},useLayoutEffect:function(e,t){return Js(4194308,4,e,t)},useInsertionEffect:function(e,t){Js(4,2,e,t)},useMemo:function(e,t){var n=gs();t=t===void 0?null:t;var r=e();if(ns){ct(!0);try{e()}finally{ct(!1)}}return n.memoizedState=[r,t],r},useReducer:function(e,t,n){var r=gs();if(n!==void 0){var i=n(t);if(ns){ct(!0);try{n(t)}finally{ct(!1)}}}else i=t;return r.memoizedState=r.baseState=i,e={pending:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:i},r.queue=e,e=e.dispatch=vc.bind(null,M,e),[r.memoizedState,e]},useRef:function(e){var t=gs();return e={current:e},t.memoizedState=e},useState:function(e){e=Ms(e);var t=e.queue,n=yc.bind(null,M,t);return t.dispatch=n,[e.memoizedState,n]},useDebugValue:ic,useDeferredValue:function(e,t){return sc(gs(),e,t)},useTransition:function(){var e=Ms(!1);return e=lc.bind(null,M,e.queue,!0,!1),gs().memoizedState=e,[!1,e]},useSyncExternalStore:function(e,t,n){var r=M,i=gs();if(k){if(n===void 0)throw Error(a(407));n=n()}else{if(n=t(),ld===null)throw Error(a(349));z&127||Ds(r,t,n)}i.memoizedState=n;var o={value:n,getSnapshot:t};return i.queue=o,Xs(ks.bind(null,r,o,e),[e]),r.flags|=2048,Ks(9,{destroy:void 0},Os.bind(null,r,o,n,t),null),n},useId:function(){var e=gs(),t=ld.identifierPrefix;if(k){var n=ca,r=sa;n=(r&~(1<<32-lt(r)-1)).toString(32)+n,t=`_`+t+`R_`+n,n=rs++,0<\/script>`,o=o.removeChild(o.firstChild);break;case`select`:o=typeof r.is==`string`?s.createElement(`select`,{is:r.is}):s.createElement(`select`),r.multiple?o.multiple=!0:r.size&&(o.size=r.size);break;default:o=typeof r.is==`string`?s.createElement(i,{is:r.is}):s.createElement(i)}}o[Nt]=t,o[Pt]=r;a:for(s=t.child;s!==null;){if(s.tag===5||s.tag===6)o.appendChild(s.stateNode);else if(s.tag!==4&&s.tag!==27&&s.child!==null){s.child.return=s,s=s.child;continue}if(s===t)break a;for(;s.sibling===null;){if(s.return===null||s.return===t)break a;s=s.return}s.sibling.return=s.return,s=s.sibling}t.stateNode=o;a:switch(hp(o,i,r),i){case`button`:case`input`:case`select`:case`textarea`:r=!!r.autoFocus;break a;case`img`:r=!0;break a;default:r=!1}r&&Cl(t)}}return Ol(t),t.subtreeFlags&=-33554433,wl(t,t.type,e===null?null:e.memoizedProps,t.pendingProps,n),null;case 6:if(e&&t.stateNode!=null)e.memoizedProps!==r&&Cl(t);else{if(typeof r!=`string`&&t.stateNode===null)throw Error(a(166));if(e=Ne.current,Sa(t)){if(e=t.stateNode,n=t.memoizedProps,r=null,i=ma,i!==null)switch(i.tag){case 27:case 5:r=i.memoizedProps}e[Nt]=t,e=!!(e.nodeValue===n||r!==null&&!0===r.suppressHydrationWarning||fp(e.nodeValue,n)),e||ya(t,!0)}else e=Sp(e).createTextNode(r),e[Nt]=t,t.stateNode=e}return Ol(t),null;case 31:if(n=t.memoizedState,e===null||e.memoizedState!==null){if(r=Sa(t),n!==null){if(e===null){if(!r)throw Error(a(318));if(e=t.memoizedState,e=e===null?null:e.dehydrated,!e)throw Error(a(557));e[Nt]=t}else Ca(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;Ol(t),e=!1}else n=wa(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=n),e=!0;if(!e)return t.flags&256?(Ko(t),t):(Ko(t),null);if(t.flags&128)throw Error(a(558))}return Ol(t),null;case 13:if(r=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(i=Sa(t),r!==null&&r.dehydrated!==null){if(e===null){if(!i)throw Error(a(318));if(i=t.memoizedState,i=i===null?null:i.dehydrated,!i)throw Error(a(317));i[Nt]=t}else Ca(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;Ol(t),i=!1}else i=wa(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=i),i=!0;if(!i)return t.flags&256?(Ko(t),t):(Ko(t),null)}return Ko(t),t.flags&128?(t.lanes=n,t):(n=r!==null,e=e!==null&&e.memoizedState!==null,n&&(r=t.child,i=null,r.alternate!==null&&r.alternate.memoizedState!==null&&r.alternate.memoizedState.cachePool!==null&&(i=r.alternate.memoizedState.cachePool.pool),o=null,r.memoizedState!==null&&r.memoizedState.cachePool!==null&&(o=r.memoizedState.cachePool.pool),o!==i&&(r.flags|=2048)),n!==e&&n&&(t.child.flags|=8192),El(t,t.updateQueue),Ol(t),null);case 4:return Ie(),e===null&&np(t.stateNode.containerInfo),t.flags|=67108864,Ol(t),null;case 10:return Aa(t.type),Ol(t),null;case 19:if(Yo(t),r=t.memoizedState,r===null)return Ol(t),null;if(i=!!(t.flags&128),o=r.rendering,o===null){if(i)Dl(r,!1);else{if(gd!==0||e!==null&&e.flags&128)for(e=t.child;e!==null;){if(o=Xo(e),o!==null){for(t.flags|=128,Dl(r,!1),e=o.updateQueue,t.updateQueue=e,El(t,e),t.subtreeFlags=0,e=n,n=t.child;n!==null;)Ki(n,e),n=n.sibling;return Jo(t,qo.current&1|2),k&&la(t,r.treeForkCount),t.child}e=e.sibling}r.tail!==null&&Ze()>Dd&&(t.flags|=128,i=!0,Dl(r,!1),t.lanes=4194304)}}else{if(!i){if(e=Xo(o),e!==null){if(t.flags|=128,i=!0,e=e.updateQueue,t.updateQueue=e,El(t,e),Dl(r,!0),r.tail===null&&r.tailMode!==`collapsed`&&r.tailMode!==`visible`&&!o.alternate&&!k)return Ol(t),null}else 2*Ze()-r.renderingStartTime>Dd&&n!==536870912&&(t.flags|=128,i=!0,Dl(r,!1),t.lanes=4194304)}r.isBackwards?(o.sibling=t.child,t.child=o):(e=r.last,e===null?t.child=o:e.sibling=o,r.last=o)}if(r.tail!==null){e=r.tail;a:{for(n=e;n!==null;){if(n.alternate!==null){n=!1;break a}n=n.sibling}n=!0}return r.rendering=e,r.tail=e.sibling,r.renderingStartTime=Ze(),e.sibling=null,o=qo.current,o=i?o&1|2:o&1,r.tailMode===`visible`||r.tailMode===`collapsed`||!n||k?Jo(t,o):(n=o,Ae(Bo,t),Ae(qo,n),Vo===null&&(Vo=t)),k&&la(t,r.treeForkCount),e}return Ol(t),null;case 22:case 23:return Ko(t),zo(),r=t.memoizedState!==null,e===null?r&&(t.flags|=8192):e.memoizedState!==null!==r&&(t.flags|=8192),r?n&536870912&&!(t.flags&128)&&(Ol(t),t.subtreeFlags&6&&(t.flags|=8192)):Ol(t),n=t.updateQueue,n!==null&&El(t,n.retryQueue),n=null,e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(n=e.memoizedState.cachePool.pool),r=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(r=t.memoizedState.cachePool.pool),r!==n&&(t.flags|=2048),e!==null&&ke(no),null;case 24:return n=null,e!==null&&(n=e.memoizedState.cache),t.memoizedState.cache!==n&&(t.flags|=2048),Aa(Ha),Ol(t),null;case 25:return null;case 30:return t.flags|=33554432,Ol(t),null}throw Error(a(156,t.tag))}function Al(e,t){switch(fa(t),t.tag){case 1:return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return Aa(Ha),Ie(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 26:case 27:case 5:return Re(t),null;case 31:if(t.memoizedState!==null){if(Ko(t),t.alternate===null)throw Error(a(340));Ca()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 13:if(Ko(t),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(a(340));Ca()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return Yo(t),e=t.flags,e&65536?(t.flags=e&-65537|128,e=t.memoizedState,e!==null&&(e.rendering=null,e.tail=null),t.flags|=4,t):null;case 4:return Ie(),null;case 10:return Aa(t.type),null;case 22:case 23:return Ko(t),zo(),e!==null&&ke(no),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 24:return Aa(Ha),null;case 25:return null;default:return null}}function jl(e,t){switch(fa(t),t.tag){case 3:Aa(Ha),Ie();break;case 26:case 27:case 5:Re(t);break;case 4:Ie();break;case 31:t.memoizedState!==null&&Ko(t);break;case 13:Ko(t);break;case 19:Yo(t);break;case 10:Aa(t.type);break;case 22:case 23:Ko(t),zo(),e!==null&&ke(no);break;case 24:Aa(Ha)}}function Ml(e,t){try{var n=t.updateQueue,r=n===null?null:n.lastEffect;if(r!==null){var i=r.next;n=i;do{if((n.tag&e)===e){r=void 0;var a=n.create,o=n.inst;r=a(),o.destroy=r}n=n.next}while(n!==i)}}catch(e){Tf(t,t.return,e)}}function Nl(e,t,n){try{var r=t.updateQueue,i=r===null?null:r.lastEffect;if(i!==null){var a=i.next;r=a;do{if((r.tag&e)===e){var o=r.inst,s=o.destroy;if(s!==void 0){o.destroy=void 0,i=t;var c=n,l=s;try{l()}catch(e){Tf(i,c,e)}}}r=r.next}while(r!==a)}}catch(e){Tf(t,t.return,e)}}function Pl(e){var t=e.updateQueue;if(t!==null){var n=e.stateNode;try{A(t,n)}catch(t){Tf(e,e.return,t)}}}function Fl(e,t,n){n.props=Nc(e.type,e.memoizedProps),n.state=e.memoizedState;try{n.componentWillUnmount()}catch(n){Tf(e,t,n)}}function Il(e,t){try{var n=e.ref;if(n!==null){switch(e.tag){case 26:case 27:case 5:var r=e.stateNode;break;case 30:var i=e.stateNode,a=Ai(e.memoizedProps,i);(i.ref===null||i.ref.name!==a)&&(i.ref=qp(a)),r=i.ref;break;case 7:if(e.stateNode===null){var o=new Jp(e);p(e.child,!1,dm,o,void 0,void 0),e.stateNode=o}r=e.stateNode;break;default:r=e.stateNode}typeof n==`function`?e.refCleanup=n(r):n.current=r}}catch(n){Tf(e,t,n)}}function Ll(e,t){var n=e.ref,r=e.refCleanup;if(n!==null){if(typeof r==`function`)try{r()}catch(n){Tf(e,t,n)}finally{e.refCleanup=null,e=e.alternate,e!=null&&(e.refCleanup=null)}else if(typeof n==`function`)try{n(null)}catch(n){Tf(e,t,n)}else n.current=null}}function Rl(e,t){if((e.tag===5||e.tag===27||e.tag===6)&&e.alternate===null&&t!==null)for(var n=0;n title`))),hp(r,t,n),r[Nt]=e,qt(r),t=r;break a;case`link`:if(o=ih(`link`,`href`,i).get(t+(n.href||``))){for(s=0;sg&&(o=g,g=h,h=o);var _=ii(s,h),v=ii(s,g);if(_&&v&&(p.rangeCount!==1||p.anchorNode!==_.node||p.anchorOffset!==_.offset||p.focusNode!==v.node||p.focusOffset!==v.offset)){var y=d.createRange();y.setStart(_.node,_.offset),p.removeAllRanges(),h>g?(p.addRange(y),p.extend(v.node,v.offset)):(y.setEnd(v.node,v.offset),p.addRange(y))}}}}for(d=[],p=s;p=p.parentNode;)p.nodeType===1&&d.push({element:p,left:p.scrollLeft,top:p.scrollTop});for(typeof s.focus==`function`&&s.focus(),s=0;sn?32:n,E.T=null,n=Fd,Fd=null;var o=jd,s=Nd;if(Ad=0,Md=jd=null,Nd=0,cd&6)throw Error(a(331));var c=cd;if(cd|=4,rd(o.current),Yu(o,o.current,s,n),cd=c,zf(0,!1),st&&typeof st.onPostCommitFiberRoot==`function`)try{st.onPostCommitFiberRoot(ot,o)}catch{}return!0}finally{we.p=i,E.T=r,xf(e,t)}}function wf(e,t,n){t=$i(n,t),t=zc(e.stateNode,t,2),e=ko(e,t,2),e!==null&&(Ct(e,2),Rf(e))}function Tf(e,t,n){if(e.tag===3)wf(e,e,n);else for(;t!==null;){if(t.tag===3){wf(t,e,n);break}if(t.tag===1){var r=t.stateNode;if(typeof t.type.getDerivedStateFromError==`function`||typeof r.componentDidCatch==`function`&&(kd===null||!kd.has(r))){e=$i(n,e),n=Bc(2),r=ko(t,n,2),r!==null&&(Vc(n,r,t,e),Ct(r,2),Rf(r));break}}t=t.return}}function Ef(e,t,n){var r=e.pingCache;if(r===null){r=e.pingCache=new sd;var i=new Set;r.set(t,i)}else i=r.get(t),i===void 0&&(i=new Set,r.set(t,i));i.has(n)||(md=!0,i.add(n),e=Df.bind(null,e,t,n),t.then(e,e))}function Df(e,t,n){var r=e.pingCache;r!==null&&r.delete(t),e.pingedLanes|=e.suspendedLanes&n,e.warmLanes&=~n,ld===e&&(z&n)===n&&(gd===4||gd===3&&(z&62914560)===z&&300>Ze()-Td?cd&2?yd|=n:Qd(e,0):yd|=n,xd===z&&(xd=0)),Rf(e)}function Of(e,t){t===0&&(t=xt()),e=D(e,t),e!==null&&(Ct(e,t),Rf(e))}function kf(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),Of(e,n)}function Af(e,t){var n=0;switch(e.tag){case 31:case 13:var r=e.stateNode,i=e.memoizedState;i!==null&&(n=i.retryLane);break;case 19:r=e.stateNode;break;case 22:r=e.stateNode._retryCache;break;default:throw Error(a(314))}r!==null&&r.delete(t),Of(e,n)}function jf(e,t){return qe(e,t)}var Mf=null,Nf=null,Pf=!1,Ff=!1,If=!1,Lf=0;function Rf(e){e!==Nf&&e.next===null&&(Nf===null?Mf=Nf=e:Nf=Nf.next=e),Ff=!0,Pf||(Pf=!0,Gf())}function zf(e,t){if(!If&&Ff){If=!0;do for(var n=!1,r=Mf;r!==null;){if(!t){if(e!==0){var i=r.pendingLanes;if(i===0)var a=0;else{var o=r.suspendedLanes,s=r.pingedLanes;a=(1<<31-lt(42|e)+1)-1,a&=i&~(o&~s),a=a&201326741?a&201326741|1:a?a|2:0}a!==0&&(n=!0,Wf(r,a))}else a=z,a=_t(r,r===ld?a:0,r.cancelPendingCommit!==null||r.timeoutHandle!==-1),!(a&3)||vt(r,a)||(n=!0,Wf(r,a))}r=r.next}while(n);If=!1}}function Bf(){Vf()}function Vf(){Ff=Pf=!1;var e=0;Lf!==0&&Op()&&(e=Lf);for(var t=Ze(),n=null,r=Mf;r!==null;){var i=r.next,a=Hf(r,t);a===0?(r.next=null,n===null?Mf=i:n.next=i,i===null&&(Nf=n)):(n=r,(e!==0||a&3)&&(Ff=!0)),r=i}Ad!==0&&Ad!==5||zf(e,!1),Lf!==0&&(Lf=0)}function Hf(e,t){for(var n=e.suspendedLanes,r=e.pingedLanes,i=e.expirationTimes,a=e.pendingLanes&-62914561;0s)break;var u=c.transferSize,d=c.initiatorType;u&&vp(d)&&(c=c.responseEnd,o+=u*(cfh){s.length=o;break}f=new Promise(Wp.bind(f)),s.push(f)}}}if(0`u`?null:document;function Rm(e,t,n){var r=Lm;if(r&&typeof t==`string`&&t){var i=hn(t);i=`link[rel="`+e+`"][href="`+i+`"]`,typeof n==`string`&&(i+=`[crossorigin="`+n+`"]`),Mm.has(i)||(Mm.add(i),e={rel:e,crossOrigin:n,href:t},r.querySelector(i)===null&&(t=r.createElement(`link`),hp(t,`link`,e),qt(t),r.head.appendChild(t)))}}function zm(e){Pm.D(e),Rm(`dns-prefetch`,e,null)}function Bm(e,t){Pm.C(e,t),Rm(`preconnect`,e,t)}function Vm(e,t,n){Pm.L(e,t,n);var r=Lm;if(r&&e&&t){var i=`link[rel="preload"][as="`+hn(t)+`"]`;t===`image`&&n&&n.imageSrcSet?(i+=`[imagesrcset="`+hn(n.imageSrcSet)+`"]`,typeof n.imageSizes==`string`&&(i+=`[imagesizes="`+hn(n.imageSizes)+`"]`)):i+=`[href="`+hn(e)+`"]`;var a=i;switch(t){case`style`:a=qm(e);break;case`script`:a=Zm(e)}if(!(jm.has(a)||(e=C({rel:`preload`,href:t===`image`&&n&&n.imageSrcSet?void 0:e,as:t},n),jm.set(a,e),r.querySelector(i)!==null||t===`style`&&r.querySelector(Jm(a))||t===`script`&&r.querySelector(Qm(a))))){var o=r.createElement(`link`);hp(o,`link`,e),t===`style`&&(o[Vt]=!0,o.onload=o.onerror=function(){Jt(o)}),qt(o),r.head.appendChild(o)}}}function Hm(e,t){Pm.m(e,t);var n=Lm;if(n&&e){var r=t&&typeof t.as==`string`?t.as:`script`,i=`link[rel="modulepreload"][as="`+hn(r)+`"][href="`+hn(e)+`"]`,a=i;switch(r){case`audioworklet`:case`paintworklet`:case`serviceworker`:case`sharedworker`:case`worker`:case`script`:a=Zm(e)}if(!jm.has(a)&&(e=C({rel:`modulepreload`,href:e},t),jm.set(a,e),n.querySelector(i)===null)){switch(r){case`audioworklet`:case`paintworklet`:case`serviceworker`:case`sharedworker`:case`worker`:case`script`:if(n.querySelector(Qm(a)))return}r=n.createElement(`link`),hp(r,`link`,e),qt(r),n.head.appendChild(r)}}}function Um(e,t,n){Pm.S(e,t,n);var r=Lm;if(r&&e){var i=Kt(r).hoistableStyles,a=qm(e);t||=`default`;var o=i.get(a);if(!o){var s={loading:0,preload:null};if(o=r.querySelector(Jm(a)))s.loading=5;else{e=C({rel:`stylesheet`,href:e,"data-precedence":t},n),(n=jm.get(a))&&th(e,n);var c=o=r.createElement(`link`);qt(c),hp(c,`link`,e),c._p=new Promise(function(e,t){c.onload=e,c.onerror=t}),c.addEventListener(`load`,function(){s.loading|=1}),c.addEventListener(`error`,function(){s.loading|=2}),s.loading|=4,eh(o,t,r)}o={type:`stylesheet`,instance:o,count:1,state:s},i.set(a,o)}}}function Wm(e,t){Pm.X(e,t);var n=Lm;if(n&&e){var r=Kt(n).hoistableScripts,i=Zm(e),a=r.get(i);a||(a=n.querySelector(Qm(i)),a||(e=C({src:e,async:!0},t),(t=jm.get(i))&&nh(e,t),a=n.createElement(`script`),qt(a),hp(a,`link`,e),n.head.appendChild(a)),a={type:`script`,instance:a,count:1,state:null},r.set(i,a))}}function Gm(e,t){Pm.M(e,t);var n=Lm;if(n&&e){var r=Kt(n).hoistableScripts,i=Zm(e),a=r.get(i);a||(a=n.querySelector(Qm(i)),a||(e=C({src:e,async:!0,type:`module`},t),(t=jm.get(i))&&nh(e,t),a=n.createElement(`script`),qt(a),hp(a,`link`,e),n.head.appendChild(a)),a={type:`script`,instance:a,count:1,state:null},r.set(i,a))}}function Km(e,t,n,r){var i=(i=Ne.current)?Nm(i):null;if(!i)throw Error(a(446));switch(e){case`meta`:case`title`:return null;case`style`:return typeof n.precedence==`string`&&typeof n.href==`string`?(n=qm(n.href),t=Kt(i).hoistableStyles,r=t.get(n),r||(r={type:`style`,instance:null,count:0,state:null},t.set(n,r)),r):{type:`void`,instance:null,count:0,state:null};case`link`:if(n.rel===`stylesheet`&&typeof n.href==`string`&&typeof n.precedence==`string`){e=qm(n.href);var o=Kt(i).hoistableStyles,s=o.get(e);if(s||(i=i.ownerDocument||i,s={type:`stylesheet`,instance:null,count:0,state:{loading:0,preload:null}},o.set(e,s),(o=i.querySelector(Jm(e)))?o._p||(s.instance=o,s.state.loading=5):(o=jm.get(e),o||(o={rel:`preload`,as:`style`,href:n.href,crossOrigin:n.crossOrigin,integrity:n.integrity,media:n.media,hrefLang:n.hrefLang,referrerPolicy:n.referrerPolicy},jm.set(e,o)),Xm(i,e,o,s.state))),t&&r===null)throw Error(a(528,``));return s}if(t&&r!==null)throw Error(a(529,``));return null;case`script`:return t=n.async,n=n.src,typeof n==`string`&&t&&typeof t!=`function`&&typeof t!=`symbol`?(n=Zm(n),t=Kt(i).hoistableScripts,r=t.get(n),r||(r={type:`script`,instance:null,count:0,state:null},t.set(n,r)),r):{type:`void`,instance:null,count:0,state:null};default:throw Error(a(444,e))}}function qm(e){return`href="`+hn(e)+`"`}function Jm(e){return`link[rel="stylesheet"][`+e+`]`}function Ym(e){return C({},e,{"data-precedence":e.precedence,precedence:null})}function Xm(e,t,n,r){if(t=e.querySelector(`link[rel="preload"][as="style"][`+t+`]`)){if(!0!==t[Vt]){r.loading=1;return}}else t=e.createElement(`link`),t[Vt]=!0,t.onload=t.onerror=Jt.bind(null,t),hp(t,`link`,n),qt(t),e.head.appendChild(t);r.preload=t,t.addEventListener(`load`,function(){return r.loading|=1}),t.addEventListener(`error`,function(){return r.loading|=2})}function Zm(e){return`[src="`+hn(e)+`"]`}function Qm(e){return`script[async]`+e}function $m(e,t,n){if(t.count++,t.instance===null)switch(t.type){case`style`:var r=e.querySelector(`style[data-href~="`+hn(n.href)+`"]`);if(r)return t.instance=r,qt(r),r;var i=C({},n,{"data-href":n.href,"data-precedence":n.precedence,href:null,precedence:null});return r=(e.ownerDocument||e).createElement(`style`),qt(r),hp(r,`style`,i),eh(r,n.precedence,e),t.instance=r;case`stylesheet`:i=qm(n.href);var o=e.querySelector(Jm(i));if(o)return t.state.loading|=4,t.instance=o,qt(o),o;r=Ym(n),(i=jm.get(i))&&th(r,i),o=(e.ownerDocument||e).createElement(`link`),qt(o);var s=o;return s._p=new Promise(function(e,t){s.onload=e,s.onerror=t}),hp(o,`link`,r),t.state.loading|=4,eh(o,n.precedence,e),t.instance=o;case`script`:return o=Zm(n.src),(i=e.querySelector(Qm(o)))?(t.instance=i,qt(i),i):(r=n,(i=jm.get(o))&&(r=C({},n),nh(r,i)),e=e.ownerDocument||e,i=e.createElement(`script`),qt(i),hp(i,`link`,r),e.head.appendChild(i),t.instance=i);case`void`:return null;default:throw Error(a(443,t.type))}else t.type===`stylesheet`&&!(t.state.loading&4)&&(r=t.instance,t.state.loading|=4,eh(r,n.precedence,e));return t.instance}function eh(e,t,n){for(var r=n.querySelectorAll(`link[rel="stylesheet"][data-precedence],style[data-precedence]`),i=r.length?r[r.length-1]:null,a=i,o=0;o title`):null)}function oh(e,t,n){if(n===1||t.itemProp!=null)return!1;switch(e){case`meta`:case`title`:return!0;case`style`:if(typeof t.precedence!=`string`||typeof t.href!=`string`||t.href===``)break;return!0;case`link`:if(typeof t.rel!=`string`||typeof t.href!=`string`||t.href===``||t.onLoad||t.onError)break;switch(t.rel){case`stylesheet`:return e=t.disabled,typeof t.precedence==`string`&&e==null;default:return!0}case`script`:if(t.async&&typeof t.async!=`function`&&typeof t.async!=`symbol`&&!t.onLoad&&!t.onError&&t.src&&typeof t.src==`string`)return!0}return!1}function sh(e,t){return e===`img`&&t.src!=null&&t.src!==``&&t.onLoad==null&&t.loading!==`lazy`}function ch(e){return!(e.type===`stylesheet`&&!(e.state.loading&3))}function lh(e){return(e.width||100)*(e.height||100)*(typeof devicePixelRatio==`number`?devicePixelRatio:1)*.25}function uh(e,t){typeof t.decode==`function`&&(e.imgCount++,t.complete||(e.imgBytes+=lh(t),e.suspenseyImages.push(t)),e=gh.bind(e),t.decode().then(e,e))}function dh(e,t,n,r){if(n.type===`stylesheet`&&(typeof r.media!=`string`||!1!==matchMedia(r.media).matches)&&!(n.state.loading&4)){if(n.instance===null){var i=qm(r.href),a=t.querySelector(Jm(i));if(a){t=a._p,typeof t==`object`&&t&&typeof t.then==`function`&&(e.count++,e=hh.bind(e),t.then(e,e)),n.state.loading|=4,n.instance=a,qt(a);return}a=t.ownerDocument||t,r=Ym(r),(i=jm.get(i))&&th(r,i),a=a.createElement(`link`),qt(a);var o=a;o._p=new Promise(function(e,t){o.onload=e,o.onerror=t}),hp(a,`link`,r),n.instance=a}e.stylesheets===null&&(e.stylesheets=new Map),e.stylesheets.set(n,t),(t=n.state.preload)&&!(n.state.loading&3)&&(e.count++,n=hh.bind(e),t.addEventListener(`load`,n),t.addEventListener(`error`,n))}}var fh=0;function ph(e,t){return e.stylesheets&&e.count===0&&vh(e,e.stylesheets),0fh?50:800)+t);return e.unsuspend=n,function(){e.unsuspend=null,clearTimeout(r),clearTimeout(i)}}:null}function mh(e){if(e.count===0&&(e.imgCount===0||!e.waitingForImages)){if(e.stylesheets)vh(e,e.stylesheets);else if(e.unsuspend){var t=e.unsuspend;e.unsuspend=null,t()}}}function hh(){this.count--,mh(this)}function gh(){this.imgCount--,mh(this)}var _h=null;function vh(e,t){e.stylesheets=null,e.unsuspend!==null&&(e.count++,_h=new Map,t.forEach(yh,e),_h=null,hh.call(e))}function yh(e,t){if(!(t.state.loading&4)){var n=_h.get(e);if(n)var r=n.get(null);else{n=new Map,_h.set(e,n);for(var i=e.querySelectorAll(`link[data-precedence],style[data-precedence]`),a=0;a{function n(){if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<`u`&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE==`function`)try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(n)}catch(e){console.error(e)}}n(),t.exports=Cn()}));function Tn(e){return e?.isNotFound===!0}function En(){try{return sessionStorage}catch{return}}var Dn=`tsr-scroll-restoration-v1_3`,On=En();function kn(){try{return JSON.parse(On?.getItem(`tsr-scroll-restoration-v1_3`)||`{}`)}catch{return{}}}var An=kn(),jn=`data-scroll-restoration-id`,Mn=e=>e.state.__TSR_key||e.href;function Nn(e){let t=e.getAttribute(jn);if(t)return`[${jn}="${t}"]`;let n=``,r=e,i;for(;i=r.parentNode;){let e=1,t=r;for(;t=t.previousElementSibling;)e++;let a=`${r.localName}:nth-child(${e})`;n=n?`${a} > ${n}`:a,r=i}return n}var Pn=!1,Fn=`window`;function In(e){try{return typeof e==`function`?e():document.querySelector(e)}catch{}}function Ln(e){let t=new Set;for(let n of e){if(n===Fn)continue;let e=In(n);e&&t.add(e)}return t}function Rn(e,t){let n=t??e.options.scrollRestoration,r=e._scroll;n&&(r.e=!0);let i=e.options.getScrollRestorationKey||Mn,a=new Set,o=e=>{let t=An[e]||={};for(let e of a)e===document?t[Fn]={scrollX,scrollY}:e.isConnected&&(t[Nn(e)]={scrollX:e.scrollLeft,scrollY:e.scrollTop})};n&&!r.s&&(r.s=!0,Pn=!1,history.scrollRestoration=`manual`,document.addEventListener(`scroll`,e=>{Pn||a.add(e.target)},!0),e.subscribe(`onBeforeLoad`,e=>{e.fromLocation&&o(i(e.fromLocation)),a.clear()}),addEventListener(`pagehide`,()=>{history.scrollRestoration=`auto`,o(i(e.stores.resolvedLocation.get()??e.stores.location.get()));try{On?.setItem(Dn,JSON.stringify(An))}catch{}}),addEventListener(`pageshow`,e=>{e.persisted&&(history.scrollRestoration=`manual`)})),!r.r&&(r.r=!0,e.subscribe(`onRendered`,t=>{let n=e.options.scrollRestorationBehavior,o=e.options.scrollToTopSelectors,s=r.n,c=r.h,l;if(a.clear(),r.n=!0,r.h=!1,typeof e.options.scrollRestoration==`function`&&!e.options.scrollRestoration({location:e.latestLocation}))return;let u=i(t.toLocation),d=t.fromLocation&&i(t.fromLocation);if(r.e&&d&&d!==u){let e=An[d];if(e){let t=An[u];for(let n in e){if(n===Fn){if(s)continue}else{let e=In(n);if(!e||s&&o&&(l??=Ln(o),l.has(e)))continue}t||=An[u]={},t[n]??=e[n]}}}Pn=!0;try{let e=t.toLocation.hash,i=t.toLocation.state.__hashScrollIntoViewOptions??!0,a=!1;if(s){!e&&o&&(l??=Ln(o));let t=e&&i&&c,s=r.e?An[u]:void 0;if(s)for(let e in s){let{scrollX:r,scrollY:i}=s[e];if(e===Fn){if(t)continue;scrollTo({top:i,left:r,behavior:n}),a=!0}else{let t=In(e);t&&(t.scrollLeft=r,t.scrollTop=i,l?.delete(t))}}if(!e){let e={top:0,left:0,behavior:n};if(a||scrollTo(e),l)for(let t of l)t.scrollTo(e)}}!a&&e&&i&&document.getElementById(e)?.scrollIntoView(i)}finally{Pn=!1}}))}function zn(e,t=String){let n;for(let r in e){let i=e[r];i!==void 0&&(n||=new URLSearchParams).set(r,t(i))}return n?n.toString():``}function Bn(e){return e?e===`false`?!1:e===`true`?!0:e*0==0&&+e+``===e?+e:e:``}function Vn(e){let t=new URLSearchParams(e),n=Object.create(null);for(let[e,r]of t.entries()){let t=n[e];t==null?n[e]=Bn(r):Array.isArray(t)?t.push(Bn(r)):n[e]=[t,Bn(r)]}return n}var Hn=/^(?:\s|["[{\d-]|fa|nu|tr)/,Un=Gn(JSON.parse),Wn=Kn(JSON.stringify,JSON.parse);function Gn(e){let t=e===JSON.parse;return n=>{n[0]===`?`&&(n=n.substring(1));let r=Vn(n);for(let n in r){let i=r[n];if(typeof i==`string`){if(t&&!Hn.test(i))continue;try{r[n]=e(i)}catch{}}}return r}}function Kn(e,t){let n=t===JSON.parse;function r(r){if(r&&typeof r==`object`)try{return e(r)}catch{}else if(t&&typeof r==`string`){if(n&&!Hn.test(r))return r;try{return t(r),e(r)}catch{}}return r}return e=>{let t=zn(e,r);return t?`?${t}`:``}}function qn(e){let t=new Map,n,r;return{get(e){let n=t.get(e);if(n)return n.visited=!0,n.value},set(i,a){let o=t.get(i);if(o){o.value=a;return}if(t.size>=e){let e=n?.next().value;for(;!e||e.visited;)e?e.visited=!1:n=t.values(),e=n.next().value;e===r&&(n=void 0),t.delete(e.key)}let s={key:i,value:a,visited:!1};r=s,t.set(i,s)},clear(){t.clear(),n=void 0,r=void 0}}}var Jn=4,Yn=5;function Xn(e){let t=e.names;if(t)return t;let n=[];for(let t of e)typeof t!=`string`&&n.push(t[1]);return e.names=n}function Zn(e,t,n){let r=e.substring(t,n);if(r.charCodeAt(0)===36)return r.length===1?[2,`_splat`,``,void 0]:[1,r.substring(1),``,``];let i=r.indexOf(`{`);if(i>=0){let a=r.indexOf(`}`,i),o=r.charCodeAt(i+1)===45,s=i+(o?3:2);if(a>=0&&r.charCodeAt(s-1)===36&&(!o||s!e.parse&&e.caseSensitive===_&&e.prefix===h&&e.suffix===g);if(y)c=y;else{let e=er(r,t,_,h,g);c=e,v.push(e),v.length===2&&i?.push(v)}}r=c}p&&m=0;e--){let n=i.wildcard[e],{prefix:r,suffix:a}=n;if(!r||!_&&(n.caseSensitive?v:y??=v.toLowerCase()).startsWith(r)){if(a){if(_)continue;let e=t.slice(u).join(`/`),i=e.slice(-a.length);if((n.caseSensitive?i:i.toLowerCase())!==a||e.length-a.length=0;t--){let n=i.optional[t];s.push({node:n,index:u,skipped:e,statics:f,dynamics:p,optionals:m,extract:h,rawParams:g})}if(!_)for(let e=i.optional.length-1;e>=0;e--){let t=i.optional[e],{prefix:n,suffix:r}=t;if(n||r){let e=t.caseSensitive?v:y??=v.toLowerCase();if(n&&!e.startsWith(n)||r&&e.indexOf(r,e.length-r.length)=0;e--){let t=i.dynamic[e],{prefix:n,suffix:r}=t;if(n||r){let e=t.caseSensitive?v:y??=v.toLowerCase();if(n&&!e.startsWith(n)||r&&e.indexOf(r,e.length-r.length)=0;e--){let t=i.pathless[e];s.push({node:t,index:u,skipped:d,statics:f,dynamics:p,optionals:m,extract:h,rawParams:g})}}if(l)return l;if(r&&c){let n=c.index;for(let e=0;ee.statics||t.statics===e.statics&&(t.dynamics>e.dynamics||t.dynamics===e.dynamics&&(t.optionals>e.optionals||t.optionals===e.optionals&&((t.node.kind===Jn)>(e.node.kind===Jn)||t.node.kind===Jn==(e.node.kind===Jn)&&t.node.depth>e.node.depth)))}function hr(e,t,n){let r=Oe(e),i=`/${r}`,a=t?i:i.toLowerCase(),o=`${a}/`,s={input:({url:e})=>{let n=t?e.pathname:e.pathname.toLowerCase();return n===a?e.pathname=`/`:n.startsWith(o)&&(e.pathname=e.pathname.slice(i.length)),e},output:({url:e})=>(e.pathname=nt(`/${r}${e.pathname}`),e)};return n?{input:({url:e})=>gr(n,s.input({url:e})),output:({url:e})=>s.output({url:_r(n,e)})}:s}function gr(e,t){let n=e?.input?.({url:t});if(n){if(typeof n==`string`)return new URL(n);if(n instanceof URL)return n}return t}function _r(e,t){let n=e?.output?.({url:t});if(n){if(typeof n==`string`)return new URL(n);if(n instanceof URL)return n}return t}function vr(e,t){let{createMutableStore:n,createReadonlyStore:r,batch:i}=t,a=new Map,o=n(`idle`),s=n(e),c=n(void 0),l=n([]),u=r(()=>l.get().map(e=>a.get(e).get())),d=r(()=>({status:o.get(),isLoading:o.get()===`pending`,matches:u.get(),location:s.get(),resolvedLocation:c.get()}));function f(e){let t=a.get(e);return t||(t=n(void 0),a.set(e,t)),t}let p={status:o,location:s,resolvedLocation:c,ids:l,matches:u,byRoute:a,__store:d,getMatchStore:f,setMatches:m};function m(e){let t=l.get(),n=e.map(e=>e.routeId);i(()=>{ke(t,n)||l.set(n);for(let e of t)n.includes(e)||a.get(e).set(()=>void 0);for(let t of e){let e=f(t.routeId);e.get()!==t&&e.set(t)}})}return p}var yr=`__TSR_index`,br=`popstate`,xr=`beforeunload`,Sr=/^[\x00-\x20]*(?:[\\/][\t\n\r]*){2,}/;function Cr(e){let t=Sr.exec(e);return t?`/`+e.slice(t[0].length):e}function wr(e){return/[\x00-\x1f\x7f]/.test(e)&&(e=e.replace(/[\x00-\x1f\x7f]/g,e=>` -\r`.includes(e)?``:encodeURIComponent(e))),Cr(e)}function Tr(e){let t=e.getLocation(),n=new Set,r=r=>{t=e.getLocation(),n.forEach(e=>e({location:t,action:r}))},i=n=>{e.notifyOnIndexChange??!0?r(n):t=e.getLocation()},a=async({task:n,navigateOpts:r,...i})=>{if(r?.ignoreBlocker??!1){n();return}let a=e.getBlockers?.()??[],o=i.type===`PUSH`||i.type===`REPLACE`;if(typeof document<`u`&&a.length&&o)for(let n of a){let r=Or(i.path,i.state);if(await n.blockerFn({currentLocation:t,nextLocation:r,action:i.type})){e.onBlocked?.();return}}n()};return{get location(){return t},get length(){return e.getLength()},subscribers:n,subscribe:e=>(n.add(e),()=>{n.delete(e)}),push:(n,i,o)=>{let s=t.state[yr];i=Er(s+1,i),a({task:()=>{e.pushState(n,i),r({type:`PUSH`})},navigateOpts:o,type:`PUSH`,path:n,state:i})},replace:(n,i,o)=>{let s=t.state[yr];i=Er(s,i),a({task:()=>{e.replaceState(n,i),r({type:`REPLACE`})},navigateOpts:o,type:`REPLACE`,path:n,state:i})},go:(t,n)=>{a({task:()=>{e.go(t,n?.ignoreBlocker??!1),i({type:`GO`,index:t})},navigateOpts:n,type:`GO`})},back:t=>{a({task:()=>{e.back(t?.ignoreBlocker??!1),i({type:`BACK`})},navigateOpts:t,type:`BACK`})},forward:t=>{a({task:()=>{e.forward(t?.ignoreBlocker??!1),i({type:`FORWARD`})},navigateOpts:t,type:`FORWARD`})},canGoBack:()=>t.state[yr]!==0,createHref:t=>e.createHref(t),block:t=>{if(!e.setBlockers)return()=>{};let n=e.getBlockers?.()??[];return e.setBlockers([...n,t]),()=>{let n=e.getBlockers?.()??[];e.setBlockers?.(n.filter(e=>e!==t))}},flush:()=>e.flush?.(),destroy:()=>e.destroy?.(),notify:r,_getBlockers:()=>e.getBlockers?.()??[]}}function Er(e,t){let n=kr();return{...t,key:n,__TSR_key:n,[yr]:e}}function Dr(e){let t=e?.window??(typeof document<`u`?window:void 0),n=t.history.pushState,r=t.history.replaceState,i=[],a=()=>i,o=e=>i=e,s=t=>wr(e?.createHref?e.createHref(t):t),c=e?.parseLocation??(()=>Or(`${t.location.pathname}${t.location.search}${t.location.hash}`,t.history.state));if(!t.history.state?.__TSR_key&&!t.history.state?.key){let e=kr();t.history.replaceState({[yr]:0,key:e,__TSR_key:e},``)}let l=c(),u,d=!1,f=!1,p=!1,m=!1,h=()=>l,g,_=()=>{g&&(x._ignoreSubscribers=!0,(g[2]?t.history.pushState:t.history.replaceState)(g[1],``,g[0]),x._ignoreSubscribers=!1,g=void 0,u=void 0)},v=(t,n,r)=>{let i=e?.createHref?s(n):void 0,a=!!g;a||(u=l),l=Or(n,r),g=[i??l.href,r,g?.[2]||t],a||queueMicrotask(()=>_())},y=e=>{l=c(),x.notify({type:e})},b=async()=>{if(m=!1,f){f=!1;return}let e=c(),n=e.state[yr]-l.state[yr],r=n===1,i=n===-1,o=!r&&!i||d;d=!1;let s=o?`GO`:i?`BACK`:`FORWARD`,u=o?{type:`GO`,index:n}:{type:i?`BACK`:`FORWARD`};if(p)p=!1;else{let r=a();if(typeof document<`u`&&r.length){for(let i of r)if(await i.blockerFn({currentLocation:l,nextLocation:e,action:s})){f=!0,t.history.go(-n),x.notify(u);return}}}l=c(),x.notify(u)},ee=e=>{if(m){m=!1;return}let t=!1,n=a();if(typeof document<`u`&&n.length)for(let e of n){let n=e.enableBeforeUnload??!0;if(n===!0){t=!0;break}if(typeof n==`function`&&n()===!0){t=!0;break}}if(t)return e.preventDefault(),e.returnValue=``},x=Tr({getLocation:h,getLength:()=>t.history.length,pushState:(e,t)=>v(!0,e,t),replaceState:(e,t)=>v(!1,e,t),back:e=>(e&&(p=!0,m=!0),t.history.back()),forward:e=>{e&&(p=!0,m=!0),t.history.forward()},go:(e,n)=>{d=!0,n&&(p=!0,m=!0),t.history.go(e)},createHref:e=>s(e),flush:_,destroy:()=>{t.history.pushState=n,t.history.replaceState=r,t.removeEventListener(xr,ee,{capture:!0}),t.removeEventListener(br,b)},onBlocked:()=>{u&&l!==u&&(l=u)},getBlockers:a,setBlockers:o,notifyOnIndexChange:!1});return x._ignoreNextBeforeUnload=e=>{m=!1;try{e=new URL(e,t.document.baseURI).href,m=/^https?:/.test(e)&&(!e.includes(`#`)||e.split(`#`)[0]!==t.location.href.split(`#`)[0])}catch{}},t.addEventListener(xr,ee,{capture:!0}),t.addEventListener(br,b),t.history.pushState=function(...e){let r=n.apply(t.history,e);return x._ignoreSubscribers||y(`PUSH`),r},t.history.replaceState=function(...e){let n=r.apply(t.history,e);return x._ignoreSubscribers||y(`REPLACE`),n},x}function Or(e,t){let n=wr(e),r=n.indexOf(`#`),i=n.indexOf(`?`);if(!t){let e=kr();t={[yr]:0,key:e,__TSR_key:e}}return{href:n,pathname:n.substring(0,r>0?i>0?Math.min(r,i):r:i>0?i:n.length),hash:r>-1?n.substring(r):``,search:i>-1?n.slice(i,r===-1?void 0:r):``,state:t}}function kr(){return(Math.random()+1).toString(36).substring(7)}function Ar(e,t){return e.protocol!==`http:`&&e.protocol!==`https:`||e.origin!==t||!!e.username||!!e.password}function jr(e){return e.pathname+e.search+e.hash}function Mr(e){return e.options.loader||e.options.beforeLoad||e.lazyFn||e.options.component?.preload||e.options.pendingComponent?.preload}function Nr(e,t){return{fromLocation:t,toLocation:e,pathChanged:t?.pathname!==e.pathname,hrefChanged:t?.href!==e.href,hashChanged:t?.hash!==e.hash}}function Pr({key:e,__TSR_key:t,__TSR_index:n,__hashScrollIntoViewOptions:r,...i}){return i}function Fr(e){return e.findIndex(e=>e.status===`error`||e.status===`notFound`||e._notFound)+1}function Ir(e,t,n,r,i,a){r&&(t=t.slice(0,r)),i&&(n=n.slice(0,i));for(let r of t){if(a&&e._tx!==a)return;n.some(e=>e.routeId===r.routeId)||e.routesById[r.routeId].options.onLeave?.(r)}for(let r of n){if(a&&e._tx!==a)return;e.routesById[r.routeId].options[t.some(e=>e.routeId===r.routeId)?`onStay`:`onEnter`]?.(r)}}var Lr=class{constructor(e,t){this.tempLocationKey=`${Math.round(Math.random()*1e7)}`,this._scroll={n:!0},this.subscribers=new Set,this._cache=new Map,this._committed=[],this.startTransition=async e=>(e(),!1),this.update=e=>{let t=this.options;this.options={...t,...e},this.isServer=this.options.isServer??!1??typeof document>`u`,this.staticLocations=new WeakMap,this.protocolAllowlist=new Set(this.options.protocolAllowlist),(!this.history||this.options.history&&this.options.history!==this.history)&&(this.history=this.options.history?this.options.history:Dr()),this.origin=this.options.origin,this.origin||=window?.origin&&window.origin!==`null`?window.origin:`http://localhost`;let n=this.options.basepath??`/`,r=this.options.rewrite,i=this.basepath!==n||t?.rewrite!==r||t?.caseSensitive!==this.options.caseSensitive;if(i&&(this.basepath=n,this.rewrite=n!==`/`&&Oe(n)?hr(n,this.options.caseSensitive,r):r),this.history&&this.updateLatestLocation(),this.options.routeTree!==this.routeTree){this.routeTree=this.options.routeTree;let e;e=this.buildRouteTree(),this.setRoutes(e)}if(this.stores)i&&this.stores.location.set(this.latestLocation);else if(this.latestLocation){let e=this.getStoreConfig(this);this.batch=e.batch,this.stores=vr(this.latestLocation,e),Rn(this)}},this.updateLatestLocation=()=>{this.latestLocation=this.parseLocation(this.history.location,this.latestLocation)},this.buildRouteTree=()=>{let e=ar(this.routeTree,this.options.caseSensitive);return this.options.routeMasks&&tr(this.options.routeMasks,e.processedTree),{...e,resolvePathCache:qn(1e3)}},this.subscribe=(e,t)=>{let n={eventType:e,fn:t};return this.subscribers.add(n),()=>{this.subscribers.delete(n)}},this.emit=e=>{for(let t of this.subscribers)if(t.eventType===e.type)try{t.fn(e)}catch(e){console.error(e)}},this.parseLocation=(e,t)=>{let n=({pathname:e,search:n,hash:r,href:i},a)=>{if(!this.rewrite&&!/[ \x00-\x1f\x7f\u0080-\uffff]/.test(e)){let i=this.options.parseSearch(n),o=this.options.stringifySearch(i);return{href:e+o+r,publicHref:e+o+r,pathname:qe(e),external:!1,searchStr:o,search:rt(t?.search,i),hash:qe(r.slice(1)),state:Be(t?.state,a)}}let o=gr(this.rewrite,new URL(i,this.origin)),s=this.options.parseSearch(o.search),c=this.options.stringifySearch(s);return o.search=c,{href:o.href.replace(o.origin,``),publicHref:i,pathname:qe(Cr(o.pathname)),external:!!this.rewrite&&Ar(o,this.origin),searchStr:c,search:rt(t?.search,s),hash:qe(o.hash.slice(1)),state:Be(t?.state,a)}},r=n(e,e.state),{__tempLocation:i,__tempKey:a}=r.state;if(i&&(!a||a===this.tempLocationKey)){let e=n(i,{...i.state,__tempLocation:void 0,key:r.state.key,__TSR_key:r.state.__TSR_key});return e.maskedLocation=r,e}return r},this.matchRoutes=(e,t,n)=>typeof e==`string`?this.matchRoutesInternal({pathname:e,search:t},n):this.matchRoutesInternal(e,t),this.getMatchedRoutes=e=>{let t=Object.create(null),n=ir(ze(e),this.processedTree,!0);return n&&Object.assign(t,n.rawParams),[n?.branch||[this.routesById.__root__],t,n?.route]},this.buildLocation=e=>{{let t=this.staticLocations.get(e);if(t)return t}let t=!1,n=(n={})=>{if(n.href){let e=Or(n.href,{});n={...n,to:gr(this.rewrite,new URL(e.pathname,this.origin)).pathname,search:this.options.parseSearch(e.search),hash:e.hash.slice(1)}}let r=n._fromLocation||this._pendingLocation||this.latestLocation,i,a=()=>(t=!0,r),o=()=>(t=!0,i??=this.matchRoutesLightweight(r)),s=n.to?`${n.to}`:`.`,c=Re(s[0]===`/`?``:n.unsafeRelative===`path`?a().pathname:n.from??o()[1],s,this.options.trailingSlash,this.resolvePathCache),l=this.routesByPath[ze(c)],u=c.includes(`$`),d;if(l)d=l._branch??=cr(l);else if(u)d=[];else{let[e,t,n]=this.getMatchedRoutes(c);d=e,this.options.notFoundRoute&&(!n||n.path!==`/`&&t[`**`])&&(d=[...d,this.options.notFoundRoute])}let f=u?l?._interpolation??Qn(!1,{fullPath:c},0):void 0,p;for(let e of d){let t=e.options.params?.stringify??e.options.stringifyParams;if(t){let e=o()[3];if(p??=Hr(n.params,e),!Ie(p))break;p===e&&(p=Object.assign(Fe(),p));try{Object.assign(p,t(p))}catch{}}}p??=Hr(n.params,Ur(n.params,f)?o()[3]:Wr);let m=e.leaveParams?c:Cr(qe(f?tt(c,f,p,this.pathParamsDecoder):c)),h=Gr(d,e._includeValidateSearch),g=()=>{let t=o()[2];if(e._includeValidateSearch&&this.options.search?.strict){let e={};d.forEach(n=>{if(n.options.validateSearch)try{Object.assign(e,Vr(n.options.validateSearch,{...e,...t}))}catch{}}),t=e}return t},_=h.length?Kr(h,g(),n):n.search===!0?g():typeof n.search==`function`?n.search(g()):n.search||Wr,v=this.options.stringifySearch(_),y=n.hash===!0?a().hash:typeof n.hash==`function`?n.hash(a().hash):n.hash||void 0,b=y?`#${y}`:``,ee=n.state?n.state===!0?a().state:typeof n.state==`function`?n.state(a().state):n.state:Wr,x=`${m}${v}${b}`,S,te,C=!1;if(this.rewrite){let e=new URL(x,this.origin),t=e.origin,n=_r(this.rewrite,e);S=jr(e),Ar(n,t)?(te=n.href,C=!0):te=Cr(jr(n))}else S=Ke(x),te=S;return{publicHref:te,href:S,pathname:m,search:_,searchStr:v,state:ee,hash:y??``,external:C,unmaskOnReload:n.unmaskOnReload}},r=n(e);if(e.mask)r.maskedLocation=n({from:e.from,...e.mask});else if(this.options.routeMasks){let t=nr(r.pathname,this.processedTree);if(t){let i=Object.assign(Fe(),t.rawParams),{from:a,params:o,...s}=t.route,c=Hr(o,i);r.maskedLocation=n({from:e.from,...s,params:c})}}return!t&&e._fromLocation&&!r.maskedLocation&&this.staticLocations.set(e,r),r},this.commitLocation=async({viewTransition:e,ignoreBlocker:t,...n})=>{let r=n.maskedLocation??n;if(r.external)return Rr(this,r.publicHref,{replace:n.replace,ignoreBlocker:t});let i,a=ze(this.latestLocation.href)===ze(n.href)&&Ee(Pr(n.state),Pr(this.latestLocation.state)),o=this._commitPromise,s,c=new Promise(e=>{s=e});if(c.resolve=()=>{s(),o?.resolve()},this._commitPromise=c,a)this.load();else{let{maskedLocation:r,hashScrollIntoView:a,...o}=n;r&&(o={...r,state:{...r.state,__tempKey:void 0,__tempLocation:{...o,search:o.searchStr,state:{...o.state,__tempKey:void 0,__tempLocation:void 0,__TSR_key:void 0,key:void 0}}}},(o.unmaskOnReload??this.options.unmaskOnReload??!1)&&(o.state.__tempKey=this.tempLocationKey)),o.state={...o.state,__hashScrollIntoViewOptions:a??this.options.defaultHashScrollIntoView??!0},this.shouldViewTransition=e,i=n.replace?`REPLACE`:`PUSH`,this.history[i===`REPLACE`?`replace`:`push`](o.publicHref,o.state,{ignoreBlocker:t}),this.history.subscribers.size||this.load({action:{type:i}})}return this._scroll.n=n.resetScroll??!0,this._commitPromise},this.buildAndCommitLocation=({replace:e,resetScroll:t,hashScrollIntoView:n,viewTransition:r,ignoreBlocker:i,...a}={})=>{let o=this.buildLocation({...a,_includeValidateSearch:!0});this._pendingLocation=o;let s=this.commitLocation({...o,viewTransition:r,replace:e,resetScroll:t,hashScrollIntoView:n,ignoreBlocker:i});return queueMicrotask(()=>{this._pendingLocation===o&&(this._pendingLocation=void 0)}),s},this.navigate=async({to:e,reloadDocument:t,href:n,publicHref:r,...i})=>{let a=n?Pe(n):void 0;if(a||t){if(e!==void 0||!n){let t=this.buildLocation({to:e,...i}),a=t.maskedLocation??t;n??=a.publicHref,r??=a.publicHref}let t=!a&&r?r:n;return Rr(this,t,i)}return this.buildAndCommitLocation({...i,href:n,to:e,_isNavigate:!0})},this.load=async e=>{this.updateLatestLocation(),e?.action&&(this._scroll.h=e.action.type===`PUSH`||e.action.type===`REPLACE`),await Ri(this,e)},this.startViewTransition=e=>{let t=this.shouldViewTransition??this.options.defaultViewTransition;if(this.shouldViewTransition=void 0,t&&typeof document.startViewTransition==`function`){let n;if(typeof t==`object`&&window.CSS?.supports?.(`selector(:active-view-transition-type(a))`)){let r=this.latestLocation,i=this.stores.resolvedLocation.get(),a=typeof t.types==`function`?t.types(Nr(r,i)):t.types;if(a===!1)return e();n={update:e,types:a}}else n=e;return document.startViewTransition(n).updateCallbackDone}return e()},this.invalidate=e=>{let t=this._committed,n=e?.filter,r=this._preloads,i=new Set,a=e=>{(!n||n(e))&&i.add(e.id)};t.forEach(a),this._cache.forEach(a),r?.forEach(e=>e.forEach(a)),this._tx?.[3].forEach(a);let o=[];for(let[e,t]of r??[])t.some(e=>i.has(e.id))&&(r.delete(e),o.push(e));let s=t=>{if(i.has(t.id)){let n=this.routesById[t.routeId],r={...t,invalid:!0,...(e?.forcePending||t.status===`error`||t.status===`notFound`)&&Mr(n)?{status:`pending`,error:void 0}:void 0};return t._flight=void 0,r}return t};this._committed=t.map(s);for(let[t,n]of this._cache)i.has(t)&&(n.invalid=!0,e?.forcePending&&(n.status=`pending`));for(let e of i){let t=this._flights?.get(e);this._flights?.delete(e),t&&!t[2]&&o.push(t[1])}for(let e of o)e.abort();return this.shouldViewTransition=!1,this.load({sync:e?.sync})},this.resolveRedirect=e=>{let t=e.options,n=e.headers.get(`Location`)||t.href;if(!n){let e=this.buildLocation(t);n=(e.maskedLocation??e).publicHref||`/`}let r;if(De.test(n)||(r=Pe(n))&&!this.protocolAllowlist.has(r))throw Error(`Redirect blocked: unsafe protocol`);if(r===`http:`||r===`https:`){let e=new URL(n);e.pathname.startsWith(`//`)?n=e.href:Ar(e,this.origin)||(n=jr(e),r=void 0)}return r&&(t.reloadDocument=!0),t.href=n,e.headers.set(`Location`,n),e},this.clearCache=e=>{let t=this._cache,n=this._preloads,r=e?.filter,i=[],a=[];for(let[e,n]of t)(!r||r(n))&&(a.push(e),i.push(n));let o=[];for(let[e,t]of n??[])(!r||t.some(r))&&(o.push(e),i.push(...t));for(let e of a)t.delete(e);for(let e of o)n.delete(e);for(let e of i){let t=e._flight;e._flight=void 0,t&&!--t[2]&&(this._flights?.get(e.id)===t&&this._flights.delete(e.id),o.push(t[1]))}for(let e of o)e.abort()},this.loadRouteChunk=Zr,this.preloadRoute=e=>zi(this,e),this.matchRoute=(e,t)=>{let n={...e,to:e.to?Re(e.from||``,e.to,this.options.trailingSlash,this.resolvePathCache):void 0,params:e.params||{},leaveParams:!0},r=this.buildLocation(n),i=this.stores.status.get()===`pending`;if(t?.pending&&!i)return!1;let a=t?.pending??!i?this.latestLocation:this.stores.resolvedLocation.get()||this.stores.location.get(),o=rr(r.pathname,t?.caseSensitive??!1,t?.fuzzy??!1,a.pathname,this.processedTree);return!o||e.params&&!Ee(o.rawParams,e.params,!0)?!1:t?.includeSearch??!0?Ee(a.search,r.search,!0)?o.rawParams:!1:o.rawParams},this.getStoreConfig=t,e.pathParamsAllowedCharacters?.length&&(this.pathParamsDecoder=Ue(e.pathParamsAllowedCharacters)),this.update({defaultPreloadDelay:50,defaultPendingMs:1e3,defaultPendingMinMs:500,context:void 0,...e,caseSensitive:e.caseSensitive??!1,notFoundMode:e.notFoundMode??`fuzzy`,stringifySearch:e.stringifySearch??Wn,parseSearch:e.parseSearch??Un,protocolAllowlist:e.protocolAllowlist??Ae}),self.__TSR_ROUTER__=this}isShell(){return!!this.options.isShell}get state(){return this.stores.__store.get()}setRoutes(e){Object.assign(this,e),this.lightweightCache=new WeakMap,this.staticLocations=new WeakMap;let t=this.options.notFoundRoute;t&&(t.init(99999999999),this.routesById[t.id]!==t&&(t._interpolation=Qn(!1,t,0)),this.routesById[t.id]=t)}matchRoutesInternal(e,t){let[n,r,i]=this.getMatchedRoutes(e.pathname),a=n,o=!1;(i?i.path!==`/`&&r[`**`]:ze(e.pathname))&&(this.options.notFoundRoute?a=[...a,this.options.notFoundRoute]:o=!0);let s=o?qr(this.options.notFoundMode,a):void 0,c=Array(a.length),l=this._committed,u=(e,t)=>{let n=l[t];return n?.routeId===e.id?n:e===this.options.notFoundRoute?l.find(t=>t.routeId===e.id):void 0},d;for(let n=0;ntypeof t!=`string`&&!je.call(e,t[1]))}var Wr=Object.freeze({});function Gr(e,t){let n=[];for(let r=0;r{let n=t(i.preSearchFilters?i.preSearchFilters.reduce((e,t)=>t(e),e):e);return i.postSearchFilters?i.postSearchFilters.reduce((e,t)=>t(e),n):n});let a=i.validateSearch;t&&a&&n.push(({search:e,next:t,meta:n})=>{let r=t(e);try{let e=Vr(a,r);if(n&&e)for(let t in e)t in r||(n.defaulted||=new Map).set(t,e[t]);return{...r,...e}}catch{}return r})}return n}function Kr(e,t,n){let r=(t,i,a)=>{if(t>=e.length){if(!n.search)return{};if(n.search===!0)return i;let e=Ne(n.search,i);return a&&(a.explicit=e),e}return e[t]({search:i,next:(e,n)=>{if(n){let n=a||{};return{search:r(t+1,e,n),meta:n}}return r(t+1,e,a)},meta:a})};return r(0,t)}function qr(e,t){if(e!==`root`){let e;for(let n=t.length-1;n>=0;n--){let r=t[n];if(r.options.notFoundComponent)return r.id;e||=r.children&&r.id}if(e)return e}return Nt}function Jr(e,t){let n=e.options.params?.parse??e.options.parseParams;n&&Object.assign(t,n(t))}function Yr(e,t){return e.options[t]?.preload?.()}function Xr(e,t){let n=Yr(e,`component`),r=Yr(e,`pendingComponent`);return t&&(r?r=r.then(t):t()),n&&r?Promise.all([n,r]).then(()=>{}):n??r}function Zr(e,t,n){let r=()=>t===!1?void 0:t?Yr(e,t):Xr(e,n),i=e._lazy;if(i)return i===!0?r():i.then(r);if(!e.lazyFn)return r();let a=e.lazyFn().then(t=>{{let{id:n,...r}=t.options;Object.assign(e.options,r),e._lazy=!0}},t=>{throw e._lazy=void 0,t});return e._lazy=a,a.then(r)}function Qr(e){let t=e.findIndex(e=>e.status!==`success`||e._notFound)+1;return t&&t{let i=()=>r(t);t.addEventListener(`abort`,i,{once:!0}),Promise.resolve(e).then(n,r).then(()=>t.removeEventListener(`abort`,i))})}function oi(e,t){return e.routesById[t.routeId]}function si(e,t,n){return Tt(e)?[ni,e]:Tn(e)?(e.routeId||=n,[ti,e]):t?(typeof e?.then==`function`&&(e=Error(`A Promise was thrown`,{cause:e})),[ei,e]):[$r,e]}function ci(e,t){let n=si(t,!0,e.id);if(n[0]!==ei)return n;try{e.options.onError?.(n[1])}catch(t){n=si(t,!0,e.id)}return n}function li(e,t,n,r,i){return i[0].signal.aborted?ri:Ti(e,t,n,ci(n,r),i)}async function ui(e,t,n,r,i,a){let[o,s]=t,c=n[0].signal,l=!!n[3];for(let i=n[6]??0;ie.navigate({...t,_fromLocation:o}),buildLocation:e.buildLocation,cause:l?`preload`:r.cause,abortController:n[0],preload:l,matches:s,routeId:u.id};try{let e=r._ctx||=u.options.context?u.options.context({...f,deps:r.loaderDeps,context:d})||{}:void 0;r.context={...d,...e}}catch(a){return fi(e,r),[i,li(e,t,u,a,n)]}if(c.aborted)return[i,ri];let p=r.paramsError??r.searchError;if(p!==void 0)return fi(e,r),[i,li(e,t,u,p,n)];let m=u.options.beforeLoad;if(!m)continue;let h=r.status;i>=a&&(r.status=`pending`,n[7]?.());try{hi(e,r,`beforeLoad`,n[0]);let a=m({...f,search:r.search,context:r.context,...e.options.additionalContext}),o=await(typeof a?.then==`function`?ai(a,c):a);if(c.aborted)return[i,ri];let s=Ti(e,t,u,si(o,!1,u.id),n);if(s[0]!==$r)return fi(e,r),[i,s];r.context={...r.context,...o}}catch(a){return fi(e,r),[i,li(e,t,u,a,n)]}finally{r.status=h,hi(e,r,!1,n[0])}}i()}function di(e,t,n){if(!(!n||--n[2])){if(e._flights?.get(t.id)===n){let n=e._tx;if(n&&!n[0].signal.aborted&&!n[3].includes(t)&&n[3].some(e=>e.id===t.id)&&n[3].some(e=>e.isFetching===`beforeLoad`))return;e._flights.delete(t.id)}return n[1]}}function fi(e,t){let n=t._flight;t._flight=void 0,di(e,t,n)?.abort()}function pi(e,t,n,r){let i=[];for(let a of t)if(!n?.includes(a)){let t=a._flight;if(a._flight=void 0,r&&t?.[2]===1&&e._flights?.get(a.id)===t&&n?.some(e=>e.id===a.id))t[2]=0;else{let n=di(e,a,t);n&&i.push(n)}}for(let e of i)e.abort()}function mi(e){for(let t of e){let e=t._flight;e&&e[2]++}}function hi(e,t,n,r){if(t.isFetching=n,r&&e._tx?.[0]!==r)return;let i=e.stores.byRoute.get(t.routeId),a=i?.get();a?.id===t.id&&i.set({...a,isFetching:n})}function gi(e,t,n,r,i,a,o){let s=t[0];return{params:n.params,location:s,navigate:t=>e.navigate({...t,_fromLocation:s}),cause:o?`preload`:n.cause,abortController:i,preload:o,deps:n.loaderDeps,parentMatchPromise:a,context:n.context,route:r,...e.options.additionalContext}}async function _i(e,t,n,r,i,a,o){let s=o[0],c=s.signal;if(c.aborted)return ri;if(!i)return[$r,void 0];let l=n._flight;hi(e,n,`loader`,s);try{if(!l){let s=new AbortController;l=[Promise.resolve().then(()=>i(gi(e,t,n,r,s,a,!!o[3]))).then(e=>si(e,!1,r.id),e=>si(e,!0,r.id)).then(t=>(t[0]!==$r&&e._flights?.get(n.id)===l&&(e._flights.delete(n.id),l[2]||s.abort()),t[0]===ei&&l[2]?ci(r,t[1]):t)),s,1],(e._flights??=new Map).set(n.id,l)}return n._flight=l,n.abortController=l[1],Ti(e,t,r,await ai(l[0],c),o)}catch(t){if(t!==c||!c.aborted)throw t;return fi(e,n),ri}finally{hi(e,n,!1,s)}}function vi(e,t,n){t[0]!==ni&&(e.status=`success`,e.error=void 0,t[0]===$r?(e.loaderData=t[1],e.invalid=!1,e.updatedAt=Date.now(),e.preload=n):e.invalid=!0)}function yi(e,t,n){let r=e._cache.get(t.id);if(r!==n||e._committed.some(e=>e.id===t.id&&e._flight===t._flight))return;let i={...t,_notFound:void 0,context:{}};i._flight&&i._flight[2]++,e._cache.set(t.id,i),r&&fi(e,r)}function bi(e,t){return t[0]===ei||t[0]===ti?{...e,status:t[0]===ei?`error`:`notFound`,error:t[1],_flight:void 0}:e}function xi(e,t,n,r,i,a,o){let s=t[1][n],c=oi(e,s),l=!!a[3],u=e._cache.get(s.id),d,f=!1,p;try{if(s.status===`success`&&(d=c.options.shouldReload,typeof d==`function`&&(d=d(gi(e,t,s,c,a[0],i,l))),a[0].signal.aborted&&(p=ri)),!p){if(s.status!==`success`)f=!0;else{let t=l||s.preload?c.options.preloadStaleTime??e.options.defaultPreloadStaleTime??3e4:c.options.staleTime??e.options.defaultStaleTime??0;f=!!(s.invalid||d||d===void 0&&Date.now()-s.updatedAt>=t&&(a[5]||s.cause===`enter`||a[2].some(e=>e.routeId===s.routeId&&e.id!==s.id)))}}}catch(n){s.invalid=!0,fi(e,s),p=li(e,t,c,n,a)}let m=c.options.loader,h=typeof m==`function`,g=h?m:m?.handler,_=!l||c.options.preload!==!1,v=_&&m?e._flights?.get(s.id):void 0;v===s._flight||p?v=void 0:v&&!f&&!l&&d===void 0?f=!0:f||(v=void 0);let y=!(!m||!f||s.status!==`success`||l||a[4]||((h?void 0:m.staleReloadMode)??e.options.defaultStaleReloadMode)===`blocking`),b=f&&_,ee=b&&!y&&(s.status!==`success`||!!m),x=n>=o?a[7]:void 0,S=c.lazyFn&&c._lazy!==!0?x:void 0;if(b&&!m&&(s.invalid=!1,s.updatedAt=Date.now()),v&&v[2]++,ee){let t=s._flight;s._flight=v,di(e,s,t)?.abort(),n>=o&&(s.status=`pending`),x?.()}b||(s.isFetching=!1);let te=!p&&ee?_i(e,t,s,c,g,i,a).then(t=>(vi(s,t,l),t[0]===$r&&(m&&!a[0].signal.aborted&&yi(e,s,u),n>=o&&(s.status=`pending`)),t)):Promise.resolve(p??[$r,s.loaderData]),C=(async()=>{try{let e=Zr(c,void 0,S);e&&await ai(e,a[0].signal)}catch(r){if(!t[1].some((e,t)=>t<=n&&(e.status===`error`||e.status===`notFound`||e._notFound)))return[n,li(e,t,c,r,a)]}let r=await te;ee&&r[0]===$r&&s.status===`pending`&&!a[0].signal.aborted&&(s.status=`success`,x?.())})();if(r.push([n,te,C]),!y)return te.then(e=>bi(s,e));let ne={...s,status:`pending`,preload:!1,_flight:v};s.invalid=!1,s.isFetching=`loader`;let re=_i(e,t,ne,c,g,i,a).then(e=>(s.isFetching=!1,vi(ne,e,!1),e));return(t[2]??=[]).push([n,re,C,ne]),re.then(e=>bi(ne,e))}async function Si(e,t,n,r,i=0){let a=n?.[1][1],o=a?.routeId?t.findIndex(e=>e.routeId===a.routeId):n?.[0]??t.length-1;o<0&&(o=0);for(let n=o;n>=0;n--){let i=oi(e,t[n]);try{let e=Zr(i,!1);e&&await ai(e,r)}catch(e){if(e===r&&r.aborted)throw e}if(i.options.notFoundComponent)return n}return a?.routeId?o:i}function Ci(e,t){t[2]&&=(pi(e,t[2].map(e=>e[3])),void 0)}async function wi(e,t,n,r){let i;try{await Promise.all(e.map(e=>e[1].then(async t=>{let a=e[0];if(!(r&&a>=await r)){if(t[0]>=ni)throw[a,t];!i&&t[0]!==$r&&(i=[a,t],await Promise.all((n??[]).map(e=>{if(!(e[0]<=a))return e[1].then(t=>{if(t[0]===ni)throw[e[0],t]})})))}})))}catch(e){return e}return t??i}function Ti(e,t,n,r,i,a){for(;r[0]===ni;){let o=r[1],s=o.options;try{if((s.href||o.headers.has(`Location`))&&(e.resolveRedirect(o),s.reloadDocument)||(s.reloadDocument?i[3]:i[1]>=20))return r;let n=e.buildLocation({...s,_fromLocation:t[0],_includeValidateSearch:!0}),a=n.maskedLocation??n;if(a.external){let t=o.clone();return t.options={...s},t.headers.set(`Location`,a.publicHref),e.resolveRedirect(t),i[3]?[ni,t]:[ni,t,a]}return[ni,o,n]}catch(e){r=a?[ei,e]:ci(n,e),a=!0}}return r}async function Ei(e,t,n,r,i,a){let o=t[1],s=await i,c=!1,l=o.findIndex(e=>e._notFound),u=t=>t[1][0]===ti?Si(e,o,t,r.signal):t[0],d=l<0?o.length:l;if((s?.[1][0]??0)>=ni)d=0;else if(s){d=s[2]??=await u(s);for(let e of n){if(e[0]>=d)break;let t=await e[1];if(t[0]!==$r&&t[0]=d)break;let t=await e[2];if(t){s=t;break}}if((s?.[1][0]??0)>=ni){let n=s[1];if(n[0]!==ni||n[1].options.reloadDocument||n[2])return Ci(e,t),n;c=!0,s=[0,[ei,Error(`Too many redirects`)]]}let f=s?s[2]??await u(s):l;if(f>=0){let i=s?.[1],l=i?.[0],u=o[f],d=i?.[1],p=()=>{i&&(u._notFound=void 0,l===ei?u.status=`error`:(d.routeId=u.routeId,u.routeId===e.routeTree.id?(u.status=`success`,u._notFound=!0):u.status=`notFound`),u.error=d,u.isFetching=!1)};p(),i||a?.();let m=oi(e,u);try{await ai(i?Promise.resolve().then(()=>Zr(m,l===ei?`errorComponent`:`notFoundComponent`)):Promise.all([Zr(m),Zr(m,`notFoundComponent`)]),r.signal)}catch(n){if(n===r.signal&&r.signal.aborted)return Ci(e,t),ri}i?c&&(r.abort(),await Promise.all([...n.map(e=>e[1]),...n.map(e=>e[2]),...(t[2]??[]).map(e=>e[1])]),Ci(e,t),pi(e,o),p()):u.status=`success`}return t}async function Di(e,t,n,r=0,i=t[1].length){let a=t[1];for(let t=r;te._notFound);if(e.options.notFoundMode!==`root`&&s>=0){let t=await Si(e,n,void 0,a,s);n[s]._notFound=void 0,n[t]._notFound=!0,s=t}let c=s<0?n.length:s+1,l=0;for(;l{for(let t=d;t=ni&&(c=0);p()}if(!a.aborted&&!r[3]){let t=[];for(let[n,r]of e._flights??[])r[2]||(e._flights.delete(n),t.push(r[1]));for(let e of t)e.abort()}let h=Ei(e,i,u,r[0],wi(u,m,i[2]),r[7]);i[2]?.length&&(i[3]=wi(i[2],void 0,void 0,h.then(e=>ii(e)?0:Qr(n).length,()=>0))),o=await h}catch(t){if(Ci(e,i),t===a&&a.aborted)return ri;throw t}return ii(o)?o:Di(e,o,a,r[6]===n.length?r[6]:0)}function ki(e,t){if(e._tx!==t)return;let n=t[3],r=e.stores.matches.get(),i=e._pending;for(let a=0;a0){i[3]=setTimeout(()=>ki(e,t),n);return}i[2]=0}let m=n.map(e=>({...e,_flight:void 0}));m[a].status=`pending`;let h=i[4]=e.startTransition(()=>e.stores.setMatches(m),m).then(t=>(t&&e._pending===i&&i[4]===h&&!i[2]&&(i[2]=Date.now()+f),t));return}}function Ai(e,t){let n=e._pending;(e._tx===t||!e._tx?.[3].some(e=>e.id===n?.[1]))&&(clearTimeout(n?.[3]),e._pending=void 0)}async function ji(e,t){let n=e._pending;if(!n)return;clearTimeout(n[3]);let r=n[2]-Date.now();if(!n[4]||r<=0||!Qr(t[3]).some(e=>e.id===n[1]))return;let i;try{await ai(new Promise(e=>{i=setTimeout(e,r)}),t[0].signal)}catch{}clearTimeout(i)}function Mi(e,t){e._committed=t,e.stores.setMatches(t)}function Ni(e,t,n,r){let i=e._committed,a=e._lifecycleEnd,o=e._cache;for(let e of n)e.preload=!1,r&&(e._assetEnd=void 0);let s=Qr(n).length,c=new Map;{let t=Date.now(),r=new Set;for(let e=0;e=(n.preload?i.options.preloadGcTime??e.options.defaultPreloadGcTime??3e5:i.options.gcTime??e.options.defaultGcTime??3e5)||c.set(n.id,o.get(n.id)===n?n:{...n,_flight:void 0,isFetching:!1,context:{}})}}t[3]=[],e._cache=c;let l=e._lifecycleEnd=Fr(n);Mi(e,n),pi(e,[...o.values(),...i].filter(e=>e._flight&&c.get(e.id)!==e),n),Ir(e,i,n,a,l,t)}async function Pi(e,t){let n=e._tx;for(;n&&n!==t;)t=n,await n[5],n=e._tx}function Fi(e,t,n){let r=n[1].options,i=n[2];if(!i)return e.navigate({...r,replace:!0,ignoreBlocker:!0});if(r.reloadDocument)return e.navigate({href:(i.maskedLocation??i).publicHref,reloadDocument:!0,replace:!0,ignoreBlocker:!0});i._redirects=t[1]+1,e._pendingLocation=i;let a=e.commitLocation({...i,viewTransition:r.viewTransition,replace:!0,resetScroll:r.resetScroll,hashScrollIntoView:r.hashScrollIntoView,ignoreBlocker:!0});return queueMicrotask(()=>{e._pendingLocation===i&&(e._pendingLocation=void 0)}),a}async function Ii(e,t,n,r,i){let a=n.map(e=>({...e}));mi(a);for(let t of r)fi(e,a[t[0]]),a[t[0]]=t[3];let o=[t[2],a],s;try{s=await Ei(e,o,r,t[0],i)}catch(t){throw pi(e,a),t}if(ii(s)){pi(e,a),s[0]===ni&&e._tx===t&&e._committed===n&&await Fi(e,t,s);return}if(await Di(e,s,t[0].signal),e._tx!==t||e._committed!==n){pi(e,a);return}for(let t of a){let n=e._cache.get(t.id);n?._flight&&n._flight===t._flight&&(e._cache.delete(t.id),fi(e,n))}Mi(e,a),pi(e,n,a)}async function Li(e,t,n,r,i,a){let o=await Oi(e,t[2],t[3],[t[0],t[1],e._committed,void 0,i,n,a,r]);if(ii(o)){let n=o[0]===ni&&e._tx===t;if((!n||o[1].options.reloadDocument)&&Ai(e,t),pi(e,t[3]),t[3]=[],!n)return;if(e._tx!==t){Ai(e,t);return}await Fi(e,t,o);return}let s=o[1];if(e._tx===t&&await ji(e,t),e._tx!==t){Ai(e,t),pi(e,s),Ci(e,o);return}let c=t[2],l=Nr(c,e.stores.resolvedLocation.get()),u=o[2];await e.startViewTransition(async()=>{if(e._tx===t&&await ji(e,t),e._tx!==t){Ai(e,t),pi(e,s),Ci(e,o);return}let n=await e.startTransition(()=>{Ai(e,t),Ni(e,t,s,a),e._tx===t&&(e.emit({type:`onLoad`,...l}),e._tx===t&&e.emit({type:`onBeforeRouteMount`,...l}))},s);if(e._tx!==t){Ci(e,o);return}u?.length&&Ii(e,t,s,u,o[3]).catch(console.error),e.batch(()=>{e.stores.resolvedLocation.set(c),e.stores.status.set(`idle`),e._tx===t&&e.emit({type:`onResolved`,...l}),n&&e._tx===t&&e.emit({type:`onRendered`,...l})}),e._tx===t&&(e._commitPromise?.resolve(),e._commitPromise=void 0)})}async function Ri(e,t){let n=e._tx,r=e.stores.resolvedLocation.get(),i=r??e.stores.location.get(),a=e.latestLocation,o=e._pendingLocation,s=o?.href===a.href?o._redirects??0:0,c=e._handoff,l=c?.[0](),u=new AbortController,d=e._preflight;if(e._preflight=u,l||c?.[1](),d?.abort(),!u.signal.aborted){let t=Nr(a,r);e.emit({type:`onBeforeNavigate`,...t}),u.signal.aborted||e.emit({type:`onBeforeLoad`,...t})}if(u.signal.aborted){await Pi(e,n);return}let f=i.href===a.href,p=u,m=e.matchRoutes(a,{_controller:u});mi(m);let h=l?c[1](m):void 0;if(h?p=l:l?.abort(),u.signal.aborted){pi(e,m),await Pi(e,n);return}e._preflight=void 0;let g,_=()=>Li(e,y,f,()=>ki(e,y),t?.sync,h),v=t?.sync?new Promise(e=>g=e):Promise.resolve().then(_),y=[p,s,a,m,Date.now(),v.then(()=>Pi(e,y))];if(e._tx=y,n){for(let t of e.stores.matches.get()){if(e._tx!==y)break;t.isFetching&&hi(e,t,!1)}n[0].abort(),pi(e,n[3],y[3],!0)}if(e._tx!==y){pi(e,y[3]),y[3]=[],g?.(),await Pi(e,y);return}e.batch(()=>{e.stores.status.set(`pending`),e.stores.location.set(a)}),(h||!e._committed.length&&m[0]?.status!==`success`&&!m.some(e=>e._notFound))&&ki(e,y),g?.(_()),await y[5]}async function zi(e,t){let n=e.buildLocation(t);for(let t=0;;t++){let r=e._committed,i=new AbortController,a,o,s;try{try{a=e.matchRoutes(n,{_controller:i}),mi(a),o=(e._preloads??=new Map).set(i,a),s=await Oi(e,n,a,[i,t,r,!0])}finally{o&&(o=o.delete(i),pi(e,a)),i.abort()}if(!ii(s))return s[1];if(!o||s.length<3)return;n=s[2]}catch(e){Tn(e)||console.error(e);return}}}var D=a(t(),1),O=i(),Bi=class extends D.Component{constructor(...e){super(...e),this.state={error:0},this.reset=()=>{this.setState({error:0})}}static getDerivedStateFromProps(e,t){let n=e.getResetKey();return t.error&&t.resetKey!==n?{resetKey:n,error:0}:{resetKey:n}}static getDerivedStateFromError(e){return{error:[e]}}componentDidCatch(e,t){this.props.onCatch?.(e,t)}render(){let e=this.state.error;return e?D.createElement(this.props.errorComponent??Vi,{error:e[0],reset:this.reset}):this.props.children}};function Vi({error:e}){let[t,n]=D.useState(!1);return(0,O.jsxs)(`div`,{style:{padding:`.5rem`,maxWidth:`100%`},children:[(0,O.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:`.5rem`},children:[(0,O.jsx)(`strong`,{style:{fontSize:`1rem`},children:`Something went wrong!`}),(0,O.jsx)(`button`,{style:{appearance:`none`,fontSize:`.6em`,border:`1px solid currentColor`,padding:`.1rem .2rem`,fontWeight:`bold`,borderRadius:`.25rem`},onClick:()=>n(e=>!e),children:t?`Hide Error`:`Show Error`})]}),(0,O.jsx)(`div`,{style:{height:`.25rem`}}),t?(0,O.jsx)(`div`,{children:(0,O.jsx)(`pre`,{style:{fontSize:`.7em`,border:`1px solid red`,borderRadius:`.25rem`,padding:`.3rem`,color:`red`,overflow:`auto`},children:e?.message?(0,O.jsx)(`code`,{children:e.message}):null})}):null]})}function Hi(e){let t=o(),n=`not-found-${Ve(t.stores.location,e=>e.pathname)}-${Ve(t.stores.status)}`;return(0,O.jsx)(Bi,{getResetKey:()=>n,onCatch:(t,n)=>{if(Tn(t))e.onCatch?.(t,n);else throw t},errorComponent:({error:t})=>{if(Tn(t))return e.fallback?.(t);throw t},children:e.children})}function Ui(){return(0,O.jsx)(`p`,{children:`Not Found`})}function Wi(e,t,n){return t.options.notFoundComponent?(0,O.jsx)(t.options.notFoundComponent,{...n}):e.options.defaultNotFoundComponent?(0,O.jsx)(e.options.defaultNotFoundComponent,{...n}):(0,O.jsx)(Ui,{})}function Gi(e,t){let n=t?.options.pendingComponent??e.options.defaultPendingComponent;return n?(0,O.jsx)(n,{}):null}var Ki=(e,t)=>e[0]===t[0]&&e[1]===t[1],qi=(e,t,n)=>!t.isRoot||t.options.shellComponent||t.options.wrapInSuspense||n===!1||n===`data-only`||!e.ssr,Ji=D.memo(function({routeId:e}){let t=o();return(0,O.jsx)(Yi,{router:t,match:Ve(t.stores.getMatchStore(e))})});function Yi({router:e,match:t}){let n=e.routesById[t.routeId],r=Gi(e,n),i=n.options.errorComponent??e.options.defaultErrorComponent,a=n.options.onCatch??e.options.defaultOnCatch,o=n.isRoot?n.options.notFoundComponent??e.options.notFoundRoute?.options.component:n.options.notFoundComponent,s=t.ssr===!1||t.ssr===`data-only`,c=qi(e,n,t.ssr)&&(n.options.wrapInSuspense??r??(n.options.errorComponent?.preload||s)),l=(0,O.jsx)(Xi,{match:t});s&&(l=(0,O.jsx)(et,{fallback:r,children:l})),o&&(l=(0,O.jsx)(Hi,{fallback:e=>{if(e.routeId??=t.routeId,e.routeId!==t.routeId)throw e;return D.createElement(o,e)},children:l})),i&&(l=(0,O.jsx)(Bi,{getResetKey:()=>t,errorComponent:i,onCatch:(e,n)=>{if(Tn(e))throw e.routeId??=t.routeId,e;a?.(e,n)},children:l})),c&&(l=(0,O.jsx)(D.Suspense,{fallback:r,children:l}));let u=n.isRoot?n.options.shellComponent:void 0;return(0,O.jsx)(xt.Provider,{value:t.routeId,children:u?(0,O.jsxs)(u,{children:[l,null]}):(0,O.jsxs)(O.Fragment,{children:[l,null]})})}var Xi=D.memo(function({match:e}){let t=o(),n=e.routeId,r=t.routesById[n],i=D.useMemo(()=>{let i=(r.options.remountDeps??t.options.defaultRemountDeps)?.({routeId:n,loaderDeps:e.loaderDeps,params:e._strictParams,search:e._strictSearch});return i?JSON.stringify(i):void 0},[n,e.loaderDeps,e._strictParams,e._strictSearch,r.options.remountDeps,t.options.defaultRemountDeps]),a=D.useMemo(()=>{let e=r.options.component??t.options.defaultComponent;return e?(0,O.jsx)(e,{},i):(0,O.jsx)(Zi,{})},[i,r.options.component,t.options.defaultComponent]);if(e.status===`pending`){if(t.ssr&&!qi(t,r,e.ssr))return a;if(t._tx)throw t._tx[5];return Gi(t,r)}if(e.status===`notFound`)return Wi(t,r,e.error);if(e.status===`error`)throw e.error;return a}),Zi=D.memo(function(){let e=o(),t=D.useContext(xt),n,r,i;{let a=e.stores.getMatchStore(t);[n,r]=Ve(a,e=>[!!e._notFound,e.error],{compare:Ki}),i=Ve(e.stores.ids,e=>e[e.indexOf(t)+1])}if(n)return Wi(e,e.routesById[t],r);if(!i)return null;let a=(0,O.jsx)(Ji,{routeId:i});return t===`__root__`?(0,O.jsx)(D.Suspense,{fallback:Gi(e),children:a}):a});function Qi(e,t){let n=e[1];e.length=0,n?.(t)}function $i({t:e}){let t=o(),n=t._rendered??=[];return t.startTransition=(r,i)=>new Promise(a=>{Qi(n,!1),n.push(i,a),e(t),D.startTransition(r)}),E(()=>{let e=t.history.subscribe(t.load);t.updateLatestLocation();let r=t.latestLocation,i=t.buildLocation({to:r.pathname,search:!0,params:!0,hash:!0,state:!0,_includeValidateSearch:!0});if(ze(r.publicHref)!==ze(i.publicHref))return t.commitLocation({...i,replace:!0,ignoreBlocker:!0}),e;let a=t.stores.resolvedLocation.get();return a?.href===r.href&&a.state.__TSR_key===r.state.__TSR_key?n.push(t.stores.matches.get(),e=>{e&&t.emit({type:`onRendered`,...Nr(a,a)})}):t._tx||t.load({sync:!0}).catch(console.error),e},[t,t.history]),null}function ea(){let e=o(),t=e.routesById[Nt],n=Gi(e,t),r=(0,O.jsxs)(O.Fragment,{children:[(0,O.jsx)($i,{t:D.useState()[1]}),e.ssr?(0,O.jsx)(ta,{}):(0,O.jsx)(D.Suspense,{fallback:n,children:(0,O.jsx)(ta,{})})]});return e.options.InnerWrap?(0,O.jsx)(e.options.InnerWrap,{children:r}):r}function ta(){let e=o(),t=e._rendered,n=Ve(e.stores.matches,e=>t[0]??e),r=n[0],i=r?.routeId;E(()=>{t[0]===n&&Qi(t,!0)},[t,n]);let a=i?(0,O.jsx)(Ji,{routeId:i}):null;return e.options.disableGlobalCatchBoundary?a:(0,O.jsx)(Bi,{getResetKey:()=>r,onCatch:void 0,children:a})}var na=e=>({createMutableStore:At,createReadonlyStore:At,batch:Ot}),ra=e=>new ia(e),ia=class extends Lr{constructor(e){super(e,na)}};function aa({router:e,children:t,...r}){Ie(r)&&e.update({...e.options,...r,context:{...e.options.context,...r.context}});let i=(0,O.jsx)(n.Provider,{value:e,children:t});return e.options.Wrap?(0,O.jsx)(e.options.Wrap,{children:i}):i}function oa({router:e,...t}){return(0,O.jsx)(aa,{router:e,...t,children:(0,O.jsx)(ea,{})})}function sa(e){let t=o({warn:e?.router===void 0}),n=e?.router||t;return Ve(n.stores.__store,yt(e,n))}function ca(e,t,n={leading:!1}){let[r,i]=(0,D.useState)(e),a=(0,D.useRef)(!1),o=(0,D.useRef)(null),s=(0,D.useRef)(!1),c=(0,D.useRef)(e);c.current=e;let l=(0,D.useCallback)(()=>{window.clearTimeout(o.current),o.current=null},[]),u=(0,D.useCallback)(()=>{l(),s.current=!1},[]),d=(0,D.useCallback)(()=>{o.current&&(u(),s.current=!1,i(c.current))},[]);return(0,D.useEffect)(()=>{a.current&&(l(),!s.current&&n.leading?(s.current=!0,i(e),o.current=window.setTimeout(()=>{s.current=!1},t)):o.current=window.setTimeout(()=>{s.current=!1,i(e)},t))},[e,n.leading,t]),(0,D.useEffect)(()=>(a.current=!0,u),[]),[r,u,{cancel:u,flush:d}]}function la(e=!1,t={}){let[n,r]=(0,D.useState)(e),i=(0,D.useCallback)(()=>{r(e=>e||(t.onOpen?.(),!0))},[t.onOpen]),a=(0,D.useCallback)(()=>{r(e=>e&&(t.onClose?.(),!1))},[t.onClose]);return[n,{open:i,close:a,toggle:(0,D.useCallback)(()=>{n?a():i()},[a,i,n]),set:r}]}function ua(e){return e===`auto`||e===`dark`||e===`light`}function da({key:e=`mantine-color-scheme-value`}={}){let t;return{get:t=>{if(typeof window>`u`)return t;try{let n=window.localStorage.getItem(e);return ua(n)?n:t}catch{return t}},set:t=>{try{window.localStorage.setItem(e,t)}catch(e){console.warn(`[@mantine/core] Local storage color scheme manager was unable to save color scheme.`,e)}},subscribe:n=>{t=t=>{t.storageArea===window.localStorage&&t.key===e&&ua(t.newValue)&&n(t.newValue)},window.addEventListener(`storage`,t)},unsubscribe:()=>{window.removeEventListener(`storage`,t)},clear:()=>{window.localStorage.removeItem(e)}}}function fa(e,t){let n=typeof window<`u`&&`matchMedia`in window&&window.matchMedia(`(prefers-color-scheme: dark)`)?.matches,r=e===`auto`?n?`dark`:`light`:e;t()?.setAttribute(`data-mantine-color-scheme`,r)}function pa({manager:e,defaultColorScheme:t,getRootElement:n,forceColorScheme:r}){let i=(0,D.useRef)(null),[a,o]=(0,D.useState)(()=>e.get(t)),s=r||a,c=(0,D.useCallback)(t=>{r||(fa(t,n),o(t),e.set(t))},[e.set,s,r]),l=(0,D.useCallback)(()=>{o(t),fa(t,n),e.clear()},[e.clear,t]);return(0,D.useEffect)(()=>(e.subscribe(c),e.unsubscribe),[e.subscribe,e.unsubscribe]),de(()=>{fa(e.get(t),n)},[]),(0,D.useEffect)(()=>{if(r)return fa(r,n),()=>{};r===void 0&&fa(a,n),typeof window<`u`&&`matchMedia`in window&&(i.current=window.matchMedia(`(prefers-color-scheme: dark)`));let e=e=>{a===`auto`&&fa(e.matches?`dark`:`light`,n)};return i.current?.addEventListener(`change`,e),()=>i.current?.removeEventListener(`change`,e)},[a,r]),{colorScheme:s,setColorScheme:c,clearColorScheme:l}}function ma(e){return Object.entries(e).map(([e,t])=>`${e}: ${t};`).join(``)}function ha(e,t){let n=t?[t]:[`:root`,`:host`],r=ma(e.variables),i=r?`${n.join(`, `)}{${r}}`:``,a=ma(e.dark),o=ma(e.light),s=e=>n.map(t=>t===`:host`?`${t}([data-mantine-color-scheme="${e}"])`:`${t}[data-mantine-color-scheme="${e}"]`).join(`, `);return`${i}\n\n${a?`${s(`dark`)}{${a}}`:``}\n\n${o?`${s(`light`)}{${o}}`:``}`}function k({theme:e,color:t,colorScheme:n,name:r=t,withColorValues:i=!0}){if(!e.colors[t])return{};if(n===`light`){let n=m(e,`light`),a={[`--mantine-color-${r}-text`]:`var(--mantine-color-${r}-filled)`,[`--mantine-color-${r}-filled`]:`var(--mantine-color-${r}-${n})`,[`--mantine-color-${r}-filled-hover`]:`var(--mantine-color-${r}-${n===9?8:n+1})`,[`--mantine-color-${r}-light`]:`var(--mantine-color-${r}-1)`,[`--mantine-color-${r}-light-hover`]:`var(--mantine-color-${r}-2)`,[`--mantine-color-${r}-light-color`]:`var(--mantine-color-${r}-9)`,[`--mantine-color-${r}-outline`]:`var(--mantine-color-${r}-${n})`,[`--mantine-color-${r}-outline-hover`]:f(e.colors[t][n],.05)};return i?{[`--mantine-color-${r}-0`]:e.colors[t][0],[`--mantine-color-${r}-1`]:e.colors[t][1],[`--mantine-color-${r}-2`]:e.colors[t][2],[`--mantine-color-${r}-3`]:e.colors[t][3],[`--mantine-color-${r}-4`]:e.colors[t][4],[`--mantine-color-${r}-5`]:e.colors[t][5],[`--mantine-color-${r}-6`]:e.colors[t][6],[`--mantine-color-${r}-7`]:e.colors[t][7],[`--mantine-color-${r}-8`]:e.colors[t][8],[`--mantine-color-${r}-9`]:e.colors[t][9],...a}:a}let a=m(e,`dark`),o={[`--mantine-color-${r}-text`]:`var(--mantine-color-${r}-4)`,[`--mantine-color-${r}-filled`]:`var(--mantine-color-${r}-${a})`,[`--mantine-color-${r}-filled-hover`]:`var(--mantine-color-${r}-${a===9?8:a+1})`,[`--mantine-color-${r}-light`]:te(e.colors[t][9],.5),[`--mantine-color-${r}-light-hover`]:te(e.colors[t][9],.3),[`--mantine-color-${r}-light-color`]:`var(--mantine-color-${r}-0)`,[`--mantine-color-${r}-outline`]:`var(--mantine-color-${r}-${Math.max(a-4,0)})`,[`--mantine-color-${r}-outline-hover`]:f(e.colors[t][Math.max(a-4,0)],.05)};return i?{[`--mantine-color-${r}-0`]:e.colors[t][0],[`--mantine-color-${r}-1`]:e.colors[t][1],[`--mantine-color-${r}-2`]:e.colors[t][2],[`--mantine-color-${r}-3`]:e.colors[t][3],[`--mantine-color-${r}-4`]:e.colors[t][4],[`--mantine-color-${r}-5`]:e.colors[t][5],[`--mantine-color-${r}-6`]:e.colors[t][6],[`--mantine-color-${r}-7`]:e.colors[t][7],[`--mantine-color-${r}-8`]:e.colors[t][8],[`--mantine-color-${r}-9`]:e.colors[t][9],...o}:o}function ga(e,t,n){le(t).forEach(r=>Object.assign(e,{[`--mantine-${n}-${r}`]:t[r]}))}var _a=e=>{let t=m(e,`light`),n=e.defaultRadius in e.radius?e.radius[e.defaultRadius]:T(e.defaultRadius),r={variables:{"--mantine-z-index-app":`100`,"--mantine-z-index-modal":`200`,"--mantine-z-index-popover":`300`,"--mantine-z-index-overlay":`400`,"--mantine-z-index-max":`9999`,"--mantine-scale":e.scale.toString(),"--mantine-cursor-type":e.cursorType,"--mantine-webkit-font-smoothing":e.fontSmoothing?`antialiased`:`unset`,"--mantine-moz-font-smoothing":e.fontSmoothing?`grayscale`:`unset`,"--mantine-color-white":e.white,"--mantine-color-black":e.black,"--mantine-line-height":e.lineHeights.md,"--mantine-font-family":e.fontFamily,"--mantine-font-family-monospace":e.fontFamilyMonospace,"--mantine-font-family-headings":e.headings.fontFamily,"--mantine-heading-font-weight":e.headings.fontWeight,"--mantine-heading-text-wrap":e.headings.textWrap,"--mantine-radius-default":n,"--mantine-primary-color-filled":`var(--mantine-color-${e.primaryColor}-filled)`,"--mantine-primary-color-filled-hover":`var(--mantine-color-${e.primaryColor}-filled-hover)`,"--mantine-primary-color-light":`var(--mantine-color-${e.primaryColor}-light)`,"--mantine-primary-color-light-hover":`var(--mantine-color-${e.primaryColor}-light-hover)`,"--mantine-primary-color-light-color":`var(--mantine-color-${e.primaryColor}-light-color)`},light:{"--mantine-color-scheme":`light`,"--mantine-primary-color-contrast":ht(e,`light`),"--mantine-color-bright":`var(--mantine-color-black)`,"--mantine-color-text":e.black,"--mantine-color-body":e.white,"--mantine-color-error":`var(--mantine-color-red-6)`,"--mantine-color-success":`var(--mantine-color-teal-8)`,"--mantine-color-placeholder":`var(--mantine-color-gray-5)`,"--mantine-color-anchor":`var(--mantine-color-${e.primaryColor}-${t})`,"--mantine-color-default":`var(--mantine-color-white)`,"--mantine-color-default-hover":`var(--mantine-color-gray-0)`,"--mantine-color-default-color":`var(--mantine-color-black)`,"--mantine-color-default-border":`var(--mantine-color-gray-4)`,"--mantine-color-dimmed":`var(--mantine-color-gray-6)`,"--mantine-color-disabled":`var(--mantine-color-gray-2)`,"--mantine-color-disabled-color":`var(--mantine-color-gray-5)`,"--mantine-color-disabled-border":`var(--mantine-color-gray-3)`},dark:{"--mantine-color-scheme":`dark`,"--mantine-primary-color-contrast":ht(e,`dark`),"--mantine-color-bright":`var(--mantine-color-white)`,"--mantine-color-text":`var(--mantine-color-dark-0)`,"--mantine-color-body":`var(--mantine-color-dark-7)`,"--mantine-color-error":`var(--mantine-color-red-8)`,"--mantine-color-success":`var(--mantine-color-teal-8)`,"--mantine-color-placeholder":`var(--mantine-color-dark-3)`,"--mantine-color-anchor":`var(--mantine-color-${e.primaryColor}-4)`,"--mantine-color-default":`var(--mantine-color-dark-6)`,"--mantine-color-default-hover":`var(--mantine-color-dark-5)`,"--mantine-color-default-color":`var(--mantine-color-white)`,"--mantine-color-default-border":`var(--mantine-color-dark-4)`,"--mantine-color-dimmed":`var(--mantine-color-dark-2)`,"--mantine-color-disabled":`var(--mantine-color-dark-6)`,"--mantine-color-disabled-color":`var(--mantine-color-dark-3)`,"--mantine-color-disabled-border":`var(--mantine-color-dark-4)`}};ga(r.variables,e.breakpoints,`breakpoint`),ga(r.variables,e.spacing,`spacing`),ga(r.variables,e.fontSizes,`font-size`),ga(r.variables,e.lineHeights,`line-height`),ga(r.variables,e.shadows,`shadow`),ga(r.variables,e.radius,`radius`),ga(r.variables,e.fontWeights,`font-weight`),e.colors[e.primaryColor].forEach((t,n)=>{r.variables[`--mantine-primary-color-${n}`]=`var(--mantine-color-${e.primaryColor}-${n})`}),le(e.colors).forEach(t=>{let n=e.colors[t];if(d(n)){Object.assign(r.light,k({theme:e,name:n.name,color:n.light,colorScheme:`light`,withColorValues:!0})),Object.assign(r.dark,k({theme:e,name:n.name,color:n.dark,colorScheme:`dark`,withColorValues:!0})),r.light[`--mantine-color-${n.name}-contrast`]=mt(n,e,`light`),r.dark[`--mantine-color-${n.name}-contrast`]=mt(n,e,`dark`);return}n.forEach((e,n)=>{r.variables[`--mantine-color-${t}-${n}`]=e}),Object.assign(r.light,k({theme:e,color:t,colorScheme:`light`,withColorValues:!1})),Object.assign(r.dark,k({theme:e,color:t,colorScheme:`dark`,withColorValues:!1}))});let i=e.headings.sizes;return le(i).forEach(t=>{r.variables[`--mantine-${t}-font-size`]=i[t].fontSize,r.variables[`--mantine-${t}-line-height`]=i[t].lineHeight,r.variables[`--mantine-${t}-font-weight`]=i[t].fontWeight||e.headings.fontWeight}),r};function va(){let e=y(),t=c(),n=le(e.breakpoints).reduce((t,n)=>{let r=e.breakpoints[n].includes(`px`),i=Ct(e.breakpoints[n]);return`${t}@media (max-width: ${r?`${i-.1}px`:ge(i-.1)}) {.mantine-visible-from-${n} {display: none !important;}}@media (min-width: ${r?`${i}px`:ge(i)}) {.mantine-hidden-from-${n} {display: none !important;}}`},``);return(0,O.jsx)(`style`,{"data-mantine-styles":`classes`,nonce:t?.(),dangerouslySetInnerHTML:{__html:n}})}function ya({theme:e,generator:t}){let n=_a(e),r=t?.(e);return r?ue(n,r):n}var ba=_a(u);function xa(e){let t={variables:{},light:{},dark:{}};return le(e.variables).forEach(n=>{ba.variables[n]!==e.variables[n]&&(t.variables[n]=e.variables[n])}),le(e.light).forEach(n=>{ba.light[n]!==e.light[n]&&(t.light[n]=e.light[n])}),le(e.dark).forEach(n=>{ba.dark[n]!==e.dark[n]&&(t.dark[n]=e.dark[n])}),t}function Sa(e){return ha({variables:{},dark:{"--mantine-color-scheme":`dark`},light:{"--mantine-color-scheme":`light`}},e)}function Ca({cssVariablesSelector:e,deduplicateCssVariables:t}){let n=y(),r=c(),i=ya({theme:n,generator:b()}),a=(e===void 0||e===`:root`||e===`:host`)&&t,o=ha(a?xa(i):i,e);return o?(0,O.jsx)(`style`,{"data-mantine-styles":!0,nonce:r?.(),dangerouslySetInnerHTML:{__html:`${o}${a?``:Sa(e)}`}}):null}Ca.displayName=`@mantine/CssVariables`;function wa({respectReducedMotion:e,getRootElement:t}){de(()=>{e&&t()?.setAttribute(`data-respect-reduced-motion`,`true`)},[e])}function Ta({theme:e,children:t,getStyleNonce:n,withStaticClasses:r=!0,withGlobalClasses:i=!0,deduplicateCssVariables:a=!0,withCssVariables:o=!0,cssVariablesSelector:s,classNamesPrefix:c=`mantine`,colorSchemeManager:l=da(),defaultColorScheme:u=`light`,getRootElement:d=()=>document.documentElement,cssVariablesResolver:f,forceColorScheme:m,stylesTransform:h,env:g,deduplicateInlineStyles:_=!1}){let{colorScheme:y,setColorScheme:b,clearColorScheme:ee}=pa({defaultColorScheme:u,forceColorScheme:m,manager:l,getRootElement:d});return wa({respectReducedMotion:e?.respectReducedMotion||!1,getRootElement:d}),(0,O.jsx)(p,{value:{colorScheme:y,setColorScheme:b,clearColorScheme:ee,getRootElement:d,classNamesPrefix:c,getStyleNonce:n,cssVariablesResolver:f,cssVariablesSelector:s??`:root`,withStaticClasses:r,stylesTransform:h,env:g,deduplicateInlineStyles:_},children:(0,O.jsxs)(v,{theme:e,children:[o&&(0,O.jsx)(Ca,{cssVariablesSelector:s,deduplicateCssVariables:a}),i&&(0,O.jsx)(va,{}),t]})})}Ta.displayName=`@mantine/core/MantineProvider`;function Ea(e){return e}var[Da,Oa]=It(`AppShell was not found in tree`);function ka({size:e,min:t,max:n,viewportMax:r}){let i=Math.min(n??1/0,r);return Math.max(Math.min(t??0,i),Math.min(e,i))}function Aa(e,t){return t!==void 0&&ef.axis===`horizontal`?window.innerWidth:window.innerHeight,[h,g]=(0,D.useState)(0),[_,v]=(0,D.useState)(void 0),b=()=>m()/d.scale,ee=e=>{let t=e.getBoundingClientRect();return((f.axis===`horizontal`?t.width:t.height)-Pa(e,f.safeAreaVariable))/d.scale},x=t=>{let r=n.rootRef.current;if(!r)return;let i=T(t);r.style.setProperty(f.sizeVariable,i),n.resizeOffsets[e]&&r.style.setProperty(f.offsetVariable,i),n.mode===`static`&&f.gridWidthVariable&&r.style.setProperty(f.gridWidthVariable,i)},S=()=>{let e=n.rootRef.current;e&&(e.style.removeProperty(f.sizeVariable),e.style.removeProperty(f.offsetVariable),f.gridWidthVariable&&e.style.removeProperty(f.gridWidthVariable))},te=()=>{s.current?.abort(),s.current=null,o.current=null;let e=c.current;c.current=null,e&&(za(`user-select`,e.userSelect),za(`-webkit-user-select`,e.webkitUserSelect),za(`cursor`,e.cursor))},C=()=>{r?.reportCollapse(e,Aa(a.current.startSize,p.collapseThreshold)),r?.endResize(e,null)},ne=t=>{if(t.pointerId!==o.current)return;a.current.moved=!0;let n=Na({section:e,deltaX:t.clientX-a.current.startX,deltaY:t.clientY-a.current.startY,dir:u})/d.scale,s=a.current.startSize+n,c=ka({size:s,min:p.min,max:p.max,viewportMax:b()});a.current.size=c,x(c),i.current?.setAttribute(`aria-valuenow`,String(Math.round(c))),r?.previewResize(e,c),r?.reportCollapse(e,Aa(s,p.collapseThreshold))},re=t=>{if(t.pointerId===o.current){if(te(),!a.current.moved){r?.endResize(e,null);return}r?.endResize(e,a.current.size)}},ie=e=>{e.pointerId===o.current&&(te(),S(),C())},w=e=>{e.key===`Escape`&&(e.preventDefault(),te(),S(),i.current?.setAttribute(`aria-valuenow`,String(Math.round(a.current.startSize))),C())},ae=()=>{let t=r?.[e].size;if(t!==void 0)return t;let n=i.current?.parentElement;return n?ee(n):0},oe=t=>{r?.initCollapse(e,Aa(ae(),p.collapseThreshold)),r?.reportCollapse(e,Aa(t,p.collapseThreshold)),r?.endResize(e,ka({size:t,min:p.min,max:p.max,viewportMax:b()}))},se=t=>{let n=t.shiftKey?La:Ia;if(t.key===`Home`){t.preventDefault(),oe(p.min??0);return}if(t.key===`End`){t.preventDefault(),oe(p.max??b());return}let r=Ra[t.key];if(!r)return;let i=Na({section:e,...r,dir:u});i!==0&&(t.preventDefault(),oe(ae()+i*n))},ce=()=>{S(),r?.[e].reset()},le=t=>{if(t.button!==0||s.current!==null)return;let n=i.current?.parentElement;if(!n)return;let l=ee(n);a.current={startSize:l,startX:t.clientX,startY:t.clientY,size:l,moved:!1},o.current=t.pointerId,r?.initCollapse(e,Aa(l,p.collapseThreshold));let u=new AbortController;s.current=u;let{signal:d}=u;c.current={userSelect:document.body.style.getPropertyValue(`user-select`),webkitUserSelect:document.body.style.getPropertyValue(`-webkit-user-select`),cursor:document.body.style.getPropertyValue(`cursor`)},document.body.style.setProperty(`user-select`,`none`),document.body.style.setProperty(`-webkit-user-select`,`none`),document.body.style.setProperty(`cursor`,f.axis===`horizontal`?`col-resize`:`row-resize`),r?.startResize(e),document.addEventListener(`pointermove`,ne,{signal:d}),document.addEventListener(`pointerup`,re,{signal:d}),document.addEventListener(`pointercancel`,ie,{signal:d}),document.addEventListener(`keydown`,w,{signal:d})};if(de(()=>{r&&r.activeSection!==e&&S()},[r?.activeSection,r?.[e].size]),de(()=>{g(m());let e=()=>g(m());return window.addEventListener(`resize`,e),()=>window.removeEventListener(`resize`,e)},[f.axis]),de(()=>{r?.[e].size===void 0&&v(ae())},[r?.[e].size,h]),de(()=>()=>{let e=s.current!==null;te(),S(),e&&C()},[]),!r?.[e].enabled)return null;let ue=h/d.scale,fe=Math.min(p.max??ue,ue),pe=r[e].size,me=pe!==void 0&&h>0?Math.min(pe,ue):pe??_;return(0,O.jsx)(l,{ref:i,role:`separator`,tabIndex:0,"aria-label":p.label??Fa[e],"aria-controls":t,"aria-orientation":f.orientation,"aria-valuemin":p.min??0,"aria-valuemax":Math.round(fe),"aria-valuenow":me===void 0?void 0:Math.round(me),onPointerDown:le,onKeyDown:se,onDoubleClick:ce,mod:{section:e,orientation:f.orientation,active:r[e].active},...n.getStyles(`resizeHandle`)})}Ba.displayName=`@mantine/core/AppShellResizeHandle`;var Va={root:`m_89ab340`,navbar:`m_45252eee`,aside:`m_9cdde9a`,header:`m_3b16f56b`,main:`m_8983817`,footer:`m_3840c879`,section:`m_6dcfc7c7`,resizeHandle:`m_3b25945a`},Ha=x(e=>{let{classNames:t,className:n,style:r,styles:i,unstyled:a,vars:o,withBorder:s,zIndex:c,mod:u,...d}=_(`AppShellAside`,null,e),f=Oa(),p=me(d.id);if(f.disabled)return null;let m=f.resize?.aside.enabled??!1,h=f.getStyles(`aside`,{className:ne({[Gt.classNames.zeroRight]:f.offsetScrollbars},n),classNames:t,styles:i,style:r});if(!m)return(0,O.jsx)(l,{component:`aside`,mod:[{"with-border":s??f.withBorder},u],...h,...d,__vars:{"--app-shell-aside-z-index":`calc(${c??f.zIndex} + 1)`}});let{children:g,dangerouslySetInnerHTML:v,...y}=d;return(0,O.jsxs)(l,{component:`aside`,mod:[{"with-border":s??f.withBorder},u],...h,...y,__vars:{"--app-shell-aside-z-index":`calc(${c??f.zIndex} + 1)`},id:p,children:[v?(0,O.jsx)(`div`,{style:{display:`contents`},dangerouslySetInnerHTML:v}):g,(0,O.jsx)(Ba,{section:`aside`,sectionId:p})]})});Ha.classes=Va,Ha.displayName=`@mantine/core/AppShellAside`;var Ua=x(e=>{let{classNames:t,className:n,style:r,styles:i,unstyled:a,vars:o,withBorder:s,zIndex:c,mod:u,...d}=_(`AppShellFooter`,null,e),f=Oa(),p=me(d.id);if(f.disabled)return null;let m=f.resize?.footer.enabled??!1,h=f.getStyles(`footer`,{className:ne({[Gt.classNames.zeroRight]:f.offsetScrollbars},n),classNames:t,styles:i,style:r});if(!m)return(0,O.jsx)(l,{component:`footer`,mod:[{"with-border":s??f.withBorder},u],...h,...d,__vars:{"--app-shell-footer-z-index":(c??f.zIndex)?.toString()}});let{children:g,dangerouslySetInnerHTML:v,...y}=d;return(0,O.jsxs)(l,{component:`footer`,mod:[{"with-border":s??f.withBorder},u],...h,...y,__vars:{"--app-shell-footer-z-index":(c??f.zIndex)?.toString()},id:p,children:[v?(0,O.jsx)(`div`,{style:{display:`contents`},dangerouslySetInnerHTML:v}):g,(0,O.jsx)(Ba,{section:`footer`,sectionId:p})]})});Ua.classes=Va,Ua.displayName=`@mantine/core/AppShellFooter`;var Wa=x(e=>{let{classNames:t,className:n,style:r,styles:i,unstyled:a,vars:o,withBorder:s,zIndex:c,mod:u,...d}=_(`AppShellHeader`,null,e),f=Oa(),p=me(d.id);if(f.disabled)return null;let m=f.resize?.header.enabled??!1,h=f.getStyles(`header`,{className:ne({[Gt.classNames.zeroRight]:f.offsetScrollbars},n),classNames:t,styles:i,style:r});if(!m)return(0,O.jsx)(l,{component:`header`,mod:[{"with-border":s??f.withBorder},u],...h,...d,__vars:{"--app-shell-header-z-index":(c??f.zIndex)?.toString()}});let{children:g,dangerouslySetInnerHTML:v,...y}=d;return(0,O.jsxs)(l,{component:`header`,mod:[{"with-border":s??f.withBorder},u],...h,...y,__vars:{"--app-shell-header-z-index":(c??f.zIndex)?.toString()},id:p,children:[v?(0,O.jsx)(`div`,{style:{display:`contents`},dangerouslySetInnerHTML:v}):g,(0,O.jsx)(Ba,{section:`header`,sectionId:p})]})});Wa.classes=Va,Wa.displayName=`@mantine/core/AppShellHeader`;var Ga=x(e=>{let{classNames:t,className:n,style:r,styles:i,vars:a,...o}=_(`AppShellMain`,null,e),s=Oa();return(0,O.jsx)(l,{component:`main`,...s.getStyles(`main`,{className:n,style:r,classNames:t,styles:i}),...o})});Ga.classes=Va,Ga.displayName=`@mantine/core/AppShellMain`;var Ka=x(e=>{let{classNames:t,className:n,style:r,styles:i,unstyled:a,vars:o,withBorder:s,zIndex:c,mod:u,...d}=_(`AppShellNavbar`,null,e),f=Oa(),p=me(d.id);if(f.disabled)return null;let m=f.resize?.navbar.enabled??!1,h=f.getStyles(`navbar`,{className:n,classNames:t,styles:i,style:r});if(!m)return(0,O.jsx)(l,{component:`nav`,mod:[{"with-border":s??f.withBorder},u],...h,...d,__vars:{"--app-shell-navbar-z-index":`calc(${c??f.zIndex} + 1)`}});let{children:g,dangerouslySetInnerHTML:v,...y}=d;return(0,O.jsxs)(l,{component:`nav`,mod:[{"with-border":s??f.withBorder},u],...h,...y,__vars:{"--app-shell-navbar-z-index":`calc(${c??f.zIndex} + 1)`},id:p,children:[v?(0,O.jsx)(`div`,{style:{display:`contents`},dangerouslySetInnerHTML:v}):g,(0,O.jsx)(Ba,{section:`navbar`,sectionId:p})]})});Ka.classes=Va,Ka.displayName=`@mantine/core/AppShellNavbar`;var qa=Se(e=>{let{classNames:t,className:n,style:r,styles:i,vars:a,grow:o,mod:s,...c}=_(`AppShellSection`,null,e),u=Oa();return(0,O.jsx)(l,{mod:[{grow:o},s],...u.getStyles(`section`,{className:n,style:r,classNames:t,styles:i}),...c})});qa.classes=Va,qa.displayName=`@mantine/core/AppShellSection`;function Ja(e){return typeof e==`object`?e.base:e}function Ya(e,t){return`min(${T(e)}, ${t===`horizontal`?`100vw`:`100dvh`})`}function Xa(e){let t=typeof e==`object`&&!!e&&e.base!==void 0&&Object.keys(e).length===1;return typeof e==`number`||typeof e==`string`||t}function Za(e){return!(typeof e!=`object`||!e||Object.keys(e).length===1&&`base`in e)}function Qa({baseStyles:e,minMediaStyles:t,maxMediaStyles:n,aside:r,theme:i,mode:a,resizedSize:o,resizable:s}){let c=r?.width,l=`translateX(var(--app-shell-aside-width))`,u=`translateX(calc(var(--app-shell-aside-width) * -1))`;if(r?.breakpoint!==void 0&&!r?.collapsed?.mobile&&(n[r?.breakpoint]=n[r?.breakpoint]||{},a===`fixed`?(n[r?.breakpoint][`--app-shell-aside-width`]=`100%`,n[r?.breakpoint][`--app-shell-aside-offset`]=`0px`):(n[r?.breakpoint][`--app-shell-aside-width`]=`0px`,n[r?.breakpoint][`--app-shell-aside-offset`]=`0px`),s&&(n[r.breakpoint][`--app-shell-aside-resize-handle-display`]=`none`)),o!==void 0){let t=Ya(o,`horizontal`);e[`--app-shell-aside-width`]=t,e[`--app-shell-aside-offset`]=t,a===`static`&&(e[`--app-shell-aside-grid-width`]=t)}else{if(Xa(c)){let t=T(Ja(c));e[`--app-shell-aside-width`]=t,e[`--app-shell-aside-offset`]=t}Za(c)&&(c.base!==void 0&&(e[`--app-shell-aside-width`]=T(c.base),e[`--app-shell-aside-offset`]=T(c.base)),le(c).forEach(e=>{e!==`base`&&(t[e]=t[e]||{},t[e][`--app-shell-aside-width`]=T(c[e]),t[e][`--app-shell-aside-offset`]=T(c[e]))}))}if(r?.breakpoint!==void 0&&a===`static`&&(t[r.breakpoint]=t[r.breakpoint]||{},t[r.breakpoint][`--app-shell-aside-position`]=`sticky`,t[r.breakpoint][`--app-shell-aside-grid-row`]=`2`,t[r.breakpoint][`--app-shell-aside-grid-column`]=`3`,t[r.breakpoint][`--app-shell-main-column-end`]=`3`),r?.collapsed?.desktop){let e=r.breakpoint;t[e]=t[e]||{},t[e][`--app-shell-aside-transform`]=l,t[e][`--app-shell-aside-transform-rtl`]=u,a===`fixed`?t[e][`--app-shell-aside-offset`]=`0px !important`:(t[e][`--app-shell-aside-width`]=`0px`,t[e][`--app-shell-aside-display`]=`none`,t[e][`--app-shell-main-column-end`]=`-1`),t[e][`--app-shell-aside-scroll-locked-visibility`]=`hidden`,s&&(t[e][`--app-shell-aside-resize-handle-display`]=`none`)}if(r?.collapsed?.mobile){let e=ct(r.breakpoint,i.breakpoints)-.1;n[e]=n[e]||{},a===`fixed`?(n[e][`--app-shell-aside-width`]=`100%`,n[e][`--app-shell-aside-offset`]=`0px`):n[e][`--app-shell-aside-width`]=`0px`,n[e][`--app-shell-aside-transform`]=l,n[e][`--app-shell-aside-transform-rtl`]=u,n[e][`--app-shell-aside-scroll-locked-visibility`]=`hidden`,s&&(n[e][`--app-shell-aside-resize-handle-display`]=`none`)}}function $a({baseStyles:e,minMediaStyles:t,footer:n,mode:r,resizedSize:i,resizable:a}){let o=n?.height,s=r===`static`?!0:n?.offset??!0;if(r===`static`&&n&&(e[`--app-shell-footer-position`]=`sticky`,e[`--app-shell-footer-grid-column`]=`1 / -1`,e[`--app-shell-footer-grid-row`]=`3`),i!==void 0){let t=Ya(i,`vertical`);e[`--app-shell-footer-height`]=t,s&&(e[`--app-shell-footer-offset`]=t)}else{if(Xa(o)){let t=T(Ja(o));e[`--app-shell-footer-height`]=t,s&&(e[`--app-shell-footer-offset`]=t)}Za(o)&&(o.base!==void 0&&(e[`--app-shell-footer-height`]=T(o.base),s&&(e[`--app-shell-footer-offset`]=T(o.base))),le(o).forEach(e=>{e!==`base`&&(t[e]=t[e]||{},t[e][`--app-shell-footer-height`]=T(o[e]),s&&(t[e][`--app-shell-footer-offset`]=T(o[e])))}))}n?.collapsed&&(e[`--app-shell-footer-transform`]=`translateY(var(--app-shell-footer-height))`,r===`fixed`&&(e[`--app-shell-footer-offset`]=`0px !important`),a&&(e[`--app-shell-footer-resize-handle-display`]=`none`))}function eo({baseStyles:e,minMediaStyles:t,header:n,mode:r,resizedSize:i,resizable:a}){let o=n?.height,s=r===`static`?!0:n?.offset??!0;if(r===`static`&&n&&(e[`--app-shell-header-position`]=`sticky`,e[`--app-shell-header-grid-column`]=`1 / -1`,e[`--app-shell-header-grid-row`]=`1`),i!==void 0){let t=Ya(i,`vertical`);e[`--app-shell-header-height`]=t,s&&(e[`--app-shell-header-offset`]=t)}else{if(Xa(o)){let t=T(Ja(o));e[`--app-shell-header-height`]=t,s&&(e[`--app-shell-header-offset`]=t)}Za(o)&&(o.base!==void 0&&(e[`--app-shell-header-height`]=T(o.base),s&&(e[`--app-shell-header-offset`]=T(o.base))),le(o).forEach(e=>{e!==`base`&&(t[e]=t[e]||{},t[e][`--app-shell-header-height`]=T(o[e]),s&&(t[e][`--app-shell-header-offset`]=T(o[e])))}))}n?.collapsed&&(e[`--app-shell-header-transform`]=`translateY(calc(var(--app-shell-header-height) * -1))`,r===`fixed`&&(e[`--app-shell-header-offset`]=`0px !important`),a&&(e[`--app-shell-header-resize-handle-display`]=`none`))}function to({baseStyles:e,minMediaStyles:t,maxMediaStyles:n,navbar:r,theme:i,mode:a,resizedSize:o,resizable:s}){let c=r?.width,l=`translateX(calc(var(--app-shell-navbar-width) * -1))`,u=`translateX(var(--app-shell-navbar-width))`;if(r?.breakpoint!==void 0&&!r?.collapsed?.mobile&&(n[r?.breakpoint]=n[r?.breakpoint]||{},n[r?.breakpoint][`--app-shell-navbar-offset`]=`0px`,n[r?.breakpoint][`--app-shell-navbar-width`]=`100%`,a===`static`&&(n[r?.breakpoint][`--app-shell-navbar-grid-width`]=`0px`),s&&(n[r.breakpoint][`--app-shell-navbar-resize-handle-display`]=`none`)),o!==void 0){let t=Ya(o,`horizontal`);e[`--app-shell-navbar-width`]=t,e[`--app-shell-navbar-offset`]=t,a===`static`&&(e[`--app-shell-navbar-grid-width`]=t)}else{if(Xa(c)){let t=T(Ja(c));e[`--app-shell-navbar-width`]=t,e[`--app-shell-navbar-offset`]=t,a===`static`&&(e[`--app-shell-navbar-grid-width`]=t)}Za(c)&&(c.base!==void 0&&(e[`--app-shell-navbar-width`]=T(c.base),e[`--app-shell-navbar-offset`]=T(c.base),a===`static`&&(e[`--app-shell-navbar-grid-width`]=T(c.base))),le(c).forEach(e=>{e!==`base`&&(t[e]=t[e]||{},t[e][`--app-shell-navbar-width`]=T(c[e]),t[e][`--app-shell-navbar-offset`]=T(c[e]),a===`static`&&(t[e][`--app-shell-navbar-grid-width`]=T(c[e])))}))}if(r?.breakpoint!==void 0&&a===`static`&&(t[r.breakpoint]=t[r.breakpoint]||{},t[r.breakpoint][`--app-shell-navbar-position`]=`sticky`,t[r.breakpoint][`--app-shell-navbar-grid-row`]=`2`,t[r.breakpoint][`--app-shell-navbar-grid-column`]=`1`,t[r.breakpoint][`--app-shell-main-column-start`]=`2`),r?.collapsed?.desktop){let e=r.breakpoint;t[e]=t[e]||{},t[e][`--app-shell-navbar-transform`]=l,t[e][`--app-shell-navbar-transform-rtl`]=u,a===`fixed`?t[e][`--app-shell-navbar-offset`]=`0px !important`:(t[e][`--app-shell-navbar-width`]=`0px`,t[e][`--app-shell-navbar-display`]=`none`,t[e][`--app-shell-main-column-start`]=`1`),s&&(t[e][`--app-shell-navbar-resize-handle-display`]=`none`)}if(r?.collapsed?.mobile){let e=ct(r.breakpoint,i.breakpoints)-.1;n[e]=n[e]||{},n[e][`--app-shell-navbar-width`]=`100%`,n[e][`--app-shell-navbar-offset`]=`0px`,a===`static`&&(n[e][`--app-shell-navbar-grid-width`]=`0px`),n[e][`--app-shell-navbar-transform`]=l,n[e][`--app-shell-navbar-transform-rtl`]=u,s&&(n[e][`--app-shell-navbar-resize-handle-display`]=`none`)}}function no(e){return Number(e)===0?`0px`:xe(e)}function ro({padding:e,baseStyles:t,minMediaStyles:n}){Xa(e)&&(t[`--app-shell-padding`]=no(Ja(e))),Za(e)&&(e.base&&(t[`--app-shell-padding`]=no(e.base)),le(e).forEach(t=>{t!==`base`&&(n[t]=n[t]||{},n[t][`--app-shell-padding`]=no(e[t]))}))}function io({navbar:e,header:t,footer:n,aside:r,padding:i,theme:a,mode:o,resize:s}){let c={},l={},u={};o===`static`&&(u[`--app-shell-main-grid-column`]=`1 / -1`,u[`--app-shell-main-grid-row`]=`2`),to({baseStyles:u,minMediaStyles:c,maxMediaStyles:l,navbar:e,theme:a,mode:o,resizedSize:s?.sizes.navbar,resizable:s?.enabled.navbar}),Qa({baseStyles:u,minMediaStyles:c,maxMediaStyles:l,aside:r,theme:a,mode:o,resizedSize:s?.sizes.aside,resizable:s?.enabled.aside}),eo({baseStyles:u,minMediaStyles:c,header:t,mode:o,resizedSize:s?.sizes.header,resizable:s?.enabled.header}),$a({baseStyles:u,minMediaStyles:c,footer:n,mode:o,resizedSize:s?.sizes.footer,resizable:s?.enabled.footer}),ro({baseStyles:u,minMediaStyles:c,padding:i});let d=gt(le(c),a.breakpoints).map(e=>({query:`(min-width: ${ge(e.px)})`,styles:c[e.value]})),f=gt(le(l),a.breakpoints).map(e=>({query:`(max-width: ${ge(e.px)})`,styles:l[e.value]}));return{baseStyles:u,media:[...d,...f]}}function ao({navbar:e,header:t,aside:n,footer:r,padding:i,mode:a,selector:o,resize:s}){let c=y(),l=g(),{media:u,baseStyles:d}=io({navbar:e,header:t,footer:r,aside:n,padding:i,theme:c,mode:a,resize:s});return(0,O.jsx)(fe,{media:u,styles:d,selector:o||l.cssVariablesSelector})}function oo(e){return e>=128||e===45||e===95||e>=48&&e<=57||e>=65&&e<=90||e>=97&&e<=122}function so(e){return e>=48&&e<=57}function co(e){let t=``;for(let n=0;n=1&&r<=31||r===127||n===0&&so(r)||n===1&&so(r)&&e.charCodeAt(0)===45?t+=`\\${r.toString(16)} `:n===0&&e.length===1&&r===45?t+=`\\${i}`:oo(r)?t+=i:t+=`\\${i}`}return t}function lo({transitionDuration:e,disabled:t,resizeKey:n}){let[r,i]=(0,D.useState)(!0),[a,o]=(0,D.useState)({key:n,active:!1}),s=(0,D.useRef)(-1),c=(0,D.useRef)(-1);return a.key!==n&&o({key:n,active:!0}),(0,D.useEffect)(()=>{if(!a.active)return;let t=window.setTimeout(()=>(0,D.startTransition)(()=>{o(e=>({...e,active:!1}))}),e||0);return()=>window.clearTimeout(t)},[a,e]),Kt(`resize`,()=>{i(!0),clearTimeout(s.current),s.current=window.setTimeout(()=>(0,D.startTransition)(()=>{i(!1)}),200)}),de(()=>{i(!0),clearTimeout(c.current),c.current=window.setTimeout(()=>(0,D.startTransition)(()=>{i(!1)}),e||0)},[t,e]),r||a.active}var uo={withBorder:!0,padding:0,transitionDuration:200,transitionTimingFunction:`ease`,zIndex:Lt(`app`),mode:`fixed`},fo=C((e,{transitionDuration:t,transitionTimingFunction:n})=>({root:{"--app-shell-transition-duration":`${t}ms`,"--app-shell-transition-timing-function":n,"--app-shell-resize-handle-size":void 0}})),po=x(e=>{let t=_(`AppShell`,uo,e),{classNames:n,className:r,style:i,styles:a,unstyled:o,vars:c,navbar:u,withBorder:d,padding:f,transitionDuration:p,transitionTimingFunction:m,header:h,zIndex:g,layout:v,disabled:y,aside:b,footer:ee,offsetScrollbars:x=!0,mode:S,mod:te,attributes:C,id:ne,resize:re,ref:ie,...w}=t,ae=s({name:`AppShell`,classes:Va,props:t,className:r,style:i,classNames:n,styles:a,unstyled:o,attributes:C,vars:c,varsResolver:fo}),oe=lo({disabled:y,transitionDuration:p,resizeKey:re?Ma.map(e=>re.sizes[e]).join(`|`):void 0}),se=me(ne),ce=(0,D.useRef)(null),le=re?{sizes:re.sizes,enabled:{navbar:re.navbar.enabled,aside:re.aside.enabled,header:re.header.enabled,footer:re.footer.enabled}}:void 0,ue={navbar:!0,aside:!0,header:S===`static`?!0:h?.offset??!0,footer:S===`static`?!0:ee?.offset??!0};return(0,O.jsxs)(Da,{value:{getStyles:ae,withBorder:d,zIndex:g,disabled:y,offsetScrollbars:x,mode:S,resize:re,rootRef:ce,resizeOffsets:ue},children:[(0,O.jsx)(ao,{navbar:u,header:h,aside:b,footer:ee,padding:f,mode:S,resize:le,selector:re||S===`static`?`#${co(se)}`:void 0}),(0,O.jsx)(l,{...ae(`root`),id:se,ref:ye(ie,ce),mod:[{resizing:oe||re?.activeSection!=null,layout:v,disabled:y,mode:S},te],...w})]})});po.classes=Va,po.varsResolver=fo,po.displayName=`@mantine/core/AppShell`,po.Navbar=Ka,po.Header=Wa,po.Main=Ga,po.Aside=Ha,po.Footer=Ua,po.Section=qa;var mo={group:`m_11def92b`,root:`m_f85678b6`,image:`m_11f8ac07`,placeholder:`m_104cd71f`},ho=(0,D.createContext)({withinGroup:!1}),go=C((e,{spacing:t})=>({group:{"--ag-spacing":xe(t)}})),_o=x(e=>{let t=_(`AvatarGroup`,null,e),{classNames:n,className:r,style:i,styles:a,unstyled:o,vars:c,spacing:u,attributes:d,...f}=t,p=s({name:`AvatarGroup`,classes:mo,props:t,className:r,style:i,classNames:n,styles:a,unstyled:o,attributes:d,vars:c,varsResolver:go,rootSelector:`group`});return(0,O.jsx)(ho,{value:{withinGroup:!0},children:(0,O.jsx)(l,{...p(`group`),...f})})});_o.classes=mo,_o.varsResolver=go,_o.displayName=`@mantine/core/AvatarGroup`;function vo(e){return(0,O.jsx)(`svg`,{...e,"data-avatar-placeholder-icon":!0,viewBox:`0 0 15 15`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`,children:(0,O.jsx)(`path`,{d:`M0.877014 7.49988C0.877014 3.84219 3.84216 0.877045 7.49985 0.877045C11.1575 0.877045 14.1227 3.84219 14.1227 7.49988C14.1227 11.1575 11.1575 14.1227 7.49985 14.1227C3.84216 14.1227 0.877014 11.1575 0.877014 7.49988ZM7.49985 1.82704C4.36683 1.82704 1.82701 4.36686 1.82701 7.49988C1.82701 8.97196 2.38774 10.3131 3.30727 11.3213C4.19074 9.94119 5.73818 9.02499 7.50023 9.02499C9.26206 9.02499 10.8093 9.94097 11.6929 11.3208C12.6121 10.3127 13.1727 8.97172 13.1727 7.49988C13.1727 4.36686 10.6328 1.82704 7.49985 1.82704ZM10.9818 11.9787C10.2839 10.7795 8.9857 9.97499 7.50023 9.97499C6.01458 9.97499 4.71624 10.7797 4.01845 11.9791C4.97952 12.7272 6.18765 13.1727 7.49985 13.1727C8.81227 13.1727 10.0206 12.727 10.9818 11.9787ZM5.14999 6.50487C5.14999 5.207 6.20212 4.15487 7.49999 4.15487C8.79786 4.15487 9.84999 5.207 9.84999 6.50487C9.84999 7.80274 8.79786 8.85487 7.49999 8.85487C6.20212 8.85487 5.14999 7.80274 5.14999 6.50487ZM7.49999 5.10487C6.72679 5.10487 6.09999 5.73167 6.09999 6.50487C6.09999 7.27807 6.72679 7.90487 7.49999 7.90487C8.27319 7.90487 8.89999 7.27807 8.89999 6.50487C8.89999 5.73167 8.27319 5.10487 7.49999 5.10487Z`,fill:`currentColor`,fillRule:`evenodd`,clipRule:`evenodd`})})}function yo(e){let t=0;for(let n=0;ne[0]).slice(0,t).join(``).toUpperCase()}var Co=C((e,{size:t,radius:n,variant:r,gradient:i,color:a,autoContrast:o,name:s,allowedInitialsColors:c})=>{let l=a===`initials`&&typeof s==`string`?xo(s,c):a,u=e.variantColorResolver({color:l||`gray`,theme:e,gradient:i,variant:r||`light`,autoContrast:o});return{root:{"--avatar-size":pe(t,`avatar-size`),"--avatar-radius":n===void 0?void 0:_e(n),"--avatar-bg":l||r?u.background:void 0,"--avatar-color":l||r?u.color:void 0,"--avatar-bd":l||r?u.border:void 0}}}),wo=Se(e=>{let t=_(`Avatar`,null,e),{classNames:n,className:r,style:i,styles:a,unstyled:o,vars:c,src:u,alt:d,radius:f,color:p,gradient:m,imageProps:h,children:g,autoContrast:v,mod:y,name:b,allowedInitialsColors:ee,attributes:x,...S}=t,te=(0,D.use)(ho),[C,ne]=(0,D.useState)(!u),re=s({name:`Avatar`,props:t,classes:mo,className:r,style:i,classNames:n,styles:a,unstyled:o,attributes:x,vars:c,varsResolver:Co});return(0,D.useEffect)(()=>ne(!u),[u]),(0,O.jsx)(l,{...re(`root`),mod:[{"within-group":te.withinGroup},y],...S,children:C||!u?(0,O.jsx)(`span`,{...re(`placeholder`),title:d,children:g||typeof b==`string`&&So(b)||(0,O.jsx)(vo,{})}):(0,O.jsx)(`img`,{...h,...re(`image`),src:u,alt:d,onError:e=>{ne(!0),h?.onError?.(e)}})})});wo.classes=mo,wo.varsResolver=Co,wo.displayName=`@mantine/core/Avatar`,wo.Group=_o;var To={root:`m_fea6bf1a`,burger:`m_d4fb9cad`},Eo=C((e,{color:t,size:n,lineSize:r,transitionDuration:i,transitionTimingFunction:a})=>({root:{"--burger-color":t?h(t,e):void 0,"--burger-size":pe(n,`burger-size`),"--burger-line-size":r?T(r):void 0,"--burger-transition-duration":i===void 0?void 0:`${i}ms`,"--burger-transition-timing-function":a}})),Do=x(e=>{let t=_(`Burger`,null,e),{classNames:n,className:r,style:i,styles:a,unstyled:o,vars:c,opened:u,children:d,transitionDuration:f,transitionTimingFunction:p,lineSize:m,attributes:h,...g}=t,v=s({name:`Burger`,classes:To,props:t,className:r,style:i,classNames:n,styles:a,unstyled:o,attributes:h,vars:c,varsResolver:Eo});return(0,O.jsxs)(ee,{...v(`root`),...g,children:[(0,O.jsx)(l,{mod:[`reduce-motion`,{opened:u}],...v(`burger`)}),d]})});Do.classes=To,Do.varsResolver=Eo,Do.displayName=`@mantine/core/Burger`;var Oo=[];for(let e=0;e<256;++e)Oo.push((e+256).toString(16).slice(1));function ko(e,t=0){return(Oo[e[t+0]]+Oo[e[t+1]]+Oo[e[t+2]]+Oo[e[t+3]]+`-`+Oo[e[t+4]]+Oo[e[t+5]]+`-`+Oo[e[t+6]]+Oo[e[t+7]]+`-`+Oo[e[t+8]]+Oo[e[t+9]]+`-`+Oo[e[t+10]]+Oo[e[t+11]]+Oo[e[t+12]]+Oo[e[t+13]]+Oo[e[t+14]]+Oo[e[t+15]]).toLowerCase()}var Ao,jo=new Uint8Array(16);function Mo(){if(!Ao){if(typeof crypto>`u`||!crypto.getRandomValues)throw Error(`crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported`);Ao=crypto.getRandomValues.bind(crypto)}return Ao(jo)}var No={randomUUID:typeof crypto<`u`&&crypto.randomUUID&&crypto.randomUUID.bind(crypto)};function Po(e,t,n){if(No.randomUUID&&!t&&!e)return No.randomUUID();e||={};let r=e.random??e.rng?.()??Mo();if(r.length<16)throw Error(`Random bytes length must be >= 16`);if(r[6]=r[6]&15|64,r[8]=r[8]&63|128,t){if(n||=0,n<0||n+16>t.length)throw RangeError(`UUID byte range ${n}:${n+15} is out of buffer bounds`);for(let e=0;e<16;++e)t[n+e]=r[e];return t}return ko(r)}var Fo=wn(),A=function(e){return e.TEXT_MESSAGE_START=`TEXT_MESSAGE_START`,e.TEXT_MESSAGE_CONTENT=`TEXT_MESSAGE_CONTENT`,e.TEXT_MESSAGE_END=`TEXT_MESSAGE_END`,e.TEXT_MESSAGE_CHUNK=`TEXT_MESSAGE_CHUNK`,e.TOOL_CALL_START=`TOOL_CALL_START`,e.TOOL_CALL_ARGS=`TOOL_CALL_ARGS`,e.TOOL_CALL_END=`TOOL_CALL_END`,e.TOOL_CALL_CHUNK=`TOOL_CALL_CHUNK`,e.TOOL_CALL_RESULT=`TOOL_CALL_RESULT`,e.STATE_SNAPSHOT=`STATE_SNAPSHOT`,e.STATE_DELTA=`STATE_DELTA`,e.MESSAGES_SNAPSHOT=`MESSAGES_SNAPSHOT`,e.ACTIVITY_SNAPSHOT=`ACTIVITY_SNAPSHOT`,e.ACTIVITY_DELTA=`ACTIVITY_DELTA`,e.RAW=`RAW`,e.CUSTOM=`CUSTOM`,e.RUN_STARTED=`RUN_STARTED`,e.RUN_FINISHED=`RUN_FINISHED`,e.RUN_ERROR=`RUN_ERROR`,e.STEP_STARTED=`STEP_STARTED`,e.STEP_FINISHED=`STEP_FINISHED`,e.REASONING_START=`REASONING_START`,e.REASONING_MESSAGE_START=`REASONING_MESSAGE_START`,e.REASONING_MESSAGE_CONTENT=`REASONING_MESSAGE_CONTENT`,e.REASONING_MESSAGE_END=`REASONING_MESSAGE_END`,e.REASONING_MESSAGE_CHUNK=`REASONING_MESSAGE_CHUNK`,e.REASONING_END=`REASONING_END`,e.REASONING_ENCRYPTED_VALUE=`REASONING_ENCRYPTED_VALUE`,e.SUBAGENT_STARTED=`SUBAGENT_STARTED`,e.SUBAGENT_FINISHED=`SUBAGENT_FINISHED`,e.SUBAGENT_ERROR=`SUBAGENT_ERROR`,e}({}),Io={TextMessageStartEvent:{optional:[`timestamp`,`rawEvent`,`metadata`,`subagentRunId`,`role`,`name`],fields:{}},TextMessageContentEvent:{optional:[`timestamp`,`rawEvent`,`metadata`,`subagentRunId`],fields:{}},TextMessageEndEvent:{optional:[`timestamp`,`rawEvent`,`metadata`,`subagentRunId`],fields:{}},TextMessageChunkEvent:{optional:[`timestamp`,`rawEvent`,`metadata`,`subagentRunId`,`messageId`,`role`,`delta`,`name`],fields:{}},ToolCallStartEvent:{optional:[`timestamp`,`rawEvent`,`metadata`,`subagentRunId`,`parentMessageId`],fields:{}},ToolCallArgsEvent:{optional:[`timestamp`,`rawEvent`,`metadata`,`subagentRunId`],fields:{}},ToolCallEndEvent:{optional:[`timestamp`,`rawEvent`,`metadata`,`subagentRunId`],fields:{}},ToolCallChunkEvent:{optional:[`timestamp`,`rawEvent`,`metadata`,`subagentRunId`,`toolCallId`,`toolCallName`,`parentMessageId`,`delta`],fields:{}},TextPart:{optional:[`id`,`metadata`],fields:{}},DataSource:{optional:[],fields:{}},UrlSource:{optional:[`mimeType`],fields:{}},FileSource:{optional:[`provider`,`mimeType`],fields:{}},PartSource:{discriminator:`type`,variants:{data:`DataSource`,url:`UrlSource`,file:`FileSource`}},ImagePart:{optional:[`id`,`metadata`],fields:{source:`PartSource`}},AudioPart:{optional:[`id`,`metadata`],fields:{source:`PartSource`}},VideoPart:{optional:[`id`,`metadata`],fields:{source:`PartSource`}},DocumentPart:{optional:[`id`,`metadata`],fields:{source:`PartSource`}},ContentPart:{discriminator:`type`,variants:{text:`TextPart`,image:`ImagePart`,audio:`AudioPart`,video:`VideoPart`,document:`DocumentPart`}},ToolCallResultEvent:{optional:[`timestamp`,`rawEvent`,`metadata`,`subagentRunId`,`role`],fields:{content:{array:`ContentPart`}}},StateSnapshotEvent:{optional:[`timestamp`,`rawEvent`,`metadata`,`subagentRunId`],fields:{}},AddOperation:{optional:[],fields:{}},RemoveOperation:{optional:[],fields:{}},ReplaceOperation:{optional:[],fields:{}},MoveOperation:{optional:[],fields:{}},CopyOperation:{optional:[],fields:{}},TestOperation:{optional:[],fields:{}},JsonPatchOperation:{discriminator:`op`,variants:{add:`AddOperation`,remove:`RemoveOperation`,replace:`ReplaceOperation`,move:`MoveOperation`,copy:`CopyOperation`,test:`TestOperation`}},StateDeltaEvent:{optional:[`timestamp`,`rawEvent`,`metadata`,`subagentRunId`],fields:{delta:{array:`JsonPatchOperation`}}},DeveloperMessage:{optional:[`subagentRunId`,`name`,`encryptedValue`,`metadata`],fields:{}},SystemMessage:{optional:[`subagentRunId`,`name`,`encryptedValue`,`metadata`],fields:{}},FunctionCall:{optional:[],fields:{}},ToolCall:{optional:[`encryptedValue`,`metadata`],fields:{function:`FunctionCall`}},AssistantMessage:{optional:[`subagentRunId`,`name`,`encryptedValue`,`metadata`,`content`,`toolCalls`],fields:{toolCalls:{array:`ToolCall`}}},UserMessage:{optional:[`subagentRunId`,`name`,`encryptedValue`,`metadata`],fields:{content:{array:`ContentPart`}}},ToolMessage:{optional:[`subagentRunId`,`error`,`encryptedValue`,`metadata`],fields:{content:{array:`ContentPart`}}},ActivityMessage:{optional:[`subagentRunId`,`metadata`],fields:{}},ReasoningMessage:{optional:[`subagentRunId`,`encryptedValue`,`metadata`],fields:{}},Message:{discriminator:`role`,variants:{developer:`DeveloperMessage`,system:`SystemMessage`,assistant:`AssistantMessage`,user:`UserMessage`,tool:`ToolMessage`,activity:`ActivityMessage`,reasoning:`ReasoningMessage`}},MessagesSnapshotEvent:{optional:[`timestamp`,`rawEvent`,`metadata`],fields:{messages:{array:`Message`}}},ActivitySnapshotEvent:{optional:[`timestamp`,`rawEvent`,`metadata`,`subagentRunId`,`replace`],fields:{}},ActivityDeltaEvent:{optional:[`timestamp`,`rawEvent`,`metadata`,`subagentRunId`],fields:{patch:{array:`JsonPatchOperation`}}},RawEvent:{optional:[`timestamp`,`rawEvent`,`metadata`,`subagentRunId`,`source`],fields:{}},CustomEvent:{optional:[`timestamp`,`rawEvent`,`metadata`,`subagentRunId`],fields:{}},Tool:{optional:[`parameters`,`metadata`],fields:{}},Context:{optional:[],fields:{}},ResumeEntry:{optional:[`payload`,`metadata`],fields:{}},RunAgentInput:{optional:[`protocolVersion`,`parentRunId`,`state`,`tools`,`context`,`forwardedProps`,`resume`],fields:{messages:{array:`Message`},tools:{array:`Tool`},context:{array:`Context`},resume:{array:`ResumeEntry`}}},RunStartedEvent:{optional:[`timestamp`,`rawEvent`,`metadata`,`protocolVersion`,`parentRunId`,`input`],fields:{input:`RunAgentInput`}},RunFinishedSuccessOutcome:{optional:[`pendingToolCallIds`],fields:{}},Interrupt:{optional:[`subagentRunId`,`message`,`toolCallId`,`responseSchema`,`expiresAt`,`metadata`],fields:{}},RunFinishedInterruptOutcome:{optional:[],fields:{interrupts:{array:`Interrupt`}}},RunFinishedCancelledOutcome:{optional:[],fields:{}},RunFinishedOutcome:{discriminator:`type`,variants:{success:`RunFinishedSuccessOutcome`,interrupt:`RunFinishedInterruptOutcome`,cancelled:`RunFinishedCancelledOutcome`}},TokenUsage:{optional:[`provider`,`model`,`inputTokens`,`outputTokens`,`totalTokens`,`reasoningTokens`,`cachedInputTokens`,`cacheWriteInputTokens`],fields:{}},RunFinishedEvent:{optional:[`timestamp`,`rawEvent`,`metadata`,`result`,`outcome`,`usage`],fields:{outcome:`RunFinishedOutcome`,usage:{array:`TokenUsage`}}},RunErrorEvent:{optional:[`timestamp`,`rawEvent`,`metadata`,`code`,`usage`],fields:{usage:{array:`TokenUsage`}}},StepStartedEvent:{optional:[`timestamp`,`rawEvent`,`metadata`,`subagentRunId`],fields:{}},StepFinishedEvent:{optional:[`timestamp`,`rawEvent`,`metadata`,`subagentRunId`],fields:{}},ReasoningStartEvent:{optional:[`timestamp`,`rawEvent`,`metadata`,`subagentRunId`],fields:{}},ReasoningMessageStartEvent:{optional:[`timestamp`,`rawEvent`,`metadata`,`subagentRunId`],fields:{}},ReasoningMessageContentEvent:{optional:[`timestamp`,`rawEvent`,`metadata`,`subagentRunId`],fields:{}},ReasoningMessageEndEvent:{optional:[`timestamp`,`rawEvent`,`metadata`,`subagentRunId`],fields:{}},ReasoningMessageChunkEvent:{optional:[`timestamp`,`rawEvent`,`metadata`,`subagentRunId`,`messageId`,`delta`],fields:{}},ReasoningEndEvent:{optional:[`timestamp`,`rawEvent`,`metadata`,`subagentRunId`],fields:{}},ReasoningEncryptedValueEvent:{optional:[`timestamp`,`rawEvent`,`metadata`,`subagentRunId`],fields:{}},SubagentStartedEvent:{optional:[`timestamp`,`rawEvent`,`metadata`,`description`,`parentSubagentRunId`,`parentToolCallId`,`parentMessageId`],fields:{}},SubagentFinishedSuccessOutcome:{optional:[],fields:{}},SubagentFinishedSuspendedOutcome:{optional:[`interruptIds`],fields:{}},SubagentFinishedOutcome:{discriminator:`type`,variants:{success:`SubagentFinishedSuccessOutcome`,suspended:`SubagentFinishedSuspendedOutcome`}},SubagentFinishedEvent:{optional:[`timestamp`,`rawEvent`,`metadata`,`result`,`outcome`],fields:{outcome:`SubagentFinishedOutcome`}},SubagentErrorEvent:{optional:[`timestamp`,`rawEvent`,`metadata`,`code`],fields:{}},Event:{discriminator:`type`,variants:{TEXT_MESSAGE_START:`TextMessageStartEvent`,TEXT_MESSAGE_CONTENT:`TextMessageContentEvent`,TEXT_MESSAGE_END:`TextMessageEndEvent`,TEXT_MESSAGE_CHUNK:`TextMessageChunkEvent`,TOOL_CALL_START:`ToolCallStartEvent`,TOOL_CALL_ARGS:`ToolCallArgsEvent`,TOOL_CALL_END:`ToolCallEndEvent`,TOOL_CALL_CHUNK:`ToolCallChunkEvent`,TOOL_CALL_RESULT:`ToolCallResultEvent`,STATE_SNAPSHOT:`StateSnapshotEvent`,STATE_DELTA:`StateDeltaEvent`,MESSAGES_SNAPSHOT:`MessagesSnapshotEvent`,ACTIVITY_SNAPSHOT:`ActivitySnapshotEvent`,ACTIVITY_DELTA:`ActivityDeltaEvent`,RAW:`RawEvent`,CUSTOM:`CustomEvent`,RUN_STARTED:`RunStartedEvent`,RUN_FINISHED:`RunFinishedEvent`,RUN_ERROR:`RunErrorEvent`,STEP_STARTED:`StepStartedEvent`,STEP_FINISHED:`StepFinishedEvent`,REASONING_START:`ReasoningStartEvent`,REASONING_MESSAGE_START:`ReasoningMessageStartEvent`,REASONING_MESSAGE_CONTENT:`ReasoningMessageContentEvent`,REASONING_MESSAGE_END:`ReasoningMessageEndEvent`,REASONING_MESSAGE_CHUNK:`ReasoningMessageChunkEvent`,REASONING_END:`ReasoningEndEvent`,REASONING_ENCRYPTED_VALUE:`ReasoningEncryptedValueEvent`,SUBAGENT_STARTED:`SubagentStartedEvent`,SUBAGENT_FINISHED:`SubagentFinishedEvent`,SUBAGENT_ERROR:`SubagentErrorEvent`}},SubagentInfo:{optional:[`description`],fields:{}},IdentityCapabilities:{optional:[`name`,`type`,`description`,`version`,`provider`,`documentationUrl`,`metadata`],fields:{}},TransportCapabilities:{optional:[`streaming`,`websocket`,`httpBinary`,`pushNotifications`,`resumable`],fields:{}},ToolsCapabilities:{optional:[`supported`,`items`,`parallelCalls`,`clientProvided`],fields:{items:{array:`Tool`}}},OutputCapabilities:{optional:[`structuredOutput`,`supportedMimeTypes`],fields:{}},StateCapabilities:{optional:[`snapshots`,`deltas`,`memory`,`persistentState`],fields:{}},MultiAgentCapabilities:{optional:[`supported`,`delegation`,`handoffs`,`subagents`],fields:{subagents:{array:`SubagentInfo`}}},ReasoningCapabilities:{optional:[`supported`,`streaming`,`encrypted`],fields:{}},MultimodalInputCapabilities:{optional:[`image`,`audio`,`video`,`pdf`,`file`],fields:{}},MultimodalOutputCapabilities:{optional:[`image`,`audio`],fields:{}},MultimodalCapabilities:{optional:[`input`,`output`],fields:{input:`MultimodalInputCapabilities`,output:`MultimodalOutputCapabilities`}},ExecutionCapabilities:{optional:[`codeExecution`,`sandboxed`,`maxIterations`,`maxExecutionTime`],fields:{}},HumanInTheLoopCapabilities:{optional:[`supported`,`approvals`,`interventions`,`feedback`,`interrupts`,`approveWithEdits`],fields:{}},AgentCapabilities:{optional:[`identity`,`transport`,`tools`,`output`,`state`,`multiAgent`,`reasoning`,`multimodal`,`execution`,`humanInTheLoop`,`custom`],fields:{identity:`IdentityCapabilities`,transport:`TransportCapabilities`,tools:`ToolsCapabilities`,output:`OutputCapabilities`,state:`StateCapabilities`,multiAgent:`MultiAgentCapabilities`,reasoning:`ReasoningCapabilities`,multimodal:`MultimodalCapabilities`,execution:`ExecutionCapabilities`,humanInTheLoop:`HumanInTheLoopCapabilities`}}};function Lo(e,t){if(typeof t==`string`)return Lo(e,Io[t]);if(`array`in t){if(!Array.isArray(e))return e;let n=e.map(e=>Lo(e,t.array));return n.every((t,n)=>t===e[n])?e:n}if(typeof e!=`object`||!e||Array.isArray(e))return e;let n=e;if(`discriminator`in t){let r=n[t.discriminator];return typeof r==`string`&&Object.prototype.hasOwnProperty.call(t.variants,r)?Lo(e,t.variants[r]):e}let r=n;for(let e of t.optional)Object.prototype.hasOwnProperty.call(n,e)&&n[e]===null&&(r===n&&(r={...n}),delete r[e]);for(let[e,i]of Object.entries(t.fields)){if(!Object.prototype.hasOwnProperty.call(r,e))continue;let t=Lo(r[e],i);t!==r[e]&&(r===n&&(r={...n}),r[e]=t)}return r}function Ro(e,t){return Lo(e,t)}var j=class extends Error{constructor(e){super(e)}},zo=class extends j{constructor(){super(`Connect not implemented. This method is not supported by the current agent.`)}};function Bo(e,t){return t===void 0?e:e===void 0?{...t}:{...e,...t}}function Vo(e){return e===void 0?``:typeof e==`string`?e:e.filter(e=>e.type===`text`).map(e=>e.text).join(``)}function Ho(e){return Array.isArray(e)&&e.some(e=>e.type!==`text`)}var Uo=(function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])},e(t,n)};return function(t,n){e(t,n);function r(){this.constructor=t}t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}})(),Wo=Object.prototype.hasOwnProperty;function Go(e,t){return Wo.call(e,t)}function Ko(e){if(Array.isArray(e)){for(var t=Array(e.length),n=0;n=48&&r<=57){t++;continue}return!1}return!0}function Yo(e){return e.indexOf(`/`)===-1&&e.indexOf(`~`)===-1?e:e.replace(/~/g,`~0`).replace(/\//g,`~1`)}function Xo(e){return e.replace(/~1/g,`/`).replace(/~0/g,`~`)}function Zo(e){if(e===void 0)return!0;if(e){if(Array.isArray(e)){for(var t=0,n=e.length;tes,_areEquals:()=>us,applyOperation:()=>as,applyPatch:()=>os,applyReducer:()=>ss,deepClone:()=>ts,getValueByPointer:()=>is,validate:()=>ls,validator:()=>cs}),es=Qo,ts=qo,ns={add:function(e,t,n){return e[t]=this.value,{newDocument:n}},remove:function(e,t,n){var r=e[t];return delete e[t],{newDocument:n,removed:r}},replace:function(e,t,n){var r=e[t];return e[t]=this.value,{newDocument:n,removed:r}},move:function(e,t,n){var r=is(n,this.path);r&&=qo(r);var i=as(n,{op:`remove`,path:this.from}).removed;return as(n,{op:`add`,path:this.path,value:i}),{newDocument:n,removed:r}},copy:function(e,t,n){var r=is(n,this.from);return as(n,{op:`add`,path:this.path,value:qo(r)}),{newDocument:n}},test:function(e,t,n){return{newDocument:n,test:us(e[t],this.value)}},_get:function(e,t,n){return this.value=e[t],{newDocument:n}}},rs={add:function(e,t,n){return Jo(t)?e.splice(t,0,this.value):e[t]=this.value,{newDocument:n,index:t}},remove:function(e,t,n){return{newDocument:n,removed:e.splice(t,1)[0]}},replace:function(e,t,n){var r=e[t];return e[t]=this.value,{newDocument:n,removed:r}},move:ns.move,copy:ns.copy,test:ns.test,_get:ns._get};function is(e,t){if(t==``)return e;var n={op:`_get`,path:t};return as(e,n),n.value}function as(e,t,n,r,i,a){if(n===void 0&&(n=!1),r===void 0&&(r=!0),i===void 0&&(i=!0),a===void 0&&(a=0),n&&(typeof n==`function`?n(t,0,e,t.path):cs(t,0)),t.path===``){var o={newDocument:e};if(t.op===`add`)return o.newDocument=t.value,o;if(t.op===`replace`)return o.newDocument=t.value,o.removed=e,o;if(t.op===`move`||t.op===`copy`)return o.newDocument=is(e,t.from),t.op===`move`&&(o.removed=e),o;if(t.op===`test`){if(o.test=us(e,t.value),o.test===!1)throw new es(`Test operation failed`,`TEST_OPERATION_FAILED`,a,t,e);return o.newDocument=e,o}if(t.op===`remove`)return o.removed=e,o.newDocument=null,o;if(t.op===`_get`)return t.value=e,o;if(n)throw new es("Operation `op` property is not one of operations defined in RFC-6902",`OPERATION_OP_INVALID`,a,t,e);return o}r||(e=qo(e));var s=(t.path||``).split(`/`),c=e,l=1,u=s.length,d=void 0,f=void 0,p=void 0;for(p=typeof n==`function`?n:cs;;){if(f=s[l],f&&f.indexOf(`~`)!=-1&&(f=Xo(f)),i&&(f==`__proto__`||f==`prototype`&&l>0&&s[l-1]==`constructor`))throw TypeError("JSON-Patch: modifying `__proto__` or `constructor/prototype` prop is banned for security reasons, if this was on purpose, please set `banPrototypeModifications` flag false and pass it to this function. More info in fast-json-patch README");if(n&&d===void 0&&(c[f]===void 0?d=s.slice(0,l).join(`/`):l==u-1&&(d=t.path),d!==void 0&&p(t,0,e,d)),l++,Array.isArray(c)){if(f===`-`)f=c.length;else if(n&&!Jo(f))throw new es(`Expected an unsigned base-10 integer value, making the new referenced value the array element with the zero-based index`,`OPERATION_PATH_ILLEGAL_ARRAY_INDEX`,a,t,e);else Jo(f)&&(f=~~f);if(l>=u){if(n&&t.op===`add`&&f>c.length)throw new es(`The specified index MUST NOT be greater than the number of elements in the array`,`OPERATION_VALUE_OUT_OF_BOUNDS`,a,t,e);var o=rs[t.op].call(t,c,f,e);if(o.test===!1)throw new es(`Test operation failed`,`TEST_OPERATION_FAILED`,a,t,e);return o}}else if(l>=u){var o=ns[t.op].call(t,c,f,e);if(o.test===!1)throw new es(`Test operation failed`,`TEST_OPERATION_FAILED`,a,t,e);return o}if(c=c[f],n&&l0)throw new es('Operation `path` property must start with "/"',`OPERATION_PATH_INVALID`,t,e,n);if((e.op===`move`||e.op===`copy`)&&typeof e.from!=`string`)throw new es("Operation `from` property is not present (applicable in `move` and `copy` operations)",`OPERATION_FROM_REQUIRED`,t,e,n);if((e.op===`add`||e.op===`replace`||e.op===`test`)&&e.value===void 0)throw new es("Operation `value` property is not present (applicable in `add`, `replace` and `test` operations)",`OPERATION_VALUE_REQUIRED`,t,e,n);if((e.op===`add`||e.op===`replace`||e.op===`test`)&&Zo(e.value))throw new es("Operation `value` property is not present (applicable in `add`, `replace` and `test` operations)",`OPERATION_VALUE_CANNOT_CONTAIN_UNDEFINED`,t,e,n);if(n){if(e.op==`add`){var i=e.path.split(`/`).length,a=r.split(`/`).length;if(i!==a+1&&i!==a)throw new es("Cannot perform an `add` operation at the desired path",`OPERATION_PATH_CANNOT_ADD`,t,e,n)}else if(e.op===`replace`||e.op===`remove`||e.op===`_get`){if(e.path!==r)throw new es(`Cannot perform the operation at a path that does not exist`,`OPERATION_PATH_UNRESOLVABLE`,t,e,n)}else if(e.op===`move`||e.op===`copy`){var o=ls([{op:`_get`,path:e.from,value:void 0}],n);if(o&&o.name===`OPERATION_PATH_UNRESOLVABLE`)throw new es(`Cannot perform the operation from a path that does not exist`,`OPERATION_FROM_UNRESOLVABLE`,t,e,n)}}}function ls(e,t,n){try{if(!Array.isArray(e))throw new es(`Patch sequence must be an array`,`SEQUENCE_NOT_AN_ARRAY`);if(t)os(qo(t),qo(e),n||!0);else{n||=cs;for(var r=0;rSs,generate:()=>bs,observe:()=>ys,unobserve:()=>vs}),fs=new WeakMap,ps=function(){function e(e){this.observers=new Map,this.obj=e}return e}(),ms=function(){function e(e,t){this.callback=e,this.observer=t}return e}();function hs(e){return fs.get(e)}function gs(e,t){return e.observers.get(t)}function _s(e,t){e.observers.delete(t.callback)}function vs(e,t){t.unobserve()}function ys(e,t){var n=[],r,i=hs(e);if(!i)i=new ps(e),fs.set(e,i);else{var a=gs(i,t);r=a&&a.observer}if(r)return r;if(r={},i.value=qo(e),t){r.callback=t,r.next=null;var o=function(){bs(r)},s=function(){clearTimeout(r.next),r.next=setTimeout(o)};typeof window<`u`&&(window.addEventListener(`mouseup`,s),window.addEventListener(`keyup`,s),window.addEventListener(`mousedown`,s),window.addEventListener(`keydown`,s),window.addEventListener(`change`,s))}return r.patches=n,r.object=e,r.unobserve=function(){bs(r),clearTimeout(r.next),_s(i,r),typeof window<`u`&&(window.removeEventListener(`mouseup`,s),window.removeEventListener(`keyup`,s),window.removeEventListener(`mousedown`,s),window.removeEventListener(`keydown`,s),window.removeEventListener(`change`,s))},i.observers.set(t,new ms(t,r)),r}function bs(e,t){t===void 0&&(t=!1);var n=fs.get(e.object);xs(n.value,e.object,e.patches,``,t),e.patches.length&&os(n.value,e.patches);var r=e.patches;return r.length>0&&(e.patches=[],e.callback&&e.callback(r)),r}function xs(e,t,n,r,i){if(t!==e){typeof t.toJSON==`function`&&(t=t.toJSON());for(var a=Ko(t),o=Ko(e),s=!1,c=o.length-1;c>=0;c--){var l=o[c],u=e[l];if(Go(t,l)&&(t[l]!==void 0||u===void 0||Array.isArray(t)!==!1)){var d=t[l];typeof u==`object`&&u&&typeof d==`object`&&d&&Array.isArray(u)===Array.isArray(d)?xs(u,d,n,r+`/`+Yo(l),i):u!==d&&(i&&n.push({op:`test`,path:r+`/`+Yo(l),value:qo(u)}),n.push({op:`replace`,path:r+`/`+Yo(l),value:qo(d)}))}else Array.isArray(e)===Array.isArray(t)?(i&&n.push({op:`test`,path:r+`/`+Yo(l),value:qo(u)}),n.push({op:`remove`,path:r+`/`+Yo(l)}),s=!0):(i&&n.push({op:`test`,path:r,value:e}),n.push({op:`replace`,path:r,value:t}))}if(s||a.length!=o.length)for(var c=0;c0&&a[a.length-1])&&(s[0]===6||s[0]===2)){n=0;continue}if(s[0]===3&&(!a||s[1]>a[0]&&s[1]=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw TypeError(t?`Object is not iterable.`:`Symbol.iterator is not defined.`)}function ks(e,t){var n=typeof Symbol==`function`&&e[Symbol.iterator];if(!n)return e;var r=n.call(e),i,a=[],o;try{for(;(t===void 0||t-->0)&&!(i=r.next()).done;)a.push(i.value)}catch(e){o={error:e}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(o)throw o.error}}return a}function As(e,t,n){if(n||arguments.length===2)for(var r=0,i=t.length,a;r1||c(e,t)})},t&&(i[e]=t(i[e])))}function c(e,t){try{l(r[e](t))}catch(e){f(a[0][3],e)}}function l(e){e.value instanceof js?Promise.resolve(e.value.v).then(u,d):f(a[0][2],e)}function u(e){c(`next`,e)}function d(e){c(`throw`,e)}function f(e,t){e(t),a.shift(),a.length&&c(a[0][0],a[0][1])}}function Ns(e){if(!Symbol.asyncIterator)throw TypeError(`Symbol.asyncIterator is not defined.`);var t=e[Symbol.asyncIterator],n;return t?t.call(e):(e=typeof Os==`function`?Os(e):e[Symbol.iterator](),n={},r(`next`),r(`throw`),r(`return`),n[Symbol.asyncIterator]=function(){return this},n);function r(t){n[t]=e[t]&&function(n){return new Promise(function(r,a){n=e[t](n),i(r,a,n.done,n.value)})}}function i(e,t,n,r){Promise.resolve(r).then(function(t){e({value:t,done:n})},t)}}function Ps(e){return typeof e==`function`}function Fs(e){var t=e(function(e){Error.call(e),e.stack=Error().stack});return t.prototype=Object.create(Error.prototype),t.prototype.constructor=t,t}var Is=Fs(function(e){return function(t){e(this),this.message=t?t.length+` errors occurred during unsubscription: -`+t.map(function(e,t){return t+1+`) `+e.toString()}).join(` - `):``,this.name=`UnsubscriptionError`,this.errors=t}});function Ls(e,t){if(e){var n=e.indexOf(t);0<=n&&e.splice(n,1)}}var Rs=function(){function e(e){this.initialTeardown=e,this.closed=!1,this._parentage=null,this._finalizers=null}return e.prototype.unsubscribe=function(){var e,t,n,r,i;if(!this.closed){this.closed=!0;var a=this._parentage;if(a){if(this._parentage=null,Array.isArray(a))try{for(var o=Os(a),s=o.next();!s.done;s=o.next())s.value.remove(this)}catch(t){e={error:t}}finally{try{s&&!s.done&&(t=o.return)&&t.call(o)}finally{if(e)throw e.error}}else a.remove(this)}var c=this.initialTeardown;if(Ps(c))try{c()}catch(e){i=e instanceof Is?e.errors:[e]}var l=this._finalizers;if(l){this._finalizers=null;try{for(var u=Os(l),d=u.next();!d.done;d=u.next()){var f=d.value;try{Vs(f)}catch(e){i??=[],e instanceof Is?i=As(As([],ks(i)),ks(e.errors)):i.push(e)}}}catch(e){n={error:e}}finally{try{d&&!d.done&&(r=u.return)&&r.call(u)}finally{if(n)throw n.error}}}if(i)throw new Is(i)}},e.prototype.add=function(t){if(t&&t!==this){if(this.closed)Vs(t);else{if(t instanceof e){if(t.closed||t._hasParent(this))return;t._addParent(this)}(this._finalizers=this._finalizers??[]).push(t)}}},e.prototype._hasParent=function(e){var t=this._parentage;return t===e||Array.isArray(t)&&t.includes(e)},e.prototype._addParent=function(e){var t=this._parentage;this._parentage=Array.isArray(t)?(t.push(e),t):t?[t,e]:e},e.prototype._removeParent=function(e){var t=this._parentage;t===e?this._parentage=null:Array.isArray(t)&&Ls(t,e)},e.prototype.remove=function(t){var n=this._finalizers;n&&Ls(n,t),t instanceof e&&t._removeParent(this)},e.EMPTY=(function(){var t=new e;return t.closed=!0,t})(),e}(),zs=Rs.EMPTY;function Bs(e){return e instanceof Rs||e&&`closed`in e&&Ps(e.remove)&&Ps(e.add)&&Ps(e.unsubscribe)}function Vs(e){Ps(e)?e():e.unsubscribe()}var Hs={onUnhandledError:null,onStoppedNotification:null,Promise:void 0,useDeprecatedSynchronousErrorHandling:!1,useDeprecatedNextContext:!1},Us={setTimeout:function(e,t){var n=[...arguments].slice(2),r=Us.delegate;return r?.setTimeout?r.setTimeout.apply(r,As([e,t],ks(n))):setTimeout.apply(void 0,As([e,t],ks(n)))},clearTimeout:function(e){return(Us.delegate?.clearTimeout||clearTimeout)(e)},delegate:void 0};function Ws(e){Us.setTimeout(function(){var t=Hs.onUnhandledError;if(t)t(e);else throw e})}function Gs(){}var Ks=(function(){return Ys(`C`,void 0,void 0)})();function qs(e){return Ys(`E`,void 0,e)}function Js(e){return Ys(`N`,e,void 0)}function Ys(e,t,n){return{kind:e,value:t,error:n}}var Xs=null;function Zs(e){if(Hs.useDeprecatedSynchronousErrorHandling){var t=!Xs;if(t&&(Xs={errorThrown:!1,error:null}),e(),t){var n=Xs,r=n.errorThrown,i=n.error;if(Xs=null,r)throw i}}else e()}function Qs(e){Hs.useDeprecatedSynchronousErrorHandling&&Xs&&(Xs.errorThrown=!0,Xs.error=e)}var $s=function(e){Ts(t,e);function t(t){var n=e.call(this)||this;return n.isStopped=!1,t?(n.destination=t,Bs(t)&&t.add(n)):n.destination=sc,n}return t.create=function(e,t,n){return new rc(e,t,n)},t.prototype.next=function(e){this.isStopped?oc(Js(e),this):this._next(e)},t.prototype.error=function(e){this.isStopped?oc(qs(e),this):(this.isStopped=!0,this._error(e))},t.prototype.complete=function(){this.isStopped?oc(Ks,this):(this.isStopped=!0,this._complete())},t.prototype.unsubscribe=function(){this.closed||(this.isStopped=!0,e.prototype.unsubscribe.call(this),this.destination=null)},t.prototype._next=function(e){this.destination.next(e)},t.prototype._error=function(e){try{this.destination.error(e)}finally{this.unsubscribe()}},t.prototype._complete=function(){try{this.destination.complete()}finally{this.unsubscribe()}},t}(Rs),ec=Function.prototype.bind;function tc(e,t){return ec.call(e,t)}var nc=function(){function e(e){this.partialObserver=e}return e.prototype.next=function(e){var t=this.partialObserver;if(t.next)try{t.next(e)}catch(e){ic(e)}},e.prototype.error=function(e){var t=this.partialObserver;if(t.error)try{t.error(e)}catch(e){ic(e)}else ic(e)},e.prototype.complete=function(){var e=this.partialObserver;if(e.complete)try{e.complete()}catch(e){ic(e)}},e}(),rc=function(e){Ts(t,e);function t(t,n,r){var i=e.call(this)||this,a;if(Ps(t)||!t)a={next:t??void 0,error:n??void 0,complete:r??void 0};else{var o;i&&Hs.useDeprecatedNextContext?(o=Object.create(t),o.unsubscribe=function(){return i.unsubscribe()},a={next:t.next&&tc(t.next,o),error:t.error&&tc(t.error,o),complete:t.complete&&tc(t.complete,o)}):a=t}return i.destination=new nc(a),i}return t}($s);function ic(e){Hs.useDeprecatedSynchronousErrorHandling?Qs(e):Ws(e)}function ac(e){throw e}function oc(e,t){var n=Hs.onStoppedNotification;n&&Us.setTimeout(function(){return n(e,t)})}var sc={closed:!0,next:Gs,error:ac,complete:Gs},cc=(function(){return typeof Symbol==`function`&&Symbol.observable||`@@observable`})();function lc(e){return e}function uc(){return dc([...arguments])}function dc(e){return e.length===0?lc:e.length===1?e[0]:function(t){return e.reduce(function(e,t){return t(e)},t)}}var fc=function(){function e(e){e&&(this._subscribe=e)}return e.prototype.lift=function(t){var n=new e;return n.source=this,n.operator=t,n},e.prototype.subscribe=function(e,t,n){var r=this,i=hc(e)?e:new rc(e,t,n);return Zs(function(){var e=r,t=e.operator,n=e.source;i.add(t?t.call(i,n):n?r._subscribe(i):r._trySubscribe(i))}),i},e.prototype._trySubscribe=function(e){try{return this._subscribe(e)}catch(t){e.error(t)}},e.prototype.forEach=function(e,t){var n=this;return t=pc(t),new t(function(t,r){var i=new rc({next:function(t){try{e(t)}catch(e){r(e),i.unsubscribe()}},error:r,complete:t});n.subscribe(i)})},e.prototype._subscribe=function(e){return this.source?.subscribe(e)},e.prototype[cc]=function(){return this},e.prototype.pipe=function(){return dc([...arguments])(this)},e.prototype.toPromise=function(e){var t=this;return e=pc(e),new e(function(e,n){var r;t.subscribe(function(e){return r=e},function(e){return n(e)},function(){return e(r)})})},e.create=function(t){return new e(t)},e}();function pc(e){return e??Hs.Promise??Promise}function mc(e){return e&&Ps(e.next)&&Ps(e.error)&&Ps(e.complete)}function hc(e){return e&&e instanceof $s||mc(e)&&Bs(e)}function gc(e){return Ps(e?.lift)}function _c(e){return function(t){if(gc(t))return t.lift(function(t){try{return e(t,this)}catch(e){this.error(e)}});throw TypeError(`Unable to lift unknown Observable type`)}}function vc(e,t,n,r,i){return new yc(e,t,n,r,i)}var yc=function(e){Ts(t,e);function t(t,n,r,i,a,o){var s=e.call(this,t)||this;return s.onFinalize=a,s.shouldUnsubscribe=o,s._next=n?function(e){try{n(e)}catch(e){t.error(e)}}:e.prototype._next,s._error=i?function(e){try{i(e)}catch(e){t.error(e)}finally{this.unsubscribe()}}:e.prototype._error,s._complete=r?function(){try{r()}catch(e){t.error(e)}finally{this.unsubscribe()}}:e.prototype._complete,s}return t.prototype.unsubscribe=function(){var t;if(!this.shouldUnsubscribe||this.shouldUnsubscribe()){var n=this.closed;e.prototype.unsubscribe.call(this),!n&&((t=this.onFinalize)==null||t.call(this))}},t}($s),bc=Fs(function(e){return function(){e(this),this.name=`ObjectUnsubscribedError`,this.message=`object unsubscribed`}}),xc=function(e){Ts(t,e);function t(){var t=e.call(this)||this;return t.closed=!1,t.currentObservers=null,t.observers=[],t.isStopped=!1,t.hasError=!1,t.thrownError=null,t}return t.prototype.lift=function(e){var t=new Sc(this,this);return t.operator=e,t},t.prototype._throwIfClosed=function(){if(this.closed)throw new bc},t.prototype.next=function(e){var t=this;Zs(function(){var n,r;if(t._throwIfClosed(),!t.isStopped){t.currentObservers||=Array.from(t.observers);try{for(var i=Os(t.currentObservers),a=i.next();!a.done;a=i.next())a.value.next(e)}catch(e){n={error:e}}finally{try{a&&!a.done&&(r=i.return)&&r.call(i)}finally{if(n)throw n.error}}}})},t.prototype.error=function(e){var t=this;Zs(function(){if(t._throwIfClosed(),!t.isStopped){t.hasError=t.isStopped=!0,t.thrownError=e;for(var n=t.observers;n.length;)n.shift().error(e)}})},t.prototype.complete=function(){var e=this;Zs(function(){if(e._throwIfClosed(),!e.isStopped){e.isStopped=!0;for(var t=e.observers;t.length;)t.shift().complete()}})},t.prototype.unsubscribe=function(){this.isStopped=this.closed=!0,this.observers=this.currentObservers=null},Object.defineProperty(t.prototype,"observed",{get:function(){return this.observers?.length>0},enumerable:!1,configurable:!0}),t.prototype._trySubscribe=function(t){return this._throwIfClosed(),e.prototype._trySubscribe.call(this,t)},t.prototype._subscribe=function(e){return this._throwIfClosed(),this._checkFinalizedStatuses(e),this._innerSubscribe(e)},t.prototype._innerSubscribe=function(e){var t=this,n=this,r=n.hasError,i=n.isStopped,a=n.observers;return r||i?zs:(this.currentObservers=null,a.push(e),new Rs(function(){t.currentObservers=null,Ls(a,e)}))},t.prototype._checkFinalizedStatuses=function(e){var t=this,n=t.hasError,r=t.thrownError,i=t.isStopped;n?e.error(r):i&&e.complete()},t.prototype.asObservable=function(){var e=new fc;return e.source=this,e},t.create=function(e,t){return new Sc(e,t)},t}(fc),Sc=function(e){Ts(t,e);function t(t,n){var r=e.call(this)||this;return r.destination=t,r.source=n,r}return t.prototype.next=function(e){var t,n;(n=(t=this.destination)?.next)==null||n.call(t,e)},t.prototype.error=function(e){var t,n;(n=(t=this.destination)?.error)==null||n.call(t,e)},t.prototype.complete=function(){var e,t;(t=(e=this.destination)?.complete)==null||t.call(e)},t.prototype._subscribe=function(e){return this.source?.subscribe(e)??zs},t}(xc),Cc={now:function(){return(Cc.delegate||Date).now()},delegate:void 0},wc=function(e){Ts(t,e);function t(t,n,r){t===void 0&&(t=1/0),n===void 0&&(n=1/0),r===void 0&&(r=Cc);var i=e.call(this)||this;return i._bufferSize=t,i._windowTime=n,i._timestampProvider=r,i._buffer=[],i._infiniteTimeWindow=!0,i._infiniteTimeWindow=n===1/0,i._bufferSize=Math.max(1,t),i._windowTime=Math.max(1,n),i}return t.prototype.next=function(t){var n=this,r=n.isStopped,i=n._buffer,a=n._infiniteTimeWindow,o=n._timestampProvider,s=n._windowTime;r||(i.push(t),!a&&i.push(o.now()+s)),this._trimBuffer(),e.prototype.next.call(this,t)},t.prototype._subscribe=function(e){this._throwIfClosed(),this._trimBuffer();for(var t=this._innerSubscribe(e),n=this,r=n._infiniteTimeWindow,i=n._buffer.slice(),a=0;a=0}function wl(e){for(var t=[`topLevel`],n=0,r,i,a,o=function(e){return t.push(e)},s=function(e){return t[t.length-1]=e},c=function(e){r??(r=n,i=t.length,a=e)},l=function(e){e===a&&(r=void 0,i=void 0,a=void 0)},u=function(){return t.pop()},d=function(){return n--},f=function(e){if(`0`<=e&&e<=`9`){o(`number`);return}switch(e){case`"`:o(`string`);return;case`-`:o(`numberNeedsDigit`);return;case`t`:o(`true`);return;case`f`:o(`false`);return;case`n`:o(`null`);return;case`[`:o(`arrayNeedsValue`);return;case`{`:o(`objectNeedsKey`);return}},p=e.length;n`9`)&&(d(),u());break;case`numberNeedsDigit`:s(`number`);break;case`numberNeedsExponent`:s(m===`+`||m===`-`?`numberNeedsDigit`:`number`);break;case`true`:case`false`:case`null`:(m<`a`||m>`z`)&&(d(),u());break;case`arrayNeedsValue`:m===`]`?u():Cl(m)||(l(`collectionItem`),s(`arrayNeedsComma`),f(m));break;case`arrayNeedsComma`:m===`]`?u():m===`,`&&(c(`collectionItem`),s(`arrayNeedsValue`));break;case`objectNeedsKey`:m===`}`?u():m===`"`&&(c(`collectionItem`),s(`objectNeedsColon`),o(`string`));break;case`objectNeedsColon`:m===`:`&&s(`objectNeedsValue`);break;case`objectNeedsValue`:Cl(m)||(l(`collectionItem`),s(`objectNeedsComma`),f(m));break;case`objectNeedsComma`:m===`}`?u():m===`,`&&(c(`collectionItem`),s(`objectNeedsKey`))}}i!=null&&(t.length=i);for(var h=[r==null?e:e.slice(0,r)],g=function(t){return h.push(t.slice(e.length-e.lastIndexOf(t[0])))},_=t.length-1;_>=0;_--)switch(t[_]){case`string`:h.push(`"`);break;case`numberNeedsDigit`:case`numberNeedsExponent`:h.push(`0`);break;case`true`:g(`true`);break;case`false`:g(`false`);break;case`null`:g(`null`);break;case`arrayNeedsValue`:case`arrayNeedsComma`:h.push(`]`);break;case`objectNeedsKey`:case`objectNeedsColon`:case`objectNeedsValue`:case`objectNeedsComma`:h.push(`}`)}return h.join(``)}function Tl(e){let t=Object.values(e).filter(e=>typeof e==`number`);return Object.entries(e).filter(([e,n])=>t.indexOf(+e)===-1).map(([e,t])=>t)}function El(e,t=`|`){return e.map(e=>$l(e)).join(t)}function Dl(e,t){return typeof t==`bigint`?t.toString():t}var Ol=class{constructor(e){this._getter=e,this._value=void 0}get value(){let e=this._getter;return e!==void 0&&(this._value=e(),this._getter=void 0),this._value}};function kl(e){return new Ol(e)}function Al(e){return e==null}function jl(e){let t=+!!e.startsWith(`^`),n=e.endsWith(`$`)?e.length-1:e.length;return e.slice(t,n)}function Ml(e,t){let n=e/t,r=Math.round(n),i=4*2**-52*Math.max(Math.abs(n),1);return Math.abs(n-r){let e=t._zod.def.shape[a];return r?r(e,a):e}):zl(e,a,r?r(n.value,a):n.value))}}function Vl(e,t){for(let n of Reflect.ownKeys(t)){let r=Object.getOwnPropertyDescriptor(t,n);r.enumerable&&(r.get?Rl(e,n,()=>t[n]):zl(e,n,r.value))}}function Hl(...e){let t={};for(let n of e){let e=Object.getOwnPropertyDescriptors(n);Object.assign(t,e)}return Object.defineProperties({},t)}function Ul(e){return JSON.stringify(e)}function Wl(e){return e.toLowerCase().trim().replace(/[^\w\s-]/g,``).replace(/[\s_-]+/g,`-`).replace(/^-+|-+$/g,``)}var Gl=`captureStackTrace`in Error?Error.captureStackTrace:(...e)=>{};function Kl(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}var ql=kl(()=>{if(Vu.jitless||typeof navigator<`u`&&navigator?.userAgent?.includes(`Cloudflare`))return!1;try{return Function(``),!0}catch{return!1}});function Jl(e){if(Kl(e)===!1)return!1;let t=e.constructor;if(t===void 0||typeof t!=`function`)return!0;let n=t.prototype;return Kl(n)!==!1&&Object.prototype.hasOwnProperty.call(n,`isPrototypeOf`)!==!1}function Yl(e){return Jl(e)?{...e}:Array.isArray(e)?[...e]:e instanceof Map?new Map(e):e instanceof Set?new Set(e):e}var Xl=new Set([`string`,`number`,`symbol`]);function Zl(e){return e.replace(/[.*+?^${}()|[\]\\]/g,`\\$&`)}function Ql(e,t,n){let r=new e._zod.constr(t??e._zod.def);return(!t||n?.parent)&&(r._zod.parent=e),r}function P(e){let t=e;if(!t)return{};if(typeof t==`string`)return{error:()=>t};if(t?.message!==void 0){if(t?.error!==void 0)throw Error("Cannot specify both `message` and `error` params");t.error=t.message}return delete t.message,typeof t.error==`string`?{...t,error:()=>t.error}:t}function $l(e){return typeof e==`bigint`?e.toString()+`n`:typeof e==`string`?`"${e}"`:`${e}`}function eu(e){return Object.keys(e).filter(t=>e[t]._zod.optin!==void 0&&e[t]._zod.optout===`optional`)}var tu={safeint:[-(2**53-1),2**53-1],int32:[-2147483648,2147483647],uint32:[0,4294967295],float32:[-34028234663852886e22,34028234663852886e22],float64:[-Number.MAX_VALUE,Number.MAX_VALUE]},nu={int64:[BigInt(`-9223372036854775808`),BigInt(`9223372036854775807`)],uint64:[BigInt(0),BigInt(`18446744073709551615`)]};function ru(e,t){let n=e._zod.def,r=n.checks;if(r&&r.length>0)throw Error(`.pick() cannot be used on object schemas containing refinements`);let i={};return Bl(i,e,iu(e,t)),Ql(e,Hl(n,{shape:i,checks:[]}))}function iu(e,t){let n=Ll(e),r=[];for(let e of Reflect.ownKeys(t)){if(!Object.getOwnPropertyDescriptor(n,e)?.enumerable)throw Error(`Unrecognized key: "${String(e)}"`);t[e]&&r.push(e)}return r}function au(e,t){let n=e._zod.def,r=n.checks;if(r&&r.length>0)throw Error(`.omit() cannot be used on object schemas containing refinements`);let i=new Set(iu(e,t)),a={};return Bl(a,e,Reflect.ownKeys(Ll(e)).filter(e=>!i.has(e))),Ql(e,Hl(n,{shape:a,checks:[]}))}function ou(e,t){if(!Jl(t))throw Error(`Invalid input to extend: expected a plain object`);let n=e._zod.def.checks;if(n&&n.length>0){let n=Ll(e);for(let e of Reflect.ownKeys(t))if(Object.getOwnPropertyDescriptor(n,e)!==void 0)throw Error("Cannot overwrite keys on object schemas containing refinements. Use `.safeExtend()` instead.")}return Ql(e,Hl(e._zod.def,{shape:su(e,t)}))}function su(e,t){let n={};return Bl(n,e,Reflect.ownKeys(Ll(e))),Vl(n,t),n}function cu(e,t){if(!Jl(t))throw Error(`Invalid input to safeExtend: expected a plain object`);return Ql(e,Hl(e._zod.def,{shape:su(e,t)}))}function lu(e,t){if(!t?._zod?.def)throw Error("Invalid input to merge: expected an object schema. To merge a plain shape, use `.extend()`.");if(e._zod.def.checks?.length)throw Error(`.merge() cannot be used on object schemas containing refinements. Use .safeExtend() instead.`);let n={};return Bl(n,e,Reflect.ownKeys(Ll(e))),Bl(n,t,Reflect.ownKeys(Ll(t))),Ql(e,Hl(e._zod.def,{shape:n,get catchall(){return t._zod.def.catchall},checks:t._zod.def.checks??[]}))}function uu(e,t,n,r=`partial`){let i=t._zod.def.checks;if(i&&i.length>0)throw Error(`.${r}() cannot be used on object schemas containing refinements`);let a=n?new Set(iu(t,n)):void 0,o={};return Bl(o,t,Reflect.ownKeys(Ll(t)),e&&((t,n)=>a&&!a.has(n)?t:new e({type:`optional`,innerType:t}))),Ql(t,Hl(t._zod.def,{shape:o,checks:[]}))}function du(e,t,n){let r=n?new Set(iu(t,n)):void 0,i={};return Bl(i,t,Reflect.ownKeys(Ll(t)),(t,n)=>r&&!r.has(n)?t:new e({type:`nonoptional`,innerType:t})),Ql(t,Hl(t._zod.def,{shape:i}))}function fu(e,t=0){if(e.aborted===!0)return!0;for(let n=t;n{var n;return(n=t).path??(n.path=[]),t.path.unshift(e),t})}function F(e){return typeof e==`string`?e:e?.message}function hu(e,t,n){var r;for(let i=t;ie;return t[Mu]=!0,t}var Pu,Fu=Object.freeze({status:`aborted`}),Iu={value:void 0,enumerable:!1},Lu=`captureStackTrace`in Error?Error:null;function Ru(e){let t=Lu;if(t){let n=t.stackTraceLimit;if(typeof n==`number`){try{t.stackTraceLimit=0}catch{return Lu=null,new e}try{return new e}finally{t.stackTraceLimit=n}}}return new e}function L(e,t,n,r){let i={};function a(e){this.def=e,this.constr=d,this.traits=new Set}a.prototype=i;let o=n,s=o&&new WeakSet;function c(n,r){if(!n._zod){Iu.value=new a(r);try{Object.defineProperty(n,"_zod",Iu)}finally{Iu.value=void 0}}else if(n._zod.traits.has(e))return;if(n._zod.traits.add(e),t(n,r),s){let e=Object.getPrototypeOf(n),t=n._zod.constr.prototype,r=e;for(;r&&r!==t;)r=Object.getPrototypeOf(r);let i=r??e;s.has(i)||(s.add(i),Su(i,o))}let i=d.prototype;for(let e in i)Object.prototype.hasOwnProperty.call(i,e)&&(e in n||(n[e]=i[e].bind(n)))}let l=r?.Parent??Object;class u extends l{}Object.defineProperty(u,"name",{value:e});function d(e){let t=r?.Parent?Ru(u):this;c(t,e);let n=t._zod.deferred;if(n){for(let e of n)e();t._zod.deferred=void 0}let i=globalThis.__zod_globalConfig?.postProcessor;return i&&i(t),t}return Object.defineProperty(d,"init",{value:c}),Object.defineProperty(d,Symbol.hasInstance,{value:t=>r?.Parent&&t instanceof r.Parent?!0:t?._zod?.traits?.has(e)}),Object.defineProperty(d,"name",{value:e}),d}var zu=class extends Error{constructor(){super(`Encountered Promise during synchronous parse. Use .parseAsync() instead.`)}},Bu=class extends Error{constructor(e){super(`Encountered unidirectional transform during encode: ${e}`),this.name=`ZodEncodeError`}};(Pu=globalThis).__zod_globalConfig??(Pu.__zod_globalConfig={});var Vu=globalThis.__zod_globalConfig;function Hu(e){return e&&Object.assign(Vu,e),Vu}function Uu(){let e=this._zod;return e.message??=JSON.stringify(e.def,Dl,2),e.message}function Wu(e){this._zod.message=e}var Gu={get:Uu,set:Wu,enumerable:!0,configurable:!0},Ku={value:void 0,enumerable:!1},qu=new WeakSet([Object.prototype,Error.prototype]),Ju=(e,t)=>{e.name=`$ZodError`,Ku.value=t,Object.defineProperty(e,"issues",Ku),Ku.value=void 0,Object.defineProperty(e,"message",Gu);let n=Object.getPrototypeOf(e);qu.has(n)||(qu.add(n),Object.defineProperty(n,"toString",{configurable:!0,enumerable:!1,get(){let e=()=>this.message;return Object.defineProperty(this,"toString",{value:e,configurable:!0,writable:!0}),e},set(e){Object.defineProperty(this,"toString",{value:e,configurable:!0,writable:!0})}}))},Yu=L(`$ZodError`,Ju);L(`$ZodError`,Ju,void 0,{Parent:Error});function Xu(e,t,n){return Object.prototype.hasOwnProperty.call(e,t)||(t===`__proto__`?Object.defineProperty(e,t,{value:n(),writable:!0,enumerable:!0,configurable:!0}):e[t]=n()),e[t]}function Zu(e,t=e=>e.message){let n={},r=[];for(let i of e.issues)i.path.length>0?Xu(n,i.path[0],()=>[]).push(t(i)):r.push(t(i));return{formErrors:r,fieldErrors:n}}function Qu(e,t=e=>e.message){let n={_errors:[]},r=(e,i=[])=>{for(let a of e.issues)if(a.code===`invalid_union`&&a.errors.length)a.errors.map(e=>r({issues:e},[...i,...a.path]));else if(a.code===`invalid_key`)r({issues:a.issues},[...i,...a.path]);else if(a.code===`invalid_element`)r({issues:a.issues},[...i,...a.path]);else{let e=[...i,...a.path];if(e.length===0)n._errors.push(t(a));else{let r=n,i=0;for(;i{let t=(n,r,i,a)=>{let o=i?{...i,async:!1}:{async:!1},s=n._zod.run({value:r,issues:[]},o);if(s instanceof Promise)throw new zu;if(s.issues.length){let n=new((a?.Err)??e)(s.issues.map(e=>gu(e,o,Hu())));throw Gl(n,a?.callee??t),n}return s.value};return t},td=e=>{let t=async(n,r,i,a)=>{let o=i?{...i,async:!0}:{async:!0},s=n._zod.run({value:r,issues:[]},o);if(s instanceof Promise&&(s=await s),s.issues.length){let n=new((a?.Err)??e)(s.issues.map(e=>gu(e,o,Hu())));throw Gl(n,a?.callee??t),n}return s.value};return t},nd=e=>(t,n,r)=>{let i=r?{...r,async:!1}:{async:!1},a=t._zod.run({value:n,issues:[]},i);if(a instanceof Promise)throw new zu;return a.issues.length?rd(e,a.issues,i):{success:!0,data:a.value}};function rd(e,t,n){let r;return{success:!1,get error(){return r||(r=new e(t.map(e=>gu(e,n,Hu()))),t=void 0,n=void 0),r},set error(e){r=e,t=void 0,n=void 0}}}var id=e=>async(t,n,r)=>{let i=r?{...r,async:!0}:{async:!0},a=t._zod.run({value:n,issues:[]},i);return a instanceof Promise&&(a=await a),a.issues.length?rd(e,a.issues,i):{success:!0,data:a.value}},ad=Symbol.for(`zod.compile.invalid`),od=Symbol.for(`zod.compile.fallback`),sd=((e,t,n)=>{let r=e._zod.bag.validator;if(r!==void 0){if(r(t)!==ad)return!0;if(r.definite===!0&&n===void 0)return!1}return cd(e,t,n)});function cd(e,t,n){let r=n?{...n,async:!1,abortEarly:!0}:{async:!1,abortEarly:!0},i=e._zod.bag.fallbackRun,a;if(i?(r[od]=!0,a=i({value:t,issues:[]},r)):a=e._zod.run({value:t,issues:[]},r),a instanceof Promise)throw new zu;return a.issues.length===0}var ld=async(e,t,n)=>{let r=n?{...n,async:!0,abortEarly:!0}:{async:!0,abortEarly:!0},i=e._zod.run({value:t,issues:[]},r);return i instanceof Promise&&(i=await i),i.issues.length===0},R=e=>{let t=ed(e),n=(e,r,i,a)=>{let o=i?{...i,direction:`backward`}:{direction:`backward`};return t(e,r,o,$u(n,a))};return n},z=e=>{let t=ed(e),n=(e,r,i,a)=>t(e,r,i,$u(n,a));return n},ud=e=>{let t=td(e),n=async(e,r,i,a)=>{let o=i?{...i,direction:`backward`}:{direction:`backward`};return await t(e,r,o,$u(n,a))};return n},dd=e=>{let t=td(e),n=async(e,r,i,a)=>await t(e,r,i,$u(n,a));return n},fd=e=>(t,n,r)=>{let i=r?{...r,direction:`backward`}:{direction:`backward`};return nd(e)(t,n,i)},pd=e=>(t,n,r)=>nd(e)(t,n,r),md=e=>async(t,n,r)=>{let i=r?{...r,direction:`backward`}:{direction:`backward`};return id(e)(t,n,i)},hd=e=>async(t,n,r)=>id(e)(t,n,r),gd=/^[cC][0-9a-z]{6,}$/,_d=/^[0-9a-z]+$/,vd=/^[0-7][0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{25}$/,yd=/^[0-9a-vA-V]{20}$/,bd=/^[A-Za-z0-9]{27}$/,xd=/^[a-zA-Z0-9_-]{21}$/;function Sd(e){return RegExp(`^[a-zA-Z0-9_-]{${e}}$`)}var Cd=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,wd=/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$/,Td=e=>e?RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${e}[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$`):/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$/,Ed=/^(?:[A-Za-z0-9_'+\-]+\.)*[A-Za-z0-9_'+\-]*[A-Za-z0-9_+-]@(?:[A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,Dd=`^(?=[\\s\\S]*[\\p{Extended_Pictographic}\\p{Regional_Indicator}\\u20E3])[\\p{Extended_Pictographic}\\p{Emoji_Component}]+$`;function Od(){return new RegExp(Dd,`u`)}var kd=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,Ad=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:))$/,jd=/^((25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/([0-9]|[1-2][0-9]|3[0-2])$/,Md=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,Nd=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,Pd=/^(?:[A-Za-z0-9_-]{4})*(?:[A-Za-z0-9_-]{2,3})?$/,Fd=/^https?$/,Id=/^\+[1-9]\d{6,14}$/,Ld=`(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))`;function Rd(e){return RegExp(`^${e}$`)}var zd=Rd(Ld);function Bd(e){let t=`(?:[01]\\d|2[0-3]):[0-5]\\d`;return typeof e.precision==`number`?e.precision===-1?`${t}`:e.precision===0?`${t}:[0-5]\\d`:`${t}:[0-5]\\d\\.\\d{${e.precision}}`:e.seconds?`${t}:[0-5]\\d(?:\\.\\d+)?`:`${t}(?::[0-5]\\d(?:\\.\\d+)?)?`}function Vd(e){return RegExp(`^${Bd(e)}$`)}function Hd(e){let t=[`Z`];e.offset&&t.push(`([+-](?:[01]\\d|2[0-3]):[0-5]\\d)`);let n=`${Bd({precision:e.precision,seconds:!0})}(?:${t.join(`|`)})`,r=e.local?`${n}|${Bd({precision:e.precision})}`:n;return RegExp(`^${Ld}T(?:${r})$`)}var Ud=/^[\s\S]{0,}$/,Wd=/^-?\d+$/,Gd=/^-?\d+(?:\.\d+)?$/,Kd=/^(?:true|false)$/i,qd=/^null$/i,Jd=/^undefined$/i,Yd=/^[^A-Z]*$/,Xd=/^[^a-z]*$/,Zd=L(`$ZodCheck`,(e,t)=>{var n;e._zod??={},e._zod.def=t,(n=e._zod).onattach??(n.onattach=[])}),Qd=e=>{let t=e.value;return!Al(t)&&t.length!==void 0},$d={number:`number`,bigint:`bigint`,object:`date`},ef=L(`$ZodCheckLessThan`,(e,t)=>{Zd.init(e,t);let n=$d[typeof t.value];e._zod.check=r=>{(t.inclusive?r.value<=t.value:r.value{Zd.init(e,t);let n=$d[typeof t.value];e._zod.check=r=>{(t.inclusive?r.value>=t.value:r.value>t.value)||r.issues.push({origin:$d[typeof r.value]??n,code:`too_small`,minimum:typeof t.value==`object`?t.value.getTime():t.value,input:r.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),nf=L(`$ZodCheckMultipleOf`,(e,t)=>{Zd.init(e,t),e._zod.check=n=>{if(typeof n.value!=typeof t.value)throw Error(`Cannot mix number and bigint in multiple_of check.`);(typeof n.value==`bigint`?t.value!==BigInt(0)&&n.value%t.value===BigInt(0):Ml(n.value,t.value)===0)||n.issues.push({origin:typeof n.value,code:`not_multiple_of`,divisor:t.value,input:n.value,inst:e,continue:!t.abort})}}),rf=L(`$ZodCheckNumberFormat`,(e,t)=>{Zd.init(e,t),t.format=t.format||`float64`;let n=t.format?.includes(`int`),r=n?`int`:`number`,[i,a]=tu[t.format];e._zod.check=o=>{let s=o.value;if(n){if(!Number.isInteger(s)){o.issues.push({expected:r,format:t.format,code:`invalid_type`,continue:!1,input:s,inst:e});return}if(!Number.isSafeInteger(s)){s>0?o.issues.push({input:s,code:`too_big`,maximum:2**53-1,note:`Integers must be within the safe integer range.`,inst:e,origin:r,inclusive:!0,continue:!t.abort}):o.issues.push({input:s,code:`too_small`,minimum:-(2**53-1),note:`Integers must be within the safe integer range.`,inst:e,origin:r,inclusive:!0,continue:!t.abort});return}}sa&&o.issues.push({origin:`number`,input:s,code:`too_big`,maximum:a,inclusive:!0,inst:e,continue:!t.abort})}}),af=L(`$ZodCheckMaxLength`,(e,t)=>{var n;Zd.init(e,t),(n=e._zod.def).when??(n.when=Qd),e._zod.check=n=>{let r=n.value,i=r.length;if((typeof r==`string`&&i>t.maximum?vu(r):i)<=t.maximum)return;let a=yu(r);n.issues.push({origin:a,code:`too_big`,maximum:t.maximum,inclusive:!0,input:r,inst:e,continue:!t.abort})}}),of=L(`$ZodCheckMinLength`,(e,t)=>{var n;Zd.init(e,t),(n=e._zod.def).when??(n.when=Qd),e._zod.check=n=>{let r=n.value,i=r.length;if((typeof r==`string`&&i>=t.minimum&&i=t.minimum)return;let a=yu(r);n.issues.push({origin:a,code:`too_small`,minimum:t.minimum,inclusive:!0,input:r,inst:e,continue:!t.abort})}}),sf=L(`$ZodCheckLengthEquals`,(e,t)=>{var n;Zd.init(e,t),(n=e._zod.def).when??(n.when=Qd),e._zod.check=n=>{let r=n.value,i=r.length,a=typeof r==`string`&&i>=t.length&&i<=t.length*2?vu(r):i;if(a===t.length)return;let o=yu(r),s=a>t.length;n.issues.push({origin:o,...s?{code:`too_big`,maximum:t.length}:{code:`too_small`,minimum:t.length},inclusive:!0,exact:!0,input:n.value,inst:e,continue:!t.abort})}}),cf=L(`$ZodCheckStringFormat`,(e,t)=>{var n,r;Zd.init(e,t),t.pattern?(n=e._zod).check??(n.check=n=>{t.pattern.lastIndex=0,!t.pattern.test(n.value)&&n.issues.push({origin:`string`,code:`invalid_format`,format:t.format,input:n.value,...t.pattern?{pattern:t.pattern.toString()}:{},inst:e,continue:!t.abort})}):(r=e._zod).check??(r.check=()=>{})}),lf=L(`$ZodCheckRegex`,(e,t)=>{cf.init(e,t),e._zod.check=n=>{t.pattern.lastIndex=0,!t.pattern.test(n.value)&&n.issues.push({origin:`string`,code:`invalid_format`,format:`regex`,input:n.value,pattern:t.pattern.toString(),inst:e,continue:!t.abort})}}),uf=L(`$ZodCheckLowerCase`,(e,t)=>{t.pattern??=Yd,cf.init(e,t)}),df=L(`$ZodCheckUpperCase`,(e,t)=>{t.pattern??=Xd,cf.init(e,t)}),ff=L(`$ZodCheckIncludes`,(e,t)=>{Zd.init(e,t);let n=Zl(t.includes);t.pattern=new RegExp(typeof t.position==`number`?`^.{${t.position},}${n}`:n),e._zod.check=n=>{n.value.includes(t.includes,t.position)||n.issues.push({origin:`string`,code:`invalid_format`,format:`includes`,includes:t.includes,input:n.value,inst:e,continue:!t.abort})}}),pf=L(`$ZodCheckStartsWith`,(e,t)=>{Zd.init(e,t);let n=RegExp(`^${Zl(t.prefix)}.*`);t.pattern??=n,e._zod.check=n=>{n.value.startsWith(t.prefix)||n.issues.push({origin:`string`,code:`invalid_format`,format:`starts_with`,prefix:t.prefix,input:n.value,inst:e,continue:!t.abort})}}),mf=L(`$ZodCheckEndsWith`,(e,t)=>{Zd.init(e,t);let n=RegExp(`.*${Zl(t.suffix)}$`);t.pattern??=n,e._zod.check=n=>{n.value.endsWith(t.suffix)||n.issues.push({origin:`string`,code:`invalid_format`,format:`ends_with`,suffix:t.suffix,input:n.value,inst:e,continue:!t.abort})}}),hf=L(`$ZodCheckOverwrite`,(e,t)=>{Zd.init(e,t),e._zod.check=e=>{e.value=t.tx(e.value)}}),gf=class{constructor(e=[],t={}){this.content=[],this.indent=0,this.args=e,this.closed=t}indented(e){this.indent+=1;try{e(this)}finally{--this.indent}}write(e){if(typeof e==`function`){e(this,{execution:`sync`}),e(this,{execution:`async`});return}let t=e.split(` -`).filter(e=>e),n=Math.min(...t.map(e=>e.length-e.trimStart().length)),r=t.map(e=>e.slice(n)).map(e=>` `.repeat(this.indent*2)+e);for(let e of r)this.content.push(e)}compile(){let e=Function,t=this?.content??[``];return new e(...Object.keys(this.closed),`return function (${this.args.join(`, `)}) {\n${t.join(` -`)}\n};`)(...Object.values(this.closed))}},_f={major:4,minor:6,patch:5},vf=L(`$ZodType`,(e,t)=>{var n;e??={},e._zod.def=t,e._zod.bag=e._zod.bag||{},e._zod.version=_f;let r=e._zod.def.checks,i=e._zod.traits.has(`$ZodCheck`)?[e,...r??[]]:r?.length?[...r]:[];for(let t of i)for(let n of t._zod.onattach)n(e);if(i.length===0)(n=e._zod).deferred??(n.deferred=[]),e._zod.deferred?.push(()=>{e._zod.run=e._zod.parse});else{let t=(t,n,r)=>{if(t.memo)return t;let i=fu(t),a;for(let o of n){if(o._zod.def.when){if(pu(t)||!o._zod.def.when(t))continue}else if(i)continue;let n=t.issues.length,s=o._zod.check(t);if(s instanceof Promise&&r?.async===!1)throw new zu;if(a||s instanceof Promise)a=(a??Promise.resolve()).then(async()=>{await s,t.issues.length!==n&&(hu(t.issues,n,e),i||=fu(t,n))});else{if(t.issues.length===n)continue;hu(t.issues,n,e),i||=fu(t,n)}}return a?a.then(()=>t):t},n=(n,r,a)=>{if(fu(n))return n.aborted=!0,n;let o=t(r,i,a);if(o instanceof Promise){if(a.async===!1)throw new zu;return o.then(t=>e._zod.parse(t,a))}return e._zod.parse(o,a)};e._zod.run=(r,a)=>{if(a.skipChecks)return e._zod.parse(r,a);if(a.direction===`backward`){let t=e._zod.parse({value:r.value,issues:[]},{...a,skipChecks:!0});return t instanceof Promise?t.then(e=>n(e,r,a)):n(t,r,a)}let o=e._zod.parse(r,a);if(o instanceof Promise){if(a.async===!1)throw new zu;return o.then(e=>t(e,i,a))}return t(o,i,a)}}},{get"~standard"(){return wu(this,`~standard`,xf(this))},set"~standard"(e){Cu(this,`~standard`,e)}}),yf=(e,t)=>e.issues.length?{issues:e.issues.map(e=>gu(e,t,Hu()))}:{value:e.value};async function bf(e,t){let n={async:!0};return yf(await e._zod.run({value:t,issues:[]},n),n)}function xf(e){return{validate:t=>{let n={async:!1};try{let r=e._zod.run({value:t,issues:[]},n);if(!(r instanceof Promise))return yf(r,n)}catch{}return bf(e,t)},vendor:`zod`,version:1}}var Sf=L(`$ZodString`,(e,t)=>{vf.init(e,t),e._zod.pattern=t.pattern??Ud,e._zod.parse=(n,r)=>{if(t.coerce)try{n.value=String(n.value)}catch{}return typeof n.value==`string`||n.issues.push({expected:`string`,code:`invalid_type`,input:n.value,inst:e}),n}}),Cf=L(`$ZodStringFormat`,(e,t)=>{cf.init(e,t),Sf.init(e,t)}),wf=L(`$ZodGUID`,(e,t)=>{t.pattern??=wd,Cf.init(e,t)}),Tf=L(`$ZodUUID`,(e,t)=>{if(t.version){let e={v1:1,v2:2,v3:3,v4:4,v5:5,v6:6,v7:7,v8:8}[t.version];if(e===void 0)throw Error(`Invalid UUID version: "${t.version}"`);t.pattern??=Td(e)}else t.pattern??=Td();Cf.init(e,t)}),Ef=L(`$ZodEmail`,(e,t)=>{t.pattern??=Ed,Cf.init(e,t)});function Df(e){try{return typeof URL<`u`&&typeof URL.canParse==`function`?URL.canParse(e):(new URL(e),!0)}catch{return!1}}function Of(e,t){return!(`normalize`in t)&&!(`hostname`in t)&&!(`protocol`in t)?Df(e)||2:kf(e,t)}function kf(e,t){if(!t.normalize&&t.protocol?.source===Fd.source&&!/^https?:\/\//i.test(e))return 1;try{if(typeof URL<`u`){let t=URL;if(typeof t.parse==`function`)return t.parse(e)??2}return new URL(e)}catch{return 2}}var Af=/[\t\n\r]/g;function jf(e){return e.replace(Af,``)}function Mf(e,t){return t.lastIndex=0,t.test(e.hostname)}function Nf(e,t){return t.lastIndex=0,t.test(e.protocol.endsWith(`:`)?e.protocol.slice(0,-1):e.protocol)}var Pf=L(`$ZodURL`,(e,t)=>{Cf.init(e,t),e._zod.check=n=>{try{let r=n.value.trim(),i=Of(r,t);if(i===1){n.issues.push({code:`invalid_format`,format:`url`,note:`Invalid URL format`,input:n.value,inst:e,continue:!t.abort});return}if(i===2){n.issues.push({code:`invalid_format`,format:`url`,input:n.value,inst:e,continue:!t.abort});return}if(i===!0){n.value=jf(r);return}t.hostname&&!Mf(i,t.hostname)&&n.issues.push({code:`invalid_format`,format:`url`,note:`Invalid hostname`,pattern:t.hostname.source,input:n.value,inst:e,continue:!t.abort}),t.protocol&&!Nf(i,t.protocol)&&n.issues.push({code:`invalid_format`,format:`url`,note:`Invalid protocol`,pattern:t.protocol.source,input:n.value,inst:e,continue:!t.abort}),n.value=t.normalize?i.href:jf(r);return}catch{n.issues.push({code:`invalid_format`,format:`url`,input:n.value,inst:e,continue:!t.abort})}}}),Ff=L(`$ZodEmoji`,(e,t)=>{t.pattern??=Od(),Cf.init(e,t)}),If=L(`$ZodNanoID`,(e,t)=>{if(t.length!==void 0&&(!Number.isInteger(t.length)||t.length<1))throw Error(`Invalid nanoid length: ${t.length}`);t.pattern??=t.length===void 0?xd:Sd(t.length),Cf.init(e,t)}),Lf=L(`$ZodCUID`,(e,t)=>{t.pattern??=gd,Cf.init(e,t)}),Rf=L(`$ZodCUID2`,(e,t)=>{t.pattern??=_d,Cf.init(e,t)}),zf=L(`$ZodULID`,(e,t)=>{t.pattern??=vd,Cf.init(e,t)}),Bf=L(`$ZodXID`,(e,t)=>{t.pattern??=yd,Cf.init(e,t)}),Vf=L(`$ZodKSUID`,(e,t)=>{t.pattern??=bd,Cf.init(e,t)}),Hf=L(`$ZodISODateTime`,(e,t)=>{t.pattern??=Hd(t),Cf.init(e,t)}),Uf=L(`$ZodISODate`,(e,t)=>{t.pattern??=zd,Cf.init(e,t)}),Wf=L(`$ZodISOTime`,(e,t)=>{t.pattern??=Vd(t),Cf.init(e,t)}),Gf=L(`$ZodISODuration`,(e,t)=>{t.pattern??=Cd,Cf.init(e,t)}),Kf=L(`$ZodIPv4`,(e,t)=>{t.pattern??=kd,Cf.init(e,t)}),qf=/^[0-9a-fA-F:.]+$/;function Jf(e){return qf.test(e)?Df(`http://[${e}]`):!1}var Yf=L(`$ZodIPv6`,(e,t)=>{t.pattern??=Ad,Cf.init(e,t),e._zod.check=n=>{Jf(n.value)||n.issues.push({code:`invalid_format`,format:`ipv6`,input:n.value,inst:e,continue:!t.abort})}}),Xf=L(`$ZodCIDRv4`,(e,t)=>{t.pattern??=jd,Cf.init(e,t)});function Zf(e){let t=e.split(`/`);if(t.length!==2)return!1;let[n,r]=t;if(!r)return!1;let i=Number(r);return`${i}`!==r||i<0||i>128?!1:Jf(n)}var Qf=L(`$ZodCIDRv6`,(e,t)=>{t.pattern??=Md,Cf.init(e,t),e._zod.check=n=>{Zf(n.value)||n.issues.push({code:`invalid_format`,format:`cidrv6`,input:n.value,inst:e,continue:!t.abort})}});function $f(e){if(e===``)return!0;if(/\s/.test(e)||e.length%4!=0)return!1;try{return atob(e),!0}catch{return!1}}var B=/^[0-9a-zA-Z+/]*={0,2}$/,ep=L(`$ZodBase64`,(e,t)=>{t.pattern??=B,Cf.init(e,t),e._zod.check=n=>{$f(n.value)||n.issues.push({code:`invalid_format`,format:`base64`,input:n.value,inst:e,continue:!t.abort})}}),tp=/^[A-Za-z0-9_-]*$/;function np(e){if(!tp.test(e))return!1;let t=e.replace(/[-_]/g,e=>e===`-`?`+`:`/`);return $f(t.padEnd(Math.ceil(t.length/4)*4,`=`))}var rp=L(`$ZodBase64URL`,(e,t)=>{t.pattern??=tp,Cf.init(e,t),e._zod.check=n=>{np(n.value)||n.issues.push({code:`invalid_format`,format:`base64url`,input:n.value,inst:e,continue:!t.abort})}}),ip=L(`$ZodE164`,(e,t)=>{t.pattern??=Id,Cf.init(e,t)});function ap(e,t=null){try{let n=e.split(`.`);if(n.length!==3)return!1;let[r]=n;if(!r)return!1;let i=JSON.parse(atob(r));return!(`typ`in i&&i?.typ!==`JWT`||!i.alg||t&&(!(`alg`in i)||i.alg!==t))}catch{return!1}}var op=L(`$ZodJWT`,(e,t)=>{Cf.init(e,t),e._zod.check=n=>{ap(n.value,t.alg)||n.issues.push({code:`invalid_format`,format:`jwt`,input:n.value,inst:e,continue:!t.abort})}}),sp=L(`$ZodNumber`,(e,t)=>{vf.init(e,t),e._zod.pattern=Gd,e._zod.parse=(n,r)=>{if(t.coerce)try{n.value=Number(n.value)}catch{}let i=n.value;if(typeof i==`number`&&!Number.isNaN(i)&&Number.isFinite(i))return n;let a=typeof i==`number`?Number.isNaN(i)?`NaN`:Number.isFinite(i)?void 0:String(i):void 0;return n.issues.push({expected:`number`,code:`invalid_type`,input:i,inst:e,...a?{received:a}:{}}),n}}),cp=L(`$ZodNumberFormat`,(e,t)=>{rf.init(e,t),sp.init(e,t)}),lp=L(`$ZodBoolean`,(e,t)=>{vf.init(e,t),e._zod.pattern=Kd,e._zod.parse=(n,r)=>{if(t.coerce)try{n.value=!!n.value}catch{}let i=n.value;return typeof i==`boolean`||n.issues.push({expected:`boolean`,code:`invalid_type`,input:i,inst:e}),n}}),up=L(`$ZodUndefined`,(e,t)=>{vf.init(e,t),e._zod.pattern=Jd,e._zod.values=new Set([void 0]),e._zod.parse=(t,n)=>{let r=t.value;return r===void 0||t.issues.push({expected:`undefined`,code:`invalid_type`,input:r,inst:e}),t}}),dp=L(`$ZodNull`,(e,t)=>{vf.init(e,t),e._zod.pattern=qd,e._zod.values=new Set([null]),e._zod.parse=(t,n)=>{let r=t.value;return r===null||t.issues.push({expected:`null`,code:`invalid_type`,input:r,inst:e}),t}}),fp=L(`$ZodAny`,(e,t)=>{vf.init(e,t),e._zod.parse=e=>e}),pp=L(`$ZodUnknown`,(e,t)=>{vf.init(e,t),e._zod.parse=e=>e}),mp=L(`$ZodNever`,(e,t)=>{vf.init(e,t),e._zod.parse=(t,n)=>(t.issues.push({expected:`never`,code:`invalid_type`,input:t.value,inst:e}),t)});function hp(e,t,n){e.issues.length&&t.issues.push(...mu(n,e.issues)),t.value[n]=e.value}var gp=L(`$ZodArray`,(e,t)=>{vf.init(e,t);let n=Vu.memoizer;n?.attach(e),e._zod.parse=(r,i)=>{let a=r.value;if(!Array.isArray(a))return r.issues.push({expected:`array`,code:`invalid_type`,input:a,inst:e}),r;r.value=n?n.alloc(e,r,Array(a.length),i):Array(a.length);let o=[],s=i?.abortEarly;for(let e=0;ehp(t,r,e)));else if(hp(c,r,e),s&&c.issues.length!==0&&fu(c))break}return o.length?Promise.all(o).then(()=>r):r}});function _p(e,t,n,r,i,a){let o=n in r,s=a===`optional`;if(o||!s||i!==`optional`){if(e.issues.length){if(i!==void 0&&s&&!o)return;t.issues.push(...mu(n,e.issues))}if(!o&&i===void 0){e.issues.length||t.issues.push({code:`invalid_type`,expected:`nonoptional`,input:void 0,path:[n]});return}e.value===void 0?(o||i===`defaulted`&&!s)&&(t.value[n]=void 0):t.value[n]=e.value}}var vp=[];function yp(e){let t=Object.keys(e.shape),n=Object.getOwnPropertySymbols(e.shape),r=n.length?n:vp,i=r.length?[...t,...r]:t;for(let t of i)if(!e.shape?.[t]?._zod?.traits?.has(`$ZodType`))throw Error(`Invalid element at key "${String(t)}": expected a Zod schema`);let a=eu(e.shape);return{...e,allKeys:i,symbolKeys:r,keySet:new Set(t),numKeys:t.length,optionalKeys:new Set(a)}}function bp(e,t,n,r,i,a,o){let s=[],c=i.keySet,l=i.catchall._zod,u=l.def.type,d=l.optin,f=l.optout,p=0;for(let i in t){if(o&&n.issues.length!==p){if(fu(n,p))break;p=n.issues.length}if(c.has(i))continue;if(i===`__proto__`){u===`never`&&s.push(i);continue}if(u===`never`){s.push(i);continue}let a=l.run({value:t[i],issues:[]},r);a instanceof Promise?e.push(a.then(e=>_p(e,n,i,t,d,f))):_p(a,n,i,t,d,f)}return s.length&&n.issues.push({code:`unrecognized_keys`,keys:s,input:t,inst:a,continue:!0}),e.length?Promise.all(e).then(()=>n):n}var xp=L(`$ZodObject`,(e,t)=>{vf.init(e,t);let n=Object.getOwnPropertyDescriptor(t,`shape`),r=n?.get?n.get.raw:t.shape??{};if(r){let e=()=>{let n={...r};return Object.defineProperty(t,"shape",{value:n}),e.raw=n,n};e.raw=r,Object.defineProperty(t,"shape",{get:e})}let i=kl(()=>yp(t));I(e,`propValues`,e=>{let t=e.def.shape,n={};for(let e in t){let r=t[e]._zod;if(r.values){Object.prototype.hasOwnProperty.call(n,e)||Fl(n,e,new Set);for(let t of r.values)n[e].add(t);r.optin!==void 0&&n[e].add(void 0)}}return n});let a=Kl,o=t.catchall,s,c=Vu.memoizer;c?.attach(e),e._zod.parse=(t,n)=>{s??=i.value;let r=t.value;if(!a(r))return t.issues.push({expected:`object`,code:`invalid_type`,input:r,inst:e}),t;t.value=c?c.alloc(e,t,{},n):{};let l=[],u=s.shape,d=n?.abortEarly,f=t.issues.length;for(let e of s.allKeys){if(d&&t.issues.length!==f){if(fu(t,f))break;f=t.issues.length}if(e===`__proto__`)continue;let i=u[e],a=i._zod.optin,o=i._zod.optout,s=i._zod.run({value:r[e],issues:[]},n);s instanceof Promise?l.push(s.then(n=>_p(n,t,e,r,a,o))):_p(s,t,e,r,a,o)}return o?bp(l,r,t,n,i.value,e,d===!0):l.length?Promise.all(l).then(()=>t):t}}),Sp=L(`$ZodObjectJIT`,(e,t)=>{xp.init(e,t);let n=e._zod.parse,r=kl(()=>yp(t)),i=Vu.memoizer,a=t=>{let n=r.value,a=n.symbolKeys,o=new gf([`payload`,`ctx`],{shape:t,inst:e,memo:i,syms:a}),s=e=>`shape[${e}]._zod.run({ value: input[${e}], issues: [] }, ctx)`,c=(e,t)=>` - let ${e}_ab = false; - for (let i = 0; i < ${e}.issues.length; i++) { - const iss = ${e}.issues[i]; - iss.path = iss.path ? [${t}, ...iss.path] : [${t}]; - payload.issues.push(iss); - if (iss.continue !== true) ${e}_ab = true; - } - if (${e}_ab && ctx && ctx.abortEarly) { - payload.value = newResult; - return payload; - }`;o.write(`const input = payload.value;`);let l=Object.create(null),u=0;for(let e of n.allKeys)l[e]=`key_${u++}`;o.write(i?`const newResult = memo.alloc(inst, payload, {}, ctx);`:`const newResult = {};`);for(let e of n.allKeys){if(e===`__proto__`)continue;let n=l[e],r=typeof e==`symbol`?`syms[${a.indexOf(e)}]`:Ul(e),i=`${r} in input`,u=t[e],d=u?._zod?.optin,f=d!==void 0,p=u?._zod?.optout===`optional`;if(o.write(`const ${n} = ${s(r)};`),f&&p){let e=d===`optional`?`${n}_present`:`${n}.value !== undefined || ${n}_present`;o.write(` - const ${n}_present = ${i}; - if (!${n}.issues.length || ${n}_present) { - if (${n}.issues.length) {${c(n,r)} - } - - if (${e}) { - newResult[${r}] = ${n}.value; - } - } - - `)}else f?(o.write(` - if (${n}.issues.length) {${c(n,r)} - } - `),d===`defaulted`?o.write(`newResult[${r}] = ${n}.value;`):o.write(` - if (${n}.value !== undefined || ${i}) { - newResult[${r}] = ${n}.value; - } - `)):o.write(` - const ${n}_present = ${i}; - if (${n}.issues.length) {${c(n,r)} - } - if (!${n}_present && !${n}.issues.length) { - payload.issues.push({ - code: "invalid_type", - expected: "nonoptional", - input: undefined, - path: [${r}] - }); - if (ctx && ctx.abortEarly) { - payload.value = newResult; - return payload; - } - } - - if (${n}_present) { - newResult[${r}] = ${n}.value; - } - - `)}return o.write(`payload.value = newResult;`),o.write(`return payload;`),o.compile()},o,s=Kl,c=!Vu.jitless,l=c&&ql.value,u=t.catchall,d;e._zod.parse=(i,f)=>{d??=r.value;let p=i.value;return s(p)?c&&l&&f?.async===!1&&f.jitless!==!0?(o||=a(t.shape),i=o(i,f),u?bp([],p,i,f,d,e,f?.abortEarly===!0):i):n(i,f):(i.issues.push({expected:`object`,code:`invalid_type`,input:p,inst:e}),i)}});function Cp(e,t,n,r){for(let n of e)if(n.issues.length===0)return t.value=n.value,t;let i=e.filter(e=>!fu(e));return i.length===1?(t.value=i[0].value,i[0]):(t.issues.push({code:`invalid_union`,input:t.value,inst:n,errors:e.map(e=>e.issues.map(e=>gu(e,r,Hu())))}),t)}var wp=L(`$ZodUnion`,(e,t)=>{vf.init(e,t),I(e,`optin`,e=>e.def.options.some(e=>e._zod.optin===`defaulted`)?`defaulted`:e.def.options.some(e=>e._zod.optin!==void 0)?`optional`:void 0),I(e,`optout`,e=>e.def.options.some(e=>e._zod.optout===`optional`)?`optional`:void 0),I(e,`values`,e=>{if(e.def.options.every(e=>e._zod.values))return new Set(e.def.options.flatMap(e=>Array.from(e._zod.values)))}),I(e,`pattern`,e=>{if(e.def.options.every(e=>e._zod.pattern)){let t=e.def.options.map(e=>e._zod.pattern);return RegExp(`^(${t.map(e=>jl(e.source)).join(`|`)})$`)}});let n=t.options.length===1?t.options[0]._zod.run:null;e._zod.parse=(r,i)=>{if(n)return n(r,i);let a=!1,o=[];for(let e of t.options){let t=e._zod.run({value:r.value,issues:[]},i);if(t instanceof Promise)o.push(t),a=!0;else{if(t.issues.length===0)return t;o.push(t)}}return a?Promise.all(o).then(t=>Cp(t,r,e,i)):Cp(o,r,e,i)}});function Tp(e){let t=new Map;for(let n of e.options){let r=n._zod.propValues?.[e.discriminator];if(!r||r.size===0)throw Error(`Invalid discriminated union option at index "${e.options.indexOf(n)}"`);for(let e of r)if(t.has(e)){if(e!==void 0)throw Error(`Duplicate discriminator value "${String(e)}"`);t.set(e,null)}else t.set(e,n)}return t}var Ep=L(`$ZodDiscriminatedUnion`,(e,t)=>{t.inclusive=!1,wp.init(e,t);let n=e._zod.parse;I(e,`propValues`,e=>{let t={},n=0;for(let r of e.def.options){let i=r._zod.propValues;if(!i||Object.keys(i).length===0)throw Error(`Invalid discriminated union option at index "${e.def.options.indexOf(r)}"`);i[e.def.discriminator]?.has(void 0)&&n++;for(let[e,n]of Object.entries(i)){Object.prototype.hasOwnProperty.call(t,e)||Fl(t,e,new Set);for(let r of n)t[e].add(r)}}return!e.def.unionFallback&&n>1&&t[e.def.discriminator]?.delete(void 0),t}),t.options.forEach((e,n)=>{let r=Il(e._zod.def);if(r&&!Object.prototype.hasOwnProperty.call(r,t.discriminator))throw Error(`Invalid discriminated union option at index "${n}"`)});let r=kl(()=>Tp(t));e._zod.parse=(i,a)=>{let o=i.value;if(!Kl(o))return i.issues.push({code:`invalid_type`,expected:`object`,input:o,inst:e}),i;let s=o?.[t.discriminator],c=r.value.get(s);return c&&(s!==void 0||a.direction!==`backward`)?c._zod.run(i,a):t.unionFallback||a.direction===`backward`?n(i,a):(i.issues.push({code:`invalid_union`,errors:[],note:`No matching discriminator`,discriminator:t.discriminator,options:Array.from(r.value.keys()).filter(e=>r.value.get(e)!==null),input:o,path:[t.discriminator],inst:e}),i)}}),Dp=L(`$ZodIntersection`,(e,t)=>{vf.init(e,t),e._zod.parse=(e,n)=>{let r=e.value,i=t.left._zod.run({value:r,issues:[]},n),a=t.right._zod.run({value:r,issues:[]},n);return i instanceof Promise||a instanceof Promise?Promise.all([i,a]).then(([t,n])=>kp(e,t,n)):kp(e,i,a)}});function Op(e,t){if(e===t||e instanceof Date&&t instanceof Date&&+e==+t)return{valid:!0,data:e};if(Jl(e)&&Jl(t)){let n=Object.keys(t),r=Object.keys(e).filter(e=>n.indexOf(e)!==-1),i={...e,...t};Object.prototype.hasOwnProperty.call(i,`__proto__`)&&delete i.__proto__;for(let n of r){if(n===`__proto__`)continue;let r=Op(e[n],t[n]);if(!r.valid)return{valid:!1,mergeErrorPath:[n,...r.mergeErrorPath]};i[n]=r.data}return{valid:!0,data:i}}if(Array.isArray(e)&&Array.isArray(t)){if(e.length!==t.length)return{valid:!1,mergeErrorPath:[]};let n=[];for(let r=0;r{let n;if(e.code===`unrecognized_keys`&&!e.path?.length)i??=e,n=e.keys;else if(e.code===`invalid_key`&&e.origin===`record`&&e.path?.length===1){let t=String(e.path[0]);a.has(t)||a.set(t,e),n=[t]}else return!1;for(let e of n)r.has(e)||r.set(e,{}),r.get(e)[t]=!0;return!0};for(let n of t.issues)o(n,`l`)||e.issues.push(n);for(let t of n.issues)o(t,`r`)||e.issues.push(t);let s=[...r].filter(([,e])=>e.l&&e.r).map(([e])=>e);if(s.length){let t=i?s.filter(e=>i.keys.includes(e)):[];t.length&&e.issues.push({...i,keys:t});for(let n of s)!t.includes(n)&&a.has(n)&&e.issues.push(a.get(n))}let c=Op(t.value,n.value);if(!c.valid){if(fu(e))return e;throw Error(`Unmergable intersection. Error path: ${JSON.stringify(c.mergeErrorPath)}`)}return e.value=c.data,e}var Ap=L(`$ZodRecord`,(e,t)=>{vf.init(e,t);let n=Vu.memoizer;n?.attach(e),e._zod.parse=(r,i)=>{let a=r.value;if(!Jl(a))return r.issues.push({expected:`record`,code:`invalid_type`,input:a,inst:e}),r;let o=[],s=t.keyType._zod.values;if(s&&!t.partial){r.value=n?n.alloc(e,r,{},i):{};let c=new Set;for(let n of s)if(typeof n==`string`||typeof n==`number`||typeof n==`symbol`){if(c.add(typeof n==`number`?n.toString():n),n===`__proto__`)continue;let s=t.keyType._zod.run({value:n,issues:[]},i);if(s instanceof Promise)throw Error(`Async schemas not supported in object keys currently`);if(s.issues.length){r.issues.push({code:`invalid_key`,origin:`record`,issues:s.issues.map(e=>gu(e,i,Hu())),input:n,path:[n],inst:e});continue}let l=s.value;if(l===`__proto__`)continue;let u=t.valueType._zod.run({value:a[n],issues:[]},i);u instanceof Promise?o.push(u.then(e=>{e.issues.length&&r.issues.push(...mu(n,e.issues)),r.value[l]=e.value})):(u.issues.length&&r.issues.push(...mu(n,u.issues)),r.value[l]=u.value)}let l;for(let e in a)if(!c.has(e)){if(t.mode===`loose`){if(e===`__proto__`)continue;r.value[e]=a[e]}else l??=[],l.push(e)}l&&l.length>0&&r.issues.push({code:`unrecognized_keys`,input:a,inst:e,keys:l,continue:!0})}else{r.value=n?n.alloc(e,r,{},i):{};let c;for(let n of Reflect.ownKeys(a)){if(n===`__proto__`||!Object.prototype.propertyIsEnumerable.call(a,n))continue;let l=t.keyType._zod.run({value:n,issues:[]},i);if(l instanceof Promise)throw Error(`Async schemas not supported in object keys currently`);if(typeof n==`string`&&Gd.test(n)&&l.issues.length){let e=t.keyType._zod.run({value:Number(n),issues:[]},i);if(e instanceof Promise)throw Error(`Async schemas not supported in object keys currently`);e.issues.length===0&&(l=e)}if(l.issues.length){t.mode===`loose`?r.value[n]=a[n]:s?(c??=[],c.push(n)):r.issues.push({code:`invalid_key`,origin:`record`,issues:l.issues.map(e=>gu(e,i,Hu())),input:n,path:[n],inst:e});continue}let u=l.value;if(u===`__proto__`)continue;let d=t.valueType._zod.run({value:a[n],issues:[]},i);d instanceof Promise?o.push(d.then(e=>{e.issues.length&&r.issues.push(...mu(n,e.issues)),r.value[u]=e.value})):(d.issues.length&&r.issues.push(...mu(n,d.issues)),r.value[u]=d.value)}c&&c.length>0&&r.issues.push({code:`unrecognized_keys`,input:a,inst:e,keys:c,continue:!0})}return o.length?Promise.all(o).then(()=>r):r}}),jp=L(`$ZodEnum`,(e,t)=>{vf.init(e,t);let n=Tl(t.entries),r=new Set(n);e._zod.values=r,I(e,`pattern`,e=>{let t=Tl(e.def.entries).filter(e=>Xl.has(typeof e));return RegExp(t.length?`^(${t.map(e=>Zl(e.toString())).join(`|`)})$`:`^[^\\s\\S]$`)}),e._zod.parse=(t,i)=>{let a=t.value;return r.has(a)||t.issues.push({code:`invalid_value`,values:n,input:a,inst:e}),t}}),Mp=L(`$ZodLiteral`,(e,t)=>{vf.init(e,t);let n=new Set(t.values);e._zod.values=n,I(e,`pattern`,e=>{let t=e.def.values;return RegExp(t.length?`^(${t.map(e=>typeof e==`string`?Zl(e):e?Zl(e.toString()):String(e)).join(`|`)})$`:`^[^\\s\\S]$`)}),e._zod.parse=(r,i)=>{let a=r.value;return n.has(a)||r.issues.push({code:`invalid_value`,values:t.values,input:a,inst:e}),r}}),Np=L(`$ZodTransform`,(e,t)=>{vf.init(e,t),e._zod.optin=`optional`,Vu.memoizer?.guard(e),e._zod.parse=(n,r)=>{if(r.direction===`backward`)throw new Bu(e.constructor.name);let i=t.transform(n.value,n);if(r.async)return(i instanceof Promise?i:Promise.resolve(i)).then(e=>(n.value=e,n));if(i instanceof Promise)throw new zu;return n.value=i,n}});function Pp(e,t){return e.value=t.issues.length?void 0:t.value,e}var Fp=L(`$ZodOptional`,(e,t)=>{vf.init(e,t),I(e,`optin`,e=>e.def.innerType._zod.optin===`defaulted`?`defaulted`:`optional`),e._zod.optout=`optional`,I(e,`values`,e=>{let t=e.def.innerType._zod.values;return t?new Set([...t,void 0]):void 0}),I(e,`pattern`,e=>{let t=e.def.innerType._zod.pattern;return t?RegExp(`^(${jl(t.source)})?$`):void 0}),e._zod.parse=(e,n)=>{if(e.value===void 0){if(t.innerType._zod.optin!==`defaulted`)return e;let r=t.innerType._zod.run({value:e.value,issues:[]},n);return r instanceof Promise?r.then(t=>Pp(e,t)):Pp(e,r)}return t.innerType._zod.run(e,n)}}),Ip=L(`$ZodExactOptional`,(e,t)=>{Fp.init(e,t),I(e,`values`,e=>e.def.innerType._zod.values),I(e,`pattern`,e=>e.def.innerType._zod.pattern),e._zod.parse=(e,n)=>t.innerType._zod.run(e,n)}),Lp=L(`$ZodNullable`,(e,t)=>{vf.init(e,t),I(e,`optin`,e=>e.def.innerType._zod.optin),I(e,`optout`,e=>e.def.innerType._zod.optout),I(e,`pattern`,e=>{let t=e.def.innerType._zod.pattern;return t?RegExp(`^(${jl(t.source)}|null)$`):void 0}),I(e,`values`,e=>e.def.innerType._zod.values?new Set([...e.def.innerType._zod.values,null]):void 0),e._zod.parse=(e,n)=>e.value===null?e:t.innerType._zod.run(e,n)}),Rp=L(`$ZodDefault`,(e,t)=>{vf.init(e,t),e._zod.optin=`defaulted`,I(e,`values`,e=>e.def.innerType._zod.values),e._zod.parse=(e,n)=>{if(n.direction===`backward`)return t.innerType._zod.run(e,n);if(e.value===void 0)return e.value=t.defaultValue,e;let r=t.innerType._zod.run(e,n);return r instanceof Promise?r.then(e=>zp(e,t)):zp(r,t)}});function zp(e,t){return e.value===void 0&&(e.value=t.defaultValue),e}var Bp=L(`$ZodPrefault`,(e,t)=>{vf.init(e,t),e._zod.optin=`defaulted`,I(e,`values`,e=>e.def.innerType._zod.values),e._zod.parse=(e,n)=>(n.direction===`backward`||e.value===void 0&&(e.value=t.defaultValue),t.innerType._zod.run(e,n))}),Vp=L(`$ZodNonOptional`,(e,t)=>{vf.init(e,t),I(e,`values`,e=>{let t=e.def.innerType._zod.values;return t?new Set([...t].filter(e=>e!==void 0)):void 0}),e._zod.parse=(n,r)=>{let i=t.innerType._zod.run(n,r);return i instanceof Promise?i.then(t=>Hp(t,e)):Hp(i,e)}});function Hp(e,t){return!e.issues.length&&e.value===void 0&&e.issues.push({code:`invalid_type`,expected:`nonoptional`,input:e.value,inst:t}),e}function Up(e,t,n,r){return t.issues.length?(e.value=n.catchValue({...t,value:e.value,error:{issues:t.issues.map(e=>gu(e,r,Hu()))},input:e.value}),e):(e.value=t.value,t.memo&&(e.memo=!0),e)}var Wp=L(`$ZodCatch`,(e,t)=>{vf.init(e,t),I(e,`optin`,e=>e.def.innerType._zod.optin===`defaulted`?`defaulted`:`optional`),I(e,`optout`,e=>e.def.innerType._zod.optout),I(e,`values`,e=>e.def.innerType._zod.values),e._zod.parse=(e,n)=>{if(n.direction===`backward`)return t.innerType._zod.run(e,n);let r=t.innerType._zod.run({value:e.value,issues:[]},n);return r instanceof Promise?r.then(r=>Up(e,r,t,n)):Up(e,r,t,n)}}),Gp=L(`$ZodPipe`,(e,t)=>{vf.init(e,t),I(e,`values`,e=>e.def.in._zod.values),I(e,`optin`,e=>e.def.in._zod.optin),I(e,`optout`,e=>e.def.out._zod.optout),I(e,`propValues`,e=>e.def.in._zod.propValues),e._zod.parse=(e,n)=>{if(n.direction===`backward`){let r=t.out._zod.run(e,n);return r instanceof Promise?r.then(e=>Kp(e,t.in,n)):Kp(r,t.in,n)}let r=t.in._zod.run(e,n);return r instanceof Promise?r.then(e=>Kp(e,t.out,n)):Kp(r,t.out,n)}});function Kp(e,t,n){return e.issues.some(e=>e.code!==`unrecognized_keys`)?(e.aborted=!0,e):t._zod.run({value:e.value,issues:e.issues},n)}var qp=L(`$ZodPreprocess`,(e,t)=>{Gp.init(e,t)}),Jp=L(`$ZodReadonly`,(e,t)=>{vf.init(e,t),I(e,`propValues`,e=>e.def.innerType._zod.propValues),I(e,`values`,e=>e.def.innerType._zod.values),I(e,`optin`,e=>e.def.innerType?._zod?.optin),I(e,`optout`,e=>e.def.innerType?._zod?.optout),e._zod.parse=(e,n)=>{if(n.direction===`backward`)return t.innerType._zod.run(e,n);let r=t.innerType._zod.run(e,n);return r instanceof Promise?r.then(Yp):Yp(r)}});function Yp(e){return e.memo||(e.value=Object.freeze(e.value)),e}var Xp=L(`$ZodLazy`,(e,t)=>{vf.init(e,t),Pl(e._zod,`innerType`,()=>{let e=t;return e._cachedInner||=t.getter(),e._cachedInner}),I(e,`pattern`,e=>e.innerType?._zod?.pattern),I(e,`propValues`,e=>e.innerType?._zod?.propValues),I(e,`optin`,e=>e.innerType?._zod?.optin??void 0),I(e,`optout`,e=>e.innerType?._zod?.optout??void 0),e._zod.parse=(t,n)=>e._zod.innerType._zod.run(t,n)}),Zp=L(`$ZodCustom`,(e,t)=>{Zd.init(e,t),vf.init(e,t),e._zod.parse=(e,t)=>e,e._zod.check=n=>{let r=n.value,i=t.fn(r);if(i instanceof Promise)return i.then(t=>Qp(t,n,r,e));Qp(i,n,r,e)}});function Qp(e,t,n,r){if(!e){let e={code:`custom`,input:n,inst:r,path:[...r._zod.def.path??[]],continue:!r._zod.def.abort};r._zod.def.params&&(e.params=r._zod.def.params),t.issues.push(xu(e))}}var $p=class extends Error{constructor(){super(`Cannot parse a reference cycle that closes through a transform`),this.name=`ZodCyclicError`}},em=`~memo`,tm=[];function nm(e){return typeof e==`object`&&!!e}function rm(e){return e.map(e=>e.path?{...e,path:e.path.slice()}:{...e})}var im=new WeakMap,am=0,om=1,sm=2;function cm(e,t,n){let r=im.get(e);if(r!==void 0)return r?sm:am;if(t.has(e))return sm;t.add(e);let i=am,a=e=>{if(i!==sm&&e?._zod){let r=cm(e,t,n);r>i&&(i=r)}},o=(e,r)=>{let i=am;for(let a of Reflect.ownKeys(e)){let o=Object.getOwnPropertyDescriptor(e,a);if(r&&!o.enumerable)continue;let s=o.get?om:o.value?._zod?cm(o.value,t,n):am;s>i&&(i=s)}return i},s=e=>{e>i&&(i=e)},c=e._zod.def;switch(c.type){case`object`:{let e=Il(c);s(e?o(e,!0):om),a(c.catchall);break}case`array`:a(c.element);break;case`tuple`:for(let e of c.items)a(e);a(c.rest);break;case`record`:case`map`:a(c.keyType),a(c.valueType);break;case`set`:a(c.valueType);break;case`union`:for(let e of c.options)a(e);break;case`intersection`:a(c.left),a(c.right);break;case`optional`:case`nullable`:case`default`:case`prefault`:case`catch`:case`readonly`:case`nonoptional`:case`promise`:case`success`:a(c.innerType);break;case`pipe`:a(c.in),a(c.out);break;case`function`:a(c.input),a(c.output);break;case`lazy`:{let r=c._cachedInner??(n?e._zod.innerType:void 0);s(r?cm(r,t,!1):om);break}case`template_literal`:case`string`:case`number`:case`int`:case`boolean`:case`bigint`:case`symbol`:case`undefined`:case`null`:case`void`:case`never`:case`any`:case`unknown`:case`date`:case`nan`:case`enum`:case`literal`:case`file`:case`transform`:case`custom`:break;default:for(let e in c){let t=Object.getOwnPropertyDescriptor(c,e);if(!t||t.get)continue;let n=t.value;if(n&&typeof n==`object`){if(n._zod)a(n);else if(Array.isArray(n))for(let e of n)a(e)}}}return t.delete(e),lm(e,i)}function lm(e,t){return t!==om&&im.set(e,t===sm),t}function um(e,t){let n=e.buckets.get(t);return n||(n=new WeakMap,e.buckets.set(t,n)),n}var dm,fm=[],pm={alloc(e,t,n){let r=dm;if(!r)return n;dm=void 0;let i={value:n,issues:null};return r.set(t.value,i),fm.push(i),n},guard(e){var t;(t=e._zod).deferred??(t.deferred=[]),e._zod.deferred.push(()=>{let t=e._zod.parse,n=(e,n)=>{if(n.direction!==`backward`&&hm(n,e.value))throw new $p;return t(e,n)};e._zod.parse=n,e._zod.run===t&&(e._zod.run=n)})},attach(e){var t;let n,r=!1,i,a;(t=e._zod).deferred??(t.deferred=[]),e._zod.deferred.push(()=>{let t=e._zod.parse,o=(s,c)=>{if(n===void 0){let i=cm(e,new Set,!1);if(i===am)return e._zod.parse=t,e._zod.run===o&&(e._zod.run=t),t(s,c);i===sm||r?n=!0:r=!0}let l=s.value;if(!nm(l))return t(s,c);let u=c[em];u||(u={buckets:new WeakMap,backEdges:void 0},c[em]=u);let d;i===c?d=a:(d=um(u,e),i=c,a=d);let f=d.get(l);if(f)return s.value=f.value,f.issues?f.issues.length&&s.issues.push(...rm(f.issues)):(s.memo=!0,u.backEdges??(u.backEdges=new WeakSet),u.backEdges.add(f.value)),s;dm=d;let p=fm.length,m=t(s,c);dm=void 0;let h=fm.length>p?fm.pop():void 0;return m instanceof Promise?m.then(e=>(h&&(h.issues=e.issues.length?rm(e.issues):tm),e)):(h&&(h.issues=m.issues.length?rm(m.issues):tm),m)};e._zod.parse=o,e._zod.run===t&&(e._zod.run=o)})}};function mm(){return pm}function hm(e,t){let n=e[em]?.backEdges;return n!==void 0&&nm(t)&&n.has(t)}var gm=()=>{let e={string:{unit:`characters`,verb:`to have`},file:{unit:`bytes`,verb:`to have`},array:{unit:`items`,verb:`to have`},set:{unit:`items`,verb:`to have`},map:{unit:`entries`,verb:`to have`}};function t(t){return e[t]??null}let n={regex:`input`,email:`email address`,url:`URL`,emoji:`emoji`,uuid:`UUID`,uuidv4:`UUIDv4`,uuidv6:`UUIDv6`,nanoid:`nanoid`,guid:`GUID`,cuid:`cuid`,cuid2:`cuid2`,ulid:`ULID`,xid:`XID`,ksuid:`KSUID`,datetime:`ISO datetime`,date:`ISO date`,time:`ISO time`,duration:`ISO duration`,ipv4:`IPv4 address`,ipv6:`IPv6 address`,mac:`MAC address`,cidrv4:`IPv4 range`,cidrv6:`IPv6 range`,base64:`base64-encoded string`,base64url:`base64url-encoded string`,json_string:`JSON string`,e164:`E.164 number`,currency_code:`currency code`,credit_card:`credit card number`,iban:`IBAN`,jwt:`JWT`,template_literal:`input`},r={nan:`NaN`};function i(e,t){return e===`number`&&typeof t==`number`&&!Number.isFinite(t)?String(t):r[e]??e}return e=>{switch(e.code){case`invalid_type`:return`Invalid input: expected ${i(e.expected)}, received ${i(bu(e.input),e.input)}`;case`invalid_value`:return e.values.length===1?`Invalid input: expected ${$l(e.values[0])}`:`Invalid option: expected one of ${El(e.values,`|`)}`;case`too_big`:{let n=e.exact?`exactly `:e.inclusive?`<=`:`<`,r=t(e.origin);return r?`Too big: expected ${e.origin??`value`} to have ${n}${e.maximum.toString()} ${r.unit??`elements`}`:`Too big: expected ${e.origin??`value`} to be ${n}${e.maximum.toString()}`}case`too_small`:{let n=e.exact?`exactly `:e.inclusive?`>=`:`>`,r=t(e.origin);return r?`Too small: expected ${e.origin} to have ${n}${e.minimum.toString()} ${r.unit}`:`Too small: expected ${e.origin} to be ${n}${e.minimum.toString()}`}case`invalid_format`:{let t=e;return t.format===`starts_with`?`Invalid string: must start with "${t.prefix}"`:t.format===`ends_with`?`Invalid string: must end with "${t.suffix}"`:t.format===`includes`?`Invalid string: must include "${t.includes}"`:t.format===`regex`?`Invalid string: must match pattern ${t.pattern}`:`Invalid ${n[t.format]??e.format}`}case`not_multiple_of`:return`Invalid number: must be a multiple of ${e.divisor}`;case`unrecognized_keys`:return`Unrecognized key${e.keys.length>1?`s`:``}: ${El(e.keys,`, `)}`;case`invalid_key`:return`Invalid key in ${e.origin}`;case`invalid_union`:return e.options&&Array.isArray(e.options)&&e.options.length>0?`Invalid discriminator value. Expected ${e.options.map(e=>`'${e}'`).join(` | `)}`:e.inclusive===!1?`Invalid input: more than one option matched`:`Invalid input`;case`invalid_element`:return`Invalid value in ${e.origin}`;default:return`Invalid input`}}};function _m(){return{localeError:gm()}}var vm,ym=class{constructor(){this._map=new WeakMap,this._idmap=new Map}add(e,...t){let n=t[0];return this._map.set(e,n),n&&typeof n==`object`&&`id`in n&&this._idmap.set(n.id,e),this}clear(){return this._map=new WeakMap,this._idmap=new Map,this}remove(e){let t=this._map.get(e);return t&&typeof t==`object`&&`id`in t&&this._idmap.delete(t.id),this._map.delete(e),this}get(e){let t=e._zod.parent;if(t){let n={...this.get(t)??{}};delete n.id;let r={...n,...this._map.get(e)};return Object.keys(r).length?r:void 0}return this._map.get(e)}has(e){return this._map.has(e)}};function bm(){return new ym}(vm=globalThis).__zod_globalRegistry??(vm.__zod_globalRegistry=bm());var xm=globalThis.__zod_globalRegistry;function Sm(e){return e.checks&&=[...e.checks],e}function Cm(e,t){return new e(Sm({type:`string`,...P(t)}))}function wm(e,t){return new e({type:`string`,format:`email`,check:`string_format`,abort:!1,...P(t)})}function Tm(e,t){return new e({type:`string`,format:`guid`,check:`string_format`,abort:!1,...P(t)})}function Em(e,t){return new e({type:`string`,format:`uuid`,check:`string_format`,abort:!1,...P(t)})}function Dm(e,t){return new e({type:`string`,format:`uuid`,check:`string_format`,abort:!1,version:`v4`,...P(t)})}function Om(e,t){return new e({type:`string`,format:`uuid`,check:`string_format`,abort:!1,version:`v6`,...P(t)})}function km(e,t){return new e({type:`string`,format:`uuid`,check:`string_format`,abort:!1,version:`v7`,...P(t)})}function Am(e,t){return new e({type:`string`,format:`url`,check:`string_format`,abort:!1,...P(t)})}function jm(e,t){return new e({type:`string`,format:`emoji`,check:`string_format`,abort:!1,...P(t)})}function Mm(e,t){return new e({type:`string`,format:`nanoid`,check:`string_format`,abort:!1,...P(t)})}function Nm(e,t){return new e({type:`string`,format:`cuid`,check:`string_format`,abort:!1,...P(t)})}function Pm(e,t){return new e({type:`string`,format:`cuid2`,check:`string_format`,abort:!1,...P(t)})}function Fm(e,t){return new e({type:`string`,format:`ulid`,check:`string_format`,abort:!1,...P(t)})}function Im(e,t){return new e({type:`string`,format:`xid`,check:`string_format`,abort:!1,...P(t)})}function Lm(e,t){return new e({type:`string`,format:`ksuid`,check:`string_format`,abort:!1,...P(t)})}function Rm(e,t){return new e({type:`string`,format:`ipv4`,check:`string_format`,abort:!1,...P(t)})}function zm(e,t){return new e({type:`string`,format:`ipv6`,check:`string_format`,abort:!1,...P(t)})}function Bm(e,t){return new e({type:`string`,format:`cidrv4`,check:`string_format`,abort:!1,...P(t)})}function Vm(e,t){return new e({type:`string`,format:`cidrv6`,check:`string_format`,abort:!1,...P(t)})}function Hm(e,t){return new e({type:`string`,format:`base64`,check:`string_format`,abort:!1,...P(t)})}function Um(e,t){return new e({type:`string`,format:`base64url`,check:`string_format`,abort:!1,...P(t)})}function Wm(e,t){return new e({type:`string`,format:`e164`,check:`string_format`,abort:!1,...P(t)})}function Gm(e,t){return new e({type:`string`,format:`jwt`,check:`string_format`,abort:!1,...P(t)})}function Km(e,t){return new e({type:`string`,format:`datetime`,check:`string_format`,offset:!1,local:!1,precision:null,...P(t)})}function qm(e,t){return new e({type:`string`,format:`date`,check:`string_format`,...P(t)})}function Jm(e,t){return new e({type:`string`,format:`time`,check:`string_format`,precision:null,...P(t)})}function Ym(e,t){return new e({type:`string`,format:`duration`,check:`string_format`,...P(t)})}function Xm(e,t){return new e(Sm({type:`number`,checks:[],...P(t)}))}function Zm(e,t){return new e(Sm({type:`number`,coerce:!0,checks:[],...P(t)}))}function Qm(e,t){return new e({type:`number`,check:`number_format`,abort:!1,format:`safeint`,...P(t)})}function $m(e,t){return new e({type:`boolean`,...P(t)})}function eh(e,t){return new e({type:`undefined`,...P(t)})}function th(e,t){return new e({type:`null`,...P(t)})}function nh(e){return new e({type:`any`})}function rh(e){return new e({type:`unknown`})}function ih(e,t){return new e({type:`never`,...P(t)})}function ah(e,t){return new ef({check:`less_than`,...P(t),value:e,inclusive:!1})}function oh(e,t){return new ef({check:`less_than`,...P(t),value:e,inclusive:!0})}function sh(e,t){return new tf({check:`greater_than`,...P(t),value:e,inclusive:!1})}function ch(e,t){return new tf({check:`greater_than`,...P(t),value:e,inclusive:!0})}function lh(e,t){return new nf({check:`multiple_of`,...P(t),value:e})}function uh(e,t){return new af({check:`max_length`,...P(t),maximum:e})}function dh(e,t){return new of({check:`min_length`,...P(t),minimum:e})}function fh(e,t){return new sf({check:`length_equals`,...P(t),length:e})}function ph(e,t){return new lf({check:`string_format`,format:`regex`,...P(t),pattern:e})}function mh(e){return new uf({check:`string_format`,format:`lowercase`,...P(e)})}function hh(e){return new df({check:`string_format`,format:`uppercase`,...P(e)})}function gh(e,t){return new ff({check:`string_format`,format:`includes`,...P(t),includes:e})}function _h(e,t){return new pf({check:`string_format`,format:`starts_with`,...P(t),prefix:e})}function vh(e,t){return new mf({check:`string_format`,format:`ends_with`,...P(t),suffix:e})}function yh(e){return new hf({check:`overwrite`,tx:e})}function bh(e){return yh(t=>t.normalize(e))}function xh(){return yh(e=>e.trim())}function Sh(){return yh(e=>e.toLowerCase())}function Ch(){return yh(e=>e.toUpperCase())}function wh(){return yh(e=>Wl(e))}function Th(e,t,n){return new e({type:`array`,element:t,...P(n)})}function Eh(e,t,n){let r=P(n);return r.abort??=!0,new e({type:`custom`,check:`custom`,fn:t,...r})}function Dh(e,t,n){return new e({type:`custom`,check:`custom`,fn:t,...P(n)})}function Oh(e,t){let n=kh(t=>(t.addIssue=e=>{if(typeof e==`string`)t.issues.push(xu(e,t.value,n._zod.def));else{let r=e;r.fatal&&(r.continue=!1),r.code??=`custom`,`input`in r||(r.input=t.value),r.inst??=n,r.continue??=!n._zod.def.abort,t.issues.push(xu(r))}},e(t.value,t)),t);return n}function kh(e,t){let n=new Zd({check:`custom`,...P(t)});return n._zod.check=e,n}function Ah(e,...t){for(let n of t)for(let t of Reflect.ownKeys(n))Object.prototype.propertyIsEnumerable.call(n,t)&&Fl(e,t,n[t]);return e}function jh(e){let t=e?.target??`draft-2020-12`;return t===`draft-4`&&(t=`draft-04`),t===`draft-7`&&(t=`draft-07`),{processors:e.processors??{},metadataRegistry:e?.metadata??xm,target:t,unrepresentable:e?.unrepresentable??`throw`,override:e?.override??(()=>{}),io:e?.io??`output`,counter:0,seen:new Map,sharedDefsExtractedFor:void 0,sharedEmitDoneFor:void 0,cycles:e?.cycles??`ref`,reused:e?.reused??`inline`,intersections:[],deferred:[],external:e?.external??void 0}}function Mh(e,t,n,r,i){let a=typeof t.unrepresentable==`function`?t.unrepresentable({zodSchema:e,path:r.path,message:i}):t.unrepresentable;if(a===`any`)return!1;if(a===void 0||a===`throw`)throw Error(i);return Object.assign(n,a),!0}function Nh(e,t,n={path:[],schemaPath:[]}){var r;let i=e._zod.def,a=t.seen.get(e);if(a)return a.count++,n.schemaPath.includes(e)&&(a.cycle=n.path),a.schema;let o={schema:{},count:1,cycle:void 0,path:n.path};t.seen.set(e,o),t.sharedDefsExtractedFor=void 0,t.sharedEmitDoneFor=void 0;let s=e._zod.toJSONSchema?.();if(s)o.schema=s;else{let r={...n,schemaPath:[...n.schemaPath,e],path:n.path};if(e._zod.processJSONSchema)e._zod.processJSONSchema(t,o.schema,r);else{let n=o.schema,a=t.processors[i.type];if(!a)throw Error(`[toJSONSchema]: Non-representable type encountered: ${i.type}`);a(e,t,n,r)}let a=e._zod.parent;a&&(o.ref||=a,Nh(a,t,r),t.seen.get(a).isParent=!0)}let c=t.metadataRegistry.get(e);return c&&Ah(o.schema,c),t.io===`input`&&Uh(e)&&(delete o.schema.examples,delete o.schema.default),t.io===`input`&&`_prefault`in o.schema&&((r=o.schema).default??(r.default=o.schema._prefault)),delete o.schema._prefault,t.seen.get(e).schema}function Ph(e){return e.replace(/~/g,`~0`).replace(/\//g,`~1`)}function Fh(e,t){let n=e.seen.get(t);if(!n)throw Error(`Unprocessed schema. This is a bug in Zod.`);if(e.external&&e.sharedDefsExtractedFor===e.external)return;let r=new Map;for(let t of e.seen.entries()){let n=e.metadataRegistry.get(t[0])?.id;if(n){let e=r.get(n);if(e&&e!==t[0])throw Error(`Duplicate schema id "${n}" detected during JSON Schema conversion. Two different schemas cannot share the same id when converted together.`);r.set(n,t[0])}}let i=t=>{let r=e.target===`draft-2020-12`?`$defs`:`definitions`;if(e.external){let n=e.external.registry.get(t[0])?.id,i=e.external.uri??(e=>e);if(n)return{ref:i(n)};let a=t[1].defId??t[1].schema.id??`schema${e.counter++}`;return t[1].defId=a,{defId:a,ref:`${i(`__shared`)}#/${r}/${Ph(a)}`}}let i=`#/${r}/`;if(t[1]===n&&!t[1].schema.id)return{ref:`#`};let a=t[1].schema.id??`__schema${e.counter++}`;return{defId:a,ref:i+Ph(a)}},a=e=>{if(e[1].schema.$ref)return;let t=e[1],{ref:n,defId:r}=i(e);t.def={...t.schema},r&&(t.defId=r);let a=t.schema;for(let e in a)delete a[e];a.$ref=n};if(e.cycles===`throw`)for(let t of e.seen.entries()){let e=t[1];if(e.cycle)throw Error(`Cycle detected: #/${e.cycle?.join(`/`)}/ - -Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}for(let n of e.seen.entries()){let r=n[1];if(t===n[0]){a(n);continue}if(e.external){let r=e.external.registry.get(n[0])?.id;if(t!==n[0]&&r){a(n);continue}}if(e.metadataRegistry.get(n[0])?.id){a(n);continue}if(r.cycle){a(n);continue}r.count>1&&e.reused===`ref`&&a(n)}e.external&&(e.sharedDefsExtractedFor=e.external)}function Ih(e){let t=e.anyOf;if(!Array.isArray(t)||t.length===0||e.type!==void 0)return;let n=[];for(let e of t){if(!e||typeof e!=`object`)return;Ih(e);let t=Object.keys(e);if(t.length!==1||t[0]!==`type`)return;let r=e.type;for(let e of Array.isArray(r)?r:[r]){if(typeof e!=`string`)return;n.includes(e)||n.push(e)}}delete e.anyOf,e.type=n.length===1?n[0]:n}var Lh=new Set([`type`,`properties`,`required`,`additionalProperties`]),Rh=[`oneOf`,`anyOf`];function zh(e){let t=e.additionalProperties;return t===void 0||t===!1||typeof t!=`object`||!t?null:Object.keys(t).length?t:null}function Bh(e){let t=[];for(let n of e){if(typeof n!=`object`||n.type!==`object`)return null;for(let e in n)if(!Lh.has(e))return null;t.push(n)}let n={},r=new Set;for(let e of t){for(let r in e.properties){if(Object.prototype.hasOwnProperty.call(n,r))continue;let e=[];for(let n of t){let t=n.properties?.[r]??zh(n);t!=null&&(e.some(e=>JSON.stringify(e)===JSON.stringify(t))||e.push(t))}Fl(n,r,e.length===1?e[0]:Bh(e)??{allOf:e})}for(let t of e.required??[])r.add(t)}let i={type:`object`,properties:n};if(r.size&&(i.required=[...r]),t.every(e=>e.additionalProperties===!1))i.additionalProperties=!1;else{let e=[];for(let n of t){let t=zh(n);t&&!e.some(e=>JSON.stringify(e)===JSON.stringify(t))&&e.push(t)}e.length===1?i.additionalProperties=e[0]:e.length>1&&(i.additionalProperties={allOf:e})}return i}function Vh(e){let t=e.allOf;if(!Array.isArray(t)||t.length<2)return;for(let t of Lh)if(t in e)return;let n=t.filter(e=>Rh.some(t=>Array.isArray(e[t]))),r=null;if(!n.length)r=Bh(t);else{let e=n[0],i=Rh.find(t=>Array.isArray(e[t]));if(Object.keys(e).length!==1)return;let a=t.filter(t=>t!==e),o=e[i].map(e=>Bh([...a,e]));if(o.some(e=>!e))return;r={[i]:o}}r&&(delete e.allOf,Ah(e,r))}function Hh(e,t){let n=e.seen.get(t);if(!n)throw Error(`Unprocessed schema. This is a bug in Zod.`);let r=t=>{let n=e.seen.get(t);if(n.ref===null)return;let i=n.def??n.schema,a={...i},o=n.ref;if(n.ref=null,o){r(o);let n=e.seen.get(o),s=n.schema;if(s.$ref&&(e.target===`draft-07`||e.target===`draft-04`||e.target===`openapi-3.0`)?(i.allOf=i.allOf??[],i.allOf.push(s)):Ah(i,s),Ah(i,a),t._zod.parent===o)for(let e in i)e!==`$ref`&&e!==`allOf`&&(e in a||delete i[e]);if(s.$ref&&n.def)for(let e in i)e!==`$ref`&&e!==`allOf`&&e in n.def&&JSON.stringify(i[e])===JSON.stringify(n.def[e])&&delete i[e]}let s=t._zod.parent;if(s&&s!==o){r(s);let t=e.seen.get(s);if(t?.schema.$ref&&(i.$ref=t.schema.$ref,t.def))for(let e in i)e!==`$ref`&&e!==`allOf`&&e in t.def&&JSON.stringify(i[e])===JSON.stringify(t.def[e])&&delete i[e]}e.override({zodSchema:t,jsonSchema:i,path:n.path??[]})};if(!e.external||e.sharedEmitDoneFor!==e.external){for(let t of[...e.seen.entries()].reverse())r(t[0]);if(e.target!==`openapi-3.0`)for(let t of e.seen.entries())Ih(t[1].def??t[1].schema);for(let t of e.deferred)t();if(e.intersections.length){let t=new Map;for(let n of e.seen.values())for(let e of[n.schema,n.def]){let n=e?.allOf;if(!Array.isArray(n))continue;let r=t.get(n);r?r.push(e):t.set(n,[e])}for(let n of e.intersections)for(let e of t.get(n)??[])Vh(e)}}let i={};if(e.target===`draft-2020-12`?i.$schema=`https://json-schema.org/draft/2020-12/schema`:e.target===`draft-07`?i.$schema=`http://json-schema.org/draft-07/schema#`:e.target===`draft-04`?i.$schema=`http://json-schema.org/draft-04/schema#`:e.target,e.external?.uri){let n=e.external.registry.get(t)?.id;if(!n)throw Error("Schema is missing an `id` property");i.$id=e.external.uri(n)}Ah(i,n.defId?n.schema:n.def??n.schema);let a=e.metadataRegistry.get(t)?.id;a!==void 0&&i.id===a&&delete i.id;let o=e.external?.defs??{};if(!e.external||e.sharedEmitDoneFor!==e.external)for(let t of e.seen.entries()){let e=t[1];e.def&&e.defId&&(e.def.id===e.defId&&delete e.def.id,Fl(o,e.defId,e.def))}e.external&&(e.sharedEmitDoneFor=e.external),e.external||Object.keys(o).length>0&&(e.target===`draft-2020-12`?i.$defs=o:i.definitions=o);try{let n=JSON.parse(JSON.stringify(i));return Object.defineProperty(n,"~standard",{value:{...t[`~standard`],jsonSchema:{input:Gh(t,`input`,e.processors),output:Gh(t,`output`,e.processors)}},enumerable:!1,writable:!1}),n}catch{throw Error(`Error converting schema to JSON.`)}}function Uh(e,t){let n=t??{seen:new Set};if(n.seen.has(e))return!1;n.seen.add(e);let r=e._zod.def;if(r.type===`transform`)return!0;if(r.type===`array`)return Uh(r.element,n);if(r.type===`set`)return Uh(r.valueType,n);if(r.type===`lazy`)return Uh(r.getter(),n);if(r.type===`promise`||r.type===`optional`||r.type===`nonoptional`||r.type===`nullable`||r.type===`readonly`||r.type==="default"||r.type===`prefault`||r.type===`catch`)return Uh(r.innerType,n);if(r.type===`intersection`)return Uh(r.left,n)||Uh(r.right,n);if(r.type===`record`||r.type===`map`)return Uh(r.keyType,n)||Uh(r.valueType,n);if(r.type===`pipe`)return e._zod.traits.has(`$ZodCodec`)?!0:Uh(r.in,n)||Uh(r.out,n);if(r.type===`object`){for(let e in r.shape)if(Uh(r.shape[e],n))return!0;return!1}if(r.type===`union`){for(let e of r.options)if(Uh(e,n))return!0;return!1}if(r.type===`tuple`){for(let e of r.items)if(Uh(e,n))return!0;return!!(r.rest&&Uh(r.rest,n))}return!1}var Wh=(e,t={})=>n=>{let r=jh({...n,processors:t});return Nh(e,r),Fh(r,e),Hh(r,e)},Gh=(e,t,n={})=>r=>{let{libraryOptions:i,target:a}=r??{},o=jh({...i??{},target:a,io:t,processors:n});return Nh(e,o),Fh(o,e),Hh(o,e)},Kh=(e,t,n)=>{(e[t]===void 0||n>e[t])&&(e[t]=n)},qh=(e,t,n)=>{(e[t]===void 0||n{Kh(e,`minimum`,t),qh(e,`maximum`,t)},Yh=(e,t)=>{e.multipleOf??=[],e.multipleOf.includes(t)||e.multipleOf.push(t)},Xh=(e,t)=>{e.patterns??=new Set,e.patterns.add(t)},Zh=(e,t)=>{e.mime=e.mime?e.mime.filter(e=>t.includes(e)):[...t]},Qh=(e,t)=>{e.format=t,t.includes(`int`)&&(e.isInt=!0)},$h=(e,t)=>Kh(e,`minimum`,t.minimum),eg=(e,t)=>qh(e,`maximum`,t.maximum),tg=e=>(t,n)=>{Qh(t,n.format);let[r,i]=e[n.format];Kh(t,`minimum`,r),qh(t,`maximum`,i)},ng={greater_than:(e,t)=>Kh(e,t.inclusive?`minimum`:`exclusiveMinimum`,t.value),less_than:(e,t)=>qh(e,t.inclusive?`maximum`:`exclusiveMaximum`,t.value),multiple_of:(e,t)=>Yh(e,t.value),number_format:tg(tu),bigint_format:tg(nu),min_length:$h,max_length:eg,length_equals:(e,t)=>Jh(e,t.length),min_size:$h,max_size:eg,size_equals:(e,t)=>Jh(e,t.size),string_format:(e,t)=>{Qh(e,t.format),t.pattern&&Xh(e,t.pattern),(t.format===`base64`||t.format===`base64url`)&&(e.contentEncoding=t.format),(t.local||t.precision===-1)&&(e.laxFormat=!0)},mime_type:(e,t)=>Zh(e,t.mime)};function rg(e){let t={},n=e._zod.def,r=e._zod.traits.has(`$ZodCheck`)?[e,...n.checks??[]]:n.checks??[];for(let e of r)ng[e._zod.def.check]?.(t,e._zod.def);let i=e._zod.bag;i.minimum!==void 0&&Kh(t,`minimum`,i.minimum),i.exclusiveMinimum!==void 0&&Kh(t,`exclusiveMinimum`,i.exclusiveMinimum),i.maximum!==void 0&&qh(t,`maximum`,i.maximum),i.exclusiveMaximum!==void 0&&qh(t,`exclusiveMaximum`,i.exclusiveMaximum),i.multipleOf!==void 0&&Yh(t,i.multipleOf),i.format!==void 0&&(t.format??=i.format,i.format.includes(`int`)&&(t.isInt=!0)),i.mime&&Zh(t,i.mime);for(let e of i.patterns??[])Xh(t,e);return t}var ig={guid:`uuid`,url:`uri`,datetime:`date-time`,json_string:`json-string`,regex:``},ag=new Map([[B,Nd],[tp,Pd]]),og=e=>ag.get(e)??e,sg=(e,t,n,r)=>{let i=n;i.type=`string`;let{minimum:a,maximum:o,format:s,patterns:c,contentEncoding:l,laxFormat:u}=rg(e);if(typeof a==`number`&&(i.minLength=a),typeof o==`number`&&(i.maxLength=o),s&&(i.format=ig[s]??s,i.format===``&&delete i.format,(s===`time`||u)&&delete i.format),l&&(i.contentEncoding=l),c&&c.size>0){let e=[...c].map(og);e.length===1?i.pattern=e[0].source:e.length>1&&(i.allOf=[...e.map(e=>({...t.target===`draft-07`||t.target===`draft-04`||t.target===`openapi-3.0`?{type:`string`}:{},pattern:e.source}))])}},cg=(e,t,n,r)=>{let i=n,{minimum:a,maximum:o,multipleOf:s,exclusiveMaximum:c,exclusiveMinimum:l,isInt:u}=rg(e);i.type=u?`integer`:`number`;let d=typeof l==`number`&&l>=(a??-1/0),f=typeof c==`number`&&c<=(o??1/0),p=t.target===`draft-04`||t.target===`openapi-3.0`;if(d?p?(i.minimum=l,i.exclusiveMinimum=!0):i.exclusiveMinimum=l:typeof a==`number`&&(i.minimum=a),f?p?(i.maximum=c,i.exclusiveMaximum=!0):i.exclusiveMaximum=c:typeof o==`number`&&(i.maximum=o),s){let n=new Set;for(let a of s)Number.isFinite(a)&&a!==0?n.add(Math.abs(a)):Mh(e,t,i,r,`A multipleOf divisor of ${a} cannot be represented in JSON Schema`);let[a,...o]=n;a!==void 0&&(i.multipleOf=a),o.length&&(i.allOf=[...i.allOf??[],...o.map(e=>({multipleOf:e}))])}},lg=(e,t,n,r)=>{n.type=`boolean`},ug=(e,t,n,r)=>{Mh(e,t,n,r,`BigInt cannot be represented in JSON Schema`)},dg=(e,t,n,r)=>{Mh(e,t,n,r,`Symbols cannot be represented in JSON Schema`)},fg=(e,t,n,r)=>{t.target===`openapi-3.0`?(n.type=`string`,n.nullable=!0,n.enum=[null]):n.type=`null`},pg=(e,t,n,r)=>{Mh(e,t,n,r,`Undefined cannot be represented in JSON Schema`)},mg=(e,t,n,r)=>{Mh(e,t,n,r,`Void cannot be represented in JSON Schema`)},hg=(e,t,n,r)=>{n.not={}},gg=(e,t,n,r)=>{},_g=(e,t,n,r)=>{},vg=(e,t,n,r)=>{Mh(e,t,n,r,`Date cannot be represented in JSON Schema`)},yg=(e,t,n,r)=>{let i=e._zod.def,a=Tl(i.entries);if(a.length===0){n.not={};return}a.every(e=>typeof e==`number`)&&(n.type=`number`),a.every(e=>typeof e==`string`)&&(n.type=`string`),n.enum=a},bg=(e,t,n,r)=>{let i=e._zod.def;if(i.values.length===0){n.not={};return}let a=[];for(let o of i.values)if(o===void 0){if(Mh(e,t,n,r,"Literal `undefined` cannot be represented in JSON Schema"))return}else if(typeof o==`bigint`){if(Mh(e,t,n,r,`BigInt literals cannot be represented in JSON Schema`))return;a.push(Number(o))}else a.push(o);if(a.length!==0){if(a.length===1){let e=a[0];n.type=e===null?`null`:typeof e,t.target===`draft-04`||t.target===`openapi-3.0`?n.enum=[e]:n.const=e}else a.every(e=>typeof e==`number`)&&(n.type=`number`),a.every(e=>typeof e==`string`)&&(n.type=`string`),a.every(e=>typeof e==`boolean`)&&(n.type=`boolean`),a.every(e=>e===null)&&(n.type=`null`),n.enum=a}},xg=(e,t,n,r)=>{Mh(e,t,n,r,`NaN cannot be represented in JSON Schema`)},Sg=(e,t,n,r)=>{let i=n,a=e._zod.pattern;if(!a)throw Error(`Pattern not found in template literal`);i.type=`string`,i.pattern=a.source},Cg=(e,t,n,r)=>{let i=n;i.type=`string`,i.format=`binary`,i.contentEncoding=`binary`;let{minimum:a,maximum:o,mime:s}=rg(e);a!==void 0&&(i.minLength=a),o!==void 0&&(i.maxLength=o),s&&(s.length===0?i.not={}:s.length===1?i.contentMediaType=s[0]:i.anyOf=s.map(e=>({contentMediaType:e})))},wg=(e,t,n,r)=>{n.type=`boolean`},Tg=(e,t,n,r)=>{Mh(e,t,n,r,`Custom types cannot be represented in JSON Schema`)},Eg=(e,t,n,r)=>{Mh(e,t,n,r,`Function types cannot be represented in JSON Schema`)},Dg=(e,t,n,r)=>{Mh(e,t,n,r,`Transforms cannot be represented in JSON Schema`)},Og=(e,t,n,r)=>{Mh(e,t,n,r,`Map cannot be represented in JSON Schema`)},kg=(e,t,n,r)=>{Mh(e,t,n,r,`Set cannot be represented in JSON Schema`)},Ag=(e,t,n,r)=>{let i=n,a=e._zod.def,{minimum:o,maximum:s}=rg(e);typeof o==`number`&&(i.minItems=o),typeof s==`number`&&(i.maxItems=s),i.type=`array`,i.items=Nh(a.element,t,{...r,path:[...r.path,`items`]})};function jg(e){let t=e._zod.def;return t.type===`pipe`&&t.in._zod.traits.has(`$ZodTransform`)?jg(t.out):t.type===`catch`?jg(t.innerType):e._zod.optin}var Mg=(e,t,n,r)=>{let i=n,a=e._zod.def,o=a.shape;if(Object.getOwnPropertySymbols(o).length&&Mh(e,t,i,r,`Symbol keys cannot be represented in JSON Schema`))return;i.type=`object`,i.properties={};for(let e in o)Fl(i.properties,e,Nh(o[e],t,{...r,path:[...r.path,`properties`,e]}));let s=[];for(let e of Object.keys(o)){let n=a.shape[e];(t.io===`input`?jg(n)===void 0:n._zod.optout===void 0)&&s.push(e)}s.length>0&&(i.required=s),a.catchall?._zod.def.type===`never`?i.additionalProperties=!1:a.catchall?a.catchall&&(i.additionalProperties=Nh(a.catchall,t,{...r,path:[...r.path,`additionalProperties`]})):t.io===`output`&&(i.additionalProperties=!1)},Ng=(e,t,n,r)=>{let i=e._zod.def,a=i.inclusive===!1,o=i.options.map((e,n)=>Nh(e,t,{...r,path:[...r.path,a?`oneOf`:`anyOf`,n]}));a?n.oneOf=o:n.anyOf=o},Pg=(e,t,n,r)=>{let i=e._zod.def,a=Nh(i.left,t,{...r,path:[...r.path,`allOf`,0]}),o=Nh(i.right,t,{...r,path:[...r.path,`allOf`,1]}),s=e=>`allOf`in e&&Object.keys(e).length===1,c=[...s(a)?a.allOf:[a],...s(o)?o.allOf:[o]];n.allOf=c,t.intersections.push(c)},Fg=(e,t,n,r)=>{let i=n,a=e._zod.def;i.type=`array`;let o=t.target===`draft-2020-12`?`prefixItems`:`items`,s=t.target===`draft-2020-12`||t.target===`openapi-3.0`?`items`:`additionalItems`,c=a.items.map((e,n)=>Nh(e,t,{...r,path:[...r.path,o,n]})),l=a.rest?Nh(a.rest,t,{...r,path:[...r.path,s,...t.target===`openapi-3.0`?[a.items.length]:[]]}):null,u=a.items.length;for(;u>0;){let e=a.items[u-1];if(!(t.io===`input`?jg(e)!==void 0:e._zod.optout===`optional`))break;u--}let d=a.items.length,f=!a.rest;t.target===`draft-2020-12`?(i.prefixItems=c,f?i.items=!1:l&&(i.items=l),u>0&&(i.minItems=u),f&&(i.maxItems=d)):t.target===`openapi-3.0`?(i.items={anyOf:c},l&&i.items.anyOf.push(l),u>0&&(i.minItems=u),f&&(i.maxItems=d)):(i.items=c,f?i.additionalItems=!1:l&&(i.additionalItems=l),u>0&&(i.minItems=u),f&&(i.maxItems=d));let{minimum:p,maximum:m}=rg(e);typeof p==`number`&&(i.minItems=p),typeof m==`number`&&(i.maxItems=m)};function Ig(e,t,n){if(t.$ref){if(n.has(t))return t;n.add(t);let r=e.get(t)?.def;if(!r)return t;let i=Ig(e,r,n);return i===r?t:i}for(let r of[`anyOf`,`oneOf`]){let i=t[r];if(!Array.isArray(i))continue;let a=i.map(t=>Ig(e,t,n));a.some((e,t)=>e!==i[t])&&(t={...t,[r]:a})}let r=Array.isArray(t.type)?t.type:[t.type],i=!r.includes(`string`)&&r.some(e=>e===`number`||e===`integer`),a=t.enum??(t.const===void 0?void 0:[t.const]);if(!i&&!a?.some(e=>typeof e==`number`))return t;let{minimum:o,maximum:s,exclusiveMinimum:c,exclusiveMaximum:l,multipleOf:u,format:d,id:f,...p}=t;return p.enum?p.enum=p.enum.map(e=>typeof e==`number`?String(e):e):typeof p.const==`number`&&(p.const=String(p.const)),i?(p.type=`string`,a||(p.pattern=(r.includes(`number`)?Gd:Wd).source),p):p}var Lg=new WeakMap;function Rg(e){let t=new Map;for(let n of e.seen.values())n.def&&!t.has(n.schema)&&t.set(n.schema,n);let n=new Map;for(let r of Lg.get(e)??[]){let i=e.seen.get(r),a=(i?.def??i?.schema)?.propertyNames;if(!a||a===!0||n.has(a))continue;let o=Ig(t,a,new Set);o!==a&&n.set(a,o)}if(n.size)for(let t of e.seen.values())for(let e of[t.schema,t.def]){let t=e&&n.get(e.propertyNames);t&&(e.propertyNames=t)}}var zg=(e,t,n,r)=>{let i=n,a=e._zod.def;i.type=`object`;let o=a.keyType,s=rg(o).patterns;if(a.mode===`loose`&&s&&s.size>0){let e=Nh(a.valueType,t,{...r,path:[...r.path,`patternProperties`,`*`]});i.patternProperties={};for(let t of s)Fl(i.patternProperties,og(t).source,e)}else{if(t.target===`draft-07`||t.target===`draft-2020-12`){i.propertyNames=Nh(a.keyType,t,{...r,path:[...r.path,`propertyNames`]});let n=Lg.get(t);n||(n=[],Lg.set(t,n),t.deferred.push(()=>Rg(t))),n.push(e)}i.additionalProperties=Nh(a.valueType,t,{...r,path:[...r.path,`additionalProperties`]})}let c=o._zod.values,l=t.io===`input`&&jg(a.valueType)!==void 0;if(c&&!a.partial&&!l){let e=[...c].filter(e=>typeof e==`string`||typeof e==`number`);e.length>0&&(i.required=e.map(String))}},Bg=(e,t,n,r)=>{let i=e._zod.def,a=Nh(i.innerType,t,r),o=t.seen.get(e);t.target===`openapi-3.0`?(o.ref=i.innerType,n.nullable=!0):n.anyOf=[a,{type:`null`}]},Vg=(e,t,n,r)=>{let i=e._zod.def;Nh(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType},Hg=Symbol();function Ug(e,t,n,r,i){let a=!1,o=JSON.stringify(e,(e,t)=>typeof t==`bigint`?(a=!0,null):t);return a?(Mh(t,n,r,i,`BigInt defaults cannot be represented in JSON Schema`),Hg):JSON.parse(o)}var Wg=(e,t,n,r)=>{let i=e._zod.def;Nh(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType;let o=Ug(i.defaultValue,e,t,n,r);o!==Hg&&(n.default=o)},Gg=(e,t,n,r)=>{let i=e._zod.def;Nh(i.innerType,t,r);let a=t.seen.get(e);if(a.ref=i.innerType,t.io!==`input`)return;let o=Ug(i.defaultValue,e,t,n,r);o!==Hg&&(n._prefault=o)},Kg=(e,t,n,r)=>{let i=e._zod.def;Nh(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType;let o;try{o=i.catchValue(void 0)}catch{Mh(e,t,n,r,`Dynamic catch values are not supported in JSON Schema`);return}n.default=o},qg=(e,t,n,r)=>{let i=e._zod.def,a=i.in._zod.traits.has(`$ZodTransform`),o=t.io===`input`?a?i.out:i.in:i.out;Nh(o,t,r);let s=t.seen.get(e);s.ref=o},Jg=(e,t,n,r)=>{let i=e._zod.def;Nh(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType,n.readOnly=!0},Yg=(e,t,n,r)=>{let i=e._zod.def;Nh(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType},Xg=(e,t,n,r)=>{let i=e._zod.def;Nh(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType},Zg=(e,t,n,r)=>{let i=e._zod.innerType;Nh(i,t,r);let a=t.seen.get(e);a.ref=i},Qg={string:sg,number:cg,boolean:lg,bigint:ug,symbol:dg,null:fg,undefined:pg,void:mg,never:hg,any:gg,unknown:_g,date:vg,enum:yg,literal:bg,nan:xg,template_literal:Sg,file:Cg,success:wg,custom:Tg,function:Eg,transform:Dg,map:Og,set:kg,array:Ag,object:Mg,union:Ng,intersection:Pg,tuple:Fg,record:zg,nullable:Bg,nonoptional:Vg,default:Wg,prefault:Gg,catch:Kg,pipe:qg,readonly:Jg,promise:Yg,optional:Xg,lazy:Zg};function $g(e,t){if(`_idmap`in e){let n=e,r=jh({...t,processors:Qg}),i={};for(let e of n._idmap.entries()){let[t,n]=e;Nh(n,r)}let a={};r.external={registry:n,uri:t?.uri,defs:i};for(let e of n._idmap.entries()){let[t,n]=e;Fh(r,n),Fl(a,t,Hh(r,n))}return Object.keys(i).length>0&&(a.__shared={[r.target===`draft-2020-12`?`$defs`:`definitions`]:i}),{schemas:a}}let n=jh({...t,processors:Qg});return Nh(e,n),Fh(n,e),Hh(n,e)}var e_=new WeakSet([Object.prototype,Error.prototype]);function t_(e,t,n){Object.defineProperty(e,t,{configurable:!0,enumerable:!1,get(){let e=n(this);return Object.defineProperty(this,t,{value:e,configurable:!0,writable:!0}),e},set(e){Object.defineProperty(this,t,{value:e,configurable:!0,writable:!0})}})}var n_=L(`ZodError`,(e,t)=>{Yu.init(e,t),e.name=`ZodError`;let n=Object.getPrototypeOf(e);e_.has(n)||(e_.add(n),t_(n,`format`,e=>t=>Qu(e,t)),t_(n,`flatten`,e=>t=>Zu(e,t)),t_(n,`addIssue`,e=>t=>{e.issues.push(t),e.message=JSON.stringify(e.issues,Dl,2)}),t_(n,`addIssues`,e=>t=>{e.issues.push(...t),e.message=JSON.stringify(e.issues,Dl,2)}),Object.defineProperty(n,"isEmpty",{configurable:!0,enumerable:!1,get(){return this.issues.length===0}}))},void 0,{Parent:Error}),r_=ed(n_),i_=td(n_),a_=nd(n_),o_=id(n_),s_=R(n_),c_=z(n_),l_=ud(n_),u_=dd(n_),d_=fd(n_),f_=pd(n_),p_=md(n_),m_=hd(n_);function h_(){Vu.localeError||Hu(_m())}function g_(){Vu.memoizer||Hu({memoizer:mm()})}var __=L(`ZodType`,(e,t)=>(h_(),vf.init(e,t),e.def=t,e.type=t.type,e),{check(...e){let t=this.def;return this.clone(Hl(t,{checks:[...t.checks??[],...e.map(e=>typeof e==`function`?{_zod:{check:e,def:{check:`custom`},onattach:[]}}:e)]}),{parent:!0})},with(...e){return this.check(...e)},clone(e,t){return Ql(this,e,t)},brand(){return this},register(e,t){return e.add(this,t),this},refine(e,t){return this.check(Gv(e,t))},superRefine(e,t){return this.check(Kv(e,t))},overwrite(e){return this.check(yh(e))},optional(){return Cv(this)},exactOptional(){return Tv(this)},nullable(){return Dv(this)},nullish(){return Cv(Dv(this))},nonoptional(e){return Nv(this,e)},array(){return ov(this)},or(e){return uv([this,e])},and(e){return mv(this,e)},transform(e){return Lv(this,xv(e))},default(e){return kv(this,e)},prefault(e){return jv(this,e)},catch(e){return Fv(this,e)},pipe(e){return Lv(this,e)},readonly(){return Bv(this)},describe(e){let t=this.clone();return xm.add(t,{description:e}),t},meta(...e){if(e.length===0)return xm.get(this);let t=this.clone();return xm.add(t,e[0]),t},isOptional(){return this.safeParse(void 0).success},isNullable(){return this.safeParse(null).success},apply(e,...t){return t.length===0?e(this):e(this,...t)},get"~standard"(){return wu(this,`~standard`,{...xf(this),jsonSchema:{input:Gh(this,`input`),output:Gh(this,`output`)}})},set"~standard"(e){Cu(this,`~standard`,e)},parse:function e(t,n){return r_(this,t,n,{callee:e})},parseAsync:async function e(t,n){return await i_(this,t,n,{callee:e})},safeParse(e,t){return a_(this,e,t)},async safeParseAsync(e,t){return o_(this,e,t)},get spa(){return this?.safeParseAsync},set spa(e){Cu(this,`spa`,e)},validate(e,t){return sd(this,e,t)},validateAsync(e,t){return ld(this,e,t)},encode:function e(t,n){return s_(this,t,n,{callee:e})},decode:function e(t,n){return c_(this,t,n,{callee:e})},encodeAsync:async function e(t,n){return await l_(this,t,n,{callee:e})},decodeAsync:async function e(t,n){return await u_(this,t,n,{callee:e})},safeEncode(e,t){return d_(this,e,t)},safeDecode(e,t){return f_(this,e,t)},async safeEncodeAsync(e,t){return p_(this,e,t)},async safeDecodeAsync(e,t){return m_(this,e,t)},toJSONSchema(e){return Wh(this,{})(e)},get description(){return xm.get(this)?.description},get _def(){return this._zod.def}}),v_=L(`_ZodString`,(e,t)=>{Sf.init(e,t),__.init(e,t),e._zod.processJSONSchema=(t,n,r)=>sg(e,t,n,r)},Tu({format:e=>rg(e).format??null,minLength:e=>rg(e).minimum??null,maxLength:e=>rg(e).maximum??null},{regex(...e){return this.check(ph(...e))},includes(...e){return this.check(gh(...e))},startsWith(...e){return this.check(_h(...e))},endsWith(...e){return this.check(vh(...e))},min(...e){return this.check(dh(...e))},max(...e){return this.check(uh(...e))},length(...e){return this.check(fh(...e))},nonempty(...e){return this.check(dh(1,...e))},lowercase(e){return this.check(mh(e))},uppercase(e){return this.check(hh(e))},trim(){return this.check(xh())},normalize(...e){return this.check(bh(...e))},toLowerCase(){return this.check(Sh())},toUpperCase(){return this.check(Ch())},slugify(){return this.check(wh())}})),y_=L(`ZodString`,(e,t)=>{Sf.init(e,t),v_.init(e,t)},{email(e){return this.check(wm(T_,e))},url(e){return this.check(Am(k_,e))},jwt(e){return this.check(Gm(G_,e))},emoji(e){return this.check(jm(j_,e))},guid(e){return this.check(Tm(D_,e))},uuid(e){return this.check(Em(O_,e))},uuidv4(e){return this.check(Dm(O_,e))},uuidv6(e){return this.check(Om(O_,e))},uuidv7(e){return this.check(km(O_,e))},nanoid(e){return this.check(Mm(M_,e))},cuid(e){return this.check(Nm(N_,e))},cuid2(e){return this.check(Pm(P_,e))},ulid(e){return this.check(Fm(F_,e))},base64(e){return this.check(Hm(H_,e))},base64url(e){return this.check(Um(U_,e))},xid(e){return this.check(Im(I_,e))},ksuid(e){return this.check(Lm(L_,e))},ipv4(e){return this.check(Rm(R_,e))},ipv6(e){return this.check(zm(z_,e))},cidrv4(e){return this.check(Bm(B_,e))},cidrv6(e){return this.check(Vm(V_,e))},e164(e){return this.check(Wm(W_,e))},datetime(e){return this.check(Km(x_,e))},date(e){return this.check(qm(S_,e))},time(e){return this.check(Jm(C_,e))},duration(e){return this.check(Ym(w_,e))}});function V(e){return Cm(y_,e)}var b_=L(`ZodStringFormat`,(e,t)=>{Cf.init(e,t),v_.init(e,t)}),x_=L(`ZodISODateTime`,(e,t)=>{Hf.init(e,t),b_.init(e,t)}),S_=L(`ZodISODate`,(e,t)=>{Uf.init(e,t),b_.init(e,t)}),C_=L(`ZodISOTime`,(e,t)=>{Wf.init(e,t),b_.init(e,t)}),w_=L(`ZodISODuration`,(e,t)=>{Gf.init(e,t),b_.init(e,t)}),T_=L(`ZodEmail`,(e,t)=>{Ef.init(e,t),b_.init(e,t)});function E_(e){return wm(T_,e)}var D_=L(`ZodGUID`,(e,t)=>{wf.init(e,t),b_.init(e,t)}),O_=L(`ZodUUID`,(e,t)=>{Tf.init(e,t),b_.init(e,t)}),k_=L(`ZodURL`,(e,t)=>{Pf.init(e,t),b_.init(e,t)});function A_(e){return Am(k_,e)}var j_=L(`ZodEmoji`,(e,t)=>{Ff.init(e,t),b_.init(e,t)}),M_=L(`ZodNanoID`,(e,t)=>{If.init(e,t),b_.init(e,t)}),N_=L(`ZodCUID`,(e,t)=>{Lf.init(e,t),b_.init(e,t)}),P_=L(`ZodCUID2`,(e,t)=>{Rf.init(e,t),b_.init(e,t)}),F_=L(`ZodULID`,(e,t)=>{zf.init(e,t),b_.init(e,t)}),I_=L(`ZodXID`,(e,t)=>{Bf.init(e,t),b_.init(e,t)}),L_=L(`ZodKSUID`,(e,t)=>{Vf.init(e,t),b_.init(e,t)}),R_=L(`ZodIPv4`,(e,t)=>{Kf.init(e,t),b_.init(e,t)}),z_=L(`ZodIPv6`,(e,t)=>{Yf.init(e,t),b_.init(e,t)}),B_=L(`ZodCIDRv4`,(e,t)=>{Xf.init(e,t),b_.init(e,t)}),V_=L(`ZodCIDRv6`,(e,t)=>{Qf.init(e,t),b_.init(e,t)}),H_=L(`ZodBase64`,(e,t)=>{ep.init(e,t),b_.init(e,t)}),U_=L(`ZodBase64URL`,(e,t)=>{rp.init(e,t),b_.init(e,t)}),W_=L(`ZodE164`,(e,t)=>{ip.init(e,t),b_.init(e,t)}),G_=L(`ZodJWT`,(e,t)=>{op.init(e,t),b_.init(e,t)}),K_=L(`ZodNumber`,(e,t)=>{sp.init(e,t),__.init(e,t),e._zod.processJSONSchema=(t,n,r)=>cg(e,t,n,r),e.isFinite=!0},Tu({minValue:e=>{let{minimum:t,exclusiveMinimum:n}=rg(e);return Math.max(t??-1/0,n??-1/0)},maxValue:e=>{let{maximum:t,exclusiveMaximum:n}=rg(e);return Math.min(t??1/0,n??1/0)},isInt:e=>{let{isInt:t,multipleOf:n}=rg(e);return!!t||!!n?.some(Number.isSafeInteger)},format:e=>rg(e).format??null},{gt(e,t){return this.check(sh(e,t))},gte(e,t){return this.check(ch(e,t))},min(e,t){return this.check(ch(e,t))},lt(e,t){return this.check(ah(e,t))},lte(e,t){return this.check(oh(e,t))},max(e,t){return this.check(oh(e,t))},int(e){return this.check(H(e))},safe(e){return this.check(H(e))},positive(e){return this.check(sh(0,e))},nonnegative(e){return this.check(ch(0,e))},negative(e){return this.check(ah(0,e))},nonpositive(e){return this.check(oh(0,e))},multipleOf(e,t){return this.check(lh(e,t))},step(e,t){return this.check(lh(e,t))},finite(){return this}}));function q_(e){return Xm(K_,e)}var J_=L(`ZodNumberFormat`,(e,t)=>{cp.init(e,t),K_.init(e,t)});function H(e){return Qm(J_,e)}var Y_=L(`ZodBoolean`,(e,t)=>{lp.init(e,t),__.init(e,t),e._zod.processJSONSchema=(t,n,r)=>lg(e,t,n,r)});function U(e){return $m(Y_,e)}var X_=L(`ZodUndefined`,(e,t)=>{up.init(e,t),__.init(e,t),e._zod.processJSONSchema=(t,n,r)=>pg(e,t,n,r)});function Z_(e){return eh(X_,e)}var Q_=L(`ZodNull`,(e,t)=>{dp.init(e,t),__.init(e,t),e._zod.processJSONSchema=(t,n,r)=>fg(e,t,n,r)});function $_(e){return th(Q_,e)}var ev=L(`ZodAny`,(e,t)=>{fp.init(e,t),__.init(e,t),e._zod.processJSONSchema=(e,t,n)=>void 0});function W(){return nh(ev)}var tv=L(`ZodUnknown`,(e,t)=>{pp.init(e,t),__.init(e,t),e._zod.processJSONSchema=(e,t,n)=>void 0});function nv(){return rh(tv)}var rv=L(`ZodNever`,(e,t)=>{mp.init(e,t),__.init(e,t),e._zod.processJSONSchema=(t,n,r)=>hg(e,t,n,r)});function iv(e){return ih(rv,e)}var av=L(`ZodArray`,(e,t)=>{g_(),gp.init(e,t),__.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Ag(e,t,n,r),e.element=t.element},{min(e,t){return this.check(dh(e,t))},nonempty(e){return this.check(dh(1,e))},max(e,t){return this.check(uh(e,t))},length(e,t){return this.check(fh(e,t))},unwrap(){return this.element}});function ov(e,t){return Th(av,e,t)}var sv=L(`ZodObject`,(e,t)=>{g_(),Sp.init(e,t),__.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Mg(e,t,n,r),ju(e,`shape`,e=>e._zod.def.shape,!1)},{keyof(){return vv(Object.keys(this._zod.def.shape))},catchall(e){return this.clone(Hl(this._zod.def,{catchall:e}))},passthrough(){return this.clone(Hl(this._zod.def,{catchall:nv()}))},loose(){return this.clone(Hl(this._zod.def,{catchall:nv()}))},strict(){return this.clone(Hl(this._zod.def,{catchall:iv()}))},strip(){return this.clone(Hl(this._zod.def,{catchall:void 0}))},extend(e){return ou(this,e)},safeExtend(e){return cu(this,e)},merge(e){return lu(this,e)},pick(e){return ru(this,e)},omit(e){return au(this,e)},partial(...e){return uu(Sv,this,e[0])},exactPartial(...e){return uu(wv,this,e[0],`exactPartial`)},required(...e){return du(Mv,this,e[0])}});function cv(e,t){return new sv({type:`object`,shape:e??{},...P(t)})}function G(e,t){return new sv({type:`object`,shape:e,catchall:nv(),...P(t)})}var lv=L(`ZodUnion`,(e,t)=>{wp.init(e,t),__.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Ng(e,t,n,r),e.options=t.options});function uv(e,t){return new lv({type:`union`,options:e,...P(t)})}var dv=L(`ZodDiscriminatedUnion`,(e,t)=>{lv.init(e,t),Ep.init(e,t)});function fv(e,t,n){return new dv({type:`union`,options:t,discriminator:e,...P(n)})}var pv=L(`ZodIntersection`,(e,t)=>{Dp.init(e,t),__.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Pg(e,t,n,r)});function mv(e,t){return new pv({type:`intersection`,left:e,right:t})}var hv=L(`ZodRecord`,(e,t)=>{g_(),Ap.init(e,t),__.init(e,t),e._zod.processJSONSchema=(t,n,r)=>zg(e,t,n,r),e.keyType=t.keyType,e.valueType=t.valueType});function gv(e,t,n){return!t||!t._zod?new hv({type:`record`,keyType:V(),valueType:e,...P(t)}):new hv({type:`record`,keyType:e,valueType:t,...P(n)})}var _v=L(`ZodEnum`,(e,t)=>{jp.init(e,t),__.init(e,t),e._zod.processJSONSchema=(t,n,r)=>yg(e,t,n,r),e.enum=t.entries,e.options=[...e._zod.values];let n=new Set(Object.keys(t.entries));e.extract=(e,r)=>{let i={};for(let r of e)if(n.has(r))i[r]=t.entries[r];else throw Error(`Key ${r} not found in enum`);return new _v({...t,checks:[],...P(r),entries:i})},e.exclude=(e,r)=>{let i={...t.entries};for(let t of e)if(n.has(t))delete i[t];else throw Error(`Key ${t} not found in enum`);return new _v({...t,checks:[],...P(r),entries:i})}});function vv(e,t){return new _v({type:`enum`,entries:Array.isArray(e)?Object.fromEntries(e.map(e=>[e,e])):e,...P(t)})}var yv=L(`ZodLiteral`,(e,t)=>{Mp.init(e,t),__.init(e,t),e._zod.processJSONSchema=(t,n,r)=>bg(e,t,n,r),e.values=new Set(t.values),Object.defineProperty(e,"value",{get(){if(t.values.length>1)throw Error("This schema contains multiple valid literal values. Use `.values` instead.");return t.values[0]}})});function K(e,t){return new yv({type:`literal`,values:Array.isArray(e)?e:[e],...P(t)})}var bv=L(`ZodTransform`,(e,t)=>{g_(),Np.init(e,t),__.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Dg(e,t,n,r),e._zod.parse=(n,r)=>{if(r.direction===`backward`)throw new Bu(e.constructor.name);n.addIssue=r=>{if(typeof r==`string`)n.issues.push(xu(r,n.value,t));else{let t=r;t.fatal&&(t.continue=!1),t.code??=`custom`,`input`in t||(t.input=n.value),t.inst??=e,n.issues.push(xu(t))}};let i=t.transform(n.value,n);return i instanceof Promise?i.then(e=>(n.value=e,n)):(n.value=i,n)}});function xv(e){return new bv({type:`transform`,transform:e})}var Sv=L(`ZodOptional`,(e,t)=>{Fp.init(e,t),__.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Xg(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function Cv(e){return new Sv({type:`optional`,innerType:e})}var wv=L(`ZodExactOptional`,(e,t)=>{Ip.init(e,t),__.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Xg(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function Tv(e){return new wv({type:`optional`,innerType:e})}var Ev=L(`ZodNullable`,(e,t)=>{Lp.init(e,t),__.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Bg(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function Dv(e){return new Ev({type:`nullable`,innerType:e})}var Ov=L(`ZodDefault`,(e,t)=>{Rp.init(e,t),__.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Wg(e,t,n,r),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap});function kv(e,t){return new Ov({type:`default`,innerType:e,get defaultValue(){return typeof t==`function`?t():Yl(t)}})}var Av=L(`ZodPrefault`,(e,t)=>{Bp.init(e,t),__.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Gg(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function jv(e,t){return new Av({type:`prefault`,innerType:e,get defaultValue(){return typeof t==`function`?t():Yl(t)}})}var Mv=L(`ZodNonOptional`,(e,t)=>{Vp.init(e,t),__.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Vg(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function Nv(e,t){return new Mv({type:`nonoptional`,innerType:e,...P(t)})}var Pv=L(`ZodCatch`,(e,t)=>{Wp.init(e,t),__.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Kg(e,t,n,r),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap});function Fv(e,t){return new Pv({type:`catch`,innerType:e,catchValue:typeof t==`function`?t:Nu(t)})}var Iv=L(`ZodPipe`,(e,t)=>{Gp.init(e,t),__.init(e,t),e._zod.processJSONSchema=(t,n,r)=>qg(e,t,n,r),e.in=t.in,e.out=t.out});function Lv(e,t){return new Iv({type:`pipe`,in:e,out:t})}var Rv=L(`ZodPreprocess`,(e,t)=>{Iv.init(e,t),qp.init(e,t)}),zv=L(`ZodReadonly`,(e,t)=>{Jp.init(e,t),__.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Jg(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function Bv(e){return new zv({type:`readonly`,innerType:e})}var Vv=L(`ZodLazy`,(e,t)=>{Xp.init(e,t),__.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Zg(e,t,n,r),e.unwrap=()=>e._zod.def.getter()});function Hv(e){return new Vv({type:`lazy`,getter:e})}var Uv=L(`ZodCustom`,(e,t)=>{Zp.init(e,t),__.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Tg(e,t,n,r)});function Wv(e,t){return Eh(Uv,e??(()=>!0),t)}function Gv(e,t={}){return Dh(Uv,e,t)}function Kv(e,t){return Oh(e,t)}function qv(e,t){return new Rv({type:`pipe`,in:xv(e),out:t})}var Jv=vv(A),q=Wv(e=>typeof e==`object`&&!!e&&!Array.isArray(e)),J=V(),Yv=vv([`developer`,`system`,`assistant`,`user`]),Xv=G({type:K(A.TEXT_MESSAGE_START),timestamp:H().min(-9007199254740991).max(9007199254740991).optional(),rawEvent:W().refine(e=>e!==null).optional(),metadata:q.optional(),subagentRunId:J.optional(),messageId:V(),role:Yv.optional(),name:V().optional()}),Zv=G({type:K(A.TEXT_MESSAGE_CONTENT),timestamp:H().min(-9007199254740991).max(9007199254740991).optional(),rawEvent:W().refine(e=>e!==null).optional(),metadata:q.optional(),subagentRunId:J.optional(),messageId:V(),delta:V()}),Qv=G({type:K(A.TEXT_MESSAGE_END),timestamp:H().min(-9007199254740991).max(9007199254740991).optional(),rawEvent:W().refine(e=>e!==null).optional(),metadata:q.optional(),subagentRunId:J.optional(),messageId:V()}),$v=G({type:K(A.TEXT_MESSAGE_CHUNK),timestamp:H().min(-9007199254740991).max(9007199254740991).optional(),rawEvent:W().refine(e=>e!==null).optional(),metadata:q.optional(),subagentRunId:J.optional(),messageId:V().optional(),role:Yv.optional(),delta:V().optional(),name:V().optional()}),ey=G({type:K(A.TOOL_CALL_START),timestamp:H().min(-9007199254740991).max(9007199254740991).optional(),rawEvent:W().refine(e=>e!==null).optional(),metadata:q.optional(),subagentRunId:J.optional(),toolCallId:V(),toolCallName:V(),parentMessageId:V().optional()}),ty=G({type:K(A.TOOL_CALL_ARGS),timestamp:H().min(-9007199254740991).max(9007199254740991).optional(),rawEvent:W().refine(e=>e!==null).optional(),metadata:q.optional(),subagentRunId:J.optional(),toolCallId:V(),delta:V()}),ny=G({type:K(A.TOOL_CALL_END),timestamp:H().min(-9007199254740991).max(9007199254740991).optional(),rawEvent:W().refine(e=>e!==null).optional(),metadata:q.optional(),subagentRunId:J.optional(),toolCallId:V()}),ry=G({type:K(A.TOOL_CALL_CHUNK),timestamp:H().min(-9007199254740991).max(9007199254740991).optional(),rawEvent:W().refine(e=>e!==null).optional(),metadata:q.optional(),subagentRunId:J.optional(),toolCallId:V().optional(),toolCallName:V().optional(),parentMessageId:V().optional(),delta:V().optional()}),iy=G({type:K(`text`),id:V().optional(),text:V(),metadata:W().refine(e=>e!==null).optional()}),ay=fv(`type`,[G({type:K(`data`),value:V(),mimeType:V()}),G({type:K(`url`),value:V(),mimeType:V().optional()}),G({type:K(`file`),value:V(),provider:V().optional(),mimeType:V().optional()})]),oy=fv(`type`,[iy,G({type:K(`image`),id:V().optional(),source:ay,metadata:W().refine(e=>e!==null).optional()}),G({type:K(`audio`),id:V().optional(),source:ay,metadata:W().refine(e=>e!==null).optional()}),G({type:K(`video`),id:V().optional(),source:ay,metadata:W().refine(e=>e!==null).optional()}),G({type:K(`document`),id:V().optional(),source:ay,metadata:W().refine(e=>e!==null).optional()})]),sy=G({type:K(A.TOOL_CALL_RESULT),timestamp:H().min(-9007199254740991).max(9007199254740991).optional(),rawEvent:W().refine(e=>e!==null).optional(),metadata:q.optional(),subagentRunId:J.optional(),messageId:V(),toolCallId:V(),content:uv([V(),ov(oy)]),role:K(`tool`).optional()}),cy=W(),ly=G({type:K(A.STATE_SNAPSHOT),timestamp:H().min(-9007199254740991).max(9007199254740991).optional(),rawEvent:W().refine(e=>e!==null).optional(),metadata:q.optional(),subagentRunId:J.optional(),snapshot:cy.refine(e=>e!==void 0)}),uy=V().regex(RegExp(`^(/([^/~]|~[01])*)*$`)),dy=ov(fv(`op`,[G({op:K(`add`),path:uy,value:W().refine(e=>e!==void 0)}).meta({specOpen:!0}),G({op:K(`remove`),path:uy}).meta({specOpen:!0}),G({op:K(`replace`),path:uy,value:W().refine(e=>e!==void 0)}).meta({specOpen:!0}),G({op:K(`move`),from:uy,path:uy}).meta({specOpen:!0}),G({op:K(`copy`),from:uy,path:uy}).meta({specOpen:!0}),G({op:K(`test`),path:uy,value:W().refine(e=>e!==void 0)}).meta({specOpen:!0})])),fy=G({type:K(A.STATE_DELTA),timestamp:H().min(-9007199254740991).max(9007199254740991).optional(),rawEvent:W().refine(e=>e!==null).optional(),metadata:q.optional(),subagentRunId:J.optional(),delta:dy}),py=G({subagentRunId:J.optional(),id:V(),role:K(`developer`),name:V().optional(),encryptedValue:V().optional(),metadata:q.optional(),content:V()}),my=G({subagentRunId:J.optional(),id:V(),role:K(`system`),name:V().optional(),encryptedValue:V().optional(),metadata:q.optional(),content:V()}),hy=G({name:V(),arguments:V()}),gy=G({id:V(),type:K(`function`),function:hy,encryptedValue:V().optional(),metadata:q.optional()}),_y=fv(`role`,[py,my,G({subagentRunId:J.optional(),id:V(),role:K(`assistant`),name:V().optional(),encryptedValue:V().optional(),metadata:q.optional(),content:V().optional(),toolCalls:ov(gy).optional()}),G({subagentRunId:J.optional(),id:V(),role:K(`user`),name:V().optional(),encryptedValue:V().optional(),metadata:q.optional(),content:uv([V(),ov(oy)])}),G({subagentRunId:J.optional(),id:V(),role:K(`tool`),content:uv([V(),ov(oy)]),toolCallId:V(),error:V().optional(),encryptedValue:V().optional(),metadata:q.optional()}),G({subagentRunId:J.optional(),id:V(),role:K(`activity`),activityType:V(),content:Wv(e=>typeof e==`object`&&!!e&&!Array.isArray(e)),metadata:q.optional()}),G({subagentRunId:J.optional(),id:V(),role:K(`reasoning`),content:V(),encryptedValue:V().optional(),metadata:q.optional()})]),vy=G({type:K(A.MESSAGES_SNAPSHOT),timestamp:H().min(-9007199254740991).max(9007199254740991).optional(),rawEvent:W().refine(e=>e!==null).optional(),metadata:q.optional(),messages:ov(_y)}),yy=G({type:K(A.ACTIVITY_SNAPSHOT),timestamp:H().min(-9007199254740991).max(9007199254740991).optional(),rawEvent:W().refine(e=>e!==null).optional(),metadata:q.optional(),subagentRunId:J.optional(),messageId:V(),activityType:V(),content:Wv(e=>typeof e==`object`&&!!e&&!Array.isArray(e)),replace:U().optional()}),by=G({type:K(A.ACTIVITY_DELTA),timestamp:H().min(-9007199254740991).max(9007199254740991).optional(),rawEvent:W().refine(e=>e!==null).optional(),metadata:q.optional(),subagentRunId:J.optional(),messageId:V(),activityType:V(),patch:dy}),xy=G({type:K(A.RAW),timestamp:H().min(-9007199254740991).max(9007199254740991).optional(),rawEvent:W().refine(e=>e!==null).optional(),metadata:q.optional(),subagentRunId:J.optional(),event:W().refine(e=>e!==void 0),source:V().optional()}),Sy=G({type:K(A.CUSTOM),timestamp:H().min(-9007199254740991).max(9007199254740991).optional(),rawEvent:W().refine(e=>e!==null).optional(),metadata:q.optional(),subagentRunId:J.optional(),name:V(),value:W().refine(e=>e!==void 0)}),Cy=G({name:V(),description:V(),parameters:W().refine(e=>e!==null).optional(),metadata:q.optional()}),wy=G({description:V(),value:V()}),Ty=G({interruptId:V(),status:vv([`resolved`,`cancelled`]),payload:W().refine(e=>e!==null).optional(),metadata:q.optional()}),Ey=G({threadId:V(),runId:V(),protocolVersion:V().optional(),parentRunId:V().optional(),state:cy.refine(e=>e!==null).nullable().transform(e=>e??void 0).optional(),messages:ov(_y),tools:ov(Cy).default(()=>[]),context:ov(wy).default(()=>[]),forwardedProps:W().refine(e=>e!==null).optional(),resume:ov(Ty).optional()}),Dy=G({type:K(A.RUN_STARTED),timestamp:H().min(-9007199254740991).max(9007199254740991).optional(),rawEvent:W().refine(e=>e!==null).optional(),metadata:q.optional(),threadId:V(),runId:V(),protocolVersion:V().optional(),parentRunId:V().optional(),input:Ey.optional()}),Oy=G({type:K(`success`),pendingToolCallIds:ov(V()).optional()}),ky=G({subagentRunId:J.optional(),id:V(),reason:V(),message:V().optional(),toolCallId:V().optional(),responseSchema:Wv(e=>typeof e==`object`&&!!e&&!Array.isArray(e)).optional(),expiresAt:V().optional(),metadata:q.optional()}),Ay=fv(`type`,[Oy,G({type:K(`interrupt`),interrupts:ov(ky).min(1)}),G({type:K(`cancelled`)})]),jy=G({provider:V().optional(),model:V().optional(),inputTokens:H().min(0).max(9007199254740991).optional(),outputTokens:H().min(0).max(9007199254740991).optional(),totalTokens:H().min(0).max(9007199254740991).optional(),reasoningTokens:H().min(0).max(9007199254740991).optional(),cachedInputTokens:H().min(0).max(9007199254740991).optional(),cacheWriteInputTokens:H().min(0).max(9007199254740991).optional()}),My=G({type:K(A.RUN_FINISHED),timestamp:H().min(-9007199254740991).max(9007199254740991).optional(),rawEvent:W().refine(e=>e!==null).optional(),metadata:q.optional(),threadId:V(),runId:V(),result:W().refine(e=>e!==null).optional(),outcome:Ay.optional(),usage:ov(jy).optional()}),Ny=G({type:K(A.RUN_ERROR),timestamp:H().min(-9007199254740991).max(9007199254740991).optional(),rawEvent:W().refine(e=>e!==null).optional(),metadata:q.optional(),message:V(),code:V().optional(),usage:ov(jy).optional()}),Py=G({type:K(A.STEP_STARTED),timestamp:H().min(-9007199254740991).max(9007199254740991).optional(),rawEvent:W().refine(e=>e!==null).optional(),metadata:q.optional(),subagentRunId:J.optional(),stepName:V()}),Fy=G({type:K(A.STEP_FINISHED),timestamp:H().min(-9007199254740991).max(9007199254740991).optional(),rawEvent:W().refine(e=>e!==null).optional(),metadata:q.optional(),subagentRunId:J.optional(),stepName:V()}),Iy=G({type:K(A.REASONING_START),timestamp:H().min(-9007199254740991).max(9007199254740991).optional(),rawEvent:W().refine(e=>e!==null).optional(),metadata:q.optional(),subagentRunId:J.optional(),messageId:V()}),Ly=G({type:K(A.REASONING_MESSAGE_START),timestamp:H().min(-9007199254740991).max(9007199254740991).optional(),rawEvent:W().refine(e=>e!==null).optional(),metadata:q.optional(),subagentRunId:J.optional(),messageId:V(),role:K(`reasoning`)}),Ry=G({type:K(A.REASONING_MESSAGE_CONTENT),timestamp:H().min(-9007199254740991).max(9007199254740991).optional(),rawEvent:W().refine(e=>e!==null).optional(),metadata:q.optional(),subagentRunId:J.optional(),messageId:V(),delta:V()}),zy=G({type:K(A.REASONING_MESSAGE_END),timestamp:H().min(-9007199254740991).max(9007199254740991).optional(),rawEvent:W().refine(e=>e!==null).optional(),metadata:q.optional(),subagentRunId:J.optional(),messageId:V()}),By=G({type:K(A.REASONING_MESSAGE_CHUNK),timestamp:H().min(-9007199254740991).max(9007199254740991).optional(),rawEvent:W().refine(e=>e!==null).optional(),metadata:q.optional(),subagentRunId:J.optional(),messageId:V().optional(),delta:V().optional()}),Vy=G({type:K(A.REASONING_END),timestamp:H().min(-9007199254740991).max(9007199254740991).optional(),rawEvent:W().refine(e=>e!==null).optional(),metadata:q.optional(),subagentRunId:J.optional(),messageId:V()}),Hy=vv([`tool-call`,`message`]),Uy=G({type:K(A.REASONING_ENCRYPTED_VALUE),timestamp:H().min(-9007199254740991).max(9007199254740991).optional(),rawEvent:W().refine(e=>e!==null).optional(),metadata:q.optional(),subagentRunId:J.optional(),subtype:Hy,entityId:V(),encryptedValue:V()}),Wy=G({type:K(A.SUBAGENT_STARTED),timestamp:H().min(-9007199254740991).max(9007199254740991).optional(),rawEvent:W().refine(e=>e!==null).optional(),metadata:q.optional(),subagentRunId:J,name:V(),description:V().optional(),parentSubagentRunId:J.optional(),parentToolCallId:V().optional(),parentMessageId:V().optional()}),Gy=fv(`type`,[G({type:K(`success`)}),G({type:K(`suspended`),interruptIds:ov(V()).optional()})]),Ky=fv(`type`,[Xv,Zv,Qv,$v,ey,ty,ny,ry,sy,ly,fy,vy,yy,by,xy,Sy,Dy,My,Ny,Py,Fy,Iy,Ly,Ry,zy,By,Vy,Uy,Wy,G({type:K(A.SUBAGENT_FINISHED),timestamp:H().min(-9007199254740991).max(9007199254740991).optional(),rawEvent:W().refine(e=>e!==null).optional(),metadata:q.optional(),subagentRunId:J,result:W().refine(e=>e!==null).optional(),outcome:Gy.optional()}),G({type:K(A.SUBAGENT_ERROR),timestamp:H().min(-9007199254740991).max(9007199254740991).optional(),rawEvent:W().refine(e=>e!==null).optional(),metadata:q.optional(),subagentRunId:J,message:V(),code:V().optional()})]);vv([`developer`,`system`,`assistant`,`user`,`tool`,`activity`,`reasoning`]);var qy=G({name:V(),description:V().optional()}),Jy=G({name:V().optional(),type:V().optional(),description:V().optional(),version:V().optional(),provider:V().optional(),documentationUrl:V().optional(),metadata:q.optional()}),Yy=G({streaming:U().optional(),websocket:U().optional(),httpBinary:U().optional(),pushNotifications:U().optional(),resumable:U().optional()}),Xy=G({supported:U().optional(),items:ov(Cy).optional(),parallelCalls:U().optional(),clientProvided:U().optional()}),Zy=G({structuredOutput:U().optional(),supportedMimeTypes:ov(V()).optional()}),Qy=G({snapshots:U().optional(),deltas:U().optional(),memory:U().optional(),persistentState:U().optional()}),$y=G({supported:U().optional(),delegation:U().optional(),handoffs:U().optional(),subagents:ov(qy).optional()}),eb=G({supported:U().optional(),streaming:U().optional(),encrypted:U().optional()}),tb=G({image:U().optional(),audio:U().optional(),video:U().optional(),pdf:U().optional(),file:U().optional()}),nb=G({image:U().optional(),audio:U().optional()}),rb=G({input:tb.optional(),output:nb.optional()}),ib=G({codeExecution:U().optional(),sandboxed:U().optional(),maxIterations:H().min(0).max(9007199254740991).optional(),maxExecutionTime:H().min(0).max(9007199254740991).optional()}),ab=G({supported:U().optional(),approvals:U().optional(),interventions:U().optional(),feedback:U().optional(),interrupts:U().optional(),approveWithEdits:U().optional()});G({identity:Jy.optional(),transport:Yy.optional(),tools:Xy.optional(),output:Zy.optional(),state:Qy.optional(),multiAgent:$y.optional(),reasoning:eb.optional(),multimodal:rb.optional(),execution:ib.optional(),humanInTheLoop:ab.optional(),custom:Wv(e=>typeof e==`object`&&!!e&&!Array.isArray(e)).optional()}),G({subagentRunId:J.optional()}),G({type:Jv,timestamp:H().min(-9007199254740991).max(9007199254740991).optional(),rawEvent:W().refine(e=>e!==null).optional(),metadata:q.optional()}),G({subagentRunId:J.optional(),id:V(),role:V(),name:V().optional(),encryptedValue:V().optional(),metadata:q.optional()}),q.optional();function ob(){let e=this.buf,t=this.pos,n=0,r=0;for(let i=0;i<28;i+=7){let a=e[t++];if(n|=(a&127)<>4,!(i&128)){this.pos=t,this.assertBounds(),this.varint64Lo=n,this.varint64Hi=r;return}for(let i=3;i<=31;i+=7){let a=e[t++];if(r|=(a&127)<=sb&&(i+=r/sb|0,r%=sb)}return a(-24,-18),a(-18,-12),a(-12,-6),a(-6),t?pb(r,i):fb(r,i)}function lb(e,t){let n=fb(e,t),r=n.hi&2147483648;r&&(n=pb(n.lo,n.hi));let i=ub(n.lo,n.hi);return r?`-`+i:i}function ub(e,t){if({lo:e,hi:t}=db(e,t),t<=2097151)return String(sb*t+e);let n=e&16777215,r=(e>>>24|t<<8)&16777215,i=t>>16&65535,a=n+r*6777216+i*6710656,o=r+i*8147497,s=i*2,c=1e7;return a>=c&&(o+=Math.floor(a/c),a%=c),o>=c&&(s+=Math.floor(o/c),o%=c),s.toString()+mb(o)+mb(a)}function db(e,t){return{lo:e>>>0,hi:t>>>0}}function fb(e,t){return{lo:e|0,hi:t|0}}function pb(e,t){return t=~t,e?e=~e+1:t+=1,fb(e,t)}var mb=e=>{let t=String(e);return`0000000`.slice(t.length)+t};function hb(){let e=this.buf[this.pos++];if(!(e&128))return this.assertBounds(),e;let t=e&127;if(e=this.buf[this.pos++],t|=(e&127)<<7,!(e&128)||(e=this.buf[this.pos++],t|=(e&127)<<14,!(e&128))||(e=this.buf[this.pos++],t|=(e&127)<<21,!(e&128)))return this.assertBounds(),t;e=this.buf[this.pos++],t|=(e&15)<<28;for(let t=5;e&128&&t<10;t++)e=this.buf[this.pos++];if(e&128)throw Error(`invalid varint`);return this.assertBounds(),t>>>0}var gb=_b();function _b(){let e=new DataView(new ArrayBuffer(8));if(typeof BigInt==`function`&&typeof e.getBigInt64==`function`&&typeof e.getBigUint64==`function`&&typeof e.setBigInt64==`function`&&typeof e.setBigUint64==`function`&&(globalThis.Deno||globalThis.Bun||typeof process!=`object`||{}.BUF_BIGINT_DISABLE!==`1`)){let t=BigInt(`-9223372036854775808`),n=BigInt(`9223372036854775807`),r=BigInt(`0`),i=BigInt(`18446744073709551615`);return{zero:BigInt(0),supported:!0,parse(e){let r=typeof e==`bigint`?e:BigInt(e);if(r>n||ri||ta.call(e)),xb(i)}return bb}function Cb(e){return(t,n)=>{let r=e(t);return n.set(r),{written:r.byteLength}}}var wb;(function(e){e[e.Varint=0]=`Varint`,e[e.Bit64=1]=`Bit64`,e[e.LengthDelimited=2]=`LengthDelimited`,e[e.StartGroup=3]=`StartGroup`,e[e.EndGroup=4]=`EndGroup`,e[e.Bit32=5]=`Bit32`})(wb||={});var Y=class{constructor(e){this.stackPos=[],this.encodeUtf8Into=e?Cb(e):Sb().encodeUtf8Into,this.buffer=Db,this.viewCache=Ob,this.pos=0}ensureCapacity(e){let t=this.pos+e;if(t>this.buffer.length){let e=this.buffer.length||Tb;for(;e0&&n.set(this.buffer),this.buffer=n}}view(){let e=this.buffer,t=this.viewCache;if(t.byteLength===e.byteLength)return t;let n=new DataView(e.buffer);return this.viewCache=n,n}finish(){let e=this.buffer.slice(0,this.pos);return this.pos=0,this.stackPos=[],e}fork(){return this.stackPos.push(this.pos),this.ensureCapacity(Eb),this.buffer[this.pos++]=0,this}join(){let e=this.stackPos.pop();if(e===void 0)throw Error(`invalid state, fork stack empty`);let t=this.pos-e-Eb,n=Ab(t);return n>Eb&&(this.ensureCapacity(n-Eb),this.buffer.copyWithin(e+n,e+Eb,this.pos)),this.pos=e,this.uint32(t),this.pos+=t,this}tag(e,t){return this.uint32((e<<3|t)>>>0)}raw(e){return this.ensureCapacity(e.length),this.buffer.set(e,this.pos),this.pos+=e.length,this}uint32(e){if(Mb(e),this.ensureCapacity(5),e<128)return this.buffer[this.pos++]=e,this;for(;e>127;)this.buffer[this.pos++]=e&127|128,e>>>=7;return this.buffer[this.pos++]=e,this}int32(e){if(jb(e),e>=0)return this.uint32(e);this.ensureCapacity(10);for(let t=0;t<9;t++)this.buffer[this.pos++]=e&127|128,e>>=7;return this.buffer[this.pos++]=1,this}bool(e){return this.ensureCapacity(1),this.buffer[this.pos++]=+!!e,this}bytes(e){return this.uint32(e.byteLength),this.raw(e)}string(e){typeof e!=`string`&&(e=String(e));let t=e.length;if(t<=kb){this.ensureCapacity(t+1);let n=this.buffer,r=this.pos;n[r++]=t;let i=0;for(;i127)break;n[r++]=t}if(i==t)return this.pos=r,this}this.ensureCapacity(t*3+5);let n=Ab(t),r=this.buffer,i=this.pos,{written:a}=this.encodeUtf8Into(e,r.subarray(i+n)),o=Ab(a);return o!=n&&r.copyWithin(i+o,i+n,i+n+a),this.uint32(a),this.pos+=a,this}float(e){return Nb(e),this.ensureCapacity(4),this.view().setFloat32(this.pos,e,!0),this.pos+=4,this}double(e){return this.ensureCapacity(8),this.view().setFloat64(this.pos,e,!0),this.pos+=8,this}fixed32(e){return Mb(e),this.ensureCapacity(4),this.view().setUint32(this.pos,e,!0),this.pos+=4,this}sfixed32(e){return jb(e),this.ensureCapacity(4),this.view().setInt32(this.pos,e,!0),this.pos+=4,this}sint32(e){return jb(e),this.uint32((e<<1^e>>31)>>>0)}sfixed64(e){let t=gb.enc(e);this.ensureCapacity(8);let n=this.view();return n.setInt32(this.pos,t.lo,!0),n.setInt32(this.pos+4,t.hi,!0),this.pos+=8,this}fixed64(e){let t=gb.uEnc(e);this.ensureCapacity(8);let n=this.view();return n.setInt32(this.pos,t.lo,!0),n.setInt32(this.pos+4,t.hi,!0),this.pos+=8,this}int64(e){let t=gb.enc(e);return this.writeVarint64(t.lo,t.hi)}sint64(e){let t=gb.enc(e),n=t.hi>>31,r=t.lo<<1^n,i=(t.hi<<1|t.lo>>>31)^n;return this.writeVarint64(r,i)}uint64(e){let t=gb.uEnc(e);return this.writeVarint64(t.lo,t.hi)}writeVarint64(e,t){this.ensureCapacity(10);let n=this.buffer,r=this.pos;for(let i=0;i<28;i+=7){let a=e>>>i,o=!(!(a>>>7)&&t==0);if(n[r++]=(o?a|128:a)&255,!o)return this.pos=r,this}let i=e>>>28&15|(t&7)<<4,a=!!(t>>3);if(n[r++]=(a?i|128:i)&255,!a)return this.pos=r,this;for(let e=3;e<31;e+=7){let i=t>>>e,a=!!(i>>>7);if(n[r++]=(a?i|128:i)&255,!a)return this.pos=r,this}return n[r++]=t>>>31&1,this.pos=r,this}},Tb=128,Eb=1,Db=new Uint8Array,Ob=new DataView(Db.buffer),kb=32;function Ab(e){return e<128?1:e<16384?2:e<2097152?3:e<268435456?4:5}var X=class{constructor(e,t=Sb().decodeUtf8){this.decodeUtf8=t,this.varint64Lo=0,this.varint64Hi=0,this.varint64=ob,this.uint32=hb,this.buf=e,this.len=e.length,this.pos=0,this.view=new DataView(e.buffer,e.byteOffset,e.byteLength)}tag(){let e=this.pos,t=this.uint32(),n=this.pos-e;if(n>5||n==5&&this.buf[this.pos-1]>15)throw Error(`illegal tag: varint overflows uint32`);let r=t>>>3,i=t&7;if(r<=0||i>5)throw Error(`illegal tag: field no `+r+` wire type `+i);return[r,i]}skip(e,t,n=100){let r=this.pos;switch(e){case wb.Varint:for(;this.buf[this.pos++]&128;);break;case wb.Bit64:this.pos+=4;case wb.Bit32:this.pos+=4;break;case wb.LengthDelimited:let r=this.uint32();this.pos+=r;break;case wb.StartGroup:if(n<=0)throw Error(`maximum recursion depth reached`);for(;;){let[e,r]=this.tag();if(r===wb.EndGroup){if(t!==void 0&&e!==t)throw Error(`invalid end group tag`);break}this.skip(r,e,n-1)}break;default:throw Error(`cant skip wire type `+e)}return this.assertBounds(),this.buf.subarray(r,this.pos)}assertBounds(){if(this.pos>this.len)throw RangeError(`premature EOF`)}int32(){return this.uint32()|0}sint32(){let e=this.uint32();return e>>>1^-(e&1)}int64(){return this.varint64(),gb.dec(this.varint64Lo,this.varint64Hi)}uint64(){return this.varint64(),gb.uDec(this.varint64Lo,this.varint64Hi)}sint64(){this.varint64();let e=this.varint64Lo,t=this.varint64Hi,n=-(e&1);return e=(e>>>1|(t&1)<<31)^n,t=t>>>1^n,gb.dec(e,t)}bool(){let e=this.buf[this.pos];return e<128?(this.pos++,e!==0):(this.varint64(),this.varint64Lo!==0||this.varint64Hi!==0)}fixed32(){return this.view.getUint32((this.pos+=4)-4,!0)}sfixed32(){return this.view.getInt32((this.pos+=4)-4,!0)}fixed64(){return gb.uDec(this.sfixed32(),this.sfixed32())}sfixed64(){return gb.dec(this.sfixed32(),this.sfixed32())}float(){return this.view.getFloat32((this.pos+=4)-4,!0)}double(){return this.view.getFloat64((this.pos+=8)-8,!0)}bytes(){let e=this.uint32(),t=this.pos;return this.pos+=e,this.assertBounds(),this.buf.subarray(t,t+e)}string(e){let t=this.bytes(),n=t.length;if(n<=kb){let r=Array(n);for(let i=0;i127)return this.decodeUtf8(t,e);r[i]=n}return String.fromCharCode.apply(String,r)}return this.decodeUtf8(t,e)}};function jb(e){if(typeof e==`string`)e=Number(e);else if(typeof e!=`number`)throw Error(`invalid int32: `+typeof e);if(!Number.isInteger(e)||e>2147483647||e<-2147483648)throw Error(`invalid int32: `+e)}function Mb(e){if(typeof e==`string`)e=Number(e);else if(typeof e!=`number`)throw Error(`invalid uint32: `+typeof e);if(!Number.isInteger(e)||e>4294967295||e<0)throw Error(`invalid uint32: `+e)}function Nb(e){if(typeof e==`string`){let t=e;if(e=Number(e),Number.isNaN(e)&&t!==`NaN`)throw Error(`invalid float32: `+t)}else if(typeof e!=`number`)throw Error(`invalid float32: `+typeof e);if(!Number.isFinite(Math.fround(e))&&Number.isFinite(e))throw Error(`invalid float32: `+e)}var Pb=function(e){return e[e.NULL_VALUE=0]=`NULL_VALUE`,e[e.UNRECOGNIZED=-1]=`UNRECOGNIZED`,e}({});function Fb(){return{fields:{}}}var Ib={encode(e,t=new Y){return Object.entries(e.fields).forEach(([e,n])=>{n!==void 0&&Rb.encode({key:e,value:n},t.uint32(10).fork()).join()}),t},decode(e,t){let n=e instanceof X?e:new X(e),r=t===void 0?n.len:n.pos+t,i=Fb();for(;n.pos>>3){case 1:{if(e!==10)break;let t=Rb.decode(n,n.uint32());t.value!==void 0&&(i.fields[t.key]=t.value);continue}}if((e&7)==4||e===0)break;n.skip(e&7)}return i},create(e){return Ib.fromPartial(e??{})},fromPartial(e){let t=Fb();return t.fields=Object.entries(e.fields??{}).reduce((e,[t,n])=>(n!==void 0&&(e[t]=n),e),{}),t},wrap(e){let t=Fb();if(e!==void 0)for(let n of Object.keys(e))t.fields[n]=e[n];return t},unwrap(e){let t={};if(e.fields)for(let n of Object.keys(e.fields))t[n]=e.fields[n];return t}};function Lb(){return{key:``,value:void 0}}var Rb={encode(e,t=new Y){return e.key!==``&&t.uint32(10).string(e.key),e.value!==void 0&&Z.encode(Z.wrap(e.value),t.uint32(18).fork()).join(),t},decode(e,t){let n=e instanceof X?e:new X(e),r=t===void 0?n.len:n.pos+t,i=Lb();for(;n.pos>>3){case 1:if(e!==10)break;i.key=n.string();continue;case 2:if(e!==18)break;i.value=Z.unwrap(Z.decode(n,n.uint32()));continue}if((e&7)==4||e===0)break;n.skip(e&7)}return i},create(e){return Rb.fromPartial(e??{})},fromPartial(e){let t=Lb();return t.key=e.key??``,t.value=e.value??void 0,t}};function zb(){return{nullValue:void 0,numberValue:void 0,stringValue:void 0,boolValue:void 0,structValue:void 0,listValue:void 0}}var Z={encode(e,t=new Y){return e.nullValue!==void 0&&t.uint32(8).int32(e.nullValue),e.numberValue!==void 0&&t.uint32(17).double(e.numberValue),e.stringValue!==void 0&&t.uint32(26).string(e.stringValue),e.boolValue!==void 0&&t.uint32(32).bool(e.boolValue),e.structValue!==void 0&&Ib.encode(Ib.wrap(e.structValue),t.uint32(42).fork()).join(),e.listValue!==void 0&&Vb.encode(Vb.wrap(e.listValue),t.uint32(50).fork()).join(),t},decode(e,t){let n=e instanceof X?e:new X(e),r=t===void 0?n.len:n.pos+t,i=zb();for(;n.pos>>3){case 1:if(e!==8)break;i.nullValue=n.int32();continue;case 2:if(e!==17)break;i.numberValue=n.double();continue;case 3:if(e!==26)break;i.stringValue=n.string();continue;case 4:if(e!==32)break;i.boolValue=n.bool();continue;case 5:if(e!==42)break;i.structValue=Ib.unwrap(Ib.decode(n,n.uint32()));continue;case 6:if(e!==50)break;i.listValue=Vb.unwrap(Vb.decode(n,n.uint32()));continue}if((e&7)==4||e===0)break;n.skip(e&7)}return i},create(e){return Z.fromPartial(e??{})},fromPartial(e){let t=zb();return t.nullValue=e.nullValue??void 0,t.numberValue=e.numberValue??void 0,t.stringValue=e.stringValue??void 0,t.boolValue=e.boolValue??void 0,t.structValue=e.structValue??void 0,t.listValue=e.listValue??void 0,t},wrap(e){let t=zb();if(e===null)t.nullValue=Pb.NULL_VALUE;else if(typeof e==`boolean`)t.boolValue=e;else if(typeof e==`number`)t.numberValue=e;else if(typeof e==`string`)t.stringValue=e;else if(globalThis.Array.isArray(e))t.listValue=e;else if(typeof e==`object`)t.structValue=e;else if(e!==void 0)throw new globalThis.Error(`Unsupported any value type: `+typeof e);return t},unwrap(e){if(e.stringValue!==void 0)return e.stringValue;if(e?.numberValue!==void 0)return e.numberValue;if(e?.boolValue!==void 0)return e.boolValue;if(e?.structValue!==void 0)return e.structValue;if(e?.listValue!==void 0)return e.listValue;if(e?.nullValue!==void 0)return null}};function Bb(){return{values:[]}}var Vb={encode(e,t=new Y){for(let n of e.values)Z.encode(Z.wrap(n),t.uint32(10).fork()).join();return t},decode(e,t){let n=e instanceof X?e:new X(e),r=t===void 0?n.len:n.pos+t,i=Bb();for(;n.pos>>3){case 1:if(e!==10)break;i.values.push(Z.unwrap(Z.decode(n,n.uint32())));continue}if((e&7)==4||e===0)break;n.skip(e&7)}return i},create(e){return Vb.fromPartial(e??{})},fromPartial(e){let t=Bb();return t.values=e.values?.map(e=>e)||[],t},wrap(e){let t=Bb();return t.values=e??[],t},unwrap(e){return e?.hasOwnProperty(`values`)&&globalThis.Array.isArray(e.values)?e.values:e}},Hb=function(e){return e[e.ADD=0]=`ADD`,e[e.REMOVE=1]=`REMOVE`,e[e.REPLACE=2]=`REPLACE`,e[e.MOVE=3]=`MOVE`,e[e.COPY=4]=`COPY`,e[e.TEST=5]=`TEST`,e[e.UNRECOGNIZED=-1]=`UNRECOGNIZED`,e}({});function Ub(){return{op:0,path:``,from:void 0,value:void 0}}var Wb={encode(e,t=new Y){return e.op!==0&&t.uint32(8).int32(e.op),e.path!==``&&t.uint32(18).string(e.path),e.from!==void 0&&t.uint32(26).string(e.from),e.value!==void 0&&Z.encode(Z.wrap(e.value),t.uint32(34).fork()).join(),t},decode(e,t){let n=e instanceof X?e:new X(e),r=t===void 0?n.len:n.pos+t,i=Ub();for(;n.pos>>3){case 1:if(e!==8)break;i.op=n.int32();continue;case 2:if(e!==18)break;i.path=n.string();continue;case 3:if(e!==26)break;i.from=n.string();continue;case 4:if(e!==34)break;i.value=Z.unwrap(Z.decode(n,n.uint32()));continue}if((e&7)==4||e===0)break;n.skip(e&7)}return i},create(e){return Wb.fromPartial(e??{})},fromPartial(e){let t=Ub();return t.op=e.op??0,t.path=e.path??``,t.from=e.from??void 0,t.value=e.value??void 0,t}};function Gb(){return{text:``,id:void 0,metadata:void 0}}var Kb={encode(e,t=new Y){return e.text!==``&&t.uint32(10).string(e.text),e.id!==void 0&&t.uint32(18).string(e.id),e.metadata!==void 0&&Z.encode(Z.wrap(e.metadata),t.uint32(26).fork()).join(),t},decode(e,t){let n=e instanceof X?e:new X(e),r=t===void 0?n.len:n.pos+t,i=Gb();for(;n.pos>>3){case 1:if(e!==10)break;i.text=n.string();continue;case 2:if(e!==18)break;i.id=n.string();continue;case 3:if(e!==26)break;i.metadata=Z.unwrap(Z.decode(n,n.uint32()));continue}if((e&7)==4||e===0)break;n.skip(e&7)}return i},create(e){return Kb.fromPartial(e??{})},fromPartial(e){let t=Gb();return t.text=e.text??``,t.id=e.id??void 0,t.metadata=e.metadata??void 0,t}};function qb(){return{source:void 0,metadata:void 0,id:void 0}}var Jb={encode(e,t=new Y){return e.source!==void 0&&nx.encode(e.source,t.uint32(10).fork()).join(),e.metadata!==void 0&&Z.encode(Z.wrap(e.metadata),t.uint32(18).fork()).join(),e.id!==void 0&&t.uint32(26).string(e.id),t},decode(e,t){let n=e instanceof X?e:new X(e),r=t===void 0?n.len:n.pos+t,i=qb();for(;n.pos>>3){case 1:if(e!==10)break;i.source=nx.decode(n,n.uint32());continue;case 2:if(e!==18)break;i.metadata=Z.unwrap(Z.decode(n,n.uint32()));continue;case 3:if(e!==26)break;i.id=n.string();continue}if((e&7)==4||e===0)break;n.skip(e&7)}return i},create(e){return Jb.fromPartial(e??{})},fromPartial(e){let t=qb();return t.source=e.source!==void 0&&e.source!==null?nx.fromPartial(e.source):void 0,t.metadata=e.metadata??void 0,t.id=e.id??void 0,t}};function Yb(){return{value:``,mimeType:``}}var Xb={encode(e,t=new Y){return e.value!==``&&t.uint32(10).string(e.value),e.mimeType!==``&&t.uint32(18).string(e.mimeType),t},decode(e,t){let n=e instanceof X?e:new X(e),r=t===void 0?n.len:n.pos+t,i=Yb();for(;n.pos>>3){case 1:if(e!==10)break;i.value=n.string();continue;case 2:if(e!==18)break;i.mimeType=n.string();continue}if((e&7)==4||e===0)break;n.skip(e&7)}return i},create(e){return Xb.fromPartial(e??{})},fromPartial(e){let t=Yb();return t.value=e.value??``,t.mimeType=e.mimeType??``,t}};function Zb(){return{value:``,mimeType:void 0}}var Qb={encode(e,t=new Y){return e.value!==``&&t.uint32(10).string(e.value),e.mimeType!==void 0&&t.uint32(18).string(e.mimeType),t},decode(e,t){let n=e instanceof X?e:new X(e),r=t===void 0?n.len:n.pos+t,i=Zb();for(;n.pos>>3){case 1:if(e!==10)break;i.value=n.string();continue;case 2:if(e!==18)break;i.mimeType=n.string();continue}if((e&7)==4||e===0)break;n.skip(e&7)}return i},create(e){return Qb.fromPartial(e??{})},fromPartial(e){let t=Zb();return t.value=e.value??``,t.mimeType=e.mimeType??void 0,t}};function $b(){return{value:``,provider:void 0,mimeType:void 0}}var ex={encode(e,t=new Y){return e.value!==``&&t.uint32(10).string(e.value),e.provider!==void 0&&t.uint32(18).string(e.provider),e.mimeType!==void 0&&t.uint32(26).string(e.mimeType),t},decode(e,t){let n=e instanceof X?e:new X(e),r=t===void 0?n.len:n.pos+t,i=$b();for(;n.pos>>3){case 1:if(e!==10)break;i.value=n.string();continue;case 2:if(e!==18)break;i.provider=n.string();continue;case 3:if(e!==26)break;i.mimeType=n.string();continue}if((e&7)==4||e===0)break;n.skip(e&7)}return i},create(e){return ex.fromPartial(e??{})},fromPartial(e){let t=$b();return t.value=e.value??``,t.provider=e.provider??void 0,t.mimeType=e.mimeType??void 0,t}};function tx(){return{data:void 0,url:void 0,file:void 0}}var nx={encode(e,t=new Y){return e.data!==void 0&&Xb.encode(e.data,t.uint32(10).fork()).join(),e.url!==void 0&&Qb.encode(e.url,t.uint32(18).fork()).join(),e.file!==void 0&&ex.encode(e.file,t.uint32(26).fork()).join(),t},decode(e,t){let n=e instanceof X?e:new X(e),r=t===void 0?n.len:n.pos+t,i=tx();for(;n.pos>>3){case 1:if(e!==10)break;i.data=Xb.decode(n,n.uint32());continue;case 2:if(e!==18)break;i.url=Qb.decode(n,n.uint32());continue;case 3:if(e!==26)break;i.file=ex.decode(n,n.uint32());continue}if((e&7)==4||e===0)break;n.skip(e&7)}return i},create(e){return nx.fromPartial(e??{})},fromPartial(e){let t=tx();return t.data=e.data!==void 0&&e.data!==null?Xb.fromPartial(e.data):void 0,t.url=e.url!==void 0&&e.url!==null?Qb.fromPartial(e.url):void 0,t.file=e.file!==void 0&&e.file!==null?ex.fromPartial(e.file):void 0,t}};function rx(){return{source:void 0,metadata:void 0,id:void 0}}var ix={encode(e,t=new Y){return e.source!==void 0&&nx.encode(e.source,t.uint32(10).fork()).join(),e.metadata!==void 0&&Z.encode(Z.wrap(e.metadata),t.uint32(18).fork()).join(),e.id!==void 0&&t.uint32(26).string(e.id),t},decode(e,t){let n=e instanceof X?e:new X(e),r=t===void 0?n.len:n.pos+t,i=rx();for(;n.pos>>3){case 1:if(e!==10)break;i.source=nx.decode(n,n.uint32());continue;case 2:if(e!==18)break;i.metadata=Z.unwrap(Z.decode(n,n.uint32()));continue;case 3:if(e!==26)break;i.id=n.string();continue}if((e&7)==4||e===0)break;n.skip(e&7)}return i},create(e){return ix.fromPartial(e??{})},fromPartial(e){let t=rx();return t.source=e.source!==void 0&&e.source!==null?nx.fromPartial(e.source):void 0,t.metadata=e.metadata??void 0,t.id=e.id??void 0,t}};function ax(){return{source:void 0,metadata:void 0,id:void 0}}var ox={encode(e,t=new Y){return e.source!==void 0&&nx.encode(e.source,t.uint32(10).fork()).join(),e.metadata!==void 0&&Z.encode(Z.wrap(e.metadata),t.uint32(18).fork()).join(),e.id!==void 0&&t.uint32(26).string(e.id),t},decode(e,t){let n=e instanceof X?e:new X(e),r=t===void 0?n.len:n.pos+t,i=ax();for(;n.pos>>3){case 1:if(e!==10)break;i.source=nx.decode(n,n.uint32());continue;case 2:if(e!==18)break;i.metadata=Z.unwrap(Z.decode(n,n.uint32()));continue;case 3:if(e!==26)break;i.id=n.string();continue}if((e&7)==4||e===0)break;n.skip(e&7)}return i},create(e){return ox.fromPartial(e??{})},fromPartial(e){let t=ax();return t.source=e.source!==void 0&&e.source!==null?nx.fromPartial(e.source):void 0,t.metadata=e.metadata??void 0,t.id=e.id??void 0,t}};function sx(){return{source:void 0,metadata:void 0,id:void 0}}var cx={encode(e,t=new Y){return e.source!==void 0&&nx.encode(e.source,t.uint32(10).fork()).join(),e.metadata!==void 0&&Z.encode(Z.wrap(e.metadata),t.uint32(18).fork()).join(),e.id!==void 0&&t.uint32(26).string(e.id),t},decode(e,t){let n=e instanceof X?e:new X(e),r=t===void 0?n.len:n.pos+t,i=sx();for(;n.pos>>3){case 1:if(e!==10)break;i.source=nx.decode(n,n.uint32());continue;case 2:if(e!==18)break;i.metadata=Z.unwrap(Z.decode(n,n.uint32()));continue;case 3:if(e!==26)break;i.id=n.string();continue}if((e&7)==4||e===0)break;n.skip(e&7)}return i},create(e){return cx.fromPartial(e??{})},fromPartial(e){let t=sx();return t.source=e.source!==void 0&&e.source!==null?nx.fromPartial(e.source):void 0,t.metadata=e.metadata??void 0,t.id=e.id??void 0,t}};function lx(){return{text:void 0,image:void 0,audio:void 0,video:void 0,document:void 0}}var ux={encode(e,t=new Y){return e.text!==void 0&&Kb.encode(e.text,t.uint32(10).fork()).join(),e.image!==void 0&&Jb.encode(e.image,t.uint32(18).fork()).join(),e.audio!==void 0&&ix.encode(e.audio,t.uint32(26).fork()).join(),e.video!==void 0&&ox.encode(e.video,t.uint32(34).fork()).join(),e.document!==void 0&&cx.encode(e.document,t.uint32(42).fork()).join(),t},decode(e,t){let n=e instanceof X?e:new X(e),r=t===void 0?n.len:n.pos+t,i=lx();for(;n.pos>>3){case 1:if(e!==10)break;i.text=Kb.decode(n,n.uint32());continue;case 2:if(e!==18)break;i.image=Jb.decode(n,n.uint32());continue;case 3:if(e!==26)break;i.audio=ix.decode(n,n.uint32());continue;case 4:if(e!==34)break;i.video=ox.decode(n,n.uint32());continue;case 5:if(e!==42)break;i.document=cx.decode(n,n.uint32());continue}if((e&7)==4||e===0)break;n.skip(e&7)}return i},create(e){return ux.fromPartial(e??{})},fromPartial(e){let t=lx();return t.text=e.text!==void 0&&e.text!==null?Kb.fromPartial(e.text):void 0,t.image=e.image!==void 0&&e.image!==null?Jb.fromPartial(e.image):void 0,t.audio=e.audio!==void 0&&e.audio!==null?ix.fromPartial(e.audio):void 0,t.video=e.video!==void 0&&e.video!==null?ox.fromPartial(e.video):void 0,t.document=e.document!==void 0&&e.document!==null?cx.fromPartial(e.document):void 0,t}};function dx(){return{id:``,type:``,function:void 0,metadata:void 0,encryptedValue:void 0}}var fx={encode(e,t=new Y){return e.id!==``&&t.uint32(10).string(e.id),e.type!==``&&t.uint32(18).string(e.type),e.function!==void 0&&mx.encode(e.function,t.uint32(26).fork()).join(),e.metadata!==void 0&&Ib.encode(Ib.wrap(e.metadata),t.uint32(34).fork()).join(),e.encryptedValue!==void 0&&t.uint32(42).string(e.encryptedValue),t},decode(e,t){let n=e instanceof X?e:new X(e),r=t===void 0?n.len:n.pos+t,i=dx();for(;n.pos>>3){case 1:if(e!==10)break;i.id=n.string();continue;case 2:if(e!==18)break;i.type=n.string();continue;case 3:if(e!==26)break;i.function=mx.decode(n,n.uint32());continue;case 4:if(e!==34)break;i.metadata=Ib.unwrap(Ib.decode(n,n.uint32()));continue;case 5:if(e!==42)break;i.encryptedValue=n.string();continue}if((e&7)==4||e===0)break;n.skip(e&7)}return i},create(e){return fx.fromPartial(e??{})},fromPartial(e){let t=dx();return t.id=e.id??``,t.type=e.type??``,t.function=e.function!==void 0&&e.function!==null?mx.fromPartial(e.function):void 0,t.metadata=e.metadata??void 0,t.encryptedValue=e.encryptedValue??void 0,t}};function px(){return{name:``,arguments:``}}var mx={encode(e,t=new Y){return e.name!==``&&t.uint32(10).string(e.name),e.arguments!==``&&t.uint32(18).string(e.arguments),t},decode(e,t){let n=e instanceof X?e:new X(e),r=t===void 0?n.len:n.pos+t,i=px();for(;n.pos>>3){case 1:if(e!==10)break;i.name=n.string();continue;case 2:if(e!==18)break;i.arguments=n.string();continue}if((e&7)==4||e===0)break;n.skip(e&7)}return i},create(e){return mx.fromPartial(e??{})},fromPartial(e){let t=px();return t.name=e.name??``,t.arguments=e.arguments??``,t}};function hx(){return{id:``,role:``,content:void 0,name:void 0,toolCalls:[],toolCallId:void 0,error:void 0,contentParts:[],metadata:void 0,subagentRunId:void 0,encryptedValue:void 0,activityType:void 0,activityContent:void 0}}var gx={encode(e,t=new Y){e.id!==``&&t.uint32(10).string(e.id),e.role!==``&&t.uint32(18).string(e.role),e.content!==void 0&&t.uint32(26).string(e.content),e.name!==void 0&&t.uint32(34).string(e.name);for(let n of e.toolCalls)fx.encode(n,t.uint32(42).fork()).join();e.toolCallId!==void 0&&t.uint32(50).string(e.toolCallId),e.error!==void 0&&t.uint32(58).string(e.error);for(let n of e.contentParts)ux.encode(n,t.uint32(66).fork()).join();return e.metadata!==void 0&&Ib.encode(Ib.wrap(e.metadata),t.uint32(74).fork()).join(),e.subagentRunId!==void 0&&t.uint32(82).string(e.subagentRunId),e.encryptedValue!==void 0&&t.uint32(90).string(e.encryptedValue),e.activityType!==void 0&&t.uint32(98).string(e.activityType),e.activityContent!==void 0&&Ib.encode(Ib.wrap(e.activityContent),t.uint32(106).fork()).join(),t},decode(e,t){let n=e instanceof X?e:new X(e),r=t===void 0?n.len:n.pos+t,i=hx();for(;n.pos>>3){case 1:if(e!==10)break;i.id=n.string();continue;case 2:if(e!==18)break;i.role=n.string();continue;case 3:if(e!==26)break;i.content=n.string();continue;case 4:if(e!==34)break;i.name=n.string();continue;case 5:if(e!==42)break;i.toolCalls.push(fx.decode(n,n.uint32()));continue;case 6:if(e!==50)break;i.toolCallId=n.string();continue;case 7:if(e!==58)break;i.error=n.string();continue;case 8:if(e!==66)break;i.contentParts.push(ux.decode(n,n.uint32()));continue;case 9:if(e!==74)break;i.metadata=Ib.unwrap(Ib.decode(n,n.uint32()));continue;case 10:if(e!==82)break;i.subagentRunId=n.string();continue;case 11:if(e!==90)break;i.encryptedValue=n.string();continue;case 12:if(e!==98)break;i.activityType=n.string();continue;case 13:if(e!==106)break;i.activityContent=Ib.unwrap(Ib.decode(n,n.uint32()));continue}if((e&7)==4||e===0)break;n.skip(e&7)}return i},create(e){return gx.fromPartial(e??{})},fromPartial(e){let t=hx();return t.id=e.id??``,t.role=e.role??``,t.content=e.content??void 0,t.name=e.name??void 0,t.toolCalls=e.toolCalls?.map(e=>fx.fromPartial(e))||[],t.toolCallId=e.toolCallId??void 0,t.error=e.error??void 0,t.contentParts=e.contentParts?.map(e=>ux.fromPartial(e))||[],t.metadata=e.metadata??void 0,t.subagentRunId=e.subagentRunId??void 0,t.encryptedValue=e.encryptedValue??void 0,t.activityType=e.activityType??void 0,t.activityContent=e.activityContent??void 0,t}};function _x(){return{name:``,description:``,parameters:void 0,metadata:void 0}}var vx={encode(e,t=new Y){return e.name!==``&&t.uint32(10).string(e.name),e.description!==``&&t.uint32(18).string(e.description),e.parameters!==void 0&&Z.encode(Z.wrap(e.parameters),t.uint32(26).fork()).join(),e.metadata!==void 0&&Ib.encode(Ib.wrap(e.metadata),t.uint32(34).fork()).join(),t},decode(e,t){let n=e instanceof X?e:new X(e),r=t===void 0?n.len:n.pos+t,i=_x();for(;n.pos>>3){case 1:if(e!==10)break;i.name=n.string();continue;case 2:if(e!==18)break;i.description=n.string();continue;case 3:if(e!==26)break;i.parameters=Z.unwrap(Z.decode(n,n.uint32()));continue;case 4:if(e!==34)break;i.metadata=Ib.unwrap(Ib.decode(n,n.uint32()));continue}if((e&7)==4||e===0)break;n.skip(e&7)}return i},create(e){return vx.fromPartial(e??{})},fromPartial(e){let t=_x();return t.name=e.name??``,t.description=e.description??``,t.parameters=e.parameters??void 0,t.metadata=e.metadata??void 0,t}};function yx(){return{description:``,value:``}}var bx={encode(e,t=new Y){return e.description!==``&&t.uint32(10).string(e.description),e.value!==``&&t.uint32(18).string(e.value),t},decode(e,t){let n=e instanceof X?e:new X(e),r=t===void 0?n.len:n.pos+t,i=yx();for(;n.pos>>3){case 1:if(e!==10)break;i.description=n.string();continue;case 2:if(e!==18)break;i.value=n.string();continue}if((e&7)==4||e===0)break;n.skip(e&7)}return i},create(e){return bx.fromPartial(e??{})},fromPartial(e){let t=yx();return t.description=e.description??``,t.value=e.value??``,t}};function xx(){return{interruptId:``,status:``,payload:void 0,metadata:void 0}}var Sx={encode(e,t=new Y){return e.interruptId!==``&&t.uint32(10).string(e.interruptId),e.status!==``&&t.uint32(18).string(e.status),e.payload!==void 0&&Z.encode(Z.wrap(e.payload),t.uint32(26).fork()).join(),e.metadata!==void 0&&Ib.encode(Ib.wrap(e.metadata),t.uint32(34).fork()).join(),t},decode(e,t){let n=e instanceof X?e:new X(e),r=t===void 0?n.len:n.pos+t,i=xx();for(;n.pos>>3){case 1:if(e!==10)break;i.interruptId=n.string();continue;case 2:if(e!==18)break;i.status=n.string();continue;case 3:if(e!==26)break;i.payload=Z.unwrap(Z.decode(n,n.uint32()));continue;case 4:if(e!==34)break;i.metadata=Ib.unwrap(Ib.decode(n,n.uint32()));continue}if((e&7)==4||e===0)break;n.skip(e&7)}return i},create(e){return Sx.fromPartial(e??{})},fromPartial(e){let t=xx();return t.interruptId=e.interruptId??``,t.status=e.status??``,t.payload=e.payload??void 0,t.metadata=e.metadata??void 0,t}};function Cx(){return{threadId:``,runId:``,parentRunId:void 0,state:void 0,messages:[],tools:[],context:[],forwardedProps:void 0,resume:[],protocolVersion:void 0}}var wx={encode(e,t=new Y){e.threadId!==``&&t.uint32(10).string(e.threadId),e.runId!==``&&t.uint32(18).string(e.runId),e.parentRunId!==void 0&&t.uint32(26).string(e.parentRunId),e.state!==void 0&&Z.encode(Z.wrap(e.state),t.uint32(34).fork()).join();for(let n of e.messages)gx.encode(n,t.uint32(42).fork()).join();for(let n of e.tools)vx.encode(n,t.uint32(50).fork()).join();for(let n of e.context)bx.encode(n,t.uint32(58).fork()).join();e.forwardedProps!==void 0&&Z.encode(Z.wrap(e.forwardedProps),t.uint32(66).fork()).join();for(let n of e.resume)Sx.encode(n,t.uint32(74).fork()).join();return e.protocolVersion!==void 0&&t.uint32(82).string(e.protocolVersion),t},decode(e,t){let n=e instanceof X?e:new X(e),r=t===void 0?n.len:n.pos+t,i=Cx();for(;n.pos>>3){case 1:if(e!==10)break;i.threadId=n.string();continue;case 2:if(e!==18)break;i.runId=n.string();continue;case 3:if(e!==26)break;i.parentRunId=n.string();continue;case 4:if(e!==34)break;i.state=Z.unwrap(Z.decode(n,n.uint32()));continue;case 5:if(e!==42)break;i.messages.push(gx.decode(n,n.uint32()));continue;case 6:if(e!==50)break;i.tools.push(vx.decode(n,n.uint32()));continue;case 7:if(e!==58)break;i.context.push(bx.decode(n,n.uint32()));continue;case 8:if(e!==66)break;i.forwardedProps=Z.unwrap(Z.decode(n,n.uint32()));continue;case 9:if(e!==74)break;i.resume.push(Sx.decode(n,n.uint32()));continue;case 10:if(e!==82)break;i.protocolVersion=n.string();continue}if((e&7)==4||e===0)break;n.skip(e&7)}return i},create(e){return wx.fromPartial(e??{})},fromPartial(e){let t=Cx();return t.threadId=e.threadId??``,t.runId=e.runId??``,t.parentRunId=e.parentRunId??void 0,t.state=e.state??void 0,t.messages=e.messages?.map(e=>gx.fromPartial(e))||[],t.tools=e.tools?.map(e=>vx.fromPartial(e))||[],t.context=e.context?.map(e=>bx.fromPartial(e))||[],t.forwardedProps=e.forwardedProps??void 0,t.resume=e.resume?.map(e=>Sx.fromPartial(e))||[],t.protocolVersion=e.protocolVersion??void 0,t}};function Tx(){return{id:``,reason:``,message:void 0,toolCallId:void 0,responseSchema:void 0,expiresAt:void 0,metadata:void 0,subagentRunId:void 0}}var Ex={encode(e,t=new Y){return e.id!==``&&t.uint32(10).string(e.id),e.reason!==``&&t.uint32(18).string(e.reason),e.message!==void 0&&t.uint32(26).string(e.message),e.toolCallId!==void 0&&t.uint32(34).string(e.toolCallId),e.responseSchema!==void 0&&Z.encode(Z.wrap(e.responseSchema),t.uint32(42).fork()).join(),e.expiresAt!==void 0&&t.uint32(50).string(e.expiresAt),e.metadata!==void 0&&Z.encode(Z.wrap(e.metadata),t.uint32(58).fork()).join(),e.subagentRunId!==void 0&&t.uint32(66).string(e.subagentRunId),t},decode(e,t){let n=e instanceof X?e:new X(e),r=t===void 0?n.len:n.pos+t,i=Tx();for(;n.pos>>3){case 1:if(e!==10)break;i.id=n.string();continue;case 2:if(e!==18)break;i.reason=n.string();continue;case 3:if(e!==26)break;i.message=n.string();continue;case 4:if(e!==34)break;i.toolCallId=n.string();continue;case 5:if(e!==42)break;i.responseSchema=Z.unwrap(Z.decode(n,n.uint32()));continue;case 6:if(e!==50)break;i.expiresAt=n.string();continue;case 7:if(e!==58)break;i.metadata=Z.unwrap(Z.decode(n,n.uint32()));continue;case 8:if(e!==66)break;i.subagentRunId=n.string();continue}if((e&7)==4||e===0)break;n.skip(e&7)}return i},create(e){return Ex.fromPartial(e??{})},fromPartial(e){let t=Tx();return t.id=e.id??``,t.reason=e.reason??``,t.message=e.message??void 0,t.toolCallId=e.toolCallId??void 0,t.responseSchema=e.responseSchema??void 0,t.expiresAt=e.expiresAt??void 0,t.metadata=e.metadata??void 0,t.subagentRunId=e.subagentRunId??void 0,t}},Dx=function(e){return e[e.TEXT_MESSAGE_START=0]=`TEXT_MESSAGE_START`,e[e.TEXT_MESSAGE_CONTENT=1]=`TEXT_MESSAGE_CONTENT`,e[e.TEXT_MESSAGE_END=2]=`TEXT_MESSAGE_END`,e[e.TOOL_CALL_START=3]=`TOOL_CALL_START`,e[e.TOOL_CALL_ARGS=4]=`TOOL_CALL_ARGS`,e[e.TOOL_CALL_END=5]=`TOOL_CALL_END`,e[e.STATE_SNAPSHOT=6]=`STATE_SNAPSHOT`,e[e.STATE_DELTA=7]=`STATE_DELTA`,e[e.MESSAGES_SNAPSHOT=8]=`MESSAGES_SNAPSHOT`,e[e.RAW=9]=`RAW`,e[e.CUSTOM=10]=`CUSTOM`,e[e.RUN_STARTED=11]=`RUN_STARTED`,e[e.RUN_FINISHED=12]=`RUN_FINISHED`,e[e.RUN_ERROR=13]=`RUN_ERROR`,e[e.STEP_STARTED=14]=`STEP_STARTED`,e[e.STEP_FINISHED=15]=`STEP_FINISHED`,e[e.SUBAGENT_STARTED=16]=`SUBAGENT_STARTED`,e[e.SUBAGENT_FINISHED=17]=`SUBAGENT_FINISHED`,e[e.SUBAGENT_ERROR=18]=`SUBAGENT_ERROR`,e[e.TEXT_MESSAGE_CHUNK=19]=`TEXT_MESSAGE_CHUNK`,e[e.TOOL_CALL_CHUNK=20]=`TOOL_CALL_CHUNK`,e[e.TOOL_CALL_RESULT=21]=`TOOL_CALL_RESULT`,e[e.ACTIVITY_SNAPSHOT=22]=`ACTIVITY_SNAPSHOT`,e[e.ACTIVITY_DELTA=23]=`ACTIVITY_DELTA`,e[e.REASONING_START=24]=`REASONING_START`,e[e.REASONING_MESSAGE_START=25]=`REASONING_MESSAGE_START`,e[e.REASONING_MESSAGE_CONTENT=26]=`REASONING_MESSAGE_CONTENT`,e[e.REASONING_MESSAGE_END=27]=`REASONING_MESSAGE_END`,e[e.REASONING_MESSAGE_CHUNK=28]=`REASONING_MESSAGE_CHUNK`,e[e.REASONING_END=29]=`REASONING_END`,e[e.REASONING_ENCRYPTED_VALUE=30]=`REASONING_ENCRYPTED_VALUE`,e[e.UNRECOGNIZED=-1]=`UNRECOGNIZED`,e}({});function Ox(){return{type:0,timestamp:void 0,rawEvent:void 0,metadata:void 0}}var Q={encode(e,t=new Y){return e.type!==0&&t.uint32(8).int32(e.type),e.timestamp!==void 0&&t.uint32(16).int64(e.timestamp),e.rawEvent!==void 0&&Z.encode(Z.wrap(e.rawEvent),t.uint32(26).fork()).join(),e.metadata!==void 0&&Ib.encode(Ib.wrap(e.metadata),t.uint32(34).fork()).join(),t},decode(e,t){let n=e instanceof X?e:new X(e),r=t===void 0?n.len:n.pos+t,i=Ox();for(;n.pos>>3){case 1:if(e!==8)break;i.type=n.int32();continue;case 2:if(e!==16)break;i.timestamp=VS(n.int64());continue;case 3:if(e!==26)break;i.rawEvent=Z.unwrap(Z.decode(n,n.uint32()));continue;case 4:if(e!==34)break;i.metadata=Ib.unwrap(Ib.decode(n,n.uint32()));continue}if((e&7)==4||e===0)break;n.skip(e&7)}return i},create(e){return Q.fromPartial(e??{})},fromPartial(e){let t=Ox();return t.type=e.type??0,t.timestamp=e.timestamp??void 0,t.rawEvent=e.rawEvent??void 0,t.metadata=e.metadata??void 0,t}};function kx(){return{baseEvent:void 0,messageId:``,role:void 0,name:void 0,subagentRunId:void 0}}var Ax={encode(e,t=new Y){return e.baseEvent!==void 0&&Q.encode(e.baseEvent,t.uint32(10).fork()).join(),e.messageId!==``&&t.uint32(18).string(e.messageId),e.role!==void 0&&t.uint32(26).string(e.role),e.name!==void 0&&t.uint32(34).string(e.name),e.subagentRunId!==void 0&&t.uint32(42).string(e.subagentRunId),t},decode(e,t){let n=e instanceof X?e:new X(e),r=t===void 0?n.len:n.pos+t,i=kx();for(;n.pos>>3){case 1:if(e!==10)break;i.baseEvent=Q.decode(n,n.uint32());continue;case 2:if(e!==18)break;i.messageId=n.string();continue;case 3:if(e!==26)break;i.role=n.string();continue;case 4:if(e!==34)break;i.name=n.string();continue;case 5:if(e!==42)break;i.subagentRunId=n.string();continue}if((e&7)==4||e===0)break;n.skip(e&7)}return i},create(e){return Ax.fromPartial(e??{})},fromPartial(e){let t=kx();return t.baseEvent=e.baseEvent!==void 0&&e.baseEvent!==null?Q.fromPartial(e.baseEvent):void 0,t.messageId=e.messageId??``,t.role=e.role??void 0,t.name=e.name??void 0,t.subagentRunId=e.subagentRunId??void 0,t}};function jx(){return{baseEvent:void 0,messageId:``,delta:``,subagentRunId:void 0}}var Mx={encode(e,t=new Y){return e.baseEvent!==void 0&&Q.encode(e.baseEvent,t.uint32(10).fork()).join(),e.messageId!==``&&t.uint32(18).string(e.messageId),e.delta!==``&&t.uint32(26).string(e.delta),e.subagentRunId!==void 0&&t.uint32(34).string(e.subagentRunId),t},decode(e,t){let n=e instanceof X?e:new X(e),r=t===void 0?n.len:n.pos+t,i=jx();for(;n.pos>>3){case 1:if(e!==10)break;i.baseEvent=Q.decode(n,n.uint32());continue;case 2:if(e!==18)break;i.messageId=n.string();continue;case 3:if(e!==26)break;i.delta=n.string();continue;case 4:if(e!==34)break;i.subagentRunId=n.string();continue}if((e&7)==4||e===0)break;n.skip(e&7)}return i},create(e){return Mx.fromPartial(e??{})},fromPartial(e){let t=jx();return t.baseEvent=e.baseEvent!==void 0&&e.baseEvent!==null?Q.fromPartial(e.baseEvent):void 0,t.messageId=e.messageId??``,t.delta=e.delta??``,t.subagentRunId=e.subagentRunId??void 0,t}};function Nx(){return{baseEvent:void 0,messageId:``,subagentRunId:void 0}}var Px={encode(e,t=new Y){return e.baseEvent!==void 0&&Q.encode(e.baseEvent,t.uint32(10).fork()).join(),e.messageId!==``&&t.uint32(18).string(e.messageId),e.subagentRunId!==void 0&&t.uint32(26).string(e.subagentRunId),t},decode(e,t){let n=e instanceof X?e:new X(e),r=t===void 0?n.len:n.pos+t,i=Nx();for(;n.pos>>3){case 1:if(e!==10)break;i.baseEvent=Q.decode(n,n.uint32());continue;case 2:if(e!==18)break;i.messageId=n.string();continue;case 3:if(e!==26)break;i.subagentRunId=n.string();continue}if((e&7)==4||e===0)break;n.skip(e&7)}return i},create(e){return Px.fromPartial(e??{})},fromPartial(e){let t=Nx();return t.baseEvent=e.baseEvent!==void 0&&e.baseEvent!==null?Q.fromPartial(e.baseEvent):void 0,t.messageId=e.messageId??``,t.subagentRunId=e.subagentRunId??void 0,t}};function Fx(){return{baseEvent:void 0,messageId:void 0,role:void 0,delta:void 0,name:void 0,subagentRunId:void 0}}var Ix={encode(e,t=new Y){return e.baseEvent!==void 0&&Q.encode(e.baseEvent,t.uint32(10).fork()).join(),e.messageId!==void 0&&t.uint32(18).string(e.messageId),e.role!==void 0&&t.uint32(26).string(e.role),e.delta!==void 0&&t.uint32(34).string(e.delta),e.name!==void 0&&t.uint32(42).string(e.name),e.subagentRunId!==void 0&&t.uint32(50).string(e.subagentRunId),t},decode(e,t){let n=e instanceof X?e:new X(e),r=t===void 0?n.len:n.pos+t,i=Fx();for(;n.pos>>3){case 1:if(e!==10)break;i.baseEvent=Q.decode(n,n.uint32());continue;case 2:if(e!==18)break;i.messageId=n.string();continue;case 3:if(e!==26)break;i.role=n.string();continue;case 4:if(e!==34)break;i.delta=n.string();continue;case 5:if(e!==42)break;i.name=n.string();continue;case 6:if(e!==50)break;i.subagentRunId=n.string();continue}if((e&7)==4||e===0)break;n.skip(e&7)}return i},create(e){return Ix.fromPartial(e??{})},fromPartial(e){let t=Fx();return t.baseEvent=e.baseEvent!==void 0&&e.baseEvent!==null?Q.fromPartial(e.baseEvent):void 0,t.messageId=e.messageId??void 0,t.role=e.role??void 0,t.delta=e.delta??void 0,t.name=e.name??void 0,t.subagentRunId=e.subagentRunId??void 0,t}};function Lx(){return{baseEvent:void 0,toolCallId:``,toolCallName:``,parentMessageId:void 0,subagentRunId:void 0}}var Rx={encode(e,t=new Y){return e.baseEvent!==void 0&&Q.encode(e.baseEvent,t.uint32(10).fork()).join(),e.toolCallId!==``&&t.uint32(18).string(e.toolCallId),e.toolCallName!==``&&t.uint32(26).string(e.toolCallName),e.parentMessageId!==void 0&&t.uint32(34).string(e.parentMessageId),e.subagentRunId!==void 0&&t.uint32(42).string(e.subagentRunId),t},decode(e,t){let n=e instanceof X?e:new X(e),r=t===void 0?n.len:n.pos+t,i=Lx();for(;n.pos>>3){case 1:if(e!==10)break;i.baseEvent=Q.decode(n,n.uint32());continue;case 2:if(e!==18)break;i.toolCallId=n.string();continue;case 3:if(e!==26)break;i.toolCallName=n.string();continue;case 4:if(e!==34)break;i.parentMessageId=n.string();continue;case 5:if(e!==42)break;i.subagentRunId=n.string();continue}if((e&7)==4||e===0)break;n.skip(e&7)}return i},create(e){return Rx.fromPartial(e??{})},fromPartial(e){let t=Lx();return t.baseEvent=e.baseEvent!==void 0&&e.baseEvent!==null?Q.fromPartial(e.baseEvent):void 0,t.toolCallId=e.toolCallId??``,t.toolCallName=e.toolCallName??``,t.parentMessageId=e.parentMessageId??void 0,t.subagentRunId=e.subagentRunId??void 0,t}};function zx(){return{baseEvent:void 0,toolCallId:``,delta:``,subagentRunId:void 0}}var Bx={encode(e,t=new Y){return e.baseEvent!==void 0&&Q.encode(e.baseEvent,t.uint32(10).fork()).join(),e.toolCallId!==``&&t.uint32(18).string(e.toolCallId),e.delta!==``&&t.uint32(26).string(e.delta),e.subagentRunId!==void 0&&t.uint32(34).string(e.subagentRunId),t},decode(e,t){let n=e instanceof X?e:new X(e),r=t===void 0?n.len:n.pos+t,i=zx();for(;n.pos>>3){case 1:if(e!==10)break;i.baseEvent=Q.decode(n,n.uint32());continue;case 2:if(e!==18)break;i.toolCallId=n.string();continue;case 3:if(e!==26)break;i.delta=n.string();continue;case 4:if(e!==34)break;i.subagentRunId=n.string();continue}if((e&7)==4||e===0)break;n.skip(e&7)}return i},create(e){return Bx.fromPartial(e??{})},fromPartial(e){let t=zx();return t.baseEvent=e.baseEvent!==void 0&&e.baseEvent!==null?Q.fromPartial(e.baseEvent):void 0,t.toolCallId=e.toolCallId??``,t.delta=e.delta??``,t.subagentRunId=e.subagentRunId??void 0,t}};function Vx(){return{baseEvent:void 0,toolCallId:``,subagentRunId:void 0}}var Hx={encode(e,t=new Y){return e.baseEvent!==void 0&&Q.encode(e.baseEvent,t.uint32(10).fork()).join(),e.toolCallId!==``&&t.uint32(18).string(e.toolCallId),e.subagentRunId!==void 0&&t.uint32(26).string(e.subagentRunId),t},decode(e,t){let n=e instanceof X?e:new X(e),r=t===void 0?n.len:n.pos+t,i=Vx();for(;n.pos>>3){case 1:if(e!==10)break;i.baseEvent=Q.decode(n,n.uint32());continue;case 2:if(e!==18)break;i.toolCallId=n.string();continue;case 3:if(e!==26)break;i.subagentRunId=n.string();continue}if((e&7)==4||e===0)break;n.skip(e&7)}return i},create(e){return Hx.fromPartial(e??{})},fromPartial(e){let t=Vx();return t.baseEvent=e.baseEvent!==void 0&&e.baseEvent!==null?Q.fromPartial(e.baseEvent):void 0,t.toolCallId=e.toolCallId??``,t.subagentRunId=e.subagentRunId??void 0,t}};function Ux(){return{baseEvent:void 0,toolCallId:void 0,toolCallName:void 0,parentMessageId:void 0,delta:void 0,subagentRunId:void 0}}var Wx={encode(e,t=new Y){return e.baseEvent!==void 0&&Q.encode(e.baseEvent,t.uint32(10).fork()).join(),e.toolCallId!==void 0&&t.uint32(18).string(e.toolCallId),e.toolCallName!==void 0&&t.uint32(26).string(e.toolCallName),e.parentMessageId!==void 0&&t.uint32(34).string(e.parentMessageId),e.delta!==void 0&&t.uint32(42).string(e.delta),e.subagentRunId!==void 0&&t.uint32(50).string(e.subagentRunId),t},decode(e,t){let n=e instanceof X?e:new X(e),r=t===void 0?n.len:n.pos+t,i=Ux();for(;n.pos>>3){case 1:if(e!==10)break;i.baseEvent=Q.decode(n,n.uint32());continue;case 2:if(e!==18)break;i.toolCallId=n.string();continue;case 3:if(e!==26)break;i.toolCallName=n.string();continue;case 4:if(e!==34)break;i.parentMessageId=n.string();continue;case 5:if(e!==42)break;i.delta=n.string();continue;case 6:if(e!==50)break;i.subagentRunId=n.string();continue}if((e&7)==4||e===0)break;n.skip(e&7)}return i},create(e){return Wx.fromPartial(e??{})},fromPartial(e){let t=Ux();return t.baseEvent=e.baseEvent!==void 0&&e.baseEvent!==null?Q.fromPartial(e.baseEvent):void 0,t.toolCallId=e.toolCallId??void 0,t.toolCallName=e.toolCallName??void 0,t.parentMessageId=e.parentMessageId??void 0,t.delta=e.delta??void 0,t.subagentRunId=e.subagentRunId??void 0,t}};function Gx(){return{baseEvent:void 0,subagentRunId:void 0,messageId:``,toolCallId:``,content:void 0,role:void 0,contentParts:[]}}var Kx={encode(e,t=new Y){e.baseEvent!==void 0&&Q.encode(e.baseEvent,t.uint32(10).fork()).join(),e.subagentRunId!==void 0&&t.uint32(18).string(e.subagentRunId),e.messageId!==``&&t.uint32(26).string(e.messageId),e.toolCallId!==``&&t.uint32(34).string(e.toolCallId),e.content!==void 0&&t.uint32(42).string(e.content),e.role!==void 0&&t.uint32(50).string(e.role);for(let n of e.contentParts)ux.encode(n,t.uint32(58).fork()).join();return t},decode(e,t){let n=e instanceof X?e:new X(e),r=t===void 0?n.len:n.pos+t,i=Gx();for(;n.pos>>3){case 1:if(e!==10)break;i.baseEvent=Q.decode(n,n.uint32());continue;case 2:if(e!==18)break;i.subagentRunId=n.string();continue;case 3:if(e!==26)break;i.messageId=n.string();continue;case 4:if(e!==34)break;i.toolCallId=n.string();continue;case 5:if(e!==42)break;i.content=n.string();continue;case 6:if(e!==50)break;i.role=n.string();continue;case 7:if(e!==58)break;i.contentParts.push(ux.decode(n,n.uint32()));continue}if((e&7)==4||e===0)break;n.skip(e&7)}return i},create(e){return Kx.fromPartial(e??{})},fromPartial(e){let t=Gx();return t.baseEvent=e.baseEvent!==void 0&&e.baseEvent!==null?Q.fromPartial(e.baseEvent):void 0,t.subagentRunId=e.subagentRunId??void 0,t.messageId=e.messageId??``,t.toolCallId=e.toolCallId??``,t.content=e.content??void 0,t.role=e.role??void 0,t.contentParts=e.contentParts?.map(e=>ux.fromPartial(e))||[],t}};function qx(){return{baseEvent:void 0,snapshot:void 0,subagentRunId:void 0}}var Jx={encode(e,t=new Y){return e.baseEvent!==void 0&&Q.encode(e.baseEvent,t.uint32(10).fork()).join(),e.snapshot!==void 0&&Z.encode(Z.wrap(e.snapshot),t.uint32(18).fork()).join(),e.subagentRunId!==void 0&&t.uint32(26).string(e.subagentRunId),t},decode(e,t){let n=e instanceof X?e:new X(e),r=t===void 0?n.len:n.pos+t,i=qx();for(;n.pos>>3){case 1:if(e!==10)break;i.baseEvent=Q.decode(n,n.uint32());continue;case 2:if(e!==18)break;i.snapshot=Z.unwrap(Z.decode(n,n.uint32()));continue;case 3:if(e!==26)break;i.subagentRunId=n.string();continue}if((e&7)==4||e===0)break;n.skip(e&7)}return i},create(e){return Jx.fromPartial(e??{})},fromPartial(e){let t=qx();return t.baseEvent=e.baseEvent!==void 0&&e.baseEvent!==null?Q.fromPartial(e.baseEvent):void 0,t.snapshot=e.snapshot??void 0,t.subagentRunId=e.subagentRunId??void 0,t}};function Yx(){return{baseEvent:void 0,delta:[],subagentRunId:void 0}}var Xx={encode(e,t=new Y){e.baseEvent!==void 0&&Q.encode(e.baseEvent,t.uint32(10).fork()).join();for(let n of e.delta)Wb.encode(n,t.uint32(18).fork()).join();return e.subagentRunId!==void 0&&t.uint32(26).string(e.subagentRunId),t},decode(e,t){let n=e instanceof X?e:new X(e),r=t===void 0?n.len:n.pos+t,i=Yx();for(;n.pos>>3){case 1:if(e!==10)break;i.baseEvent=Q.decode(n,n.uint32());continue;case 2:if(e!==18)break;i.delta.push(Wb.decode(n,n.uint32()));continue;case 3:if(e!==26)break;i.subagentRunId=n.string();continue}if((e&7)==4||e===0)break;n.skip(e&7)}return i},create(e){return Xx.fromPartial(e??{})},fromPartial(e){let t=Yx();return t.baseEvent=e.baseEvent!==void 0&&e.baseEvent!==null?Q.fromPartial(e.baseEvent):void 0,t.delta=e.delta?.map(e=>Wb.fromPartial(e))||[],t.subagentRunId=e.subagentRunId??void 0,t}};function Zx(){return{baseEvent:void 0,messages:[]}}var Qx={encode(e,t=new Y){e.baseEvent!==void 0&&Q.encode(e.baseEvent,t.uint32(10).fork()).join();for(let n of e.messages)gx.encode(n,t.uint32(18).fork()).join();return t},decode(e,t){let n=e instanceof X?e:new X(e),r=t===void 0?n.len:n.pos+t,i=Zx();for(;n.pos>>3){case 1:if(e!==10)break;i.baseEvent=Q.decode(n,n.uint32());continue;case 2:if(e!==18)break;i.messages.push(gx.decode(n,n.uint32()));continue}if((e&7)==4||e===0)break;n.skip(e&7)}return i},create(e){return Qx.fromPartial(e??{})},fromPartial(e){let t=Zx();return t.baseEvent=e.baseEvent!==void 0&&e.baseEvent!==null?Q.fromPartial(e.baseEvent):void 0,t.messages=e.messages?.map(e=>gx.fromPartial(e))||[],t}};function $x(){return{baseEvent:void 0,subagentRunId:void 0,messageId:``,activityType:``,content:void 0,replace:void 0}}var eS={encode(e,t=new Y){return e.baseEvent!==void 0&&Q.encode(e.baseEvent,t.uint32(10).fork()).join(),e.subagentRunId!==void 0&&t.uint32(18).string(e.subagentRunId),e.messageId!==``&&t.uint32(26).string(e.messageId),e.activityType!==``&&t.uint32(34).string(e.activityType),e.content!==void 0&&Ib.encode(Ib.wrap(e.content),t.uint32(42).fork()).join(),e.replace!==void 0&&t.uint32(48).bool(e.replace),t},decode(e,t){let n=e instanceof X?e:new X(e),r=t===void 0?n.len:n.pos+t,i=$x();for(;n.pos>>3){case 1:if(e!==10)break;i.baseEvent=Q.decode(n,n.uint32());continue;case 2:if(e!==18)break;i.subagentRunId=n.string();continue;case 3:if(e!==26)break;i.messageId=n.string();continue;case 4:if(e!==34)break;i.activityType=n.string();continue;case 5:if(e!==42)break;i.content=Ib.unwrap(Ib.decode(n,n.uint32()));continue;case 6:if(e!==48)break;i.replace=n.bool();continue}if((e&7)==4||e===0)break;n.skip(e&7)}return i},create(e){return eS.fromPartial(e??{})},fromPartial(e){let t=$x();return t.baseEvent=e.baseEvent!==void 0&&e.baseEvent!==null?Q.fromPartial(e.baseEvent):void 0,t.subagentRunId=e.subagentRunId??void 0,t.messageId=e.messageId??``,t.activityType=e.activityType??``,t.content=e.content??void 0,t.replace=e.replace??void 0,t}};function tS(){return{baseEvent:void 0,subagentRunId:void 0,messageId:``,activityType:``,patch:[]}}var nS={encode(e,t=new Y){e.baseEvent!==void 0&&Q.encode(e.baseEvent,t.uint32(10).fork()).join(),e.subagentRunId!==void 0&&t.uint32(18).string(e.subagentRunId),e.messageId!==``&&t.uint32(26).string(e.messageId),e.activityType!==``&&t.uint32(34).string(e.activityType);for(let n of e.patch)Wb.encode(n,t.uint32(42).fork()).join();return t},decode(e,t){let n=e instanceof X?e:new X(e),r=t===void 0?n.len:n.pos+t,i=tS();for(;n.pos>>3){case 1:if(e!==10)break;i.baseEvent=Q.decode(n,n.uint32());continue;case 2:if(e!==18)break;i.subagentRunId=n.string();continue;case 3:if(e!==26)break;i.messageId=n.string();continue;case 4:if(e!==34)break;i.activityType=n.string();continue;case 5:if(e!==42)break;i.patch.push(Wb.decode(n,n.uint32()));continue}if((e&7)==4||e===0)break;n.skip(e&7)}return i},create(e){return nS.fromPartial(e??{})},fromPartial(e){let t=tS();return t.baseEvent=e.baseEvent!==void 0&&e.baseEvent!==null?Q.fromPartial(e.baseEvent):void 0,t.subagentRunId=e.subagentRunId??void 0,t.messageId=e.messageId??``,t.activityType=e.activityType??``,t.patch=e.patch?.map(e=>Wb.fromPartial(e))||[],t}};function rS(){return{baseEvent:void 0,event:void 0,source:void 0,subagentRunId:void 0}}var iS={encode(e,t=new Y){return e.baseEvent!==void 0&&Q.encode(e.baseEvent,t.uint32(10).fork()).join(),e.event!==void 0&&Z.encode(Z.wrap(e.event),t.uint32(18).fork()).join(),e.source!==void 0&&t.uint32(26).string(e.source),e.subagentRunId!==void 0&&t.uint32(34).string(e.subagentRunId),t},decode(e,t){let n=e instanceof X?e:new X(e),r=t===void 0?n.len:n.pos+t,i=rS();for(;n.pos>>3){case 1:if(e!==10)break;i.baseEvent=Q.decode(n,n.uint32());continue;case 2:if(e!==18)break;i.event=Z.unwrap(Z.decode(n,n.uint32()));continue;case 3:if(e!==26)break;i.source=n.string();continue;case 4:if(e!==34)break;i.subagentRunId=n.string();continue}if((e&7)==4||e===0)break;n.skip(e&7)}return i},create(e){return iS.fromPartial(e??{})},fromPartial(e){let t=rS();return t.baseEvent=e.baseEvent!==void 0&&e.baseEvent!==null?Q.fromPartial(e.baseEvent):void 0,t.event=e.event??void 0,t.source=e.source??void 0,t.subagentRunId=e.subagentRunId??void 0,t}};function aS(){return{baseEvent:void 0,name:``,value:void 0,subagentRunId:void 0}}var oS={encode(e,t=new Y){return e.baseEvent!==void 0&&Q.encode(e.baseEvent,t.uint32(10).fork()).join(),e.name!==``&&t.uint32(18).string(e.name),e.value!==void 0&&Z.encode(Z.wrap(e.value),t.uint32(26).fork()).join(),e.subagentRunId!==void 0&&t.uint32(34).string(e.subagentRunId),t},decode(e,t){let n=e instanceof X?e:new X(e),r=t===void 0?n.len:n.pos+t,i=aS();for(;n.pos>>3){case 1:if(e!==10)break;i.baseEvent=Q.decode(n,n.uint32());continue;case 2:if(e!==18)break;i.name=n.string();continue;case 3:if(e!==26)break;i.value=Z.unwrap(Z.decode(n,n.uint32()));continue;case 4:if(e!==34)break;i.subagentRunId=n.string();continue}if((e&7)==4||e===0)break;n.skip(e&7)}return i},create(e){return oS.fromPartial(e??{})},fromPartial(e){let t=aS();return t.baseEvent=e.baseEvent!==void 0&&e.baseEvent!==null?Q.fromPartial(e.baseEvent):void 0,t.name=e.name??``,t.value=e.value??void 0,t.subagentRunId=e.subagentRunId??void 0,t}};function sS(){return{baseEvent:void 0,threadId:``,runId:``,parentRunId:void 0,input:void 0,protocolVersion:void 0}}var cS={encode(e,t=new Y){return e.baseEvent!==void 0&&Q.encode(e.baseEvent,t.uint32(10).fork()).join(),e.threadId!==``&&t.uint32(18).string(e.threadId),e.runId!==``&&t.uint32(26).string(e.runId),e.parentRunId!==void 0&&t.uint32(34).string(e.parentRunId),e.input!==void 0&&wx.encode(e.input,t.uint32(42).fork()).join(),e.protocolVersion!==void 0&&t.uint32(50).string(e.protocolVersion),t},decode(e,t){let n=e instanceof X?e:new X(e),r=t===void 0?n.len:n.pos+t,i=sS();for(;n.pos>>3){case 1:if(e!==10)break;i.baseEvent=Q.decode(n,n.uint32());continue;case 2:if(e!==18)break;i.threadId=n.string();continue;case 3:if(e!==26)break;i.runId=n.string();continue;case 4:if(e!==34)break;i.parentRunId=n.string();continue;case 5:if(e!==42)break;i.input=wx.decode(n,n.uint32());continue;case 6:if(e!==50)break;i.protocolVersion=n.string();continue}if((e&7)==4||e===0)break;n.skip(e&7)}return i},create(e){return cS.fromPartial(e??{})},fromPartial(e){let t=sS();return t.baseEvent=e.baseEvent!==void 0&&e.baseEvent!==null?Q.fromPartial(e.baseEvent):void 0,t.threadId=e.threadId??``,t.runId=e.runId??``,t.parentRunId=e.parentRunId??void 0,t.input=e.input!==void 0&&e.input!==null?wx.fromPartial(e.input):void 0,t.protocolVersion=e.protocolVersion??void 0,t}};function lS(){return{baseEvent:void 0,threadId:``,runId:``,result:void 0,outcome:``,interrupts:[],usage:[],pendingToolCallIds:[]}}var uS={encode(e,t=new Y){e.baseEvent!==void 0&&Q.encode(e.baseEvent,t.uint32(10).fork()).join(),e.threadId!==``&&t.uint32(18).string(e.threadId),e.runId!==``&&t.uint32(26).string(e.runId),e.result!==void 0&&Z.encode(Z.wrap(e.result),t.uint32(34).fork()).join(),e.outcome!==``&&t.uint32(42).string(e.outcome);for(let n of e.interrupts)Ex.encode(n,t.uint32(50).fork()).join();for(let n of e.usage)BS.encode(n,t.uint32(58).fork()).join();for(let n of e.pendingToolCallIds)t.uint32(66).string(n);return t},decode(e,t){let n=e instanceof X?e:new X(e),r=t===void 0?n.len:n.pos+t,i=lS();for(;n.pos>>3){case 1:if(e!==10)break;i.baseEvent=Q.decode(n,n.uint32());continue;case 2:if(e!==18)break;i.threadId=n.string();continue;case 3:if(e!==26)break;i.runId=n.string();continue;case 4:if(e!==34)break;i.result=Z.unwrap(Z.decode(n,n.uint32()));continue;case 5:if(e!==42)break;i.outcome=n.string();continue;case 6:if(e!==50)break;i.interrupts.push(Ex.decode(n,n.uint32()));continue;case 7:if(e!==58)break;i.usage.push(BS.decode(n,n.uint32()));continue;case 8:if(e!==66)break;i.pendingToolCallIds.push(n.string());continue}if((e&7)==4||e===0)break;n.skip(e&7)}return i},create(e){return uS.fromPartial(e??{})},fromPartial(e){let t=lS();return t.baseEvent=e.baseEvent!==void 0&&e.baseEvent!==null?Q.fromPartial(e.baseEvent):void 0,t.threadId=e.threadId??``,t.runId=e.runId??``,t.result=e.result??void 0,t.outcome=e.outcome??``,t.interrupts=e.interrupts?.map(e=>Ex.fromPartial(e))||[],t.usage=e.usage?.map(e=>BS.fromPartial(e))||[],t.pendingToolCallIds=e.pendingToolCallIds?.map(e=>e)||[],t}};function dS(){return{baseEvent:void 0,code:void 0,message:``,usage:[]}}var fS={encode(e,t=new Y){e.baseEvent!==void 0&&Q.encode(e.baseEvent,t.uint32(10).fork()).join(),e.code!==void 0&&t.uint32(18).string(e.code),e.message!==``&&t.uint32(26).string(e.message);for(let n of e.usage)BS.encode(n,t.uint32(34).fork()).join();return t},decode(e,t){let n=e instanceof X?e:new X(e),r=t===void 0?n.len:n.pos+t,i=dS();for(;n.pos>>3){case 1:if(e!==10)break;i.baseEvent=Q.decode(n,n.uint32());continue;case 2:if(e!==18)break;i.code=n.string();continue;case 3:if(e!==26)break;i.message=n.string();continue;case 4:if(e!==34)break;i.usage.push(BS.decode(n,n.uint32()));continue}if((e&7)==4||e===0)break;n.skip(e&7)}return i},create(e){return fS.fromPartial(e??{})},fromPartial(e){let t=dS();return t.baseEvent=e.baseEvent!==void 0&&e.baseEvent!==null?Q.fromPartial(e.baseEvent):void 0,t.code=e.code??void 0,t.message=e.message??``,t.usage=e.usage?.map(e=>BS.fromPartial(e))||[],t}};function pS(){return{baseEvent:void 0,stepName:``,subagentRunId:void 0}}var mS={encode(e,t=new Y){return e.baseEvent!==void 0&&Q.encode(e.baseEvent,t.uint32(10).fork()).join(),e.stepName!==``&&t.uint32(18).string(e.stepName),e.subagentRunId!==void 0&&t.uint32(26).string(e.subagentRunId),t},decode(e,t){let n=e instanceof X?e:new X(e),r=t===void 0?n.len:n.pos+t,i=pS();for(;n.pos>>3){case 1:if(e!==10)break;i.baseEvent=Q.decode(n,n.uint32());continue;case 2:if(e!==18)break;i.stepName=n.string();continue;case 3:if(e!==26)break;i.subagentRunId=n.string();continue}if((e&7)==4||e===0)break;n.skip(e&7)}return i},create(e){return mS.fromPartial(e??{})},fromPartial(e){let t=pS();return t.baseEvent=e.baseEvent!==void 0&&e.baseEvent!==null?Q.fromPartial(e.baseEvent):void 0,t.stepName=e.stepName??``,t.subagentRunId=e.subagentRunId??void 0,t}};function hS(){return{baseEvent:void 0,stepName:``,subagentRunId:void 0}}var gS={encode(e,t=new Y){return e.baseEvent!==void 0&&Q.encode(e.baseEvent,t.uint32(10).fork()).join(),e.stepName!==``&&t.uint32(18).string(e.stepName),e.subagentRunId!==void 0&&t.uint32(26).string(e.subagentRunId),t},decode(e,t){let n=e instanceof X?e:new X(e),r=t===void 0?n.len:n.pos+t,i=hS();for(;n.pos>>3){case 1:if(e!==10)break;i.baseEvent=Q.decode(n,n.uint32());continue;case 2:if(e!==18)break;i.stepName=n.string();continue;case 3:if(e!==26)break;i.subagentRunId=n.string();continue}if((e&7)==4||e===0)break;n.skip(e&7)}return i},create(e){return gS.fromPartial(e??{})},fromPartial(e){let t=hS();return t.baseEvent=e.baseEvent!==void 0&&e.baseEvent!==null?Q.fromPartial(e.baseEvent):void 0,t.stepName=e.stepName??``,t.subagentRunId=e.subagentRunId??void 0,t}};function _S(){return{baseEvent:void 0,subagentRunId:void 0,messageId:``}}var vS={encode(e,t=new Y){return e.baseEvent!==void 0&&Q.encode(e.baseEvent,t.uint32(10).fork()).join(),e.subagentRunId!==void 0&&t.uint32(18).string(e.subagentRunId),e.messageId!==``&&t.uint32(26).string(e.messageId),t},decode(e,t){let n=e instanceof X?e:new X(e),r=t===void 0?n.len:n.pos+t,i=_S();for(;n.pos>>3){case 1:if(e!==10)break;i.baseEvent=Q.decode(n,n.uint32());continue;case 2:if(e!==18)break;i.subagentRunId=n.string();continue;case 3:if(e!==26)break;i.messageId=n.string();continue}if((e&7)==4||e===0)break;n.skip(e&7)}return i},create(e){return vS.fromPartial(e??{})},fromPartial(e){let t=_S();return t.baseEvent=e.baseEvent!==void 0&&e.baseEvent!==null?Q.fromPartial(e.baseEvent):void 0,t.subagentRunId=e.subagentRunId??void 0,t.messageId=e.messageId??``,t}};function yS(){return{baseEvent:void 0,subagentRunId:void 0,messageId:``,role:``}}var bS={encode(e,t=new Y){return e.baseEvent!==void 0&&Q.encode(e.baseEvent,t.uint32(10).fork()).join(),e.subagentRunId!==void 0&&t.uint32(18).string(e.subagentRunId),e.messageId!==``&&t.uint32(26).string(e.messageId),e.role!==``&&t.uint32(34).string(e.role),t},decode(e,t){let n=e instanceof X?e:new X(e),r=t===void 0?n.len:n.pos+t,i=yS();for(;n.pos>>3){case 1:if(e!==10)break;i.baseEvent=Q.decode(n,n.uint32());continue;case 2:if(e!==18)break;i.subagentRunId=n.string();continue;case 3:if(e!==26)break;i.messageId=n.string();continue;case 4:if(e!==34)break;i.role=n.string();continue}if((e&7)==4||e===0)break;n.skip(e&7)}return i},create(e){return bS.fromPartial(e??{})},fromPartial(e){let t=yS();return t.baseEvent=e.baseEvent!==void 0&&e.baseEvent!==null?Q.fromPartial(e.baseEvent):void 0,t.subagentRunId=e.subagentRunId??void 0,t.messageId=e.messageId??``,t.role=e.role??``,t}};function xS(){return{baseEvent:void 0,subagentRunId:void 0,messageId:``,delta:``}}var SS={encode(e,t=new Y){return e.baseEvent!==void 0&&Q.encode(e.baseEvent,t.uint32(10).fork()).join(),e.subagentRunId!==void 0&&t.uint32(18).string(e.subagentRunId),e.messageId!==``&&t.uint32(26).string(e.messageId),e.delta!==``&&t.uint32(34).string(e.delta),t},decode(e,t){let n=e instanceof X?e:new X(e),r=t===void 0?n.len:n.pos+t,i=xS();for(;n.pos>>3){case 1:if(e!==10)break;i.baseEvent=Q.decode(n,n.uint32());continue;case 2:if(e!==18)break;i.subagentRunId=n.string();continue;case 3:if(e!==26)break;i.messageId=n.string();continue;case 4:if(e!==34)break;i.delta=n.string();continue}if((e&7)==4||e===0)break;n.skip(e&7)}return i},create(e){return SS.fromPartial(e??{})},fromPartial(e){let t=xS();return t.baseEvent=e.baseEvent!==void 0&&e.baseEvent!==null?Q.fromPartial(e.baseEvent):void 0,t.subagentRunId=e.subagentRunId??void 0,t.messageId=e.messageId??``,t.delta=e.delta??``,t}};function CS(){return{baseEvent:void 0,subagentRunId:void 0,messageId:``}}var wS={encode(e,t=new Y){return e.baseEvent!==void 0&&Q.encode(e.baseEvent,t.uint32(10).fork()).join(),e.subagentRunId!==void 0&&t.uint32(18).string(e.subagentRunId),e.messageId!==``&&t.uint32(26).string(e.messageId),t},decode(e,t){let n=e instanceof X?e:new X(e),r=t===void 0?n.len:n.pos+t,i=CS();for(;n.pos>>3){case 1:if(e!==10)break;i.baseEvent=Q.decode(n,n.uint32());continue;case 2:if(e!==18)break;i.subagentRunId=n.string();continue;case 3:if(e!==26)break;i.messageId=n.string();continue}if((e&7)==4||e===0)break;n.skip(e&7)}return i},create(e){return wS.fromPartial(e??{})},fromPartial(e){let t=CS();return t.baseEvent=e.baseEvent!==void 0&&e.baseEvent!==null?Q.fromPartial(e.baseEvent):void 0,t.subagentRunId=e.subagentRunId??void 0,t.messageId=e.messageId??``,t}};function TS(){return{baseEvent:void 0,subagentRunId:void 0,messageId:void 0,delta:void 0}}var ES={encode(e,t=new Y){return e.baseEvent!==void 0&&Q.encode(e.baseEvent,t.uint32(10).fork()).join(),e.subagentRunId!==void 0&&t.uint32(18).string(e.subagentRunId),e.messageId!==void 0&&t.uint32(26).string(e.messageId),e.delta!==void 0&&t.uint32(34).string(e.delta),t},decode(e,t){let n=e instanceof X?e:new X(e),r=t===void 0?n.len:n.pos+t,i=TS();for(;n.pos>>3){case 1:if(e!==10)break;i.baseEvent=Q.decode(n,n.uint32());continue;case 2:if(e!==18)break;i.subagentRunId=n.string();continue;case 3:if(e!==26)break;i.messageId=n.string();continue;case 4:if(e!==34)break;i.delta=n.string();continue}if((e&7)==4||e===0)break;n.skip(e&7)}return i},create(e){return ES.fromPartial(e??{})},fromPartial(e){let t=TS();return t.baseEvent=e.baseEvent!==void 0&&e.baseEvent!==null?Q.fromPartial(e.baseEvent):void 0,t.subagentRunId=e.subagentRunId??void 0,t.messageId=e.messageId??void 0,t.delta=e.delta??void 0,t}};function DS(){return{baseEvent:void 0,subagentRunId:void 0,messageId:``}}var OS={encode(e,t=new Y){return e.baseEvent!==void 0&&Q.encode(e.baseEvent,t.uint32(10).fork()).join(),e.subagentRunId!==void 0&&t.uint32(18).string(e.subagentRunId),e.messageId!==``&&t.uint32(26).string(e.messageId),t},decode(e,t){let n=e instanceof X?e:new X(e),r=t===void 0?n.len:n.pos+t,i=DS();for(;n.pos>>3){case 1:if(e!==10)break;i.baseEvent=Q.decode(n,n.uint32());continue;case 2:if(e!==18)break;i.subagentRunId=n.string();continue;case 3:if(e!==26)break;i.messageId=n.string();continue}if((e&7)==4||e===0)break;n.skip(e&7)}return i},create(e){return OS.fromPartial(e??{})},fromPartial(e){let t=DS();return t.baseEvent=e.baseEvent!==void 0&&e.baseEvent!==null?Q.fromPartial(e.baseEvent):void 0,t.subagentRunId=e.subagentRunId??void 0,t.messageId=e.messageId??``,t}};function kS(){return{baseEvent:void 0,subagentRunId:void 0,subtype:``,entityId:``,encryptedValue:``}}var AS={encode(e,t=new Y){return e.baseEvent!==void 0&&Q.encode(e.baseEvent,t.uint32(10).fork()).join(),e.subagentRunId!==void 0&&t.uint32(18).string(e.subagentRunId),e.subtype!==``&&t.uint32(26).string(e.subtype),e.entityId!==``&&t.uint32(34).string(e.entityId),e.encryptedValue!==``&&t.uint32(42).string(e.encryptedValue),t},decode(e,t){let n=e instanceof X?e:new X(e),r=t===void 0?n.len:n.pos+t,i=kS();for(;n.pos>>3){case 1:if(e!==10)break;i.baseEvent=Q.decode(n,n.uint32());continue;case 2:if(e!==18)break;i.subagentRunId=n.string();continue;case 3:if(e!==26)break;i.subtype=n.string();continue;case 4:if(e!==34)break;i.entityId=n.string();continue;case 5:if(e!==42)break;i.encryptedValue=n.string();continue}if((e&7)==4||e===0)break;n.skip(e&7)}return i},create(e){return AS.fromPartial(e??{})},fromPartial(e){let t=kS();return t.baseEvent=e.baseEvent!==void 0&&e.baseEvent!==null?Q.fromPartial(e.baseEvent):void 0,t.subagentRunId=e.subagentRunId??void 0,t.subtype=e.subtype??``,t.entityId=e.entityId??``,t.encryptedValue=e.encryptedValue??``,t}};function jS(){return{baseEvent:void 0,subagentRunId:``,name:``,description:void 0,parentSubagentRunId:void 0,parentToolCallId:void 0,parentMessageId:void 0}}var MS={encode(e,t=new Y){return e.baseEvent!==void 0&&Q.encode(e.baseEvent,t.uint32(10).fork()).join(),e.subagentRunId!==``&&t.uint32(18).string(e.subagentRunId),e.name!==``&&t.uint32(26).string(e.name),e.description!==void 0&&t.uint32(34).string(e.description),e.parentSubagentRunId!==void 0&&t.uint32(42).string(e.parentSubagentRunId),e.parentToolCallId!==void 0&&t.uint32(50).string(e.parentToolCallId),e.parentMessageId!==void 0&&t.uint32(58).string(e.parentMessageId),t},decode(e,t){let n=e instanceof X?e:new X(e),r=t===void 0?n.len:n.pos+t,i=jS();for(;n.pos>>3){case 1:if(e!==10)break;i.baseEvent=Q.decode(n,n.uint32());continue;case 2:if(e!==18)break;i.subagentRunId=n.string();continue;case 3:if(e!==26)break;i.name=n.string();continue;case 4:if(e!==34)break;i.description=n.string();continue;case 5:if(e!==42)break;i.parentSubagentRunId=n.string();continue;case 6:if(e!==50)break;i.parentToolCallId=n.string();continue;case 7:if(e!==58)break;i.parentMessageId=n.string();continue}if((e&7)==4||e===0)break;n.skip(e&7)}return i},create(e){return MS.fromPartial(e??{})},fromPartial(e){let t=jS();return t.baseEvent=e.baseEvent!==void 0&&e.baseEvent!==null?Q.fromPartial(e.baseEvent):void 0,t.subagentRunId=e.subagentRunId??``,t.name=e.name??``,t.description=e.description??void 0,t.parentSubagentRunId=e.parentSubagentRunId??void 0,t.parentToolCallId=e.parentToolCallId??void 0,t.parentMessageId=e.parentMessageId??void 0,t}};function NS(){return{baseEvent:void 0,subagentRunId:``,result:void 0,outcome:``,interruptIds:[]}}var PS={encode(e,t=new Y){e.baseEvent!==void 0&&Q.encode(e.baseEvent,t.uint32(10).fork()).join(),e.subagentRunId!==``&&t.uint32(18).string(e.subagentRunId),e.result!==void 0&&Z.encode(Z.wrap(e.result),t.uint32(26).fork()).join(),e.outcome!==``&&t.uint32(34).string(e.outcome);for(let n of e.interruptIds)t.uint32(42).string(n);return t},decode(e,t){let n=e instanceof X?e:new X(e),r=t===void 0?n.len:n.pos+t,i=NS();for(;n.pos>>3){case 1:if(e!==10)break;i.baseEvent=Q.decode(n,n.uint32());continue;case 2:if(e!==18)break;i.subagentRunId=n.string();continue;case 3:if(e!==26)break;i.result=Z.unwrap(Z.decode(n,n.uint32()));continue;case 4:if(e!==34)break;i.outcome=n.string();continue;case 5:if(e!==42)break;i.interruptIds.push(n.string());continue}if((e&7)==4||e===0)break;n.skip(e&7)}return i},create(e){return PS.fromPartial(e??{})},fromPartial(e){let t=NS();return t.baseEvent=e.baseEvent!==void 0&&e.baseEvent!==null?Q.fromPartial(e.baseEvent):void 0,t.subagentRunId=e.subagentRunId??``,t.result=e.result??void 0,t.outcome=e.outcome??``,t.interruptIds=e.interruptIds?.map(e=>e)||[],t}};function FS(){return{baseEvent:void 0,subagentRunId:``,message:``,code:void 0}}var IS={encode(e,t=new Y){return e.baseEvent!==void 0&&Q.encode(e.baseEvent,t.uint32(10).fork()).join(),e.subagentRunId!==``&&t.uint32(18).string(e.subagentRunId),e.message!==``&&t.uint32(26).string(e.message),e.code!==void 0&&t.uint32(34).string(e.code),t},decode(e,t){let n=e instanceof X?e:new X(e),r=t===void 0?n.len:n.pos+t,i=FS();for(;n.pos>>3){case 1:if(e!==10)break;i.baseEvent=Q.decode(n,n.uint32());continue;case 2:if(e!==18)break;i.subagentRunId=n.string();continue;case 3:if(e!==26)break;i.message=n.string();continue;case 4:if(e!==34)break;i.code=n.string();continue}if((e&7)==4||e===0)break;n.skip(e&7)}return i},create(e){return IS.fromPartial(e??{})},fromPartial(e){let t=FS();return t.baseEvent=e.baseEvent!==void 0&&e.baseEvent!==null?Q.fromPartial(e.baseEvent):void 0,t.subagentRunId=e.subagentRunId??``,t.message=e.message??``,t.code=e.code??void 0,t}};function LS(){return{textMessageStart:void 0,textMessageContent:void 0,textMessageEnd:void 0,toolCallStart:void 0,toolCallArgs:void 0,toolCallEnd:void 0,stateSnapshot:void 0,stateDelta:void 0,messagesSnapshot:void 0,raw:void 0,custom:void 0,runStarted:void 0,runFinished:void 0,runError:void 0,stepStarted:void 0,stepFinished:void 0,textMessageChunk:void 0,toolCallChunk:void 0,subagentStarted:void 0,subagentFinished:void 0,subagentError:void 0,toolCallResult:void 0,activitySnapshot:void 0,activityDelta:void 0,reasoningStart:void 0,reasoningMessageStart:void 0,reasoningMessageContent:void 0,reasoningMessageEnd:void 0,reasoningMessageChunk:void 0,reasoningEnd:void 0,reasoningEncryptedValue:void 0}}var RS={encode(e,t=new Y){return e.textMessageStart!==void 0&&Ax.encode(e.textMessageStart,t.uint32(10).fork()).join(),e.textMessageContent!==void 0&&Mx.encode(e.textMessageContent,t.uint32(18).fork()).join(),e.textMessageEnd!==void 0&&Px.encode(e.textMessageEnd,t.uint32(26).fork()).join(),e.toolCallStart!==void 0&&Rx.encode(e.toolCallStart,t.uint32(34).fork()).join(),e.toolCallArgs!==void 0&&Bx.encode(e.toolCallArgs,t.uint32(42).fork()).join(),e.toolCallEnd!==void 0&&Hx.encode(e.toolCallEnd,t.uint32(50).fork()).join(),e.stateSnapshot!==void 0&&Jx.encode(e.stateSnapshot,t.uint32(58).fork()).join(),e.stateDelta!==void 0&&Xx.encode(e.stateDelta,t.uint32(66).fork()).join(),e.messagesSnapshot!==void 0&&Qx.encode(e.messagesSnapshot,t.uint32(74).fork()).join(),e.raw!==void 0&&iS.encode(e.raw,t.uint32(82).fork()).join(),e.custom!==void 0&&oS.encode(e.custom,t.uint32(90).fork()).join(),e.runStarted!==void 0&&cS.encode(e.runStarted,t.uint32(98).fork()).join(),e.runFinished!==void 0&&uS.encode(e.runFinished,t.uint32(106).fork()).join(),e.runError!==void 0&&fS.encode(e.runError,t.uint32(114).fork()).join(),e.stepStarted!==void 0&&mS.encode(e.stepStarted,t.uint32(122).fork()).join(),e.stepFinished!==void 0&&gS.encode(e.stepFinished,t.uint32(130).fork()).join(),e.textMessageChunk!==void 0&&Ix.encode(e.textMessageChunk,t.uint32(138).fork()).join(),e.toolCallChunk!==void 0&&Wx.encode(e.toolCallChunk,t.uint32(146).fork()).join(),e.subagentStarted!==void 0&&MS.encode(e.subagentStarted,t.uint32(154).fork()).join(),e.subagentFinished!==void 0&&PS.encode(e.subagentFinished,t.uint32(162).fork()).join(),e.subagentError!==void 0&&IS.encode(e.subagentError,t.uint32(170).fork()).join(),e.toolCallResult!==void 0&&Kx.encode(e.toolCallResult,t.uint32(178).fork()).join(),e.activitySnapshot!==void 0&&eS.encode(e.activitySnapshot,t.uint32(186).fork()).join(),e.activityDelta!==void 0&&nS.encode(e.activityDelta,t.uint32(194).fork()).join(),e.reasoningStart!==void 0&&vS.encode(e.reasoningStart,t.uint32(202).fork()).join(),e.reasoningMessageStart!==void 0&&bS.encode(e.reasoningMessageStart,t.uint32(210).fork()).join(),e.reasoningMessageContent!==void 0&&SS.encode(e.reasoningMessageContent,t.uint32(218).fork()).join(),e.reasoningMessageEnd!==void 0&&wS.encode(e.reasoningMessageEnd,t.uint32(226).fork()).join(),e.reasoningMessageChunk!==void 0&&ES.encode(e.reasoningMessageChunk,t.uint32(234).fork()).join(),e.reasoningEnd!==void 0&&OS.encode(e.reasoningEnd,t.uint32(242).fork()).join(),e.reasoningEncryptedValue!==void 0&&AS.encode(e.reasoningEncryptedValue,t.uint32(250).fork()).join(),t},decode(e,t){let n=e instanceof X?e:new X(e),r=t===void 0?n.len:n.pos+t,i=LS();for(;n.pos>>3){case 1:if(e!==10)break;i.textMessageStart=Ax.decode(n,n.uint32());continue;case 2:if(e!==18)break;i.textMessageContent=Mx.decode(n,n.uint32());continue;case 3:if(e!==26)break;i.textMessageEnd=Px.decode(n,n.uint32());continue;case 4:if(e!==34)break;i.toolCallStart=Rx.decode(n,n.uint32());continue;case 5:if(e!==42)break;i.toolCallArgs=Bx.decode(n,n.uint32());continue;case 6:if(e!==50)break;i.toolCallEnd=Hx.decode(n,n.uint32());continue;case 7:if(e!==58)break;i.stateSnapshot=Jx.decode(n,n.uint32());continue;case 8:if(e!==66)break;i.stateDelta=Xx.decode(n,n.uint32());continue;case 9:if(e!==74)break;i.messagesSnapshot=Qx.decode(n,n.uint32());continue;case 10:if(e!==82)break;i.raw=iS.decode(n,n.uint32());continue;case 11:if(e!==90)break;i.custom=oS.decode(n,n.uint32());continue;case 12:if(e!==98)break;i.runStarted=cS.decode(n,n.uint32());continue;case 13:if(e!==106)break;i.runFinished=uS.decode(n,n.uint32());continue;case 14:if(e!==114)break;i.runError=fS.decode(n,n.uint32());continue;case 15:if(e!==122)break;i.stepStarted=mS.decode(n,n.uint32());continue;case 16:if(e!==130)break;i.stepFinished=gS.decode(n,n.uint32());continue;case 17:if(e!==138)break;i.textMessageChunk=Ix.decode(n,n.uint32());continue;case 18:if(e!==146)break;i.toolCallChunk=Wx.decode(n,n.uint32());continue;case 19:if(e!==154)break;i.subagentStarted=MS.decode(n,n.uint32());continue;case 20:if(e!==162)break;i.subagentFinished=PS.decode(n,n.uint32());continue;case 21:if(e!==170)break;i.subagentError=IS.decode(n,n.uint32());continue;case 22:if(e!==178)break;i.toolCallResult=Kx.decode(n,n.uint32());continue;case 23:if(e!==186)break;i.activitySnapshot=eS.decode(n,n.uint32());continue;case 24:if(e!==194)break;i.activityDelta=nS.decode(n,n.uint32());continue;case 25:if(e!==202)break;i.reasoningStart=vS.decode(n,n.uint32());continue;case 26:if(e!==210)break;i.reasoningMessageStart=bS.decode(n,n.uint32());continue;case 27:if(e!==218)break;i.reasoningMessageContent=SS.decode(n,n.uint32());continue;case 28:if(e!==226)break;i.reasoningMessageEnd=wS.decode(n,n.uint32());continue;case 29:if(e!==234)break;i.reasoningMessageChunk=ES.decode(n,n.uint32());continue;case 30:if(e!==242)break;i.reasoningEnd=OS.decode(n,n.uint32());continue;case 31:if(e!==250)break;i.reasoningEncryptedValue=AS.decode(n,n.uint32());continue}if((e&7)==4||e===0)break;n.skip(e&7)}return i},create(e){return RS.fromPartial(e??{})},fromPartial(e){let t=LS();return t.textMessageStart=e.textMessageStart!==void 0&&e.textMessageStart!==null?Ax.fromPartial(e.textMessageStart):void 0,t.textMessageContent=e.textMessageContent!==void 0&&e.textMessageContent!==null?Mx.fromPartial(e.textMessageContent):void 0,t.textMessageEnd=e.textMessageEnd!==void 0&&e.textMessageEnd!==null?Px.fromPartial(e.textMessageEnd):void 0,t.toolCallStart=e.toolCallStart!==void 0&&e.toolCallStart!==null?Rx.fromPartial(e.toolCallStart):void 0,t.toolCallArgs=e.toolCallArgs!==void 0&&e.toolCallArgs!==null?Bx.fromPartial(e.toolCallArgs):void 0,t.toolCallEnd=e.toolCallEnd!==void 0&&e.toolCallEnd!==null?Hx.fromPartial(e.toolCallEnd):void 0,t.stateSnapshot=e.stateSnapshot!==void 0&&e.stateSnapshot!==null?Jx.fromPartial(e.stateSnapshot):void 0,t.stateDelta=e.stateDelta!==void 0&&e.stateDelta!==null?Xx.fromPartial(e.stateDelta):void 0,t.messagesSnapshot=e.messagesSnapshot!==void 0&&e.messagesSnapshot!==null?Qx.fromPartial(e.messagesSnapshot):void 0,t.raw=e.raw!==void 0&&e.raw!==null?iS.fromPartial(e.raw):void 0,t.custom=e.custom!==void 0&&e.custom!==null?oS.fromPartial(e.custom):void 0,t.runStarted=e.runStarted!==void 0&&e.runStarted!==null?cS.fromPartial(e.runStarted):void 0,t.runFinished=e.runFinished!==void 0&&e.runFinished!==null?uS.fromPartial(e.runFinished):void 0,t.runError=e.runError!==void 0&&e.runError!==null?fS.fromPartial(e.runError):void 0,t.stepStarted=e.stepStarted!==void 0&&e.stepStarted!==null?mS.fromPartial(e.stepStarted):void 0,t.stepFinished=e.stepFinished!==void 0&&e.stepFinished!==null?gS.fromPartial(e.stepFinished):void 0,t.textMessageChunk=e.textMessageChunk!==void 0&&e.textMessageChunk!==null?Ix.fromPartial(e.textMessageChunk):void 0,t.toolCallChunk=e.toolCallChunk!==void 0&&e.toolCallChunk!==null?Wx.fromPartial(e.toolCallChunk):void 0,t.subagentStarted=e.subagentStarted!==void 0&&e.subagentStarted!==null?MS.fromPartial(e.subagentStarted):void 0,t.subagentFinished=e.subagentFinished!==void 0&&e.subagentFinished!==null?PS.fromPartial(e.subagentFinished):void 0,t.subagentError=e.subagentError!==void 0&&e.subagentError!==null?IS.fromPartial(e.subagentError):void 0,t.toolCallResult=e.toolCallResult!==void 0&&e.toolCallResult!==null?Kx.fromPartial(e.toolCallResult):void 0,t.activitySnapshot=e.activitySnapshot!==void 0&&e.activitySnapshot!==null?eS.fromPartial(e.activitySnapshot):void 0,t.activityDelta=e.activityDelta!==void 0&&e.activityDelta!==null?nS.fromPartial(e.activityDelta):void 0,t.reasoningStart=e.reasoningStart!==void 0&&e.reasoningStart!==null?vS.fromPartial(e.reasoningStart):void 0,t.reasoningMessageStart=e.reasoningMessageStart!==void 0&&e.reasoningMessageStart!==null?bS.fromPartial(e.reasoningMessageStart):void 0,t.reasoningMessageContent=e.reasoningMessageContent!==void 0&&e.reasoningMessageContent!==null?SS.fromPartial(e.reasoningMessageContent):void 0,t.reasoningMessageEnd=e.reasoningMessageEnd!==void 0&&e.reasoningMessageEnd!==null?wS.fromPartial(e.reasoningMessageEnd):void 0,t.reasoningMessageChunk=e.reasoningMessageChunk!==void 0&&e.reasoningMessageChunk!==null?ES.fromPartial(e.reasoningMessageChunk):void 0,t.reasoningEnd=e.reasoningEnd!==void 0&&e.reasoningEnd!==null?OS.fromPartial(e.reasoningEnd):void 0,t.reasoningEncryptedValue=e.reasoningEncryptedValue!==void 0&&e.reasoningEncryptedValue!==null?AS.fromPartial(e.reasoningEncryptedValue):void 0,t}};function zS(){return{provider:void 0,model:void 0,inputTokens:void 0,outputTokens:void 0,totalTokens:void 0,reasoningTokens:void 0,cachedInputTokens:void 0,cacheWriteInputTokens:void 0}}var BS={encode(e,t=new Y){return e.provider!==void 0&&t.uint32(10).string(e.provider),e.model!==void 0&&t.uint32(18).string(e.model),e.inputTokens!==void 0&&t.uint32(24).int64(e.inputTokens),e.outputTokens!==void 0&&t.uint32(32).int64(e.outputTokens),e.totalTokens!==void 0&&t.uint32(40).int64(e.totalTokens),e.reasoningTokens!==void 0&&t.uint32(48).int64(e.reasoningTokens),e.cachedInputTokens!==void 0&&t.uint32(56).int64(e.cachedInputTokens),e.cacheWriteInputTokens!==void 0&&t.uint32(64).int64(e.cacheWriteInputTokens),t},decode(e,t){let n=e instanceof X?e:new X(e),r=t===void 0?n.len:n.pos+t,i=zS();for(;n.pos>>3){case 1:if(e!==10)break;i.provider=n.string();continue;case 2:if(e!==18)break;i.model=n.string();continue;case 3:if(e!==24)break;i.inputTokens=VS(n.int64());continue;case 4:if(e!==32)break;i.outputTokens=VS(n.int64());continue;case 5:if(e!==40)break;i.totalTokens=VS(n.int64());continue;case 6:if(e!==48)break;i.reasoningTokens=VS(n.int64());continue;case 7:if(e!==56)break;i.cachedInputTokens=VS(n.int64());continue;case 8:if(e!==64)break;i.cacheWriteInputTokens=VS(n.int64());continue}if((e&7)==4||e===0)break;n.skip(e&7)}return i},create(e){return BS.fromPartial(e??{})},fromPartial(e){let t=zS();return t.provider=e.provider??void 0,t.model=e.model??void 0,t.inputTokens=e.inputTokens??void 0,t.outputTokens=e.outputTokens??void 0,t.totalTokens=e.totalTokens??void 0,t.reasoningTokens=e.reasoningTokens??void 0,t.cachedInputTokens=e.cachedInputTokens??void 0,t.cacheWriteInputTokens=e.cacheWriteInputTokens??void 0,t}};function VS(e){let t=globalThis.Number(e.toString());if(t>globalThis.Number.MAX_SAFE_INTEGER)throw new globalThis.Error(`Value is larger than Number.MAX_SAFE_INTEGER`);if(te&&typeof e==`object`?e:void 0,US=e=>Array.isArray(e)?e:[],WS=()=>typeof process<`u`&&!!{}.SUPPRESS_TRANSFORMATION_WARNINGS,GS=()=>{WS()||console.warn(`[ag-ui][proto] Dropped a content part this build does not know: the protocol has a variant this SDK predates.`)};new Set(Object.values(A));var KS={textMessageStart:`TEXT_MESSAGE_START`,textMessageContent:`TEXT_MESSAGE_CONTENT`,textMessageEnd:`TEXT_MESSAGE_END`,textMessageChunk:`TEXT_MESSAGE_CHUNK`,toolCallStart:`TOOL_CALL_START`,toolCallArgs:`TOOL_CALL_ARGS`,toolCallEnd:`TOOL_CALL_END`,toolCallChunk:`TOOL_CALL_CHUNK`,toolCallResult:`TOOL_CALL_RESULT`,stateSnapshot:`STATE_SNAPSHOT`,stateDelta:`STATE_DELTA`,messagesSnapshot:`MESSAGES_SNAPSHOT`,activitySnapshot:`ACTIVITY_SNAPSHOT`,activityDelta:`ACTIVITY_DELTA`,raw:`RAW`,custom:`CUSTOM`,runStarted:`RUN_STARTED`,runFinished:`RUN_FINISHED`,runError:`RUN_ERROR`,stepStarted:`STEP_STARTED`,stepFinished:`STEP_FINISHED`,reasoningStart:`REASONING_START`,reasoningMessageStart:`REASONING_MESSAGE_START`,reasoningMessageContent:`REASONING_MESSAGE_CONTENT`,reasoningMessageEnd:`REASONING_MESSAGE_END`,reasoningMessageChunk:`REASONING_MESSAGE_CHUNK`,reasoningEnd:`REASONING_END`,reasoningEncryptedValue:`REASONING_ENCRYPTED_VALUE`,subagentStarted:`SUBAGENT_STARTED`,subagentFinished:`SUBAGENT_FINISHED`,subagentError:`SUBAGENT_ERROR`},qS=new Set([1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31]),JS=e=>{let t=HS(e);if(t){if([t.data,t.url,t.file].filter(Boolean).length>1)throw Error(`Invalid event: source carries more than one arm`);if(t.data){let e=t.data;return{type:`data`,value:e.value,mimeType:e.mimeType}}if(t.url){let e=t.url;return{type:`url`,value:e.value,mimeType:e.mimeType}}if(t.file){let e=t.file;return{type:`file`,value:e.value,provider:e.provider,mimeType:e.mimeType}}}},YS=e=>{let t=HS(e);if(t){if([t.text,t.image,t.audio,t.video,t.document].filter(Boolean).length>1)throw Error(`Invalid event: content part carries more than one arm`);if(t.text){let e=t.text;return{type:`text`,id:e.id,text:e.text,metadata:e.metadata}}if(t.image){let e=t.image;return e.source!==void 0&&JS(e.source)===void 0?void 0:{type:`image`,id:e.id,source:JS(e.source),metadata:e.metadata}}if(t.audio){let e=t.audio;return e.source!==void 0&&JS(e.source)===void 0?void 0:{type:`audio`,id:e.id,source:JS(e.source),metadata:e.metadata}}if(t.video){let e=t.video;return e.source!==void 0&&JS(e.source)===void 0?void 0:{type:`video`,id:e.id,source:JS(e.source),metadata:e.metadata}}if(t.document){let e=t.document;return e.source!==void 0&&JS(e.source)===void 0?void 0:{type:`document`,id:e.id,source:JS(e.source),metadata:e.metadata}}}},XS=new Set([`activity`]),ZS=new Set([`user`,`tool`]),QS=new Set([`developer`,`system`,`assistant`,`user`,`tool`,`activity`,`reasoning`]),$S=e=>{let t=HS(e)??{},n={...t},r=typeof t.role==`string`?t.role:``,i=QS.has(r),a=i?ZS.has(r):US(t.contentParts).length>0,o=i?XS.has(r):!a&&t.activityContent!==void 0;if(!i&&(t.content===void 0?0:1)+ +(US(t.contentParts).length>0)+(t.activityContent===void 0?0:1)>1)throw Error(`Invalid event: message carries more than one content form`);if(i){if(!a&&US(t.contentParts).length>0)throw Error(`Invalid event: message carries content parts for a role that has none`);if(t.activityContent!==void 0&&!o)throw Error(`Invalid event: message carries activity content for a non-activity role`);if(o&&t.content!==void 0)throw Error(`Invalid event: activity content cannot ride with other content forms`);if(a&&t.content!==void 0&&US(t.contentParts).length>0)throw Error(`Invalid event: message carries both string content and content parts`)}return a&&t.content===void 0&&(n.content=US(t.contentParts).map(e=>{let t=YS(e);return t===void 0&&GS(),t}).filter(e=>e!==void 0)),o&&t.activityContent!==void 0&&(n.content=t.activityContent),delete n.activityContent,delete n.contentParts,US(t.toolCalls).length===0&&delete n.toolCalls,Object.keys(n).forEach(e=>{n[e]===void 0&&delete n[e]}),n},eC=e=>{if(Array.isArray(e)){for(let t of e)eC(t);return}let t=HS(e);if(t)for(let e of Object.keys(t))t[e]===void 0?delete t[e]:eC(t[e])},tC=e=>{let t=HS(e);if(!t)return;let n={};return t.threadId!==void 0&&(n.threadId=t.threadId),t.runId!==void 0&&(n.runId=t.runId),t.protocolVersion!==void 0&&(n.protocolVersion=t.protocolVersion),t.parentRunId!==void 0&&(n.parentRunId=t.parentRunId),t.state!==void 0&&(n.state=t.state),n.messages=US(t.messages).map($S).filter(e=>e!==void 0),n.tools=US(t.tools),n.context=US(t.context),t.forwardedProps!==void 0&&(n.forwardedProps=t.forwardedProps),n.resume=US(t.resume),n},nC={TextMessageStartEvent:{singular:new Set([1]),descend:{1:`BaseEvent`}},BaseEvent:{singular:new Set([3,4]),descend:{},google:{3:`google.protobuf.Value`,4:`google.protobuf.Struct`}},TextMessageContentEvent:{singular:new Set([1]),descend:{1:`BaseEvent`}},TextMessageEndEvent:{singular:new Set([1]),descend:{1:`BaseEvent`}},ToolCallStartEvent:{singular:new Set([1]),descend:{1:`BaseEvent`}},ToolCallArgsEvent:{singular:new Set([1]),descend:{1:`BaseEvent`}},ToolCallEndEvent:{singular:new Set([1]),descend:{1:`BaseEvent`}},StateSnapshotEvent:{singular:new Set([1,2]),descend:{1:`BaseEvent`},google:{2:`google.protobuf.Value`}},StateDeltaEvent:{singular:new Set([1]),descend:{1:`BaseEvent`,2:`JsonPatchOperation`}},JsonPatchOperation:{singular:new Set([4]),descend:{},google:{4:`google.protobuf.Value`}},MessagesSnapshotEvent:{singular:new Set([1]),descend:{1:`BaseEvent`,2:`Message`}},Message:{singular:new Set([9,13]),descend:{5:`ToolCall`,8:`InputContent`},google:{9:`google.protobuf.Struct`,13:`google.protobuf.Struct`}},ToolCall:{singular:new Set([3,4]),descend:{},google:{4:`google.protobuf.Struct`}},InputContent:{singular:new Set([1,2,3,4,5]),descend:{1:`TextInputPart`,2:`ImageInputPart`,3:`AudioInputPart`,4:`VideoInputPart`,5:`DocumentInputPart`},arms:new Set([1,2,3,4,5])},TextInputPart:{singular:new Set([3]),descend:{},google:{3:`google.protobuf.Value`}},ImageInputPart:{singular:new Set([1,2]),descend:{1:`InputContentSource`},google:{2:`google.protobuf.Value`}},InputContentSource:{singular:new Set([1,2,3]),descend:{},arms:new Set([1,2,3])},AudioInputPart:{singular:new Set([1,2]),descend:{1:`InputContentSource`},google:{2:`google.protobuf.Value`}},VideoInputPart:{singular:new Set([1,2]),descend:{1:`InputContentSource`},google:{2:`google.protobuf.Value`}},DocumentInputPart:{singular:new Set([1,2]),descend:{1:`InputContentSource`},google:{2:`google.protobuf.Value`}},RawEvent:{singular:new Set([1,2]),descend:{1:`BaseEvent`},google:{2:`google.protobuf.Value`}},CustomEvent:{singular:new Set([1,3]),descend:{1:`BaseEvent`},google:{3:`google.protobuf.Value`}},RunStartedEvent:{singular:new Set([1,5]),descend:{1:`BaseEvent`,5:`RunAgentInput`}},RunAgentInput:{singular:new Set([4,8]),descend:{5:`Message`,6:`Tool`,9:`ResumeEntry`},google:{4:`google.protobuf.Value`,8:`google.protobuf.Value`}},Tool:{singular:new Set([3,4]),descend:{},google:{3:`google.protobuf.Value`,4:`google.protobuf.Struct`}},ResumeEntry:{singular:new Set([3,4]),descend:{},google:{3:`google.protobuf.Value`,4:`google.protobuf.Struct`}},RunFinishedEvent:{singular:new Set([1,4]),descend:{1:`BaseEvent`,6:`Interrupt`},google:{4:`google.protobuf.Value`}},Interrupt:{singular:new Set([5,7]),descend:{},google:{5:`google.protobuf.Value`,7:`google.protobuf.Value`}},RunErrorEvent:{singular:new Set([1]),descend:{1:`BaseEvent`}},StepStartedEvent:{singular:new Set([1]),descend:{1:`BaseEvent`}},StepFinishedEvent:{singular:new Set([1]),descend:{1:`BaseEvent`}},TextMessageChunkEvent:{singular:new Set([1]),descend:{1:`BaseEvent`}},ToolCallChunkEvent:{singular:new Set([1]),descend:{1:`BaseEvent`}},SubagentStartedEvent:{singular:new Set([1]),descend:{1:`BaseEvent`}},SubagentFinishedEvent:{singular:new Set([1,3]),descend:{1:`BaseEvent`},google:{3:`google.protobuf.Value`}},SubagentErrorEvent:{singular:new Set([1]),descend:{1:`BaseEvent`}},ToolCallResultEvent:{singular:new Set([1]),descend:{1:`BaseEvent`,7:`InputContent`}},ActivitySnapshotEvent:{singular:new Set([1,5]),descend:{1:`BaseEvent`},google:{5:`google.protobuf.Struct`}},ActivityDeltaEvent:{singular:new Set([1]),descend:{1:`BaseEvent`,5:`JsonPatchOperation`}},ReasoningStartEvent:{singular:new Set([1]),descend:{1:`BaseEvent`}},ReasoningMessageStartEvent:{singular:new Set([1]),descend:{1:`BaseEvent`}},ReasoningMessageContentEvent:{singular:new Set([1]),descend:{1:`BaseEvent`}},ReasoningMessageEndEvent:{singular:new Set([1]),descend:{1:`BaseEvent`}},ReasoningMessageChunkEvent:{singular:new Set([1]),descend:{1:`BaseEvent`}},ReasoningEndEvent:{singular:new Set([1]),descend:{1:`BaseEvent`}},ReasoningEncryptedValueEvent:{singular:new Set([1]),descend:{1:`BaseEvent`}},"google.protobuf.Struct":{singular:new Set,descend:{1:`google.protobuf.Struct.FieldsEntry`}},"google.protobuf.Struct.FieldsEntry":{singular:new Set([2]),descend:{2:`google.protobuf.Value`}},"google.protobuf.Value":{singular:new Set([5,6]),descend:{5:`google.protobuf.Struct`,6:`google.protobuf.ListValue`},arms:new Set([1,2,3,4,5,6]),armWireTypes:{1:0,2:1,3:2,4:0,5:2,6:2}},"google.protobuf.ListValue":{singular:new Set,descend:{1:`google.protobuf.Value`}}},rC={1:`TextMessageStartEvent`,2:`TextMessageContentEvent`,3:`TextMessageEndEvent`,4:`ToolCallStartEvent`,5:`ToolCallArgsEvent`,6:`ToolCallEndEvent`,7:`StateSnapshotEvent`,8:`StateDeltaEvent`,9:`MessagesSnapshotEvent`,10:`RawEvent`,11:`CustomEvent`,12:`RunStartedEvent`,13:`RunFinishedEvent`,14:`RunErrorEvent`,15:`StepStartedEvent`,16:`StepFinishedEvent`,17:`TextMessageChunkEvent`,18:`ToolCallChunkEvent`,19:`SubagentStartedEvent`,20:`SubagentFinishedEvent`,21:`SubagentErrorEvent`,22:`ToolCallResultEvent`,23:`ActivitySnapshotEvent`,24:`ActivityDeltaEvent`,25:`ReasoningStartEvent`,26:`ReasoningMessageStartEvent`,27:`ReasoningMessageContentEvent`,28:`ReasoningMessageEndEvent`,29:`ReasoningMessageChunkEvent`,30:`ReasoningEndEvent`,31:`ReasoningEncryptedValueEvent`};function iC(e,t){let n=0,r=0;for(;;){if(t.offset>=e.length)throw Error(`Invalid event`);let i=e[t.offset++];if(r<28?n+=(i&127)*2**r:r===28&&(n+=(i&15)*2**28),r+=7,!(i&128))return n}}function aC(e,t){let n={offset:0},r=0,i=0;for(;n.offsete.length)throw Error(`Invalid event`);if(r===0){if(t.arms?.has(o)){if(i!==0&&i!==o)throw Error(`Invalid event`);i=o}let r=t.descend[o];if(r!==void 0){let t=nC[r];t!==void 0&&aC(e.subarray(n.offset,n.offset+a),t)}}n.offset+=a}else if(s===5)n.offset+=4;else throw Error(`Invalid event`);if(n.offset>e.length)throw Error(`Invalid event`)}if(r!==0)throw Error(`Invalid event`)}function oC(e){let t=new Set,n={offset:0},r=0;for(;n.offset0&&!t.has(a))throw Error(`Invalid event`);t.add(a)}if(o===0)iC(e,n);else if(o===1)n.offset+=8;else if(o===2){let t=iC(e,n);if(n.offset+t>e.length)throw Error(`Invalid event`);if(r===0){let r=rC[a];if(r!==void 0){let i=nC[r];i!==void 0&&aC(e.subarray(n.offset,n.offset+t),i)}}n.offset+=t}else if(o===5)n.offset+=4;else throw Error(`Invalid event`);if(n.offset>e.length)throw Error(`Invalid event`)}if(r!==0)throw Error(`Invalid event`)}function sC(e){if(e.length===1)return e[0];let t=new Uint8Array(e.reduce((e,t)=>e+t.length,0)),n=0;for(let r of e)t.set(r,n),n+=r.length;return t}function cC(e,t){let n=new X(e),r=[],i=new Map,a,o=!1;for(;n.pos1||n!==t){s.push(new Y().uint32(e.number*8+2).bytes(n).finish()),o=!0;continue}}s.push(e.raw)}return o?sC(s):e}var lC=class extends Error{constructor(e=`Unknown event type`){super(e),this.name=`AGUIUnknownEventTypeError`}};function uC(e,t,n,r){let i=0,a=0,o=0;for(;;){if(t.offset>=e.length||o>=n)return-1;let s=e[t.offset++];if(o+=1,o===n&&s>r)return-1;if(i+=(s&127)*2**a,a+=7,!(s&128))return i}}var dC=(e,t)=>uC(e,t,5,15),fC=(e,t)=>uC(e,t,10,1);function pC(e){let t={offset:0},n=[];for(;t.offsete.length)return!1;t.offset+=n}else return!1;if(t.offset>e.length)return!1}return n.length===0}function mC(e){let t={offset:0},n=[],r=0;for(;t.offsete.length)return!1;if(s){if(qS.has(a)||!pC(e.subarray(t.offset,t.offset+n)))return!1;r+=1}t.offset+=n}else return!1;if(t.offset>e.length)return!1}return n.length===0&&r>0}function hC(e){oC(e);let t=RS.decode(cC(e,{singular:qS,descend:rC})),n=Object.entries(t).filter(([,e])=>e!==void 0);if(n.length!==1)throw n.length===0&&mC(e)?new lC:Error(`Invalid event`);let r=n[0],i=KS[r[0]];if(i===void 0)throw Error(`Invalid event`);let a=r[1],o=HS(a.baseEvent);if(!o)throw Error(`Invalid event`);let s=Dx[o.type];if(s!==i)throw Error(`Invalid event: envelope carries `+i+` but the base event declares `+String(s));if(a.type=i,a.timestamp=o.timestamp,a.rawEvent=o.rawEvent,o.metadata!==void 0&&(a.metadata=o.metadata),delete a.baseEvent,a.type===`MESSAGES_SNAPSHOT`&&Array.isArray(a.messages)&&(a.messages=a.messages.map($S).filter(e=>e!==void 0)),a.type===`RUN_FINISHED`){let e=a,t=typeof e.outcome==`string`&&e.outcome!==``?e.outcome:void 0,n={};n.pendingToolCallIds=e.pendingToolCallIds,delete e.pendingToolCallIds,n.interrupts=e.interrupts,delete e.interrupts,delete e.outcome,t===void 0&&(US(n.pendingToolCallIds).length>0&&(e.pendingToolCallIds=n.pendingToolCallIds),US(n.interrupts).length>0&&(e.interrupts=n.interrupts)),t===`success`&&(e.outcome={type:`success`,...US(n.pendingToolCallIds).length>0?{pendingToolCallIds:n.pendingToolCallIds}:{},...US(n.interrupts).length>0?{interrupts:n.interrupts}:{}}),t===`interrupt`&&(e.outcome={type:`interrupt`,interrupts:US(n.interrupts),...US(n.pendingToolCallIds).length>0?{pendingToolCallIds:n.pendingToolCallIds}:{}}),t===`cancelled`&&(e.outcome={type:`cancelled`,...US(n.pendingToolCallIds).length>0?{pendingToolCallIds:n.pendingToolCallIds}:{},...US(n.interrupts).length>0?{interrupts:n.interrupts}:{}}),t!==void 0&&![`success`,`interrupt`,`cancelled`].includes(t)&&(e.outcome={type:t,...US(n.pendingToolCallIds).length>0?{pendingToolCallIds:n.pendingToolCallIds}:{},...US(n.interrupts).length>0?{interrupts:n.interrupts}:{}})}if(a.type===`SUBAGENT_FINISHED`){let e=a,t=typeof e.outcome==`string`&&e.outcome!==``?e.outcome:void 0,n={};n.interruptIds=e.interruptIds,delete e.interruptIds,delete e.outcome,t===void 0&&US(n.interruptIds).length>0&&(e.interruptIds=n.interruptIds),t===`success`&&(e.outcome={type:`success`,...US(n.interruptIds).length>0?{interruptIds:n.interruptIds}:{}}),t===`suspended`&&(e.outcome={type:`suspended`,...US(n.interruptIds).length>0?{interruptIds:n.interruptIds}:{}}),t!==void 0&&![`success`,`suspended`].includes(t)&&(e.outcome={type:t,...US(n.interruptIds).length>0?{interruptIds:n.interruptIds}:{}})}if(a.type===`STATE_DELTA`&&Array.isArray(a.delta)&&(a.delta=a.delta.map(e=>{let t=Hb[e.op];return e.op=typeof t==`string`&&t!==`UNRECOGNIZED`?t.toLowerCase():String(e.op),Object.keys(e).forEach(t=>{e[t]===void 0&&delete e[t]}),e})),a.type===`ACTIVITY_DELTA`&&Array.isArray(a.patch)&&(a.patch=a.patch.map(e=>{let t=Hb[e.op];return e.op=typeof t==`string`&&t!==`UNRECOGNIZED`?t.toLowerCase():String(e.op),Object.keys(e).forEach(t=>{e[t]===void 0&&delete e[t]}),e})),a.type===`RUN_FINISHED`&&Array.isArray(a.usage)&&a.usage.length===0&&delete a.usage,a.type===`RUN_ERROR`&&Array.isArray(a.usage)&&a.usage.length===0&&delete a.usage,a.type===`TOOL_CALL_RESULT`){let e=a;if(e.content!==void 0&&US(e.contentParts).length>0)throw Error(`Invalid event: content carries both string content and content parts`);e.content===void 0&&(e.content=US(e.contentParts).map(e=>{let t=YS(e);return t===void 0&&GS(),t}).filter(e=>e!==void 0)),delete e.contentParts}return a.type===`RUN_STARTED`&&a.input!==void 0&&(a.input=tC(a.input)),eC(a),a}var gC=/^[v^~<>=]*?(\d+)(?:\.([x*]|\d+)(?:\.([x*]|\d+)(?:\.([x*]|\d+))?(?:-([\da-z\-]+(?:\.[\da-z\-]+)*))?(?:\+[\da-z\-]+(?:\.[\da-z\-]+)*)?)?)?$/i,_C=e=>{if(typeof e!=`string`)throw TypeError(`Invalid argument expected string`);let t=e.match(gC);if(!t)throw Error(`Invalid argument not valid semver ('${e}' received)`);return t.shift(),t},vC=e=>e===`*`||e===`x`||e===`X`,yC=e=>{let t=parseInt(e,10);return isNaN(t)?e:t},bC=(e,t)=>typeof e==typeof t?[e,t]:[String(e),String(t)],xC=(e,t)=>{if(vC(e)||vC(t))return 0;let[n,r]=bC(yC(e),yC(t));return n>r?1:n{for(let n=0;n{let n=_C(e),r=_C(t),i=n.pop(),a=r.pop(),o=SC(n,r);return o===0?i&&a?SC(i.split(`.`),a.split(`.`)):i||a?i?-1:1:0:o},wC=e=>typeof e==`string`&&/^[v\d]/.test(e)&&gC.test(e);Object.freeze({status:`aborted`});function $(e,t,n){function r(n,r){var i;Object.defineProperty(n,"_zod",{value:n._zod??{},enumerable:!1}),(i=n._zod).traits??(i.traits=new Set),n._zod.traits.add(e),t(n,r);for(let e in o.prototype)e in n||Object.defineProperty(n,e,{value:o.prototype[e].bind(n)});n._zod.constr=o,n._zod.def=r}let i=n?.Parent??Object;class a extends i{}Object.defineProperty(a,"name",{value:e});function o(e){var t;let i=n?.Parent?new a:this;r(i,e),(t=i._zod).deferred??(t.deferred=[]);for(let e of i._zod.deferred)e();return i}return Object.defineProperty(o,"init",{value:r}),Object.defineProperty(o,Symbol.hasInstance,{value:t=>n?.Parent&&t instanceof n.Parent?!0:t?._zod?.traits?.has(e)}),Object.defineProperty(o,"name",{value:e}),o}var TC=class extends Error{constructor(){super(`Encountered Promise during synchronous parse. Use .parseAsync() instead.`)}},EC={};function DC(e){return e&&Object.assign(EC,e),EC}function OC(e){let t=Object.values(e).filter(e=>typeof e==`number`);return Object.entries(e).filter(([e,n])=>t.indexOf(+e)===-1).map(([e,t])=>t)}function kC(e,t){return typeof t==`bigint`?t.toString():t}function AC(e){return{get value(){{let t=e();return Object.defineProperty(this,"value",{value:t}),t}}}}function jC(e){return e==null}function MC(e){let t=+!!e.startsWith(`^`),n=e.endsWith(`$`)?e.length-1:e.length;return e.slice(t,n)}function NC(e,t,n){Object.defineProperty(e,t,{get(){{let r=n();return e[t]=r,r}},set(n){Object.defineProperty(e,t,{value:n})},configurable:!0})}function PC(e,t,n){Object.defineProperty(e,t,{value:n,writable:!0,enumerable:!0,configurable:!0})}function FC(e){return JSON.stringify(e)}var IC=Error.captureStackTrace?Error.captureStackTrace:(...e)=>{};function LC(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}var RC=AC(()=>{if(typeof navigator<`u`&&navigator?.userAgent?.includes(`Cloudflare`))return!1;try{return Function(``),!0}catch{return!1}});function zC(e){if(LC(e)===!1)return!1;let t=e.constructor;if(t===void 0)return!0;let n=t.prototype;return LC(n)!==!1&&Object.prototype.hasOwnProperty.call(n,`isPrototypeOf`)!==!1}var BC=new Set([`string`,`number`,`symbol`]);function VC(e){return e.replace(/[.*+?^${}()|[\]\\]/g,`\\$&`)}function HC(e,t,n){let r=new e._zod.constr(t??e._zod.def);return(!t||n?.parent)&&(r._zod.parent=e),r}function UC(e){let t=e;if(!t)return{};if(typeof t==`string`)return{error:()=>t};if(t?.message!==void 0){if(t?.error!==void 0)throw Error("Cannot specify both `message` and `error` params");t.error=t.message}return delete t.message,typeof t.error==`string`?{...t,error:()=>t.error}:t}function WC(e){return Object.keys(e).filter(t=>e[t]._zod.optin===`optional`&&e[t]._zod.optout===`optional`)}function GC(e,t){let n={},r=e._zod.def;for(let e in t){if(!(e in r.shape))throw Error(`Unrecognized key: "${e}"`);t[e]&&(n[e]=r.shape[e])}return HC(e,{...e._zod.def,shape:n,checks:[]})}function KC(e,t){let n={...e._zod.def.shape},r=e._zod.def;for(let e in t){if(!(e in r.shape))throw Error(`Unrecognized key: "${e}"`);t[e]&&delete n[e]}return HC(e,{...e._zod.def,shape:n,checks:[]})}function qC(e,t){if(!zC(t))throw Error(`Invalid input to extend: expected a plain object`);return HC(e,{...e._zod.def,get shape(){let n={...e._zod.def.shape,...t};return PC(this,`shape`,n),n},checks:[]})}function JC(e,t){return HC(e,{...e._zod.def,get shape(){let n={...e._zod.def.shape,...t._zod.def.shape};return PC(this,`shape`,n),n},catchall:t._zod.def.catchall,checks:[]})}function YC(e,t,n){let r=t._zod.def.shape,i={...r};if(n)for(let t in n){if(!(t in r))throw Error(`Unrecognized key: "${t}"`);n[t]&&(i[t]=e?new e({type:`optional`,innerType:r[t]}):r[t])}else for(let t in r)i[t]=e?new e({type:`optional`,innerType:r[t]}):r[t];return HC(t,{...t._zod.def,shape:i,checks:[]})}function XC(e,t,n){let r=t._zod.def.shape,i={...r};if(n)for(let t in n){if(!(t in i))throw Error(`Unrecognized key: "${t}"`);n[t]&&(i[t]=new e({type:`nonoptional`,innerType:r[t]}))}else for(let t in r)i[t]=new e({type:`nonoptional`,innerType:r[t]});return HC(t,{...t._zod.def,shape:i,checks:[]})}function ZC(e,t=0){for(let n=t;n{var n;return(n=t).path??(n.path=[]),t.path.unshift(e),t})}function $C(e){return typeof e==`string`?e:e?.message}function ew(e,t,n){let r={...e,path:e.path??[]};return e.message||(r.message=$C(e.inst?._zod.def?.error?.(e))??$C(t?.error?.(e))??$C(n.customError?.(e))??$C(n.localeError?.(e))??`Invalid input`),delete r.inst,delete r.continue,t?.reportInput||delete r.input,r}function tw(e){return Array.isArray(e)?`array`:typeof e==`string`?`string`:`unknown`}function nw(...e){let[t,n,r]=e;return typeof t==`string`?{message:t,code:`custom`,input:n,inst:r}:{...t}}var rw=(e,t)=>{e.name=`$ZodError`,Object.defineProperty(e,"_zod",{value:e._zod,enumerable:!1}),Object.defineProperty(e,"issues",{value:t,enumerable:!1}),Object.defineProperty(e,"message",{get(){return JSON.stringify(t,kC,2)},enumerable:!0}),Object.defineProperty(e,"toString",{value:()=>e.message,enumerable:!1})},iw=$(`$ZodError`,rw),aw=$(`$ZodError`,rw,{Parent:Error});function ow(e,t=e=>e.message){let n={},r=[];for(let i of e.issues)i.path.length>0?(n[i.path[0]]=n[i.path[0]]||[],n[i.path[0]].push(t(i))):r.push(t(i));return{formErrors:r,fieldErrors:n}}function sw(e,t){let n=t||function(e){return e.message},r={_errors:[]},i=e=>{for(let t of e.issues)if(t.code===`invalid_union`&&t.errors.length)t.errors.map(e=>i({issues:e}));else if(t.code===`invalid_key`)i({issues:t.issues});else if(t.code===`invalid_element`)i({issues:t.issues});else if(t.path.length===0)r._errors.push(n(t));else{let e=r,i=0;for(;i(t,n,r,i)=>{let a=r?Object.assign(r,{async:!1}):{async:!1},o=t._zod.run({value:n,issues:[]},a);if(o instanceof Promise)throw new TC;if(o.issues.length){let t=new((i?.Err)??e)(o.issues.map(e=>ew(e,a,DC())));throw IC(t,i?.callee),t}return o.value},lw=e=>async(t,n,r,i)=>{let a=r?Object.assign(r,{async:!0}):{async:!0},o=t._zod.run({value:n,issues:[]},a);if(o instanceof Promise&&(o=await o),o.issues.length){let t=new((i?.Err)??e)(o.issues.map(e=>ew(e,a,DC())));throw IC(t,i?.callee),t}return o.value},uw=e=>(t,n,r)=>{let i=r?{...r,async:!1}:{async:!1},a=t._zod.run({value:n,issues:[]},i);if(a instanceof Promise)throw new TC;return a.issues.length?{success:!1,error:new(e??iw)(a.issues.map(e=>ew(e,i,DC())))}:{success:!0,data:a.value}},dw=uw(aw),fw=e=>async(t,n,r)=>{let i=r?Object.assign(r,{async:!0}):{async:!0},a=t._zod.run({value:n,issues:[]},i);return a instanceof Promise&&(a=await a),a.issues.length?{success:!1,error:new e(a.issues.map(e=>ew(e,i,DC())))}:{success:!0,data:a.value}},pw=fw(aw),mw=$(`$ZodCheck`,(e,t)=>{var n;e._zod??={},e._zod.def=t,(n=e._zod).onattach??(n.onattach=[])}),hw=$(`$ZodCheckMaxLength`,(e,t)=>{var n;mw.init(e,t),(n=e._zod.def).when??(n.when=e=>{let t=e.value;return!jC(t)&&t.length!==void 0}),e._zod.onattach.push(e=>{let n=e._zod.bag.maximum??1/0;t.maximum{let r=n.value;if(r.length<=t.maximum)return;let i=tw(r);n.issues.push({origin:i,code:`too_big`,maximum:t.maximum,inclusive:!0,input:r,inst:e,continue:!t.abort})}}),gw=$(`$ZodCheckMinLength`,(e,t)=>{var n;mw.init(e,t),(n=e._zod.def).when??(n.when=e=>{let t=e.value;return!jC(t)&&t.length!==void 0}),e._zod.onattach.push(e=>{let n=e._zod.bag.minimum??-1/0;t.minimum>n&&(e._zod.bag.minimum=t.minimum)}),e._zod.check=n=>{let r=n.value;if(r.length>=t.minimum)return;let i=tw(r);n.issues.push({origin:i,code:`too_small`,minimum:t.minimum,inclusive:!0,input:r,inst:e,continue:!t.abort})}}),_w=$(`$ZodCheckLengthEquals`,(e,t)=>{var n;mw.init(e,t),(n=e._zod.def).when??(n.when=e=>{let t=e.value;return!jC(t)&&t.length!==void 0}),e._zod.onattach.push(e=>{let n=e._zod.bag;n.minimum=t.length,n.maximum=t.length,n.length=t.length}),e._zod.check=n=>{let r=n.value,i=r.length;if(i===t.length)return;let a=tw(r),o=i>t.length;n.issues.push({origin:a,...o?{code:`too_big`,maximum:t.length}:{code:`too_small`,minimum:t.length},inclusive:!0,exact:!0,input:n.value,inst:e,continue:!t.abort})}}),vw=$(`$ZodCheckOverwrite`,(e,t)=>{mw.init(e,t),e._zod.check=e=>{e.value=t.tx(e.value)}}),yw=class{constructor(e=[]){this.content=[],this.indent=0,this&&(this.args=e)}indented(e){this.indent+=1,e(this),--this.indent}write(e){if(typeof e==`function`){e(this,{execution:`sync`}),e(this,{execution:`async`});return}let t=e.split(` -`).filter(e=>e),n=Math.min(...t.map(e=>e.length-e.trimStart().length)),r=t.map(e=>e.slice(n)).map(e=>` `.repeat(this.indent*2)+e);for(let e of r)this.content.push(e)}compile(){let e=Function,t=this?.args,n=[...(this?.content??[``]).map(e=>` ${e}`)];return new e(...t,n.join(` -`))}},bw={major:4,minor:0,patch:0},xw=$(`$ZodType`,(e,t)=>{var n;e??={},e._zod.def=t,e._zod.bag=e._zod.bag||{},e._zod.version=bw;let r=[...e._zod.def.checks??[]];e._zod.traits.has(`$ZodCheck`)&&r.unshift(e);for(let t of r)for(let n of t._zod.onattach)n(e);if(r.length===0)(n=e._zod).deferred??(n.deferred=[]),e._zod.deferred?.push(()=>{e._zod.run=e._zod.parse});else{let t=(e,t,n)=>{let r=ZC(e),i;for(let a of t){if(a._zod.def.when){if(!a._zod.def.when(e))continue}else if(r)continue;let t=e.issues.length,o=a._zod.check(e);if(o instanceof Promise&&n?.async===!1)throw new TC;if(i||o instanceof Promise)i=(i??Promise.resolve()).then(async()=>{await o,e.issues.length!==t&&(r||=ZC(e,t))});else{if(e.issues.length===t)continue;r||=ZC(e,t)}}return i?i.then(()=>e):e};e._zod.run=(n,i)=>{let a=e._zod.parse(n,i);if(a instanceof Promise){if(i.async===!1)throw new TC;return a.then(e=>t(e,r,i))}return t(a,r,i)}}e[`~standard`]={validate:t=>{try{let n=dw(e,t);return n.success?{value:n.data}:{issues:n.error?.issues}}catch{return pw(e,t).then(e=>e.success?{value:e.data}:{issues:e.error?.issues})}},vendor:`zod`,version:1}}),Sw=$(`$ZodUnknown`,(e,t)=>{xw.init(e,t),e._zod.parse=e=>e}),Cw=$(`$ZodNever`,(e,t)=>{xw.init(e,t),e._zod.parse=(t,n)=>(t.issues.push({expected:`never`,code:`invalid_type`,input:t.value,inst:e}),t)});function ww(e,t,n){e.issues.length&&t.issues.push(...QC(n,e.issues)),t.value[n]=e.value}var Tw=$(`$ZodArray`,(e,t)=>{xw.init(e,t),e._zod.parse=(n,r)=>{let i=n.value;if(!Array.isArray(i))return n.issues.push({expected:`array`,code:`invalid_type`,input:i,inst:e}),n;n.value=Array(i.length);let a=[];for(let e=0;eww(t,n,e))):ww(s,n,e)}return a.length?Promise.all(a).then(()=>n):n}});function Ew(e,t,n){e.issues.length&&t.issues.push(...QC(n,e.issues)),t.value[n]=e.value}function Dw(e,t,n,r){e.issues.length?r[n]===void 0?n in r?t.value[n]=void 0:t.value[n]=e.value:t.issues.push(...QC(n,e.issues)):e.value===void 0?n in r&&(t.value[n]=void 0):t.value[n]=e.value}var Ow=$(`$ZodObject`,(e,t)=>{xw.init(e,t);let n=AC(()=>{let e=Object.keys(t.shape);for(let n of e)if(!(t.shape[n]instanceof xw))throw Error(`Invalid element at key "${n}": expected a Zod schema`);let n=WC(t.shape);return{shape:t.shape,keys:e,keySet:new Set(e),numKeys:e.length,optionalKeys:new Set(n)}});NC(e._zod,`propValues`,()=>{let e=t.shape,n={};for(let t in e){let r=e[t]._zod;if(r.values){n[t]??(n[t]=new Set);for(let e of r.values)n[t].add(e)}}return n});let r=e=>{let t=new yw([`shape`,`payload`,`ctx`]),r=n.value,i=e=>{let t=FC(e);return`shape[${t}]._zod.run({ value: input[${t}], issues: [] }, ctx)`};t.write(`const input = payload.value;`);let a=Object.create(null),o=0;for(let e of r.keys)a[e]=`key_${o++}`;t.write(`const newResult = {}`);for(let e of r.keys)if(r.optionalKeys.has(e)){let n=a[e];t.write(`const ${n} = ${i(e)};`);let r=FC(e);t.write(` - if (${n}.issues.length) { - if (input[${r}] === undefined) { - if (${r} in input) { - newResult[${r}] = undefined; - } - } else { - payload.issues = payload.issues.concat( - ${n}.issues.map((iss) => ({ - ...iss, - path: iss.path ? [${r}, ...iss.path] : [${r}], - })) - ); - } - } else if (${n}.value === undefined) { - if (${r} in input) newResult[${r}] = undefined; - } else { - newResult[${r}] = ${n}.value; - } - `)}else{let n=a[e];t.write(`const ${n} = ${i(e)};`),t.write(` - if (${n}.issues.length) payload.issues = payload.issues.concat(${n}.issues.map(iss => ({ - ...iss, - path: iss.path ? [${FC(e)}, ...iss.path] : [${FC(e)}] - })));`),t.write(`newResult[${FC(e)}] = ${n}.value`)}t.write(`payload.value = newResult;`),t.write(`return payload;`);let s=t.compile();return(t,n)=>s(e,t,n)},i,a=LC,o=!EC.jitless,s=o&&RC.value,c=t.catchall,l;e._zod.parse=(u,d)=>{l??=n.value;let f=u.value;if(!a(f))return u.issues.push({expected:`object`,code:`invalid_type`,input:f,inst:e}),u;let p=[];if(o&&s&&d?.async===!1&&d.jitless!==!0)i||=r(t.shape),u=i(u,d);else{u.value={};let e=l.shape;for(let t of l.keys){let n=e[t],r=n._zod.run({value:f[t],issues:[]},d),i=n._zod.optin===`optional`&&n._zod.optout===`optional`;r instanceof Promise?p.push(r.then(e=>i?Dw(e,u,t,f):Ew(e,u,t))):i?Dw(r,u,t,f):Ew(r,u,t)}}if(!c)return p.length?Promise.all(p).then(()=>u):u;let m=[],h=l.keySet,g=c._zod,_=g.def.type;for(let e of Object.keys(f)){if(h.has(e))continue;if(_===`never`){m.push(e);continue}let t=g.run({value:f[e],issues:[]},d);t instanceof Promise?p.push(t.then(t=>Ew(t,u,e))):Ew(t,u,e)}return m.length&&u.issues.push({code:`unrecognized_keys`,keys:m,input:f,inst:e}),p.length?Promise.all(p).then(()=>u):u}});function kw(e,t,n,r){for(let n of e)if(n.issues.length===0)return t.value=n.value,t;return t.issues.push({code:`invalid_union`,input:t.value,inst:n,errors:e.map(e=>e.issues.map(e=>ew(e,r,DC())))}),t}var Aw=$(`$ZodUnion`,(e,t)=>{xw.init(e,t),NC(e._zod,`optin`,()=>t.options.some(e=>e._zod.optin===`optional`)?`optional`:void 0),NC(e._zod,`optout`,()=>t.options.some(e=>e._zod.optout===`optional`)?`optional`:void 0),NC(e._zod,`values`,()=>{if(t.options.every(e=>e._zod.values))return new Set(t.options.flatMap(e=>Array.from(e._zod.values)))}),NC(e._zod,`pattern`,()=>{if(t.options.every(e=>e._zod.pattern)){let e=t.options.map(e=>e._zod.pattern);return RegExp(`^(${e.map(e=>MC(e.source)).join(`|`)})$`)}}),e._zod.parse=(n,r)=>{let i=!1,a=[];for(let e of t.options){let t=e._zod.run({value:n.value,issues:[]},r);if(t instanceof Promise)a.push(t),i=!0;else{if(t.issues.length===0)return t;a.push(t)}}return i?Promise.all(a).then(t=>kw(t,n,e,r)):kw(a,n,e,r)}}),jw=$(`$ZodIntersection`,(e,t)=>{xw.init(e,t),e._zod.parse=(e,n)=>{let r=e.value,i=t.left._zod.run({value:r,issues:[]},n),a=t.right._zod.run({value:r,issues:[]},n);return i instanceof Promise||a instanceof Promise?Promise.all([i,a]).then(([t,n])=>Nw(e,t,n)):Nw(e,i,a)}});function Mw(e,t){if(e===t||e instanceof Date&&t instanceof Date&&+e==+t)return{valid:!0,data:e};if(zC(e)&&zC(t)){let n=Object.keys(t),r=Object.keys(e).filter(e=>n.indexOf(e)!==-1),i={...e,...t};for(let n of r){let r=Mw(e[n],t[n]);if(!r.valid)return{valid:!1,mergeErrorPath:[n,...r.mergeErrorPath]};i[n]=r.data}return{valid:!0,data:i}}if(Array.isArray(e)&&Array.isArray(t)){if(e.length!==t.length)return{valid:!1,mergeErrorPath:[]};let n=[];for(let r=0;r{xw.init(e,t),e._zod.parse=(n,r)=>{let i=n.value;if(!zC(i))return n.issues.push({expected:`record`,code:`invalid_type`,input:i,inst:e}),n;let a=[];if(t.keyType._zod.values){let o=t.keyType._zod.values;n.value={};for(let e of o)if(typeof e==`string`||typeof e==`number`||typeof e==`symbol`){let o=t.valueType._zod.run({value:i[e],issues:[]},r);o instanceof Promise?a.push(o.then(t=>{t.issues.length&&n.issues.push(...QC(e,t.issues)),n.value[e]=t.value})):(o.issues.length&&n.issues.push(...QC(e,o.issues)),n.value[e]=o.value)}let s;for(let e in i)o.has(e)||(s??=[],s.push(e));s&&s.length>0&&n.issues.push({code:`unrecognized_keys`,input:i,inst:e,keys:s})}else{n.value={};for(let o of Reflect.ownKeys(i)){if(o===`__proto__`)continue;let s=t.keyType._zod.run({value:o,issues:[]},r);if(s instanceof Promise)throw Error(`Async schemas not supported in object keys currently`);if(s.issues.length){n.issues.push({origin:`record`,code:`invalid_key`,issues:s.issues.map(e=>ew(e,r,DC())),input:o,path:[o],inst:e}),n.value[s.value]=s.value;continue}let c=t.valueType._zod.run({value:i[o],issues:[]},r);c instanceof Promise?a.push(c.then(e=>{e.issues.length&&n.issues.push(...QC(o,e.issues)),n.value[s.value]=e.value})):(c.issues.length&&n.issues.push(...QC(o,c.issues)),n.value[s.value]=c.value)}}return a.length?Promise.all(a).then(()=>n):n}}),Fw=$(`$ZodEnum`,(e,t)=>{xw.init(e,t);let n=OC(t.entries);e._zod.values=new Set(n),e._zod.pattern=RegExp(`^(${n.filter(e=>BC.has(typeof e)).map(e=>typeof e==`string`?VC(e):e.toString()).join(`|`)})$`),e._zod.parse=(t,r)=>{let i=t.value;return e._zod.values.has(i)||t.issues.push({code:`invalid_value`,values:n,input:i,inst:e}),t}}),Iw=$(`$ZodLiteral`,(e,t)=>{xw.init(e,t),e._zod.values=new Set(t.values),e._zod.pattern=RegExp(`^(${t.values.map(e=>typeof e==`string`?VC(e):e?e.toString():String(e)).join(`|`)})$`),e._zod.parse=(n,r)=>{let i=n.value;return e._zod.values.has(i)||n.issues.push({code:`invalid_value`,values:t.values,input:i,inst:e}),n}}),Lw=$(`$ZodTransform`,(e,t)=>{xw.init(e,t),e._zod.parse=(e,n)=>{let r=t.transform(e.value,e);if(n.async)return(r instanceof Promise?r:Promise.resolve(r)).then(t=>(e.value=t,e));if(r instanceof Promise)throw new TC;return e.value=r,e}}),Rw=$(`$ZodOptional`,(e,t)=>{xw.init(e,t),e._zod.optin=`optional`,e._zod.optout=`optional`,NC(e._zod,`values`,()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,void 0]):void 0),NC(e._zod,`pattern`,()=>{let e=t.innerType._zod.pattern;return e?RegExp(`^(${MC(e.source)})?$`):void 0}),e._zod.parse=(e,n)=>t.innerType._zod.optin===`optional`?t.innerType._zod.run(e,n):e.value===void 0?e:t.innerType._zod.run(e,n)}),zw=$(`$ZodNullable`,(e,t)=>{xw.init(e,t),NC(e._zod,`optin`,()=>t.innerType._zod.optin),NC(e._zod,`optout`,()=>t.innerType._zod.optout),NC(e._zod,`pattern`,()=>{let e=t.innerType._zod.pattern;return e?RegExp(`^(${MC(e.source)}|null)$`):void 0}),NC(e._zod,`values`,()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,null]):void 0),e._zod.parse=(e,n)=>e.value===null?e:t.innerType._zod.run(e,n)}),Bw=$(`$ZodDefault`,(e,t)=>{xw.init(e,t),e._zod.optin=`optional`,NC(e._zod,`values`,()=>t.innerType._zod.values),e._zod.parse=(e,n)=>{if(e.value===void 0)return e.value=t.defaultValue,e;let r=t.innerType._zod.run(e,n);return r instanceof Promise?r.then(e=>Vw(e,t)):Vw(r,t)}});function Vw(e,t){return e.value===void 0&&(e.value=t.defaultValue),e}var Hw=$(`$ZodPrefault`,(e,t)=>{xw.init(e,t),e._zod.optin=`optional`,NC(e._zod,`values`,()=>t.innerType._zod.values),e._zod.parse=(e,n)=>(e.value===void 0&&(e.value=t.defaultValue),t.innerType._zod.run(e,n))}),Uw=$(`$ZodNonOptional`,(e,t)=>{xw.init(e,t),NC(e._zod,`values`,()=>{let e=t.innerType._zod.values;return e?new Set([...e].filter(e=>e!==void 0)):void 0}),e._zod.parse=(n,r)=>{let i=t.innerType._zod.run(n,r);return i instanceof Promise?i.then(t=>Ww(t,e)):Ww(i,e)}});function Ww(e,t){return!e.issues.length&&e.value===void 0&&e.issues.push({code:`invalid_type`,expected:`nonoptional`,input:e.value,inst:t}),e}var Gw=$(`$ZodCatch`,(e,t)=>{xw.init(e,t),e._zod.optin=`optional`,NC(e._zod,`optout`,()=>t.innerType._zod.optout),NC(e._zod,`values`,()=>t.innerType._zod.values),e._zod.parse=(e,n)=>{let r=t.innerType._zod.run(e,n);return r instanceof Promise?r.then(r=>(e.value=r.value,r.issues.length&&(e.value=t.catchValue({...e,error:{issues:r.issues.map(e=>ew(e,n,DC()))},input:e.value}),e.issues=[]),e)):(e.value=r.value,r.issues.length&&(e.value=t.catchValue({...e,error:{issues:r.issues.map(e=>ew(e,n,DC()))},input:e.value}),e.issues=[]),e)}}),Kw=$(`$ZodPipe`,(e,t)=>{xw.init(e,t),NC(e._zod,`values`,()=>t.in._zod.values),NC(e._zod,`optin`,()=>t.in._zod.optin),NC(e._zod,`optout`,()=>t.out._zod.optout),e._zod.parse=(e,n)=>{let r=t.in._zod.run(e,n);return r instanceof Promise?r.then(e=>qw(e,t,n)):qw(r,t,n)}});function qw(e,t,n){return ZC(e)?e:t.out._zod.run({value:e.value,issues:e.issues},n)}var Jw=$(`$ZodReadonly`,(e,t)=>{xw.init(e,t),NC(e._zod,`propValues`,()=>t.innerType._zod.propValues),NC(e._zod,`values`,()=>t.innerType._zod.values),NC(e._zod,`optin`,()=>t.innerType._zod.optin),NC(e._zod,`optout`,()=>t.innerType._zod.optout),e._zod.parse=(e,n)=>{let r=t.innerType._zod.run(e,n);return r instanceof Promise?r.then(Yw):Yw(r)}});function Yw(e){return e.value=Object.freeze(e.value),e}var Xw=$(`$ZodLazy`,(e,t)=>{xw.init(e,t),NC(e._zod,`innerType`,()=>t.getter()),NC(e._zod,`pattern`,()=>e._zod.innerType._zod.pattern),NC(e._zod,`propValues`,()=>e._zod.innerType._zod.propValues),NC(e._zod,`optin`,()=>e._zod.innerType._zod.optin),NC(e._zod,`optout`,()=>e._zod.innerType._zod.optout),e._zod.parse=(t,n)=>e._zod.innerType._zod.run(t,n)}),Zw=$(`$ZodCustom`,(e,t)=>{mw.init(e,t),xw.init(e,t),e._zod.parse=(e,t)=>e,e._zod.check=n=>{let r=n.value,i=t.fn(r);if(i instanceof Promise)return i.then(t=>Qw(t,n,r,e));Qw(i,n,r,e)}});function Qw(e,t,n,r){if(!e){let e={code:`custom`,input:n,inst:r,path:[...r._zod.def.path??[]],continue:!r._zod.def.abort};r._zod.def.params&&(e.params=r._zod.def.params),t.issues.push(nw(e))}}var $w=class{constructor(){this._map=new Map,this._idmap=new Map}add(e,...t){let n=t[0];if(this._map.set(e,n),n&&typeof n==`object`&&`id`in n){if(this._idmap.has(n.id))throw Error(`ID ${n.id} already exists in the registry`);this._idmap.set(n.id,e)}return this}clear(){return this._map=new Map,this._idmap=new Map,this}remove(e){let t=this._map.get(e);return t&&typeof t==`object`&&`id`in t&&this._idmap.delete(t.id),this._map.delete(e),this}get(e){let t=e._zod.parent;if(t){let n={...this.get(t)??{}};return delete n.id,{...n,...this._map.get(e)}}return this._map.get(e)}has(e){return this._map.has(e)}};function eT(){return new $w}var tT=eT();function nT(e){return new e({type:`unknown`})}function rT(e,t){return new e({type:`never`,...UC(t)})}function iT(e,t){return new hw({check:`max_length`,...UC(t),maximum:e})}function aT(e,t){return new gw({check:`min_length`,...UC(t),minimum:e})}function oT(e,t){return new _w({check:`length_equals`,...UC(t),length:e})}function sT(e){return new vw({check:`overwrite`,tx:e})}function cT(e,t,n){return new e({type:`array`,element:t,...UC(n)})}function lT(e,t,n){return new e({type:`custom`,check:`custom`,fn:t,...UC(n)})}var uT=(e,t)=>{iw.init(e,t),e.name=`ZodError`,Object.defineProperties(e,{format:{value:t=>sw(e,t)},flatten:{value:t=>ow(e,t)},addIssue:{value:t=>e.issues.push(t)},addIssues:{value:t=>e.issues.push(...t)},isEmpty:{get(){return e.issues.length===0}}})};$(`ZodError`,uT);var dT=$(`ZodError`,uT,{Parent:Error}),fT=cw(dT),pT=lw(dT),mT=uw(dT),hT=fw(dT),gT=$(`ZodType`,(e,t)=>(xw.init(e,t),e.def=t,Object.defineProperty(e,"_def",{value:t}),e.check=(...n)=>e.clone({...t,checks:[...t.checks??[],...n.map(e=>typeof e==`function`?{_zod:{check:e,def:{check:`custom`},onattach:[]}}:e)]}),e.clone=(t,n)=>HC(e,t,n),e.brand=()=>e,e.register=((t,n)=>(t.add(e,n),e)),e.parse=(t,n)=>fT(e,t,n,{callee:e.parse}),e.safeParse=(t,n)=>mT(e,t,n),e.parseAsync=async(t,n)=>pT(e,t,n,{callee:e.parseAsync}),e.safeParseAsync=async(t,n)=>hT(e,t,n),e.spa=e.safeParseAsync,e.refine=(t,n)=>e.check($T(t,n)),e.superRefine=t=>e.check(eE(t)),e.overwrite=t=>e.check(sT(t)),e.optional=()=>FT(e),e.nullable=()=>LT(e),e.nullish=()=>FT(LT(e)),e.nonoptional=t=>UT(e,t),e.array=()=>ST(e),e.or=t=>TT([e,t]),e.and=t=>DT(e,t),e.transform=t=>qT(e,NT(t)),e.default=t=>zT(e,t),e.prefault=t=>VT(e,t),e.catch=t=>GT(e,t),e.pipe=t=>qT(e,t),e.readonly=()=>YT(e),e.describe=t=>{let n=e.clone();return tT.add(n,{description:t}),n},Object.defineProperty(e,"description",{get(){return tT.get(e)?.description},configurable:!0}),e.meta=(...t)=>{if(t.length===0)return tT.get(e);let n=e.clone();return tT.add(n,t[0]),n},e.isOptional=()=>e.safeParse(void 0).success,e.isNullable=()=>e.safeParse(null).success,e)),_T=$(`ZodUnknown`,(e,t)=>{Sw.init(e,t),gT.init(e,t)});function vT(){return nT(_T)}var yT=$(`ZodNever`,(e,t)=>{Cw.init(e,t),gT.init(e,t)});function bT(e){return rT(yT,e)}var xT=$(`ZodArray`,(e,t)=>{Tw.init(e,t),gT.init(e,t),e.element=t.element,e.min=(t,n)=>e.check(aT(t,n)),e.nonempty=t=>e.check(aT(1,t)),e.max=(t,n)=>e.check(iT(t,n)),e.length=(t,n)=>e.check(oT(t,n)),e.unwrap=()=>e.element});function ST(e,t){return cT(xT,e,t)}var CT=$(`ZodObject`,(e,t)=>{Ow.init(e,t),gT.init(e,t),NC(e,`shape`,()=>t.shape),e.keyof=()=>AT(Object.keys(e._zod.def.shape)),e.catchall=t=>e.clone({...e._zod.def,catchall:t}),e.passthrough=()=>e.clone({...e._zod.def,catchall:vT()}),e.loose=()=>e.clone({...e._zod.def,catchall:vT()}),e.strict=()=>e.clone({...e._zod.def,catchall:bT()}),e.strip=()=>e.clone({...e._zod.def,catchall:void 0}),e.extend=t=>qC(e,t),e.merge=t=>JC(e,t),e.pick=t=>GC(e,t),e.omit=t=>KC(e,t),e.partial=(...t)=>YC(PT,e,t[0]),e.required=(...t)=>XC(HT,e,t[0])}),wT=$(`ZodUnion`,(e,t)=>{Aw.init(e,t),gT.init(e,t),e.options=t.options});function TT(e,t){return new wT({type:`union`,options:e,...UC(t)})}var ET=$(`ZodIntersection`,(e,t)=>{jw.init(e,t),gT.init(e,t)});function DT(e,t){return new ET({type:`intersection`,left:e,right:t})}var OT=$(`ZodRecord`,(e,t)=>{Pw.init(e,t),gT.init(e,t),e.keyType=t.keyType,e.valueType=t.valueType}),kT=$(`ZodEnum`,(e,t)=>{Fw.init(e,t),gT.init(e,t),e.enum=t.entries,e.options=Object.values(t.entries);let n=new Set(Object.keys(t.entries));e.extract=(e,r)=>{let i={};for(let r of e)if(n.has(r))i[r]=t.entries[r];else throw Error(`Key ${r} not found in enum`);return new kT({...t,checks:[],...UC(r),entries:i})},e.exclude=(e,r)=>{let i={...t.entries};for(let t of e)if(n.has(t))delete i[t];else throw Error(`Key ${t} not found in enum`);return new kT({...t,checks:[],...UC(r),entries:i})}});function AT(e,t){return new kT({type:`enum`,entries:Array.isArray(e)?Object.fromEntries(e.map(e=>[e,e])):e,...UC(t)})}var jT=$(`ZodLiteral`,(e,t)=>{Iw.init(e,t),gT.init(e,t),e.values=new Set(t.values),Object.defineProperty(e,"value",{get(){if(t.values.length>1)throw Error("This schema contains multiple valid literal values. Use `.values` instead.");return t.values[0]}})}),MT=$(`ZodTransform`,(e,t)=>{Lw.init(e,t),gT.init(e,t),e._zod.parse=(n,r)=>{n.addIssue=r=>{if(typeof r==`string`)n.issues.push(nw(r,n.value,t));else{let t=r;t.fatal&&(t.continue=!1),t.code??=`custom`,t.input??=n.value,t.inst??=e,t.continue??=!0,n.issues.push(nw(t))}};let i=t.transform(n.value,n);return i instanceof Promise?i.then(e=>(n.value=e,n)):(n.value=i,n)}});function NT(e){return new MT({type:`transform`,transform:e})}var PT=$(`ZodOptional`,(e,t)=>{Rw.init(e,t),gT.init(e,t),e.unwrap=()=>e._zod.def.innerType});function FT(e){return new PT({type:`optional`,innerType:e})}var IT=$(`ZodNullable`,(e,t)=>{zw.init(e,t),gT.init(e,t),e.unwrap=()=>e._zod.def.innerType});function LT(e){return new IT({type:`nullable`,innerType:e})}var RT=$(`ZodDefault`,(e,t)=>{Bw.init(e,t),gT.init(e,t),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap});function zT(e,t){return new RT({type:`default`,innerType:e,get defaultValue(){return typeof t==`function`?t():t}})}var BT=$(`ZodPrefault`,(e,t)=>{Hw.init(e,t),gT.init(e,t),e.unwrap=()=>e._zod.def.innerType});function VT(e,t){return new BT({type:`prefault`,innerType:e,get defaultValue(){return typeof t==`function`?t():t}})}var HT=$(`ZodNonOptional`,(e,t)=>{Uw.init(e,t),gT.init(e,t),e.unwrap=()=>e._zod.def.innerType});function UT(e,t){return new HT({type:`nonoptional`,innerType:e,...UC(t)})}var WT=$(`ZodCatch`,(e,t)=>{Gw.init(e,t),gT.init(e,t),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap});function GT(e,t){return new WT({type:`catch`,innerType:e,catchValue:typeof t==`function`?t:()=>t})}var KT=$(`ZodPipe`,(e,t)=>{Kw.init(e,t),gT.init(e,t),e.in=t.in,e.out=t.out});function qT(e,t){return new KT({type:`pipe`,in:e,out:t})}var JT=$(`ZodReadonly`,(e,t)=>{Jw.init(e,t),gT.init(e,t)});function YT(e){return new JT({type:`readonly`,innerType:e})}var XT=$(`ZodLazy`,(e,t)=>{Xw.init(e,t),gT.init(e,t),e.unwrap=()=>e._zod.def.getter()}),ZT=$(`ZodCustom`,(e,t)=>{Zw.init(e,t),gT.init(e,t)});function QT(e){let t=new mw({check:`custom`});return t._zod.check=e,t}function $T(e,t={}){return lT(ZT,e,t)}function eE(e){let t=QT(n=>(n.addIssue=e=>{if(typeof e==`string`)n.issues.push(nw(e,n.value,t._zod.def));else{let r=e;r.fatal&&(r.continue=!1),r.code??=`custom`,r.input??=n.value,r.inst??=t,r.continue??=!t._zod.def.abort,n.issues.push(nw(r))}},e(n.value,n)));return t}var tE=`@ag-ui/client`;function nE(e){if(!e.metadata||!Object.prototype.hasOwnProperty.call(e.metadata,tE))return;let t=e.metadata?.[tE];if(!t||typeof t!=`object`||Array.isArray(t))return[];if(!Object.prototype.hasOwnProperty.call(t,`authoritativeActivityTypes`))return;let n=t.authoritativeActivityTypes;return n===null?null:Array.isArray(n)&&n.every(e=>typeof e==`string`)?n:[]}var rE=e=>{if(typeof structuredClone==`function`)return structuredClone(e);try{return JSON.parse(JSON.stringify(e))}catch{return Array.isArray(e)?[...e]:{...e}}};function iE(){return Po()}function aE(e){return e instanceof TypeError&&/read[- ]?only|not extensible|cannot add property|cannot delete property|can't be deleted|unable to delete property|object is frozen|is not writable/i.test(e.message)}function oE(e){if(Object.freeze(e),typeof e==`object`&&e)for(let t of Object.values(e))typeof t==`object`&&t&&!Object.isFrozen(t)&&oE(t);return e}var sE=524288;function cE(e,t,n){let r=0,i=[e,t],a=new WeakSet;for(;i.length>0;){let e=i.pop();if(typeof e==`string`){if(r+=e.length,r>n)return!0}else if(typeof e==`object`&&e){if(a.has(e))continue;if(a.add(e),Array.isArray(e))for(let t=0;tn)return!0;i.push(e[o])}}}}return!1}async function lE(e,t,n,r){let i=typeof process<`u`&&!0,a=i&&!!{}.VITEST_WORKER_ID,o=i&&!!{}.VITEST_WORKER_ID,s=o&&!cE(t,n,sE),c=s?rE(t):t,l=s?rE(n):n,u=!1,d=!1,f;for(let t of e)try{s&&(oE(c),oE(l));let e=await r(t,c,l);if(e===void 0)continue;let n=!1;if(e.messages!==void 0&&e.messages!==c&&(c=rE(e.messages),u=!0,n=!0),e.state!==void 0&&e.state!==l&&(l=rE(e.state),d=!0,n=!0),s&&n&&cE(c,l,sE)&&(s=!1),f=e.stopPropagation,f===!0)break}catch(e){if(a&&e instanceof TypeError)throw e;s&&o&&aE(e)?console.error(`AG-UI: Subscriber attempted to mutate frozen inputs in-place. Return mutations via AgentStateMutation instead of mutating directly.`,e):console.error(`Subscriber error:`,e);continue}return{...u?{messages:Object.isFrozen(c)?rE(c):c}:{},...d?{state:Object.isFrozen(l)?rE(l):l}:{},...f===void 0?{}:{stopPropagation:f}}}function uE(e){if(!e)return{enabled:!1,events:!1,lifecycle:!1,verbose:!1};if(e===!0)return{enabled:!0,events:!0,lifecycle:!0,verbose:!0};let t=e.events??!0,n=e.lifecycle??!0,r=e.verbose??!1;return{enabled:t||n,events:t,lifecycle:n,verbose:r}}function dE(e){if(e instanceof fE)return e;if(e===!0)return new fE(uE(!0))}var fE=class{constructor(e){this.config=e}event(e,t,n,r){this.config.events&&(this.config.verbose?console.debug(`[${e}] ${t}`,typeof n==`string`?n:JSON.stringify(n)):console.debug(`[${e}] ${t}`,r??n))}lifecycle(e,t,n){this.config.lifecycle&&(n?console.debug(`[${e}] ${t}`,n):console.debug(`[${e}] ${t}`))}get eventsEnabled(){return this.config.events}get lifecycleEnabled(){return this.config.lifecycle}get enabled(){return this.config.enabled}};function pE(e){return e.enabled?new fE(e):void 0}function mE(e,t,n){if(t){let r=e.find(e=>e.id===t);if(r?.role===`assistant`)return r;r&&console.warn(`TOOL_CALL_START: parentMessageId '${t}' matches a '${r.role}' message, not assistant — falling back to toolCallId`);let i={id:r?n:t,role:`assistant`,toolCalls:[]};return e.push(i),i}let r={id:n,role:`assistant`,toolCalls:[]};return e.push(r),r}function hE(e,t){return!e||t.metadata===void 0?!1:(e.metadata=Bo(e.metadata,rE(t.metadata)),!0)}var gE=(e,t,n,r,i)=>{let a=dE(i),o=rE(n.messages),s=rE(e.state),c={},l=[],u=new Set,d=e=>{let t=e.outcome?.type===`success`?e.outcome.pendingToolCallIds:void 0;return t!==void 0&&t.length>0?[...t]:l.filter(e=>!u.has(e))},f=e=>{e.messages!==void 0&&(o=e.messages,c.messages=e.messages),e.state!==void 0&&(s=e.state,c.state=e.state)},p=()=>{let e=rE(c);return c={},e.messages!==void 0||e.state!==void 0?il(e):Tc};return t.pipe(hl(async t=>{let i=await lE(r,o,s,(r,i,a)=>r.onEvent?.({event:t,agent:n,input:e,messages:i,state:a}));if(f(i),i.stopPropagation===!0?a?.event(`APPLY`,`Event dropped:`,t,{type:t.type,reason:`stopPropagation by subscriber`}):a?.event(`APPLY`,`Event applied:`,t,{type:t.type,subscribers:r.length}),i.stopPropagation===!0)return p();switch(t.type){case A.TEXT_MESSAGE_START:{let i=await lE(r,o,s,(r,i,a)=>r.onTextMessageStartEvent?.({event:t,messages:i,state:a,agent:n,input:e}));if(f(i),i.stopPropagation!==!0){let{messageId:e,role:n=`assistant`,name:r,subagentRunId:i}=t,a=o.find(t=>t.id===e);if(a?.role===`activity`)return console.warn(`TEXT_MESSAGE_START: Message '${e}' is an activity message — message ids must be unique across activity and text messages`),p();let s=a;if(!s){let t={id:e,role:n,content:``,...r!==void 0&&{name:r},...i!=null&&{subagentRunId:i}};o.push(t),s=t}let c=hE(s,t);(!a||c)&&f({messages:o})}return p()}case A.TEXT_MESSAGE_CONTENT:{let{messageId:i,delta:a}=t,c=o.find(e=>e.id===i);if(!c)return console.warn(`TEXT_MESSAGE_CONTENT: No message found with ID '${i}'`),p();if(c.role===`activity`)return console.warn(`TEXT_MESSAGE_CONTENT: Message '${i}' is an activity message — message ids must be unique across activity and text messages`),p();let l=await lE(r,o,s,(r,i,a)=>r.onTextMessageContentEvent?.({event:t,messages:i,state:a,agent:n,input:e,textMessageBuffer:typeof c.content==`string`?c.content:``}));return f(l),l.stopPropagation!==!0&&(c.content=`${typeof c.content==`string`?c.content:``}${a}`,hE(c,t),f({messages:o})),p()}case A.TEXT_MESSAGE_END:{let{messageId:i}=t,a=o.find(e=>e.id===i);if(!a)return console.warn(`TEXT_MESSAGE_END: No message found with ID '${i}'`),p();if(a.role===`activity`)return console.warn(`TEXT_MESSAGE_END: Message '${i}' is an activity message — message ids must be unique across activity and text messages`),p();let c=await lE(r,o,s,(r,i,o)=>r.onTextMessageEndEvent?.({event:t,messages:i,state:o,agent:n,input:e,textMessageBuffer:typeof a.content==`string`?a.content:``}));return f(c),c.stopPropagation!==!0&&hE(a,t)&&f({messages:o}),await Promise.all(r.map(t=>{t.onNewMessage?.({message:a,messages:o,state:s,agent:n,input:e})})),p()}case A.TOOL_CALL_START:{let i=await lE(r,o,s,(r,i,a)=>r.onToolCallStartEvent?.({event:t,messages:i,state:a,agent:n,input:e}));if(f(i),i.stopPropagation!==!0){let{toolCallId:e,toolCallName:n,parentMessageId:r,subagentRunId:i}=t;l.includes(e)||l.push(e);let a=o.find(t=>t.toolCalls?.some(t=>t.id===e))?.toolCalls?.find(t=>t.id===e);if(a){let r=a.function.name!==n;return r&&(console.warn(`TOOL_CALL_START: tool call '${e}' already exists with name '${a.function.name}' — updating it to '${n}'`),a.function.name=n),(hE(a,t)||r)&&f({messages:o}),p()}let s=new Set(o.map(e=>e.id)),c=mE(o,r,e);!s.has(c.id)&&i!=null&&c.subagentRunId===void 0&&(c.subagentRunId=i),c.toolCalls??=[];let u={id:e,type:`function`,function:{name:n,arguments:``}};c.toolCalls.push(u),hE(u,t),f({messages:o})}return p()}case A.TOOL_CALL_ARGS:{let{toolCallId:i,delta:a}=t,c=o.find(e=>e.toolCalls?.some(e=>e.id===i));if(!c)return console.warn(`TOOL_CALL_ARGS: No message found containing tool call with ID '${i}'`),p();let l=c.toolCalls?.find(e=>e.id===i);if(!l)return console.warn(`TOOL_CALL_ARGS: No tool call found with ID '${i}'`),p();let u=await lE(r,o,s,(r,i,a)=>{let o=l.function.arguments,s=l.function.name,c={};try{c=wl(o)}catch{}return r.onToolCallArgsEvent?.({event:t,messages:i,state:a,agent:n,input:e,toolCallBuffer:o,toolCallName:s,partialToolCallArgs:c})});return f(u),u.stopPropagation!==!0&&(l.function.arguments+=a,hE(l,t),f({messages:o})),p()}case A.TOOL_CALL_END:{let{toolCallId:i}=t,a=o.find(e=>e.toolCalls?.some(e=>e.id===i));if(!a)return console.warn(`TOOL_CALL_END: No message found containing tool call with ID '${i}'`),p();let c=a.toolCalls?.find(e=>e.id===i);if(!c)return console.warn(`TOOL_CALL_END: No tool call found with ID '${i}'`),p();let l=await lE(r,o,s,(r,i,a)=>{let o=c.function.arguments,s=c.function.name,l={};try{l=JSON.parse(o)}catch{}return r.onToolCallEndEvent?.({event:t,messages:i,state:a,agent:n,input:e,toolCallName:s,toolCallArgs:l})});return f(l),l.stopPropagation!==!0&&hE(c,t)&&f({messages:o}),await Promise.all(r.map(t=>{t.onNewToolCall?.({toolCall:c,messages:o,state:s,agent:n,input:e})})),p()}case A.TOOL_CALL_RESULT:{let i=await lE(r,o,s,(r,i,a)=>r.onToolCallResultEvent?.({event:t,messages:i,state:a,agent:n,input:e}));if(f(i),i.stopPropagation!==!0){let{messageId:i,toolCallId:a,content:c,role:l,subagentRunId:d}=t;u.add(a);let p={id:i,toolCallId:a,role:l||`tool`,content:c,...d!=null&&{subagentRunId:d}};hE(p,t);let m=o.findIndex(e=>e.role===`assistant`&&e.toolCalls?.some(e=>e.id===a));if(m===-1)o.push(p);else{let e=m+1;for(;e{t.onNewMessage?.({message:p,messages:o,state:s,agent:n,input:e})})),f({messages:o})}return p()}case A.STATE_SNAPSHOT:{let i=await lE(r,o,s,(r,i,a)=>r.onStateSnapshotEvent?.({event:t,messages:i,state:a,agent:n,input:e}));if(f(i),i.stopPropagation!==!0){let{snapshot:e}=t;s=e,f({state:s})}return p()}case A.STATE_DELTA:{let i=await lE(r,o,s,(r,i,a)=>r.onStateDeltaEvent?.({event:t,messages:i,state:a,agent:n,input:e}));if(f(i),i.stopPropagation!==!0){let{delta:e}=t;try{s=Cs.applyPatch(s,e,!0,!1).newDocument,f({state:s})}catch(t){let n=t instanceof Error?t.message:String(t);console.warn(`Failed to apply state patch:\nCurrent state: ${JSON.stringify(s,null,2)}\nPatch operations: ${JSON.stringify(e,null,2)}\nError: ${n}`)}}return p()}case A.MESSAGES_SNAPSHOT:{let i=await lE(r,o,s,(r,i,a)=>r.onMessagesSnapshotEvent?.({event:t,messages:i,state:a,agent:n,input:e}));if(f(i),i.stopPropagation!==!0){let{messages:e}=t,n=e.map(e=>{if(e.subagentRunId!==null)return e;let t={...e};return delete t.subagentRunId,t}),r=new Map(n.map(e=>[e.id,e])),i=nE(t),a=n.some(e=>e.role===`activity`),s=n.some(e=>e.role===`reasoning`),c=e=>e.role===`activity`&&(i?!i.includes(e.activityType):i!==null&&!a)||e.role===`reasoning`&&!s;o=o.filter(e=>r.has(e.id)||c(e)).map(e=>r.get(e.id)??e);let l=new Set(o.map(e=>e.id));for(let e of n)l.has(e.id)||o.push(e);f({messages:o})}return p()}case A.ACTIVITY_SNAPSHOT:{let i=t,a=o.findIndex(e=>e.id===i.messageId),c=a>=0?o[a]:void 0,l=c?.role===`activity`?c:void 0,u=i.replace??!0,d=await lE(r,o,s,(t,r,a)=>t.onActivitySnapshotEvent?.({event:i,messages:r,state:a,agent:n,input:e,activityMessage:l,existingMessage:c}));if(f(d),d.stopPropagation!==!0){let t={id:i.messageId,role:`activity`,activityType:i.activityType,content:rE(i.content),...i.subagentRunId!=null&&{subagentRunId:i.subagentRunId}},c,d;a===-1?(o.push(t),c=t,d=t):l?(u&&(o[a]={...l,activityType:i.activityType,content:rE(i.content),subagentRunId:i.subagentRunId},i.subagentRunId??delete o[a].subagentRunId),d=o[a]):u&&(o[a]=t,c=t,d=t),hE(d,i),f({messages:o}),c&&await Promise.all(r.map(t=>t.onNewMessage?.({message:c,messages:o,state:s,agent:n,input:e})))}return p()}case A.ACTIVITY_DELTA:{let i=t,a=o.findIndex(e=>e.id===i.messageId);if(a===-1)return p();let c=o[a];if(c.role!==`activity`)return console.warn(`ACTIVITY_DELTA: Message '${i.messageId}' is not an activity message`),p();let l=c,u=await lE(r,o,s,(t,r,a)=>t.onActivityDeltaEvent?.({event:i,messages:r,state:a,agent:n,input:e,activityMessage:l}));if(f(u),u.stopPropagation!==!0)try{hE(l,i)&&f({messages:o});let e=rE(l.content??{}),t=Cs.applyPatch(e,i.patch??[],!0,!1).newDocument;o[a]={...l,content:rE(t),activityType:i.activityType},f({messages:o})}catch(e){let t=e instanceof Error?e.message:String(e);console.warn(`Failed to apply activity patch for '${i.messageId}': ${t}`)}return p()}case A.RAW:return f(await lE(r,o,s,(r,i,a)=>r.onRawEvent?.({event:t,messages:i,state:a,agent:n,input:e}))),p();case A.CUSTOM:return f(await lE(r,o,s,(r,i,a)=>r.onCustomEvent?.({event:t,messages:i,state:a,agent:n,input:e}))),p();case A.RUN_STARTED:{let i=await lE(r,o,s,(r,i,a)=>r.onRunStartedEvent?.({event:t,messages:i,state:a,agent:n,input:e}));if(f(i),l=[],u=new Set,i.stopPropagation!==!0){let e=t;if(e.input?.messages){for(let t of e.input.messages){let e=t;if(t.subagentRunId===null){let n={...t};delete n.subagentRunId,e=n}o.find(t=>t.id===e.id)||o.push(e)}f({messages:o})}}return p()}case A.RUN_FINISHED:{let i=t,a=i.outcome?.type===`interrupt`?{event:i,outcome:`interrupt`,interrupts:i.outcome.interrupts}:i.outcome?.type===`cancelled`?{event:i,outcome:`cancelled`}:{event:i,outcome:`success`,result:i.result,pendingToolCallIds:d(i)},c=await lE(r,o,s,(t,r,i)=>t.onRunFinishedEvent?.({...a,messages:r,state:i,agent:n,input:e}));return f(c),c.stopPropagation!==!0&&(n.pendingInterrupts=a.outcome===`interrupt`?a.interrupts.map(e=>{if(e.subagentRunId!==null)return e;let t={...e};return delete t.subagentRunId,t}):[]),p()}case A.RUN_ERROR:return f(await lE(r,o,s,(r,i,a)=>r.onRunErrorEvent?.({event:t,messages:i,state:a,agent:n,input:e}))),p();case A.STEP_STARTED:return f(await lE(r,o,s,(r,i,a)=>r.onStepStartedEvent?.({event:t,messages:i,state:a,agent:n,input:e}))),p();case A.STEP_FINISHED:return f(await lE(r,o,s,(r,i,a)=>r.onStepFinishedEvent?.({event:t,messages:i,state:a,agent:n,input:e}))),p();case A.TEXT_MESSAGE_CHUNK:throw Error(`TEXT_MESSAGE_CHUNK must be transformed before being applied`);case A.TOOL_CALL_CHUNK:throw Error(`TOOL_CALL_CHUNK must be transformed before being applied`);case A.REASONING_START:return f(await lE(r,o,s,(r,i,a)=>r.onReasoningStartEvent?.({event:t,messages:i,state:a,agent:n,input:e}))),p();case A.REASONING_MESSAGE_START:{let i=await lE(r,o,s,(r,i,a)=>r.onReasoningMessageStartEvent?.({event:t,messages:i,state:a,agent:n,input:e}));if(f(i),i.stopPropagation!==!0){let{messageId:e,subagentRunId:n}=t,r=o.find(t=>t.id===e);if(r?.role===`activity`)return console.warn(`REASONING_MESSAGE_START: Message '${e}' is an activity message — message ids must be unique across activity and reasoning messages`),p();let i=r;if(!i){let t={id:e,role:`reasoning`,content:``,...n!=null&&{subagentRunId:n}};o.push(t),i=t}let a=hE(i,t);(!r||a)&&f({messages:o})}return p()}case A.REASONING_MESSAGE_CONTENT:{let{messageId:i,delta:a}=t,c=o.find(e=>e.id===i);if(!c)return console.warn(`REASONING_MESSAGE_CONTENT: No message found with ID '${i}'`),p();if(c.role===`activity`)return console.warn(`REASONING_MESSAGE_CONTENT: Message '${i}' is an activity message — message ids must be unique across activity and reasoning messages`),p();let l=await lE(r,o,s,(r,i,a)=>r.onReasoningMessageContentEvent?.({event:t,messages:i,state:a,agent:n,input:e,reasoningMessageBuffer:typeof c.content==`string`?c.content:``}));return f(l),l.stopPropagation!==!0&&(c.content=`${typeof c.content==`string`?c.content:``}${a}`,hE(c,t),f({messages:o})),p()}case A.REASONING_MESSAGE_END:{let{messageId:i}=t,a=o.find(e=>e.id===i);if(!a)return console.warn(`REASONING_MESSAGE_END: No message found with ID '${i}'`),p();if(a.role===`activity`)return console.warn(`REASONING_MESSAGE_END: Message '${i}' is an activity message — message ids must be unique across activity and reasoning messages`),p();let c=await lE(r,o,s,(r,i,o)=>r.onReasoningMessageEndEvent?.({event:t,messages:i,state:o,agent:n,input:e,reasoningMessageBuffer:typeof a.content==`string`?a.content:``}));return f(c),c.stopPropagation!==!0&&hE(a,t)&&f({messages:o}),await Promise.all(r.map(t=>{t.onNewMessage?.({message:a,messages:o,state:s,agent:n,input:e})})),p()}case A.REASONING_MESSAGE_CHUNK:throw Error(`REASONING_MESSAGE_CHUNK must be transformed before being applied`);case A.REASONING_END:return f(await lE(r,o,s,(r,i,a)=>r.onReasoningEndEvent?.({event:t,messages:i,state:a,agent:n,input:e}))),p();case A.REASONING_ENCRYPTED_VALUE:{let{subtype:i,entityId:a,encryptedValue:l}=t,u=await lE(r,o,s,(r,i,a)=>r.onReasoningEncryptedValueEvent?.({event:t,messages:i,state:a,agent:n,input:e}));if(f(u),u.stopPropagation!==!0){let e=!1;if(i===`tool-call`){for(let t of o)if(t.role===`assistant`&&t.toolCalls){let n=t.toolCalls.find(e=>e.id===a);if(n){n.encryptedValue=l,e=!0;break}}}else{let t=o.find(e=>e.id===a);t?.role!==`activity`&&t&&(t.encryptedValue=l,e=!0)}e&&(c.messages=o)}return p()}case A.SUBAGENT_STARTED:return f(await lE(r,o,s,(r,i,a)=>r.onSubagentStartedEvent?.({event:t,messages:i,state:a,agent:n,input:e}))),p();case A.SUBAGENT_FINISHED:return f(await lE(r,o,s,(r,i,a)=>r.onSubagentFinishedEvent?.({event:t,messages:i,state:a,agent:n,input:e}))),p();case A.SUBAGENT_ERROR:return f(await lE(r,o,s,(r,i,a)=>r.onSubagentErrorEvent?.({event:t,messages:i,state:a,agent:n,input:e}))),p()}return t.type,p()}),ul(),r.length>0?vl({}):e=>e)};function _E(e,t){typeof process<`u`&&{}.SUPPRESS_TRANSFORMATION_WARNINGS||console.warn(`[ag-ui][compat] Converting deprecated ${e} to ${t}. The old shape leaves the protocol after its shim window — see the repo-root DEPRECATIONS.md. Set SUPPRESS_TRANSFORMATION_WARNINGS=true to silence.`)}var vE=e=>t=>{let n=dE(e),r=new Set,i=new Set,a=new Set,o=new Set,s={message:new Map,toolCall:new Map,activity:new Map,reasoning:new Map},c=!1,l=!1,u=!1,d=new Map,f=e=>{let t=d.get(e);return t||(t=new Map,d.set(e,t)),t},p=()=>{for(let e of d.values())if(e.size>0)return!0;return!1},m=new Map,h=new Set,g=!1,_=!1,v=()=>{_=!1,r.clear(),i.clear(),a.clear(),o.clear(),s.message.clear(),s.toolCall.clear(),s.activity.clear(),s.reasoning.clear(),d.clear(),m.clear(),h.clear(),c=!1,l=!1,g=!0},y=(e,t)=>{let n=e??[];if(Array.isArray(n))for(let e of n){if(!e||typeof e.id!=`string`)continue;if(e.subagentRunId===null)return new j(`Cannot send a message (id '${e.id}') with 'subagentRunId: null'. The field is optional — omit it entirely.`);let n=e.role===`reasoning`?s.reasoning:e.role===`activity`?s.activity:s.message;(t||!n.has(e.id))&&n.set(e.id,{subagentRunId:e.subagentRunId});for(let n of e.toolCalls??[])n&&typeof n.id==`string`&&(t||!s.toolCall.has(n.id))&&s.toolCall.set(n.id,{subagentRunId:e.subagentRunId??void 0})}},b=(e,t,n,r,i)=>{if(t!==void 0&&n&&n.subagentRunId!==t)return new j(`Cannot send '${e}': subagentRunId '${t}' does not match the ${r} '${i}' opener's subagent '${n.subagentRunId??`(the parent agent)`}'.`)};return t.pipe(ll(e=>{let t=e.type;if(n?.event(`VERIFY`,`Event:`,e,{type:e.type}),l&&t!==A.RUN_STARTED)return N(()=>new j(`Cannot send event type '${t}': The run has already errored with 'RUN_ERROR'. No further events can be sent.`));if(c&&t!==A.RUN_ERROR&&t!==A.RUN_STARTED)return N(()=>new j(`Cannot send event type '${t}': The run has already finished with 'RUN_FINISHED'. Start a new run with 'RUN_STARTED'.`));if(!u){if(u=!0,t!==A.RUN_STARTED&&t!==A.RUN_ERROR)return N(()=>new j(`First event must be 'RUN_STARTED'`))}else if(t===A.RUN_STARTED){if(g&&!c&&!l)return N(()=>new j(`Cannot send 'RUN_STARTED' while a run is still active. The previous run must be finished with 'RUN_FINISHED' before starting a new run.`));(c||l)&&v()}if(e.subagentRunId===null){_||(_=!0,_E(`subagentRunId: null`,`an absent field`));let{subagentRunId:t,...n}=e;e=n}if(t===A.SUBAGENT_STARTED||t===A.SUBAGENT_FINISHED||t===A.SUBAGENT_ERROR){let n=t===A.SUBAGENT_STARTED?[`description`,`parentSubagentRunId`,`parentToolCallId`,`parentMessageId`]:t===A.SUBAGENT_FINISHED?[`outcome`]:[`code`];for(let r of n)if(e[r]===null)return N(()=>new j(`Cannot send '${t}' with '${r}: null'. The field is optional — omit it entirely.`));let r=e.outcome;if(r!=null&&r.type!==`success`&&r.type!==`suspended`)return N(()=>new j(`Cannot send '${t}' with outcome type '${String(r.type)}'. The outcome is either { type: "success" } or { type: "suspended" }.`));if(r&&r.interruptIds===null)return N(()=>new j(`Cannot send '${t}' with 'outcome.interruptIds: null'. The field is optional — omit it entirely.`));if(r&&Array.isArray(r.interruptIds)&&r.interruptIds.some(e=>typeof e!=`string`))return N(()=>new j(`Cannot send '${t}' with a non-string entry in 'outcome.interruptIds'. Interrupt ids are strings.`))}if(t===A.RUN_FINISHED){let t=e.outcome;if(t?.type===`interrupt`&&Array.isArray(t.interrupts)){for(let e of t.interrupts)if(e&&e.subagentRunId===null)return N(()=>new j(`Cannot send 'RUN_FINISHED' with an interrupt (id '${e.id}') carrying 'subagentRunId: null'. The field is optional — omit it entirely.`))}}switch(t){case A.TEXT_MESSAGE_START:{let n=e.messageId;if(r.has(n))return N(()=>new j(`Cannot send 'TEXT_MESSAGE_START' event: A text message with ID '${n}' is already in progress. Complete it with 'TEXT_MESSAGE_END' first.`));let i=s.message.get(n);if(i){let r=b(t,e.subagentRunId,i,`message`,n);if(r)return N(()=>r)}return r.add(n),i||s.message.set(n,{subagentRunId:e.subagentRunId}),il(e)}case A.TEXT_MESSAGE_CONTENT:{let n=e.messageId;if(!r.has(n))return N(()=>new j(`Cannot send 'TEXT_MESSAGE_CONTENT' event: No active text message found with ID '${n}'. Start a text message with 'TEXT_MESSAGE_START' first.`));let i=b(t,e.subagentRunId,s.message.get(n),`message`,n);return i?N(()=>i):il(e)}case A.TEXT_MESSAGE_END:{let n=e.messageId;if(!r.has(n))return N(()=>new j(`Cannot send 'TEXT_MESSAGE_END' event: No active text message found with ID '${n}'. A 'TEXT_MESSAGE_START' event must be sent first.`));let i=b(t,e.subagentRunId,s.message.get(n),`message`,n);return i?N(()=>i):(r.delete(n),il(e))}case A.TOOL_CALL_START:{let n=e.toolCallId;if(i.has(n))return N(()=>new j(`Cannot send 'TOOL_CALL_START' event: A tool call with ID '${n}' is already in progress. Complete it with 'TOOL_CALL_END' first.`));let r=e.parentMessageId,a=e.subagentRunId,o;if(r!==void 0){let e=s.message.get(r);if(e){if(a!==void 0&&a!==e.subagentRunId)return N(()=>new j(`Cannot send 'TOOL_CALL_START': subagentRunId '${a}' does not match its parent message '${r}' owner '${e.subagentRunId??`(the parent agent)`}'. A tool call belongs to the message that carries it.`));o=e}}let c=s.toolCall.get(n);if(c){let e=b(t,a,c,`tool call`,n);if(e)return N(()=>e);if(a===void 0&&o&&o.subagentRunId!==c.subagentRunId)return N(()=>new j(`Cannot send 'TOOL_CALL_START': tool call '${n}' is owned by '${c.subagentRunId??`(the parent agent)`}' but its parent message '${r}' is owned by '${o.subagentRunId??`(the parent agent)`}'. A tool call belongs to the message that carries it.`))}return i.add(n),c||s.toolCall.set(n,a===void 0?o??{subagentRunId:void 0}:{subagentRunId:a}),il(e)}case A.TOOL_CALL_ARGS:{let n=e.toolCallId;if(!i.has(n))return N(()=>new j(`Cannot send 'TOOL_CALL_ARGS' event: No active tool call found with ID '${n}'. Start a tool call with 'TOOL_CALL_START' first.`));let r=b(t,e.subagentRunId,s.toolCall.get(n),`tool call`,n);return r?N(()=>r):il(e)}case A.TOOL_CALL_END:{let n=e.toolCallId;if(!i.has(n))return N(()=>new j(`Cannot send 'TOOL_CALL_END' event: No active tool call found with ID '${n}'. A 'TOOL_CALL_START' event must be sent first.`));let r=b(t,e.subagentRunId,s.toolCall.get(n),`tool call`,n);return r?N(()=>r):(i.delete(n),il(e))}case A.STEP_STARTED:{let t=e.stepName,n=e.subagentRunId;return f(n).has(t)?N(()=>new j(`Step "${t}" is already active for 'STEP_STARTED'${n===void 0?``:` in subagent '${n}'`}`)):(f(n).set(t,!0),il(e))}case A.STEP_FINISHED:{let t=e.stepName,n=e.subagentRunId;if(!f(n).has(t)){let e,r=!1;for(let[i,a]of d)if(i!==n&&a.has(t)){e=i,r=!0;break}return N(r?()=>new j(`Cannot send 'STEP_FINISHED' for step "${t}" attributed to ${n===void 0?`the parent agent`:`subagent '${n}'`}: that step is open under ${e===void 0?`the parent agent`:`subagent '${e}'`}. A step must be finished by whoever started it.`):()=>new j(`Cannot send 'STEP_FINISHED' for step "${t}" that was not started`))}return f(n).delete(t),il(e)}case A.ACTIVITY_SNAPSHOT:{let t=e.messageId;return(!s.activity.has(t)||e.replace!==!1)&&s.activity.set(t,{subagentRunId:e.subagentRunId}),il(e)}case A.TOOL_CALL_RESULT:{let t=e.messageId;return typeof t==`string`&&s.message.set(t,{subagentRunId:e.subagentRunId}),il(e)}case A.REASONING_START:case A.REASONING_MESSAGE_START:{let n=e.messageId,r=t===A.REASONING_START,i=r?a:o;if(i.has(n))return N(()=>new j(r?`Cannot send 'REASONING_START' event: A reasoning span with ID '${n}' is already in progress. Complete it with 'REASONING_END' first.`:`Cannot send 'REASONING_MESSAGE_START' event: A reasoning message with ID '${n}' is already in progress. Complete it with 'REASONING_MESSAGE_END' first.`));let c=s.reasoning.get(n);if(c){let r=b(t,e.subagentRunId,c,`reasoning message`,n);if(r)return N(()=>r)}return i.add(n),c||s.reasoning.set(n,{subagentRunId:e.subagentRunId}),il(e)}case A.REASONING_MESSAGE_CONTENT:case A.REASONING_MESSAGE_END:case A.REASONING_END:{let n=e.messageId,r=t===A.REASONING_END,i=r?a:o;if(!i.has(n))return N(()=>new j(r?`Cannot send 'REASONING_END' event: No active reasoning span found with ID '${n}'. A 'REASONING_START' event must be sent first.`:`Cannot send '${t}' event: No active reasoning message found with ID '${n}'. Start a reasoning message with 'REASONING_MESSAGE_START' first.`));let c=b(t,e.subagentRunId,s.reasoning.get(n),`reasoning message`,n);return c?N(()=>c):((t===A.REASONING_END||t===A.REASONING_MESSAGE_END)&&i.delete(n),il(e))}case A.REASONING_ENCRYPTED_VALUE:{let n=e.entityId,r=e.subtype,i=r===`tool-call`?s.toolCall.get(n):r===`message`?s.message.get(n)??s.reasoning.get(n):s.reasoning.get(n),a=r===`tool-call`?`tool call`:r===`message`?`message`:`reasoning message`,o=b(t,e.subagentRunId,i,a,n);return o?N(()=>o):il(e)}case A.ACTIVITY_DELTA:{let n=e.messageId,r=b(t,e.subagentRunId,s.activity.get(n),`activity`,n);return r?N(()=>r):il(e)}case A.SUBAGENT_STARTED:{if(typeof e.subagentRunId!=`string`)return N(()=>new j(`Cannot send 'SUBAGENT_STARTED' without a 'subagentRunId'.`));if(typeof e.name!=`string`)return N(()=>new j(`Cannot send 'SUBAGENT_STARTED' without a 'name'.`));let t=e.subagentRunId,n=e.parentSubagentRunId;return m.has(t)?N(()=>new j(`Cannot send 'SUBAGENT_STARTED': subagent '${t}' is already active. Finish it with 'SUBAGENT_FINISHED' first.`)):h.has(t)?N(()=>new j(`Cannot send 'SUBAGENT_STARTED': subagent '${t}' has already finished in this run. Subagent IDs are per-invocation and cannot be reused.`)):n!==void 0&&!m.has(n)&&!h.has(n)?N(()=>new j(`Cannot send 'SUBAGENT_STARTED': parentSubagentRunId '${n}' has not been started in this run.`)):(m.set(t,!0),il(e))}case A.SUBAGENT_FINISHED:case A.SUBAGENT_ERROR:{if(typeof e.subagentRunId!=`string`)return N(()=>new j(`Cannot send '${t}' without a 'subagentRunId'.`));if(t===A.SUBAGENT_ERROR&&typeof e.message!=`string`)return N(()=>new j(`Cannot send 'SUBAGENT_ERROR' without a 'message'.`));let n=e.subagentRunId;return m.has(n)?(m.delete(n),h.add(n),il(e)):N(()=>new j(`Cannot send '${t}': no active subagent found with ID '${n}'. A 'SUBAGENT_STARTED' event must be sent first.`))}case A.MESSAGES_SNAPSHOT:{let t=y(e.messages,!0);if(t)return N(()=>t)}return il(e);case A.RUN_STARTED:g=!0;{let t=y((e.input??{}).messages,!1);if(t)return N(()=>t)}return il(e);case A.RUN_FINISHED:if(p()){let e=[];for(let[t,n]of d)for(let r of n.keys())e.push(t===void 0?r:`${r} (subagent '${t}')`);let t=e.join(`, `);return N(()=>new j(`Cannot send 'RUN_FINISHED' while steps are still active: ${t}`))}if(r.size>0){let e=Array.from(r.keys()).join(`, `);return N(()=>new j(`Cannot send 'RUN_FINISHED' while text messages are still active: ${e}`))}if(o.size>0){let e=Array.from(o.keys()).join(`, `);return N(()=>new j(`Cannot send 'RUN_FINISHED' while reasoning messages are still active: ${e}`))}if(a.size>0){let e=Array.from(a.keys()).join(`, `);return N(()=>new j(`Cannot send 'RUN_FINISHED' while reasoning spans are still active: ${e}`))}if(i.size>0){let e=Array.from(i.keys()).join(`, `);return N(()=>new j(`Cannot send 'RUN_FINISHED' while tool calls are still active: ${e}`))}if(m.size>0){let e=Array.from(m.keys()).join(`, `);return N(()=>new j(`Cannot send 'RUN_FINISHED' while subagents are still active: ${e}`))}return c=!0,il(e);case A.RUN_ERROR:return l=!0,il(e);case A.CUSTOM:return il(e);default:return il(e)}}))},yE=function(e){return e.HEADERS=`headers`,e.DATA=`data`,e}({}),bE=e=>fl(()=>rl(e())).pipe(bl(e=>{if(!e.ok){let t=e.headers.get(`content-type`)||``;return rl(e.text()).pipe(ll(n=>{let r=n;if(t.includes(`application/json`))try{r=JSON.parse(n)}catch{}let i=Error(`HTTP ${e.status}: ${typeof r==`string`?r:JSON.stringify(r)}`);return i.status=e.status,i.payload=r,N(()=>i)}))}let t={type:yE.HEADERS,status:e.status,headers:e.headers},n=e.body?.getReader();return n?new fc(e=>{let r=!1;return e.next(t),(async()=>{try{for(;!e.closed;){let{done:t,value:i}=await n.read();if(t){r=!0;break}let a={type:yE.DATA,data:i};e.next(a)}e.complete()}catch(t){r=!0,e.error(t)}})(),()=>{r||n.cancel().catch(e=>{e?.name!==`AbortError`&&console.warn(`Failed to cancel HTTP response stream:`,e)})}}):N(()=>Error(`Failed to getReader() from response`))})),xE=10485760,SE=(e,t)=>{let n=dE(t),r=new xc,i=new TextDecoder(`utf-8`,{fatal:!1}),a=``;e.subscribe({next:e=>{if(e.type!==yE.HEADERS&&e.type===yE.DATA&&e.data){let t=i.decode(e.data,{stream:!0});a+=t;let n=a.split(/\n\n/);a=n.pop()||``;for(let e of n)o(e);if(a.length>xE){r.error(Error(`SSE buffer size exceeded maximum limit of ${xE/1048576} MB`));return}}},error:e=>r.error(e),complete:()=>{a&&(a+=i.decode(),o(a)),r.complete()}});function o(e){let t=e.split(` -`),i=[];for(let e of t)e.startsWith(`data:`)&&i.push(e.slice(5).replace(/^ /,``));if(i.length>0)try{let e=i.join(` -`),t=JSON.parse(e);n?.event(`SSE`,`Event received:`,t,{type:t?.type}),r.next(t)}catch(e){r.error(e)}}return r.asObservable()},CE=10485760,wE=()=>typeof process<`u`&&!!{}.SUPPRESS_TRANSFORMATION_WARNINGS,TE=(e,t)=>{let n=dE(t),r=new xc,i=new Uint8Array,a=!1;e.subscribe({next:e=>{if(e.type!==yE.HEADERS&&e.type===yE.DATA&&e.data){let t=new Uint8Array(i.length+e.data.length);t.set(i,0),t.set(e.data,i.length),i=t,o()}},error:e=>r.error(e),complete:()=>{if(o(),!a){if(i.length>0){r.error(Error(`The binary stream ended mid-frame: ${i.length} trailing bytes could not be read as a complete message.`));return}r.complete()}}});function o(){if(!a)for(;i.length>=4;){let e=4+new DataView(i.buffer,i.byteOffset,4).getUint32(0,!1);if(e>CE){r.error(Error(`Protobuf message size exceeded maximum limit of ${CE/1048576} MB`));return}if(i.length{let n=dE(t),r=new xc,i=new wc(1),a=!1,o,s=!1,c=()=>{s=!0,o?.unsubscribe()},l=e=>{c(),r.error(e)},u=()=>{c(),r.complete()};return o=e.subscribe({next:e=>{if(i.next(e),e.type===yE.HEADERS&&!a){a=!0;let t=e.headers.get(`content-type`);n?.lifecycle(`HTTP`,`Stream format detected:`,{contentType:t,parser:t===`application/vnd.ag-ui.event+proto`?`protobuf`:`sse`}),t===`application/vnd.ag-ui.event+proto`?TE(i,n).subscribe({next:e=>r.next(e),error:e=>l(e),complete:()=>u()}):SE(i,n).subscribe({next:e=>{if(typeof e!=`object`||!e||Array.isArray(e)){let t=Error(`Invalid event: the frame is not a JSON object.`);n?.event(`HTTP`,`Event invalid:`,{json:e,error:String(t)}),l(t);return}let t=e;if(typeof t.type!=`string`||t.type.length===0){let t=Error(`Invalid event: the frame carries no event type.`);n?.event(`HTTP`,`Event invalid:`,{json:e,error:String(t)}),l(t);return}n?.event(`HTTP`,`Event received:`,e,{type:t.type}),r.next(e)},error:e=>{if(e?.name===`AbortError`){r.next({type:A.RUN_ERROR,message:e.message||`Request aborted`,code:`abort`,rawEvent:e}),u();return}return l(e)},complete:()=>u()})}else a||l(Error(`No headers event received before data events`))},error:e=>{i.error(e),l(e)},complete:()=>{i.complete()}}),s&&o.unsubscribe(),r.asObservable()},DE={TextMessageStart:`TextMessageStart`,TextMessageContent:`TextMessageContent`,TextMessageEnd:`TextMessageEnd`,ActionExecutionStart:`ActionExecutionStart`,ActionExecutionArgs:`ActionExecutionArgs`,ActionExecutionEnd:`ActionExecutionEnd`,ActionExecutionResult:`ActionExecutionResult`,AgentStateMessage:`AgentStateMessage`,MetaEvent:`MetaEvent`,RunStarted:`RunStarted`,RunFinished:`RunFinished`,RunError:`RunError`,NodeStarted:`NodeStarted`,NodeFinished:`NodeFinished`},OE=e=>{if(typeof e==`string`)return e;if(!Array.isArray(e))return;let t=e.filter(e=>e.type===`text`).map(e=>e.text).filter(e=>e.length>0);if(t.length!==0)return t.join(` -`)};function kE(e,t){return Ho(t)&&AE(`[ag-ui][legacy] The result of tool call '${e}' carries content parts the legacy protocol cannot represent; only its text parts are bridged and the rest is dropped.`),Vo(t)}var AE=e=>{typeof process<`u`&&{}.SUPPRESS_TRANSFORMATION_WARNINGS||console.warn(e)},jE=(e,t,n)=>r=>{let i={},a=!0,o=!0,s=``,c=null,l=null,u=[],d={},f=!1,p=e=>{typeof e==`object`&&e&&(`messages`in e&&delete e.messages,i=e)};return r.pipe(ll(r=>{switch(r.type){case A.TEXT_MESSAGE_START:{let e=r;return[{type:DE.TextMessageStart,messageId:e.messageId,role:e.role}]}case A.TEXT_MESSAGE_CONTENT:{let e=r;return[{type:DE.TextMessageContent,messageId:e.messageId,content:e.delta}]}case A.TEXT_MESSAGE_END:{let e=r;return[{type:DE.TextMessageEnd,messageId:e.messageId}]}case A.TOOL_CALL_START:{let e=r;return u.push({id:e.toolCallId,type:`function`,function:{name:e.toolCallName,arguments:``}}),o=!0,d[e.toolCallId]=e.toolCallName,[{type:DE.ActionExecutionStart,actionExecutionId:e.toolCallId,actionName:e.toolCallName,parentMessageId:e.parentMessageId}]}case A.TOOL_CALL_ARGS:{let c=r,d=u.find(e=>e.id===c.toolCallId);if(!d)return AE(`[ag-ui][legacy] TOOL_CALL_ARGS: No tool call found with ID '${c.toolCallId}'`),[];d.function.arguments+=c.delta;let f=!1;if(l){let e=l.find(e=>e.tool==d.function.name);if(e)try{let t=JSON.parse(wl(d.function.arguments));e.tool_argument&&e.tool_argument in t?(p({...i,[e.state_key]:t[e.tool_argument]}),f=!0):e.tool_argument||(p({...i,[e.state_key]:t}),f=!0)}catch{}}return[{type:DE.ActionExecutionArgs,actionExecutionId:c.toolCallId,args:c.delta},...f?[{type:DE.AgentStateMessage,threadId:e,agentName:n,nodeName:s,runId:t,running:a,role:`assistant`,state:JSON.stringify(i),active:o}]:[]]}case A.TOOL_CALL_END:{let e=r;return[{type:DE.ActionExecutionEnd,actionExecutionId:e.toolCallId}]}case A.TOOL_CALL_RESULT:{let e=r,t=d[e.toolCallId];return(t===void 0||t===``)&&AE(`[ag-ui][legacy] No usable tool name was seen for tool call '${e.toolCallId}' (${t===void 0?`no TOOL_CALL_START reached this bridge`:`its TOOL_CALL_START carried an empty toolCallName`}), so its result is being bridged with the fabricated action name "unknown". Downstream consumers route on that name.`),[{type:DE.ActionExecutionResult,actionExecutionId:e.toolCallId,result:kE(e.toolCallId,e.content),actionName:t||`unknown`}]}case A.RAW:return f||(f=!0,AE(`[ag-ui][legacy] Dropping RAW events: the legacy runtime protocol has no equivalent, so the provider payloads they carry do not reach the legacy stream. Reported once per stream.`)),[];case A.CUSTOM:{let e=r;switch(e.name){case`Exit`:a=!1;break;case`PredictState`:l=e.value}return[{type:DE.MetaEvent,name:e.name,value:e.value}]}case A.STATE_SNAPSHOT:return p(r.snapshot),[{type:DE.AgentStateMessage,threadId:e,agentName:n,nodeName:s,runId:t,running:a,role:`assistant`,state:JSON.stringify(i),active:o}];case A.STATE_DELTA:{let c=r,l;try{l=Cs.applyPatch(i,c.delta,!0,!1).newDocument}catch(e){let t=e instanceof Error?e.message:String(e);return AE(`[ag-ui][legacy] Failed to apply state patch:\nCurrent state: ${JSON.stringify(i,null,2)}\nPatch operations: ${JSON.stringify(c.delta,null,2)}\nError: ${t}`),[]}return p(l),[{type:DE.AgentStateMessage,threadId:e,agentName:n,nodeName:s,runId:t,running:a,role:`assistant`,state:JSON.stringify(i),active:o}]}case A.MESSAGES_SNAPSHOT:return c=r.messages,[{type:DE.AgentStateMessage,threadId:e,agentName:n,nodeName:s,runId:t,running:a,role:`assistant`,state:JSON.stringify({...i,...c?{messages:c}:{}}),active:!0}];case A.RUN_STARTED:return[];case A.RUN_FINISHED:{if(c&&(i.messages=c),Object.keys(i).length===0)return[];let r=null;if(c)try{r=ME(c)}catch(e){return[{type:DE.RunError,message:e.message}]}return[{type:DE.AgentStateMessage,threadId:e,agentName:n,nodeName:s,runId:t,running:a,role:`assistant`,state:JSON.stringify({...i,...r?{messages:r}:{}}),active:!1}]}case A.RUN_ERROR:{let e=r;return[{type:DE.RunError,message:e.message,code:e.code}]}case A.STEP_STARTED:return s=r.stepName,u=[],l=null,[{type:DE.AgentStateMessage,threadId:e,agentName:n,nodeName:s,runId:t,running:a,role:`assistant`,state:JSON.stringify(i),active:!0}];case A.STEP_FINISHED:return u=[],l=null,[{type:DE.AgentStateMessage,threadId:e,agentName:n,nodeName:s,runId:t,running:a,role:`assistant`,state:JSON.stringify(i),active:!1}];default:return[]}}))};function ME(e){let t=[];for(let n of e)if(n.role===`assistant`||n.role===`user`||n.role===`system`){let e=OE(n.content);if(e){let r={id:n.id,role:n.role,content:e};t.push(r)}if(n.role===`assistant`&&n.toolCalls&&n.toolCalls.length>0)for(let e of n.toolCalls){let r;try{r=JSON.parse(e.function.arguments)}catch(t){throw Error(`Failed to parse arguments for tool call '${e.id}' (${e.function.name}): ${t.message}`)}let i={id:e.id,name:e.function.name,arguments:r,parentMessageId:n.id};t.push(i)}}else if(n.role===`tool`){let r=`unknown`;for(let t of e)if(t.role===`assistant`&&t.toolCalls?.length){for(let e of t.toolCalls)if(e.id===n.toolCallId){r=e.function.name;break}}let i={id:n.id,result:kE(n.toolCallId,n.content),actionExecutionId:n.toolCallId,actionName:r};t.push(i)}return t}var NE=e=>e.kind===`tool`?e.fields.toolCallId:e.fields.messageId,PE=e=>e===`tool`?`toolCallId`:`messageId`,FE=(e,t,n,r,i)=>{if(r!==void 0&&r!==i)throw Error(`Cannot continue ${e} '${t}': chunk ${n} '${r}' does not match the open stream's ${n} ${i===void 0?`(absent)`:`'${i}'`}.`)},IE=(e,t)=>t.metadata===void 0?e:{...e,metadata:t.metadata},LE=(e,t)=>{let n=IE(e,t);return t.rawEvent===void 0?n:{...n,rawEvent:t.rawEvent}},RE=e=>new Set(Object.keys(e.shape)),zE=RE($v),BE=RE(ry),VE=RE(By),HE=(e,t)=>{let n;for(let r of Object.keys(e))t.has(r)||((n??={})[r]=e[r]);return n},UE=e=>{typeof process<`u`&&{}.SUPPRESS_TRANSFORMATION_WARNINGS||console.warn(`[ag-ui][transform] ${e} Set SUPPRESS_TRANSFORMATION_WARNINGS=true to silence.`)},WE=(e,t,n,r)=>{if(t===void 0||n||e.length===0)return;let i=e[e.length-1],a=Object.keys(t).filter(e=>Object.prototype.hasOwnProperty.call(i,e));a.length>0&&UE(`A ${r} carried ${a.map(e=>`'${e}'`).join(`, `)}, which the synthesized ${String(i.type)} already describes. The synthesized value is kept and the chunk's is dropped — this stage does not judge a described field, so the producer's value cannot be substituted for its own.`),e[e.length-1]={...t,...i}},GE=e=>t=>{let n=dE(e),r=new Map,i=e=>{let t=r.get(e);if(!t)return[];switch(r.delete(e),t.kind){case`text`:{let e={type:A.TEXT_MESSAGE_END,messageId:t.fields.messageId,...t.fields.subagentRunId!==void 0&&{subagentRunId:t.fields.subagentRunId}};return n?.event(`TRANSFORM`,`TEXT_MESSAGE_END`,e,{messageId:e.messageId}),[e]}case`tool`:{let e={type:A.TOOL_CALL_END,toolCallId:t.fields.toolCallId,...t.fields.subagentRunId!==void 0&&{subagentRunId:t.fields.subagentRunId}};return n?.event(`TRANSFORM`,`TOOL_CALL_END`,e,{toolCallId:e.toolCallId}),[e]}case`reasoning`:{let e={type:A.REASONING_MESSAGE_END,messageId:t.fields.messageId,...t.fields.subagentRunId!==void 0&&{subagentRunId:t.fields.subagentRunId}};return n?.event(`TRANSFORM`,`REASONING_MESSAGE_END`,e,{messageId:e.messageId}),[e]}}},a=()=>[...r.keys()].flatMap(e=>i(e)),o=(e,t)=>{for(let[n,i]of r)if(i.kind===e&&NE(i)===t)return{owner:n}},s=(e,t,n,i,a)=>{if(t!==void 0){let r=o(e,t);if(r){if(n!==void 0&&n!==r.owner)throw Error(`Cannot continue ${a} '${t}': chunk subagentRunId '${n}' does not match the open stream's subagent '${r.owner??`(the parent agent)`}'.`);return r.owner}return n}if(n!==void 0)return n;if(r.get(void 0)?.kind===e)return;let s=[...r.entries()].filter(([,t])=>t.kind===e);if(s.length===1)return s[0][0];if(s.length>1)throw Error(`Ambiguous ${i}: it carries neither a ${PE(e)} nor a subagentRunId, but ${s.length} lanes have an open ${a}. Attribute the chunk to the subagent it belongs to.`)};return t.pipe(ll(e=>{switch(e.type){case A.TEXT_MESSAGE_START:case A.TEXT_MESSAGE_CONTENT:case A.TEXT_MESSAGE_END:case A.TOOL_CALL_START:case A.TOOL_CALL_ARGS:case A.TOOL_CALL_END:case A.TOOL_CALL_RESULT:case A.STATE_SNAPSHOT:case A.STATE_DELTA:case A.CUSTOM:case A.STEP_STARTED:case A.STEP_FINISHED:case A.REASONING_START:case A.REASONING_MESSAGE_START:case A.REASONING_MESSAGE_CONTENT:case A.REASONING_MESSAGE_END:case A.REASONING_END:return[...i(e.subagentRunId??void 0),e];case A.RUN_STARTED:case A.RUN_FINISHED:case A.RUN_ERROR:case A.MESSAGES_SNAPSHOT:return[...a(),e];case A.RAW:case A.ACTIVITY_SNAPSHOT:case A.ACTIVITY_DELTA:case A.REASONING_ENCRYPTED_VALUE:case A.SUBAGENT_STARTED:return[e];case A.SUBAGENT_FINISHED:case A.SUBAGENT_ERROR:{let t=e.subagentRunId;return t==null?[e]:[...i(t),e]}case A.TEXT_MESSAGE_CHUNK:{let t=e,a=HE(e,zE),o=s(`text`,t.messageId,t.subagentRunId??void 0,`TEXT_MESSAGE_CHUNK`,`text message`),c=r.get(o),l=[],u=!1,d;if(c?.kind===`text`&&(t.messageId===void 0||t.messageId===c.fields.messageId))FE(`text message`,c.fields.messageId,`role`,t.role,c.fields.role),FE(`text message`,c.fields.messageId,`name`,t.name,c.fields.name),d=c.fields;else{if(l.push(...i(o)),t.messageId===void 0)throw Error(`First TEXT_MESSAGE_CHUNK must have a messageId`);d={messageId:t.messageId,role:t.role===void 0?`assistant`:t.role,name:t.name,subagentRunId:t.subagentRunId},r.set(o,{kind:`text`,fields:d});let e=IE({type:A.TEXT_MESSAGE_START,messageId:t.messageId,role:d.role,...t.name!==void 0&&{name:t.name},...t.subagentRunId!==void 0&&{subagentRunId:t.subagentRunId}},t);l.push(e),n?.event(`TRANSFORM`,`TEXT_MESSAGE_START`,e,{messageId:t.messageId})}if(t.delta!==void 0||t.rawEvent!==void 0){let e=t.subagentRunId===void 0?d.subagentRunId:t.subagentRunId,r=LE({...a,type:A.TEXT_MESSAGE_CONTENT,messageId:d.messageId,delta:t.delta===void 0?``:t.delta,...e!==void 0&&{subagentRunId:e}},t);l.push(r),u=!0,n?.event(`TRANSFORM`,`TEXT_MESSAGE_CONTENT`,r,{messageId:d.messageId})}if(l.length===0&&(t.metadata!==void 0||t.rawEvent!==void 0||t.subagentRunId===null||a!==void 0)){let e=t.subagentRunId===void 0?d.subagentRunId:t.subagentRunId;l.push({...a,type:A.TEXT_MESSAGE_CONTENT,messageId:d.messageId,delta:``,...t.metadata!==void 0&&{metadata:t.metadata},...t.rawEvent!==void 0&&{rawEvent:t.rawEvent},...e!==void 0&&{subagentRunId:e}}),u=!0}return WE(l,a,u,`TEXT_MESSAGE_CHUNK`),l}case A.TOOL_CALL_CHUNK:{let t=e,a=HE(e,BE),o=s(`tool`,t.toolCallId,t.subagentRunId??void 0,`TOOL_CALL_CHUNK`,`tool call`),c=r.get(o),l=[],u=!1,d;if(c?.kind===`tool`&&(t.toolCallId===void 0||t.toolCallId===c.fields.toolCallId))FE(`tool call`,c.fields.toolCallId,`toolCallName`,t.toolCallName,c.fields.toolCallName),FE(`tool call`,c.fields.toolCallId,`parentMessageId`,t.parentMessageId,c.fields.parentMessageId),d=c.fields;else{if(l.push(...i(o)),t.toolCallId===void 0)throw Error(`First TOOL_CALL_CHUNK must have a toolCallId`);if(t.toolCallName===void 0)throw Error(`First TOOL_CALL_CHUNK must have a toolCallName`);d={toolCallId:t.toolCallId,toolCallName:t.toolCallName,parentMessageId:t.parentMessageId,subagentRunId:t.subagentRunId},r.set(o,{kind:`tool`,fields:d});let e=IE({type:A.TOOL_CALL_START,toolCallId:t.toolCallId,toolCallName:t.toolCallName,...t.parentMessageId!==void 0&&{parentMessageId:t.parentMessageId},...t.subagentRunId!==void 0&&{subagentRunId:t.subagentRunId}},t);l.push(e),n?.event(`TRANSFORM`,`TOOL_CALL_START`,e,{toolCallId:t.toolCallId,toolCallName:t.toolCallName})}if(t.delta!==void 0||t.rawEvent!==void 0){let e=t.subagentRunId===void 0?d.subagentRunId:t.subagentRunId,r=LE({...a,type:A.TOOL_CALL_ARGS,toolCallId:d.toolCallId,delta:t.delta===void 0?``:t.delta,...e!==void 0&&{subagentRunId:e}},t);l.push(r),u=!0,n?.event(`TRANSFORM`,`TOOL_CALL_ARGS`,r,{toolCallId:d.toolCallId})}if(l.length===0&&(t.metadata!==void 0||t.rawEvent!==void 0||t.subagentRunId===null||a!==void 0)){let e=t.subagentRunId===void 0?d.subagentRunId:t.subagentRunId;l.push({...a,type:A.TOOL_CALL_ARGS,toolCallId:d.toolCallId,delta:``,...t.metadata!==void 0&&{metadata:t.metadata},...t.rawEvent!==void 0&&{rawEvent:t.rawEvent},...e!==void 0&&{subagentRunId:e}}),u=!0}return WE(l,a,u,`TOOL_CALL_CHUNK`),l}case A.REASONING_MESSAGE_CHUNK:{let t=e,a=HE(e,VE),o=s(`reasoning`,t.messageId,t.subagentRunId??void 0,`REASONING_MESSAGE_CHUNK`,`reasoning message`),c=r.get(o),l=[],u=!1,d;if(c?.kind===`reasoning`&&(t.messageId===void 0||t.messageId===c.fields.messageId))d=c.fields;else{if(l.push(...i(o)),t.messageId===void 0)throw Error(`First REASONING_MESSAGE_CHUNK must have a messageId`);d={messageId:t.messageId,subagentRunId:t.subagentRunId},r.set(o,{kind:`reasoning`,fields:d});let e=IE({type:A.REASONING_MESSAGE_START,messageId:t.messageId,role:`reasoning`,...t.subagentRunId!==void 0&&{subagentRunId:t.subagentRunId}},t);l.push(e),n?.event(`TRANSFORM`,`REASONING_MESSAGE_START`,e,{messageId:t.messageId})}if(t.delta!==void 0||t.rawEvent!==void 0){let e=t.subagentRunId===void 0?d.subagentRunId:t.subagentRunId,r=LE({...a,type:A.REASONING_MESSAGE_CONTENT,messageId:d.messageId,delta:t.delta===void 0?``:t.delta,...e!==void 0&&{subagentRunId:e}},t);l.push(r),u=!0,n?.event(`TRANSFORM`,`REASONING_MESSAGE_CONTENT`,r,{messageId:d.messageId})}if(l.length===0&&(t.metadata!==void 0||t.rawEvent!==void 0||t.subagentRunId===null||a!==void 0)){let e=t.subagentRunId===void 0?d.subagentRunId:t.subagentRunId;l.push({...a,type:A.REASONING_MESSAGE_CONTENT,messageId:d.messageId,delta:``,...t.metadata!==void 0&&{metadata:t.metadata},...t.rawEvent!==void 0&&{rawEvent:t.rawEvent},...e!==void 0&&{subagentRunId:e}}),u=!0}return WE(l,a,u,`REASONING_MESSAGE_CHUNK`),l}}return e.type,[e]}),yl(()=>{a()}))},KE=Symbol(`agui.strip.drop`);function qE(e){let t=e;for(;;){if(t instanceof PT||t instanceof IT||t instanceof RT||t instanceof JT||t instanceof WT){t=t.unwrap();continue}if(t instanceof KT){t=t.def.in;continue}if(t instanceof XT){t=t.def.getter();continue}return t}}function JE(e){let t=e.def;return typeof t?.discriminator==`string`?t.discriminator:void 0}function YE(e){let t=e,n=Array.isArray(t.def?.values)?t.def.values:t.values?Array.from(t.values):void 0;return n&&n.length===1?n[0]:t.value}function XE(e){let t=qE(e);return t instanceof jT?YE(t):void 0}function ZE(e,t,n,r){let i=qE(t);if(i instanceof CT){if(typeof e!=`object`||!e||Array.isArray(e))return e;let t=i.shape,a=e,o={},s=i.meta()?.specOpen===!0;for(let e of Object.keys(a)){let i=Object.prototype.hasOwnProperty.call(t,e)?t[e]:void 0;if(i===void 0){if(s){o[e]=a[e];continue}r.push(`${n}/${e}`);continue}let c=r.length,l=ZE(a[e],i,`${n}/${e}`,r);if(l===KE){if(r.length=c,i.safeParse(void 0).success){r.push(`${n}/${e}`);continue}return KE}o[e]=l}return o}if(i instanceof xT){if(!Array.isArray(e))return e;let t=i.element,a=[];return e.forEach((e,i)=>{let o=r.length,s=ZE(e,t,`${n}/${i}`,r);if(s===KE){r.length=o,r.push(`${n}/${i}`);return}a.push(s)}),a}if(i instanceof OT){if(typeof e!=`object`||!e||Array.isArray(e))return e;let t=i.def.valueType,a=e,o={};for(let e of Object.keys(a)){let i=r.length,s=ZE(a[e],t,`${n}/${e}`,r);if(s===KE){r.length=i,r.push(`${n}/${e}`);continue}o[e]=s}return o}if(i instanceof wT){let t=i.options,a=JE(i);if(a!==void 0){if(typeof e!=`object`||!e||Array.isArray(e))return e;let i=e[a];for(let o of t){let t=qE(o);if(!(t instanceof CT))continue;let s=t.shape;if(XE(s[a])===i)return ZE(e,o,n,r)}return KE}let o=t.filter(e=>qE(e)instanceof CT),s=typeof e==`object`&&!!e&&!Array.isArray(e);if(o.length>1&&s)return e;for(let i of t){let t=qE(i);if(t instanceof xT&&Array.isArray(e)||t instanceof CT&&s)return ZE(e,i,n,r)}return e}return e}function QE(e,t){let n=[],r=ZE(e,t,``,n);if(r===KE)throw Error(`Internal error: the stripper found the whole value unrecognisable, which the schemas are not supposed to allow — schema/stripper mismatch.`);return{value:r,stripped:n}}var $E=new Set(Object.values(A));function eD(e){return $E.has(e.type)}var tD=new Map(Ky.options.map(e=>{let t=e.shape;return[String(YE(t.type)),e]})),nD=()=>typeof process<`u`&&!!{}.SUPPRESS_TRANSFORMATION_WARNINGS;function rD(e){nD()||console.warn(`[ag-ui][enforce] ${e}`)}var iD=e=>t=>{let n=dE(e);return t.pipe(ll(e=>{if(!eD(e))return rD(`Dropping unrecognised event '${String(e.type)}': no middleware translated it and the protocol does not describe it.`),n?.event(`ENFORCE`,`Unrecognised event dropped:`,e,{type:e.type}),Tc;let t=tD.get(e.type);if(t===void 0)throw Error(`No validator for recognised event type '${String(e.type)}'`);let{value:r,stripped:i}=QE(e,t);for(let t of i)rD(`Removed unrecognised material at '${t}' on ${String(e.type)}. Nothing handled it; see the repo-root DEPRECATIONS.md if it is a retired shape.`);return il(t.parse(r))}))};function aD(e){let{value:t,stripped:n}=QE(Ro(e,`RunAgentInput`),Ey);for(let e of n)rD(`Removed unrecognised material at '${e}' from the outgoing input.`);return Ey.parse(t)}var oD=class{runNext(e,t){return t.run(e).pipe(GE(!1))}runNextWithState(e,t){let n=rE(e.messages||[]),r=rE(e.state===void 0?{}:e.state),i=new wc;return gE(e,i,t,[]).subscribe({next:e=>{e.messages!==void 0&&(n=e.messages),e.state!==void 0&&(r=e.state)},error:()=>{}}),this.runNext(e,t).pipe(hl(async e=>(i.next(e),await new Promise(e=>setTimeout(e,0)),{event:e,messages:rE(n),state:rE(r)})))}},sD=class extends oD{constructor(e){super(),this.fn=e}run(e,t){return this.fn(e,t)}};function cD(e){return e.startsWith(`image/`)?`image`:e.startsWith(`audio/`)?`audio`:e.startsWith(`video/`)?`video`:`document`}function lD(e){return typeof e==`object`&&!!e&&`type`in e&&e.type===`binary`&&`mimeType`in e&&typeof e.mimeType==`string`}function uD(e){let t=cD(e.mimeType);return e.data?{type:t,source:{type:`data`,value:e.data,mimeType:e.mimeType},...e.filename?{metadata:{filename:e.filename}}:{}}:e.url?{type:t,source:{type:`url`,value:e.url,mimeType:e.mimeType},...e.filename?{metadata:{filename:e.filename}}:{}}:((typeof process>`u`||!{}.SUPPRESS_TRANSFORMATION_WARNINGS)&&console.warn(`[ag-ui][compat] A binary content part carries only an id ('${e.id??``}') and cannot be converted to a modern media part; a 1.0 peer will not accept it. Provide data or a url. See the repo-root DEPRECATIONS.md.`),e)}function dD(e,t,n){if(typeof e!=`object`||!e||!(`type`in e)||e.type!==t.type||!(`source`in e))return!1;let r=e.source;return typeof r!=`object`||!r||!(`type`in r)||r.type!==t.source.type||!(`value`in r)||r.value!==t.source.value||!(`mimeType`in r)||r.mimeType!==t.source.mimeType?!1:!n||`metadata`in e&&typeof e.metadata==`object`&&e.metadata!==null&&`filename`in e.metadata&&e.metadata.filename===n}function fD(e){let t=e.content;if(!Array.isArray(t))return e;let n=t.flatMap(e=>{if(lD(e)){let n=uD(e);return n.type!==`binary`&&t.some(t=>dD(t,n,e.filename))?[]:[n]}return[e]});return{...e,content:n}}var pD=`THINKING_START`,mD=`THINKING_END`,hD=`THINKING_TEXT_MESSAGE_START`,gD=`THINKING_TEXT_MESSAGE_CONTENT`,_D=`THINKING_TEXT_MESSAGE_END`;function vD(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}var yD={event:[`rawEvent`,`subagentRunId`],[A.RUN_STARTED]:[`parentRunId`,`input`],[A.RUN_FINISHED]:[`result`,`outcome`],[A.RUN_ERROR]:[`usage`],[A.SUBAGENT_FINISHED]:[`result`],[A.TOOL_CALL_START]:[`parentMessageId`],[A.TOOL_CALL_CHUNK]:[`parentMessageId`],[A.TOOL_CALL_RESULT]:[`role`],"RUN_FINISHED.outcome":[`pendingToolCallIds`],"RUN_FINISHED.usage[]":[`provider`,`reasoningTokens`,`cachedInputTokens`,`cacheWriteInputTokens`],RunAgentInput:[`forwardedProps`],Tool:[`parameters`],ResumeEntry:[`payload`],"input content":[`metadata`]},bD=new Map(Object.entries(yD).filter(([e])=>Object.values(A).includes(e))),xD=e=>_E(e,`an absent field`);function SD(e,t,n,r){if(!vD(e))return e;let i;for(let a of t)e[a]===null&&(r(n===void 0?`${a}: null`:`${n}.${a}: null`),i??={...e},delete i[a]);return i??e}function CD(e,t,n){if(!vD(e)||!Array.isArray(e[t]))return e;let r=e[t],i=r.map(n);return i.some((e,t)=>e!==r[t])?{...e,[t]:i}:e}function wD(e,t){return CD(e,`content`,e=>{if(!vD(e))return e;switch(e.type){case`image`:case`audio`:case`video`:case`document`:return SD(e,yD[`input content`],`${e.type} input content`,t);default:return e}})}function TD(e,t=xD){let n=SD(e,yD.RunAgentInput,`RunAgentInput`,t);return n=CD(n,`tools`,e=>SD(e,yD.Tool,`Tool`,t)),n=CD(n,`resume`,e=>SD(e,yD.ResumeEntry,`ResumeEntry`,t)),CD(n,`messages`,e=>wD(e,t))}var ED=class extends oD{constructor(...e){super(...e),this.currentReasoningId=null,this.currentMessageId=null,this.nullsNoticedThisRun=new Set,this.noticeNullOncePerRun=e=>{this.nullsNoticedThisRun.has(e)||(this.nullsNoticedThisRun.add(e),_E(e,`an absent field`))}}warn(e,t){_E(e,t)}mintedContinuationId(e,t){if(t!==null)return t;let n=iE();return this.warnAside(`Minting a messageId ('${n}') for ${e}: no THINKING opener preceded it, so there was no id to continue. The id is this client's invention, not the producer's, and verification will reject the translated event for naming something nothing opened.`),n}warnAside(e){typeof process<`u`&&{}.SUPPRESS_TRANSFORMATION_WARNINGS||console.warn(`[ag-ui][compat] ${e} Set SUPPRESS_TRANSFORMATION_WARNINGS=true to silence.`)}run(e,t){return this.currentReasoningId=null,this.currentMessageId=null,this.nullsNoticedThisRun.clear(),e.messages=e.messages.map(fD),t.run(e).pipe(sl(e=>this.transformEvent(e)))}transformEvent(e){let t=this.noticeNullOncePerRun;e.type===A.RUN_STARTED&&this.nullsNoticedThisRun.clear(),e=SD(e,yD.event,void 0,t);let n=bD.get(e.type);switch(n&&(e=SD(e,n,e.type,t)),e.type){case pD:{this.currentReasoningId=iE();let{title:t,...n}=e;return this.warn(pD,A.REASONING_START),t!==void 0&&this.warnAside(`Dropping ${pD}.title ${JSON.stringify(t)}: ${A.REASONING_START} has no title field, so the span's label cannot be carried and nothing downstream can recover it.`),{...n,type:A.REASONING_START,messageId:this.currentReasoningId}}case hD:return this.currentMessageId=iE(),this.warn(hD,A.REASONING_MESSAGE_START),{...e,type:A.REASONING_MESSAGE_START,messageId:this.currentMessageId,role:`reasoning`};case gD:{let{delta:t,...n}=e;return this.warn(gD,A.REASONING_MESSAGE_CONTENT),{...n,type:A.REASONING_MESSAGE_CONTENT,messageId:this.mintedContinuationId(gD,this.currentMessageId),delta:t}}case _D:{let t=this.mintedContinuationId(_D,this.currentMessageId);return this.currentMessageId=null,this.warn(_D,A.REASONING_MESSAGE_END),{...e,type:A.REASONING_MESSAGE_END,messageId:t}}case mD:{let t=this.mintedContinuationId(mD,this.currentReasoningId);return this.currentReasoningId=null,this.warn(mD,A.REASONING_END),{...e,type:A.REASONING_END,messageId:t}}case A.RUN_FINISHED:{let n=e,r=SD(n.outcome,yD[`RUN_FINISHED.outcome`],`RUN_FINISHED.outcome`,t);return CD(r===n.outcome?n:{...n,outcome:r},`usage`,e=>SD(e,yD[`RUN_FINISHED.usage[]`],`RUN_FINISHED.usage[]`,t))}case A.MESSAGES_SNAPSHOT:{let t=e;return Array.isArray(t.messages)?{...t,messages:t.messages.map(e=>this.upgradeInboundMessage(e))}:e}case A.RUN_STARTED:{let n=TD(e.input,t),r=n===e.input?e:{...e,input:n},i=r;return!i.input||!Array.isArray(i.input.messages)?r:{...i,input:{...i.input,messages:i.input.messages.map(e=>this.upgradeInboundMessage(e))}}}default:return e}}upgradeInboundMessage(e){e=wD(e,this.noticeNullOncePerRun);let t=e.content;return!Array.isArray(t)||!t.some(e=>typeof e==`object`&&!!e&&e.type===`binary`)?e:(this.warn(`binary input content`,`the modern media content parts`),fD(e))}},DD=()=>e=>fl(()=>{let t=new ED;return e.pipe(sl(e=>t.transformEvent(e)))});function OD(e,t=new Date){return e.expiresAt!==void 0&&new Date(e.expiresAt)<=t}function kD(){return typeof process<`u`&&!!{}.SUPPRESS_TRANSFORMATION_WARNINGS}function AD(e){kD()||console.warn(`[ag-ui][compat] Flattening message content for a <=0.0.39 peer DROPS non-text parts (${e.join(`, `)}). The peer cannot receive them; upgrade it to keep media content. See the repo-root DEPRECATIONS.md.`)}function jD(e){kD()||console.warn(`[ag-ui][compat] Not flattening message content for a <=0.0.39 peer: ${e} content part(s) claim type "text" but carry a malformed 'text' value. That is a defect in the message, not media the peer cannot represent, and a downgrade must not repair it — the content is passed on unchanged so the outgoing enforcement boundary reports it. See the repo-root DEPRECATIONS.md.`)}function MD(e){let t=e.content;if(Array.isArray(t)){let n=e=>typeof e==`object`&&!!e&&`type`in e&&e.type===`text`,r=e=>n(e)&&typeof e.text==`string`,i=t.filter(e=>n(e)&&!r(e));if(i.length>0)return jD(i.length),e;let a=t.filter(e=>!r(e)).map(e=>typeof e==`object`&&e&&`type`in e?String(e.type):typeof e);a.length>0&&AD(a);let o=t.filter(r).map(e=>e.text).join(``);return{...e,content:o}}return typeof t==`string`?e:t===void 0?{...e,content:``}:e}var ND=class extends oD{run(e,t){let{parentRunId:n,...r}=e,i={...r,messages:r.messages.map(MD)};return this.runNext(i,t)}},PD=`THINKING_START`,FD=`THINKING_END`,ID=`THINKING_TEXT_MESSAGE_START`,LD=`THINKING_TEXT_MESSAGE_CONTENT`,RD=`THINKING_TEXT_MESSAGE_END`,zD=class extends oD{constructor(...e){super(...e),this.currentReasoningId=null,this.currentMessageId=null}warnAboutTransformation(e,t){typeof process<`u`&&{}.SUPPRESS_TRANSFORMATION_WARNINGS||console.warn(`AG-UI is converting ${e} to ${t}. To remove this warning, upgrade your AG-UI integration package (e.g. @ag-ui/langgraph). To surpress it, set SUPPRESS_TRANSFORMATION_WARNINGS=true in your .env file.`)}run(e,t){return this.currentReasoningId=null,this.currentMessageId=null,this.runNext(e,t).pipe(sl(e=>this.transformEvent(e)))}transformEvent(e){switch(e.type){case PD:{this.currentReasoningId=iE();let{title:t,...n}=e;return this.warnAboutTransformation(PD,A.REASONING_START),{...n,type:A.REASONING_START,messageId:this.currentReasoningId}}case ID:return this.currentMessageId=iE(),this.warnAboutTransformation(ID,A.REASONING_MESSAGE_START),{...e,type:A.REASONING_MESSAGE_START,messageId:this.currentMessageId,role:`reasoning`};case LD:{let{delta:t,...n}=e;return this.warnAboutTransformation(LD,A.REASONING_MESSAGE_CONTENT),{...n,type:A.REASONING_MESSAGE_CONTENT,messageId:this.currentMessageId??iE(),delta:t}}case RD:{let t=this.currentMessageId??iE();return this.warnAboutTransformation(RD,A.REASONING_MESSAGE_END),{...e,type:A.REASONING_MESSAGE_END,messageId:t}}case FD:{let t=this.currentReasoningId??iE();return this.warnAboutTransformation(FD,A.REASONING_END),{...e,type:A.REASONING_END,messageId:t}}default:return e}}},BD=`SUBAGENT_STARTED`,VD=`SUBAGENT_FINISHED`,HD=`SUBAGENT_ERROR`;function UD(e){if(e&&typeof e==`object`&&`subagentRunId`in e){let{subagentRunId:t,...n}=e;return n}return e}function WD(e){return e.map(e=>UD(e))}var GD=class extends oD{warnDroppedLifecycleEvent(e){typeof process<`u`&&{}.SUPPRESS_TRANSFORMATION_WARNINGS||console.warn(`AG-UI is dropping ${e} because the target agent predates subagent support. To remove this warning, upgrade your AG-UI integration package. To suppress it, set SUPPRESS_TRANSFORMATION_WARNINGS=true in your .env file.`)}run(e,t){let n={...e,messages:(e.messages??[]).map(e=>UD(e))};return this.runNext(n,t).pipe(Sl(e=>{let t=e.type;(t===BD||t===VD||t===HD)&&this.warnDroppedLifecycleEvent(t)}),pl(e=>{let t=e.type;return t!==BD&&t!==VD&&t!==HD}),sl(e=>{let t=UD(e);if(t.type===A.MESSAGES_SNAPSHOT){let e=t;if(Array.isArray(e.messages))return{...e,messages:WD(e.messages)}}if(t.type===A.RUN_FINISHED){let e=t;if(e.outcome&&Array.isArray(e.outcome.interrupts))return{...e,outcome:{...e.outcome,interrupts:e.outcome.interrupts.map(e=>UD(e))}}}if(t.type===A.RUN_STARTED){let e=t;if(e.input&&Array.isArray(e.input.messages))return{...e,input:{...e.input,messages:WD(e.input.messages)}}}return t}))}},KD=`1.0.2`,qD=!1,JD=new WeakSet,YD=(e,t)=>/^\d+\.\d+$/.test(e)?CC(e,t)>0?`newer`:`not-newer`:`uninterpretable`,XD=e=>{let t=e.protocolVersion;if(t!==void 0&&t!==`1.0`)switch(YD(t,`1.0`)){case`uninterpretable`:console.warn(`[ag-ui] The producer declared protocol version '${t}', which this client cannot interpret.`);return;case`newer`:console.warn(`[ag-ui] The producer speaks protocol ${t}; this client speaks 1.0. Unrecognised material will be stripped with warnings.`);return;case`not-newer`:return}},ZD=class e{resolvePeerCeiling(t){if(this.resolvingPeerCeiling)return KD;let n=Object.getOwnPropertyDescriptor(this,`maxVersion`),r=Object.getOwnPropertyDescriptor(this,`maxProtocolVersion`),i=Object.getPrototypeOf(this);for(;i&&i!==e.prototype;)n??=Object.getOwnPropertyDescriptor(i,`maxVersion`),r??=Object.getOwnPropertyDescriptor(i,`maxProtocolVersion`),i=Object.getPrototypeOf(i);if(t===`maxVersion`&&n)return KD;let a=t===`maxProtocolVersion`?n:r;if(!a)return KD;this.resolvingPeerCeiling=!0;try{return a.get?a.get.call(this):a.value}finally{this.resolvingPeerCeiling=!1}}get maxProtocolVersion(){return this.resolvePeerCeiling(`maxProtocolVersion`)}get maxVersion(){return!this.resolvingPeerCeiling&&!qD&&(qD=!0,console.warn(`[ag-ui] AbstractAgent.maxVersion is deprecated — use maxProtocolVersion. Same value; the new name says whose version it is and that it is a ceiling.`)),this.resolvePeerCeiling(`maxVersion`)}get debug(){return this._debug}set debug(e){this._debug=uE(e),this._debugLogger=pE(this._debug)}get debugLogger(){return this._debugLogger}set debugLogger(e){this._debugLogger=typeof e==`boolean`?e?pE(uE(!0)):void 0:e}resolvedCeilingDuringConstruction(){let e=this.maxProtocolVersion;if(typeof e!=`string`||!wC(e))throw new j(`maxProtocolVersion resolved to ${JSON.stringify(e)} during construction, which is not a version this client can compare. A ceiling read from an instance field is not available yet — return a literal from the getter.`);return e}constructor({agentId:e,description:t,threadId:n,initialMessages:r,initialState:i,debug:a}={}){this.subscribers=[],this.isRunning=!1,this.pendingInterrupts=[],this.middlewares=[],this.resolvingPeerCeiling=!1,this.agentId=e,this.description=t??``,this.threadId=n??Po(),this.messages=rE(r??[]),this.state=rE(i??{}),this._debug=uE(a),this._debugLogger=pE(this._debug);let o=this.resolvedCeilingDuringConstruction();CC(o,`0.0.39`)<=0&&this.middlewares.unshift(new ND),CC(o,`0.0.45`)<=0&&this.middlewares.unshift(new zD),CC(o,`0.0.57`)<=0&&this.middlewares.unshift(new GD)}subscribe(e){return this.subscribers.push(e),{unsubscribe:()=>{this.subscribers=this.subscribers.filter(t=>t!==e)}}}use(...e){let t=e.map(e=>typeof e==`function`?new sD(e):e);return this.middlewares.push(...t),this}async runAgent(e,t){try{this.isRunning=!0,this.agentId=this.agentId??Po();let n=this.prepareRunAgentInput(e);this.debugLogger?.lifecycle(`LIFECYCLE`,`Run started:`,{agentId:this.agentId,threadId:this.threadId});let r,i=new Set(this.messages.map(e=>e.id)),a=[{onRunStartedEvent:({event:e})=>XD(e),onRunFinishedEvent:e=>{e.outcome===`success`&&(r=e.result)}},...this.subscribers,t??{}];JD.add(n),await this.onInitialize(n,a),this.activeRunDetach$=new xc;let o;this.activeRunCompletionPromise=new Promise(e=>{o=e}),await ol(uc(()=>[...this.middlewares,new ED].reduceRight((e,t)=>({run:n=>t.run(n,e),get messages(){return e.messages},get state(){return e.state}}),this).run(n),iD(this.debugLogger),GE(this.debugLogger),vE(this.debugLogger),e=>e.pipe(xl(this.activeRunDetach$)),e=>this.applyBeforeSourceError(n,e,a),ml(e=>(this.debugLogger?.lifecycle(`LIFECYCLE`,`Run errored:`,{agentId:this.agentId,error:e instanceof Error?e.message:String(e)}),this.isRunning=!1,this.onError(n,e,a))),yl(()=>{this.debugLogger?.lifecycle(`LIFECYCLE`,`Run finished:`,{agentId:this.agentId,threadId:this.threadId}),this.isRunning=!1,this.onFinalize(n,a),o?.(),o=void 0,this.activeRunCompletionPromise=void 0,this.activeRunDetach$=void 0}))(il(null)));let s=rE(this.messages).filter(e=>!i.has(e.id));return{result:r,newMessages:s}}finally{this.isRunning=!1}}connect(e){throw new zo}async connectAgent(e,t){try{this.isRunning=!0,this.agentId=this.agentId??Po();let n=this.prepareRunAgentInput(e),r,i=new Set(this.messages.map(e=>e.id)),a=[{onRunStartedEvent:({event:e})=>XD(e),onRunFinishedEvent:e=>{e.outcome===`success`&&(r=e.result)}},...this.subscribers,t??{}];await this.onInitialize(n,a),this.activeRunDetach$=new xc;let o;this.activeRunCompletionPromise=new Promise(e=>{o=e}),await ol(uc(()=>fl(()=>this.connect(n)),e=>iD(this.debugLogger)(DD()(e)),GE(this.debugLogger),vE(this.debugLogger),e=>e.pipe(xl(this.activeRunDetach$)),e=>this.applyBeforeSourceError(n,e,a),ml(e=>(this.isRunning=!1,e instanceof zo?Tc:this.onError(n,e,a))),yl(()=>{this.isRunning=!1,this.onFinalize(n,a),o?.(),o=void 0,this.activeRunCompletionPromise=void 0,this.activeRunDetach$=void 0}))(il(null)),{defaultValue:void 0});let s=rE(this.messages).filter(e=>!i.has(e.id));return{result:r,newMessages:s}}finally{this.isRunning=!1}}abortRun(){}async detachActiveRun(){if(!this.activeRunDetach$)return;let e=this.activeRunCompletionPromise??Promise.resolve();this.activeRunDetach$.next(),this.activeRunDetach$?.complete(),await e}applyBeforeSourceError(e,t,n){return fl(()=>{let r,i=t.pipe(ml(e=>(r={error:e},Tc)));return this.processApplyEvents(e,this.apply(e,i,n),n).pipe(_l(fl(()=>{let e=r;return e?N(()=>e.error):Tc})))})}apply(e,t,n){return gE(e,t,this,n,this.debugLogger)}processApplyEvents(e,t,n){return t.pipe(Sl(t=>{t.messages&&(this.messages=t.messages,n.forEach(t=>{t.onMessagesChanged?.({messages:this.messages,state:this.state,agent:this,input:e})})),t.state!==void 0&&(this.state=t.state,n.forEach(t=>{t.onStateChanged?.({state:this.state,messages:this.messages,agent:this,input:e})}))}))}prepareRunAgentInput(e){let t=rE(this.messages);for(let e of t)e.subagentRunId===null&&delete e.subagentRunId;let n=t.filter(e=>e.role!==`activity`);return{threadId:this.threadId,runId:e?.runId||Po(),...CC(this.maxProtocolVersion,KD)>=0&&{protocolVersion:`1.0`},tools:rE(e?.tools??[]),context:rE(e?.context??[]),forwardedProps:rE(e?.forwardedProps??{}),state:rE(this.state),messages:n,...e?.resume===void 0?{}:{resume:rE(e.resume)}}}async onInitialize(e,t){if(JD.has(e)&&this.pendingInterrupts.length>0){let t=new Set((e.resume??[]).map(e=>e.interruptId)),n=this.pendingInterrupts.map(e=>e.id).filter(e=>!t.has(e));if(n.length>0)throw new j(`Thread has ${n.length} pending interrupt(s) not addressed by resume: ${n.join(`, `)}`);for(let t of this.pendingInterrupts)if(OD(t)&&(e.resume??[]).find(e=>e.interruptId===t.id)?.status!==`cancelled`)throw new j(`Interrupt ${t.id} expired at ${t.expiresAt} and can no longer be answered. Cancel it to continue the thread.`)}let n=await lE(t,this.messages,this.state,(t,n,r)=>t.onRunInitialized?.({messages:n,state:r,agent:this,input:e}));if(n.messages!==void 0||n.state!==void 0){if(n.messages){this.messages=n.messages;for(let e of n.messages)e.subagentRunId===null&&delete e.subagentRunId;e.messages=n.messages.filter(e=>e.role!==`activity`),t.forEach(t=>{t.onMessagesChanged?.({messages:this.messages,state:this.state,agent:this,input:e})})}n.state!==void 0&&(this.state=n.state,e.state=n.state,t.forEach(t=>{t.onStateChanged?.({state:this.state,messages:this.messages,agent:this,input:e})}))}}onError(e,t,n){return rl(lE(n,this.messages,this.state,(n,r,i)=>n.onRunFailed?.({error:t,messages:r,state:i,agent:this,input:e}))).pipe(sl(r=>{let i=r;if((i.messages!==void 0||i.state!==void 0)&&(i.messages!==void 0&&(this.messages=i.messages,n.forEach(t=>{t.onMessagesChanged?.({messages:this.messages,state:this.state,agent:this,input:e})})),i.state!==void 0&&(this.state=i.state,n.forEach(t=>{t.onStateChanged?.({state:this.state,messages:this.messages,agent:this,input:e})}))),i.stopPropagation!==!0){let e=String(t);if(t.name!==`AbortError`&&t.message!==`Fetch is aborted`&&t.message!==`signal is aborted without reason`&&t.message!==`component unmounted`&&e!==`component unmounted`)throw console.error(`Agent execution failed:`,t),t}return{}}))}async onFinalize(e,t){let n=await lE(t,this.messages,this.state,(t,n,r)=>t.onRunFinalized?.({messages:n,state:r,agent:this,input:e}));(n.messages!==void 0||n.state!==void 0)&&(n.messages!==void 0&&(this.messages=n.messages,t.forEach(t=>{t.onMessagesChanged?.({messages:this.messages,state:this.state,agent:this,input:e})})),n.state!==void 0&&(this.state=n.state,t.forEach(t=>{t.onStateChanged?.({state:this.state,messages:this.messages,agent:this,input:e})})))}clone(){let e=Object.create(Object.getPrototypeOf(this));return e.agentId=this.agentId,e.description=this.description,e.threadId=this.threadId,e.messages=rE(this.messages),e.state=rE(this.state),e._debug=this._debug,e._debugLogger=this._debugLogger,e.isRunning=this.isRunning,e.subscribers=[...this.subscribers],e.middlewares=[...this.middlewares],e.pendingInterrupts=rE(this.pendingInterrupts),e}addMessage(e){this.messages.push(e),(async()=>{for(let t of this.subscribers)await t.onNewMessage?.({message:e,messages:this.messages,state:this.state,agent:this});if(e.role===`assistant`&&e.toolCalls)for(let t of e.toolCalls)for(let e of this.subscribers)await e.onNewToolCall?.({toolCall:t,messages:this.messages,state:this.state,agent:this});for(let e of this.subscribers)await e.onMessagesChanged?.({messages:this.messages,state:this.state,agent:this})})()}addMessages(e){this.messages.push(...e),(async()=>{for(let t of e){for(let e of this.subscribers)await e.onNewMessage?.({message:t,messages:this.messages,state:this.state,agent:this});if(t.role===`assistant`&&t.toolCalls)for(let e of t.toolCalls)for(let t of this.subscribers)await t.onNewToolCall?.({toolCall:e,messages:this.messages,state:this.state,agent:this})}for(let e of this.subscribers)await e.onMessagesChanged?.({messages:this.messages,state:this.state,agent:this})})()}setMessages(e){this.messages=rE(e),(async()=>{for(let e of this.subscribers)await e.onMessagesChanged?.({messages:this.messages,state:this.state,agent:this})})()}setState(e){this.state=rE(e),(async()=>{for(let e of this.subscribers)await e.onStateChanged?.({messages:this.messages,state:this.state,agent:this})})()}legacy_to_be_removed_runAgentBridged(e){this.agentId=this.agentId??Po();let t=this.prepareRunAgentInput(e);return[...this.middlewares,new ED].reduceRight((e,t)=>({run:n=>t.run(n,e),get messages(){return e.messages},get state(){return e.state}}),this).run(t).pipe(iD(this.debugLogger),GE(this.debugLogger),vE(this.debugLogger),jE(this.threadId,t.runId,this.agentId),e=>e.pipe(sl(e=>(this.debugLogger?.event(`LEGACY`,`Event:`,e,{type:e.type}),e))))}};function QD(e){if(!Array.isArray(e.messages))return e;let t=!1,n=e.messages.map(e=>{if(e.subagentRunId===null){t=!0;let n={...e};return delete n.subagentRunId,n}return e});return t?{...e,messages:n}:e}var $D=class extends ZD{requestInit(e){return{method:`POST`,headers:{...this.headers,"Content-Type":`application/json`,Accept:`text/event-stream`},body:JSON.stringify(QD(e)),signal:this.abortController.signal}}runAgent(e,t){return this.abortController=e?.abortController??new AbortController,super.runAgent(e,t)}abortRun(){this.abortController.abort(),super.abortRun()}constructor(e){super(e),this.abortController=new AbortController,this.url=e.url,this.headers=rE(e.headers??{}),this.fetch=e.fetch??((e,t)=>fetch(e,t))}run(e){return EE(bE(()=>this.fetch(this.url,this.requestInit(aD(e)))),this.debugLogger)}clone(){let e=super.clone();e.url=this.url,e.headers=rE(this.headers??{}),e.fetch=this.fetch;let t=new AbortController,n=this.abortController.signal;return n.aborted&&t.abort(n.reason),e.abortController=t,e}},eO=class extends Yt{constructor(e,t){super(e,t)}bindMethods(){super.bindMethods(),this.fetchNextPage=this.fetchNextPage.bind(this),this.fetchPreviousPage=this.fetchPreviousPage.bind(this)}setOptions(e){e._type=`infinite`,super.setOptions(e)}getOptimisticResult(e){return e._type=`infinite`,super.getOptimisticResult(e)}fetchNextPage(e){return this.fetch({...e,meta:{fetchMore:{direction:`forward`}}})}fetchPreviousPage(e){return this.fetch({...e,meta:{fetchMore:{direction:`backward`}}})}createResult(e,t){let{state:n}=e,r=super.createResult(e,t),{isFetching:i,isRefetching:a,isError:o,isRefetchError:s}=r,c=n.fetchMeta?.fetchMore?.direction,l=o&&c===`forward`,u=i&&c===`forward`,d=o&&c===`backward`,f=i&&c===`backward`;return{...r,fetchNextPage:this.fetchNextPage,fetchPreviousPage:this.fetchPreviousPage,hasNextPage:ln(t,n.data),hasPreviousPage:Zt(t,n.data),isFetchNextPageError:l,isFetchingNextPage:u,isFetchPreviousPageError:d,isFetchingPreviousPage:f,isRefetchError:s&&!l&&!d,isRefetching:a&&!u&&!f}}},tO=class extends $t{#e;#t;#n;constructor(e={}){super(),this.config=e,this.#e=new Set,this.#t=new Map,this.#n=0}build(e,t,n){let r=new cn({client:e,mutationCache:this,mutationId:++this.#n,options:e.defaultMutationOptions(t),state:n});return this.add(r),r}add(e){this.#e.add(e);let t=nO(e);if(typeof t==`string`){let n=this.#t.get(t);n?n.push(e):this.#t.set(t,[e])}this.notify({type:`added`,mutation:e})}remove(e){if(this.#e.delete(e)){let t=nO(e);if(typeof t==`string`){let n=this.#t.get(t);if(n){if(n.length>1){let t=n.indexOf(e);t!==-1&&n.splice(t,1)}else n[0]===e&&this.#t.delete(t)}}}this.notify({type:`removed`,mutation:e})}canRun(e){let t=nO(e);if(typeof t==`string`){let n=this.#t.get(t)?.find(e=>e.state.status===`pending`);return!n||n===e}return!0}runNext(e){let t=nO(e);return typeof t==`string`?(this.#t.get(t)?.find(t=>t!==e&&t.state.isPaused))?.continue()??Promise.resolve():Promise.resolve()}clear(){dn.batch(()=>{this.#e.forEach(e=>{this.notify({type:`removed`,mutation:e})}),this.#e.clear(),this.#t.clear()})}getAll(){return Array.from(this.#e)}find(e){let t={exact:!0,...e};return this.getAll().find(e=>en(t,e))}findAll(e={}){return this.getAll().filter(t=>en(e,t))}notify(e){dn.batch(()=>{this.listeners.forEach(t=>{t(e)})})}resumePausedMutations(){let e=this.getAll().filter(e=>e.state.isPaused);return dn.batch(()=>Promise.all(e.map(e=>e.continue().catch(fn))))}};function nO(e){return e.options.scope?.id}var rO=class extends $t{#e;constructor(e={}){super(),this.config=e,this.#e=new Map}build(e,t,n){let r=t.queryKey,i=t.queryHash??tn(r,t),a=this.get(i);return a||(a=new on({client:e,queryKey:r,queryHash:i,options:e.defaultQueryOptions(t),state:n,defaultOptions:e.getQueryDefaults(r)}),this.add(a)),a}add(e){this.#e.has(e.queryHash)||(this.#e.set(e.queryHash,e),this.notify({type:`added`,query:e}))}remove(e){this.#e.get(e.queryHash)===e&&(e.destroy(),this.#e.delete(e.queryHash),this.notify({type:`removed`,query:e}))}clear(){dn.batch(()=>{this.getAll().forEach(e=>{this.remove(e)})})}get(e){return this.#e.get(e)}getAll(){return[...this.#e.values()]}find(e){let t={exact:!0,...e};return this.getAll().find(e=>Jt(t,e))}findAll(e={}){let t=this.getAll();return Object.keys(e).length>0?t.filter(t=>Jt(e,t)):t}notify(e){dn.batch(()=>{this.listeners.forEach(t=>{t(e)})})}onFocus(){dn.batch(()=>{this.getAll().forEach(e=>{e.onFocus()})})}onOnline(){dn.batch(()=>{this.getAll().forEach(e=>{e.onOnline()})})}},iO=class{#e;#t;#n;#r;#i;#a;#o;#s;constructor(e={}){this.#e=e.queryCache||new rO,this.#t=e.mutationCache||new tO,this.#n=e.defaultOptions||{},this.#r=new Map,this.#i=new Map,this.#a=0}mount(){this.#a++,this.#a===1&&(this.#o=Qt.subscribe(async e=>{e&&(await this.resumePausedMutations(),this.#e.onFocus())}),this.#s=nn.subscribe(async e=>{e&&(await this.resumePausedMutations(),this.#e.onOnline())}))}unmount(){this.#a--,this.#a===0&&(this.#o?.(),this.#o=void 0,this.#s?.(),this.#s=void 0)}isFetching(e){return this.#e.findAll({...e,fetchStatus:`fetching`}).length}isMutating(e){return this.#t.findAll({...e,status:`pending`}).length}getQueryData(e){let t=this.defaultQueryOptions({queryKey:e});return this.#e.get(t.queryHash)?.state.data}ensureQueryData(e){let t=this.defaultQueryOptions(e),n=this.#e.build(this,t),r=n.state.data;return r===void 0?this.fetchQuery(e):(e.revalidateIfStale&&n.isStaleByTime(Xt(t.staleTime,n))&&this.prefetchQuery(t),Promise.resolve(r))}getQueriesData(e){return this.#e.findAll(e).map(({queryKey:e,state:t})=>[e,t.data])}setQueryData(e,t,n){let r=this.defaultQueryOptions({queryKey:e}),i=this.#e.get(r.queryHash)?.state.data,a=sn(t,i);if(a!==void 0)return this.#e.build(this,r).setData(a,{...n,manual:!0})}setQueriesData(e,t,n){return dn.batch(()=>this.#e.findAll(e).map(({queryKey:e})=>[e,this.setQueryData(e,t,n)]))}getQueryState(e){let t=this.defaultQueryOptions({queryKey:e});return this.#e.get(t.queryHash)?.state}removeQueries(e){let t=this.#e;dn.batch(()=>{t.findAll(e).forEach(e=>{t.remove(e)})})}resetQueries(e,t){let n=this.#e;return dn.batch(()=>{let r=n.findAll(e),i=new Set(r);return r.forEach(e=>{e.reset()}),this.refetchQueries({type:`active`,predicate:e=>i.has(e)},t)})}cancelQueries(e,t={}){let n={revert:!0,...t},r=dn.batch(()=>this.#e.findAll(e).map(e=>e.cancel(n)));return Promise.all(r).then(fn).catch(fn)}invalidateQueries(e,t={}){return dn.batch(()=>(this.#e.findAll(e).forEach(e=>{e.invalidate()}),e?.refetchType===`none`?Promise.resolve():this.refetchQueries({...e,type:e?.refetchType??e?.type??`active`},t)))}refetchQueries(e,t={}){let n={...t,cancelRefetch:t.cancelRefetch??!0},r=dn.batch(()=>this.#e.findAll(e).filter(e=>!e.isDisabled()&&!e.isStatic()).map(e=>{let t=e.fetch(void 0,n);return n.throwOnError||(t=t.catch(fn)),e.state.fetchStatus===`paused`?Promise.resolve():t}));return Promise.all(r).then(fn)}async query(e){let t=this.defaultQueryOptions(e);t.retry===void 0&&(t.retry=!1);let n=this.#e.build(this,t),r=n.isStaleByTime(Xt(t.staleTime,n))?await n.fetch(t):n.state.data,i=t.select;return i?i(r):r}fetchQuery(e){let t=this.defaultQueryOptions(e);t.retry===void 0&&(t.retry=!1);let n=this.#e.build(this,t);return n.isStaleByTime(Xt(t.staleTime,n))?n.fetch(t):Promise.resolve(n.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(fn).catch(fn)}infiniteQuery(e){return e._type=`infinite`,this.query(e)}fetchInfiniteQuery(e){return e._type=`infinite`,this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(fn).catch(fn)}ensureInfiniteQueryData(e){return e._type=`infinite`,this.ensureQueryData(e)}resumePausedMutations(){return nn.isOnline()?this.#t.resumePausedMutations():Promise.resolve()}getQueryCache(){return this.#e}getMutationCache(){return this.#t}getDefaultOptions(){return this.#n}setDefaultOptions(e){this.#n=e}setQueryDefaults(e,t){this.#r.set(rn(e),{queryKey:e,defaultOptions:t})}getQueryDefaults(e){let t=[...this.#r.values()],n={};return t.forEach(t=>{mn(e,t.queryKey)&&Object.assign(n,t.defaultOptions)}),n}setMutationDefaults(e,t){this.#i.set(rn(e),{mutationKey:e,defaultOptions:t})}getMutationDefaults(e){let t=[...this.#i.values()],n={};return t.forEach(t=>{mn(e,t.mutationKey)&&Object.assign(n,t.defaultOptions)}),n}defaultQueryOptions(e){if(e._defaulted)return e;let t={...this.#n.queries,...this.getQueryDefaults(e.queryKey),...e,_defaulted:!0};return t.queryHash||=tn(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===Ut&&(t.enabled=!1),t}defaultMutationOptions(e){return e?._defaulted?e:{...this.#n.mutations,...e?.mutationKey&&this.getMutationDefaults(e.mutationKey),...e,_defaulted:!0}}clear(){this.#e.clear(),this.#t.clear()}};function aO(e,t){return an(e,eO,t)}var oO=new Map([[`bold`,D.createElement(D.Fragment,null,D.createElement(`path`,{d:`M232,44H160a43.86,43.86,0,0,0-32,13.85A43.86,43.86,0,0,0,96,44H24A12,12,0,0,0,12,56V200a12,12,0,0,0,12,12H96a20,20,0,0,1,20,20,12,12,0,0,0,24,0,20,20,0,0,1,20-20h72a12,12,0,0,0,12-12V56A12,12,0,0,0,232,44ZM96,188H36V68H96a20,20,0,0,1,20,20V192.81A43.79,43.79,0,0,0,96,188Zm124,0H160a43.71,43.71,0,0,0-20,4.83V88a20,20,0,0,1,20-20h60Z`}))],[`duotone`,D.createElement(D.Fragment,null,D.createElement(`path`,{d:`M232,56V200H160a32,32,0,0,0-32,32,32,32,0,0,0-32-32H24V56H96a32,32,0,0,1,32,32,32,32,0,0,1,32-32Z`,opacity:`0.2`}),D.createElement(`path`,{d:`M232,48H160a40,40,0,0,0-32,16A40,40,0,0,0,96,48H24a8,8,0,0,0-8,8V200a8,8,0,0,0,8,8H96a24,24,0,0,1,24,24,8,8,0,0,0,16,0,24,24,0,0,1,24-24h72a8,8,0,0,0,8-8V56A8,8,0,0,0,232,48ZM96,192H32V64H96a24,24,0,0,1,24,24V200A39.81,39.81,0,0,0,96,192Zm128,0H160a39.81,39.81,0,0,0-24,8V88a24,24,0,0,1,24-24h64Z`}))],[`fill`,D.createElement(D.Fragment,null,D.createElement(`path`,{d:`M240,56V200a8,8,0,0,1-8,8H160a24,24,0,0,0-24,23.94,7.9,7.9,0,0,1-5.12,7.55A8,8,0,0,1,120,232a24,24,0,0,0-24-24H24a8,8,0,0,1-8-8V56a8,8,0,0,1,8-8H88a32,32,0,0,1,32,32v87.73a8.17,8.17,0,0,0,7.47,8.25,8,8,0,0,0,8.53-8V80a32,32,0,0,1,32-32h64A8,8,0,0,1,240,56Z`}))],[`light`,D.createElement(D.Fragment,null,D.createElement(`path`,{d:`M232,50H160a38,38,0,0,0-32,17.55A38,38,0,0,0,96,50H24a6,6,0,0,0-6,6V200a6,6,0,0,0,6,6H96a26,26,0,0,1,26,26,6,6,0,0,0,12,0,26,26,0,0,1,26-26h72a6,6,0,0,0,6-6V56A6,6,0,0,0,232,50ZM96,194H30V62H96a26,26,0,0,1,26,26V204.31A37.86,37.86,0,0,0,96,194Zm130,0H160a37.87,37.87,0,0,0-26,10.32V88a26,26,0,0,1,26-26h66Z`}))],[`regular`,D.createElement(D.Fragment,null,D.createElement(`path`,{d:`M232,48H160a40,40,0,0,0-32,16A40,40,0,0,0,96,48H24a8,8,0,0,0-8,8V200a8,8,0,0,0,8,8H96a24,24,0,0,1,24,24,8,8,0,0,0,16,0,24,24,0,0,1,24-24h72a8,8,0,0,0,8-8V56A8,8,0,0,0,232,48ZM96,192H32V64H96a24,24,0,0,1,24,24V200A39.81,39.81,0,0,0,96,192Zm128,0H160a39.81,39.81,0,0,0-24,8V88a24,24,0,0,1,24-24h64Z`}))],[`thin`,D.createElement(D.Fragment,null,D.createElement(`path`,{d:`M232,52H160a36,36,0,0,0-32,19.54A36,36,0,0,0,96,52H24a4,4,0,0,0-4,4V200a4,4,0,0,0,4,4H96a28,28,0,0,1,28,28,4,4,0,0,0,8,0,28,28,0,0,1,28-28h72a4,4,0,0,0,4-4V56A4,4,0,0,0,232,52ZM96,196H28V60H96a28,28,0,0,1,28,28V209.4A35.93,35.93,0,0,0,96,196Zm132,0H160a35.94,35.94,0,0,0-28,13.41V88a28,28,0,0,1,28-28h68Z`}))]]),sO=new Map([[`bold`,D.createElement(D.Fragment,null,D.createElement(`path`,{d:`M232.49,215.51,185,168a92.12,92.12,0,1,0-17,17l47.53,47.54a12,12,0,0,0,17-17ZM44,112a68,68,0,1,1,68,68A68.07,68.07,0,0,1,44,112Z`}))],[`duotone`,D.createElement(D.Fragment,null,D.createElement(`path`,{d:`M192,112a80,80,0,1,1-80-80A80,80,0,0,1,192,112Z`,opacity:`0.2`}),D.createElement(`path`,{d:`M229.66,218.34,179.6,168.28a88.21,88.21,0,1,0-11.32,11.31l50.06,50.07a8,8,0,0,0,11.32-11.32ZM40,112a72,72,0,1,1,72,72A72.08,72.08,0,0,1,40,112Z`}))],[`fill`,D.createElement(D.Fragment,null,D.createElement(`path`,{d:`M168,112a56,56,0,1,1-56-56A56,56,0,0,1,168,112Zm61.66,117.66a8,8,0,0,1-11.32,0l-50.06-50.07a88,88,0,1,1,11.32-11.31l50.06,50.06A8,8,0,0,1,229.66,229.66ZM112,184a72,72,0,1,0-72-72A72.08,72.08,0,0,0,112,184Z`}))],[`light`,D.createElement(D.Fragment,null,D.createElement(`path`,{d:`M228.24,219.76l-51.38-51.38a86.15,86.15,0,1,0-8.48,8.48l51.38,51.38a6,6,0,0,0,8.48-8.48ZM38,112a74,74,0,1,1,74,74A74.09,74.09,0,0,1,38,112Z`}))],[`regular`,D.createElement(D.Fragment,null,D.createElement(`path`,{d:`M229.66,218.34l-50.07-50.06a88.11,88.11,0,1,0-11.31,11.31l50.06,50.07a8,8,0,0,0,11.32-11.32ZM40,112a72,72,0,1,1,72,72A72.08,72.08,0,0,1,40,112Z`}))],[`thin`,D.createElement(D.Fragment,null,D.createElement(`path`,{d:`M226.83,221.17l-52.7-52.7a84.1,84.1,0,1,0-5.66,5.66l52.7,52.7a4,4,0,0,0,5.66-5.66ZM36,112a76,76,0,1,1,76,76A76.08,76.08,0,0,1,36,112Z`}))]]),cO=new Map([[`bold`,D.createElement(D.Fragment,null,D.createElement(`path`,{d:`M236.37,139.4a12,12,0,0,0-12-3A84.07,84.07,0,0,1,119.6,31.59a12,12,0,0,0-15-15A108.86,108.86,0,0,0,49.69,55.07,108,108,0,0,0,136,228a107.09,107.09,0,0,0,64.93-21.69,108.86,108.86,0,0,0,38.44-54.94A12,12,0,0,0,236.37,139.4Zm-49.88,47.74A84,84,0,0,1,68.86,69.51,84.93,84.93,0,0,1,92.27,48.29Q92,52.13,92,56A108.12,108.12,0,0,0,200,164q3.87,0,7.71-.27A84.79,84.79,0,0,1,186.49,187.14Z`}))],[`duotone`,D.createElement(D.Fragment,null,D.createElement(`path`,{d:`M227.89,147.89A96,96,0,1,1,108.11,28.11,96.09,96.09,0,0,0,227.89,147.89Z`,opacity:`0.2`}),D.createElement(`path`,{d:`M233.54,142.23a8,8,0,0,0-8-2,88.08,88.08,0,0,1-109.8-109.8,8,8,0,0,0-10-10,104.84,104.84,0,0,0-52.91,37A104,104,0,0,0,136,224a103.09,103.09,0,0,0,62.52-20.88,104.84,104.84,0,0,0,37-52.91A8,8,0,0,0,233.54,142.23ZM188.9,190.34A88,88,0,0,1,65.66,67.11a89,89,0,0,1,31.4-26A106,106,0,0,0,96,56,104.11,104.11,0,0,0,200,160a106,106,0,0,0,14.92-1.06A89,89,0,0,1,188.9,190.34Z`}))],[`fill`,D.createElement(D.Fragment,null,D.createElement(`path`,{d:`M235.54,150.21a104.84,104.84,0,0,1-37,52.91A104,104,0,0,1,32,120,103.09,103.09,0,0,1,52.88,57.48a104.84,104.84,0,0,1,52.91-37,8,8,0,0,1,10,10,88.08,88.08,0,0,0,109.8,109.8,8,8,0,0,1,10,10Z`}))],[`light`,D.createElement(D.Fragment,null,D.createElement(`path`,{d:`M232.13,143.64a6,6,0,0,0-6-1.49A90.07,90.07,0,0,1,113.86,29.85a6,6,0,0,0-7.49-7.48A102.88,102.88,0,0,0,54.48,58.68,102,102,0,0,0,197.32,201.52a102.88,102.88,0,0,0,36.31-51.89A6,6,0,0,0,232.13,143.64Zm-42,48.29a90,90,0,0,1-126-126A90.9,90.9,0,0,1,99.65,37.66,102.06,102.06,0,0,0,218.34,156.35,90.9,90.9,0,0,1,190.1,191.93Z`}))],[`regular`,D.createElement(D.Fragment,null,D.createElement(`path`,{d:`M233.54,142.23a8,8,0,0,0-8-2,88.08,88.08,0,0,1-109.8-109.8,8,8,0,0,0-10-10,104.84,104.84,0,0,0-52.91,37A104,104,0,0,0,136,224a103.09,103.09,0,0,0,62.52-20.88,104.84,104.84,0,0,0,37-52.91A8,8,0,0,0,233.54,142.23ZM188.9,190.34A88,88,0,0,1,65.66,67.11a89,89,0,0,1,31.4-26A106,106,0,0,0,96,56,104.11,104.11,0,0,0,200,160a106,106,0,0,0,14.92-1.06A89,89,0,0,1,188.9,190.34Z`}))],[`thin`,D.createElement(D.Fragment,null,D.createElement(`path`,{d:`M230.72,145.06a4,4,0,0,0-4-1A92.08,92.08,0,0,1,111.94,29.27a4,4,0,0,0-5-5A100.78,100.78,0,0,0,56.08,59.88a100,100,0,0,0,140,140,100.78,100.78,0,0,0,35.59-50.87A4,4,0,0,0,230.72,145.06ZM191.3,193.53A92,92,0,0,1,62.47,64.7a93,93,0,0,1,39.88-30.35,100.09,100.09,0,0,0,119.3,119.3A93,93,0,0,1,191.3,193.53Z`}))]]),lO=new Map([[`bold`,D.createElement(D.Fragment,null,D.createElement(`path`,{d:`M240.49,15.51a12,12,0,0,0-17,0L173.94,65.09l-2.54-2.55a36.05,36.05,0,0,0-50.91,0L100,83l-3.51-3.52a12,12,0,0,0-17,17L83,100,62.54,120.49a36,36,0,0,0,0,50.91l2.55,2.54L15.51,223.51a12,12,0,0,0,17,17l49.57-49.58,2.54,2.55a36.06,36.06,0,0,0,50.91,0L156,173l3.51,3.52a12,12,0,0,0,17-17L173,156l20.49-20.49a36,36,0,0,0,0-50.91l-2.55-2.54,49.58-49.57A12,12,0,0,0,240.49,15.51Zm-121.95,161a12,12,0,0,1-17,0L79.51,154.43a12,12,0,0,1,0-17L100,117l39,39Zm58-57.95h0L156,139l-39-39,20.49-20.49a12,12,0,0,1,17,0l22.06,22.06a12,12,0,0,1,0,17ZM85.27,33.37a12,12,0,0,1,21.46-10.74l8,16A12,12,0,1,1,93.27,49.37Zm-68,57.26a12,12,0,0,1,16.1-5.36l16,8a12,12,0,1,1-10.74,21.46l-16-8A12,12,0,0,1,17.27,90.63Zm221.46,74.74a12,12,0,0,1-16.1,5.36l-16-8a12,12,0,0,1,10.74-21.46l16,8A12,12,0,0,1,238.73,165.37Zm-68,57.26a12,12,0,1,1-21.46,10.74l-8-16a12,12,0,0,1,21.46-10.74Z`}))],[`duotone`,D.createElement(D.Fragment,null,D.createElement(`path`,{d:`M185,127,127,185a24,24,0,0,1-33.94,0L71,162.91A24,24,0,0,1,71,129L129,71a24,24,0,0,1,33.94,0L185,93.09A24,24,0,0,1,185,127Z`,opacity:`0.2`}),D.createElement(`path`,{d:`M237.66,18.34a8,8,0,0,0-11.32,0l-52.4,52.41-5.37-5.38a32.05,32.05,0,0,0-45.26,0L100,88.69l-6.34-6.35A8,8,0,0,0,82.34,93.66L88.69,100,65.37,123.31a32,32,0,0,0,0,45.26l5.38,5.37-52.41,52.4a8,8,0,0,0,11.32,11.32l52.4-52.41,5.37,5.38a32.06,32.06,0,0,0,45.26,0L156,167.31l6.34,6.35a8,8,0,0,0,11.32-11.32L167.31,156l23.32-23.31a32,32,0,0,0,0-45.26l-5.38-5.37,52.41-52.4A8,8,0,0,0,237.66,18.34Zm-116.29,161a16,16,0,0,1-22.62,0L76.69,157.25a16,16,0,0,1,0-22.62L100,111.31,144.69,156Zm57.94-57.94h0L156,144.69,111.31,100l23.32-23.31a16,16,0,0,1,22.62,0l22.06,22a16,16,0,0,1,0,22.63ZM88.57,35A8,8,0,0,1,103.43,29l8,20A8,8,0,0,1,96.57,55ZM24.57,93A8,8,0,0,1,35,88.57l20,8A8,8,0,0,1,49,111.43l-20-8A8,8,0,0,1,24.57,93ZM231.43,163a8,8,0,0,1-10.4,4.46l-20-8A8,8,0,1,1,207,144.57l20,8A8,8,0,0,1,231.43,163Zm-64,58.06A8,8,0,0,1,152.57,227l-8-20A8,8,0,0,1,159.43,201Z`}))],[`fill`,D.createElement(D.Fragment,null,D.createElement(`path`,{d:`M88.57,35A8,8,0,0,1,103.43,29l8,20A8,8,0,0,1,96.57,55ZM29,103.43l20,8A8,8,0,1,0,55,96.57l-20-8A8,8,0,0,0,29,103.43ZM227,152.57l-20-8A8,8,0,1,0,201,159.43l20,8A8,8,0,0,0,227,152.57ZM159.43,201A8,8,0,0,0,144.57,207l8,20A8,8,0,1,0,167.43,221ZM237.91,18.52a8,8,0,0,0-11.5-.18L174,70.75l-5.38-5.38a32,32,0,0,0-45.28,0L106.14,82.54a4,4,0,0,0,0,5.66l61.7,61.66a4,4,0,0,0,5.66,0l16.74-16.74a32.76,32.76,0,0,0,9.81-22.52,31.82,31.82,0,0,0-9.37-23.17l-5.38-5.37,52.2-52.17A8.22,8.22,0,0,0,237.91,18.52ZM85.64,90.34a8,8,0,0,0-11.49.18,8.22,8.22,0,0,0,.41,11.37L80.67,108,65.34,123.31A31.82,31.82,0,0,0,56,146.47,32.75,32.75,0,0,0,65.77,169l5,4.94L18.49,226.13a8.21,8.21,0,0,0-.61,11.1,8,8,0,0,0,11.72.43L82,185.25l5.37,5.38a32.1,32.1,0,0,0,45.29,0L148,175.31l6.34,6.35a8,8,0,0,0,11.32-11.32Z`}))],[`light`,D.createElement(D.Fragment,null,D.createElement(`path`,{d:`M236.24,19.76a6,6,0,0,0-8.48,0L173.94,73.57l-6.79-6.78a30,30,0,0,0-42.42,0L100,91.51l-7.76-7.75a6,6,0,0,0-8.48,8.48L91.51,100,66.79,124.73a30,30,0,0,0,0,42.42l6.78,6.79L19.76,227.76a6,6,0,1,0,8.48,8.48l53.82-53.81,6.79,6.78a30,30,0,0,0,42.42,0L156,164.49l7.76,7.75a6,6,0,0,0,8.48-8.48L164.49,156l24.72-24.73a30,30,0,0,0,0-42.42l-6.78-6.79,53.81-53.82A6,6,0,0,0,236.24,19.76Zm-113.45,161a18,18,0,0,1-25.46,0L75.27,158.67a18,18,0,0,1,0-25.46L100,108.49,147.51,156Zm57.94-57.94L156,147.51,108.49,100l24.72-24.73a18,18,0,0,1,25.46,0l22.06,22.06a18,18,0,0,1,0,25.46ZM90.43,34.23a6,6,0,0,1,11.14-4.46l8,20a6,6,0,1,1-11.14,4.46Zm-64,59.54a6,6,0,0,1,7.8-3.34l20,8a6,6,0,1,1-4.46,11.14l-20-8A6,6,0,0,1,26.43,93.77Zm203.14,68.46a6,6,0,0,1-7.8,3.34l-20-8a6,6,0,0,1,4.46-11.14l20,8A6,6,0,0,1,229.57,162.23Zm-64,59.54a6,6,0,1,1-11.14,4.46l-8-20a6,6,0,0,1,11.14-4.46Z`}))],[`regular`,D.createElement(D.Fragment,null,D.createElement(`path`,{d:`M237.66,18.34a8,8,0,0,0-11.32,0l-52.4,52.41-5.37-5.38a32.05,32.05,0,0,0-45.26,0L100,88.69l-6.34-6.35A8,8,0,0,0,82.34,93.66L88.69,100,65.37,123.31a32,32,0,0,0,0,45.26l5.38,5.37-52.41,52.4a8,8,0,0,0,11.32,11.32l52.4-52.41,5.37,5.38a32,32,0,0,0,45.26,0L156,167.31l6.34,6.35a8,8,0,0,0,11.32-11.32L167.31,156l23.32-23.31a32,32,0,0,0,0-45.26l-5.38-5.37,52.41-52.4A8,8,0,0,0,237.66,18.34Zm-116.29,161a16,16,0,0,1-22.62,0L76.69,157.25a16,16,0,0,1,0-22.62L100,111.31,144.69,156Zm57.94-57.94L156,144.69,111.31,100l23.32-23.31a16,16,0,0,1,22.62,0l22.06,22A16,16,0,0,1,179.31,121.37ZM88.57,35A8,8,0,0,1,103.43,29l8,20A8,8,0,0,1,96.57,55ZM24.57,93A8,8,0,0,1,35,88.57l20,8A8,8,0,0,1,49,111.43l-20-8A8,8,0,0,1,24.57,93ZM231.43,163a8,8,0,0,1-10.4,4.46l-20-8A8,8,0,1,1,207,144.57l20,8A8,8,0,0,1,231.43,163Zm-64,58.06A8,8,0,0,1,152.57,227l-8-20A8,8,0,0,1,159.43,201Z`}))],[`thin`,D.createElement(D.Fragment,null,D.createElement(`path`,{d:`M234.83,21.17a4,4,0,0,0-5.66,0L173.94,76.4l-8.2-8.2a28,28,0,0,0-39.6,0L100,94.34l-9.17-9.17a4,4,0,0,0-5.66,5.66L94.34,100,68.2,126.14a28,28,0,0,0,0,39.6l8.2,8.2L21.17,229.17a4,4,0,0,0,5.66,5.66L82.06,179.6l8.2,8.2a28,28,0,0,0,39.6,0L156,161.66l9.17,9.17a4,4,0,0,0,5.66-5.66L161.66,156l26.14-26.14a28,28,0,0,0,0-39.6l-8.2-8.2,55.23-55.23A4,4,0,0,0,234.83,21.17Zm-110.63,161a20,20,0,0,1-28.28,0L73.86,160.08a20,20,0,0,1,0-28.28L100,105.66,150.34,156Zm57.94-57.94L156,150.34,105.66,100,131.8,73.86a20,20,0,0,1,28.28,0l22.06,22.06A20,20,0,0,1,182.14,124.2ZM92.29,33.49a4,4,0,1,1,7.42-3l8,20a4,4,0,0,1-2.22,5.2A3.91,3.91,0,0,1,104,56a4,4,0,0,1-3.71-2.51Zm-64,61a4,4,0,0,1,5.2-2.22l20,8A4,4,0,0,1,52,108a3.91,3.91,0,0,1-1.49-.29l-20-8A4,4,0,0,1,28.29,94.51Zm199.42,67A4,4,0,0,1,224,164a3.91,3.91,0,0,1-1.49-.29l-20-8a4,4,0,1,1,3-7.42l20,8A4,4,0,0,1,227.71,161.49Zm-64,61a4,4,0,0,1-2.22,5.2A3.91,3.91,0,0,1,160,228a4,4,0,0,1-3.71-2.51l-8-20a4,4,0,0,1,7.42-3Z`}))]]),uO=new Map([[`bold`,D.createElement(D.Fragment,null,D.createElement(`path`,{d:`M228,128a12,12,0,0,1-12,12H140v76a12,12,0,0,1-24,0V140H40a12,12,0,0,1,0-24h76V40a12,12,0,0,1,24,0v76h76A12,12,0,0,1,228,128Z`}))],[`duotone`,D.createElement(D.Fragment,null,D.createElement(`path`,{d:`M216,56V200a16,16,0,0,1-16,16H56a16,16,0,0,1-16-16V56A16,16,0,0,1,56,40H200A16,16,0,0,1,216,56Z`,opacity:`0.2`}),D.createElement(`path`,{d:`M224,128a8,8,0,0,1-8,8H136v80a8,8,0,0,1-16,0V136H40a8,8,0,0,1,0-16h80V40a8,8,0,0,1,16,0v80h80A8,8,0,0,1,224,128Z`}))],[`fill`,D.createElement(D.Fragment,null,D.createElement(`path`,{d:`M208,32H48A16,16,0,0,0,32,48V208a16,16,0,0,0,16,16H208a16,16,0,0,0,16-16V48A16,16,0,0,0,208,32ZM184,136H136v48a8,8,0,0,1-16,0V136H72a8,8,0,0,1,0-16h48V72a8,8,0,0,1,16,0v48h48a8,8,0,0,1,0,16Z`}))],[`light`,D.createElement(D.Fragment,null,D.createElement(`path`,{d:`M222,128a6,6,0,0,1-6,6H134v82a6,6,0,0,1-12,0V134H40a6,6,0,0,1,0-12h82V40a6,6,0,0,1,12,0v82h82A6,6,0,0,1,222,128Z`}))],[`regular`,D.createElement(D.Fragment,null,D.createElement(`path`,{d:`M224,128a8,8,0,0,1-8,8H136v80a8,8,0,0,1-16,0V136H40a8,8,0,0,1,0-16h80V40a8,8,0,0,1,16,0v80h80A8,8,0,0,1,224,128Z`}))],[`thin`,D.createElement(D.Fragment,null,D.createElement(`path`,{d:`M220,128a4,4,0,0,1-4,4H132v84a4,4,0,0,1-8,0V132H40a4,4,0,0,1,0-8h84V40a4,4,0,0,1,8,0v84h84A4,4,0,0,1,220,128Z`}))]]),dO=new Map([[`bold`,D.createElement(D.Fragment,null,D.createElement(`path`,{d:`M124,216a12,12,0,0,1-12,12H48a12,12,0,0,1-12-12V40A12,12,0,0,1,48,28h64a12,12,0,0,1,0,24H60V204h52A12,12,0,0,1,124,216Zm108.49-96.49-40-40a12,12,0,0,0-17,17L195,116H112a12,12,0,0,0,0,24h83l-19.52,19.51a12,12,0,0,0,17,17l40-40A12,12,0,0,0,232.49,119.51Z`}))],[`duotone`,D.createElement(D.Fragment,null,D.createElement(`path`,{d:`M224,56V200a16,16,0,0,1-16,16H48V40H208A16,16,0,0,1,224,56Z`,opacity:`0.2`}),D.createElement(`path`,{d:`M120,216a8,8,0,0,1-8,8H48a8,8,0,0,1-8-8V40a8,8,0,0,1,8-8h64a8,8,0,0,1,0,16H56V208h56A8,8,0,0,1,120,216Zm109.66-93.66-40-40a8,8,0,0,0-11.32,11.32L204.69,120H112a8,8,0,0,0,0,16h92.69l-26.35,26.34a8,8,0,0,0,11.32,11.32l40-40A8,8,0,0,0,229.66,122.34Z`}))],[`fill`,D.createElement(D.Fragment,null,D.createElement(`path`,{d:`M120,216a8,8,0,0,1-8,8H48a8,8,0,0,1-8-8V40a8,8,0,0,1,8-8h64a8,8,0,0,1,0,16H56V208h56A8,8,0,0,1,120,216Zm109.66-93.66-40-40A8,8,0,0,0,176,88v32H112a8,8,0,0,0,0,16h64v32a8,8,0,0,0,13.66,5.66l40-40A8,8,0,0,0,229.66,122.34Z`}))],[`light`,D.createElement(D.Fragment,null,D.createElement(`path`,{d:`M118,216a6,6,0,0,1-6,6H48a6,6,0,0,1-6-6V40a6,6,0,0,1,6-6h64a6,6,0,0,1,0,12H54V210h58A6,6,0,0,1,118,216Zm110.24-92.24-40-40a6,6,0,0,0-8.48,8.48L209.51,122H112a6,6,0,0,0,0,12h97.51l-29.75,29.76a6,6,0,1,0,8.48,8.48l40-40A6,6,0,0,0,228.24,123.76Z`}))],[`regular`,D.createElement(D.Fragment,null,D.createElement(`path`,{d:`M120,216a8,8,0,0,1-8,8H48a8,8,0,0,1-8-8V40a8,8,0,0,1,8-8h64a8,8,0,0,1,0,16H56V208h56A8,8,0,0,1,120,216Zm109.66-93.66-40-40a8,8,0,0,0-11.32,11.32L204.69,120H112a8,8,0,0,0,0,16h92.69l-26.35,26.34a8,8,0,0,0,11.32,11.32l40-40A8,8,0,0,0,229.66,122.34Z`}))],[`thin`,D.createElement(D.Fragment,null,D.createElement(`path`,{d:`M116,216a4,4,0,0,1-4,4H48a4,4,0,0,1-4-4V40a4,4,0,0,1,4-4h64a4,4,0,0,1,0,8H52V212h60A4,4,0,0,1,116,216Zm110.83-90.83-40-40a4,4,0,0,0-5.66,5.66L214.34,124H112a4,4,0,0,0,0,8H214.34l-33.17,33.17a4,4,0,0,0,5.66,5.66l40-40A4,4,0,0,0,226.83,125.17Z`}))]]),fO=new Map([[`bold`,D.createElement(D.Fragment,null,D.createElement(`path`,{d:`M199,125.31l-49.88-18.39L130.69,57a19.92,19.92,0,0,0-37.38,0L74.92,106.92,25,125.31a19.92,19.92,0,0,0,0,37.38l49.88,18.39L93.31,231a19.92,19.92,0,0,0,37.38,0l18.39-49.88L199,162.69a19.92,19.92,0,0,0,0-37.38Zm-63.38,35.16a12,12,0,0,0-7.11,7.11L112,212.28l-16.47-44.7a12,12,0,0,0-7.11-7.11L43.72,144l44.7-16.47a12,12,0,0,0,7.11-7.11L112,75.72l16.47,44.7a12,12,0,0,0,7.11,7.11L180.28,144ZM140,40a12,12,0,0,1,12-12h12V16a12,12,0,0,1,24,0V28h12a12,12,0,0,1,0,24H188V64a12,12,0,0,1-24,0V52H152A12,12,0,0,1,140,40ZM252,88a12,12,0,0,1-12,12h-4v4a12,12,0,0,1-24,0v-4h-4a12,12,0,0,1,0-24h4V72a12,12,0,0,1,24,0v4h4A12,12,0,0,1,252,88Z`}))],[`duotone`,D.createElement(D.Fragment,null,D.createElement(`path`,{d:`M194.82,151.43l-55.09,20.3-20.3,55.09a7.92,7.92,0,0,1-14.86,0l-20.3-55.09-55.09-20.3a7.92,7.92,0,0,1,0-14.86l55.09-20.3,20.3-55.09a7.92,7.92,0,0,1,14.86,0l20.3,55.09,55.09,20.3A7.92,7.92,0,0,1,194.82,151.43Z`,opacity:`0.2`}),D.createElement(`path`,{d:`M197.58,129.06,146,110l-19-51.62a15.92,15.92,0,0,0-29.88,0L78,110l-51.62,19a15.92,15.92,0,0,0,0,29.88L78,178l19,51.62a15.92,15.92,0,0,0,29.88,0L146,178l51.62-19a15.92,15.92,0,0,0,0-29.88ZM137,164.22a8,8,0,0,0-4.74,4.74L112,223.85,91.78,169A8,8,0,0,0,87,164.22L32.15,144,87,123.78A8,8,0,0,0,91.78,119L112,64.15,132.22,119a8,8,0,0,0,4.74,4.74L191.85,144ZM144,40a8,8,0,0,1,8-8h16V16a8,8,0,0,1,16,0V32h16a8,8,0,0,1,0,16H184V64a8,8,0,0,1-16,0V48H152A8,8,0,0,1,144,40ZM248,88a8,8,0,0,1-8,8h-8v8a8,8,0,0,1-16,0V96h-8a8,8,0,0,1,0-16h8V72a8,8,0,0,1,16,0v8h8A8,8,0,0,1,248,88Z`}))],[`fill`,D.createElement(D.Fragment,null,D.createElement(`path`,{d:`M208,144a15.78,15.78,0,0,1-10.42,14.94L146,178l-19,51.62a15.92,15.92,0,0,1-29.88,0L78,178l-51.62-19a15.92,15.92,0,0,1,0-29.88L78,110l19-51.62a15.92,15.92,0,0,1,29.88,0L146,110l51.62,19A15.78,15.78,0,0,1,208,144ZM152,48h16V64a8,8,0,0,0,16,0V48h16a8,8,0,0,0,0-16H184V16a8,8,0,0,0-16,0V32H152a8,8,0,0,0,0,16Zm88,32h-8V72a8,8,0,0,0-16,0v8h-8a8,8,0,0,0,0,16h8v8a8,8,0,0,0,16,0V96h8a8,8,0,0,0,0-16Z`}))],[`light`,D.createElement(D.Fragment,null,D.createElement(`path`,{d:`M196.89,130.94,144.4,111.6,125.06,59.11a13.92,13.92,0,0,0-26.12,0L79.6,111.6,27.11,130.94a13.92,13.92,0,0,0,0,26.12L79.6,176.4l19.34,52.49a13.92,13.92,0,0,0,26.12,0L144.4,176.4l52.49-19.34a13.92,13.92,0,0,0,0-26.12Zm-4.15,14.86-55.08,20.3a6,6,0,0,0-3.56,3.56l-20.3,55.08a1.92,1.92,0,0,1-3.6,0L89.9,169.66a6,6,0,0,0-3.56-3.56L31.26,145.8a1.92,1.92,0,0,1,0-3.6l55.08-20.3a6,6,0,0,0,3.56-3.56l20.3-55.08a1.92,1.92,0,0,1,3.6,0l20.3,55.08a6,6,0,0,0,3.56,3.56l55.08,20.3a1.92,1.92,0,0,1,0,3.6ZM146,40a6,6,0,0,1,6-6h18V16a6,6,0,0,1,12,0V34h18a6,6,0,0,1,0,12H182V64a6,6,0,0,1-12,0V46H152A6,6,0,0,1,146,40ZM246,88a6,6,0,0,1-6,6H230v10a6,6,0,0,1-12,0V94H208a6,6,0,0,1,0-12h10V72a6,6,0,0,1,12,0V82h10A6,6,0,0,1,246,88Z`}))],[`regular`,D.createElement(D.Fragment,null,D.createElement(`path`,{d:`M197.58,129.06,146,110l-19-51.62a15.92,15.92,0,0,0-29.88,0L78,110l-51.62,19a15.92,15.92,0,0,0,0,29.88L78,178l19,51.62a15.92,15.92,0,0,0,29.88,0L146,178l51.62-19a15.92,15.92,0,0,0,0-29.88ZM137,164.22a8,8,0,0,0-4.74,4.74L112,223.85,91.78,169A8,8,0,0,0,87,164.22L32.15,144,87,123.78A8,8,0,0,0,91.78,119L112,64.15,132.22,119a8,8,0,0,0,4.74,4.74L191.85,144ZM144,40a8,8,0,0,1,8-8h16V16a8,8,0,0,1,16,0V32h16a8,8,0,0,1,0,16H184V64a8,8,0,0,1-16,0V48H152A8,8,0,0,1,144,40ZM248,88a8,8,0,0,1-8,8h-8v8a8,8,0,0,1-16,0V96h-8a8,8,0,0,1,0-16h8V72a8,8,0,0,1,16,0v8h8A8,8,0,0,1,248,88Z`}))],[`thin`,D.createElement(D.Fragment,null,D.createElement(`path`,{d:`M196.2,132.81l-53.36-19.65L123.19,59.8a11.93,11.93,0,0,0-22.38,0L81.16,113.16,27.8,132.81a11.93,11.93,0,0,0,0,22.38l53.36,19.65,19.65,53.36a11.93,11.93,0,0,0,22.38,0l19.65-53.36,53.36-19.65a11.93,11.93,0,0,0,0-22.38Zm-2.77,14.87L138.35,168a4,4,0,0,0-2.37,2.37l-20.3,55.08a3.92,3.92,0,0,1-7.36,0L88,170.35A4,4,0,0,0,85.65,168l-55.08-20.3a3.92,3.92,0,0,1,0-7.36L85.65,120A4,4,0,0,0,88,117.65l20.3-55.08a3.92,3.92,0,0,1,7.36,0L136,117.65a4,4,0,0,0,2.37,2.37l55.08,20.3a3.92,3.92,0,0,1,0,7.36ZM148,40a4,4,0,0,1,4-4h20V16a4,4,0,0,1,8,0V36h20a4,4,0,0,1,0,8H180V64a4,4,0,0,1-8,0V44H152A4,4,0,0,1,148,40Zm96,48a4,4,0,0,1-4,4H228v12a4,4,0,0,1-8,0V92H208a4,4,0,0,1,0-8h12V72a4,4,0,0,1,8,0V84h12A4,4,0,0,1,244,88Z`}))]]),pO=new Map([[`bold`,D.createElement(D.Fragment,null,D.createElement(`path`,{d:`M116,36V20a12,12,0,0,1,24,0V36a12,12,0,0,1-24,0Zm80,92a68,68,0,1,1-68-68A68.07,68.07,0,0,1,196,128Zm-24,0a44,44,0,1,0-44,44A44.05,44.05,0,0,0,172,128ZM51.51,68.49a12,12,0,1,0,17-17l-12-12a12,12,0,0,0-17,17Zm0,119-12,12a12,12,0,0,0,17,17l12-12a12,12,0,1,0-17-17ZM196,72a12,12,0,0,0,8.49-3.51l12-12a12,12,0,0,0-17-17l-12,12A12,12,0,0,0,196,72Zm8.49,115.51a12,12,0,0,0-17,17l12,12a12,12,0,0,0,17-17ZM48,128a12,12,0,0,0-12-12H20a12,12,0,0,0,0,24H36A12,12,0,0,0,48,128Zm80,80a12,12,0,0,0-12,12v16a12,12,0,0,0,24,0V220A12,12,0,0,0,128,208Zm108-92H220a12,12,0,0,0,0,24h16a12,12,0,0,0,0-24Z`}))],[`duotone`,D.createElement(D.Fragment,null,D.createElement(`path`,{d:`M184,128a56,56,0,1,1-56-56A56,56,0,0,1,184,128Z`,opacity:`0.2`}),D.createElement(`path`,{d:`M120,40V16a8,8,0,0,1,16,0V40a8,8,0,0,1-16,0Zm72,88a64,64,0,1,1-64-64A64.07,64.07,0,0,1,192,128Zm-16,0a48,48,0,1,0-48,48A48.05,48.05,0,0,0,176,128ZM58.34,69.66A8,8,0,0,0,69.66,58.34l-16-16A8,8,0,0,0,42.34,53.66Zm0,116.68-16,16a8,8,0,0,0,11.32,11.32l16-16a8,8,0,0,0-11.32-11.32ZM192,72a8,8,0,0,0,5.66-2.34l16-16a8,8,0,0,0-11.32-11.32l-16,16A8,8,0,0,0,192,72Zm5.66,114.34a8,8,0,0,0-11.32,11.32l16,16a8,8,0,0,0,11.32-11.32ZM48,128a8,8,0,0,0-8-8H16a8,8,0,0,0,0,16H40A8,8,0,0,0,48,128Zm80,80a8,8,0,0,0-8,8v24a8,8,0,0,0,16,0V216A8,8,0,0,0,128,208Zm112-88H216a8,8,0,0,0,0,16h24a8,8,0,0,0,0-16Z`}))],[`fill`,D.createElement(D.Fragment,null,D.createElement(`path`,{d:`M120,40V16a8,8,0,0,1,16,0V40a8,8,0,0,1-16,0Zm8,24a64,64,0,1,0,64,64A64.07,64.07,0,0,0,128,64ZM58.34,69.66A8,8,0,0,0,69.66,58.34l-16-16A8,8,0,0,0,42.34,53.66Zm0,116.68-16,16a8,8,0,0,0,11.32,11.32l16-16a8,8,0,0,0-11.32-11.32ZM192,72a8,8,0,0,0,5.66-2.34l16-16a8,8,0,0,0-11.32-11.32l-16,16A8,8,0,0,0,192,72Zm5.66,114.34a8,8,0,0,0-11.32,11.32l16,16a8,8,0,0,0,11.32-11.32ZM48,128a8,8,0,0,0-8-8H16a8,8,0,0,0,0,16H40A8,8,0,0,0,48,128Zm80,80a8,8,0,0,0-8,8v24a8,8,0,0,0,16,0V216A8,8,0,0,0,128,208Zm112-88H216a8,8,0,0,0,0,16h24a8,8,0,0,0,0-16Z`}))],[`light`,D.createElement(D.Fragment,null,D.createElement(`path`,{d:`M122,40V16a6,6,0,0,1,12,0V40a6,6,0,0,1-12,0Zm68,88a62,62,0,1,1-62-62A62.07,62.07,0,0,1,190,128Zm-12,0a50,50,0,1,0-50,50A50.06,50.06,0,0,0,178,128ZM59.76,68.24a6,6,0,1,0,8.48-8.48l-16-16a6,6,0,0,0-8.48,8.48Zm0,119.52-16,16a6,6,0,1,0,8.48,8.48l16-16a6,6,0,1,0-8.48-8.48ZM192,70a6,6,0,0,0,4.24-1.76l16-16a6,6,0,0,0-8.48-8.48l-16,16A6,6,0,0,0,192,70Zm4.24,117.76a6,6,0,0,0-8.48,8.48l16,16a6,6,0,0,0,8.48-8.48ZM46,128a6,6,0,0,0-6-6H16a6,6,0,0,0,0,12H40A6,6,0,0,0,46,128Zm82,82a6,6,0,0,0-6,6v24a6,6,0,0,0,12,0V216A6,6,0,0,0,128,210Zm112-88H216a6,6,0,0,0,0,12h24a6,6,0,0,0,0-12Z`}))],[`regular`,D.createElement(D.Fragment,null,D.createElement(`path`,{d:`M120,40V16a8,8,0,0,1,16,0V40a8,8,0,0,1-16,0Zm72,88a64,64,0,1,1-64-64A64.07,64.07,0,0,1,192,128Zm-16,0a48,48,0,1,0-48,48A48.05,48.05,0,0,0,176,128ZM58.34,69.66A8,8,0,0,0,69.66,58.34l-16-16A8,8,0,0,0,42.34,53.66Zm0,116.68-16,16a8,8,0,0,0,11.32,11.32l16-16a8,8,0,0,0-11.32-11.32ZM192,72a8,8,0,0,0,5.66-2.34l16-16a8,8,0,0,0-11.32-11.32l-16,16A8,8,0,0,0,192,72Zm5.66,114.34a8,8,0,0,0-11.32,11.32l16,16a8,8,0,0,0,11.32-11.32ZM48,128a8,8,0,0,0-8-8H16a8,8,0,0,0,0,16H40A8,8,0,0,0,48,128Zm80,80a8,8,0,0,0-8,8v24a8,8,0,0,0,16,0V216A8,8,0,0,0,128,208Zm112-88H216a8,8,0,0,0,0,16h24a8,8,0,0,0,0-16Z`}))],[`thin`,D.createElement(D.Fragment,null,D.createElement(`path`,{d:`M124,40V16a4,4,0,0,1,8,0V40a4,4,0,0,1-8,0Zm64,88a60,60,0,1,1-60-60A60.07,60.07,0,0,1,188,128Zm-8,0a52,52,0,1,0-52,52A52.06,52.06,0,0,0,180,128ZM61.17,66.83a4,4,0,0,0,5.66-5.66l-16-16a4,4,0,0,0-5.66,5.66Zm0,122.34-16,16a4,4,0,0,0,5.66,5.66l16-16a4,4,0,0,0-5.66-5.66ZM192,68a4,4,0,0,0,2.83-1.17l16-16a4,4,0,1,0-5.66-5.66l-16,16A4,4,0,0,0,192,68Zm2.83,121.17a4,4,0,0,0-5.66,5.66l16,16a4,4,0,0,0,5.66-5.66ZM40,124H16a4,4,0,0,0,0,8H40a4,4,0,0,0,0-8Zm88,88a4,4,0,0,0-4,4v24a4,4,0,0,0,8,0V216A4,4,0,0,0,128,212Zm112-88H216a4,4,0,0,0,0,8h24a4,4,0,0,0,0-8Z`}))]]),mO=D.forwardRef((e,t)=>D.createElement(w,{ref:t,...e,weights:oO}));mO.displayName=`BookOpenIcon`;var hO=mO,gO=D.forwardRef((e,t)=>D.createElement(w,{ref:t,...e,weights:sO}));gO.displayName=`MagnifyingGlassIcon`;var _O=gO,vO=D.forwardRef((e,t)=>D.createElement(w,{ref:t,...e,weights:cO}));vO.displayName=`MoonIcon`;var yO=vO,bO=D.forwardRef((e,t)=>D.createElement(w,{ref:t,...e,weights:lO}));bO.displayName=`PlugsConnectedIcon`;var xO=bO,SO=D.forwardRef((e,t)=>D.createElement(w,{ref:t,...e,weights:uO}));SO.displayName=`PlusIcon`;var CO=SO,wO=D.forwardRef((e,t)=>D.createElement(w,{ref:t,...e,weights:dO}));wO.displayName=`SignOutIcon`;var TO=wO,EO=D.forwardRef((e,t)=>D.createElement(w,{ref:t,...e,weights:fO}));EO.displayName=`SparkleIcon`;var DO=EO,OO=D.forwardRef((e,t)=>D.createElement(w,{ref:t,...e,weights:pO}));OO.displayName=`SunIcon`;var kO=OO,AO=[`agent-threads`];async function jO(e){let t=await gn(e);if(!t.ok)throw Error(`Request failed (${t.status})`);return t.json()}var MO=[];for(let e=0;e<256;++e)MO.push((e+256).toString(16).slice(1));function NO(e,t=0){return(MO[e[t+0]]+MO[e[t+1]]+MO[e[t+2]]+MO[e[t+3]]+`-`+MO[e[t+4]]+MO[e[t+5]]+`-`+MO[e[t+6]]+MO[e[t+7]]+`-`+MO[e[t+8]]+MO[e[t+9]]+`-`+MO[e[t+10]]+MO[e[t+11]]+MO[e[t+12]]+MO[e[t+13]]+MO[e[t+14]]+MO[e[t+15]]).toLowerCase()}var PO=new Uint8Array(16);function FO(){return crypto.getRandomValues(PO)}var IO={};function LO(e,t,n){let r;if(e)r=zO(e.random??e.rng?.()??FO(),e.msecs,e.seq,t,n);else{let e=Date.now(),i=FO();RO(IO,e,i),r=zO(i,IO.msecs,IO.seq,t,n)}return t??NO(r)}function RO(e,t,n){return e.msecs??=-1/0,e.seq??=0,t>e.msecs?(e.seq=BO(n),e.msecs=t):(e.seq=e.seq+1|0,e.seq===0&&e.msecs++),e}function zO(e,t,n,r,i=0){if(e.length<16)throw Error(`Random bytes length must be >= 16`);if(!r)r=new Uint8Array(16),i=0;else if(i<0||i+16>r.length)throw RangeError(`UUID byte range ${i}:${i+15} is out of buffer bounds`);return t??=Date.now(),n??=BO(e),r[i++]=t/1099511627776&255,r[i++]=t/4294967296&255,r[i++]=t/16777216&255,r[i++]=t/65536&255,r[i++]=t/256&255,r[i++]=t&255,r[i++]=112|n>>>28&15,r[i++]=n>>>20&255,r[i++]=128|n>>>14&63,r[i++]=n>>>6&255,r[i++]=n<<2&255|e[10]&3,r[i++]=e[11],r[i++]=e[12],r[i++]=e[13],r[i++]=e[14],r[i++]=e[15],r}function BO(e){return(e[6]&127)<<24|e[7]<<16|e[8]<<8|e[9]}function VO(){return LO()}function HO(){let{setColorScheme:e}=Vt(),t=Ht(`light`,{getInitialValueInEffect:!0}),n=t===`dark`?`light`:`dark`,[r,i]=(0,D.useState)(!1);return(0,O.jsx)(zt,{label:`Switch to ${n} theme`,opened:r,children:(0,O.jsx)(We,{variant:`subtle`,color:`gray`,"aria-label":`Switch to ${n} theme`,onMouseEnter:()=>i(!0),onMouseLeave:()=>i(!1),onFocus:()=>i(!0),onBlur:()=>i(!1),onClick:()=>{i(!1),e(n)},children:t===`dark`?(0,O.jsx)(kO,{size:17,weight:`bold`}):(0,O.jsx)(yO,{size:17,weight:`bold`})})})}var UO={home:`https://fanout.run/start/what-fanout-is`,ingest:`https://fanout.run/start/send-telemetry`};async function WO(e,t){let n=new URLSearchParams({page_size:`30`});e&&n.set(`q`,e),t&&n.set(`cursor`,t);let r=await gn(`/api/agent/threads?${n}`);if(!r.ok)throw Error(`Unable to load chats (${r.status})`);return r.json()}function GO({agentAvailable:e,activeThreadID:t,activeDashboardID:n,autoFocusSearch:r=!1,onNewChat:i,onSelectThread:a,onDeletedThread:o,onSelectDashboard:s,onCreateDashboard:c,onInvestigateService:l,ref:u}){let d=qt(),[f,p]=(0,D.useState)(``),[m]=ca(f.trim(),250),[h,g]=(0,D.useState)(null),[_,v]=(0,D.useState)(null),[y,b]=(0,D.useState)(``),[x,S]=(0,D.useState)(``),[te,C]=(0,D.useState)(!1),ne=(0,D.useRef)(null);(0,D.useImperativeHandle)(u,()=>({focusSearch:()=>ne.current?.focus()}),[]),(0,D.useEffect)(()=>{r&&requestAnimationFrame(()=>ne.current?.focus())},[r]);let ie=aO({queryKey:[...AO,m],queryFn:({pageParam:e})=>WO(m,e),initialPageParam:``,getNextPageParam:e=>e.next_cursor??void 0,enabled:e}),w=un({queryKey:ut,queryFn:it,refetchInterval:3e4,staleTime:ot}),ae=(0,D.useMemo)(()=>ie.data?.pages.flatMap(e=>e.items)??[],[ie.data]),le=(0,D.useMemo)(()=>ZO(ae),[ae]),ue=un({queryKey:[`telemetry-schema`,`1h`],queryFn:()=>jO(`/api/telemetry/schema?window=1h`),enabled:!!m&&!!l,staleTime:6e4}),de=(0,D.useMemo)(()=>{if(!m)return[];let e=m.toLowerCase();return(ue.data?.services??[]).map(e=>e.value).filter(t=>t.toLowerCase().includes(e)).slice(0,6)},[ue.data,m]),fe=(0,D.useMemo)(()=>{let e=w.data??[],t=m.toLowerCase();return t?e.filter(e=>e.name.toLowerCase().includes(t)):e},[w.data,m]);function pe(e){S(``),b(e.title),g(e)}async function T(){if(h&&y.trim()){C(!0),S(``);try{let e=await gn(`/api/agent/threads/${encodeURIComponent(h.id)}`,{method:`PATCH`,headers:{"Content-Type":`application/json`},body:JSON.stringify({title:y.trim()})});if(!e.ok)throw Error(`Unable to rename chat (${e.status})`);await d.invalidateQueries({queryKey:AO}),g(null)}catch(e){S(e instanceof Error?e.message:`Unable to rename this chat.`)}finally{C(!1)}}}async function me(){if(_){C(!0),S(``);try{let e=await gn(`/api/agent/threads/${encodeURIComponent(_.id)}`,{method:`DELETE`});if(!e.ok)throw Error(`Unable to delete chat (${e.status})`);let t=_.id;v(null),await d.invalidateQueries({queryKey:AO}),await d.invalidateQueries({queryKey:ut}),o(t)}catch(e){S(e instanceof Error?e.message:`Unable to delete this chat.`)}finally{C(!1)}}}return(0,O.jsxs)(oe,{gap:`sm`,h:`100%`,component:`nav`,"aria-label":`Navigation`,children:[e&&(0,O.jsx)(se,{leftSection:(0,O.jsx)(CO,{size:16,weight:`bold`}),onClick:i,children:`New chat`}),(0,O.jsx)(Rt,{type:`auto`,offsetScrollbars:!0,flex:1,mx:-4,px:4,children:(0,O.jsxs)(oe,{gap:`lg`,pb:`sm`,children:[e&&(0,O.jsxs)(oe,{gap:4,children:[(0,O.jsx)(KO,{children:`Chats`}),ie.isLoading&&(0,O.jsx)(be,{py:`md`,children:(0,O.jsx)(Ce,{size:`xs`})}),ie.isError&&(0,O.jsx)(he,{color:`bad`,radius:`md`,p:`xs`,children:`Chats could not be loaded.`}),!ie.isLoading&&!ie.isError&&ae.length===0&&(0,O.jsx)(ce,{c:`dimmed`,size:`sm`,px:`sm`,py:`xs`,children:m?`No matching chats`:`No chats yet`}),le.map(e=>(0,O.jsxs)(oe,{gap:2,children:[le.length>1&&(0,O.jsx)(ce,{c:`dimmed`,size:`xs`,px:`sm`,pt:4,children:e.label}),e.threads.map(e=>(0,O.jsx)(qO,{thread:e,active:e.id===t,onSelect:()=>a(e.id),onRename:()=>pe(e),onDelete:()=>{S(``),v(e)}},e.id))]},e.label)),ie.hasNextPage&&(0,O.jsx)(se,{variant:`subtle`,color:`gray`,size:`compact-sm`,loading:ie.isFetchingNextPage,onClick:()=>void ie.fetchNextPage(),children:`See all`})]}),m&&l&&ue.isLoading&&(0,O.jsx)(be,{py:`md`,children:(0,O.jsx)(Ce,{size:`xs`})}),m&&l&&(ue.isSuccess||ue.isError)&&(0,O.jsxs)(oe,{gap:4,children:[(0,O.jsx)(KO,{children:`Services`}),ue.isError&&(0,O.jsx)(ce,{c:`dimmed`,size:`sm`,px:`sm`,children:`Services could not be searched`}),ue.isSuccess&&de.length===0&&(0,O.jsx)(ce,{c:`dimmed`,size:`sm`,px:`sm`,children:`No matching services`}),de.map(e=>(0,O.jsx)(ee,{className:`rail-row`,p:`sm`,onClick:()=>l(e),children:(0,O.jsx)(ce,{size:`sm`,fw:500,truncate:!0,children:e})},e))]}),(0,O.jsxs)(oe,{gap:4,children:[(0,O.jsx)(KO,{children:`Dashboards`}),w.isLoading&&(0,O.jsx)(be,{py:`md`,children:(0,O.jsx)(Ce,{size:`xs`})}),w.isError&&(0,O.jsx)(he,{color:`bad`,radius:`md`,p:`xs`,children:`Dashboards could not be loaded.`}),!w.isLoading&&!w.isError&&m&&fe.length===0&&(0,O.jsx)(ce,{c:`dimmed`,size:`sm`,px:`sm`,py:`xs`,children:`No matching dashboards`}),fe.map(e=>{let t=e.id===n;return(0,O.jsxs)(oe,{gap:0,children:[(0,O.jsx)(ee,{component:`a`,href:`/dashboards/${encodeURIComponent(e.id)}`,className:`rail-row`,"data-active":t||void 0,"aria-current":t?`page`:void 0,p:`sm`,onClick:t=>{t.button!==0||t.metaKey||t.ctrlKey||t.shiftKey||t.altKey||(t.preventDefault(),s(e.id))},children:(0,O.jsxs)(re,{justify:`space-between`,gap:`sm`,wrap:`nowrap`,children:[(0,O.jsx)(ce,{size:`sm`,fw:t?600:500,truncate:!0,children:e.name}),e.is_default&&(0,O.jsx)(Je,{size:`xs`,variant:`light`,color:`gray`,children:`Default`})]})}),e.origin&&(0,O.jsx)(ee,{component:`a`,href:`/chat/${encodeURIComponent(e.origin.thread_id)}`,"data-request-provenance":!0,px:`sm`,pb:`xs`,onClick:t=>{t.button!==0||t.metaKey||t.ctrlKey||t.shiftKey||t.altKey||(t.preventDefault(),a(e.origin.thread_id))},children:(0,O.jsxs)(ce,{size:`xs`,c:`dimmed`,lineClamp:2,children:[`Built from: `,e.origin.request_excerpt]})})]},e.id)}),e&&(0,O.jsx)(se,{variant:`subtle`,color:`gray`,size:`compact-sm`,justify:`flex-start`,leftSection:(0,O.jsx)(DO,{size:14,weight:`fill`}),onClick:c,children:w.data?.length===0?`New dashboard`:`Create with AI`})]})]})}),(0,O.jsx)(yn,{ref:ne,value:f,onChange:e=>p(e.currentTarget.value),leftSection:(0,O.jsx)(_O,{size:15}),rightSection:(0,O.jsx)(dt,{size:`xs`,children:`⌘K`}),rightSectionWidth:44,placeholder:`Search`,"aria-label":`Search chats, dashboards and services`,size:`sm`}),(0,O.jsx)(Wt,{opened:h!==null,onClose:()=>!te&&g(null),title:`Rename chat`,centered:!0,children:(0,O.jsx)(`form`,{onSubmit:e=>{e.preventDefault(),T()},children:(0,O.jsxs)(oe,{children:[(0,O.jsx)(yn,{label:`Name`,value:y,onChange:e=>b(e.currentTarget.value),maxLength:120,autoFocus:!0}),x&&(0,O.jsx)(he,{color:`bad`,children:x}),(0,O.jsxs)(re,{justify:`flex-end`,children:[(0,O.jsx)(se,{variant:`default`,onClick:()=>g(null),disabled:te,children:`Cancel`}),(0,O.jsx)(se,{type:`submit`,loading:te,disabled:!y.trim(),children:`Save`})]})]})})}),(0,O.jsx)(Wt,{opened:_!==null,onClose:()=>!te&&v(null),title:`Delete chat?`,centered:!0,children:(0,O.jsxs)(oe,{children:[(0,O.jsxs)(ce,{size:`sm`,children:[`This permanently removes `,(0,O.jsx)(ce,{span:!0,fw:650,children:_?.title}),` and its saved messages.`]}),x&&(0,O.jsx)(he,{color:`bad`,children:x}),(0,O.jsxs)(re,{justify:`flex-end`,children:[(0,O.jsx)(se,{variant:`default`,onClick:()=>v(null),disabled:te,children:`Cancel`}),(0,O.jsx)(se,{color:`bad`,loading:te,onClick:()=>void me(),children:`Delete`})]})]})})]})}function KO({children:e}){return(0,O.jsx)(ce,{c:`dimmed`,size:`xs`,fw:700,tt:`uppercase`,lts:`0.08em`,px:`sm`,children:e})}function qO({thread:e,active:t,onSelect:n,onRename:r,onDelete:i}){return(0,O.jsx)(l,{"data-active":t||void 0,className:`rail-row`,children:(0,O.jsxs)(re,{gap:2,wrap:`nowrap`,children:[(0,O.jsx)(ee,{onClick:n,"aria-current":t?`page`:void 0,p:`sm`,flex:1,style:{minWidth:0},children:(0,O.jsxs)(oe,{gap:0,children:[(0,O.jsx)(ce,{size:`sm`,fw:t?600:500,truncate:!0,children:e.title}),(0,O.jsx)(ce,{c:`dimmed`,size:`xs`,children:QO(e.updated_at)})]})}),(0,O.jsxs)(st,{position:`bottom-end`,withinPortal:!0,children:[(0,O.jsx)(st.Target,{children:(0,O.jsx)(We,{className:`rail-row-actions`,variant:`subtle`,color:`gray`,size:`sm`,mr:4,"aria-label":`Actions for ${e.title}`,children:(0,O.jsx)(ft,{size:18,weight:`bold`})})}),(0,O.jsxs)(st.Dropdown,{children:[(0,O.jsx)(st.Item,{leftSection:(0,O.jsx)(at,{size:15}),onClick:r,children:`Rename`}),(0,O.jsx)(st.Item,{color:`bad`,leftSection:(0,O.jsx)(Ft,{size:15}),onClick:i,children:`Delete`})]})]})]})})}function JO(e){return e.includes(`T`)?new Date(e):new Date(`${e.replace(` `,`T`)}Z`)}function YO(e){return new Date(e.getFullYear(),e.getMonth(),e.getDate()).getTime()}var XO=[`Today`,`Yesterday`,`Previous 7 days`,`Older`];function ZO(e){let t=YO(new Date),n=new Map;for(let r of e){let e=Math.floor((t-YO(JO(r.updated_at)))/864e5),i=e<=0?`Today`:e===1?`Yesterday`:e<=7?`Previous 7 days`:`Older`,a=n.get(i)??[];a.push(r),n.set(i,a)}return XO.filter(e=>n.has(e)).map(e=>({label:e,threads:n.get(e)}))}function QO(e){let t=JO(e),n=YO(new Date);return Math.floor((n-YO(t))/864e5)<=1?new Intl.DateTimeFormat(void 0,{hour:`numeric`,minute:`2-digit`}).format(t):new Intl.DateTimeFormat(void 0,{month:`short`,day:`numeric`}).format(t)}function $O({children:e}){let{agentAvailable:t,threadID:n,threadMissing:r,newThread:i,selectThread:a,openChat:o}=Ze(),s=we(),c=sa({select:e=>e.location.pathname}),{dashboardId:l}=wt({strict:!1}),u=c===`/chat`||c.startsWith(`/chat/`),[d,f]=la(!1),[p,m]=(0,D.useState)(!1),[h,g]=(0,D.useState)(``),_=(0,D.useRef)(null),v=ae(`(max-width: 62em)`),y=(0,D.useRef)(v);y.current=v,(0,D.useEffect)(()=>{f.close()},[c]),(0,D.useEffect)(()=>{let e=e=>{(e.metaKey||e.ctrlKey)&&e.key.toLowerCase()===`k`&&(e.preventDefault(),y.current?(m(!0),f.open()):_.current?.focusSearch())};return window.addEventListener(`keydown`,e),()=>window.removeEventListener(`keydown`,e)},[]);let b={agentAvailable:t,activeThreadID:u&&!r&&c!==`/chat`?n:void 0,activeDashboardID:l,onNewChat:i,onSelectThread:a,onDeletedThread:e=>{e===n&&i()},onSelectDashboard:e=>void s({to:`/dashboards/$dashboardId`,params:{dashboardId:e},search:{}}),onCreateDashboard:()=>o(Ge),onInvestigateService:e=>o(`Investigate the ${e} service. Explain its errors and latency.`)};return(0,O.jsxs)(po,{header:{height:52},navbar:{width:256,breakpoint:`md`,collapsed:{mobile:!0}},padding:0,children:[(0,O.jsx)(po.Header,{children:(0,O.jsxs)(re,{h:`100%`,px:{base:`sm`,sm:`md`},justify:`space-between`,wrap:`nowrap`,children:[(0,O.jsxs)(re,{gap:`sm`,wrap:`nowrap`,children:[(0,O.jsx)(Do,{hiddenFrom:`md`,opened:d,onClick:()=>{m(!1),f.toggle()},size:`sm`,"aria-label":d?`Close navigation`:`Open navigation`}),(0,O.jsx)(ve,{size:`small`})]}),(0,O.jsxs)(re,{gap:`xs`,wrap:`nowrap`,children:[(0,O.jsx)(zt,{label:`Documentation`,children:(0,O.jsx)(We,{component:`a`,href:UO.home,target:`_blank`,rel:`noopener noreferrer`,variant:`subtle`,color:`gray`,"aria-label":`Documentation`,children:(0,O.jsx)(hO,{size:17,weight:`bold`})})}),(0,O.jsx)(HO,{}),(0,O.jsx)(ek,{onError:g})]})]})}),(0,O.jsx)(po.Navbar,{p:`sm`,children:(0,O.jsx)(GO,{ref:_,...b})}),(0,O.jsx)(pt,{opened:d,onClose:f.close,hiddenFrom:`md`,size:288,padding:`sm`,title:(0,O.jsx)(ve,{size:`small`}),overlayProps:{backgroundOpacity:.24,blur:1},children:(0,O.jsx)(GO,{...b,autoFocusSearch:d&&p})}),(0,O.jsxs)(po.Main,{children:[h&&(0,O.jsx)(he,{color:`bad`,m:`md`,withCloseButton:!0,onClose:()=>g(``),children:h}),e]})]})}function ek({onError:e}){let t=we(),n=vn(),r=(n.display_name.trim()||n.email.trim()||`?`).charAt(0).toUpperCase();return(0,O.jsxs)(st,{position:`bottom-end`,withinPortal:!0,shadow:`md`,children:[(0,O.jsx)(st.Target,{children:(0,O.jsx)(We,{variant:`subtle`,color:`gray`,size:`lg`,radius:`xl`,"aria-label":`Account menu`,children:(0,O.jsx)(wo,{size:26,radius:`xl`,color:`brand`,children:r})})}),(0,O.jsxs)(st.Dropdown,{children:[(0,O.jsx)(st.Label,{children:n.email||`Signed in`}),(0,O.jsx)(st.Item,{leftSection:(0,O.jsx)(xO,{size:15}),onClick:()=>void t({to:`/settings`}),children:`Connect telemetry`}),(0,O.jsx)(st.Divider,{}),(0,O.jsx)(st.Item,{leftSection:(0,O.jsx)(TO,{size:15}),onClick:()=>void hn().catch(t=>e(t instanceof Error?t.message:`Sign-out failed — your session is still active.`)),children:`Sign out`})]})]})}function tk(){let{agent_available:e}=_n(),t=we(),n=qt(),{threadId:r}=wt({strict:!1}),[i,a]=(0,D.useState)(VO),o=(0,D.useRef)(new Set),s=r??i,[c,l]=(0,D.useState)([]),[u,d]=(0,D.useState)({}),[f,p]=(0,D.useState)(``),[m,h]=(0,D.useState)(!1),[g,_]=(0,D.useState)(!1),[v,y]=(0,D.useState)(``),[b,ee]=(0,D.useState)(null),x=(0,D.useRef)(null),[S,te]=(0,D.useState)(!1),C=(0,D.useRef)(!1),[ne,re]=(0,D.useState)(``),[ie,w]=(0,D.useState)(``),[ae,oe]=(0,D.useState)(0),se=(0,D.useRef)(null),ce=(0,D.useRef)({}),le=(0,D.useRef)(null),ue=(0,D.useRef)(new Map),de=(0,D.useMemo)(()=>new $D({url:`/api/agent/runs`,threadId:s,fetch:(e,t)=>gn(e,t)}),[s]),fe=!e||f===s;function pe(){ue.current.clear(),y(``),x.current=null,ee(null)}let T=e=>e.filter(e=>e.role!==`reasoning`);function me(){let e=x.current?.text.split(/(?<=[.!?])\s/)[0]?.trim().replace(/[.!?]+$/,``);return e?e+`…`:``}function he(e){return C.current||e instanceof Error&&e.name===`AbortError`}(0,D.useEffect)(()=>{let t=!0;if(l([]),ce.current={},d({}),p(``),h(!1),_(!1),C.current=!1,te(!1),pe(),w(``),!e){p(s);return}!r||o.current.has(s)?(de.setMessages([]),p(s)):gn(`/api/agent/threads/${encodeURIComponent(s)}`).then(async e=>{if(e.status===404)return null;if(!e.ok)throw Error(`Unable to load thread (${e.status})`);return e.json()}).then(e=>{if(t){if(e===null){h(!0),p(s);return}de.setMessages(T(e.messages??[])),l(T(e.messages??[])),p(s)}}).catch(()=>{t&&(se.current=null,w(`This chat could not be restored. Start a new chat or try again.`))});let i=de.subscribe({onEvent:({event:e,messages:t})=>{switch(e.type){case`REASONING_MESSAGE_START`:return x.current={id:e.messageId,text:``,collapsed:!1},ee(x.current),y(``),{stopPropagation:!0};case`REASONING_MESSAGE_CONTENT`:{let t=e,n={id:t.messageId,text:(x.current?.text??``)+t.delta,collapsed:!1};return x.current=n,ee(n),{stopPropagation:!0}}case`REASONING_START`:case`REASONING_MESSAGE_END`:case`REASONING_END`:return{stopPropagation:!0};default:l(T(t))}},onMessagesChanged:({messages:e})=>l(T(e)),onRunInitialized:()=>{C.current=!1,te(!1),_(!0),w(``)},onTextMessageContentEvent:({event:e})=>{e.delta&&(x.current=null,ee(null),y(``))},onToolCallStartEvent:({event:e})=>{ue.current.set(e.toolCallId,Xe(e.toolCallName)),y(Xe(e.toolCallName)),x.current&&(x.current={...x.current,collapsed:!0},ee(x.current))},onToolCallResultEvent:({event:e,messages:t})=>{ue.current.delete(e.toolCallId),y([...ue.current.values()].at(-1)??me());let r=$e(e.toolCallId,e.content,t);r&&(n.invalidateQueries({queryKey:ut}),n.invalidateQueries({queryKey:[`dashboard`,r.id]}),n.invalidateQueries({queryKey:[`dashboard-versions`,r.id]}))},onRunErrorEvent:({event:e})=>{e.code===`abort`||C.current?(w(``),te(!0)):(console.warn(`Agent run error`,e.code),w(He(e.code))),_(!1),pe()},onRunFinalized:({messages:e})=>{let t=T(e);l(t),d(e=>{let n={...e};for(let e of t)e.role===`assistant`&&!n[e.id]&&(n[e.id]=Date.now());return n}),_(!1),pe(),o.current.delete(s),n.invalidateQueries({queryKey:AO})},onRunFailed:e=>{he(e.error)?(w(``),te(!0)):(console.error(`Agent run failed`,e),w(He())),_(!1),pe(),o.current.delete(s),n.invalidateQueries({queryKey:AO})}});return()=>{t=!1,i.unsubscribe(),de.abortRun()}},[de,e,n,ae,s]),(0,D.useEffect)(()=>{if(!e)return;let n=e=>{let n=e.target,i=n?.matches(`input, textarea, [contenteditable='true']`);e.key===`/`&&!i&&(e.preventDefault(),r?requestAnimationFrame(()=>le.current?.focus()):t({to:`/chat`}).then(()=>requestAnimationFrame(()=>le.current?.focus()))),e.key===`Escape`&&n===le.current&&(re(``),le.current?.blur())};return window.addEventListener(`keydown`,n),()=>window.removeEventListener(`keydown`,n)},[e,t,r]);async function ge(){_(!0),w(``);try{await de.runAgent({forwardedProps:{...ce.current}})}catch(e){he(e)?(w(``),te(!0)):(console.error(`Agent run failed`,e),w(He())),_(!1),pe(),o.current.delete(s)}}async function _e(n,i){let a=n.trim();if(!e||!a||g||!fe||m)return;ce.current={...i},r||(o.current.add(s),t({to:`/chat/$threadId`,params:{threadId:s},replace:!0}));let c={id:VO(),role:`user`,content:a};de.addMessage(c),l([...de.messages]),d(e=>({...e,[c.id]:Date.now()})),re(``),await ge()}(0,D.useEffect)(()=>{let e=se.current;fe&&r&&e&&(se.current=null,_e(e.text,e.options))},[fe,r,s]);function ve(e){e.preventDefault(),_e(ne)}function ye(){C.current=!0,w(``),te(!0),de.abortRun(),_(!1),pe(),o.current.delete(s)}function be(){!g&&de.messages.some(e=>e.role===`user`)&&ge()}function xe(n,r){if(!e)return;let i=VO();o.current.add(i),se.current=n?{text:n,options:{...r}}:null,t({to:`/chat/$threadId`,params:{threadId:i}})}function Se(){de.abortRun(),se.current=null,ce.current={},a(VO()),t({to:`/chat`})}function Ce(e){se.current=null,ce.current={},t({to:`/chat/$threadId`,params:{threadId:e}})}function E(){oe(e=>e+1)}return(0,O.jsx)(Ye.Provider,{value:{agentAvailable:e,threadID:s,threadMissing:m,messages:c,messageTimes:u,ready:fe,running:g,activity:v,provisional:b,stopped:S,input:ne,setInput:re,error:ie,inputRef:le,send:_e,submit:ve,stop:ye,retry:be,reloadThread:E,openChat:xe,newThread:Se,selectThread:Ce},children:(0,O.jsx)($O,{children:(0,O.jsx)(Zi,{})})})}function nk(){let e=(0,D.useMemo)(()=>new iO,[]);return(0,O.jsx)(pn,{client:e,children:(0,O.jsx)(bn,{children:(0,O.jsx)(tk,{})})})}var rk=kt({component:nk,notFoundComponent:()=>(0,O.jsx)(Te,{to:`/`,replace:!0})}),ik=Dt(`/`)({component:Mt(()=>Qe(()=>import(`./routes-D2AdaqvY.js`),__vite__mapDeps([0,1,2])),`component`)}),ak=Dt(`/settings`)({component:Mt(()=>Qe(()=>import(`./settings-BnFwabAq.js`),__vite__mapDeps([3,1,4,5,6,7,2,8])),`component`)}),ok=Dt(`/chat/`)({component:Mt(()=>Qe(()=>import(`./chat.index-eVfsC4Jb.js`),__vite__mapDeps([9,10,1,4,11,5,12])),`component`)}),sk=Dt(`/chat/$threadId`)({component:Mt(()=>Qe(()=>import(`./chat._threadId-eVfsC4Jb.js`),__vite__mapDeps([13,10,1,4,11,5,12])),`component`)}),ck=Dt(`/dashboards/`)({component:Mt(()=>Qe(()=>import(`./dashboards.index-mQSdDlyY.js`),__vite__mapDeps([14,1,2,15,4,11,5,16,6,7,17,12,8])),`component`),validateSearch:e=>bt(_t(e))}),lk=Dt(`/dashboards/$dashboardId`)({component:Mt(()=>Qe(()=>import(`./dashboards._dashboardId-09220iIf.js`),__vite__mapDeps([18,1,2,15,4,11,5,16,6,7,17,12,8])),`component`),validateSearch:e=>bt(_t(e))}),uk=ik.update({id:`/`,path:`/`,getParentRoute:()=>rk}),dk=ak.update({id:`/settings`,path:`/settings`,getParentRoute:()=>rk}),fk=ok.update({id:`/chat/`,path:`/chat/`,getParentRoute:()=>rk}),pk=sk.update({id:`/chat/$threadId`,path:`/chat/$threadId`,getParentRoute:()=>rk}),mk=ck.update({id:`/dashboards/`,path:`/dashboards/`,getParentRoute:()=>rk}),hk={IndexRoute:uk,SettingsRoute:dk,ChatThreadIdRoute:pk,DashboardsDashboardIdRoute:lk.update({id:`/dashboards/$dashboardId`,path:`/dashboards/$dashboardId`,getParentRoute:()=>rk}),ChatIndexRoute:fk,DashboardsIndexRoute:mk},gk=ra({routeTree:rk._addFileChildren(hk)._addFileTypes(),parseSearch:Pt,stringifySearch:lt,defaultPreload:`intent`,scrollRestoration:!0}),_k=vt(S),vk=Ea({...Et,variantColorResolver:_k});(0,Fo.createRoot)(document.getElementById(`root`)).render((0,O.jsx)(D.StrictMode,{children:(0,O.jsx)(Ta,{theme:vk,defaultColorScheme:`auto`,cssVariablesResolver:jt,children:(0,O.jsx)(oa,{router:gk})})}));export{a_ as A,Cv as C,uv as D,V as E,Fu as F,Zm as M,qm as N,nv as O,Km as P,cv as S,gv as T,Hv as _,S_ as a,iv as b,vv as c,W as d,ov as f,mv as g,E_ as h,jO as i,$g as j,A_ as k,$_ as l,fv as m,ck as n,x_ as o,U as p,UO as r,K_ as s,lk as t,Z_ as u,K as v,qv as w,q_ as x,G as y}; \ No newline at end of file diff --git a/internal/ui/dist/assets/index-D1TEoZWj.js b/internal/ui/dist/assets/index-D1TEoZWj.js new file mode 100644 index 000000000..44244bbb9 --- /dev/null +++ b/internal/ui/dist/assets/index-D1TEoZWj.js @@ -0,0 +1,136 @@ +const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/routes-D2AdaqvY.js","assets/useRouter-ByJ6_rwb.js","assets/useNavigate-B1zgPEUp.js","assets/settings-TyOL6EZs.js","assets/brand-DUaZkIz1.js","assets/Tooltip-B3r3s_B9.js","assets/WarningCircle.es-DMCNfIHa.js","assets/chat.index-CybsW_0R.js","assets/chat-CAy267fh.js","assets/preload-helper-FMCtZeYw.js","assets/dashboard-change-chips-BKnD9tpX.js","assets/chat._threadId-CybsW_0R.js","assets/dashboards.index-BGm8G1FV.js","assets/page-BaMlOBRS.js","assets/dashboards._dashboardId-CGcM78tU.js"])))=>i.map(i=>d[i]); +import{a as e,i as t,n,o as r,r as i,s as a,t as o}from"./useRouter-ByJ6_rwb.js";import{$ as s,A as c,B as l,C as u,F as d,G as f,H as p,I as m,J as h,K as g,L as _,M as v,N as y,P as b,Q as x,R as S,S as C,T as w,U as T,V as ee,W as E,X as D,Y as O,Z as te,_ as ne,_t as re,a as k,at as ie,b as ae,c as A,ct as oe,d as se,dt as ce,f as le,gt as ue,h as de,ht as fe,i as pe,it as me,j as he,k as ge,l as _e,lt as ve,m as j,mt as M,nt as ye,o as be,p as xe,pt as Se,q as Ce,r as we,rt as Te,st as Ee,t as De,tt as Oe,u as ke,ut as Ae,v as je,w as Me,x as Ne,y as Pe,z as Fe}from"./brand-DUaZkIz1.js";import{i as Ie,n as Le,r as Re,t as ze}from"./useNavigate-B1zgPEUp.js";import{A as Be,C as Ve,D as He,E as Ue,M as We,O as Ge,T as Ke,_ as qe,a as Je,b as Ye,g as Xe,h as Ze,i as Qe,j as $e,k as et,m as tt,n as nt,r as rt,s as it,t as at,u as ot,v as st,w as ct,y as lt}from"./preload-helper-FMCtZeYw.js";import{C as ut,E as dt,T as ft,_ as pt,a as mt,c as ht,d as gt,f as _t,g as vt,h as yt,i as bt,l as xt,m as St,n as Ct,o as wt,p as Tt,r as Et,s as Dt,t as Ot,u as kt,v as At,x as jt,y as Mt}from"./Tooltip-B3r3s_B9.js";(function(){let e=document.createElement(`link`).relList;if(e&&e.supports&&e.supports(`modulepreload`))return;for(let e of document.querySelectorAll(`link[rel="modulepreload"]`))n(e);new MutationObserver(e=>{for(let t of e)if(t.type===`childList`)for(let e of t.addedNodes)e.tagName===`LINK`&&e.rel===`modulepreload`&&n(e)}).observe(document,{childList:!0,subtree:!0});function t(e){let t={};return e.integrity&&(t.integrity=e.integrity),e.referrerPolicy&&(t.referrerPolicy=e.referrerPolicy),t.credentials=e.crossOrigin===`use-credentials`?`include`:e.crossOrigin===`anonymous`?`omit`:`same-origin`,t}function n(e){if(e.ep)return;e.ep=!0;let n=t(e);fetch(e.href,n)}})();var Nt=e((e=>{function t(e,t){var n=e.length;e.push(t);a:for(;0>>1,a=e[r];if(0>>1;ri(c,n))li(u,c)?(e[r]=u,e[l]=n,r=l):(e[r]=c,e[s]=n,r=s);else if(li(u,n))e[r]=u,e[l]=n,r=l;else break a}}return t}function i(e,t){var n=e.sortIndex-t.sortIndex;return n===0?e.id-t.id:n}if(e.unstable_now=void 0,typeof performance==`object`&&typeof performance.now==`function`){var a=performance;e.unstable_now=function(){return a.now()}}else{var o=Date,s=o.now();e.unstable_now=function(){return o.now()-s}}var c=[],l=[],u=1,d=null,f=3,p=!1,m=!1,h=!1,g=!1,_=typeof setTimeout==`function`?setTimeout:null,v=typeof clearTimeout==`function`?clearTimeout:null,y=typeof setImmediate<`u`?setImmediate:null;function b(e){for(var i=n(l);i!==null;){if(i.callback===null)r(l);else if(i.startTime<=e)r(l),i.sortIndex=i.expirationTime,t(c,i);else break;i=n(l)}}function x(e){if(h=!1,b(e),!m){if(n(c)!==null)m=!0,S||(S=!0,D());else{var t=n(l);t!==null&&ne(x,t.startTime-e)}}}var S=!1,C=-1,w=5,T=-1;function ee(){return g?!0:!(e.unstable_now()-Tt&&ee());){var o=d.callback;if(typeof o==`function`){d.callback=null,f=d.priorityLevel;var s=o(d.expirationTime<=t);if(t=e.unstable_now(),typeof s==`function`){d.callback=s,b(t),i=!0;break b}d===n(c)&&r(c),b(t)}else r(c);d=n(c)}if(d!==null)i=!0;else{var u=n(l);u!==null&&ne(x,u.startTime-t),i=!1}}break a}finally{d=null,f=a,p=!1}i=void 0}}finally{i?D():S=!1}}}var D;if(typeof y==`function`)D=function(){y(E)};else if(typeof MessageChannel<`u`){var O=new MessageChannel,te=O.port2;O.port1.onmessage=E,D=function(){te.postMessage(null)}}else D=function(){_(E,0)};function ne(t,n){C=_(function(){t(e.unstable_now())},n)}e.unstable_IdlePriority=5,e.unstable_ImmediatePriority=1,e.unstable_LowPriority=4,e.unstable_NormalPriority=3,e.unstable_Profiling=null,e.unstable_UserBlockingPriority=2,e.unstable_cancelCallback=function(e){e.callback=null},e.unstable_forceFrameRate=function(e){0>e||125o?(r.sortIndex=a,t(l,r),n(c)===null&&r===n(l)&&(h?(v(C),C=-1):h=!0,ne(x,a-o))):(r.sortIndex=s,t(c,r),m||p||(m=!0,S||(S=!0,D()))),r},e.unstable_shouldYield=ee,e.unstable_wrapCallback=function(e){var t=f;return function(){var n=f;f=t;try{return e.apply(this,arguments)}finally{f=n}}}})),Pt=e(((e,t)=>{t.exports=Nt()})),Ft=e((e=>{var n=Pt(),r=t(),i=re();function a(e){var t=`https://react.dev/errors/`+e;if(1xe||(e.current=be[xe],be[xe]=null,xe--)}function we(e,t){xe++,be[xe]=e.current,e.current=t}var Te=Se(null),Ee=Se(null),De=Se(null),Oe=Se(null);function ke(e,t){switch(we(De,t),we(Ee,e),we(Te,null),t.nodeType){case 9:case 11:e=(e=t.documentElement)&&(e=e.namespaceURI)?xp(e):0;break;default:if(e=t.tagName,t=t.namespaceURI)t=xp(t),e=Sp(t,e);else switch(e){case`svg`:e=1;break;case`math`:e=2;break;default:e=0}}Ce(Te),we(Te,e)}function Ae(){Ce(Te),Ce(Ee),Ce(De)}function je(e){var t=e.memoizedState;t!==null&&(vh._currentValue=t.memoizedState,we(Oe,e)),t=Te.current;var n=Sp(t,e.type);t!==n&&(we(Ee,e),we(Te,n))}function Me(e){Ee.current===e&&(Ce(Te),Ce(Ee)),Oe.current===e&&(Ce(Oe),vh._currentValue=ye)}var Ne,Pe;function Fe(e){if(Ne===void 0)try{throw Error()}catch(e){var t=e.stack.trim().match(/\n( *(at )?)/);Ne=t&&t[1]||``,Pe=-1)`:-1i||c[r]!==l[i]){var u=` +`+c[r].replace(` at new `,` at `);return e.displayName&&u.includes(``)&&(u=u.replace(``,e.displayName)),u}while(1<=r&&0<=i);break}}}finally{Ie=!1,Error.prepareStackTrace=n}return(n=e?e.displayName||e.name:``)?Fe(n):``}function Re(e,t){switch(e.tag){case 26:case 27:case 5:return Fe(e.type);case 16:return Fe(`Lazy`);case 13:return e.child!==t&&t!==null?Fe(`Suspense Fallback`):Fe(`Suspense`);case 19:return Fe(`SuspenseList`);case 0:case 15:return Le(e.type,!1);case 11:return Le(e.type.render,!1);case 1:return Le(e.type,!0);case 31:return Fe(`Activity`);case 30:return Fe(`ViewTransition`);default:return``}}function ze(e){try{var t=``,n=null;do t+=Re(e,n),n=e,e=e.return;while(e);return t}catch(e){return` +Error generating stack: `+e.message+` +`+e.stack}}var Be=Object.prototype.hasOwnProperty,Ve=n.unstable_scheduleCallback,He=n.unstable_cancelCallback,Ue=n.unstable_shouldYield,We=n.unstable_requestPaint,Ge=n.unstable_now,Ke=n.unstable_getCurrentPriorityLevel,qe=n.unstable_ImmediatePriority,Je=n.unstable_UserBlockingPriority,Ye=n.unstable_NormalPriority,Xe=n.unstable_LowPriority,Ze=n.unstable_IdlePriority,Qe=n.log,$e=n.unstable_setDisableYieldValue,et=null,tt=null;function nt(e){if(typeof Qe==`function`&&$e(e),tt&&typeof tt.setStrictMode==`function`)try{tt.setStrictMode(et,e)}catch{}}var rt=Math.clz32?Math.clz32:ot,it=Math.log,at=Math.LN2;function ot(e){return e>>>=0,e===0?32:31-(it(e)/at|0)|0}var st=256,ct=262144,lt=4194304;function ut(e){var t=e&42;if(t!==0)return t;switch(e&-e){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:return 64;case 128:return 128;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:return e&-e;case 262144:case 524288:case 1048576:case 2097152:return e&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return e&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return e}}function dt(e,t,n){var r=e.pendingLanes;if(r===0)return 0;var i=0,a=e.suspendedLanes,o=e.pingedLanes;e=e.warmLanes;var s=r&134217727;return s===0?(s=r&~a,s===0?o===0?n||(n=r&~e,n!==0&&(i=ut(n))):i=ut(o):i=ut(s)):(r=s&~a,r===0?(o&=s,o===0?n||(n=s&~e,n!==0&&(i=ut(n))):i=ut(o)):i=ut(r)),i===0?0:t!==0&&t!==i&&(t&a)===0&&(a=i&-i,n=t&-t,a>=n||a===32&&n&4194048)?t:i}function ft(e,t){return(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&t)===0}function pt(e,t){t&8&&(t|=t&32);var n=e.entangledLanes;if(n!==0)for(e=e.entanglements,n&=t;0n;n++)t.push(e);return t}function _t(e,t){e.pendingLanes|=t,t!==268435456&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function vt(e,t,n,r,i,a){var o=e.pendingLanes;e.pendingLanes=n,e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0,e.expiredLanes&=n,e.entangledLanes&=n,e.errorRecoveryDisabledLanes&=n,e.shellSuspendCounter=0;var s=e.entanglements,c=e.expirationTimes,l=e.hiddenUpdates;for(n=o&~n;0=_r),br=` `,xr=!1;function Sr(e,t){switch(e){case`keyup`:return hr.indexOf(t.keyCode)!==-1;case`keydown`:return t.keyCode!==229;case`keypress`:case`mousedown`:case`focusout`:return!0;default:return!1}}function Cr(e){return e=e.detail,typeof e==`object`&&`data`in e?e.data:null}var wr=!1;function Tr(e,t){switch(e){case`compositionend`:return Cr(t);case`keypress`:return t.which===32?(xr=!0,br):null;case`textInput`:return e=t.data,e===br&&xr?null:e;default:return null}}function Er(e,t){if(wr)return e===`compositionend`||!gr&&Sr(e,t)?(e=Rn(),Ln=In=Fn=null,wr=!1,e):null;switch(e){case`paste`:return null;case`keypress`:if(!(t.ctrlKey||t.altKey||t.metaKey)||t.ctrlKey&&t.altKey){if(t.char&&1=t)return{node:n,offset:t-e};e=r}a:{for(;n;){if(n.nextSibling){n=n.nextSibling;break a}n=n.parentNode}n=void 0}n=Yr(n)}}function Zr(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?Zr(e,t.parentNode):`contains`in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function Qr(e){e=e!=null&&e.ownerDocument!=null&&e.ownerDocument.defaultView!=null?e.ownerDocument.defaultView:window;for(var t=Jr(e.document);t instanceof e.HTMLIFrameElement;){try{var n=typeof t.contentWindow.location.href==`string`}catch{n=!1}if(n)e=t.contentWindow;else break;t=Jr(e.document)}return t}function $r(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&(t===`input`&&(e.type===`text`||e.type===`search`||e.type===`tel`||e.type===`url`||e.type===`password`)||t===`textarea`||e.contentEditable===`true`)}var ei=Mn&&`documentMode`in document&&11>=document.documentMode,ti=null,ni=null,ri=null,ii=!1;function ai(e,t,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;ii||ti==null||ti!==Jr(r)||(r=ti,`selectionStart`in r&&$r(r)?r={start:r.selectionStart,end:r.selectionEnd}:(r=(r.ownerDocument&&r.ownerDocument.defaultView||window).getSelection(),r={anchorNode:r.anchorNode,anchorOffset:r.anchorOffset,focusNode:r.focusNode,focusOffset:r.focusOffset}),ri&&qr(ri,r)||(ri=r,r=ip(ni,`onSelect`),0>=o,i-=o,ta=1<<32-rt(t)+i|n<h?(g=d,d=null):g=d.sibling;var _=p(i,d,s[h],c);if(_===null){d===null&&(d=g);break}e&&d&&_.alternate===null&&t(i,d),a=o(_,a,h),u===null?l=_:u.sibling=_,u=_,d=g}if(h===s.length)return n(i,d),F&&ra(i,h),l;if(d===null){for(;hg?(_=h,h=null):_=h.sibling;var y=p(i,h,v.value,l);if(y===null){h===null&&(h=_);break}e&&h&&y.alternate===null&&t(i,h),s=o(y,s,g),d===null?u=y:d.sibling=y,d=y,h=_}if(v.done)return n(i,h),F&&ra(i,g),u;if(h===null){for(;!v.done;g++,v=c.next())v=f(i,v.value,l),v!==null&&(s=o(v,s,g),d===null?u=v:d.sibling=v,d=v);return F&&ra(i,g),u}for(h=r(h);!v.done;g++,v=c.next())v=m(h,i,g,v.value,l),v!==null&&(e&&(_=v.alternate,_!==null&&h.delete(_.key===null?g:_.key)),s=o(v,s,g),d===null?u=v:d.sibling=v,d=v);return e&&h.forEach(function(e){return t(i,e)}),F&&ra(i,g),u}function _(e,r,o,c){if(typeof o==`object`&&o&&o.type===O&&o.key===null&&o.props.ref===void 0&&(o=o.props.children),typeof o==`object`&&o){switch(o.$$typeof){case E:a:{for(var l=o.key;r!==null;){if(r.key===l){if(l=o.type,l===O){if(r.tag===7){n(e,r.sibling),c=i(r,o.props.children),mo(c,o),c.return=e,e=c;break a}}else if(r.elementType===l||typeof l==`object`&&l&&l.$$typeof===ce&&oo(l)===r.type){n(e,r.sibling),c=i(r,o.props),mo(c,o),c.return=e,e=c;break a}n(e,r);break}t(e,r),r=r.sibling}o.type===O?(c=Hi(o.props.children,e.mode,c,o.key),mo(c,o),c.return=e,e=c):(c=Vi(o.type,o.key,o.props,null,e.mode,c),mo(c,o),c.return=e,e=c)}return s(e);case D:a:{for(l=o.key;r!==null;){if(r.key===l){if(r.tag===4&&r.stateNode.containerInfo===o.containerInfo&&r.stateNode.implementation===o.implementation){n(e,r.sibling),c=i(r,o.children||[]),c.return=e,e=c;break a}n(e,r);break}t(e,r),r=r.sibling}c=Gi(o,e.mode,c),c.return=e,e=c}return s(e);case ce:return o=oo(o),_(e,r,o,c)}if(ve(o))return h(e,r,o,c);if(he(o)){if(l=he(o),typeof l!=`function`)throw Error(a(150));return o=l.call(o),g(e,r,o,c)}if(typeof o.then==`function`)return _(e,r,po(o),c);if(o.$$typeof===ie)return _(e,r,ja(e,o),c);ho(e,o)}return typeof o==`string`&&o!==``||typeof o==`number`||typeof o==`bigint`?(o=``+o,r!==null&&r.tag===6?(n(e,r.sibling),c=i(r,o),c.return=e,e=c):(n(e,r),c=Ui(o,e.mode,c),c.return=e,e=c),s(e)):n(e,r)}return function(e,t,n,r){try{fo=0;var i=_(e,t,n,r);return uo=null,i}catch(t){if(t===eo||t===no)throw t;var a=Li(29,t,null,e.mode);return a.lanes=r,a.return=e,a}}}var _o=go(!0),vo=go(!1),yo=!1;function bo(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function xo(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,callbacks:null})}function So(e){return{lane:e,tag:0,payload:null,callback:null,next:null}}function Co(e,t,n){var r=e.updateQueue;if(r===null)return null;if(r=r.shared,sd&2){var i=r.pending;return i===null?t.next=t:(t.next=i.next,i.next=t),r.pending=t,t=Pi(e),Ni(e,null,n),t}return Ai(e,r,t,n),Pi(e)}function wo(e,t,n){if(t=t.updateQueue,t!==null&&(t=t.shared,n&4194048)){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,bt(e,n)}}function To(e,t){var n=e.updateQueue,r=e.alternate;if(r!==null&&(r=r.updateQueue,n===r)){var i=null,a=null;if(n=n.firstBaseUpdate,n!==null){do{var o={lane:n.lane,tag:n.tag,payload:n.payload,callback:null,next:null};a===null?i=a=o:a=a.next=o,n=n.next}while(n!==null);a===null?i=a=t:a=a.next=t}else i=a=t;n={baseState:r.baseState,firstBaseUpdate:i,lastBaseUpdate:a,shared:r.shared,callbacks:r.callbacks},e.updateQueue=n;return}e=n.lastBaseUpdate,e===null?n.firstBaseUpdate=t:e.next=t,n.lastBaseUpdate=t}var Eo=!1;function Do(){if(Eo){var e=Ga;if(e!==null)throw e}}function Oo(e,t,n,r){Eo=!1;var i=e.updateQueue;yo=!1;var a=i.firstBaseUpdate,o=i.lastBaseUpdate,s=i.shared.pending;if(s!==null){i.shared.pending=null;var c=s,l=c.next;c.next=null,o===null?a=l:o.next=l,o=c;var u=e.alternate;u!==null&&(u=u.updateQueue,s=u.lastBaseUpdate,s!==o&&(s===null?u.firstBaseUpdate=l:s.next=l,u.lastBaseUpdate=c))}if(a!==null){var d=i.baseState;o=0,u=l=c=null,s=a;do{var f=s.lane&-536870913,p=f!==s.lane;if(p?(ud&f)===f:(r&f)===f){f!==0&&f===Wa&&(Eo=!0),u!==null&&(u=u.next={lane:0,tag:s.tag,payload:s.payload,callback:null,next:null});a:{var m=e,h=s;f=t;var g=n;switch(h.tag){case 1:if(m=h.payload,typeof m==`function`){d=m.call(g,d,f);break a}d=m;break a;case 3:m.flags=m.flags&-65537|128;case 0:if(m=h.payload,f=typeof m==`function`?m.call(g,d,f):m,f==null)break a;d=T({},d,f);break a;case 2:yo=!0}}f=s.callback,f!==null&&(e.flags|=64,p&&(e.flags|=8192),p=i.callbacks,p===null?i.callbacks=[f]:p.push(f))}else p={lane:f,tag:s.tag,payload:s.payload,callback:s.callback,next:null},u===null?(l=u=p,c=d):u=u.next=p,o|=f;if(s=s.next,s===null){if(s=i.shared.pending,s===null)break;p=s,s=p.next,p.next=null,i.lastBaseUpdate=p,i.shared.pending=null}}while(1);u===null&&(c=d),i.baseState=c,i.firstBaseUpdate=l,i.lastBaseUpdate=u,a===null&&(i.shared.lanes=0),_d|=o,e.lanes=o,e.memoizedState=d}}function ko(e,t){if(typeof e!=`function`)throw Error(a(191,e));e.call(t)}function Ao(e,t){var n=e.callbacks;if(n!==null)for(e.callbacks=null,e=0;ea?a:8;var o=j.T,s={};s.types=o===null?null:o.types,j.T=s,_c(e,!1,t,n);try{var c=i(),l=j.S;l!==null&&l(s,c),typeof c==`object`&&c&&typeof c.then==`function`?gc(e,t,Ja(c,r),Hd(e)):gc(e,t,r,Hd(e))}catch(n){gc(e,t,{then:function(){},status:`rejected`,reason:n},Hd())}finally{M.p=a,o!==null&&s.types!==null&&(o.types=s.types),j.T=o}}function oc(){}function sc(e,t,n,r){if(e.tag!==5)throw Error(a(476));var i=cc(e).queue;ac(e,i,t,ye,n===null?oc:function(){return lc(e),n(r)})}function cc(e){var t=e.memoizedState;if(t!==null)return t;t={memoizedState:ye,baseState:ye,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:vs,lastRenderedState:ye},next:null};var n={};return t.next={memoizedState:n,baseState:n,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:vs,lastRenderedState:n},next:null},e.memoizedState=t,e=e.alternate,e!==null&&(e.memoizedState=t),t}function lc(e){var t=cc(e);t.next===null&&(t=e.alternate.memoizedState),gc(e,t.next.queue,{},Hd())}function uc(){return Aa(vh)}function dc(){return ps().memoizedState}function fc(){return ps().memoizedState}function pc(e){for(var t=e.return;t!==null;){switch(t.tag){case 24:case 3:var n=Hd();e=So(n);var r=Co(t,e,n);r!==null&&(Gd(r,t,n),wo(r,t,n)),t={cache:La()},e.payload=t;return}t=t.return}}function mc(e,t,n){var r=Hd();n={lane:r,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null},vc(e)?yc(t,n):(n=ji(e,t,n,r),n!==null&&(Gd(n,e,r),bc(n,t,r)))}function hc(e,t,n){gc(e,t,n,Hd())}function gc(e,t,n,r){var i={lane:r,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null};if(vc(e))yc(t,i);else{var a=e.alternate;if(e.lanes===0&&(a===null||a.lanes===0)&&(a=t.lastRenderedReducer,a!==null))try{var o=t.lastRenderedState,s=a(o,n);if(i.hasEagerState=!0,i.eagerState=s,Kr(s,o))return Ai(e,t,i,0),cd===null&&ki(),!1}catch{}if(n=ji(e,t,i,r),n!==null)return Gd(n,e,r),bc(n,t,r),!0}return!1}function _c(e,t,n,r){if(r={lane:2,revertLane:Gf(),gesture:null,action:r,hasEagerState:!1,eagerState:null,next:null},vc(e)){if(t)throw Error(a(479))}else t=ji(e,n,r,2),t!==null&&Gd(t,e,2)}function vc(e){var t=e.alternate;return e===I||t!==null&&t===I}function yc(e,t){Zo=Xo=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function bc(e,t,n){if(n&4194048){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,bt(e,n)}}var xc={readContext:Aa,use:gs,useCallback:rs,useContext:rs,useEffect:rs,useImperativeHandle:rs,useLayoutEffect:rs,useInsertionEffect:rs,useMemo:rs,useReducer:rs,useRef:rs,useState:rs,useDebugValue:rs,useDeferredValue:rs,useTransition:rs,useSyncExternalStore:rs,useId:rs,useHostTransitionStatus:rs,useFormState:rs,useActionState:rs,useOptimistic:rs,useMemoCache:rs,useCacheRefresh:rs,useEffectEvent:rs},Sc={readContext:Aa,use:gs,useCallback:function(e,t){return fs().memoizedState=[e,t===void 0?null:t],e},useContext:Aa,useEffect:Ks,useImperativeHandle:function(e,t,n){n=n==null?null:n.concat([e]),Ws(4194308,4,Qs.bind(null,t,e),n)},useLayoutEffect:function(e,t){return Ws(4194308,4,e,t)},useInsertionEffect:function(e,t){Ws(4,2,e,t)},useMemo:function(e,t){var n=fs();t=t===void 0?null:t;var r=e();if(Qo){nt(!0);try{e()}finally{nt(!1)}}return n.memoizedState=[r,t],r},useReducer:function(e,t,n){var r=fs();if(n!==void 0){var i=n(t);if(Qo){nt(!0);try{n(t)}finally{nt(!1)}}}else i=t;return r.memoizedState=r.baseState=i,e={pending:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:i},r.queue=e,e=e.dispatch=mc.bind(null,I,e),[r.memoizedState,e]},useRef:function(e){var t=fs();return e={current:e},t.memoizedState=e},useState:function(e){e=Os(e);var t=e.queue,n=hc.bind(null,I,t);return t.dispatch=n,[e.memoizedState,n]},useDebugValue:ec,useDeferredValue:function(e,t){return rc(fs(),e,t)},useTransition:function(){var e=Os(!1);return e=ac.bind(null,I,e.queue,!0,!1),fs().memoizedState=e,[!1,e]},useSyncExternalStore:function(e,t,n){var r=I,i=fs();if(F){if(n===void 0)throw Error(a(407));n=n()}else{if(n=t(),cd===null)throw Error(a(349));ud&127||Cs(r,t,n)}i.memoizedState=n;var o={value:n,getSnapshot:t};return i.queue=o,Ks(Ts.bind(null,r,o,e),[e]),r.flags|=2048,Hs(9,{destroy:void 0},ws.bind(null,r,o,n,t),null),n},useId:function(){var e=fs(),t=cd.identifierPrefix;if(F){var n=na,r=ta;n=(r&~(1<<32-rt(r)-1)).toString(32)+n,t=`_`+t+`R_`+n,n=$o++,0<\/script>`,o=o.removeChild(o.firstChild);break;case`select`:o=typeof r.is==`string`?s.createElement(`select`,{is:r.is}):s.createElement(`select`),r.multiple?o.multiple=!0:r.size&&(o.size=r.size);break;default:o=typeof r.is==`string`?s.createElement(i,{is:r.is}):s.createElement(i)}}o[Dt]=t,o[Ot]=r;a:for(s=t.child;s!==null;){if(s.tag===5||s.tag===6)o.appendChild(s.stateNode);else if(s.tag!==4&&s.tag!==27&&s.child!==null){s.child.return=s,s=s.child;continue}if(s===t)break a;for(;s.sibling===null;){if(s.return===null||s.return===t)break a;s=s.return}s.sibling.return=s.return,s=s.sibling}t.stateNode=o;a:switch(pp(o,i,r),i){case`button`:case`input`:case`select`:case`textarea`:r=!!r.autoFocus;break a;case`img`:r=!0;break a;default:r=!1}r&&vl(t)}}return Cl(t),t.subtreeFlags&=-33554433,yl(t,t.type,e===null?null:e.memoizedProps,t.pendingProps,n),null;case 6:if(e&&t.stateNode!=null)e.memoizedProps!==r&&vl(t);else{if(typeof r!=`string`&&t.stateNode===null)throw Error(a(166));if(e=De.current,ga(t)){if(e=t.stateNode,n=t.memoizedProps,r=null,i=ca,i!==null)switch(i.tag){case 27:case 5:r=i.memoizedProps}e[Dt]=t,e=!!(e.nodeValue===n||r!==null&&!0===r.suppressHydrationWarning||up(e.nodeValue,n)),e||pa(t,!0)}else e=bp(e).createTextNode(r),e[Dt]=t,t.stateNode=e}return Cl(t),null;case 31:if(n=t.memoizedState,e===null||e.memoizedState!==null){if(r=ga(t),n!==null){if(e===null){if(!r)throw Error(a(318));if(e=t.memoizedState,e=e===null?null:e.dehydrated,!e)throw Error(a(557));e[Dt]=t}else _a(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;Cl(t),e=!1}else n=va(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=n),e=!0;if(!e)return t.flags&256?(Ho(t),t):(Ho(t),null);if(t.flags&128)throw Error(a(558))}return Cl(t),null;case 13:if(r=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(i=ga(t),r!==null&&r.dehydrated!==null){if(e===null){if(!i)throw Error(a(318));if(i=t.memoizedState,i=i===null?null:i.dehydrated,!i)throw Error(a(317));i[Dt]=t}else _a(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;Cl(t),i=!1}else i=va(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=i),i=!0;if(!i)return t.flags&256?(Ho(t),t):(Ho(t),null)}return Ho(t),t.flags&128?(t.lanes=n,t):(n=r!==null,e=e!==null&&e.memoizedState!==null,n&&(r=t.child,i=null,r.alternate!==null&&r.alternate.memoizedState!==null&&r.alternate.memoizedState.cachePool!==null&&(i=r.alternate.memoizedState.cachePool.pool),o=null,r.memoizedState!==null&&r.memoizedState.cachePool!==null&&(o=r.memoizedState.cachePool.pool),o!==i&&(r.flags|=2048)),n!==e&&n&&(t.child.flags|=8192),xl(t,t.updateQueue),Cl(t),null);case 4:return Ae(),e===null&&ep(t.stateNode.containerInfo),t.flags|=67108864,Cl(t),null;case 10:return wa(t.type),Cl(t),null;case 19:if(Go(t),r=t.memoizedState,r===null)return Cl(t),null;if(i=!!(t.flags&128),o=r.rendering,o===null){if(i)Sl(r,!1);else{if(gd!==0||e!==null&&e.flags&128)for(e=t.child;e!==null;){if(o=Ko(e),o!==null){for(t.flags|=128,Sl(r,!1),e=o.updateQueue,t.updateQueue=e,xl(t,e),t.subtreeFlags=0,e=n,n=t.child;n!==null;)Bi(n,e),n=n.sibling;return Wo(t,Uo.current&1|2),F&&ra(t,r.treeForkCount),t.child}e=e.sibling}r.tail!==null&&Ge()>Dd&&(t.flags|=128,i=!0,Sl(r,!1),t.lanes=4194304)}}else{if(!i){if(e=Ko(o),e!==null){if(t.flags|=128,i=!0,e=e.updateQueue,t.updateQueue=e,xl(t,e),Sl(r,!0),r.tail===null&&r.tailMode!==`collapsed`&&r.tailMode!==`visible`&&!o.alternate&&!F)return Cl(t),null}else 2*Ge()-r.renderingStartTime>Dd&&n!==536870912&&(t.flags|=128,i=!0,Sl(r,!1),t.lanes=4194304)}r.isBackwards?(o.sibling=t.child,t.child=o):(e=r.last,e===null?t.child=o:e.sibling=o,r.last=o)}if(r.tail!==null){e=r.tail;a:{for(n=e;n!==null;){if(n.alternate!==null){n=!1;break a}n=n.sibling}n=!0}return r.rendering=e,r.tail=e.sibling,r.renderingStartTime=Ge(),e.sibling=null,o=Uo.current,o=i?o&1|2:o&1,r.tailMode===`visible`||r.tailMode===`collapsed`||!n||F?Wo(t,o):(n=o,we(Io,t),we(Uo,n),Lo===null&&(Lo=t)),F&&ra(t,r.treeForkCount),e}return Cl(t),null;case 22:case 23:return Ho(t),Fo(),r=t.memoizedState!==null,e===null?r&&(t.flags|=8192):e.memoizedState!==null!==r&&(t.flags|=8192),r?n&536870912&&!(t.flags&128)&&(Cl(t),t.subtreeFlags&6&&(t.flags|=8192)):Cl(t),n=t.updateQueue,n!==null&&xl(t,n.retryQueue),n=null,e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(n=e.memoizedState.cachePool.pool),r=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(r=t.memoizedState.cachePool.pool),r!==n&&(t.flags|=2048),e!==null&&Ce(Xa),null;case 24:return n=null,e!==null&&(n=e.memoizedState.cache),t.memoizedState.cache!==n&&(t.flags|=2048),wa(Ia),Cl(t),null;case 25:return null;case 30:return t.flags|=33554432,Cl(t),null}throw Error(a(156,t.tag))}function Tl(e,t){switch(oa(t),t.tag){case 1:return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return wa(Ia),Ae(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 26:case 27:case 5:return Me(t),null;case 31:if(t.memoizedState!==null){if(Ho(t),t.alternate===null)throw Error(a(340));_a()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 13:if(Ho(t),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(a(340));_a()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return Go(t),e=t.flags,e&65536?(t.flags=e&-65537|128,e=t.memoizedState,e!==null&&(e.rendering=null,e.tail=null),t.flags|=4,t):null;case 4:return Ae(),null;case 10:return wa(t.type),null;case 22:case 23:return Ho(t),Fo(),e!==null&&Ce(Xa),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 24:return wa(Ia),null;case 25:return null;default:return null}}function El(e,t){switch(oa(t),t.tag){case 3:wa(Ia),Ae();break;case 26:case 27:case 5:Me(t);break;case 4:Ae();break;case 31:t.memoizedState!==null&&Ho(t);break;case 13:Ho(t);break;case 19:Go(t);break;case 10:wa(t.type);break;case 22:case 23:Ho(t),Fo(),e!==null&&Ce(Xa);break;case 24:wa(Ia)}}function Dl(e,t){try{var n=t.updateQueue,r=n===null?null:n.lastEffect;if(r!==null){var i=r.next;n=i;do{if((n.tag&e)===e){r=void 0;var a=n.create,o=n.inst;r=a(),o.destroy=r}n=n.next}while(n!==i)}}catch(e){wf(t,t.return,e)}}function Ol(e,t,n){try{var r=t.updateQueue,i=r===null?null:r.lastEffect;if(i!==null){var a=i.next;r=a;do{if((r.tag&e)===e){var o=r.inst,s=o.destroy;if(s!==void 0){o.destroy=void 0,i=t;var c=n,l=s;try{l()}catch(e){wf(i,c,e)}}}r=r.next}while(r!==a)}}catch(e){wf(t,t.return,e)}}function kl(e){var t=e.updateQueue;if(t!==null){var n=e.stateNode;try{Ao(t,n)}catch(t){wf(e,e.return,t)}}}function Al(e,t,n){n.props=kc(e.type,e.memoizedProps),n.state=e.memoizedState;try{n.componentWillUnmount()}catch(n){wf(e,t,n)}}function jl(e,t){try{var n=e.ref;if(n!==null){switch(e.tag){case 26:case 27:case 5:var r=e.stateNode;break;case 30:var i=e.stateNode,a=Si(e.memoizedProps,i);(i.ref===null||i.ref.name!==a)&&(i.ref=Gp(a)),r=i.ref;break;case 7:if(e.stateNode===null){var o=new Kp(e);p(e.child,!1,lm,o,void 0,void 0),e.stateNode=o}r=e.stateNode;break;default:r=e.stateNode}typeof n==`function`?e.refCleanup=n(r):n.current=r}}catch(n){wf(e,t,n)}}function Ml(e,t){var n=e.ref,r=e.refCleanup;if(n!==null){if(typeof r==`function`)try{r()}catch(n){wf(e,t,n)}finally{e.refCleanup=null,e=e.alternate,e!=null&&(e.refCleanup=null)}else if(typeof n==`function`)try{n(null)}catch(n){wf(e,t,n)}else n.current=null}}function Nl(e,t){if((e.tag===5||e.tag===27||e.tag===6)&&e.alternate===null&&t!==null)for(var n=0;n title`))),pp(r,t,n),r[Dt]=e,Bt(r),t=r;break a;case`link`:if(o=nh(`link`,`href`,i).get(t+(n.href||``))){for(s=0;sg&&(o=g,g=h,h=o);var _=Xr(s,h),v=Xr(s,g);if(_&&v&&(p.rangeCount!==1||p.anchorNode!==_.node||p.anchorOffset!==_.offset||p.focusNode!==v.node||p.focusOffset!==v.offset)){var y=d.createRange();y.setStart(_.node,_.offset),p.removeAllRanges(),h>g?(p.addRange(y),p.extend(v.node,v.offset)):(y.setEnd(v.node,v.offset),p.addRange(y))}}}}for(d=[],p=s;p=p.parentNode;)p.nodeType===1&&d.push({element:p,left:p.scrollLeft,top:p.scrollTop});for(typeof s.focus==`function`&&s.focus(),s=0;sn?32:n,j.T=null,n=Fd,Fd=null;var o=jd,s=Nd;if(Ad=0,Md=jd=null,Nd=0,sd&6)throw Error(a(331));var c=sd;if(sd|=4,nd(o.current),Ju(o,o.current,s,n),sd=c,Rf(0,!1),tt&&typeof tt.onPostCommitFiberRoot==`function`)try{tt.onPostCommitFiberRoot(et,o)}catch{}return!0}finally{M.p=i,j.T=r,bf(e,t)}}function Cf(e,t,n){t=qi(n,t),t=Fc(e.stateNode,t,2),e=Co(e,t,2),e!==null&&(_t(e,2),Lf(e))}function wf(e,t,n){if(e.tag===3)Cf(e,e,n);else for(;t!==null;){if(t.tag===3){Cf(t,e,n);break}if(t.tag===1){var r=t.stateNode;if(typeof t.type.getDerivedStateFromError==`function`||typeof r.componentDidCatch==`function`&&(kd===null||!kd.has(r))){e=qi(n,e),n=Ic(2),r=Co(t,n,2),r!==null&&(Lc(n,r,t,e),_t(r,2),Lf(r));break}}t=t.return}}function Tf(e,t,n){var r=e.pingCache;if(r===null){r=e.pingCache=new od;var i=new Set;r.set(t,i)}else i=r.get(t),i===void 0&&(i=new Set,r.set(t,i));i.has(n)||(md=!0,i.add(n),e=Ef.bind(null,e,t,n),t.then(e,e))}function Ef(e,t,n){var r=e.pingCache;r!==null&&r.delete(t),e.pingedLanes|=e.suspendedLanes&n,e.warmLanes&=~n,cd===e&&(ud&n)===n&&(gd===4||gd===3&&(ud&62914560)===ud&&300>Ge()-Td?sd&2?yd|=n:Qd(e,0):yd|=n,xd===ud&&(xd=0)),Lf(e)}function Df(e,t){t===0&&(t=ht()),e=Mi(e,t),e!==null&&(_t(e,t),Lf(e))}function Of(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),Df(e,n)}function kf(e,t){var n=0;switch(e.tag){case 31:case 13:var r=e.stateNode,i=e.memoizedState;i!==null&&(n=i.retryLane);break;case 19:r=e.stateNode;break;case 22:r=e.stateNode._retryCache;break;default:throw Error(a(314))}r!==null&&r.delete(t),Df(e,n)}function Af(e,t){return Ve(e,t)}var jf=null,Mf=null,Nf=!1,Pf=!1,Ff=!1,If=0;function Lf(e){e!==Mf&&e.next===null&&(Mf===null?jf=Mf=e:Mf=Mf.next=e),Pf=!0,Nf||(Nf=!0,Wf())}function Rf(e,t){if(!Ff&&Pf){Ff=!0;do for(var n=!1,r=jf;r!==null;){if(!t){if(e!==0){var i=r.pendingLanes;if(i===0)var a=0;else{var o=r.suspendedLanes,s=r.pingedLanes;a=(1<<31-rt(42|e)+1)-1,a&=i&~(o&~s),a=a&201326741?a&201326741|1:a?a|2:0}a!==0&&(n=!0,Uf(r,a))}else a=ud,a=dt(r,r===cd?a:0,r.cancelPendingCommit!==null||r.timeoutHandle!==-1),!(a&3)||ft(r,a)||(n=!0,Uf(r,a))}r=r.next}while(n);Ff=!1}}function zf(){Bf()}function Bf(){Pf=Nf=!1;var e=0;If!==0&&Ep()&&(e=If);for(var t=Ge(),n=null,r=jf;r!==null;){var i=r.next,a=Vf(r,t);a===0?(r.next=null,n===null?jf=i:n.next=i,i===null&&(Mf=n)):(n=r,(e!==0||a&3)&&(Pf=!0)),r=i}Ad!==0&&Ad!==5||Rf(e,!1),If!==0&&(If=0)}function Vf(e,t){for(var n=e.suspendedLanes,r=e.pingedLanes,i=e.expirationTimes,a=e.pendingLanes&-62914561;0s)break;var u=c.transferSize,d=c.initiatorType;u&&gp(d)&&(c=c.responseEnd,o+=u*(cuh){s.length=o;break}f=new Promise(Hp.bind(f)),s.push(f)}}}if(0`u`?null:document;function Im(e,t,n){var r=Fm;if(r&&typeof t==`string`&&t){var i=cn(t);i=`link[rel="`+e+`"][href="`+i+`"]`,typeof n==`string`&&(i+=`[crossorigin="`+n+`"]`),Am.has(i)||(Am.add(i),e={rel:e,crossOrigin:n,href:t},r.querySelector(i)===null&&(t=r.createElement(`link`),pp(t,`link`,e),Bt(t),r.head.appendChild(t)))}}function Lm(e){Mm.D(e),Im(`dns-prefetch`,e,null)}function Rm(e,t){Mm.C(e,t),Im(`preconnect`,e,t)}function zm(e,t,n){Mm.L(e,t,n);var r=Fm;if(r&&e&&t){var i=`link[rel="preload"][as="`+cn(t)+`"]`;t===`image`&&n&&n.imageSrcSet?(i+=`[imagesrcset="`+cn(n.imageSrcSet)+`"]`,typeof n.imageSizes==`string`&&(i+=`[imagesizes="`+cn(n.imageSizes)+`"]`)):i+=`[href="`+cn(e)+`"]`;var a=i;switch(t){case`style`:a=Gm(e);break;case`script`:a=Ym(e)}if(!(km.has(a)||(e=T({rel:`preload`,href:t===`image`&&n&&n.imageSrcSet?void 0:e,as:t},n),km.set(a,e),r.querySelector(i)!==null||t===`style`&&r.querySelector(Km(a))||t===`script`&&r.querySelector(Xm(a))))){var o=r.createElement(`link`);pp(o,`link`,e),t===`style`&&(o[It]=!0,o.onload=o.onerror=function(){Vt(o)}),Bt(o),r.head.appendChild(o)}}}function Bm(e,t){Mm.m(e,t);var n=Fm;if(n&&e){var r=t&&typeof t.as==`string`?t.as:`script`,i=`link[rel="modulepreload"][as="`+cn(r)+`"][href="`+cn(e)+`"]`,a=i;switch(r){case`audioworklet`:case`paintworklet`:case`serviceworker`:case`sharedworker`:case`worker`:case`script`:a=Ym(e)}if(!km.has(a)&&(e=T({rel:`modulepreload`,href:e},t),km.set(a,e),n.querySelector(i)===null)){switch(r){case`audioworklet`:case`paintworklet`:case`serviceworker`:case`sharedworker`:case`worker`:case`script`:if(n.querySelector(Xm(a)))return}r=n.createElement(`link`),pp(r,`link`,e),Bt(r),n.head.appendChild(r)}}}function Vm(e,t,n){Mm.S(e,t,n);var r=Fm;if(r&&e){var i=zt(r).hoistableStyles,a=Gm(e);t||=`default`;var o=i.get(a);if(!o){var s={loading:0,preload:null};if(o=r.querySelector(Km(a)))s.loading=5;else{e=T({rel:`stylesheet`,href:e,"data-precedence":t},n),(n=km.get(a))&&$m(e,n);var c=o=r.createElement(`link`);Bt(c),pp(c,`link`,e),c._p=new Promise(function(e,t){c.onload=e,c.onerror=t}),c.addEventListener(`load`,function(){s.loading|=1}),c.addEventListener(`error`,function(){s.loading|=2}),s.loading|=4,Qm(o,t,r)}o={type:`stylesheet`,instance:o,count:1,state:s},i.set(a,o)}}}function Hm(e,t){Mm.X(e,t);var n=Fm;if(n&&e){var r=zt(n).hoistableScripts,i=Ym(e),a=r.get(i);a||(a=n.querySelector(Xm(i)),a||(e=T({src:e,async:!0},t),(t=km.get(i))&&eh(e,t),a=n.createElement(`script`),Bt(a),pp(a,`link`,e),n.head.appendChild(a)),a={type:`script`,instance:a,count:1,state:null},r.set(i,a))}}function Um(e,t){Mm.M(e,t);var n=Fm;if(n&&e){var r=zt(n).hoistableScripts,i=Ym(e),a=r.get(i);a||(a=n.querySelector(Xm(i)),a||(e=T({src:e,async:!0,type:`module`},t),(t=km.get(i))&&eh(e,t),a=n.createElement(`script`),Bt(a),pp(a,`link`,e),n.head.appendChild(a)),a={type:`script`,instance:a,count:1,state:null},r.set(i,a))}}function Wm(e,t,n,r){var i=(i=De.current)?jm(i):null;if(!i)throw Error(a(446));switch(e){case`meta`:case`title`:return null;case`style`:return typeof n.precedence==`string`&&typeof n.href==`string`?(n=Gm(n.href),t=zt(i).hoistableStyles,r=t.get(n),r||(r={type:`style`,instance:null,count:0,state:null},t.set(n,r)),r):{type:`void`,instance:null,count:0,state:null};case`link`:if(n.rel===`stylesheet`&&typeof n.href==`string`&&typeof n.precedence==`string`){e=Gm(n.href);var o=zt(i).hoistableStyles,s=o.get(e);if(s||(i=i.ownerDocument||i,s={type:`stylesheet`,instance:null,count:0,state:{loading:0,preload:null}},o.set(e,s),(o=i.querySelector(Km(e)))?o._p||(s.instance=o,s.state.loading=5):(o=km.get(e),o||(o={rel:`preload`,as:`style`,href:n.href,crossOrigin:n.crossOrigin,integrity:n.integrity,media:n.media,hrefLang:n.hrefLang,referrerPolicy:n.referrerPolicy},km.set(e,o)),Jm(i,e,o,s.state))),t&&r===null)throw Error(a(528,``));return s}if(t&&r!==null)throw Error(a(529,``));return null;case`script`:return t=n.async,n=n.src,typeof n==`string`&&t&&typeof t!=`function`&&typeof t!=`symbol`?(n=Ym(n),t=zt(i).hoistableScripts,r=t.get(n),r||(r={type:`script`,instance:null,count:0,state:null},t.set(n,r)),r):{type:`void`,instance:null,count:0,state:null};default:throw Error(a(444,e))}}function Gm(e){return`href="`+cn(e)+`"`}function Km(e){return`link[rel="stylesheet"][`+e+`]`}function qm(e){return T({},e,{"data-precedence":e.precedence,precedence:null})}function Jm(e,t,n,r){if(t=e.querySelector(`link[rel="preload"][as="style"][`+t+`]`)){if(!0!==t[It]){r.loading=1;return}}else t=e.createElement(`link`),t[It]=!0,t.onload=t.onerror=Vt.bind(null,t),pp(t,`link`,n),Bt(t),e.head.appendChild(t);r.preload=t,t.addEventListener(`load`,function(){return r.loading|=1}),t.addEventListener(`error`,function(){return r.loading|=2})}function Ym(e){return`[src="`+cn(e)+`"]`}function Xm(e){return`script[async]`+e}function Zm(e,t,n){if(t.count++,t.instance===null)switch(t.type){case`style`:var r=e.querySelector(`style[data-href~="`+cn(n.href)+`"]`);if(r)return t.instance=r,Bt(r),r;var i=T({},n,{"data-href":n.href,"data-precedence":n.precedence,href:null,precedence:null});return r=(e.ownerDocument||e).createElement(`style`),Bt(r),pp(r,`style`,i),Qm(r,n.precedence,e),t.instance=r;case`stylesheet`:i=Gm(n.href);var o=e.querySelector(Km(i));if(o)return t.state.loading|=4,t.instance=o,Bt(o),o;r=qm(n),(i=km.get(i))&&$m(r,i),o=(e.ownerDocument||e).createElement(`link`),Bt(o);var s=o;return s._p=new Promise(function(e,t){s.onload=e,s.onerror=t}),pp(o,`link`,r),t.state.loading|=4,Qm(o,n.precedence,e),t.instance=o;case`script`:return o=Ym(n.src),(i=e.querySelector(Xm(o)))?(t.instance=i,Bt(i),i):(r=n,(i=km.get(o))&&(r=T({},n),eh(r,i)),e=e.ownerDocument||e,i=e.createElement(`script`),Bt(i),pp(i,`link`,r),e.head.appendChild(i),t.instance=i);case`void`:return null;default:throw Error(a(443,t.type))}else t.type===`stylesheet`&&!(t.state.loading&4)&&(r=t.instance,t.state.loading|=4,Qm(r,n.precedence,e));return t.instance}function Qm(e,t,n){for(var r=n.querySelectorAll(`link[rel="stylesheet"][data-precedence],style[data-precedence]`),i=r.length?r[r.length-1]:null,a=i,o=0;o title`):null)}function ih(e,t,n){if(n===1||t.itemProp!=null)return!1;switch(e){case`meta`:case`title`:return!0;case`style`:if(typeof t.precedence!=`string`||typeof t.href!=`string`||t.href===``)break;return!0;case`link`:if(typeof t.rel!=`string`||typeof t.href!=`string`||t.href===``||t.onLoad||t.onError)break;switch(t.rel){case`stylesheet`:return e=t.disabled,typeof t.precedence==`string`&&e==null;default:return!0}case`script`:if(t.async&&typeof t.async!=`function`&&typeof t.async!=`symbol`&&!t.onLoad&&!t.onError&&t.src&&typeof t.src==`string`)return!0}return!1}function ah(e,t){return e===`img`&&t.src!=null&&t.src!==``&&t.onLoad==null&&t.loading!==`lazy`}function oh(e){return!(e.type===`stylesheet`&&!(e.state.loading&3))}function sh(e){return(e.width||100)*(e.height||100)*(typeof devicePixelRatio==`number`?devicePixelRatio:1)*.25}function ch(e,t){typeof t.decode==`function`&&(e.imgCount++,t.complete||(e.imgBytes+=sh(t),e.suspenseyImages.push(t)),e=mh.bind(e),t.decode().then(e,e))}function lh(e,t,n,r){if(n.type===`stylesheet`&&(typeof r.media!=`string`||!1!==matchMedia(r.media).matches)&&!(n.state.loading&4)){if(n.instance===null){var i=Gm(r.href),a=t.querySelector(Km(i));if(a){t=a._p,typeof t==`object`&&t&&typeof t.then==`function`&&(e.count++,e=ph.bind(e),t.then(e,e)),n.state.loading|=4,n.instance=a,Bt(a);return}a=t.ownerDocument||t,r=qm(r),(i=km.get(i))&&$m(r,i),a=a.createElement(`link`),Bt(a);var o=a;o._p=new Promise(function(e,t){o.onload=e,o.onerror=t}),pp(a,`link`,r),n.instance=a}e.stylesheets===null&&(e.stylesheets=new Map),e.stylesheets.set(n,t),(t=n.state.preload)&&!(n.state.loading&3)&&(e.count++,n=ph.bind(e),t.addEventListener(`load`,n),t.addEventListener(`error`,n))}}var uh=0;function dh(e,t){return e.stylesheets&&e.count===0&&gh(e,e.stylesheets),0uh?50:800)+t);return e.unsuspend=n,function(){e.unsuspend=null,clearTimeout(r),clearTimeout(i)}}:null}function fh(e){if(e.count===0&&(e.imgCount===0||!e.waitingForImages)){if(e.stylesheets)gh(e,e.stylesheets);else if(e.unsuspend){var t=e.unsuspend;e.unsuspend=null,t()}}}function ph(){this.count--,fh(this)}function mh(){this.imgCount--,fh(this)}var hh=null;function gh(e,t){e.stylesheets=null,e.unsuspend!==null&&(e.count++,hh=new Map,t.forEach(_h,e),hh=null,ph.call(e))}function _h(e,t){if(!(t.state.loading&4)){var n=hh.get(e);if(n)var r=n.get(null);else{n=new Map,hh.set(e,n);for(var i=e.querySelectorAll(`link[data-precedence],style[data-precedence]`),a=0;a{function n(){if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<`u`&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE==`function`)try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(n)}catch(e){console.error(e)}}n(),t.exports=Ft()})),Lt=class{get to(){return this._to}get id(){return this._id}get path(){return this._path}get fullPath(){return this._fullPath}constructor(e){if(this.init=e=>{this.originalIndex=e,this._branch=void 0;let t=this.options,n=!t?.path&&!t?.id;this.parentRoute=this.options.getParentRoute?.(),n?this._path=ct:this.parentRoute||et();let r=n?ct:t?.path;r&&r!==`/`&&(r=He(r));let i=t?.id||r,a=n?ct:Ue((this.parentRoute.id===`__root__`?``:this.parentRoute.id)+`/`+(i??``));r===`__root__`&&(r=`/`);let o=a===`__root__`?`/`:r===void 0?this.parentRoute.fullPath:Ue(this.parentRoute.fullPath+`/`+r);this._path=r,this._id=a,this._fullPath=o,this._to=Ge(o)},this.addChildren=e=>this._addFileChildren(e),this._addFileChildren=e=>(Array.isArray(e)&&(this.children=e),typeof e==`object`&&e&&(this.children=Object.values(e)),this),this._addFileTypes=()=>this,this.updateLoader=e=>(Object.assign(this.options,e),this),this.update=e=>(Object.assign(this.options,e),this),this.lazy=e=>(this.lazyFn=e,this),this.redirect=e=>Ve({from:this.fullPath,...e}),this.options=e||{},this.isRoot=!e?.getParentRoute,e?.id&&e?.path)throw Error(`Route cannot have both an 'id' and a 'path' option.`)}},Rt=class extends Lt{constructor(e){super(e)}},N=a(t(),1),P=i(),zt=class extends N.Component{constructor(...e){super(...e),this.state={error:0},this.reset=()=>{this.setState({error:0})}}static getDerivedStateFromProps(e,t){let n=e.getResetKey();return t.error&&t.resetKey!==n?{resetKey:n,error:0}:{resetKey:n}}static getDerivedStateFromError(e){return{error:[e]}}componentDidCatch(e,t){this.props.onCatch?.(e,t)}render(){let e=this.state.error;return e?N.createElement(this.props.errorComponent??Bt,{error:e[0],reset:this.reset}):this.props.children}};function Bt({error:e}){let[t,n]=N.useState(!1);return(0,P.jsxs)(`div`,{style:{padding:`.5rem`,maxWidth:`100%`},children:[(0,P.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:`.5rem`},children:[(0,P.jsx)(`strong`,{style:{fontSize:`1rem`},children:`Something went wrong!`}),(0,P.jsx)(`button`,{style:{appearance:`none`,fontSize:`.6em`,border:`1px solid currentColor`,padding:`.1rem .2rem`,fontWeight:`bold`,borderRadius:`.25rem`},onClick:()=>n(e=>!e),children:t?`Hide Error`:`Show Error`})]}),(0,P.jsx)(`div`,{style:{height:`.25rem`}}),t?(0,P.jsx)(`div`,{children:(0,P.jsx)(`pre`,{style:{fontSize:`.7em`,border:`1px solid red`,borderRadius:`.25rem`,padding:`.3rem`,color:`red`,overflow:`auto`},children:e?.message?(0,P.jsx)(`code`,{children:e.message}):null})}):null]})}var Vt=()=>!0,Ht=()=>!1;function Ut({children:e,fallback:t=null}){return(0,P.jsx)(N.Fragment,{children:Wt()?e:t})}function Wt(e=!0){return N.useSyncExternalStore(Gt,Vt,e?Ht:Vt)}function Gt(){return()=>{}}function Kt({update:e,notify:t,unwatched:n}){return{link:r,unlink:i,propagate:a,checkDirty:o,shallowPropagate:s};function r(e,t,n){let r=t.depsTail;if(r!==void 0&&r.dep===e)return;let i=r===void 0?t.deps:r.nextDep;if(i!==void 0&&i.dep===e){i.version=n,t.depsTail=i;return}let a=e.subsTail;if(a!==void 0&&a.version===n&&a.sub===t)return;let o=t.depsTail=e.subsTail={version:n,dep:e,sub:t,prevDep:r,nextDep:i,prevSub:a,nextSub:void 0};i!==void 0&&(i.prevDep=o),r===void 0?t.deps=o:r.nextDep=o,a===void 0?e.subs=o:a.nextSub=o}function i(e,t=e.sub){let r=e.dep,i=e.prevDep,a=e.nextDep,o=e.nextSub,s=e.prevSub;return a===void 0?t.depsTail=i:a.prevDep=i,i===void 0?t.deps=a:i.nextDep=a,o===void 0?r.subsTail=s:o.prevSub=s,s===void 0?(r.subs=o)===void 0&&n(r):s.nextSub=o,a}function a(e){let n=e.nextSub,r;top:do{let i=e.sub,a=i.flags;if(a&60?a&12?a&4?!(a&48)&&c(e,i)?(i.flags=a|40,a&=1):a=0:i.flags=a&-9|32:a=0:i.flags=a|32,a&2&&t(i),a&1){let t=i.subs;if(t!==void 0){let i=(e=t).nextSub;i!==void 0&&(r={value:n,prev:r},n=i);continue}}if((e=n)!==void 0){n=e.nextSub;continue}for(;r!==void 0;)if(e=r.value,r=r.prev,e!==void 0){n=e.nextSub;continue top}break}while(1)}function o(t,n){let r,i=0,a=!1;top:do{let o=t.dep,c=o.flags;if(n.flags&16)a=!0;else if((c&17)==17){if(e(o)){let e=o.subs;e.nextSub!==void 0&&s(e),a=!0}}else if((c&33)==33){(t.nextSub!==void 0||t.prevSub!==void 0)&&(r={value:t,prev:r}),t=o.deps,n=o,++i;continue}if(!a){let e=t.nextDep;if(e!==void 0){t=e;continue}}for(;i--;){let i=n.subs,o=i.nextSub!==void 0;if(o?(t=r.value,r=r.prev):t=i,a){if(e(n)){o&&s(i),n=t.sub;continue}a=!1}else n.flags&=-33;n=t.sub;let c=t.nextDep;if(c!==void 0){t=c;continue top}}return a}while(1)}function s(e){do{let n=e.sub,r=n.flags;(r&48)==32&&(n.flags=r|16,(r&6)==2&&t(n))}while((e=e.nextSub)!==void 0)}function c(e,t){let n=t.depsTail;for(;n!==void 0;){if(n===e)return!0;n=n.prevDep}return!1}}function qt(e,t,n){let r=typeof e==`object`,i=r?e:void 0;return{next:(r?e.next:e)?.bind(i),error:(r?e.error:t)?.bind(i),complete:(r?e.complete:n)?.bind(i)}}var Jt=[],Yt=0,{link:Xt,unlink:Zt,propagate:Qt,checkDirty:$t,shallowPropagate:en}=Kt({update(e){return e._update()},notify(e){Jt[nn++]=e,e.flags&=-3},unwatched(e){e.depsTail!==void 0&&(e.depsTail=void 0,e.flags=17,sn(e))}}),tn=0,nn=0,rn,an=0;function on(e){try{++an,e()}finally{--an||cn()}}function sn(e){let t=e.depsTail,n=t===void 0?e.deps:t.nextDep;for(;n!==void 0;)n=Zt(n,e)}function cn(){if(!(an>0)){for(;tn{i.get(),n.current?(rn=void 0,t.next?.(i._snapshot)):n.current=!0});return{unsubscribe:()=>{r.stop()}}},_update(e){let a=rn,o=t?.compare??Object.is;if(n)rn=i,++Yt,i.depsTail=void 0;else if(e===void 0)return!1;n&&(i.flags=5);try{let t=i._snapshot,a=typeof e==`function`?e(t):e===void 0&&n?r(t):e;return t===void 0||!o(t,a)?(i._snapshot=a,!0):!1}finally{rn=a,n&&(i.flags&=-5),sn(i)}}};return n?(i.flags=17,i.get=function(){let e=i.flags;if(e&16||e&32&&$t(i.deps,i)){if(i._update()){let e=i.subs;e!==void 0&&en(e)}}else e&32&&(i.flags=e&-33);return rn!==void 0&&Xt(i,rn,Yt),i._snapshot}):i.set=function(e){if(i._update(e)){let e=i.subs;e!==void 0&&(Qt(e),en(e),cn())}},i}function un(e){let t=()=>{let t=rn;rn=n,++Yt,n.depsTail=void 0,n.flags=6;try{return e()}finally{rn=t,n.flags&=-5,sn(n)}},n={deps:void 0,depsTail:void 0,subs:void 0,subsTail:void 0,flags:6,notify(){let e=this.flags;e&16||e&32&&$t(this.deps,this)?t():this.flags=2},stop(){this.flags=0,this.depsTail=void 0,sn(this)}};return t(),n}var dn=e((e=>{var n=t();function r(e,t){return e===t&&(e!==0||1/e==1/t)||e!==e&&t!==t}var i=typeof Object.is==`function`?Object.is:r,a=n.useState,o=n.useEffect,s=n.useLayoutEffect,c=n.useDebugValue;function l(e,t){var n=t(),r=a({inst:{value:n,getSnapshot:t}}),i=r[0].inst,l=r[1];return s(function(){i.value=n,i.getSnapshot=t,u(i)&&l({inst:i})},[e,n,t]),o(function(){return u(i)&&l({inst:i}),e(function(){u(i)&&l({inst:i})})},[e]),c(n),n}function u(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!i(e,n)}catch{return!0}}function d(e,t){return t()}var f=typeof window>`u`||window.document===void 0||window.document.createElement===void 0?d:l;e.useSyncExternalStore=n.useSyncExternalStore===void 0?f:n.useSyncExternalStore})),fn=e(((e,t)=>{t.exports=dn()})),pn=e((e=>{var n=t(),r=fn();function i(e,t){return e===t&&(e!==0||1/e==1/t)||e!==e&&t!==t}var a=typeof Object.is==`function`?Object.is:i,o=r.useSyncExternalStore,s=n.useRef,c=n.useEffect,l=n.useMemo,u=n.useDebugValue;e.useSyncExternalStoreWithSelector=function(e,t,n,r,i){var d=s(null);if(d.current===null){var f={hasValue:!1,value:null};d.current=f}else f=d.current;d=l(function(){function e(e){if(!o){if(o=!0,s=e,e=r(e),i!==void 0&&f.hasValue){var t=f.value;if(i(t,e))return c=t}return c=e}if(t=c,a(s,e))return t;var n=r(e);return i!==void 0&&i(t,n)?(s=e,t):(s=e,c=n)}var o=!1,s,c,l=n===void 0?null:n;return[function(){return e(t())},l===null?void 0:function(){return e(l())}]},[t,n,r,i]);var p=o(e,d[0],d[1]);return c(function(){f.hasValue=!0,f.value=p},[p]),u(p),p}})),mn=e(((e,t)=>{t.exports=pn()}))();function hn(e,t){return e===t}function gn(e,t=e=>e,n){let r=n?.compare??hn,i=(0,N.useCallback)(t=>{let{unsubscribe:n}=e.subscribe(t);return n},[e]),a=(0,N.useCallback)(()=>e.get(),[e]);return(0,mn.useSyncExternalStoreWithSelector)(i,a,a,t,r)}var _n={};function vn(e,t){let n=N.useRef();return r=>{let i=e?.select?e.select(r):r;return e?.structuralSharing??t.options.defaultStructuralSharing?n.current=We(n.current,i):i}}function yn(e){let t=o(),n=N.useContext(e.from?qe:st),r=e.from??n,i=t.stores.getMatchStore(r),a=vn(e,t),s=gn(i,e=>e?a(e):_n);if(s!==_n)return s;(e.shouldThrow??!0)&&et()}function bn(e){return yn({from:e.from,strict:e.strict,structuralSharing:e.structuralSharing,select:t=>e.select?e.select(t.loaderData):t.loaderData})}function xn(e){let{select:t,...n}=e;return yn({...n,select:e=>t?t(e.loaderDeps):e.loaderDeps})}function Sn(e){return yn({from:e.from,shouldThrow:e.shouldThrow,structuralSharing:e.structuralSharing,strict:e.strict,select:t=>{let n=e.strict===!1?t.params:t._strictParams;return e.select?e.select(n):n}})}function Cn(e){return yn({from:e.from,strict:e.strict,shouldThrow:e.shouldThrow,structuralSharing:e.structuralSharing,select:t=>e.select?e.select(t.search):t.search})}function wn(e){return yn({...e,select:t=>e.select?e.select(t.context):t.context})}var Tn=class extends Lt{constructor(e){super(e),this.useMatch=e=>yn({...e,from:this.id}),this.useRouteContext=e=>wn({...e,from:this.id}),this.useSearch=e=>Cn({...e,from:this.id}),this.useParams=e=>Sn({...e,from:this.id}),this.useLoaderDeps=e=>xn({...e,from:this.id}),this.useLoaderData=e=>bn({...e,from:this.id}),this.useNavigate=()=>Le({from:this.fullPath}),this.Link=N.forwardRef((e,t)=>(0,P.jsx)(Xe,{ref:t,from:this.fullPath,...e}))}};function En(e){return new Tn(e)}var Dn=class extends Rt{constructor(e){super(e),this.useMatch=e=>yn({...e,from:this.id}),this.useRouteContext=e=>wn({...e,from:this.id}),this.useSearch=e=>Cn({...e,from:this.id}),this.useParams=e=>Sn({...e,from:this.id}),this.useLoaderDeps=e=>xn({...e,from:this.id}),this.useLoaderData=e=>bn({...e,from:this.id}),this.useNavigate=()=>Le({from:this.fullPath}),this.Link=N.forwardRef((e,t)=>(0,P.jsx)(Xe,{ref:t,from:this.fullPath,...e}))}};function On(e){return new Dn(e)}function kn(e){return e=>{let t=En(e);return t.isRoot=!1,t}}function An(e,t){let n,r,i,a=()=>(n||=(i=void 0,e().then(e=>{n=void 0,o.preload=void 0,r=e[t??`default`]}).catch(e=>{n=void 0,i=e})),n),o=function(e){if(i){if($e(i)&&typeof sessionStorage<`u`){let e=`tanstack_router_reload:${i.message}`;if(!sessionStorage.getItem(e))throw sessionStorage.setItem(e,`1`),window.location.reload(),new Promise(()=>{})}throw i}if(!r){if(Re)Re(a());else throw a()}return N.createElement(r,e)};return o.preload=a,o}function jn(e){let t=o(),n=`not-found-${gn(t.stores.location,e=>e.pathname)}-${gn(t.stores.status)}`;return(0,P.jsx)(zt,{getResetKey:()=>n,onCatch:(t,n)=>{if(Ke(t))e.onCatch?.(t,n);else throw t},errorComponent:({error:t})=>{if(Ke(t))return e.fallback?.(t);throw t},children:e.children})}function Mn(){return(0,P.jsx)(`p`,{children:`Not Found`})}function Nn(e,t,n){return t.options.notFoundComponent?(0,P.jsx)(t.options.notFoundComponent,{...n}):e.options.defaultNotFoundComponent?(0,P.jsx)(e.options.defaultNotFoundComponent,{...n}):(0,P.jsx)(Mn,{})}function Pn(e,t){let n=t?.options.pendingComponent??e.options.defaultPendingComponent;return n?(0,P.jsx)(n,{}):null}var Fn=(e,t)=>e[0]===t[0]&&e[1]===t[1],In=(e,t,n)=>!t.isRoot||t.options.shellComponent||t.options.wrapInSuspense||n===!1||n===`data-only`||!e.ssr,Ln=N.memo(function({routeId:e}){let t=o();return Rn(t,gn(t.stores.getMatchStore(e)))});function Rn(e,t){let n=e.routesById[t.routeId],r=Pn(e,n),i=n.options.errorComponent??e.options.defaultErrorComponent,a=n.options.onCatch??e.options.defaultOnCatch,o=n.isRoot?n.options.notFoundComponent??e.options.notFoundRoute?.options.component:n.options.notFoundComponent,s=t.ssr===!1||t.ssr===`data-only`,c=In(e,n,t.ssr)&&(n.options.wrapInSuspense??r??(n.options.errorComponent?.preload||s)),l=(0,P.jsx)(zn,{match:t});s&&(l=(0,P.jsx)(Ut,{fallback:r,children:l})),o&&(l=(0,P.jsx)(jn,{fallback:e=>{if(e.routeId??=t.routeId,e.routeId!==t.routeId)throw e;return N.createElement(o,e)},children:l})),i&&(l=(0,P.jsx)(zt,{getResetKey:()=>t,errorComponent:i,onCatch:(e,n)=>{if(Ke(e))throw e.routeId??=t.routeId,e;a?.(e,n)},children:l})),c&&(l=(0,P.jsx)(N.Suspense,{fallback:r,children:l}));let u=n.isRoot&&n.options.shellComponent;return u?(0,P.jsx)(st.Provider,{value:t.routeId,children:(0,P.jsxs)(u,{children:[l,null]})}):(0,P.jsxs)(st.Provider,{value:t.routeId,children:[l,null]})}var zn=N.memo(function({match:e}){let t=o(),n=e.routeId,r=t.routesById[n],i=N.useMemo(()=>{let i=(r.options.remountDeps??t.options.defaultRemountDeps)?.({routeId:n,loaderDeps:e.loaderDeps,params:e._strictParams,search:e._strictSearch});return i?JSON.stringify(i):void 0},[n,e.loaderDeps,e._strictParams,e._strictSearch,r.options.remountDeps,t.options.defaultRemountDeps]),a=N.useMemo(()=>{let e=r.options.component??t.options.defaultComponent;return e?(0,P.jsx)(e,{},i):(0,P.jsx)(Bn,{})},[i,r.options.component,t.options.defaultComponent]);if(e.status===`pending`){if(t.ssr&&!In(t,r,e.ssr))return a;if(t._tx)throw t._tx[5];return Pn(t,r)}if(e.status===`notFound`)return Nn(t,r,e.error);if(e.status===`error`)throw e.error;return a}),Bn=N.memo(function(){let e=o(),t=N.useContext(st),n,r,i;{let a=e.stores.getMatchStore(t);[n,r]=gn(a,e=>[!!e._notFound,e.error],{compare:Fn}),i=gn(e.stores.ids,e=>e[e.indexOf(t)+1])}if(n)return Nn(e,e.routesById[t],r);if(!i)return null;let a=(0,P.jsx)(Ln,{routeId:i});return t===`__root__`?(0,P.jsx)(N.Suspense,{fallback:Pn(e),children:a}):a});function Vn(e,t){let n=e[1];e.length=0,n?.(t)}function Hn({t:e}){let t=o(),n=t._rendered??=[];return t.startTransition=(r,i)=>new Promise(a=>{Vn(n,!1),n.push(i,a),e(t),N.startTransition(r)}),Ie(()=>{let e=t.history.subscribe(t.load);t.updateLatestLocation();let r=t.latestLocation,i=t.buildLocation({to:r.pathname,search:!0,params:!0,hash:!0,state:!0,_includeValidateSearch:!0});if(Ge(r.publicHref)!==Ge(i.publicHref))return t.commitLocation({...i,replace:!0,ignoreBlocker:!0}),e;let a=t.stores.resolvedLocation.get();return a?.href===r.href&&a.state.__TSR_key===r.state.__TSR_key?n.push(t.stores.matches.get(),e=>{e&&t.emit({type:`onRendered`,...Ye(a,a)})}):t._tx||t.load({sync:!0}).catch(console.error),e},[t,t.history]),null}function Un(){let e=o(),t=e.routesById[ct],n=Pn(e,t),r=(0,P.jsxs)(P.Fragment,{children:[(0,P.jsx)(Hn,{t:N.useState()[1]}),e.ssr?(0,P.jsx)(Wn,{}):(0,P.jsx)(N.Suspense,{fallback:n,children:(0,P.jsx)(Wn,{})})]});return e.options.InnerWrap?(0,P.jsx)(e.options.InnerWrap,{children:r}):r}function Wn(){let e=o(),t=e._rendered,n=gn(e.stores.matches,e=>t[0]??e),r=n[0],i=r?.routeId;Ie(()=>{t[0]===n&&Vn(t,!0)},[t,n]);let a=i?(0,P.jsx)(Ln,{routeId:i}):null;return e.options.disableGlobalCatchBoundary?a:(0,P.jsx)(zt,{getResetKey:()=>r,onCatch:void 0,children:a})}var Gn=e=>({createMutableStore:ln,createReadonlyStore:ln,batch:on}),Kn=e=>new qn(e),qn=class extends lt{constructor(e){super(e,Gn)}};function Jn({router:e,children:t,...r}){Be(r)&&e.update({...e.options,...r,context:{...e.options.context,...r.context}});let i=(0,P.jsx)(n.Provider,{value:e,children:t});return e.options.Wrap?(0,P.jsx)(e.options.Wrap,{children:i}):i}function Yn({router:e,...t}){return(0,P.jsx)(Jn,{router:e,...t,children:(0,P.jsx)(Un,{})})}function Xn(e){let t=o({warn:e?.router===void 0}),n=e?.router||t;return gn(n.stores.__store,vn(e,n))}function Zn(e){return typeof e!=`string`||!e.includes(`var(--mantine-scale)`)?e:e.match(/^calc\((.*?)\)$/)?.[1].split(`*`)[0].trim()}function Qn(e){let t=Zn(e);return typeof t==`number`?t:typeof t==`string`?t.includes(`calc`)||t.includes(`var`)?t:t.includes(`px`)?Number(t.replace(`px`,``)):t.includes(`rem`)?Number(t.replace(`rem`,``))*16:t.includes(`em`)?Number(t.replace(`em`,``))*16:Number(t):NaN}function $n(e,t){let n=e;for(;(n=n.parentElement)&&!n.matches(t););return n}function er(e,t,n){for(let n=e-1;n>=0;--n)if(!t[n].disabled)return n;if(n){for(let e=t.length-1;e>-1;--e)if(!t[e].disabled)return e}return e}function tr(e,t,n){for(let n=e+1;n{n?.(s);let c=Array.from($n(s.currentTarget,e)?.querySelectorAll(t)||[]).filter(t=>nr(s.currentTarget,t,e)),l=c.findIndex(e=>s.currentTarget===e),u=tr(l,c,r),d=er(l,c,r),f=a===`rtl`?d:u,p=a===`rtl`?u:d;switch(s.key){case`ArrowRight`:o===`horizontal`&&(s.stopPropagation(),s.preventDefault(),c[f].focus(),i&&c[f].click());break;case`ArrowLeft`:o===`horizontal`&&(s.stopPropagation(),s.preventDefault(),c[p].focus(),i&&c[p].click());break;case`ArrowUp`:o===`vertical`&&(s.stopPropagation(),s.preventDefault(),c[d].focus(),i&&c[d].click());break;case`ArrowDown`:o===`vertical`&&(s.stopPropagation(),s.preventDefault(),c[u].focus(),i&&c[u].click());break;case`Home`:s.stopPropagation(),s.preventDefault(),c[tr(-1,c,!1)]?.focus();break;case`End`:s.stopPropagation(),s.preventDefault(),c[er(c.length,c,!1)]?.focus()}}}var ir=()=>{};function ar(e,t={active:!0}){return typeof e!=`function`||!t.active?t.onKeyDown||ir:n=>{n.key===`Escape`&&(e(n),t.onTrigger?.())}}function or(e,t){return n=>{e?.(n),t?.(n)}}function sr(e,t){return e in t?Qn(t[e]):Qn(e)}function cr(e,t){let n=e.map(e=>({value:e,px:sr(e,t)}));return n.sort((e,t)=>e.px-t.px),n}function lr(e,t,n){return n?Array.from($n(n,t)?.querySelectorAll(e)||[]).findIndex(e=>e===n):null}var ur=[`mousedown`,`touchstart`];function dr(e,t,n,r=!0,i=!1){let a=(0,N.useRef)(null),o=t||ur,s=(0,N.useEffectEvent)(t=>{let{target:r}=t??{};if(!document.body.contains(r)&&r?.tagName!==`HTML`)return;let i=t.composedPath();Array.isArray(n)?n.every(e=>!!e&&!i.includes(e))&&e(t):a.current&&!i.includes(a.current)&&e(t)}),c=o.join(`,`);return(0,N.useEffect)(()=>{if(!r)return;let e=c.split(`,`);return e.forEach(e=>document.addEventListener(e,s,i)),()=>{e.forEach(e=>document.removeEventListener(e,s,i))}},[c,r,i]),a}function fr(e,t){return ie(`(prefers-color-scheme: dark)`,e===`dark`,t)?`dark`:`light`}function pr(e,t,n={leading:!1}){let[r,i]=(0,N.useState)(e),a=(0,N.useRef)(!1),o=(0,N.useRef)(null),s=(0,N.useRef)(!1),c=(0,N.useRef)(e);c.current=e;let l=(0,N.useCallback)(()=>{window.clearTimeout(o.current),o.current=null},[]),u=(0,N.useCallback)(()=>{l(),s.current=!1},[]),d=(0,N.useCallback)(()=>{o.current&&(u(),s.current=!1,i(c.current))},[]);return(0,N.useEffect)(()=>{a.current&&(l(),!s.current&&n.leading?(s.current=!0,i(e),o.current=window.setTimeout(()=>{s.current=!1},t)):o.current=window.setTimeout(()=>{s.current=!1,i(e)},t))},[e,n.leading,t]),(0,N.useEffect)(()=>(a.current=!0,u),[]),[r,u,{cancel:u,flush:d}]}function mr({opened:e,shouldReturnFocus:t=!0}){let n=(0,N.useRef)(null),r=()=>{n.current&&`focus`in n.current&&typeof n.current.focus==`function`&&n.current?.focus({preventScroll:!0})};return Te(()=>{let i=-1,a=e=>{e.key===`Tab`&&window.clearTimeout(i)};if(document.addEventListener(`keydown`,a),e)n.current=document.activeElement;else if(t){let e=document.activeElement;i=window.setTimeout(()=>{let t=document.activeElement;(t===null||t===document.body||t===e)&&r()},10)}return()=>{window.clearTimeout(i),document.removeEventListener(`keydown`,a)}},[e,t]),r}var hr=/input|select|textarea|button|object/,gr=`a, input, select, textarea, button, object, [tabindex]`;function _r(e){return e.style.display===`none`}function vr(e){if(e.getAttribute(`aria-hidden`)||e.getAttribute(`hidden`)||e.getAttribute(`type`)===`hidden`)return!1;let t=e;for(;t&&t!==document.body&&t.nodeType!==11;){if(_r(t))return!1;t=t.parentNode}return!0}function yr(e){let t=e.getAttribute(`tabindex`);return t===null&&(t=void 0),parseInt(t,10)}function br(e){let t=e.nodeName.toLowerCase(),n=!Number.isNaN(yr(e));return(hr.test(t)&&!e.disabled||e instanceof HTMLAnchorElement&&e.href||n)&&vr(e)}function xr(e){let t=yr(e);return(Number.isNaN(t)||t>=0)&&br(e)}function Sr(e){return Array.from(e.querySelectorAll(gr)).filter(xr)}function Cr(e,t){let n=Sr(e);if(!n.length){t.preventDefault();return}let r=n[t.shiftKey?0:n.length-1],i=e.getRootNode(),a=r===i.activeElement||e===i.activeElement,o=i.activeElement;if(o.tagName===`INPUT`&&o.getAttribute(`type`)===`radio`&&(a=n.filter(e=>e.getAttribute(`type`)===`radio`&&e.getAttribute(`name`)===o.getAttribute(`name`)).includes(r)),!a)return;t.preventDefault();let s=n[t.shiftKey?n.length-1:0];s&&s.focus()}function wr(e=!0){let t=(0,N.useRef)(null),n=e=>{let t=e.querySelector(`[data-autofocus]`);if(!t){let n=Array.from(e.querySelectorAll(gr));t=n.find(xr)||n.find(br)||null,!t&&br(e)&&(t=e)}t?t.focus({preventScroll:!0}):console.warn(`[@mantine/hooks/use-focus-trap] Failed to find focusable element within provided node`,e)},r=(0,N.useCallback)(r=>{if(e){if(r===null){t.current=null;return}t.current!==r&&(setTimeout(()=>{r.getRootNode()?n(r):console.warn(`[@mantine/hooks/use-focus-trap] Ref node is not part of the dom`,r)}),t.current=r)}},[e]);return(0,N.useEffect)(()=>{if(!e)return;t.current&&setTimeout(()=>{t.current&&n(t.current)});let r=e=>{e.key===`Tab`&&t.current&&Cr(t.current,e)};return document.addEventListener(`keydown`,r),()=>document.removeEventListener(`keydown`,r)},[e]),r}function Tr(e,t,n){let r=(0,N.useEffectEvent)(t);(0,N.useEffect)(()=>(window.addEventListener(e,r,n),()=>window.removeEventListener(e,r,n)),[e])}function Er({value:e,defaultValue:t,finalValue:n,onChange:r=()=>{}}){let[i,a]=(0,N.useState)(t===void 0?n:t);return e===void 0?[i,(e,...t)=>{a(e),r?.(e,...t)},!1]:[e,r,!0]}function Dr(e=!1,t={}){let[n,r]=(0,N.useState)(e),i=(0,N.useCallback)(()=>{r(e=>e||(t.onOpen?.(),!0))},[t.onOpen]),a=(0,N.useCallback)(()=>{r(e=>e&&(t.onClose?.(),!1))},[t.onClose]);return[n,{open:i,close:a,toggle:(0,N.useCallback)(()=>{n?a():i()},[a,i,n]),set:r}]}var Or=[`mouse`,`touch`],kr=10;function Ar(e,t={}){let{threshold:n=400,events:r=Or,cancelOnMove:i=!1,onStart:a,onFinish:o,onCancel:s}=t,c=(0,N.useRef)(!1),l=(0,N.useRef)(!1),u=(0,N.useRef)(-1),d=(0,N.useRef)(null);(0,N.useEffect)(()=>()=>window.clearTimeout(u.current),[]);let f=r.join(`,`);return(0,N.useMemo)(()=>{if(typeof e!=`function`)return{};let t=i!==!1,f=i===!0?kr:i===!1?0:i,p=t=>{(Nr(t)||Mr(t))&&(a&&a(t),d.current=jr(t),l.current=!0,u.current=window.setTimeout(()=>{e(t),c.current=!0},n))},m=e=>{(Nr(e)||Mr(e))&&(c.current?o&&o(e):l.current&&s&&s(e),c.current=!1,l.current=!1,d.current=null,u.current!==-1&&(window.clearTimeout(u.current),u.current=-1))},h=e=>{if(!t||!l.current||c.current)return;let n=jr(e);if(!n||!d.current)return;let r=n.x-d.current.x,i=n.y-d.current.y;Math.sqrt(r*r+i*i)>f&&m(e)},g={};return r.includes(`mouse`)&&(g.onMouseDown=p,g.onMouseUp=m,g.onMouseLeave=m,t&&(g.onMouseMove=h)),r.includes(`touch`)&&(g.onTouchStart=p,g.onTouchEnd=m,g.onTouchCancel=m,t&&(g.onTouchMove=h)),g},[e,n,s,o,a,i,f])}function jr(e){if(Mr(e)){let t=e.touches[0]??e.changedTouches[0];return t?{x:t.clientX,y:t.clientY}:null}return{x:e.clientX,y:e.clientY}}function Mr(e){return window.TouchEvent?e.nativeEvent instanceof TouchEvent:`touches`in e.nativeEvent}function Nr(e){return e.nativeEvent instanceof MouseEvent}function Pr(e){return e===`auto`||e===`dark`||e===`light`}function Fr({key:e=`mantine-color-scheme-value`}={}){let t;return{get:t=>{if(typeof window>`u`)return t;try{let n=window.localStorage.getItem(e);return Pr(n)?n:t}catch{return t}},set:t=>{try{window.localStorage.setItem(e,t)}catch(e){console.warn(`[@mantine/core] Local storage color scheme manager was unable to save color scheme.`,e)}},subscribe:n=>{t=t=>{t.storageArea===window.localStorage&&t.key===e&&Pr(t.newValue)&&n(t.newValue)},window.addEventListener(`storage`,t)},unsubscribe:()=>{window.removeEventListener(`storage`,t)},clear:()=>{window.localStorage.removeItem(e)}}}function Ir({color:e,theme:t,autoContrast:n,colorScheme:r}){return(typeof n==`boolean`?n:t.autoContrast)&&Ce({color:e||t.primaryColor,theme:t,colorScheme:r}).isLight?`var(--mantine-color-black)`:`var(--mantine-color-white)`}function Lr(e,t,n){return Ir({color:n===`dark`?e.dark:e.light,theme:t,colorScheme:n,autoContrast:!0})}function Rr(e,t){let n=e.colors[e.primaryColor];return f(n)?e.autoContrast?Lr(n,e,t):`var(--mantine-color-white)`:Ir({color:n[h(e,t)],theme:e,autoContrast:null})}function zr(e){let t=document.createElement(`style`);return t.setAttribute(`data-mantine-styles`,`inline`),t.innerHTML=`*, *::before, *::after {transition: none !important;}`,t.setAttribute(`data-mantine-disable-transition`,`true`),e&&t.setAttribute(`nonce`,e),document.head.appendChild(t),()=>document.querySelectorAll(`[data-mantine-disable-transition]`).forEach(e=>e.remove())}function Br({keepTransitions:e}={}){let t=(0,N.useRef)(ir),n=(0,N.useRef)(-1),r=(0,N.use)(m),i=l(),a=(0,N.useRef)(i?.());if(!r)throw Error(`[@mantine/core] MantineProvider was not found in tree`);let o=i=>{r.setColorScheme(i),t.current=e?()=>{}:zr(a.current),window.clearTimeout(n.current),n.current=window.setTimeout(()=>{t.current?.()},10)},s=()=>{r.clearColorScheme(),t.current=e?()=>{}:zr(a.current),window.clearTimeout(n.current),n.current=window.setTimeout(()=>{t.current?.()},10)},c=fr(`light`,{getInitialValueInEffect:!1}),u=r.colorScheme===`auto`?c:r.colorScheme,d=(0,N.useCallback)(()=>o(u===`light`?`dark`:`light`),[o,u]);return(0,N.useEffect)(()=>()=>{t.current?.(),window.clearTimeout(n.current)},[]),{colorScheme:r.colorScheme,setColorScheme:o,clearColorScheme:s,toggleColorScheme:d}}function Vr(e,t){let n=typeof window<`u`&&`matchMedia`in window&&window.matchMedia(`(prefers-color-scheme: dark)`)?.matches,r=e===`auto`?n?`dark`:`light`:e;t()?.setAttribute(`data-mantine-color-scheme`,r)}function Hr({manager:e,defaultColorScheme:t,getRootElement:n,forceColorScheme:r}){let i=(0,N.useRef)(null),[a,o]=(0,N.useState)(()=>e.get(t)),s=r||a,c=(0,N.useCallback)(t=>{r||(Vr(t,n),o(t),e.set(t))},[e.set,s,r]),l=(0,N.useCallback)(()=>{o(t),Vr(t,n),e.clear()},[e.clear,t]);return(0,N.useEffect)(()=>(e.subscribe(c),e.unsubscribe),[e.subscribe,e.unsubscribe]),me(()=>{Vr(e.get(t),n)},[]),(0,N.useEffect)(()=>{if(r)return Vr(r,n),()=>{};r===void 0&&Vr(a,n),typeof window<`u`&&`matchMedia`in window&&(i.current=window.matchMedia(`(prefers-color-scheme: dark)`));let e=e=>{a===`auto`&&Vr(e.matches?`dark`:`light`,n)};return i.current?.addEventListener(`change`,e),()=>i.current?.removeEventListener(`change`,e)},[a,r]),{colorScheme:s,setColorScheme:c,clearColorScheme:l}}function Ur(e,t={getInitialValueInEffect:!0}){let n=fr(e,t),{colorScheme:r}=Br();return r===`auto`?n:r}function Wr(e){return Object.entries(e).map(([e,t])=>`${e}: ${t};`).join(``)}function Gr(e,t){let n=t?[t]:[`:root`,`:host`],r=Wr(e.variables),i=r?`${n.join(`, `)}{${r}}`:``,a=Wr(e.dark),o=Wr(e.light),s=e=>n.map(t=>t===`:host`?`${t}([data-mantine-color-scheme="${e}"])`:`${t}[data-mantine-color-scheme="${e}"]`).join(`, `);return`${i}\n\n${a?`${s(`dark`)}{${a}}`:``}\n\n${o?`${s(`light`)}{${o}}`:``}`}function Kr({theme:e,color:t,colorScheme:n,name:r=t,withColorValues:i=!0}){if(!e.colors[t])return{};if(n===`light`){let n=h(e,`light`),a={[`--mantine-color-${r}-text`]:`var(--mantine-color-${r}-filled)`,[`--mantine-color-${r}-filled`]:`var(--mantine-color-${r}-${n})`,[`--mantine-color-${r}-filled-hover`]:`var(--mantine-color-${r}-${n===9?8:n+1})`,[`--mantine-color-${r}-light`]:`var(--mantine-color-${r}-1)`,[`--mantine-color-${r}-light-hover`]:`var(--mantine-color-${r}-2)`,[`--mantine-color-${r}-light-color`]:`var(--mantine-color-${r}-9)`,[`--mantine-color-${r}-outline`]:`var(--mantine-color-${r}-${n})`,[`--mantine-color-${r}-outline-hover`]:p(e.colors[t][n],.05)};return i?{[`--mantine-color-${r}-0`]:e.colors[t][0],[`--mantine-color-${r}-1`]:e.colors[t][1],[`--mantine-color-${r}-2`]:e.colors[t][2],[`--mantine-color-${r}-3`]:e.colors[t][3],[`--mantine-color-${r}-4`]:e.colors[t][4],[`--mantine-color-${r}-5`]:e.colors[t][5],[`--mantine-color-${r}-6`]:e.colors[t][6],[`--mantine-color-${r}-7`]:e.colors[t][7],[`--mantine-color-${r}-8`]:e.colors[t][8],[`--mantine-color-${r}-9`]:e.colors[t][9],...a}:a}let a=h(e,`dark`),o={[`--mantine-color-${r}-text`]:`var(--mantine-color-${r}-4)`,[`--mantine-color-${r}-filled`]:`var(--mantine-color-${r}-${a})`,[`--mantine-color-${r}-filled-hover`]:`var(--mantine-color-${r}-${a===9?8:a+1})`,[`--mantine-color-${r}-light`]:E(e.colors[t][9],.5),[`--mantine-color-${r}-light-hover`]:E(e.colors[t][9],.3),[`--mantine-color-${r}-light-color`]:`var(--mantine-color-${r}-0)`,[`--mantine-color-${r}-outline`]:`var(--mantine-color-${r}-${Math.max(a-4,0)})`,[`--mantine-color-${r}-outline-hover`]:p(e.colors[t][Math.max(a-4,0)],.05)};return i?{[`--mantine-color-${r}-0`]:e.colors[t][0],[`--mantine-color-${r}-1`]:e.colors[t][1],[`--mantine-color-${r}-2`]:e.colors[t][2],[`--mantine-color-${r}-3`]:e.colors[t][3],[`--mantine-color-${r}-4`]:e.colors[t][4],[`--mantine-color-${r}-5`]:e.colors[t][5],[`--mantine-color-${r}-6`]:e.colors[t][6],[`--mantine-color-${r}-7`]:e.colors[t][7],[`--mantine-color-${r}-8`]:e.colors[t][8],[`--mantine-color-${r}-9`]:e.colors[t][9],...o}:o}function qr(e,t,n){ue(t).forEach(r=>Object.assign(e,{[`--mantine-${n}-${r}`]:t[r]}))}var Jr=e=>{let t=h(e,`light`),n=e.defaultRadius in e.radius?e.radius[e.defaultRadius]:M(e.defaultRadius),r={variables:{"--mantine-z-index-app":`100`,"--mantine-z-index-modal":`200`,"--mantine-z-index-popover":`300`,"--mantine-z-index-overlay":`400`,"--mantine-z-index-max":`9999`,"--mantine-scale":e.scale.toString(),"--mantine-cursor-type":e.cursorType,"--mantine-webkit-font-smoothing":e.fontSmoothing?`antialiased`:`unset`,"--mantine-moz-font-smoothing":e.fontSmoothing?`grayscale`:`unset`,"--mantine-color-white":e.white,"--mantine-color-black":e.black,"--mantine-line-height":e.lineHeights.md,"--mantine-font-family":e.fontFamily,"--mantine-font-family-monospace":e.fontFamilyMonospace,"--mantine-font-family-headings":e.headings.fontFamily,"--mantine-heading-font-weight":e.headings.fontWeight,"--mantine-heading-text-wrap":e.headings.textWrap,"--mantine-radius-default":n,"--mantine-primary-color-filled":`var(--mantine-color-${e.primaryColor}-filled)`,"--mantine-primary-color-filled-hover":`var(--mantine-color-${e.primaryColor}-filled-hover)`,"--mantine-primary-color-light":`var(--mantine-color-${e.primaryColor}-light)`,"--mantine-primary-color-light-hover":`var(--mantine-color-${e.primaryColor}-light-hover)`,"--mantine-primary-color-light-color":`var(--mantine-color-${e.primaryColor}-light-color)`},light:{"--mantine-color-scheme":`light`,"--mantine-primary-color-contrast":Rr(e,`light`),"--mantine-color-bright":`var(--mantine-color-black)`,"--mantine-color-text":e.black,"--mantine-color-body":e.white,"--mantine-color-error":`var(--mantine-color-red-6)`,"--mantine-color-success":`var(--mantine-color-teal-8)`,"--mantine-color-placeholder":`var(--mantine-color-gray-5)`,"--mantine-color-anchor":`var(--mantine-color-${e.primaryColor}-${t})`,"--mantine-color-default":`var(--mantine-color-white)`,"--mantine-color-default-hover":`var(--mantine-color-gray-0)`,"--mantine-color-default-color":`var(--mantine-color-black)`,"--mantine-color-default-border":`var(--mantine-color-gray-4)`,"--mantine-color-dimmed":`var(--mantine-color-gray-6)`,"--mantine-color-disabled":`var(--mantine-color-gray-2)`,"--mantine-color-disabled-color":`var(--mantine-color-gray-5)`,"--mantine-color-disabled-border":`var(--mantine-color-gray-3)`},dark:{"--mantine-color-scheme":`dark`,"--mantine-primary-color-contrast":Rr(e,`dark`),"--mantine-color-bright":`var(--mantine-color-white)`,"--mantine-color-text":`var(--mantine-color-dark-0)`,"--mantine-color-body":`var(--mantine-color-dark-7)`,"--mantine-color-error":`var(--mantine-color-red-8)`,"--mantine-color-success":`var(--mantine-color-teal-8)`,"--mantine-color-placeholder":`var(--mantine-color-dark-3)`,"--mantine-color-anchor":`var(--mantine-color-${e.primaryColor}-4)`,"--mantine-color-default":`var(--mantine-color-dark-6)`,"--mantine-color-default-hover":`var(--mantine-color-dark-5)`,"--mantine-color-default-color":`var(--mantine-color-white)`,"--mantine-color-default-border":`var(--mantine-color-dark-4)`,"--mantine-color-dimmed":`var(--mantine-color-dark-2)`,"--mantine-color-disabled":`var(--mantine-color-dark-6)`,"--mantine-color-disabled-color":`var(--mantine-color-dark-3)`,"--mantine-color-disabled-border":`var(--mantine-color-dark-4)`}};qr(r.variables,e.breakpoints,`breakpoint`),qr(r.variables,e.spacing,`spacing`),qr(r.variables,e.fontSizes,`font-size`),qr(r.variables,e.lineHeights,`line-height`),qr(r.variables,e.shadows,`shadow`),qr(r.variables,e.radius,`radius`),qr(r.variables,e.fontWeights,`font-weight`),e.colors[e.primaryColor].forEach((t,n)=>{r.variables[`--mantine-primary-color-${n}`]=`var(--mantine-color-${e.primaryColor}-${n})`}),ue(e.colors).forEach(t=>{let n=e.colors[t];if(f(n)){Object.assign(r.light,Kr({theme:e,name:n.name,color:n.light,colorScheme:`light`,withColorValues:!0})),Object.assign(r.dark,Kr({theme:e,name:n.name,color:n.dark,colorScheme:`dark`,withColorValues:!0})),r.light[`--mantine-color-${n.name}-contrast`]=Lr(n,e,`light`),r.dark[`--mantine-color-${n.name}-contrast`]=Lr(n,e,`dark`);return}n.forEach((e,n)=>{r.variables[`--mantine-color-${t}-${n}`]=e}),Object.assign(r.light,Kr({theme:e,color:t,colorScheme:`light`,withColorValues:!1})),Object.assign(r.dark,Kr({theme:e,color:t,colorScheme:`dark`,withColorValues:!1}))});let i=e.headings.sizes;return ue(i).forEach(t=>{r.variables[`--mantine-${t}-font-size`]=i[t].fontSize,r.variables[`--mantine-${t}-line-height`]=i[t].lineHeight,r.variables[`--mantine-${t}-font-weight`]=i[t].fontWeight||e.headings.fontWeight}),r};function Yr(){let e=b(),t=l(),n=ue(e.breakpoints).reduce((t,n)=>{let r=e.breakpoints[n].includes(`px`),i=Qn(e.breakpoints[n]);return`${t}@media (max-width: ${r?`${i-.1}px`:Se(i-.1)}) {.mantine-visible-from-${n} {display: none !important;}}@media (min-width: ${r?`${i}px`:Se(i)}) {.mantine-hidden-from-${n} {display: none !important;}}`},``);return(0,P.jsx)(`style`,{"data-mantine-styles":`classes`,nonce:t?.(),dangerouslySetInnerHTML:{__html:n}})}function Xr({theme:e,generator:t}){let n=Jr(e),r=t?.(e);return r?fe(n,r):n}var Zr=Jr(d);function Qr(e){let t={variables:{},light:{},dark:{}};return ue(e.variables).forEach(n=>{Zr.variables[n]!==e.variables[n]&&(t.variables[n]=e.variables[n])}),ue(e.light).forEach(n=>{Zr.light[n]!==e.light[n]&&(t.light[n]=e.light[n])}),ue(e.dark).forEach(n=>{Zr.dark[n]!==e.dark[n]&&(t.dark[n]=e.dark[n])}),t}function $r(e){return Gr({variables:{},dark:{"--mantine-color-scheme":`dark`},light:{"--mantine-color-scheme":`light`}},e)}function ei({cssVariablesSelector:e,deduplicateCssVariables:t}){let n=b(),r=l(),i=Xr({theme:n,generator:S()}),a=(e===void 0||e===`:root`||e===`:host`)&&t,o=Gr(a?Qr(i):i,e);return o?(0,P.jsx)(`style`,{"data-mantine-styles":!0,nonce:r?.(),dangerouslySetInnerHTML:{__html:`${o}${a?``:$r(e)}`}}):null}ei.displayName=`@mantine/CssVariables`;function ti({respectReducedMotion:e,getRootElement:t}){me(()=>{e&&t()?.setAttribute(`data-respect-reduced-motion`,`true`)},[e])}function ni({theme:e,children:t,getStyleNonce:n,withStaticClasses:r=!0,withGlobalClasses:i=!0,deduplicateCssVariables:a=!0,withCssVariables:o=!0,cssVariablesSelector:s,classNamesPrefix:c=`mantine`,colorSchemeManager:l=Fr(),defaultColorScheme:u=`light`,getRootElement:d=()=>document.documentElement,cssVariablesResolver:f,forceColorScheme:p,stylesTransform:h,env:g,deduplicateInlineStyles:_=!1}){let{colorScheme:v,setColorScheme:b,clearColorScheme:x}=Hr({defaultColorScheme:u,forceColorScheme:p,manager:l,getRootElement:d});return ti({respectReducedMotion:e?.respectReducedMotion||!1,getRootElement:d}),(0,P.jsx)(m,{value:{colorScheme:v,setColorScheme:b,clearColorScheme:x,getRootElement:d,classNamesPrefix:c,getStyleNonce:n,cssVariablesResolver:f,cssVariablesSelector:s??`:root`,withStaticClasses:r,stylesTransform:h,env:g,deduplicateInlineStyles:_},children:(0,P.jsxs)(y,{theme:e,children:[o&&(0,P.jsx)(ei,{cssVariablesSelector:s,deduplicateCssVariables:a}),i&&(0,P.jsx)(Yr,{}),t]})})}ni.displayName=`@mantine/core/MantineProvider`;function ri(e){return e}var ii={root:`m_515a97f8`},ai=w(e=>{let t=v(`VisuallyHidden`,null,e),{classNames:n,className:r,style:i,styles:a,unstyled:o,vars:s,attributes:l,...d}=t,f=c({name:`VisuallyHidden`,classes:ii,props:t,className:r,style:i,classNames:n,styles:a,unstyled:o,attributes:l});return(0,P.jsx)(u,{component:`span`,...f(`root`),...d})});ai.classes=ii,ai.displayName=`@mantine/core/VisuallyHidden`;function oi({open:e,close:t,openDelay:n,closeDelay:r}){let i=(0,N.useRef)(-1),a=(0,N.useRef)(-1),o=()=>{window.clearTimeout(i.current),window.clearTimeout(a.current)};return(0,N.useEffect)(()=>o,[]),{openDropdown:()=>{o(),n===0||n===void 0?e():i.current=window.setTimeout(e,n)},closeDropdown:()=>{o(),r===0||r===void 0?t():a.current=window.setTimeout(t,r)}}}var si={root:`m_9814e45f`},ci={zIndex:ft(`modal`)},li=D((e,{gradient:t,color:n,backgroundOpacity:r,blur:i,radius:a,zIndex:o})=>({root:{"--overlay-bg":t||(n!==void 0||r!==void 0)&&T(n||`#000`,r??.6)||void 0,"--overlay-filter":i?`blur(${M(i)})`:void 0,"--overlay-radius":a===void 0?void 0:Ee(a),"--overlay-z-index":o?.toString()}})),ui=Me(e=>{let t=v(`Overlay`,ci,e),{classNames:n,className:r,style:i,styles:a,unstyled:o,vars:s,fixed:l,center:d,children:f,radius:p,zIndex:m,gradient:h,blur:g,color:_,backgroundOpacity:y,mod:b,attributes:x,...S}=t,C=c({name:`Overlay`,props:t,classes:si,className:r,style:i,classNames:n,styles:a,unstyled:o,attributes:x,vars:s,varsResolver:li});return(0,P.jsx)(u,{...C(`root`),mod:[{center:d,fixed:l},b],...S,children:f})});ui.classes=si,ui.varsResolver=li,ui.displayName=`@mantine/core/Overlay`;var[di,fi]=dt(`Popover component was not found in the tree`);function pi({childProps:e,disabled:t,opened:n,longPressDelay:r=500,setReference:i,open:a}){let o=(0,N.useRef)(!1),s=(0,N.useRef)(!1),c=(0,N.useRef)(null),l=(0,N.useRef)(t);l.current=t;let u=(e,t,n)=>{i({getBoundingClientRect:()=>({x:e,y:t,width:0,height:0,top:t,left:e,right:e,bottom:t,toJSON:()=>void 0}),contextElement:n}),a()},d=or(e.onMouseDown,e=>{t||e.button===2&&e.stopPropagation()}),f=or(e.onContextMenu,e=>{t||e.defaultPrevented||(e.preventDefault(),!s.current&&(u(e.clientX,e.clientY,e.currentTarget),o.current&&(s.current=!0)))}),p=Ar(e=>{if(l.current||s.current)return;let t=e,n=t.touches[0]??t.changedTouches[0];n&&(u(n.clientX,n.clientY,c.current),s.current=!0)},{threshold:r,events:[`touch`],cancelOnMove:!0,onStart:e=>{o.current=!0,s.current=!1,c.current=e.currentTarget},onFinish:e=>{o.current=!1,s.current=!1,l.current||e.preventDefault()},onCancel:()=>{o.current=!1,s.current=!1}});return{onContextMenu:f,onMouseDown:d,onTouchStart:or(e.onTouchStart,p.onTouchStart),onTouchEnd:or(e.onTouchEnd,p.onTouchEnd),onTouchCancel:or(e.onTouchCancel,p.onTouchCancel),onTouchMove:or(e.onTouchMove,p.onTouchMove),style:t?e.style:{...e.style,WebkitTouchCallout:`none`,WebkitUserSelect:`none`,userSelect:`none`},"data-expanded":n?!0:void 0}}function mi(e){let{children:t,disabled:n,longPressDelay:r}=v(`PopoverContextMenu`,null,e),i=te(t);if(!i)throw Error(`Popover.ContextMenu component children should be an element or a component that accepts ref. Fragments, strings, numbers and other primitive values are not supported`);let a=fi(),o=pi({childProps:i.props,disabled:n||a.disabled,opened:a.opened,longPressDelay:r,setReference:a.reference,open:()=>{a.opened||a.onToggle()}});return(0,N.cloneElement)(i,o)}mi.displayName=`@mantine/core/PopoverContextMenu`;function hi({children:e,active:t=!0,refProp:n=`ref`,innerRef:r}){let i=wr(t),a=Oe(i,r),o=te(e);return o?(0,N.cloneElement)(o,{[n]:a}):e}function gi(e){return(0,P.jsx)(ai,{tabIndex:-1,"data-autofocus":!0,...e})}hi.displayName=`@mantine/core/FocusTrap`,gi.displayName=`@mantine/core/FocusTrapInitialFocus`,hi.InitialFocus=gi;var _i={dropdown:`m_38a85659`,arrow:`m_a31dc6c1`,overlay:`m_3d7bc908`},vi=w(e=>{let t=v(`PopoverDropdown`,null,e),{className:n,style:r,vars:i,children:a,onKeyDownCapture:o,variant:s,classNames:c,styles:l,ref:d,...f}=t,p=fi(),{dir:m}=jt(),h=p.arrowPosition===`merge`&&p.withArrow?mt({position:p.placement,dir:m}):void 0,g=mr({opened:p.opened,shouldReturnFocus:p.returnFocus}),_=p.withRoles?{"aria-labelledby":p.getTargetId(),id:p.getDropdownId(),role:`dialog`,tabIndex:-1}:{},y=Oe(d,p.floating);return p.disabled?null:(0,P.jsx)(Ct,{...p.portalProps,withinPortal:p.withinPortal,children:(0,P.jsx)(ae,{mounted:p.opened,...p.transitionProps,transition:p.transitionProps?.transition||`fade`,duration:p.transitionProps?.duration??150,keepMounted:p.keepMounted,keepMountedMode:p.keepMountedMode,exitDuration:typeof p.transitionProps?.exitDuration==`number`?p.transitionProps.exitDuration:p.transitionProps?.duration,children:e=>(0,P.jsx)(hi,{active:p.trapFocus&&p.opened,innerRef:y,children:(0,P.jsxs)(u,{..._,...f,variant:s,onKeyDownCapture:ar(()=>{p.onClose?.(),p.onDismiss?.()},{active:p.closeOnEscape,onTrigger:g,onKeyDown:o}),"data-position":p.placement,"data-fixed":p.floatingStrategy===`fixed`||void 0,...p.getStyles(`dropdown`,{className:n,props:t,classNames:c,styles:l,style:[{...e,...h,zIndex:p.zIndex,top:p.y??0,left:p.x??0,width:p.width===`target`?void 0:M(p.width),...p.referenceHidden?{display:`none`}:null},p.resolvedStyles?.dropdown,l?.dropdown,r]}),children:[a,(0,P.jsx)(bt,{ref:p.arrowRef,arrowX:p.arrowX,arrowY:p.arrowY,visible:p.withArrow,position:p.placement,arrowSize:p.arrowSize,arrowRadius:p.arrowRadius,arrowOffset:p.arrowOffset,arrowPosition:p.arrowPosition,...p.getStyles(`arrow`,{props:t,classNames:c,styles:l})})]})})})})});vi.classes=_i,vi.displayName=`@mantine/core/PopoverDropdown`;var yi={refProp:`ref`,popupType:`dialog`},bi=w(e=>{let{children:t,refProp:n,popupType:r,ref:i,...a}=v(`PopoverTarget`,yi,e),o=te(t);if(!o)throw Error(`Popover.Target component children should be an element or a component that accepts ref. Fragments, strings, numbers and other primitive values are not supported`);let s=a,c=fi(),l=Oe(c.reference,ut(o),i),u=c.withRoles?{"aria-haspopup":r,"aria-expanded":c.opened,"aria-controls":c.opened?c.getDropdownId():void 0,id:c.getTargetId()}:{},d=o.props;return(0,N.cloneElement)(o,{...s,...u,...c.targetProps,className:O(c.targetProps.className,s.className,d.className),[n]:l,...c.controlled?null:{onClick:e=>{c.onToggle(),d.onClick?.(e)}}})});bi.displayName=`@mantine/core/PopoverTarget`;function xi(e){if(e===void 0)return{shift:!0,flip:!0};let t={...e};return e.shift===void 0&&(t.shift=!0),e.flip===void 0&&(t.flip=!0),t}function Si(e,t,n,r){let i=xi(e.middlewares),a=[vt(e.offset),Tt()];if(i.flip&&!n){let e=typeof i.flip==`boolean`?{}:i.flip,t=r?{fallbackStrategy:`initialPlacement`,...e}:e;a.push(_t(t))}if(i.shift){let t=typeof i.shift==`boolean`?{}:i.shift;a.push(pt(n=>{let r=n.placement.startsWith(`top`)||n.placement.startsWith(`bottom`);return{limiter:yt(),padding:5,...e.width===`target`&&r?{mainAxis:!1}:null,...t}}))}return i.inline&&a.push(typeof i.inline==`boolean`?St():St(i.inline)),a.push(gt({element:e.arrowRef,padding:e.arrowOffset})),(i.size||e.width===`target`)&&a.push(At({...typeof i.size==`boolean`?{}:i.size,apply({rects:n,availableWidth:r,availableHeight:a,...o}){let s=t().refs.floating.current?.style??{};i.size&&(typeof i.size==`object`&&i.size.apply?i.size.apply({rects:n,availableWidth:r,availableHeight:a,...o}):Object.assign(s,{maxWidth:`${r}px`,maxHeight:`${a}px`})),e.width===`target`&&Object.assign(s,{width:`${n.reference.width}px`})}})),a}function Ci(e){let[t,n]=Er({value:e.opened,defaultValue:e.defaultOpened,finalValue:!1,onChange:e.onChange}),r=(0,N.useRef)(t),i=(0,N.useRef)(!1),[a,o]=(0,N.useState)(null),s=e.preventPositionChangeWhenVisible!==!1,c=(0,N.useRef)(t);t!==c.current&&(c.current=t,t&&a!==null&&o(null));let l=(0,N.useRef)(e.position);e.position!==l.current&&(l.current=e.position,i.current=!1,a!==null&&o(null));let u=(0,N.useCallback)(()=>o(null),[]),d=()=>{t&&!e.disabled&&n(!1)},f=()=>{e.disabled||n(!t)},p=ht({open:t,strategy:e.strategy,placement:s?a??e.position:e.position,middleware:Si(e,()=>p,s&&a!==null,s),whileElementsMounted:e.keepMounted?void 0:Mt});(0,N.useEffect)(()=>{if(!e.keepMounted)return;let n=p.refs.reference.current,r=p.refs.floating.current;if(t&&n&&r)return Mt(n,r,p.update)},[e.keepMounted,t,p.update,p.elements.reference,p.elements.floating]),me(()=>{if(!t){i.current=!1;return}if(!s||a!==null)return;let e=p.refs.floating.current;if(e&&e.offsetHeight!==0&&e.offsetWidth!==0){if(!i.current){i.current=!0,p.update();return}p.isPositioned&&o(p.placement)}},[s,t,p.isPositioned,p.placement,a,p.update]);let m=(0,N.useRef)(p.placement);return me(()=>{m.current!==p.placement&&(m.current=p.placement,e.onPositionChange?.(p.placement))},[p.placement]),Te(()=>{t!==r.current&&(t?e.onOpen?.():e.onClose?.()),r.current=t},[t,e.onClose,e.onOpen]),{floating:p,controlled:typeof e.opened==`boolean`,opened:t,onClose:d,onToggle:f,resetLockedPlacement:u}}var wi={position:`bottom`,offset:8,transitionProps:{transition:`fade`,duration:150},middlewares:{flip:!0,shift:!0,inline:!1},arrowSize:7,arrowOffset:5,arrowRadius:0,arrowPosition:`side`,closeOnClickOutside:!0,withinPortal:!0,closeOnEscape:!0,trapFocus:!1,withRoles:!0,returnFocus:!1,withOverlay:!1,hideDetached:!0,preventPositionChangeWhenVisible:!0,clickOutsideEvents:[`mousedown`,`touchstart`],clickOutsideCapture:!1,zIndex:ft(`popover`),__staticSelector:`Popover`,width:`max-content`},Ti=D((e,{radius:t,shadow:n})=>({dropdown:{"--popover-radius":t===void 0?void 0:Ee(t),"--popover-shadow":oe(n)}}));function Ei(e){let t=v(`Popover`,wi,e),{children:n,position:r,offset:i,onPositionChange:a,opened:o,transitionProps:s,onExitTransitionEnd:l,onEnterTransitionEnd:u,width:d,middlewares:f,withArrow:p,arrowSize:m,arrowOffset:h,arrowRadius:g,arrowPosition:_,unstyled:y,classNames:b,styles:x,closeOnClickOutside:S,withinPortal:C,portalProps:w,closeOnEscape:T,clickOutsideEvents:ee,clickOutsideCapture:E,trapFocus:D,onClose:O,onDismiss:te,onOpen:ne,onChange:re,zIndex:k,radius:ie,shadow:A,id:oe,defaultOpened:se,__staticSelector:ce,withRoles:le,disabled:ue,returnFocus:de,variant:fe,keepMounted:pe,keepMountedMode:me,vars:ge,floatingStrategy:_e,withOverlay:ve,overlayProps:j,hideDetached:M,attributes:be,preventPositionChangeWhenVisible:xe,...Se}=t,Ce=c({name:ce,props:t,classes:_i,classNames:b,styles:x,unstyled:y,attributes:be,rootSelector:`dropdown`,vars:ge,varsResolver:Ti}),{resolvedStyles:we}=he({classNames:b,styles:x,props:t}),Te=(0,N.useRef)(null),[Ee,De]=(0,N.useState)(null),[Oe,ke]=(0,N.useState)(null),{dir:Ae}=jt(),je=Fe(),Me=ye(oe),Ne=Ci({middlewares:f,width:d,position:Et(Ae,r),offset:typeof i==`number`?i+(p?m/2:0):i,arrowRef:Te,arrowOffset:h,onPositionChange:a,opened:o,defaultOpened:se,onChange:re,onOpen:ne,onClose:O,onDismiss:te,strategy:_e,disabled:ue,preventPositionChangeWhenVisible:xe,keepMounted:pe});dr(()=>{S&&(Ne.onClose(),te?.())},ee,[Ee,Oe],!0,E);let Pe=(0,N.useCallback)(e=>{De(e),Ne.floating.refs.setReference(e)},[Ne.floating.refs.setReference]),Ie=(0,N.useCallback)(e=>{ke(e),Ne.floating.refs.setFloating(e)},[Ne.floating.refs.setFloating]),Le=(0,N.useCallback)(()=>{s?.onExited?.(),l?.(),Ne.resetLockedPlacement()},[s?.onExited,l,Ne.resetLockedPlacement]),Re=(0,N.useCallback)(()=>{s?.onEntered?.(),u?.()},[s?.onEntered,u]);return(0,P.jsxs)(di,{value:{returnFocus:de,disabled:ue,controlled:Ne.controlled,reference:Pe,floating:Ie,x:Ne.floating.x,y:Ne.floating.y,arrowX:Ne.floating?.middlewareData?.arrow?.x,arrowY:Ne.floating?.middlewareData?.arrow?.y,opened:Ne.opened,arrowRef:Te,transitionProps:{...s,onExited:Le,onEntered:Re},width:d,withArrow:p,arrowSize:m,arrowOffset:h,arrowRadius:g,arrowPosition:_,placement:Ne.floating.placement,trapFocus:D,withinPortal:C,portalProps:w,zIndex:k,radius:ie,shadow:A,closeOnEscape:T,onDismiss:te,onClose:Ne.onClose,onToggle:Ne.onToggle,getTargetId:()=>Me,getDropdownId:()=>`${Me}-dropdown`,withRoles:le,targetProps:Se,__staticSelector:ce,classNames:b,styles:x,unstyled:y,variant:fe,keepMounted:pe,keepMountedMode:me,getStyles:Ce,resolvedStyles:we,floatingStrategy:_e,referenceHidden:M&&je!==`test`?Ne.floating.middlewareData.hide?.referenceHidden:!1},children:[n,ve&&(0,P.jsx)(ae,{transition:`fade`,mounted:Ne.opened,duration:s?.duration||250,exitDuration:s?.exitDuration||250,children:e=>(0,P.jsx)(Ct,{withinPortal:C,children:(0,P.jsx)(ui,{...j,...Ce(`overlay`,{className:j?.className,style:[e,j?.style]})})})})]})}Ei.Target=bi,Ei.Dropdown=vi,Ei.ContextMenu=mi,Ei.varsResolver=Ti,Ei.displayName=`@mantine/core/Popover`,Ei.extend=e=>e,Ei.withProps=e=>{let t=t=>(0,P.jsx)(Ei,{...e,...t});return t.extend=Ei.extend,t.displayName=`WithProps(${Ei.displayName})`,t};var[Di,Oi]=dt(`ModalBase component was not found in tree`);function ki({opened:e,transitionDuration:t}){let[n,r]=(0,N.useState)(e),i=(0,N.useRef)(-1),a=x()?0:t;return(0,N.useEffect)(()=>(e?(r(!0),window.clearTimeout(i.current)):a===0?r(!1):i.current=window.setTimeout(()=>r(!1),a),()=>window.clearTimeout(i.current)),[e,a]),n}function Ai({id:e,transitionProps:t,opened:n,trapFocus:r,closeOnEscape:i,onClose:a,returnFocus:o,handledEscapeEvents:s}){let c=ye(e),[l,u]=(0,N.useState)(!1),[d,f]=(0,N.useState)(!1),p=ki({opened:n,transitionDuration:typeof t?.duration==`number`?t?.duration:200});return Tr(`keydown`,e=>{e.key===`Escape`&&i&&!e.isComposing&&n&&!s?.has(e)&&e.target?.getAttribute(`data-mantine-stop-propagation`)!==`true`&&(s?.add(e),a())},{capture:!0}),mr({opened:n,shouldReturnFocus:r&&o}),{_id:c,titleMounted:l,bodyMounted:d,shouldLockScroll:p,setTitleMounted:u,setBodyMounted:f}}var ji=function(){return ji=Object.assign||function(e){for(var t,n=1,r=arguments.length;n`u`)return oa;var t=ca(e),n=document.documentElement.clientWidth,r=window.innerWidth;return{left:t[0],top:t[1],right:t[2],gap:Math.max(0,r-n+t[2]-t[0])}},F=aa(),ua=`data-scroll-locked`,da=function(e,t,n,r){var i=e.left,a=e.top,o=e.right,s=e.gap;return n===void 0&&(n=`margin`),` + .${Ii} { + overflow: hidden ${r}; + padding-right: ${s}px ${r}; + } + body[${ua}] { + overflow: hidden ${r}; + overscroll-behavior: contain; + ${[t&&`position: relative ${r};`,n===`margin`&&` + padding-left: ${i}px; + padding-top: ${a}px; + padding-right: ${o}px; + margin-left:0; + margin-top:0; + margin-right: ${s}px ${r}; + `,n===`padding`&&`padding-right: ${s}px ${r};`].filter(Boolean).join(``)} + } + + .${Pi} { + right: ${s}px ${r}; + } + + .${Fi} { + margin-right: ${s}px ${r}; + } + + .${Pi} .${Pi} { + right: 0 ${r}; + } + + .${Fi} .${Fi} { + margin-right: 0 ${r}; + } + + body[${ua}] { + ${Li}: ${s}px; + } +`},fa=function(){var e=parseInt(document.body.getAttribute(`data-scroll-locked`)||`0`,10);return isFinite(e)?e:0},pa=function(){N.useEffect(function(){return document.body.setAttribute(ua,(fa()+1).toString()),function(){var e=fa()-1;e<=0?document.body.removeAttribute(ua):document.body.setAttribute(ua,e.toString())}},[])},ma=function(e){var t=e.noRelative,n=e.noImportant,r=e.gapMode,i=r===void 0?`margin`:r;pa();var a=N.useMemo(function(){return la(i)},[i]);return N.createElement(F,{styles:da(a,!t,i,n?``:`!important`)})},ha=!1;if(typeof window<`u`)try{var ga=Object.defineProperty({},"passive",{get:function(){return ha=!0,!0}});window.addEventListener(`test`,ga,ga),window.removeEventListener(`test`,ga,ga)}catch{ha=!1}var _a=ha?{passive:!1}:!1,va=function(e){return e.tagName===`TEXTAREA`},ya=function(e,t){if(!(e instanceof Element))return!1;var n=window.getComputedStyle(e);return n[t]!==`hidden`&&!(n.overflowY===n.overflowX&&!va(e)&&n[t]===`visible`)},ba=function(e){return ya(e,`overflowY`)},xa=function(e){return ya(e,`overflowX`)},Sa=function(e,t){var n=t.ownerDocument,r=t;do{if(typeof ShadowRoot<`u`&&r instanceof ShadowRoot&&(r=r.host),Ta(e,r)){var i=Ea(e,r);if(i[1]>i[2])return!0}r=r.parentNode}while(r&&r!==n.body);return!1},Ca=function(e){return[e.scrollTop,e.scrollHeight,e.clientHeight]},wa=function(e){return[e.scrollLeft,e.scrollWidth,e.clientWidth]},Ta=function(e,t){return e===`v`?ba(t):xa(t)},Ea=function(e,t){return e===`v`?Ca(t):wa(t)},Da=function(e,t){return e===`h`&&t===`rtl`?-1:1},Oa=function(e,t,n,r,i){var a=Da(e,window.getComputedStyle(t).direction),o=a*r,s=n.target,c=t.contains(s),l=!1,u=o>0,d=0,f=0;do{if(!s)break;var p=Ea(e,s),m=p[0],h=p[1]-p[2]-a*m;(m||h)&&Ta(e,s)&&(d+=h,f+=m);var g=s.parentNode;s=g&&g.nodeType===Node.DOCUMENT_FRAGMENT_NODE?g.host:g}while(!c&&s!==document.body||c&&(t.contains(s)||t===s));return(u&&(i&&Math.abs(d)<1||!i&&o>d)||!u&&(i&&Math.abs(f)<1||!i&&-o>f))&&(l=!0),l},ka=function(e){return`changedTouches`in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},Aa=function(e){return[e.deltaX,e.deltaY]},ja=function(e){return e&&`current`in e?e.current:e},Ma=function(e,t){return e[0]===t[0]&&e[1]===t[1]},Na=function(e){return` + .block-interactivity-${e} {pointer-events: none;} + .allow-interactivity-${e} {pointer-events: all;} +`},Pa=0,Fa=[];function Ia(e){var t=N.useRef([]),n=N.useRef([0,0]),r=N.useRef(),i=N.useState(Pa++)[0],a=N.useState(aa)[0],o=N.useRef(e);N.useEffect(function(){o.current=e},[e]),N.useEffect(function(){if(e.inert){document.body.classList.add(`block-interactivity-${i}`);var t=Ni([e.lockRef.current],(e.shards||[]).map(ja),!0).filter(Boolean);return t.forEach(function(e){return e.classList.add(`allow-interactivity-${i}`)}),function(){document.body.classList.remove(`block-interactivity-${i}`),t.forEach(function(e){return e.classList.remove(`allow-interactivity-${i}`)})}}},[e.inert,e.lockRef.current,e.shards]);var s=N.useCallback(function(e,t){if(`touches`in e&&e.touches.length===2||e.type===`wheel`&&e.ctrlKey)return!o.current.allowPinchZoom;var i=ka(e),a=n.current,s=`deltaX`in e?e.deltaX:a[0]-i[0],c=`deltaY`in e?e.deltaY:a[1]-i[1],l,u=e.target,d=Math.abs(s)>Math.abs(c)?`h`:`v`;if(`touches`in e&&d===`h`&&u.type===`range`)return!1;var f=window.getSelection(),p=f&&f.anchorNode;if(p&&(p===u||p.contains(u)))return!1;var m=Sa(d,u);if(!m)return!0;if(m?l=d:(l=d===`v`?`h`:`v`,m=Sa(d,u)),!m)return!1;if(!r.current&&`changedTouches`in e&&(s||c)&&(r.current=l),!l)return!0;var h=r.current||l;return Oa(h,t,e,h===`h`?s:c,!0)},[]),c=N.useCallback(function(e){var n=e;if(Fa.length&&Fa[Fa.length-1]===a){var r=`deltaY`in n?Aa(n):ka(n),i=t.current.filter(function(e){return e.name===n.type&&(e.target===n.target||n.target===e.shadowParent)&&Ma(e.delta,r)})[0];if(i&&i.should){n.cancelable&&n.preventDefault();return}if(!i){var c=(o.current.shards||[]).map(ja).filter(Boolean).filter(function(e){return e.contains(n.target)});(c.length>0?s(n,c[0]):!o.current.noIsolation)&&n.cancelable&&n.preventDefault()}}},[]),l=N.useCallback(function(e,n,r,i){var a={name:e,delta:n,target:r,should:i,shadowParent:La(r)};t.current.push(a),setTimeout(function(){t.current=t.current.filter(function(e){return e!==a})},1)},[]),u=N.useCallback(function(e){n.current=ka(e),r.current=void 0},[]),d=N.useCallback(function(t){l(t.type,Aa(t),t.target,s(t,e.lockRef.current))},[]),f=N.useCallback(function(t){l(t.type,ka(t),t.target,s(t,e.lockRef.current))},[]);N.useEffect(function(){return Fa.push(a),e.setCallbacks({onScrollCapture:d,onWheelCapture:d,onTouchMoveCapture:f}),document.addEventListener(`wheel`,c,_a),document.addEventListener(`touchmove`,c,_a),document.addEventListener(`touchstart`,u,_a),function(){Fa=Fa.filter(function(e){return e!==a}),document.removeEventListener(`wheel`,c,_a),document.removeEventListener(`touchmove`,c,_a),document.removeEventListener(`touchstart`,u,_a)}},[]);var p=e.removeScrollBar,m=e.inert;return N.createElement(N.Fragment,null,m?N.createElement(a,{styles:Na(i)}):null,p?N.createElement(ma,{noRelative:e.noRelative,gapMode:e.gapMode}):null)}function La(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}var Ra=Yi(Xi,Ia),za=N.forwardRef(function(e,t){return N.createElement(Qi,ji({},e,{ref:t,sideCar:Ra}))});za.classNames=Qi.classNames;function Ba({keepMounted:e,keepMountedMode:t=`activity`,opened:n,onClose:r,id:i,transitionProps:a,onExitTransitionEnd:o,onEnterTransitionEnd:s,trapFocus:c,closeOnEscape:l,returnFocus:d,closeOnClickOutside:f,withinPortal:p,portalProps:m,lockScroll:h,children:g,zIndex:_,shadow:v,padding:y,__vars:b,unstyled:x,removeScrollProps:S,__handledEscapeEvents:C,...w}){let{_id:T,titleMounted:ee,bodyMounted:E,shouldLockScroll:D,setTitleMounted:O,setBodyMounted:te}=Ai({id:i,transitionProps:a,opened:n,trapFocus:c,closeOnEscape:l,onClose:r,returnFocus:d,handledEscapeEvents:C}),{key:ne,...re}=S||{};return(0,P.jsx)(Ct,{...m,withinPortal:p,children:(0,P.jsx)(Di,{value:{opened:n,onClose:r,closeOnClickOutside:f,onExitTransitionEnd:o,onEnterTransitionEnd:s,transitionProps:{...a,keepMounted:e,keepMountedMode:t},getTitleId:()=>`${T}-title`,getBodyId:()=>`${T}-body`,titleMounted:ee,bodyMounted:E,setTitleMounted:O,setBodyMounted:te,trapFocus:c,closeOnEscape:l,zIndex:_,unstyled:x},children:(0,P.jsx)(za,{enabled:D&&h,...re,children:(0,P.jsx)(u,{...w,id:T,__vars:{...b,"--mb-z-index":(_||ft(`modal`)).toString(),"--mb-shadow":oe(v),"--mb-padding":Ae(y)},children:g})},ne)})})}Ba.displayName=`@mantine/core/ModalBase`;function Va(){let e=Oi();return(0,N.useEffect)(()=>(e.setBodyMounted(!0),()=>e.setBodyMounted(!1)),[]),e.getBodyId()}var Ha={title:`m_615af6c9`,header:`m_b5489c3c`,inner:`m_60c222c7`,content:`m_fd1ab0aa`,close:`m_606cb269`,body:`m_5df29311`};function Ua({className:e,...t}){let n=Va(),r=Oi();return(0,P.jsx)(u,{id:n,className:O({[Ha.body]:!r.unstyled},e),...t})}Ua.displayName=`@mantine/core/ModalBaseBody`;function Wa({className:e,onClick:t,...n}){let r=Oi();return(0,P.jsx)(je,{...n,onClick:e=>{r.onClose(),t?.(e)},className:O({[Ha.close]:!r.unstyled},e),unstyled:r.unstyled})}Wa.displayName=`@mantine/core/ModalBaseCloseButton`;function Ga({transitionProps:e,className:t,innerProps:n,onKeyDown:r,style:i,ref:a,...o}){let s=Oi();return(0,P.jsx)(ae,{mounted:s.opened,transition:`pop`,...s.transitionProps,onExited:()=>{s.onExitTransitionEnd?.(),s.transitionProps?.onExited?.()},onEntered:()=>{s.onEnterTransitionEnd?.(),s.transitionProps?.onEntered?.()},...e,children:e=>(0,P.jsx)(`div`,{...n,className:O({[Ha.inner]:!s.unstyled},n.className),children:(0,P.jsx)(hi,{active:s.opened&&s.trapFocus,innerRef:a,children:(0,P.jsx)(Ne,{...o,component:`section`,role:`dialog`,tabIndex:-1,"aria-modal":!0,"aria-describedby":s.bodyMounted?s.getBodyId():void 0,"aria-labelledby":s.titleMounted?s.getTitleId():void 0,style:[i,e],className:O({[Ha.content]:!s.unstyled},t),unstyled:s.unstyled,children:o.children})})})})}Ga.displayName=`@mantine/core/ModalBaseContent`;function Ka({className:e,...t}){let n=Oi();return(0,P.jsx)(u,{component:`header`,className:O({[Ha.header]:!n.unstyled},e),...t})}Ka.displayName=`@mantine/core/ModalBaseHeader`;var qa={duration:200,timingFunction:`ease`,transition:`fade`};function Ja(e){let t=Oi();return{...qa,...t.transitionProps,...e}}function Ya({onClick:e,transitionProps:t,style:n,visible:r,...i}){let a=Oi(),o=Ja(t);return(0,P.jsx)(ae,{mounted:r===void 0?a.opened:r,...o,transition:`fade`,children:t=>(0,P.jsx)(ui,{fixed:!0,style:[n,t],zIndex:a.zIndex,unstyled:a.unstyled,onClick:t=>{e?.(t),a.closeOnClickOutside&&a.onClose()},...i})})}Ya.displayName=`@mantine/core/ModalBaseOverlay`;function Xa(){let e=Oi();return(0,N.useEffect)(()=>(e.setTitleMounted(!0),()=>e.setTitleMounted(!1)),[]),e.getTitleId()}function Za({className:e,...t}){let n=Xa(),r=Oi();return(0,P.jsx)(u,{component:`h2`,className:O({[Ha.title]:!r.unstyled},e),id:n,...t})}Za.displayName=`@mantine/core/ModalBaseTitle`;function Qa({children:e}){return(0,P.jsx)(P.Fragment,{children:e})}function $a({style:e,size:t=16,...n}){return(0,P.jsx)(`svg`,{viewBox:`0 0 15 15`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`,style:{...e,width:M(t),height:M(t),display:`block`},...n,children:(0,P.jsx)(`path`,{d:`M3.13523 6.15803C3.3241 5.95657 3.64052 5.94637 3.84197 6.13523L7.5 9.56464L11.158 6.13523C11.3595 5.94637 11.6759 5.95657 11.8648 6.15803C12.0536 6.35949 12.0434 6.67591 11.842 6.86477L7.84197 10.6148C7.64964 10.7951 7.35036 10.7951 7.15803 10.6148L3.15803 6.86477C2.95657 6.67591 2.94637 6.35949 3.13523 6.15803Z`,fill:`currentColor`,fillRule:`evenodd`,clipRule:`evenodd`})})}$a.displayName=`@mantine/core/AccordionChevron`;var[eo,to]=dt(`AppShell was not found in tree`);function no({size:e,min:t,max:n,viewportMax:r}){let i=Math.min(n??1/0,r);return Math.max(Math.min(t??0,i),Math.min(e,i))}function ro(e,t){return t!==void 0&&ef.axis===`horizontal`?window.innerWidth:window.innerHeight,[h,g]=(0,N.useState)(0),[_,v]=(0,N.useState)(void 0),y=()=>m()/d.scale,x=e=>{let t=e.getBoundingClientRect();return((f.axis===`horizontal`?t.width:t.height)-so(e,f.safeAreaVariable))/d.scale},S=t=>{let r=n.rootRef.current;if(!r)return;let i=M(t);r.style.setProperty(f.sizeVariable,i),n.resizeOffsets[e]&&r.style.setProperty(f.offsetVariable,i),n.mode===`static`&&f.gridWidthVariable&&r.style.setProperty(f.gridWidthVariable,i)},C=()=>{let e=n.rootRef.current;e&&(e.style.removeProperty(f.sizeVariable),e.style.removeProperty(f.offsetVariable),f.gridWidthVariable&&e.style.removeProperty(f.gridWidthVariable))},w=()=>{s.current?.abort(),s.current=null,o.current=null;let e=c.current;c.current=null,e&&(po(`user-select`,e.userSelect),po(`-webkit-user-select`,e.webkitUserSelect),po(`cursor`,e.cursor))},T=()=>{r?.reportCollapse(e,ro(a.current.startSize,p.collapseThreshold)),r?.endResize(e,null)},ee=t=>{if(t.pointerId!==o.current)return;a.current.moved=!0;let n=oo({section:e,deltaX:t.clientX-a.current.startX,deltaY:t.clientY-a.current.startY,dir:l})/d.scale,s=a.current.startSize+n,c=no({size:s,min:p.min,max:p.max,viewportMax:y()});a.current.size=c,S(c),i.current?.setAttribute(`aria-valuenow`,String(Math.round(c))),r?.previewResize(e,c),r?.reportCollapse(e,ro(s,p.collapseThreshold))},E=t=>{if(t.pointerId===o.current){if(w(),!a.current.moved){r?.endResize(e,null);return}r?.endResize(e,a.current.size)}},D=e=>{e.pointerId===o.current&&(w(),C(),T())},O=e=>{e.key===`Escape`&&(e.preventDefault(),w(),C(),i.current?.setAttribute(`aria-valuenow`,String(Math.round(a.current.startSize))),T())},te=()=>{let t=r?.[e].size;if(t!==void 0)return t;let n=i.current?.parentElement;return n?x(n):0},ne=t=>{r?.initCollapse(e,ro(te(),p.collapseThreshold)),r?.reportCollapse(e,ro(t,p.collapseThreshold)),r?.endResize(e,no({size:t,min:p.min,max:p.max,viewportMax:y()}))},re=t=>{let n=t.shiftKey?uo:lo;if(t.key===`Home`){t.preventDefault(),ne(p.min??0);return}if(t.key===`End`){t.preventDefault(),ne(p.max??y());return}let r=fo[t.key];if(!r)return;let i=oo({section:e,...r,dir:l});i!==0&&(t.preventDefault(),ne(te()+i*n))},k=()=>{C(),r?.[e].reset()},ie=t=>{if(t.button!==0||s.current!==null)return;let n=i.current?.parentElement;if(!n)return;let l=x(n);a.current={startSize:l,startX:t.clientX,startY:t.clientY,size:l,moved:!1},o.current=t.pointerId,r?.initCollapse(e,ro(l,p.collapseThreshold));let u=new AbortController;s.current=u;let{signal:d}=u;c.current={userSelect:document.body.style.getPropertyValue(`user-select`),webkitUserSelect:document.body.style.getPropertyValue(`-webkit-user-select`),cursor:document.body.style.getPropertyValue(`cursor`)},document.body.style.setProperty(`user-select`,`none`),document.body.style.setProperty(`-webkit-user-select`,`none`),document.body.style.setProperty(`cursor`,f.axis===`horizontal`?`col-resize`:`row-resize`),r?.startResize(e),document.addEventListener(`pointermove`,ee,{signal:d}),document.addEventListener(`pointerup`,E,{signal:d}),document.addEventListener(`pointercancel`,D,{signal:d}),document.addEventListener(`keydown`,O,{signal:d})};if(me(()=>{r&&r.activeSection!==e&&C()},[r?.activeSection,r?.[e].size]),me(()=>{g(m());let e=()=>g(m());return window.addEventListener(`resize`,e),()=>window.removeEventListener(`resize`,e)},[f.axis]),me(()=>{r?.[e].size===void 0&&v(te())},[r?.[e].size,h]),me(()=>()=>{let e=s.current!==null;w(),C(),e&&T()},[]),!r?.[e].enabled)return null;let ae=h/d.scale,A=Math.min(p.max??ae,ae),oe=r[e].size,se=oe!==void 0&&h>0?Math.min(oe,ae):oe??_;return(0,P.jsx)(u,{ref:i,role:`separator`,tabIndex:0,"aria-label":p.label??co[e],"aria-controls":t,"aria-orientation":f.orientation,"aria-valuemin":p.min??0,"aria-valuemax":Math.round(A),"aria-valuenow":se===void 0?void 0:Math.round(se),onPointerDown:ie,onKeyDown:re,onDoubleClick:k,mod:{section:e,orientation:f.orientation,active:r[e].active},...n.getStyles(`resizeHandle`)})}mo.displayName=`@mantine/core/AppShellResizeHandle`;var ho={root:`m_89ab340`,navbar:`m_45252eee`,aside:`m_9cdde9a`,header:`m_3b16f56b`,main:`m_8983817`,footer:`m_3840c879`,section:`m_6dcfc7c7`,resizeHandle:`m_3b25945a`},go=w(e=>{let{classNames:t,className:n,style:r,styles:i,unstyled:a,vars:o,withBorder:s,zIndex:c,mod:l,...d}=v(`AppShellAside`,null,e),f=to(),p=ye(d.id);if(f.disabled)return null;let m=f.resize?.aside.enabled??!1,h=f.getStyles(`aside`,{className:O({[za.classNames.zeroRight]:f.offsetScrollbars},n),classNames:t,styles:i,style:r});if(!m)return(0,P.jsx)(u,{component:`aside`,mod:[{"with-border":s??f.withBorder},l],...h,...d,__vars:{"--app-shell-aside-z-index":`calc(${c??f.zIndex} + 1)`}});let{children:g,dangerouslySetInnerHTML:_,...y}=d;return(0,P.jsxs)(u,{component:`aside`,mod:[{"with-border":s??f.withBorder},l],...h,...y,__vars:{"--app-shell-aside-z-index":`calc(${c??f.zIndex} + 1)`},id:p,children:[_?(0,P.jsx)(`div`,{style:{display:`contents`},dangerouslySetInnerHTML:_}):g,(0,P.jsx)(mo,{section:`aside`,sectionId:p})]})});go.classes=ho,go.displayName=`@mantine/core/AppShellAside`;var _o=w(e=>{let{classNames:t,className:n,style:r,styles:i,unstyled:a,vars:o,withBorder:s,zIndex:c,mod:l,...d}=v(`AppShellFooter`,null,e),f=to(),p=ye(d.id);if(f.disabled)return null;let m=f.resize?.footer.enabled??!1,h=f.getStyles(`footer`,{className:O({[za.classNames.zeroRight]:f.offsetScrollbars},n),classNames:t,styles:i,style:r});if(!m)return(0,P.jsx)(u,{component:`footer`,mod:[{"with-border":s??f.withBorder},l],...h,...d,__vars:{"--app-shell-footer-z-index":(c??f.zIndex)?.toString()}});let{children:g,dangerouslySetInnerHTML:_,...y}=d;return(0,P.jsxs)(u,{component:`footer`,mod:[{"with-border":s??f.withBorder},l],...h,...y,__vars:{"--app-shell-footer-z-index":(c??f.zIndex)?.toString()},id:p,children:[_?(0,P.jsx)(`div`,{style:{display:`contents`},dangerouslySetInnerHTML:_}):g,(0,P.jsx)(mo,{section:`footer`,sectionId:p})]})});_o.classes=ho,_o.displayName=`@mantine/core/AppShellFooter`;var vo=w(e=>{let{classNames:t,className:n,style:r,styles:i,unstyled:a,vars:o,withBorder:s,zIndex:c,mod:l,...d}=v(`AppShellHeader`,null,e),f=to(),p=ye(d.id);if(f.disabled)return null;let m=f.resize?.header.enabled??!1,h=f.getStyles(`header`,{className:O({[za.classNames.zeroRight]:f.offsetScrollbars},n),classNames:t,styles:i,style:r});if(!m)return(0,P.jsx)(u,{component:`header`,mod:[{"with-border":s??f.withBorder},l],...h,...d,__vars:{"--app-shell-header-z-index":(c??f.zIndex)?.toString()}});let{children:g,dangerouslySetInnerHTML:_,...y}=d;return(0,P.jsxs)(u,{component:`header`,mod:[{"with-border":s??f.withBorder},l],...h,...y,__vars:{"--app-shell-header-z-index":(c??f.zIndex)?.toString()},id:p,children:[_?(0,P.jsx)(`div`,{style:{display:`contents`},dangerouslySetInnerHTML:_}):g,(0,P.jsx)(mo,{section:`header`,sectionId:p})]})});vo.classes=ho,vo.displayName=`@mantine/core/AppShellHeader`;var yo=w(e=>{let{classNames:t,className:n,style:r,styles:i,vars:a,...o}=v(`AppShellMain`,null,e),s=to();return(0,P.jsx)(u,{component:`main`,...s.getStyles(`main`,{className:n,style:r,classNames:t,styles:i}),...o})});yo.classes=ho,yo.displayName=`@mantine/core/AppShellMain`;var bo=w(e=>{let{classNames:t,className:n,style:r,styles:i,unstyled:a,vars:o,withBorder:s,zIndex:c,mod:l,...d}=v(`AppShellNavbar`,null,e),f=to(),p=ye(d.id);if(f.disabled)return null;let m=f.resize?.navbar.enabled??!1,h=f.getStyles(`navbar`,{className:n,classNames:t,styles:i,style:r});if(!m)return(0,P.jsx)(u,{component:`nav`,mod:[{"with-border":s??f.withBorder},l],...h,...d,__vars:{"--app-shell-navbar-z-index":`calc(${c??f.zIndex} + 1)`}});let{children:g,dangerouslySetInnerHTML:_,...y}=d;return(0,P.jsxs)(u,{component:`nav`,mod:[{"with-border":s??f.withBorder},l],...h,...y,__vars:{"--app-shell-navbar-z-index":`calc(${c??f.zIndex} + 1)`},id:p,children:[_?(0,P.jsx)(`div`,{style:{display:`contents`},dangerouslySetInnerHTML:_}):g,(0,P.jsx)(mo,{section:`navbar`,sectionId:p})]})});bo.classes=ho,bo.displayName=`@mantine/core/AppShellNavbar`;var xo=Me(e=>{let{classNames:t,className:n,style:r,styles:i,vars:a,grow:o,mod:s,...c}=v(`AppShellSection`,null,e),l=to();return(0,P.jsx)(u,{mod:[{grow:o},s],...l.getStyles(`section`,{className:n,style:r,classNames:t,styles:i}),...c})});xo.classes=ho,xo.displayName=`@mantine/core/AppShellSection`;function So(e){return typeof e==`object`?e.base:e}function Co(e,t){return`min(${M(e)}, ${t===`horizontal`?`100vw`:`100dvh`})`}function wo(e){let t=typeof e==`object`&&!!e&&e.base!==void 0&&Object.keys(e).length===1;return typeof e==`number`||typeof e==`string`||t}function To(e){return!(typeof e!=`object`||!e||Object.keys(e).length===1&&`base`in e)}function Eo({baseStyles:e,minMediaStyles:t,maxMediaStyles:n,aside:r,theme:i,mode:a,resizedSize:o,resizable:s}){let c=r?.width,l=`translateX(var(--app-shell-aside-width))`,u=`translateX(calc(var(--app-shell-aside-width) * -1))`;if(r?.breakpoint!==void 0&&!r?.collapsed?.mobile&&(n[r?.breakpoint]=n[r?.breakpoint]||{},a===`fixed`?(n[r?.breakpoint][`--app-shell-aside-width`]=`100%`,n[r?.breakpoint][`--app-shell-aside-offset`]=`0px`):(n[r?.breakpoint][`--app-shell-aside-width`]=`0px`,n[r?.breakpoint][`--app-shell-aside-offset`]=`0px`),s&&(n[r.breakpoint][`--app-shell-aside-resize-handle-display`]=`none`)),o!==void 0){let t=Co(o,`horizontal`);e[`--app-shell-aside-width`]=t,e[`--app-shell-aside-offset`]=t,a===`static`&&(e[`--app-shell-aside-grid-width`]=t)}else{if(wo(c)){let t=M(So(c));e[`--app-shell-aside-width`]=t,e[`--app-shell-aside-offset`]=t}To(c)&&(c.base!==void 0&&(e[`--app-shell-aside-width`]=M(c.base),e[`--app-shell-aside-offset`]=M(c.base)),ue(c).forEach(e=>{e!==`base`&&(t[e]=t[e]||{},t[e][`--app-shell-aside-width`]=M(c[e]),t[e][`--app-shell-aside-offset`]=M(c[e]))}))}if(r?.breakpoint!==void 0&&a===`static`&&(t[r.breakpoint]=t[r.breakpoint]||{},t[r.breakpoint][`--app-shell-aside-position`]=`sticky`,t[r.breakpoint][`--app-shell-aside-grid-row`]=`2`,t[r.breakpoint][`--app-shell-aside-grid-column`]=`3`,t[r.breakpoint][`--app-shell-main-column-end`]=`3`),r?.collapsed?.desktop){let e=r.breakpoint;t[e]=t[e]||{},t[e][`--app-shell-aside-transform`]=l,t[e][`--app-shell-aside-transform-rtl`]=u,a===`fixed`?t[e][`--app-shell-aside-offset`]=`0px !important`:(t[e][`--app-shell-aside-width`]=`0px`,t[e][`--app-shell-aside-display`]=`none`,t[e][`--app-shell-main-column-end`]=`-1`),t[e][`--app-shell-aside-scroll-locked-visibility`]=`hidden`,s&&(t[e][`--app-shell-aside-resize-handle-display`]=`none`)}if(r?.collapsed?.mobile){let e=sr(r.breakpoint,i.breakpoints)-.1;n[e]=n[e]||{},a===`fixed`?(n[e][`--app-shell-aside-width`]=`100%`,n[e][`--app-shell-aside-offset`]=`0px`):n[e][`--app-shell-aside-width`]=`0px`,n[e][`--app-shell-aside-transform`]=l,n[e][`--app-shell-aside-transform-rtl`]=u,n[e][`--app-shell-aside-scroll-locked-visibility`]=`hidden`,s&&(n[e][`--app-shell-aside-resize-handle-display`]=`none`)}}function Do({baseStyles:e,minMediaStyles:t,footer:n,mode:r,resizedSize:i,resizable:a}){let o=n?.height,s=r===`static`?!0:n?.offset??!0;if(r===`static`&&n&&(e[`--app-shell-footer-position`]=`sticky`,e[`--app-shell-footer-grid-column`]=`1 / -1`,e[`--app-shell-footer-grid-row`]=`3`),i!==void 0){let t=Co(i,`vertical`);e[`--app-shell-footer-height`]=t,s&&(e[`--app-shell-footer-offset`]=t)}else{if(wo(o)){let t=M(So(o));e[`--app-shell-footer-height`]=t,s&&(e[`--app-shell-footer-offset`]=t)}To(o)&&(o.base!==void 0&&(e[`--app-shell-footer-height`]=M(o.base),s&&(e[`--app-shell-footer-offset`]=M(o.base))),ue(o).forEach(e=>{e!==`base`&&(t[e]=t[e]||{},t[e][`--app-shell-footer-height`]=M(o[e]),s&&(t[e][`--app-shell-footer-offset`]=M(o[e])))}))}n?.collapsed&&(e[`--app-shell-footer-transform`]=`translateY(var(--app-shell-footer-height))`,r===`fixed`&&(e[`--app-shell-footer-offset`]=`0px !important`),a&&(e[`--app-shell-footer-resize-handle-display`]=`none`))}function Oo({baseStyles:e,minMediaStyles:t,header:n,mode:r,resizedSize:i,resizable:a}){let o=n?.height,s=r===`static`?!0:n?.offset??!0;if(r===`static`&&n&&(e[`--app-shell-header-position`]=`sticky`,e[`--app-shell-header-grid-column`]=`1 / -1`,e[`--app-shell-header-grid-row`]=`1`),i!==void 0){let t=Co(i,`vertical`);e[`--app-shell-header-height`]=t,s&&(e[`--app-shell-header-offset`]=t)}else{if(wo(o)){let t=M(So(o));e[`--app-shell-header-height`]=t,s&&(e[`--app-shell-header-offset`]=t)}To(o)&&(o.base!==void 0&&(e[`--app-shell-header-height`]=M(o.base),s&&(e[`--app-shell-header-offset`]=M(o.base))),ue(o).forEach(e=>{e!==`base`&&(t[e]=t[e]||{},t[e][`--app-shell-header-height`]=M(o[e]),s&&(t[e][`--app-shell-header-offset`]=M(o[e])))}))}n?.collapsed&&(e[`--app-shell-header-transform`]=`translateY(calc(var(--app-shell-header-height) * -1))`,r===`fixed`&&(e[`--app-shell-header-offset`]=`0px !important`),a&&(e[`--app-shell-header-resize-handle-display`]=`none`))}function ko({baseStyles:e,minMediaStyles:t,maxMediaStyles:n,navbar:r,theme:i,mode:a,resizedSize:o,resizable:s}){let c=r?.width,l=`translateX(calc(var(--app-shell-navbar-width) * -1))`,u=`translateX(var(--app-shell-navbar-width))`;if(r?.breakpoint!==void 0&&!r?.collapsed?.mobile&&(n[r?.breakpoint]=n[r?.breakpoint]||{},n[r?.breakpoint][`--app-shell-navbar-offset`]=`0px`,n[r?.breakpoint][`--app-shell-navbar-width`]=`100%`,a===`static`&&(n[r?.breakpoint][`--app-shell-navbar-grid-width`]=`0px`),s&&(n[r.breakpoint][`--app-shell-navbar-resize-handle-display`]=`none`)),o!==void 0){let t=Co(o,`horizontal`);e[`--app-shell-navbar-width`]=t,e[`--app-shell-navbar-offset`]=t,a===`static`&&(e[`--app-shell-navbar-grid-width`]=t)}else{if(wo(c)){let t=M(So(c));e[`--app-shell-navbar-width`]=t,e[`--app-shell-navbar-offset`]=t,a===`static`&&(e[`--app-shell-navbar-grid-width`]=t)}To(c)&&(c.base!==void 0&&(e[`--app-shell-navbar-width`]=M(c.base),e[`--app-shell-navbar-offset`]=M(c.base),a===`static`&&(e[`--app-shell-navbar-grid-width`]=M(c.base))),ue(c).forEach(e=>{e!==`base`&&(t[e]=t[e]||{},t[e][`--app-shell-navbar-width`]=M(c[e]),t[e][`--app-shell-navbar-offset`]=M(c[e]),a===`static`&&(t[e][`--app-shell-navbar-grid-width`]=M(c[e])))}))}if(r?.breakpoint!==void 0&&a===`static`&&(t[r.breakpoint]=t[r.breakpoint]||{},t[r.breakpoint][`--app-shell-navbar-position`]=`sticky`,t[r.breakpoint][`--app-shell-navbar-grid-row`]=`2`,t[r.breakpoint][`--app-shell-navbar-grid-column`]=`1`,t[r.breakpoint][`--app-shell-main-column-start`]=`2`),r?.collapsed?.desktop){let e=r.breakpoint;t[e]=t[e]||{},t[e][`--app-shell-navbar-transform`]=l,t[e][`--app-shell-navbar-transform-rtl`]=u,a===`fixed`?t[e][`--app-shell-navbar-offset`]=`0px !important`:(t[e][`--app-shell-navbar-width`]=`0px`,t[e][`--app-shell-navbar-display`]=`none`,t[e][`--app-shell-main-column-start`]=`1`),s&&(t[e][`--app-shell-navbar-resize-handle-display`]=`none`)}if(r?.collapsed?.mobile){let e=sr(r.breakpoint,i.breakpoints)-.1;n[e]=n[e]||{},n[e][`--app-shell-navbar-width`]=`100%`,n[e][`--app-shell-navbar-offset`]=`0px`,a===`static`&&(n[e][`--app-shell-navbar-grid-width`]=`0px`),n[e][`--app-shell-navbar-transform`]=l,n[e][`--app-shell-navbar-transform-rtl`]=u,s&&(n[e][`--app-shell-navbar-resize-handle-display`]=`none`)}}function Ao(e){return Number(e)===0?`0px`:Ae(e)}function jo({padding:e,baseStyles:t,minMediaStyles:n}){wo(e)&&(t[`--app-shell-padding`]=Ao(So(e))),To(e)&&(e.base&&(t[`--app-shell-padding`]=Ao(e.base)),ue(e).forEach(t=>{t!==`base`&&(n[t]=n[t]||{},n[t][`--app-shell-padding`]=Ao(e[t]))}))}function Mo({navbar:e,header:t,footer:n,aside:r,padding:i,theme:a,mode:o,resize:s}){let c={},l={},u={};o===`static`&&(u[`--app-shell-main-grid-column`]=`1 / -1`,u[`--app-shell-main-grid-row`]=`2`),ko({baseStyles:u,minMediaStyles:c,maxMediaStyles:l,navbar:e,theme:a,mode:o,resizedSize:s?.sizes.navbar,resizable:s?.enabled.navbar}),Eo({baseStyles:u,minMediaStyles:c,maxMediaStyles:l,aside:r,theme:a,mode:o,resizedSize:s?.sizes.aside,resizable:s?.enabled.aside}),Oo({baseStyles:u,minMediaStyles:c,header:t,mode:o,resizedSize:s?.sizes.header,resizable:s?.enabled.header}),Do({baseStyles:u,minMediaStyles:c,footer:n,mode:o,resizedSize:s?.sizes.footer,resizable:s?.enabled.footer}),jo({baseStyles:u,minMediaStyles:c,padding:i});let d=cr(ue(c),a.breakpoints).map(e=>({query:`(min-width: ${Se(e.px)})`,styles:c[e.value]})),f=cr(ue(l),a.breakpoints).map(e=>({query:`(max-width: ${Se(e.px)})`,styles:l[e.value]}));return{baseStyles:u,media:[...d,...f]}}function No({navbar:e,header:t,aside:n,footer:r,padding:i,mode:a,selector:o,resize:s}){let c=b(),l=_(),{media:u,baseStyles:d}=Mo({navbar:e,header:t,footer:r,aside:n,padding:i,theme:c,mode:a,resize:s});return(0,P.jsx)(ge,{media:u,styles:d,selector:o||l.cssVariablesSelector})}function Po(e){return e>=128||e===45||e===95||e>=48&&e<=57||e>=65&&e<=90||e>=97&&e<=122}function Fo(e){return e>=48&&e<=57}function Io(e){let t=``;for(let n=0;n=1&&r<=31||r===127||n===0&&Fo(r)||n===1&&Fo(r)&&e.charCodeAt(0)===45?t+=`\\${r.toString(16)} `:n===0&&e.length===1&&r===45?t+=`\\${i}`:Po(r)?t+=i:t+=`\\${i}`}return t}function Lo({transitionDuration:e,disabled:t,resizeKey:n}){let[r,i]=(0,N.useState)(!0),[a,o]=(0,N.useState)({key:n,active:!1}),s=(0,N.useRef)(-1),c=(0,N.useRef)(-1);return a.key!==n&&o({key:n,active:!0}),(0,N.useEffect)(()=>{if(!a.active)return;let t=window.setTimeout(()=>(0,N.startTransition)(()=>{o(e=>({...e,active:!1}))}),e||0);return()=>window.clearTimeout(t)},[a,e]),Tr(`resize`,()=>{i(!0),clearTimeout(s.current),s.current=window.setTimeout(()=>(0,N.startTransition)(()=>{i(!1)}),200)}),me(()=>{i(!0),clearTimeout(c.current),c.current=window.setTimeout(()=>(0,N.startTransition)(()=>{i(!1)}),e||0)},[t,e]),r||a.active}var Ro={withBorder:!0,padding:0,transitionDuration:200,transitionTimingFunction:`ease`,zIndex:ft(`app`),mode:`fixed`},zo=D((e,{transitionDuration:t,transitionTimingFunction:n})=>({root:{"--app-shell-transition-duration":`${t}ms`,"--app-shell-transition-timing-function":n,"--app-shell-resize-handle-size":void 0}})),Bo=w(e=>{let t=v(`AppShell`,Ro,e),{classNames:n,className:r,style:i,styles:a,unstyled:o,vars:s,navbar:l,withBorder:d,padding:f,transitionDuration:p,transitionTimingFunction:m,header:h,zIndex:g,layout:_,disabled:y,aside:b,footer:x,offsetScrollbars:S=!0,mode:C,mod:w,attributes:T,id:ee,resize:E,ref:D,...O}=t,te=c({name:`AppShell`,classes:ho,props:t,className:r,style:i,classNames:n,styles:a,unstyled:o,attributes:T,vars:s,varsResolver:zo}),ne=Lo({disabled:y,transitionDuration:p,resizeKey:E?ao.map(e=>E.sizes[e]).join(`|`):void 0}),re=ye(ee),k=(0,N.useRef)(null),ie=E?{sizes:E.sizes,enabled:{navbar:E.navbar.enabled,aside:E.aside.enabled,header:E.header.enabled,footer:E.footer.enabled}}:void 0,ae={navbar:!0,aside:!0,header:C===`static`?!0:h?.offset??!0,footer:C===`static`?!0:x?.offset??!0};return(0,P.jsxs)(eo,{value:{getStyles:te,withBorder:d,zIndex:g,disabled:y,offsetScrollbars:S,mode:C,resize:E,rootRef:k,resizeOffsets:ae},children:[(0,P.jsx)(No,{navbar:l,header:h,aside:b,footer:x,padding:f,mode:C,resize:ie,selector:E||C===`static`?`#${Io(re)}`:void 0}),(0,P.jsx)(u,{...te(`root`),id:re,ref:Oe(D,k),mod:[{resizing:ne||E?.activeSection!=null,layout:_,disabled:y,mode:C},w],...O})]})});Bo.classes=ho,Bo.varsResolver=zo,Bo.displayName=`@mantine/core/AppShell`,Bo.Navbar=bo,Bo.Header=vo,Bo.Main=yo,Bo.Aside=go,Bo.Footer=_o,Bo.Section=xo;function Vo({size:e,style:t,...n}){let r=e===void 0?t:{width:M(e),height:M(e),...t};return(0,P.jsx)(`svg`,{viewBox:`0 0 10 7`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`,style:r,"aria-hidden":!0,...n,children:(0,P.jsx)(`path`,{d:`M4 4.586L1.707 2.293A1 1 0 1 0 .293 3.707l3 3a.997.997 0 0 0 1.414 0l5-5A1 1 0 1 0 8.293.293L4 4.586z`,fill:`currentColor`,fillRule:`evenodd`,clipRule:`evenodd`})})}var Ho={group:`m_11def92b`,root:`m_f85678b6`,image:`m_11f8ac07`,placeholder:`m_104cd71f`},Uo=(0,N.createContext)({withinGroup:!1}),Wo=D((e,{spacing:t})=>({group:{"--ag-spacing":Ae(t)}})),Go=w(e=>{let t=v(`AvatarGroup`,null,e),{classNames:n,className:r,style:i,styles:a,unstyled:o,vars:s,spacing:l,attributes:d,...f}=t,p=c({name:`AvatarGroup`,classes:Ho,props:t,className:r,style:i,classNames:n,styles:a,unstyled:o,attributes:d,vars:s,varsResolver:Wo,rootSelector:`group`});return(0,P.jsx)(Uo,{value:{withinGroup:!0},children:(0,P.jsx)(u,{...p(`group`),...f})})});Go.classes=Ho,Go.varsResolver=Wo,Go.displayName=`@mantine/core/AvatarGroup`;function Ko(e){return(0,P.jsx)(`svg`,{...e,"data-avatar-placeholder-icon":!0,viewBox:`0 0 15 15`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`,children:(0,P.jsx)(`path`,{d:`M0.877014 7.49988C0.877014 3.84219 3.84216 0.877045 7.49985 0.877045C11.1575 0.877045 14.1227 3.84219 14.1227 7.49988C14.1227 11.1575 11.1575 14.1227 7.49985 14.1227C3.84216 14.1227 0.877014 11.1575 0.877014 7.49988ZM7.49985 1.82704C4.36683 1.82704 1.82701 4.36686 1.82701 7.49988C1.82701 8.97196 2.38774 10.3131 3.30727 11.3213C4.19074 9.94119 5.73818 9.02499 7.50023 9.02499C9.26206 9.02499 10.8093 9.94097 11.6929 11.3208C12.6121 10.3127 13.1727 8.97172 13.1727 7.49988C13.1727 4.36686 10.6328 1.82704 7.49985 1.82704ZM10.9818 11.9787C10.2839 10.7795 8.9857 9.97499 7.50023 9.97499C6.01458 9.97499 4.71624 10.7797 4.01845 11.9791C4.97952 12.7272 6.18765 13.1727 7.49985 13.1727C8.81227 13.1727 10.0206 12.727 10.9818 11.9787ZM5.14999 6.50487C5.14999 5.207 6.20212 4.15487 7.49999 4.15487C8.79786 4.15487 9.84999 5.207 9.84999 6.50487C9.84999 7.80274 8.79786 8.85487 7.49999 8.85487C6.20212 8.85487 5.14999 7.80274 5.14999 6.50487ZM7.49999 5.10487C6.72679 5.10487 6.09999 5.73167 6.09999 6.50487C6.09999 7.27807 6.72679 7.90487 7.49999 7.90487C8.27319 7.90487 8.89999 7.27807 8.89999 6.50487C8.89999 5.73167 8.27319 5.10487 7.49999 5.10487Z`,fill:`currentColor`,fillRule:`evenodd`,clipRule:`evenodd`})})}function qo(e){let t=0;for(let n=0;ne[0]).slice(0,t).join(``).toUpperCase()}var Xo=D((e,{size:t,radius:n,variant:r,gradient:i,color:a,autoContrast:o,name:s,allowedInitialsColors:c})=>{let l=a===`initials`&&typeof s==`string`?Jo(s,c):a,u=e.variantColorResolver({color:l||`gray`,theme:e,gradient:i,variant:r||`light`,autoContrast:o});return{root:{"--avatar-size":ve(t,`avatar-size`),"--avatar-radius":n===void 0?void 0:Ee(n),"--avatar-bg":l||r?u.background:void 0,"--avatar-color":l||r?u.color:void 0,"--avatar-bd":l||r?u.border:void 0}}}),Zo=Me(e=>{let t=v(`Avatar`,null,e),{classNames:n,className:r,style:i,styles:a,unstyled:o,vars:s,src:l,alt:d,radius:f,color:p,gradient:m,imageProps:h,children:g,autoContrast:_,mod:y,name:b,allowedInitialsColors:x,attributes:S,...C}=t,w=(0,N.use)(Uo),[T,ee]=(0,N.useState)(!l),E=c({name:`Avatar`,props:t,classes:Ho,className:r,style:i,classNames:n,styles:a,unstyled:o,attributes:S,vars:s,varsResolver:Xo});return(0,N.useEffect)(()=>ee(!l),[l]),(0,P.jsx)(u,{...E(`root`),mod:[{"within-group":w.withinGroup},y],...C,children:T||!l?(0,P.jsx)(`span`,{...E(`placeholder`),title:d,children:g||typeof b==`string`&&Yo(b)||(0,P.jsx)(Ko,{})}):(0,P.jsx)(`img`,{...h,...E(`image`),src:l,alt:d,onError:e=>{ee(!0),h?.onError?.(e)}})})});Zo.classes=Ho,Zo.varsResolver=Xo,Zo.displayName=`@mantine/core/Avatar`,Zo.Group=Go;var Qo={root:`m_fea6bf1a`,burger:`m_d4fb9cad`},$o=D((e,{color:t,size:n,lineSize:r,transitionDuration:i,transitionTimingFunction:a})=>({root:{"--burger-color":t?g(t,e):void 0,"--burger-size":ve(n,`burger-size`),"--burger-line-size":r?M(r):void 0,"--burger-transition-duration":i===void 0?void 0:`${i}ms`,"--burger-transition-timing-function":a}})),es=w(e=>{let t=v(`Burger`,null,e),{classNames:n,className:r,style:i,styles:a,unstyled:o,vars:s,opened:l,children:d,transitionDuration:f,transitionTimingFunction:p,lineSize:m,attributes:h,...g}=t,_=c({name:`Burger`,classes:Qo,props:t,className:r,style:i,classNames:n,styles:a,unstyled:o,attributes:h,vars:s,varsResolver:$o});return(0,P.jsxs)(C,{..._(`root`),...g,children:[(0,P.jsx)(u,{mod:[`reduce-motion`,{opened:l}],..._(`burger`)}),d]})});es.classes=Qo,es.varsResolver=$o,es.displayName=`@mantine/core/Burger`;var ts={root:`m_b183c0a2`},ns=D((e,{color:t})=>({root:{"--code-bg":t?g(t,e):void 0}})),rs=w(e=>{let t=v(`Code`,null,e),{classNames:n,className:r,style:i,styles:a,unstyled:o,vars:s,color:l,block:d,mod:f,attributes:p,...m}=t,h=c({name:`Code`,props:t,classes:ts,className:r,style:i,classNames:n,styles:a,unstyled:o,attributes:p,vars:s,varsResolver:ns});return(0,P.jsx)(u,{component:d?`pre`:`code`,mod:[{block:d},f],...h(`root`),...m,dir:`ltr`})});rs.classes=ts,rs.varsResolver=ns,rs.displayName=`@mantine/core/Code`;var[is,as]=dt(`Drawer component was not found in tree`),os={root:`m_f11b401e`,header:`m_5a7c2c9`,content:`m_b8a05bbd`,inner:`m_31cd769a`},ss=w(e=>{let{classNames:t,className:n,style:r,styles:i,vars:a,...o}=v(`DrawerBody`,null,e),s=as();return(0,P.jsx)(Ua,{...s.getStyles(`body`,{classNames:t,style:r,styles:i,className:n}),...o})});ss.classes=os,ss.displayName=`@mantine/core/DrawerBody`;var cs=w(e=>{let{classNames:t,className:n,style:r,styles:i,vars:a,...o}=v(`DrawerCloseButton`,null,e),s=as();return(0,P.jsx)(Wa,{...s.getStyles(`close`,{classNames:t,style:r,styles:i,className:n}),...o})});cs.classes=os,cs.displayName=`@mantine/core/DrawerCloseButton`;var ls=w(e=>{let{classNames:t,className:n,style:r,styles:i,vars:a,children:o,radius:s,__hidden:c,...l}=v(`DrawerContent`,null,e),u=as(),d=u.scrollAreaComponent||Qa;return(0,P.jsx)(Ga,{...u.getStyles(`content`,{className:n,style:r,styles:i,classNames:t}),innerProps:u.getStyles(`inner`,{className:n,style:r,styles:i,classNames:t}),...l,radius:s||u.radius||0,"data-hidden":c||void 0,children:(0,P.jsx)(d,{style:{height:`calc(100vh - var(--drawer-offset) * 2)`},children:o})})});ls.classes=os,ls.displayName=`@mantine/core/DrawerContent`;var us=w(e=>{let{classNames:t,className:n,style:r,styles:i,vars:a,...o}=v(`DrawerHeader`,null,e),s=as();return(0,P.jsx)(Ka,{...s.getStyles(`header`,{classNames:t,style:r,styles:i,className:n}),...o})});us.classes=os,us.displayName=`@mantine/core/DrawerHeader`;var ds=w(e=>{let{classNames:t,className:n,style:r,styles:i,vars:a,...o}=v(`DrawerOverlay`,null,e),s=as();return(0,P.jsx)(Ya,{...s.getStyles(`overlay`,{classNames:t,style:r,styles:i,className:n}),...o})});ds.classes=os,ds.displayName=`@mantine/core/DrawerOverlay`;function fs(e){switch(e){case`top`:return`flex-start`;case`bottom`:return`flex-end`;default:return}}function ps(e){if(e===`top`||e===`bottom`)return`0 0 calc(100% - var(--drawer-offset, 0rem) * 2)`}var ms={top:`slide-down`,bottom:`slide-up`,left:`slide-right`,right:`slide-left`},hs={top:`slide-down`,bottom:`slide-up`,right:`slide-right`,left:`slide-left`},gs={closeOnClickOutside:!0,withinPortal:!0,lockScroll:!0,trapFocus:!0,returnFocus:!0,closeOnEscape:!0,keepMounted:!1,zIndex:ft(`modal`),position:`left`},_s=D((e,{position:t,size:n,offset:r})=>({root:{"--drawer-size":ve(n,`drawer-size`),"--drawer-flex":ps(t),"--drawer-height":t===`left`||t===`right`?void 0:`var(--drawer-size)`,"--drawer-align":fs(t),"--drawer-justify":t===`right`?`flex-end`:void 0,"--drawer-offset":M(r)}})),vs=w(e=>{let t=v(`DrawerRoot`,gs,e),{classNames:n,className:r,style:i,styles:a,unstyled:o,vars:s,scrollAreaComponent:l,position:u,transitionProps:d,radius:f,attributes:p,...m}=t,{dir:h}=jt(),g=c({name:`Drawer`,classes:os,props:t,className:r,style:i,classNames:n,styles:a,unstyled:o,attributes:p,vars:s,varsResolver:_s}),_=(h===`rtl`?hs:ms)[u];return(0,P.jsx)(is,{value:{scrollAreaComponent:l,getStyles:g,radius:f},children:(0,P.jsx)(Ba,{...g(`root`),transitionProps:{transition:_,...d},"data-offset-scrollbars":l===wt.Autosize||void 0,unstyled:o,...m})})});vs.classes=os,vs.varsResolver=_s,vs.displayName=`@mantine/core/DrawerRoot`;var ys=(0,N.createContext)(null);function bs({children:e}){let[t,n]=(0,N.useState)([]),[r,i]=(0,N.useState)(ft(`modal`)),[a]=(0,N.useState)(()=>new WeakSet);return(0,P.jsx)(ys,{value:{stack:t,addModal:(e,t)=>{n(t=>[...new Set([...t,e])]),i(e=>typeof t==`number`&&typeof e==`number`?Math.max(e,t):e)},removeModal:e=>n(t=>t.filter(t=>t!==e)),getZIndex:e=>`calc(${r} + ${t.indexOf(e)} + 1)`,currentId:t[t.length-1],maxZIndex:r,handledEscapeEvents:a},children:e})}bs.displayName=`@mantine/core/DrawerStack`;var xs=w(e=>{let{classNames:t,className:n,style:r,styles:i,vars:a,...o}=v(`DrawerTitle`,null,e),s=as();return(0,P.jsx)(Za,{...s.getStyles(`title`,{classNames:t,style:r,styles:i,className:n}),...o})});xs.classes=os,xs.displayName=`@mantine/core/DrawerTitle`;var Ss={closeOnClickOutside:!0,withinPortal:!0,lockScroll:!0,trapFocus:!0,returnFocus:!0,closeOnEscape:!0,keepMounted:!1,zIndex:ft(`modal`),withOverlay:!0,withCloseButton:!0},Cs=w(e=>{let{title:t,withOverlay:n,overlayProps:r,withCloseButton:i,closeButtonProps:a,children:o,opened:s,stackId:c,zIndex:l,...u}=v(`Drawer`,Ss,e),d=(0,N.use)(ys),f=!!t||i,p=d&&c?{closeOnEscape:d.currentId===c,trapFocus:d.currentId===c,zIndex:d.getZIndex(c),__handledEscapeEvents:d.handledEscapeEvents}:{},m=n===!1?!1:c&&d?d.currentId===c:s;return(0,N.useEffect)(()=>{d&&c&&(s?d.addModal(c,l||ft(`modal`)):d.removeModal(c))},[s,c,l]),(0,P.jsxs)(vs,{opened:s,zIndex:d&&c?d.getZIndex(c):l,...u,...p,children:[n&&(0,P.jsx)(ds,{visible:m,transitionProps:d&&c?{duration:0}:void 0,...r}),(0,P.jsxs)(ls,{__hidden:d&&c&&s?c!==d.currentId:!1,children:[f&&(0,P.jsxs)(us,{children:[t&&(0,P.jsx)(xs,{children:t}),i&&(0,P.jsx)(cs,{...a})]}),(0,P.jsx)(ss,{children:o})]})]})});Cs.classes=os,Cs.displayName=`@mantine/core/Drawer`,Cs.Root=vs,Cs.Overlay=ds,Cs.Content=ls,Cs.Body=ss,Cs.Header=us,Cs.Title=xs,Cs.CloseButton=cs,Cs.Stack=bs;var ws={root:`m_dc6f14e2`},Ts=D((e,{size:t})=>({root:{"--kbd-fz":ve(t,`kbd-fz`)}})),Es=w(e=>{let t=v(`Kbd`,null,e),{classNames:n,className:r,style:i,styles:a,unstyled:o,vars:s,attributes:l,...d}=t,f=c({name:`Kbd`,classes:ws,props:t,className:r,style:i,classNames:n,styles:a,unstyled:o,attributes:l,vars:s,varsResolver:Ts});return(0,P.jsx)(u,{component:`kbd`,...f(`root`),...d})});Es.classes=ws,Es.varsResolver=Ts,Es.displayName=`@mantine/core/Kbd`;var[Ds,Os]=dt(`Menu component was not found in the tree`),ks=(0,N.createContext)(null);function As(e){let{value:t,defaultValue:n,onChange:r,children:i}=v(`MenuCheckboxGroup`,null,e),[a,o]=Er({value:t,defaultValue:n,finalValue:[],onChange:r}),s=(0,N.useCallback)(e=>{o(a.includes(e)?a.filter(t=>t!==e):[...a,e])},[a,o]);return(0,P.jsx)(ks,{value:{values:a,onChange:s},children:i})}As.displayName=`@mantine/core/MenuCheckboxGroup`;var js=(0,N.createContext)(null);function Ms({role:e,checked:t,indicator:n,onSelect:r,color:i,closeMenuOnClick:a,rightSection:o,children:s,disabled:c,dataDisabled:l,className:u,style:d,styles:f,classNames:p,buttonRef:m,others:h}){let g=Os(),_=(0,N.use)(js),v=b(),{dir:y}=jt(),x=(0,N.useRef)(null),S=or(h.onClick,()=>{l||(r(),a&&g.closeDropdownImmediately())}),w=or(h.onMouseMove,()=>{if(!g.hasSearch)return;let e=x.current?.closest(`[data-menu-dropdown]`);e&&e.querySelectorAll(`[data-menu-active]`).forEach(t=>{t!==x.current&&t.closest(`[data-menu-dropdown]`)===e&&t.removeAttribute(`data-menu-active`)})}),T=or(h.onKeyDown,e=>{e.key===`ArrowLeft`&&_&&(_.close(),_.focusParentItem())}),ee=i?v.variantColorResolver({color:i,theme:v,variant:`light`}):void 0,E=i?Ce({color:i,theme:v}):null,D=g.alignItemsLabels!==`none`||t;return(0,P.jsxs)(C,{onMouseDown:e=>e.preventDefault(),...h,unstyled:g.unstyled,tabIndex:g.menuItemTabIndex,...g.getStyles(`item`,{className:u,style:d,styles:f,classNames:p}),ref:Oe(x,m),role:e,"aria-checked":t,disabled:c,"data-menu-item":!0,"data-checked":t||void 0,"data-disabled":c||l||void 0,"data-mantine-stop-propagation":!0,onClick:S,onMouseMove:w,onKeyDown:rr({siblingSelector:`[data-menu-item]:not([data-disabled])`,parentSelector:`[data-menu-dropdown]`,activateOnFocus:!1,loop:g.loop,dir:y,orientation:`vertical`,onKeyDown:T}),__vars:{"--menu-item-color":E?.isThemeColor&&E?.shade===void 0?`var(--mantine-color-${E.color}-6)`:ee?.color,"--menu-item-hover":ee?.hover},children:[D&&(0,P.jsx)(`div`,{...g.getStyles(`itemIndicator`,{styles:f,classNames:p}),"data-checked":t||void 0,children:t?n:null}),s&&(0,P.jsx)(`div`,{...g.getStyles(`itemLabel`,{styles:f,classNames:p}),"data-menu-item-label":!0,children:s}),o&&(0,P.jsx)(`div`,{...g.getStyles(`itemSection`,{styles:f,classNames:p}),"data-position":`right`,children:o})]})}var Ns={dropdown:`m_dc9b7c9f`,label:`m_9bfac126`,divider:`m_efdf90cb`,item:`m_99ac2aa1`,search:`m_ef8769b6`,itemLabel:`m_5476e0d3`,itemIndicator:`m_8395186e`,itemSection:`m_8b75e504`,chevron:`m_b85b0bed`},Ps=w(e=>{let{classNames:t,className:n,style:r,styles:i,vars:a,color:o,closeMenuOnClick:s,rightSection:c,children:l,disabled:u,"data-disabled":d,value:f,checked:p,defaultChecked:m,onChange:h,checkIcon:g,ref:_,...y}=v(`MenuCheckboxItem`,null,e),b=Os(),x=(0,N.use)(ks),S=x&&f!==void 0?x.values.includes(f):void 0,[C,w]=Er({value:p??S,defaultValue:m,finalValue:!1,onChange:h}),T=g??b.checkIcon??(0,P.jsx)(Vo,{size:10});return(0,P.jsx)(Ms,{role:`menuitemcheckbox`,checked:C,indicator:T,onSelect:()=>{h?w(!C):x&&f!==void 0?x.onChange(f):w(!C)},color:o,closeMenuOnClick:s,rightSection:c,disabled:u,dataDisabled:d,className:n,style:r,styles:i,classNames:t,buttonRef:_,others:y,children:l})});Ps.classes=Ns,Ps.displayName=`@mantine/core/MenuCheckboxItem`;function Fs(e){let{children:t,disabled:n,longPressDelay:r}=v(`MenuContextMenu`,null,e),i=te(t);if(!i)throw Error(`Menu.ContextMenu component children should be an element or a component that accepts ref. Fragments, strings, numbers and other primitive values are not supported`);let a=Os(),o=fi(),s=pi({childProps:i.props,disabled:n||o.disabled,opened:a.opened,longPressDelay:r,setReference:o.reference,open:()=>a.openDropdown()});return(0,N.cloneElement)(i,s)}Fs.displayName=`@mantine/core/MenuContextMenu`;var Is=w(e=>{let{classNames:t,className:n,style:r,styles:i,vars:a,...o}=v(`MenuDivider`,null,e),s=Os();return(0,P.jsx)(u,{...s.getStyles(`divider`,{className:n,style:r,styles:i,classNames:t}),...o})});Is.classes=Ns,Is.displayName=`@mantine/core/MenuDivider`;var Ls=500;function Rs(e){return((e.querySelector(`[data-menu-item-label]`)??e).textContent??``).trim().toLowerCase()}function zs(e){return e.length>1&&e.split(``).every(t=>t===e[0])}function Bs({enabled:e,opened:t,getDropdown:n}){let r=(0,N.useRef)({buffer:``,timeoutId:null});return(0,N.useEffect)(()=>{if(t&&e)return;let n=r.current;n.timeoutId!==null&&(window.clearTimeout(n.timeoutId),n.timeoutId=null),n.buffer=``},[t,e]),(0,N.useEffect)(()=>()=>{let{timeoutId:e}=r.current;e!==null&&window.clearTimeout(e)},[]),t=>{if(!e||t.defaultPrevented||t.ctrlKey||t.metaKey||t.altKey||t.key.length!==1||t.key===` `)return;let i=t.target;if(i&&(i.tagName===`INPUT`||i.tagName===`TEXTAREA`||i.tagName===`SELECT`||i.isContentEditable))return;let a=n();if(!a)return;let o=Array.from(a.querySelectorAll(`[data-menu-item]:not([data-disabled])`)).filter(e=>e.closest(`[data-menu-dropdown]`)===a);if(o.length===0)return;let s=r.current;s.buffer=(s.buffer+t.key).toLowerCase(),s.timeoutId!==null&&window.clearTimeout(s.timeoutId),s.timeoutId=window.setTimeout(()=>{s.buffer=``,s.timeoutId=null},Ls);let c=document.activeElement,l=c?o.indexOf(c):-1,u=null;if(s.buffer.length===1||zs(s.buffer)){let e=s.buffer[0],t=l+1;for(let n=0;n{let{classNames:t,className:n,style:r,styles:i,vars:a,onMouseEnter:o,onMouseLeave:s,onKeyDown:c,children:l,ref:u,...d}=v(`MenuDropdown`,null,e),f=(0,N.useRef)(null),p=Os(),m=Bs({enabled:!p.hasSearch,opened:p.opened,getDropdown:()=>f.current}),h=or(c,e=>{m(e),!(e.defaultPrevented||p.hasSearch)&&(e.key===`ArrowUp`||e.key===`ArrowDown`)&&(e.preventDefault(),f.current?.querySelectorAll(`[data-menu-item]:not(:disabled)`)[0]?.focus())}),g=or(o,()=>(p.trigger===`hover`||p.trigger===`click-hover`)&&p.openDropdown()),_=or(s,()=>(p.trigger===`hover`||p.trigger===`click-hover`)&&p.closeDropdown());return(0,P.jsxs)(Ei.Dropdown,{...d,onMouseEnter:g,onMouseLeave:_,role:`menu`,"aria-orientation":`vertical`,ref:Oe(u,f),...p.getStyles(`dropdown`,{className:n,style:r,styles:i,classNames:t,withStaticClass:!1}),tabIndex:-1,"data-menu-dropdown":!0,onKeyDown:h,children:[p.withInitialFocusPlaceholder&&!p.hasSearch&&(0,P.jsx)(`div`,{role:`presentation`,tabIndex:-1,"data-autofocus":!0,"data-mantine-stop-propagation":!0,style:{outline:0}}),l]})});Vs.classes=Ns,Vs.displayName=`@mantine/core/MenuDropdown`;var Hs=Me(e=>{let{classNames:t,className:n,style:r,styles:i,vars:a,color:o,closeMenuOnClick:s,leftSection:c,rightSection:l,children:u,disabled:d,"data-disabled":f,ref:p,...m}=v(`MenuItem`,null,e),h=Os(),g=(0,N.use)(js),_=b(),{dir:y}=jt(),x=(0,N.useRef)(null),S=m,w=or(S.onClick,()=>{f||(typeof s==`boolean`?s&&h.closeDropdownImmediately():h.closeOnItemClick&&h.closeDropdownImmediately())}),T=or(S.onMouseMove,()=>{if(!h.hasSearch)return;let e=x.current?.closest(`[data-menu-dropdown]`);e&&e.querySelectorAll(`[data-menu-active]`).forEach(t=>{t!==x.current&&t.closest(`[data-menu-dropdown]`)===e&&t.removeAttribute(`data-menu-active`)})}),ee=o?_.variantColorResolver({color:o,theme:_,variant:`light`}):void 0,E=o?Ce({color:o,theme:_}):null,D=or(S.onKeyDown,e=>{e.key===`ArrowLeft`&&g&&(g.close(),g.focusParentItem())});return(0,P.jsxs)(C,{onMouseDown:e=>e.preventDefault(),...m,unstyled:h.unstyled,tabIndex:h.menuItemTabIndex,...h.getStyles(`item`,{className:n,style:r,styles:i,classNames:t}),ref:Oe(x,p),role:`menuitem`,disabled:d,"data-menu-item":!0,"data-disabled":d||f||void 0,"data-mantine-stop-propagation":!0,onClick:w,onMouseMove:T,onKeyDown:rr({siblingSelector:`[data-menu-item]:not([data-disabled])`,parentSelector:`[data-menu-dropdown]`,activateOnFocus:!1,loop:h.loop,dir:y,orientation:`vertical`,onKeyDown:D}),__vars:{"--menu-item-color":E?.isThemeColor&&E?.shade===void 0?`var(--mantine-color-${E.color}-6)`:ee?.color,"--menu-item-hover":ee?.hover},children:[h.alignItemsLabels===`all`&&(0,P.jsx)(`div`,{...h.getStyles(`itemIndicator`,{styles:i,classNames:t}),"data-placeholder":!0}),c&&(0,P.jsx)(`div`,{...h.getStyles(`itemSection`,{styles:i,classNames:t}),"data-position":`left`,children:c}),u&&(0,P.jsx)(`div`,{...h.getStyles(`itemLabel`,{styles:i,classNames:t}),"data-menu-item-label":!0,children:u}),l&&(0,P.jsx)(`div`,{...h.getStyles(`itemSection`,{styles:i,classNames:t}),"data-position":`right`,children:l})]})});Hs.classes=Ns,Hs.displayName=`@mantine/core/MenuItem`;var Us=w(e=>{let{classNames:t,className:n,style:r,styles:i,vars:a,...o}=v(`MenuLabel`,null,e),s=Os();return(0,P.jsx)(u,{...s.getStyles(`label`,{className:n,style:r,styles:i,classNames:t}),...o})});Us.classes=Ns,Us.displayName=`@mantine/core/MenuLabel`;var Ws=(0,N.createContext)(null);function Gs(e){let{value:t,defaultValue:n,onChange:r,children:i}=v(`MenuRadioGroup`,null,e),[a,o]=Er({value:t,defaultValue:n,finalValue:null,onChange:r});return(0,P.jsx)(Ws,{value:{value:a,onChange:e=>o(e)},children:i})}Gs.displayName=`@mantine/core/MenuRadioGroup`;function Ks({size:e,style:t,...n}){return(0,P.jsx)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,fill:`none`,viewBox:`0 0 5 5`,style:{width:M(e),height:M(e),...t},"aria-hidden":!0,...n,children:(0,P.jsx)(`circle`,{cx:`2.5`,cy:`2.5`,r:`2.5`,fill:`currentColor`})})}var qs=w(e=>{let{classNames:t,className:n,style:r,styles:i,vars:a,color:o,closeMenuOnClick:s,rightSection:c,children:l,disabled:u,"data-disabled":d,value:f,checked:p,onChange:m,checkIcon:h,ref:g,..._}=v(`MenuRadioItem`,null,e),y=Os(),b=(0,N.use)(Ws),x=p??(b?b.value===f:!1),S=h??y.checkIcon??(0,P.jsx)(Ks,{size:5});return(0,P.jsx)(Ms,{role:`menuitemradio`,checked:x,indicator:S,onSelect:()=>{x||(m?m(f):b&&b.onChange(f))},color:o,closeMenuOnClick:s,rightSection:c,disabled:u,dataDisabled:d,className:n,style:r,styles:i,classNames:t,buttonRef:g,others:_,children:l})});qs.classes=Ns,qs.displayName=`@mantine/core/MenuRadioItem`;var Js=`[data-menu-item]:not([data-disabled])`,Ys=`[data-menu-active]`;function Xs(e){return e?.closest(`[data-menu-dropdown]`)}function Zs(e){return e?Array.from(e.querySelectorAll(Js)).filter(t=>t.closest(`[data-menu-dropdown]`)===e):[]}function Qs(e){e&&e.querySelectorAll(Ys).forEach(t=>{t.closest(`[data-menu-dropdown]`)===e&&t.removeAttribute(`data-menu-active`)})}function $s(e,t){Qs(t),e&&(e.setAttribute(`data-menu-active`,`true`),e.scrollIntoView({block:`nearest`}))}function ec(e){return e.findIndex(e=>e.hasAttribute(`data-menu-active`))}var tc={clearSearchOnClose:!0},nc=w(e=>{let{classNames:t,styles:n,onKeyDown:r,onChange:i,size:a,clearSearchOnClose:o,ref:s,...c}=v(`MenuSearch`,tc,e),l=Os(),u=(0,N.useRef)(null),d=Oe(s,u),f=(0,N.useRef)(i);f.current=i,(0,N.useEffect)(()=>l.registerSearch(),[l.registerSearch]),(0,N.useEffect)(()=>{o?l.searchExitClearRef.current=()=>{f.current?.({currentTarget:{value:``}})}:l.searchExitClearRef.current=null},[o,l.searchExitClearRef]),(0,N.useEffect)(()=>{l.opened||Qs(Xs(u.current))},[l.opened]);let p=or(i,e=>{Qs(Xs(e.currentTarget))}),m=or(r,e=>{if(e.defaultPrevented)return;let t=Xs(e.currentTarget),n=Zs(t);if(e.key===`ArrowDown`){if(e.preventDefault(),n.length===0)return;let r=ec(n);$s(n[r>=n.length-1?l.loop?0:r:r+1]??null,t)}else if(e.key===`ArrowUp`){if(e.preventDefault(),n.length===0)return;let r=ec(n);$s(n[r<=0?r===-1||l.loop?n.length-1:0:r-1]??null,t)}else if(e.key===`Home`)e.preventDefault(),n.length>0&&$s(n[0],t);else if(e.key===`End`)e.preventDefault(),n.length>0&&$s(n[n.length-1],t);else if(e.key===`Enter`){if(e.nativeEvent.isComposing||e.nativeEvent.keyCode===229)return;let t=n[ec(n)];t&&(e.preventDefault(),t.hasAttribute(`data-sub-menu-item`)?(t.focus(),t.dispatchEvent(new KeyboardEvent(`keydown`,{key:`ArrowRight`,bubbles:!0}))):t.click())}}),h=l.getStyles(`search`);return(0,P.jsx)(de,{"data-autofocus":!0,"data-mantine-stop-propagation":!0,type:`search`,size:a,...c,ref:d,classNames:[{input:h.className},t],styles:[{input:h.style},n],onKeyDown:m,onChange:p,__staticSelector:`Menu`})});nc.classes=Ns,nc.displayName=`@mantine/core/MenuSearch`;var rc=w(e=>{let{classNames:t,className:n,style:r,styles:i,vars:a,onMouseEnter:o,onMouseLeave:s,onPointerEnter:c,onPointerLeave:l,onKeyDown:u,children:d,ref:f,...p}=v(`MenuSubDropdown`,null,e),m=(0,N.useRef)(null),h=Os(),g=(0,N.use)(js),_=Bs({enabled:!h.hasSearch,opened:g?.opened??!1,getDropdown:()=>m.current}),y=or(u,e=>{_(e),!e.ctrlKey&&!e.metaKey&&!e.altKey&&e.key.length===1&&e.key!==` `&&e.stopPropagation()}),b=g?.getFloatingProps({onMouseEnter:o,onMouseLeave:s,onPointerEnter:c,onPointerLeave:l});return(0,P.jsx)(Ei.Dropdown,{...p,...b,role:`menu`,"aria-orientation":`vertical`,ref:Oe(f,m,g?.setFloating),...h.getStyles(`dropdown`,{className:n,style:r,styles:i,classNames:t,withStaticClass:!1}),tabIndex:-1,"data-menu-dropdown":!0,onKeyDown:y,children:d})});rc.classes=Ns,rc.displayName=`@mantine/core/MenuSubDropdown`;var ic=Me(e=>{let{classNames:t,className:n,style:r,styles:i,vars:a,color:o,leftSection:s,rightSection:c,children:l,disabled:u,"data-disabled":d,closeMenuOnClick:f,ref:p,...m}=v(`MenuSubItem`,null,e),h=Os(),g=(0,N.use)(js),_=b(),{dir:y}=jt(),x=(0,N.useRef)(null),S=m,w=o?_.variantColorResolver({color:o,theme:_,variant:`light`}):void 0,T=o?Ce({color:o,theme:_}):null,ee=or(S.onKeyDown,e=>{e.key===`ArrowRight`&&(g?.open(),g?.focusFirstItem()),e.key===`ArrowLeft`&&g?.parentContext&&(g.parentContext.close(),g.parentContext.focusParentItem())}),E=or(S.onClick,()=>{!d&&f&&h.closeDropdownImmediately()}),D=or(S.onMouseMove,()=>{if(!h.hasSearch)return;let e=x.current?.closest(`[data-menu-dropdown]`);e&&e.querySelectorAll(`[data-menu-active]`).forEach(t=>{t!==x.current&&t.closest(`[data-menu-dropdown]`)===e&&t.removeAttribute(`data-menu-active`)})}),O=g?.getReferenceProps({onMouseEnter:S.onMouseEnter,onMouseLeave:S.onMouseLeave,onPointerEnter:S.onPointerEnter,onPointerLeave:S.onPointerLeave});return(0,P.jsxs)(C,{onMouseDown:e=>e.preventDefault(),...m,...O,unstyled:h.unstyled,tabIndex:h.menuItemTabIndex,...h.getStyles(`item`,{className:n,style:r,styles:i,classNames:t}),ref:Oe(x,p,g?.setReference),role:`menuitem`,disabled:u,"data-menu-item":!0,"data-sub-menu-item":!0,"data-disabled":u||d||void 0,"data-mantine-stop-propagation":!0,onClick:E,onMouseMove:D,onKeyDown:rr({siblingSelector:`[data-menu-item]:not([data-disabled])`,parentSelector:`[data-menu-dropdown]`,activateOnFocus:!1,loop:h.loop,dir:y,orientation:`vertical`,onKeyDown:ee}),__vars:{"--menu-item-color":T?.isThemeColor&&T?.shade===void 0?`var(--mantine-color-${T.color}-6)`:w?.color,"--menu-item-hover":w?.hover},children:[h.alignItemsLabels===`all`&&(0,P.jsx)(`div`,{...h.getStyles(`itemIndicator`,{styles:i,classNames:t}),"data-placeholder":!0}),s&&(0,P.jsx)(`div`,{...h.getStyles(`itemSection`,{styles:i,classNames:t}),"data-position":`left`,children:s}),l&&(0,P.jsx)(`div`,{...h.getStyles(`itemLabel`,{styles:i,classNames:t}),"data-menu-item-label":!0,children:l}),(0,P.jsx)(`div`,{...h.getStyles(`itemSection`,{styles:i,classNames:t}),"data-position":`right`,children:c||(0,P.jsx)($a,{...h.getStyles(`chevron`),size:14})})]})});ic.classes=Ns,ic.displayName=`@mantine/core/MenuSubItem`;function ac({children:e,refProp:t}){if(!ce(e))throw Error(`Menu.Sub.Target component children should be an element or a component that accepts ref. Fragments, strings, numbers and other primitive values are not supported`);return Os(),(0,P.jsx)(Ei.Target,{refProp:t,popupType:`menu`,children:e})}ac.displayName=`@mantine/core/MenuSubTarget`;var oc={offset:0,position:`right-start`,safeAreaPolygon:!0,transitionProps:{duration:0},openDelay:0,middlewares:{shift:{crossAxis:!0}}};function sc(e){let{children:t,closeDelay:n,openDelay:r,position:i,safeAreaPolygon:a,opened:o,onChange:s,...c}=v(`MenuSub`,oc,e),l=ye(),[u,d]=Er({value:o,finalValue:!1,onChange:s}),f=(0,N.use)(js),p=Os(),{dir:m}=jt(),h=Et(m,i),g=f?.registerOpenSub??p.registerOpenSub,_=(0,N.useRef)(null),y=(0,N.useCallback)(e=>{let t=_.current;return t&&t!==e&&t(),_.current=e,()=>{_.current===e&&(_.current=null)}},[]),b=(0,N.useRef)(d);b.current=d;let x=(0,N.useCallback)(()=>b.current(!0),[]),S=(0,N.useCallback)(()=>b.current(!1),[]);(0,N.useEffect)(()=>{if(u)return g(S)},[u,g,S]);let{context:C,refs:w}=ht({placement:h,open:u,onOpenChange:e=>{e?x():S()}}),{getReferenceProps:T,getFloatingProps:ee}=kt([xt(C,{handleClose:a?Dt(typeof a==`object`?a:void 0):void 0,delay:{open:r,close:n}})]);return(0,P.jsx)(js,{value:{opened:u,close:S,open:x,focusFirstItem:()=>window.setTimeout(()=>{document.getElementById(`${l}-dropdown`)?.querySelectorAll(`[data-menu-item]:not([data-disabled])`)[0]?.focus()},16),focusParentItem:()=>window.setTimeout(()=>{document.getElementById(`${l}-target`)?.focus()},16),parentContext:f,setReference:w.setReference,setFloating:w.setFloating,getReferenceProps:T,getFloatingProps:ee,registerOpenSub:y},children:(0,P.jsx)(Ei,{opened:u,onChange:e=>e?x():S(),withArrow:!1,id:l,position:i,...c,withinPortal:!1,children:t})})}sc.extend=e=>e,sc.displayName=`@mantine/core/MenuSub`,sc.Target=ac,sc.Dropdown=rc,sc.Item=ic;var cc={refProp:`ref`};function lc(e){let{children:t,refProp:n,...r}=v(`MenuTarget`,cc,e),i=te(t);if(!i)throw Error(`Menu.Target component children should be an element or a component that accepts ref. Fragments, strings, numbers and other primitive values are not supported`);let a=Os(),o=i.props,s=or(o.onClick,()=>{a.trigger===`click`?a.toggleDropdown():a.trigger===`click-hover`&&(a.setOpenedViaClick(!0),a.opened||a.openDropdown())}),c=or(o.onMouseEnter,()=>(a.trigger===`hover`||a.trigger===`click-hover`)&&a.openDropdown()),l=or(o.onMouseLeave,()=>{(a.trigger===`hover`||a.trigger===`click-hover`&&!a.openedViaClick)&&a.closeDropdown()});return(0,P.jsx)(Ei.Target,{refProp:n,popupType:`menu`,...r,children:(0,N.cloneElement)(i,{onClick:s,onMouseEnter:c,onMouseLeave:l,"data-expanded":a.opened?!0:void 0})})}lc.displayName=`@mantine/core/MenuTarget`;var uc={trapFocus:!0,closeOnItemClick:!0,withInitialFocusPlaceholder:!0,clickOutsideEvents:[`mousedown`,`touchstart`,`keydown`],loop:!0,trigger:`click`,openDelay:0,closeDelay:100,menuItemTabIndex:-1,alignItemsLabels:`with-indicators`},dc=w(e=>{let t=v(`Menu`,uc,e),{children:n,onOpen:r,onClose:i,opened:a,defaultOpened:o,trapFocus:s,onChange:l,closeOnItemClick:u,loop:d,closeOnEscape:f,trigger:p,openDelay:m,closeDelay:h,classNames:g,styles:_,unstyled:y,variant:b,vars:x,menuItemTabIndex:S,keepMounted:C,withInitialFocusPlaceholder:w,attributes:T,onExitTransitionEnd:ee,alignItemsLabels:E,checkIcon:D,...O}=t,te=c({name:`Menu`,classes:Ns,props:t,classNames:g,styles:_,unstyled:y,attributes:T}),[ne,re]=Er({value:a,defaultValue:o,finalValue:!1,onChange:l}),[k,ie]=(0,N.useState)(!1),ae=()=>{re(!1),ie(!1),ne&&i?.()},A=()=>{re(!0),!ne&&r?.()},oe=()=>{ne?ae():A()},{openDropdown:se,closeDropdown:ce}=oi({open:A,close:ae,closeDelay:h,openDelay:m}),le=(0,N.useRef)(null),ue=(0,N.useCallback)(e=>{let t=le.current;return t&&t!==e&&t(),le.current=e,()=>{le.current===e&&(le.current=null)}},[]),de=(0,N.useRef)(0),[fe,pe]=(0,N.useState)(!1),me=(0,N.useCallback)(()=>(de.current+=1,de.current===1&&pe(!0),()=>{--de.current,de.current===0&&pe(!1)}),[]),ge=(0,N.useRef)(null),_e=()=>{ge.current?.(),ee?.()},ve=e=>lr(`[data-menu-item]`,`[data-menu-dropdown]`,e),{resolvedClassNames:j,resolvedStyles:M}=he({classNames:g,styles:_,props:t});return(0,P.jsx)(Ds,{value:{getStyles:te,opened:ne,toggleDropdown:oe,getItemIndex:ve,openedViaClick:k,setOpenedViaClick:ie,closeOnItemClick:u,closeDropdown:p===`click`?ae:ce,openDropdown:p===`click`?A:se,closeDropdownImmediately:ae,loop:d,trigger:p,unstyled:y,menuItemTabIndex:S,withInitialFocusPlaceholder:w,registerOpenSub:ue,hasSearch:fe,registerSearch:me,searchExitClearRef:ge,alignItemsLabels:E,checkIcon:D},children:(0,P.jsx)(Ei,{returnFocus:!0,...O,opened:ne,onChange:oe,defaultOpened:o,trapFocus:!C&&s,closeOnEscape:f,__staticSelector:`Menu`,classNames:j,styles:M,unstyled:y,variant:b,keepMounted:C,onExitTransitionEnd:_e,children:n})})});dc.displayName=`@mantine/core/Menu`,dc.classes=Ns,dc.Item=Hs,dc.Label=Us,dc.Dropdown=Vs,dc.Target=lc,dc.Divider=Is,dc.Search=nc,dc.Sub=sc,dc.CheckboxItem=Ps,dc.CheckboxGroup=As,dc.RadioItem=qs,dc.RadioGroup=Gs,dc.ContextMenu=Fs;var[fc,pc]=dt(`Modal component was not found in tree`),mc={root:`m_9df02822`,content:`m_54c44539`,inner:`m_1f958f16`,header:`m_d0e2b9cd`},hc=w(e=>{let{classNames:t,className:n,style:r,styles:i,vars:a,...o}=v(`ModalBody`,null,e),s=pc();return(0,P.jsx)(Ua,{...s.getStyles(`body`,{classNames:t,style:r,styles:i,className:n}),...o})});hc.classes=mc,hc.displayName=`@mantine/core/ModalBody`;var gc=w(e=>{let{classNames:t,className:n,style:r,styles:i,vars:a,...o}=v(`ModalCloseButton`,null,e),s=pc();return(0,P.jsx)(Wa,{...s.getStyles(`close`,{classNames:t,style:r,styles:i,className:n}),...o})});gc.classes=mc,gc.displayName=`@mantine/core/ModalCloseButton`;var _c=w(e=>{let{classNames:t,className:n,style:r,styles:i,vars:a,children:o,__hidden:s,...c}=v(`ModalContent`,null,e),l=pc(),u=l.scrollAreaComponent||Qa;return(0,P.jsx)(Ga,{...l.getStyles(`content`,{className:n,style:r,styles:i,classNames:t}),innerProps:l.getStyles(`inner`,{className:n,style:r,styles:i,classNames:t}),"data-full-screen":l.fullScreen||void 0,"data-modal-content":!0,"data-hidden":s||void 0,...c,children:(0,P.jsx)(u,{style:{maxHeight:l.fullScreen?`100dvh`:`calc(100dvh - (${M(l.yOffset)} * 2))`},children:o})})});_c.classes=mc,_c.displayName=`@mantine/core/ModalContent`;var vc=w(e=>{let{classNames:t,className:n,style:r,styles:i,vars:a,...o}=v(`ModalHeader`,null,e),s=pc();return(0,P.jsx)(Ka,{...s.getStyles(`header`,{classNames:t,style:r,styles:i,className:n}),...o})});vc.classes=mc,vc.displayName=`@mantine/core/ModalHeader`;var yc=w(e=>{let{classNames:t,className:n,style:r,styles:i,vars:a,...o}=v(`ModalOverlay`,null,e),s=pc();return(0,P.jsx)(Ya,{...s.getStyles(`overlay`,{classNames:t,style:r,styles:i,className:n}),...o})});yc.classes=mc,yc.displayName=`@mantine/core/ModalOverlay`;var bc={__staticSelector:`Modal`,closeOnClickOutside:!0,withinPortal:!0,lockScroll:!0,trapFocus:!0,returnFocus:!0,closeOnEscape:!0,keepMounted:!1,zIndex:ft(`modal`),transitionProps:{duration:200,transition:`fade-down`},yOffset:`5dvh`},xc=D((e,{radius:t,size:n,yOffset:r,xOffset:i})=>({root:{"--modal-radius":t===void 0?void 0:Ee(t),"--modal-size":ve(n,`modal-size`),"--modal-y-offset":M(r),"--modal-x-offset":M(i)}})),Sc=w(e=>{let t=v(`ModalRoot`,bc,e),{classNames:n,className:r,style:i,styles:a,unstyled:o,vars:s,yOffset:l,scrollAreaComponent:u,radius:d,fullScreen:f,centered:p,xOffset:m,__staticSelector:h,attributes:g,..._}=t,y=c({name:h,classes:mc,props:t,className:r,style:i,classNames:n,styles:a,unstyled:o,attributes:g,vars:s,varsResolver:xc});return(0,P.jsx)(fc,{value:{yOffset:l,scrollAreaComponent:u,getStyles:y,fullScreen:f},children:(0,P.jsx)(Ba,{...y(`root`),"data-full-screen":f||void 0,"data-centered":p||void 0,"data-offset-scrollbars":u===wt.Autosize||void 0,unstyled:o,..._})})});Sc.classes=mc,Sc.varsResolver=xc,Sc.displayName=`@mantine/core/ModalRoot`;var Cc=(0,N.createContext)(null);function wc({children:e}){let[t,n]=(0,N.useState)([]),[r,i]=(0,N.useState)(ft(`modal`)),[a]=(0,N.useState)(()=>new WeakSet);return(0,P.jsx)(Cc,{value:{stack:t,addModal:(e,t)=>{n(t=>[...new Set([...t,e])]),i(e=>typeof t==`number`&&typeof e==`number`?Math.max(e,t):e)},removeModal:e=>n(t=>t.filter(t=>t!==e)),getZIndex:e=>`calc(${r} + ${t.indexOf(e)} + 1)`,currentId:t[t.length-1],maxZIndex:r,handledEscapeEvents:a},children:e})}wc.displayName=`@mantine/core/ModalStack`;var Tc=w(e=>{let{classNames:t,className:n,style:r,styles:i,vars:a,...o}=v(`ModalTitle`,null,e),s=pc();return(0,P.jsx)(Za,{...s.getStyles(`title`,{classNames:t,style:r,styles:i,className:n}),...o})});Tc.classes=mc,Tc.displayName=`@mantine/core/ModalTitle`;var Ec={closeOnClickOutside:!0,withinPortal:!0,lockScroll:!0,trapFocus:!0,returnFocus:!0,closeOnEscape:!0,keepMounted:!1,zIndex:ft(`modal`),transitionProps:{duration:200,transition:`fade-down`},withOverlay:!0,withCloseButton:!0},Dc=w(e=>{let{title:t,withOverlay:n,overlayProps:r,withCloseButton:i,closeButtonProps:a,children:o,radius:s,opened:c,stackId:l,zIndex:u,...d}=v(`Modal`,Ec,e),f=(0,N.use)(Cc),p=!!t||i,m=f&&l?{closeOnEscape:f.currentId===l,trapFocus:f.currentId===l,zIndex:f.getZIndex(l),__handledEscapeEvents:f.handledEscapeEvents}:{},h=n===!1?!1:l&&f?f.currentId===l:c;return(0,N.useEffect)(()=>{f&&l&&(c?f.addModal(l,u||ft(`modal`)):f.removeModal(l))},[c,l,u]),(0,P.jsxs)(Sc,{radius:s,opened:c,zIndex:f&&l?f.getZIndex(l):u,...d,...m,children:[n&&(0,P.jsx)(yc,{visible:h,transitionProps:f&&l?{duration:0}:void 0,...r}),(0,P.jsxs)(_c,{radius:s,__hidden:f&&l&&c?l!==f.currentId:!1,children:[p&&(0,P.jsxs)(vc,{children:[t&&(0,P.jsx)(Tc,{children:t}),i&&(0,P.jsx)(gc,{...a})]}),(0,P.jsx)(hc,{children:o})]})]})});Dc.classes=mc,Dc.displayName=`@mantine/core/Modal`,Dc.Root=Sc,Dc.Overlay=yc,Dc.Content=_c,Dc.Body=hc,Dc.Header=vc,Dc.Title=Tc,Dc.CloseButton=gc,Dc.Stack=wc;function Oc(e,t){if(e<1)return[];let n=Array(e).fill(``);if(t){let r=t.trim().split(``);for(let t=0;t({root:{"--pin-input-size":ve(t??`sm`,`pin-input-size`)}})),Nc=w(e=>{let{name:t,form:n,className:r,value:i,defaultValue:a,variant:o,gap:l,style:u,size:d,classNames:f,styles:p,unstyled:m,length:h,onChange:g,onComplete:_,manageFocus:y,autoFocus:b,error:x,success:S,radius:C,disabled:w,oneTimeCode:T,placeholder:ee,type:E,mask:D,readOnly:O,inputType:te,inputMode:re,ariaLabel:k,vars:ie,id:ae,hiddenInputProps:A,rootRef:oe,getInputProps:se,attributes:ce,ref:le,...ue}=v([`Input`,`PinInput`],jc,e),fe=ye(ae),pe=c({name:`PinInput`,classes:kc,props:e,className:r,style:u,classNames:f,styles:p,unstyled:m,attributes:ce,vars:ie,varsResolver:Mc}),{resolvedClassNames:me,resolvedStyles:ge}=he({classNames:f,styles:p,props:e}),[_e,ve]=(0,N.useState)(-1),j=(0,N.useRef)([]),M=h??4,be=(0,N.useRef)(!1),[xe,Se]=Er({value:i===void 0?void 0:Oc(M,i),defaultValue:a?.split(``).slice(0,M),finalValue:Oc(M,``),onChange:e=>{let t=e.join(``).trim();g?.(t),t.length===M&&!be.current?(be.current=!0,_?.(t)):t.length(E instanceof RegExp?E:E&&E in Ac?Ac[E]:null)?.test(e),Ee=(e,t)=>{if(y){if(e===`next`){let e=t+1;e=0&&j.current[e]?.focus()}}},De=(e,t)=>{let n=[...Ce];return n[t]=e,Se(n),n},Oe=(e,t)=>{let n=e.target.value;if(n.length>1){if(n.length>2){if(Te(n)){Se(Oc(M,n));let e=Math.min(n.length,M);e{let{ctrlKey:n,metaKey:r,key:i,shiftKey:a,target:o}=e,s=o.value;if(re===`numeric`){let t=[`Backspace`,`Tab`,`Control`,`Delete`,`ArrowLeft`,`ArrowRight`],a=n||r;if(!(t.includes(i)||a||!Number.isNaN(Number(i)))){e.preventDefault();return}}switch(i){case`ArrowLeft`:e.preventDefault(),Ee(`prev`,t);break;case`ArrowRight`:e.preventDefault(),Ee(`next`,t);break;case`Tab`:a&&t>0&&y&&(e.preventDefault(),Ee(`prev`,t));break;case` `:e.preventDefault(),Ee(`next`,t);break;case`Delete`:e.preventDefault(),O||De(``,t);break;case`Backspace`:O?e.preventDefault():s===``?(e.preventDefault(),Ee(`prev`,t)):(De(``,t),t0&&i===Ce[t]&&(e.preventDefault(),Ee(`next`,t))}},Ae=(e,t)=>{e.target.select(),ve(t)},je=()=>{ve(-1)},Me=e=>{if(e.preventDefault(),O)return;let t=e.clipboardData.getData(`text/plain`).replace(/[\n\r\s]+/g,``);if(Te(t.trim())){let e=Oc(M,t);Se(e);let n=e.filter(e=>e!==``).length;n>=M?j.current[M-1]?.focus():j.current[n]?.focus()}};return(0,P.jsxs)(P.Fragment,{children:[(0,P.jsx)(ne,{...ue,...pe(`root`),ref:oe,role:`group`,id:fe,gap:l,unstyled:m,wrap:`nowrap`,variant:o,__size:d,dir:`ltr`,children:Ce.map((e,t)=>(0,N.createElement)(de,{component:`input`,...pe(`pinInput`,{style:{"--input-padding":`0`,"--input-text-align":`center`}}),classNames:me,styles:ge,size:d,__staticSelector:`PinInput`,id:`${fe}-${t+1}`,key:`${fe}-${t}`,inputMode:re||(E===`number`?`numeric`:`text`),onChange:e=>Oe(e,t),onKeyDown:e=>ke(e,t),onFocus:e=>Ae(e,t),onBlur:je,onPaste:Me,type:te||(D?`password`:E===`number`?`tel`:`text`),radius:C,error:x,success:S,variant:o,disabled:w,ref:e=>{e&&(t===0&&s(le,e),j.current[t]=e)},autoComplete:T?`one-time-code`:`off`,placeholder:_e===t?``:ee,value:e,autoFocus:b&&t===0,unstyled:m,"aria-label":k,readOnly:O,...se?.(t)}))}),(0,P.jsx)(`input`,{type:`hidden`,name:t,form:n,value:we,...A})]})});Nc.classes={...kc,...j.classes},Nc.varsResolver=Mc,Nc.displayName=`@mantine/core/PinInput`;var Pc=w(e=>{let t=v([`Input`,`InputWrapper`,`TextInput`],null,e);return(0,P.jsx)(j,{component:`input`,...t,__staticSelector:`TextInput`})});Pc.classes=j.classes,Pc.displayName=`@mantine/core/TextInput`;var Fc=[];for(let e=0;e<256;++e)Fc.push((e+256).toString(16).slice(1));function Ic(e,t=0){return(Fc[e[t+0]]+Fc[e[t+1]]+Fc[e[t+2]]+Fc[e[t+3]]+`-`+Fc[e[t+4]]+Fc[e[t+5]]+`-`+Fc[e[t+6]]+Fc[e[t+7]]+`-`+Fc[e[t+8]]+Fc[e[t+9]]+`-`+Fc[e[t+10]]+Fc[e[t+11]]+Fc[e[t+12]]+Fc[e[t+13]]+Fc[e[t+14]]+Fc[e[t+15]]).toLowerCase()}var Lc,Rc=new Uint8Array(16);function zc(){if(!Lc){if(typeof crypto>`u`||!crypto.getRandomValues)throw Error(`crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported`);Lc=crypto.getRandomValues.bind(crypto)}return Lc(Rc)}var Bc={randomUUID:typeof crypto<`u`&&crypto.randomUUID&&crypto.randomUUID.bind(crypto)};function Vc(e,t,n){if(Bc.randomUUID&&!t&&!e)return Bc.randomUUID();e||={};let r=e.random??e.rng?.()??zc();if(r.length<16)throw Error(`Random bytes length must be >= 16`);if(r[6]=r[6]&15|64,r[8]=r[8]&63|128,t){if(n||=0,n<0||n+16>t.length)throw RangeError(`UUID byte range ${n}:${n+15} is out of buffer bounds`);for(let e=0;e<16;++e)t[n+e]=r[e];return t}return Ic(r)}var Hc=It(),L=function(e){return e.TEXT_MESSAGE_START=`TEXT_MESSAGE_START`,e.TEXT_MESSAGE_CONTENT=`TEXT_MESSAGE_CONTENT`,e.TEXT_MESSAGE_END=`TEXT_MESSAGE_END`,e.TEXT_MESSAGE_CHUNK=`TEXT_MESSAGE_CHUNK`,e.TOOL_CALL_START=`TOOL_CALL_START`,e.TOOL_CALL_ARGS=`TOOL_CALL_ARGS`,e.TOOL_CALL_END=`TOOL_CALL_END`,e.TOOL_CALL_CHUNK=`TOOL_CALL_CHUNK`,e.TOOL_CALL_RESULT=`TOOL_CALL_RESULT`,e.STATE_SNAPSHOT=`STATE_SNAPSHOT`,e.STATE_DELTA=`STATE_DELTA`,e.MESSAGES_SNAPSHOT=`MESSAGES_SNAPSHOT`,e.ACTIVITY_SNAPSHOT=`ACTIVITY_SNAPSHOT`,e.ACTIVITY_DELTA=`ACTIVITY_DELTA`,e.RAW=`RAW`,e.CUSTOM=`CUSTOM`,e.RUN_STARTED=`RUN_STARTED`,e.RUN_FINISHED=`RUN_FINISHED`,e.RUN_ERROR=`RUN_ERROR`,e.STEP_STARTED=`STEP_STARTED`,e.STEP_FINISHED=`STEP_FINISHED`,e.REASONING_START=`REASONING_START`,e.REASONING_MESSAGE_START=`REASONING_MESSAGE_START`,e.REASONING_MESSAGE_CONTENT=`REASONING_MESSAGE_CONTENT`,e.REASONING_MESSAGE_END=`REASONING_MESSAGE_END`,e.REASONING_MESSAGE_CHUNK=`REASONING_MESSAGE_CHUNK`,e.REASONING_END=`REASONING_END`,e.REASONING_ENCRYPTED_VALUE=`REASONING_ENCRYPTED_VALUE`,e.SUBAGENT_STARTED=`SUBAGENT_STARTED`,e.SUBAGENT_FINISHED=`SUBAGENT_FINISHED`,e.SUBAGENT_ERROR=`SUBAGENT_ERROR`,e}({}),Uc={TextMessageStartEvent:{optional:[`timestamp`,`rawEvent`,`metadata`,`subagentRunId`,`role`,`name`],fields:{}},TextMessageContentEvent:{optional:[`timestamp`,`rawEvent`,`metadata`,`subagentRunId`],fields:{}},TextMessageEndEvent:{optional:[`timestamp`,`rawEvent`,`metadata`,`subagentRunId`],fields:{}},TextMessageChunkEvent:{optional:[`timestamp`,`rawEvent`,`metadata`,`subagentRunId`,`messageId`,`role`,`delta`,`name`],fields:{}},ToolCallStartEvent:{optional:[`timestamp`,`rawEvent`,`metadata`,`subagentRunId`,`parentMessageId`],fields:{}},ToolCallArgsEvent:{optional:[`timestamp`,`rawEvent`,`metadata`,`subagentRunId`],fields:{}},ToolCallEndEvent:{optional:[`timestamp`,`rawEvent`,`metadata`,`subagentRunId`],fields:{}},ToolCallChunkEvent:{optional:[`timestamp`,`rawEvent`,`metadata`,`subagentRunId`,`toolCallId`,`toolCallName`,`parentMessageId`,`delta`],fields:{}},TextPart:{optional:[`id`,`metadata`],fields:{}},DataSource:{optional:[],fields:{}},UrlSource:{optional:[`mimeType`],fields:{}},FileSource:{optional:[`provider`,`mimeType`],fields:{}},PartSource:{discriminator:`type`,variants:{data:`DataSource`,url:`UrlSource`,file:`FileSource`}},ImagePart:{optional:[`id`,`metadata`],fields:{source:`PartSource`}},AudioPart:{optional:[`id`,`metadata`],fields:{source:`PartSource`}},VideoPart:{optional:[`id`,`metadata`],fields:{source:`PartSource`}},DocumentPart:{optional:[`id`,`metadata`],fields:{source:`PartSource`}},ContentPart:{discriminator:`type`,variants:{text:`TextPart`,image:`ImagePart`,audio:`AudioPart`,video:`VideoPart`,document:`DocumentPart`}},ToolCallResultEvent:{optional:[`timestamp`,`rawEvent`,`metadata`,`subagentRunId`,`role`],fields:{content:{array:`ContentPart`}}},StateSnapshotEvent:{optional:[`timestamp`,`rawEvent`,`metadata`,`subagentRunId`],fields:{}},AddOperation:{optional:[],fields:{}},RemoveOperation:{optional:[],fields:{}},ReplaceOperation:{optional:[],fields:{}},MoveOperation:{optional:[],fields:{}},CopyOperation:{optional:[],fields:{}},TestOperation:{optional:[],fields:{}},JsonPatchOperation:{discriminator:`op`,variants:{add:`AddOperation`,remove:`RemoveOperation`,replace:`ReplaceOperation`,move:`MoveOperation`,copy:`CopyOperation`,test:`TestOperation`}},StateDeltaEvent:{optional:[`timestamp`,`rawEvent`,`metadata`,`subagentRunId`],fields:{delta:{array:`JsonPatchOperation`}}},DeveloperMessage:{optional:[`subagentRunId`,`name`,`encryptedValue`,`metadata`],fields:{}},SystemMessage:{optional:[`subagentRunId`,`name`,`encryptedValue`,`metadata`],fields:{}},FunctionCall:{optional:[],fields:{}},ToolCall:{optional:[`encryptedValue`,`metadata`],fields:{function:`FunctionCall`}},AssistantMessage:{optional:[`subagentRunId`,`name`,`encryptedValue`,`metadata`,`content`,`toolCalls`],fields:{toolCalls:{array:`ToolCall`}}},UserMessage:{optional:[`subagentRunId`,`name`,`encryptedValue`,`metadata`],fields:{content:{array:`ContentPart`}}},ToolMessage:{optional:[`subagentRunId`,`error`,`encryptedValue`,`metadata`],fields:{content:{array:`ContentPart`}}},ActivityMessage:{optional:[`subagentRunId`,`metadata`],fields:{}},ReasoningMessage:{optional:[`subagentRunId`,`encryptedValue`,`metadata`],fields:{}},Message:{discriminator:`role`,variants:{developer:`DeveloperMessage`,system:`SystemMessage`,assistant:`AssistantMessage`,user:`UserMessage`,tool:`ToolMessage`,activity:`ActivityMessage`,reasoning:`ReasoningMessage`}},MessagesSnapshotEvent:{optional:[`timestamp`,`rawEvent`,`metadata`],fields:{messages:{array:`Message`}}},ActivitySnapshotEvent:{optional:[`timestamp`,`rawEvent`,`metadata`,`subagentRunId`,`replace`],fields:{}},ActivityDeltaEvent:{optional:[`timestamp`,`rawEvent`,`metadata`,`subagentRunId`],fields:{patch:{array:`JsonPatchOperation`}}},RawEvent:{optional:[`timestamp`,`rawEvent`,`metadata`,`subagentRunId`,`source`],fields:{}},CustomEvent:{optional:[`timestamp`,`rawEvent`,`metadata`,`subagentRunId`],fields:{}},Tool:{optional:[`parameters`,`metadata`],fields:{}},Context:{optional:[],fields:{}},ResumeEntry:{optional:[`payload`,`metadata`],fields:{}},RunAgentInput:{optional:[`protocolVersion`,`parentRunId`,`state`,`tools`,`context`,`forwardedProps`,`resume`],fields:{messages:{array:`Message`},tools:{array:`Tool`},context:{array:`Context`},resume:{array:`ResumeEntry`}}},RunStartedEvent:{optional:[`timestamp`,`rawEvent`,`metadata`,`protocolVersion`,`parentRunId`,`input`],fields:{input:`RunAgentInput`}},RunFinishedSuccessOutcome:{optional:[`pendingToolCallIds`],fields:{}},Interrupt:{optional:[`subagentRunId`,`message`,`toolCallId`,`responseSchema`,`expiresAt`,`metadata`],fields:{}},RunFinishedInterruptOutcome:{optional:[],fields:{interrupts:{array:`Interrupt`}}},RunFinishedCancelledOutcome:{optional:[],fields:{}},RunFinishedOutcome:{discriminator:`type`,variants:{success:`RunFinishedSuccessOutcome`,interrupt:`RunFinishedInterruptOutcome`,cancelled:`RunFinishedCancelledOutcome`}},TokenUsage:{optional:[`provider`,`model`,`inputTokens`,`outputTokens`,`totalTokens`,`reasoningTokens`,`cachedInputTokens`,`cacheWriteInputTokens`],fields:{}},RunFinishedEvent:{optional:[`timestamp`,`rawEvent`,`metadata`,`result`,`outcome`,`usage`],fields:{outcome:`RunFinishedOutcome`,usage:{array:`TokenUsage`}}},RunErrorEvent:{optional:[`timestamp`,`rawEvent`,`metadata`,`code`,`usage`],fields:{usage:{array:`TokenUsage`}}},StepStartedEvent:{optional:[`timestamp`,`rawEvent`,`metadata`,`subagentRunId`],fields:{}},StepFinishedEvent:{optional:[`timestamp`,`rawEvent`,`metadata`,`subagentRunId`],fields:{}},ReasoningStartEvent:{optional:[`timestamp`,`rawEvent`,`metadata`,`subagentRunId`],fields:{}},ReasoningMessageStartEvent:{optional:[`timestamp`,`rawEvent`,`metadata`,`subagentRunId`],fields:{}},ReasoningMessageContentEvent:{optional:[`timestamp`,`rawEvent`,`metadata`,`subagentRunId`],fields:{}},ReasoningMessageEndEvent:{optional:[`timestamp`,`rawEvent`,`metadata`,`subagentRunId`],fields:{}},ReasoningMessageChunkEvent:{optional:[`timestamp`,`rawEvent`,`metadata`,`subagentRunId`,`messageId`,`delta`],fields:{}},ReasoningEndEvent:{optional:[`timestamp`,`rawEvent`,`metadata`,`subagentRunId`],fields:{}},ReasoningEncryptedValueEvent:{optional:[`timestamp`,`rawEvent`,`metadata`,`subagentRunId`],fields:{}},SubagentStartedEvent:{optional:[`timestamp`,`rawEvent`,`metadata`,`description`,`parentSubagentRunId`,`parentToolCallId`,`parentMessageId`],fields:{}},SubagentFinishedSuccessOutcome:{optional:[],fields:{}},SubagentFinishedSuspendedOutcome:{optional:[`interruptIds`],fields:{}},SubagentFinishedOutcome:{discriminator:`type`,variants:{success:`SubagentFinishedSuccessOutcome`,suspended:`SubagentFinishedSuspendedOutcome`}},SubagentFinishedEvent:{optional:[`timestamp`,`rawEvent`,`metadata`,`result`,`outcome`],fields:{outcome:`SubagentFinishedOutcome`}},SubagentErrorEvent:{optional:[`timestamp`,`rawEvent`,`metadata`,`code`],fields:{}},Event:{discriminator:`type`,variants:{TEXT_MESSAGE_START:`TextMessageStartEvent`,TEXT_MESSAGE_CONTENT:`TextMessageContentEvent`,TEXT_MESSAGE_END:`TextMessageEndEvent`,TEXT_MESSAGE_CHUNK:`TextMessageChunkEvent`,TOOL_CALL_START:`ToolCallStartEvent`,TOOL_CALL_ARGS:`ToolCallArgsEvent`,TOOL_CALL_END:`ToolCallEndEvent`,TOOL_CALL_CHUNK:`ToolCallChunkEvent`,TOOL_CALL_RESULT:`ToolCallResultEvent`,STATE_SNAPSHOT:`StateSnapshotEvent`,STATE_DELTA:`StateDeltaEvent`,MESSAGES_SNAPSHOT:`MessagesSnapshotEvent`,ACTIVITY_SNAPSHOT:`ActivitySnapshotEvent`,ACTIVITY_DELTA:`ActivityDeltaEvent`,RAW:`RawEvent`,CUSTOM:`CustomEvent`,RUN_STARTED:`RunStartedEvent`,RUN_FINISHED:`RunFinishedEvent`,RUN_ERROR:`RunErrorEvent`,STEP_STARTED:`StepStartedEvent`,STEP_FINISHED:`StepFinishedEvent`,REASONING_START:`ReasoningStartEvent`,REASONING_MESSAGE_START:`ReasoningMessageStartEvent`,REASONING_MESSAGE_CONTENT:`ReasoningMessageContentEvent`,REASONING_MESSAGE_END:`ReasoningMessageEndEvent`,REASONING_MESSAGE_CHUNK:`ReasoningMessageChunkEvent`,REASONING_END:`ReasoningEndEvent`,REASONING_ENCRYPTED_VALUE:`ReasoningEncryptedValueEvent`,SUBAGENT_STARTED:`SubagentStartedEvent`,SUBAGENT_FINISHED:`SubagentFinishedEvent`,SUBAGENT_ERROR:`SubagentErrorEvent`}},SubagentInfo:{optional:[`description`],fields:{}},IdentityCapabilities:{optional:[`name`,`type`,`description`,`version`,`provider`,`documentationUrl`,`metadata`],fields:{}},TransportCapabilities:{optional:[`streaming`,`websocket`,`httpBinary`,`pushNotifications`,`resumable`],fields:{}},ToolsCapabilities:{optional:[`supported`,`items`,`parallelCalls`,`clientProvided`],fields:{items:{array:`Tool`}}},OutputCapabilities:{optional:[`structuredOutput`,`supportedMimeTypes`],fields:{}},StateCapabilities:{optional:[`snapshots`,`deltas`,`memory`,`persistentState`],fields:{}},MultiAgentCapabilities:{optional:[`supported`,`delegation`,`handoffs`,`subagents`],fields:{subagents:{array:`SubagentInfo`}}},ReasoningCapabilities:{optional:[`supported`,`streaming`,`encrypted`],fields:{}},MultimodalInputCapabilities:{optional:[`image`,`audio`,`video`,`pdf`,`file`],fields:{}},MultimodalOutputCapabilities:{optional:[`image`,`audio`],fields:{}},MultimodalCapabilities:{optional:[`input`,`output`],fields:{input:`MultimodalInputCapabilities`,output:`MultimodalOutputCapabilities`}},ExecutionCapabilities:{optional:[`codeExecution`,`sandboxed`,`maxIterations`,`maxExecutionTime`],fields:{}},HumanInTheLoopCapabilities:{optional:[`supported`,`approvals`,`interventions`,`feedback`,`interrupts`,`approveWithEdits`],fields:{}},AgentCapabilities:{optional:[`identity`,`transport`,`tools`,`output`,`state`,`multiAgent`,`reasoning`,`multimodal`,`execution`,`humanInTheLoop`,`custom`],fields:{identity:`IdentityCapabilities`,transport:`TransportCapabilities`,tools:`ToolsCapabilities`,output:`OutputCapabilities`,state:`StateCapabilities`,multiAgent:`MultiAgentCapabilities`,reasoning:`ReasoningCapabilities`,multimodal:`MultimodalCapabilities`,execution:`ExecutionCapabilities`,humanInTheLoop:`HumanInTheLoopCapabilities`}}};function Wc(e,t){if(typeof t==`string`)return Wc(e,Uc[t]);if(`array`in t){if(!Array.isArray(e))return e;let n=e.map(e=>Wc(e,t.array));return n.every((t,n)=>t===e[n])?e:n}if(typeof e!=`object`||!e||Array.isArray(e))return e;let n=e;if(`discriminator`in t){let r=n[t.discriminator];return typeof r==`string`&&Object.prototype.hasOwnProperty.call(t.variants,r)?Wc(e,t.variants[r]):e}let r=n;for(let e of t.optional)Object.prototype.hasOwnProperty.call(n,e)&&n[e]===null&&(r===n&&(r={...n}),delete r[e]);for(let[e,i]of Object.entries(t.fields)){if(!Object.prototype.hasOwnProperty.call(r,e))continue;let t=Wc(r[e],i);t!==r[e]&&(r===n&&(r={...n}),r[e]=t)}return r}function Gc(e,t){return Wc(e,t)}var R=class extends Error{constructor(e){super(e)}},Kc=class extends R{constructor(){super(`Connect not implemented. This method is not supported by the current agent.`)}};function qc(e,t){return t===void 0?e:e===void 0?{...t}:{...e,...t}}function Jc(e){return e===void 0?``:typeof e==`string`?e:e.filter(e=>e.type===`text`).map(e=>e.text).join(``)}function Yc(e){return Array.isArray(e)&&e.some(e=>e.type!==`text`)}var Xc=(function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])},e(t,n)};return function(t,n){e(t,n);function r(){this.constructor=t}t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}})(),Zc=Object.prototype.hasOwnProperty;function Qc(e,t){return Zc.call(e,t)}function $c(e){if(Array.isArray(e)){for(var t=Array(e.length),n=0;n=48&&r<=57){t++;continue}return!1}return!0}function nl(e){return e.indexOf(`/`)===-1&&e.indexOf(`~`)===-1?e:e.replace(/~/g,`~0`).replace(/\//g,`~1`)}function rl(e){return e.replace(/~1/g,`/`).replace(/~0/g,`~`)}function il(e){if(e===void 0)return!0;if(e){if(Array.isArray(e)){for(var t=0,n=e.length;tcl,_areEquals:()=>vl,applyOperation:()=>pl,applyPatch:()=>ml,applyReducer:()=>hl,deepClone:()=>ll,getValueByPointer:()=>fl,validate:()=>_l,validator:()=>gl}),cl=ol,ll=el,ul={add:function(e,t,n){return e[t]=this.value,{newDocument:n}},remove:function(e,t,n){var r=e[t];return delete e[t],{newDocument:n,removed:r}},replace:function(e,t,n){var r=e[t];return e[t]=this.value,{newDocument:n,removed:r}},move:function(e,t,n){var r=fl(n,this.path);r&&=el(r);var i=pl(n,{op:`remove`,path:this.from}).removed;return pl(n,{op:`add`,path:this.path,value:i}),{newDocument:n,removed:r}},copy:function(e,t,n){var r=fl(n,this.from);return pl(n,{op:`add`,path:this.path,value:el(r)}),{newDocument:n}},test:function(e,t,n){return{newDocument:n,test:vl(e[t],this.value)}},_get:function(e,t,n){return this.value=e[t],{newDocument:n}}},dl={add:function(e,t,n){return tl(t)?e.splice(t,0,this.value):e[t]=this.value,{newDocument:n,index:t}},remove:function(e,t,n){return{newDocument:n,removed:e.splice(t,1)[0]}},replace:function(e,t,n){var r=e[t];return e[t]=this.value,{newDocument:n,removed:r}},move:ul.move,copy:ul.copy,test:ul.test,_get:ul._get};function fl(e,t){if(t==``)return e;var n={op:`_get`,path:t};return pl(e,n),n.value}function pl(e,t,n,r,i,a){if(n===void 0&&(n=!1),r===void 0&&(r=!0),i===void 0&&(i=!0),a===void 0&&(a=0),n&&(typeof n==`function`?n(t,0,e,t.path):gl(t,0)),t.path===``){var o={newDocument:e};if(t.op===`add`)return o.newDocument=t.value,o;if(t.op===`replace`)return o.newDocument=t.value,o.removed=e,o;if(t.op===`move`||t.op===`copy`)return o.newDocument=fl(e,t.from),t.op===`move`&&(o.removed=e),o;if(t.op===`test`){if(o.test=vl(e,t.value),o.test===!1)throw new cl(`Test operation failed`,`TEST_OPERATION_FAILED`,a,t,e);return o.newDocument=e,o}if(t.op===`remove`)return o.removed=e,o.newDocument=null,o;if(t.op===`_get`)return t.value=e,o;if(n)throw new cl("Operation `op` property is not one of operations defined in RFC-6902",`OPERATION_OP_INVALID`,a,t,e);return o}r||(e=el(e));var s=(t.path||``).split(`/`),c=e,l=1,u=s.length,d=void 0,f=void 0,p=void 0;for(p=typeof n==`function`?n:gl;;){if(f=s[l],f&&f.indexOf(`~`)!=-1&&(f=rl(f)),i&&(f==`__proto__`||f==`prototype`&&l>0&&s[l-1]==`constructor`))throw TypeError("JSON-Patch: modifying `__proto__` or `constructor/prototype` prop is banned for security reasons, if this was on purpose, please set `banPrototypeModifications` flag false and pass it to this function. More info in fast-json-patch README");if(n&&d===void 0&&(c[f]===void 0?d=s.slice(0,l).join(`/`):l==u-1&&(d=t.path),d!==void 0&&p(t,0,e,d)),l++,Array.isArray(c)){if(f===`-`)f=c.length;else if(n&&!tl(f))throw new cl(`Expected an unsigned base-10 integer value, making the new referenced value the array element with the zero-based index`,`OPERATION_PATH_ILLEGAL_ARRAY_INDEX`,a,t,e);else tl(f)&&(f=~~f);if(l>=u){if(n&&t.op===`add`&&f>c.length)throw new cl(`The specified index MUST NOT be greater than the number of elements in the array`,`OPERATION_VALUE_OUT_OF_BOUNDS`,a,t,e);var o=dl[t.op].call(t,c,f,e);if(o.test===!1)throw new cl(`Test operation failed`,`TEST_OPERATION_FAILED`,a,t,e);return o}}else if(l>=u){var o=ul[t.op].call(t,c,f,e);if(o.test===!1)throw new cl(`Test operation failed`,`TEST_OPERATION_FAILED`,a,t,e);return o}if(c=c[f],n&&l0)throw new cl('Operation `path` property must start with "/"',`OPERATION_PATH_INVALID`,t,e,n);if((e.op===`move`||e.op===`copy`)&&typeof e.from!=`string`)throw new cl("Operation `from` property is not present (applicable in `move` and `copy` operations)",`OPERATION_FROM_REQUIRED`,t,e,n);if((e.op===`add`||e.op===`replace`||e.op===`test`)&&e.value===void 0)throw new cl("Operation `value` property is not present (applicable in `add`, `replace` and `test` operations)",`OPERATION_VALUE_REQUIRED`,t,e,n);if((e.op===`add`||e.op===`replace`||e.op===`test`)&&il(e.value))throw new cl("Operation `value` property is not present (applicable in `add`, `replace` and `test` operations)",`OPERATION_VALUE_CANNOT_CONTAIN_UNDEFINED`,t,e,n);if(n){if(e.op==`add`){var i=e.path.split(`/`).length,a=r.split(`/`).length;if(i!==a+1&&i!==a)throw new cl("Cannot perform an `add` operation at the desired path",`OPERATION_PATH_CANNOT_ADD`,t,e,n)}else if(e.op===`replace`||e.op===`remove`||e.op===`_get`){if(e.path!==r)throw new cl(`Cannot perform the operation at a path that does not exist`,`OPERATION_PATH_UNRESOLVABLE`,t,e,n)}else if(e.op===`move`||e.op===`copy`){var o=_l([{op:`_get`,path:e.from,value:void 0}],n);if(o&&o.name===`OPERATION_PATH_UNRESOLVABLE`)throw new cl(`Cannot perform the operation from a path that does not exist`,`OPERATION_FROM_UNRESOLVABLE`,t,e,n)}}}function _l(e,t,n){try{if(!Array.isArray(e))throw new cl(`Patch sequence must be an array`,`SEQUENCE_NOT_AN_ARRAY`);if(t)ml(el(t),el(e),n||!0);else{n||=gl;for(var r=0;rAl,generate:()=>Ol,observe:()=>Dl,unobserve:()=>El}),bl=new WeakMap,xl=function(){function e(e){this.observers=new Map,this.obj=e}return e}(),Sl=function(){function e(e,t){this.callback=e,this.observer=t}return e}();function Cl(e){return bl.get(e)}function wl(e,t){return e.observers.get(t)}function Tl(e,t){e.observers.delete(t.callback)}function El(e,t){t.unobserve()}function Dl(e,t){var n=[],r,i=Cl(e);if(!i)i=new xl(e),bl.set(e,i);else{var a=wl(i,t);r=a&&a.observer}if(r)return r;if(r={},i.value=el(e),t){r.callback=t,r.next=null;var o=function(){Ol(r)},s=function(){clearTimeout(r.next),r.next=setTimeout(o)};typeof window<`u`&&(window.addEventListener(`mouseup`,s),window.addEventListener(`keyup`,s),window.addEventListener(`mousedown`,s),window.addEventListener(`keydown`,s),window.addEventListener(`change`,s))}return r.patches=n,r.object=e,r.unobserve=function(){Ol(r),clearTimeout(r.next),Tl(i,r),typeof window<`u`&&(window.removeEventListener(`mouseup`,s),window.removeEventListener(`keyup`,s),window.removeEventListener(`mousedown`,s),window.removeEventListener(`keydown`,s),window.removeEventListener(`change`,s))},i.observers.set(t,new Sl(t,r)),r}function Ol(e,t){t===void 0&&(t=!1);var n=bl.get(e.object);kl(n.value,e.object,e.patches,``,t),e.patches.length&&ml(n.value,e.patches);var r=e.patches;return r.length>0&&(e.patches=[],e.callback&&e.callback(r)),r}function kl(e,t,n,r,i){if(t!==e){typeof t.toJSON==`function`&&(t=t.toJSON());for(var a=$c(t),o=$c(e),s=!1,c=o.length-1;c>=0;c--){var l=o[c],u=e[l];if(Qc(t,l)&&(t[l]!==void 0||u===void 0||Array.isArray(t)!==!1)){var d=t[l];typeof u==`object`&&u&&typeof d==`object`&&d&&Array.isArray(u)===Array.isArray(d)?kl(u,d,n,r+`/`+nl(l),i):u!==d&&(i&&n.push({op:`test`,path:r+`/`+nl(l),value:el(u)}),n.push({op:`replace`,path:r+`/`+nl(l),value:el(d)}))}else Array.isArray(e)===Array.isArray(t)?(i&&n.push({op:`test`,path:r+`/`+nl(l),value:el(u)}),n.push({op:`remove`,path:r+`/`+nl(l)}),s=!0):(i&&n.push({op:`test`,path:r,value:e}),n.push({op:`replace`,path:r,value:t}))}if(s||a.length!=o.length)for(var c=0;c0&&a[a.length-1])&&(s[0]===6||s[0]===2)){n=0;continue}if(s[0]===3&&(!a||s[1]>a[0]&&s[1]=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw TypeError(t?`Object is not iterable.`:`Symbol.iterator is not defined.`)}function Ll(e,t){var n=typeof Symbol==`function`&&e[Symbol.iterator];if(!n)return e;var r=n.call(e),i,a=[],o;try{for(;(t===void 0||t-->0)&&!(i=r.next()).done;)a.push(i.value)}catch(e){o={error:e}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(o)throw o.error}}return a}function Rl(e,t,n){if(n||arguments.length===2)for(var r=0,i=t.length,a;r1||c(e,t)})},t&&(i[e]=t(i[e])))}function c(e,t){try{l(r[e](t))}catch(e){f(a[0][3],e)}}function l(e){e.value instanceof zl?Promise.resolve(e.value.v).then(u,d):f(a[0][2],e)}function u(e){c(`next`,e)}function d(e){c(`throw`,e)}function f(e,t){e(t),a.shift(),a.length&&c(a[0][0],a[0][1])}}function Vl(e){if(!Symbol.asyncIterator)throw TypeError(`Symbol.asyncIterator is not defined.`);var t=e[Symbol.asyncIterator],n;return t?t.call(e):(e=typeof Il==`function`?Il(e):e[Symbol.iterator](),n={},r(`next`),r(`throw`),r(`return`),n[Symbol.asyncIterator]=function(){return this},n);function r(t){n[t]=e[t]&&function(n){return new Promise(function(r,a){n=e[t](n),i(r,a,n.done,n.value)})}}function i(e,t,n,r){Promise.resolve(r).then(function(t){e({value:t,done:n})},t)}}function Hl(e){return typeof e==`function`}function Ul(e){var t=e(function(e){Error.call(e),e.stack=Error().stack});return t.prototype=Object.create(Error.prototype),t.prototype.constructor=t,t}var Wl=Ul(function(e){return function(t){e(this),this.message=t?t.length+` errors occurred during unsubscription: +`+t.map(function(e,t){return t+1+`) `+e.toString()}).join(` + `):``,this.name=`UnsubscriptionError`,this.errors=t}});function Gl(e,t){if(e){var n=e.indexOf(t);0<=n&&e.splice(n,1)}}var Kl=function(){function e(e){this.initialTeardown=e,this.closed=!1,this._parentage=null,this._finalizers=null}return e.prototype.unsubscribe=function(){var e,t,n,r,i;if(!this.closed){this.closed=!0;var a=this._parentage;if(a){if(this._parentage=null,Array.isArray(a))try{for(var o=Il(a),s=o.next();!s.done;s=o.next())s.value.remove(this)}catch(t){e={error:t}}finally{try{s&&!s.done&&(t=o.return)&&t.call(o)}finally{if(e)throw e.error}}else a.remove(this)}var c=this.initialTeardown;if(Hl(c))try{c()}catch(e){i=e instanceof Wl?e.errors:[e]}var l=this._finalizers;if(l){this._finalizers=null;try{for(var u=Il(l),d=u.next();!d.done;d=u.next()){var f=d.value;try{Yl(f)}catch(e){i??=[],e instanceof Wl?i=Rl(Rl([],Ll(i)),Ll(e.errors)):i.push(e)}}}catch(e){n={error:e}}finally{try{d&&!d.done&&(r=u.return)&&r.call(u)}finally{if(n)throw n.error}}}if(i)throw new Wl(i)}},e.prototype.add=function(t){if(t&&t!==this){if(this.closed)Yl(t);else{if(t instanceof e){if(t.closed||t._hasParent(this))return;t._addParent(this)}(this._finalizers=this._finalizers??[]).push(t)}}},e.prototype._hasParent=function(e){var t=this._parentage;return t===e||Array.isArray(t)&&t.includes(e)},e.prototype._addParent=function(e){var t=this._parentage;this._parentage=Array.isArray(t)?(t.push(e),t):t?[t,e]:e},e.prototype._removeParent=function(e){var t=this._parentage;t===e?this._parentage=null:Array.isArray(t)&&Gl(t,e)},e.prototype.remove=function(t){var n=this._finalizers;n&&Gl(n,t),t instanceof e&&t._removeParent(this)},e.EMPTY=(function(){var t=new e;return t.closed=!0,t})(),e}(),ql=Kl.EMPTY;function Jl(e){return e instanceof Kl||e&&`closed`in e&&Hl(e.remove)&&Hl(e.add)&&Hl(e.unsubscribe)}function Yl(e){Hl(e)?e():e.unsubscribe()}var Xl={onUnhandledError:null,onStoppedNotification:null,Promise:void 0,useDeprecatedSynchronousErrorHandling:!1,useDeprecatedNextContext:!1},Zl={setTimeout:function(e,t){var n=[...arguments].slice(2),r=Zl.delegate;return r?.setTimeout?r.setTimeout.apply(r,Rl([e,t],Ll(n))):setTimeout.apply(void 0,Rl([e,t],Ll(n)))},clearTimeout:function(e){return(Zl.delegate?.clearTimeout||clearTimeout)(e)},delegate:void 0};function Ql(e){Zl.setTimeout(function(){var t=Xl.onUnhandledError;if(t)t(e);else throw e})}function $l(){}var eu=(function(){return ru(`C`,void 0,void 0)})();function tu(e){return ru(`E`,void 0,e)}function nu(e){return ru(`N`,e,void 0)}function ru(e,t,n){return{kind:e,value:t,error:n}}var iu=null;function au(e){if(Xl.useDeprecatedSynchronousErrorHandling){var t=!iu;if(t&&(iu={errorThrown:!1,error:null}),e(),t){var n=iu,r=n.errorThrown,i=n.error;if(iu=null,r)throw i}}else e()}function ou(e){Xl.useDeprecatedSynchronousErrorHandling&&iu&&(iu.errorThrown=!0,iu.error=e)}var su=function(e){Nl(t,e);function t(t){var n=e.call(this)||this;return n.isStopped=!1,t?(n.destination=t,Jl(t)&&t.add(n)):n.destination=hu,n}return t.create=function(e,t,n){return new du(e,t,n)},t.prototype.next=function(e){this.isStopped?mu(nu(e),this):this._next(e)},t.prototype.error=function(e){this.isStopped?mu(tu(e),this):(this.isStopped=!0,this._error(e))},t.prototype.complete=function(){this.isStopped?mu(eu,this):(this.isStopped=!0,this._complete())},t.prototype.unsubscribe=function(){this.closed||(this.isStopped=!0,e.prototype.unsubscribe.call(this),this.destination=null)},t.prototype._next=function(e){this.destination.next(e)},t.prototype._error=function(e){try{this.destination.error(e)}finally{this.unsubscribe()}},t.prototype._complete=function(){try{this.destination.complete()}finally{this.unsubscribe()}},t}(Kl),cu=Function.prototype.bind;function lu(e,t){return cu.call(e,t)}var uu=function(){function e(e){this.partialObserver=e}return e.prototype.next=function(e){var t=this.partialObserver;if(t.next)try{t.next(e)}catch(e){fu(e)}},e.prototype.error=function(e){var t=this.partialObserver;if(t.error)try{t.error(e)}catch(e){fu(e)}else fu(e)},e.prototype.complete=function(){var e=this.partialObserver;if(e.complete)try{e.complete()}catch(e){fu(e)}},e}(),du=function(e){Nl(t,e);function t(t,n,r){var i=e.call(this)||this,a;if(Hl(t)||!t)a={next:t??void 0,error:n??void 0,complete:r??void 0};else{var o;i&&Xl.useDeprecatedNextContext?(o=Object.create(t),o.unsubscribe=function(){return i.unsubscribe()},a={next:t.next&&lu(t.next,o),error:t.error&&lu(t.error,o),complete:t.complete&&lu(t.complete,o)}):a=t}return i.destination=new uu(a),i}return t}(su);function fu(e){Xl.useDeprecatedSynchronousErrorHandling?ou(e):Ql(e)}function pu(e){throw e}function mu(e,t){var n=Xl.onStoppedNotification;n&&Zl.setTimeout(function(){return n(e,t)})}var hu={closed:!0,next:$l,error:pu,complete:$l},gu=(function(){return typeof Symbol==`function`&&Symbol.observable||`@@observable`})();function _u(e){return e}function vu(){return yu([...arguments])}function yu(e){return e.length===0?_u:e.length===1?e[0]:function(t){return e.reduce(function(e,t){return t(e)},t)}}var bu=function(){function e(e){e&&(this._subscribe=e)}return e.prototype.lift=function(t){var n=new e;return n.source=this,n.operator=t,n},e.prototype.subscribe=function(e,t,n){var r=this,i=Cu(e)?e:new du(e,t,n);return au(function(){var e=r,t=e.operator,n=e.source;i.add(t?t.call(i,n):n?r._subscribe(i):r._trySubscribe(i))}),i},e.prototype._trySubscribe=function(e){try{return this._subscribe(e)}catch(t){e.error(t)}},e.prototype.forEach=function(e,t){var n=this;return t=xu(t),new t(function(t,r){var i=new du({next:function(t){try{e(t)}catch(e){r(e),i.unsubscribe()}},error:r,complete:t});n.subscribe(i)})},e.prototype._subscribe=function(e){return this.source?.subscribe(e)},e.prototype[gu]=function(){return this},e.prototype.pipe=function(){return yu([...arguments])(this)},e.prototype.toPromise=function(e){var t=this;return e=xu(e),new e(function(e,n){var r;t.subscribe(function(e){return r=e},function(e){return n(e)},function(){return e(r)})})},e.create=function(t){return new e(t)},e}();function xu(e){return e??Xl.Promise??Promise}function Su(e){return e&&Hl(e.next)&&Hl(e.error)&&Hl(e.complete)}function Cu(e){return e&&e instanceof su||Su(e)&&Jl(e)}function wu(e){return Hl(e?.lift)}function Tu(e){return function(t){if(wu(t))return t.lift(function(t){try{return e(t,this)}catch(e){this.error(e)}});throw TypeError(`Unable to lift unknown Observable type`)}}function Eu(e,t,n,r,i){return new Du(e,t,n,r,i)}var Du=function(e){Nl(t,e);function t(t,n,r,i,a,o){var s=e.call(this,t)||this;return s.onFinalize=a,s.shouldUnsubscribe=o,s._next=n?function(e){try{n(e)}catch(e){t.error(e)}}:e.prototype._next,s._error=i?function(e){try{i(e)}catch(e){t.error(e)}finally{this.unsubscribe()}}:e.prototype._error,s._complete=r?function(){try{r()}catch(e){t.error(e)}finally{this.unsubscribe()}}:e.prototype._complete,s}return t.prototype.unsubscribe=function(){var t;if(!this.shouldUnsubscribe||this.shouldUnsubscribe()){var n=this.closed;e.prototype.unsubscribe.call(this),!n&&((t=this.onFinalize)==null||t.call(this))}},t}(su),Ou=Ul(function(e){return function(){e(this),this.name=`ObjectUnsubscribedError`,this.message=`object unsubscribed`}}),ku=function(e){Nl(t,e);function t(){var t=e.call(this)||this;return t.closed=!1,t.currentObservers=null,t.observers=[],t.isStopped=!1,t.hasError=!1,t.thrownError=null,t}return t.prototype.lift=function(e){var t=new Au(this,this);return t.operator=e,t},t.prototype._throwIfClosed=function(){if(this.closed)throw new Ou},t.prototype.next=function(e){var t=this;au(function(){var n,r;if(t._throwIfClosed(),!t.isStopped){t.currentObservers||=Array.from(t.observers);try{for(var i=Il(t.currentObservers),a=i.next();!a.done;a=i.next())a.value.next(e)}catch(e){n={error:e}}finally{try{a&&!a.done&&(r=i.return)&&r.call(i)}finally{if(n)throw n.error}}}})},t.prototype.error=function(e){var t=this;au(function(){if(t._throwIfClosed(),!t.isStopped){t.hasError=t.isStopped=!0,t.thrownError=e;for(var n=t.observers;n.length;)n.shift().error(e)}})},t.prototype.complete=function(){var e=this;au(function(){if(e._throwIfClosed(),!e.isStopped){e.isStopped=!0;for(var t=e.observers;t.length;)t.shift().complete()}})},t.prototype.unsubscribe=function(){this.isStopped=this.closed=!0,this.observers=this.currentObservers=null},Object.defineProperty(t.prototype,"observed",{get:function(){return this.observers?.length>0},enumerable:!1,configurable:!0}),t.prototype._trySubscribe=function(t){return this._throwIfClosed(),e.prototype._trySubscribe.call(this,t)},t.prototype._subscribe=function(e){return this._throwIfClosed(),this._checkFinalizedStatuses(e),this._innerSubscribe(e)},t.prototype._innerSubscribe=function(e){var t=this,n=this,r=n.hasError,i=n.isStopped,a=n.observers;return r||i?ql:(this.currentObservers=null,a.push(e),new Kl(function(){t.currentObservers=null,Gl(a,e)}))},t.prototype._checkFinalizedStatuses=function(e){var t=this,n=t.hasError,r=t.thrownError,i=t.isStopped;n?e.error(r):i&&e.complete()},t.prototype.asObservable=function(){var e=new bu;return e.source=this,e},t.create=function(e,t){return new Au(e,t)},t}(bu),Au=function(e){Nl(t,e);function t(t,n){var r=e.call(this)||this;return r.destination=t,r.source=n,r}return t.prototype.next=function(e){var t,n;(n=(t=this.destination)?.next)==null||n.call(t,e)},t.prototype.error=function(e){var t,n;(n=(t=this.destination)?.error)==null||n.call(t,e)},t.prototype.complete=function(){var e,t;(t=(e=this.destination)?.complete)==null||t.call(e)},t.prototype._subscribe=function(e){return this.source?.subscribe(e)??ql},t}(ku),ju={now:function(){return(ju.delegate||Date).now()},delegate:void 0},Mu=function(e){Nl(t,e);function t(t,n,r){t===void 0&&(t=1/0),n===void 0&&(n=1/0),r===void 0&&(r=ju);var i=e.call(this)||this;return i._bufferSize=t,i._windowTime=n,i._timestampProvider=r,i._buffer=[],i._infiniteTimeWindow=!0,i._infiniteTimeWindow=n===1/0,i._bufferSize=Math.max(1,t),i._windowTime=Math.max(1,n),i}return t.prototype.next=function(t){var n=this,r=n.isStopped,i=n._buffer,a=n._infiniteTimeWindow,o=n._timestampProvider,s=n._windowTime;r||(i.push(t),!a&&i.push(o.now()+s)),this._trimBuffer(),e.prototype.next.call(this,t)},t.prototype._subscribe=function(e){this._throwIfClosed(),this._trimBuffer();for(var t=this._innerSubscribe(e),n=this,r=n._infiniteTimeWindow,i=n._buffer.slice(),a=0;a=0}function Md(e){for(var t=[`topLevel`],n=0,r,i,a,o=function(e){return t.push(e)},s=function(e){return t[t.length-1]=e},c=function(e){r??(r=n,i=t.length,a=e)},l=function(e){e===a&&(r=void 0,i=void 0,a=void 0)},u=function(){return t.pop()},d=function(){return n--},f=function(e){if(`0`<=e&&e<=`9`){o(`number`);return}switch(e){case`"`:o(`string`);return;case`-`:o(`numberNeedsDigit`);return;case`t`:o(`true`);return;case`f`:o(`false`);return;case`n`:o(`null`);return;case`[`:o(`arrayNeedsValue`);return;case`{`:o(`objectNeedsKey`);return}},p=e.length;n`9`)&&(d(),u());break;case`numberNeedsDigit`:s(`number`);break;case`numberNeedsExponent`:s(m===`+`||m===`-`?`numberNeedsDigit`:`number`);break;case`true`:case`false`:case`null`:(m<`a`||m>`z`)&&(d(),u());break;case`arrayNeedsValue`:m===`]`?u():jd(m)||(l(`collectionItem`),s(`arrayNeedsComma`),f(m));break;case`arrayNeedsComma`:m===`]`?u():m===`,`&&(c(`collectionItem`),s(`arrayNeedsValue`));break;case`objectNeedsKey`:m===`}`?u():m===`"`&&(c(`collectionItem`),s(`objectNeedsColon`),o(`string`));break;case`objectNeedsColon`:m===`:`&&s(`objectNeedsValue`);break;case`objectNeedsValue`:jd(m)||(l(`collectionItem`),s(`objectNeedsComma`),f(m));break;case`objectNeedsComma`:m===`}`?u():m===`,`&&(c(`collectionItem`),s(`objectNeedsKey`))}}i!=null&&(t.length=i);for(var h=[r==null?e:e.slice(0,r)],g=function(t){return h.push(t.slice(e.length-e.lastIndexOf(t[0])))},_=t.length-1;_>=0;_--)switch(t[_]){case`string`:h.push(`"`);break;case`numberNeedsDigit`:case`numberNeedsExponent`:h.push(`0`);break;case`true`:g(`true`);break;case`false`:g(`false`);break;case`null`:g(`null`);break;case`arrayNeedsValue`:case`arrayNeedsComma`:h.push(`]`);break;case`objectNeedsKey`:case`objectNeedsColon`:case`objectNeedsValue`:case`objectNeedsComma`:h.push(`}`)}return h.join(``)}function Nd(e){let t=Object.values(e).filter(e=>typeof e==`number`);return Object.entries(e).filter(([e,n])=>t.indexOf(+e)===-1).map(([e,t])=>t)}function Pd(e,t=`|`){return e.map(e=>cf(e)).join(t)}function Fd(e,t){return typeof t==`bigint`?t.toString():t}var Id=class{constructor(e){this._getter=e,this._value=void 0}get value(){let e=this._getter;return e!==void 0&&(this._value=e(),this._getter=void 0),this._value}};function Ld(e){return new Id(e)}function Rd(e){return e==null}function zd(e){let t=+!!e.startsWith(`^`),n=e.endsWith(`$`)?e.length-1:e.length;return e.slice(t,n)}function Bd(e,t){let n=e/t,r=Math.round(n),i=4*2**-52*Math.max(Math.abs(n),1);return Math.abs(n-r){let e=t._zod.def.shape[a];return r?r(e,a):e}):qd(e,a,r?r(n.value,a):n.value))}}function Yd(e,t){for(let n of Reflect.ownKeys(t)){let r=Object.getOwnPropertyDescriptor(t,n);r.enumerable&&(r.get?Kd(e,n,()=>t[n]):qd(e,n,r.value))}}function Xd(...e){let t={};for(let n of e){let e=Object.getOwnPropertyDescriptors(n);Object.assign(t,e)}return Object.defineProperties({},t)}function Zd(e){return JSON.stringify(e)}function Qd(e){return e.toLowerCase().trim().replace(/[^\w\s-]/g,``).replace(/[\s_-]+/g,`-`).replace(/^-+|-+$/g,``)}var $d=`captureStackTrace`in Error?Error.captureStackTrace:(...e)=>{};function ef(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}var tf=Ld(()=>{if(H.jitless||typeof navigator<`u`&&navigator?.userAgent?.includes(`Cloudflare`))return!1;try{return Function(``),!0}catch{return!1}});function nf(e){if(ef(e)===!1)return!1;let t=e.constructor;if(t===void 0||typeof t!=`function`)return!0;let n=t.prototype;return ef(n)!==!1&&Object.prototype.hasOwnProperty.call(n,`isPrototypeOf`)!==!1}function rf(e){return nf(e)?{...e}:Array.isArray(e)?[...e]:e instanceof Map?new Map(e):e instanceof Set?new Set(e):e}var af=new Set([`string`,`number`,`symbol`]);function of(e){return e.replace(/[.*+?^${}()|[\]\\]/g,`\\$&`)}function sf(e,t,n){let r=new e._zod.constr(t??e._zod.def);return(!t||n?.parent)&&(r._zod.parent=e),r}function B(e){let t=e;if(!t)return{};if(typeof t==`string`)return{error:()=>t};if(t?.message!==void 0){if(t?.error!==void 0)throw Error("Cannot specify both `message` and `error` params");t.error=t.message}return delete t.message,typeof t.error==`string`?{...t,error:()=>t.error}:t}function cf(e){return typeof e==`bigint`?e.toString()+`n`:typeof e==`string`?`"${e}"`:`${e}`}function lf(e){return Object.keys(e).filter(t=>e[t]._zod.optin!==void 0&&e[t]._zod.optout===`optional`)}var uf={safeint:[-(2**53-1),2**53-1],int32:[-2147483648,2147483647],uint32:[0,4294967295],float32:[-34028234663852886e22,34028234663852886e22],float64:[-Number.MAX_VALUE,Number.MAX_VALUE]},df={int64:[BigInt(`-9223372036854775808`),BigInt(`9223372036854775807`)],uint64:[BigInt(0),BigInt(`18446744073709551615`)]};function ff(e,t){let n=e._zod.def,r=n.checks;if(r&&r.length>0)throw Error(`.pick() cannot be used on object schemas containing refinements`);let i={};return Jd(i,e,pf(e,t)),sf(e,Xd(n,{shape:i,checks:[]}))}function pf(e,t){let n=Gd(e),r=[];for(let e of Reflect.ownKeys(t)){if(!Object.getOwnPropertyDescriptor(n,e)?.enumerable)throw Error(`Unrecognized key: "${String(e)}"`);t[e]&&r.push(e)}return r}function mf(e,t){let n=e._zod.def,r=n.checks;if(r&&r.length>0)throw Error(`.omit() cannot be used on object schemas containing refinements`);let i=new Set(pf(e,t)),a={};return Jd(a,e,Reflect.ownKeys(Gd(e)).filter(e=>!i.has(e))),sf(e,Xd(n,{shape:a,checks:[]}))}function hf(e,t){if(!nf(t))throw Error(`Invalid input to extend: expected a plain object`);let n=e._zod.def.checks;if(n&&n.length>0){let n=Gd(e);for(let e of Reflect.ownKeys(t))if(Object.getOwnPropertyDescriptor(n,e)!==void 0)throw Error("Cannot overwrite keys on object schemas containing refinements. Use `.safeExtend()` instead.")}return sf(e,Xd(e._zod.def,{shape:gf(e,t)}))}function gf(e,t){let n={};return Jd(n,e,Reflect.ownKeys(Gd(e))),Yd(n,t),n}function _f(e,t){if(!nf(t))throw Error(`Invalid input to safeExtend: expected a plain object`);return sf(e,Xd(e._zod.def,{shape:gf(e,t)}))}function vf(e,t){if(!t?._zod?.def)throw Error("Invalid input to merge: expected an object schema. To merge a plain shape, use `.extend()`.");if(e._zod.def.checks?.length)throw Error(`.merge() cannot be used on object schemas containing refinements. Use .safeExtend() instead.`);let n={};return Jd(n,e,Reflect.ownKeys(Gd(e))),Jd(n,t,Reflect.ownKeys(Gd(t))),sf(e,Xd(e._zod.def,{shape:n,get catchall(){return t._zod.def.catchall},checks:t._zod.def.checks??[]}))}function yf(e,t,n,r=`partial`){let i=t._zod.def.checks;if(i&&i.length>0)throw Error(`.${r}() cannot be used on object schemas containing refinements`);let a=n?new Set(pf(t,n)):void 0,o={};return Jd(o,t,Reflect.ownKeys(Gd(t)),e&&((t,n)=>a&&!a.has(n)?t:new e({type:`optional`,innerType:t}))),sf(t,Xd(t._zod.def,{shape:o,checks:[]}))}function bf(e,t,n){let r=n?new Set(pf(t,n)):void 0,i={};return Jd(i,t,Reflect.ownKeys(Gd(t)),(t,n)=>r&&!r.has(n)?t:new e({type:`nonoptional`,innerType:t})),sf(t,Xd(t._zod.def,{shape:i}))}function xf(e,t=0){if(e.aborted===!0)return!0;for(let n=t;n{var n;return(n=t).path??(n.path=[]),t.path.unshift(e),t})}function wf(e){return typeof e==`string`?e:e?.message}function Tf(e,t,n){var r;for(let i=t;ie;return t[Uf]=!0,t}var Gf,Kf=Object.freeze({status:`aborted`}),qf={value:void 0,enumerable:!1},Jf=`captureStackTrace`in Error?Error:null;function Yf(e){let t=Jf;if(t){let n=t.stackTraceLimit;if(typeof n==`number`){try{t.stackTraceLimit=0}catch{return Jf=null,new e}try{return new e}finally{t.stackTraceLimit=n}}}return new e}function V(e,t,n,r){let i={};function a(e){this.def=e,this.constr=d,this.traits=new Set}a.prototype=i;let o=n,s=o&&new WeakSet;function c(n,r){if(!n._zod){qf.value=new a(r);try{Object.defineProperty(n,"_zod",qf)}finally{qf.value=void 0}}else if(n._zod.traits.has(e))return;if(n._zod.traits.add(e),t(n,r),s){let e=Object.getPrototypeOf(n),t=n._zod.constr.prototype,r=e;for(;r&&r!==t;)r=Object.getPrototypeOf(r);let i=r??e;s.has(i)||(s.add(i),Mf(i,o))}let i=d.prototype;for(let e in i)Object.prototype.hasOwnProperty.call(i,e)&&(e in n||(n[e]=i[e].bind(n)))}let l=r?.Parent??Object;class u extends l{}Object.defineProperty(u,"name",{value:e});function d(e){let t=r?.Parent?Yf(u):this;c(t,e);let n=t._zod.deferred;if(n){for(let e of n)e();t._zod.deferred=void 0}let i=globalThis.__zod_globalConfig?.postProcessor;return i&&i(t),t}return Object.defineProperty(d,"init",{value:c}),Object.defineProperty(d,Symbol.hasInstance,{value:t=>r?.Parent&&t instanceof r.Parent?!0:t?._zod?.traits?.has(e)}),Object.defineProperty(d,"name",{value:e}),d}var Xf=class extends Error{constructor(){super(`Encountered Promise during synchronous parse. Use .parseAsync() instead.`)}},Zf=class extends Error{constructor(e){super(`Encountered unidirectional transform during encode: ${e}`),this.name=`ZodEncodeError`}};(Gf=globalThis).__zod_globalConfig??(Gf.__zod_globalConfig={});var H=globalThis.__zod_globalConfig;function Qf(e){return e&&Object.assign(H,e),H}function $f(){let e=this._zod;return e.message??=JSON.stringify(e.def,Fd,2),e.message}function ep(e){this._zod.message=e}var tp={get:$f,set:ep,enumerable:!0,configurable:!0},np={value:void 0,enumerable:!1},rp=new WeakSet([Object.prototype,Error.prototype]),ip=(e,t)=>{e.name=`$ZodError`,np.value=t,Object.defineProperty(e,"issues",np),np.value=void 0,Object.defineProperty(e,"message",tp);let n=Object.getPrototypeOf(e);rp.has(n)||(rp.add(n),Object.defineProperty(n,"toString",{configurable:!0,enumerable:!1,get(){let e=()=>this.message;return Object.defineProperty(this,"toString",{value:e,configurable:!0,writable:!0}),e},set(e){Object.defineProperty(this,"toString",{value:e,configurable:!0,writable:!0})}}))},ap=V(`$ZodError`,ip);V(`$ZodError`,ip,void 0,{Parent:Error});function op(e,t,n){return Object.prototype.hasOwnProperty.call(e,t)||(t===`__proto__`?Object.defineProperty(e,t,{value:n(),writable:!0,enumerable:!0,configurable:!0}):e[t]=n()),e[t]}function sp(e,t=e=>e.message){let n={},r=[];for(let i of e.issues)i.path.length>0?op(n,i.path[0],()=>[]).push(t(i)):r.push(t(i));return{formErrors:r,fieldErrors:n}}function cp(e,t=e=>e.message){let n={_errors:[]},r=(e,i=[])=>{for(let a of e.issues)if(a.code===`invalid_union`&&a.errors.length)a.errors.map(e=>r({issues:e},[...i,...a.path]));else if(a.code===`invalid_key`)r({issues:a.issues},[...i,...a.path]);else if(a.code===`invalid_element`)r({issues:a.issues},[...i,...a.path]);else{let e=[...i,...a.path];if(e.length===0)n._errors.push(t(a));else{let r=n,i=0;for(;i{let t=(n,r,i,a)=>{let o=i?{...i,async:!1}:{async:!1},s=n._zod.run({value:r,issues:[]},o);if(s instanceof Promise)throw new Xf;if(s.issues.length){let n=new((a?.Err)??e)(s.issues.map(e=>Ef(e,o,Qf())));throw $d(n,a?.callee??t),n}return s.value};return t},dp=e=>{let t=async(n,r,i,a)=>{let o=i?{...i,async:!0}:{async:!0},s=n._zod.run({value:r,issues:[]},o);if(s instanceof Promise&&(s=await s),s.issues.length){let n=new((a?.Err)??e)(s.issues.map(e=>Ef(e,o,Qf())));throw $d(n,a?.callee??t),n}return s.value};return t},fp=e=>(t,n,r)=>{let i=r?{...r,async:!1}:{async:!1},a=t._zod.run({value:n,issues:[]},i);if(a instanceof Promise)throw new Xf;return a.issues.length?pp(e,a.issues,i):{success:!0,data:a.value}};function pp(e,t,n){let r;return{success:!1,get error(){return r||(r=new e(t.map(e=>Ef(e,n,Qf()))),t=void 0,n=void 0),r},set error(e){r=e,t=void 0,n=void 0}}}var mp=e=>async(t,n,r)=>{let i=r?{...r,async:!0}:{async:!0},a=t._zod.run({value:n,issues:[]},i);return a instanceof Promise&&(a=await a),a.issues.length?pp(e,a.issues,i):{success:!0,data:a.value}},hp=Symbol.for(`zod.compile.invalid`),gp=Symbol.for(`zod.compile.fallback`),_p=((e,t,n)=>{let r=e._zod.bag.validator;if(r!==void 0){if(r(t)!==hp)return!0;if(r.definite===!0&&n===void 0)return!1}return vp(e,t,n)});function vp(e,t,n){let r=n?{...n,async:!1,abortEarly:!0}:{async:!1,abortEarly:!0},i=e._zod.bag.fallbackRun,a;if(i?(r[gp]=!0,a=i({value:t,issues:[]},r)):a=e._zod.run({value:t,issues:[]},r),a instanceof Promise)throw new Xf;return a.issues.length===0}var yp=async(e,t,n)=>{let r=n?{...n,async:!0,abortEarly:!0}:{async:!0,abortEarly:!0},i=e._zod.run({value:t,issues:[]},r);return i instanceof Promise&&(i=await i),i.issues.length===0},bp=e=>{let t=up(e),n=(e,r,i,a)=>{let o=i?{...i,direction:`backward`}:{direction:`backward`};return t(e,r,o,lp(n,a))};return n},xp=e=>{let t=up(e),n=(e,r,i,a)=>t(e,r,i,lp(n,a));return n},Sp=e=>{let t=dp(e),n=async(e,r,i,a)=>{let o=i?{...i,direction:`backward`}:{direction:`backward`};return await t(e,r,o,lp(n,a))};return n},Cp=e=>{let t=dp(e),n=async(e,r,i,a)=>await t(e,r,i,lp(n,a));return n},wp=e=>(t,n,r)=>{let i=r?{...r,direction:`backward`}:{direction:`backward`};return fp(e)(t,n,i)},Tp=e=>(t,n,r)=>fp(e)(t,n,r),Ep=e=>async(t,n,r)=>{let i=r?{...r,direction:`backward`}:{direction:`backward`};return mp(e)(t,n,i)},Dp=e=>async(t,n,r)=>mp(e)(t,n,r),Op=/^[cC][0-9a-z]{6,}$/,kp=/^[0-9a-z]+$/,Ap=/^[0-7][0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{25}$/,jp=/^[0-9a-vA-V]{20}$/,Mp=/^[A-Za-z0-9]{27}$/,Np=/^[a-zA-Z0-9_-]{21}$/;function Pp(e){return RegExp(`^[a-zA-Z0-9_-]{${e}}$`)}var Fp=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,Ip=/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$/,Lp=e=>e?RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${e}[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$`):/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$/,Rp=/^(?:[A-Za-z0-9_'+\-]+\.)*[A-Za-z0-9_'+\-]*[A-Za-z0-9_+-]@(?:[A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,zp=`^(?=[\\s\\S]*[\\p{Extended_Pictographic}\\p{Regional_Indicator}\\u20E3])[\\p{Extended_Pictographic}\\p{Emoji_Component}]+$`;function Bp(){return new RegExp(zp,`u`)}var Vp=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,Hp=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:))$/,Up=/^((25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/([0-9]|[1-2][0-9]|3[0-2])$/,Wp=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,Gp=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,Kp=/^(?:[A-Za-z0-9_-]{4})*(?:[A-Za-z0-9_-]{2,3})?$/,qp=/^https?$/,Jp=/^\+[1-9]\d{6,14}$/,Yp=`(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))`;function Xp(e){return RegExp(`^${e}$`)}var Zp=Xp(Yp);function Qp(e){let t=`(?:[01]\\d|2[0-3]):[0-5]\\d`;return typeof e.precision==`number`?e.precision===-1?`${t}`:e.precision===0?`${t}:[0-5]\\d`:`${t}:[0-5]\\d\\.\\d{${e.precision}}`:e.seconds?`${t}:[0-5]\\d(?:\\.\\d+)?`:`${t}(?::[0-5]\\d(?:\\.\\d+)?)?`}function $p(e){return RegExp(`^${Qp(e)}$`)}function em(e){let t=[`Z`];e.offset&&t.push(`([+-](?:[01]\\d|2[0-3]):[0-5]\\d)`);let n=`${Qp({precision:e.precision,seconds:!0})}(?:${t.join(`|`)})`,r=e.local?`${n}|${Qp({precision:e.precision})}`:n;return RegExp(`^${Yp}T(?:${r})$`)}var tm=/^[\s\S]{0,}$/,nm=/^-?\d+$/,rm=/^-?\d+(?:\.\d+)?$/,im=/^(?:true|false)$/i,am=/^null$/i,om=/^undefined$/i,sm=/^[^A-Z]*$/,cm=/^[^a-z]*$/,lm=V(`$ZodCheck`,(e,t)=>{var n;e._zod??={},e._zod.def=t,(n=e._zod).onattach??(n.onattach=[])}),um=e=>{let t=e.value;return!Rd(t)&&t.length!==void 0},dm={number:`number`,bigint:`bigint`,object:`date`},fm=V(`$ZodCheckLessThan`,(e,t)=>{lm.init(e,t);let n=dm[typeof t.value];e._zod.check=r=>{(t.inclusive?r.value<=t.value:r.value{lm.init(e,t);let n=dm[typeof t.value];e._zod.check=r=>{(t.inclusive?r.value>=t.value:r.value>t.value)||r.issues.push({origin:dm[typeof r.value]??n,code:`too_small`,minimum:typeof t.value==`object`?t.value.getTime():t.value,input:r.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),mm=V(`$ZodCheckMultipleOf`,(e,t)=>{lm.init(e,t),e._zod.check=n=>{if(typeof n.value!=typeof t.value)throw Error(`Cannot mix number and bigint in multiple_of check.`);(typeof n.value==`bigint`?t.value!==BigInt(0)&&n.value%t.value===BigInt(0):Bd(n.value,t.value)===0)||n.issues.push({origin:typeof n.value,code:`not_multiple_of`,divisor:t.value,input:n.value,inst:e,continue:!t.abort})}}),hm=V(`$ZodCheckNumberFormat`,(e,t)=>{lm.init(e,t),t.format=t.format||`float64`;let n=t.format?.includes(`int`),r=n?`int`:`number`,[i,a]=uf[t.format];e._zod.check=o=>{let s=o.value;if(n){if(!Number.isInteger(s)){o.issues.push({expected:r,format:t.format,code:`invalid_type`,continue:!1,input:s,inst:e});return}if(!Number.isSafeInteger(s)){s>0?o.issues.push({input:s,code:`too_big`,maximum:2**53-1,note:`Integers must be within the safe integer range.`,inst:e,origin:r,inclusive:!0,continue:!t.abort}):o.issues.push({input:s,code:`too_small`,minimum:-(2**53-1),note:`Integers must be within the safe integer range.`,inst:e,origin:r,inclusive:!0,continue:!t.abort});return}}sa&&o.issues.push({origin:`number`,input:s,code:`too_big`,maximum:a,inclusive:!0,inst:e,continue:!t.abort})}}),gm=V(`$ZodCheckMaxLength`,(e,t)=>{var n;lm.init(e,t),(n=e._zod.def).when??(n.when=um),e._zod.check=n=>{let r=n.value,i=r.length;if((typeof r==`string`&&i>t.maximum?Of(r):i)<=t.maximum)return;let a=kf(r);n.issues.push({origin:a,code:`too_big`,maximum:t.maximum,inclusive:!0,input:r,inst:e,continue:!t.abort})}}),_m=V(`$ZodCheckMinLength`,(e,t)=>{var n;lm.init(e,t),(n=e._zod.def).when??(n.when=um),e._zod.check=n=>{let r=n.value,i=r.length;if((typeof r==`string`&&i>=t.minimum&&i=t.minimum)return;let a=kf(r);n.issues.push({origin:a,code:`too_small`,minimum:t.minimum,inclusive:!0,input:r,inst:e,continue:!t.abort})}}),vm=V(`$ZodCheckLengthEquals`,(e,t)=>{var n;lm.init(e,t),(n=e._zod.def).when??(n.when=um),e._zod.check=n=>{let r=n.value,i=r.length,a=typeof r==`string`&&i>=t.length&&i<=t.length*2?Of(r):i;if(a===t.length)return;let o=kf(r),s=a>t.length;n.issues.push({origin:o,...s?{code:`too_big`,maximum:t.length}:{code:`too_small`,minimum:t.length},inclusive:!0,exact:!0,input:n.value,inst:e,continue:!t.abort})}}),ym=V(`$ZodCheckStringFormat`,(e,t)=>{var n,r;lm.init(e,t),t.pattern?(n=e._zod).check??(n.check=n=>{t.pattern.lastIndex=0,!t.pattern.test(n.value)&&n.issues.push({origin:`string`,code:`invalid_format`,format:t.format,input:n.value,...t.pattern?{pattern:t.pattern.toString()}:{},inst:e,continue:!t.abort})}):(r=e._zod).check??(r.check=()=>{})}),bm=V(`$ZodCheckRegex`,(e,t)=>{ym.init(e,t),e._zod.check=n=>{t.pattern.lastIndex=0,!t.pattern.test(n.value)&&n.issues.push({origin:`string`,code:`invalid_format`,format:`regex`,input:n.value,pattern:t.pattern.toString(),inst:e,continue:!t.abort})}}),xm=V(`$ZodCheckLowerCase`,(e,t)=>{t.pattern??=sm,ym.init(e,t)}),Sm=V(`$ZodCheckUpperCase`,(e,t)=>{t.pattern??=cm,ym.init(e,t)}),Cm=V(`$ZodCheckIncludes`,(e,t)=>{lm.init(e,t);let n=of(t.includes);t.pattern=new RegExp(typeof t.position==`number`?`^.{${t.position},}${n}`:n),e._zod.check=n=>{n.value.includes(t.includes,t.position)||n.issues.push({origin:`string`,code:`invalid_format`,format:`includes`,includes:t.includes,input:n.value,inst:e,continue:!t.abort})}}),wm=V(`$ZodCheckStartsWith`,(e,t)=>{lm.init(e,t);let n=RegExp(`^${of(t.prefix)}.*`);t.pattern??=n,e._zod.check=n=>{n.value.startsWith(t.prefix)||n.issues.push({origin:`string`,code:`invalid_format`,format:`starts_with`,prefix:t.prefix,input:n.value,inst:e,continue:!t.abort})}}),Tm=V(`$ZodCheckEndsWith`,(e,t)=>{lm.init(e,t);let n=RegExp(`.*${of(t.suffix)}$`);t.pattern??=n,e._zod.check=n=>{n.value.endsWith(t.suffix)||n.issues.push({origin:`string`,code:`invalid_format`,format:`ends_with`,suffix:t.suffix,input:n.value,inst:e,continue:!t.abort})}}),Em=V(`$ZodCheckOverwrite`,(e,t)=>{lm.init(e,t),e._zod.check=e=>{e.value=t.tx(e.value)}}),Dm=class{constructor(e=[],t={}){this.content=[],this.indent=0,this.args=e,this.closed=t}indented(e){this.indent+=1;try{e(this)}finally{--this.indent}}write(e){if(typeof e==`function`){e(this,{execution:`sync`}),e(this,{execution:`async`});return}let t=e.split(` +`).filter(e=>e),n=Math.min(...t.map(e=>e.length-e.trimStart().length)),r=t.map(e=>e.slice(n)).map(e=>` `.repeat(this.indent*2)+e);for(let e of r)this.content.push(e)}compile(){let e=Function,t=this?.content??[``];return new e(...Object.keys(this.closed),`return function (${this.args.join(`, `)}) {\n${t.join(` +`)}\n};`)(...Object.values(this.closed))}},Om={major:4,minor:6,patch:5},km=V(`$ZodType`,(e,t)=>{var n;e??={},e._zod.def=t,e._zod.bag=e._zod.bag||{},e._zod.version=Om;let r=e._zod.def.checks,i=e._zod.traits.has(`$ZodCheck`)?[e,...r??[]]:r?.length?[...r]:[];for(let t of i)for(let n of t._zod.onattach)n(e);if(i.length===0)(n=e._zod).deferred??(n.deferred=[]),e._zod.deferred?.push(()=>{e._zod.run=e._zod.parse});else{let t=(t,n,r)=>{if(t.memo)return t;let i=xf(t),a;for(let o of n){if(o._zod.def.when){if(Sf(t)||!o._zod.def.when(t))continue}else if(i)continue;let n=t.issues.length,s=o._zod.check(t);if(s instanceof Promise&&r?.async===!1)throw new Xf;if(a||s instanceof Promise)a=(a??Promise.resolve()).then(async()=>{await s,t.issues.length!==n&&(Tf(t.issues,n,e),i||=xf(t,n))});else{if(t.issues.length===n)continue;Tf(t.issues,n,e),i||=xf(t,n)}}return a?a.then(()=>t):t},n=(n,r,a)=>{if(xf(n))return n.aborted=!0,n;let o=t(r,i,a);if(o instanceof Promise){if(a.async===!1)throw new Xf;return o.then(t=>e._zod.parse(t,a))}return e._zod.parse(o,a)};e._zod.run=(r,a)=>{if(a.skipChecks)return e._zod.parse(r,a);if(a.direction===`backward`){let t=e._zod.parse({value:r.value,issues:[]},{...a,skipChecks:!0});return t instanceof Promise?t.then(e=>n(e,r,a)):n(t,r,a)}let o=e._zod.parse(r,a);if(o instanceof Promise){if(a.async===!1)throw new Xf;return o.then(e=>t(e,i,a))}return t(o,i,a)}}},{get"~standard"(){return Pf(this,`~standard`,Mm(this))},set"~standard"(e){Nf(this,`~standard`,e)}}),Am=(e,t)=>e.issues.length?{issues:e.issues.map(e=>Ef(e,t,Qf()))}:{value:e.value};async function jm(e,t){let n={async:!0};return Am(await e._zod.run({value:t,issues:[]},n),n)}function Mm(e){return{validate:t=>{let n={async:!1};try{let r=e._zod.run({value:t,issues:[]},n);if(!(r instanceof Promise))return Am(r,n)}catch{}return jm(e,t)},vendor:`zod`,version:1}}var Nm=V(`$ZodString`,(e,t)=>{km.init(e,t),e._zod.pattern=t.pattern??tm,e._zod.parse=(n,r)=>{if(t.coerce)try{n.value=String(n.value)}catch{}return typeof n.value==`string`||n.issues.push({expected:`string`,code:`invalid_type`,input:n.value,inst:e}),n}}),Pm=V(`$ZodStringFormat`,(e,t)=>{ym.init(e,t),Nm.init(e,t)}),Fm=V(`$ZodGUID`,(e,t)=>{t.pattern??=Ip,Pm.init(e,t)}),Im=V(`$ZodUUID`,(e,t)=>{if(t.version){let e={v1:1,v2:2,v3:3,v4:4,v5:5,v6:6,v7:7,v8:8}[t.version];if(e===void 0)throw Error(`Invalid UUID version: "${t.version}"`);t.pattern??=Lp(e)}else t.pattern??=Lp();Pm.init(e,t)}),Lm=V(`$ZodEmail`,(e,t)=>{t.pattern??=Rp,Pm.init(e,t)});function Rm(e){try{return typeof URL<`u`&&typeof URL.canParse==`function`?URL.canParse(e):(new URL(e),!0)}catch{return!1}}function zm(e,t){return!(`normalize`in t)&&!(`hostname`in t)&&!(`protocol`in t)?Rm(e)||2:Bm(e,t)}function Bm(e,t){if(!t.normalize&&t.protocol?.source===qp.source&&!/^https?:\/\//i.test(e))return 1;try{if(typeof URL<`u`){let t=URL;if(typeof t.parse==`function`)return t.parse(e)??2}return new URL(e)}catch{return 2}}var Vm=/[\t\n\r]/g;function Hm(e){return e.replace(Vm,``)}function Um(e,t){return t.lastIndex=0,t.test(e.hostname)}function Wm(e,t){return t.lastIndex=0,t.test(e.protocol.endsWith(`:`)?e.protocol.slice(0,-1):e.protocol)}var Gm=V(`$ZodURL`,(e,t)=>{Pm.init(e,t),e._zod.check=n=>{try{let r=n.value.trim(),i=zm(r,t);if(i===1){n.issues.push({code:`invalid_format`,format:`url`,note:`Invalid URL format`,input:n.value,inst:e,continue:!t.abort});return}if(i===2){n.issues.push({code:`invalid_format`,format:`url`,input:n.value,inst:e,continue:!t.abort});return}if(i===!0){n.value=Hm(r);return}t.hostname&&!Um(i,t.hostname)&&n.issues.push({code:`invalid_format`,format:`url`,note:`Invalid hostname`,pattern:t.hostname.source,input:n.value,inst:e,continue:!t.abort}),t.protocol&&!Wm(i,t.protocol)&&n.issues.push({code:`invalid_format`,format:`url`,note:`Invalid protocol`,pattern:t.protocol.source,input:n.value,inst:e,continue:!t.abort}),n.value=t.normalize?i.href:Hm(r);return}catch{n.issues.push({code:`invalid_format`,format:`url`,input:n.value,inst:e,continue:!t.abort})}}}),Km=V(`$ZodEmoji`,(e,t)=>{t.pattern??=Bp(),Pm.init(e,t)}),qm=V(`$ZodNanoID`,(e,t)=>{if(t.length!==void 0&&(!Number.isInteger(t.length)||t.length<1))throw Error(`Invalid nanoid length: ${t.length}`);t.pattern??=t.length===void 0?Np:Pp(t.length),Pm.init(e,t)}),Jm=V(`$ZodCUID`,(e,t)=>{t.pattern??=Op,Pm.init(e,t)}),Ym=V(`$ZodCUID2`,(e,t)=>{t.pattern??=kp,Pm.init(e,t)}),Xm=V(`$ZodULID`,(e,t)=>{t.pattern??=Ap,Pm.init(e,t)}),Zm=V(`$ZodXID`,(e,t)=>{t.pattern??=jp,Pm.init(e,t)}),Qm=V(`$ZodKSUID`,(e,t)=>{t.pattern??=Mp,Pm.init(e,t)}),$m=V(`$ZodISODateTime`,(e,t)=>{t.pattern??=em(t),Pm.init(e,t)}),eh=V(`$ZodISODate`,(e,t)=>{t.pattern??=Zp,Pm.init(e,t)}),th=V(`$ZodISOTime`,(e,t)=>{t.pattern??=$p(t),Pm.init(e,t)}),nh=V(`$ZodISODuration`,(e,t)=>{t.pattern??=Fp,Pm.init(e,t)}),rh=V(`$ZodIPv4`,(e,t)=>{t.pattern??=Vp,Pm.init(e,t)}),ih=/^[0-9a-fA-F:.]+$/;function ah(e){return ih.test(e)?Rm(`http://[${e}]`):!1}var oh=V(`$ZodIPv6`,(e,t)=>{t.pattern??=Hp,Pm.init(e,t),e._zod.check=n=>{ah(n.value)||n.issues.push({code:`invalid_format`,format:`ipv6`,input:n.value,inst:e,continue:!t.abort})}}),sh=V(`$ZodCIDRv4`,(e,t)=>{t.pattern??=Up,Pm.init(e,t)});function ch(e){let t=e.split(`/`);if(t.length!==2)return!1;let[n,r]=t;if(!r)return!1;let i=Number(r);return`${i}`!==r||i<0||i>128?!1:ah(n)}var lh=V(`$ZodCIDRv6`,(e,t)=>{t.pattern??=Wp,Pm.init(e,t),e._zod.check=n=>{ch(n.value)||n.issues.push({code:`invalid_format`,format:`cidrv6`,input:n.value,inst:e,continue:!t.abort})}});function uh(e){if(e===``)return!0;if(/\s/.test(e)||e.length%4!=0)return!1;try{return atob(e),!0}catch{return!1}}var dh=/^[0-9a-zA-Z+/]*={0,2}$/,fh=V(`$ZodBase64`,(e,t)=>{t.pattern??=dh,Pm.init(e,t),e._zod.check=n=>{uh(n.value)||n.issues.push({code:`invalid_format`,format:`base64`,input:n.value,inst:e,continue:!t.abort})}}),ph=/^[A-Za-z0-9_-]*$/;function mh(e){if(!ph.test(e))return!1;let t=e.replace(/[-_]/g,e=>e===`-`?`+`:`/`);return uh(t.padEnd(Math.ceil(t.length/4)*4,`=`))}var hh=V(`$ZodBase64URL`,(e,t)=>{t.pattern??=ph,Pm.init(e,t),e._zod.check=n=>{mh(n.value)||n.issues.push({code:`invalid_format`,format:`base64url`,input:n.value,inst:e,continue:!t.abort})}}),gh=V(`$ZodE164`,(e,t)=>{t.pattern??=Jp,Pm.init(e,t)});function _h(e,t=null){try{let n=e.split(`.`);if(n.length!==3)return!1;let[r]=n;if(!r)return!1;let i=JSON.parse(atob(r));return!(`typ`in i&&i?.typ!==`JWT`||!i.alg||t&&(!(`alg`in i)||i.alg!==t))}catch{return!1}}var vh=V(`$ZodJWT`,(e,t)=>{Pm.init(e,t),e._zod.check=n=>{_h(n.value,t.alg)||n.issues.push({code:`invalid_format`,format:`jwt`,input:n.value,inst:e,continue:!t.abort})}}),yh=V(`$ZodNumber`,(e,t)=>{km.init(e,t),e._zod.pattern=rm,e._zod.parse=(n,r)=>{if(t.coerce)try{n.value=Number(n.value)}catch{}let i=n.value;if(typeof i==`number`&&!Number.isNaN(i)&&Number.isFinite(i))return n;let a=typeof i==`number`?Number.isNaN(i)?`NaN`:Number.isFinite(i)?void 0:String(i):void 0;return n.issues.push({expected:`number`,code:`invalid_type`,input:i,inst:e,...a?{received:a}:{}}),n}}),bh=V(`$ZodNumberFormat`,(e,t)=>{hm.init(e,t),yh.init(e,t)}),xh=V(`$ZodBoolean`,(e,t)=>{km.init(e,t),e._zod.pattern=im,e._zod.parse=(n,r)=>{if(t.coerce)try{n.value=!!n.value}catch{}let i=n.value;return typeof i==`boolean`||n.issues.push({expected:`boolean`,code:`invalid_type`,input:i,inst:e}),n}}),Sh=V(`$ZodUndefined`,(e,t)=>{km.init(e,t),e._zod.pattern=om,e._zod.values=new Set([void 0]),e._zod.parse=(t,n)=>{let r=t.value;return r===void 0||t.issues.push({expected:`undefined`,code:`invalid_type`,input:r,inst:e}),t}}),Ch=V(`$ZodNull`,(e,t)=>{km.init(e,t),e._zod.pattern=am,e._zod.values=new Set([null]),e._zod.parse=(t,n)=>{let r=t.value;return r===null||t.issues.push({expected:`null`,code:`invalid_type`,input:r,inst:e}),t}}),wh=V(`$ZodAny`,(e,t)=>{km.init(e,t),e._zod.parse=e=>e}),Th=V(`$ZodUnknown`,(e,t)=>{km.init(e,t),e._zod.parse=e=>e}),Eh=V(`$ZodNever`,(e,t)=>{km.init(e,t),e._zod.parse=(t,n)=>(t.issues.push({expected:`never`,code:`invalid_type`,input:t.value,inst:e}),t)});function Dh(e,t,n){e.issues.length&&t.issues.push(...Cf(n,e.issues)),t.value[n]=e.value}var Oh=V(`$ZodArray`,(e,t)=>{km.init(e,t);let n=H.memoizer;n?.attach(e),e._zod.parse=(r,i)=>{let a=r.value;if(!Array.isArray(a))return r.issues.push({expected:`array`,code:`invalid_type`,input:a,inst:e}),r;r.value=n?n.alloc(e,r,Array(a.length),i):Array(a.length);let o=[],s=i?.abortEarly;for(let e=0;eDh(t,r,e)));else if(Dh(c,r,e),s&&c.issues.length!==0&&xf(c))break}return o.length?Promise.all(o).then(()=>r):r}});function kh(e,t,n,r,i,a){let o=n in r,s=a===`optional`;if(o||!s||i!==`optional`){if(e.issues.length){if(i!==void 0&&s&&!o)return;t.issues.push(...Cf(n,e.issues))}if(!o&&i===void 0){e.issues.length||t.issues.push({code:`invalid_type`,expected:`nonoptional`,input:void 0,path:[n]});return}e.value===void 0?(o||i===`defaulted`&&!s)&&(t.value[n]=void 0):t.value[n]=e.value}}var Ah=[];function jh(e){let t=Object.keys(e.shape),n=Object.getOwnPropertySymbols(e.shape),r=n.length?n:Ah,i=r.length?[...t,...r]:t;for(let t of i)if(!e.shape?.[t]?._zod?.traits?.has(`$ZodType`))throw Error(`Invalid element at key "${String(t)}": expected a Zod schema`);let a=lf(e.shape);return{...e,allKeys:i,symbolKeys:r,keySet:new Set(t),numKeys:t.length,optionalKeys:new Set(a)}}function Mh(e,t,n,r,i,a,o){let s=[],c=i.keySet,l=i.catchall._zod,u=l.def.type,d=l.optin,f=l.optout,p=0;for(let i in t){if(o&&n.issues.length!==p){if(xf(n,p))break;p=n.issues.length}if(c.has(i))continue;if(i===`__proto__`){u===`never`&&s.push(i);continue}if(u===`never`){s.push(i);continue}let a=l.run({value:t[i],issues:[]},r);a instanceof Promise?e.push(a.then(e=>kh(e,n,i,t,d,f))):kh(a,n,i,t,d,f)}return s.length&&n.issues.push({code:`unrecognized_keys`,keys:s,input:t,inst:a,continue:!0}),e.length?Promise.all(e).then(()=>n):n}var Nh=V(`$ZodObject`,(e,t)=>{km.init(e,t);let n=Object.getOwnPropertyDescriptor(t,`shape`),r=n?.get?n.get.raw:t.shape??{};if(r){let e=()=>{let n={...r};return Object.defineProperty(t,"shape",{value:n}),e.raw=n,n};e.raw=r,Object.defineProperty(t,"shape",{get:e})}let i=Ld(()=>jh(t));Vf(e,`propValues`,e=>{let t=e.def.shape,n={};for(let e in t){let r=t[e]._zod;if(r.values){Object.prototype.hasOwnProperty.call(n,e)||Ud(n,e,new Set);for(let t of r.values)n[e].add(t);r.optin!==void 0&&n[e].add(void 0)}}return n});let a=ef,o=t.catchall,s,c=H.memoizer;c?.attach(e),e._zod.parse=(t,n)=>{s??=i.value;let r=t.value;if(!a(r))return t.issues.push({expected:`object`,code:`invalid_type`,input:r,inst:e}),t;t.value=c?c.alloc(e,t,{},n):{};let l=[],u=s.shape,d=n?.abortEarly,f=t.issues.length;for(let e of s.allKeys){if(d&&t.issues.length!==f){if(xf(t,f))break;f=t.issues.length}if(e===`__proto__`)continue;let i=u[e],a=i._zod.optin,o=i._zod.optout,s=i._zod.run({value:r[e],issues:[]},n);s instanceof Promise?l.push(s.then(n=>kh(n,t,e,r,a,o))):kh(s,t,e,r,a,o)}return o?Mh(l,r,t,n,i.value,e,d===!0):l.length?Promise.all(l).then(()=>t):t}}),Ph=V(`$ZodObjectJIT`,(e,t)=>{Nh.init(e,t);let n=e._zod.parse,r=Ld(()=>jh(t)),i=H.memoizer,a=t=>{let n=r.value,a=n.symbolKeys,o=new Dm([`payload`,`ctx`],{shape:t,inst:e,memo:i,syms:a}),s=e=>`shape[${e}]._zod.run({ value: input[${e}], issues: [] }, ctx)`,c=(e,t)=>` + let ${e}_ab = false; + for (let i = 0; i < ${e}.issues.length; i++) { + const iss = ${e}.issues[i]; + iss.path = iss.path ? [${t}, ...iss.path] : [${t}]; + payload.issues.push(iss); + if (iss.continue !== true) ${e}_ab = true; + } + if (${e}_ab && ctx && ctx.abortEarly) { + payload.value = newResult; + return payload; + }`;o.write(`const input = payload.value;`);let l=Object.create(null),u=0;for(let e of n.allKeys)l[e]=`key_${u++}`;o.write(i?`const newResult = memo.alloc(inst, payload, {}, ctx);`:`const newResult = {};`);for(let e of n.allKeys){if(e===`__proto__`)continue;let n=l[e],r=typeof e==`symbol`?`syms[${a.indexOf(e)}]`:Zd(e),i=`${r} in input`,u=t[e],d=u?._zod?.optin,f=d!==void 0,p=u?._zod?.optout===`optional`;if(o.write(`const ${n} = ${s(r)};`),f&&p){let e=d===`optional`?`${n}_present`:`${n}.value !== undefined || ${n}_present`;o.write(` + const ${n}_present = ${i}; + if (!${n}.issues.length || ${n}_present) { + if (${n}.issues.length) {${c(n,r)} + } + + if (${e}) { + newResult[${r}] = ${n}.value; + } + } + + `)}else f?(o.write(` + if (${n}.issues.length) {${c(n,r)} + } + `),d===`defaulted`?o.write(`newResult[${r}] = ${n}.value;`):o.write(` + if (${n}.value !== undefined || ${i}) { + newResult[${r}] = ${n}.value; + } + `)):o.write(` + const ${n}_present = ${i}; + if (${n}.issues.length) {${c(n,r)} + } + if (!${n}_present && !${n}.issues.length) { + payload.issues.push({ + code: "invalid_type", + expected: "nonoptional", + input: undefined, + path: [${r}] + }); + if (ctx && ctx.abortEarly) { + payload.value = newResult; + return payload; + } + } + + if (${n}_present) { + newResult[${r}] = ${n}.value; + } + + `)}return o.write(`payload.value = newResult;`),o.write(`return payload;`),o.compile()},o,s=ef,c=!H.jitless,l=c&&tf.value,u=t.catchall,d;e._zod.parse=(i,f)=>{d??=r.value;let p=i.value;return s(p)?c&&l&&f?.async===!1&&f.jitless!==!0?(o||=a(t.shape),i=o(i,f),u?Mh([],p,i,f,d,e,f?.abortEarly===!0):i):n(i,f):(i.issues.push({expected:`object`,code:`invalid_type`,input:p,inst:e}),i)}});function Fh(e,t,n,r){for(let n of e)if(n.issues.length===0)return t.value=n.value,t;let i=e.filter(e=>!xf(e));return i.length===1?(t.value=i[0].value,i[0]):(t.issues.push({code:`invalid_union`,input:t.value,inst:n,errors:e.map(e=>e.issues.map(e=>Ef(e,r,Qf())))}),t)}var Ih=V(`$ZodUnion`,(e,t)=>{km.init(e,t),Vf(e,`optin`,e=>e.def.options.some(e=>e._zod.optin===`defaulted`)?`defaulted`:e.def.options.some(e=>e._zod.optin!==void 0)?`optional`:void 0),Vf(e,`optout`,e=>e.def.options.some(e=>e._zod.optout===`optional`)?`optional`:void 0),Vf(e,`values`,e=>{if(e.def.options.every(e=>e._zod.values))return new Set(e.def.options.flatMap(e=>Array.from(e._zod.values)))}),Vf(e,`pattern`,e=>{if(e.def.options.every(e=>e._zod.pattern)){let t=e.def.options.map(e=>e._zod.pattern);return RegExp(`^(${t.map(e=>zd(e.source)).join(`|`)})$`)}});let n=t.options.length===1?t.options[0]._zod.run:null;e._zod.parse=(r,i)=>{if(n)return n(r,i);let a=!1,o=[];for(let e of t.options){let t=e._zod.run({value:r.value,issues:[]},i);if(t instanceof Promise)o.push(t),a=!0;else{if(t.issues.length===0)return t;o.push(t)}}return a?Promise.all(o).then(t=>Fh(t,r,e,i)):Fh(o,r,e,i)}});function Lh(e){let t=new Map;for(let n of e.options){let r=n._zod.propValues?.[e.discriminator];if(!r||r.size===0)throw Error(`Invalid discriminated union option at index "${e.options.indexOf(n)}"`);for(let e of r)if(t.has(e)){if(e!==void 0)throw Error(`Duplicate discriminator value "${String(e)}"`);t.set(e,null)}else t.set(e,n)}return t}var Rh=V(`$ZodDiscriminatedUnion`,(e,t)=>{t.inclusive=!1,Ih.init(e,t);let n=e._zod.parse;Vf(e,`propValues`,e=>{let t={},n=0;for(let r of e.def.options){let i=r._zod.propValues;if(!i||Object.keys(i).length===0)throw Error(`Invalid discriminated union option at index "${e.def.options.indexOf(r)}"`);i[e.def.discriminator]?.has(void 0)&&n++;for(let[e,n]of Object.entries(i)){Object.prototype.hasOwnProperty.call(t,e)||Ud(t,e,new Set);for(let r of n)t[e].add(r)}}return!e.def.unionFallback&&n>1&&t[e.def.discriminator]?.delete(void 0),t}),t.options.forEach((e,n)=>{let r=Wd(e._zod.def);if(r&&!Object.prototype.hasOwnProperty.call(r,t.discriminator))throw Error(`Invalid discriminated union option at index "${n}"`)});let r=Ld(()=>Lh(t));e._zod.parse=(i,a)=>{let o=i.value;if(!ef(o))return i.issues.push({code:`invalid_type`,expected:`object`,input:o,inst:e}),i;let s=o?.[t.discriminator],c=r.value.get(s);return c&&(s!==void 0||a.direction!==`backward`)?c._zod.run(i,a):t.unionFallback||a.direction===`backward`?n(i,a):(i.issues.push({code:`invalid_union`,errors:[],note:`No matching discriminator`,discriminator:t.discriminator,options:Array.from(r.value.keys()).filter(e=>r.value.get(e)!==null),input:o,path:[t.discriminator],inst:e}),i)}}),zh=V(`$ZodIntersection`,(e,t)=>{km.init(e,t),e._zod.parse=(e,n)=>{let r=e.value,i=t.left._zod.run({value:r,issues:[]},n),a=t.right._zod.run({value:r,issues:[]},n);return i instanceof Promise||a instanceof Promise?Promise.all([i,a]).then(([t,n])=>Vh(e,t,n)):Vh(e,i,a)}});function Bh(e,t){if(e===t||e instanceof Date&&t instanceof Date&&+e==+t)return{valid:!0,data:e};if(nf(e)&&nf(t)){let n=Object.keys(t),r=Object.keys(e).filter(e=>n.indexOf(e)!==-1),i={...e,...t};Object.prototype.hasOwnProperty.call(i,`__proto__`)&&delete i.__proto__;for(let n of r){if(n===`__proto__`)continue;let r=Bh(e[n],t[n]);if(!r.valid)return{valid:!1,mergeErrorPath:[n,...r.mergeErrorPath]};i[n]=r.data}return{valid:!0,data:i}}if(Array.isArray(e)&&Array.isArray(t)){if(e.length!==t.length)return{valid:!1,mergeErrorPath:[]};let n=[];for(let r=0;r{let n;if(e.code===`unrecognized_keys`&&!e.path?.length)i??=e,n=e.keys;else if(e.code===`invalid_key`&&e.origin===`record`&&e.path?.length===1){let t=String(e.path[0]);a.has(t)||a.set(t,e),n=[t]}else return!1;for(let e of n)r.has(e)||r.set(e,{}),r.get(e)[t]=!0;return!0};for(let n of t.issues)o(n,`l`)||e.issues.push(n);for(let t of n.issues)o(t,`r`)||e.issues.push(t);let s=[...r].filter(([,e])=>e.l&&e.r).map(([e])=>e);if(s.length){let t=i?s.filter(e=>i.keys.includes(e)):[];t.length&&e.issues.push({...i,keys:t});for(let n of s)!t.includes(n)&&a.has(n)&&e.issues.push(a.get(n))}let c=Bh(t.value,n.value);if(!c.valid){if(xf(e))return e;throw Error(`Unmergable intersection. Error path: ${JSON.stringify(c.mergeErrorPath)}`)}return e.value=c.data,e}var Hh=V(`$ZodRecord`,(e,t)=>{km.init(e,t);let n=H.memoizer;n?.attach(e),e._zod.parse=(r,i)=>{let a=r.value;if(!nf(a))return r.issues.push({expected:`record`,code:`invalid_type`,input:a,inst:e}),r;let o=[],s=t.keyType._zod.values;if(s&&!t.partial){r.value=n?n.alloc(e,r,{},i):{};let c=new Set;for(let n of s)if(typeof n==`string`||typeof n==`number`||typeof n==`symbol`){if(c.add(typeof n==`number`?n.toString():n),n===`__proto__`)continue;let s=t.keyType._zod.run({value:n,issues:[]},i);if(s instanceof Promise)throw Error(`Async schemas not supported in object keys currently`);if(s.issues.length){r.issues.push({code:`invalid_key`,origin:`record`,issues:s.issues.map(e=>Ef(e,i,Qf())),input:n,path:[n],inst:e});continue}let l=s.value;if(l===`__proto__`)continue;let u=t.valueType._zod.run({value:a[n],issues:[]},i);u instanceof Promise?o.push(u.then(e=>{e.issues.length&&r.issues.push(...Cf(n,e.issues)),r.value[l]=e.value})):(u.issues.length&&r.issues.push(...Cf(n,u.issues)),r.value[l]=u.value)}let l;for(let e in a)if(!c.has(e)){if(t.mode===`loose`){if(e===`__proto__`)continue;r.value[e]=a[e]}else l??=[],l.push(e)}l&&l.length>0&&r.issues.push({code:`unrecognized_keys`,input:a,inst:e,keys:l,continue:!0})}else{r.value=n?n.alloc(e,r,{},i):{};let c;for(let n of Reflect.ownKeys(a)){if(n===`__proto__`||!Object.prototype.propertyIsEnumerable.call(a,n))continue;let l=t.keyType._zod.run({value:n,issues:[]},i);if(l instanceof Promise)throw Error(`Async schemas not supported in object keys currently`);if(typeof n==`string`&&rm.test(n)&&l.issues.length){let e=t.keyType._zod.run({value:Number(n),issues:[]},i);if(e instanceof Promise)throw Error(`Async schemas not supported in object keys currently`);e.issues.length===0&&(l=e)}if(l.issues.length){t.mode===`loose`?r.value[n]=a[n]:s?(c??=[],c.push(n)):r.issues.push({code:`invalid_key`,origin:`record`,issues:l.issues.map(e=>Ef(e,i,Qf())),input:n,path:[n],inst:e});continue}let u=l.value;if(u===`__proto__`)continue;let d=t.valueType._zod.run({value:a[n],issues:[]},i);d instanceof Promise?o.push(d.then(e=>{e.issues.length&&r.issues.push(...Cf(n,e.issues)),r.value[u]=e.value})):(d.issues.length&&r.issues.push(...Cf(n,d.issues)),r.value[u]=d.value)}c&&c.length>0&&r.issues.push({code:`unrecognized_keys`,input:a,inst:e,keys:c,continue:!0})}return o.length?Promise.all(o).then(()=>r):r}}),Uh=V(`$ZodEnum`,(e,t)=>{km.init(e,t);let n=Nd(t.entries),r=new Set(n);e._zod.values=r,Vf(e,`pattern`,e=>{let t=Nd(e.def.entries).filter(e=>af.has(typeof e));return RegExp(t.length?`^(${t.map(e=>of(e.toString())).join(`|`)})$`:`^[^\\s\\S]$`)}),e._zod.parse=(t,i)=>{let a=t.value;return r.has(a)||t.issues.push({code:`invalid_value`,values:n,input:a,inst:e}),t}}),Wh=V(`$ZodLiteral`,(e,t)=>{km.init(e,t);let n=new Set(t.values);e._zod.values=n,Vf(e,`pattern`,e=>{let t=e.def.values;return RegExp(t.length?`^(${t.map(e=>typeof e==`string`?of(e):e?of(e.toString()):String(e)).join(`|`)})$`:`^[^\\s\\S]$`)}),e._zod.parse=(r,i)=>{let a=r.value;return n.has(a)||r.issues.push({code:`invalid_value`,values:t.values,input:a,inst:e}),r}}),Gh=V(`$ZodTransform`,(e,t)=>{km.init(e,t),e._zod.optin=`optional`,H.memoizer?.guard(e),e._zod.parse=(n,r)=>{if(r.direction===`backward`)throw new Zf(e.constructor.name);let i=t.transform(n.value,n);if(r.async)return(i instanceof Promise?i:Promise.resolve(i)).then(e=>(n.value=e,n));if(i instanceof Promise)throw new Xf;return n.value=i,n}});function Kh(e,t){return e.value=t.issues.length?void 0:t.value,e}var qh=V(`$ZodOptional`,(e,t)=>{km.init(e,t),Vf(e,`optin`,e=>e.def.innerType._zod.optin===`defaulted`?`defaulted`:`optional`),e._zod.optout=`optional`,Vf(e,`values`,e=>{let t=e.def.innerType._zod.values;return t?new Set([...t,void 0]):void 0}),Vf(e,`pattern`,e=>{let t=e.def.innerType._zod.pattern;return t?RegExp(`^(${zd(t.source)})?$`):void 0}),e._zod.parse=(e,n)=>{if(e.value===void 0){if(t.innerType._zod.optin!==`defaulted`)return e;let r=t.innerType._zod.run({value:e.value,issues:[]},n);return r instanceof Promise?r.then(t=>Kh(e,t)):Kh(e,r)}return t.innerType._zod.run(e,n)}}),Jh=V(`$ZodExactOptional`,(e,t)=>{qh.init(e,t),Vf(e,`values`,e=>e.def.innerType._zod.values),Vf(e,`pattern`,e=>e.def.innerType._zod.pattern),e._zod.parse=(e,n)=>t.innerType._zod.run(e,n)}),Yh=V(`$ZodNullable`,(e,t)=>{km.init(e,t),Vf(e,`optin`,e=>e.def.innerType._zod.optin),Vf(e,`optout`,e=>e.def.innerType._zod.optout),Vf(e,`pattern`,e=>{let t=e.def.innerType._zod.pattern;return t?RegExp(`^(${zd(t.source)}|null)$`):void 0}),Vf(e,`values`,e=>e.def.innerType._zod.values?new Set([...e.def.innerType._zod.values,null]):void 0),e._zod.parse=(e,n)=>e.value===null?e:t.innerType._zod.run(e,n)}),Xh=V(`$ZodDefault`,(e,t)=>{km.init(e,t),e._zod.optin=`defaulted`,Vf(e,`values`,e=>e.def.innerType._zod.values),e._zod.parse=(e,n)=>{if(n.direction===`backward`)return t.innerType._zod.run(e,n);if(e.value===void 0)return e.value=t.defaultValue,e;let r=t.innerType._zod.run(e,n);return r instanceof Promise?r.then(e=>Zh(e,t)):Zh(r,t)}});function Zh(e,t){return e.value===void 0&&(e.value=t.defaultValue),e}var Qh=V(`$ZodPrefault`,(e,t)=>{km.init(e,t),e._zod.optin=`defaulted`,Vf(e,`values`,e=>e.def.innerType._zod.values),e._zod.parse=(e,n)=>(n.direction===`backward`||e.value===void 0&&(e.value=t.defaultValue),t.innerType._zod.run(e,n))}),$h=V(`$ZodNonOptional`,(e,t)=>{km.init(e,t),Vf(e,`values`,e=>{let t=e.def.innerType._zod.values;return t?new Set([...t].filter(e=>e!==void 0)):void 0}),e._zod.parse=(n,r)=>{let i=t.innerType._zod.run(n,r);return i instanceof Promise?i.then(t=>eg(t,e)):eg(i,e)}});function eg(e,t){return!e.issues.length&&e.value===void 0&&e.issues.push({code:`invalid_type`,expected:`nonoptional`,input:e.value,inst:t}),e}function tg(e,t,n,r){return t.issues.length?(e.value=n.catchValue({...t,value:e.value,error:{issues:t.issues.map(e=>Ef(e,r,Qf()))},input:e.value}),e):(e.value=t.value,t.memo&&(e.memo=!0),e)}var ng=V(`$ZodCatch`,(e,t)=>{km.init(e,t),Vf(e,`optin`,e=>e.def.innerType._zod.optin===`defaulted`?`defaulted`:`optional`),Vf(e,`optout`,e=>e.def.innerType._zod.optout),Vf(e,`values`,e=>e.def.innerType._zod.values),e._zod.parse=(e,n)=>{if(n.direction===`backward`)return t.innerType._zod.run(e,n);let r=t.innerType._zod.run({value:e.value,issues:[]},n);return r instanceof Promise?r.then(r=>tg(e,r,t,n)):tg(e,r,t,n)}}),rg=V(`$ZodPipe`,(e,t)=>{km.init(e,t),Vf(e,`values`,e=>e.def.in._zod.values),Vf(e,`optin`,e=>e.def.in._zod.optin),Vf(e,`optout`,e=>e.def.out._zod.optout),Vf(e,`propValues`,e=>e.def.in._zod.propValues),e._zod.parse=(e,n)=>{if(n.direction===`backward`){let r=t.out._zod.run(e,n);return r instanceof Promise?r.then(e=>ig(e,t.in,n)):ig(r,t.in,n)}let r=t.in._zod.run(e,n);return r instanceof Promise?r.then(e=>ig(e,t.out,n)):ig(r,t.out,n)}});function ig(e,t,n){return e.issues.some(e=>e.code!==`unrecognized_keys`)?(e.aborted=!0,e):t._zod.run({value:e.value,issues:e.issues},n)}var ag=V(`$ZodPreprocess`,(e,t)=>{rg.init(e,t)}),og=V(`$ZodReadonly`,(e,t)=>{km.init(e,t),Vf(e,`propValues`,e=>e.def.innerType._zod.propValues),Vf(e,`values`,e=>e.def.innerType._zod.values),Vf(e,`optin`,e=>e.def.innerType?._zod?.optin),Vf(e,`optout`,e=>e.def.innerType?._zod?.optout),e._zod.parse=(e,n)=>{if(n.direction===`backward`)return t.innerType._zod.run(e,n);let r=t.innerType._zod.run(e,n);return r instanceof Promise?r.then(sg):sg(r)}});function sg(e){return e.memo||(e.value=Object.freeze(e.value)),e}var cg=V(`$ZodLazy`,(e,t)=>{km.init(e,t),Hd(e._zod,`innerType`,()=>{let e=t;return e._cachedInner||=t.getter(),e._cachedInner}),Vf(e,`pattern`,e=>e.innerType?._zod?.pattern),Vf(e,`propValues`,e=>e.innerType?._zod?.propValues),Vf(e,`optin`,e=>e.innerType?._zod?.optin??void 0),Vf(e,`optout`,e=>e.innerType?._zod?.optout??void 0),e._zod.parse=(t,n)=>e._zod.innerType._zod.run(t,n)}),lg=V(`$ZodCustom`,(e,t)=>{lm.init(e,t),km.init(e,t),e._zod.parse=(e,t)=>e,e._zod.check=n=>{let r=n.value,i=t.fn(r);if(i instanceof Promise)return i.then(t=>ug(t,n,r,e));ug(i,n,r,e)}});function ug(e,t,n,r){if(!e){let e={code:`custom`,input:n,inst:r,path:[...r._zod.def.path??[]],continue:!r._zod.def.abort};r._zod.def.params&&(e.params=r._zod.def.params),t.issues.push(jf(e))}}var dg=class extends Error{constructor(){super(`Cannot parse a reference cycle that closes through a transform`),this.name=`ZodCyclicError`}},fg=`~memo`,pg=[];function mg(e){return typeof e==`object`&&!!e}function hg(e){return e.map(e=>e.path?{...e,path:e.path.slice()}:{...e})}var gg=new WeakMap,_g=0,vg=1,yg=2;function bg(e,t,n){let r=gg.get(e);if(r!==void 0)return r?yg:_g;if(t.has(e))return yg;t.add(e);let i=_g,a=e=>{if(i!==yg&&e?._zod){let r=bg(e,t,n);r>i&&(i=r)}},o=(e,r)=>{let i=_g;for(let a of Reflect.ownKeys(e)){let o=Object.getOwnPropertyDescriptor(e,a);if(r&&!o.enumerable)continue;let s=o.get?vg:o.value?._zod?bg(o.value,t,n):_g;s>i&&(i=s)}return i},s=e=>{e>i&&(i=e)},c=e._zod.def;switch(c.type){case`object`:{let e=Wd(c);s(e?o(e,!0):vg),a(c.catchall);break}case`array`:a(c.element);break;case`tuple`:for(let e of c.items)a(e);a(c.rest);break;case`record`:case`map`:a(c.keyType),a(c.valueType);break;case`set`:a(c.valueType);break;case`union`:for(let e of c.options)a(e);break;case`intersection`:a(c.left),a(c.right);break;case`optional`:case`nullable`:case`default`:case`prefault`:case`catch`:case`readonly`:case`nonoptional`:case`promise`:case`success`:a(c.innerType);break;case`pipe`:a(c.in),a(c.out);break;case`function`:a(c.input),a(c.output);break;case`lazy`:{let r=c._cachedInner??(n?e._zod.innerType:void 0);s(r?bg(r,t,!1):vg);break}case`template_literal`:case`string`:case`number`:case`int`:case`boolean`:case`bigint`:case`symbol`:case`undefined`:case`null`:case`void`:case`never`:case`any`:case`unknown`:case`date`:case`nan`:case`enum`:case`literal`:case`file`:case`transform`:case`custom`:break;default:for(let e in c){let t=Object.getOwnPropertyDescriptor(c,e);if(!t||t.get)continue;let n=t.value;if(n&&typeof n==`object`){if(n._zod)a(n);else if(Array.isArray(n))for(let e of n)a(e)}}}return t.delete(e),xg(e,i)}function xg(e,t){return t!==vg&&gg.set(e,t===yg),t}function Sg(e,t){let n=e.buckets.get(t);return n||(n=new WeakMap,e.buckets.set(t,n)),n}var Cg,wg=[],Tg={alloc(e,t,n){let r=Cg;if(!r)return n;Cg=void 0;let i={value:n,issues:null};return r.set(t.value,i),wg.push(i),n},guard(e){var t;(t=e._zod).deferred??(t.deferred=[]),e._zod.deferred.push(()=>{let t=e._zod.parse,n=(e,n)=>{if(n.direction!==`backward`&&Dg(n,e.value))throw new dg;return t(e,n)};e._zod.parse=n,e._zod.run===t&&(e._zod.run=n)})},attach(e){var t;let n,r=!1,i,a;(t=e._zod).deferred??(t.deferred=[]),e._zod.deferred.push(()=>{let t=e._zod.parse,o=(s,c)=>{if(n===void 0){let i=bg(e,new Set,!1);if(i===_g)return e._zod.parse=t,e._zod.run===o&&(e._zod.run=t),t(s,c);i===yg||r?n=!0:r=!0}let l=s.value;if(!mg(l))return t(s,c);let u=c[fg];u||(u={buckets:new WeakMap,backEdges:void 0},c[fg]=u);let d;i===c?d=a:(d=Sg(u,e),i=c,a=d);let f=d.get(l);if(f)return s.value=f.value,f.issues?f.issues.length&&s.issues.push(...hg(f.issues)):(s.memo=!0,u.backEdges??(u.backEdges=new WeakSet),u.backEdges.add(f.value)),s;Cg=d;let p=wg.length,m=t(s,c);Cg=void 0;let h=wg.length>p?wg.pop():void 0;return m instanceof Promise?m.then(e=>(h&&(h.issues=e.issues.length?hg(e.issues):pg),e)):(h&&(h.issues=m.issues.length?hg(m.issues):pg),m)};e._zod.parse=o,e._zod.run===t&&(e._zod.run=o)})}};function Eg(){return Tg}function Dg(e,t){let n=e[fg]?.backEdges;return n!==void 0&&mg(t)&&n.has(t)}var Og=()=>{let e={string:{unit:`characters`,verb:`to have`},file:{unit:`bytes`,verb:`to have`},array:{unit:`items`,verb:`to have`},set:{unit:`items`,verb:`to have`},map:{unit:`entries`,verb:`to have`}};function t(t){return e[t]??null}let n={regex:`input`,email:`email address`,url:`URL`,emoji:`emoji`,uuid:`UUID`,uuidv4:`UUIDv4`,uuidv6:`UUIDv6`,nanoid:`nanoid`,guid:`GUID`,cuid:`cuid`,cuid2:`cuid2`,ulid:`ULID`,xid:`XID`,ksuid:`KSUID`,datetime:`ISO datetime`,date:`ISO date`,time:`ISO time`,duration:`ISO duration`,ipv4:`IPv4 address`,ipv6:`IPv6 address`,mac:`MAC address`,cidrv4:`IPv4 range`,cidrv6:`IPv6 range`,base64:`base64-encoded string`,base64url:`base64url-encoded string`,json_string:`JSON string`,e164:`E.164 number`,currency_code:`currency code`,credit_card:`credit card number`,iban:`IBAN`,jwt:`JWT`,template_literal:`input`},r={nan:`NaN`};function i(e,t){return e===`number`&&typeof t==`number`&&!Number.isFinite(t)?String(t):r[e]??e}return e=>{switch(e.code){case`invalid_type`:return`Invalid input: expected ${i(e.expected)}, received ${i(Af(e.input),e.input)}`;case`invalid_value`:return e.values.length===1?`Invalid input: expected ${cf(e.values[0])}`:`Invalid option: expected one of ${Pd(e.values,`|`)}`;case`too_big`:{let n=e.exact?`exactly `:e.inclusive?`<=`:`<`,r=t(e.origin);return r?`Too big: expected ${e.origin??`value`} to have ${n}${e.maximum.toString()} ${r.unit??`elements`}`:`Too big: expected ${e.origin??`value`} to be ${n}${e.maximum.toString()}`}case`too_small`:{let n=e.exact?`exactly `:e.inclusive?`>=`:`>`,r=t(e.origin);return r?`Too small: expected ${e.origin} to have ${n}${e.minimum.toString()} ${r.unit}`:`Too small: expected ${e.origin} to be ${n}${e.minimum.toString()}`}case`invalid_format`:{let t=e;return t.format===`starts_with`?`Invalid string: must start with "${t.prefix}"`:t.format===`ends_with`?`Invalid string: must end with "${t.suffix}"`:t.format===`includes`?`Invalid string: must include "${t.includes}"`:t.format===`regex`?`Invalid string: must match pattern ${t.pattern}`:`Invalid ${n[t.format]??e.format}`}case`not_multiple_of`:return`Invalid number: must be a multiple of ${e.divisor}`;case`unrecognized_keys`:return`Unrecognized key${e.keys.length>1?`s`:``}: ${Pd(e.keys,`, `)}`;case`invalid_key`:return`Invalid key in ${e.origin}`;case`invalid_union`:return e.options&&Array.isArray(e.options)&&e.options.length>0?`Invalid discriminator value. Expected ${e.options.map(e=>`'${e}'`).join(` | `)}`:e.inclusive===!1?`Invalid input: more than one option matched`:`Invalid input`;case`invalid_element`:return`Invalid value in ${e.origin}`;default:return`Invalid input`}}};function kg(){return{localeError:Og()}}var Ag,jg=class{constructor(){this._map=new WeakMap,this._idmap=new Map}add(e,...t){let n=t[0];return this._map.set(e,n),n&&typeof n==`object`&&`id`in n&&this._idmap.set(n.id,e),this}clear(){return this._map=new WeakMap,this._idmap=new Map,this}remove(e){let t=this._map.get(e);return t&&typeof t==`object`&&`id`in t&&this._idmap.delete(t.id),this._map.delete(e),this}get(e){let t=e._zod.parent;if(t){let n={...this.get(t)??{}};delete n.id;let r={...n,...this._map.get(e)};return Object.keys(r).length?r:void 0}return this._map.get(e)}has(e){return this._map.has(e)}};function Mg(){return new jg}(Ag=globalThis).__zod_globalRegistry??(Ag.__zod_globalRegistry=Mg());var Ng=globalThis.__zod_globalRegistry;function Pg(e){return e.checks&&=[...e.checks],e}function Fg(e,t){return new e(Pg({type:`string`,...B(t)}))}function Ig(e,t){return new e({type:`string`,format:`email`,check:`string_format`,abort:!1,...B(t)})}function Lg(e,t){return new e({type:`string`,format:`guid`,check:`string_format`,abort:!1,...B(t)})}function Rg(e,t){return new e({type:`string`,format:`uuid`,check:`string_format`,abort:!1,...B(t)})}function zg(e,t){return new e({type:`string`,format:`uuid`,check:`string_format`,abort:!1,version:`v4`,...B(t)})}function Bg(e,t){return new e({type:`string`,format:`uuid`,check:`string_format`,abort:!1,version:`v6`,...B(t)})}function Vg(e,t){return new e({type:`string`,format:`uuid`,check:`string_format`,abort:!1,version:`v7`,...B(t)})}function Hg(e,t){return new e({type:`string`,format:`url`,check:`string_format`,abort:!1,...B(t)})}function Ug(e,t){return new e({type:`string`,format:`emoji`,check:`string_format`,abort:!1,...B(t)})}function Wg(e,t){return new e({type:`string`,format:`nanoid`,check:`string_format`,abort:!1,...B(t)})}function Gg(e,t){return new e({type:`string`,format:`cuid`,check:`string_format`,abort:!1,...B(t)})}function Kg(e,t){return new e({type:`string`,format:`cuid2`,check:`string_format`,abort:!1,...B(t)})}function qg(e,t){return new e({type:`string`,format:`ulid`,check:`string_format`,abort:!1,...B(t)})}function Jg(e,t){return new e({type:`string`,format:`xid`,check:`string_format`,abort:!1,...B(t)})}function Yg(e,t){return new e({type:`string`,format:`ksuid`,check:`string_format`,abort:!1,...B(t)})}function Xg(e,t){return new e({type:`string`,format:`ipv4`,check:`string_format`,abort:!1,...B(t)})}function Zg(e,t){return new e({type:`string`,format:`ipv6`,check:`string_format`,abort:!1,...B(t)})}function Qg(e,t){return new e({type:`string`,format:`cidrv4`,check:`string_format`,abort:!1,...B(t)})}function $g(e,t){return new e({type:`string`,format:`cidrv6`,check:`string_format`,abort:!1,...B(t)})}function e_(e,t){return new e({type:`string`,format:`base64`,check:`string_format`,abort:!1,...B(t)})}function t_(e,t){return new e({type:`string`,format:`base64url`,check:`string_format`,abort:!1,...B(t)})}function n_(e,t){return new e({type:`string`,format:`e164`,check:`string_format`,abort:!1,...B(t)})}function r_(e,t){return new e({type:`string`,format:`jwt`,check:`string_format`,abort:!1,...B(t)})}function i_(e,t){return new e({type:`string`,format:`datetime`,check:`string_format`,offset:!1,local:!1,precision:null,...B(t)})}function a_(e,t){return new e({type:`string`,format:`date`,check:`string_format`,...B(t)})}function o_(e,t){return new e({type:`string`,format:`time`,check:`string_format`,precision:null,...B(t)})}function s_(e,t){return new e({type:`string`,format:`duration`,check:`string_format`,...B(t)})}function c_(e,t){return new e(Pg({type:`number`,checks:[],...B(t)}))}function l_(e,t){return new e(Pg({type:`number`,coerce:!0,checks:[],...B(t)}))}function u_(e,t){return new e({type:`number`,check:`number_format`,abort:!1,format:`safeint`,...B(t)})}function d_(e,t){return new e({type:`boolean`,...B(t)})}function f_(e,t){return new e({type:`undefined`,...B(t)})}function p_(e,t){return new e({type:`null`,...B(t)})}function m_(e){return new e({type:`any`})}function h_(e){return new e({type:`unknown`})}function g_(e,t){return new e({type:`never`,...B(t)})}function __(e,t){return new fm({check:`less_than`,...B(t),value:e,inclusive:!1})}function v_(e,t){return new fm({check:`less_than`,...B(t),value:e,inclusive:!0})}function y_(e,t){return new pm({check:`greater_than`,...B(t),value:e,inclusive:!1})}function b_(e,t){return new pm({check:`greater_than`,...B(t),value:e,inclusive:!0})}function x_(e,t){return new mm({check:`multiple_of`,...B(t),value:e})}function S_(e,t){return new gm({check:`max_length`,...B(t),maximum:e})}function C_(e,t){return new _m({check:`min_length`,...B(t),minimum:e})}function w_(e,t){return new vm({check:`length_equals`,...B(t),length:e})}function T_(e,t){return new bm({check:`string_format`,format:`regex`,...B(t),pattern:e})}function E_(e){return new xm({check:`string_format`,format:`lowercase`,...B(e)})}function D_(e){return new Sm({check:`string_format`,format:`uppercase`,...B(e)})}function O_(e,t){return new Cm({check:`string_format`,format:`includes`,...B(t),includes:e})}function k_(e,t){return new wm({check:`string_format`,format:`starts_with`,...B(t),prefix:e})}function A_(e,t){return new Tm({check:`string_format`,format:`ends_with`,...B(t),suffix:e})}function j_(e){return new Em({check:`overwrite`,tx:e})}function M_(e){return j_(t=>t.normalize(e))}function N_(){return j_(e=>e.trim())}function P_(){return j_(e=>e.toLowerCase())}function F_(){return j_(e=>e.toUpperCase())}function I_(){return j_(e=>Qd(e))}function L_(e,t,n){return new e({type:`array`,element:t,...B(n)})}function R_(e,t,n){let r=B(n);return r.abort??=!0,new e({type:`custom`,check:`custom`,fn:t,...r})}function z_(e,t,n){return new e({type:`custom`,check:`custom`,fn:t,...B(n)})}function B_(e,t){let n=V_(t=>(t.addIssue=e=>{if(typeof e==`string`)t.issues.push(jf(e,t.value,n._zod.def));else{let r=e;r.fatal&&(r.continue=!1),r.code??=`custom`,`input`in r||(r.input=t.value),r.inst??=n,r.continue??=!n._zod.def.abort,t.issues.push(jf(r))}},e(t.value,t)),t);return n}function V_(e,t){let n=new lm({check:`custom`,...B(t)});return n._zod.check=e,n}function H_(e,...t){for(let n of t)for(let t of Reflect.ownKeys(n))Object.prototype.propertyIsEnumerable.call(n,t)&&Ud(e,t,n[t]);return e}function U_(e){let t=e?.target??`draft-2020-12`;return t===`draft-4`&&(t=`draft-04`),t===`draft-7`&&(t=`draft-07`),{processors:e.processors??{},metadataRegistry:e?.metadata??Ng,target:t,unrepresentable:e?.unrepresentable??`throw`,override:e?.override??(()=>{}),io:e?.io??`output`,counter:0,seen:new Map,sharedDefsExtractedFor:void 0,sharedEmitDoneFor:void 0,cycles:e?.cycles??`ref`,reused:e?.reused??`inline`,intersections:[],deferred:[],external:e?.external??void 0}}function W_(e,t,n,r,i){let a=typeof t.unrepresentable==`function`?t.unrepresentable({zodSchema:e,path:r.path,message:i}):t.unrepresentable;if(a===`any`)return!1;if(a===void 0||a===`throw`)throw Error(i);return Object.assign(n,a),!0}function G_(e,t,n={path:[],schemaPath:[]}){var r;let i=e._zod.def,a=t.seen.get(e);if(a)return a.count++,n.schemaPath.includes(e)&&(a.cycle=n.path),a.schema;let o={schema:{},count:1,cycle:void 0,path:n.path};t.seen.set(e,o),t.sharedDefsExtractedFor=void 0,t.sharedEmitDoneFor=void 0;let s=e._zod.toJSONSchema?.();if(s)o.schema=s;else{let r={...n,schemaPath:[...n.schemaPath,e],path:n.path};if(e._zod.processJSONSchema)e._zod.processJSONSchema(t,o.schema,r);else{let n=o.schema,a=t.processors[i.type];if(!a)throw Error(`[toJSONSchema]: Non-representable type encountered: ${i.type}`);a(e,t,n,r)}let a=e._zod.parent;a&&(o.ref||=a,G_(a,t,r),t.seen.get(a).isParent=!0)}let c=t.metadataRegistry.get(e);return c&&H_(o.schema,c),t.io===`input`&&tv(e)&&(delete o.schema.examples,delete o.schema.default),t.io===`input`&&`_prefault`in o.schema&&((r=o.schema).default??(r.default=o.schema._prefault)),delete o.schema._prefault,t.seen.get(e).schema}function K_(e){return e.replace(/~/g,`~0`).replace(/\//g,`~1`)}function q_(e,t){let n=e.seen.get(t);if(!n)throw Error(`Unprocessed schema. This is a bug in Zod.`);if(e.external&&e.sharedDefsExtractedFor===e.external)return;let r=new Map;for(let t of e.seen.entries()){let n=e.metadataRegistry.get(t[0])?.id;if(n){let e=r.get(n);if(e&&e!==t[0])throw Error(`Duplicate schema id "${n}" detected during JSON Schema conversion. Two different schemas cannot share the same id when converted together.`);r.set(n,t[0])}}let i=t=>{let r=e.target===`draft-2020-12`?`$defs`:`definitions`;if(e.external){let n=e.external.registry.get(t[0])?.id,i=e.external.uri??(e=>e);if(n)return{ref:i(n)};let a=t[1].defId??t[1].schema.id??`schema${e.counter++}`;return t[1].defId=a,{defId:a,ref:`${i(`__shared`)}#/${r}/${K_(a)}`}}let i=`#/${r}/`;if(t[1]===n&&!t[1].schema.id)return{ref:`#`};let a=t[1].schema.id??`__schema${e.counter++}`;return{defId:a,ref:i+K_(a)}},a=e=>{if(e[1].schema.$ref)return;let t=e[1],{ref:n,defId:r}=i(e);t.def={...t.schema},r&&(t.defId=r);let a=t.schema;for(let e in a)delete a[e];a.$ref=n};if(e.cycles===`throw`)for(let t of e.seen.entries()){let e=t[1];if(e.cycle)throw Error(`Cycle detected: #/${e.cycle?.join(`/`)}/ + +Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}for(let n of e.seen.entries()){let r=n[1];if(t===n[0]){a(n);continue}if(e.external){let r=e.external.registry.get(n[0])?.id;if(t!==n[0]&&r){a(n);continue}}if(e.metadataRegistry.get(n[0])?.id){a(n);continue}if(r.cycle){a(n);continue}r.count>1&&e.reused===`ref`&&a(n)}e.external&&(e.sharedDefsExtractedFor=e.external)}function J_(e){let t=e.anyOf;if(!Array.isArray(t)||t.length===0||e.type!==void 0)return;let n=[];for(let e of t){if(!e||typeof e!=`object`)return;J_(e);let t=Object.keys(e);if(t.length!==1||t[0]!==`type`)return;let r=e.type;for(let e of Array.isArray(r)?r:[r]){if(typeof e!=`string`)return;n.includes(e)||n.push(e)}}delete e.anyOf,e.type=n.length===1?n[0]:n}var Y_=new Set([`type`,`properties`,`required`,`additionalProperties`]),X_=[`oneOf`,`anyOf`];function Z_(e){let t=e.additionalProperties;return t===void 0||t===!1||typeof t!=`object`||!t?null:Object.keys(t).length?t:null}function Q_(e){let t=[];for(let n of e){if(typeof n!=`object`||n.type!==`object`)return null;for(let e in n)if(!Y_.has(e))return null;t.push(n)}let n={},r=new Set;for(let e of t){for(let r in e.properties){if(Object.prototype.hasOwnProperty.call(n,r))continue;let e=[];for(let n of t){let t=n.properties?.[r]??Z_(n);t!=null&&(e.some(e=>JSON.stringify(e)===JSON.stringify(t))||e.push(t))}Ud(n,r,e.length===1?e[0]:Q_(e)??{allOf:e})}for(let t of e.required??[])r.add(t)}let i={type:`object`,properties:n};if(r.size&&(i.required=[...r]),t.every(e=>e.additionalProperties===!1))i.additionalProperties=!1;else{let e=[];for(let n of t){let t=Z_(n);t&&!e.some(e=>JSON.stringify(e)===JSON.stringify(t))&&e.push(t)}e.length===1?i.additionalProperties=e[0]:e.length>1&&(i.additionalProperties={allOf:e})}return i}function $_(e){let t=e.allOf;if(!Array.isArray(t)||t.length<2)return;for(let t of Y_)if(t in e)return;let n=t.filter(e=>X_.some(t=>Array.isArray(e[t]))),r=null;if(!n.length)r=Q_(t);else{let e=n[0],i=X_.find(t=>Array.isArray(e[t]));if(Object.keys(e).length!==1)return;let a=t.filter(t=>t!==e),o=e[i].map(e=>Q_([...a,e]));if(o.some(e=>!e))return;r={[i]:o}}r&&(delete e.allOf,H_(e,r))}function ev(e,t){let n=e.seen.get(t);if(!n)throw Error(`Unprocessed schema. This is a bug in Zod.`);let r=t=>{let n=e.seen.get(t);if(n.ref===null)return;let i=n.def??n.schema,a={...i},o=n.ref;if(n.ref=null,o){r(o);let n=e.seen.get(o),s=n.schema;if(s.$ref&&(e.target===`draft-07`||e.target===`draft-04`||e.target===`openapi-3.0`)?(i.allOf=i.allOf??[],i.allOf.push(s)):H_(i,s),H_(i,a),t._zod.parent===o)for(let e in i)e!==`$ref`&&e!==`allOf`&&(e in a||delete i[e]);if(s.$ref&&n.def)for(let e in i)e!==`$ref`&&e!==`allOf`&&e in n.def&&JSON.stringify(i[e])===JSON.stringify(n.def[e])&&delete i[e]}let s=t._zod.parent;if(s&&s!==o){r(s);let t=e.seen.get(s);if(t?.schema.$ref&&(i.$ref=t.schema.$ref,t.def))for(let e in i)e!==`$ref`&&e!==`allOf`&&e in t.def&&JSON.stringify(i[e])===JSON.stringify(t.def[e])&&delete i[e]}e.override({zodSchema:t,jsonSchema:i,path:n.path??[]})};if(!e.external||e.sharedEmitDoneFor!==e.external){for(let t of[...e.seen.entries()].reverse())r(t[0]);if(e.target!==`openapi-3.0`)for(let t of e.seen.entries())J_(t[1].def??t[1].schema);for(let t of e.deferred)t();if(e.intersections.length){let t=new Map;for(let n of e.seen.values())for(let e of[n.schema,n.def]){let n=e?.allOf;if(!Array.isArray(n))continue;let r=t.get(n);r?r.push(e):t.set(n,[e])}for(let n of e.intersections)for(let e of t.get(n)??[])$_(e)}}let i={};if(e.target===`draft-2020-12`?i.$schema=`https://json-schema.org/draft/2020-12/schema`:e.target===`draft-07`?i.$schema=`http://json-schema.org/draft-07/schema#`:e.target===`draft-04`?i.$schema=`http://json-schema.org/draft-04/schema#`:e.target,e.external?.uri){let n=e.external.registry.get(t)?.id;if(!n)throw Error("Schema is missing an `id` property");i.$id=e.external.uri(n)}H_(i,n.defId?n.schema:n.def??n.schema);let a=e.metadataRegistry.get(t)?.id;a!==void 0&&i.id===a&&delete i.id;let o=e.external?.defs??{};if(!e.external||e.sharedEmitDoneFor!==e.external)for(let t of e.seen.entries()){let e=t[1];e.def&&e.defId&&(e.def.id===e.defId&&delete e.def.id,Ud(o,e.defId,e.def))}e.external&&(e.sharedEmitDoneFor=e.external),e.external||Object.keys(o).length>0&&(e.target===`draft-2020-12`?i.$defs=o:i.definitions=o);try{let n=JSON.parse(JSON.stringify(i));return Object.defineProperty(n,"~standard",{value:{...t[`~standard`],jsonSchema:{input:rv(t,`input`,e.processors),output:rv(t,`output`,e.processors)}},enumerable:!1,writable:!1}),n}catch{throw Error(`Error converting schema to JSON.`)}}function tv(e,t){let n=t??{seen:new Set};if(n.seen.has(e))return!1;n.seen.add(e);let r=e._zod.def;if(r.type===`transform`)return!0;if(r.type===`array`)return tv(r.element,n);if(r.type===`set`)return tv(r.valueType,n);if(r.type===`lazy`)return tv(r.getter(),n);if(r.type===`promise`||r.type===`optional`||r.type===`nonoptional`||r.type===`nullable`||r.type===`readonly`||r.type==="default"||r.type===`prefault`||r.type===`catch`)return tv(r.innerType,n);if(r.type===`intersection`)return tv(r.left,n)||tv(r.right,n);if(r.type===`record`||r.type===`map`)return tv(r.keyType,n)||tv(r.valueType,n);if(r.type===`pipe`)return e._zod.traits.has(`$ZodCodec`)?!0:tv(r.in,n)||tv(r.out,n);if(r.type===`object`){for(let e in r.shape)if(tv(r.shape[e],n))return!0;return!1}if(r.type===`union`){for(let e of r.options)if(tv(e,n))return!0;return!1}if(r.type===`tuple`){for(let e of r.items)if(tv(e,n))return!0;return!!(r.rest&&tv(r.rest,n))}return!1}var nv=(e,t={})=>n=>{let r=U_({...n,processors:t});return G_(e,r),q_(r,e),ev(r,e)},rv=(e,t,n={})=>r=>{let{libraryOptions:i,target:a}=r??{},o=U_({...i??{},target:a,io:t,processors:n});return G_(e,o),q_(o,e),ev(o,e)},iv=(e,t,n)=>{(e[t]===void 0||n>e[t])&&(e[t]=n)},av=(e,t,n)=>{(e[t]===void 0||n{iv(e,`minimum`,t),av(e,`maximum`,t)},sv=(e,t)=>{e.multipleOf??=[],e.multipleOf.includes(t)||e.multipleOf.push(t)},cv=(e,t)=>{e.patterns??=new Set,e.patterns.add(t)},lv=(e,t)=>{e.mime=e.mime?e.mime.filter(e=>t.includes(e)):[...t]},uv=(e,t)=>{e.format=t,t.includes(`int`)&&(e.isInt=!0)},dv=(e,t)=>iv(e,`minimum`,t.minimum),fv=(e,t)=>av(e,`maximum`,t.maximum),pv=e=>(t,n)=>{uv(t,n.format);let[r,i]=e[n.format];iv(t,`minimum`,r),av(t,`maximum`,i)},mv={greater_than:(e,t)=>iv(e,t.inclusive?`minimum`:`exclusiveMinimum`,t.value),less_than:(e,t)=>av(e,t.inclusive?`maximum`:`exclusiveMaximum`,t.value),multiple_of:(e,t)=>sv(e,t.value),number_format:pv(uf),bigint_format:pv(df),min_length:dv,max_length:fv,length_equals:(e,t)=>ov(e,t.length),min_size:dv,max_size:fv,size_equals:(e,t)=>ov(e,t.size),string_format:(e,t)=>{uv(e,t.format),t.pattern&&cv(e,t.pattern),(t.format===`base64`||t.format===`base64url`)&&(e.contentEncoding=t.format),(t.local||t.precision===-1)&&(e.laxFormat=!0)},mime_type:(e,t)=>lv(e,t.mime)};function hv(e){let t={},n=e._zod.def,r=e._zod.traits.has(`$ZodCheck`)?[e,...n.checks??[]]:n.checks??[];for(let e of r)mv[e._zod.def.check]?.(t,e._zod.def);let i=e._zod.bag;i.minimum!==void 0&&iv(t,`minimum`,i.minimum),i.exclusiveMinimum!==void 0&&iv(t,`exclusiveMinimum`,i.exclusiveMinimum),i.maximum!==void 0&&av(t,`maximum`,i.maximum),i.exclusiveMaximum!==void 0&&av(t,`exclusiveMaximum`,i.exclusiveMaximum),i.multipleOf!==void 0&&sv(t,i.multipleOf),i.format!==void 0&&(t.format??=i.format,i.format.includes(`int`)&&(t.isInt=!0)),i.mime&&lv(t,i.mime);for(let e of i.patterns??[])cv(t,e);return t}var gv={guid:`uuid`,url:`uri`,datetime:`date-time`,json_string:`json-string`,regex:``},_v=new Map([[dh,Gp],[ph,Kp]]),vv=e=>_v.get(e)??e,yv=(e,t,n,r)=>{let i=n;i.type=`string`;let{minimum:a,maximum:o,format:s,patterns:c,contentEncoding:l,laxFormat:u}=hv(e);if(typeof a==`number`&&(i.minLength=a),typeof o==`number`&&(i.maxLength=o),s&&(i.format=gv[s]??s,i.format===``&&delete i.format,(s===`time`||u)&&delete i.format),l&&(i.contentEncoding=l),c&&c.size>0){let e=[...c].map(vv);e.length===1?i.pattern=e[0].source:e.length>1&&(i.allOf=[...e.map(e=>({...t.target===`draft-07`||t.target===`draft-04`||t.target===`openapi-3.0`?{type:`string`}:{},pattern:e.source}))])}},bv=(e,t,n,r)=>{let i=n,{minimum:a,maximum:o,multipleOf:s,exclusiveMaximum:c,exclusiveMinimum:l,isInt:u}=hv(e);i.type=u?`integer`:`number`;let d=typeof l==`number`&&l>=(a??-1/0),f=typeof c==`number`&&c<=(o??1/0),p=t.target===`draft-04`||t.target===`openapi-3.0`;if(d?p?(i.minimum=l,i.exclusiveMinimum=!0):i.exclusiveMinimum=l:typeof a==`number`&&(i.minimum=a),f?p?(i.maximum=c,i.exclusiveMaximum=!0):i.exclusiveMaximum=c:typeof o==`number`&&(i.maximum=o),s){let n=new Set;for(let a of s)Number.isFinite(a)&&a!==0?n.add(Math.abs(a)):W_(e,t,i,r,`A multipleOf divisor of ${a} cannot be represented in JSON Schema`);let[a,...o]=n;a!==void 0&&(i.multipleOf=a),o.length&&(i.allOf=[...i.allOf??[],...o.map(e=>({multipleOf:e}))])}},xv=(e,t,n,r)=>{n.type=`boolean`},Sv=(e,t,n,r)=>{W_(e,t,n,r,`BigInt cannot be represented in JSON Schema`)},Cv=(e,t,n,r)=>{W_(e,t,n,r,`Symbols cannot be represented in JSON Schema`)},wv=(e,t,n,r)=>{t.target===`openapi-3.0`?(n.type=`string`,n.nullable=!0,n.enum=[null]):n.type=`null`},Tv=(e,t,n,r)=>{W_(e,t,n,r,`Undefined cannot be represented in JSON Schema`)},Ev=(e,t,n,r)=>{W_(e,t,n,r,`Void cannot be represented in JSON Schema`)},Dv=(e,t,n,r)=>{n.not={}},Ov=(e,t,n,r)=>{},kv=(e,t,n,r)=>{},Av=(e,t,n,r)=>{W_(e,t,n,r,`Date cannot be represented in JSON Schema`)},jv=(e,t,n,r)=>{let i=e._zod.def,a=Nd(i.entries);if(a.length===0){n.not={};return}a.every(e=>typeof e==`number`)&&(n.type=`number`),a.every(e=>typeof e==`string`)&&(n.type=`string`),n.enum=a},Mv=(e,t,n,r)=>{let i=e._zod.def;if(i.values.length===0){n.not={};return}let a=[];for(let o of i.values)if(o===void 0){if(W_(e,t,n,r,"Literal `undefined` cannot be represented in JSON Schema"))return}else if(typeof o==`bigint`){if(W_(e,t,n,r,`BigInt literals cannot be represented in JSON Schema`))return;a.push(Number(o))}else a.push(o);if(a.length!==0){if(a.length===1){let e=a[0];n.type=e===null?`null`:typeof e,t.target===`draft-04`||t.target===`openapi-3.0`?n.enum=[e]:n.const=e}else a.every(e=>typeof e==`number`)&&(n.type=`number`),a.every(e=>typeof e==`string`)&&(n.type=`string`),a.every(e=>typeof e==`boolean`)&&(n.type=`boolean`),a.every(e=>e===null)&&(n.type=`null`),n.enum=a}},Nv=(e,t,n,r)=>{W_(e,t,n,r,`NaN cannot be represented in JSON Schema`)},Pv=(e,t,n,r)=>{let i=n,a=e._zod.pattern;if(!a)throw Error(`Pattern not found in template literal`);i.type=`string`,i.pattern=a.source},Fv=(e,t,n,r)=>{let i=n;i.type=`string`,i.format=`binary`,i.contentEncoding=`binary`;let{minimum:a,maximum:o,mime:s}=hv(e);a!==void 0&&(i.minLength=a),o!==void 0&&(i.maxLength=o),s&&(s.length===0?i.not={}:s.length===1?i.contentMediaType=s[0]:i.anyOf=s.map(e=>({contentMediaType:e})))},Iv=(e,t,n,r)=>{n.type=`boolean`},Lv=(e,t,n,r)=>{W_(e,t,n,r,`Custom types cannot be represented in JSON Schema`)},Rv=(e,t,n,r)=>{W_(e,t,n,r,`Function types cannot be represented in JSON Schema`)},zv=(e,t,n,r)=>{W_(e,t,n,r,`Transforms cannot be represented in JSON Schema`)},Bv=(e,t,n,r)=>{W_(e,t,n,r,`Map cannot be represented in JSON Schema`)},Vv=(e,t,n,r)=>{W_(e,t,n,r,`Set cannot be represented in JSON Schema`)},Hv=(e,t,n,r)=>{let i=n,a=e._zod.def,{minimum:o,maximum:s}=hv(e);typeof o==`number`&&(i.minItems=o),typeof s==`number`&&(i.maxItems=s),i.type=`array`,i.items=G_(a.element,t,{...r,path:[...r.path,`items`]})};function Uv(e){let t=e._zod.def;return t.type===`pipe`&&t.in._zod.traits.has(`$ZodTransform`)?Uv(t.out):t.type===`catch`?Uv(t.innerType):e._zod.optin}var Wv=(e,t,n,r)=>{let i=n,a=e._zod.def,o=a.shape;if(Object.getOwnPropertySymbols(o).length&&W_(e,t,i,r,`Symbol keys cannot be represented in JSON Schema`))return;i.type=`object`,i.properties={};for(let e in o)Ud(i.properties,e,G_(o[e],t,{...r,path:[...r.path,`properties`,e]}));let s=[];for(let e of Object.keys(o)){let n=a.shape[e];(t.io===`input`?Uv(n)===void 0:n._zod.optout===void 0)&&s.push(e)}s.length>0&&(i.required=s),a.catchall?._zod.def.type===`never`?i.additionalProperties=!1:a.catchall?a.catchall&&(i.additionalProperties=G_(a.catchall,t,{...r,path:[...r.path,`additionalProperties`]})):t.io===`output`&&(i.additionalProperties=!1)},Gv=(e,t,n,r)=>{let i=e._zod.def,a=i.inclusive===!1,o=i.options.map((e,n)=>G_(e,t,{...r,path:[...r.path,a?`oneOf`:`anyOf`,n]}));a?n.oneOf=o:n.anyOf=o},Kv=(e,t,n,r)=>{let i=e._zod.def,a=G_(i.left,t,{...r,path:[...r.path,`allOf`,0]}),o=G_(i.right,t,{...r,path:[...r.path,`allOf`,1]}),s=e=>`allOf`in e&&Object.keys(e).length===1,c=[...s(a)?a.allOf:[a],...s(o)?o.allOf:[o]];n.allOf=c,t.intersections.push(c)},qv=(e,t,n,r)=>{let i=n,a=e._zod.def;i.type=`array`;let o=t.target===`draft-2020-12`?`prefixItems`:`items`,s=t.target===`draft-2020-12`||t.target===`openapi-3.0`?`items`:`additionalItems`,c=a.items.map((e,n)=>G_(e,t,{...r,path:[...r.path,o,n]})),l=a.rest?G_(a.rest,t,{...r,path:[...r.path,s,...t.target===`openapi-3.0`?[a.items.length]:[]]}):null,u=a.items.length;for(;u>0;){let e=a.items[u-1];if(!(t.io===`input`?Uv(e)!==void 0:e._zod.optout===`optional`))break;u--}let d=a.items.length,f=!a.rest;t.target===`draft-2020-12`?(i.prefixItems=c,f?i.items=!1:l&&(i.items=l),u>0&&(i.minItems=u),f&&(i.maxItems=d)):t.target===`openapi-3.0`?(i.items={anyOf:c},l&&i.items.anyOf.push(l),u>0&&(i.minItems=u),f&&(i.maxItems=d)):(i.items=c,f?i.additionalItems=!1:l&&(i.additionalItems=l),u>0&&(i.minItems=u),f&&(i.maxItems=d));let{minimum:p,maximum:m}=hv(e);typeof p==`number`&&(i.minItems=p),typeof m==`number`&&(i.maxItems=m)};function Jv(e,t,n){if(t.$ref){if(n.has(t))return t;n.add(t);let r=e.get(t)?.def;if(!r)return t;let i=Jv(e,r,n);return i===r?t:i}for(let r of[`anyOf`,`oneOf`]){let i=t[r];if(!Array.isArray(i))continue;let a=i.map(t=>Jv(e,t,n));a.some((e,t)=>e!==i[t])&&(t={...t,[r]:a})}let r=Array.isArray(t.type)?t.type:[t.type],i=!r.includes(`string`)&&r.some(e=>e===`number`||e===`integer`),a=t.enum??(t.const===void 0?void 0:[t.const]);if(!i&&!a?.some(e=>typeof e==`number`))return t;let{minimum:o,maximum:s,exclusiveMinimum:c,exclusiveMaximum:l,multipleOf:u,format:d,id:f,...p}=t;return p.enum?p.enum=p.enum.map(e=>typeof e==`number`?String(e):e):typeof p.const==`number`&&(p.const=String(p.const)),i?(p.type=`string`,a||(p.pattern=(r.includes(`number`)?rm:nm).source),p):p}var Yv=new WeakMap;function Xv(e){let t=new Map;for(let n of e.seen.values())n.def&&!t.has(n.schema)&&t.set(n.schema,n);let n=new Map;for(let r of Yv.get(e)??[]){let i=e.seen.get(r),a=(i?.def??i?.schema)?.propertyNames;if(!a||a===!0||n.has(a))continue;let o=Jv(t,a,new Set);o!==a&&n.set(a,o)}if(n.size)for(let t of e.seen.values())for(let e of[t.schema,t.def]){let t=e&&n.get(e.propertyNames);t&&(e.propertyNames=t)}}var Zv=(e,t,n,r)=>{let i=n,a=e._zod.def;i.type=`object`;let o=a.keyType,s=hv(o).patterns;if(a.mode===`loose`&&s&&s.size>0){let e=G_(a.valueType,t,{...r,path:[...r.path,`patternProperties`,`*`]});i.patternProperties={};for(let t of s)Ud(i.patternProperties,vv(t).source,e)}else{if(t.target===`draft-07`||t.target===`draft-2020-12`){i.propertyNames=G_(a.keyType,t,{...r,path:[...r.path,`propertyNames`]});let n=Yv.get(t);n||(n=[],Yv.set(t,n),t.deferred.push(()=>Xv(t))),n.push(e)}i.additionalProperties=G_(a.valueType,t,{...r,path:[...r.path,`additionalProperties`]})}let c=o._zod.values,l=t.io===`input`&&Uv(a.valueType)!==void 0;if(c&&!a.partial&&!l){let e=[...c].filter(e=>typeof e==`string`||typeof e==`number`);e.length>0&&(i.required=e.map(String))}},Qv=(e,t,n,r)=>{let i=e._zod.def,a=G_(i.innerType,t,r),o=t.seen.get(e);t.target===`openapi-3.0`?(o.ref=i.innerType,n.nullable=!0):n.anyOf=[a,{type:`null`}]},$v=(e,t,n,r)=>{let i=e._zod.def;G_(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType},ey=Symbol();function ty(e,t,n,r,i){let a=!1,o=JSON.stringify(e,(e,t)=>typeof t==`bigint`?(a=!0,null):t);return a?(W_(t,n,r,i,`BigInt defaults cannot be represented in JSON Schema`),ey):JSON.parse(o)}var ny=(e,t,n,r)=>{let i=e._zod.def;G_(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType;let o=ty(i.defaultValue,e,t,n,r);o!==ey&&(n.default=o)},ry=(e,t,n,r)=>{let i=e._zod.def;G_(i.innerType,t,r);let a=t.seen.get(e);if(a.ref=i.innerType,t.io!==`input`)return;let o=ty(i.defaultValue,e,t,n,r);o!==ey&&(n._prefault=o)},iy=(e,t,n,r)=>{let i=e._zod.def;G_(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType;let o;try{o=i.catchValue(void 0)}catch{W_(e,t,n,r,`Dynamic catch values are not supported in JSON Schema`);return}n.default=o},ay=(e,t,n,r)=>{let i=e._zod.def,a=i.in._zod.traits.has(`$ZodTransform`),o=t.io===`input`?a?i.out:i.in:i.out;G_(o,t,r);let s=t.seen.get(e);s.ref=o},oy=(e,t,n,r)=>{let i=e._zod.def;G_(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType,n.readOnly=!0},sy=(e,t,n,r)=>{let i=e._zod.def;G_(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType},cy=(e,t,n,r)=>{let i=e._zod.def;G_(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType},ly=(e,t,n,r)=>{let i=e._zod.innerType;G_(i,t,r);let a=t.seen.get(e);a.ref=i},uy={string:yv,number:bv,boolean:xv,bigint:Sv,symbol:Cv,null:wv,undefined:Tv,void:Ev,never:Dv,any:Ov,unknown:kv,date:Av,enum:jv,literal:Mv,nan:Nv,template_literal:Pv,file:Fv,success:Iv,custom:Lv,function:Rv,transform:zv,map:Bv,set:Vv,array:Hv,object:Wv,union:Gv,intersection:Kv,tuple:qv,record:Zv,nullable:Qv,nonoptional:$v,default:ny,prefault:ry,catch:iy,pipe:ay,readonly:oy,promise:sy,optional:cy,lazy:ly};function dy(e,t){if(`_idmap`in e){let n=e,r=U_({...t,processors:uy}),i={};for(let e of n._idmap.entries()){let[t,n]=e;G_(n,r)}let a={};r.external={registry:n,uri:t?.uri,defs:i};for(let e of n._idmap.entries()){let[t,n]=e;q_(r,n),Ud(a,t,ev(r,n))}return Object.keys(i).length>0&&(a.__shared={[r.target===`draft-2020-12`?`$defs`:`definitions`]:i}),{schemas:a}}let n=U_({...t,processors:uy});return G_(e,n),q_(n,e),ev(n,e)}var fy=new WeakSet([Object.prototype,Error.prototype]);function py(e,t,n){Object.defineProperty(e,t,{configurable:!0,enumerable:!1,get(){let e=n(this);return Object.defineProperty(this,t,{value:e,configurable:!0,writable:!0}),e},set(e){Object.defineProperty(this,t,{value:e,configurable:!0,writable:!0})}})}var my=V(`ZodError`,(e,t)=>{ap.init(e,t),e.name=`ZodError`;let n=Object.getPrototypeOf(e);fy.has(n)||(fy.add(n),py(n,`format`,e=>t=>cp(e,t)),py(n,`flatten`,e=>t=>sp(e,t)),py(n,`addIssue`,e=>t=>{e.issues.push(t),e.message=JSON.stringify(e.issues,Fd,2)}),py(n,`addIssues`,e=>t=>{e.issues.push(...t),e.message=JSON.stringify(e.issues,Fd,2)}),Object.defineProperty(n,"isEmpty",{configurable:!0,enumerable:!1,get(){return this.issues.length===0}}))},void 0,{Parent:Error}),hy=up(my),gy=dp(my),_y=fp(my),vy=mp(my),yy=bp(my),by=xp(my),xy=Sp(my),Sy=Cp(my),Cy=wp(my),wy=Tp(my),Ty=Ep(my),Ey=Dp(my);function Dy(){H.localeError||Qf(kg())}function Oy(){H.memoizer||Qf({memoizer:Eg()})}var ky=V(`ZodType`,(e,t)=>(Dy(),km.init(e,t),e.def=t,e.type=t.type,e),{check(...e){let t=this.def;return this.clone(Xd(t,{checks:[...t.checks??[],...e.map(e=>typeof e==`function`?{_zod:{check:e,def:{check:`custom`},onattach:[]}}:e)]}),{parent:!0})},with(...e){return this.check(...e)},clone(e,t){return sf(this,e,t)},brand(){return this},register(e,t){return e.add(this,t),this},refine(e,t){return this.check(ix(e,t))},superRefine(e,t){return this.check(ax(e,t))},overwrite(e){return this.check(j_(e))},optional(){return Ib(this)},exactOptional(){return Rb(this)},nullable(){return Bb(this)},nullish(){return Ib(Bb(this))},nonoptional(e){return Kb(this,e)},array(){return yb(this)},or(e){return Cb([this,e])},and(e){return Db(this,e)},transform(e){return Xb(this,Pb(e))},default(e){return Hb(this,e)},prefault(e){return Wb(this,e)},catch(e){return Jb(this,e)},pipe(e){return Xb(this,e)},readonly(){return $b(this)},describe(e){let t=this.clone();return Ng.add(t,{description:e}),t},meta(...e){if(e.length===0)return Ng.get(this);let t=this.clone();return Ng.add(t,e[0]),t},isOptional(){return this.safeParse(void 0).success},isNullable(){return this.safeParse(null).success},apply(e,...t){return t.length===0?e(this):e(this,...t)},get"~standard"(){return Pf(this,`~standard`,{...Mm(this),jsonSchema:{input:rv(this,`input`),output:rv(this,`output`)}})},set"~standard"(e){Nf(this,`~standard`,e)},parse:function e(t,n){return hy(this,t,n,{callee:e})},parseAsync:async function e(t,n){return await gy(this,t,n,{callee:e})},safeParse(e,t){return _y(this,e,t)},async safeParseAsync(e,t){return vy(this,e,t)},get spa(){return this?.safeParseAsync},set spa(e){Nf(this,`spa`,e)},validate(e,t){return _p(this,e,t)},validateAsync(e,t){return yp(this,e,t)},encode:function e(t,n){return yy(this,t,n,{callee:e})},decode:function e(t,n){return by(this,t,n,{callee:e})},encodeAsync:async function e(t,n){return await xy(this,t,n,{callee:e})},decodeAsync:async function e(t,n){return await Sy(this,t,n,{callee:e})},safeEncode(e,t){return Cy(this,e,t)},safeDecode(e,t){return wy(this,e,t)},async safeEncodeAsync(e,t){return Ty(this,e,t)},async safeDecodeAsync(e,t){return Ey(this,e,t)},toJSONSchema(e){return nv(this,{})(e)},get description(){return Ng.get(this)?.description},get _def(){return this._zod.def}}),Ay=V(`_ZodString`,(e,t)=>{Nm.init(e,t),ky.init(e,t),e._zod.processJSONSchema=(t,n,r)=>yv(e,t,n,r)},Ff({format:e=>hv(e).format??null,minLength:e=>hv(e).minimum??null,maxLength:e=>hv(e).maximum??null},{regex(...e){return this.check(T_(...e))},includes(...e){return this.check(O_(...e))},startsWith(...e){return this.check(k_(...e))},endsWith(...e){return this.check(A_(...e))},min(...e){return this.check(C_(...e))},max(...e){return this.check(S_(...e))},length(...e){return this.check(w_(...e))},nonempty(...e){return this.check(C_(1,...e))},lowercase(e){return this.check(E_(e))},uppercase(e){return this.check(D_(e))},trim(){return this.check(N_())},normalize(...e){return this.check(M_(...e))},toLowerCase(){return this.check(P_())},toUpperCase(){return this.check(F_())},slugify(){return this.check(I_())}})),jy=V(`ZodString`,(e,t)=>{Nm.init(e,t),Ay.init(e,t)},{email(e){return this.check(Ig(Ly,e))},url(e){return this.check(Hg(Vy,e))},jwt(e){return this.check(r_(rb,e))},emoji(e){return this.check(Ug(Uy,e))},guid(e){return this.check(Lg(zy,e))},uuid(e){return this.check(Rg(By,e))},uuidv4(e){return this.check(zg(By,e))},uuidv6(e){return this.check(Bg(By,e))},uuidv7(e){return this.check(Vg(By,e))},nanoid(e){return this.check(Wg(Wy,e))},cuid(e){return this.check(Gg(Gy,e))},cuid2(e){return this.check(Kg(Ky,e))},ulid(e){return this.check(qg(qy,e))},base64(e){return this.check(e_(eb,e))},base64url(e){return this.check(t_(tb,e))},xid(e){return this.check(Jg(Jy,e))},ksuid(e){return this.check(Yg(Yy,e))},ipv4(e){return this.check(Xg(Xy,e))},ipv6(e){return this.check(Zg(Zy,e))},cidrv4(e){return this.check(Qg(Qy,e))},cidrv6(e){return this.check($g($y,e))},e164(e){return this.check(n_(nb,e))},datetime(e){return this.check(i_(Ny,e))},date(e){return this.check(a_(Py,e))},time(e){return this.check(o_(Fy,e))},duration(e){return this.check(s_(Iy,e))}});function U(e){return Fg(jy,e)}var My=V(`ZodStringFormat`,(e,t)=>{Pm.init(e,t),Ay.init(e,t)}),Ny=V(`ZodISODateTime`,(e,t)=>{$m.init(e,t),My.init(e,t)}),Py=V(`ZodISODate`,(e,t)=>{eh.init(e,t),My.init(e,t)}),Fy=V(`ZodISOTime`,(e,t)=>{th.init(e,t),My.init(e,t)}),Iy=V(`ZodISODuration`,(e,t)=>{nh.init(e,t),My.init(e,t)}),Ly=V(`ZodEmail`,(e,t)=>{Lm.init(e,t),My.init(e,t)});function Ry(e){return Ig(Ly,e)}var zy=V(`ZodGUID`,(e,t)=>{Fm.init(e,t),My.init(e,t)}),By=V(`ZodUUID`,(e,t)=>{Im.init(e,t),My.init(e,t)}),Vy=V(`ZodURL`,(e,t)=>{Gm.init(e,t),My.init(e,t)});function Hy(e){return Hg(Vy,e)}var Uy=V(`ZodEmoji`,(e,t)=>{Km.init(e,t),My.init(e,t)}),Wy=V(`ZodNanoID`,(e,t)=>{qm.init(e,t),My.init(e,t)}),Gy=V(`ZodCUID`,(e,t)=>{Jm.init(e,t),My.init(e,t)}),Ky=V(`ZodCUID2`,(e,t)=>{Ym.init(e,t),My.init(e,t)}),qy=V(`ZodULID`,(e,t)=>{Xm.init(e,t),My.init(e,t)}),Jy=V(`ZodXID`,(e,t)=>{Zm.init(e,t),My.init(e,t)}),Yy=V(`ZodKSUID`,(e,t)=>{Qm.init(e,t),My.init(e,t)}),Xy=V(`ZodIPv4`,(e,t)=>{rh.init(e,t),My.init(e,t)}),Zy=V(`ZodIPv6`,(e,t)=>{oh.init(e,t),My.init(e,t)}),Qy=V(`ZodCIDRv4`,(e,t)=>{sh.init(e,t),My.init(e,t)}),$y=V(`ZodCIDRv6`,(e,t)=>{lh.init(e,t),My.init(e,t)}),eb=V(`ZodBase64`,(e,t)=>{fh.init(e,t),My.init(e,t)}),tb=V(`ZodBase64URL`,(e,t)=>{hh.init(e,t),My.init(e,t)}),nb=V(`ZodE164`,(e,t)=>{gh.init(e,t),My.init(e,t)}),rb=V(`ZodJWT`,(e,t)=>{vh.init(e,t),My.init(e,t)}),ib=V(`ZodNumber`,(e,t)=>{yh.init(e,t),ky.init(e,t),e._zod.processJSONSchema=(t,n,r)=>bv(e,t,n,r),e.isFinite=!0},Ff({minValue:e=>{let{minimum:t,exclusiveMinimum:n}=hv(e);return Math.max(t??-1/0,n??-1/0)},maxValue:e=>{let{maximum:t,exclusiveMaximum:n}=hv(e);return Math.min(t??1/0,n??1/0)},isInt:e=>{let{isInt:t,multipleOf:n}=hv(e);return!!t||!!n?.some(Number.isSafeInteger)},format:e=>hv(e).format??null},{gt(e,t){return this.check(y_(e,t))},gte(e,t){return this.check(b_(e,t))},min(e,t){return this.check(b_(e,t))},lt(e,t){return this.check(__(e,t))},lte(e,t){return this.check(v_(e,t))},max(e,t){return this.check(v_(e,t))},int(e){return this.check(W(e))},safe(e){return this.check(W(e))},positive(e){return this.check(y_(0,e))},nonnegative(e){return this.check(b_(0,e))},negative(e){return this.check(__(0,e))},nonpositive(e){return this.check(v_(0,e))},multipleOf(e,t){return this.check(x_(e,t))},step(e,t){return this.check(x_(e,t))},finite(){return this}}));function ab(e){return c_(ib,e)}var ob=V(`ZodNumberFormat`,(e,t)=>{bh.init(e,t),ib.init(e,t)});function W(e){return u_(ob,e)}var sb=V(`ZodBoolean`,(e,t)=>{xh.init(e,t),ky.init(e,t),e._zod.processJSONSchema=(t,n,r)=>xv(e,t,n,r)});function cb(e){return d_(sb,e)}var lb=V(`ZodUndefined`,(e,t)=>{Sh.init(e,t),ky.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Tv(e,t,n,r)});function ub(e){return f_(lb,e)}var db=V(`ZodNull`,(e,t)=>{Ch.init(e,t),ky.init(e,t),e._zod.processJSONSchema=(t,n,r)=>wv(e,t,n,r)});function fb(e){return p_(db,e)}var pb=V(`ZodAny`,(e,t)=>{wh.init(e,t),ky.init(e,t),e._zod.processJSONSchema=(e,t,n)=>void 0});function G(){return m_(pb)}var mb=V(`ZodUnknown`,(e,t)=>{Th.init(e,t),ky.init(e,t),e._zod.processJSONSchema=(e,t,n)=>void 0});function hb(){return h_(mb)}var gb=V(`ZodNever`,(e,t)=>{Eh.init(e,t),ky.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Dv(e,t,n,r)});function _b(e){return g_(gb,e)}var vb=V(`ZodArray`,(e,t)=>{Oy(),Oh.init(e,t),ky.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Hv(e,t,n,r),e.element=t.element},{min(e,t){return this.check(C_(e,t))},nonempty(e){return this.check(C_(1,e))},max(e,t){return this.check(S_(e,t))},length(e,t){return this.check(w_(e,t))},unwrap(){return this.element}});function yb(e,t){return L_(vb,e,t)}var bb=V(`ZodObject`,(e,t)=>{Oy(),Ph.init(e,t),ky.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Wv(e,t,n,r),Hf(e,`shape`,e=>e._zod.def.shape,!1)},{keyof(){return jb(Object.keys(this._zod.def.shape))},catchall(e){return this.clone(Xd(this._zod.def,{catchall:e}))},passthrough(){return this.clone(Xd(this._zod.def,{catchall:hb()}))},loose(){return this.clone(Xd(this._zod.def,{catchall:hb()}))},strict(){return this.clone(Xd(this._zod.def,{catchall:_b()}))},strip(){return this.clone(Xd(this._zod.def,{catchall:void 0}))},extend(e){return hf(this,e)},safeExtend(e){return _f(this,e)},merge(e){return vf(this,e)},pick(e){return ff(this,e)},omit(e){return mf(this,e)},partial(...e){return yf(Fb,this,e[0])},exactPartial(...e){return yf(Lb,this,e[0],`exactPartial`)},required(...e){return bf(Gb,this,e[0])}});function xb(e,t){return new bb({type:`object`,shape:e??{},...B(t)})}function K(e,t){return new bb({type:`object`,shape:e,catchall:hb(),...B(t)})}var Sb=V(`ZodUnion`,(e,t)=>{Ih.init(e,t),ky.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Gv(e,t,n,r),e.options=t.options});function Cb(e,t){return new Sb({type:`union`,options:e,...B(t)})}var wb=V(`ZodDiscriminatedUnion`,(e,t)=>{Sb.init(e,t),Rh.init(e,t)});function Tb(e,t,n){return new wb({type:`union`,options:t,discriminator:e,...B(n)})}var Eb=V(`ZodIntersection`,(e,t)=>{zh.init(e,t),ky.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Kv(e,t,n,r)});function Db(e,t){return new Eb({type:`intersection`,left:e,right:t})}var Ob=V(`ZodRecord`,(e,t)=>{Oy(),Hh.init(e,t),ky.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Zv(e,t,n,r),e.keyType=t.keyType,e.valueType=t.valueType});function kb(e,t,n){return!t||!t._zod?new Ob({type:`record`,keyType:U(),valueType:e,...B(t)}):new Ob({type:`record`,keyType:e,valueType:t,...B(n)})}var Ab=V(`ZodEnum`,(e,t)=>{Uh.init(e,t),ky.init(e,t),e._zod.processJSONSchema=(t,n,r)=>jv(e,t,n,r),e.enum=t.entries,e.options=[...e._zod.values];let n=new Set(Object.keys(t.entries));e.extract=(e,r)=>{let i={};for(let r of e)if(n.has(r))i[r]=t.entries[r];else throw Error(`Key ${r} not found in enum`);return new Ab({...t,checks:[],...B(r),entries:i})},e.exclude=(e,r)=>{let i={...t.entries};for(let t of e)if(n.has(t))delete i[t];else throw Error(`Key ${t} not found in enum`);return new Ab({...t,checks:[],...B(r),entries:i})}});function jb(e,t){return new Ab({type:`enum`,entries:Array.isArray(e)?Object.fromEntries(e.map(e=>[e,e])):e,...B(t)})}var Mb=V(`ZodLiteral`,(e,t)=>{Wh.init(e,t),ky.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Mv(e,t,n,r),e.values=new Set(t.values),Object.defineProperty(e,"value",{get(){if(t.values.length>1)throw Error("This schema contains multiple valid literal values. Use `.values` instead.");return t.values[0]}})});function q(e,t){return new Mb({type:`literal`,values:Array.isArray(e)?e:[e],...B(t)})}var Nb=V(`ZodTransform`,(e,t)=>{Oy(),Gh.init(e,t),ky.init(e,t),e._zod.processJSONSchema=(t,n,r)=>zv(e,t,n,r),e._zod.parse=(n,r)=>{if(r.direction===`backward`)throw new Zf(e.constructor.name);n.addIssue=r=>{if(typeof r==`string`)n.issues.push(jf(r,n.value,t));else{let t=r;t.fatal&&(t.continue=!1),t.code??=`custom`,`input`in t||(t.input=n.value),t.inst??=e,n.issues.push(jf(t))}};let i=t.transform(n.value,n);return i instanceof Promise?i.then(e=>(n.value=e,n)):(n.value=i,n)}});function Pb(e){return new Nb({type:`transform`,transform:e})}var Fb=V(`ZodOptional`,(e,t)=>{qh.init(e,t),ky.init(e,t),e._zod.processJSONSchema=(t,n,r)=>cy(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function Ib(e){return new Fb({type:`optional`,innerType:e})}var Lb=V(`ZodExactOptional`,(e,t)=>{Jh.init(e,t),ky.init(e,t),e._zod.processJSONSchema=(t,n,r)=>cy(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function Rb(e){return new Lb({type:`optional`,innerType:e})}var zb=V(`ZodNullable`,(e,t)=>{Yh.init(e,t),ky.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Qv(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function Bb(e){return new zb({type:`nullable`,innerType:e})}var Vb=V(`ZodDefault`,(e,t)=>{Xh.init(e,t),ky.init(e,t),e._zod.processJSONSchema=(t,n,r)=>ny(e,t,n,r),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap});function Hb(e,t){return new Vb({type:`default`,innerType:e,get defaultValue(){return typeof t==`function`?t():rf(t)}})}var Ub=V(`ZodPrefault`,(e,t)=>{Qh.init(e,t),ky.init(e,t),e._zod.processJSONSchema=(t,n,r)=>ry(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function Wb(e,t){return new Ub({type:`prefault`,innerType:e,get defaultValue(){return typeof t==`function`?t():rf(t)}})}var Gb=V(`ZodNonOptional`,(e,t)=>{$h.init(e,t),ky.init(e,t),e._zod.processJSONSchema=(t,n,r)=>$v(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function Kb(e,t){return new Gb({type:`nonoptional`,innerType:e,...B(t)})}var qb=V(`ZodCatch`,(e,t)=>{ng.init(e,t),ky.init(e,t),e._zod.processJSONSchema=(t,n,r)=>iy(e,t,n,r),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap});function Jb(e,t){return new qb({type:`catch`,innerType:e,catchValue:typeof t==`function`?t:Wf(t)})}var Yb=V(`ZodPipe`,(e,t)=>{rg.init(e,t),ky.init(e,t),e._zod.processJSONSchema=(t,n,r)=>ay(e,t,n,r),e.in=t.in,e.out=t.out});function Xb(e,t){return new Yb({type:`pipe`,in:e,out:t})}var Zb=V(`ZodPreprocess`,(e,t)=>{Yb.init(e,t),ag.init(e,t)}),Qb=V(`ZodReadonly`,(e,t)=>{og.init(e,t),ky.init(e,t),e._zod.processJSONSchema=(t,n,r)=>oy(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function $b(e){return new Qb({type:`readonly`,innerType:e})}var ex=V(`ZodLazy`,(e,t)=>{cg.init(e,t),ky.init(e,t),e._zod.processJSONSchema=(t,n,r)=>ly(e,t,n,r),e.unwrap=()=>e._zod.def.getter()});function tx(e){return new ex({type:`lazy`,getter:e})}var nx=V(`ZodCustom`,(e,t)=>{lg.init(e,t),ky.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Lv(e,t,n,r)});function rx(e,t){return R_(nx,e??(()=>!0),t)}function ix(e,t={}){return z_(nx,e,t)}function ax(e,t){return B_(e,t)}function ox(e,t){return new Zb({type:`pipe`,in:Pb(e),out:t})}var sx=jb(L),J=rx(e=>typeof e==`object`&&!!e&&!Array.isArray(e)),cx=U(),lx=jb([`developer`,`system`,`assistant`,`user`]),ux=K({type:q(L.TEXT_MESSAGE_START),timestamp:W().min(-9007199254740991).max(9007199254740991).optional(),rawEvent:G().refine(e=>e!==null).optional(),metadata:J.optional(),subagentRunId:cx.optional(),messageId:U(),role:lx.optional(),name:U().optional()}),dx=K({type:q(L.TEXT_MESSAGE_CONTENT),timestamp:W().min(-9007199254740991).max(9007199254740991).optional(),rawEvent:G().refine(e=>e!==null).optional(),metadata:J.optional(),subagentRunId:cx.optional(),messageId:U(),delta:U()}),fx=K({type:q(L.TEXT_MESSAGE_END),timestamp:W().min(-9007199254740991).max(9007199254740991).optional(),rawEvent:G().refine(e=>e!==null).optional(),metadata:J.optional(),subagentRunId:cx.optional(),messageId:U()}),px=K({type:q(L.TEXT_MESSAGE_CHUNK),timestamp:W().min(-9007199254740991).max(9007199254740991).optional(),rawEvent:G().refine(e=>e!==null).optional(),metadata:J.optional(),subagentRunId:cx.optional(),messageId:U().optional(),role:lx.optional(),delta:U().optional(),name:U().optional()}),mx=K({type:q(L.TOOL_CALL_START),timestamp:W().min(-9007199254740991).max(9007199254740991).optional(),rawEvent:G().refine(e=>e!==null).optional(),metadata:J.optional(),subagentRunId:cx.optional(),toolCallId:U(),toolCallName:U(),parentMessageId:U().optional()}),hx=K({type:q(L.TOOL_CALL_ARGS),timestamp:W().min(-9007199254740991).max(9007199254740991).optional(),rawEvent:G().refine(e=>e!==null).optional(),metadata:J.optional(),subagentRunId:cx.optional(),toolCallId:U(),delta:U()}),gx=K({type:q(L.TOOL_CALL_END),timestamp:W().min(-9007199254740991).max(9007199254740991).optional(),rawEvent:G().refine(e=>e!==null).optional(),metadata:J.optional(),subagentRunId:cx.optional(),toolCallId:U()}),_x=K({type:q(L.TOOL_CALL_CHUNK),timestamp:W().min(-9007199254740991).max(9007199254740991).optional(),rawEvent:G().refine(e=>e!==null).optional(),metadata:J.optional(),subagentRunId:cx.optional(),toolCallId:U().optional(),toolCallName:U().optional(),parentMessageId:U().optional(),delta:U().optional()}),vx=K({type:q(`text`),id:U().optional(),text:U(),metadata:G().refine(e=>e!==null).optional()}),yx=Tb(`type`,[K({type:q(`data`),value:U(),mimeType:U()}),K({type:q(`url`),value:U(),mimeType:U().optional()}),K({type:q(`file`),value:U(),provider:U().optional(),mimeType:U().optional()})]),bx=Tb(`type`,[vx,K({type:q(`image`),id:U().optional(),source:yx,metadata:G().refine(e=>e!==null).optional()}),K({type:q(`audio`),id:U().optional(),source:yx,metadata:G().refine(e=>e!==null).optional()}),K({type:q(`video`),id:U().optional(),source:yx,metadata:G().refine(e=>e!==null).optional()}),K({type:q(`document`),id:U().optional(),source:yx,metadata:G().refine(e=>e!==null).optional()})]),xx=K({type:q(L.TOOL_CALL_RESULT),timestamp:W().min(-9007199254740991).max(9007199254740991).optional(),rawEvent:G().refine(e=>e!==null).optional(),metadata:J.optional(),subagentRunId:cx.optional(),messageId:U(),toolCallId:U(),content:Cb([U(),yb(bx)]),role:q(`tool`).optional()}),Sx=G(),Cx=K({type:q(L.STATE_SNAPSHOT),timestamp:W().min(-9007199254740991).max(9007199254740991).optional(),rawEvent:G().refine(e=>e!==null).optional(),metadata:J.optional(),subagentRunId:cx.optional(),snapshot:Sx.refine(e=>e!==void 0)}),wx=U().regex(RegExp(`^(/([^/~]|~[01])*)*$`)),Tx=yb(Tb(`op`,[K({op:q(`add`),path:wx,value:G().refine(e=>e!==void 0)}).meta({specOpen:!0}),K({op:q(`remove`),path:wx}).meta({specOpen:!0}),K({op:q(`replace`),path:wx,value:G().refine(e=>e!==void 0)}).meta({specOpen:!0}),K({op:q(`move`),from:wx,path:wx}).meta({specOpen:!0}),K({op:q(`copy`),from:wx,path:wx}).meta({specOpen:!0}),K({op:q(`test`),path:wx,value:G().refine(e=>e!==void 0)}).meta({specOpen:!0})])),Ex=K({type:q(L.STATE_DELTA),timestamp:W().min(-9007199254740991).max(9007199254740991).optional(),rawEvent:G().refine(e=>e!==null).optional(),metadata:J.optional(),subagentRunId:cx.optional(),delta:Tx}),Dx=K({subagentRunId:cx.optional(),id:U(),role:q(`developer`),name:U().optional(),encryptedValue:U().optional(),metadata:J.optional(),content:U()}),Ox=K({subagentRunId:cx.optional(),id:U(),role:q(`system`),name:U().optional(),encryptedValue:U().optional(),metadata:J.optional(),content:U()}),kx=K({name:U(),arguments:U()}),Ax=K({id:U(),type:q(`function`),function:kx,encryptedValue:U().optional(),metadata:J.optional()}),jx=Tb(`role`,[Dx,Ox,K({subagentRunId:cx.optional(),id:U(),role:q(`assistant`),name:U().optional(),encryptedValue:U().optional(),metadata:J.optional(),content:U().optional(),toolCalls:yb(Ax).optional()}),K({subagentRunId:cx.optional(),id:U(),role:q(`user`),name:U().optional(),encryptedValue:U().optional(),metadata:J.optional(),content:Cb([U(),yb(bx)])}),K({subagentRunId:cx.optional(),id:U(),role:q(`tool`),content:Cb([U(),yb(bx)]),toolCallId:U(),error:U().optional(),encryptedValue:U().optional(),metadata:J.optional()}),K({subagentRunId:cx.optional(),id:U(),role:q(`activity`),activityType:U(),content:rx(e=>typeof e==`object`&&!!e&&!Array.isArray(e)),metadata:J.optional()}),K({subagentRunId:cx.optional(),id:U(),role:q(`reasoning`),content:U(),encryptedValue:U().optional(),metadata:J.optional()})]),Mx=K({type:q(L.MESSAGES_SNAPSHOT),timestamp:W().min(-9007199254740991).max(9007199254740991).optional(),rawEvent:G().refine(e=>e!==null).optional(),metadata:J.optional(),messages:yb(jx)}),Nx=K({type:q(L.ACTIVITY_SNAPSHOT),timestamp:W().min(-9007199254740991).max(9007199254740991).optional(),rawEvent:G().refine(e=>e!==null).optional(),metadata:J.optional(),subagentRunId:cx.optional(),messageId:U(),activityType:U(),content:rx(e=>typeof e==`object`&&!!e&&!Array.isArray(e)),replace:cb().optional()}),Px=K({type:q(L.ACTIVITY_DELTA),timestamp:W().min(-9007199254740991).max(9007199254740991).optional(),rawEvent:G().refine(e=>e!==null).optional(),metadata:J.optional(),subagentRunId:cx.optional(),messageId:U(),activityType:U(),patch:Tx}),Fx=K({type:q(L.RAW),timestamp:W().min(-9007199254740991).max(9007199254740991).optional(),rawEvent:G().refine(e=>e!==null).optional(),metadata:J.optional(),subagentRunId:cx.optional(),event:G().refine(e=>e!==void 0),source:U().optional()}),Ix=K({type:q(L.CUSTOM),timestamp:W().min(-9007199254740991).max(9007199254740991).optional(),rawEvent:G().refine(e=>e!==null).optional(),metadata:J.optional(),subagentRunId:cx.optional(),name:U(),value:G().refine(e=>e!==void 0)}),Lx=K({name:U(),description:U(),parameters:G().refine(e=>e!==null).optional(),metadata:J.optional()}),Rx=K({description:U(),value:U()}),zx=K({interruptId:U(),status:jb([`resolved`,`cancelled`]),payload:G().refine(e=>e!==null).optional(),metadata:J.optional()}),Bx=K({threadId:U(),runId:U(),protocolVersion:U().optional(),parentRunId:U().optional(),state:Sx.refine(e=>e!==null).nullable().transform(e=>e??void 0).optional(),messages:yb(jx),tools:yb(Lx).default(()=>[]),context:yb(Rx).default(()=>[]),forwardedProps:G().refine(e=>e!==null).optional(),resume:yb(zx).optional()}),Vx=K({type:q(L.RUN_STARTED),timestamp:W().min(-9007199254740991).max(9007199254740991).optional(),rawEvent:G().refine(e=>e!==null).optional(),metadata:J.optional(),threadId:U(),runId:U(),protocolVersion:U().optional(),parentRunId:U().optional(),input:Bx.optional()}),Hx=K({type:q(`success`),pendingToolCallIds:yb(U()).optional()}),Ux=K({subagentRunId:cx.optional(),id:U(),reason:U(),message:U().optional(),toolCallId:U().optional(),responseSchema:rx(e=>typeof e==`object`&&!!e&&!Array.isArray(e)).optional(),expiresAt:U().optional(),metadata:J.optional()}),Wx=Tb(`type`,[Hx,K({type:q(`interrupt`),interrupts:yb(Ux).min(1)}),K({type:q(`cancelled`)})]),Gx=K({provider:U().optional(),model:U().optional(),inputTokens:W().min(0).max(9007199254740991).optional(),outputTokens:W().min(0).max(9007199254740991).optional(),totalTokens:W().min(0).max(9007199254740991).optional(),reasoningTokens:W().min(0).max(9007199254740991).optional(),cachedInputTokens:W().min(0).max(9007199254740991).optional(),cacheWriteInputTokens:W().min(0).max(9007199254740991).optional()}),Kx=K({type:q(L.RUN_FINISHED),timestamp:W().min(-9007199254740991).max(9007199254740991).optional(),rawEvent:G().refine(e=>e!==null).optional(),metadata:J.optional(),threadId:U(),runId:U(),result:G().refine(e=>e!==null).optional(),outcome:Wx.optional(),usage:yb(Gx).optional()}),qx=K({type:q(L.RUN_ERROR),timestamp:W().min(-9007199254740991).max(9007199254740991).optional(),rawEvent:G().refine(e=>e!==null).optional(),metadata:J.optional(),message:U(),code:U().optional(),usage:yb(Gx).optional()}),Jx=K({type:q(L.STEP_STARTED),timestamp:W().min(-9007199254740991).max(9007199254740991).optional(),rawEvent:G().refine(e=>e!==null).optional(),metadata:J.optional(),subagentRunId:cx.optional(),stepName:U()}),Yx=K({type:q(L.STEP_FINISHED),timestamp:W().min(-9007199254740991).max(9007199254740991).optional(),rawEvent:G().refine(e=>e!==null).optional(),metadata:J.optional(),subagentRunId:cx.optional(),stepName:U()}),Xx=K({type:q(L.REASONING_START),timestamp:W().min(-9007199254740991).max(9007199254740991).optional(),rawEvent:G().refine(e=>e!==null).optional(),metadata:J.optional(),subagentRunId:cx.optional(),messageId:U()}),Zx=K({type:q(L.REASONING_MESSAGE_START),timestamp:W().min(-9007199254740991).max(9007199254740991).optional(),rawEvent:G().refine(e=>e!==null).optional(),metadata:J.optional(),subagentRunId:cx.optional(),messageId:U(),role:q(`reasoning`)}),Qx=K({type:q(L.REASONING_MESSAGE_CONTENT),timestamp:W().min(-9007199254740991).max(9007199254740991).optional(),rawEvent:G().refine(e=>e!==null).optional(),metadata:J.optional(),subagentRunId:cx.optional(),messageId:U(),delta:U()}),$x=K({type:q(L.REASONING_MESSAGE_END),timestamp:W().min(-9007199254740991).max(9007199254740991).optional(),rawEvent:G().refine(e=>e!==null).optional(),metadata:J.optional(),subagentRunId:cx.optional(),messageId:U()}),eS=K({type:q(L.REASONING_MESSAGE_CHUNK),timestamp:W().min(-9007199254740991).max(9007199254740991).optional(),rawEvent:G().refine(e=>e!==null).optional(),metadata:J.optional(),subagentRunId:cx.optional(),messageId:U().optional(),delta:U().optional()}),tS=K({type:q(L.REASONING_END),timestamp:W().min(-9007199254740991).max(9007199254740991).optional(),rawEvent:G().refine(e=>e!==null).optional(),metadata:J.optional(),subagentRunId:cx.optional(),messageId:U()}),nS=jb([`tool-call`,`message`]),rS=K({type:q(L.REASONING_ENCRYPTED_VALUE),timestamp:W().min(-9007199254740991).max(9007199254740991).optional(),rawEvent:G().refine(e=>e!==null).optional(),metadata:J.optional(),subagentRunId:cx.optional(),subtype:nS,entityId:U(),encryptedValue:U()}),iS=K({type:q(L.SUBAGENT_STARTED),timestamp:W().min(-9007199254740991).max(9007199254740991).optional(),rawEvent:G().refine(e=>e!==null).optional(),metadata:J.optional(),subagentRunId:cx,name:U(),description:U().optional(),parentSubagentRunId:cx.optional(),parentToolCallId:U().optional(),parentMessageId:U().optional()}),aS=Tb(`type`,[K({type:q(`success`)}),K({type:q(`suspended`),interruptIds:yb(U()).optional()})]),oS=Tb(`type`,[ux,dx,fx,px,mx,hx,gx,_x,xx,Cx,Ex,Mx,Nx,Px,Fx,Ix,Vx,Kx,qx,Jx,Yx,Xx,Zx,Qx,$x,eS,tS,rS,iS,K({type:q(L.SUBAGENT_FINISHED),timestamp:W().min(-9007199254740991).max(9007199254740991).optional(),rawEvent:G().refine(e=>e!==null).optional(),metadata:J.optional(),subagentRunId:cx,result:G().refine(e=>e!==null).optional(),outcome:aS.optional()}),K({type:q(L.SUBAGENT_ERROR),timestamp:W().min(-9007199254740991).max(9007199254740991).optional(),rawEvent:G().refine(e=>e!==null).optional(),metadata:J.optional(),subagentRunId:cx,message:U(),code:U().optional()})]);jb([`developer`,`system`,`assistant`,`user`,`tool`,`activity`,`reasoning`]);var sS=K({name:U(),description:U().optional()}),cS=K({name:U().optional(),type:U().optional(),description:U().optional(),version:U().optional(),provider:U().optional(),documentationUrl:U().optional(),metadata:J.optional()}),lS=K({streaming:cb().optional(),websocket:cb().optional(),httpBinary:cb().optional(),pushNotifications:cb().optional(),resumable:cb().optional()}),uS=K({supported:cb().optional(),items:yb(Lx).optional(),parallelCalls:cb().optional(),clientProvided:cb().optional()}),dS=K({structuredOutput:cb().optional(),supportedMimeTypes:yb(U()).optional()}),fS=K({snapshots:cb().optional(),deltas:cb().optional(),memory:cb().optional(),persistentState:cb().optional()}),pS=K({supported:cb().optional(),delegation:cb().optional(),handoffs:cb().optional(),subagents:yb(sS).optional()}),mS=K({supported:cb().optional(),streaming:cb().optional(),encrypted:cb().optional()}),hS=K({image:cb().optional(),audio:cb().optional(),video:cb().optional(),pdf:cb().optional(),file:cb().optional()}),gS=K({image:cb().optional(),audio:cb().optional()}),_S=K({input:hS.optional(),output:gS.optional()}),vS=K({codeExecution:cb().optional(),sandboxed:cb().optional(),maxIterations:W().min(0).max(9007199254740991).optional(),maxExecutionTime:W().min(0).max(9007199254740991).optional()}),yS=K({supported:cb().optional(),approvals:cb().optional(),interventions:cb().optional(),feedback:cb().optional(),interrupts:cb().optional(),approveWithEdits:cb().optional()});K({identity:cS.optional(),transport:lS.optional(),tools:uS.optional(),output:dS.optional(),state:fS.optional(),multiAgent:pS.optional(),reasoning:mS.optional(),multimodal:_S.optional(),execution:vS.optional(),humanInTheLoop:yS.optional(),custom:rx(e=>typeof e==`object`&&!!e&&!Array.isArray(e)).optional()}),K({subagentRunId:cx.optional()}),K({type:sx,timestamp:W().min(-9007199254740991).max(9007199254740991).optional(),rawEvent:G().refine(e=>e!==null).optional(),metadata:J.optional()}),K({subagentRunId:cx.optional(),id:U(),role:U(),name:U().optional(),encryptedValue:U().optional(),metadata:J.optional()}),J.optional();function bS(){let e=this.buf,t=this.pos,n=0,r=0;for(let i=0;i<28;i+=7){let a=e[t++];if(n|=(a&127)<>4,!(i&128)){this.pos=t,this.assertBounds(),this.varint64Lo=n,this.varint64Hi=r;return}for(let i=3;i<=31;i+=7){let a=e[t++];if(r|=(a&127)<=xS&&(i+=r/xS|0,r%=xS)}return a(-24,-18),a(-18,-12),a(-12,-6),a(-6),t?DS(r,i):ES(r,i)}function CS(e,t){let n=ES(e,t),r=n.hi&2147483648;r&&(n=DS(n.lo,n.hi));let i=wS(n.lo,n.hi);return r?`-`+i:i}function wS(e,t){if({lo:e,hi:t}=TS(e,t),t<=2097151)return String(xS*t+e);let n=e&16777215,r=(e>>>24|t<<8)&16777215,i=t>>16&65535,a=n+r*6777216+i*6710656,o=r+i*8147497,s=i*2,c=1e7;return a>=c&&(o+=Math.floor(a/c),a%=c),o>=c&&(s+=Math.floor(o/c),o%=c),s.toString()+OS(o)+OS(a)}function TS(e,t){return{lo:e>>>0,hi:t>>>0}}function ES(e,t){return{lo:e|0,hi:t|0}}function DS(e,t){return t=~t,e?e=~e+1:t+=1,ES(e,t)}var OS=e=>{let t=String(e);return`0000000`.slice(t.length)+t};function kS(){let e=this.buf[this.pos++];if(!(e&128))return this.assertBounds(),e;let t=e&127;if(e=this.buf[this.pos++],t|=(e&127)<<7,!(e&128)||(e=this.buf[this.pos++],t|=(e&127)<<14,!(e&128))||(e=this.buf[this.pos++],t|=(e&127)<<21,!(e&128)))return this.assertBounds(),t;e=this.buf[this.pos++],t|=(e&15)<<28;for(let t=5;e&128&&t<10;t++)e=this.buf[this.pos++];if(e&128)throw Error(`invalid varint`);return this.assertBounds(),t>>>0}var AS=jS();function jS(){let e=new DataView(new ArrayBuffer(8));if(typeof BigInt==`function`&&typeof e.getBigInt64==`function`&&typeof e.getBigUint64==`function`&&typeof e.setBigInt64==`function`&&typeof e.setBigUint64==`function`&&(globalThis.Deno||globalThis.Bun||typeof process!=`object`||{}.BUF_BIGINT_DISABLE!==`1`)){let t=BigInt(`-9223372036854775808`),n=BigInt(`9223372036854775807`),r=BigInt(`0`),i=BigInt(`18446744073709551615`);return{zero:BigInt(0),supported:!0,parse(e){let r=typeof e==`bigint`?e:BigInt(e);if(r>n||ri||ta.call(e)),FS(i)}return PS}function LS(e){return(t,n)=>{let r=e(t);return n.set(r),{written:r.byteLength}}}var RS;(function(e){e[e.Varint=0]=`Varint`,e[e.Bit64=1]=`Bit64`,e[e.LengthDelimited=2]=`LengthDelimited`,e[e.StartGroup=3]=`StartGroup`,e[e.EndGroup=4]=`EndGroup`,e[e.Bit32=5]=`Bit32`})(RS||={});var Y=class{constructor(e){this.stackPos=[],this.encodeUtf8Into=e?LS(e):IS().encodeUtf8Into,this.buffer=VS,this.viewCache=HS,this.pos=0}ensureCapacity(e){let t=this.pos+e;if(t>this.buffer.length){let e=this.buffer.length||zS;for(;e0&&n.set(this.buffer),this.buffer=n}}view(){let e=this.buffer,t=this.viewCache;if(t.byteLength===e.byteLength)return t;let n=new DataView(e.buffer);return this.viewCache=n,n}finish(){let e=this.buffer.slice(0,this.pos);return this.pos=0,this.stackPos=[],e}fork(){return this.stackPos.push(this.pos),this.ensureCapacity(BS),this.buffer[this.pos++]=0,this}join(){let e=this.stackPos.pop();if(e===void 0)throw Error(`invalid state, fork stack empty`);let t=this.pos-e-BS,n=WS(t);return n>BS&&(this.ensureCapacity(n-BS),this.buffer.copyWithin(e+n,e+BS,this.pos)),this.pos=e,this.uint32(t),this.pos+=t,this}tag(e,t){return this.uint32((e<<3|t)>>>0)}raw(e){return this.ensureCapacity(e.length),this.buffer.set(e,this.pos),this.pos+=e.length,this}uint32(e){if(KS(e),this.ensureCapacity(5),e<128)return this.buffer[this.pos++]=e,this;for(;e>127;)this.buffer[this.pos++]=e&127|128,e>>>=7;return this.buffer[this.pos++]=e,this}int32(e){if(GS(e),e>=0)return this.uint32(e);this.ensureCapacity(10);for(let t=0;t<9;t++)this.buffer[this.pos++]=e&127|128,e>>=7;return this.buffer[this.pos++]=1,this}bool(e){return this.ensureCapacity(1),this.buffer[this.pos++]=+!!e,this}bytes(e){return this.uint32(e.byteLength),this.raw(e)}string(e){typeof e!=`string`&&(e=String(e));let t=e.length;if(t<=US){this.ensureCapacity(t+1);let n=this.buffer,r=this.pos;n[r++]=t;let i=0;for(;i127)break;n[r++]=t}if(i==t)return this.pos=r,this}this.ensureCapacity(t*3+5);let n=WS(t),r=this.buffer,i=this.pos,{written:a}=this.encodeUtf8Into(e,r.subarray(i+n)),o=WS(a);return o!=n&&r.copyWithin(i+o,i+n,i+n+a),this.uint32(a),this.pos+=a,this}float(e){return qS(e),this.ensureCapacity(4),this.view().setFloat32(this.pos,e,!0),this.pos+=4,this}double(e){return this.ensureCapacity(8),this.view().setFloat64(this.pos,e,!0),this.pos+=8,this}fixed32(e){return KS(e),this.ensureCapacity(4),this.view().setUint32(this.pos,e,!0),this.pos+=4,this}sfixed32(e){return GS(e),this.ensureCapacity(4),this.view().setInt32(this.pos,e,!0),this.pos+=4,this}sint32(e){return GS(e),this.uint32((e<<1^e>>31)>>>0)}sfixed64(e){let t=AS.enc(e);this.ensureCapacity(8);let n=this.view();return n.setInt32(this.pos,t.lo,!0),n.setInt32(this.pos+4,t.hi,!0),this.pos+=8,this}fixed64(e){let t=AS.uEnc(e);this.ensureCapacity(8);let n=this.view();return n.setInt32(this.pos,t.lo,!0),n.setInt32(this.pos+4,t.hi,!0),this.pos+=8,this}int64(e){let t=AS.enc(e);return this.writeVarint64(t.lo,t.hi)}sint64(e){let t=AS.enc(e),n=t.hi>>31,r=t.lo<<1^n,i=(t.hi<<1|t.lo>>>31)^n;return this.writeVarint64(r,i)}uint64(e){let t=AS.uEnc(e);return this.writeVarint64(t.lo,t.hi)}writeVarint64(e,t){this.ensureCapacity(10);let n=this.buffer,r=this.pos;for(let i=0;i<28;i+=7){let a=e>>>i,o=!(!(a>>>7)&&t==0);if(n[r++]=(o?a|128:a)&255,!o)return this.pos=r,this}let i=e>>>28&15|(t&7)<<4,a=!!(t>>3);if(n[r++]=(a?i|128:i)&255,!a)return this.pos=r,this;for(let e=3;e<31;e+=7){let i=t>>>e,a=!!(i>>>7);if(n[r++]=(a?i|128:i)&255,!a)return this.pos=r,this}return n[r++]=t>>>31&1,this.pos=r,this}},zS=128,BS=1,VS=new Uint8Array,HS=new DataView(VS.buffer),US=32;function WS(e){return e<128?1:e<16384?2:e<2097152?3:e<268435456?4:5}var X=class{constructor(e,t=IS().decodeUtf8){this.decodeUtf8=t,this.varint64Lo=0,this.varint64Hi=0,this.varint64=bS,this.uint32=kS,this.buf=e,this.len=e.length,this.pos=0,this.view=new DataView(e.buffer,e.byteOffset,e.byteLength)}tag(){let e=this.pos,t=this.uint32(),n=this.pos-e;if(n>5||n==5&&this.buf[this.pos-1]>15)throw Error(`illegal tag: varint overflows uint32`);let r=t>>>3,i=t&7;if(r<=0||i>5)throw Error(`illegal tag: field no `+r+` wire type `+i);return[r,i]}skip(e,t,n=100){let r=this.pos;switch(e){case RS.Varint:for(;this.buf[this.pos++]&128;);break;case RS.Bit64:this.pos+=4;case RS.Bit32:this.pos+=4;break;case RS.LengthDelimited:let r=this.uint32();this.pos+=r;break;case RS.StartGroup:if(n<=0)throw Error(`maximum recursion depth reached`);for(;;){let[e,r]=this.tag();if(r===RS.EndGroup){if(t!==void 0&&e!==t)throw Error(`invalid end group tag`);break}this.skip(r,e,n-1)}break;default:throw Error(`cant skip wire type `+e)}return this.assertBounds(),this.buf.subarray(r,this.pos)}assertBounds(){if(this.pos>this.len)throw RangeError(`premature EOF`)}int32(){return this.uint32()|0}sint32(){let e=this.uint32();return e>>>1^-(e&1)}int64(){return this.varint64(),AS.dec(this.varint64Lo,this.varint64Hi)}uint64(){return this.varint64(),AS.uDec(this.varint64Lo,this.varint64Hi)}sint64(){this.varint64();let e=this.varint64Lo,t=this.varint64Hi,n=-(e&1);return e=(e>>>1|(t&1)<<31)^n,t=t>>>1^n,AS.dec(e,t)}bool(){let e=this.buf[this.pos];return e<128?(this.pos++,e!==0):(this.varint64(),this.varint64Lo!==0||this.varint64Hi!==0)}fixed32(){return this.view.getUint32((this.pos+=4)-4,!0)}sfixed32(){return this.view.getInt32((this.pos+=4)-4,!0)}fixed64(){return AS.uDec(this.sfixed32(),this.sfixed32())}sfixed64(){return AS.dec(this.sfixed32(),this.sfixed32())}float(){return this.view.getFloat32((this.pos+=4)-4,!0)}double(){return this.view.getFloat64((this.pos+=8)-8,!0)}bytes(){let e=this.uint32(),t=this.pos;return this.pos+=e,this.assertBounds(),this.buf.subarray(t,t+e)}string(e){let t=this.bytes(),n=t.length;if(n<=US){let r=Array(n);for(let i=0;i127)return this.decodeUtf8(t,e);r[i]=n}return String.fromCharCode.apply(String,r)}return this.decodeUtf8(t,e)}};function GS(e){if(typeof e==`string`)e=Number(e);else if(typeof e!=`number`)throw Error(`invalid int32: `+typeof e);if(!Number.isInteger(e)||e>2147483647||e<-2147483648)throw Error(`invalid int32: `+e)}function KS(e){if(typeof e==`string`)e=Number(e);else if(typeof e!=`number`)throw Error(`invalid uint32: `+typeof e);if(!Number.isInteger(e)||e>4294967295||e<0)throw Error(`invalid uint32: `+e)}function qS(e){if(typeof e==`string`){let t=e;if(e=Number(e),Number.isNaN(e)&&t!==`NaN`)throw Error(`invalid float32: `+t)}else if(typeof e!=`number`)throw Error(`invalid float32: `+typeof e);if(!Number.isFinite(Math.fround(e))&&Number.isFinite(e))throw Error(`invalid float32: `+e)}var JS=function(e){return e[e.NULL_VALUE=0]=`NULL_VALUE`,e[e.UNRECOGNIZED=-1]=`UNRECOGNIZED`,e}({});function YS(){return{fields:{}}}var XS={encode(e,t=new Y){return Object.entries(e.fields).forEach(([e,n])=>{n!==void 0&&QS.encode({key:e,value:n},t.uint32(10).fork()).join()}),t},decode(e,t){let n=e instanceof X?e:new X(e),r=t===void 0?n.len:n.pos+t,i=YS();for(;n.pos>>3){case 1:{if(e!==10)break;let t=QS.decode(n,n.uint32());t.value!==void 0&&(i.fields[t.key]=t.value);continue}}if((e&7)==4||e===0)break;n.skip(e&7)}return i},create(e){return XS.fromPartial(e??{})},fromPartial(e){let t=YS();return t.fields=Object.entries(e.fields??{}).reduce((e,[t,n])=>(n!==void 0&&(e[t]=n),e),{}),t},wrap(e){let t=YS();if(e!==void 0)for(let n of Object.keys(e))t.fields[n]=e[n];return t},unwrap(e){let t={};if(e.fields)for(let n of Object.keys(e.fields))t[n]=e.fields[n];return t}};function ZS(){return{key:``,value:void 0}}var QS={encode(e,t=new Y){return e.key!==``&&t.uint32(10).string(e.key),e.value!==void 0&&Z.encode(Z.wrap(e.value),t.uint32(18).fork()).join(),t},decode(e,t){let n=e instanceof X?e:new X(e),r=t===void 0?n.len:n.pos+t,i=ZS();for(;n.pos>>3){case 1:if(e!==10)break;i.key=n.string();continue;case 2:if(e!==18)break;i.value=Z.unwrap(Z.decode(n,n.uint32()));continue}if((e&7)==4||e===0)break;n.skip(e&7)}return i},create(e){return QS.fromPartial(e??{})},fromPartial(e){let t=ZS();return t.key=e.key??``,t.value=e.value??void 0,t}};function $S(){return{nullValue:void 0,numberValue:void 0,stringValue:void 0,boolValue:void 0,structValue:void 0,listValue:void 0}}var Z={encode(e,t=new Y){return e.nullValue!==void 0&&t.uint32(8).int32(e.nullValue),e.numberValue!==void 0&&t.uint32(17).double(e.numberValue),e.stringValue!==void 0&&t.uint32(26).string(e.stringValue),e.boolValue!==void 0&&t.uint32(32).bool(e.boolValue),e.structValue!==void 0&&XS.encode(XS.wrap(e.structValue),t.uint32(42).fork()).join(),e.listValue!==void 0&&tC.encode(tC.wrap(e.listValue),t.uint32(50).fork()).join(),t},decode(e,t){let n=e instanceof X?e:new X(e),r=t===void 0?n.len:n.pos+t,i=$S();for(;n.pos>>3){case 1:if(e!==8)break;i.nullValue=n.int32();continue;case 2:if(e!==17)break;i.numberValue=n.double();continue;case 3:if(e!==26)break;i.stringValue=n.string();continue;case 4:if(e!==32)break;i.boolValue=n.bool();continue;case 5:if(e!==42)break;i.structValue=XS.unwrap(XS.decode(n,n.uint32()));continue;case 6:if(e!==50)break;i.listValue=tC.unwrap(tC.decode(n,n.uint32()));continue}if((e&7)==4||e===0)break;n.skip(e&7)}return i},create(e){return Z.fromPartial(e??{})},fromPartial(e){let t=$S();return t.nullValue=e.nullValue??void 0,t.numberValue=e.numberValue??void 0,t.stringValue=e.stringValue??void 0,t.boolValue=e.boolValue??void 0,t.structValue=e.structValue??void 0,t.listValue=e.listValue??void 0,t},wrap(e){let t=$S();if(e===null)t.nullValue=JS.NULL_VALUE;else if(typeof e==`boolean`)t.boolValue=e;else if(typeof e==`number`)t.numberValue=e;else if(typeof e==`string`)t.stringValue=e;else if(globalThis.Array.isArray(e))t.listValue=e;else if(typeof e==`object`)t.structValue=e;else if(e!==void 0)throw new globalThis.Error(`Unsupported any value type: `+typeof e);return t},unwrap(e){if(e.stringValue!==void 0)return e.stringValue;if(e?.numberValue!==void 0)return e.numberValue;if(e?.boolValue!==void 0)return e.boolValue;if(e?.structValue!==void 0)return e.structValue;if(e?.listValue!==void 0)return e.listValue;if(e?.nullValue!==void 0)return null}};function eC(){return{values:[]}}var tC={encode(e,t=new Y){for(let n of e.values)Z.encode(Z.wrap(n),t.uint32(10).fork()).join();return t},decode(e,t){let n=e instanceof X?e:new X(e),r=t===void 0?n.len:n.pos+t,i=eC();for(;n.pos>>3){case 1:if(e!==10)break;i.values.push(Z.unwrap(Z.decode(n,n.uint32())));continue}if((e&7)==4||e===0)break;n.skip(e&7)}return i},create(e){return tC.fromPartial(e??{})},fromPartial(e){let t=eC();return t.values=e.values?.map(e=>e)||[],t},wrap(e){let t=eC();return t.values=e??[],t},unwrap(e){return e?.hasOwnProperty(`values`)&&globalThis.Array.isArray(e.values)?e.values:e}},nC=function(e){return e[e.ADD=0]=`ADD`,e[e.REMOVE=1]=`REMOVE`,e[e.REPLACE=2]=`REPLACE`,e[e.MOVE=3]=`MOVE`,e[e.COPY=4]=`COPY`,e[e.TEST=5]=`TEST`,e[e.UNRECOGNIZED=-1]=`UNRECOGNIZED`,e}({});function rC(){return{op:0,path:``,from:void 0,value:void 0}}var iC={encode(e,t=new Y){return e.op!==0&&t.uint32(8).int32(e.op),e.path!==``&&t.uint32(18).string(e.path),e.from!==void 0&&t.uint32(26).string(e.from),e.value!==void 0&&Z.encode(Z.wrap(e.value),t.uint32(34).fork()).join(),t},decode(e,t){let n=e instanceof X?e:new X(e),r=t===void 0?n.len:n.pos+t,i=rC();for(;n.pos>>3){case 1:if(e!==8)break;i.op=n.int32();continue;case 2:if(e!==18)break;i.path=n.string();continue;case 3:if(e!==26)break;i.from=n.string();continue;case 4:if(e!==34)break;i.value=Z.unwrap(Z.decode(n,n.uint32()));continue}if((e&7)==4||e===0)break;n.skip(e&7)}return i},create(e){return iC.fromPartial(e??{})},fromPartial(e){let t=rC();return t.op=e.op??0,t.path=e.path??``,t.from=e.from??void 0,t.value=e.value??void 0,t}};function aC(){return{text:``,id:void 0,metadata:void 0}}var oC={encode(e,t=new Y){return e.text!==``&&t.uint32(10).string(e.text),e.id!==void 0&&t.uint32(18).string(e.id),e.metadata!==void 0&&Z.encode(Z.wrap(e.metadata),t.uint32(26).fork()).join(),t},decode(e,t){let n=e instanceof X?e:new X(e),r=t===void 0?n.len:n.pos+t,i=aC();for(;n.pos>>3){case 1:if(e!==10)break;i.text=n.string();continue;case 2:if(e!==18)break;i.id=n.string();continue;case 3:if(e!==26)break;i.metadata=Z.unwrap(Z.decode(n,n.uint32()));continue}if((e&7)==4||e===0)break;n.skip(e&7)}return i},create(e){return oC.fromPartial(e??{})},fromPartial(e){let t=aC();return t.text=e.text??``,t.id=e.id??void 0,t.metadata=e.metadata??void 0,t}};function sC(){return{source:void 0,metadata:void 0,id:void 0}}var cC={encode(e,t=new Y){return e.source!==void 0&&gC.encode(e.source,t.uint32(10).fork()).join(),e.metadata!==void 0&&Z.encode(Z.wrap(e.metadata),t.uint32(18).fork()).join(),e.id!==void 0&&t.uint32(26).string(e.id),t},decode(e,t){let n=e instanceof X?e:new X(e),r=t===void 0?n.len:n.pos+t,i=sC();for(;n.pos>>3){case 1:if(e!==10)break;i.source=gC.decode(n,n.uint32());continue;case 2:if(e!==18)break;i.metadata=Z.unwrap(Z.decode(n,n.uint32()));continue;case 3:if(e!==26)break;i.id=n.string();continue}if((e&7)==4||e===0)break;n.skip(e&7)}return i},create(e){return cC.fromPartial(e??{})},fromPartial(e){let t=sC();return t.source=e.source!==void 0&&e.source!==null?gC.fromPartial(e.source):void 0,t.metadata=e.metadata??void 0,t.id=e.id??void 0,t}};function lC(){return{value:``,mimeType:``}}var uC={encode(e,t=new Y){return e.value!==``&&t.uint32(10).string(e.value),e.mimeType!==``&&t.uint32(18).string(e.mimeType),t},decode(e,t){let n=e instanceof X?e:new X(e),r=t===void 0?n.len:n.pos+t,i=lC();for(;n.pos>>3){case 1:if(e!==10)break;i.value=n.string();continue;case 2:if(e!==18)break;i.mimeType=n.string();continue}if((e&7)==4||e===0)break;n.skip(e&7)}return i},create(e){return uC.fromPartial(e??{})},fromPartial(e){let t=lC();return t.value=e.value??``,t.mimeType=e.mimeType??``,t}};function dC(){return{value:``,mimeType:void 0}}var fC={encode(e,t=new Y){return e.value!==``&&t.uint32(10).string(e.value),e.mimeType!==void 0&&t.uint32(18).string(e.mimeType),t},decode(e,t){let n=e instanceof X?e:new X(e),r=t===void 0?n.len:n.pos+t,i=dC();for(;n.pos>>3){case 1:if(e!==10)break;i.value=n.string();continue;case 2:if(e!==18)break;i.mimeType=n.string();continue}if((e&7)==4||e===0)break;n.skip(e&7)}return i},create(e){return fC.fromPartial(e??{})},fromPartial(e){let t=dC();return t.value=e.value??``,t.mimeType=e.mimeType??void 0,t}};function pC(){return{value:``,provider:void 0,mimeType:void 0}}var mC={encode(e,t=new Y){return e.value!==``&&t.uint32(10).string(e.value),e.provider!==void 0&&t.uint32(18).string(e.provider),e.mimeType!==void 0&&t.uint32(26).string(e.mimeType),t},decode(e,t){let n=e instanceof X?e:new X(e),r=t===void 0?n.len:n.pos+t,i=pC();for(;n.pos>>3){case 1:if(e!==10)break;i.value=n.string();continue;case 2:if(e!==18)break;i.provider=n.string();continue;case 3:if(e!==26)break;i.mimeType=n.string();continue}if((e&7)==4||e===0)break;n.skip(e&7)}return i},create(e){return mC.fromPartial(e??{})},fromPartial(e){let t=pC();return t.value=e.value??``,t.provider=e.provider??void 0,t.mimeType=e.mimeType??void 0,t}};function hC(){return{data:void 0,url:void 0,file:void 0}}var gC={encode(e,t=new Y){return e.data!==void 0&&uC.encode(e.data,t.uint32(10).fork()).join(),e.url!==void 0&&fC.encode(e.url,t.uint32(18).fork()).join(),e.file!==void 0&&mC.encode(e.file,t.uint32(26).fork()).join(),t},decode(e,t){let n=e instanceof X?e:new X(e),r=t===void 0?n.len:n.pos+t,i=hC();for(;n.pos>>3){case 1:if(e!==10)break;i.data=uC.decode(n,n.uint32());continue;case 2:if(e!==18)break;i.url=fC.decode(n,n.uint32());continue;case 3:if(e!==26)break;i.file=mC.decode(n,n.uint32());continue}if((e&7)==4||e===0)break;n.skip(e&7)}return i},create(e){return gC.fromPartial(e??{})},fromPartial(e){let t=hC();return t.data=e.data!==void 0&&e.data!==null?uC.fromPartial(e.data):void 0,t.url=e.url!==void 0&&e.url!==null?fC.fromPartial(e.url):void 0,t.file=e.file!==void 0&&e.file!==null?mC.fromPartial(e.file):void 0,t}};function _C(){return{source:void 0,metadata:void 0,id:void 0}}var vC={encode(e,t=new Y){return e.source!==void 0&&gC.encode(e.source,t.uint32(10).fork()).join(),e.metadata!==void 0&&Z.encode(Z.wrap(e.metadata),t.uint32(18).fork()).join(),e.id!==void 0&&t.uint32(26).string(e.id),t},decode(e,t){let n=e instanceof X?e:new X(e),r=t===void 0?n.len:n.pos+t,i=_C();for(;n.pos>>3){case 1:if(e!==10)break;i.source=gC.decode(n,n.uint32());continue;case 2:if(e!==18)break;i.metadata=Z.unwrap(Z.decode(n,n.uint32()));continue;case 3:if(e!==26)break;i.id=n.string();continue}if((e&7)==4||e===0)break;n.skip(e&7)}return i},create(e){return vC.fromPartial(e??{})},fromPartial(e){let t=_C();return t.source=e.source!==void 0&&e.source!==null?gC.fromPartial(e.source):void 0,t.metadata=e.metadata??void 0,t.id=e.id??void 0,t}};function yC(){return{source:void 0,metadata:void 0,id:void 0}}var bC={encode(e,t=new Y){return e.source!==void 0&&gC.encode(e.source,t.uint32(10).fork()).join(),e.metadata!==void 0&&Z.encode(Z.wrap(e.metadata),t.uint32(18).fork()).join(),e.id!==void 0&&t.uint32(26).string(e.id),t},decode(e,t){let n=e instanceof X?e:new X(e),r=t===void 0?n.len:n.pos+t,i=yC();for(;n.pos>>3){case 1:if(e!==10)break;i.source=gC.decode(n,n.uint32());continue;case 2:if(e!==18)break;i.metadata=Z.unwrap(Z.decode(n,n.uint32()));continue;case 3:if(e!==26)break;i.id=n.string();continue}if((e&7)==4||e===0)break;n.skip(e&7)}return i},create(e){return bC.fromPartial(e??{})},fromPartial(e){let t=yC();return t.source=e.source!==void 0&&e.source!==null?gC.fromPartial(e.source):void 0,t.metadata=e.metadata??void 0,t.id=e.id??void 0,t}};function xC(){return{source:void 0,metadata:void 0,id:void 0}}var SC={encode(e,t=new Y){return e.source!==void 0&&gC.encode(e.source,t.uint32(10).fork()).join(),e.metadata!==void 0&&Z.encode(Z.wrap(e.metadata),t.uint32(18).fork()).join(),e.id!==void 0&&t.uint32(26).string(e.id),t},decode(e,t){let n=e instanceof X?e:new X(e),r=t===void 0?n.len:n.pos+t,i=xC();for(;n.pos>>3){case 1:if(e!==10)break;i.source=gC.decode(n,n.uint32());continue;case 2:if(e!==18)break;i.metadata=Z.unwrap(Z.decode(n,n.uint32()));continue;case 3:if(e!==26)break;i.id=n.string();continue}if((e&7)==4||e===0)break;n.skip(e&7)}return i},create(e){return SC.fromPartial(e??{})},fromPartial(e){let t=xC();return t.source=e.source!==void 0&&e.source!==null?gC.fromPartial(e.source):void 0,t.metadata=e.metadata??void 0,t.id=e.id??void 0,t}};function CC(){return{text:void 0,image:void 0,audio:void 0,video:void 0,document:void 0}}var wC={encode(e,t=new Y){return e.text!==void 0&&oC.encode(e.text,t.uint32(10).fork()).join(),e.image!==void 0&&cC.encode(e.image,t.uint32(18).fork()).join(),e.audio!==void 0&&vC.encode(e.audio,t.uint32(26).fork()).join(),e.video!==void 0&&bC.encode(e.video,t.uint32(34).fork()).join(),e.document!==void 0&&SC.encode(e.document,t.uint32(42).fork()).join(),t},decode(e,t){let n=e instanceof X?e:new X(e),r=t===void 0?n.len:n.pos+t,i=CC();for(;n.pos>>3){case 1:if(e!==10)break;i.text=oC.decode(n,n.uint32());continue;case 2:if(e!==18)break;i.image=cC.decode(n,n.uint32());continue;case 3:if(e!==26)break;i.audio=vC.decode(n,n.uint32());continue;case 4:if(e!==34)break;i.video=bC.decode(n,n.uint32());continue;case 5:if(e!==42)break;i.document=SC.decode(n,n.uint32());continue}if((e&7)==4||e===0)break;n.skip(e&7)}return i},create(e){return wC.fromPartial(e??{})},fromPartial(e){let t=CC();return t.text=e.text!==void 0&&e.text!==null?oC.fromPartial(e.text):void 0,t.image=e.image!==void 0&&e.image!==null?cC.fromPartial(e.image):void 0,t.audio=e.audio!==void 0&&e.audio!==null?vC.fromPartial(e.audio):void 0,t.video=e.video!==void 0&&e.video!==null?bC.fromPartial(e.video):void 0,t.document=e.document!==void 0&&e.document!==null?SC.fromPartial(e.document):void 0,t}};function TC(){return{id:``,type:``,function:void 0,metadata:void 0,encryptedValue:void 0}}var EC={encode(e,t=new Y){return e.id!==``&&t.uint32(10).string(e.id),e.type!==``&&t.uint32(18).string(e.type),e.function!==void 0&&OC.encode(e.function,t.uint32(26).fork()).join(),e.metadata!==void 0&&XS.encode(XS.wrap(e.metadata),t.uint32(34).fork()).join(),e.encryptedValue!==void 0&&t.uint32(42).string(e.encryptedValue),t},decode(e,t){let n=e instanceof X?e:new X(e),r=t===void 0?n.len:n.pos+t,i=TC();for(;n.pos>>3){case 1:if(e!==10)break;i.id=n.string();continue;case 2:if(e!==18)break;i.type=n.string();continue;case 3:if(e!==26)break;i.function=OC.decode(n,n.uint32());continue;case 4:if(e!==34)break;i.metadata=XS.unwrap(XS.decode(n,n.uint32()));continue;case 5:if(e!==42)break;i.encryptedValue=n.string();continue}if((e&7)==4||e===0)break;n.skip(e&7)}return i},create(e){return EC.fromPartial(e??{})},fromPartial(e){let t=TC();return t.id=e.id??``,t.type=e.type??``,t.function=e.function!==void 0&&e.function!==null?OC.fromPartial(e.function):void 0,t.metadata=e.metadata??void 0,t.encryptedValue=e.encryptedValue??void 0,t}};function DC(){return{name:``,arguments:``}}var OC={encode(e,t=new Y){return e.name!==``&&t.uint32(10).string(e.name),e.arguments!==``&&t.uint32(18).string(e.arguments),t},decode(e,t){let n=e instanceof X?e:new X(e),r=t===void 0?n.len:n.pos+t,i=DC();for(;n.pos>>3){case 1:if(e!==10)break;i.name=n.string();continue;case 2:if(e!==18)break;i.arguments=n.string();continue}if((e&7)==4||e===0)break;n.skip(e&7)}return i},create(e){return OC.fromPartial(e??{})},fromPartial(e){let t=DC();return t.name=e.name??``,t.arguments=e.arguments??``,t}};function kC(){return{id:``,role:``,content:void 0,name:void 0,toolCalls:[],toolCallId:void 0,error:void 0,contentParts:[],metadata:void 0,subagentRunId:void 0,encryptedValue:void 0,activityType:void 0,activityContent:void 0}}var AC={encode(e,t=new Y){e.id!==``&&t.uint32(10).string(e.id),e.role!==``&&t.uint32(18).string(e.role),e.content!==void 0&&t.uint32(26).string(e.content),e.name!==void 0&&t.uint32(34).string(e.name);for(let n of e.toolCalls)EC.encode(n,t.uint32(42).fork()).join();e.toolCallId!==void 0&&t.uint32(50).string(e.toolCallId),e.error!==void 0&&t.uint32(58).string(e.error);for(let n of e.contentParts)wC.encode(n,t.uint32(66).fork()).join();return e.metadata!==void 0&&XS.encode(XS.wrap(e.metadata),t.uint32(74).fork()).join(),e.subagentRunId!==void 0&&t.uint32(82).string(e.subagentRunId),e.encryptedValue!==void 0&&t.uint32(90).string(e.encryptedValue),e.activityType!==void 0&&t.uint32(98).string(e.activityType),e.activityContent!==void 0&&XS.encode(XS.wrap(e.activityContent),t.uint32(106).fork()).join(),t},decode(e,t){let n=e instanceof X?e:new X(e),r=t===void 0?n.len:n.pos+t,i=kC();for(;n.pos>>3){case 1:if(e!==10)break;i.id=n.string();continue;case 2:if(e!==18)break;i.role=n.string();continue;case 3:if(e!==26)break;i.content=n.string();continue;case 4:if(e!==34)break;i.name=n.string();continue;case 5:if(e!==42)break;i.toolCalls.push(EC.decode(n,n.uint32()));continue;case 6:if(e!==50)break;i.toolCallId=n.string();continue;case 7:if(e!==58)break;i.error=n.string();continue;case 8:if(e!==66)break;i.contentParts.push(wC.decode(n,n.uint32()));continue;case 9:if(e!==74)break;i.metadata=XS.unwrap(XS.decode(n,n.uint32()));continue;case 10:if(e!==82)break;i.subagentRunId=n.string();continue;case 11:if(e!==90)break;i.encryptedValue=n.string();continue;case 12:if(e!==98)break;i.activityType=n.string();continue;case 13:if(e!==106)break;i.activityContent=XS.unwrap(XS.decode(n,n.uint32()));continue}if((e&7)==4||e===0)break;n.skip(e&7)}return i},create(e){return AC.fromPartial(e??{})},fromPartial(e){let t=kC();return t.id=e.id??``,t.role=e.role??``,t.content=e.content??void 0,t.name=e.name??void 0,t.toolCalls=e.toolCalls?.map(e=>EC.fromPartial(e))||[],t.toolCallId=e.toolCallId??void 0,t.error=e.error??void 0,t.contentParts=e.contentParts?.map(e=>wC.fromPartial(e))||[],t.metadata=e.metadata??void 0,t.subagentRunId=e.subagentRunId??void 0,t.encryptedValue=e.encryptedValue??void 0,t.activityType=e.activityType??void 0,t.activityContent=e.activityContent??void 0,t}};function jC(){return{name:``,description:``,parameters:void 0,metadata:void 0}}var MC={encode(e,t=new Y){return e.name!==``&&t.uint32(10).string(e.name),e.description!==``&&t.uint32(18).string(e.description),e.parameters!==void 0&&Z.encode(Z.wrap(e.parameters),t.uint32(26).fork()).join(),e.metadata!==void 0&&XS.encode(XS.wrap(e.metadata),t.uint32(34).fork()).join(),t},decode(e,t){let n=e instanceof X?e:new X(e),r=t===void 0?n.len:n.pos+t,i=jC();for(;n.pos>>3){case 1:if(e!==10)break;i.name=n.string();continue;case 2:if(e!==18)break;i.description=n.string();continue;case 3:if(e!==26)break;i.parameters=Z.unwrap(Z.decode(n,n.uint32()));continue;case 4:if(e!==34)break;i.metadata=XS.unwrap(XS.decode(n,n.uint32()));continue}if((e&7)==4||e===0)break;n.skip(e&7)}return i},create(e){return MC.fromPartial(e??{})},fromPartial(e){let t=jC();return t.name=e.name??``,t.description=e.description??``,t.parameters=e.parameters??void 0,t.metadata=e.metadata??void 0,t}};function NC(){return{description:``,value:``}}var PC={encode(e,t=new Y){return e.description!==``&&t.uint32(10).string(e.description),e.value!==``&&t.uint32(18).string(e.value),t},decode(e,t){let n=e instanceof X?e:new X(e),r=t===void 0?n.len:n.pos+t,i=NC();for(;n.pos>>3){case 1:if(e!==10)break;i.description=n.string();continue;case 2:if(e!==18)break;i.value=n.string();continue}if((e&7)==4||e===0)break;n.skip(e&7)}return i},create(e){return PC.fromPartial(e??{})},fromPartial(e){let t=NC();return t.description=e.description??``,t.value=e.value??``,t}};function FC(){return{interruptId:``,status:``,payload:void 0,metadata:void 0}}var IC={encode(e,t=new Y){return e.interruptId!==``&&t.uint32(10).string(e.interruptId),e.status!==``&&t.uint32(18).string(e.status),e.payload!==void 0&&Z.encode(Z.wrap(e.payload),t.uint32(26).fork()).join(),e.metadata!==void 0&&XS.encode(XS.wrap(e.metadata),t.uint32(34).fork()).join(),t},decode(e,t){let n=e instanceof X?e:new X(e),r=t===void 0?n.len:n.pos+t,i=FC();for(;n.pos>>3){case 1:if(e!==10)break;i.interruptId=n.string();continue;case 2:if(e!==18)break;i.status=n.string();continue;case 3:if(e!==26)break;i.payload=Z.unwrap(Z.decode(n,n.uint32()));continue;case 4:if(e!==34)break;i.metadata=XS.unwrap(XS.decode(n,n.uint32()));continue}if((e&7)==4||e===0)break;n.skip(e&7)}return i},create(e){return IC.fromPartial(e??{})},fromPartial(e){let t=FC();return t.interruptId=e.interruptId??``,t.status=e.status??``,t.payload=e.payload??void 0,t.metadata=e.metadata??void 0,t}};function LC(){return{threadId:``,runId:``,parentRunId:void 0,state:void 0,messages:[],tools:[],context:[],forwardedProps:void 0,resume:[],protocolVersion:void 0}}var RC={encode(e,t=new Y){e.threadId!==``&&t.uint32(10).string(e.threadId),e.runId!==``&&t.uint32(18).string(e.runId),e.parentRunId!==void 0&&t.uint32(26).string(e.parentRunId),e.state!==void 0&&Z.encode(Z.wrap(e.state),t.uint32(34).fork()).join();for(let n of e.messages)AC.encode(n,t.uint32(42).fork()).join();for(let n of e.tools)MC.encode(n,t.uint32(50).fork()).join();for(let n of e.context)PC.encode(n,t.uint32(58).fork()).join();e.forwardedProps!==void 0&&Z.encode(Z.wrap(e.forwardedProps),t.uint32(66).fork()).join();for(let n of e.resume)IC.encode(n,t.uint32(74).fork()).join();return e.protocolVersion!==void 0&&t.uint32(82).string(e.protocolVersion),t},decode(e,t){let n=e instanceof X?e:new X(e),r=t===void 0?n.len:n.pos+t,i=LC();for(;n.pos>>3){case 1:if(e!==10)break;i.threadId=n.string();continue;case 2:if(e!==18)break;i.runId=n.string();continue;case 3:if(e!==26)break;i.parentRunId=n.string();continue;case 4:if(e!==34)break;i.state=Z.unwrap(Z.decode(n,n.uint32()));continue;case 5:if(e!==42)break;i.messages.push(AC.decode(n,n.uint32()));continue;case 6:if(e!==50)break;i.tools.push(MC.decode(n,n.uint32()));continue;case 7:if(e!==58)break;i.context.push(PC.decode(n,n.uint32()));continue;case 8:if(e!==66)break;i.forwardedProps=Z.unwrap(Z.decode(n,n.uint32()));continue;case 9:if(e!==74)break;i.resume.push(IC.decode(n,n.uint32()));continue;case 10:if(e!==82)break;i.protocolVersion=n.string();continue}if((e&7)==4||e===0)break;n.skip(e&7)}return i},create(e){return RC.fromPartial(e??{})},fromPartial(e){let t=LC();return t.threadId=e.threadId??``,t.runId=e.runId??``,t.parentRunId=e.parentRunId??void 0,t.state=e.state??void 0,t.messages=e.messages?.map(e=>AC.fromPartial(e))||[],t.tools=e.tools?.map(e=>MC.fromPartial(e))||[],t.context=e.context?.map(e=>PC.fromPartial(e))||[],t.forwardedProps=e.forwardedProps??void 0,t.resume=e.resume?.map(e=>IC.fromPartial(e))||[],t.protocolVersion=e.protocolVersion??void 0,t}};function zC(){return{id:``,reason:``,message:void 0,toolCallId:void 0,responseSchema:void 0,expiresAt:void 0,metadata:void 0,subagentRunId:void 0}}var BC={encode(e,t=new Y){return e.id!==``&&t.uint32(10).string(e.id),e.reason!==``&&t.uint32(18).string(e.reason),e.message!==void 0&&t.uint32(26).string(e.message),e.toolCallId!==void 0&&t.uint32(34).string(e.toolCallId),e.responseSchema!==void 0&&Z.encode(Z.wrap(e.responseSchema),t.uint32(42).fork()).join(),e.expiresAt!==void 0&&t.uint32(50).string(e.expiresAt),e.metadata!==void 0&&Z.encode(Z.wrap(e.metadata),t.uint32(58).fork()).join(),e.subagentRunId!==void 0&&t.uint32(66).string(e.subagentRunId),t},decode(e,t){let n=e instanceof X?e:new X(e),r=t===void 0?n.len:n.pos+t,i=zC();for(;n.pos>>3){case 1:if(e!==10)break;i.id=n.string();continue;case 2:if(e!==18)break;i.reason=n.string();continue;case 3:if(e!==26)break;i.message=n.string();continue;case 4:if(e!==34)break;i.toolCallId=n.string();continue;case 5:if(e!==42)break;i.responseSchema=Z.unwrap(Z.decode(n,n.uint32()));continue;case 6:if(e!==50)break;i.expiresAt=n.string();continue;case 7:if(e!==58)break;i.metadata=Z.unwrap(Z.decode(n,n.uint32()));continue;case 8:if(e!==66)break;i.subagentRunId=n.string();continue}if((e&7)==4||e===0)break;n.skip(e&7)}return i},create(e){return BC.fromPartial(e??{})},fromPartial(e){let t=zC();return t.id=e.id??``,t.reason=e.reason??``,t.message=e.message??void 0,t.toolCallId=e.toolCallId??void 0,t.responseSchema=e.responseSchema??void 0,t.expiresAt=e.expiresAt??void 0,t.metadata=e.metadata??void 0,t.subagentRunId=e.subagentRunId??void 0,t}},VC=function(e){return e[e.TEXT_MESSAGE_START=0]=`TEXT_MESSAGE_START`,e[e.TEXT_MESSAGE_CONTENT=1]=`TEXT_MESSAGE_CONTENT`,e[e.TEXT_MESSAGE_END=2]=`TEXT_MESSAGE_END`,e[e.TOOL_CALL_START=3]=`TOOL_CALL_START`,e[e.TOOL_CALL_ARGS=4]=`TOOL_CALL_ARGS`,e[e.TOOL_CALL_END=5]=`TOOL_CALL_END`,e[e.STATE_SNAPSHOT=6]=`STATE_SNAPSHOT`,e[e.STATE_DELTA=7]=`STATE_DELTA`,e[e.MESSAGES_SNAPSHOT=8]=`MESSAGES_SNAPSHOT`,e[e.RAW=9]=`RAW`,e[e.CUSTOM=10]=`CUSTOM`,e[e.RUN_STARTED=11]=`RUN_STARTED`,e[e.RUN_FINISHED=12]=`RUN_FINISHED`,e[e.RUN_ERROR=13]=`RUN_ERROR`,e[e.STEP_STARTED=14]=`STEP_STARTED`,e[e.STEP_FINISHED=15]=`STEP_FINISHED`,e[e.SUBAGENT_STARTED=16]=`SUBAGENT_STARTED`,e[e.SUBAGENT_FINISHED=17]=`SUBAGENT_FINISHED`,e[e.SUBAGENT_ERROR=18]=`SUBAGENT_ERROR`,e[e.TEXT_MESSAGE_CHUNK=19]=`TEXT_MESSAGE_CHUNK`,e[e.TOOL_CALL_CHUNK=20]=`TOOL_CALL_CHUNK`,e[e.TOOL_CALL_RESULT=21]=`TOOL_CALL_RESULT`,e[e.ACTIVITY_SNAPSHOT=22]=`ACTIVITY_SNAPSHOT`,e[e.ACTIVITY_DELTA=23]=`ACTIVITY_DELTA`,e[e.REASONING_START=24]=`REASONING_START`,e[e.REASONING_MESSAGE_START=25]=`REASONING_MESSAGE_START`,e[e.REASONING_MESSAGE_CONTENT=26]=`REASONING_MESSAGE_CONTENT`,e[e.REASONING_MESSAGE_END=27]=`REASONING_MESSAGE_END`,e[e.REASONING_MESSAGE_CHUNK=28]=`REASONING_MESSAGE_CHUNK`,e[e.REASONING_END=29]=`REASONING_END`,e[e.REASONING_ENCRYPTED_VALUE=30]=`REASONING_ENCRYPTED_VALUE`,e[e.UNRECOGNIZED=-1]=`UNRECOGNIZED`,e}({});function HC(){return{type:0,timestamp:void 0,rawEvent:void 0,metadata:void 0}}var Q={encode(e,t=new Y){return e.type!==0&&t.uint32(8).int32(e.type),e.timestamp!==void 0&&t.uint32(16).int64(e.timestamp),e.rawEvent!==void 0&&Z.encode(Z.wrap(e.rawEvent),t.uint32(26).fork()).join(),e.metadata!==void 0&&XS.encode(XS.wrap(e.metadata),t.uint32(34).fork()).join(),t},decode(e,t){let n=e instanceof X?e:new X(e),r=t===void 0?n.len:n.pos+t,i=HC();for(;n.pos>>3){case 1:if(e!==8)break;i.type=n.int32();continue;case 2:if(e!==16)break;i.timestamp=tT(n.int64());continue;case 3:if(e!==26)break;i.rawEvent=Z.unwrap(Z.decode(n,n.uint32()));continue;case 4:if(e!==34)break;i.metadata=XS.unwrap(XS.decode(n,n.uint32()));continue}if((e&7)==4||e===0)break;n.skip(e&7)}return i},create(e){return Q.fromPartial(e??{})},fromPartial(e){let t=HC();return t.type=e.type??0,t.timestamp=e.timestamp??void 0,t.rawEvent=e.rawEvent??void 0,t.metadata=e.metadata??void 0,t}};function UC(){return{baseEvent:void 0,messageId:``,role:void 0,name:void 0,subagentRunId:void 0}}var WC={encode(e,t=new Y){return e.baseEvent!==void 0&&Q.encode(e.baseEvent,t.uint32(10).fork()).join(),e.messageId!==``&&t.uint32(18).string(e.messageId),e.role!==void 0&&t.uint32(26).string(e.role),e.name!==void 0&&t.uint32(34).string(e.name),e.subagentRunId!==void 0&&t.uint32(42).string(e.subagentRunId),t},decode(e,t){let n=e instanceof X?e:new X(e),r=t===void 0?n.len:n.pos+t,i=UC();for(;n.pos>>3){case 1:if(e!==10)break;i.baseEvent=Q.decode(n,n.uint32());continue;case 2:if(e!==18)break;i.messageId=n.string();continue;case 3:if(e!==26)break;i.role=n.string();continue;case 4:if(e!==34)break;i.name=n.string();continue;case 5:if(e!==42)break;i.subagentRunId=n.string();continue}if((e&7)==4||e===0)break;n.skip(e&7)}return i},create(e){return WC.fromPartial(e??{})},fromPartial(e){let t=UC();return t.baseEvent=e.baseEvent!==void 0&&e.baseEvent!==null?Q.fromPartial(e.baseEvent):void 0,t.messageId=e.messageId??``,t.role=e.role??void 0,t.name=e.name??void 0,t.subagentRunId=e.subagentRunId??void 0,t}};function GC(){return{baseEvent:void 0,messageId:``,delta:``,subagentRunId:void 0}}var KC={encode(e,t=new Y){return e.baseEvent!==void 0&&Q.encode(e.baseEvent,t.uint32(10).fork()).join(),e.messageId!==``&&t.uint32(18).string(e.messageId),e.delta!==``&&t.uint32(26).string(e.delta),e.subagentRunId!==void 0&&t.uint32(34).string(e.subagentRunId),t},decode(e,t){let n=e instanceof X?e:new X(e),r=t===void 0?n.len:n.pos+t,i=GC();for(;n.pos>>3){case 1:if(e!==10)break;i.baseEvent=Q.decode(n,n.uint32());continue;case 2:if(e!==18)break;i.messageId=n.string();continue;case 3:if(e!==26)break;i.delta=n.string();continue;case 4:if(e!==34)break;i.subagentRunId=n.string();continue}if((e&7)==4||e===0)break;n.skip(e&7)}return i},create(e){return KC.fromPartial(e??{})},fromPartial(e){let t=GC();return t.baseEvent=e.baseEvent!==void 0&&e.baseEvent!==null?Q.fromPartial(e.baseEvent):void 0,t.messageId=e.messageId??``,t.delta=e.delta??``,t.subagentRunId=e.subagentRunId??void 0,t}};function qC(){return{baseEvent:void 0,messageId:``,subagentRunId:void 0}}var JC={encode(e,t=new Y){return e.baseEvent!==void 0&&Q.encode(e.baseEvent,t.uint32(10).fork()).join(),e.messageId!==``&&t.uint32(18).string(e.messageId),e.subagentRunId!==void 0&&t.uint32(26).string(e.subagentRunId),t},decode(e,t){let n=e instanceof X?e:new X(e),r=t===void 0?n.len:n.pos+t,i=qC();for(;n.pos>>3){case 1:if(e!==10)break;i.baseEvent=Q.decode(n,n.uint32());continue;case 2:if(e!==18)break;i.messageId=n.string();continue;case 3:if(e!==26)break;i.subagentRunId=n.string();continue}if((e&7)==4||e===0)break;n.skip(e&7)}return i},create(e){return JC.fromPartial(e??{})},fromPartial(e){let t=qC();return t.baseEvent=e.baseEvent!==void 0&&e.baseEvent!==null?Q.fromPartial(e.baseEvent):void 0,t.messageId=e.messageId??``,t.subagentRunId=e.subagentRunId??void 0,t}};function YC(){return{baseEvent:void 0,messageId:void 0,role:void 0,delta:void 0,name:void 0,subagentRunId:void 0}}var XC={encode(e,t=new Y){return e.baseEvent!==void 0&&Q.encode(e.baseEvent,t.uint32(10).fork()).join(),e.messageId!==void 0&&t.uint32(18).string(e.messageId),e.role!==void 0&&t.uint32(26).string(e.role),e.delta!==void 0&&t.uint32(34).string(e.delta),e.name!==void 0&&t.uint32(42).string(e.name),e.subagentRunId!==void 0&&t.uint32(50).string(e.subagentRunId),t},decode(e,t){let n=e instanceof X?e:new X(e),r=t===void 0?n.len:n.pos+t,i=YC();for(;n.pos>>3){case 1:if(e!==10)break;i.baseEvent=Q.decode(n,n.uint32());continue;case 2:if(e!==18)break;i.messageId=n.string();continue;case 3:if(e!==26)break;i.role=n.string();continue;case 4:if(e!==34)break;i.delta=n.string();continue;case 5:if(e!==42)break;i.name=n.string();continue;case 6:if(e!==50)break;i.subagentRunId=n.string();continue}if((e&7)==4||e===0)break;n.skip(e&7)}return i},create(e){return XC.fromPartial(e??{})},fromPartial(e){let t=YC();return t.baseEvent=e.baseEvent!==void 0&&e.baseEvent!==null?Q.fromPartial(e.baseEvent):void 0,t.messageId=e.messageId??void 0,t.role=e.role??void 0,t.delta=e.delta??void 0,t.name=e.name??void 0,t.subagentRunId=e.subagentRunId??void 0,t}};function ZC(){return{baseEvent:void 0,toolCallId:``,toolCallName:``,parentMessageId:void 0,subagentRunId:void 0}}var QC={encode(e,t=new Y){return e.baseEvent!==void 0&&Q.encode(e.baseEvent,t.uint32(10).fork()).join(),e.toolCallId!==``&&t.uint32(18).string(e.toolCallId),e.toolCallName!==``&&t.uint32(26).string(e.toolCallName),e.parentMessageId!==void 0&&t.uint32(34).string(e.parentMessageId),e.subagentRunId!==void 0&&t.uint32(42).string(e.subagentRunId),t},decode(e,t){let n=e instanceof X?e:new X(e),r=t===void 0?n.len:n.pos+t,i=ZC();for(;n.pos>>3){case 1:if(e!==10)break;i.baseEvent=Q.decode(n,n.uint32());continue;case 2:if(e!==18)break;i.toolCallId=n.string();continue;case 3:if(e!==26)break;i.toolCallName=n.string();continue;case 4:if(e!==34)break;i.parentMessageId=n.string();continue;case 5:if(e!==42)break;i.subagentRunId=n.string();continue}if((e&7)==4||e===0)break;n.skip(e&7)}return i},create(e){return QC.fromPartial(e??{})},fromPartial(e){let t=ZC();return t.baseEvent=e.baseEvent!==void 0&&e.baseEvent!==null?Q.fromPartial(e.baseEvent):void 0,t.toolCallId=e.toolCallId??``,t.toolCallName=e.toolCallName??``,t.parentMessageId=e.parentMessageId??void 0,t.subagentRunId=e.subagentRunId??void 0,t}};function $C(){return{baseEvent:void 0,toolCallId:``,delta:``,subagentRunId:void 0}}var ew={encode(e,t=new Y){return e.baseEvent!==void 0&&Q.encode(e.baseEvent,t.uint32(10).fork()).join(),e.toolCallId!==``&&t.uint32(18).string(e.toolCallId),e.delta!==``&&t.uint32(26).string(e.delta),e.subagentRunId!==void 0&&t.uint32(34).string(e.subagentRunId),t},decode(e,t){let n=e instanceof X?e:new X(e),r=t===void 0?n.len:n.pos+t,i=$C();for(;n.pos>>3){case 1:if(e!==10)break;i.baseEvent=Q.decode(n,n.uint32());continue;case 2:if(e!==18)break;i.toolCallId=n.string();continue;case 3:if(e!==26)break;i.delta=n.string();continue;case 4:if(e!==34)break;i.subagentRunId=n.string();continue}if((e&7)==4||e===0)break;n.skip(e&7)}return i},create(e){return ew.fromPartial(e??{})},fromPartial(e){let t=$C();return t.baseEvent=e.baseEvent!==void 0&&e.baseEvent!==null?Q.fromPartial(e.baseEvent):void 0,t.toolCallId=e.toolCallId??``,t.delta=e.delta??``,t.subagentRunId=e.subagentRunId??void 0,t}};function tw(){return{baseEvent:void 0,toolCallId:``,subagentRunId:void 0}}var nw={encode(e,t=new Y){return e.baseEvent!==void 0&&Q.encode(e.baseEvent,t.uint32(10).fork()).join(),e.toolCallId!==``&&t.uint32(18).string(e.toolCallId),e.subagentRunId!==void 0&&t.uint32(26).string(e.subagentRunId),t},decode(e,t){let n=e instanceof X?e:new X(e),r=t===void 0?n.len:n.pos+t,i=tw();for(;n.pos>>3){case 1:if(e!==10)break;i.baseEvent=Q.decode(n,n.uint32());continue;case 2:if(e!==18)break;i.toolCallId=n.string();continue;case 3:if(e!==26)break;i.subagentRunId=n.string();continue}if((e&7)==4||e===0)break;n.skip(e&7)}return i},create(e){return nw.fromPartial(e??{})},fromPartial(e){let t=tw();return t.baseEvent=e.baseEvent!==void 0&&e.baseEvent!==null?Q.fromPartial(e.baseEvent):void 0,t.toolCallId=e.toolCallId??``,t.subagentRunId=e.subagentRunId??void 0,t}};function rw(){return{baseEvent:void 0,toolCallId:void 0,toolCallName:void 0,parentMessageId:void 0,delta:void 0,subagentRunId:void 0}}var iw={encode(e,t=new Y){return e.baseEvent!==void 0&&Q.encode(e.baseEvent,t.uint32(10).fork()).join(),e.toolCallId!==void 0&&t.uint32(18).string(e.toolCallId),e.toolCallName!==void 0&&t.uint32(26).string(e.toolCallName),e.parentMessageId!==void 0&&t.uint32(34).string(e.parentMessageId),e.delta!==void 0&&t.uint32(42).string(e.delta),e.subagentRunId!==void 0&&t.uint32(50).string(e.subagentRunId),t},decode(e,t){let n=e instanceof X?e:new X(e),r=t===void 0?n.len:n.pos+t,i=rw();for(;n.pos>>3){case 1:if(e!==10)break;i.baseEvent=Q.decode(n,n.uint32());continue;case 2:if(e!==18)break;i.toolCallId=n.string();continue;case 3:if(e!==26)break;i.toolCallName=n.string();continue;case 4:if(e!==34)break;i.parentMessageId=n.string();continue;case 5:if(e!==42)break;i.delta=n.string();continue;case 6:if(e!==50)break;i.subagentRunId=n.string();continue}if((e&7)==4||e===0)break;n.skip(e&7)}return i},create(e){return iw.fromPartial(e??{})},fromPartial(e){let t=rw();return t.baseEvent=e.baseEvent!==void 0&&e.baseEvent!==null?Q.fromPartial(e.baseEvent):void 0,t.toolCallId=e.toolCallId??void 0,t.toolCallName=e.toolCallName??void 0,t.parentMessageId=e.parentMessageId??void 0,t.delta=e.delta??void 0,t.subagentRunId=e.subagentRunId??void 0,t}};function aw(){return{baseEvent:void 0,subagentRunId:void 0,messageId:``,toolCallId:``,content:void 0,role:void 0,contentParts:[]}}var ow={encode(e,t=new Y){e.baseEvent!==void 0&&Q.encode(e.baseEvent,t.uint32(10).fork()).join(),e.subagentRunId!==void 0&&t.uint32(18).string(e.subagentRunId),e.messageId!==``&&t.uint32(26).string(e.messageId),e.toolCallId!==``&&t.uint32(34).string(e.toolCallId),e.content!==void 0&&t.uint32(42).string(e.content),e.role!==void 0&&t.uint32(50).string(e.role);for(let n of e.contentParts)wC.encode(n,t.uint32(58).fork()).join();return t},decode(e,t){let n=e instanceof X?e:new X(e),r=t===void 0?n.len:n.pos+t,i=aw();for(;n.pos>>3){case 1:if(e!==10)break;i.baseEvent=Q.decode(n,n.uint32());continue;case 2:if(e!==18)break;i.subagentRunId=n.string();continue;case 3:if(e!==26)break;i.messageId=n.string();continue;case 4:if(e!==34)break;i.toolCallId=n.string();continue;case 5:if(e!==42)break;i.content=n.string();continue;case 6:if(e!==50)break;i.role=n.string();continue;case 7:if(e!==58)break;i.contentParts.push(wC.decode(n,n.uint32()));continue}if((e&7)==4||e===0)break;n.skip(e&7)}return i},create(e){return ow.fromPartial(e??{})},fromPartial(e){let t=aw();return t.baseEvent=e.baseEvent!==void 0&&e.baseEvent!==null?Q.fromPartial(e.baseEvent):void 0,t.subagentRunId=e.subagentRunId??void 0,t.messageId=e.messageId??``,t.toolCallId=e.toolCallId??``,t.content=e.content??void 0,t.role=e.role??void 0,t.contentParts=e.contentParts?.map(e=>wC.fromPartial(e))||[],t}};function sw(){return{baseEvent:void 0,snapshot:void 0,subagentRunId:void 0}}var cw={encode(e,t=new Y){return e.baseEvent!==void 0&&Q.encode(e.baseEvent,t.uint32(10).fork()).join(),e.snapshot!==void 0&&Z.encode(Z.wrap(e.snapshot),t.uint32(18).fork()).join(),e.subagentRunId!==void 0&&t.uint32(26).string(e.subagentRunId),t},decode(e,t){let n=e instanceof X?e:new X(e),r=t===void 0?n.len:n.pos+t,i=sw();for(;n.pos>>3){case 1:if(e!==10)break;i.baseEvent=Q.decode(n,n.uint32());continue;case 2:if(e!==18)break;i.snapshot=Z.unwrap(Z.decode(n,n.uint32()));continue;case 3:if(e!==26)break;i.subagentRunId=n.string();continue}if((e&7)==4||e===0)break;n.skip(e&7)}return i},create(e){return cw.fromPartial(e??{})},fromPartial(e){let t=sw();return t.baseEvent=e.baseEvent!==void 0&&e.baseEvent!==null?Q.fromPartial(e.baseEvent):void 0,t.snapshot=e.snapshot??void 0,t.subagentRunId=e.subagentRunId??void 0,t}};function lw(){return{baseEvent:void 0,delta:[],subagentRunId:void 0}}var uw={encode(e,t=new Y){e.baseEvent!==void 0&&Q.encode(e.baseEvent,t.uint32(10).fork()).join();for(let n of e.delta)iC.encode(n,t.uint32(18).fork()).join();return e.subagentRunId!==void 0&&t.uint32(26).string(e.subagentRunId),t},decode(e,t){let n=e instanceof X?e:new X(e),r=t===void 0?n.len:n.pos+t,i=lw();for(;n.pos>>3){case 1:if(e!==10)break;i.baseEvent=Q.decode(n,n.uint32());continue;case 2:if(e!==18)break;i.delta.push(iC.decode(n,n.uint32()));continue;case 3:if(e!==26)break;i.subagentRunId=n.string();continue}if((e&7)==4||e===0)break;n.skip(e&7)}return i},create(e){return uw.fromPartial(e??{})},fromPartial(e){let t=lw();return t.baseEvent=e.baseEvent!==void 0&&e.baseEvent!==null?Q.fromPartial(e.baseEvent):void 0,t.delta=e.delta?.map(e=>iC.fromPartial(e))||[],t.subagentRunId=e.subagentRunId??void 0,t}};function dw(){return{baseEvent:void 0,messages:[]}}var fw={encode(e,t=new Y){e.baseEvent!==void 0&&Q.encode(e.baseEvent,t.uint32(10).fork()).join();for(let n of e.messages)AC.encode(n,t.uint32(18).fork()).join();return t},decode(e,t){let n=e instanceof X?e:new X(e),r=t===void 0?n.len:n.pos+t,i=dw();for(;n.pos>>3){case 1:if(e!==10)break;i.baseEvent=Q.decode(n,n.uint32());continue;case 2:if(e!==18)break;i.messages.push(AC.decode(n,n.uint32()));continue}if((e&7)==4||e===0)break;n.skip(e&7)}return i},create(e){return fw.fromPartial(e??{})},fromPartial(e){let t=dw();return t.baseEvent=e.baseEvent!==void 0&&e.baseEvent!==null?Q.fromPartial(e.baseEvent):void 0,t.messages=e.messages?.map(e=>AC.fromPartial(e))||[],t}};function pw(){return{baseEvent:void 0,subagentRunId:void 0,messageId:``,activityType:``,content:void 0,replace:void 0}}var mw={encode(e,t=new Y){return e.baseEvent!==void 0&&Q.encode(e.baseEvent,t.uint32(10).fork()).join(),e.subagentRunId!==void 0&&t.uint32(18).string(e.subagentRunId),e.messageId!==``&&t.uint32(26).string(e.messageId),e.activityType!==``&&t.uint32(34).string(e.activityType),e.content!==void 0&&XS.encode(XS.wrap(e.content),t.uint32(42).fork()).join(),e.replace!==void 0&&t.uint32(48).bool(e.replace),t},decode(e,t){let n=e instanceof X?e:new X(e),r=t===void 0?n.len:n.pos+t,i=pw();for(;n.pos>>3){case 1:if(e!==10)break;i.baseEvent=Q.decode(n,n.uint32());continue;case 2:if(e!==18)break;i.subagentRunId=n.string();continue;case 3:if(e!==26)break;i.messageId=n.string();continue;case 4:if(e!==34)break;i.activityType=n.string();continue;case 5:if(e!==42)break;i.content=XS.unwrap(XS.decode(n,n.uint32()));continue;case 6:if(e!==48)break;i.replace=n.bool();continue}if((e&7)==4||e===0)break;n.skip(e&7)}return i},create(e){return mw.fromPartial(e??{})},fromPartial(e){let t=pw();return t.baseEvent=e.baseEvent!==void 0&&e.baseEvent!==null?Q.fromPartial(e.baseEvent):void 0,t.subagentRunId=e.subagentRunId??void 0,t.messageId=e.messageId??``,t.activityType=e.activityType??``,t.content=e.content??void 0,t.replace=e.replace??void 0,t}};function hw(){return{baseEvent:void 0,subagentRunId:void 0,messageId:``,activityType:``,patch:[]}}var gw={encode(e,t=new Y){e.baseEvent!==void 0&&Q.encode(e.baseEvent,t.uint32(10).fork()).join(),e.subagentRunId!==void 0&&t.uint32(18).string(e.subagentRunId),e.messageId!==``&&t.uint32(26).string(e.messageId),e.activityType!==``&&t.uint32(34).string(e.activityType);for(let n of e.patch)iC.encode(n,t.uint32(42).fork()).join();return t},decode(e,t){let n=e instanceof X?e:new X(e),r=t===void 0?n.len:n.pos+t,i=hw();for(;n.pos>>3){case 1:if(e!==10)break;i.baseEvent=Q.decode(n,n.uint32());continue;case 2:if(e!==18)break;i.subagentRunId=n.string();continue;case 3:if(e!==26)break;i.messageId=n.string();continue;case 4:if(e!==34)break;i.activityType=n.string();continue;case 5:if(e!==42)break;i.patch.push(iC.decode(n,n.uint32()));continue}if((e&7)==4||e===0)break;n.skip(e&7)}return i},create(e){return gw.fromPartial(e??{})},fromPartial(e){let t=hw();return t.baseEvent=e.baseEvent!==void 0&&e.baseEvent!==null?Q.fromPartial(e.baseEvent):void 0,t.subagentRunId=e.subagentRunId??void 0,t.messageId=e.messageId??``,t.activityType=e.activityType??``,t.patch=e.patch?.map(e=>iC.fromPartial(e))||[],t}};function _w(){return{baseEvent:void 0,event:void 0,source:void 0,subagentRunId:void 0}}var vw={encode(e,t=new Y){return e.baseEvent!==void 0&&Q.encode(e.baseEvent,t.uint32(10).fork()).join(),e.event!==void 0&&Z.encode(Z.wrap(e.event),t.uint32(18).fork()).join(),e.source!==void 0&&t.uint32(26).string(e.source),e.subagentRunId!==void 0&&t.uint32(34).string(e.subagentRunId),t},decode(e,t){let n=e instanceof X?e:new X(e),r=t===void 0?n.len:n.pos+t,i=_w();for(;n.pos>>3){case 1:if(e!==10)break;i.baseEvent=Q.decode(n,n.uint32());continue;case 2:if(e!==18)break;i.event=Z.unwrap(Z.decode(n,n.uint32()));continue;case 3:if(e!==26)break;i.source=n.string();continue;case 4:if(e!==34)break;i.subagentRunId=n.string();continue}if((e&7)==4||e===0)break;n.skip(e&7)}return i},create(e){return vw.fromPartial(e??{})},fromPartial(e){let t=_w();return t.baseEvent=e.baseEvent!==void 0&&e.baseEvent!==null?Q.fromPartial(e.baseEvent):void 0,t.event=e.event??void 0,t.source=e.source??void 0,t.subagentRunId=e.subagentRunId??void 0,t}};function yw(){return{baseEvent:void 0,name:``,value:void 0,subagentRunId:void 0}}var bw={encode(e,t=new Y){return e.baseEvent!==void 0&&Q.encode(e.baseEvent,t.uint32(10).fork()).join(),e.name!==``&&t.uint32(18).string(e.name),e.value!==void 0&&Z.encode(Z.wrap(e.value),t.uint32(26).fork()).join(),e.subagentRunId!==void 0&&t.uint32(34).string(e.subagentRunId),t},decode(e,t){let n=e instanceof X?e:new X(e),r=t===void 0?n.len:n.pos+t,i=yw();for(;n.pos>>3){case 1:if(e!==10)break;i.baseEvent=Q.decode(n,n.uint32());continue;case 2:if(e!==18)break;i.name=n.string();continue;case 3:if(e!==26)break;i.value=Z.unwrap(Z.decode(n,n.uint32()));continue;case 4:if(e!==34)break;i.subagentRunId=n.string();continue}if((e&7)==4||e===0)break;n.skip(e&7)}return i},create(e){return bw.fromPartial(e??{})},fromPartial(e){let t=yw();return t.baseEvent=e.baseEvent!==void 0&&e.baseEvent!==null?Q.fromPartial(e.baseEvent):void 0,t.name=e.name??``,t.value=e.value??void 0,t.subagentRunId=e.subagentRunId??void 0,t}};function xw(){return{baseEvent:void 0,threadId:``,runId:``,parentRunId:void 0,input:void 0,protocolVersion:void 0}}var Sw={encode(e,t=new Y){return e.baseEvent!==void 0&&Q.encode(e.baseEvent,t.uint32(10).fork()).join(),e.threadId!==``&&t.uint32(18).string(e.threadId),e.runId!==``&&t.uint32(26).string(e.runId),e.parentRunId!==void 0&&t.uint32(34).string(e.parentRunId),e.input!==void 0&&RC.encode(e.input,t.uint32(42).fork()).join(),e.protocolVersion!==void 0&&t.uint32(50).string(e.protocolVersion),t},decode(e,t){let n=e instanceof X?e:new X(e),r=t===void 0?n.len:n.pos+t,i=xw();for(;n.pos>>3){case 1:if(e!==10)break;i.baseEvent=Q.decode(n,n.uint32());continue;case 2:if(e!==18)break;i.threadId=n.string();continue;case 3:if(e!==26)break;i.runId=n.string();continue;case 4:if(e!==34)break;i.parentRunId=n.string();continue;case 5:if(e!==42)break;i.input=RC.decode(n,n.uint32());continue;case 6:if(e!==50)break;i.protocolVersion=n.string();continue}if((e&7)==4||e===0)break;n.skip(e&7)}return i},create(e){return Sw.fromPartial(e??{})},fromPartial(e){let t=xw();return t.baseEvent=e.baseEvent!==void 0&&e.baseEvent!==null?Q.fromPartial(e.baseEvent):void 0,t.threadId=e.threadId??``,t.runId=e.runId??``,t.parentRunId=e.parentRunId??void 0,t.input=e.input!==void 0&&e.input!==null?RC.fromPartial(e.input):void 0,t.protocolVersion=e.protocolVersion??void 0,t}};function Cw(){return{baseEvent:void 0,threadId:``,runId:``,result:void 0,outcome:``,interrupts:[],usage:[],pendingToolCallIds:[]}}var ww={encode(e,t=new Y){e.baseEvent!==void 0&&Q.encode(e.baseEvent,t.uint32(10).fork()).join(),e.threadId!==``&&t.uint32(18).string(e.threadId),e.runId!==``&&t.uint32(26).string(e.runId),e.result!==void 0&&Z.encode(Z.wrap(e.result),t.uint32(34).fork()).join(),e.outcome!==``&&t.uint32(42).string(e.outcome);for(let n of e.interrupts)BC.encode(n,t.uint32(50).fork()).join();for(let n of e.usage)eT.encode(n,t.uint32(58).fork()).join();for(let n of e.pendingToolCallIds)t.uint32(66).string(n);return t},decode(e,t){let n=e instanceof X?e:new X(e),r=t===void 0?n.len:n.pos+t,i=Cw();for(;n.pos>>3){case 1:if(e!==10)break;i.baseEvent=Q.decode(n,n.uint32());continue;case 2:if(e!==18)break;i.threadId=n.string();continue;case 3:if(e!==26)break;i.runId=n.string();continue;case 4:if(e!==34)break;i.result=Z.unwrap(Z.decode(n,n.uint32()));continue;case 5:if(e!==42)break;i.outcome=n.string();continue;case 6:if(e!==50)break;i.interrupts.push(BC.decode(n,n.uint32()));continue;case 7:if(e!==58)break;i.usage.push(eT.decode(n,n.uint32()));continue;case 8:if(e!==66)break;i.pendingToolCallIds.push(n.string());continue}if((e&7)==4||e===0)break;n.skip(e&7)}return i},create(e){return ww.fromPartial(e??{})},fromPartial(e){let t=Cw();return t.baseEvent=e.baseEvent!==void 0&&e.baseEvent!==null?Q.fromPartial(e.baseEvent):void 0,t.threadId=e.threadId??``,t.runId=e.runId??``,t.result=e.result??void 0,t.outcome=e.outcome??``,t.interrupts=e.interrupts?.map(e=>BC.fromPartial(e))||[],t.usage=e.usage?.map(e=>eT.fromPartial(e))||[],t.pendingToolCallIds=e.pendingToolCallIds?.map(e=>e)||[],t}};function Tw(){return{baseEvent:void 0,code:void 0,message:``,usage:[]}}var Ew={encode(e,t=new Y){e.baseEvent!==void 0&&Q.encode(e.baseEvent,t.uint32(10).fork()).join(),e.code!==void 0&&t.uint32(18).string(e.code),e.message!==``&&t.uint32(26).string(e.message);for(let n of e.usage)eT.encode(n,t.uint32(34).fork()).join();return t},decode(e,t){let n=e instanceof X?e:new X(e),r=t===void 0?n.len:n.pos+t,i=Tw();for(;n.pos>>3){case 1:if(e!==10)break;i.baseEvent=Q.decode(n,n.uint32());continue;case 2:if(e!==18)break;i.code=n.string();continue;case 3:if(e!==26)break;i.message=n.string();continue;case 4:if(e!==34)break;i.usage.push(eT.decode(n,n.uint32()));continue}if((e&7)==4||e===0)break;n.skip(e&7)}return i},create(e){return Ew.fromPartial(e??{})},fromPartial(e){let t=Tw();return t.baseEvent=e.baseEvent!==void 0&&e.baseEvent!==null?Q.fromPartial(e.baseEvent):void 0,t.code=e.code??void 0,t.message=e.message??``,t.usage=e.usage?.map(e=>eT.fromPartial(e))||[],t}};function Dw(){return{baseEvent:void 0,stepName:``,subagentRunId:void 0}}var Ow={encode(e,t=new Y){return e.baseEvent!==void 0&&Q.encode(e.baseEvent,t.uint32(10).fork()).join(),e.stepName!==``&&t.uint32(18).string(e.stepName),e.subagentRunId!==void 0&&t.uint32(26).string(e.subagentRunId),t},decode(e,t){let n=e instanceof X?e:new X(e),r=t===void 0?n.len:n.pos+t,i=Dw();for(;n.pos>>3){case 1:if(e!==10)break;i.baseEvent=Q.decode(n,n.uint32());continue;case 2:if(e!==18)break;i.stepName=n.string();continue;case 3:if(e!==26)break;i.subagentRunId=n.string();continue}if((e&7)==4||e===0)break;n.skip(e&7)}return i},create(e){return Ow.fromPartial(e??{})},fromPartial(e){let t=Dw();return t.baseEvent=e.baseEvent!==void 0&&e.baseEvent!==null?Q.fromPartial(e.baseEvent):void 0,t.stepName=e.stepName??``,t.subagentRunId=e.subagentRunId??void 0,t}};function kw(){return{baseEvent:void 0,stepName:``,subagentRunId:void 0}}var Aw={encode(e,t=new Y){return e.baseEvent!==void 0&&Q.encode(e.baseEvent,t.uint32(10).fork()).join(),e.stepName!==``&&t.uint32(18).string(e.stepName),e.subagentRunId!==void 0&&t.uint32(26).string(e.subagentRunId),t},decode(e,t){let n=e instanceof X?e:new X(e),r=t===void 0?n.len:n.pos+t,i=kw();for(;n.pos>>3){case 1:if(e!==10)break;i.baseEvent=Q.decode(n,n.uint32());continue;case 2:if(e!==18)break;i.stepName=n.string();continue;case 3:if(e!==26)break;i.subagentRunId=n.string();continue}if((e&7)==4||e===0)break;n.skip(e&7)}return i},create(e){return Aw.fromPartial(e??{})},fromPartial(e){let t=kw();return t.baseEvent=e.baseEvent!==void 0&&e.baseEvent!==null?Q.fromPartial(e.baseEvent):void 0,t.stepName=e.stepName??``,t.subagentRunId=e.subagentRunId??void 0,t}};function jw(){return{baseEvent:void 0,subagentRunId:void 0,messageId:``}}var Mw={encode(e,t=new Y){return e.baseEvent!==void 0&&Q.encode(e.baseEvent,t.uint32(10).fork()).join(),e.subagentRunId!==void 0&&t.uint32(18).string(e.subagentRunId),e.messageId!==``&&t.uint32(26).string(e.messageId),t},decode(e,t){let n=e instanceof X?e:new X(e),r=t===void 0?n.len:n.pos+t,i=jw();for(;n.pos>>3){case 1:if(e!==10)break;i.baseEvent=Q.decode(n,n.uint32());continue;case 2:if(e!==18)break;i.subagentRunId=n.string();continue;case 3:if(e!==26)break;i.messageId=n.string();continue}if((e&7)==4||e===0)break;n.skip(e&7)}return i},create(e){return Mw.fromPartial(e??{})},fromPartial(e){let t=jw();return t.baseEvent=e.baseEvent!==void 0&&e.baseEvent!==null?Q.fromPartial(e.baseEvent):void 0,t.subagentRunId=e.subagentRunId??void 0,t.messageId=e.messageId??``,t}};function Nw(){return{baseEvent:void 0,subagentRunId:void 0,messageId:``,role:``}}var Pw={encode(e,t=new Y){return e.baseEvent!==void 0&&Q.encode(e.baseEvent,t.uint32(10).fork()).join(),e.subagentRunId!==void 0&&t.uint32(18).string(e.subagentRunId),e.messageId!==``&&t.uint32(26).string(e.messageId),e.role!==``&&t.uint32(34).string(e.role),t},decode(e,t){let n=e instanceof X?e:new X(e),r=t===void 0?n.len:n.pos+t,i=Nw();for(;n.pos>>3){case 1:if(e!==10)break;i.baseEvent=Q.decode(n,n.uint32());continue;case 2:if(e!==18)break;i.subagentRunId=n.string();continue;case 3:if(e!==26)break;i.messageId=n.string();continue;case 4:if(e!==34)break;i.role=n.string();continue}if((e&7)==4||e===0)break;n.skip(e&7)}return i},create(e){return Pw.fromPartial(e??{})},fromPartial(e){let t=Nw();return t.baseEvent=e.baseEvent!==void 0&&e.baseEvent!==null?Q.fromPartial(e.baseEvent):void 0,t.subagentRunId=e.subagentRunId??void 0,t.messageId=e.messageId??``,t.role=e.role??``,t}};function Fw(){return{baseEvent:void 0,subagentRunId:void 0,messageId:``,delta:``}}var Iw={encode(e,t=new Y){return e.baseEvent!==void 0&&Q.encode(e.baseEvent,t.uint32(10).fork()).join(),e.subagentRunId!==void 0&&t.uint32(18).string(e.subagentRunId),e.messageId!==``&&t.uint32(26).string(e.messageId),e.delta!==``&&t.uint32(34).string(e.delta),t},decode(e,t){let n=e instanceof X?e:new X(e),r=t===void 0?n.len:n.pos+t,i=Fw();for(;n.pos>>3){case 1:if(e!==10)break;i.baseEvent=Q.decode(n,n.uint32());continue;case 2:if(e!==18)break;i.subagentRunId=n.string();continue;case 3:if(e!==26)break;i.messageId=n.string();continue;case 4:if(e!==34)break;i.delta=n.string();continue}if((e&7)==4||e===0)break;n.skip(e&7)}return i},create(e){return Iw.fromPartial(e??{})},fromPartial(e){let t=Fw();return t.baseEvent=e.baseEvent!==void 0&&e.baseEvent!==null?Q.fromPartial(e.baseEvent):void 0,t.subagentRunId=e.subagentRunId??void 0,t.messageId=e.messageId??``,t.delta=e.delta??``,t}};function Lw(){return{baseEvent:void 0,subagentRunId:void 0,messageId:``}}var Rw={encode(e,t=new Y){return e.baseEvent!==void 0&&Q.encode(e.baseEvent,t.uint32(10).fork()).join(),e.subagentRunId!==void 0&&t.uint32(18).string(e.subagentRunId),e.messageId!==``&&t.uint32(26).string(e.messageId),t},decode(e,t){let n=e instanceof X?e:new X(e),r=t===void 0?n.len:n.pos+t,i=Lw();for(;n.pos>>3){case 1:if(e!==10)break;i.baseEvent=Q.decode(n,n.uint32());continue;case 2:if(e!==18)break;i.subagentRunId=n.string();continue;case 3:if(e!==26)break;i.messageId=n.string();continue}if((e&7)==4||e===0)break;n.skip(e&7)}return i},create(e){return Rw.fromPartial(e??{})},fromPartial(e){let t=Lw();return t.baseEvent=e.baseEvent!==void 0&&e.baseEvent!==null?Q.fromPartial(e.baseEvent):void 0,t.subagentRunId=e.subagentRunId??void 0,t.messageId=e.messageId??``,t}};function zw(){return{baseEvent:void 0,subagentRunId:void 0,messageId:void 0,delta:void 0}}var Bw={encode(e,t=new Y){return e.baseEvent!==void 0&&Q.encode(e.baseEvent,t.uint32(10).fork()).join(),e.subagentRunId!==void 0&&t.uint32(18).string(e.subagentRunId),e.messageId!==void 0&&t.uint32(26).string(e.messageId),e.delta!==void 0&&t.uint32(34).string(e.delta),t},decode(e,t){let n=e instanceof X?e:new X(e),r=t===void 0?n.len:n.pos+t,i=zw();for(;n.pos>>3){case 1:if(e!==10)break;i.baseEvent=Q.decode(n,n.uint32());continue;case 2:if(e!==18)break;i.subagentRunId=n.string();continue;case 3:if(e!==26)break;i.messageId=n.string();continue;case 4:if(e!==34)break;i.delta=n.string();continue}if((e&7)==4||e===0)break;n.skip(e&7)}return i},create(e){return Bw.fromPartial(e??{})},fromPartial(e){let t=zw();return t.baseEvent=e.baseEvent!==void 0&&e.baseEvent!==null?Q.fromPartial(e.baseEvent):void 0,t.subagentRunId=e.subagentRunId??void 0,t.messageId=e.messageId??void 0,t.delta=e.delta??void 0,t}};function Vw(){return{baseEvent:void 0,subagentRunId:void 0,messageId:``}}var Hw={encode(e,t=new Y){return e.baseEvent!==void 0&&Q.encode(e.baseEvent,t.uint32(10).fork()).join(),e.subagentRunId!==void 0&&t.uint32(18).string(e.subagentRunId),e.messageId!==``&&t.uint32(26).string(e.messageId),t},decode(e,t){let n=e instanceof X?e:new X(e),r=t===void 0?n.len:n.pos+t,i=Vw();for(;n.pos>>3){case 1:if(e!==10)break;i.baseEvent=Q.decode(n,n.uint32());continue;case 2:if(e!==18)break;i.subagentRunId=n.string();continue;case 3:if(e!==26)break;i.messageId=n.string();continue}if((e&7)==4||e===0)break;n.skip(e&7)}return i},create(e){return Hw.fromPartial(e??{})},fromPartial(e){let t=Vw();return t.baseEvent=e.baseEvent!==void 0&&e.baseEvent!==null?Q.fromPartial(e.baseEvent):void 0,t.subagentRunId=e.subagentRunId??void 0,t.messageId=e.messageId??``,t}};function Uw(){return{baseEvent:void 0,subagentRunId:void 0,subtype:``,entityId:``,encryptedValue:``}}var Ww={encode(e,t=new Y){return e.baseEvent!==void 0&&Q.encode(e.baseEvent,t.uint32(10).fork()).join(),e.subagentRunId!==void 0&&t.uint32(18).string(e.subagentRunId),e.subtype!==``&&t.uint32(26).string(e.subtype),e.entityId!==``&&t.uint32(34).string(e.entityId),e.encryptedValue!==``&&t.uint32(42).string(e.encryptedValue),t},decode(e,t){let n=e instanceof X?e:new X(e),r=t===void 0?n.len:n.pos+t,i=Uw();for(;n.pos>>3){case 1:if(e!==10)break;i.baseEvent=Q.decode(n,n.uint32());continue;case 2:if(e!==18)break;i.subagentRunId=n.string();continue;case 3:if(e!==26)break;i.subtype=n.string();continue;case 4:if(e!==34)break;i.entityId=n.string();continue;case 5:if(e!==42)break;i.encryptedValue=n.string();continue}if((e&7)==4||e===0)break;n.skip(e&7)}return i},create(e){return Ww.fromPartial(e??{})},fromPartial(e){let t=Uw();return t.baseEvent=e.baseEvent!==void 0&&e.baseEvent!==null?Q.fromPartial(e.baseEvent):void 0,t.subagentRunId=e.subagentRunId??void 0,t.subtype=e.subtype??``,t.entityId=e.entityId??``,t.encryptedValue=e.encryptedValue??``,t}};function Gw(){return{baseEvent:void 0,subagentRunId:``,name:``,description:void 0,parentSubagentRunId:void 0,parentToolCallId:void 0,parentMessageId:void 0}}var Kw={encode(e,t=new Y){return e.baseEvent!==void 0&&Q.encode(e.baseEvent,t.uint32(10).fork()).join(),e.subagentRunId!==``&&t.uint32(18).string(e.subagentRunId),e.name!==``&&t.uint32(26).string(e.name),e.description!==void 0&&t.uint32(34).string(e.description),e.parentSubagentRunId!==void 0&&t.uint32(42).string(e.parentSubagentRunId),e.parentToolCallId!==void 0&&t.uint32(50).string(e.parentToolCallId),e.parentMessageId!==void 0&&t.uint32(58).string(e.parentMessageId),t},decode(e,t){let n=e instanceof X?e:new X(e),r=t===void 0?n.len:n.pos+t,i=Gw();for(;n.pos>>3){case 1:if(e!==10)break;i.baseEvent=Q.decode(n,n.uint32());continue;case 2:if(e!==18)break;i.subagentRunId=n.string();continue;case 3:if(e!==26)break;i.name=n.string();continue;case 4:if(e!==34)break;i.description=n.string();continue;case 5:if(e!==42)break;i.parentSubagentRunId=n.string();continue;case 6:if(e!==50)break;i.parentToolCallId=n.string();continue;case 7:if(e!==58)break;i.parentMessageId=n.string();continue}if((e&7)==4||e===0)break;n.skip(e&7)}return i},create(e){return Kw.fromPartial(e??{})},fromPartial(e){let t=Gw();return t.baseEvent=e.baseEvent!==void 0&&e.baseEvent!==null?Q.fromPartial(e.baseEvent):void 0,t.subagentRunId=e.subagentRunId??``,t.name=e.name??``,t.description=e.description??void 0,t.parentSubagentRunId=e.parentSubagentRunId??void 0,t.parentToolCallId=e.parentToolCallId??void 0,t.parentMessageId=e.parentMessageId??void 0,t}};function qw(){return{baseEvent:void 0,subagentRunId:``,result:void 0,outcome:``,interruptIds:[]}}var Jw={encode(e,t=new Y){e.baseEvent!==void 0&&Q.encode(e.baseEvent,t.uint32(10).fork()).join(),e.subagentRunId!==``&&t.uint32(18).string(e.subagentRunId),e.result!==void 0&&Z.encode(Z.wrap(e.result),t.uint32(26).fork()).join(),e.outcome!==``&&t.uint32(34).string(e.outcome);for(let n of e.interruptIds)t.uint32(42).string(n);return t},decode(e,t){let n=e instanceof X?e:new X(e),r=t===void 0?n.len:n.pos+t,i=qw();for(;n.pos>>3){case 1:if(e!==10)break;i.baseEvent=Q.decode(n,n.uint32());continue;case 2:if(e!==18)break;i.subagentRunId=n.string();continue;case 3:if(e!==26)break;i.result=Z.unwrap(Z.decode(n,n.uint32()));continue;case 4:if(e!==34)break;i.outcome=n.string();continue;case 5:if(e!==42)break;i.interruptIds.push(n.string());continue}if((e&7)==4||e===0)break;n.skip(e&7)}return i},create(e){return Jw.fromPartial(e??{})},fromPartial(e){let t=qw();return t.baseEvent=e.baseEvent!==void 0&&e.baseEvent!==null?Q.fromPartial(e.baseEvent):void 0,t.subagentRunId=e.subagentRunId??``,t.result=e.result??void 0,t.outcome=e.outcome??``,t.interruptIds=e.interruptIds?.map(e=>e)||[],t}};function Yw(){return{baseEvent:void 0,subagentRunId:``,message:``,code:void 0}}var Xw={encode(e,t=new Y){return e.baseEvent!==void 0&&Q.encode(e.baseEvent,t.uint32(10).fork()).join(),e.subagentRunId!==``&&t.uint32(18).string(e.subagentRunId),e.message!==``&&t.uint32(26).string(e.message),e.code!==void 0&&t.uint32(34).string(e.code),t},decode(e,t){let n=e instanceof X?e:new X(e),r=t===void 0?n.len:n.pos+t,i=Yw();for(;n.pos>>3){case 1:if(e!==10)break;i.baseEvent=Q.decode(n,n.uint32());continue;case 2:if(e!==18)break;i.subagentRunId=n.string();continue;case 3:if(e!==26)break;i.message=n.string();continue;case 4:if(e!==34)break;i.code=n.string();continue}if((e&7)==4||e===0)break;n.skip(e&7)}return i},create(e){return Xw.fromPartial(e??{})},fromPartial(e){let t=Yw();return t.baseEvent=e.baseEvent!==void 0&&e.baseEvent!==null?Q.fromPartial(e.baseEvent):void 0,t.subagentRunId=e.subagentRunId??``,t.message=e.message??``,t.code=e.code??void 0,t}};function Zw(){return{textMessageStart:void 0,textMessageContent:void 0,textMessageEnd:void 0,toolCallStart:void 0,toolCallArgs:void 0,toolCallEnd:void 0,stateSnapshot:void 0,stateDelta:void 0,messagesSnapshot:void 0,raw:void 0,custom:void 0,runStarted:void 0,runFinished:void 0,runError:void 0,stepStarted:void 0,stepFinished:void 0,textMessageChunk:void 0,toolCallChunk:void 0,subagentStarted:void 0,subagentFinished:void 0,subagentError:void 0,toolCallResult:void 0,activitySnapshot:void 0,activityDelta:void 0,reasoningStart:void 0,reasoningMessageStart:void 0,reasoningMessageContent:void 0,reasoningMessageEnd:void 0,reasoningMessageChunk:void 0,reasoningEnd:void 0,reasoningEncryptedValue:void 0}}var Qw={encode(e,t=new Y){return e.textMessageStart!==void 0&&WC.encode(e.textMessageStart,t.uint32(10).fork()).join(),e.textMessageContent!==void 0&&KC.encode(e.textMessageContent,t.uint32(18).fork()).join(),e.textMessageEnd!==void 0&&JC.encode(e.textMessageEnd,t.uint32(26).fork()).join(),e.toolCallStart!==void 0&&QC.encode(e.toolCallStart,t.uint32(34).fork()).join(),e.toolCallArgs!==void 0&&ew.encode(e.toolCallArgs,t.uint32(42).fork()).join(),e.toolCallEnd!==void 0&&nw.encode(e.toolCallEnd,t.uint32(50).fork()).join(),e.stateSnapshot!==void 0&&cw.encode(e.stateSnapshot,t.uint32(58).fork()).join(),e.stateDelta!==void 0&&uw.encode(e.stateDelta,t.uint32(66).fork()).join(),e.messagesSnapshot!==void 0&&fw.encode(e.messagesSnapshot,t.uint32(74).fork()).join(),e.raw!==void 0&&vw.encode(e.raw,t.uint32(82).fork()).join(),e.custom!==void 0&&bw.encode(e.custom,t.uint32(90).fork()).join(),e.runStarted!==void 0&&Sw.encode(e.runStarted,t.uint32(98).fork()).join(),e.runFinished!==void 0&&ww.encode(e.runFinished,t.uint32(106).fork()).join(),e.runError!==void 0&&Ew.encode(e.runError,t.uint32(114).fork()).join(),e.stepStarted!==void 0&&Ow.encode(e.stepStarted,t.uint32(122).fork()).join(),e.stepFinished!==void 0&&Aw.encode(e.stepFinished,t.uint32(130).fork()).join(),e.textMessageChunk!==void 0&&XC.encode(e.textMessageChunk,t.uint32(138).fork()).join(),e.toolCallChunk!==void 0&&iw.encode(e.toolCallChunk,t.uint32(146).fork()).join(),e.subagentStarted!==void 0&&Kw.encode(e.subagentStarted,t.uint32(154).fork()).join(),e.subagentFinished!==void 0&&Jw.encode(e.subagentFinished,t.uint32(162).fork()).join(),e.subagentError!==void 0&&Xw.encode(e.subagentError,t.uint32(170).fork()).join(),e.toolCallResult!==void 0&&ow.encode(e.toolCallResult,t.uint32(178).fork()).join(),e.activitySnapshot!==void 0&&mw.encode(e.activitySnapshot,t.uint32(186).fork()).join(),e.activityDelta!==void 0&&gw.encode(e.activityDelta,t.uint32(194).fork()).join(),e.reasoningStart!==void 0&&Mw.encode(e.reasoningStart,t.uint32(202).fork()).join(),e.reasoningMessageStart!==void 0&&Pw.encode(e.reasoningMessageStart,t.uint32(210).fork()).join(),e.reasoningMessageContent!==void 0&&Iw.encode(e.reasoningMessageContent,t.uint32(218).fork()).join(),e.reasoningMessageEnd!==void 0&&Rw.encode(e.reasoningMessageEnd,t.uint32(226).fork()).join(),e.reasoningMessageChunk!==void 0&&Bw.encode(e.reasoningMessageChunk,t.uint32(234).fork()).join(),e.reasoningEnd!==void 0&&Hw.encode(e.reasoningEnd,t.uint32(242).fork()).join(),e.reasoningEncryptedValue!==void 0&&Ww.encode(e.reasoningEncryptedValue,t.uint32(250).fork()).join(),t},decode(e,t){let n=e instanceof X?e:new X(e),r=t===void 0?n.len:n.pos+t,i=Zw();for(;n.pos>>3){case 1:if(e!==10)break;i.textMessageStart=WC.decode(n,n.uint32());continue;case 2:if(e!==18)break;i.textMessageContent=KC.decode(n,n.uint32());continue;case 3:if(e!==26)break;i.textMessageEnd=JC.decode(n,n.uint32());continue;case 4:if(e!==34)break;i.toolCallStart=QC.decode(n,n.uint32());continue;case 5:if(e!==42)break;i.toolCallArgs=ew.decode(n,n.uint32());continue;case 6:if(e!==50)break;i.toolCallEnd=nw.decode(n,n.uint32());continue;case 7:if(e!==58)break;i.stateSnapshot=cw.decode(n,n.uint32());continue;case 8:if(e!==66)break;i.stateDelta=uw.decode(n,n.uint32());continue;case 9:if(e!==74)break;i.messagesSnapshot=fw.decode(n,n.uint32());continue;case 10:if(e!==82)break;i.raw=vw.decode(n,n.uint32());continue;case 11:if(e!==90)break;i.custom=bw.decode(n,n.uint32());continue;case 12:if(e!==98)break;i.runStarted=Sw.decode(n,n.uint32());continue;case 13:if(e!==106)break;i.runFinished=ww.decode(n,n.uint32());continue;case 14:if(e!==114)break;i.runError=Ew.decode(n,n.uint32());continue;case 15:if(e!==122)break;i.stepStarted=Ow.decode(n,n.uint32());continue;case 16:if(e!==130)break;i.stepFinished=Aw.decode(n,n.uint32());continue;case 17:if(e!==138)break;i.textMessageChunk=XC.decode(n,n.uint32());continue;case 18:if(e!==146)break;i.toolCallChunk=iw.decode(n,n.uint32());continue;case 19:if(e!==154)break;i.subagentStarted=Kw.decode(n,n.uint32());continue;case 20:if(e!==162)break;i.subagentFinished=Jw.decode(n,n.uint32());continue;case 21:if(e!==170)break;i.subagentError=Xw.decode(n,n.uint32());continue;case 22:if(e!==178)break;i.toolCallResult=ow.decode(n,n.uint32());continue;case 23:if(e!==186)break;i.activitySnapshot=mw.decode(n,n.uint32());continue;case 24:if(e!==194)break;i.activityDelta=gw.decode(n,n.uint32());continue;case 25:if(e!==202)break;i.reasoningStart=Mw.decode(n,n.uint32());continue;case 26:if(e!==210)break;i.reasoningMessageStart=Pw.decode(n,n.uint32());continue;case 27:if(e!==218)break;i.reasoningMessageContent=Iw.decode(n,n.uint32());continue;case 28:if(e!==226)break;i.reasoningMessageEnd=Rw.decode(n,n.uint32());continue;case 29:if(e!==234)break;i.reasoningMessageChunk=Bw.decode(n,n.uint32());continue;case 30:if(e!==242)break;i.reasoningEnd=Hw.decode(n,n.uint32());continue;case 31:if(e!==250)break;i.reasoningEncryptedValue=Ww.decode(n,n.uint32());continue}if((e&7)==4||e===0)break;n.skip(e&7)}return i},create(e){return Qw.fromPartial(e??{})},fromPartial(e){let t=Zw();return t.textMessageStart=e.textMessageStart!==void 0&&e.textMessageStart!==null?WC.fromPartial(e.textMessageStart):void 0,t.textMessageContent=e.textMessageContent!==void 0&&e.textMessageContent!==null?KC.fromPartial(e.textMessageContent):void 0,t.textMessageEnd=e.textMessageEnd!==void 0&&e.textMessageEnd!==null?JC.fromPartial(e.textMessageEnd):void 0,t.toolCallStart=e.toolCallStart!==void 0&&e.toolCallStart!==null?QC.fromPartial(e.toolCallStart):void 0,t.toolCallArgs=e.toolCallArgs!==void 0&&e.toolCallArgs!==null?ew.fromPartial(e.toolCallArgs):void 0,t.toolCallEnd=e.toolCallEnd!==void 0&&e.toolCallEnd!==null?nw.fromPartial(e.toolCallEnd):void 0,t.stateSnapshot=e.stateSnapshot!==void 0&&e.stateSnapshot!==null?cw.fromPartial(e.stateSnapshot):void 0,t.stateDelta=e.stateDelta!==void 0&&e.stateDelta!==null?uw.fromPartial(e.stateDelta):void 0,t.messagesSnapshot=e.messagesSnapshot!==void 0&&e.messagesSnapshot!==null?fw.fromPartial(e.messagesSnapshot):void 0,t.raw=e.raw!==void 0&&e.raw!==null?vw.fromPartial(e.raw):void 0,t.custom=e.custom!==void 0&&e.custom!==null?bw.fromPartial(e.custom):void 0,t.runStarted=e.runStarted!==void 0&&e.runStarted!==null?Sw.fromPartial(e.runStarted):void 0,t.runFinished=e.runFinished!==void 0&&e.runFinished!==null?ww.fromPartial(e.runFinished):void 0,t.runError=e.runError!==void 0&&e.runError!==null?Ew.fromPartial(e.runError):void 0,t.stepStarted=e.stepStarted!==void 0&&e.stepStarted!==null?Ow.fromPartial(e.stepStarted):void 0,t.stepFinished=e.stepFinished!==void 0&&e.stepFinished!==null?Aw.fromPartial(e.stepFinished):void 0,t.textMessageChunk=e.textMessageChunk!==void 0&&e.textMessageChunk!==null?XC.fromPartial(e.textMessageChunk):void 0,t.toolCallChunk=e.toolCallChunk!==void 0&&e.toolCallChunk!==null?iw.fromPartial(e.toolCallChunk):void 0,t.subagentStarted=e.subagentStarted!==void 0&&e.subagentStarted!==null?Kw.fromPartial(e.subagentStarted):void 0,t.subagentFinished=e.subagentFinished!==void 0&&e.subagentFinished!==null?Jw.fromPartial(e.subagentFinished):void 0,t.subagentError=e.subagentError!==void 0&&e.subagentError!==null?Xw.fromPartial(e.subagentError):void 0,t.toolCallResult=e.toolCallResult!==void 0&&e.toolCallResult!==null?ow.fromPartial(e.toolCallResult):void 0,t.activitySnapshot=e.activitySnapshot!==void 0&&e.activitySnapshot!==null?mw.fromPartial(e.activitySnapshot):void 0,t.activityDelta=e.activityDelta!==void 0&&e.activityDelta!==null?gw.fromPartial(e.activityDelta):void 0,t.reasoningStart=e.reasoningStart!==void 0&&e.reasoningStart!==null?Mw.fromPartial(e.reasoningStart):void 0,t.reasoningMessageStart=e.reasoningMessageStart!==void 0&&e.reasoningMessageStart!==null?Pw.fromPartial(e.reasoningMessageStart):void 0,t.reasoningMessageContent=e.reasoningMessageContent!==void 0&&e.reasoningMessageContent!==null?Iw.fromPartial(e.reasoningMessageContent):void 0,t.reasoningMessageEnd=e.reasoningMessageEnd!==void 0&&e.reasoningMessageEnd!==null?Rw.fromPartial(e.reasoningMessageEnd):void 0,t.reasoningMessageChunk=e.reasoningMessageChunk!==void 0&&e.reasoningMessageChunk!==null?Bw.fromPartial(e.reasoningMessageChunk):void 0,t.reasoningEnd=e.reasoningEnd!==void 0&&e.reasoningEnd!==null?Hw.fromPartial(e.reasoningEnd):void 0,t.reasoningEncryptedValue=e.reasoningEncryptedValue!==void 0&&e.reasoningEncryptedValue!==null?Ww.fromPartial(e.reasoningEncryptedValue):void 0,t}};function $w(){return{provider:void 0,model:void 0,inputTokens:void 0,outputTokens:void 0,totalTokens:void 0,reasoningTokens:void 0,cachedInputTokens:void 0,cacheWriteInputTokens:void 0}}var eT={encode(e,t=new Y){return e.provider!==void 0&&t.uint32(10).string(e.provider),e.model!==void 0&&t.uint32(18).string(e.model),e.inputTokens!==void 0&&t.uint32(24).int64(e.inputTokens),e.outputTokens!==void 0&&t.uint32(32).int64(e.outputTokens),e.totalTokens!==void 0&&t.uint32(40).int64(e.totalTokens),e.reasoningTokens!==void 0&&t.uint32(48).int64(e.reasoningTokens),e.cachedInputTokens!==void 0&&t.uint32(56).int64(e.cachedInputTokens),e.cacheWriteInputTokens!==void 0&&t.uint32(64).int64(e.cacheWriteInputTokens),t},decode(e,t){let n=e instanceof X?e:new X(e),r=t===void 0?n.len:n.pos+t,i=$w();for(;n.pos>>3){case 1:if(e!==10)break;i.provider=n.string();continue;case 2:if(e!==18)break;i.model=n.string();continue;case 3:if(e!==24)break;i.inputTokens=tT(n.int64());continue;case 4:if(e!==32)break;i.outputTokens=tT(n.int64());continue;case 5:if(e!==40)break;i.totalTokens=tT(n.int64());continue;case 6:if(e!==48)break;i.reasoningTokens=tT(n.int64());continue;case 7:if(e!==56)break;i.cachedInputTokens=tT(n.int64());continue;case 8:if(e!==64)break;i.cacheWriteInputTokens=tT(n.int64());continue}if((e&7)==4||e===0)break;n.skip(e&7)}return i},create(e){return eT.fromPartial(e??{})},fromPartial(e){let t=$w();return t.provider=e.provider??void 0,t.model=e.model??void 0,t.inputTokens=e.inputTokens??void 0,t.outputTokens=e.outputTokens??void 0,t.totalTokens=e.totalTokens??void 0,t.reasoningTokens=e.reasoningTokens??void 0,t.cachedInputTokens=e.cachedInputTokens??void 0,t.cacheWriteInputTokens=e.cacheWriteInputTokens??void 0,t}};function tT(e){let t=globalThis.Number(e.toString());if(t>globalThis.Number.MAX_SAFE_INTEGER)throw new globalThis.Error(`Value is larger than Number.MAX_SAFE_INTEGER`);if(te&&typeof e==`object`?e:void 0,rT=e=>Array.isArray(e)?e:[],iT=()=>typeof process<`u`&&!!{}.SUPPRESS_TRANSFORMATION_WARNINGS,aT=()=>{iT()||console.warn(`[ag-ui][proto] Dropped a content part this build does not know: the protocol has a variant this SDK predates.`)};new Set(Object.values(L));var oT={textMessageStart:`TEXT_MESSAGE_START`,textMessageContent:`TEXT_MESSAGE_CONTENT`,textMessageEnd:`TEXT_MESSAGE_END`,textMessageChunk:`TEXT_MESSAGE_CHUNK`,toolCallStart:`TOOL_CALL_START`,toolCallArgs:`TOOL_CALL_ARGS`,toolCallEnd:`TOOL_CALL_END`,toolCallChunk:`TOOL_CALL_CHUNK`,toolCallResult:`TOOL_CALL_RESULT`,stateSnapshot:`STATE_SNAPSHOT`,stateDelta:`STATE_DELTA`,messagesSnapshot:`MESSAGES_SNAPSHOT`,activitySnapshot:`ACTIVITY_SNAPSHOT`,activityDelta:`ACTIVITY_DELTA`,raw:`RAW`,custom:`CUSTOM`,runStarted:`RUN_STARTED`,runFinished:`RUN_FINISHED`,runError:`RUN_ERROR`,stepStarted:`STEP_STARTED`,stepFinished:`STEP_FINISHED`,reasoningStart:`REASONING_START`,reasoningMessageStart:`REASONING_MESSAGE_START`,reasoningMessageContent:`REASONING_MESSAGE_CONTENT`,reasoningMessageEnd:`REASONING_MESSAGE_END`,reasoningMessageChunk:`REASONING_MESSAGE_CHUNK`,reasoningEnd:`REASONING_END`,reasoningEncryptedValue:`REASONING_ENCRYPTED_VALUE`,subagentStarted:`SUBAGENT_STARTED`,subagentFinished:`SUBAGENT_FINISHED`,subagentError:`SUBAGENT_ERROR`},sT=new Set([1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31]),cT=e=>{let t=nT(e);if(t){if([t.data,t.url,t.file].filter(Boolean).length>1)throw Error(`Invalid event: source carries more than one arm`);if(t.data){let e=t.data;return{type:`data`,value:e.value,mimeType:e.mimeType}}if(t.url){let e=t.url;return{type:`url`,value:e.value,mimeType:e.mimeType}}if(t.file){let e=t.file;return{type:`file`,value:e.value,provider:e.provider,mimeType:e.mimeType}}}},lT=e=>{let t=nT(e);if(t){if([t.text,t.image,t.audio,t.video,t.document].filter(Boolean).length>1)throw Error(`Invalid event: content part carries more than one arm`);if(t.text){let e=t.text;return{type:`text`,id:e.id,text:e.text,metadata:e.metadata}}if(t.image){let e=t.image;return e.source!==void 0&&cT(e.source)===void 0?void 0:{type:`image`,id:e.id,source:cT(e.source),metadata:e.metadata}}if(t.audio){let e=t.audio;return e.source!==void 0&&cT(e.source)===void 0?void 0:{type:`audio`,id:e.id,source:cT(e.source),metadata:e.metadata}}if(t.video){let e=t.video;return e.source!==void 0&&cT(e.source)===void 0?void 0:{type:`video`,id:e.id,source:cT(e.source),metadata:e.metadata}}if(t.document){let e=t.document;return e.source!==void 0&&cT(e.source)===void 0?void 0:{type:`document`,id:e.id,source:cT(e.source),metadata:e.metadata}}}},uT=new Set([`activity`]),dT=new Set([`user`,`tool`]),fT=new Set([`developer`,`system`,`assistant`,`user`,`tool`,`activity`,`reasoning`]),pT=e=>{let t=nT(e)??{},n={...t},r=typeof t.role==`string`?t.role:``,i=fT.has(r),a=i?dT.has(r):rT(t.contentParts).length>0,o=i?uT.has(r):!a&&t.activityContent!==void 0;if(!i&&(t.content===void 0?0:1)+ +(rT(t.contentParts).length>0)+(t.activityContent===void 0?0:1)>1)throw Error(`Invalid event: message carries more than one content form`);if(i){if(!a&&rT(t.contentParts).length>0)throw Error(`Invalid event: message carries content parts for a role that has none`);if(t.activityContent!==void 0&&!o)throw Error(`Invalid event: message carries activity content for a non-activity role`);if(o&&t.content!==void 0)throw Error(`Invalid event: activity content cannot ride with other content forms`);if(a&&t.content!==void 0&&rT(t.contentParts).length>0)throw Error(`Invalid event: message carries both string content and content parts`)}return a&&t.content===void 0&&(n.content=rT(t.contentParts).map(e=>{let t=lT(e);return t===void 0&&aT(),t}).filter(e=>e!==void 0)),o&&t.activityContent!==void 0&&(n.content=t.activityContent),delete n.activityContent,delete n.contentParts,rT(t.toolCalls).length===0&&delete n.toolCalls,Object.keys(n).forEach(e=>{n[e]===void 0&&delete n[e]}),n},mT=e=>{if(Array.isArray(e)){for(let t of e)mT(t);return}let t=nT(e);if(t)for(let e of Object.keys(t))t[e]===void 0?delete t[e]:mT(t[e])},hT=e=>{let t=nT(e);if(!t)return;let n={};return t.threadId!==void 0&&(n.threadId=t.threadId),t.runId!==void 0&&(n.runId=t.runId),t.protocolVersion!==void 0&&(n.protocolVersion=t.protocolVersion),t.parentRunId!==void 0&&(n.parentRunId=t.parentRunId),t.state!==void 0&&(n.state=t.state),n.messages=rT(t.messages).map(pT).filter(e=>e!==void 0),n.tools=rT(t.tools),n.context=rT(t.context),t.forwardedProps!==void 0&&(n.forwardedProps=t.forwardedProps),n.resume=rT(t.resume),n},gT={TextMessageStartEvent:{singular:new Set([1]),descend:{1:`BaseEvent`}},BaseEvent:{singular:new Set([3,4]),descend:{},google:{3:`google.protobuf.Value`,4:`google.protobuf.Struct`}},TextMessageContentEvent:{singular:new Set([1]),descend:{1:`BaseEvent`}},TextMessageEndEvent:{singular:new Set([1]),descend:{1:`BaseEvent`}},ToolCallStartEvent:{singular:new Set([1]),descend:{1:`BaseEvent`}},ToolCallArgsEvent:{singular:new Set([1]),descend:{1:`BaseEvent`}},ToolCallEndEvent:{singular:new Set([1]),descend:{1:`BaseEvent`}},StateSnapshotEvent:{singular:new Set([1,2]),descend:{1:`BaseEvent`},google:{2:`google.protobuf.Value`}},StateDeltaEvent:{singular:new Set([1]),descend:{1:`BaseEvent`,2:`JsonPatchOperation`}},JsonPatchOperation:{singular:new Set([4]),descend:{},google:{4:`google.protobuf.Value`}},MessagesSnapshotEvent:{singular:new Set([1]),descend:{1:`BaseEvent`,2:`Message`}},Message:{singular:new Set([9,13]),descend:{5:`ToolCall`,8:`InputContent`},google:{9:`google.protobuf.Struct`,13:`google.protobuf.Struct`}},ToolCall:{singular:new Set([3,4]),descend:{},google:{4:`google.protobuf.Struct`}},InputContent:{singular:new Set([1,2,3,4,5]),descend:{1:`TextInputPart`,2:`ImageInputPart`,3:`AudioInputPart`,4:`VideoInputPart`,5:`DocumentInputPart`},arms:new Set([1,2,3,4,5])},TextInputPart:{singular:new Set([3]),descend:{},google:{3:`google.protobuf.Value`}},ImageInputPart:{singular:new Set([1,2]),descend:{1:`InputContentSource`},google:{2:`google.protobuf.Value`}},InputContentSource:{singular:new Set([1,2,3]),descend:{},arms:new Set([1,2,3])},AudioInputPart:{singular:new Set([1,2]),descend:{1:`InputContentSource`},google:{2:`google.protobuf.Value`}},VideoInputPart:{singular:new Set([1,2]),descend:{1:`InputContentSource`},google:{2:`google.protobuf.Value`}},DocumentInputPart:{singular:new Set([1,2]),descend:{1:`InputContentSource`},google:{2:`google.protobuf.Value`}},RawEvent:{singular:new Set([1,2]),descend:{1:`BaseEvent`},google:{2:`google.protobuf.Value`}},CustomEvent:{singular:new Set([1,3]),descend:{1:`BaseEvent`},google:{3:`google.protobuf.Value`}},RunStartedEvent:{singular:new Set([1,5]),descend:{1:`BaseEvent`,5:`RunAgentInput`}},RunAgentInput:{singular:new Set([4,8]),descend:{5:`Message`,6:`Tool`,9:`ResumeEntry`},google:{4:`google.protobuf.Value`,8:`google.protobuf.Value`}},Tool:{singular:new Set([3,4]),descend:{},google:{3:`google.protobuf.Value`,4:`google.protobuf.Struct`}},ResumeEntry:{singular:new Set([3,4]),descend:{},google:{3:`google.protobuf.Value`,4:`google.protobuf.Struct`}},RunFinishedEvent:{singular:new Set([1,4]),descend:{1:`BaseEvent`,6:`Interrupt`},google:{4:`google.protobuf.Value`}},Interrupt:{singular:new Set([5,7]),descend:{},google:{5:`google.protobuf.Value`,7:`google.protobuf.Value`}},RunErrorEvent:{singular:new Set([1]),descend:{1:`BaseEvent`}},StepStartedEvent:{singular:new Set([1]),descend:{1:`BaseEvent`}},StepFinishedEvent:{singular:new Set([1]),descend:{1:`BaseEvent`}},TextMessageChunkEvent:{singular:new Set([1]),descend:{1:`BaseEvent`}},ToolCallChunkEvent:{singular:new Set([1]),descend:{1:`BaseEvent`}},SubagentStartedEvent:{singular:new Set([1]),descend:{1:`BaseEvent`}},SubagentFinishedEvent:{singular:new Set([1,3]),descend:{1:`BaseEvent`},google:{3:`google.protobuf.Value`}},SubagentErrorEvent:{singular:new Set([1]),descend:{1:`BaseEvent`}},ToolCallResultEvent:{singular:new Set([1]),descend:{1:`BaseEvent`,7:`InputContent`}},ActivitySnapshotEvent:{singular:new Set([1,5]),descend:{1:`BaseEvent`},google:{5:`google.protobuf.Struct`}},ActivityDeltaEvent:{singular:new Set([1]),descend:{1:`BaseEvent`,5:`JsonPatchOperation`}},ReasoningStartEvent:{singular:new Set([1]),descend:{1:`BaseEvent`}},ReasoningMessageStartEvent:{singular:new Set([1]),descend:{1:`BaseEvent`}},ReasoningMessageContentEvent:{singular:new Set([1]),descend:{1:`BaseEvent`}},ReasoningMessageEndEvent:{singular:new Set([1]),descend:{1:`BaseEvent`}},ReasoningMessageChunkEvent:{singular:new Set([1]),descend:{1:`BaseEvent`}},ReasoningEndEvent:{singular:new Set([1]),descend:{1:`BaseEvent`}},ReasoningEncryptedValueEvent:{singular:new Set([1]),descend:{1:`BaseEvent`}},"google.protobuf.Struct":{singular:new Set,descend:{1:`google.protobuf.Struct.FieldsEntry`}},"google.protobuf.Struct.FieldsEntry":{singular:new Set([2]),descend:{2:`google.protobuf.Value`}},"google.protobuf.Value":{singular:new Set([5,6]),descend:{5:`google.protobuf.Struct`,6:`google.protobuf.ListValue`},arms:new Set([1,2,3,4,5,6]),armWireTypes:{1:0,2:1,3:2,4:0,5:2,6:2}},"google.protobuf.ListValue":{singular:new Set,descend:{1:`google.protobuf.Value`}}},_T={1:`TextMessageStartEvent`,2:`TextMessageContentEvent`,3:`TextMessageEndEvent`,4:`ToolCallStartEvent`,5:`ToolCallArgsEvent`,6:`ToolCallEndEvent`,7:`StateSnapshotEvent`,8:`StateDeltaEvent`,9:`MessagesSnapshotEvent`,10:`RawEvent`,11:`CustomEvent`,12:`RunStartedEvent`,13:`RunFinishedEvent`,14:`RunErrorEvent`,15:`StepStartedEvent`,16:`StepFinishedEvent`,17:`TextMessageChunkEvent`,18:`ToolCallChunkEvent`,19:`SubagentStartedEvent`,20:`SubagentFinishedEvent`,21:`SubagentErrorEvent`,22:`ToolCallResultEvent`,23:`ActivitySnapshotEvent`,24:`ActivityDeltaEvent`,25:`ReasoningStartEvent`,26:`ReasoningMessageStartEvent`,27:`ReasoningMessageContentEvent`,28:`ReasoningMessageEndEvent`,29:`ReasoningMessageChunkEvent`,30:`ReasoningEndEvent`,31:`ReasoningEncryptedValueEvent`};function vT(e,t){let n=0,r=0;for(;;){if(t.offset>=e.length)throw Error(`Invalid event`);let i=e[t.offset++];if(r<28?n+=(i&127)*2**r:r===28&&(n+=(i&15)*2**28),r+=7,!(i&128))return n}}function yT(e,t){let n={offset:0},r=0,i=0;for(;n.offsete.length)throw Error(`Invalid event`);if(r===0){if(t.arms?.has(o)){if(i!==0&&i!==o)throw Error(`Invalid event`);i=o}let r=t.descend[o];if(r!==void 0){let t=gT[r];t!==void 0&&yT(e.subarray(n.offset,n.offset+a),t)}}n.offset+=a}else if(s===5)n.offset+=4;else throw Error(`Invalid event`);if(n.offset>e.length)throw Error(`Invalid event`)}if(r!==0)throw Error(`Invalid event`)}function bT(e){let t=new Set,n={offset:0},r=0;for(;n.offset0&&!t.has(a))throw Error(`Invalid event`);t.add(a)}if(o===0)vT(e,n);else if(o===1)n.offset+=8;else if(o===2){let t=vT(e,n);if(n.offset+t>e.length)throw Error(`Invalid event`);if(r===0){let r=_T[a];if(r!==void 0){let i=gT[r];i!==void 0&&yT(e.subarray(n.offset,n.offset+t),i)}}n.offset+=t}else if(o===5)n.offset+=4;else throw Error(`Invalid event`);if(n.offset>e.length)throw Error(`Invalid event`)}if(r!==0)throw Error(`Invalid event`)}function xT(e){if(e.length===1)return e[0];let t=new Uint8Array(e.reduce((e,t)=>e+t.length,0)),n=0;for(let r of e)t.set(r,n),n+=r.length;return t}function ST(e,t){let n=new X(e),r=[],i=new Map,a,o=!1;for(;n.pos1||n!==t){s.push(new Y().uint32(e.number*8+2).bytes(n).finish()),o=!0;continue}}s.push(e.raw)}return o?xT(s):e}var CT=class extends Error{constructor(e=`Unknown event type`){super(e),this.name=`AGUIUnknownEventTypeError`}};function wT(e,t,n,r){let i=0,a=0,o=0;for(;;){if(t.offset>=e.length||o>=n)return-1;let s=e[t.offset++];if(o+=1,o===n&&s>r)return-1;if(i+=(s&127)*2**a,a+=7,!(s&128))return i}}var TT=(e,t)=>wT(e,t,5,15),ET=(e,t)=>wT(e,t,10,1);function DT(e){let t={offset:0},n=[];for(;t.offsete.length)return!1;t.offset+=n}else return!1;if(t.offset>e.length)return!1}return n.length===0}function OT(e){let t={offset:0},n=[],r=0;for(;t.offsete.length)return!1;if(s){if(sT.has(a)||!DT(e.subarray(t.offset,t.offset+n)))return!1;r+=1}t.offset+=n}else return!1;if(t.offset>e.length)return!1}return n.length===0&&r>0}function kT(e){bT(e);let t=Qw.decode(ST(e,{singular:sT,descend:_T})),n=Object.entries(t).filter(([,e])=>e!==void 0);if(n.length!==1)throw n.length===0&&OT(e)?new CT:Error(`Invalid event`);let r=n[0],i=oT[r[0]];if(i===void 0)throw Error(`Invalid event`);let a=r[1],o=nT(a.baseEvent);if(!o)throw Error(`Invalid event`);let s=VC[o.type];if(s!==i)throw Error(`Invalid event: envelope carries `+i+` but the base event declares `+String(s));if(a.type=i,a.timestamp=o.timestamp,a.rawEvent=o.rawEvent,o.metadata!==void 0&&(a.metadata=o.metadata),delete a.baseEvent,a.type===`MESSAGES_SNAPSHOT`&&Array.isArray(a.messages)&&(a.messages=a.messages.map(pT).filter(e=>e!==void 0)),a.type===`RUN_FINISHED`){let e=a,t=typeof e.outcome==`string`&&e.outcome!==``?e.outcome:void 0,n={};n.pendingToolCallIds=e.pendingToolCallIds,delete e.pendingToolCallIds,n.interrupts=e.interrupts,delete e.interrupts,delete e.outcome,t===void 0&&(rT(n.pendingToolCallIds).length>0&&(e.pendingToolCallIds=n.pendingToolCallIds),rT(n.interrupts).length>0&&(e.interrupts=n.interrupts)),t===`success`&&(e.outcome={type:`success`,...rT(n.pendingToolCallIds).length>0?{pendingToolCallIds:n.pendingToolCallIds}:{},...rT(n.interrupts).length>0?{interrupts:n.interrupts}:{}}),t===`interrupt`&&(e.outcome={type:`interrupt`,interrupts:rT(n.interrupts),...rT(n.pendingToolCallIds).length>0?{pendingToolCallIds:n.pendingToolCallIds}:{}}),t===`cancelled`&&(e.outcome={type:`cancelled`,...rT(n.pendingToolCallIds).length>0?{pendingToolCallIds:n.pendingToolCallIds}:{},...rT(n.interrupts).length>0?{interrupts:n.interrupts}:{}}),t!==void 0&&![`success`,`interrupt`,`cancelled`].includes(t)&&(e.outcome={type:t,...rT(n.pendingToolCallIds).length>0?{pendingToolCallIds:n.pendingToolCallIds}:{},...rT(n.interrupts).length>0?{interrupts:n.interrupts}:{}})}if(a.type===`SUBAGENT_FINISHED`){let e=a,t=typeof e.outcome==`string`&&e.outcome!==``?e.outcome:void 0,n={};n.interruptIds=e.interruptIds,delete e.interruptIds,delete e.outcome,t===void 0&&rT(n.interruptIds).length>0&&(e.interruptIds=n.interruptIds),t===`success`&&(e.outcome={type:`success`,...rT(n.interruptIds).length>0?{interruptIds:n.interruptIds}:{}}),t===`suspended`&&(e.outcome={type:`suspended`,...rT(n.interruptIds).length>0?{interruptIds:n.interruptIds}:{}}),t!==void 0&&![`success`,`suspended`].includes(t)&&(e.outcome={type:t,...rT(n.interruptIds).length>0?{interruptIds:n.interruptIds}:{}})}if(a.type===`STATE_DELTA`&&Array.isArray(a.delta)&&(a.delta=a.delta.map(e=>{let t=nC[e.op];return e.op=typeof t==`string`&&t!==`UNRECOGNIZED`?t.toLowerCase():String(e.op),Object.keys(e).forEach(t=>{e[t]===void 0&&delete e[t]}),e})),a.type===`ACTIVITY_DELTA`&&Array.isArray(a.patch)&&(a.patch=a.patch.map(e=>{let t=nC[e.op];return e.op=typeof t==`string`&&t!==`UNRECOGNIZED`?t.toLowerCase():String(e.op),Object.keys(e).forEach(t=>{e[t]===void 0&&delete e[t]}),e})),a.type===`RUN_FINISHED`&&Array.isArray(a.usage)&&a.usage.length===0&&delete a.usage,a.type===`RUN_ERROR`&&Array.isArray(a.usage)&&a.usage.length===0&&delete a.usage,a.type===`TOOL_CALL_RESULT`){let e=a;if(e.content!==void 0&&rT(e.contentParts).length>0)throw Error(`Invalid event: content carries both string content and content parts`);e.content===void 0&&(e.content=rT(e.contentParts).map(e=>{let t=lT(e);return t===void 0&&aT(),t}).filter(e=>e!==void 0)),delete e.contentParts}return a.type===`RUN_STARTED`&&a.input!==void 0&&(a.input=hT(a.input)),mT(a),a}var AT=/^[v^~<>=]*?(\d+)(?:\.([x*]|\d+)(?:\.([x*]|\d+)(?:\.([x*]|\d+))?(?:-([\da-z\-]+(?:\.[\da-z\-]+)*))?(?:\+[\da-z\-]+(?:\.[\da-z\-]+)*)?)?)?$/i,jT=e=>{if(typeof e!=`string`)throw TypeError(`Invalid argument expected string`);let t=e.match(AT);if(!t)throw Error(`Invalid argument not valid semver ('${e}' received)`);return t.shift(),t},MT=e=>e===`*`||e===`x`||e===`X`,NT=e=>{let t=parseInt(e,10);return isNaN(t)?e:t},PT=(e,t)=>typeof e==typeof t?[e,t]:[String(e),String(t)],FT=(e,t)=>{if(MT(e)||MT(t))return 0;let[n,r]=PT(NT(e),NT(t));return n>r?1:n{for(let n=0;n{let n=jT(e),r=jT(t),i=n.pop(),a=r.pop(),o=IT(n,r);return o===0?i&&a?IT(i.split(`.`),a.split(`.`)):i||a?i?-1:1:0:o},RT=e=>typeof e==`string`&&/^[v\d]/.test(e)&&AT.test(e);Object.freeze({status:`aborted`});function $(e,t,n){function r(n,r){var i;Object.defineProperty(n,"_zod",{value:n._zod??{},enumerable:!1}),(i=n._zod).traits??(i.traits=new Set),n._zod.traits.add(e),t(n,r);for(let e in o.prototype)e in n||Object.defineProperty(n,e,{value:o.prototype[e].bind(n)});n._zod.constr=o,n._zod.def=r}let i=n?.Parent??Object;class a extends i{}Object.defineProperty(a,"name",{value:e});function o(e){var t;let i=n?.Parent?new a:this;r(i,e),(t=i._zod).deferred??(t.deferred=[]);for(let e of i._zod.deferred)e();return i}return Object.defineProperty(o,"init",{value:r}),Object.defineProperty(o,Symbol.hasInstance,{value:t=>n?.Parent&&t instanceof n.Parent?!0:t?._zod?.traits?.has(e)}),Object.defineProperty(o,"name",{value:e}),o}var zT=class extends Error{constructor(){super(`Encountered Promise during synchronous parse. Use .parseAsync() instead.`)}},BT={};function VT(e){return e&&Object.assign(BT,e),BT}function HT(e){let t=Object.values(e).filter(e=>typeof e==`number`);return Object.entries(e).filter(([e,n])=>t.indexOf(+e)===-1).map(([e,t])=>t)}function UT(e,t){return typeof t==`bigint`?t.toString():t}function WT(e){return{get value(){{let t=e();return Object.defineProperty(this,"value",{value:t}),t}}}}function GT(e){return e==null}function KT(e){let t=+!!e.startsWith(`^`),n=e.endsWith(`$`)?e.length-1:e.length;return e.slice(t,n)}function qT(e,t,n){Object.defineProperty(e,t,{get(){{let r=n();return e[t]=r,r}},set(n){Object.defineProperty(e,t,{value:n})},configurable:!0})}function JT(e,t,n){Object.defineProperty(e,t,{value:n,writable:!0,enumerable:!0,configurable:!0})}function YT(e){return JSON.stringify(e)}var XT=Error.captureStackTrace?Error.captureStackTrace:(...e)=>{};function ZT(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}var QT=WT(()=>{if(typeof navigator<`u`&&navigator?.userAgent?.includes(`Cloudflare`))return!1;try{return Function(``),!0}catch{return!1}});function $T(e){if(ZT(e)===!1)return!1;let t=e.constructor;if(t===void 0)return!0;let n=t.prototype;return ZT(n)!==!1&&Object.prototype.hasOwnProperty.call(n,`isPrototypeOf`)!==!1}var eE=new Set([`string`,`number`,`symbol`]);function tE(e){return e.replace(/[.*+?^${}()|[\]\\]/g,`\\$&`)}function nE(e,t,n){let r=new e._zod.constr(t??e._zod.def);return(!t||n?.parent)&&(r._zod.parent=e),r}function rE(e){let t=e;if(!t)return{};if(typeof t==`string`)return{error:()=>t};if(t?.message!==void 0){if(t?.error!==void 0)throw Error("Cannot specify both `message` and `error` params");t.error=t.message}return delete t.message,typeof t.error==`string`?{...t,error:()=>t.error}:t}function iE(e){return Object.keys(e).filter(t=>e[t]._zod.optin===`optional`&&e[t]._zod.optout===`optional`)}function aE(e,t){let n={},r=e._zod.def;for(let e in t){if(!(e in r.shape))throw Error(`Unrecognized key: "${e}"`);t[e]&&(n[e]=r.shape[e])}return nE(e,{...e._zod.def,shape:n,checks:[]})}function oE(e,t){let n={...e._zod.def.shape},r=e._zod.def;for(let e in t){if(!(e in r.shape))throw Error(`Unrecognized key: "${e}"`);t[e]&&delete n[e]}return nE(e,{...e._zod.def,shape:n,checks:[]})}function sE(e,t){if(!$T(t))throw Error(`Invalid input to extend: expected a plain object`);return nE(e,{...e._zod.def,get shape(){let n={...e._zod.def.shape,...t};return JT(this,`shape`,n),n},checks:[]})}function cE(e,t){return nE(e,{...e._zod.def,get shape(){let n={...e._zod.def.shape,...t._zod.def.shape};return JT(this,`shape`,n),n},catchall:t._zod.def.catchall,checks:[]})}function lE(e,t,n){let r=t._zod.def.shape,i={...r};if(n)for(let t in n){if(!(t in r))throw Error(`Unrecognized key: "${t}"`);n[t]&&(i[t]=e?new e({type:`optional`,innerType:r[t]}):r[t])}else for(let t in r)i[t]=e?new e({type:`optional`,innerType:r[t]}):r[t];return nE(t,{...t._zod.def,shape:i,checks:[]})}function uE(e,t,n){let r=t._zod.def.shape,i={...r};if(n)for(let t in n){if(!(t in i))throw Error(`Unrecognized key: "${t}"`);n[t]&&(i[t]=new e({type:`nonoptional`,innerType:r[t]}))}else for(let t in r)i[t]=new e({type:`nonoptional`,innerType:r[t]});return nE(t,{...t._zod.def,shape:i,checks:[]})}function dE(e,t=0){for(let n=t;n{var n;return(n=t).path??(n.path=[]),t.path.unshift(e),t})}function pE(e){return typeof e==`string`?e:e?.message}function mE(e,t,n){let r={...e,path:e.path??[]};return e.message||(r.message=pE(e.inst?._zod.def?.error?.(e))??pE(t?.error?.(e))??pE(n.customError?.(e))??pE(n.localeError?.(e))??`Invalid input`),delete r.inst,delete r.continue,t?.reportInput||delete r.input,r}function hE(e){return Array.isArray(e)?`array`:typeof e==`string`?`string`:`unknown`}function gE(...e){let[t,n,r]=e;return typeof t==`string`?{message:t,code:`custom`,input:n,inst:r}:{...t}}var _E=(e,t)=>{e.name=`$ZodError`,Object.defineProperty(e,"_zod",{value:e._zod,enumerable:!1}),Object.defineProperty(e,"issues",{value:t,enumerable:!1}),Object.defineProperty(e,"message",{get(){return JSON.stringify(t,UT,2)},enumerable:!0}),Object.defineProperty(e,"toString",{value:()=>e.message,enumerable:!1})},vE=$(`$ZodError`,_E),yE=$(`$ZodError`,_E,{Parent:Error});function bE(e,t=e=>e.message){let n={},r=[];for(let i of e.issues)i.path.length>0?(n[i.path[0]]=n[i.path[0]]||[],n[i.path[0]].push(t(i))):r.push(t(i));return{formErrors:r,fieldErrors:n}}function xE(e,t){let n=t||function(e){return e.message},r={_errors:[]},i=e=>{for(let t of e.issues)if(t.code===`invalid_union`&&t.errors.length)t.errors.map(e=>i({issues:e}));else if(t.code===`invalid_key`)i({issues:t.issues});else if(t.code===`invalid_element`)i({issues:t.issues});else if(t.path.length===0)r._errors.push(n(t));else{let e=r,i=0;for(;i(t,n,r,i)=>{let a=r?Object.assign(r,{async:!1}):{async:!1},o=t._zod.run({value:n,issues:[]},a);if(o instanceof Promise)throw new zT;if(o.issues.length){let t=new((i?.Err)??e)(o.issues.map(e=>mE(e,a,VT())));throw XT(t,i?.callee),t}return o.value},CE=e=>async(t,n,r,i)=>{let a=r?Object.assign(r,{async:!0}):{async:!0},o=t._zod.run({value:n,issues:[]},a);if(o instanceof Promise&&(o=await o),o.issues.length){let t=new((i?.Err)??e)(o.issues.map(e=>mE(e,a,VT())));throw XT(t,i?.callee),t}return o.value},wE=e=>(t,n,r)=>{let i=r?{...r,async:!1}:{async:!1},a=t._zod.run({value:n,issues:[]},i);if(a instanceof Promise)throw new zT;return a.issues.length?{success:!1,error:new(e??vE)(a.issues.map(e=>mE(e,i,VT())))}:{success:!0,data:a.value}},TE=wE(yE),EE=e=>async(t,n,r)=>{let i=r?Object.assign(r,{async:!0}):{async:!0},a=t._zod.run({value:n,issues:[]},i);return a instanceof Promise&&(a=await a),a.issues.length?{success:!1,error:new e(a.issues.map(e=>mE(e,i,VT())))}:{success:!0,data:a.value}},DE=EE(yE),OE=$(`$ZodCheck`,(e,t)=>{var n;e._zod??={},e._zod.def=t,(n=e._zod).onattach??(n.onattach=[])}),kE=$(`$ZodCheckMaxLength`,(e,t)=>{var n;OE.init(e,t),(n=e._zod.def).when??(n.when=e=>{let t=e.value;return!GT(t)&&t.length!==void 0}),e._zod.onattach.push(e=>{let n=e._zod.bag.maximum??1/0;t.maximum{let r=n.value;if(r.length<=t.maximum)return;let i=hE(r);n.issues.push({origin:i,code:`too_big`,maximum:t.maximum,inclusive:!0,input:r,inst:e,continue:!t.abort})}}),AE=$(`$ZodCheckMinLength`,(e,t)=>{var n;OE.init(e,t),(n=e._zod.def).when??(n.when=e=>{let t=e.value;return!GT(t)&&t.length!==void 0}),e._zod.onattach.push(e=>{let n=e._zod.bag.minimum??-1/0;t.minimum>n&&(e._zod.bag.minimum=t.minimum)}),e._zod.check=n=>{let r=n.value;if(r.length>=t.minimum)return;let i=hE(r);n.issues.push({origin:i,code:`too_small`,minimum:t.minimum,inclusive:!0,input:r,inst:e,continue:!t.abort})}}),jE=$(`$ZodCheckLengthEquals`,(e,t)=>{var n;OE.init(e,t),(n=e._zod.def).when??(n.when=e=>{let t=e.value;return!GT(t)&&t.length!==void 0}),e._zod.onattach.push(e=>{let n=e._zod.bag;n.minimum=t.length,n.maximum=t.length,n.length=t.length}),e._zod.check=n=>{let r=n.value,i=r.length;if(i===t.length)return;let a=hE(r),o=i>t.length;n.issues.push({origin:a,...o?{code:`too_big`,maximum:t.length}:{code:`too_small`,minimum:t.length},inclusive:!0,exact:!0,input:n.value,inst:e,continue:!t.abort})}}),ME=$(`$ZodCheckOverwrite`,(e,t)=>{OE.init(e,t),e._zod.check=e=>{e.value=t.tx(e.value)}}),NE=class{constructor(e=[]){this.content=[],this.indent=0,this&&(this.args=e)}indented(e){this.indent+=1,e(this),--this.indent}write(e){if(typeof e==`function`){e(this,{execution:`sync`}),e(this,{execution:`async`});return}let t=e.split(` +`).filter(e=>e),n=Math.min(...t.map(e=>e.length-e.trimStart().length)),r=t.map(e=>e.slice(n)).map(e=>` `.repeat(this.indent*2)+e);for(let e of r)this.content.push(e)}compile(){let e=Function,t=this?.args,n=[...(this?.content??[``]).map(e=>` ${e}`)];return new e(...t,n.join(` +`))}},PE={major:4,minor:0,patch:0},FE=$(`$ZodType`,(e,t)=>{var n;e??={},e._zod.def=t,e._zod.bag=e._zod.bag||{},e._zod.version=PE;let r=[...e._zod.def.checks??[]];e._zod.traits.has(`$ZodCheck`)&&r.unshift(e);for(let t of r)for(let n of t._zod.onattach)n(e);if(r.length===0)(n=e._zod).deferred??(n.deferred=[]),e._zod.deferred?.push(()=>{e._zod.run=e._zod.parse});else{let t=(e,t,n)=>{let r=dE(e),i;for(let a of t){if(a._zod.def.when){if(!a._zod.def.when(e))continue}else if(r)continue;let t=e.issues.length,o=a._zod.check(e);if(o instanceof Promise&&n?.async===!1)throw new zT;if(i||o instanceof Promise)i=(i??Promise.resolve()).then(async()=>{await o,e.issues.length!==t&&(r||=dE(e,t))});else{if(e.issues.length===t)continue;r||=dE(e,t)}}return i?i.then(()=>e):e};e._zod.run=(n,i)=>{let a=e._zod.parse(n,i);if(a instanceof Promise){if(i.async===!1)throw new zT;return a.then(e=>t(e,r,i))}return t(a,r,i)}}e[`~standard`]={validate:t=>{try{let n=TE(e,t);return n.success?{value:n.data}:{issues:n.error?.issues}}catch{return DE(e,t).then(e=>e.success?{value:e.data}:{issues:e.error?.issues})}},vendor:`zod`,version:1}}),IE=$(`$ZodUnknown`,(e,t)=>{FE.init(e,t),e._zod.parse=e=>e}),LE=$(`$ZodNever`,(e,t)=>{FE.init(e,t),e._zod.parse=(t,n)=>(t.issues.push({expected:`never`,code:`invalid_type`,input:t.value,inst:e}),t)});function RE(e,t,n){e.issues.length&&t.issues.push(...fE(n,e.issues)),t.value[n]=e.value}var zE=$(`$ZodArray`,(e,t)=>{FE.init(e,t),e._zod.parse=(n,r)=>{let i=n.value;if(!Array.isArray(i))return n.issues.push({expected:`array`,code:`invalid_type`,input:i,inst:e}),n;n.value=Array(i.length);let a=[];for(let e=0;eRE(t,n,e))):RE(s,n,e)}return a.length?Promise.all(a).then(()=>n):n}});function BE(e,t,n){e.issues.length&&t.issues.push(...fE(n,e.issues)),t.value[n]=e.value}function VE(e,t,n,r){e.issues.length?r[n]===void 0?n in r?t.value[n]=void 0:t.value[n]=e.value:t.issues.push(...fE(n,e.issues)):e.value===void 0?n in r&&(t.value[n]=void 0):t.value[n]=e.value}var HE=$(`$ZodObject`,(e,t)=>{FE.init(e,t);let n=WT(()=>{let e=Object.keys(t.shape);for(let n of e)if(!(t.shape[n]instanceof FE))throw Error(`Invalid element at key "${n}": expected a Zod schema`);let n=iE(t.shape);return{shape:t.shape,keys:e,keySet:new Set(e),numKeys:e.length,optionalKeys:new Set(n)}});qT(e._zod,`propValues`,()=>{let e=t.shape,n={};for(let t in e){let r=e[t]._zod;if(r.values){n[t]??(n[t]=new Set);for(let e of r.values)n[t].add(e)}}return n});let r=e=>{let t=new NE([`shape`,`payload`,`ctx`]),r=n.value,i=e=>{let t=YT(e);return`shape[${t}]._zod.run({ value: input[${t}], issues: [] }, ctx)`};t.write(`const input = payload.value;`);let a=Object.create(null),o=0;for(let e of r.keys)a[e]=`key_${o++}`;t.write(`const newResult = {}`);for(let e of r.keys)if(r.optionalKeys.has(e)){let n=a[e];t.write(`const ${n} = ${i(e)};`);let r=YT(e);t.write(` + if (${n}.issues.length) { + if (input[${r}] === undefined) { + if (${r} in input) { + newResult[${r}] = undefined; + } + } else { + payload.issues = payload.issues.concat( + ${n}.issues.map((iss) => ({ + ...iss, + path: iss.path ? [${r}, ...iss.path] : [${r}], + })) + ); + } + } else if (${n}.value === undefined) { + if (${r} in input) newResult[${r}] = undefined; + } else { + newResult[${r}] = ${n}.value; + } + `)}else{let n=a[e];t.write(`const ${n} = ${i(e)};`),t.write(` + if (${n}.issues.length) payload.issues = payload.issues.concat(${n}.issues.map(iss => ({ + ...iss, + path: iss.path ? [${YT(e)}, ...iss.path] : [${YT(e)}] + })));`),t.write(`newResult[${YT(e)}] = ${n}.value`)}t.write(`payload.value = newResult;`),t.write(`return payload;`);let s=t.compile();return(t,n)=>s(e,t,n)},i,a=ZT,o=!BT.jitless,s=o&&QT.value,c=t.catchall,l;e._zod.parse=(u,d)=>{l??=n.value;let f=u.value;if(!a(f))return u.issues.push({expected:`object`,code:`invalid_type`,input:f,inst:e}),u;let p=[];if(o&&s&&d?.async===!1&&d.jitless!==!0)i||=r(t.shape),u=i(u,d);else{u.value={};let e=l.shape;for(let t of l.keys){let n=e[t],r=n._zod.run({value:f[t],issues:[]},d),i=n._zod.optin===`optional`&&n._zod.optout===`optional`;r instanceof Promise?p.push(r.then(e=>i?VE(e,u,t,f):BE(e,u,t))):i?VE(r,u,t,f):BE(r,u,t)}}if(!c)return p.length?Promise.all(p).then(()=>u):u;let m=[],h=l.keySet,g=c._zod,_=g.def.type;for(let e of Object.keys(f)){if(h.has(e))continue;if(_===`never`){m.push(e);continue}let t=g.run({value:f[e],issues:[]},d);t instanceof Promise?p.push(t.then(t=>BE(t,u,e))):BE(t,u,e)}return m.length&&u.issues.push({code:`unrecognized_keys`,keys:m,input:f,inst:e}),p.length?Promise.all(p).then(()=>u):u}});function UE(e,t,n,r){for(let n of e)if(n.issues.length===0)return t.value=n.value,t;return t.issues.push({code:`invalid_union`,input:t.value,inst:n,errors:e.map(e=>e.issues.map(e=>mE(e,r,VT())))}),t}var WE=$(`$ZodUnion`,(e,t)=>{FE.init(e,t),qT(e._zod,`optin`,()=>t.options.some(e=>e._zod.optin===`optional`)?`optional`:void 0),qT(e._zod,`optout`,()=>t.options.some(e=>e._zod.optout===`optional`)?`optional`:void 0),qT(e._zod,`values`,()=>{if(t.options.every(e=>e._zod.values))return new Set(t.options.flatMap(e=>Array.from(e._zod.values)))}),qT(e._zod,`pattern`,()=>{if(t.options.every(e=>e._zod.pattern)){let e=t.options.map(e=>e._zod.pattern);return RegExp(`^(${e.map(e=>KT(e.source)).join(`|`)})$`)}}),e._zod.parse=(n,r)=>{let i=!1,a=[];for(let e of t.options){let t=e._zod.run({value:n.value,issues:[]},r);if(t instanceof Promise)a.push(t),i=!0;else{if(t.issues.length===0)return t;a.push(t)}}return i?Promise.all(a).then(t=>UE(t,n,e,r)):UE(a,n,e,r)}}),GE=$(`$ZodIntersection`,(e,t)=>{FE.init(e,t),e._zod.parse=(e,n)=>{let r=e.value,i=t.left._zod.run({value:r,issues:[]},n),a=t.right._zod.run({value:r,issues:[]},n);return i instanceof Promise||a instanceof Promise?Promise.all([i,a]).then(([t,n])=>qE(e,t,n)):qE(e,i,a)}});function KE(e,t){if(e===t||e instanceof Date&&t instanceof Date&&+e==+t)return{valid:!0,data:e};if($T(e)&&$T(t)){let n=Object.keys(t),r=Object.keys(e).filter(e=>n.indexOf(e)!==-1),i={...e,...t};for(let n of r){let r=KE(e[n],t[n]);if(!r.valid)return{valid:!1,mergeErrorPath:[n,...r.mergeErrorPath]};i[n]=r.data}return{valid:!0,data:i}}if(Array.isArray(e)&&Array.isArray(t)){if(e.length!==t.length)return{valid:!1,mergeErrorPath:[]};let n=[];for(let r=0;r{FE.init(e,t),e._zod.parse=(n,r)=>{let i=n.value;if(!$T(i))return n.issues.push({expected:`record`,code:`invalid_type`,input:i,inst:e}),n;let a=[];if(t.keyType._zod.values){let o=t.keyType._zod.values;n.value={};for(let e of o)if(typeof e==`string`||typeof e==`number`||typeof e==`symbol`){let o=t.valueType._zod.run({value:i[e],issues:[]},r);o instanceof Promise?a.push(o.then(t=>{t.issues.length&&n.issues.push(...fE(e,t.issues)),n.value[e]=t.value})):(o.issues.length&&n.issues.push(...fE(e,o.issues)),n.value[e]=o.value)}let s;for(let e in i)o.has(e)||(s??=[],s.push(e));s&&s.length>0&&n.issues.push({code:`unrecognized_keys`,input:i,inst:e,keys:s})}else{n.value={};for(let o of Reflect.ownKeys(i)){if(o===`__proto__`)continue;let s=t.keyType._zod.run({value:o,issues:[]},r);if(s instanceof Promise)throw Error(`Async schemas not supported in object keys currently`);if(s.issues.length){n.issues.push({origin:`record`,code:`invalid_key`,issues:s.issues.map(e=>mE(e,r,VT())),input:o,path:[o],inst:e}),n.value[s.value]=s.value;continue}let c=t.valueType._zod.run({value:i[o],issues:[]},r);c instanceof Promise?a.push(c.then(e=>{e.issues.length&&n.issues.push(...fE(o,e.issues)),n.value[s.value]=e.value})):(c.issues.length&&n.issues.push(...fE(o,c.issues)),n.value[s.value]=c.value)}}return a.length?Promise.all(a).then(()=>n):n}}),YE=$(`$ZodEnum`,(e,t)=>{FE.init(e,t);let n=HT(t.entries);e._zod.values=new Set(n),e._zod.pattern=RegExp(`^(${n.filter(e=>eE.has(typeof e)).map(e=>typeof e==`string`?tE(e):e.toString()).join(`|`)})$`),e._zod.parse=(t,r)=>{let i=t.value;return e._zod.values.has(i)||t.issues.push({code:`invalid_value`,values:n,input:i,inst:e}),t}}),XE=$(`$ZodLiteral`,(e,t)=>{FE.init(e,t),e._zod.values=new Set(t.values),e._zod.pattern=RegExp(`^(${t.values.map(e=>typeof e==`string`?tE(e):e?e.toString():String(e)).join(`|`)})$`),e._zod.parse=(n,r)=>{let i=n.value;return e._zod.values.has(i)||n.issues.push({code:`invalid_value`,values:t.values,input:i,inst:e}),n}}),ZE=$(`$ZodTransform`,(e,t)=>{FE.init(e,t),e._zod.parse=(e,n)=>{let r=t.transform(e.value,e);if(n.async)return(r instanceof Promise?r:Promise.resolve(r)).then(t=>(e.value=t,e));if(r instanceof Promise)throw new zT;return e.value=r,e}}),QE=$(`$ZodOptional`,(e,t)=>{FE.init(e,t),e._zod.optin=`optional`,e._zod.optout=`optional`,qT(e._zod,`values`,()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,void 0]):void 0),qT(e._zod,`pattern`,()=>{let e=t.innerType._zod.pattern;return e?RegExp(`^(${KT(e.source)})?$`):void 0}),e._zod.parse=(e,n)=>t.innerType._zod.optin===`optional`?t.innerType._zod.run(e,n):e.value===void 0?e:t.innerType._zod.run(e,n)}),$E=$(`$ZodNullable`,(e,t)=>{FE.init(e,t),qT(e._zod,`optin`,()=>t.innerType._zod.optin),qT(e._zod,`optout`,()=>t.innerType._zod.optout),qT(e._zod,`pattern`,()=>{let e=t.innerType._zod.pattern;return e?RegExp(`^(${KT(e.source)}|null)$`):void 0}),qT(e._zod,`values`,()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,null]):void 0),e._zod.parse=(e,n)=>e.value===null?e:t.innerType._zod.run(e,n)}),eD=$(`$ZodDefault`,(e,t)=>{FE.init(e,t),e._zod.optin=`optional`,qT(e._zod,`values`,()=>t.innerType._zod.values),e._zod.parse=(e,n)=>{if(e.value===void 0)return e.value=t.defaultValue,e;let r=t.innerType._zod.run(e,n);return r instanceof Promise?r.then(e=>tD(e,t)):tD(r,t)}});function tD(e,t){return e.value===void 0&&(e.value=t.defaultValue),e}var nD=$(`$ZodPrefault`,(e,t)=>{FE.init(e,t),e._zod.optin=`optional`,qT(e._zod,`values`,()=>t.innerType._zod.values),e._zod.parse=(e,n)=>(e.value===void 0&&(e.value=t.defaultValue),t.innerType._zod.run(e,n))}),rD=$(`$ZodNonOptional`,(e,t)=>{FE.init(e,t),qT(e._zod,`values`,()=>{let e=t.innerType._zod.values;return e?new Set([...e].filter(e=>e!==void 0)):void 0}),e._zod.parse=(n,r)=>{let i=t.innerType._zod.run(n,r);return i instanceof Promise?i.then(t=>iD(t,e)):iD(i,e)}});function iD(e,t){return!e.issues.length&&e.value===void 0&&e.issues.push({code:`invalid_type`,expected:`nonoptional`,input:e.value,inst:t}),e}var aD=$(`$ZodCatch`,(e,t)=>{FE.init(e,t),e._zod.optin=`optional`,qT(e._zod,`optout`,()=>t.innerType._zod.optout),qT(e._zod,`values`,()=>t.innerType._zod.values),e._zod.parse=(e,n)=>{let r=t.innerType._zod.run(e,n);return r instanceof Promise?r.then(r=>(e.value=r.value,r.issues.length&&(e.value=t.catchValue({...e,error:{issues:r.issues.map(e=>mE(e,n,VT()))},input:e.value}),e.issues=[]),e)):(e.value=r.value,r.issues.length&&(e.value=t.catchValue({...e,error:{issues:r.issues.map(e=>mE(e,n,VT()))},input:e.value}),e.issues=[]),e)}}),oD=$(`$ZodPipe`,(e,t)=>{FE.init(e,t),qT(e._zod,`values`,()=>t.in._zod.values),qT(e._zod,`optin`,()=>t.in._zod.optin),qT(e._zod,`optout`,()=>t.out._zod.optout),e._zod.parse=(e,n)=>{let r=t.in._zod.run(e,n);return r instanceof Promise?r.then(e=>sD(e,t,n)):sD(r,t,n)}});function sD(e,t,n){return dE(e)?e:t.out._zod.run({value:e.value,issues:e.issues},n)}var cD=$(`$ZodReadonly`,(e,t)=>{FE.init(e,t),qT(e._zod,`propValues`,()=>t.innerType._zod.propValues),qT(e._zod,`values`,()=>t.innerType._zod.values),qT(e._zod,`optin`,()=>t.innerType._zod.optin),qT(e._zod,`optout`,()=>t.innerType._zod.optout),e._zod.parse=(e,n)=>{let r=t.innerType._zod.run(e,n);return r instanceof Promise?r.then(lD):lD(r)}});function lD(e){return e.value=Object.freeze(e.value),e}var uD=$(`$ZodLazy`,(e,t)=>{FE.init(e,t),qT(e._zod,`innerType`,()=>t.getter()),qT(e._zod,`pattern`,()=>e._zod.innerType._zod.pattern),qT(e._zod,`propValues`,()=>e._zod.innerType._zod.propValues),qT(e._zod,`optin`,()=>e._zod.innerType._zod.optin),qT(e._zod,`optout`,()=>e._zod.innerType._zod.optout),e._zod.parse=(t,n)=>e._zod.innerType._zod.run(t,n)}),dD=$(`$ZodCustom`,(e,t)=>{OE.init(e,t),FE.init(e,t),e._zod.parse=(e,t)=>e,e._zod.check=n=>{let r=n.value,i=t.fn(r);if(i instanceof Promise)return i.then(t=>fD(t,n,r,e));fD(i,n,r,e)}});function fD(e,t,n,r){if(!e){let e={code:`custom`,input:n,inst:r,path:[...r._zod.def.path??[]],continue:!r._zod.def.abort};r._zod.def.params&&(e.params=r._zod.def.params),t.issues.push(gE(e))}}var pD=class{constructor(){this._map=new Map,this._idmap=new Map}add(e,...t){let n=t[0];if(this._map.set(e,n),n&&typeof n==`object`&&`id`in n){if(this._idmap.has(n.id))throw Error(`ID ${n.id} already exists in the registry`);this._idmap.set(n.id,e)}return this}clear(){return this._map=new Map,this._idmap=new Map,this}remove(e){let t=this._map.get(e);return t&&typeof t==`object`&&`id`in t&&this._idmap.delete(t.id),this._map.delete(e),this}get(e){let t=e._zod.parent;if(t){let n={...this.get(t)??{}};return delete n.id,{...n,...this._map.get(e)}}return this._map.get(e)}has(e){return this._map.has(e)}};function mD(){return new pD}var hD=mD();function gD(e){return new e({type:`unknown`})}function _D(e,t){return new e({type:`never`,...rE(t)})}function vD(e,t){return new kE({check:`max_length`,...rE(t),maximum:e})}function yD(e,t){return new AE({check:`min_length`,...rE(t),minimum:e})}function bD(e,t){return new jE({check:`length_equals`,...rE(t),length:e})}function xD(e){return new ME({check:`overwrite`,tx:e})}function SD(e,t,n){return new e({type:`array`,element:t,...rE(n)})}function CD(e,t,n){return new e({type:`custom`,check:`custom`,fn:t,...rE(n)})}var wD=(e,t)=>{vE.init(e,t),e.name=`ZodError`,Object.defineProperties(e,{format:{value:t=>xE(e,t)},flatten:{value:t=>bE(e,t)},addIssue:{value:t=>e.issues.push(t)},addIssues:{value:t=>e.issues.push(...t)},isEmpty:{get(){return e.issues.length===0}}})};$(`ZodError`,wD);var TD=$(`ZodError`,wD,{Parent:Error}),ED=SE(TD),DD=CE(TD),OD=wE(TD),kD=EE(TD),AD=$(`ZodType`,(e,t)=>(FE.init(e,t),e.def=t,Object.defineProperty(e,"_def",{value:t}),e.check=(...n)=>e.clone({...t,checks:[...t.checks??[],...n.map(e=>typeof e==`function`?{_zod:{check:e,def:{check:`custom`},onattach:[]}}:e)]}),e.clone=(t,n)=>nE(e,t,n),e.brand=()=>e,e.register=((t,n)=>(t.add(e,n),e)),e.parse=(t,n)=>ED(e,t,n,{callee:e.parse}),e.safeParse=(t,n)=>OD(e,t,n),e.parseAsync=async(t,n)=>DD(e,t,n,{callee:e.parseAsync}),e.safeParseAsync=async(t,n)=>kD(e,t,n),e.spa=e.safeParseAsync,e.refine=(t,n)=>e.check(pO(t,n)),e.superRefine=t=>e.check(mO(t)),e.overwrite=t=>e.check(xD(t)),e.optional=()=>YD(e),e.nullable=()=>ZD(e),e.nullish=()=>YD(ZD(e)),e.nonoptional=t=>rO(e,t),e.array=()=>ID(e),e.or=t=>zD([e,t]),e.and=t=>VD(e,t),e.transform=t=>sO(e,qD(t)),e.default=t=>$D(e,t),e.prefault=t=>tO(e,t),e.catch=t=>aO(e,t),e.pipe=t=>sO(e,t),e.readonly=()=>lO(e),e.describe=t=>{let n=e.clone();return hD.add(n,{description:t}),n},Object.defineProperty(e,"description",{get(){return hD.get(e)?.description},configurable:!0}),e.meta=(...t)=>{if(t.length===0)return hD.get(e);let n=e.clone();return hD.add(n,t[0]),n},e.isOptional=()=>e.safeParse(void 0).success,e.isNullable=()=>e.safeParse(null).success,e)),jD=$(`ZodUnknown`,(e,t)=>{IE.init(e,t),AD.init(e,t)});function MD(){return gD(jD)}var ND=$(`ZodNever`,(e,t)=>{LE.init(e,t),AD.init(e,t)});function PD(e){return _D(ND,e)}var FD=$(`ZodArray`,(e,t)=>{zE.init(e,t),AD.init(e,t),e.element=t.element,e.min=(t,n)=>e.check(yD(t,n)),e.nonempty=t=>e.check(yD(1,t)),e.max=(t,n)=>e.check(vD(t,n)),e.length=(t,n)=>e.check(bD(t,n)),e.unwrap=()=>e.element});function ID(e,t){return SD(FD,e,t)}var LD=$(`ZodObject`,(e,t)=>{HE.init(e,t),AD.init(e,t),qT(e,`shape`,()=>t.shape),e.keyof=()=>WD(Object.keys(e._zod.def.shape)),e.catchall=t=>e.clone({...e._zod.def,catchall:t}),e.passthrough=()=>e.clone({...e._zod.def,catchall:MD()}),e.loose=()=>e.clone({...e._zod.def,catchall:MD()}),e.strict=()=>e.clone({...e._zod.def,catchall:PD()}),e.strip=()=>e.clone({...e._zod.def,catchall:void 0}),e.extend=t=>sE(e,t),e.merge=t=>cE(e,t),e.pick=t=>aE(e,t),e.omit=t=>oE(e,t),e.partial=(...t)=>lE(JD,e,t[0]),e.required=(...t)=>uE(nO,e,t[0])}),RD=$(`ZodUnion`,(e,t)=>{WE.init(e,t),AD.init(e,t),e.options=t.options});function zD(e,t){return new RD({type:`union`,options:e,...rE(t)})}var BD=$(`ZodIntersection`,(e,t)=>{GE.init(e,t),AD.init(e,t)});function VD(e,t){return new BD({type:`intersection`,left:e,right:t})}var HD=$(`ZodRecord`,(e,t)=>{JE.init(e,t),AD.init(e,t),e.keyType=t.keyType,e.valueType=t.valueType}),UD=$(`ZodEnum`,(e,t)=>{YE.init(e,t),AD.init(e,t),e.enum=t.entries,e.options=Object.values(t.entries);let n=new Set(Object.keys(t.entries));e.extract=(e,r)=>{let i={};for(let r of e)if(n.has(r))i[r]=t.entries[r];else throw Error(`Key ${r} not found in enum`);return new UD({...t,checks:[],...rE(r),entries:i})},e.exclude=(e,r)=>{let i={...t.entries};for(let t of e)if(n.has(t))delete i[t];else throw Error(`Key ${t} not found in enum`);return new UD({...t,checks:[],...rE(r),entries:i})}});function WD(e,t){return new UD({type:`enum`,entries:Array.isArray(e)?Object.fromEntries(e.map(e=>[e,e])):e,...rE(t)})}var GD=$(`ZodLiteral`,(e,t)=>{XE.init(e,t),AD.init(e,t),e.values=new Set(t.values),Object.defineProperty(e,"value",{get(){if(t.values.length>1)throw Error("This schema contains multiple valid literal values. Use `.values` instead.");return t.values[0]}})}),KD=$(`ZodTransform`,(e,t)=>{ZE.init(e,t),AD.init(e,t),e._zod.parse=(n,r)=>{n.addIssue=r=>{if(typeof r==`string`)n.issues.push(gE(r,n.value,t));else{let t=r;t.fatal&&(t.continue=!1),t.code??=`custom`,t.input??=n.value,t.inst??=e,t.continue??=!0,n.issues.push(gE(t))}};let i=t.transform(n.value,n);return i instanceof Promise?i.then(e=>(n.value=e,n)):(n.value=i,n)}});function qD(e){return new KD({type:`transform`,transform:e})}var JD=$(`ZodOptional`,(e,t)=>{QE.init(e,t),AD.init(e,t),e.unwrap=()=>e._zod.def.innerType});function YD(e){return new JD({type:`optional`,innerType:e})}var XD=$(`ZodNullable`,(e,t)=>{$E.init(e,t),AD.init(e,t),e.unwrap=()=>e._zod.def.innerType});function ZD(e){return new XD({type:`nullable`,innerType:e})}var QD=$(`ZodDefault`,(e,t)=>{eD.init(e,t),AD.init(e,t),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap});function $D(e,t){return new QD({type:`default`,innerType:e,get defaultValue(){return typeof t==`function`?t():t}})}var eO=$(`ZodPrefault`,(e,t)=>{nD.init(e,t),AD.init(e,t),e.unwrap=()=>e._zod.def.innerType});function tO(e,t){return new eO({type:`prefault`,innerType:e,get defaultValue(){return typeof t==`function`?t():t}})}var nO=$(`ZodNonOptional`,(e,t)=>{rD.init(e,t),AD.init(e,t),e.unwrap=()=>e._zod.def.innerType});function rO(e,t){return new nO({type:`nonoptional`,innerType:e,...rE(t)})}var iO=$(`ZodCatch`,(e,t)=>{aD.init(e,t),AD.init(e,t),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap});function aO(e,t){return new iO({type:`catch`,innerType:e,catchValue:typeof t==`function`?t:()=>t})}var oO=$(`ZodPipe`,(e,t)=>{oD.init(e,t),AD.init(e,t),e.in=t.in,e.out=t.out});function sO(e,t){return new oO({type:`pipe`,in:e,out:t})}var cO=$(`ZodReadonly`,(e,t)=>{cD.init(e,t),AD.init(e,t)});function lO(e){return new cO({type:`readonly`,innerType:e})}var uO=$(`ZodLazy`,(e,t)=>{uD.init(e,t),AD.init(e,t),e.unwrap=()=>e._zod.def.getter()}),dO=$(`ZodCustom`,(e,t)=>{dD.init(e,t),AD.init(e,t)});function fO(e){let t=new OE({check:`custom`});return t._zod.check=e,t}function pO(e,t={}){return CD(dO,e,t)}function mO(e){let t=fO(n=>(n.addIssue=e=>{if(typeof e==`string`)n.issues.push(gE(e,n.value,t._zod.def));else{let r=e;r.fatal&&(r.continue=!1),r.code??=`custom`,r.input??=n.value,r.inst??=t,r.continue??=!t._zod.def.abort,n.issues.push(gE(r))}},e(n.value,n)));return t}var hO=`@ag-ui/client`;function gO(e){if(!e.metadata||!Object.prototype.hasOwnProperty.call(e.metadata,hO))return;let t=e.metadata?.[hO];if(!t||typeof t!=`object`||Array.isArray(t))return[];if(!Object.prototype.hasOwnProperty.call(t,`authoritativeActivityTypes`))return;let n=t.authoritativeActivityTypes;return n===null?null:Array.isArray(n)&&n.every(e=>typeof e==`string`)?n:[]}var _O=e=>{if(typeof structuredClone==`function`)return structuredClone(e);try{return JSON.parse(JSON.stringify(e))}catch{return Array.isArray(e)?[...e]:{...e}}};function vO(){return Vc()}function yO(e){return e instanceof TypeError&&/read[- ]?only|not extensible|cannot add property|cannot delete property|can't be deleted|unable to delete property|object is frozen|is not writable/i.test(e.message)}function bO(e){if(Object.freeze(e),typeof e==`object`&&e)for(let t of Object.values(e))typeof t==`object`&&t&&!Object.isFrozen(t)&&bO(t);return e}var xO=524288;function SO(e,t,n){let r=0,i=[e,t],a=new WeakSet;for(;i.length>0;){let e=i.pop();if(typeof e==`string`){if(r+=e.length,r>n)return!0}else if(typeof e==`object`&&e){if(a.has(e))continue;if(a.add(e),Array.isArray(e))for(let t=0;tn)return!0;i.push(e[o])}}}}return!1}async function CO(e,t,n,r){let i=typeof process<`u`&&!0,a=i&&!!{}.VITEST_WORKER_ID,o=i&&!!{}.VITEST_WORKER_ID,s=o&&!SO(t,n,xO),c=s?_O(t):t,l=s?_O(n):n,u=!1,d=!1,f;for(let t of e)try{s&&(bO(c),bO(l));let e=await r(t,c,l);if(e===void 0)continue;let n=!1;if(e.messages!==void 0&&e.messages!==c&&(c=_O(e.messages),u=!0,n=!0),e.state!==void 0&&e.state!==l&&(l=_O(e.state),d=!0,n=!0),s&&n&&SO(c,l,xO)&&(s=!1),f=e.stopPropagation,f===!0)break}catch(e){if(a&&e instanceof TypeError)throw e;s&&o&&yO(e)?console.error(`AG-UI: Subscriber attempted to mutate frozen inputs in-place. Return mutations via AgentStateMutation instead of mutating directly.`,e):console.error(`Subscriber error:`,e);continue}return{...u?{messages:Object.isFrozen(c)?_O(c):c}:{},...d?{state:Object.isFrozen(l)?_O(l):l}:{},...f===void 0?{}:{stopPropagation:f}}}function wO(e){if(!e)return{enabled:!1,events:!1,lifecycle:!1,verbose:!1};if(e===!0)return{enabled:!0,events:!0,lifecycle:!0,verbose:!0};let t=e.events??!0,n=e.lifecycle??!0,r=e.verbose??!1;return{enabled:t||n,events:t,lifecycle:n,verbose:r}}function TO(e){if(e instanceof EO)return e;if(e===!0)return new EO(wO(!0))}var EO=class{constructor(e){this.config=e}event(e,t,n,r){this.config.events&&(this.config.verbose?console.debug(`[${e}] ${t}`,typeof n==`string`?n:JSON.stringify(n)):console.debug(`[${e}] ${t}`,r??n))}lifecycle(e,t,n){this.config.lifecycle&&(n?console.debug(`[${e}] ${t}`,n):console.debug(`[${e}] ${t}`))}get eventsEnabled(){return this.config.events}get lifecycleEnabled(){return this.config.lifecycle}get enabled(){return this.config.enabled}};function DO(e){return e.enabled?new EO(e):void 0}function OO(e,t,n){if(t){let r=e.find(e=>e.id===t);if(r?.role===`assistant`)return r;r&&console.warn(`TOOL_CALL_START: parentMessageId '${t}' matches a '${r.role}' message, not assistant — falling back to toolCallId`);let i={id:r?n:t,role:`assistant`,toolCalls:[]};return e.push(i),i}let r={id:n,role:`assistant`,toolCalls:[]};return e.push(r),r}function kO(e,t){return!e||t.metadata===void 0?!1:(e.metadata=qc(e.metadata,_O(t.metadata)),!0)}var AO=(e,t,n,r,i)=>{let a=TO(i),o=_O(n.messages),s=_O(e.state),c={},l=[],u=new Set,d=e=>{let t=e.outcome?.type===`success`?e.outcome.pendingToolCallIds:void 0;return t!==void 0&&t.length>0?[...t]:l.filter(e=>!u.has(e))},f=e=>{e.messages!==void 0&&(o=e.messages,c.messages=e.messages),e.state!==void 0&&(s=e.state,c.state=e.state)},p=()=>{let e=_O(c);return c={},e.messages!==void 0||e.state!==void 0?fd(e):Nu};return t.pipe(Cd(async t=>{let i=await CO(r,o,s,(r,i,a)=>r.onEvent?.({event:t,agent:n,input:e,messages:i,state:a}));if(f(i),i.stopPropagation===!0?a?.event(`APPLY`,`Event dropped:`,t,{type:t.type,reason:`stopPropagation by subscriber`}):a?.event(`APPLY`,`Event applied:`,t,{type:t.type,subscribers:r.length}),i.stopPropagation===!0)return p();switch(t.type){case L.TEXT_MESSAGE_START:{let i=await CO(r,o,s,(r,i,a)=>r.onTextMessageStartEvent?.({event:t,messages:i,state:a,agent:n,input:e}));if(f(i),i.stopPropagation!==!0){let{messageId:e,role:n=`assistant`,name:r,subagentRunId:i}=t,a=o.find(t=>t.id===e);if(a?.role===`activity`)return console.warn(`TEXT_MESSAGE_START: Message '${e}' is an activity message — message ids must be unique across activity and text messages`),p();let s=a;if(!s){let t={id:e,role:n,content:``,...r!==void 0&&{name:r},...i!=null&&{subagentRunId:i}};o.push(t),s=t}let c=kO(s,t);(!a||c)&&f({messages:o})}return p()}case L.TEXT_MESSAGE_CONTENT:{let{messageId:i,delta:a}=t,c=o.find(e=>e.id===i);if(!c)return console.warn(`TEXT_MESSAGE_CONTENT: No message found with ID '${i}'`),p();if(c.role===`activity`)return console.warn(`TEXT_MESSAGE_CONTENT: Message '${i}' is an activity message — message ids must be unique across activity and text messages`),p();let l=await CO(r,o,s,(r,i,a)=>r.onTextMessageContentEvent?.({event:t,messages:i,state:a,agent:n,input:e,textMessageBuffer:typeof c.content==`string`?c.content:``}));return f(l),l.stopPropagation!==!0&&(c.content=`${typeof c.content==`string`?c.content:``}${a}`,kO(c,t),f({messages:o})),p()}case L.TEXT_MESSAGE_END:{let{messageId:i}=t,a=o.find(e=>e.id===i);if(!a)return console.warn(`TEXT_MESSAGE_END: No message found with ID '${i}'`),p();if(a.role===`activity`)return console.warn(`TEXT_MESSAGE_END: Message '${i}' is an activity message — message ids must be unique across activity and text messages`),p();let c=await CO(r,o,s,(r,i,o)=>r.onTextMessageEndEvent?.({event:t,messages:i,state:o,agent:n,input:e,textMessageBuffer:typeof a.content==`string`?a.content:``}));return f(c),c.stopPropagation!==!0&&kO(a,t)&&f({messages:o}),await Promise.all(r.map(t=>{t.onNewMessage?.({message:a,messages:o,state:s,agent:n,input:e})})),p()}case L.TOOL_CALL_START:{let i=await CO(r,o,s,(r,i,a)=>r.onToolCallStartEvent?.({event:t,messages:i,state:a,agent:n,input:e}));if(f(i),i.stopPropagation!==!0){let{toolCallId:e,toolCallName:n,parentMessageId:r,subagentRunId:i}=t;l.includes(e)||l.push(e);let a=o.find(t=>t.toolCalls?.some(t=>t.id===e))?.toolCalls?.find(t=>t.id===e);if(a){let r=a.function.name!==n;return r&&(console.warn(`TOOL_CALL_START: tool call '${e}' already exists with name '${a.function.name}' — updating it to '${n}'`),a.function.name=n),(kO(a,t)||r)&&f({messages:o}),p()}let s=new Set(o.map(e=>e.id)),c=OO(o,r,e);!s.has(c.id)&&i!=null&&c.subagentRunId===void 0&&(c.subagentRunId=i),c.toolCalls??=[];let u={id:e,type:`function`,function:{name:n,arguments:``}};c.toolCalls.push(u),kO(u,t),f({messages:o})}return p()}case L.TOOL_CALL_ARGS:{let{toolCallId:i,delta:a}=t,c=o.find(e=>e.toolCalls?.some(e=>e.id===i));if(!c)return console.warn(`TOOL_CALL_ARGS: No message found containing tool call with ID '${i}'`),p();let l=c.toolCalls?.find(e=>e.id===i);if(!l)return console.warn(`TOOL_CALL_ARGS: No tool call found with ID '${i}'`),p();let u=await CO(r,o,s,(r,i,a)=>{let o=l.function.arguments,s=l.function.name,c={};try{c=Md(o)}catch{}return r.onToolCallArgsEvent?.({event:t,messages:i,state:a,agent:n,input:e,toolCallBuffer:o,toolCallName:s,partialToolCallArgs:c})});return f(u),u.stopPropagation!==!0&&(l.function.arguments+=a,kO(l,t),f({messages:o})),p()}case L.TOOL_CALL_END:{let{toolCallId:i}=t,a=o.find(e=>e.toolCalls?.some(e=>e.id===i));if(!a)return console.warn(`TOOL_CALL_END: No message found containing tool call with ID '${i}'`),p();let c=a.toolCalls?.find(e=>e.id===i);if(!c)return console.warn(`TOOL_CALL_END: No tool call found with ID '${i}'`),p();let l=await CO(r,o,s,(r,i,a)=>{let o=c.function.arguments,s=c.function.name,l={};try{l=JSON.parse(o)}catch{}return r.onToolCallEndEvent?.({event:t,messages:i,state:a,agent:n,input:e,toolCallName:s,toolCallArgs:l})});return f(l),l.stopPropagation!==!0&&kO(c,t)&&f({messages:o}),await Promise.all(r.map(t=>{t.onNewToolCall?.({toolCall:c,messages:o,state:s,agent:n,input:e})})),p()}case L.TOOL_CALL_RESULT:{let i=await CO(r,o,s,(r,i,a)=>r.onToolCallResultEvent?.({event:t,messages:i,state:a,agent:n,input:e}));if(f(i),i.stopPropagation!==!0){let{messageId:i,toolCallId:a,content:c,role:l,subagentRunId:d}=t;u.add(a);let p={id:i,toolCallId:a,role:l||`tool`,content:c,...d!=null&&{subagentRunId:d}};kO(p,t);let m=o.findIndex(e=>e.role===`assistant`&&e.toolCalls?.some(e=>e.id===a));if(m===-1)o.push(p);else{let e=m+1;for(;e{t.onNewMessage?.({message:p,messages:o,state:s,agent:n,input:e})})),f({messages:o})}return p()}case L.STATE_SNAPSHOT:{let i=await CO(r,o,s,(r,i,a)=>r.onStateSnapshotEvent?.({event:t,messages:i,state:a,agent:n,input:e}));if(f(i),i.stopPropagation!==!0){let{snapshot:e}=t;s=e,f({state:s})}return p()}case L.STATE_DELTA:{let i=await CO(r,o,s,(r,i,a)=>r.onStateDeltaEvent?.({event:t,messages:i,state:a,agent:n,input:e}));if(f(i),i.stopPropagation!==!0){let{delta:e}=t;try{s=jl.applyPatch(s,e,!0,!1).newDocument,f({state:s})}catch(t){let n=t instanceof Error?t.message:String(t);console.warn(`Failed to apply state patch:\nCurrent state: ${JSON.stringify(s,null,2)}\nPatch operations: ${JSON.stringify(e,null,2)}\nError: ${n}`)}}return p()}case L.MESSAGES_SNAPSHOT:{let i=await CO(r,o,s,(r,i,a)=>r.onMessagesSnapshotEvent?.({event:t,messages:i,state:a,agent:n,input:e}));if(f(i),i.stopPropagation!==!0){let{messages:e}=t,n=e.map(e=>{if(e.subagentRunId!==null)return e;let t={...e};return delete t.subagentRunId,t}),r=new Map(n.map(e=>[e.id,e])),i=gO(t),a=n.some(e=>e.role===`activity`),s=n.some(e=>e.role===`reasoning`),c=e=>e.role===`activity`&&(i?!i.includes(e.activityType):i!==null&&!a)||e.role===`reasoning`&&!s;o=o.filter(e=>r.has(e.id)||c(e)).map(e=>r.get(e.id)??e);let l=new Set(o.map(e=>e.id));for(let e of n)l.has(e.id)||o.push(e);f({messages:o})}return p()}case L.ACTIVITY_SNAPSHOT:{let i=t,a=o.findIndex(e=>e.id===i.messageId),c=a>=0?o[a]:void 0,l=c?.role===`activity`?c:void 0,u=i.replace??!0,d=await CO(r,o,s,(t,r,a)=>t.onActivitySnapshotEvent?.({event:i,messages:r,state:a,agent:n,input:e,activityMessage:l,existingMessage:c}));if(f(d),d.stopPropagation!==!0){let t={id:i.messageId,role:`activity`,activityType:i.activityType,content:_O(i.content),...i.subagentRunId!=null&&{subagentRunId:i.subagentRunId}},c,d;a===-1?(o.push(t),c=t,d=t):l?(u&&(o[a]={...l,activityType:i.activityType,content:_O(i.content),subagentRunId:i.subagentRunId},i.subagentRunId??delete o[a].subagentRunId),d=o[a]):u&&(o[a]=t,c=t,d=t),kO(d,i),f({messages:o}),c&&await Promise.all(r.map(t=>t.onNewMessage?.({message:c,messages:o,state:s,agent:n,input:e})))}return p()}case L.ACTIVITY_DELTA:{let i=t,a=o.findIndex(e=>e.id===i.messageId);if(a===-1)return p();let c=o[a];if(c.role!==`activity`)return console.warn(`ACTIVITY_DELTA: Message '${i.messageId}' is not an activity message`),p();let l=c,u=await CO(r,o,s,(t,r,a)=>t.onActivityDeltaEvent?.({event:i,messages:r,state:a,agent:n,input:e,activityMessage:l}));if(f(u),u.stopPropagation!==!0)try{kO(l,i)&&f({messages:o});let e=_O(l.content??{}),t=jl.applyPatch(e,i.patch??[],!0,!1).newDocument;o[a]={...l,content:_O(t),activityType:i.activityType},f({messages:o})}catch(e){let t=e instanceof Error?e.message:String(e);console.warn(`Failed to apply activity patch for '${i.messageId}': ${t}`)}return p()}case L.RAW:return f(await CO(r,o,s,(r,i,a)=>r.onRawEvent?.({event:t,messages:i,state:a,agent:n,input:e}))),p();case L.CUSTOM:return f(await CO(r,o,s,(r,i,a)=>r.onCustomEvent?.({event:t,messages:i,state:a,agent:n,input:e}))),p();case L.RUN_STARTED:{let i=await CO(r,o,s,(r,i,a)=>r.onRunStartedEvent?.({event:t,messages:i,state:a,agent:n,input:e}));if(f(i),l=[],u=new Set,i.stopPropagation!==!0){let e=t;if(e.input?.messages){for(let t of e.input.messages){let e=t;if(t.subagentRunId===null){let n={...t};delete n.subagentRunId,e=n}o.find(t=>t.id===e.id)||o.push(e)}f({messages:o})}}return p()}case L.RUN_FINISHED:{let i=t,a=i.outcome?.type===`interrupt`?{event:i,outcome:`interrupt`,interrupts:i.outcome.interrupts}:i.outcome?.type===`cancelled`?{event:i,outcome:`cancelled`}:{event:i,outcome:`success`,result:i.result,pendingToolCallIds:d(i)},c=await CO(r,o,s,(t,r,i)=>t.onRunFinishedEvent?.({...a,messages:r,state:i,agent:n,input:e}));return f(c),c.stopPropagation!==!0&&(n.pendingInterrupts=a.outcome===`interrupt`?a.interrupts.map(e=>{if(e.subagentRunId!==null)return e;let t={...e};return delete t.subagentRunId,t}):[]),p()}case L.RUN_ERROR:return f(await CO(r,o,s,(r,i,a)=>r.onRunErrorEvent?.({event:t,messages:i,state:a,agent:n,input:e}))),p();case L.STEP_STARTED:return f(await CO(r,o,s,(r,i,a)=>r.onStepStartedEvent?.({event:t,messages:i,state:a,agent:n,input:e}))),p();case L.STEP_FINISHED:return f(await CO(r,o,s,(r,i,a)=>r.onStepFinishedEvent?.({event:t,messages:i,state:a,agent:n,input:e}))),p();case L.TEXT_MESSAGE_CHUNK:throw Error(`TEXT_MESSAGE_CHUNK must be transformed before being applied`);case L.TOOL_CALL_CHUNK:throw Error(`TOOL_CALL_CHUNK must be transformed before being applied`);case L.REASONING_START:return f(await CO(r,o,s,(r,i,a)=>r.onReasoningStartEvent?.({event:t,messages:i,state:a,agent:n,input:e}))),p();case L.REASONING_MESSAGE_START:{let i=await CO(r,o,s,(r,i,a)=>r.onReasoningMessageStartEvent?.({event:t,messages:i,state:a,agent:n,input:e}));if(f(i),i.stopPropagation!==!0){let{messageId:e,subagentRunId:n}=t,r=o.find(t=>t.id===e);if(r?.role===`activity`)return console.warn(`REASONING_MESSAGE_START: Message '${e}' is an activity message — message ids must be unique across activity and reasoning messages`),p();let i=r;if(!i){let t={id:e,role:`reasoning`,content:``,...n!=null&&{subagentRunId:n}};o.push(t),i=t}let a=kO(i,t);(!r||a)&&f({messages:o})}return p()}case L.REASONING_MESSAGE_CONTENT:{let{messageId:i,delta:a}=t,c=o.find(e=>e.id===i);if(!c)return console.warn(`REASONING_MESSAGE_CONTENT: No message found with ID '${i}'`),p();if(c.role===`activity`)return console.warn(`REASONING_MESSAGE_CONTENT: Message '${i}' is an activity message — message ids must be unique across activity and reasoning messages`),p();let l=await CO(r,o,s,(r,i,a)=>r.onReasoningMessageContentEvent?.({event:t,messages:i,state:a,agent:n,input:e,reasoningMessageBuffer:typeof c.content==`string`?c.content:``}));return f(l),l.stopPropagation!==!0&&(c.content=`${typeof c.content==`string`?c.content:``}${a}`,kO(c,t),f({messages:o})),p()}case L.REASONING_MESSAGE_END:{let{messageId:i}=t,a=o.find(e=>e.id===i);if(!a)return console.warn(`REASONING_MESSAGE_END: No message found with ID '${i}'`),p();if(a.role===`activity`)return console.warn(`REASONING_MESSAGE_END: Message '${i}' is an activity message — message ids must be unique across activity and reasoning messages`),p();let c=await CO(r,o,s,(r,i,o)=>r.onReasoningMessageEndEvent?.({event:t,messages:i,state:o,agent:n,input:e,reasoningMessageBuffer:typeof a.content==`string`?a.content:``}));return f(c),c.stopPropagation!==!0&&kO(a,t)&&f({messages:o}),await Promise.all(r.map(t=>{t.onNewMessage?.({message:a,messages:o,state:s,agent:n,input:e})})),p()}case L.REASONING_MESSAGE_CHUNK:throw Error(`REASONING_MESSAGE_CHUNK must be transformed before being applied`);case L.REASONING_END:return f(await CO(r,o,s,(r,i,a)=>r.onReasoningEndEvent?.({event:t,messages:i,state:a,agent:n,input:e}))),p();case L.REASONING_ENCRYPTED_VALUE:{let{subtype:i,entityId:a,encryptedValue:l}=t,u=await CO(r,o,s,(r,i,a)=>r.onReasoningEncryptedValueEvent?.({event:t,messages:i,state:a,agent:n,input:e}));if(f(u),u.stopPropagation!==!0){let e=!1;if(i===`tool-call`){for(let t of o)if(t.role===`assistant`&&t.toolCalls){let n=t.toolCalls.find(e=>e.id===a);if(n){n.encryptedValue=l,e=!0;break}}}else{let t=o.find(e=>e.id===a);t?.role!==`activity`&&t&&(t.encryptedValue=l,e=!0)}e&&(c.messages=o)}return p()}case L.SUBAGENT_STARTED:return f(await CO(r,o,s,(r,i,a)=>r.onSubagentStartedEvent?.({event:t,messages:i,state:a,agent:n,input:e}))),p();case L.SUBAGENT_FINISHED:return f(await CO(r,o,s,(r,i,a)=>r.onSubagentFinishedEvent?.({event:t,messages:i,state:a,agent:n,input:e}))),p();case L.SUBAGENT_ERROR:return f(await CO(r,o,s,(r,i,a)=>r.onSubagentErrorEvent?.({event:t,messages:i,state:a,agent:n,input:e}))),p()}return t.type,p()}),vd(),r.length>0?Ed({}):e=>e)};function jO(e,t){typeof process<`u`&&{}.SUPPRESS_TRANSFORMATION_WARNINGS||console.warn(`[ag-ui][compat] Converting deprecated ${e} to ${t}. The old shape leaves the protocol after its shim window — see the repo-root DEPRECATIONS.md. Set SUPPRESS_TRANSFORMATION_WARNINGS=true to silence.`)}var MO=e=>t=>{let n=TO(e),r=new Set,i=new Set,a=new Set,o=new Set,s={message:new Map,toolCall:new Map,activity:new Map,reasoning:new Map},c=!1,l=!1,u=!1,d=new Map,f=e=>{let t=d.get(e);return t||(t=new Map,d.set(e,t)),t},p=()=>{for(let e of d.values())if(e.size>0)return!0;return!1},m=new Map,h=new Set,g=!1,_=!1,v=()=>{_=!1,r.clear(),i.clear(),a.clear(),o.clear(),s.message.clear(),s.toolCall.clear(),s.activity.clear(),s.reasoning.clear(),d.clear(),m.clear(),h.clear(),c=!1,l=!1,g=!0},y=(e,t)=>{let n=e??[];if(Array.isArray(n))for(let e of n){if(!e||typeof e.id!=`string`)continue;if(e.subagentRunId===null)return new R(`Cannot send a message (id '${e.id}') with 'subagentRunId: null'. The field is optional — omit it entirely.`);let n=e.role===`reasoning`?s.reasoning:e.role===`activity`?s.activity:s.message;(t||!n.has(e.id))&&n.set(e.id,{subagentRunId:e.subagentRunId});for(let n of e.toolCalls??[])n&&typeof n.id==`string`&&(t||!s.toolCall.has(n.id))&&s.toolCall.set(n.id,{subagentRunId:e.subagentRunId??void 0})}},b=(e,t,n,r,i)=>{if(t!==void 0&&n&&n.subagentRunId!==t)return new R(`Cannot send '${e}': subagentRunId '${t}' does not match the ${r} '${i}' opener's subagent '${n.subagentRunId??`(the parent agent)`}'.`)};return t.pipe(_d(e=>{let t=e.type;if(n?.event(`VERIFY`,`Event:`,e,{type:e.type}),l&&t!==L.RUN_STARTED)return z(()=>new R(`Cannot send event type '${t}': The run has already errored with 'RUN_ERROR'. No further events can be sent.`));if(c&&t!==L.RUN_ERROR&&t!==L.RUN_STARTED)return z(()=>new R(`Cannot send event type '${t}': The run has already finished with 'RUN_FINISHED'. Start a new run with 'RUN_STARTED'.`));if(!u){if(u=!0,t!==L.RUN_STARTED&&t!==L.RUN_ERROR)return z(()=>new R(`First event must be 'RUN_STARTED'`))}else if(t===L.RUN_STARTED){if(g&&!c&&!l)return z(()=>new R(`Cannot send 'RUN_STARTED' while a run is still active. The previous run must be finished with 'RUN_FINISHED' before starting a new run.`));(c||l)&&v()}if(e.subagentRunId===null){_||(_=!0,jO(`subagentRunId: null`,`an absent field`));let{subagentRunId:t,...n}=e;e=n}if(t===L.SUBAGENT_STARTED||t===L.SUBAGENT_FINISHED||t===L.SUBAGENT_ERROR){let n=t===L.SUBAGENT_STARTED?[`description`,`parentSubagentRunId`,`parentToolCallId`,`parentMessageId`]:t===L.SUBAGENT_FINISHED?[`outcome`]:[`code`];for(let r of n)if(e[r]===null)return z(()=>new R(`Cannot send '${t}' with '${r}: null'. The field is optional — omit it entirely.`));let r=e.outcome;if(r!=null&&r.type!==`success`&&r.type!==`suspended`)return z(()=>new R(`Cannot send '${t}' with outcome type '${String(r.type)}'. The outcome is either { type: "success" } or { type: "suspended" }.`));if(r&&r.interruptIds===null)return z(()=>new R(`Cannot send '${t}' with 'outcome.interruptIds: null'. The field is optional — omit it entirely.`));if(r&&Array.isArray(r.interruptIds)&&r.interruptIds.some(e=>typeof e!=`string`))return z(()=>new R(`Cannot send '${t}' with a non-string entry in 'outcome.interruptIds'. Interrupt ids are strings.`))}if(t===L.RUN_FINISHED){let t=e.outcome;if(t?.type===`interrupt`&&Array.isArray(t.interrupts)){for(let e of t.interrupts)if(e&&e.subagentRunId===null)return z(()=>new R(`Cannot send 'RUN_FINISHED' with an interrupt (id '${e.id}') carrying 'subagentRunId: null'. The field is optional — omit it entirely.`))}}switch(t){case L.TEXT_MESSAGE_START:{let n=e.messageId;if(r.has(n))return z(()=>new R(`Cannot send 'TEXT_MESSAGE_START' event: A text message with ID '${n}' is already in progress. Complete it with 'TEXT_MESSAGE_END' first.`));let i=s.message.get(n);if(i){let r=b(t,e.subagentRunId,i,`message`,n);if(r)return z(()=>r)}return r.add(n),i||s.message.set(n,{subagentRunId:e.subagentRunId}),fd(e)}case L.TEXT_MESSAGE_CONTENT:{let n=e.messageId;if(!r.has(n))return z(()=>new R(`Cannot send 'TEXT_MESSAGE_CONTENT' event: No active text message found with ID '${n}'. Start a text message with 'TEXT_MESSAGE_START' first.`));let i=b(t,e.subagentRunId,s.message.get(n),`message`,n);return i?z(()=>i):fd(e)}case L.TEXT_MESSAGE_END:{let n=e.messageId;if(!r.has(n))return z(()=>new R(`Cannot send 'TEXT_MESSAGE_END' event: No active text message found with ID '${n}'. A 'TEXT_MESSAGE_START' event must be sent first.`));let i=b(t,e.subagentRunId,s.message.get(n),`message`,n);return i?z(()=>i):(r.delete(n),fd(e))}case L.TOOL_CALL_START:{let n=e.toolCallId;if(i.has(n))return z(()=>new R(`Cannot send 'TOOL_CALL_START' event: A tool call with ID '${n}' is already in progress. Complete it with 'TOOL_CALL_END' first.`));let r=e.parentMessageId,a=e.subagentRunId,o;if(r!==void 0){let e=s.message.get(r);if(e){if(a!==void 0&&a!==e.subagentRunId)return z(()=>new R(`Cannot send 'TOOL_CALL_START': subagentRunId '${a}' does not match its parent message '${r}' owner '${e.subagentRunId??`(the parent agent)`}'. A tool call belongs to the message that carries it.`));o=e}}let c=s.toolCall.get(n);if(c){let e=b(t,a,c,`tool call`,n);if(e)return z(()=>e);if(a===void 0&&o&&o.subagentRunId!==c.subagentRunId)return z(()=>new R(`Cannot send 'TOOL_CALL_START': tool call '${n}' is owned by '${c.subagentRunId??`(the parent agent)`}' but its parent message '${r}' is owned by '${o.subagentRunId??`(the parent agent)`}'. A tool call belongs to the message that carries it.`))}return i.add(n),c||s.toolCall.set(n,a===void 0?o??{subagentRunId:void 0}:{subagentRunId:a}),fd(e)}case L.TOOL_CALL_ARGS:{let n=e.toolCallId;if(!i.has(n))return z(()=>new R(`Cannot send 'TOOL_CALL_ARGS' event: No active tool call found with ID '${n}'. Start a tool call with 'TOOL_CALL_START' first.`));let r=b(t,e.subagentRunId,s.toolCall.get(n),`tool call`,n);return r?z(()=>r):fd(e)}case L.TOOL_CALL_END:{let n=e.toolCallId;if(!i.has(n))return z(()=>new R(`Cannot send 'TOOL_CALL_END' event: No active tool call found with ID '${n}'. A 'TOOL_CALL_START' event must be sent first.`));let r=b(t,e.subagentRunId,s.toolCall.get(n),`tool call`,n);return r?z(()=>r):(i.delete(n),fd(e))}case L.STEP_STARTED:{let t=e.stepName,n=e.subagentRunId;return f(n).has(t)?z(()=>new R(`Step "${t}" is already active for 'STEP_STARTED'${n===void 0?``:` in subagent '${n}'`}`)):(f(n).set(t,!0),fd(e))}case L.STEP_FINISHED:{let t=e.stepName,n=e.subagentRunId;if(!f(n).has(t)){let e,r=!1;for(let[i,a]of d)if(i!==n&&a.has(t)){e=i,r=!0;break}return z(r?()=>new R(`Cannot send 'STEP_FINISHED' for step "${t}" attributed to ${n===void 0?`the parent agent`:`subagent '${n}'`}: that step is open under ${e===void 0?`the parent agent`:`subagent '${e}'`}. A step must be finished by whoever started it.`):()=>new R(`Cannot send 'STEP_FINISHED' for step "${t}" that was not started`))}return f(n).delete(t),fd(e)}case L.ACTIVITY_SNAPSHOT:{let t=e.messageId;return(!s.activity.has(t)||e.replace!==!1)&&s.activity.set(t,{subagentRunId:e.subagentRunId}),fd(e)}case L.TOOL_CALL_RESULT:{let t=e.messageId;return typeof t==`string`&&s.message.set(t,{subagentRunId:e.subagentRunId}),fd(e)}case L.REASONING_START:case L.REASONING_MESSAGE_START:{let n=e.messageId,r=t===L.REASONING_START,i=r?a:o;if(i.has(n))return z(()=>new R(r?`Cannot send 'REASONING_START' event: A reasoning span with ID '${n}' is already in progress. Complete it with 'REASONING_END' first.`:`Cannot send 'REASONING_MESSAGE_START' event: A reasoning message with ID '${n}' is already in progress. Complete it with 'REASONING_MESSAGE_END' first.`));let c=s.reasoning.get(n);if(c){let r=b(t,e.subagentRunId,c,`reasoning message`,n);if(r)return z(()=>r)}return i.add(n),c||s.reasoning.set(n,{subagentRunId:e.subagentRunId}),fd(e)}case L.REASONING_MESSAGE_CONTENT:case L.REASONING_MESSAGE_END:case L.REASONING_END:{let n=e.messageId,r=t===L.REASONING_END,i=r?a:o;if(!i.has(n))return z(()=>new R(r?`Cannot send 'REASONING_END' event: No active reasoning span found with ID '${n}'. A 'REASONING_START' event must be sent first.`:`Cannot send '${t}' event: No active reasoning message found with ID '${n}'. Start a reasoning message with 'REASONING_MESSAGE_START' first.`));let c=b(t,e.subagentRunId,s.reasoning.get(n),`reasoning message`,n);return c?z(()=>c):((t===L.REASONING_END||t===L.REASONING_MESSAGE_END)&&i.delete(n),fd(e))}case L.REASONING_ENCRYPTED_VALUE:{let n=e.entityId,r=e.subtype,i=r===`tool-call`?s.toolCall.get(n):r===`message`?s.message.get(n)??s.reasoning.get(n):s.reasoning.get(n),a=r===`tool-call`?`tool call`:r===`message`?`message`:`reasoning message`,o=b(t,e.subagentRunId,i,a,n);return o?z(()=>o):fd(e)}case L.ACTIVITY_DELTA:{let n=e.messageId,r=b(t,e.subagentRunId,s.activity.get(n),`activity`,n);return r?z(()=>r):fd(e)}case L.SUBAGENT_STARTED:{if(typeof e.subagentRunId!=`string`)return z(()=>new R(`Cannot send 'SUBAGENT_STARTED' without a 'subagentRunId'.`));if(typeof e.name!=`string`)return z(()=>new R(`Cannot send 'SUBAGENT_STARTED' without a 'name'.`));let t=e.subagentRunId,n=e.parentSubagentRunId;return m.has(t)?z(()=>new R(`Cannot send 'SUBAGENT_STARTED': subagent '${t}' is already active. Finish it with 'SUBAGENT_FINISHED' first.`)):h.has(t)?z(()=>new R(`Cannot send 'SUBAGENT_STARTED': subagent '${t}' has already finished in this run. Subagent IDs are per-invocation and cannot be reused.`)):n!==void 0&&!m.has(n)&&!h.has(n)?z(()=>new R(`Cannot send 'SUBAGENT_STARTED': parentSubagentRunId '${n}' has not been started in this run.`)):(m.set(t,!0),fd(e))}case L.SUBAGENT_FINISHED:case L.SUBAGENT_ERROR:{if(typeof e.subagentRunId!=`string`)return z(()=>new R(`Cannot send '${t}' without a 'subagentRunId'.`));if(t===L.SUBAGENT_ERROR&&typeof e.message!=`string`)return z(()=>new R(`Cannot send 'SUBAGENT_ERROR' without a 'message'.`));let n=e.subagentRunId;return m.has(n)?(m.delete(n),h.add(n),fd(e)):z(()=>new R(`Cannot send '${t}': no active subagent found with ID '${n}'. A 'SUBAGENT_STARTED' event must be sent first.`))}case L.MESSAGES_SNAPSHOT:{let t=y(e.messages,!0);if(t)return z(()=>t)}return fd(e);case L.RUN_STARTED:g=!0;{let t=y((e.input??{}).messages,!1);if(t)return z(()=>t)}return fd(e);case L.RUN_FINISHED:if(p()){let e=[];for(let[t,n]of d)for(let r of n.keys())e.push(t===void 0?r:`${r} (subagent '${t}')`);let t=e.join(`, `);return z(()=>new R(`Cannot send 'RUN_FINISHED' while steps are still active: ${t}`))}if(r.size>0){let e=Array.from(r.keys()).join(`, `);return z(()=>new R(`Cannot send 'RUN_FINISHED' while text messages are still active: ${e}`))}if(o.size>0){let e=Array.from(o.keys()).join(`, `);return z(()=>new R(`Cannot send 'RUN_FINISHED' while reasoning messages are still active: ${e}`))}if(a.size>0){let e=Array.from(a.keys()).join(`, `);return z(()=>new R(`Cannot send 'RUN_FINISHED' while reasoning spans are still active: ${e}`))}if(i.size>0){let e=Array.from(i.keys()).join(`, `);return z(()=>new R(`Cannot send 'RUN_FINISHED' while tool calls are still active: ${e}`))}if(m.size>0){let e=Array.from(m.keys()).join(`, `);return z(()=>new R(`Cannot send 'RUN_FINISHED' while subagents are still active: ${e}`))}return c=!0,fd(e);case L.RUN_ERROR:return l=!0,fd(e);case L.CUSTOM:return fd(e);default:return fd(e)}}))},NO=function(e){return e.HEADERS=`headers`,e.DATA=`data`,e}({}),PO=e=>bd(()=>dd(e())).pipe(Od(e=>{if(!e.ok){let t=e.headers.get(`content-type`)||``;return dd(e.text()).pipe(_d(n=>{let r=n;if(t.includes(`application/json`))try{r=JSON.parse(n)}catch{}let i=Error(`HTTP ${e.status}: ${typeof r==`string`?r:JSON.stringify(r)}`);return i.status=e.status,i.payload=r,z(()=>i)}))}let t={type:NO.HEADERS,status:e.status,headers:e.headers},n=e.body?.getReader();return n?new bu(e=>{let r=!1;return e.next(t),(async()=>{try{for(;!e.closed;){let{done:t,value:i}=await n.read();if(t){r=!0;break}let a={type:NO.DATA,data:i};e.next(a)}e.complete()}catch(t){r=!0,e.error(t)}})(),()=>{r||n.cancel().catch(e=>{e?.name!==`AbortError`&&console.warn(`Failed to cancel HTTP response stream:`,e)})}}):z(()=>Error(`Failed to getReader() from response`))})),FO=10485760,IO=(e,t)=>{let n=TO(t),r=new ku,i=new TextDecoder(`utf-8`,{fatal:!1}),a=``;e.subscribe({next:e=>{if(e.type!==NO.HEADERS&&e.type===NO.DATA&&e.data){let t=i.decode(e.data,{stream:!0});a+=t;let n=a.split(/\n\n/);a=n.pop()||``;for(let e of n)o(e);if(a.length>FO){r.error(Error(`SSE buffer size exceeded maximum limit of ${FO/1048576} MB`));return}}},error:e=>r.error(e),complete:()=>{a&&(a+=i.decode(),o(a)),r.complete()}});function o(e){let t=e.split(` +`),i=[];for(let e of t)e.startsWith(`data:`)&&i.push(e.slice(5).replace(/^ /,``));if(i.length>0)try{let e=i.join(` +`),t=JSON.parse(e);n?.event(`SSE`,`Event received:`,t,{type:t?.type}),r.next(t)}catch(e){r.error(e)}}return r.asObservable()},LO=10485760,RO=()=>typeof process<`u`&&!!{}.SUPPRESS_TRANSFORMATION_WARNINGS,zO=(e,t)=>{let n=TO(t),r=new ku,i=new Uint8Array,a=!1;e.subscribe({next:e=>{if(e.type!==NO.HEADERS&&e.type===NO.DATA&&e.data){let t=new Uint8Array(i.length+e.data.length);t.set(i,0),t.set(e.data,i.length),i=t,o()}},error:e=>r.error(e),complete:()=>{if(o(),!a){if(i.length>0){r.error(Error(`The binary stream ended mid-frame: ${i.length} trailing bytes could not be read as a complete message.`));return}r.complete()}}});function o(){if(!a)for(;i.length>=4;){let e=4+new DataView(i.buffer,i.byteOffset,4).getUint32(0,!1);if(e>LO){r.error(Error(`Protobuf message size exceeded maximum limit of ${LO/1048576} MB`));return}if(i.length{let n=TO(t),r=new ku,i=new Mu(1),a=!1,o,s=!1,c=()=>{s=!0,o?.unsubscribe()},l=e=>{c(),r.error(e)},u=()=>{c(),r.complete()};return o=e.subscribe({next:e=>{if(i.next(e),e.type===NO.HEADERS&&!a){a=!0;let t=e.headers.get(`content-type`);n?.lifecycle(`HTTP`,`Stream format detected:`,{contentType:t,parser:t===`application/vnd.ag-ui.event+proto`?`protobuf`:`sse`}),t===`application/vnd.ag-ui.event+proto`?zO(i,n).subscribe({next:e=>r.next(e),error:e=>l(e),complete:()=>u()}):IO(i,n).subscribe({next:e=>{if(typeof e!=`object`||!e||Array.isArray(e)){let t=Error(`Invalid event: the frame is not a JSON object.`);n?.event(`HTTP`,`Event invalid:`,{json:e,error:String(t)}),l(t);return}let t=e;if(typeof t.type!=`string`||t.type.length===0){let t=Error(`Invalid event: the frame carries no event type.`);n?.event(`HTTP`,`Event invalid:`,{json:e,error:String(t)}),l(t);return}n?.event(`HTTP`,`Event received:`,e,{type:t.type}),r.next(e)},error:e=>{if(e?.name===`AbortError`){r.next({type:L.RUN_ERROR,message:e.message||`Request aborted`,code:`abort`,rawEvent:e}),u();return}return l(e)},complete:()=>u()})}else a||l(Error(`No headers event received before data events`))},error:e=>{i.error(e),l(e)},complete:()=>{i.complete()}}),s&&o.unsubscribe(),r.asObservable()},VO={TextMessageStart:`TextMessageStart`,TextMessageContent:`TextMessageContent`,TextMessageEnd:`TextMessageEnd`,ActionExecutionStart:`ActionExecutionStart`,ActionExecutionArgs:`ActionExecutionArgs`,ActionExecutionEnd:`ActionExecutionEnd`,ActionExecutionResult:`ActionExecutionResult`,AgentStateMessage:`AgentStateMessage`,MetaEvent:`MetaEvent`,RunStarted:`RunStarted`,RunFinished:`RunFinished`,RunError:`RunError`,NodeStarted:`NodeStarted`,NodeFinished:`NodeFinished`},HO=e=>{if(typeof e==`string`)return e;if(!Array.isArray(e))return;let t=e.filter(e=>e.type===`text`).map(e=>e.text).filter(e=>e.length>0);if(t.length!==0)return t.join(` +`)};function UO(e,t){return Yc(t)&&WO(`[ag-ui][legacy] The result of tool call '${e}' carries content parts the legacy protocol cannot represent; only its text parts are bridged and the rest is dropped.`),Jc(t)}var WO=e=>{typeof process<`u`&&{}.SUPPRESS_TRANSFORMATION_WARNINGS||console.warn(e)},GO=(e,t,n)=>r=>{let i={},a=!0,o=!0,s=``,c=null,l=null,u=[],d={},f=!1,p=e=>{typeof e==`object`&&e&&(`messages`in e&&delete e.messages,i=e)};return r.pipe(_d(r=>{switch(r.type){case L.TEXT_MESSAGE_START:{let e=r;return[{type:VO.TextMessageStart,messageId:e.messageId,role:e.role}]}case L.TEXT_MESSAGE_CONTENT:{let e=r;return[{type:VO.TextMessageContent,messageId:e.messageId,content:e.delta}]}case L.TEXT_MESSAGE_END:{let e=r;return[{type:VO.TextMessageEnd,messageId:e.messageId}]}case L.TOOL_CALL_START:{let e=r;return u.push({id:e.toolCallId,type:`function`,function:{name:e.toolCallName,arguments:``}}),o=!0,d[e.toolCallId]=e.toolCallName,[{type:VO.ActionExecutionStart,actionExecutionId:e.toolCallId,actionName:e.toolCallName,parentMessageId:e.parentMessageId}]}case L.TOOL_CALL_ARGS:{let c=r,d=u.find(e=>e.id===c.toolCallId);if(!d)return WO(`[ag-ui][legacy] TOOL_CALL_ARGS: No tool call found with ID '${c.toolCallId}'`),[];d.function.arguments+=c.delta;let f=!1;if(l){let e=l.find(e=>e.tool==d.function.name);if(e)try{let t=JSON.parse(Md(d.function.arguments));e.tool_argument&&e.tool_argument in t?(p({...i,[e.state_key]:t[e.tool_argument]}),f=!0):e.tool_argument||(p({...i,[e.state_key]:t}),f=!0)}catch{}}return[{type:VO.ActionExecutionArgs,actionExecutionId:c.toolCallId,args:c.delta},...f?[{type:VO.AgentStateMessage,threadId:e,agentName:n,nodeName:s,runId:t,running:a,role:`assistant`,state:JSON.stringify(i),active:o}]:[]]}case L.TOOL_CALL_END:{let e=r;return[{type:VO.ActionExecutionEnd,actionExecutionId:e.toolCallId}]}case L.TOOL_CALL_RESULT:{let e=r,t=d[e.toolCallId];return(t===void 0||t===``)&&WO(`[ag-ui][legacy] No usable tool name was seen for tool call '${e.toolCallId}' (${t===void 0?`no TOOL_CALL_START reached this bridge`:`its TOOL_CALL_START carried an empty toolCallName`}), so its result is being bridged with the fabricated action name "unknown". Downstream consumers route on that name.`),[{type:VO.ActionExecutionResult,actionExecutionId:e.toolCallId,result:UO(e.toolCallId,e.content),actionName:t||`unknown`}]}case L.RAW:return f||(f=!0,WO(`[ag-ui][legacy] Dropping RAW events: the legacy runtime protocol has no equivalent, so the provider payloads they carry do not reach the legacy stream. Reported once per stream.`)),[];case L.CUSTOM:{let e=r;switch(e.name){case`Exit`:a=!1;break;case`PredictState`:l=e.value}return[{type:VO.MetaEvent,name:e.name,value:e.value}]}case L.STATE_SNAPSHOT:return p(r.snapshot),[{type:VO.AgentStateMessage,threadId:e,agentName:n,nodeName:s,runId:t,running:a,role:`assistant`,state:JSON.stringify(i),active:o}];case L.STATE_DELTA:{let c=r,l;try{l=jl.applyPatch(i,c.delta,!0,!1).newDocument}catch(e){let t=e instanceof Error?e.message:String(e);return WO(`[ag-ui][legacy] Failed to apply state patch:\nCurrent state: ${JSON.stringify(i,null,2)}\nPatch operations: ${JSON.stringify(c.delta,null,2)}\nError: ${t}`),[]}return p(l),[{type:VO.AgentStateMessage,threadId:e,agentName:n,nodeName:s,runId:t,running:a,role:`assistant`,state:JSON.stringify(i),active:o}]}case L.MESSAGES_SNAPSHOT:return c=r.messages,[{type:VO.AgentStateMessage,threadId:e,agentName:n,nodeName:s,runId:t,running:a,role:`assistant`,state:JSON.stringify({...i,...c?{messages:c}:{}}),active:!0}];case L.RUN_STARTED:return[];case L.RUN_FINISHED:{if(c&&(i.messages=c),Object.keys(i).length===0)return[];let r=null;if(c)try{r=KO(c)}catch(e){return[{type:VO.RunError,message:e.message}]}return[{type:VO.AgentStateMessage,threadId:e,agentName:n,nodeName:s,runId:t,running:a,role:`assistant`,state:JSON.stringify({...i,...r?{messages:r}:{}}),active:!1}]}case L.RUN_ERROR:{let e=r;return[{type:VO.RunError,message:e.message,code:e.code}]}case L.STEP_STARTED:return s=r.stepName,u=[],l=null,[{type:VO.AgentStateMessage,threadId:e,agentName:n,nodeName:s,runId:t,running:a,role:`assistant`,state:JSON.stringify(i),active:!0}];case L.STEP_FINISHED:return u=[],l=null,[{type:VO.AgentStateMessage,threadId:e,agentName:n,nodeName:s,runId:t,running:a,role:`assistant`,state:JSON.stringify(i),active:!1}];default:return[]}}))};function KO(e){let t=[];for(let n of e)if(n.role===`assistant`||n.role===`user`||n.role===`system`){let e=HO(n.content);if(e){let r={id:n.id,role:n.role,content:e};t.push(r)}if(n.role===`assistant`&&n.toolCalls&&n.toolCalls.length>0)for(let e of n.toolCalls){let r;try{r=JSON.parse(e.function.arguments)}catch(t){throw Error(`Failed to parse arguments for tool call '${e.id}' (${e.function.name}): ${t.message}`)}let i={id:e.id,name:e.function.name,arguments:r,parentMessageId:n.id};t.push(i)}}else if(n.role===`tool`){let r=`unknown`;for(let t of e)if(t.role===`assistant`&&t.toolCalls?.length){for(let e of t.toolCalls)if(e.id===n.toolCallId){r=e.function.name;break}}let i={id:n.id,result:UO(n.toolCallId,n.content),actionExecutionId:n.toolCallId,actionName:r};t.push(i)}return t}var qO=e=>e.kind===`tool`?e.fields.toolCallId:e.fields.messageId,JO=e=>e===`tool`?`toolCallId`:`messageId`,YO=(e,t,n,r,i)=>{if(r!==void 0&&r!==i)throw Error(`Cannot continue ${e} '${t}': chunk ${n} '${r}' does not match the open stream's ${n} ${i===void 0?`(absent)`:`'${i}'`}.`)},XO=(e,t)=>t.metadata===void 0?e:{...e,metadata:t.metadata},ZO=(e,t)=>{let n=XO(e,t);return t.rawEvent===void 0?n:{...n,rawEvent:t.rawEvent}},QO=e=>new Set(Object.keys(e.shape)),$O=QO(px),ek=QO(_x),tk=QO(eS),nk=(e,t)=>{let n;for(let r of Object.keys(e))t.has(r)||((n??={})[r]=e[r]);return n},rk=e=>{typeof process<`u`&&{}.SUPPRESS_TRANSFORMATION_WARNINGS||console.warn(`[ag-ui][transform] ${e} Set SUPPRESS_TRANSFORMATION_WARNINGS=true to silence.`)},ik=(e,t,n,r)=>{if(t===void 0||n||e.length===0)return;let i=e[e.length-1],a=Object.keys(t).filter(e=>Object.prototype.hasOwnProperty.call(i,e));a.length>0&&rk(`A ${r} carried ${a.map(e=>`'${e}'`).join(`, `)}, which the synthesized ${String(i.type)} already describes. The synthesized value is kept and the chunk's is dropped — this stage does not judge a described field, so the producer's value cannot be substituted for its own.`),e[e.length-1]={...t,...i}},ak=e=>t=>{let n=TO(e),r=new Map,i=e=>{let t=r.get(e);if(!t)return[];switch(r.delete(e),t.kind){case`text`:{let e={type:L.TEXT_MESSAGE_END,messageId:t.fields.messageId,...t.fields.subagentRunId!==void 0&&{subagentRunId:t.fields.subagentRunId}};return n?.event(`TRANSFORM`,`TEXT_MESSAGE_END`,e,{messageId:e.messageId}),[e]}case`tool`:{let e={type:L.TOOL_CALL_END,toolCallId:t.fields.toolCallId,...t.fields.subagentRunId!==void 0&&{subagentRunId:t.fields.subagentRunId}};return n?.event(`TRANSFORM`,`TOOL_CALL_END`,e,{toolCallId:e.toolCallId}),[e]}case`reasoning`:{let e={type:L.REASONING_MESSAGE_END,messageId:t.fields.messageId,...t.fields.subagentRunId!==void 0&&{subagentRunId:t.fields.subagentRunId}};return n?.event(`TRANSFORM`,`REASONING_MESSAGE_END`,e,{messageId:e.messageId}),[e]}}},a=()=>[...r.keys()].flatMap(e=>i(e)),o=(e,t)=>{for(let[n,i]of r)if(i.kind===e&&qO(i)===t)return{owner:n}},s=(e,t,n,i,a)=>{if(t!==void 0){let r=o(e,t);if(r){if(n!==void 0&&n!==r.owner)throw Error(`Cannot continue ${a} '${t}': chunk subagentRunId '${n}' does not match the open stream's subagent '${r.owner??`(the parent agent)`}'.`);return r.owner}return n}if(n!==void 0)return n;if(r.get(void 0)?.kind===e)return;let s=[...r.entries()].filter(([,t])=>t.kind===e);if(s.length===1)return s[0][0];if(s.length>1)throw Error(`Ambiguous ${i}: it carries neither a ${JO(e)} nor a subagentRunId, but ${s.length} lanes have an open ${a}. Attribute the chunk to the subagent it belongs to.`)};return t.pipe(_d(e=>{switch(e.type){case L.TEXT_MESSAGE_START:case L.TEXT_MESSAGE_CONTENT:case L.TEXT_MESSAGE_END:case L.TOOL_CALL_START:case L.TOOL_CALL_ARGS:case L.TOOL_CALL_END:case L.TOOL_CALL_RESULT:case L.STATE_SNAPSHOT:case L.STATE_DELTA:case L.CUSTOM:case L.STEP_STARTED:case L.STEP_FINISHED:case L.REASONING_START:case L.REASONING_MESSAGE_START:case L.REASONING_MESSAGE_CONTENT:case L.REASONING_MESSAGE_END:case L.REASONING_END:return[...i(e.subagentRunId??void 0),e];case L.RUN_STARTED:case L.RUN_FINISHED:case L.RUN_ERROR:case L.MESSAGES_SNAPSHOT:return[...a(),e];case L.RAW:case L.ACTIVITY_SNAPSHOT:case L.ACTIVITY_DELTA:case L.REASONING_ENCRYPTED_VALUE:case L.SUBAGENT_STARTED:return[e];case L.SUBAGENT_FINISHED:case L.SUBAGENT_ERROR:{let t=e.subagentRunId;return t==null?[e]:[...i(t),e]}case L.TEXT_MESSAGE_CHUNK:{let t=e,a=nk(e,$O),o=s(`text`,t.messageId,t.subagentRunId??void 0,`TEXT_MESSAGE_CHUNK`,`text message`),c=r.get(o),l=[],u=!1,d;if(c?.kind===`text`&&(t.messageId===void 0||t.messageId===c.fields.messageId))YO(`text message`,c.fields.messageId,`role`,t.role,c.fields.role),YO(`text message`,c.fields.messageId,`name`,t.name,c.fields.name),d=c.fields;else{if(l.push(...i(o)),t.messageId===void 0)throw Error(`First TEXT_MESSAGE_CHUNK must have a messageId`);d={messageId:t.messageId,role:t.role===void 0?`assistant`:t.role,name:t.name,subagentRunId:t.subagentRunId},r.set(o,{kind:`text`,fields:d});let e=XO({type:L.TEXT_MESSAGE_START,messageId:t.messageId,role:d.role,...t.name!==void 0&&{name:t.name},...t.subagentRunId!==void 0&&{subagentRunId:t.subagentRunId}},t);l.push(e),n?.event(`TRANSFORM`,`TEXT_MESSAGE_START`,e,{messageId:t.messageId})}if(t.delta!==void 0||t.rawEvent!==void 0){let e=t.subagentRunId===void 0?d.subagentRunId:t.subagentRunId,r=ZO({...a,type:L.TEXT_MESSAGE_CONTENT,messageId:d.messageId,delta:t.delta===void 0?``:t.delta,...e!==void 0&&{subagentRunId:e}},t);l.push(r),u=!0,n?.event(`TRANSFORM`,`TEXT_MESSAGE_CONTENT`,r,{messageId:d.messageId})}if(l.length===0&&(t.metadata!==void 0||t.rawEvent!==void 0||t.subagentRunId===null||a!==void 0)){let e=t.subagentRunId===void 0?d.subagentRunId:t.subagentRunId;l.push({...a,type:L.TEXT_MESSAGE_CONTENT,messageId:d.messageId,delta:``,...t.metadata!==void 0&&{metadata:t.metadata},...t.rawEvent!==void 0&&{rawEvent:t.rawEvent},...e!==void 0&&{subagentRunId:e}}),u=!0}return ik(l,a,u,`TEXT_MESSAGE_CHUNK`),l}case L.TOOL_CALL_CHUNK:{let t=e,a=nk(e,ek),o=s(`tool`,t.toolCallId,t.subagentRunId??void 0,`TOOL_CALL_CHUNK`,`tool call`),c=r.get(o),l=[],u=!1,d;if(c?.kind===`tool`&&(t.toolCallId===void 0||t.toolCallId===c.fields.toolCallId))YO(`tool call`,c.fields.toolCallId,`toolCallName`,t.toolCallName,c.fields.toolCallName),YO(`tool call`,c.fields.toolCallId,`parentMessageId`,t.parentMessageId,c.fields.parentMessageId),d=c.fields;else{if(l.push(...i(o)),t.toolCallId===void 0)throw Error(`First TOOL_CALL_CHUNK must have a toolCallId`);if(t.toolCallName===void 0)throw Error(`First TOOL_CALL_CHUNK must have a toolCallName`);d={toolCallId:t.toolCallId,toolCallName:t.toolCallName,parentMessageId:t.parentMessageId,subagentRunId:t.subagentRunId},r.set(o,{kind:`tool`,fields:d});let e=XO({type:L.TOOL_CALL_START,toolCallId:t.toolCallId,toolCallName:t.toolCallName,...t.parentMessageId!==void 0&&{parentMessageId:t.parentMessageId},...t.subagentRunId!==void 0&&{subagentRunId:t.subagentRunId}},t);l.push(e),n?.event(`TRANSFORM`,`TOOL_CALL_START`,e,{toolCallId:t.toolCallId,toolCallName:t.toolCallName})}if(t.delta!==void 0||t.rawEvent!==void 0){let e=t.subagentRunId===void 0?d.subagentRunId:t.subagentRunId,r=ZO({...a,type:L.TOOL_CALL_ARGS,toolCallId:d.toolCallId,delta:t.delta===void 0?``:t.delta,...e!==void 0&&{subagentRunId:e}},t);l.push(r),u=!0,n?.event(`TRANSFORM`,`TOOL_CALL_ARGS`,r,{toolCallId:d.toolCallId})}if(l.length===0&&(t.metadata!==void 0||t.rawEvent!==void 0||t.subagentRunId===null||a!==void 0)){let e=t.subagentRunId===void 0?d.subagentRunId:t.subagentRunId;l.push({...a,type:L.TOOL_CALL_ARGS,toolCallId:d.toolCallId,delta:``,...t.metadata!==void 0&&{metadata:t.metadata},...t.rawEvent!==void 0&&{rawEvent:t.rawEvent},...e!==void 0&&{subagentRunId:e}}),u=!0}return ik(l,a,u,`TOOL_CALL_CHUNK`),l}case L.REASONING_MESSAGE_CHUNK:{let t=e,a=nk(e,tk),o=s(`reasoning`,t.messageId,t.subagentRunId??void 0,`REASONING_MESSAGE_CHUNK`,`reasoning message`),c=r.get(o),l=[],u=!1,d;if(c?.kind===`reasoning`&&(t.messageId===void 0||t.messageId===c.fields.messageId))d=c.fields;else{if(l.push(...i(o)),t.messageId===void 0)throw Error(`First REASONING_MESSAGE_CHUNK must have a messageId`);d={messageId:t.messageId,subagentRunId:t.subagentRunId},r.set(o,{kind:`reasoning`,fields:d});let e=XO({type:L.REASONING_MESSAGE_START,messageId:t.messageId,role:`reasoning`,...t.subagentRunId!==void 0&&{subagentRunId:t.subagentRunId}},t);l.push(e),n?.event(`TRANSFORM`,`REASONING_MESSAGE_START`,e,{messageId:t.messageId})}if(t.delta!==void 0||t.rawEvent!==void 0){let e=t.subagentRunId===void 0?d.subagentRunId:t.subagentRunId,r=ZO({...a,type:L.REASONING_MESSAGE_CONTENT,messageId:d.messageId,delta:t.delta===void 0?``:t.delta,...e!==void 0&&{subagentRunId:e}},t);l.push(r),u=!0,n?.event(`TRANSFORM`,`REASONING_MESSAGE_CONTENT`,r,{messageId:d.messageId})}if(l.length===0&&(t.metadata!==void 0||t.rawEvent!==void 0||t.subagentRunId===null||a!==void 0)){let e=t.subagentRunId===void 0?d.subagentRunId:t.subagentRunId;l.push({...a,type:L.REASONING_MESSAGE_CONTENT,messageId:d.messageId,delta:``,...t.metadata!==void 0&&{metadata:t.metadata},...t.rawEvent!==void 0&&{rawEvent:t.rawEvent},...e!==void 0&&{subagentRunId:e}}),u=!0}return ik(l,a,u,`REASONING_MESSAGE_CHUNK`),l}}return e.type,[e]}),Dd(()=>{a()}))},ok=Symbol(`agui.strip.drop`);function sk(e){let t=e;for(;;){if(t instanceof JD||t instanceof XD||t instanceof QD||t instanceof cO||t instanceof iO){t=t.unwrap();continue}if(t instanceof oO){t=t.def.in;continue}if(t instanceof uO){t=t.def.getter();continue}return t}}function ck(e){let t=e.def;return typeof t?.discriminator==`string`?t.discriminator:void 0}function lk(e){let t=e,n=Array.isArray(t.def?.values)?t.def.values:t.values?Array.from(t.values):void 0;return n&&n.length===1?n[0]:t.value}function uk(e){let t=sk(e);return t instanceof GD?lk(t):void 0}function dk(e,t,n,r){let i=sk(t);if(i instanceof LD){if(typeof e!=`object`||!e||Array.isArray(e))return e;let t=i.shape,a=e,o={},s=i.meta()?.specOpen===!0;for(let e of Object.keys(a)){let i=Object.prototype.hasOwnProperty.call(t,e)?t[e]:void 0;if(i===void 0){if(s){o[e]=a[e];continue}r.push(`${n}/${e}`);continue}let c=r.length,l=dk(a[e],i,`${n}/${e}`,r);if(l===ok){if(r.length=c,i.safeParse(void 0).success){r.push(`${n}/${e}`);continue}return ok}o[e]=l}return o}if(i instanceof FD){if(!Array.isArray(e))return e;let t=i.element,a=[];return e.forEach((e,i)=>{let o=r.length,s=dk(e,t,`${n}/${i}`,r);if(s===ok){r.length=o,r.push(`${n}/${i}`);return}a.push(s)}),a}if(i instanceof HD){if(typeof e!=`object`||!e||Array.isArray(e))return e;let t=i.def.valueType,a=e,o={};for(let e of Object.keys(a)){let i=r.length,s=dk(a[e],t,`${n}/${e}`,r);if(s===ok){r.length=i,r.push(`${n}/${e}`);continue}o[e]=s}return o}if(i instanceof RD){let t=i.options,a=ck(i);if(a!==void 0){if(typeof e!=`object`||!e||Array.isArray(e))return e;let i=e[a];for(let o of t){let t=sk(o);if(!(t instanceof LD))continue;let s=t.shape;if(uk(s[a])===i)return dk(e,o,n,r)}return ok}let o=t.filter(e=>sk(e)instanceof LD),s=typeof e==`object`&&!!e&&!Array.isArray(e);if(o.length>1&&s)return e;for(let i of t){let t=sk(i);if(t instanceof FD&&Array.isArray(e)||t instanceof LD&&s)return dk(e,i,n,r)}return e}return e}function fk(e,t){let n=[],r=dk(e,t,``,n);if(r===ok)throw Error(`Internal error: the stripper found the whole value unrecognisable, which the schemas are not supposed to allow — schema/stripper mismatch.`);return{value:r,stripped:n}}var pk=new Set(Object.values(L));function mk(e){return pk.has(e.type)}var hk=new Map(oS.options.map(e=>{let t=e.shape;return[String(lk(t.type)),e]})),gk=()=>typeof process<`u`&&!!{}.SUPPRESS_TRANSFORMATION_WARNINGS;function _k(e){gk()||console.warn(`[ag-ui][enforce] ${e}`)}var vk=e=>t=>{let n=TO(e);return t.pipe(_d(e=>{if(!mk(e))return _k(`Dropping unrecognised event '${String(e.type)}': no middleware translated it and the protocol does not describe it.`),n?.event(`ENFORCE`,`Unrecognised event dropped:`,e,{type:e.type}),Nu;let t=hk.get(e.type);if(t===void 0)throw Error(`No validator for recognised event type '${String(e.type)}'`);let{value:r,stripped:i}=fk(e,t);for(let t of i)_k(`Removed unrecognised material at '${t}' on ${String(e.type)}. Nothing handled it; see the repo-root DEPRECATIONS.md if it is a retired shape.`);return fd(t.parse(r))}))};function yk(e){let{value:t,stripped:n}=fk(Gc(e,`RunAgentInput`),Bx);for(let e of n)_k(`Removed unrecognised material at '${e}' from the outgoing input.`);return Bx.parse(t)}var bk=class{runNext(e,t){return t.run(e).pipe(ak(!1))}runNextWithState(e,t){let n=_O(e.messages||[]),r=_O(e.state===void 0?{}:e.state),i=new Mu;return AO(e,i,t,[]).subscribe({next:e=>{e.messages!==void 0&&(n=e.messages),e.state!==void 0&&(r=e.state)},error:()=>{}}),this.runNext(e,t).pipe(Cd(async e=>(i.next(e),await new Promise(e=>setTimeout(e,0)),{event:e,messages:_O(n),state:_O(r)})))}},xk=class extends bk{constructor(e){super(),this.fn=e}run(e,t){return this.fn(e,t)}};function Sk(e){return e.startsWith(`image/`)?`image`:e.startsWith(`audio/`)?`audio`:e.startsWith(`video/`)?`video`:`document`}function Ck(e){return typeof e==`object`&&!!e&&`type`in e&&e.type===`binary`&&`mimeType`in e&&typeof e.mimeType==`string`}function wk(e){let t=Sk(e.mimeType);return e.data?{type:t,source:{type:`data`,value:e.data,mimeType:e.mimeType},...e.filename?{metadata:{filename:e.filename}}:{}}:e.url?{type:t,source:{type:`url`,value:e.url,mimeType:e.mimeType},...e.filename?{metadata:{filename:e.filename}}:{}}:((typeof process>`u`||!{}.SUPPRESS_TRANSFORMATION_WARNINGS)&&console.warn(`[ag-ui][compat] A binary content part carries only an id ('${e.id??``}') and cannot be converted to a modern media part; a 1.0 peer will not accept it. Provide data or a url. See the repo-root DEPRECATIONS.md.`),e)}function Tk(e,t,n){if(typeof e!=`object`||!e||!(`type`in e)||e.type!==t.type||!(`source`in e))return!1;let r=e.source;return typeof r!=`object`||!r||!(`type`in r)||r.type!==t.source.type||!(`value`in r)||r.value!==t.source.value||!(`mimeType`in r)||r.mimeType!==t.source.mimeType?!1:!n||`metadata`in e&&typeof e.metadata==`object`&&e.metadata!==null&&`filename`in e.metadata&&e.metadata.filename===n}function Ek(e){let t=e.content;if(!Array.isArray(t))return e;let n=t.flatMap(e=>{if(Ck(e)){let n=wk(e);return n.type!==`binary`&&t.some(t=>Tk(t,n,e.filename))?[]:[n]}return[e]});return{...e,content:n}}var Dk=`THINKING_START`,Ok=`THINKING_END`,kk=`THINKING_TEXT_MESSAGE_START`,Ak=`THINKING_TEXT_MESSAGE_CONTENT`,jk=`THINKING_TEXT_MESSAGE_END`;function Mk(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}var Nk={event:[`rawEvent`,`subagentRunId`],[L.RUN_STARTED]:[`parentRunId`,`input`],[L.RUN_FINISHED]:[`result`,`outcome`],[L.RUN_ERROR]:[`usage`],[L.SUBAGENT_FINISHED]:[`result`],[L.TOOL_CALL_START]:[`parentMessageId`],[L.TOOL_CALL_CHUNK]:[`parentMessageId`],[L.TOOL_CALL_RESULT]:[`role`],"RUN_FINISHED.outcome":[`pendingToolCallIds`],"RUN_FINISHED.usage[]":[`provider`,`reasoningTokens`,`cachedInputTokens`,`cacheWriteInputTokens`],RunAgentInput:[`forwardedProps`],Tool:[`parameters`],ResumeEntry:[`payload`],"input content":[`metadata`]},Pk=new Map(Object.entries(Nk).filter(([e])=>Object.values(L).includes(e))),Fk=e=>jO(e,`an absent field`);function Ik(e,t,n,r){if(!Mk(e))return e;let i;for(let a of t)e[a]===null&&(r(n===void 0?`${a}: null`:`${n}.${a}: null`),i??={...e},delete i[a]);return i??e}function Lk(e,t,n){if(!Mk(e)||!Array.isArray(e[t]))return e;let r=e[t],i=r.map(n);return i.some((e,t)=>e!==r[t])?{...e,[t]:i}:e}function Rk(e,t){return Lk(e,`content`,e=>{if(!Mk(e))return e;switch(e.type){case`image`:case`audio`:case`video`:case`document`:return Ik(e,Nk[`input content`],`${e.type} input content`,t);default:return e}})}function zk(e,t=Fk){let n=Ik(e,Nk.RunAgentInput,`RunAgentInput`,t);return n=Lk(n,`tools`,e=>Ik(e,Nk.Tool,`Tool`,t)),n=Lk(n,`resume`,e=>Ik(e,Nk.ResumeEntry,`ResumeEntry`,t)),Lk(n,`messages`,e=>Rk(e,t))}var Bk=class extends bk{constructor(...e){super(...e),this.currentReasoningId=null,this.currentMessageId=null,this.nullsNoticedThisRun=new Set,this.noticeNullOncePerRun=e=>{this.nullsNoticedThisRun.has(e)||(this.nullsNoticedThisRun.add(e),jO(e,`an absent field`))}}warn(e,t){jO(e,t)}mintedContinuationId(e,t){if(t!==null)return t;let n=vO();return this.warnAside(`Minting a messageId ('${n}') for ${e}: no THINKING opener preceded it, so there was no id to continue. The id is this client's invention, not the producer's, and verification will reject the translated event for naming something nothing opened.`),n}warnAside(e){typeof process<`u`&&{}.SUPPRESS_TRANSFORMATION_WARNINGS||console.warn(`[ag-ui][compat] ${e} Set SUPPRESS_TRANSFORMATION_WARNINGS=true to silence.`)}run(e,t){return this.currentReasoningId=null,this.currentMessageId=null,this.nullsNoticedThisRun.clear(),e.messages=e.messages.map(Ek),t.run(e).pipe(hd(e=>this.transformEvent(e)))}transformEvent(e){let t=this.noticeNullOncePerRun;e.type===L.RUN_STARTED&&this.nullsNoticedThisRun.clear(),e=Ik(e,Nk.event,void 0,t);let n=Pk.get(e.type);switch(n&&(e=Ik(e,n,e.type,t)),e.type){case Dk:{this.currentReasoningId=vO();let{title:t,...n}=e;return this.warn(Dk,L.REASONING_START),t!==void 0&&this.warnAside(`Dropping ${Dk}.title ${JSON.stringify(t)}: ${L.REASONING_START} has no title field, so the span's label cannot be carried and nothing downstream can recover it.`),{...n,type:L.REASONING_START,messageId:this.currentReasoningId}}case kk:return this.currentMessageId=vO(),this.warn(kk,L.REASONING_MESSAGE_START),{...e,type:L.REASONING_MESSAGE_START,messageId:this.currentMessageId,role:`reasoning`};case Ak:{let{delta:t,...n}=e;return this.warn(Ak,L.REASONING_MESSAGE_CONTENT),{...n,type:L.REASONING_MESSAGE_CONTENT,messageId:this.mintedContinuationId(Ak,this.currentMessageId),delta:t}}case jk:{let t=this.mintedContinuationId(jk,this.currentMessageId);return this.currentMessageId=null,this.warn(jk,L.REASONING_MESSAGE_END),{...e,type:L.REASONING_MESSAGE_END,messageId:t}}case Ok:{let t=this.mintedContinuationId(Ok,this.currentReasoningId);return this.currentReasoningId=null,this.warn(Ok,L.REASONING_END),{...e,type:L.REASONING_END,messageId:t}}case L.RUN_FINISHED:{let n=e,r=Ik(n.outcome,Nk[`RUN_FINISHED.outcome`],`RUN_FINISHED.outcome`,t);return Lk(r===n.outcome?n:{...n,outcome:r},`usage`,e=>Ik(e,Nk[`RUN_FINISHED.usage[]`],`RUN_FINISHED.usage[]`,t))}case L.MESSAGES_SNAPSHOT:{let t=e;return Array.isArray(t.messages)?{...t,messages:t.messages.map(e=>this.upgradeInboundMessage(e))}:e}case L.RUN_STARTED:{let n=zk(e.input,t),r=n===e.input?e:{...e,input:n},i=r;return!i.input||!Array.isArray(i.input.messages)?r:{...i,input:{...i.input,messages:i.input.messages.map(e=>this.upgradeInboundMessage(e))}}}default:return e}}upgradeInboundMessage(e){e=Rk(e,this.noticeNullOncePerRun);let t=e.content;return!Array.isArray(t)||!t.some(e=>typeof e==`object`&&!!e&&e.type===`binary`)?e:(this.warn(`binary input content`,`the modern media content parts`),Ek(e))}},Vk=()=>e=>bd(()=>{let t=new Bk;return e.pipe(hd(e=>t.transformEvent(e)))});function Hk(e,t=new Date){return e.expiresAt!==void 0&&new Date(e.expiresAt)<=t}function Uk(){return typeof process<`u`&&!!{}.SUPPRESS_TRANSFORMATION_WARNINGS}function Wk(e){Uk()||console.warn(`[ag-ui][compat] Flattening message content for a <=0.0.39 peer DROPS non-text parts (${e.join(`, `)}). The peer cannot receive them; upgrade it to keep media content. See the repo-root DEPRECATIONS.md.`)}function Gk(e){Uk()||console.warn(`[ag-ui][compat] Not flattening message content for a <=0.0.39 peer: ${e} content part(s) claim type "text" but carry a malformed 'text' value. That is a defect in the message, not media the peer cannot represent, and a downgrade must not repair it — the content is passed on unchanged so the outgoing enforcement boundary reports it. See the repo-root DEPRECATIONS.md.`)}function Kk(e){let t=e.content;if(Array.isArray(t)){let n=e=>typeof e==`object`&&!!e&&`type`in e&&e.type===`text`,r=e=>n(e)&&typeof e.text==`string`,i=t.filter(e=>n(e)&&!r(e));if(i.length>0)return Gk(i.length),e;let a=t.filter(e=>!r(e)).map(e=>typeof e==`object`&&e&&`type`in e?String(e.type):typeof e);a.length>0&&Wk(a);let o=t.filter(r).map(e=>e.text).join(``);return{...e,content:o}}return typeof t==`string`?e:t===void 0?{...e,content:``}:e}var qk=class extends bk{run(e,t){let{parentRunId:n,...r}=e,i={...r,messages:r.messages.map(Kk)};return this.runNext(i,t)}},Jk=`THINKING_START`,Yk=`THINKING_END`,Xk=`THINKING_TEXT_MESSAGE_START`,Zk=`THINKING_TEXT_MESSAGE_CONTENT`,Qk=`THINKING_TEXT_MESSAGE_END`,$k=class extends bk{constructor(...e){super(...e),this.currentReasoningId=null,this.currentMessageId=null}warnAboutTransformation(e,t){typeof process<`u`&&{}.SUPPRESS_TRANSFORMATION_WARNINGS||console.warn(`AG-UI is converting ${e} to ${t}. To remove this warning, upgrade your AG-UI integration package (e.g. @ag-ui/langgraph). To surpress it, set SUPPRESS_TRANSFORMATION_WARNINGS=true in your .env file.`)}run(e,t){return this.currentReasoningId=null,this.currentMessageId=null,this.runNext(e,t).pipe(hd(e=>this.transformEvent(e)))}transformEvent(e){switch(e.type){case Jk:{this.currentReasoningId=vO();let{title:t,...n}=e;return this.warnAboutTransformation(Jk,L.REASONING_START),{...n,type:L.REASONING_START,messageId:this.currentReasoningId}}case Xk:return this.currentMessageId=vO(),this.warnAboutTransformation(Xk,L.REASONING_MESSAGE_START),{...e,type:L.REASONING_MESSAGE_START,messageId:this.currentMessageId,role:`reasoning`};case Zk:{let{delta:t,...n}=e;return this.warnAboutTransformation(Zk,L.REASONING_MESSAGE_CONTENT),{...n,type:L.REASONING_MESSAGE_CONTENT,messageId:this.currentMessageId??vO(),delta:t}}case Qk:{let t=this.currentMessageId??vO();return this.warnAboutTransformation(Qk,L.REASONING_MESSAGE_END),{...e,type:L.REASONING_MESSAGE_END,messageId:t}}case Yk:{let t=this.currentReasoningId??vO();return this.warnAboutTransformation(Yk,L.REASONING_END),{...e,type:L.REASONING_END,messageId:t}}default:return e}}},eA=`SUBAGENT_STARTED`,tA=`SUBAGENT_FINISHED`,nA=`SUBAGENT_ERROR`;function rA(e){if(e&&typeof e==`object`&&`subagentRunId`in e){let{subagentRunId:t,...n}=e;return n}return e}function iA(e){return e.map(e=>rA(e))}var aA=class extends bk{warnDroppedLifecycleEvent(e){typeof process<`u`&&{}.SUPPRESS_TRANSFORMATION_WARNINGS||console.warn(`AG-UI is dropping ${e} because the target agent predates subagent support. To remove this warning, upgrade your AG-UI integration package. To suppress it, set SUPPRESS_TRANSFORMATION_WARNINGS=true in your .env file.`)}run(e,t){let n={...e,messages:(e.messages??[]).map(e=>rA(e))};return this.runNext(n,t).pipe(Ad(e=>{let t=e.type;(t===eA||t===tA||t===nA)&&this.warnDroppedLifecycleEvent(t)}),xd(e=>{let t=e.type;return t!==eA&&t!==tA&&t!==nA}),hd(e=>{let t=rA(e);if(t.type===L.MESSAGES_SNAPSHOT){let e=t;if(Array.isArray(e.messages))return{...e,messages:iA(e.messages)}}if(t.type===L.RUN_FINISHED){let e=t;if(e.outcome&&Array.isArray(e.outcome.interrupts))return{...e,outcome:{...e.outcome,interrupts:e.outcome.interrupts.map(e=>rA(e))}}}if(t.type===L.RUN_STARTED){let e=t;if(e.input&&Array.isArray(e.input.messages))return{...e,input:{...e.input,messages:iA(e.input.messages)}}}return t}))}},oA=`1.0.2`,sA=!1,cA=new WeakSet,lA=(e,t)=>/^\d+\.\d+$/.test(e)?LT(e,t)>0?`newer`:`not-newer`:`uninterpretable`,uA=e=>{let t=e.protocolVersion;if(t!==void 0&&t!==`1.0`)switch(lA(t,`1.0`)){case`uninterpretable`:console.warn(`[ag-ui] The producer declared protocol version '${t}', which this client cannot interpret.`);return;case`newer`:console.warn(`[ag-ui] The producer speaks protocol ${t}; this client speaks 1.0. Unrecognised material will be stripped with warnings.`);return;case`not-newer`:return}},dA=class e{resolvePeerCeiling(t){if(this.resolvingPeerCeiling)return oA;let n=Object.getOwnPropertyDescriptor(this,`maxVersion`),r=Object.getOwnPropertyDescriptor(this,`maxProtocolVersion`),i=Object.getPrototypeOf(this);for(;i&&i!==e.prototype;)n??=Object.getOwnPropertyDescriptor(i,`maxVersion`),r??=Object.getOwnPropertyDescriptor(i,`maxProtocolVersion`),i=Object.getPrototypeOf(i);if(t===`maxVersion`&&n)return oA;let a=t===`maxProtocolVersion`?n:r;if(!a)return oA;this.resolvingPeerCeiling=!0;try{return a.get?a.get.call(this):a.value}finally{this.resolvingPeerCeiling=!1}}get maxProtocolVersion(){return this.resolvePeerCeiling(`maxProtocolVersion`)}get maxVersion(){return!this.resolvingPeerCeiling&&!sA&&(sA=!0,console.warn(`[ag-ui] AbstractAgent.maxVersion is deprecated — use maxProtocolVersion. Same value; the new name says whose version it is and that it is a ceiling.`)),this.resolvePeerCeiling(`maxVersion`)}get debug(){return this._debug}set debug(e){this._debug=wO(e),this._debugLogger=DO(this._debug)}get debugLogger(){return this._debugLogger}set debugLogger(e){this._debugLogger=typeof e==`boolean`?e?DO(wO(!0)):void 0:e}resolvedCeilingDuringConstruction(){let e=this.maxProtocolVersion;if(typeof e!=`string`||!RT(e))throw new R(`maxProtocolVersion resolved to ${JSON.stringify(e)} during construction, which is not a version this client can compare. A ceiling read from an instance field is not available yet — return a literal from the getter.`);return e}constructor({agentId:e,description:t,threadId:n,initialMessages:r,initialState:i,debug:a}={}){this.subscribers=[],this.isRunning=!1,this.pendingInterrupts=[],this.middlewares=[],this.resolvingPeerCeiling=!1,this.agentId=e,this.description=t??``,this.threadId=n??Vc(),this.messages=_O(r??[]),this.state=_O(i??{}),this._debug=wO(a),this._debugLogger=DO(this._debug);let o=this.resolvedCeilingDuringConstruction();LT(o,`0.0.39`)<=0&&this.middlewares.unshift(new qk),LT(o,`0.0.45`)<=0&&this.middlewares.unshift(new $k),LT(o,`0.0.57`)<=0&&this.middlewares.unshift(new aA)}subscribe(e){return this.subscribers.push(e),{unsubscribe:()=>{this.subscribers=this.subscribers.filter(t=>t!==e)}}}use(...e){let t=e.map(e=>typeof e==`function`?new xk(e):e);return this.middlewares.push(...t),this}async runAgent(e,t){try{this.isRunning=!0,this.agentId=this.agentId??Vc();let n=this.prepareRunAgentInput(e);this.debugLogger?.lifecycle(`LIFECYCLE`,`Run started:`,{agentId:this.agentId,threadId:this.threadId});let r,i=new Set(this.messages.map(e=>e.id)),a=[{onRunStartedEvent:({event:e})=>uA(e),onRunFinishedEvent:e=>{e.outcome===`success`&&(r=e.result)}},...this.subscribers,t??{}];cA.add(n),await this.onInitialize(n,a),this.activeRunDetach$=new ku;let o;this.activeRunCompletionPromise=new Promise(e=>{o=e}),await md(vu(()=>[...this.middlewares,new Bk].reduceRight((e,t)=>({run:n=>t.run(n,e),get messages(){return e.messages},get state(){return e.state}}),this).run(n),vk(this.debugLogger),ak(this.debugLogger),MO(this.debugLogger),e=>e.pipe(kd(this.activeRunDetach$)),e=>this.applyBeforeSourceError(n,e,a),Sd(e=>(this.debugLogger?.lifecycle(`LIFECYCLE`,`Run errored:`,{agentId:this.agentId,error:e instanceof Error?e.message:String(e)}),this.isRunning=!1,this.onError(n,e,a))),Dd(()=>{this.debugLogger?.lifecycle(`LIFECYCLE`,`Run finished:`,{agentId:this.agentId,threadId:this.threadId}),this.isRunning=!1,this.onFinalize(n,a),o?.(),o=void 0,this.activeRunCompletionPromise=void 0,this.activeRunDetach$=void 0}))(fd(null)));let s=_O(this.messages).filter(e=>!i.has(e.id));return{result:r,newMessages:s}}finally{this.isRunning=!1}}connect(e){throw new Kc}async connectAgent(e,t){try{this.isRunning=!0,this.agentId=this.agentId??Vc();let n=this.prepareRunAgentInput(e),r,i=new Set(this.messages.map(e=>e.id)),a=[{onRunStartedEvent:({event:e})=>uA(e),onRunFinishedEvent:e=>{e.outcome===`success`&&(r=e.result)}},...this.subscribers,t??{}];await this.onInitialize(n,a),this.activeRunDetach$=new ku;let o;this.activeRunCompletionPromise=new Promise(e=>{o=e}),await md(vu(()=>bd(()=>this.connect(n)),e=>vk(this.debugLogger)(Vk()(e)),ak(this.debugLogger),MO(this.debugLogger),e=>e.pipe(kd(this.activeRunDetach$)),e=>this.applyBeforeSourceError(n,e,a),Sd(e=>(this.isRunning=!1,e instanceof Kc?Nu:this.onError(n,e,a))),Dd(()=>{this.isRunning=!1,this.onFinalize(n,a),o?.(),o=void 0,this.activeRunCompletionPromise=void 0,this.activeRunDetach$=void 0}))(fd(null)),{defaultValue:void 0});let s=_O(this.messages).filter(e=>!i.has(e.id));return{result:r,newMessages:s}}finally{this.isRunning=!1}}abortRun(){}async detachActiveRun(){if(!this.activeRunDetach$)return;let e=this.activeRunCompletionPromise??Promise.resolve();this.activeRunDetach$.next(),this.activeRunDetach$?.complete(),await e}applyBeforeSourceError(e,t,n){return bd(()=>{let r,i=t.pipe(Sd(e=>(r={error:e},Nu)));return this.processApplyEvents(e,this.apply(e,i,n),n).pipe(Td(bd(()=>{let e=r;return e?z(()=>e.error):Nu})))})}apply(e,t,n){return AO(e,t,this,n,this.debugLogger)}processApplyEvents(e,t,n){return t.pipe(Ad(t=>{t.messages&&(this.messages=t.messages,n.forEach(t=>{t.onMessagesChanged?.({messages:this.messages,state:this.state,agent:this,input:e})})),t.state!==void 0&&(this.state=t.state,n.forEach(t=>{t.onStateChanged?.({state:this.state,messages:this.messages,agent:this,input:e})}))}))}prepareRunAgentInput(e){let t=_O(this.messages);for(let e of t)e.subagentRunId===null&&delete e.subagentRunId;let n=t.filter(e=>e.role!==`activity`);return{threadId:this.threadId,runId:e?.runId||Vc(),...LT(this.maxProtocolVersion,oA)>=0&&{protocolVersion:`1.0`},tools:_O(e?.tools??[]),context:_O(e?.context??[]),forwardedProps:_O(e?.forwardedProps??{}),state:_O(this.state),messages:n,...e?.resume===void 0?{}:{resume:_O(e.resume)}}}async onInitialize(e,t){if(cA.has(e)&&this.pendingInterrupts.length>0){let t=new Set((e.resume??[]).map(e=>e.interruptId)),n=this.pendingInterrupts.map(e=>e.id).filter(e=>!t.has(e));if(n.length>0)throw new R(`Thread has ${n.length} pending interrupt(s) not addressed by resume: ${n.join(`, `)}`);for(let t of this.pendingInterrupts)if(Hk(t)&&(e.resume??[]).find(e=>e.interruptId===t.id)?.status!==`cancelled`)throw new R(`Interrupt ${t.id} expired at ${t.expiresAt} and can no longer be answered. Cancel it to continue the thread.`)}let n=await CO(t,this.messages,this.state,(t,n,r)=>t.onRunInitialized?.({messages:n,state:r,agent:this,input:e}));if(n.messages!==void 0||n.state!==void 0){if(n.messages){this.messages=n.messages;for(let e of n.messages)e.subagentRunId===null&&delete e.subagentRunId;e.messages=n.messages.filter(e=>e.role!==`activity`),t.forEach(t=>{t.onMessagesChanged?.({messages:this.messages,state:this.state,agent:this,input:e})})}n.state!==void 0&&(this.state=n.state,e.state=n.state,t.forEach(t=>{t.onStateChanged?.({state:this.state,messages:this.messages,agent:this,input:e})}))}}onError(e,t,n){return dd(CO(n,this.messages,this.state,(n,r,i)=>n.onRunFailed?.({error:t,messages:r,state:i,agent:this,input:e}))).pipe(hd(r=>{let i=r;if((i.messages!==void 0||i.state!==void 0)&&(i.messages!==void 0&&(this.messages=i.messages,n.forEach(t=>{t.onMessagesChanged?.({messages:this.messages,state:this.state,agent:this,input:e})})),i.state!==void 0&&(this.state=i.state,n.forEach(t=>{t.onStateChanged?.({state:this.state,messages:this.messages,agent:this,input:e})}))),i.stopPropagation!==!0){let e=String(t);if(t.name!==`AbortError`&&t.message!==`Fetch is aborted`&&t.message!==`signal is aborted without reason`&&t.message!==`component unmounted`&&e!==`component unmounted`)throw console.error(`Agent execution failed:`,t),t}return{}}))}async onFinalize(e,t){let n=await CO(t,this.messages,this.state,(t,n,r)=>t.onRunFinalized?.({messages:n,state:r,agent:this,input:e}));(n.messages!==void 0||n.state!==void 0)&&(n.messages!==void 0&&(this.messages=n.messages,t.forEach(t=>{t.onMessagesChanged?.({messages:this.messages,state:this.state,agent:this,input:e})})),n.state!==void 0&&(this.state=n.state,t.forEach(t=>{t.onStateChanged?.({state:this.state,messages:this.messages,agent:this,input:e})})))}clone(){let e=Object.create(Object.getPrototypeOf(this));return e.agentId=this.agentId,e.description=this.description,e.threadId=this.threadId,e.messages=_O(this.messages),e.state=_O(this.state),e._debug=this._debug,e._debugLogger=this._debugLogger,e.isRunning=this.isRunning,e.subscribers=[...this.subscribers],e.middlewares=[...this.middlewares],e.pendingInterrupts=_O(this.pendingInterrupts),e}addMessage(e){this.messages.push(e),(async()=>{for(let t of this.subscribers)await t.onNewMessage?.({message:e,messages:this.messages,state:this.state,agent:this});if(e.role===`assistant`&&e.toolCalls)for(let t of e.toolCalls)for(let e of this.subscribers)await e.onNewToolCall?.({toolCall:t,messages:this.messages,state:this.state,agent:this});for(let e of this.subscribers)await e.onMessagesChanged?.({messages:this.messages,state:this.state,agent:this})})()}addMessages(e){this.messages.push(...e),(async()=>{for(let t of e){for(let e of this.subscribers)await e.onNewMessage?.({message:t,messages:this.messages,state:this.state,agent:this});if(t.role===`assistant`&&t.toolCalls)for(let e of t.toolCalls)for(let t of this.subscribers)await t.onNewToolCall?.({toolCall:e,messages:this.messages,state:this.state,agent:this})}for(let e of this.subscribers)await e.onMessagesChanged?.({messages:this.messages,state:this.state,agent:this})})()}setMessages(e){this.messages=_O(e),(async()=>{for(let e of this.subscribers)await e.onMessagesChanged?.({messages:this.messages,state:this.state,agent:this})})()}setState(e){this.state=_O(e),(async()=>{for(let e of this.subscribers)await e.onStateChanged?.({messages:this.messages,state:this.state,agent:this})})()}legacy_to_be_removed_runAgentBridged(e){this.agentId=this.agentId??Vc();let t=this.prepareRunAgentInput(e);return[...this.middlewares,new Bk].reduceRight((e,t)=>({run:n=>t.run(n,e),get messages(){return e.messages},get state(){return e.state}}),this).run(t).pipe(vk(this.debugLogger),ak(this.debugLogger),MO(this.debugLogger),GO(this.threadId,t.runId,this.agentId),e=>e.pipe(hd(e=>(this.debugLogger?.event(`LEGACY`,`Event:`,e,{type:e.type}),e))))}};function fA(e){if(!Array.isArray(e.messages))return e;let t=!1,n=e.messages.map(e=>{if(e.subagentRunId===null){t=!0;let n={...e};return delete n.subagentRunId,n}return e});return t?{...e,messages:n}:e}var pA=class extends dA{requestInit(e){return{method:`POST`,headers:{...this.headers,"Content-Type":`application/json`,Accept:`text/event-stream`},body:JSON.stringify(fA(e)),signal:this.abortController.signal}}runAgent(e,t){return this.abortController=e?.abortController??new AbortController,super.runAgent(e,t)}abortRun(){this.abortController.abort(),super.abortRun()}constructor(e){super(e),this.abortController=new AbortController,this.url=e.url,this.headers=_O(e.headers??{}),this.fetch=e.fetch??((e,t)=>fetch(e,t))}run(e){return BO(PO(()=>this.fetch(this.url,this.requestInit(yk(e)))),this.debugLogger)}clone(){let e=super.clone();e.url=this.url,e.headers=_O(this.headers??{}),e.fetch=this.fetch;let t=new AbortController,n=this.abortController.signal;return n.aborted&&t.abort(n.reason),e.abortController=t,e}},mA=N.createContext(void 0),hA=e=>{let t=N.useContext(mA);if(e)return e;if(!t)throw Error(`No QueryClient set, use QueryClientProvider to set one`);return t},gA=({client:e,children:t})=>(N.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),(0,P.jsx)(mA.Provider,{value:e,children:t})),_A={setTimeout:(e,t)=>setTimeout(e,t),clearTimeout:e=>clearTimeout(e),setInterval:(e,t)=>setInterval(e,t),clearInterval:e=>clearInterval(e)},vA=new class{#e=_A;setTimeoutProvider(e){this.#e=e}setTimeout(e,t){return this.#e.setTimeout(e,t)}clearTimeout(e){this.#e.clearTimeout(e)}setInterval(e,t){return this.#e.setInterval(e,t)}clearInterval(e){this.#e.clearInterval(e)}};function yA(e){setTimeout(e,0)}var bA=typeof window>`u`||`Deno`in globalThis;function xA(){}function SA(e,t){return typeof e==`function`?e(t):e}function CA(e){return typeof e==`number`&&e>=0&&e!==1/0}function wA(e,t){return Math.max(e+(t||0)-Date.now(),0)}function TA(e,t){return typeof e==`function`?e(t):e}function EA(e,t){let{type:n=`all`,exact:r,fetchStatus:i,predicate:a,queryKey:o,stale:s}=e;if(o){if(r){if(t.queryHash!==OA(o,t.options))return!1}else if(!AA(t.queryKey,o))return!1}if(n!==`all`){let e=t.isActive();if(n===`active`&&!e||n===`inactive`&&e)return!1}return!(typeof s==`boolean`&&t.isStale()!==s||i&&i!==t.state.fetchStatus||a&&!a(t))}function DA(e,t){let{exact:n,status:r,predicate:i,mutationKey:a}=e;if(a){if(!t.options.mutationKey)return!1;if(n){if(kA(t.options.mutationKey)!==kA(a))return!1}else if(!AA(t.options.mutationKey,a))return!1}return!(r&&t.state.status!==r||i&&!i(t))}function OA(e,t){return(t?.queryKeyHashFn||kA)(e)}function kA(e){return JSON.stringify(e,(e,t)=>FA(t)?Object.keys(t).sort().reduce((e,n)=>(e[n]=t[n],e),{}):t)}function AA(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(e&&t&&typeof e==`object`&&typeof t==`object`){if(Array.isArray(e)&&Array.isArray(t)){if(t.length>e.length)return!1;for(let n=0;n500)return t;let r=PA(e)&&PA(t);if(!r&&!(FA(e)&&FA(t)))return t;let i=(r?e:Object.keys(e)).length,a=r?t:Object.keys(t),o=a.length,s=r?Array(o):{},c=0;for(let l=0;l{vA.setTimeout(t,e)})}function RA(e,t,n){return typeof n.structuralSharing==`function`?n.structuralSharing(e,t):n.structuralSharing===!1?t:MA(e,t)}function zA(e,t,n=0){let r=[...e,t];return n&&r.length>n?r.slice(1):r}function BA(e,t,n=0){let r=[t,...e];return n&&r.length>n?r.slice(0,-1):r}var VA=Symbol();function HA(e,t){return!e.queryFn&&t?.initialPromise?()=>t.initialPromise:!e.queryFn||e.queryFn===VA?()=>Promise.reject(Error(`Missing queryFn: '${e.queryHash}'`)):e.queryFn}function UA(e,t){return typeof e==`function`?e(...t):!!e}function WA(e,t,n){let r=!1,i;return Object.defineProperty(e,"signal",{enumerable:!0,get:()=>(i??=t(),r?i:(r=!0,i.aborted?n():i.addEventListener(`abort`,n,{once:!0}),i))}),e}var GA=()=>bA,KA=()=>GA(),qA=class{constructor(){this.listeners=new Set,this.subscribe=this.subscribe.bind(this)}subscribe(e){return this.listeners.add(e),this.onSubscribe(),()=>{this.listeners.delete(e),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}},JA=new class extends qA{#e;#t;#n;constructor(){super(),this.#n=e=>{if(typeof window<`u`&&window.addEventListener){let t=()=>e();return window.addEventListener(`visibilitychange`,t,!1),()=>{window.removeEventListener(`visibilitychange`,t)}}}}onSubscribe(){this.#t||this.setEventListener(this.#n)}onUnsubscribe(){this.hasListeners()||(this.#t?.(),this.#t=void 0)}setEventListener(e){this.#n=e,this.#t?.(),this.#t=e(e=>{typeof e==`boolean`?this.setFocused(e):this.onFocus()})}setFocused(e){this.#e!==e&&(this.#e=e,this.onFocus())}onFocus(){let e=this.isFocused();this.listeners.forEach(t=>{t(e)})}isFocused(){return typeof this.#e==`boolean`?this.#e:globalThis.document?.visibilityState!==`hidden`}},YA=yA;function XA(){let e=[],t=0,n=e=>{e()},r=e=>{e()},i=YA,a=r=>{t?e.push(r):i(()=>{n(r)})},o=()=>{let t=e;e=[],t.length&&i(()=>{r(()=>{t.forEach(e=>{n(e)})})})};return{batch:e=>{let n;t++;try{n=e()}finally{t--,t||o()}return n},batchCalls:e=>(...t)=>{a(()=>{e(...t)})},schedule:a,setNotifyFunction:e=>{n=e},setBatchNotifyFunction:e=>{r=e},setScheduler:e=>{i=e}}}var ZA=XA(),QA=new class extends qA{#e=!0;#t;#n;constructor(){super(),this.#n=e=>{if(typeof window<`u`&&window.addEventListener){let t=()=>e(!0),n=()=>e(!1);return window.addEventListener(`online`,t,!1),window.addEventListener(`offline`,n,!1),()=>{window.removeEventListener(`online`,t),window.removeEventListener(`offline`,n)}}}}onSubscribe(){this.#t||this.setEventListener(this.#n)}onUnsubscribe(){this.hasListeners()||(this.#t?.(),this.#t=void 0)}setEventListener(e){this.#n=e,this.#t?.(),this.#t=e(this.setOnline.bind(this))}setOnline(e){this.#e!==e&&(this.#e=e,this.listeners.forEach(t=>{t(e)}))}isOnline(){return this.#e}};function $A(e){return Math.min(1e3*2**e,3e4)}function ej(e){return(e??`online`)!==`online`||QA.isOnline()}var tj=class extends Error{constructor(e){super(`CancelledError`),this.revert=e?.revert,this.silent=e?.silent}};function nj(e){let t=!1,n=0,r,i=`pending`,a,o,s=new Promise((e,t)=>{a=e,o=t});s.catch(xA);let c=()=>i!==`pending`,l=t=>{if(!c()){let n=new tj(t);h(n),e.onCancel?.(n)}},u=()=>{t=!0},d=()=>{t=!1},f=()=>JA.isFocused()&&(e.networkMode===`always`||QA.isOnline())&&e.canRun(),p=()=>ej(e.networkMode)&&e.canRun(),m=e=>{c()||(r?.(),i=`resolved`,a(e))},h=e=>{c()||(r?.(),i=`rejected`,o(e))},g=t=>new Promise(n=>{r=e=>{(c()||t())&&n(e)},e.onPause?.()}).then(()=>{r=void 0,c()||e.onContinue?.()}),_=()=>{if(c())return;let r,i=n===0?e.initialPromise:void 0;try{r=i??e.fn()}catch(e){r=Promise.reject(e)}Promise.resolve(r).then(m).catch(r=>{if(c())return;let i=e.retry??(KA()?0:3),a=e.retryDelay??$A,o=typeof a==`function`?a(n,r):a,s=i===!0||typeof i==`number`&&nf()?void 0:g(f)).then(()=>{t?h(r):_()})})};return{promise:s,status:()=>i,cancel:l,continue:()=>(r?.(),s),cancelRetry:u,continueRetry:d,canStart:p,start:()=>(p()?_():g(p).then(_),s)}}var rj=class{#e;destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),CA(this.gcTime)&&(this.#e=vA.setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(KA()?1/0:3e5))}clearGcTimeout(){this.#e!==void 0&&(vA.clearTimeout(this.#e),this.#e=void 0)}};function ij(e){return{onFetch:(t,n)=>{let r=t.options,i=t.fetchOptions?.meta?.fetchMore?.direction,a=t.state.data?.pages||[],o=t.state.data?.pageParams||[],s={pages:[],pageParams:[]},c=0,l=async()=>{let n=!1,l=e=>{WA(e,()=>t.signal,()=>n=!0)},u=HA(t.options,t.fetchOptions),d=async(e,r,i)=>{if(n)return Promise.reject(t.signal.reason);if(r==null&&e.pages.length)return Promise.resolve(e);let a=(()=>{let e={client:t.client,queryKey:t.queryKey,pageParam:r,direction:i?`backward`:`forward`,meta:t.options.meta};return l(e),e})(),o=await u(a),{maxPages:s}=t.options,c=i?BA:zA;return{pages:c(e.pages,o,s),pageParams:c(e.pageParams,r,s)}};if(i&&a.length){let e=i===`backward`,t=e?oj:aj,n={pages:a,pageParams:o};s=await d(n,t(r,n),e)}else{let t=e??a.length;do{let e=c===0?o[0]??r.initialPageParam:aj(r,s);if(c>0&&e==null)break;s=await d(s,e),c++}while(ct.options.persister?.(l,{client:t.client,queryKey:t.queryKey,meta:t.options.meta,signal:t.signal},n):l}}}function aj(e,{pages:t,pageParams:n}){let r=t.length-1;return t.length>0?e.getNextPageParam(t[r],t,n[r],n):void 0}function oj(e,{pages:t,pageParams:n}){return t.length>0?e.getPreviousPageParam?.(t[0],t,n[0],n):void 0}function sj(e,t){return t?aj(e,t)!=null:!1}function cj(e,t){return!t||!e.getPreviousPageParam?!1:oj(e,t)!=null}var lj=class extends rj{#e;#t;#n;#r;#i;#a;#o;#s;constructor(e){super(),this.#s=!1,this.#o=e.defaultOptions,this.setOptions(e.options),this.observers=[],this.#i=e.client,this.#r=this.#i.getQueryCache(),this.queryKey=e.queryKey,this.queryHash=e.queryHash,this.#t=fj(this.options),this.state=e.state??this.#t,this.scheduleGc()}get meta(){return this.options.meta}get queryType(){return this.#e}get promise(){return this.#a?.promise}setOptions(e){if(this.options={...this.#o,...e},e?._type&&(this.#e=e._type),this.updateGcTime(this.options.gcTime),this.state&&this.state.data===void 0){let e=fj(this.options);e.data!==void 0&&(this.setState(dj(e.data,e.dataUpdatedAt)),this.#t=e)}}optionalRemove(){!this.observers.length&&this.state.fetchStatus===`idle`&&this.#r.remove(this)}setData(e,t){let n=RA(this.state.data,e,this.options);return this.#c({data:n,type:`success`,dataUpdatedAt:t?.updatedAt,manual:t?.manual}),n}setState(e){this.#c({type:`setState`,state:e})}cancel(e){let t=this.#a?.promise;return this.#a?.cancel(e),t?t.then(xA).catch(xA):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}get resetState(){return this.#t}reset(){this.destroy(),this.setState(this.resetState)}isActive(){return this.observers.some(e=>TA(e.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===VA||!this.isFetched()}isFetched(){return this.state.dataUpdateCount+this.state.errorUpdateCount>0}isStatic(){return this.getObserversCount()>0&&this.observers.some(e=>TA(e.options.staleTime,this)===`static`)}isStale(){return this.getObserversCount()>0?this.observers.some(e=>e.getCurrentResult().isStale):this.state.data===void 0||this.state.isInvalidated}isStaleByTime(e=0){return this.state.data===void 0?!0:e===`static`?!1:this.state.isInvalidated?!0:!wA(this.state.dataUpdatedAt,e)}onFocus(){this.observers.find(e=>e.shouldFetchOnWindowFocus())?.refetch({cancelRefetch:!1}),this.#a?.continue()}onOnline(){this.observers.find(e=>e.shouldFetchOnReconnect())?.refetch({cancelRefetch:!1}),this.#a?.continue()}addObserver(e){this.observers.includes(e)||(this.observers.push(e),this.clearGcTimeout(),this.#r.notify({type:`observerAdded`,query:this,observer:e}))}removeObserver(e){let t=this.observers.indexOf(e);t!==-1&&(this.observers.splice(t,1),this.observers.length||(this.#a&&(this.#s||this.state.fetchStatus===`paused`&&this.state.status===`pending`?this.#a.cancel({revert:!0}):this.#a.cancelRetry()),this.scheduleGc()),this.#r.notify({type:`observerRemoved`,query:this,observer:e}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||this.#c({type:`invalidate`})}async fetch(e,t){if(this.state.fetchStatus!==`idle`&&this.#a?.status()!==`rejected`){if(this.state.data!==void 0&&t?.cancelRefetch)this.cancel({silent:!0});else if(this.#a)return this.#a.continueRetry(),this.#a.promise}if(e&&this.setOptions(e),!this.options.queryFn){let e=this.observers.find(e=>e.options.queryFn);e&&this.setOptions(e.options)}let n=new AbortController,r=e=>{Object.defineProperty(e,"signal",{enumerable:!0,get:()=>(this.#s=!0,n.signal)})},i=()=>{let e=HA(this.options,t),n=(()=>{let e={client:this.#i,queryKey:this.queryKey,meta:this.meta};return r(e),e})();return this.#s=!1,this.options.persister?this.options.persister(e,n,this):e(n)},a=(()=>{let e={fetchOptions:t,options:this.options,queryKey:this.queryKey,client:this.#i,state:this.state,fetchFn:i};return r(e),e})();(this.#e===`infinite`?ij(this.options.pages):this.options.behavior)?.onFetch(a,this),this.#n=this.state,(this.state.fetchStatus===`idle`||this.state.fetchMeta!==a.fetchOptions?.meta)&&this.#c({type:`fetch`,meta:a.fetchOptions?.meta});let o=this.#a=nj({initialPromise:t?.initialPromise,fn:a.fetchFn,onCancel:e=>{e instanceof tj&&e.revert&&this.setState({...this.#n,fetchStatus:`idle`}),n.abort()},onFail:(e,t)=>{this.#c({type:`failed`,failureCount:e,error:t})},onPause:()=>{this.#c({type:`pause`})},onContinue:()=>{this.#c({type:`continue`})},retry:a.options.retry,retryDelay:a.options.retryDelay,networkMode:a.options.networkMode,canRun:()=>!0});try{let e=await o.start();if(e===void 0)throw Error(`${this.queryHash} data is undefined`);return this.setData(e),this.#r.config.onSuccess?.(e,this),this.#r.config.onSettled?.(e,this.state.error,this),e}catch(e){if(e instanceof tj){if(e.silent)return this.#a.promise;if(e.revert){if(this.state.data===void 0)throw e;return this.state.data}}throw this.#c({type:`error`,error:e}),this.#r.config.onError?.(e,this),this.#r.config.onSettled?.(this.state.data,e,this),e}finally{this.#a===o&&(this.#a=void 0),this.scheduleGc()}}#c(e){let t=t=>{switch(e.type){case`failed`:return{...t,fetchFailureCount:e.failureCount,fetchFailureReason:e.error};case`pause`:return{...t,fetchStatus:`paused`};case`continue`:return{...t,fetchStatus:`fetching`};case`fetch`:return{...t,...uj(t.data,this.options),fetchMeta:e.meta??null};case`success`:let n={...t,...dj(e.data,e.dataUpdatedAt),dataUpdateCount:t.dataUpdateCount+1,...!e.manual&&{fetchStatus:`idle`,fetchFailureCount:0,fetchFailureReason:null}};return this.#n=e.manual?n:void 0,n;case`error`:let r=e.error;return{...t,error:r,errorUpdateCount:t.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:t.fetchFailureCount+1,fetchFailureReason:r,fetchStatus:`idle`,status:`error`,isInvalidated:!0};case`invalidate`:return{...t,isInvalidated:!0};case`setState`:return{...t,...e.state}}};this.state=t(this.state),ZA.batch(()=>{this.observers.slice().forEach(e=>{e.onQueryUpdate()}),this.#r.notify({query:this,type:`updated`,action:e})})}};function uj(e,t){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:ej(t.networkMode)?`fetching`:`paused`,...e===void 0&&{error:null,status:`pending`}}}function dj(e,t){return{data:e,dataUpdatedAt:t??Date.now(),error:null,isInvalidated:!1,status:`success`}}function fj(e){let t=typeof e.initialData==`function`?e.initialData():e.initialData,n=t!==void 0,r=n?typeof e.initialDataUpdatedAt==`function`?e.initialDataUpdatedAt():e.initialDataUpdatedAt:0;return{data:t,dataUpdateCount:0,dataUpdatedAt:n?r??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:n?`success`:`pending`,fetchStatus:`idle`}}var pj=class extends qA{#e;#t=void 0;#n=void 0;#r=void 0;#i;#a;#o;#s;#c;#l;#u;#d;#f;#p=new Set;constructor(e,t){super(),this.options=t,this.#e=e,this.#o=null,this.bindMethods(),this.setOptions(t)}bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(this.#t.addObserver(this),hj(this.#t,this.options)?this.#m():this.updateResult(),this.#y())}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return gj(this.#t,this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return gj(this.#t,this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,this.#b(),this.#x(),this.#t.removeObserver(this)}setOptions(e){let t=this.options,n=this.#t;if(this.options=this.#e.defaultQueryOptions(e),this.options.enabled!==void 0&&typeof this.options.enabled!=`boolean`&&typeof this.options.enabled!=`function`&&typeof TA(this.options.enabled,this.#t)!=`boolean`)throw Error(`Expected enabled to be a boolean or a callback that returns a boolean`);this.#S(),this.#t.setOptions(this.options),t._defaulted&&!NA(this.options,t)&&this.#e.getQueryCache().notify({type:`observerOptionsUpdated`,query:this.#t,observer:this});let r=this.hasListeners();r&&_j(this.#t,n,this.options,t)&&this.#m(),this.updateResult(),r&&(this.#t!==n||TA(this.options.enabled,this.#t)!==TA(t.enabled,this.#t)||TA(this.options.staleTime,this.#t)!==TA(t.staleTime,this.#t))&&this.#g();let i=this.#_();r&&(this.#t!==n||TA(this.options.enabled,this.#t)!==TA(t.enabled,this.#t)||i!==this.#f)&&this.#v(i)}getOptimisticResult(e){let t=this.#e.getQueryCache().build(this.#e,e),n=this.createResult(t,e);return NA(this.getCurrentResult(),n)||(this.#r=n,this.#a=this.options,this.#i=this.#t.state),n}getCurrentResult(){return this.#r}trackResult(e,t){return new Proxy(e,{get:(e,n)=>(this.trackProp(n),t?.(n),Reflect.get(e,n))})}trackProp(e){this.#p.add(e)}getCurrentQuery(){return this.#t}refetch({...e}={}){return this.fetch({...e})}fetchOptimistic(e){let t=this.#e.defaultQueryOptions(e),n=this.#e.getQueryCache().build(this.#e,t),r=()=>{},i,a=new Promise(e=>{i=e,r=this.#e.getQueryCache().subscribe(i=>{i.type===`updated`&&i.query.queryHash===n.queryHash&&n.state.data!==void 0&&(r(),e(this.createResult(n,t)))})});return Promise.race([n.fetch().then(()=>{let e=this.createResult(n,t);return i?.(e),e}).finally(()=>{r()}),a])}fetch(e){return this.#m({...e,cancelRefetch:e.cancelRefetch??!0}).then(()=>(this.updateResult(),this.#r))}#m(e){this.#S();let t=this.#t.fetch(this.options,e);return e?.throwOnError||(t=t.catch(xA)),t}#h(e){return!KA()&&TA(this.options.enabled,this.#t)!==!1&&CA(e)}#g(){this.#b();let e=TA(this.options.staleTime,this.#t);if(this.#r.isStale||!this.#h(e))return;let t=wA(this.#r.dataUpdatedAt,e)+1;this.#u=vA.setTimeout(()=>{this.#r.isStale||this.updateResult()},t)}#_(){return TA(this.options.refetchInterval,this.#t)??!1}#v(e){this.#x(),this.#f=e,this.#f!==0&&this.#h(this.#f)&&(this.#d=vA.setInterval(()=>{(this.options.refetchIntervalInBackground||JA.isFocused())&&this.#m()},this.#f))}#y(){this.#g(),this.#v(this.#_())}#b(){this.#u!==void 0&&(vA.clearTimeout(this.#u),this.#u=void 0)}#x(){this.#d!==void 0&&(vA.clearInterval(this.#d),this.#d=void 0)}createResult(e,t){let n=this.#t,r=this.options,i=this.#r,a=this.#i,o=this.#a,s=e===n?this.#n:e.state,{state:c}=e,l={...c},u=!1,d;if(t._optimisticResults){let i=this.hasListeners(),a=!i&&hj(e,t),o=i&&_j(e,n,t,r);(a||o)&&(l={...l,...uj(c.data,e.options)}),t._optimisticResults===`isRestoring`&&(l.fetchStatus=`idle`)}let{error:f,errorUpdatedAt:p,status:m}=l;d=l.data;let h=!1;if(t.placeholderData!==void 0&&d===void 0&&m===`pending`){let e;i?.isPlaceholderData&&t.placeholderData===o?.placeholderData?(e=i.data,h=!0):e=typeof t.placeholderData==`function`?t.placeholderData(this.#l?.state.data,this.#l):t.placeholderData,e!==void 0&&(m=`success`,d=RA(i?.data,e,t),u=!0)}if(t.select&&d!==void 0&&!h){if(i&&d===a?.data&&t.select===this.#s)d=this.#c;else try{this.#s=t.select,d=t.select(d),d=RA(i?.data,d,t),this.#c=d,this.#o=null}catch(e){this.#o=e}}else d===void 0&&(this.#o=null);this.#o&&(f=this.#o,d=this.#c,p=Date.now(),m=`error`,u=!1);let g=l.fetchStatus===`fetching`,_=m===`pending`,v=m===`error`,y=_&&g,b=d!==void 0;return{status:m,fetchStatus:l.fetchStatus,isPending:_,isSuccess:m===`success`,isError:v,isInitialLoading:y,isLoading:y,data:d,dataUpdatedAt:l.dataUpdatedAt,error:f,errorUpdatedAt:p,failureCount:l.fetchFailureCount,failureReason:l.fetchFailureReason,errorUpdateCount:l.errorUpdateCount,isFetched:e.isFetched(),isFetchedAfterMount:l.dataUpdateCount>s.dataUpdateCount||l.errorUpdateCount>s.errorUpdateCount,isFetching:g,isRefetching:g&&!_,isLoadingError:v&&!b,isPaused:l.fetchStatus===`paused`,isPlaceholderData:u,isRefetchError:v&&b,isStale:vj(e,t),refetch:this.refetch,isEnabled:TA(t.enabled,e)!==!1}}updateResult(){let e=this.#r,t=this.createResult(this.#t,this.options);if(this.#i=this.#t.state,this.#a=this.options,this.#i.data!==void 0&&(this.#l=this.#t),NA(t,e))return;this.#r=t;let n=(()=>{if(!e)return!0;let{notifyOnChangeProps:t}=this.options,n=typeof t==`function`?t():t;if(n===`all`||!n&&!this.#p.size)return!0;let r=new Set(n??this.#p);return this.options.throwOnError&&r.add(`error`),Object.keys(this.#r).some(t=>{let n=t;return this.#r[n]!==e[n]&&r.has(n)})})();ZA.batch(()=>{n&&this.listeners.forEach(e=>{e(this.#r)}),this.#e.getQueryCache().notify({query:this.#t,type:`observerResultsUpdated`})})}#S(){let e=this.#e.getQueryCache().build(this.#e,this.options);if(e===this.#t)return;let t=this.#t;this.#t=e,this.#n=e.state,this.hasListeners()&&(t?.removeObserver(this),e.addObserver(this))}onQueryUpdate(){this.updateResult(),this.hasListeners()&&this.#y()}};function mj(e,t){return TA(t.enabled,e)!==!1&&e.state.data===void 0&&(e.state.status!==`error`||TA(t.retryOnMount,e)!==!1)}function hj(e,t){return mj(e,t)||e.state.data!==void 0&&gj(e,t,t.refetchOnMount)}function gj(e,t,n){if(TA(t.enabled,e)!==!1&&TA(t.staleTime,e)!==`static`){let r=TA(n,e);return r===`always`||r!==!1&&vj(e,t)}return!1}function _j(e,t,n,r){return(e!==t||TA(r.enabled,e)===!1)&&(!n.suspense||e.state.status!==`error`)&&vj(e,n)}function vj(e,t){return TA(t.enabled,e)!==!1&&e.isStaleByTime(TA(t.staleTime,e))}var yj=class extends pj{constructor(e,t){super(e,t)}bindMethods(){super.bindMethods(),this.fetchNextPage=this.fetchNextPage.bind(this),this.fetchPreviousPage=this.fetchPreviousPage.bind(this)}setOptions(e){e._type=`infinite`,super.setOptions(e)}getOptimisticResult(e){return e._type=`infinite`,super.getOptimisticResult(e)}fetchNextPage(e){return this.fetch({...e,meta:{fetchMore:{direction:`forward`}}})}fetchPreviousPage(e){return this.fetch({...e,meta:{fetchMore:{direction:`backward`}}})}createResult(e,t){let{state:n}=e,r=super.createResult(e,t),{isFetching:i,isRefetching:a,isError:o,isRefetchError:s}=r,c=n.fetchMeta?.fetchMore?.direction,l=o&&c===`forward`,u=i&&c===`forward`,d=o&&c===`backward`,f=i&&c===`backward`;return{...r,fetchNextPage:this.fetchNextPage,fetchPreviousPage:this.fetchPreviousPage,hasNextPage:sj(t,n.data),hasPreviousPage:cj(t,n.data),isFetchNextPageError:l,isFetchingNextPage:u,isFetchPreviousPageError:d,isFetchingPreviousPage:f,isRefetchError:s&&!l&&!d,isRefetching:a&&!u&&!f}}},bj=class extends rj{#e;#t;#n;#r;constructor(e){super(),this.#e=e.client,this.mutationId=e.mutationId,this.#n=e.mutationCache,this.#t=[],this.state=e.state||xj(),this.setOptions(e.options),this.scheduleGc()}setOptions(e){this.options=e,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(e){this.#t.includes(e)||(this.#t.push(e),this.clearGcTimeout(),this.#n.notify({type:`observerAdded`,mutation:this,observer:e}))}removeObserver(e){this.#t=this.#t.filter(t=>t!==e),this.scheduleGc(),this.#n.notify({type:`observerRemoved`,mutation:this,observer:e})}optionalRemove(){this.#t.length||(this.state.status===`pending`?this.scheduleGc():this.#n.remove(this))}continue(){return this.#r?.continue()??(this.state.status===`pending`?this.execute(this.state.variables):Promise.resolve())}async execute(e){let t=()=>{this.#i({type:`continue`})},n={client:this.#e,meta:this.options.meta,mutationKey:this.options.mutationKey},r=this.#r=nj({fn:()=>this.options.mutationFn?this.options.mutationFn(e,n):Promise.reject(Error(`No mutationFn found`)),onFail:(e,t)=>{this.#i({type:`failed`,failureCount:e,error:t})},onPause:()=>{this.#i({type:`pause`})},onContinue:t,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>this.#n.canRun(this)}),i=this.state.status===`pending`,a=!r.canStart();try{if(i)t();else{this.#i({type:`pending`,variables:e,isPaused:a}),this.#n.config.onMutate&&await this.#n.config.onMutate(e,this,n);let t=await this.options.onMutate?.(e,n);t!==this.state.context&&this.#i({type:`pending`,context:t,variables:e,isPaused:a})}let o=await r.start();return await this.#n.config.onSuccess?.(o,e,this.state.context,this,n),await this.options.onSuccess?.(o,e,this.state.context,n),await this.#n.config.onSettled?.(o,null,this.state.variables,this.state.context,this,n),await this.options.onSettled?.(o,null,e,this.state.context,n),this.#i({type:`success`,data:o}),o}catch(t){try{await this.#n.config.onError?.(t,e,this.state.context,this,n)}catch(e){Promise.reject(e)}try{await this.options.onError?.(t,e,this.state.context,n)}catch(e){Promise.reject(e)}try{await this.#n.config.onSettled?.(void 0,t,this.state.variables,this.state.context,this,n)}catch(e){Promise.reject(e)}try{await this.options.onSettled?.(void 0,t,e,this.state.context,n)}catch(e){Promise.reject(e)}throw this.#i({type:`error`,error:t}),t}finally{this.#r===r&&(this.#r=void 0),this.#n.runNext(this)}}#i(e){let t=t=>{switch(e.type){case`failed`:return{...t,failureCount:e.failureCount,failureReason:e.error};case`pause`:return{...t,isPaused:!0};case`continue`:return{...t,isPaused:!1};case`pending`:return{...t,context:e.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:e.isPaused,status:`pending`,variables:e.variables,submittedAt:Date.now()};case`success`:return{...t,data:e.data,failureCount:0,failureReason:null,error:null,status:`success`,isPaused:!1};case`error`:return{...t,data:void 0,error:e.error,failureCount:t.failureCount+1,failureReason:e.error,isPaused:!1,status:`error`}}};this.state=t(this.state),ZA.batch(()=>{this.#t.forEach(t=>{t.onMutationUpdate(e)}),this.#n.notify({mutation:this,type:`updated`,action:e})})}};function xj(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:`idle`,variables:void 0,submittedAt:0}}var Sj=class extends qA{#e;#t;#n;constructor(e={}){super(),this.config=e,this.#e=new Set,this.#t=new Map,this.#n=0}build(e,t,n){let r=new bj({client:e,mutationCache:this,mutationId:++this.#n,options:e.defaultMutationOptions(t),state:n});return this.add(r),r}add(e){this.#e.add(e);let t=Cj(e);if(typeof t==`string`){let n=this.#t.get(t);n?n.push(e):this.#t.set(t,[e])}this.notify({type:`added`,mutation:e})}remove(e){if(this.#e.delete(e)){let t=Cj(e);if(typeof t==`string`){let n=this.#t.get(t);if(n){if(n.length>1){let t=n.indexOf(e);t!==-1&&n.splice(t,1)}else n[0]===e&&this.#t.delete(t)}}}this.notify({type:`removed`,mutation:e})}canRun(e){let t=Cj(e);if(typeof t==`string`){let n=this.#t.get(t)?.find(e=>e.state.status===`pending`);return!n||n===e}return!0}runNext(e){let t=Cj(e);return typeof t==`string`?(this.#t.get(t)?.find(t=>t!==e&&t.state.isPaused))?.continue()??Promise.resolve():Promise.resolve()}clear(){ZA.batch(()=>{this.#e.forEach(e=>{this.notify({type:`removed`,mutation:e})}),this.#e.clear(),this.#t.clear()})}getAll(){return Array.from(this.#e)}find(e){let t={exact:!0,...e};return this.getAll().find(e=>DA(t,e))}findAll(e={}){return this.getAll().filter(t=>DA(e,t))}notify(e){ZA.batch(()=>{this.listeners.forEach(t=>{t(e)})})}resumePausedMutations(){let e=this.getAll().filter(e=>e.state.isPaused);return ZA.batch(()=>Promise.all(e.map(e=>e.continue().catch(xA))))}};function Cj(e){return e.options.scope?.id}var wj=class extends qA{#e;constructor(e={}){super(),this.config=e,this.#e=new Map}build(e,t,n){let r=t.queryKey,i=t.queryHash??OA(r,t),a=this.get(i);return a||(a=new lj({client:e,queryKey:r,queryHash:i,options:e.defaultQueryOptions(t),state:n,defaultOptions:e.getQueryDefaults(r)}),this.add(a)),a}add(e){this.#e.has(e.queryHash)||(this.#e.set(e.queryHash,e),this.notify({type:`added`,query:e}))}remove(e){this.#e.get(e.queryHash)===e&&(e.destroy(),this.#e.delete(e.queryHash),this.notify({type:`removed`,query:e}))}clear(){ZA.batch(()=>{this.getAll().forEach(e=>{this.remove(e)})})}get(e){return this.#e.get(e)}getAll(){return[...this.#e.values()]}find(e){let t={exact:!0,...e};return this.getAll().find(e=>EA(t,e))}findAll(e={}){let t=this.getAll();return Object.keys(e).length>0?t.filter(t=>EA(e,t)):t}notify(e){ZA.batch(()=>{this.listeners.forEach(t=>{t(e)})})}onFocus(){ZA.batch(()=>{this.getAll().forEach(e=>{e.onFocus()})})}onOnline(){ZA.batch(()=>{this.getAll().forEach(e=>{e.onOnline()})})}},Tj=class{#e;#t;#n;#r;#i;#a;#o;#s;constructor(e={}){this.#e=e.queryCache||new wj,this.#t=e.mutationCache||new Sj,this.#n=e.defaultOptions||{},this.#r=new Map,this.#i=new Map,this.#a=0}mount(){this.#a++,this.#a===1&&(this.#o=JA.subscribe(async e=>{e&&(await this.resumePausedMutations(),this.#e.onFocus())}),this.#s=QA.subscribe(async e=>{e&&(await this.resumePausedMutations(),this.#e.onOnline())}))}unmount(){this.#a--,this.#a===0&&(this.#o?.(),this.#o=void 0,this.#s?.(),this.#s=void 0)}isFetching(e){return this.#e.findAll({...e,fetchStatus:`fetching`}).length}isMutating(e){return this.#t.findAll({...e,status:`pending`}).length}getQueryData(e){let t=this.defaultQueryOptions({queryKey:e});return this.#e.get(t.queryHash)?.state.data}ensureQueryData(e){let t=this.defaultQueryOptions(e),n=this.#e.build(this,t),r=n.state.data;return r===void 0?this.fetchQuery(e):(e.revalidateIfStale&&n.isStaleByTime(TA(t.staleTime,n))&&this.prefetchQuery(t),Promise.resolve(r))}getQueriesData(e){return this.#e.findAll(e).map(({queryKey:e,state:t})=>[e,t.data])}setQueryData(e,t,n){let r=this.defaultQueryOptions({queryKey:e}),i=this.#e.get(r.queryHash)?.state.data,a=SA(t,i);if(a!==void 0)return this.#e.build(this,r).setData(a,{...n,manual:!0})}setQueriesData(e,t,n){return ZA.batch(()=>this.#e.findAll(e).map(({queryKey:e})=>[e,this.setQueryData(e,t,n)]))}getQueryState(e){let t=this.defaultQueryOptions({queryKey:e});return this.#e.get(t.queryHash)?.state}removeQueries(e){let t=this.#e;ZA.batch(()=>{t.findAll(e).forEach(e=>{t.remove(e)})})}resetQueries(e,t){let n=this.#e;return ZA.batch(()=>{let r=n.findAll(e),i=new Set(r);return r.forEach(e=>{e.reset()}),this.refetchQueries({type:`active`,predicate:e=>i.has(e)},t)})}cancelQueries(e,t={}){let n={revert:!0,...t},r=ZA.batch(()=>this.#e.findAll(e).map(e=>e.cancel(n)));return Promise.all(r).then(xA).catch(xA)}invalidateQueries(e,t={}){return ZA.batch(()=>(this.#e.findAll(e).forEach(e=>{e.invalidate()}),e?.refetchType===`none`?Promise.resolve():this.refetchQueries({...e,type:e?.refetchType??e?.type??`active`},t)))}refetchQueries(e,t={}){let n={...t,cancelRefetch:t.cancelRefetch??!0},r=ZA.batch(()=>this.#e.findAll(e).filter(e=>!e.isDisabled()&&!e.isStatic()).map(e=>{let t=e.fetch(void 0,n);return n.throwOnError||(t=t.catch(xA)),e.state.fetchStatus===`paused`?Promise.resolve():t}));return Promise.all(r).then(xA)}async query(e){let t=this.defaultQueryOptions(e);t.retry===void 0&&(t.retry=!1);let n=this.#e.build(this,t),r=n.isStaleByTime(TA(t.staleTime,n))?await n.fetch(t):n.state.data,i=t.select;return i?i(r):r}fetchQuery(e){let t=this.defaultQueryOptions(e);t.retry===void 0&&(t.retry=!1);let n=this.#e.build(this,t);return n.isStaleByTime(TA(t.staleTime,n))?n.fetch(t):Promise.resolve(n.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(xA).catch(xA)}infiniteQuery(e){return e._type=`infinite`,this.query(e)}fetchInfiniteQuery(e){return e._type=`infinite`,this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(xA).catch(xA)}ensureInfiniteQueryData(e){return e._type=`infinite`,this.ensureQueryData(e)}resumePausedMutations(){return QA.isOnline()?this.#t.resumePausedMutations():Promise.resolve()}getQueryCache(){return this.#e}getMutationCache(){return this.#t}getDefaultOptions(){return this.#n}setDefaultOptions(e){this.#n=e}setQueryDefaults(e,t){this.#r.set(kA(e),{queryKey:e,defaultOptions:t})}getQueryDefaults(e){let t=[...this.#r.values()],n={};return t.forEach(t=>{AA(e,t.queryKey)&&Object.assign(n,t.defaultOptions)}),n}setMutationDefaults(e,t){this.#i.set(kA(e),{mutationKey:e,defaultOptions:t})}getMutationDefaults(e){let t=[...this.#i.values()],n={};return t.forEach(t=>{AA(e,t.mutationKey)&&Object.assign(n,t.defaultOptions)}),n}defaultQueryOptions(e){if(e._defaulted)return e;let t={...this.#n.queries,...this.getQueryDefaults(e.queryKey),...e,_defaulted:!0};return t.queryHash||=OA(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===VA&&(t.enabled=!1),t}defaultMutationOptions(e){return e?._defaulted?e:{...this.#n.mutations,...e?.mutationKey&&this.getMutationDefaults(e.mutationKey),...e,_defaulted:!0}}clear(){this.#e.clear(),this.#t.clear()}},Ej=N.createContext(!1),Dj=()=>N.useContext(Ej);Ej.Provider;function Oj(){let e=!1;return{clearReset:()=>{e=!1},reset:()=>{e=!0},isReset:()=>e}}var kj=N.createContext(Oj()),Aj=()=>N.useContext(kj),jj=(e,t,n)=>{let r=n?.state.error&&typeof e.throwOnError==`function`?UA(e.throwOnError,[n.state.error,n]):e.throwOnError;(e.suspense||r)&&(t.isReset()||(e.retryOnMount=!1))},Mj=e=>{N.useEffect(()=>{e.clearReset()},[e])},Nj=({result:e,errorResetBoundary:t,throwOnError:n,query:r,suspense:i})=>e.isError&&!t.isReset()&&!e.isFetching&&r&&(i&&e.data===void 0||UA(n,[e.error,r])),Pj=e=>{if(e.suspense){let t=1e3,n=e=>e===`static`?e:Math.max(e??t,t),r=e.staleTime;e.staleTime=typeof r==`function`?(...e)=>n(r(...e)):n(r),typeof e.gcTime==`number`&&(e.gcTime=Math.max(e.gcTime,t))}},Fj=(e,t)=>e?.suspense&&t.isPending,Ij=(e,t,n)=>t.fetchOptimistic(e).catch(()=>{n.clearReset()});function Lj(e,t,n){let r=Dj(),i=Aj(),a=hA(n),o=a.defaultQueryOptions(e),s=a.getQueryCache().get(o.queryHash),c=e.subscribed!==!1;o._optimisticResults=r?`isRestoring`:c?`optimistic`:void 0,Pj(o),jj(o,i,s),Mj(i);let[l]=N.useState(()=>new t(a,o)),u=l.getOptimisticResult(o),d=!r&&c;if(N.useSyncExternalStore(N.useCallback(e=>{let t=d?l.subscribe(ZA.batchCalls(e)):xA;return l.updateResult(),t},[l,d]),()=>l.getCurrentResult(),()=>l.getCurrentResult()),N.useEffect(()=>{l.setOptions(o)},[o,l]),Fj(o,u))throw Ij(o,l,i);if(Nj({result:u,errorResetBoundary:i,throwOnError:o.throwOnError,query:s,suspense:o.suspense}))throw u.error;return o.notifyOnChangeProps?u:l.trackResult(u)}function Rj(e,t){return Lj(e,pj,t)}function zj(e,t){return Lj(e,yj,t)}var Bj=new Map([[`bold`,N.createElement(N.Fragment,null,N.createElement(`path`,{d:`M228,128a12,12,0,0,1-12,12H69l51.52,51.51a12,12,0,0,1-17,17l-72-72a12,12,0,0,1,0-17l72-72a12,12,0,0,1,17,17L69,116H216A12,12,0,0,1,228,128Z`}))],[`duotone`,N.createElement(N.Fragment,null,N.createElement(`path`,{d:`M112,56V200L40,128Z`,opacity:`0.2`}),N.createElement(`path`,{d:`M216,120H120V56a8,8,0,0,0-13.66-5.66l-72,72a8,8,0,0,0,0,11.32l72,72A8,8,0,0,0,120,200V136h96a8,8,0,0,0,0-16ZM104,180.69,51.31,128,104,75.31Z`}))],[`fill`,N.createElement(N.Fragment,null,N.createElement(`path`,{d:`M224,128a8,8,0,0,1-8,8H120v64a8,8,0,0,1-13.66,5.66l-72-72a8,8,0,0,1,0-11.32l72-72A8,8,0,0,1,120,56v64h96A8,8,0,0,1,224,128Z`}))],[`light`,N.createElement(N.Fragment,null,N.createElement(`path`,{d:`M222,128a6,6,0,0,1-6,6H54.49l61.75,61.76a6,6,0,1,1-8.48,8.48l-72-72a6,6,0,0,1,0-8.48l72-72a6,6,0,0,1,8.48,8.48L54.49,122H216A6,6,0,0,1,222,128Z`}))],[`regular`,N.createElement(N.Fragment,null,N.createElement(`path`,{d:`M224,128a8,8,0,0,1-8,8H59.31l58.35,58.34a8,8,0,0,1-11.32,11.32l-72-72a8,8,0,0,1,0-11.32l72-72a8,8,0,0,1,11.32,11.32L59.31,120H216A8,8,0,0,1,224,128Z`}))],[`thin`,N.createElement(N.Fragment,null,N.createElement(`path`,{d:`M220,128a4,4,0,0,1-4,4H49.66l65.17,65.17a4,4,0,0,1-5.66,5.66l-72-72a4,4,0,0,1,0-5.66l72-72a4,4,0,0,1,5.66,5.66L49.66,124H216A4,4,0,0,1,220,128Z`}))]]),Vj=new Map([[`bold`,N.createElement(N.Fragment,null,N.createElement(`path`,{d:`M224.49,136.49l-72,72a12,12,0,0,1-17-17L187,140H40a12,12,0,0,1,0-24H187L135.51,64.48a12,12,0,0,1,17-17l72,72A12,12,0,0,1,224.49,136.49Z`}))],[`duotone`,N.createElement(N.Fragment,null,N.createElement(`path`,{d:`M216,128l-72,72V56Z`,opacity:`0.2`}),N.createElement(`path`,{d:`M221.66,122.34l-72-72A8,8,0,0,0,136,56v64H40a8,8,0,0,0,0,16h96v64a8,8,0,0,0,13.66,5.66l72-72A8,8,0,0,0,221.66,122.34ZM152,180.69V75.31L204.69,128Z`}))],[`fill`,N.createElement(N.Fragment,null,N.createElement(`path`,{d:`M221.66,133.66l-72,72A8,8,0,0,1,136,200V136H40a8,8,0,0,1,0-16h96V56a8,8,0,0,1,13.66-5.66l72,72A8,8,0,0,1,221.66,133.66Z`}))],[`light`,N.createElement(N.Fragment,null,N.createElement(`path`,{d:`M220.24,132.24l-72,72a6,6,0,0,1-8.48-8.48L201.51,134H40a6,6,0,0,1,0-12H201.51L139.76,60.24a6,6,0,0,1,8.48-8.48l72,72A6,6,0,0,1,220.24,132.24Z`}))],[`regular`,N.createElement(N.Fragment,null,N.createElement(`path`,{d:`M221.66,133.66l-72,72a8,8,0,0,1-11.32-11.32L196.69,136H40a8,8,0,0,1,0-16H196.69L138.34,61.66a8,8,0,0,1,11.32-11.32l72,72A8,8,0,0,1,221.66,133.66Z`}))],[`thin`,N.createElement(N.Fragment,null,N.createElement(`path`,{d:`M218.83,130.83l-72,72a4,4,0,0,1-5.66-5.66L206.34,132H40a4,4,0,0,1,0-8H206.34L141.17,58.83a4,4,0,0,1,5.66-5.66l72,72A4,4,0,0,1,218.83,130.83Z`}))]]),Hj=new Map([[`bold`,N.createElement(N.Fragment,null,N.createElement(`path`,{d:`M232,44H160a43.86,43.86,0,0,0-32,13.85A43.86,43.86,0,0,0,96,44H24A12,12,0,0,0,12,56V200a12,12,0,0,0,12,12H96a20,20,0,0,1,20,20,12,12,0,0,0,24,0,20,20,0,0,1,20-20h72a12,12,0,0,0,12-12V56A12,12,0,0,0,232,44ZM96,188H36V68H96a20,20,0,0,1,20,20V192.81A43.79,43.79,0,0,0,96,188Zm124,0H160a43.71,43.71,0,0,0-20,4.83V88a20,20,0,0,1,20-20h60Z`}))],[`duotone`,N.createElement(N.Fragment,null,N.createElement(`path`,{d:`M232,56V200H160a32,32,0,0,0-32,32,32,32,0,0,0-32-32H24V56H96a32,32,0,0,1,32,32,32,32,0,0,1,32-32Z`,opacity:`0.2`}),N.createElement(`path`,{d:`M232,48H160a40,40,0,0,0-32,16A40,40,0,0,0,96,48H24a8,8,0,0,0-8,8V200a8,8,0,0,0,8,8H96a24,24,0,0,1,24,24,8,8,0,0,0,16,0,24,24,0,0,1,24-24h72a8,8,0,0,0,8-8V56A8,8,0,0,0,232,48ZM96,192H32V64H96a24,24,0,0,1,24,24V200A39.81,39.81,0,0,0,96,192Zm128,0H160a39.81,39.81,0,0,0-24,8V88a24,24,0,0,1,24-24h64Z`}))],[`fill`,N.createElement(N.Fragment,null,N.createElement(`path`,{d:`M240,56V200a8,8,0,0,1-8,8H160a24,24,0,0,0-24,23.94,7.9,7.9,0,0,1-5.12,7.55A8,8,0,0,1,120,232a24,24,0,0,0-24-24H24a8,8,0,0,1-8-8V56a8,8,0,0,1,8-8H88a32,32,0,0,1,32,32v87.73a8.17,8.17,0,0,0,7.47,8.25,8,8,0,0,0,8.53-8V80a32,32,0,0,1,32-32h64A8,8,0,0,1,240,56Z`}))],[`light`,N.createElement(N.Fragment,null,N.createElement(`path`,{d:`M232,50H160a38,38,0,0,0-32,17.55A38,38,0,0,0,96,50H24a6,6,0,0,0-6,6V200a6,6,0,0,0,6,6H96a26,26,0,0,1,26,26,6,6,0,0,0,12,0,26,26,0,0,1,26-26h72a6,6,0,0,0,6-6V56A6,6,0,0,0,232,50ZM96,194H30V62H96a26,26,0,0,1,26,26V204.31A37.86,37.86,0,0,0,96,194Zm130,0H160a37.87,37.87,0,0,0-26,10.32V88a26,26,0,0,1,26-26h66Z`}))],[`regular`,N.createElement(N.Fragment,null,N.createElement(`path`,{d:`M232,48H160a40,40,0,0,0-32,16A40,40,0,0,0,96,48H24a8,8,0,0,0-8,8V200a8,8,0,0,0,8,8H96a24,24,0,0,1,24,24,8,8,0,0,0,16,0,24,24,0,0,1,24-24h72a8,8,0,0,0,8-8V56A8,8,0,0,0,232,48ZM96,192H32V64H96a24,24,0,0,1,24,24V200A39.81,39.81,0,0,0,96,192Zm128,0H160a39.81,39.81,0,0,0-24,8V88a24,24,0,0,1,24-24h64Z`}))],[`thin`,N.createElement(N.Fragment,null,N.createElement(`path`,{d:`M232,52H160a36,36,0,0,0-32,19.54A36,36,0,0,0,96,52H24a4,4,0,0,0-4,4V200a4,4,0,0,0,4,4H96a28,28,0,0,1,28,28,4,4,0,0,0,8,0,28,28,0,0,1,28-28h72a4,4,0,0,0,4-4V56A4,4,0,0,0,232,52ZM96,196H28V60H96a28,28,0,0,1,28,28V209.4A35.93,35.93,0,0,0,96,196Zm132,0H160a35.94,35.94,0,0,0-28,13.41V88a28,28,0,0,1,28-28h68Z`}))]]),Uj=new Map([[`bold`,N.createElement(N.Fragment,null,N.createElement(`path`,{d:`M144,128a16,16,0,1,1-16-16A16,16,0,0,1,144,128ZM60,112a16,16,0,1,0,16,16A16,16,0,0,0,60,112Zm136,0a16,16,0,1,0,16,16A16,16,0,0,0,196,112Z`}))],[`duotone`,N.createElement(N.Fragment,null,N.createElement(`path`,{d:`M240,96v64a16,16,0,0,1-16,16H32a16,16,0,0,1-16-16V96A16,16,0,0,1,32,80H224A16,16,0,0,1,240,96Z`,opacity:`0.2`}),N.createElement(`path`,{d:`M140,128a12,12,0,1,1-12-12A12,12,0,0,1,140,128Zm56-12a12,12,0,1,0,12,12A12,12,0,0,0,196,116ZM60,116a12,12,0,1,0,12,12A12,12,0,0,0,60,116Z`}))],[`fill`,N.createElement(N.Fragment,null,N.createElement(`path`,{d:`M224,80H32A16,16,0,0,0,16,96v64a16,16,0,0,0,16,16H224a16,16,0,0,0,16-16V96A16,16,0,0,0,224,80ZM60,140a12,12,0,1,1,12-12A12,12,0,0,1,60,140Zm68,0a12,12,0,1,1,12-12A12,12,0,0,1,128,140Zm68,0a12,12,0,1,1,12-12A12,12,0,0,1,196,140Z`}))],[`light`,N.createElement(N.Fragment,null,N.createElement(`path`,{d:`M138,128a10,10,0,1,1-10-10A10,10,0,0,1,138,128ZM60,118a10,10,0,1,0,10,10A10,10,0,0,0,60,118Zm136,0a10,10,0,1,0,10,10A10,10,0,0,0,196,118Z`}))],[`regular`,N.createElement(N.Fragment,null,N.createElement(`path`,{d:`M140,128a12,12,0,1,1-12-12A12,12,0,0,1,140,128Zm56-12a12,12,0,1,0,12,12A12,12,0,0,0,196,116ZM60,116a12,12,0,1,0,12,12A12,12,0,0,0,60,116Z`}))],[`thin`,N.createElement(N.Fragment,null,N.createElement(`path`,{d:`M136,128a8,8,0,1,1-8-8A8,8,0,0,1,136,128Zm-76-8a8,8,0,1,0,8,8A8,8,0,0,0,60,120Zm136,0a8,8,0,1,0,8,8A8,8,0,0,0,196,120Z`}))]]),Wj=new Map([[`bold`,N.createElement(N.Fragment,null,N.createElement(`path`,{d:`M232.49,215.51,185,168a92.12,92.12,0,1,0-17,17l47.53,47.54a12,12,0,0,0,17-17ZM44,112a68,68,0,1,1,68,68A68.07,68.07,0,0,1,44,112Z`}))],[`duotone`,N.createElement(N.Fragment,null,N.createElement(`path`,{d:`M192,112a80,80,0,1,1-80-80A80,80,0,0,1,192,112Z`,opacity:`0.2`}),N.createElement(`path`,{d:`M229.66,218.34,179.6,168.28a88.21,88.21,0,1,0-11.32,11.31l50.06,50.07a8,8,0,0,0,11.32-11.32ZM40,112a72,72,0,1,1,72,72A72.08,72.08,0,0,1,40,112Z`}))],[`fill`,N.createElement(N.Fragment,null,N.createElement(`path`,{d:`M168,112a56,56,0,1,1-56-56A56,56,0,0,1,168,112Zm61.66,117.66a8,8,0,0,1-11.32,0l-50.06-50.07a88,88,0,1,1,11.32-11.31l50.06,50.06A8,8,0,0,1,229.66,229.66ZM112,184a72,72,0,1,0-72-72A72.08,72.08,0,0,0,112,184Z`}))],[`light`,N.createElement(N.Fragment,null,N.createElement(`path`,{d:`M228.24,219.76l-51.38-51.38a86.15,86.15,0,1,0-8.48,8.48l51.38,51.38a6,6,0,0,0,8.48-8.48ZM38,112a74,74,0,1,1,74,74A74.09,74.09,0,0,1,38,112Z`}))],[`regular`,N.createElement(N.Fragment,null,N.createElement(`path`,{d:`M229.66,218.34l-50.07-50.06a88.11,88.11,0,1,0-11.31,11.31l50.06,50.07a8,8,0,0,0,11.32-11.32ZM40,112a72,72,0,1,1,72,72A72.08,72.08,0,0,1,40,112Z`}))],[`thin`,N.createElement(N.Fragment,null,N.createElement(`path`,{d:`M226.83,221.17l-52.7-52.7a84.1,84.1,0,1,0-5.66,5.66l52.7,52.7a4,4,0,0,0,5.66-5.66ZM36,112a76,76,0,1,1,76,76A76.08,76.08,0,0,1,36,112Z`}))]]),Gj=new Map([[`bold`,N.createElement(N.Fragment,null,N.createElement(`path`,{d:`M236.37,139.4a12,12,0,0,0-12-3A84.07,84.07,0,0,1,119.6,31.59a12,12,0,0,0-15-15A108.86,108.86,0,0,0,49.69,55.07,108,108,0,0,0,136,228a107.09,107.09,0,0,0,64.93-21.69,108.86,108.86,0,0,0,38.44-54.94A12,12,0,0,0,236.37,139.4Zm-49.88,47.74A84,84,0,0,1,68.86,69.51,84.93,84.93,0,0,1,92.27,48.29Q92,52.13,92,56A108.12,108.12,0,0,0,200,164q3.87,0,7.71-.27A84.79,84.79,0,0,1,186.49,187.14Z`}))],[`duotone`,N.createElement(N.Fragment,null,N.createElement(`path`,{d:`M227.89,147.89A96,96,0,1,1,108.11,28.11,96.09,96.09,0,0,0,227.89,147.89Z`,opacity:`0.2`}),N.createElement(`path`,{d:`M233.54,142.23a8,8,0,0,0-8-2,88.08,88.08,0,0,1-109.8-109.8,8,8,0,0,0-10-10,104.84,104.84,0,0,0-52.91,37A104,104,0,0,0,136,224a103.09,103.09,0,0,0,62.52-20.88,104.84,104.84,0,0,0,37-52.91A8,8,0,0,0,233.54,142.23ZM188.9,190.34A88,88,0,0,1,65.66,67.11a89,89,0,0,1,31.4-26A106,106,0,0,0,96,56,104.11,104.11,0,0,0,200,160a106,106,0,0,0,14.92-1.06A89,89,0,0,1,188.9,190.34Z`}))],[`fill`,N.createElement(N.Fragment,null,N.createElement(`path`,{d:`M235.54,150.21a104.84,104.84,0,0,1-37,52.91A104,104,0,0,1,32,120,103.09,103.09,0,0,1,52.88,57.48a104.84,104.84,0,0,1,52.91-37,8,8,0,0,1,10,10,88.08,88.08,0,0,0,109.8,109.8,8,8,0,0,1,10,10Z`}))],[`light`,N.createElement(N.Fragment,null,N.createElement(`path`,{d:`M232.13,143.64a6,6,0,0,0-6-1.49A90.07,90.07,0,0,1,113.86,29.85a6,6,0,0,0-7.49-7.48A102.88,102.88,0,0,0,54.48,58.68,102,102,0,0,0,197.32,201.52a102.88,102.88,0,0,0,36.31-51.89A6,6,0,0,0,232.13,143.64Zm-42,48.29a90,90,0,0,1-126-126A90.9,90.9,0,0,1,99.65,37.66,102.06,102.06,0,0,0,218.34,156.35,90.9,90.9,0,0,1,190.1,191.93Z`}))],[`regular`,N.createElement(N.Fragment,null,N.createElement(`path`,{d:`M233.54,142.23a8,8,0,0,0-8-2,88.08,88.08,0,0,1-109.8-109.8,8,8,0,0,0-10-10,104.84,104.84,0,0,0-52.91,37A104,104,0,0,0,136,224a103.09,103.09,0,0,0,62.52-20.88,104.84,104.84,0,0,0,37-52.91A8,8,0,0,0,233.54,142.23ZM188.9,190.34A88,88,0,0,1,65.66,67.11a89,89,0,0,1,31.4-26A106,106,0,0,0,96,56,104.11,104.11,0,0,0,200,160a106,106,0,0,0,14.92-1.06A89,89,0,0,1,188.9,190.34Z`}))],[`thin`,N.createElement(N.Fragment,null,N.createElement(`path`,{d:`M230.72,145.06a4,4,0,0,0-4-1A92.08,92.08,0,0,1,111.94,29.27a4,4,0,0,0-5-5A100.78,100.78,0,0,0,56.08,59.88a100,100,0,0,0,140,140,100.78,100.78,0,0,0,35.59-50.87A4,4,0,0,0,230.72,145.06ZM191.3,193.53A92,92,0,0,1,62.47,64.7a93,93,0,0,1,39.88-30.35,100.09,100.09,0,0,0,119.3,119.3A93,93,0,0,1,191.3,193.53Z`}))]]),Kj=new Map([[`bold`,N.createElement(N.Fragment,null,N.createElement(`path`,{d:`M230.14,70.54,185.46,25.85a20,20,0,0,0-28.29,0L33.86,149.17A19.85,19.85,0,0,0,28,163.31V208a20,20,0,0,0,20,20H92.69a19.86,19.86,0,0,0,14.14-5.86L230.14,98.82a20,20,0,0,0,0-28.28ZM91,204H52V165l84-84,39,39ZM192,103,153,64l18.34-18.34,39,39Z`}))],[`duotone`,N.createElement(N.Fragment,null,N.createElement(`path`,{d:`M221.66,90.34,192,120,136,64l29.66-29.66a8,8,0,0,1,11.31,0L221.66,79A8,8,0,0,1,221.66,90.34Z`,opacity:`0.2`}),N.createElement(`path`,{d:`M227.31,73.37,182.63,28.68a16,16,0,0,0-22.63,0L36.69,152A15.86,15.86,0,0,0,32,163.31V208a16,16,0,0,0,16,16H92.69A15.86,15.86,0,0,0,104,219.31L227.31,96a16,16,0,0,0,0-22.63ZM92.69,208H48V163.31l88-88L180.69,120ZM192,108.68,147.31,64l24-24L216,84.68Z`}))],[`fill`,N.createElement(N.Fragment,null,N.createElement(`path`,{d:`M227.31,73.37,182.63,28.68a16,16,0,0,0-22.63,0L36.69,152A15.86,15.86,0,0,0,32,163.31V208a16,16,0,0,0,16,16H92.69A15.86,15.86,0,0,0,104,219.31L227.31,96a16,16,0,0,0,0-22.63ZM192,108.68,147.31,64l24-24L216,84.68Z`}))],[`light`,N.createElement(N.Fragment,null,N.createElement(`path`,{d:`M225.9,74.78,181.21,30.09a14,14,0,0,0-19.8,0L38.1,153.41a13.94,13.94,0,0,0-4.1,9.9V208a14,14,0,0,0,14,14H92.69a13.94,13.94,0,0,0,9.9-4.1L225.9,94.58a14,14,0,0,0,0-19.8ZM94.1,209.41a2,2,0,0,1-1.41.59H48a2,2,0,0,1-2-2V163.31a2,2,0,0,1,.59-1.41L136,72.48,183.51,120ZM217.41,86.1,192,111.51,144.49,64,169.9,38.58a2,2,0,0,1,2.83,0l44.68,44.69a2,2,0,0,1,0,2.83Z`}))],[`regular`,N.createElement(N.Fragment,null,N.createElement(`path`,{d:`M227.31,73.37,182.63,28.68a16,16,0,0,0-22.63,0L36.69,152A15.86,15.86,0,0,0,32,163.31V208a16,16,0,0,0,16,16H92.69A15.86,15.86,0,0,0,104,219.31L227.31,96a16,16,0,0,0,0-22.63ZM92.69,208H48V163.31l88-88L180.69,120ZM192,108.68,147.31,64l24-24L216,84.68Z`}))],[`thin`,N.createElement(N.Fragment,null,N.createElement(`path`,{d:`M224.49,76.2,179.8,31.51a12,12,0,0,0-17,0L133.17,61.17h0L39.52,154.83A11.9,11.9,0,0,0,36,163.31V208a12,12,0,0,0,12,12H92.69a12,12,0,0,0,8.48-3.51L224.48,93.17a12,12,0,0,0,0-17Zm-129,134.63A4,4,0,0,1,92.69,212H48a4,4,0,0,1-4-4V163.31a4,4,0,0,1,1.17-2.83L136,69.65,186.34,120ZM218.83,87.51,192,114.34,141.66,64l26.82-26.83a4,4,0,0,1,5.66,0l44.69,44.68a4,4,0,0,1,0,5.66Z`}))]]),qj=new Map([[`bold`,N.createElement(N.Fragment,null,N.createElement(`path`,{d:`M240.49,15.51a12,12,0,0,0-17,0L173.94,65.09l-2.54-2.55a36.05,36.05,0,0,0-50.91,0L100,83l-3.51-3.52a12,12,0,0,0-17,17L83,100,62.54,120.49a36,36,0,0,0,0,50.91l2.55,2.54L15.51,223.51a12,12,0,0,0,17,17l49.57-49.58,2.54,2.55a36.06,36.06,0,0,0,50.91,0L156,173l3.51,3.52a12,12,0,0,0,17-17L173,156l20.49-20.49a36,36,0,0,0,0-50.91l-2.55-2.54,49.58-49.57A12,12,0,0,0,240.49,15.51Zm-121.95,161a12,12,0,0,1-17,0L79.51,154.43a12,12,0,0,1,0-17L100,117l39,39Zm58-57.95h0L156,139l-39-39,20.49-20.49a12,12,0,0,1,17,0l22.06,22.06a12,12,0,0,1,0,17ZM85.27,33.37a12,12,0,0,1,21.46-10.74l8,16A12,12,0,1,1,93.27,49.37Zm-68,57.26a12,12,0,0,1,16.1-5.36l16,8a12,12,0,1,1-10.74,21.46l-16-8A12,12,0,0,1,17.27,90.63Zm221.46,74.74a12,12,0,0,1-16.1,5.36l-16-8a12,12,0,0,1,10.74-21.46l16,8A12,12,0,0,1,238.73,165.37Zm-68,57.26a12,12,0,1,1-21.46,10.74l-8-16a12,12,0,0,1,21.46-10.74Z`}))],[`duotone`,N.createElement(N.Fragment,null,N.createElement(`path`,{d:`M185,127,127,185a24,24,0,0,1-33.94,0L71,162.91A24,24,0,0,1,71,129L129,71a24,24,0,0,1,33.94,0L185,93.09A24,24,0,0,1,185,127Z`,opacity:`0.2`}),N.createElement(`path`,{d:`M237.66,18.34a8,8,0,0,0-11.32,0l-52.4,52.41-5.37-5.38a32.05,32.05,0,0,0-45.26,0L100,88.69l-6.34-6.35A8,8,0,0,0,82.34,93.66L88.69,100,65.37,123.31a32,32,0,0,0,0,45.26l5.38,5.37-52.41,52.4a8,8,0,0,0,11.32,11.32l52.4-52.41,5.37,5.38a32.06,32.06,0,0,0,45.26,0L156,167.31l6.34,6.35a8,8,0,0,0,11.32-11.32L167.31,156l23.32-23.31a32,32,0,0,0,0-45.26l-5.38-5.37,52.41-52.4A8,8,0,0,0,237.66,18.34Zm-116.29,161a16,16,0,0,1-22.62,0L76.69,157.25a16,16,0,0,1,0-22.62L100,111.31,144.69,156Zm57.94-57.94h0L156,144.69,111.31,100l23.32-23.31a16,16,0,0,1,22.62,0l22.06,22a16,16,0,0,1,0,22.63ZM88.57,35A8,8,0,0,1,103.43,29l8,20A8,8,0,0,1,96.57,55ZM24.57,93A8,8,0,0,1,35,88.57l20,8A8,8,0,0,1,49,111.43l-20-8A8,8,0,0,1,24.57,93ZM231.43,163a8,8,0,0,1-10.4,4.46l-20-8A8,8,0,1,1,207,144.57l20,8A8,8,0,0,1,231.43,163Zm-64,58.06A8,8,0,0,1,152.57,227l-8-20A8,8,0,0,1,159.43,201Z`}))],[`fill`,N.createElement(N.Fragment,null,N.createElement(`path`,{d:`M88.57,35A8,8,0,0,1,103.43,29l8,20A8,8,0,0,1,96.57,55ZM29,103.43l20,8A8,8,0,1,0,55,96.57l-20-8A8,8,0,0,0,29,103.43ZM227,152.57l-20-8A8,8,0,1,0,201,159.43l20,8A8,8,0,0,0,227,152.57ZM159.43,201A8,8,0,0,0,144.57,207l8,20A8,8,0,1,0,167.43,221ZM237.91,18.52a8,8,0,0,0-11.5-.18L174,70.75l-5.38-5.38a32,32,0,0,0-45.28,0L106.14,82.54a4,4,0,0,0,0,5.66l61.7,61.66a4,4,0,0,0,5.66,0l16.74-16.74a32.76,32.76,0,0,0,9.81-22.52,31.82,31.82,0,0,0-9.37-23.17l-5.38-5.37,52.2-52.17A8.22,8.22,0,0,0,237.91,18.52ZM85.64,90.34a8,8,0,0,0-11.49.18,8.22,8.22,0,0,0,.41,11.37L80.67,108,65.34,123.31A31.82,31.82,0,0,0,56,146.47,32.75,32.75,0,0,0,65.77,169l5,4.94L18.49,226.13a8.21,8.21,0,0,0-.61,11.1,8,8,0,0,0,11.72.43L82,185.25l5.37,5.38a32.1,32.1,0,0,0,45.29,0L148,175.31l6.34,6.35a8,8,0,0,0,11.32-11.32Z`}))],[`light`,N.createElement(N.Fragment,null,N.createElement(`path`,{d:`M236.24,19.76a6,6,0,0,0-8.48,0L173.94,73.57l-6.79-6.78a30,30,0,0,0-42.42,0L100,91.51l-7.76-7.75a6,6,0,0,0-8.48,8.48L91.51,100,66.79,124.73a30,30,0,0,0,0,42.42l6.78,6.79L19.76,227.76a6,6,0,1,0,8.48,8.48l53.82-53.81,6.79,6.78a30,30,0,0,0,42.42,0L156,164.49l7.76,7.75a6,6,0,0,0,8.48-8.48L164.49,156l24.72-24.73a30,30,0,0,0,0-42.42l-6.78-6.79,53.81-53.82A6,6,0,0,0,236.24,19.76Zm-113.45,161a18,18,0,0,1-25.46,0L75.27,158.67a18,18,0,0,1,0-25.46L100,108.49,147.51,156Zm57.94-57.94L156,147.51,108.49,100l24.72-24.73a18,18,0,0,1,25.46,0l22.06,22.06a18,18,0,0,1,0,25.46ZM90.43,34.23a6,6,0,0,1,11.14-4.46l8,20a6,6,0,1,1-11.14,4.46Zm-64,59.54a6,6,0,0,1,7.8-3.34l20,8a6,6,0,1,1-4.46,11.14l-20-8A6,6,0,0,1,26.43,93.77Zm203.14,68.46a6,6,0,0,1-7.8,3.34l-20-8a6,6,0,0,1,4.46-11.14l20,8A6,6,0,0,1,229.57,162.23Zm-64,59.54a6,6,0,1,1-11.14,4.46l-8-20a6,6,0,0,1,11.14-4.46Z`}))],[`regular`,N.createElement(N.Fragment,null,N.createElement(`path`,{d:`M237.66,18.34a8,8,0,0,0-11.32,0l-52.4,52.41-5.37-5.38a32.05,32.05,0,0,0-45.26,0L100,88.69l-6.34-6.35A8,8,0,0,0,82.34,93.66L88.69,100,65.37,123.31a32,32,0,0,0,0,45.26l5.38,5.37-52.41,52.4a8,8,0,0,0,11.32,11.32l52.4-52.41,5.37,5.38a32,32,0,0,0,45.26,0L156,167.31l6.34,6.35a8,8,0,0,0,11.32-11.32L167.31,156l23.32-23.31a32,32,0,0,0,0-45.26l-5.38-5.37,52.41-52.4A8,8,0,0,0,237.66,18.34Zm-116.29,161a16,16,0,0,1-22.62,0L76.69,157.25a16,16,0,0,1,0-22.62L100,111.31,144.69,156Zm57.94-57.94L156,144.69,111.31,100l23.32-23.31a16,16,0,0,1,22.62,0l22.06,22A16,16,0,0,1,179.31,121.37ZM88.57,35A8,8,0,0,1,103.43,29l8,20A8,8,0,0,1,96.57,55ZM24.57,93A8,8,0,0,1,35,88.57l20,8A8,8,0,0,1,49,111.43l-20-8A8,8,0,0,1,24.57,93ZM231.43,163a8,8,0,0,1-10.4,4.46l-20-8A8,8,0,1,1,207,144.57l20,8A8,8,0,0,1,231.43,163Zm-64,58.06A8,8,0,0,1,152.57,227l-8-20A8,8,0,0,1,159.43,201Z`}))],[`thin`,N.createElement(N.Fragment,null,N.createElement(`path`,{d:`M234.83,21.17a4,4,0,0,0-5.66,0L173.94,76.4l-8.2-8.2a28,28,0,0,0-39.6,0L100,94.34l-9.17-9.17a4,4,0,0,0-5.66,5.66L94.34,100,68.2,126.14a28,28,0,0,0,0,39.6l8.2,8.2L21.17,229.17a4,4,0,0,0,5.66,5.66L82.06,179.6l8.2,8.2a28,28,0,0,0,39.6,0L156,161.66l9.17,9.17a4,4,0,0,0,5.66-5.66L161.66,156l26.14-26.14a28,28,0,0,0,0-39.6l-8.2-8.2,55.23-55.23A4,4,0,0,0,234.83,21.17Zm-110.63,161a20,20,0,0,1-28.28,0L73.86,160.08a20,20,0,0,1,0-28.28L100,105.66,150.34,156Zm57.94-57.94L156,150.34,105.66,100,131.8,73.86a20,20,0,0,1,28.28,0l22.06,22.06A20,20,0,0,1,182.14,124.2ZM92.29,33.49a4,4,0,1,1,7.42-3l8,20a4,4,0,0,1-2.22,5.2A3.91,3.91,0,0,1,104,56a4,4,0,0,1-3.71-2.51Zm-64,61a4,4,0,0,1,5.2-2.22l20,8A4,4,0,0,1,52,108a3.91,3.91,0,0,1-1.49-.29l-20-8A4,4,0,0,1,28.29,94.51Zm199.42,67A4,4,0,0,1,224,164a3.91,3.91,0,0,1-1.49-.29l-20-8a4,4,0,1,1,3-7.42l20,8A4,4,0,0,1,227.71,161.49Zm-64,61a4,4,0,0,1-2.22,5.2A3.91,3.91,0,0,1,160,228a4,4,0,0,1-3.71-2.51l-8-20a4,4,0,0,1,7.42-3Z`}))]]),Jj=new Map([[`bold`,N.createElement(N.Fragment,null,N.createElement(`path`,{d:`M228,128a12,12,0,0,1-12,12H140v76a12,12,0,0,1-24,0V140H40a12,12,0,0,1,0-24h76V40a12,12,0,0,1,24,0v76h76A12,12,0,0,1,228,128Z`}))],[`duotone`,N.createElement(N.Fragment,null,N.createElement(`path`,{d:`M216,56V200a16,16,0,0,1-16,16H56a16,16,0,0,1-16-16V56A16,16,0,0,1,56,40H200A16,16,0,0,1,216,56Z`,opacity:`0.2`}),N.createElement(`path`,{d:`M224,128a8,8,0,0,1-8,8H136v80a8,8,0,0,1-16,0V136H40a8,8,0,0,1,0-16h80V40a8,8,0,0,1,16,0v80h80A8,8,0,0,1,224,128Z`}))],[`fill`,N.createElement(N.Fragment,null,N.createElement(`path`,{d:`M208,32H48A16,16,0,0,0,32,48V208a16,16,0,0,0,16,16H208a16,16,0,0,0,16-16V48A16,16,0,0,0,208,32ZM184,136H136v48a8,8,0,0,1-16,0V136H72a8,8,0,0,1,0-16h48V72a8,8,0,0,1,16,0v48h48a8,8,0,0,1,0,16Z`}))],[`light`,N.createElement(N.Fragment,null,N.createElement(`path`,{d:`M222,128a6,6,0,0,1-6,6H134v82a6,6,0,0,1-12,0V134H40a6,6,0,0,1,0-12h82V40a6,6,0,0,1,12,0v82h82A6,6,0,0,1,222,128Z`}))],[`regular`,N.createElement(N.Fragment,null,N.createElement(`path`,{d:`M224,128a8,8,0,0,1-8,8H136v80a8,8,0,0,1-16,0V136H40a8,8,0,0,1,0-16h80V40a8,8,0,0,1,16,0v80h80A8,8,0,0,1,224,128Z`}))],[`thin`,N.createElement(N.Fragment,null,N.createElement(`path`,{d:`M220,128a4,4,0,0,1-4,4H132v84a4,4,0,0,1-8,0V132H40a4,4,0,0,1,0-8h84V40a4,4,0,0,1,8,0v84h84A4,4,0,0,1,220,128Z`}))]]),Yj=new Map([[`bold`,N.createElement(N.Fragment,null,N.createElement(`path`,{d:`M124,216a12,12,0,0,1-12,12H48a12,12,0,0,1-12-12V40A12,12,0,0,1,48,28h64a12,12,0,0,1,0,24H60V204h52A12,12,0,0,1,124,216Zm108.49-96.49-40-40a12,12,0,0,0-17,17L195,116H112a12,12,0,0,0,0,24h83l-19.52,19.51a12,12,0,0,0,17,17l40-40A12,12,0,0,0,232.49,119.51Z`}))],[`duotone`,N.createElement(N.Fragment,null,N.createElement(`path`,{d:`M224,56V200a16,16,0,0,1-16,16H48V40H208A16,16,0,0,1,224,56Z`,opacity:`0.2`}),N.createElement(`path`,{d:`M120,216a8,8,0,0,1-8,8H48a8,8,0,0,1-8-8V40a8,8,0,0,1,8-8h64a8,8,0,0,1,0,16H56V208h56A8,8,0,0,1,120,216Zm109.66-93.66-40-40a8,8,0,0,0-11.32,11.32L204.69,120H112a8,8,0,0,0,0,16h92.69l-26.35,26.34a8,8,0,0,0,11.32,11.32l40-40A8,8,0,0,0,229.66,122.34Z`}))],[`fill`,N.createElement(N.Fragment,null,N.createElement(`path`,{d:`M120,216a8,8,0,0,1-8,8H48a8,8,0,0,1-8-8V40a8,8,0,0,1,8-8h64a8,8,0,0,1,0,16H56V208h56A8,8,0,0,1,120,216Zm109.66-93.66-40-40A8,8,0,0,0,176,88v32H112a8,8,0,0,0,0,16h64v32a8,8,0,0,0,13.66,5.66l40-40A8,8,0,0,0,229.66,122.34Z`}))],[`light`,N.createElement(N.Fragment,null,N.createElement(`path`,{d:`M118,216a6,6,0,0,1-6,6H48a6,6,0,0,1-6-6V40a6,6,0,0,1,6-6h64a6,6,0,0,1,0,12H54V210h58A6,6,0,0,1,118,216Zm110.24-92.24-40-40a6,6,0,0,0-8.48,8.48L209.51,122H112a6,6,0,0,0,0,12h97.51l-29.75,29.76a6,6,0,1,0,8.48,8.48l40-40A6,6,0,0,0,228.24,123.76Z`}))],[`regular`,N.createElement(N.Fragment,null,N.createElement(`path`,{d:`M120,216a8,8,0,0,1-8,8H48a8,8,0,0,1-8-8V40a8,8,0,0,1,8-8h64a8,8,0,0,1,0,16H56V208h56A8,8,0,0,1,120,216Zm109.66-93.66-40-40a8,8,0,0,0-11.32,11.32L204.69,120H112a8,8,0,0,0,0,16h92.69l-26.35,26.34a8,8,0,0,0,11.32,11.32l40-40A8,8,0,0,0,229.66,122.34Z`}))],[`thin`,N.createElement(N.Fragment,null,N.createElement(`path`,{d:`M116,216a4,4,0,0,1-4,4H48a4,4,0,0,1-4-4V40a4,4,0,0,1,4-4h64a4,4,0,0,1,0,8H52V212h60A4,4,0,0,1,116,216Zm110.83-90.83-40-40a4,4,0,0,0-5.66,5.66L214.34,124H112a4,4,0,0,0,0,8H214.34l-33.17,33.17a4,4,0,0,0,5.66,5.66l40-40A4,4,0,0,0,226.83,125.17Z`}))]]),Xj=new Map([[`bold`,N.createElement(N.Fragment,null,N.createElement(`path`,{d:`M199,125.31l-49.88-18.39L130.69,57a19.92,19.92,0,0,0-37.38,0L74.92,106.92,25,125.31a19.92,19.92,0,0,0,0,37.38l49.88,18.39L93.31,231a19.92,19.92,0,0,0,37.38,0l18.39-49.88L199,162.69a19.92,19.92,0,0,0,0-37.38Zm-63.38,35.16a12,12,0,0,0-7.11,7.11L112,212.28l-16.47-44.7a12,12,0,0,0-7.11-7.11L43.72,144l44.7-16.47a12,12,0,0,0,7.11-7.11L112,75.72l16.47,44.7a12,12,0,0,0,7.11,7.11L180.28,144ZM140,40a12,12,0,0,1,12-12h12V16a12,12,0,0,1,24,0V28h12a12,12,0,0,1,0,24H188V64a12,12,0,0,1-24,0V52H152A12,12,0,0,1,140,40ZM252,88a12,12,0,0,1-12,12h-4v4a12,12,0,0,1-24,0v-4h-4a12,12,0,0,1,0-24h4V72a12,12,0,0,1,24,0v4h4A12,12,0,0,1,252,88Z`}))],[`duotone`,N.createElement(N.Fragment,null,N.createElement(`path`,{d:`M194.82,151.43l-55.09,20.3-20.3,55.09a7.92,7.92,0,0,1-14.86,0l-20.3-55.09-55.09-20.3a7.92,7.92,0,0,1,0-14.86l55.09-20.3,20.3-55.09a7.92,7.92,0,0,1,14.86,0l20.3,55.09,55.09,20.3A7.92,7.92,0,0,1,194.82,151.43Z`,opacity:`0.2`}),N.createElement(`path`,{d:`M197.58,129.06,146,110l-19-51.62a15.92,15.92,0,0,0-29.88,0L78,110l-51.62,19a15.92,15.92,0,0,0,0,29.88L78,178l19,51.62a15.92,15.92,0,0,0,29.88,0L146,178l51.62-19a15.92,15.92,0,0,0,0-29.88ZM137,164.22a8,8,0,0,0-4.74,4.74L112,223.85,91.78,169A8,8,0,0,0,87,164.22L32.15,144,87,123.78A8,8,0,0,0,91.78,119L112,64.15,132.22,119a8,8,0,0,0,4.74,4.74L191.85,144ZM144,40a8,8,0,0,1,8-8h16V16a8,8,0,0,1,16,0V32h16a8,8,0,0,1,0,16H184V64a8,8,0,0,1-16,0V48H152A8,8,0,0,1,144,40ZM248,88a8,8,0,0,1-8,8h-8v8a8,8,0,0,1-16,0V96h-8a8,8,0,0,1,0-16h8V72a8,8,0,0,1,16,0v8h8A8,8,0,0,1,248,88Z`}))],[`fill`,N.createElement(N.Fragment,null,N.createElement(`path`,{d:`M208,144a15.78,15.78,0,0,1-10.42,14.94L146,178l-19,51.62a15.92,15.92,0,0,1-29.88,0L78,178l-51.62-19a15.92,15.92,0,0,1,0-29.88L78,110l19-51.62a15.92,15.92,0,0,1,29.88,0L146,110l51.62,19A15.78,15.78,0,0,1,208,144ZM152,48h16V64a8,8,0,0,0,16,0V48h16a8,8,0,0,0,0-16H184V16a8,8,0,0,0-16,0V32H152a8,8,0,0,0,0,16Zm88,32h-8V72a8,8,0,0,0-16,0v8h-8a8,8,0,0,0,0,16h8v8a8,8,0,0,0,16,0V96h8a8,8,0,0,0,0-16Z`}))],[`light`,N.createElement(N.Fragment,null,N.createElement(`path`,{d:`M196.89,130.94,144.4,111.6,125.06,59.11a13.92,13.92,0,0,0-26.12,0L79.6,111.6,27.11,130.94a13.92,13.92,0,0,0,0,26.12L79.6,176.4l19.34,52.49a13.92,13.92,0,0,0,26.12,0L144.4,176.4l52.49-19.34a13.92,13.92,0,0,0,0-26.12Zm-4.15,14.86-55.08,20.3a6,6,0,0,0-3.56,3.56l-20.3,55.08a1.92,1.92,0,0,1-3.6,0L89.9,169.66a6,6,0,0,0-3.56-3.56L31.26,145.8a1.92,1.92,0,0,1,0-3.6l55.08-20.3a6,6,0,0,0,3.56-3.56l20.3-55.08a1.92,1.92,0,0,1,3.6,0l20.3,55.08a6,6,0,0,0,3.56,3.56l55.08,20.3a1.92,1.92,0,0,1,0,3.6ZM146,40a6,6,0,0,1,6-6h18V16a6,6,0,0,1,12,0V34h18a6,6,0,0,1,0,12H182V64a6,6,0,0,1-12,0V46H152A6,6,0,0,1,146,40ZM246,88a6,6,0,0,1-6,6H230v10a6,6,0,0,1-12,0V94H208a6,6,0,0,1,0-12h10V72a6,6,0,0,1,12,0V82h10A6,6,0,0,1,246,88Z`}))],[`regular`,N.createElement(N.Fragment,null,N.createElement(`path`,{d:`M197.58,129.06,146,110l-19-51.62a15.92,15.92,0,0,0-29.88,0L78,110l-51.62,19a15.92,15.92,0,0,0,0,29.88L78,178l19,51.62a15.92,15.92,0,0,0,29.88,0L146,178l51.62-19a15.92,15.92,0,0,0,0-29.88ZM137,164.22a8,8,0,0,0-4.74,4.74L112,223.85,91.78,169A8,8,0,0,0,87,164.22L32.15,144,87,123.78A8,8,0,0,0,91.78,119L112,64.15,132.22,119a8,8,0,0,0,4.74,4.74L191.85,144ZM144,40a8,8,0,0,1,8-8h16V16a8,8,0,0,1,16,0V32h16a8,8,0,0,1,0,16H184V64a8,8,0,0,1-16,0V48H152A8,8,0,0,1,144,40ZM248,88a8,8,0,0,1-8,8h-8v8a8,8,0,0,1-16,0V96h-8a8,8,0,0,1,0-16h8V72a8,8,0,0,1,16,0v8h8A8,8,0,0,1,248,88Z`}))],[`thin`,N.createElement(N.Fragment,null,N.createElement(`path`,{d:`M196.2,132.81l-53.36-19.65L123.19,59.8a11.93,11.93,0,0,0-22.38,0L81.16,113.16,27.8,132.81a11.93,11.93,0,0,0,0,22.38l53.36,19.65,19.65,53.36a11.93,11.93,0,0,0,22.38,0l19.65-53.36,53.36-19.65a11.93,11.93,0,0,0,0-22.38Zm-2.77,14.87L138.35,168a4,4,0,0,0-2.37,2.37l-20.3,55.08a3.92,3.92,0,0,1-7.36,0L88,170.35A4,4,0,0,0,85.65,168l-55.08-20.3a3.92,3.92,0,0,1,0-7.36L85.65,120A4,4,0,0,0,88,117.65l20.3-55.08a3.92,3.92,0,0,1,7.36,0L136,117.65a4,4,0,0,0,2.37,2.37l55.08,20.3a3.92,3.92,0,0,1,0,7.36ZM148,40a4,4,0,0,1,4-4h20V16a4,4,0,0,1,8,0V36h20a4,4,0,0,1,0,8H180V64a4,4,0,0,1-8,0V44H152A4,4,0,0,1,148,40Zm96,48a4,4,0,0,1-4,4H228v12a4,4,0,0,1-8,0V92H208a4,4,0,0,1,0-8h12V72a4,4,0,0,1,8,0V84h12A4,4,0,0,1,244,88Z`}))]]),Zj=new Map([[`bold`,N.createElement(N.Fragment,null,N.createElement(`path`,{d:`M116,36V20a12,12,0,0,1,24,0V36a12,12,0,0,1-24,0Zm80,92a68,68,0,1,1-68-68A68.07,68.07,0,0,1,196,128Zm-24,0a44,44,0,1,0-44,44A44.05,44.05,0,0,0,172,128ZM51.51,68.49a12,12,0,1,0,17-17l-12-12a12,12,0,0,0-17,17Zm0,119-12,12a12,12,0,0,0,17,17l12-12a12,12,0,1,0-17-17ZM196,72a12,12,0,0,0,8.49-3.51l12-12a12,12,0,0,0-17-17l-12,12A12,12,0,0,0,196,72Zm8.49,115.51a12,12,0,0,0-17,17l12,12a12,12,0,0,0,17-17ZM48,128a12,12,0,0,0-12-12H20a12,12,0,0,0,0,24H36A12,12,0,0,0,48,128Zm80,80a12,12,0,0,0-12,12v16a12,12,0,0,0,24,0V220A12,12,0,0,0,128,208Zm108-92H220a12,12,0,0,0,0,24h16a12,12,0,0,0,0-24Z`}))],[`duotone`,N.createElement(N.Fragment,null,N.createElement(`path`,{d:`M184,128a56,56,0,1,1-56-56A56,56,0,0,1,184,128Z`,opacity:`0.2`}),N.createElement(`path`,{d:`M120,40V16a8,8,0,0,1,16,0V40a8,8,0,0,1-16,0Zm72,88a64,64,0,1,1-64-64A64.07,64.07,0,0,1,192,128Zm-16,0a48,48,0,1,0-48,48A48.05,48.05,0,0,0,176,128ZM58.34,69.66A8,8,0,0,0,69.66,58.34l-16-16A8,8,0,0,0,42.34,53.66Zm0,116.68-16,16a8,8,0,0,0,11.32,11.32l16-16a8,8,0,0,0-11.32-11.32ZM192,72a8,8,0,0,0,5.66-2.34l16-16a8,8,0,0,0-11.32-11.32l-16,16A8,8,0,0,0,192,72Zm5.66,114.34a8,8,0,0,0-11.32,11.32l16,16a8,8,0,0,0,11.32-11.32ZM48,128a8,8,0,0,0-8-8H16a8,8,0,0,0,0,16H40A8,8,0,0,0,48,128Zm80,80a8,8,0,0,0-8,8v24a8,8,0,0,0,16,0V216A8,8,0,0,0,128,208Zm112-88H216a8,8,0,0,0,0,16h24a8,8,0,0,0,0-16Z`}))],[`fill`,N.createElement(N.Fragment,null,N.createElement(`path`,{d:`M120,40V16a8,8,0,0,1,16,0V40a8,8,0,0,1-16,0Zm8,24a64,64,0,1,0,64,64A64.07,64.07,0,0,0,128,64ZM58.34,69.66A8,8,0,0,0,69.66,58.34l-16-16A8,8,0,0,0,42.34,53.66Zm0,116.68-16,16a8,8,0,0,0,11.32,11.32l16-16a8,8,0,0,0-11.32-11.32ZM192,72a8,8,0,0,0,5.66-2.34l16-16a8,8,0,0,0-11.32-11.32l-16,16A8,8,0,0,0,192,72Zm5.66,114.34a8,8,0,0,0-11.32,11.32l16,16a8,8,0,0,0,11.32-11.32ZM48,128a8,8,0,0,0-8-8H16a8,8,0,0,0,0,16H40A8,8,0,0,0,48,128Zm80,80a8,8,0,0,0-8,8v24a8,8,0,0,0,16,0V216A8,8,0,0,0,128,208Zm112-88H216a8,8,0,0,0,0,16h24a8,8,0,0,0,0-16Z`}))],[`light`,N.createElement(N.Fragment,null,N.createElement(`path`,{d:`M122,40V16a6,6,0,0,1,12,0V40a6,6,0,0,1-12,0Zm68,88a62,62,0,1,1-62-62A62.07,62.07,0,0,1,190,128Zm-12,0a50,50,0,1,0-50,50A50.06,50.06,0,0,0,178,128ZM59.76,68.24a6,6,0,1,0,8.48-8.48l-16-16a6,6,0,0,0-8.48,8.48Zm0,119.52-16,16a6,6,0,1,0,8.48,8.48l16-16a6,6,0,1,0-8.48-8.48ZM192,70a6,6,0,0,0,4.24-1.76l16-16a6,6,0,0,0-8.48-8.48l-16,16A6,6,0,0,0,192,70Zm4.24,117.76a6,6,0,0,0-8.48,8.48l16,16a6,6,0,0,0,8.48-8.48ZM46,128a6,6,0,0,0-6-6H16a6,6,0,0,0,0,12H40A6,6,0,0,0,46,128Zm82,82a6,6,0,0,0-6,6v24a6,6,0,0,0,12,0V216A6,6,0,0,0,128,210Zm112-88H216a6,6,0,0,0,0,12h24a6,6,0,0,0,0-12Z`}))],[`regular`,N.createElement(N.Fragment,null,N.createElement(`path`,{d:`M120,40V16a8,8,0,0,1,16,0V40a8,8,0,0,1-16,0Zm72,88a64,64,0,1,1-64-64A64.07,64.07,0,0,1,192,128Zm-16,0a48,48,0,1,0-48,48A48.05,48.05,0,0,0,176,128ZM58.34,69.66A8,8,0,0,0,69.66,58.34l-16-16A8,8,0,0,0,42.34,53.66Zm0,116.68-16,16a8,8,0,0,0,11.32,11.32l16-16a8,8,0,0,0-11.32-11.32ZM192,72a8,8,0,0,0,5.66-2.34l16-16a8,8,0,0,0-11.32-11.32l-16,16A8,8,0,0,0,192,72Zm5.66,114.34a8,8,0,0,0-11.32,11.32l16,16a8,8,0,0,0,11.32-11.32ZM48,128a8,8,0,0,0-8-8H16a8,8,0,0,0,0,16H40A8,8,0,0,0,48,128Zm80,80a8,8,0,0,0-8,8v24a8,8,0,0,0,16,0V216A8,8,0,0,0,128,208Zm112-88H216a8,8,0,0,0,0,16h24a8,8,0,0,0,0-16Z`}))],[`thin`,N.createElement(N.Fragment,null,N.createElement(`path`,{d:`M124,40V16a4,4,0,0,1,8,0V40a4,4,0,0,1-8,0Zm64,88a60,60,0,1,1-60-60A60.07,60.07,0,0,1,188,128Zm-8,0a52,52,0,1,0-52,52A52.06,52.06,0,0,0,180,128ZM61.17,66.83a4,4,0,0,0,5.66-5.66l-16-16a4,4,0,0,0-5.66,5.66Zm0,122.34-16,16a4,4,0,0,0,5.66,5.66l16-16a4,4,0,0,0-5.66-5.66ZM192,68a4,4,0,0,0,2.83-1.17l16-16a4,4,0,1,0-5.66-5.66l-16,16A4,4,0,0,0,192,68Zm2.83,121.17a4,4,0,0,0-5.66,5.66l16,16a4,4,0,0,0,5.66-5.66ZM40,124H16a4,4,0,0,0,0,8H40a4,4,0,0,0,0-8Zm88,88a4,4,0,0,0-4,4v24a4,4,0,0,0,8,0V216A4,4,0,0,0,128,212Zm112-88H216a4,4,0,0,0,0,8h24a4,4,0,0,0,0-8Z`}))]]),Qj=new Map([[`bold`,N.createElement(N.Fragment,null,N.createElement(`path`,{d:`M216,48H180V36A28,28,0,0,0,152,8H104A28,28,0,0,0,76,36V48H40a12,12,0,0,0,0,24h4V208a20,20,0,0,0,20,20H192a20,20,0,0,0,20-20V72h4a12,12,0,0,0,0-24ZM100,36a4,4,0,0,1,4-4h48a4,4,0,0,1,4,4V48H100Zm88,168H68V72H188ZM116,104v64a12,12,0,0,1-24,0V104a12,12,0,0,1,24,0Zm48,0v64a12,12,0,0,1-24,0V104a12,12,0,0,1,24,0Z`}))],[`duotone`,N.createElement(N.Fragment,null,N.createElement(`path`,{d:`M200,56V208a8,8,0,0,1-8,8H64a8,8,0,0,1-8-8V56Z`,opacity:`0.2`}),N.createElement(`path`,{d:`M216,48H176V40a24,24,0,0,0-24-24H104A24,24,0,0,0,80,40v8H40a8,8,0,0,0,0,16h8V208a16,16,0,0,0,16,16H192a16,16,0,0,0,16-16V64h8a8,8,0,0,0,0-16ZM96,40a8,8,0,0,1,8-8h48a8,8,0,0,1,8,8v8H96Zm96,168H64V64H192ZM112,104v64a8,8,0,0,1-16,0V104a8,8,0,0,1,16,0Zm48,0v64a8,8,0,0,1-16,0V104a8,8,0,0,1,16,0Z`}))],[`fill`,N.createElement(N.Fragment,null,N.createElement(`path`,{d:`M216,48H176V40a24,24,0,0,0-24-24H104A24,24,0,0,0,80,40v8H40a8,8,0,0,0,0,16h8V208a16,16,0,0,0,16,16H192a16,16,0,0,0,16-16V64h8a8,8,0,0,0,0-16ZM112,168a8,8,0,0,1-16,0V104a8,8,0,0,1,16,0Zm48,0a8,8,0,0,1-16,0V104a8,8,0,0,1,16,0Zm0-120H96V40a8,8,0,0,1,8-8h48a8,8,0,0,1,8,8Z`}))],[`light`,N.createElement(N.Fragment,null,N.createElement(`path`,{d:`M216,50H174V40a22,22,0,0,0-22-22H104A22,22,0,0,0,82,40V50H40a6,6,0,0,0,0,12H50V208a14,14,0,0,0,14,14H192a14,14,0,0,0,14-14V62h10a6,6,0,0,0,0-12ZM94,40a10,10,0,0,1,10-10h48a10,10,0,0,1,10,10V50H94ZM194,208a2,2,0,0,1-2,2H64a2,2,0,0,1-2-2V62H194ZM110,104v64a6,6,0,0,1-12,0V104a6,6,0,0,1,12,0Zm48,0v64a6,6,0,0,1-12,0V104a6,6,0,0,1,12,0Z`}))],[`regular`,N.createElement(N.Fragment,null,N.createElement(`path`,{d:`M216,48H176V40a24,24,0,0,0-24-24H104A24,24,0,0,0,80,40v8H40a8,8,0,0,0,0,16h8V208a16,16,0,0,0,16,16H192a16,16,0,0,0,16-16V64h8a8,8,0,0,0,0-16ZM96,40a8,8,0,0,1,8-8h48a8,8,0,0,1,8,8v8H96Zm96,168H64V64H192ZM112,104v64a8,8,0,0,1-16,0V104a8,8,0,0,1,16,0Zm48,0v64a8,8,0,0,1-16,0V104a8,8,0,0,1,16,0Z`}))],[`thin`,N.createElement(N.Fragment,null,N.createElement(`path`,{d:`M216,52H172V40a20,20,0,0,0-20-20H104A20,20,0,0,0,84,40V52H40a4,4,0,0,0,0,8H52V208a12,12,0,0,0,12,12H192a12,12,0,0,0,12-12V60h12a4,4,0,0,0,0-8ZM92,40a12,12,0,0,1,12-12h48a12,12,0,0,1,12,12V52H92ZM196,208a4,4,0,0,1-4,4H64a4,4,0,0,1-4-4V60H196ZM108,104v64a4,4,0,0,1-8,0V104a4,4,0,0,1,8,0Zm48,0v64a4,4,0,0,1-8,0V104a4,4,0,0,1,8,0Z`}))]]),$j=new Map([[`bold`,N.createElement(N.Fragment,null,N.createElement(`path`,{d:`M256,136a12,12,0,0,1-12,12h-8v8a12,12,0,0,1-24,0v-8h-8a12,12,0,0,1,0-24h8v-8a12,12,0,0,1,24,0v8h8A12,12,0,0,1,256,136Zm-54.81,56.28a12,12,0,1,1-18.38,15.44C169.12,191.42,145,172,108,172c-28.89,0-55.46,12.68-74.81,35.72a12,12,0,0,1-18.38-15.44A124.08,124.08,0,0,1,63.5,156.53a72,72,0,1,1,89,0A124,124,0,0,1,201.19,192.28ZM108,148a48,48,0,1,0-48-48A48.05,48.05,0,0,0,108,148Z`}))],[`duotone`,N.createElement(N.Fragment,null,N.createElement(`path`,{d:`M168,100a60,60,0,1,1-60-60A60,60,0,0,1,168,100Z`,opacity:`0.2`}),N.createElement(`path`,{d:`M256,136a8,8,0,0,1-8,8H232v16a8,8,0,0,1-16,0V144H200a8,8,0,0,1,0-16h16V112a8,8,0,0,1,16,0v16h16A8,8,0,0,1,256,136Zm-57.87,58.85a8,8,0,0,1-12.26,10.3C165.75,181.19,138.09,168,108,168s-57.75,13.19-77.87,37.15a8,8,0,0,1-12.25-10.3c14.94-17.78,33.52-30.41,54.17-37.17a68,68,0,1,1,71.9,0C164.6,164.44,183.18,177.07,198.13,194.85ZM108,152a52,52,0,1,0-52-52A52.06,52.06,0,0,0,108,152Z`}))],[`fill`,N.createElement(N.Fragment,null,N.createElement(`path`,{d:`M256,136a8,8,0,0,1-8,8H232v16a8,8,0,0,1-16,0V144H200a8,8,0,0,1,0-16h16V112a8,8,0,0,1,16,0v16h16A8,8,0,0,1,256,136ZM144,157.68a68,68,0,1,0-71.9,0c-20.65,6.76-39.23,19.39-54.17,37.17A8,8,0,0,0,24,208H192a8,8,0,0,0,6.13-13.15C183.18,177.07,164.6,164.44,144,157.68Z`}))],[`light`,N.createElement(N.Fragment,null,N.createElement(`path`,{d:`M254,136a6,6,0,0,1-6,6H230v18a6,6,0,0,1-12,0V142H200a6,6,0,0,1,0-12h18V112a6,6,0,0,1,12,0v18h18A6,6,0,0,1,254,136Zm-57.41,60.14a6,6,0,1,1-9.18,7.72C166.9,179.45,138.69,166,108,166s-58.89,13.45-79.41,37.86a6,6,0,0,1-9.18-7.72C35.14,177.41,55,164.48,77,158.25a66,66,0,1,1,62,0C161,164.48,180.86,177.41,196.59,196.14ZM108,154a54,54,0,1,0-54-54A54.06,54.06,0,0,0,108,154Z`}))],[`regular`,N.createElement(N.Fragment,null,N.createElement(`path`,{d:`M256,136a8,8,0,0,1-8,8H232v16a8,8,0,0,1-16,0V144H200a8,8,0,0,1,0-16h16V112a8,8,0,0,1,16,0v16h16A8,8,0,0,1,256,136Zm-57.87,58.85a8,8,0,0,1-12.26,10.3C165.75,181.19,138.09,168,108,168s-57.75,13.19-77.87,37.15a8,8,0,0,1-12.25-10.3c14.94-17.78,33.52-30.41,54.17-37.17a68,68,0,1,1,71.9,0C164.6,164.44,183.18,177.07,198.13,194.85ZM108,152a52,52,0,1,0-52-52A52.06,52.06,0,0,0,108,152Z`}))],[`thin`,N.createElement(N.Fragment,null,N.createElement(`path`,{d:`M252,136a4,4,0,0,1-4,4H228v20a4,4,0,0,1-8,0V140H200a4,4,0,0,1,0-8h20V112a4,4,0,0,1,8,0v20h20A4,4,0,0,1,252,136Zm-56.94,61.43a4,4,0,0,1-6.12,5.14C168,177.7,139.3,164,108,164s-60,13.7-80.94,38.57a4,4,0,1,1-6.12-5.14c16.71-19.9,38.13-33.13,61.89-38.59a64,64,0,1,1,50.34,0C156.93,164.3,178.35,177.53,195.06,197.43ZM108,156a56,56,0,1,0-56-56A56.06,56.06,0,0,0,108,156Z`}))]]),eM=N.forwardRef((e,t)=>N.createElement(k,{ref:t,...e,weights:Bj}));eM.displayName=`ArrowLeftIcon`;var tM=eM,nM=N.forwardRef((e,t)=>N.createElement(k,{ref:t,...e,weights:Vj}));nM.displayName=`ArrowRightIcon`;var rM=nM,iM=N.forwardRef((e,t)=>N.createElement(k,{ref:t,...e,weights:Hj}));iM.displayName=`BookOpenIcon`;var aM=iM,oM=N.forwardRef((e,t)=>N.createElement(k,{ref:t,...e,weights:Uj}));oM.displayName=`DotsThreeIcon`;var sM=oM,cM=N.forwardRef((e,t)=>N.createElement(k,{ref:t,...e,weights:Wj}));cM.displayName=`MagnifyingGlassIcon`;var lM=cM,uM=N.forwardRef((e,t)=>N.createElement(k,{ref:t,...e,weights:Gj}));uM.displayName=`MoonIcon`;var dM=uM,fM=N.forwardRef((e,t)=>N.createElement(k,{ref:t,...e,weights:Kj}));fM.displayName=`PencilSimpleIcon`;var pM=fM,mM=N.forwardRef((e,t)=>N.createElement(k,{ref:t,...e,weights:qj}));mM.displayName=`PlugsConnectedIcon`;var hM=mM,gM=N.forwardRef((e,t)=>N.createElement(k,{ref:t,...e,weights:Jj}));gM.displayName=`PlusIcon`;var _M=gM,vM=N.forwardRef((e,t)=>N.createElement(k,{ref:t,...e,weights:Yj}));vM.displayName=`SignOutIcon`;var yM=vM,bM=N.forwardRef((e,t)=>N.createElement(k,{ref:t,...e,weights:Xj}));bM.displayName=`SparkleIcon`;var xM=bM,SM=N.forwardRef((e,t)=>N.createElement(k,{ref:t,...e,weights:Zj}));SM.displayName=`SunIcon`;var CM=SM,wM=N.forwardRef((e,t)=>N.createElement(k,{ref:t,...e,weights:Qj}));wM.displayName=`TrashIcon`;var TM=wM,EM=N.forwardRef((e,t)=>N.createElement(k,{ref:t,...e,weights:$j}));EM.displayName=`UserPlusIcon`;var DM=EM,OM=class extends Error{status;problems;code;constructor(e,t,n=[],r=``){super(e),this.status=t,this.problems=n,this.code=r}},kM=`fanout:unauthorized`;function AM(){let e=new URLSearchParams(window.location.search).get(`return_to`);if(!e)return``;let t=new URL(e,window.location.origin);return t.origin!==window.location.origin||t.pathname!==`/api/auth/oauth/authorize`?``:`${t.pathname}${t.search}`}function jM(e){return!e||typeof e!=`object`||!(`id`in e)||typeof e.id!=`string`||e.id===``?`none`:`user`}function MM(){window.dispatchEvent(new Event(kM))}async function NM(e,t={}){let n=new Headers(t.headers);n.set(`Fanout-Request`,`1`);let r=await fetch(e,{...t,headers:n,credentials:`same-origin`});if(r.status===401&&MM(),r.status===403){let e=await r.clone().json().catch(()=>({}));throw new OM(e.message??`You do not have permission to perform this action.`,r.status,[],e.code??``)}return r}async function PM(){let e=await NM(`/api/auth/logout`,{method:`POST`});if(!e.ok&&e.status!==401)throw Error(`Sign-out failed — your session is still active.`);e.status!==401&&MM(),window.location.assign(`/`)}var FM=(0,N.createContext)(null);function IM(){let e=(0,N.useContext)(FM);if(!e)throw Error(`Fanout runtime status is unavailable`);return e}var LM=(0,N.createContext)(null);function RM(){let e=(0,N.useContext)(LM);if(!e)throw Error(`Fanout viewer is unavailable`);return e}function zM(e){if(!e||typeof e!=`object`)return null;let t=e;return typeof t.id!=`string`||t.id===``||t.status!==`active`&&t.status!==`suspended`?null:{id:t.id,email:typeof t.email==`string`?t.email:``,display_name:typeof t.display_name==`string`?t.display_name:``,status:t.status,role:typeof t.role==`string`?t.role:``}}async function BM(e,t){let n=await fetch(e,{method:t===void 0?`GET`:`POST`,headers:t===void 0?void 0:{"Content-Type":`application/json`},body:t===void 0?void 0:JSON.stringify(t),credentials:`same-origin`}),r=await n.json().catch(()=>({}));if(!n.ok)throw Error(r.message??`Request failed (${n.status})`);return r}function VM({children:e,wide:t=!1}){return(0,P.jsx)(u,{mih:`100dvh`,style:{background:`radial-gradient(circle at 50% -12%, var(--mantine-color-brand-light), transparent 38%), linear-gradient(180deg, var(--mantine-color-default-hover), var(--mantine-color-body) 62%)`},children:(0,P.jsx)(ke,{mih:`100dvh`,px:`md`,py:48,children:(0,P.jsx)(_e,{size:t?680:480,w:`100%`,children:(0,P.jsx)(Ne,{radius:28,p:{base:24,sm:40},style:{background:`var(--mantine-color-body)`,border:`1px solid var(--mantine-color-default-border)`,boxShadow:`var(--mantine-shadow-xl)`},children:e})})})})}function HM(){return typeof window>`u`?``:new URLSearchParams(window.location.search).get(`setup_token`)??``}function UM(){return typeof window>`u`?``:new URLSearchParams(window.location.search).get(`login_token`)??``}function WM({children:e}){let t=Le(),[n,r]=(0,N.useState)(null),[i,a]=(0,N.useState)(!1),[o,s]=(0,N.useState)(`none`),[c,l]=(0,N.useState)(null),[d,f]=(0,N.useState)(!1),[p,m]=(0,N.useState)(``),[h,g]=(0,N.useState)(``),[_,v]=(0,N.useState)(HM),[y,b]=(0,N.useState)(UM),[x,S]=(0,N.useState)(``),[C,w]=(0,N.useState)(!1),[T,ee]=(0,N.useState)(0),[E,D]=(0,N.useState)(()=>Date.now()),[O,te]=(0,N.useState)(!1),[re,k]=(0,N.useState)(``),[ie,ae]=(0,N.useState)(null),[oe,ce]=(0,N.useState)(!1),ue=(0,N.useRef)(null),de=AM(),fe=o===`user`;async function me(){let e=await fetch(`/api/auth/me`,{credentials:`same-origin`});if(!e.ok){s(`none`),l(null);return}let t=await e.json().catch(()=>null);s(jM(t)),l(zM(t))}async function he(){try{let e=await fetch(`/api/auth/me`,{credentials:`same-origin`});if(!e.ok)return;l(zM(await e.json().catch(()=>null)))}catch{}}(0,N.useEffect)(()=>{let e=new URL(window.location.href);(e.searchParams.has(`setup_token`)||e.searchParams.has(`login_token`))&&(e.searchParams.delete(`setup_token`),e.searchParams.delete(`login_token`),t({href:e.pathname+e.search+e.hash,replace:!0}))},[t]),(0,N.useEffect)(()=>{BM(`/api/auth/status`).then(r).catch(e=>k(String(e))).finally(()=>a(!0)),me().catch(()=>s(`none`)).finally(()=>f(!0));let e=()=>{s(`none`),l(null)};return window.addEventListener(kM,e),()=>window.removeEventListener(kM,e)},[]),(0,N.useEffect)(()=>{d&&o===`none`&&y&&(te(!0),k(``),BM(`/api/auth/link/verify`,{token:y}).then(()=>{s(`user`),he()}).catch(e=>k(e instanceof Error?e.message:String(e))).finally(()=>{b(``),te(!1)}))},[y,d,o]),(0,N.useEffect)(()=>{fe&&d&&de&&window.location.replace(de)},[fe,de,d]),(0,N.useEffect)(()=>{if(T<=Date.now())return;let e=setInterval(()=>{D(Date.now()),Date.now()>=T&&clearInterval(e)},1e3);return()=>clearInterval(e)},[T]);let ge=Math.max(0,Math.ceil((T-E)/1e3));(0,N.useEffect)(()=>{C&&!O&&re&&ue.current?.querySelector(`input`)?.focus()},[O,C,re]);async function _e(e){try{await navigator.clipboard.writeText(e),ce(!0)}catch{k(`Clipboard access failed. Select and copy the token manually.`)}}if(ie?.ingest_token)return(0,P.jsx)(VM,{wide:!0,children:(0,P.jsxs)(A,{gap:`lg`,children:[(0,P.jsx)(De,{}),(0,P.jsxs)(`div`,{children:[(0,P.jsx)(le,{c:`brand`,fw:700,size:`xs`,tt:`uppercase`,lts:`0.12em`,children:`Setup complete`}),(0,P.jsx)(be,{order:1,mt:`xs`,fz:{base:28,sm:32},lh:1.08,children:`Save your ingest token`})]}),(0,P.jsx)(le,{c:`dimmed`,children:`Fanout shows this token once. Store it with your collector secrets before continuing.`}),(0,P.jsxs)(A,{gap:`xs`,children:[(0,P.jsx)(le,{size:`sm`,fw:600,children:`OTLP endpoint`}),(0,P.jsx)(rs,{block:!0,children:ie.suggested_endpoint??window.location.origin})]}),(0,P.jsxs)(A,{gap:`xs`,children:[(0,P.jsx)(le,{size:`sm`,fw:600,children:`Header`}),(0,P.jsxs)(rs,{block:!0,children:[ie.ingest_header_name??`Authorization`,`: Bearer `,ie.ingest_token]})]}),re&&(0,P.jsx)(xe,{color:`bad`,radius:`md`,children:re}),(0,P.jsxs)(ne,{grow:!0,align:`stretch`,children:[(0,P.jsx)(se,{variant:`light`,radius:`md`,leftSection:oe?(0,P.jsx)(pe,{size:16,weight:`bold`}):(0,P.jsx)(we,{size:16}),onClick:()=>void _e(`${ie.ingest_header_name??`Authorization`}: Bearer ${ie.ingest_token}`),children:oe?`Copied`:`Copy header`}),(0,P.jsx)(se,{radius:`md`,rightSection:(0,P.jsx)(rM,{size:16,weight:`bold`}),onClick:()=>{s(`user`),ae(null),he()},children:`Continue to Fanout`})]}),(0,P.jsx)(se,{variant:`subtle`,size:`compact-xs`,onClick:()=>void _e(ie.ingest_token??``),children:`Copy token only`})]})});if(!d||!i||y)return(0,P.jsx)(ke,{mih:`100dvh`,children:(0,P.jsx)(Pe,{size:`sm`})});if(!n)return(0,P.jsx)(VM,{children:(0,P.jsxs)(A,{gap:`lg`,children:[(0,P.jsx)(De,{}),(0,P.jsx)(be,{order:1,children:`Fanout is unavailable`}),(0,P.jsx)(xe,{color:`bad`,radius:`md`,children:re||`Authentication status could not be loaded.`})]})});if(fe&&de)return null;if(fe)return(0,P.jsx)(FM.Provider,{value:n,children:(0,P.jsx)(LM.Provider,{value:c??{id:``,email:p,display_name:h,status:`active`,role:``},children:e})});if(n&&!n.setup_required&&n.auth_mode===`oidc`){let e=de?`/api/auth/oidc/start?return_to=${encodeURIComponent(de)}`:`/api/auth/oidc/start`;return(0,P.jsx)(VM,{children:(0,P.jsxs)(A,{gap:28,children:[(0,P.jsx)(De,{}),(0,P.jsxs)(A,{gap:10,children:[(0,P.jsx)(le,{c:`brand`,fw:700,size:`xs`,tt:`uppercase`,lts:`0.12em`,children:`Secure workspace`}),(0,P.jsx)(be,{order:1,fz:{base:28,sm:32},lh:1.08,children:`Sign in`}),(0,P.jsx)(le,{c:`dimmed`,size:`md`,lh:1.6,children:`Use your organization's identity provider to continue.`})]}),re&&(0,P.jsx)(xe,{color:`bad`,radius:`md`,children:re}),(0,P.jsx)(se,{component:`a`,href:e,size:`md`,radius:`md`,rightSection:(0,P.jsx)(rM,{size:17,weight:`bold`}),children:`Continue with SSO`})]})})}async function ve(){te(!0),k(``);try{await BM(`/api/auth/code/send`,{email:p}),w(!0),S(``),ee(Date.now()+3e4),D(Date.now())}catch(e){k(e instanceof Error?e.message:String(e))}finally{te(!1)}}async function j(e){te(!0),k(``);try{await BM(`/api/auth/code/verify`,{email:p,code:e}),s(`user`),w(!1),S(``),ee(0),he()}catch(e){S(``),k(e instanceof Error?e.message:String(e))}finally{te(!1)}}function M(){w(!1),S(``),k(``)}async function ye(e){e.preventDefault(),te(!0),k(``);try{if(n?.setup_required){let e=await BM(`/api/auth/setup`,{email:p,display_name:h,setup_token:_});e.ingest_token?ae(e):(s(`user`),he())}else if(C){await j(x);return}else{await ve();return}}catch(e){k(e instanceof Error?e.message:String(e))}finally{te(!1)}}let Se=C&&!n?.setup_required,Ce=n?.setup_required?`Create the first admin`:Se?`Check your email`:n?.self_signup?`Sign in or create an account`:`Sign in`,Te=n?.setup_required?`Use the one-time token printed by the Fanout process.`:n?.smtp_configured?Se?`We sent a code to ${p}.`:n?.self_signup?`Enter your email to sign in or create a viewer account. No password needed.`:`Enter your email and we’ll send a short verification code. No password needed.`:`Email delivery is not configured. Ask the operator to run fanout login-link with your email address.`;return(0,P.jsx)(VM,{children:(0,P.jsxs)(A,{gap:28,children:[(0,P.jsx)(De,{}),(0,P.jsxs)(A,{gap:10,children:[(0,P.jsx)(le,{c:`brand`,fw:700,size:`xs`,tt:`uppercase`,lts:`0.12em`,children:n?.setup_required?`One-time setup`:`Secure workspace`}),(0,P.jsx)(be,{order:1,fz:{base:28,sm:32},lh:1.08,children:Ce}),Te&&(0,P.jsx)(le,{c:`dimmed`,size:`md`,lh:1.6,maw:390,children:Te})]}),(0,P.jsx)(`form`,{onSubmit:ye,children:(0,P.jsxs)(A,{gap:`md`,children:[(0,P.jsx)(Pc,{label:`Email`,placeholder:`you@company.com`,type:`email`,required:!0,value:p,onChange:e=>m(e.currentTarget.value),disabled:C,variant:`filled`,radius:`md`,size:`md`,autoFocus:!C}),n?.setup_required&&(0,P.jsx)(Pc,{label:`Display name`,placeholder:`Your display name`,value:h,onChange:e=>g(e.currentTarget.value),variant:`filled`,radius:`md`,size:`md`}),n?.setup_required&&(0,P.jsx)(Pc,{label:`Setup token`,placeholder:`from the setup URL printed at startup`,required:!0,value:_,onChange:e=>v(e.currentTarget.value),autoComplete:`one-time-code`,variant:`filled`,radius:`md`,size:`md`}),Se&&(0,P.jsxs)(A,{gap:`xs`,children:[(0,P.jsx)(le,{size:`sm`,fw:600,children:`Verification code`}),(0,P.jsx)(u,{ref:ue,children:(0,P.jsx)(Nc,{length:6,type:`number`,oneTimeCode:!0,autoFocus:!0,value:x,onChange:S,onComplete:e=>void j(e),disabled:O,error:!!re,size:`md`,radius:`md`,"aria-label":`Verification code`,getInputProps:e=>({"aria-label":`Digit ${e+1}`})})}),(0,P.jsxs)(ne,{justify:`space-between`,gap:`xs`,children:[(0,P.jsxs)(le,{c:`dimmed`,size:`xs`,children:[`Sent to `,p]}),(0,P.jsx)(se,{variant:`subtle`,size:`compact-xs`,leftSection:(0,P.jsx)(tM,{size:12,weight:`bold`}),onClick:M,disabled:O,children:`Change email`})]}),(0,P.jsxs)(ne,{justify:`space-between`,gap:`xs`,children:[(0,P.jsx)(le,{c:`dimmed`,size:`xs`,children:`Codes expire in 5 minutes`}),(0,P.jsx)(se,{variant:`subtle`,size:`compact-xs`,onClick:()=>void ve(),disabled:O||ge>0,children:ge>0?`Resend in ${ge}s`:`Resend code`})]})]}),re&&(0,P.jsx)(xe,{color:`bad`,radius:`md`,children:re}),Se?(0,P.jsx)(se,{type:`submit`,size:`md`,radius:`md`,mt:4,loading:O,disabled:O||x.length<6,rightSection:(0,P.jsx)(rM,{size:17,weight:`bold`}),children:`Verify code`}):(0,P.jsx)(se,{type:`submit`,size:`md`,radius:`md`,mt:4,loading:O,disabled:!n||!n.setup_required&&!n.smtp_configured,leftSection:n?.setup_required?(0,P.jsx)(DM,{size:17,weight:`bold`}):void 0,rightSection:n?.setup_required?void 0:(0,P.jsx)(rM,{size:17,weight:`bold`}),children:n?.setup_required?`Create admin`:`Send code`})]})})]})})}var GM=[`agent-threads`];async function KM(e){let t=await NM(e);if(!t.ok)throw Error(`Request failed (${t.status})`);return t.json()}var qM=[];for(let e=0;e<256;++e)qM.push((e+256).toString(16).slice(1));function JM(e,t=0){return(qM[e[t+0]]+qM[e[t+1]]+qM[e[t+2]]+qM[e[t+3]]+`-`+qM[e[t+4]]+qM[e[t+5]]+`-`+qM[e[t+6]]+qM[e[t+7]]+`-`+qM[e[t+8]]+qM[e[t+9]]+`-`+qM[e[t+10]]+qM[e[t+11]]+qM[e[t+12]]+qM[e[t+13]]+qM[e[t+14]]+qM[e[t+15]]).toLowerCase()}var YM=new Uint8Array(16);function XM(){return crypto.getRandomValues(YM)}var ZM={};function QM(e,t,n){let r;if(e)r=eN(e.random??e.rng?.()??XM(),e.msecs,e.seq,t,n);else{let e=Date.now(),i=XM();$M(ZM,e,i),r=eN(i,ZM.msecs,ZM.seq,t,n)}return t??JM(r)}function $M(e,t,n){return e.msecs??=-1/0,e.seq??=0,t>e.msecs?(e.seq=tN(n),e.msecs=t):(e.seq=e.seq+1|0,e.seq===0&&e.msecs++),e}function eN(e,t,n,r,i=0){if(e.length<16)throw Error(`Random bytes length must be >= 16`);if(!r)r=new Uint8Array(16),i=0;else if(i<0||i+16>r.length)throw RangeError(`UUID byte range ${i}:${i+15} is out of buffer bounds`);return t??=Date.now(),n??=tN(e),r[i++]=t/1099511627776&255,r[i++]=t/4294967296&255,r[i++]=t/16777216&255,r[i++]=t/65536&255,r[i++]=t/256&255,r[i++]=t&255,r[i++]=112|n>>>28&15,r[i++]=n>>>20&255,r[i++]=128|n>>>14&63,r[i++]=n>>>6&255,r[i++]=n<<2&255|e[10]&3,r[i++]=e[11],r[i++]=e[12],r[i++]=e[13],r[i++]=e[14],r[i++]=e[15],r}function tN(e){return(e[6]&127)<<24|e[7]<<16|e[8]<<8|e[9]}function nN(){return QM()}var rN=[`dashboards`],iN=3e4;async function aN(e,t){let{json:n,...r}=t??{},i=new Headers(r.headers),a=r.body;n!==void 0&&(i.set(`content-type`,`application/json`),a=JSON.stringify(n));let o=await NM(e,{...r,headers:i,body:a}),s=await o.json().catch(()=>({}));if(!o.ok)throw new OM(s.message??`Request failed (${o.status})`,o.status,s.problems??[],s.code??``);return s}var oN=e=>`/api/dashboards/${encodeURIComponent(e)}`,sN=()=>aN(`/api/dashboards`).then(e=>e.dashboards),cN=(e,t)=>aN(oN(e),{signal:t}),lN=(e,t)=>aN(`${oN(e)}/versions`,{signal:t}).then(e=>e.versions),uN=(e,t,n)=>aN(`${oN(e)}/versions/${t}`,{signal:n}),dN=(e,t)=>aN(`${oN(e)}/versions/${t}/restore`,{method:`POST`}),fN=(e,t,n,r)=>aN(oN(e),{method:`PUT`,json:{spec:t,base_version:n,message:r}}),pN=(e,t,n,r)=>aN(oN(e),{method:`PATCH`,json:{operations:t,base_version:n,message:r}}),mN=(e,t)=>aN(`/api/panels/query`,{method:`POST`,json:e,signal:t}).then(e=>e.results),hN=(e,t)=>aN(`/api/annotations`,{method:`POST`,json:e,signal:t}),gN=(e,t)=>aN(`/api/panels/variables/resolve`,{method:`POST`,json:e,signal:t}).then(e=>e.options),_N=(e,t)=>aN(`/api/panels/exemplars`,{method:`POST`,json:e,signal:t});function vN(e,t){let n=new URLSearchParams({namespace:e.namespace??``,from:e.window_from,to:e.window_to,limit:`200`});return aN(`/api/traces/${encodeURIComponent(e.trace_id??``)}?${n}`,{signal:t})}function yN(){let{setColorScheme:e}=Br(),t=Ur(`light`,{getInitialValueInEffect:!0}),n=t===`dark`?`light`:`dark`,[r,i]=(0,N.useState)(!1);return(0,P.jsx)(Ot,{label:`Switch to ${n} theme`,opened:r,children:(0,P.jsx)(Ze,{variant:`subtle`,color:`gray`,"aria-label":`Switch to ${n} theme`,onMouseEnter:()=>i(!0),onMouseLeave:()=>i(!1),onFocus:()=>i(!0),onBlur:()=>i(!1),onClick:()=>{i(!1),e(n)},children:t===`dark`?(0,P.jsx)(CM,{size:17,weight:`bold`}):(0,P.jsx)(dM,{size:17,weight:`bold`})})})}var bN={home:`https://fanout.run/start/what-fanout-is`,ingest:`https://fanout.run/start/send-telemetry`};async function xN(e,t){let n=new URLSearchParams({page_size:`30`});e&&n.set(`q`,e),t&&n.set(`cursor`,t);let r=await NM(`/api/agent/threads?${n}`);if(!r.ok)throw Error(`Unable to load chats (${r.status})`);return r.json()}function SN({agentAvailable:e,activeThreadID:t,activeDashboardID:n,autoFocusSearch:r=!1,onNewChat:i,onSelectThread:a,onDeletedThread:o,onSelectDashboard:s,onCreateDashboard:c,onInvestigateService:l,ref:u}){let d=hA(),[f,p]=(0,N.useState)(``),[m]=pr(f.trim(),250),[h,g]=(0,N.useState)(null),[_,v]=(0,N.useState)(null),[y,b]=(0,N.useState)(``),[x,S]=(0,N.useState)(``),[w,T]=(0,N.useState)(!1),ee=(0,N.useRef)(null);(0,N.useImperativeHandle)(u,()=>({focusSearch:()=>ee.current?.focus()}),[]),(0,N.useEffect)(()=>{r&&requestAnimationFrame(()=>ee.current?.focus())},[r]);let E=zj({queryKey:[...GM,m],queryFn:({pageParam:e})=>xN(m,e),initialPageParam:``,getNextPageParam:e=>e.next_cursor??void 0,enabled:e}),D=Rj({queryKey:rN,queryFn:sN,refetchInterval:3e4,staleTime:iN}),O=(0,N.useMemo)(()=>E.data?.pages.flatMap(e=>e.items)??[],[E.data]),te=(0,N.useMemo)(()=>ON(O),[O]),re=Rj({queryKey:[`telemetry-schema`,`1h`],queryFn:()=>KM(`/api/telemetry/schema?window=1h`),enabled:!!m&&!!l,staleTime:6e4}),k=(0,N.useMemo)(()=>{if(!m)return[];let e=m.toLowerCase();return(re.data?.services??[]).map(e=>e.value).filter(t=>t.toLowerCase().includes(e)).slice(0,6)},[re.data,m]),ie=(0,N.useMemo)(()=>{let e=D.data??[],t=m.toLowerCase();return t?e.filter(e=>e.name.toLowerCase().includes(t)):e},[D.data,m]);function ae(e){S(``),b(e.title),g(e)}async function oe(){if(h&&y.trim()){T(!0),S(``);try{let e=await NM(`/api/agent/threads/${encodeURIComponent(h.id)}`,{method:`PATCH`,headers:{"Content-Type":`application/json`},body:JSON.stringify({title:y.trim()})});if(!e.ok)throw Error(`Unable to rename chat (${e.status})`);await d.invalidateQueries({queryKey:GM}),g(null)}catch(e){S(e instanceof Error?e.message:`Unable to rename this chat.`)}finally{T(!1)}}}async function ce(){if(_){T(!0),S(``);try{let e=await NM(`/api/agent/threads/${encodeURIComponent(_.id)}`,{method:`DELETE`});if(!e.ok)throw Error(`Unable to delete chat (${e.status})`);let t=_.id;v(null),await d.invalidateQueries({queryKey:GM}),await d.invalidateQueries({queryKey:rN}),o(t)}catch(e){S(e instanceof Error?e.message:`Unable to delete this chat.`)}finally{T(!1)}}}return(0,P.jsxs)(A,{gap:`sm`,h:`100%`,component:`nav`,"aria-label":`Navigation`,children:[e&&(0,P.jsx)(se,{leftSection:(0,P.jsx)(_M,{size:16,weight:`bold`}),onClick:i,children:`New chat`}),(0,P.jsx)(wt,{type:`auto`,offsetScrollbars:!0,flex:1,mx:-4,px:4,children:(0,P.jsxs)(A,{gap:`lg`,pb:`sm`,children:[e&&(0,P.jsxs)(A,{gap:4,children:[(0,P.jsx)(CN,{children:`Chats`}),E.isLoading&&(0,P.jsx)(ke,{py:`md`,children:(0,P.jsx)(Pe,{size:`xs`})}),E.isError&&(0,P.jsx)(xe,{color:`bad`,radius:`md`,p:`xs`,children:`Chats could not be loaded.`}),!E.isLoading&&!E.isError&&O.length===0&&(0,P.jsx)(le,{c:`dimmed`,size:`sm`,px:`sm`,py:`xs`,children:m?`No matching chats`:`No chats yet`}),te.map(e=>(0,P.jsxs)(A,{gap:2,children:[te.length>1&&(0,P.jsx)(le,{c:`dimmed`,size:`xs`,px:`sm`,pt:4,children:e.label}),e.threads.map(e=>(0,P.jsx)(wN,{thread:e,active:e.id===t,onSelect:()=>a(e.id),onRename:()=>ae(e),onDelete:()=>{S(``),v(e)}},e.id))]},e.label)),E.hasNextPage&&(0,P.jsx)(se,{variant:`subtle`,color:`gray`,size:`compact-sm`,loading:E.isFetchingNextPage,onClick:()=>void E.fetchNextPage(),children:`See all`})]}),m&&l&&re.isLoading&&(0,P.jsx)(ke,{py:`md`,children:(0,P.jsx)(Pe,{size:`xs`})}),m&&l&&(re.isSuccess||re.isError)&&(0,P.jsxs)(A,{gap:4,children:[(0,P.jsx)(CN,{children:`Services`}),re.isError&&(0,P.jsx)(le,{c:`dimmed`,size:`sm`,px:`sm`,children:`Services could not be searched`}),re.isSuccess&&k.length===0&&(0,P.jsx)(le,{c:`dimmed`,size:`sm`,px:`sm`,children:`No matching services`}),k.map(e=>(0,P.jsx)(C,{className:`rail-row`,p:`sm`,onClick:()=>l(e),children:(0,P.jsx)(le,{size:`sm`,fw:500,truncate:!0,children:e})},e))]}),(0,P.jsxs)(A,{gap:4,children:[(0,P.jsx)(CN,{children:`Dashboards`}),D.isLoading&&(0,P.jsx)(ke,{py:`md`,children:(0,P.jsx)(Pe,{size:`xs`})}),D.isError&&(0,P.jsx)(xe,{color:`bad`,radius:`md`,p:`xs`,children:`Dashboards could not be loaded.`}),!D.isLoading&&!D.isError&&m&&ie.length===0&&(0,P.jsx)(le,{c:`dimmed`,size:`sm`,px:`sm`,py:`xs`,children:`No matching dashboards`}),ie.map(e=>{let t=e.id===n;return(0,P.jsxs)(A,{gap:0,children:[(0,P.jsx)(C,{component:`a`,href:`/dashboards/${encodeURIComponent(e.id)}`,className:`rail-row`,"data-active":t||void 0,"aria-current":t?`page`:void 0,p:`sm`,onClick:t=>{t.button!==0||t.metaKey||t.ctrlKey||t.shiftKey||t.altKey||(t.preventDefault(),s(e.id))},children:(0,P.jsxs)(ne,{justify:`space-between`,gap:`sm`,wrap:`nowrap`,children:[(0,P.jsx)(le,{size:`sm`,fw:t?600:500,truncate:!0,children:e.name}),e.is_default&&(0,P.jsx)(tt,{size:`xs`,variant:`light`,color:`gray`,children:`Default`})]})}),e.origin&&(0,P.jsx)(C,{component:`a`,href:`/chat/${encodeURIComponent(e.origin.thread_id)}`,"data-request-provenance":!0,px:`sm`,pb:`xs`,onClick:t=>{t.button!==0||t.metaKey||t.ctrlKey||t.shiftKey||t.altKey||(t.preventDefault(),a(e.origin.thread_id))},children:(0,P.jsxs)(le,{size:`xs`,c:`dimmed`,lineClamp:2,children:[`Built from: `,e.origin.request_excerpt]})})]},e.id)}),e&&(0,P.jsx)(se,{variant:`subtle`,color:`gray`,size:`compact-sm`,justify:`flex-start`,leftSection:(0,P.jsx)(xM,{size:14,weight:`fill`}),onClick:c,children:D.data?.length===0?`New dashboard`:`Create with AI`})]})]})}),(0,P.jsx)(Pc,{ref:ee,value:f,onChange:e=>p(e.currentTarget.value),leftSection:(0,P.jsx)(lM,{size:15}),rightSection:(0,P.jsx)(Es,{size:`xs`,children:`⌘K`}),rightSectionWidth:44,placeholder:`Search`,"aria-label":`Search chats, dashboards and services`,size:`sm`}),(0,P.jsx)(Dc,{opened:h!==null,onClose:()=>!w&&g(null),title:`Rename chat`,centered:!0,children:(0,P.jsx)(`form`,{onSubmit:e=>{e.preventDefault(),oe()},children:(0,P.jsxs)(A,{children:[(0,P.jsx)(Pc,{label:`Name`,value:y,onChange:e=>b(e.currentTarget.value),maxLength:120,autoFocus:!0}),x&&(0,P.jsx)(xe,{color:`bad`,children:x}),(0,P.jsxs)(ne,{justify:`flex-end`,children:[(0,P.jsx)(se,{variant:`default`,onClick:()=>g(null),disabled:w,children:`Cancel`}),(0,P.jsx)(se,{type:`submit`,loading:w,disabled:!y.trim(),children:`Save`})]})]})})}),(0,P.jsx)(Dc,{opened:_!==null,onClose:()=>!w&&v(null),title:`Delete chat?`,centered:!0,children:(0,P.jsxs)(A,{children:[(0,P.jsxs)(le,{size:`sm`,children:[`This permanently removes `,(0,P.jsx)(le,{span:!0,fw:650,children:_?.title}),` and its saved messages.`]}),x&&(0,P.jsx)(xe,{color:`bad`,children:x}),(0,P.jsxs)(ne,{justify:`flex-end`,children:[(0,P.jsx)(se,{variant:`default`,onClick:()=>v(null),disabled:w,children:`Cancel`}),(0,P.jsx)(se,{color:`bad`,loading:w,onClick:()=>void ce(),children:`Delete`})]})]})})]})}function CN({children:e}){return(0,P.jsx)(le,{c:`dimmed`,size:`xs`,fw:700,tt:`uppercase`,lts:`0.08em`,px:`sm`,children:e})}function wN({thread:e,active:t,onSelect:n,onRename:r,onDelete:i}){return(0,P.jsx)(u,{"data-active":t||void 0,className:`rail-row`,children:(0,P.jsxs)(ne,{gap:2,wrap:`nowrap`,children:[(0,P.jsx)(C,{onClick:n,"aria-current":t?`page`:void 0,p:`sm`,flex:1,style:{minWidth:0},children:(0,P.jsxs)(A,{gap:0,children:[(0,P.jsx)(le,{size:`sm`,fw:t?600:500,truncate:!0,children:e.title}),(0,P.jsx)(le,{c:`dimmed`,size:`xs`,children:kN(e.updated_at)})]})}),(0,P.jsxs)(dc,{position:`bottom-end`,withinPortal:!0,children:[(0,P.jsx)(dc.Target,{children:(0,P.jsx)(Ze,{className:`rail-row-actions`,variant:`subtle`,color:`gray`,size:`sm`,mr:4,"aria-label":`Actions for ${e.title}`,children:(0,P.jsx)(sM,{size:18,weight:`bold`})})}),(0,P.jsxs)(dc.Dropdown,{children:[(0,P.jsx)(dc.Item,{leftSection:(0,P.jsx)(pM,{size:15}),onClick:r,children:`Rename`}),(0,P.jsx)(dc.Item,{color:`bad`,leftSection:(0,P.jsx)(TM,{size:15}),onClick:i,children:`Delete`})]})]})]})})}function TN(e){return e.includes(`T`)?new Date(e):new Date(`${e.replace(` `,`T`)}Z`)}function EN(e){return new Date(e.getFullYear(),e.getMonth(),e.getDate()).getTime()}var DN=[`Today`,`Yesterday`,`Previous 7 days`,`Older`];function ON(e){let t=EN(new Date),n=new Map;for(let r of e){let e=Math.floor((t-EN(TN(r.updated_at)))/864e5),i=e<=0?`Today`:e===1?`Yesterday`:e<=7?`Previous 7 days`:`Older`,a=n.get(i)??[];a.push(r),n.set(i,a)}return DN.filter(e=>n.has(e)).map(e=>({label:e,threads:n.get(e)}))}function kN(e){let t=TN(e),n=EN(new Date);return Math.floor((n-EN(t))/864e5)<=1?new Intl.DateTimeFormat(void 0,{hour:`numeric`,minute:`2-digit`}).format(t):new Intl.DateTimeFormat(void 0,{month:`short`,day:`numeric`}).format(t)}function AN({children:e}){let{agentAvailable:t,threadID:n,threadMissing:r,newThread:i,selectThread:a,openChat:o}=it(),s=Le(),c=Xn({select:e=>e.location.pathname}),{dashboardId:l}=Sn({strict:!1}),u=c===`/chat`||c.startsWith(`/chat/`),[d,f]=Dr(!1),[p,m]=(0,N.useState)(!1),[h,g]=(0,N.useState)(``),_=(0,N.useRef)(null),v=ie(`(max-width: 62em)`),y=(0,N.useRef)(v);y.current=v,(0,N.useEffect)(()=>{f.close()},[c]),(0,N.useEffect)(()=>{let e=e=>{(e.metaKey||e.ctrlKey)&&e.key.toLowerCase()===`k`&&(e.preventDefault(),y.current?(m(!0),f.open()):_.current?.focusSearch())};return window.addEventListener(`keydown`,e),()=>window.removeEventListener(`keydown`,e)},[]);let b={agentAvailable:t,activeThreadID:u&&!r&&c!==`/chat`?n:void 0,activeDashboardID:l,onNewChat:i,onSelectThread:a,onDeletedThread:e=>{e===n&&i()},onSelectDashboard:e=>void s({to:`/dashboards/$dashboardId`,params:{dashboardId:e},search:{}}),onCreateDashboard:()=>o(Qe),onInvestigateService:e=>o(`Investigate the ${e} service. Explain its errors and latency.`)};return(0,P.jsxs)(Bo,{header:{height:52},navbar:{width:256,breakpoint:`md`,collapsed:{mobile:!0}},padding:0,children:[(0,P.jsx)(Bo.Header,{children:(0,P.jsxs)(ne,{h:`100%`,px:{base:`sm`,sm:`md`},justify:`space-between`,wrap:`nowrap`,children:[(0,P.jsxs)(ne,{gap:`sm`,wrap:`nowrap`,children:[(0,P.jsx)(es,{hiddenFrom:`md`,opened:d,onClick:()=>{m(!1),f.toggle()},size:`sm`,"aria-label":d?`Close navigation`:`Open navigation`}),(0,P.jsx)(De,{size:`small`})]}),(0,P.jsxs)(ne,{gap:`xs`,wrap:`nowrap`,children:[(0,P.jsx)(Ot,{label:`Documentation`,children:(0,P.jsx)(Ze,{component:`a`,href:bN.home,target:`_blank`,rel:`noopener noreferrer`,variant:`subtle`,color:`gray`,"aria-label":`Documentation`,children:(0,P.jsx)(aM,{size:17,weight:`bold`})})}),(0,P.jsx)(yN,{}),(0,P.jsx)(jN,{onError:g})]})]})}),(0,P.jsx)(Bo.Navbar,{p:`sm`,children:(0,P.jsx)(SN,{ref:_,...b})}),(0,P.jsx)(Cs,{opened:d,onClose:f.close,hiddenFrom:`md`,size:288,padding:`sm`,title:(0,P.jsx)(De,{size:`small`}),overlayProps:{backgroundOpacity:.24,blur:1},children:(0,P.jsx)(SN,{...b,autoFocusSearch:d&&p})}),(0,P.jsxs)(Bo.Main,{children:[h&&(0,P.jsx)(xe,{color:`bad`,m:`md`,withCloseButton:!0,onClose:()=>g(``),children:h}),e]})]})}function jN({onError:e}){let t=Le(),n=RM(),r=(n.display_name.trim()||n.email.trim()||`?`).charAt(0).toUpperCase();return(0,P.jsxs)(dc,{position:`bottom-end`,withinPortal:!0,shadow:`md`,children:[(0,P.jsx)(dc.Target,{children:(0,P.jsx)(Ze,{variant:`subtle`,color:`gray`,size:`lg`,radius:`xl`,"aria-label":`Account menu`,children:(0,P.jsx)(Zo,{size:26,radius:`xl`,color:`brand`,children:r})})}),(0,P.jsxs)(dc.Dropdown,{children:[(0,P.jsx)(dc.Label,{children:n.email||`Signed in`}),(0,P.jsx)(dc.Item,{leftSection:(0,P.jsx)(hM,{size:15}),onClick:()=>void t({to:`/settings`}),children:`Connect telemetry`}),(0,P.jsx)(dc.Divider,{}),(0,P.jsx)(dc.Item,{leftSection:(0,P.jsx)(yM,{size:15}),onClick:()=>void PM().catch(t=>e(t instanceof Error?t.message:`Sign-out failed — your session is still active.`)),children:`Sign out`})]})]})}function MN(){let{agent_available:e}=IM(),t=Le(),n=hA(),{threadId:r}=Sn({strict:!1}),[i,a]=(0,N.useState)(nN),o=(0,N.useRef)(new Set),s=r??i,[c,l]=(0,N.useState)([]),[u,d]=(0,N.useState)({}),[f,p]=(0,N.useState)(``),[m,h]=(0,N.useState)(!1),[g,_]=(0,N.useState)(!1),[v,y]=(0,N.useState)(``),[b,x]=(0,N.useState)(null),S=(0,N.useRef)(null),[C,w]=(0,N.useState)(!1),T=(0,N.useRef)(!1),[ee,E]=(0,N.useState)(``),[D,O]=(0,N.useState)(``),[te,ne]=(0,N.useState)(0),re=(0,N.useRef)(null),k=(0,N.useRef)({}),ie=(0,N.useRef)(null),ae=(0,N.useRef)(new Map),A=(0,N.useMemo)(()=>new pA({url:`/api/agent/runs`,threadId:s,fetch:(e,t)=>NM(e,t)}),[s]),oe=!e||f===s;function se(){ae.current.clear(),y(``),S.current=null,x(null)}let ce=e=>e.filter(e=>e.role!==`reasoning`);function le(){let e=S.current?.text.split(/(?<=[.!?])\s/)[0]?.trim().replace(/[.!?]+$/,``);return e?e+`…`:``}function ue(e){return T.current||e instanceof Error&&e.name===`AbortError`}(0,N.useEffect)(()=>{let t=!0;if(l([]),k.current={},d({}),p(``),h(!1),_(!1),T.current=!1,w(!1),se(),O(``),!e){p(s);return}!r||o.current.has(s)?(A.setMessages([]),p(s)):NM(`/api/agent/threads/${encodeURIComponent(s)}`).then(async e=>{if(e.status===404)return null;if(!e.ok)throw Error(`Unable to load thread (${e.status})`);return e.json()}).then(e=>{if(t){if(e===null){h(!0),p(s);return}A.setMessages(ce(e.messages??[])),l(ce(e.messages??[])),p(s)}}).catch(()=>{t&&(re.current=null,O(`This chat could not be restored. Start a new chat or try again.`))});let i=A.subscribe({onEvent:({event:e,messages:t})=>{switch(e.type){case`REASONING_MESSAGE_START`:return S.current={id:e.messageId,text:``,collapsed:!1},x(S.current),y(``),{stopPropagation:!0};case`REASONING_MESSAGE_CONTENT`:{let t=e,n={id:t.messageId,text:(S.current?.text??``)+t.delta,collapsed:!1};return S.current=n,x(n),{stopPropagation:!0}}case`REASONING_START`:case`REASONING_MESSAGE_END`:case`REASONING_END`:return{stopPropagation:!0};default:l(ce(t))}},onMessagesChanged:({messages:e})=>l(ce(e)),onRunInitialized:()=>{T.current=!1,w(!1),_(!0),O(``)},onTextMessageContentEvent:({event:e})=>{e.delta&&(S.current=null,x(null),y(``))},onToolCallStartEvent:({event:e})=>{ae.current.set(e.toolCallId,rt(e.toolCallName)),y(rt(e.toolCallName)),S.current&&(S.current={...S.current,collapsed:!0},x(S.current))},onToolCallResultEvent:({event:e,messages:t})=>{ae.current.delete(e.toolCallId),y([...ae.current.values()].at(-1)??le());let r=ot(e.toolCallId,e.content,t);r&&(n.invalidateQueries({queryKey:rN}),n.invalidateQueries({queryKey:[`dashboard`,r.id]}),n.invalidateQueries({queryKey:[`dashboard-versions`,r.id]}))},onRunErrorEvent:({event:e})=>{e.code===`abort`||T.current?(O(``),w(!0)):(console.warn(`Agent run error`,e.code),O(Je(e.code))),_(!1),se()},onRunFinalized:({messages:e})=>{let t=ce(e);l(t),d(e=>{let n={...e};for(let e of t)e.role===`assistant`&&!n[e.id]&&(n[e.id]=Date.now());return n}),_(!1),se(),o.current.delete(s),n.invalidateQueries({queryKey:GM})},onRunFailed:e=>{ue(e.error)?(O(``),w(!0)):(console.error(`Agent run failed`,e),O(Je())),_(!1),se(),o.current.delete(s),n.invalidateQueries({queryKey:GM})}});return()=>{t=!1,i.unsubscribe(),A.abortRun()}},[A,e,n,te,s]),(0,N.useEffect)(()=>{if(!e)return;let n=e=>{let n=e.target,i=n?.matches(`input, textarea, [contenteditable='true']`);e.key===`/`&&!i&&(e.preventDefault(),r?requestAnimationFrame(()=>ie.current?.focus()):t({to:`/chat`}).then(()=>requestAnimationFrame(()=>ie.current?.focus()))),e.key===`Escape`&&n===ie.current&&(E(``),ie.current?.blur())};return window.addEventListener(`keydown`,n),()=>window.removeEventListener(`keydown`,n)},[e,t,r]);async function de(){_(!0),O(``);try{await A.runAgent({forwardedProps:{...k.current}})}catch(e){ue(e)?(O(``),w(!0)):(console.error(`Agent run failed`,e),O(Je())),_(!1),se(),o.current.delete(s)}}async function fe(n,i){let a=n.trim();if(!e||!a||g||!oe||m)return;k.current={...i},r||(o.current.add(s),t({to:`/chat/$threadId`,params:{threadId:s},replace:!0}));let c={id:nN(),role:`user`,content:a};A.addMessage(c),l([...A.messages]),d(e=>({...e,[c.id]:Date.now()})),E(``),await de()}(0,N.useEffect)(()=>{let e=re.current;oe&&r&&e&&(re.current=null,fe(e.text,e.options))},[oe,r,s]);function pe(e){e.preventDefault(),fe(ee)}function me(){T.current=!0,O(``),w(!0),A.abortRun(),_(!1),se(),o.current.delete(s)}function he(){!g&&A.messages.some(e=>e.role===`user`)&&de()}function ge(n,r){if(!e)return;let i=nN();o.current.add(i),re.current=n?{text:n,options:{...r}}:null,t({to:`/chat/$threadId`,params:{threadId:i}})}function _e(){A.abortRun(),re.current=null,k.current={},a(nN()),t({to:`/chat`})}function ve(e){re.current=null,k.current={},t({to:`/chat/$threadId`,params:{threadId:e}})}function j(){ne(e=>e+1)}return(0,P.jsx)(nt.Provider,{value:{agentAvailable:e,threadID:s,threadMissing:m,messages:c,messageTimes:u,ready:oe,running:g,activity:v,provisional:b,stopped:C,input:ee,setInput:E,error:D,inputRef:ie,send:fe,submit:pe,stop:me,retry:he,reloadThread:j,openChat:ge,newThread:_e,selectThread:ve},children:(0,P.jsx)(AN,{children:(0,P.jsx)(Bn,{})})})}function NN(){let e=(0,N.useMemo)(()=>new Tj,[]);return(0,P.jsx)(gA,{client:e,children:(0,P.jsx)(WM,{children:(0,P.jsx)(MN,{})})})}var PN=On({component:NN,notFoundComponent:()=>(0,P.jsx)(ze,{to:`/`,replace:!0})}),FN=kn(`/`)({component:An(()=>at(()=>import(`./routes-D2AdaqvY.js`),__vite__mapDeps([0,1,2])),`component`)}),IN=kn(`/settings`)({component:An(()=>at(()=>import(`./settings-TyOL6EZs.js`),__vite__mapDeps([3,1,4,5,6])),`component`)}),LN=kn(`/chat/`)({component:An(()=>at(()=>import(`./chat.index-CybsW_0R.js`),__vite__mapDeps([7,8,1,4,9,5,10])),`component`)}),RN=kn(`/chat/$threadId`)({component:An(()=>at(()=>import(`./chat._threadId-CybsW_0R.js`),__vite__mapDeps([11,8,1,4,9,5,10])),`component`)});function zN(e){try{let t=typeof e==`string`?e:JSON.stringify(e);if(!t||t.length>4096)return;let n=typeof e==`string`?JSON.parse(e):e;if(!n||typeof n!=`object`)return;let r=n;return typeof r.panel_id!=`string`||!/^([a-z][a-z0-9_]{0,39})$/.test(r.panel_id)||r.kind!==`traces`&&r.kind!==`logs`||typeof r.from!=`string`||typeof r.to!=`string`||!Number.isFinite(Date.parse(r.from))||!Number.isFinite(Date.parse(r.to))||Date.parse(r.from)>=Date.parse(r.to)||Date.parse(r.to)-Date.parse(r.from)>2592e6||typeof r.window_from!=`string`||typeof r.window_to!=`string`||!Number.isFinite(Date.parse(r.window_from))||!Number.isFinite(Date.parse(r.window_to))||Date.parse(r.window_from)>=Date.parse(r.window_to)||Date.parse(r.window_to)-Date.parse(r.window_from)>2592e6||Date.parse(r.from)Date.parse(r.window_to)||!r.dimensions||Array.isArray(r.dimensions)||typeof r.dimensions!=`object`||Object.keys(r.dimensions).length>3||Object.values(r.dimensions).some(e=>typeof e!=`string`||e.length>500)||r.trace_id!==void 0&&(typeof r.trace_id!=`string`||r.trace_id.length>128)||r.namespace!==void 0&&(typeof r.namespace!=`string`||r.namespace.length>200)||r.bucket&&(!Number.isFinite(r.bucket.lower)||r.bucket.lower<0||r.bucket.upper!==void 0&&(!Number.isFinite(r.bucket.upper)||r.bucket.upper<=r.bucket.lower))?void 0:{panel_id:r.panel_id,kind:r.kind,from:r.from,to:r.to,window_from:r.window_from,window_to:r.window_to,dimensions:r.dimensions,trace_id:r.trace_id,namespace:r.namespace,bucket:r.bucket}}catch{return}}function BN(e,t,n){if(!e.drill&&e.viz!==`service_map`&&!n.trace_id||t.from_ms===void 0||t.to_ms===void 0)return;let r=t.from_ms,i=t.to_ms;if(n.from!==void 0&&n.to!==void 0&&(r=Math.max(r,Date.parse(n.from)),i=Math.min(i,Date.parse(n.to))),n.time!==void 0&&!n.trace_id){let e=/^(\d+)(s|m|h|d)$/.exec(t.interval??``),a=e?Number(e[1])*{s:1e3,m:6e4,h:36e5,d:864e5}[e[2]]:6e4;r=Math.max(r,n.time),i=Math.min(i,n.time+a)}return zN(JSON.stringify({panel_id:e.id,kind:n.trace_id||e.viz===`service_map`?`traces`:e.drill,from:n.from&&Date.parse(n.from)===r?n.from:new Date(r).toISOString(),to:n.to&&Date.parse(n.to)===i?n.to:new Date(i).toISOString(),window_from:new Date(t.from_ms).toISOString(),window_to:new Date(t.to_ms).toISOString(),dimensions:n.dimensions,trace_id:n.trace_id,namespace:n.namespace,bucket:n.bucket}))}function VN(e){let t=new URLSearchParams;for(let[n,r]of Object.entries(e))for(let e of Array.isArray(r)?r:[r]){if(e===void 0)continue;let r=typeof e==`string`&&/^[{"]/.test(e);t.append(n,r||typeof e==`object`&&e?JSON.stringify(e):String(e))}let n=t.toString();return n?`?${n}`:``}function HN(e){let t=Object.create(null),n=e=>{if(e.startsWith(`{`)||e.startsWith(`"`))try{let t=JSON.parse(e);if(typeof t==`string`)return/^[{"]/.test(t)?t:e;if(typeof t==`object`&&t&&!Array.isArray(t))return t}catch{}return e},r=new URLSearchParams(e);for(let e of new Set(r.keys())){let i=r.getAll(e).map(n);t[e]=i.length===1?i[0]:i}return t}var UN=[`5m`,`15m`,`1h`,`3h`,`6h`,`12h`,`24h`,`2d`,`7d`,`30d`],WN=[`off`,`10s`,`30s`,`1m`,`5m`],GN=e=>{if(typeof e!=`string`||!/^\d{4}-\d{2}-\d{2}[Tt](?:[01]\d|2[0-3]):[0-5]\d:[0-5]\d(?:\.\d+)?(?:[Zz]|[+-](?:[01]\d|2[0-3]):[0-5]\d)$/.test(e)||Number.isNaN(Date.parse(e)))return!1;let[t,n,r]=e.slice(0,10).split(`-`).map(Number),i=new Date(0);return i.setUTCFullYear(t,n-1,r),i.setUTCHours(0,0,0,0),i.getUTCFullYear()===t&&i.getUTCMonth()===n-1&&i.getUTCDate()===r},KN=e=>typeof e==`string`||typeof e==`number`||typeof e==`boolean`?String(e):void 0;function qN(e){let t={};typeof e.range==`string`&&UN.includes(e.range)?t.range=e.range:GN(e.from)&&GN(e.to)&&Date.parse(e.from)typeof e==`string`)&&(i[e]=t)}}else{let t=KN(n);t!==void 0&&(i[e]=t)}}}Object.keys(i).length>0&&(t.vars=i);let a=zN(e.drill);return a&&(t.drill=JSON.stringify(a)),t}function JN(e){let t={};e.drill&&(t.drill=JSON.parse(e.drill)),e.range&&(t.range=e.range),e.from&&e.to&&(t.from=e.from,t.to=e.to),e.compare&&(t.compare=e.compare),e.view&&(t.view=e.view),e.edit&&(t.edit=e.edit);for(let[n,r]of Object.entries(e.vars??{}))t[`var-${n}`]=Array.isArray(r)?{values:r}:r;return t}function YN(e,t){let n=new URL(e);return n.search=VN(JN({...qN(HN(n.search)),drill:JSON.stringify(t)})),n.href}function XN(e,t){let n=e.time.refresh??`30s`;return t.from&&t.to?{from:t.from,to:t.to,refresh:n}:t.range?{range:t.range,refresh:n}:{...e.time,refresh:n}}var ZN=kn(`/dashboards/`)({component:An(()=>at(()=>import(`./dashboards.index-BGm8G1FV.js`),__vite__mapDeps([12,1,2,13,4,9,5,10,6])),`component`),validateSearch:e=>JN(qN(e))}),QN=kn(`/dashboards/$dashboardId`)({component:An(()=>at(()=>import(`./dashboards._dashboardId-CGcM78tU.js`),__vite__mapDeps([14,1,2,13,4,9,5,10,6])),`component`),validateSearch:e=>JN(qN(e))}),$N=FN.update({id:`/`,path:`/`,getParentRoute:()=>PN}),eP=IN.update({id:`/settings`,path:`/settings`,getParentRoute:()=>PN}),tP=LN.update({id:`/chat/`,path:`/chat/`,getParentRoute:()=>PN}),nP=RN.update({id:`/chat/$threadId`,path:`/chat/$threadId`,getParentRoute:()=>PN}),rP=ZN.update({id:`/dashboards/`,path:`/dashboards/`,getParentRoute:()=>PN}),iP={IndexRoute:$N,SettingsRoute:eP,ChatThreadIdRoute:nP,DashboardsDashboardIdRoute:QN.update({id:`/dashboards/$dashboardId`,path:`/dashboards/$dashboardId`,getParentRoute:()=>PN}),ChatIndexRoute:tP,DashboardsIndexRoute:rP},aP=Kn({routeTree:PN._addFileChildren(iP)._addFileTypes(),parseSearch:HN,stringifySearch:VN,defaultPreload:`intent`,scrollRestoration:!0}),oP=[`#fafafa`,`#e6e4de`,`#bfbdb6`,`#8b8e99`,`#565b69`,`#1d2433`,`#131721`,`#0b0e14`,`#080a10`,`#05070b`],sP=[`#f3ecfd`,`#ece3fb`,`#dcc9f7`,`#d2a6ff`,`#bf94ec`,`#a97ce0`,`#9163d6`,`#7c4dcc`,`#5b32a3`,`#40236f`],cP=[`#eefbe6`,`#dcf7cc`,`#c2f0a6`,`#a5e880`,`#8fe06c`,`#7fd962`,`#66c04b`,`#4f9c3a`,`#3b7a2c`,`#2a5a1f`],lP=[`#fff5e6`,`#ffe9c9`,`#ffd79b`,`#ffc571`,`#ffbc62`,`#ffb454`,`#ef9c33`,`#c87d21`,`#9c5f16`,`#74460f`],uP=[`#fdecee`,`#fbd9dc`,`#f8b6bc`,`#f59099`,`#f37d87`,`#f26d78`,`#e04d5a`,`#c03642`,`#96262f`,`#6f1a21`],dP=[`#e8f6ff`,`#ccebff`,`#a3daff`,`#7dcbff`,`#66c5ff`,`#59c2ff`,`#33a7e6`,`#1e86bd`,`#146694`,`#0d4a6d`],fP={dark:{text:`#bfbdb6`,muted:`#8b8e99`,grid:`#1d2433`,surface:`#131721`,border:`#626777`},light:{text:`#4a5058`,muted:`#6b7280`,grid:`#eceef0`,surface:`#fcfcfc`,border:`#8c939d`}},pP={dark:[`#3987e5`,`#d95926`,`#199e70`,`#9085e9`,`#c98500`,`#d55181`],light:[`#2a78d6`,`#eb6834`,`#1baf7a`,`#4a3aa7`,`#eda100`,`#e87ba4`]},mP={micro:11,small:12,body:14,title:16,section:22,page:32},hP={display:`"Geist Mono Variable", ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace`,body:`"Geist Variable", ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif`},gP={brand:sP,ok:cP,warn:lP,bad:uP,info:dP},_P={light:7,dark:5};function vP(e){let t=e.replace(`#`,``),n=t.length===3?[...t].map(e=>e+e).join(``):t,r=e=>{let t=parseInt(n.slice(e,e+2),16)/255;return t<=.03928?t/12.92:((t+.055)/1.055)**2.4};return .2126*r(0)+.7152*r(2)+.0722*r(4)}function yP(e){let t=vP(e),n=1.05/(t+.05);return(t+.05)/.05>n?`var(--mantine-color-black)`:`var(--mantine-color-white)`}function bP(e){return Object.fromEntries(Object.entries(gP).map(([t,n])=>[`--fanout-color-${t}-contrast`,yP(n[_P[e]])]))}function xP(e){return t=>{let n=t.color??wP.primaryColor,r=e({...t,color:n}),i=t.variant===`filled`||t.variant===void 0;return t.autoContrast===!1||!i||!Object.hasOwn(gP,n)?r:{...r,color:`var(--fanout-color-${n}-contrast)`}}}var SP=.25,CP={xs:9,sm:10,md:11,lg:13,xl:16},wP={primaryColor:`brand`,primaryShade:_P,autoContrast:!0,luminanceThreshold:SP,colors:{dark:oP,brand:sP,ok:cP,warn:lP,bad:uP,info:dP},defaultRadius:`md`,fontFamily:hP.body,fontFamilyMonospace:hP.display,headings:{fontFamily:hP.body,fontWeight:`600`},cursorType:`pointer`,components:{Tabs:{styles:(e,t)=>({tab:DP(t.color,`--tabs-text-color`)})},Pagination:{styles:(e,t)=>({control:DP(t.color,`--pagination-active-color`)})},Badge:{vars:(e,t)=>({root:EP(t.size)})},Menu:{defaultProps:{withInitialFocusPlaceholder:!1}},Drawer:{defaultProps:{closeButtonProps:{"aria-label":`Close`}}},Modal:{defaultProps:{closeButtonProps:{"aria-label":`Close`}}}}},TP=()=>({variables:{"--mantine-color-error":`var(--mantine-color-bad-filled)`},light:{"--mantine-color-dimmed":fP.light.muted,...bP(`light`)},dark:bP(`dark`)});function EP(e){let t=CP[e??`md`];return t===void 0||t>=mP.micro?{}:{"--badge-fz":`${mP.micro/16}rem`}}function DP(e,t){return!e||e===wP.primaryColor?{[t]:`var(--fanout-color-${wP.primaryColor}-contrast)`}:{}}var OP=xP(ee),kP=ri({...wP,variantColorResolver:OP});(0,Hc.createRoot)(document.getElementById(`root`)).render((0,P.jsx)(N.StrictMode,{children:(0,P.jsx)(ni,{theme:kP,defaultColorScheme:`auto`,cssVariablesResolver:TP,children:(0,P.jsx)(Yn,{router:aP})})}));export{Ny as $,hN as A,Dc as At,TM as B,Ur as Bt,rN as C,_y as Ct,sN as D,i_ as Dt,uN as E,a_ as Et,dN as F,Vo as Ft,ZA as G,Qn as Gt,sM as H,Er as Ht,KM as I,$a as It,xA as J,ln as Jt,qA as K,gn as Kt,RM as L,Ei as Lt,mN as M,Es as Mt,fN as N,Cs as Nt,lN as O,Kf as Ot,gN as P,rs as Pt,Py as Q,NM as R,hi as Rt,bN as S,Hy as St,vN as T,l_ as Tt,Rj as U,cr as Ut,pM as V,Ir as Vt,xj as W,rr as Wt,UA as X,NA as Y,hA as Z,UN as _,ox as _t,fP as a,yb as at,BN as b,Cb as bt,cP as c,Ry as ct,lP as d,q as dt,ib as et,QN as f,K as ft,qN as g,Ib as gt,XN as h,xb as ht,sP as i,G as it,_N as j,dc as jt,pN as k,Pc as kt,pP as l,Db as lt,YN as m,ab as mt,vP as n,fb as nt,hP as o,cb as ot,ZN as p,_b as pt,kA as q,on as qt,uP as r,ub as rt,dP as s,Tb as st,yP as t,jb as tt,mP as u,tx as ut,WN as v,kb as vt,cN as w,dy as wt,zN as x,hb as xt,JN as y,U as yt,OM as z,ai as zt}; \ No newline at end of file diff --git a/internal/ui/dist/assets/mcp-app-frame-XtROHu70.js b/internal/ui/dist/assets/mcp-app-frame-XtROHu70.js new file mode 100644 index 000000000..8efb468b6 --- /dev/null +++ b/internal/ui/dist/assets/mcp-app-frame-XtROHu70.js @@ -0,0 +1,57 @@ +import{i as e,r as t,s as n}from"./useRouter-ByJ6_rwb.js";import{C as r,d as i,f as a,p as o,u as s,y as c}from"./brand-DUaZkIz1.js";import{n as l}from"./chat-CAy267fh.js";import{$ as u,Bt as d,Ct as f,Dt as p,Et as m,Ot as h,Q as g,R as _,Rt as v,St as y,Tt as b,_t as ee,at as x,bt as S,ct as C,dt as w,et as te,ft as T,gt as E,ht as D,it as ne,lt as re,mt as O,nt as ie,ot as k,pt as ae,rt as oe,st as se,tt as A,ut as ce,vt as j,wt as M,xt as N,yt as P}from"./index-D1TEoZWj.js";var le={invalid_type:`invalid_type`,too_big:`too_big`,too_small:`too_small`,invalid_format:`invalid_format`,not_multiple_of:`not_multiple_of`,unrecognized_keys:`unrecognized_keys`,invalid_union:`invalid_union`,invalid_key:`invalid_key`,invalid_element:`invalid_element`,invalid_value:`invalid_value`,custom:`custom`},ue;ue||={};function de(e){return p(u,e)}function fe(e){return m(g,e)}function pe(e){return b(te,e)}function F(e){return typeof e==`object`&&e&&!Array.isArray(e)?e:void 0}function I(e,t){if(!Array.isArray(e))return[];let n=new Set(t);return e.filter(e=>{if(typeof e!=`string`||/[\s;'\"]/.test(e))return!1;let t=e.match(/^([a-z]+):\/\/([^/]+)$/i);return!!(t&&n.has(t[1].toLowerCase()))})}function me(e){let t=F(F(F(e)?.ui)?.csp),n=I(t?.connectDomains,[`http`,`https`,`ws`,`wss`]),r=I(t?.resourceDomains,[`http`,`https`]),i=I(t?.frameDomains,[`http`,`https`]),a=I(t?.baseUriDomains,[`http`,`https`]),o=r.length?` ${r.join(` `)}`:``,s=[`default-src 'none'`,`worker-src blob:`,`script-src 'self' 'unsafe-inline'${o}`,`style-src 'self' 'unsafe-inline'${o}`,`img-src 'self' data:${o}`,`media-src 'self' data:${o}`,`font-src 'self' data:${o}`,`connect-src ${n.length?n.join(` `):`'none'`}`];return i.length&&s.push(`frame-src ${i.join(` `)}`),a.length&&s.push(`base-uri ${a.join(` `)}`),`${s.join(`; `)};`}var he=Object.create,ge=Object.defineProperty,_e=Object.getOwnPropertyDescriptor,ve=Object.getOwnPropertyNames,L=Object.getPrototypeOf,ye=Object.prototype.hasOwnProperty,be=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),xe=(e,t)=>{let n={};for(var r in e)ge(n,r,{get:e[r],enumerable:!0});return t&&ge(n,Symbol.toStringTag,{value:`Module`}),n},Se=(e,t,n,r)=>{if(t&&typeof t==`object`||typeof t==`function`)for(var i=ve(t),a=0,o=i.length,s;at[e]).bind(null,s),enumerable:!(r=_e(t,s))||r.enumerable});return e},Ce=(e,t,n)=>(n=e==null?{}:he(L(e)),Se(t||!e||!e.__esModule?ge(n,`default`,{value:e,enumerable:!0}):n,e)),we=new Set([`https://json-schema.org/draft/2020-12/schema`,`http://json-schema.org/draft/2020-12/schema`]),Te=new Set([`https://json-schema.org/draft/2019-09/schema`,`http://json-schema.org/draft/2019-09/schema`]),Ee=new Set([`https://json-schema.org/draft-07/schema`,`http://json-schema.org/draft-07/schema`]),De=new Set([`https://json-schema.org/draft-06/schema`,`http://json-schema.org/draft-06/schema`]);function Oe(e){return typeof e==`string`&&Te.has(e.replace(/#$/,``))}function ke(e,t){if(!(`$schema`in e)||typeof e.$schema!=`string`)return`2020-12`;let n=e.$schema.replace(/#$/,``);if(we.has(n))return`2020-12`;if(Te.has(n))return`2019-09`;if(Ee.has(n)||De.has(n))return`draft-7`;throw Error(`JSON Schema declares an unsupported dialect ("$schema": "${e.$schema.slice(0,200)}"). The default validator supports JSON Schema 2020-12, 2019-09, draft-07, and draft-06; ${t}`)}var Ae=`2025-11-25`,je=[Ae,`2025-06-18`,`2025-03-26`,`2024-11-05`,`2024-10-07`],Me=`io.modelcontextprotocol/related-task`,Ne=`io.modelcontextprotocol/protocolVersion`,Pe=`io.modelcontextprotocol/clientInfo`,Fe=`io.modelcontextprotocol/serverInfo`,Ie=`io.modelcontextprotocol/clientCapabilities`,Le=`io.modelcontextprotocol/subscriptionId`,Re=`io.modelcontextprotocol/logLevel`,ze=ce(()=>S([P(),O(),k(),ie(),j(P(),ze),x(ze)])),R=j(P(),ze),Be=x(ze),Ve=S([P(),O().int()]),He=P(),Ue=D({ttl:O().optional()}),We=D({taskId:P()}),Ge=T({progressToken:Ve.optional(),[Me]:We.optional()}),z=D({_meta:Ge.optional()}),Ke=z.extend({task:Ue.optional()}),B=D({method:P(),params:z.loose().optional()}),V=D({_meta:Ge.optional()}),H=D({method:P(),params:V.loose().optional()}),qe=T({get[Fe](){return W.optional().catch(void 0)}}),U=T({_meta:qe.optional()}),Je=S([P(),O().int()]),Ye=D({jsonrpc:w(`2.0`),id:Je,...B.shape}).strict(),Xe=D({jsonrpc:w(`2.0`),...H.shape}).strict(),Ze=D({jsonrpc:w(`2.0`),id:Je,result:U}).strict(),Qe=D({jsonrpc:w(`2.0`),id:Je.optional(),error:D({code:O().int(),message:P(),data:N().optional()})}).strict(),$e=S([Ye,Xe,Ze,Qe]),et=S([Ze,Qe]),tt=U.strict(),nt=V.extend({requestId:Je.optional(),reason:P().optional()}),rt=H.extend({method:w(`notifications/cancelled`),params:nt}),it=D({src:P(),mimeType:P().optional(),sizes:x(P()).optional(),theme:A([`light`,`dark`]).optional()}),at=D({icons:x(it).optional()}),ot=D({name:P(),title:P().optional()}),W=ot.extend({...ot.shape,...at.shape,version:P(),websiteUrl:P().optional(),description:P().optional()}),st=re(D({applyDefaults:k().optional()}),R),ct=ee(e=>e&&typeof e==`object`&&!Array.isArray(e)&&Object.keys(e).length===0?{form:{}}:e,re(D({form:st.optional(),url:R.optional()}),R.optional())),lt=T({list:R.optional(),cancel:R.optional(),requests:T({sampling:T({createMessage:R.optional()}).optional(),elicitation:T({create:R.optional()}).optional()}).optional()}),ut=T({list:R.optional(),cancel:R.optional(),requests:T({tools:T({call:R.optional()}).optional()}).optional()}),dt=D({experimental:j(P(),R).optional(),sampling:D({context:R.optional(),tools:R.optional()}).optional(),elicitation:ct.optional(),roots:D({listChanged:k().optional()}).optional(),tasks:lt.optional(),extensions:j(P(),R).optional()}),ft=z.extend({protocolVersion:P(),capabilities:dt,clientInfo:W}),pt=B.extend({method:w(`initialize`),params:ft}),mt=D({experimental:j(P(),R).optional(),logging:R.optional(),completions:R.optional(),prompts:D({listChanged:k().optional()}).optional(),resources:D({subscribe:k().optional(),listChanged:k().optional()}).optional(),tools:D({listChanged:k().optional()}).optional(),tasks:ut.optional(),extensions:j(P(),R).optional()}),ht=U.extend({protocolVersion:P(),capabilities:mt,serverInfo:W,instructions:P().optional()}),gt=H.extend({method:w(`notifications/initialized`),params:V.optional()}),_t=B.extend({method:w(`server/discover`),params:z.optional()}),vt=U.extend({supportedVersions:x(P()),capabilities:mt,instructions:P().optional()}),yt=B.extend({method:w(`ping`),params:z.optional()}),bt=D({progress:O(),total:E(O()),message:E(P())}),xt=D({...V.shape,...bt.shape,progressToken:Ve}),St=H.extend({method:w(`notifications/progress`),params:xt}),Ct=z.extend({cursor:He.optional()}),wt=B.extend({params:Ct.optional()}),Tt=U.extend({nextCursor:He.optional()}),Et=D({uri:P(),mimeType:E(P()),_meta:j(P(),N()).optional()}),Dt=Et.extend({text:P()}),Ot=P().refine(e=>{try{return atob(e),!0}catch{return!1}},{message:`Invalid Base64 string`}),kt=Et.extend({blob:Ot}),At=A([`user`,`assistant`]),jt=D({audience:x(At).optional(),priority:O().min(0).max(1).optional(),lastModified:de({offset:!0}).optional()}),Mt=D({...ot.shape,...at.shape,uri:P(),description:E(P()),mimeType:E(P()),size:E(O()),annotations:jt.optional(),_meta:E(T({}))}),Nt=D({...ot.shape,...at.shape,uriTemplate:P(),description:E(P()),mimeType:E(P()),annotations:jt.optional(),_meta:E(T({}))}),Pt=wt.extend({method:w(`resources/list`)}),Ft=Tt.extend({resources:x(Mt)}),It=wt.extend({method:w(`resources/templates/list`)}),Lt=Tt.extend({resourceTemplates:x(Nt)}),Rt=z.extend({uri:P()}),zt=Rt,Bt=B.extend({method:w(`resources/read`),params:zt}),Vt=U.extend({contents:x(S([Dt,kt]))}),Ht=H.extend({method:w(`notifications/resources/list_changed`),params:V.optional()}),Ut=Rt,Wt=B.extend({method:w(`resources/subscribe`),params:Ut}),Gt=Rt,Kt=B.extend({method:w(`resources/unsubscribe`),params:Gt}),qt=D({toolsListChanged:k().optional(),promptsListChanged:k().optional(),resourcesListChanged:k().optional(),resourceSubscriptions:x(P()).optional()}),Jt=z.extend({notifications:qt}),Yt=B.extend({method:w(`subscriptions/listen`),params:Jt}),Xt=V.extend({notifications:qt}),Zt=H.extend({method:w(`notifications/subscriptions/acknowledged`),params:Xt}),Qt=qe.extend({[Le]:Je}),$t=U.extend({_meta:Qt}),en=V.extend({uri:P()}),tn=H.extend({method:w(`notifications/resources/updated`),params:en}),G=D({name:P(),description:E(P()),required:E(k())}),nn=D({...ot.shape,...at.shape,description:E(P()),arguments:E(x(G)),_meta:E(T({}))}),rn=wt.extend({method:w(`prompts/list`)}),an=Tt.extend({prompts:x(nn)}),on=z.extend({name:P(),arguments:j(P(),P()).optional()}),sn=B.extend({method:w(`prompts/get`),params:on}),cn=D({type:w(`text`),text:P(),annotations:jt.optional(),_meta:j(P(),N()).optional()}),K=D({type:w(`image`),data:Ot,mimeType:P(),annotations:jt.optional(),_meta:j(P(),N()).optional()}),ln=D({type:w(`audio`),data:Ot,mimeType:P(),annotations:jt.optional(),_meta:j(P(),N()).optional()}),un=D({type:w(`tool_use`),name:P(),id:P(),input:j(P(),N()),_meta:j(P(),N()).optional()}),dn=D({type:w(`resource`),resource:S([Dt,kt]),annotations:jt.optional(),_meta:j(P(),N()).optional()}),fn=Mt.extend({type:w(`resource_link`)}),pn=S([cn,K,ln,fn,dn]),mn=D({role:At,content:pn}),hn=U.extend({description:P().optional(),messages:x(mn)}),gn=H.extend({method:w(`notifications/prompts/list_changed`),params:V.optional()}),_n=D({title:P().optional(),readOnlyHint:k().optional(),destructiveHint:k().optional(),idempotentHint:k().optional(),openWorldHint:k().optional()}),vn=D({taskSupport:A([`required`,`optional`,`forbidden`]).optional()}),yn=D({...ot.shape,...at.shape,description:P().optional(),inputSchema:D({type:w(`object`),properties:j(P(),ze).optional(),required:x(P()).optional()}).catchall(N()),outputSchema:T({$schema:P().optional()}).optional(),annotations:_n.optional(),execution:vn.optional(),_meta:j(P(),N()).optional()}),bn=wt.extend({method:w(`tools/list`)}),xn=Tt.extend({tools:x(yn)}),Sn=U.extend({content:x(pn).default([]),structuredContent:N().optional(),isError:k().optional()}),Cn=Sn.or(U.extend({toolResult:N()})),wn=Ke.extend({name:P(),arguments:j(P(),N()).optional()}),Tn=B.extend({method:w(`tools/call`),params:wn}),En=H.extend({method:w(`notifications/tools/list_changed`),params:V.optional()}),Dn=D({autoRefresh:k().default(!0),debounceMs:O().int().nonnegative().default(300)}),On=A([`debug`,`info`,`notice`,`warning`,`error`,`critical`,`alert`,`emergency`]),kn=z.extend({level:On}),An=B.extend({method:w(`logging/setLevel`),params:kn}),jn=V.extend({level:On,logger:P().optional(),data:N()}),Mn=H.extend({method:w(`notifications/message`),params:jn}),Nn=D({name:P().optional()}),Pn=D({hints:x(Nn).optional(),costPriority:O().min(0).max(1).optional(),speedPriority:O().min(0).max(1).optional(),intelligencePriority:O().min(0).max(1).optional()}),Fn=D({mode:A([`auto`,`required`,`none`]).optional()}),In=D({type:w(`tool_result`),toolUseId:P().describe(`The unique identifier for the corresponding tool call.`),content:x(pn),structuredContent:N().optional(),isError:k().optional(),_meta:j(P(),N()).optional()}),Ln=se(`type`,[cn,K,ln]),Rn=se(`type`,[cn,K,ln,un,In]),zn=D({role:At,content:S([Rn,x(Rn)]),_meta:j(P(),N()).optional()}),Bn=Ke.extend({messages:x(zn),modelPreferences:Pn.optional(),systemPrompt:P().optional(),includeContext:A([`none`,`thisServer`,`allServers`]).optional(),temperature:O().optional(),maxTokens:O().int(),stopSequences:x(P()).optional(),metadata:R.optional(),tools:x(yn).optional(),toolChoice:Fn.optional()}),Vn=B.extend({method:w(`sampling/createMessage`),params:Bn}),Hn=U.extend({model:P(),stopReason:E(A([`endTurn`,`stopSequence`,`maxTokens`]).or(P())),role:At,content:Ln}),Un=U.extend({model:P(),stopReason:E(A([`endTurn`,`stopSequence`,`maxTokens`,`toolUse`]).or(P())),role:At,content:S([Rn,x(Rn)])}),Wn=D({type:w(`boolean`),title:P().optional(),description:P().optional(),default:k().optional()}),Gn=D({type:w(`string`),title:P().optional(),description:P().optional(),minLength:O().optional(),maxLength:O().optional(),format:A([`email`,`uri`,`date`,`date-time`]).optional(),default:P().optional()}),Kn=D({type:A([`number`,`integer`]),title:P().optional(),description:P().optional(),minimum:O().optional(),maximum:O().optional(),default:O().optional()}),qn=D({type:w(`string`),title:P().optional(),description:P().optional(),enum:x(P()),default:P().optional()}),Jn=D({type:w(`string`),title:P().optional(),description:P().optional(),oneOf:x(D({const:P(),title:P()})),default:P().optional()}),Yn=D({type:w(`string`),title:P().optional(),description:P().optional(),enum:x(P()),enumNames:x(P()).optional(),default:P().optional()}),Xn=S([qn,Jn]),Zn=D({type:w(`array`),title:P().optional(),description:P().optional(),minItems:O().optional(),maxItems:O().optional(),items:D({type:w(`string`),enum:x(P())}),default:x(P()).optional()}),Qn=D({type:w(`array`),title:P().optional(),description:P().optional(),minItems:O().optional(),maxItems:O().optional(),items:D({anyOf:x(D({const:P(),title:P()}))}),default:x(P()).optional()}),$n=S([Zn,Qn]),er=S([Yn,Xn,$n]),tr=S([er,Wn,Gn,Kn]),nr=Ke.extend({mode:w(`form`).optional(),message:P(),requestedSchema:D({type:w(`object`),properties:j(P(),tr),required:x(P()).optional()}).catchall(N())}),rr=Ke.extend({mode:w(`url`),message:P(),elicitationId:P(),url:P().url()}),ir=S([nr,rr]),ar=B.extend({method:w(`elicitation/create`),params:ir}),or=V.extend({elicitationId:P()}),sr=H.extend({method:w(`notifications/elicitation/complete`),params:or}),cr=U.extend({action:A([`accept`,`decline`,`cancel`]),content:ee(e=>e===null?void 0:e,j(P(),S([P(),O(),k(),x(P())])).optional())}),lr=D({type:w(`ref/resource`),uri:P()}),ur=D({type:w(`ref/prompt`),name:P()}),dr=z.extend({ref:S([ur,lr]),argument:D({name:P(),value:P()}),context:D({arguments:j(P(),P()).optional()}).optional()}),fr=B.extend({method:w(`completion/complete`),params:dr}),pr=U.extend({completion:T({values:x(P()).max(100),total:E(O().int()),hasMore:E(k())})}),mr=D({uri:P().startsWith(`file://`),name:P().optional(),_meta:j(P(),N()).optional()}),hr=B.extend({method:w(`roots/list`),params:z.optional()}),gr=U.extend({roots:x(mr)}),_r=H.extend({method:w(`notifications/roots/list_changed`),params:V.optional()}),vr=T({ttl:O().optional(),pollInterval:O().optional()}),yr=A([`working`,`input_required`,`completed`,`failed`,`cancelled`]),br=D({taskId:P(),status:yr,ttl:S([O(),ie()]),createdAt:P(),lastUpdatedAt:P(),pollInterval:E(O()),statusMessage:E(P())}),xr=U.extend({task:br}),Sr=V.merge(br),Cr=H.extend({method:w(`notifications/tasks/status`),params:Sr}),wr=B.extend({method:w(`tasks/get`),params:z.extend({taskId:P()})}),Tr=U.merge(br),Er=B.extend({method:w(`tasks/result`),params:z.extend({taskId:P()})}),Dr=U.loose(),Or=wt.extend({method:w(`tasks/list`)}),kr=Tt.extend({tasks:x(br)}),Ar=B.extend({method:w(`tasks/cancel`),params:z.extend({taskId:P()})}),jr=U.merge(br),Mr=S([yt,pt,_t,fr,An,sn,rn,Pt,It,Bt,Wt,Kt,Yt,Tn,bn]),Nr=S([rt,St,gt,_r]),Pr=S([tt,Hn,Un,cr,gr]),Fr=S([yt,Vn,ar,hr]),Ir=S([rt,St,Mn,tn,Ht,En,gn,Zt,sr]),Lr=S([tt,ht,vt,pr,hn,an,Ft,Lt,Vt,Sn,xn,$t]),q=y().superRefine((e,t)=>{if(!URL.canParse(e))return t.addIssue({code:le.custom,message:`URL must be parseable`,fatal:!0}),h}).refine(e=>{let t=new URL(e);return t.protocol!==`javascript:`&&t.protocol!==`data:`&&t.protocol!==`vbscript:`},{message:`URL cannot use javascript:, data:, or vbscript: scheme`}),Rr=T({resource:P().url(),authorization_servers:x(q).optional(),jwks_uri:P().url().optional(),scopes_supported:x(P()).optional(),bearer_methods_supported:x(P()).optional(),resource_signing_alg_values_supported:x(P()).optional(),resource_name:P().optional(),resource_documentation:P().optional(),resource_policy_uri:P().url().optional(),resource_tos_uri:P().url().optional(),tls_client_certificate_bound_access_tokens:k().optional(),authorization_details_types_supported:x(P()).optional(),dpop_signing_alg_values_supported:x(P()).optional(),dpop_bound_access_tokens_required:k().optional()}),zr=T({issuer:P(),authorization_endpoint:q,token_endpoint:q,registration_endpoint:q.optional(),scopes_supported:x(P()).optional(),response_types_supported:x(P()),response_modes_supported:x(P()).optional(),grant_types_supported:x(P()).optional(),token_endpoint_auth_methods_supported:x(P()).optional(),token_endpoint_auth_signing_alg_values_supported:x(P()).optional(),service_documentation:q.optional(),revocation_endpoint:q.optional(),revocation_endpoint_auth_methods_supported:x(P()).optional(),revocation_endpoint_auth_signing_alg_values_supported:x(P()).optional(),introspection_endpoint:P().optional(),introspection_endpoint_auth_methods_supported:x(P()).optional(),introspection_endpoint_auth_signing_alg_values_supported:x(P()).optional(),code_challenge_methods_supported:x(P()).optional(),client_id_metadata_document_supported:k().optional(),authorization_response_iss_parameter_supported:k().optional().catch(void 0),dpop_signing_alg_values_supported:x(P()).optional()}),Br=T({issuer:P(),authorization_endpoint:q,token_endpoint:q,userinfo_endpoint:q.optional(),jwks_uri:q,registration_endpoint:q.optional(),scopes_supported:x(P()).optional(),response_types_supported:x(P()),response_modes_supported:x(P()).optional(),grant_types_supported:x(P()).optional(),acr_values_supported:x(P()).optional(),subject_types_supported:x(P()),id_token_signing_alg_values_supported:x(P()),id_token_encryption_alg_values_supported:x(P()).optional(),id_token_encryption_enc_values_supported:x(P()).optional(),userinfo_signing_alg_values_supported:x(P()).optional(),userinfo_encryption_alg_values_supported:x(P()).optional(),userinfo_encryption_enc_values_supported:x(P()).optional(),request_object_signing_alg_values_supported:x(P()).optional(),request_object_encryption_alg_values_supported:x(P()).optional(),request_object_encryption_enc_values_supported:x(P()).optional(),token_endpoint_auth_methods_supported:x(P()).optional(),token_endpoint_auth_signing_alg_values_supported:x(P()).optional(),display_values_supported:x(P()).optional(),claim_types_supported:x(P()).optional(),claims_supported:x(P()).optional(),service_documentation:P().optional(),claims_locales_supported:x(P()).optional(),ui_locales_supported:x(P()).optional(),claims_parameter_supported:k().optional(),request_parameter_supported:k().optional(),request_uri_parameter_supported:k().optional(),require_request_uri_registration:k().optional(),op_policy_uri:q.optional(),op_tos_uri:q.optional(),client_id_metadata_document_supported:k().optional(),authorization_response_iss_parameter_supported:k().optional().catch(void 0)}),Vr=D({...Br.shape,...zr.pick({code_challenge_methods_supported:!0}).shape}),Hr=D({access_token:P(),id_token:P().optional(),token_type:P(),expires_in:pe().optional(),scope:P().optional(),refresh_token:P().optional(),issuer:P().optional().catch(void 0)}).strip(),Ur=D({issued_token_type:w(`urn:ietf:params:oauth:token-type:id-jag`),access_token:P(),token_type:P().optional(),expires_in:O().optional(),scope:P().optional()}).strip(),Wr=D({error:P(),error_description:P().optional(),error_uri:P().optional()}),Gr=q.optional().or(w(``).transform(()=>void 0)),Kr=D({redirect_uris:x(q),token_endpoint_auth_method:P().optional(),grant_types:x(P()).optional(),response_types:x(P()).optional(),application_type:P().optional(),client_name:P().optional(),client_uri:q.optional(),logo_uri:Gr,scope:P().optional(),contacts:x(P()).optional(),tos_uri:Gr,policy_uri:P().optional(),jwks_uri:q.optional(),jwks:ne().optional(),software_id:P().optional(),software_version:P().optional(),software_statement:P().optional()}).strip(),qr=D({client_id:P(),client_secret:P().optional(),client_id_issued_at:O().optional(),client_secret_expires_at:O().optional(),issuer:P().optional().catch(void 0)}).strip(),Jr=Kr.merge(qr),Yr=D({error:P(),error_description:P().optional()}).strip(),Xr=D({token:P(),token_type_hint:P().optional()}).strip(),Zr=Symbol.for(`mcp.sdk.errorBrands`);function Qr(e,t){let n=new Set,r=t;for(;typeof r==`function`;){let e=r.mcpBrand;Object.prototype.hasOwnProperty.call(r,`mcpBrand`)&&typeof e==`string`&&n.add(e),r=Object.getPrototypeOf(r)}n.size!==0&&Object.defineProperty(e,Zr,{value:n,enumerable:!1,configurable:!0})}function $r(e,t){try{if(typeof t==`object`&&t&&Object.prototype.hasOwnProperty.call(e,`mcpBrand`)&&typeof e.mcpBrand==`string`&&Object.prototype.hasOwnProperty.call(t,Zr)){let n=t[Zr];if(n&&typeof n.has==`function`&&n.has(e.mcpBrand))return!0}}catch{}return Function.prototype[Symbol.hasInstance].call(e,t)}var ei=function(e){return e.InvalidRequest=`invalid_request`,e.InvalidClient=`invalid_client`,e.InvalidGrant=`invalid_grant`,e.UnauthorizedClient=`unauthorized_client`,e.UnsupportedGrantType=`unsupported_grant_type`,e.InvalidScope=`invalid_scope`,e.AccessDenied=`access_denied`,e.ServerError=`server_error`,e.TemporarilyUnavailable=`temporarily_unavailable`,e.UnsupportedResponseType=`unsupported_response_type`,e.UnsupportedTokenType=`unsupported_token_type`,e.InvalidToken=`invalid_token`,e.MethodNotAllowed=`method_not_allowed`,e.TooManyRequests=`too_many_requests`,e.InvalidClientMetadata=`invalid_client_metadata`,e.InvalidRedirectUri=`invalid_redirect_uri`,e.InsufficientScope=`insufficient_scope`,e.InvalidTarget=`invalid_target`,e.InvalidDpopProof=`invalid_dpop_proof`,e.UseDpopNonce=`use_dpop_nonce`,e}({}),ti=class e extends Error{static{Object.defineProperty(this,"mcpBrand",{value:`mcp.OAuthError`})}static[Symbol.hasInstance](e){return $r(this,e)}static isInstance(e){if(typeof this!=`function`)throw TypeError("isInstance must be called on the class (e.g. `SdkError.isInstance(value)`); for callbacks use `v => SdkError.isInstance(v)`");return $r(this,e)}constructor(e,t,n){super(t),this.code=e,this.errorUri=n,this.name=`OAuthError`,Qr(this,new.target)}toResponseObject(){let e={error:this.code,error_description:this.message};return this.errorUri&&(e.error_uri=this.errorUri),e}static fromResponse(t){return new e(t.error,t.error_description??t.error,t.error_uri)}},J=function(e){return e.NotConnected=`NOT_CONNECTED`,e.AlreadyConnected=`ALREADY_CONNECTED`,e.NotInitialized=`NOT_INITIALIZED`,e.CapabilityNotSupported=`CAPABILITY_NOT_SUPPORTED`,e.RequestTimeout=`REQUEST_TIMEOUT`,e.ConnectionClosed=`CONNECTION_CLOSED`,e.SendFailed=`SEND_FAILED`,e.InvalidResult=`INVALID_RESULT`,e.UnsupportedResultType=`UNSUPPORTED_RESULT_TYPE`,e.InputRequiredRoundsExceeded=`INPUT_REQUIRED_ROUNDS_EXCEEDED`,e.ListPaginationExceeded=`LIST_PAGINATION_EXCEEDED`,e.MethodNotSupportedByProtocolVersion=`METHOD_NOT_SUPPORTED_BY_PROTOCOL_VERSION`,e.EraNegotiationFailed=`ERA_NEGOTIATION_FAILED`,e.ClientHttpNotImplemented=`CLIENT_HTTP_NOT_IMPLEMENTED`,e.ClientHttpAuthentication=`CLIENT_HTTP_AUTHENTICATION`,e.ClientHttpForbidden=`CLIENT_HTTP_FORBIDDEN`,e.ClientHttpUnexpectedContent=`CLIENT_HTTP_UNEXPECTED_CONTENT`,e.ClientHttpFailedToOpenStream=`CLIENT_HTTP_FAILED_TO_OPEN_STREAM`,e.ClientHttpFailedToTerminateSession=`CLIENT_HTTP_FAILED_TO_TERMINATE_SESSION`,e}({}),Y=class extends Error{static{Object.defineProperty(this,"mcpBrand",{value:`mcp.SdkError`})}static[Symbol.hasInstance](e){return $r(this,e)}static isInstance(e){if(typeof this!=`function`)throw TypeError("isInstance must be called on the class (e.g. `SdkError.isInstance(value)`); for callbacks use `v => SdkError.isInstance(v)`");return $r(this,e)}constructor(e,t,n,r){super(t,r),this.code=e,this.data=n,this.name=`SdkError`,Qr(this,new.target)}},ni=class extends Y{static{Object.defineProperty(this,"mcpBrand",{value:`mcp.SdkHttpError`})}constructor(e,t,n,r){super(e,t,n,r),this.name=`SdkHttpError`}get status(){return this.data.status}get statusText(){return this.data.statusText}};function ri(e){let t=typeof e==`string`?new URL(e):new URL(e.href);return t.hash=``,t}function ii(e){if(typeof e!=`object`||!e||Array.isArray(e))return e;let t={...e};return delete t.issuer,t}function ai({requestedResource:e,configuredResource:t}){let n=typeof e==`string`?new URL(e):new URL(e.href),r=typeof t==`string`?new URL(t):new URL(t.href);if(n.origin!==r.origin||n.pathname.length=oi}function li(e){return e.filter(e=>!ci(e))}function ui(e){return e.filter(e=>ci(e))}function di(e){let t=e.structuredContent;return t===void 0||typeof t==`object`&&t&&!Array.isArray(t)||(e.content?.some(e=>e.type===`text`)??!1)?e:{...e,content:[...e.content??[],{type:`text`,text:JSON.stringify(t)}]}}var fi=[`task`,`inputRequests`,`requestState`];function pi(e){return typeof e!=`object`||!e||Array.isArray(e)||e.content!==void 0||fi.some(t=>t in e)?e:{...e,content:[]}}function mi(){let e=ce(()=>S([P(),O(),k(),ie(),j(P(),e),x(e)])),t=j(P(),e),n=S([P(),O().int()]),r=P(),i=D({ttl:O().optional()}),a=D({taskId:P()}),o=T({progressToken:n.optional(),"io.modelcontextprotocol/related-task":a.optional()}),s=D({_meta:o.optional()}),c=s.extend({task:i.optional()}),l=D({method:P(),params:s.loose().optional()}),u=D({_meta:o.optional()}),d=D({method:P(),params:u.loose().optional()}),f=T({_meta:o.optional()}),p=S([P(),O().int()]),m=f.strict(),h=u.extend({requestId:p.optional(),reason:P().optional()}),g=d.extend({method:w(`notifications/cancelled`),params:h}),_=D({src:P(),mimeType:P().optional(),sizes:x(P()).optional(),theme:A([`light`,`dark`]).optional()}),v=D({icons:x(_).optional()}),y=D({name:P(),title:P().optional()}),b=y.extend({...y.shape,...v.shape,version:P(),websiteUrl:P().optional(),description:P().optional()}),C=re(D({applyDefaults:k().optional()}),t),te=ee(e=>e&&typeof e==`object`&&!Array.isArray(e)&&Object.keys(e).length===0?{form:{}}:e,re(D({form:C.optional(),url:t.optional()}),t.optional())),ne=T({list:t.optional(),cancel:t.optional(),requests:T({sampling:T({createMessage:t.optional()}).optional(),elicitation:T({create:t.optional()}).optional()}).optional()}),ae=T({list:t.optional(),cancel:t.optional(),requests:T({tools:T({call:t.optional()}).optional()}).optional()}),oe=D({experimental:j(P(),t).optional(),sampling:D({context:t.optional(),tools:t.optional()}).optional(),elicitation:te.optional(),roots:D({listChanged:k().optional()}).optional(),tasks:ne.optional(),extensions:j(P(),t).optional()}),M=s.extend({protocolVersion:P(),capabilities:oe,clientInfo:b}),le=l.extend({method:w(`initialize`),params:M}),ue=D({experimental:j(P(),t).optional(),logging:t.optional(),completions:t.optional(),prompts:D({listChanged:k().optional()}).optional(),resources:D({subscribe:k().optional(),listChanged:k().optional()}).optional(),tools:D({listChanged:k().optional()}).optional(),tasks:ae.optional(),extensions:j(P(),t).optional()}),fe=f.extend({protocolVersion:P(),capabilities:ue,serverInfo:b,instructions:P().optional()}),pe=d.extend({method:w(`notifications/initialized`),params:u.optional()}),F=l.extend({method:w(`ping`),params:s.optional()}),I=D({progress:O(),total:E(O()),message:E(P())}),me=D({...u.shape,...I.shape,progressToken:n}),he=d.extend({method:w(`notifications/progress`),params:me}),ge=s.extend({cursor:r.optional()}),_e=l.extend({params:ge.optional()}),ve=f.extend({nextCursor:r.optional()}),L=D({uri:P(),mimeType:E(P()),_meta:j(P(),N()).optional()}),ye=L.extend({text:P()}),be=P().refine(e=>{try{return atob(e),!0}catch{return!1}},{message:`Invalid Base64 string`}),xe=L.extend({blob:be}),Se=A([`user`,`assistant`]),Ce=D({audience:x(Se).optional(),priority:O().min(0).max(1).optional(),lastModified:de({offset:!0}).optional()}),we=D({...y.shape,...v.shape,uri:P(),description:E(P()),mimeType:E(P()),size:E(O()),annotations:Ce.optional(),_meta:E(T({}))}),Te=D({...y.shape,...v.shape,uriTemplate:P(),description:E(P()),mimeType:E(P()),annotations:Ce.optional(),_meta:E(T({}))}),Ee=_e.extend({method:w(`resources/list`)}),De=ve.extend({resources:x(we)}),Oe=_e.extend({method:w(`resources/templates/list`)}),ke=ve.extend({resourceTemplates:x(Te)}),Ae=s.extend({uri:P()}),je=Ae,Me=l.extend({method:w(`resources/read`),params:je}),Ne=f.extend({contents:x(S([ye,xe]))}),Pe=d.extend({method:w(`notifications/resources/list_changed`),params:u.optional()}),Fe=Ae,Ie=l.extend({method:w(`resources/subscribe`),params:Fe}),Le=Ae,Re=l.extend({method:w(`resources/unsubscribe`),params:Le}),ze=u.extend({uri:P()}),R=d.extend({method:w(`notifications/resources/updated`),params:ze}),Be=D({name:P(),description:E(P()),required:E(k())}),Ve=D({...y.shape,...v.shape,description:E(P()),arguments:E(x(Be)),_meta:E(T({}))}),He=_e.extend({method:w(`prompts/list`)}),Ue=ve.extend({prompts:x(Ve)}),We=s.extend({name:P(),arguments:j(P(),P()).optional()}),Ge=l.extend({method:w(`prompts/get`),params:We}),z=D({type:w(`text`),text:P(),annotations:Ce.optional(),_meta:j(P(),N()).optional()}),Ke=D({type:w(`image`),data:be,mimeType:P(),annotations:Ce.optional(),_meta:j(P(),N()).optional()}),B=D({type:w(`audio`),data:be,mimeType:P(),annotations:Ce.optional(),_meta:j(P(),N()).optional()}),V=D({type:w(`tool_use`),name:P(),id:P(),input:j(P(),N()),_meta:j(P(),N()).optional()}),H=D({type:w(`resource`),resource:S([ye,xe]),annotations:Ce.optional(),_meta:j(P(),N()).optional()}),qe=we.extend({type:w(`resource_link`)}),U=S([z,Ke,B,qe,H]),Je=D({role:Se,content:U}),Ye=f.extend({description:P().optional(),messages:x(Je)}),Xe=d.extend({method:w(`notifications/prompts/list_changed`),params:u.optional()}),Ze=D({title:P().optional(),readOnlyHint:k().optional(),destructiveHint:k().optional(),idempotentHint:k().optional(),openWorldHint:k().optional()}),Qe=D({taskSupport:A([`required`,`optional`,`forbidden`]).optional()}),$e=D({...y.shape,...v.shape,description:P().optional(),inputSchema:D({type:w(`object`),properties:j(P(),e).optional(),required:x(P()).optional()}).catchall(N()),outputSchema:D({type:w(`object`),properties:j(P(),e).optional(),required:x(P()).optional()}).catchall(N()).optional(),annotations:Ze.optional(),execution:Qe.optional(),_meta:j(P(),N()).optional()}),et=_e.extend({method:w(`tools/list`)}),tt=ve.extend({tools:x($e)}),nt=f.extend({content:x(U),structuredContent:j(P(),N()).optional(),isError:k().optional()}),rt=c.extend({name:P(),arguments:j(P(),N()).optional()}),it=l.extend({method:w(`tools/call`),params:rt}),at=d.extend({method:w(`notifications/tools/list_changed`),params:u.optional()}),ot=A([`debug`,`info`,`notice`,`warning`,`error`,`critical`,`alert`,`emergency`]),W=s.extend({level:ot}),st=l.extend({method:w(`logging/setLevel`),params:W}),ct=u.extend({level:ot,logger:P().optional(),data:N()}),lt=d.extend({method:w(`notifications/message`),params:ct}),ut=D({name:P().optional()}),dt=D({hints:x(ut).optional(),costPriority:O().min(0).max(1).optional(),speedPriority:O().min(0).max(1).optional(),intelligencePriority:O().min(0).max(1).optional()}),ft=D({mode:A([`auto`,`required`,`none`]).optional()}),pt=D({type:w(`tool_result`),toolUseId:P().describe(`The unique identifier for the corresponding tool call.`),content:x(U),structuredContent:D({}).loose().optional(),isError:k().optional(),_meta:j(P(),N()).optional()}),mt=se(`type`,[z,Ke,B]),ht=se(`type`,[z,Ke,B,V,pt]),gt=D({role:Se,content:S([ht,x(ht)]),_meta:j(P(),N()).optional()}),_t=c.extend({messages:x(gt),modelPreferences:dt.optional(),systemPrompt:P().optional(),includeContext:A([`none`,`thisServer`,`allServers`]).optional(),temperature:O().optional(),maxTokens:O().int(),stopSequences:x(P()).optional(),metadata:t.optional(),tools:x($e).optional(),toolChoice:ft.optional()}),vt=l.extend({method:w(`sampling/createMessage`),params:_t}),yt=f.extend({model:P(),stopReason:E(A([`endTurn`,`stopSequence`,`maxTokens`]).or(P())),role:Se,content:mt}),bt=f.extend({model:P(),stopReason:E(A([`endTurn`,`stopSequence`,`maxTokens`,`toolUse`]).or(P())),role:Se,content:S([ht,x(ht)])}),xt=D({type:w(`boolean`),title:P().optional(),description:P().optional(),default:k().optional()}),St=D({type:w(`string`),title:P().optional(),description:P().optional(),minLength:O().optional(),maxLength:O().optional(),format:A([`email`,`uri`,`date`,`date-time`]).optional(),default:P().optional()}),Ct=D({type:A([`number`,`integer`]),title:P().optional(),description:P().optional(),minimum:O().optional(),maximum:O().optional(),default:O().optional()}),wt=D({type:w(`string`),title:P().optional(),description:P().optional(),enum:x(P()),default:P().optional()}),Tt=D({type:w(`string`),title:P().optional(),description:P().optional(),oneOf:x(D({const:P(),title:P()})),default:P().optional()}),Et=D({type:w(`string`),title:P().optional(),description:P().optional(),enum:x(P()),enumNames:x(P()).optional(),default:P().optional()}),Dt=S([wt,Tt]),Ot=D({type:w(`array`),title:P().optional(),description:P().optional(),minItems:O().optional(),maxItems:O().optional(),items:D({type:w(`string`),enum:x(P())}),default:x(P()).optional()}),kt=D({type:w(`array`),title:P().optional(),description:P().optional(),minItems:O().optional(),maxItems:O().optional(),items:D({anyOf:x(D({const:P(),title:P()}))}),default:x(P()).optional()}),At=S([Ot,kt]),jt=S([Et,Dt,At]),Mt=S([jt,xt,St,Ct]),Nt=c.extend({mode:w(`form`).optional(),message:P(),requestedSchema:D({type:w(`object`),properties:j(P(),Mt),required:x(P()).optional()}).catchall(N())}),Pt=c.extend({mode:w(`url`),message:P(),elicitationId:P(),url:P().url()}),Ft=S([Nt,Pt]),It=l.extend({method:w(`elicitation/create`),params:Ft}),Lt=u.extend({elicitationId:P()}),Rt=d.extend({method:w(`notifications/elicitation/complete`),params:Lt}),zt=f.extend({action:A([`accept`,`decline`,`cancel`]),content:ee(e=>e===null?void 0:e,j(P(),S([P(),O(),k(),x(P())])).optional())}),Bt=D({type:w(`ref/resource`),uri:P()}),Vt=D({type:w(`ref/prompt`),name:P()}),Ht=s.extend({ref:S([Vt,Bt]),argument:D({name:P(),value:P()}),context:D({arguments:j(P(),P()).optional()}).optional()}),Ut=l.extend({method:w(`completion/complete`),params:Ht}),Wt=f.extend({completion:T({values:x(P()).max(100),total:E(O().int()),hasMore:E(k())})}),Gt=D({uri:P().startsWith(`file://`),name:P().optional(),_meta:j(P(),N()).optional()}),Kt=l.extend({method:w(`roots/list`),params:s.optional()}),qt=f.extend({roots:x(Gt)}),Jt=d.extend({method:w(`notifications/roots/list_changed`),params:u.optional()}),Yt=T({ttl:O().optional(),pollInterval:O().optional()}),Xt=A([`working`,`input_required`,`completed`,`failed`,`cancelled`]),Zt=D({taskId:P(),status:Xt,ttl:S([O(),ie()]),createdAt:P(),lastUpdatedAt:P(),pollInterval:E(O()),statusMessage:E(P())}),Qt=f.extend({task:Zt}),$t=u.merge(Zt),en=d.extend({method:w(`notifications/tasks/status`),params:$t}),tn=l.extend({method:w(`tasks/get`),params:s.extend({taskId:P()})}),G=f.merge(Zt),nn=l.extend({method:w(`tasks/result`),params:s.extend({taskId:P()})}),rn=f.loose(),an=_e.extend({method:w(`tasks/list`)}),on=ve.extend({tasks:x(Zt)}),sn=l.extend({method:w(`tasks/cancel`),params:s.extend({taskId:P()})});return{JSONValueSchema:e,JSONObjectSchema:t,ProgressTokenSchema:n,CursorSchema:r,TaskMetadataSchema:i,RelatedTaskMetadataSchema:a,RequestMetaSchema:o,BaseRequestParamsSchema:s,TaskAugmentedRequestParamsSchema:c,RequestSchema:l,NotificationsParamsSchema:u,NotificationSchema:d,ResultSchema:f,RequestIdSchema:p,EmptyResultSchema:m,CancelledNotificationParamsSchema:h,CancelledNotificationSchema:g,IconSchema:_,IconsSchema:v,BaseMetadataSchema:y,ImplementationSchema:b,ClientTasksCapabilitySchema:ne,ServerTasksCapabilitySchema:ae,ClientCapabilitiesSchema:oe,InitializeRequestParamsSchema:M,InitializeRequestSchema:le,ServerCapabilitiesSchema:ue,InitializeResultSchema:fe,InitializedNotificationSchema:pe,PingRequestSchema:F,ProgressSchema:I,ProgressNotificationParamsSchema:me,ProgressNotificationSchema:he,PaginatedRequestParamsSchema:ge,PaginatedRequestSchema:_e,PaginatedResultSchema:ve,ResourceContentsSchema:L,TextResourceContentsSchema:ye,BlobResourceContentsSchema:xe,RoleSchema:Se,AnnotationsSchema:Ce,ResourceSchema:we,ResourceTemplateSchema:Te,ListResourcesRequestSchema:Ee,ListResourcesResultSchema:De,ListResourceTemplatesRequestSchema:Oe,ListResourceTemplatesResultSchema:ke,ResourceRequestParamsSchema:Ae,ReadResourceRequestParamsSchema:je,ReadResourceRequestSchema:Me,ReadResourceResultSchema:Ne,ResourceListChangedNotificationSchema:Pe,SubscribeRequestParamsSchema:Fe,SubscribeRequestSchema:Ie,UnsubscribeRequestParamsSchema:Le,UnsubscribeRequestSchema:Re,ResourceUpdatedNotificationParamsSchema:ze,ResourceUpdatedNotificationSchema:R,PromptArgumentSchema:Be,PromptSchema:Ve,ListPromptsRequestSchema:He,ListPromptsResultSchema:Ue,GetPromptRequestParamsSchema:We,GetPromptRequestSchema:Ge,TextContentSchema:z,ImageContentSchema:Ke,AudioContentSchema:B,ToolUseContentSchema:V,EmbeddedResourceSchema:H,ResourceLinkSchema:qe,ContentBlockSchema:U,PromptMessageSchema:Je,GetPromptResultSchema:Ye,PromptListChangedNotificationSchema:Xe,ToolAnnotationsSchema:Ze,ToolExecutionSchema:Qe,ToolSchema:$e,ListToolsRequestSchema:et,ListToolsResultSchema:tt,CallToolResultSchema:nt,CallToolRequestParamsSchema:rt,CallToolRequestSchema:it,ToolListChangedNotificationSchema:at,LoggingLevelSchema:ot,SetLevelRequestParamsSchema:W,SetLevelRequestSchema:st,LoggingMessageNotificationParamsSchema:ct,LoggingMessageNotificationSchema:lt,ModelHintSchema:ut,ModelPreferencesSchema:dt,ToolChoiceSchema:ft,ToolResultContentSchema:pt,SamplingContentSchema:mt,SamplingMessageContentBlockSchema:ht,SamplingMessageSchema:gt,CreateMessageRequestParamsSchema:_t,CreateMessageRequestSchema:vt,CreateMessageResultSchema:yt,CreateMessageResultWithToolsSchema:bt,BooleanSchemaSchema:xt,StringSchemaSchema:St,NumberSchemaSchema:Ct,UntitledSingleSelectEnumSchemaSchema:wt,TitledSingleSelectEnumSchemaSchema:Tt,LegacyTitledEnumSchemaSchema:Et,SingleSelectEnumSchemaSchema:Dt,UntitledMultiSelectEnumSchemaSchema:Ot,TitledMultiSelectEnumSchemaSchema:kt,MultiSelectEnumSchemaSchema:At,EnumSchemaSchema:jt,PrimitiveSchemaDefinitionSchema:Mt,ElicitRequestFormParamsSchema:Nt,ElicitRequestURLParamsSchema:Pt,ElicitRequestParamsSchema:Ft,ElicitRequestSchema:It,ElicitationCompleteNotificationParamsSchema:Lt,ElicitationCompleteNotificationSchema:Rt,ElicitResultSchema:zt,ResourceTemplateReferenceSchema:Bt,PromptReferenceSchema:Vt,CompleteRequestParamsSchema:Ht,CompleteRequestSchema:Ut,CompleteResultSchema:Wt,RootSchema:Gt,ListRootsRequestSchema:Kt,ListRootsResultSchema:qt,RootsListChangedNotificationSchema:Jt,TaskCreationParamsSchema:Yt,TaskStatusSchema:Xt,TaskSchema:Zt,CreateTaskResultSchema:Qt,TaskStatusNotificationParamsSchema:$t,TaskStatusNotificationSchema:en,GetTaskRequestSchema:tn,GetTaskResultSchema:G,GetTaskPayloadRequestSchema:nn,GetTaskPayloadResultSchema:rn,ListTasksRequestSchema:an,ListTasksResultSchema:on,CancelTaskRequestSchema:sn,CancelTaskResultSchema:f.merge(Zt),ClientRequestSchema:S([F,le,Ut,st,Ge,He,Ee,Oe,Me,Ie,Re,it,et,tn,nn,an,sn]),ClientNotificationSchema:S([g,he,pe,Jt,en]),ClientResultSchema:S([m,yt,bt,zt,qt,G,on,Qt]),ServerRequestSchema:S([F,vt,It,Kt,tn,nn,an,sn]),ServerNotificationSchema:S([g,he,lt,R,Pe,at,Xe,en,Rt]),ServerResultSchema:S([m,fe,Wt,Ye,Ue,De,ke,Ne,nt,tt,G,on,Qt]),CallToolResultWireSchema:N().superRefine((e,t)=>{if(typeof e==`object`&&e&&!Array.isArray(e)&&e.content===void 0){for(let n of fi)if(n in e){t.addIssue({code:`custom`,message:`content is required when the body carries '${n}' — another result family cannot default into an empty tools/call success`});return}}}).transform(pi).pipe(nt)}}var hi;function gi(){return hi??=mi()}function _i(e){return e.type!==`object`}var vi=new Set([`const`,`enum`,`default`,`examples`]),yi=new Set([`properties`,`patternProperties`,`$defs`,`definitions`,`dependentSchemas`,`dependencies`]);function bi(e){return e!==void 0&&!(typeof e==`string`&&e.startsWith(`#`))}function xi(e){let t=typeof e.$schema==`string`?e.$schema:void 0;if(bi(e.$id))return{...t!==void 0&&{$schema:t},type:`object`,properties:{result:e},required:[`result`]};let n=Oe(e.$schema)&&e.$recursiveAnchor!==!0,r=(e,t)=>{if(Array.isArray(e))return e.map(e=>r(e,!1));if(typeof e!=`object`||!e||!t&&bi(e.$id))return e;let i={},a=!1;for(let[o,s]of Object.entries(e))t?i[o]=r(s,!1):(o===`$ref`||o===`$dynamicRef`)&&typeof s==`string`?i[o]=s===`#`?`#/properties/result`:s.startsWith(`#/`)?`#/properties/result${s.slice(1)}`:s:o===`$recursiveRef`&&s===`#`&&n?a=!0:i[o]=vi.has(o)?s:yi.has(o)?r(s,!0):r(s,!1);return a&&(`$ref`in i?i.allOf=[...Array.isArray(i.allOf)?i.allOf:[],{$ref:`#/properties/result`}]:i.$ref=`#/properties/result`),i};return{...t!==void 0&&{$schema:t},type:`object`,properties:{result:r(e,!1)},required:[`result`]}}var Si={ping:null,initialize:null,"completion/complete":null,"logging/setLevel":null,"prompts/get":null,"prompts/list":null,"resources/list":null,"resources/templates/list":null,"resources/read":null,"resources/subscribe":null,"resources/unsubscribe":null,"tools/call":null,"tools/list":null,"tasks/get":null,"tasks/result":null,"tasks/list":null,"tasks/cancel":null,"sampling/createMessage":null,"elicitation/create":null,"roots/list":null},Ci={"notifications/cancelled":null,"notifications/progress":null,"notifications/initialized":null,"notifications/roots/list_changed":null,"notifications/tasks/status":null,"notifications/message":null,"notifications/resources/updated":null,"notifications/resources/list_changed":null,"notifications/tools/list_changed":null,"notifications/prompts/list_changed":null,"notifications/elicitation/complete":null},wi={ping:null,initialize:null,"completion/complete":null,"logging/setLevel":null,"prompts/get":null,"prompts/list":null,"resources/list":null,"resources/templates/list":null,"resources/read":null,"resources/subscribe":null,"resources/unsubscribe":null,"tools/call":null,"tools/list":null,"sampling/createMessage":null,"elicitation/create":null,"roots/list":null},Ti;function Ei(){if(Ti)return Ti;let e=gi();return Ti={requestSchemas:{ping:e.PingRequestSchema,initialize:e.InitializeRequestSchema,"completion/complete":e.CompleteRequestSchema,"logging/setLevel":e.SetLevelRequestSchema,"prompts/get":e.GetPromptRequestSchema,"prompts/list":e.ListPromptsRequestSchema,"resources/list":e.ListResourcesRequestSchema,"resources/templates/list":e.ListResourceTemplatesRequestSchema,"resources/read":e.ReadResourceRequestSchema,"resources/subscribe":e.SubscribeRequestSchema,"resources/unsubscribe":e.UnsubscribeRequestSchema,"tools/call":e.CallToolRequestSchema,"tools/list":e.ListToolsRequestSchema,"tasks/get":e.GetTaskRequestSchema,"tasks/result":e.GetTaskPayloadRequestSchema,"tasks/list":e.ListTasksRequestSchema,"tasks/cancel":e.CancelTaskRequestSchema,"sampling/createMessage":e.CreateMessageRequestSchema,"elicitation/create":e.ElicitRequestSchema,"roots/list":e.ListRootsRequestSchema},notificationSchemas:{"notifications/cancelled":e.CancelledNotificationSchema,"notifications/progress":e.ProgressNotificationSchema,"notifications/initialized":e.InitializedNotificationSchema,"notifications/roots/list_changed":e.RootsListChangedNotificationSchema,"notifications/tasks/status":e.TaskStatusNotificationSchema,"notifications/message":e.LoggingMessageNotificationSchema,"notifications/resources/updated":e.ResourceUpdatedNotificationSchema,"notifications/resources/list_changed":e.ResourceListChangedNotificationSchema,"notifications/tools/list_changed":e.ToolListChangedNotificationSchema,"notifications/prompts/list_changed":e.PromptListChangedNotificationSchema,"notifications/elicitation/complete":e.ElicitationCompleteNotificationSchema},resultSchemas:{ping:e.EmptyResultSchema,initialize:e.InitializeResultSchema,"completion/complete":e.CompleteResultSchema,"logging/setLevel":e.EmptyResultSchema,"prompts/get":e.GetPromptResultSchema,"prompts/list":e.ListPromptsResultSchema,"resources/list":e.ListResourcesResultSchema,"resources/templates/list":e.ListResourceTemplatesResultSchema,"resources/read":e.ReadResourceResultSchema,"resources/subscribe":e.EmptyResultSchema,"resources/unsubscribe":e.EmptyResultSchema,"tools/call":e.CallToolResultWireSchema,"tools/list":e.ListToolsResultSchema,"sampling/createMessage":e.CreateMessageResultWithToolsSchema,"elicitation/create":e.ElicitResultSchema,"roots/list":e.ListRootsResultSchema}},Ti}function Di(e){return Object.prototype.hasOwnProperty.call(Si,e)}function Oi(e){return Object.prototype.hasOwnProperty.call(Ci,e)}function ki(e){return Object.prototype.hasOwnProperty.call(wi,e)}function Ai(e){return ki(e)?Ei().resultSchemas[e]:void 0}function ji(e){return Di(e)?Ei().requestSchemas[e]:void 0}function Mi(e){return Oi(e)?Ei().notificationSchemas[e]:void 0}Object.keys(Si),Object.keys(Ci);function Ni(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function Pi(e,t){if(e===void 0)return{ok:!1,reason:`not-in-era`};let n=e.safeParse(t);return n.success?{ok:!0,value:n.data}:{ok:!1,reason:`invalid`,message:String(n.error)}}var Fi={ok:!1,reason:`not-in-era`};function Ii(e){return Ni(e)&&Ni(e.outputSchema)&&_i(e.outputSchema)}function Li(e){return e}var Ri={era:`2025-11-25`,hasRequestMethod:Di,hasNotificationMethod:Oi,validateRequest:(e,t)=>Pi(ji(e),t),validateResult:(e,t)=>Pi(Ai(e),t),validateNotification:(e,t)=>Pi(Mi(e),t),hasInputRequestMethod:()=>!1,validateInputRequest:()=>Fi,validateInputResponse:()=>Fi,samplingResultVariant:((e,t)=>{let n=gi();return Pi(e?n.CreateMessageResultWithToolsSchema:n.CreateMessageResultSchema,t)}),outboundEnvelope:e=>void 0,validateEnvelopeMeta:e=>[],projectCallToolResult(e,t){let n=di(e),r=n.structuredContent;if(r===void 0)return n;let i=typeof r!=`object`||!r||Array.isArray(r),a=t!==void 0&&_i(t);return!i&&!a?n:{...n,structuredContent:{result:r}}},decodeResult(e,t){if(Ni(t)&&`resultType`in t){let e={...t};return delete e.resultType,{kind:`complete`,result:Li(e)}}return{kind:`complete`,result:Li(t)}},encodeResult(e,t){if(e!==`tools/list`)return t;let n=t.tools;return!Array.isArray(n)||!n.some(e=>Ii(e))?t:{...t,tools:n.map(e=>Ii(e)?{...e,outputSchema:xi(e.outputSchema)}:e)}},encodeErrorCode:e=>e===-32002?-32602:e,checkInboundEnvelope:e=>void 0};function zi(){let e=ce(()=>S([P(),O(),k(),ie(),j(P(),e),x(e)])),t=j(P(),e),n=S([P(),O().int()]),r=P(),i=S([P(),O().int()]),a=A([`user`,`assistant`]),o=A([`debug`,`info`,`notice`,`warning`,`error`,`critical`,`alert`,`emergency`]),s=P().refine(e=>{try{return atob(e),!0}catch{return!1}},{message:`Invalid Base64 string`}),c=D({ttl:O().optional()}),l=D({taskId:P()}),u=T({progressToken:n.optional(),"io.modelcontextprotocol/related-task":l.optional()}),d=D({_meta:u.optional()}),f=d.extend({task:c.optional()}),p=D({_meta:u.optional()}),m=D({method:P(),params:p.loose().optional()}),h=D({src:P(),mimeType:P().optional(),sizes:x(P()).optional(),theme:A([`light`,`dark`]).optional()}),g=D({icons:x(h).optional()}),_=D({name:P(),title:P().optional()}),v=_.extend({..._.shape,...g.shape,version:P(),websiteUrl:P().optional(),description:P().optional()}),y=re(D({applyDefaults:k().optional()}),t),b=ee(e=>e&&typeof e==`object`&&!Array.isArray(e)&&Object.keys(e).length===0?{form:{}}:e,re(D({form:y.optional(),url:t.optional()}),t.optional())),C=T({list:t.optional(),cancel:t.optional(),requests:T({sampling:T({createMessage:t.optional()}).optional(),elicitation:T({create:t.optional()}).optional()}).optional()}),te=T({list:t.optional(),cancel:t.optional(),requests:T({tools:T({call:t.optional()}).optional()}).optional()}),ne=D({experimental:j(P(),t).optional(),sampling:D({context:t.optional(),tools:t.optional()}).optional(),elicitation:b.optional(),roots:D({listChanged:k().optional()}).optional(),tasks:C.optional(),extensions:j(P(),t).optional()}),ae=D({experimental:j(P(),t).optional(),logging:t.optional(),completions:t.optional(),prompts:D({listChanged:k().optional()}).optional(),resources:D({subscribe:k().optional(),listChanged:k().optional()}).optional(),tools:D({listChanged:k().optional()}).optional(),tasks:te.optional(),extensions:j(P(),t).optional()}),oe=D({progress:O(),total:E(O()),message:E(P())}),se=D({...p.shape,...oe.shape,progressToken:n}),M=m.extend({method:w(`notifications/progress`),params:se}),le=p.extend({level:o,logger:P().optional(),data:N()}),ue=m.extend({method:w(`notifications/message`),params:le}),fe=D({uri:P(),mimeType:E(P()),_meta:j(P(),N()).optional()}),pe=fe.extend({text:P()}),F=fe.extend({blob:s}),I=D({audience:x(a).optional(),priority:O().min(0).max(1).optional(),lastModified:de({offset:!0}).optional()}),me=D({..._.shape,...g.shape,uri:P(),description:E(P()),mimeType:E(P()),size:E(O()),annotations:I.optional(),_meta:E(T({}))}),he=D({..._.shape,...g.shape,uriTemplate:P(),description:E(P()),mimeType:E(P()),annotations:I.optional(),_meta:E(T({}))}),ge=m.extend({method:w(`notifications/resources/list_changed`),params:p.optional()}),_e=p.extend({uri:P()}),ve=m.extend({method:w(`notifications/resources/updated`),params:_e}),L=D({name:P(),description:E(P()),required:E(k())}),ye=D({..._.shape,...g.shape,description:E(P()),arguments:E(x(L)),_meta:E(T({}))}),be=m.extend({method:w(`notifications/prompts/list_changed`),params:p.optional()}),xe=D({type:w(`text`),text:P(),annotations:I.optional(),_meta:j(P(),N()).optional()}),Se=D({type:w(`image`),data:s,mimeType:P(),annotations:I.optional(),_meta:j(P(),N()).optional()}),Ce=D({type:w(`audio`),data:s,mimeType:P(),annotations:I.optional(),_meta:j(P(),N()).optional()}),we=D({type:w(`tool_use`),name:P(),id:P(),input:j(P(),N()),_meta:j(P(),N()).optional()}),Te=D({type:w(`resource`),resource:S([pe,F]),annotations:I.optional(),_meta:j(P(),N()).optional()}),Ee=me.extend({type:w(`resource_link`)}),De=S([xe,Se,Ce,Ee,Te]),Oe=D({role:a,content:De}),ke=D({title:P().optional(),readOnlyHint:k().optional(),destructiveHint:k().optional(),idempotentHint:k().optional(),openWorldHint:k().optional()}),Ae=m.extend({method:w(`notifications/tools/list_changed`),params:p.optional()}),je=D({name:P().optional()}),Me=D({hints:x(je).optional(),costPriority:O().min(0).max(1).optional(),speedPriority:O().min(0).max(1).optional(),intelligencePriority:O().min(0).max(1).optional()}),Le=D({mode:A([`auto`,`required`,`none`]).optional()}),ze=D({type:w(`boolean`),title:P().optional(),description:P().optional(),default:k().optional()}),R=D({type:w(`string`),title:P().optional(),description:P().optional(),minLength:O().optional(),maxLength:O().optional(),format:A([`email`,`uri`,`date`,`date-time`]).optional(),default:P().optional()}),Be=D({type:A([`number`,`integer`]),title:P().optional(),description:P().optional(),minimum:O().optional(),maximum:O().optional(),default:O().optional()}),Ve=D({type:w(`string`),title:P().optional(),description:P().optional(),enum:x(P()),default:P().optional()}),He=D({type:w(`string`),title:P().optional(),description:P().optional(),oneOf:x(D({const:P(),title:P()})),default:P().optional()}),Ue=D({type:w(`string`),title:P().optional(),description:P().optional(),enum:x(P()),enumNames:x(P()).optional(),default:P().optional()}),We=S([Ve,He]),Ge=D({type:w(`array`),title:P().optional(),description:P().optional(),minItems:O().optional(),maxItems:O().optional(),items:D({type:w(`string`),enum:x(P())}),default:x(P()).optional()}),z=D({type:w(`array`),title:P().optional(),description:P().optional(),minItems:O().optional(),maxItems:O().optional(),items:D({anyOf:x(D({const:P(),title:P()}))}),default:x(P()).optional()}),Ke=S([Ge,z]),B=S([Ue,We,Ke]),V=S([B,ze,R,Be]),H=f.extend({mode:w(`form`).optional(),message:P(),requestedSchema:D({type:w(`object`),properties:j(P(),V),required:x(P()).optional()}).catchall(N())}),qe=D({type:w(`ref/resource`),uri:P()}),U=D({type:w(`ref/prompt`),name:P()}),Je=D({uri:P().startsWith(`file://`),name:P().optional(),_meta:j(P(),N()).optional()}),Ye=ne.shape,Xe=D({experimental:Ye.experimental,sampling:Ye.sampling,elicitation:Ye.elicitation,roots:Ye.roots,extensions:Ye.extensions}),Ze=ae.shape,Qe=D({experimental:Ze.experimental,logging:Ze.logging,completions:Ze.completions,prompts:Ze.prompts,resources:Ze.resources,tools:Ze.tools,extensions:Ze.extensions}),$e=T({progressToken:n.optional(),[Ne]:P(),[Pe]:v.optional(),[Ie]:Xe,[Re]:o.optional()}),et=D({..._.shape,...g.shape,description:P().optional(),inputSchema:T({$schema:P().optional(),type:w(`object`)}),outputSchema:T({$schema:P().optional()}).optional(),annotations:ke.optional(),_meta:j(P(),N()).optional()}),tt=D({type:w(`tool_result`),toolUseId:P(),content:x(De),structuredContent:N().optional(),isError:k().optional(),_meta:j(P(),N()).optional()}),nt=S([xe,Se,Ce,we,tt]),rt=D({role:a,content:S([nt,x(nt)]),_meta:j(P(),N()).optional()}),it=P(),at=T({[Fe]:v.optional().catch(void 0)}),ot=at.optional();function W(e){return T({_meta:ot,resultType:it.default(`complete`),...e})}let st=W({}),ct=W({nextCursor:r.optional()}),lt=W({content:x(De),structuredContent:N().optional(),isError:k().optional()}),ut=W({ttlMs:O().int().min(0),cacheScope:A([`public`,`private`]),tools:x(et),nextCursor:r.optional()}),dt=W({ttlMs:O().int().min(0),cacheScope:A([`public`,`private`]),prompts:x(ye),nextCursor:r.optional()}),ft=W({description:P().optional(),messages:x(Oe)}),pt=W({ttlMs:O().int().min(0),cacheScope:A([`public`,`private`]),resources:x(me),nextCursor:r.optional()}),mt=W({ttlMs:O().int().min(0),cacheScope:A([`public`,`private`]),resourceTemplates:x(he),nextCursor:r.optional()}),ht=W({ttlMs:O().int().min(0),cacheScope:A([`public`,`private`]),contents:x(S([pe,F]))}),gt=W({completion:D({values:x(P()).max(100),total:O().int().optional(),hasMore:k().optional()}).loose()}),_t=W({ttlMs:O().int().min(0),cacheScope:A([`public`,`private`])}),vt=W({ttlMs:O().int().min(0).catch(0),cacheScope:A([`public`,`private`]).catch(`private`),supportedVersions:x(P()),capabilities:Qe,instructions:P().optional()}),yt=D({messages:x(rt),modelPreferences:Me.optional(),systemPrompt:P().optional(),includeContext:A([`none`,`thisServer`,`allServers`]).optional(),temperature:O().optional(),maxTokens:O().int(),stopSequences:x(P()).optional(),metadata:t.optional(),tools:x(et).optional(),toolChoice:Le.optional()}),bt=D({method:w(`sampling/createMessage`),params:yt}),xt=D({method:w(`roots/list`),params:D({_meta:j(P(),N()).optional()}).optional()}),St=D({...rt.shape,model:P(),stopReason:P().optional()}),Ct=D({roots:x(Je)}),wt=D({action:A([`accept`,`decline`,`cancel`]),content:j(P(),S([P(),O(),k(),x(P())])).optional()}),Tt=D({mode:w(`url`),message:P(),url:P().url()}),Et=S([H,Tt]),Dt=D({method:w(`elicitation/create`),params:Et}),Ot=S([bt,xt,Dt]),kt=S([St,Ct,wt]),At=j(P(),Ot),jt=j(P(),kt),Mt=W({inputRequests:At.optional(),requestState:P().optional()}),Nt={inputResponses:jt.optional(),requestState:P().optional()},Pt=D({_meta:$e,...Nt}),Ft=T({progressToken:n.optional()});function It(e,t){return D({method:w(e),params:D({_meta:$e,...t})})}function Lt(e,t){return D({method:w(e),params:D({_meta:Ft.optional(),...t}).optional()})}let Rt={name:P(),arguments:j(P(),N()).optional(),...Nt},zt={cursor:r.optional()},Bt=It(`tools/call`,Rt),Vt=It(`tools/list`,zt),Ht=It(`prompts/list`,zt),Ut=It(`prompts/get`,{name:P(),arguments:j(P(),P()).optional(),...Nt}),Wt=It(`resources/list`,zt),Gt=It(`resources/templates/list`,zt),Kt=It(`resources/read`,{uri:P(),...Nt}),qt={ref:S([U,qe]),argument:D({name:P(),value:P()}),context:D({arguments:j(P(),P()).optional()}).optional()},Jt=It(`completion/complete`,qt),Yt=It(`server/discover`,{}),Xt=D({toolsListChanged:k().optional(),promptsListChanged:k().optional(),resourcesListChanged:k().optional(),resourceSubscriptions:x(P()).optional()}),Zt={notifications:Xt},Qt=It(`subscriptions/listen`,Zt),$t=at.extend({"io.modelcontextprotocol/subscriptionId":i}),en=T({_meta:$t,resultType:it.default(`complete`)}),tn={"tools/call":Lt(`tools/call`,Rt),"tools/list":Lt(`tools/list`,zt),"prompts/get":Lt(`prompts/get`,{name:P(),arguments:j(P(),P()).optional()}),"prompts/list":Lt(`prompts/list`,zt),"resources/list":Lt(`resources/list`,zt),"resources/templates/list":Lt(`resources/templates/list`,zt),"resources/read":Lt(`resources/read`,{uri:P()}),"completion/complete":Lt(`completion/complete`,qt),"server/discover":Lt(`server/discover`,{}),"subscriptions/listen":Lt(`subscriptions/listen`,Zt)};function G(e){return T({_meta:ot,...e})}let nn={"tools/call":G({content:x(De),structuredContent:N().optional(),isError:k().optional()}),"tools/list":G({ttlMs:O().int().min(0),cacheScope:A([`public`,`private`]),tools:x(et),nextCursor:r.optional()}),"prompts/get":G({description:P().optional(),messages:x(Oe)}),"prompts/list":G({ttlMs:O().int().min(0),cacheScope:A([`public`,`private`]),prompts:x(ye),nextCursor:r.optional()}),"resources/list":G({ttlMs:O().int().min(0),cacheScope:A([`public`,`private`]),resources:x(me),nextCursor:r.optional()}),"resources/templates/list":G({ttlMs:O().int().min(0),cacheScope:A([`public`,`private`]),resourceTemplates:x(he),nextCursor:r.optional()}),"resources/read":G({ttlMs:O().int().min(0),cacheScope:A([`public`,`private`]),contents:x(S([pe,F]))}),"completion/complete":G({completion:D({values:x(P()).max(100),total:O().int().optional(),hasMore:k().optional()}).loose()}),"server/discover":G({ttlMs:O().int().min(0).catch(0),cacheScope:A([`public`,`private`]).catch(`private`),supportedVersions:x(P()),capabilities:Qe,instructions:P().optional()}),"subscriptions/listen":G({})},rn=T({"io.modelcontextprotocol/subscriptionId":i.optional()}),an=D({method:w(`notifications/subscriptions/acknowledged`),params:D({_meta:rn.optional(),notifications:Xt})}),on=D({_meta:rn.optional(),requestId:i,reason:P().optional()}),sn=D({method:w(`notifications/cancelled`),params:on}),cn={"notifications/cancelled":sn,"notifications/progress":M,"notifications/message":ue,"notifications/resources/updated":ve,"notifications/resources/list_changed":ge,"notifications/tools/list_changed":Ae,"notifications/prompts/list_changed":be,"notifications/subscriptions/acknowledged":an},K=e=>D({jsonrpc:w(`2.0`),id:S([P(),O().int()]),result:e}).strict();return{JSONValueSchema:e,JSONObjectSchema:t,ProgressTokenSchema:n,CursorSchema:r,RequestIdSchema:i,RoleSchema:a,LoggingLevelSchema:o,TaskMetadataSchema:c,RelatedTaskMetadataSchema:l,RequestMetaSchema:u,BaseRequestParamsSchema:d,TaskAugmentedRequestParamsSchema:f,NotificationsParamsSchema:p,NotificationSchema:m,IconSchema:h,IconsSchema:g,BaseMetadataSchema:_,ImplementationSchema:v,ClientTasksCapabilitySchema:C,ServerTasksCapabilitySchema:te,ClientCapabilitiesSchema:ne,ServerCapabilitiesSchema:ae,ProgressSchema:oe,ProgressNotificationParamsSchema:se,ProgressNotificationSchema:M,LoggingMessageNotificationParamsSchema:le,LoggingMessageNotificationSchema:ue,ResourceContentsSchema:fe,TextResourceContentsSchema:pe,BlobResourceContentsSchema:F,AnnotationsSchema:I,ResourceSchema:me,ResourceTemplateSchema:he,ResourceListChangedNotificationSchema:ge,ResourceUpdatedNotificationParamsSchema:_e,ResourceUpdatedNotificationSchema:ve,PromptArgumentSchema:L,PromptSchema:ye,PromptListChangedNotificationSchema:be,TextContentSchema:xe,ImageContentSchema:Se,AudioContentSchema:Ce,ToolUseContentSchema:we,EmbeddedResourceSchema:Te,ResourceLinkSchema:Ee,ContentBlockSchema:De,PromptMessageSchema:Oe,ToolAnnotationsSchema:ke,ToolListChangedNotificationSchema:Ae,ModelHintSchema:je,ModelPreferencesSchema:Me,ToolChoiceSchema:Le,BooleanSchemaSchema:ze,StringSchemaSchema:R,NumberSchemaSchema:Be,UntitledSingleSelectEnumSchemaSchema:Ve,TitledSingleSelectEnumSchemaSchema:He,LegacyTitledEnumSchemaSchema:Ue,SingleSelectEnumSchemaSchema:We,UntitledMultiSelectEnumSchemaSchema:Ge,TitledMultiSelectEnumSchemaSchema:z,MultiSelectEnumSchemaSchema:Ke,EnumSchemaSchema:B,PrimitiveSchemaDefinitionSchema:V,ElicitRequestFormParamsSchema:H,ResourceTemplateReferenceSchema:qe,PromptReferenceSchema:U,RootSchema:Je,ClientCapabilities2026Schema:Xe,ServerCapabilities2026Schema:Qe,RequestMetaEnvelopeSchema:$e,ToolSchema:et,ToolResultContentSchema:tt,SamplingMessageContentBlockSchema:nt,SamplingMessageSchema:rt,ResultTypeSchema:it,ResultMetaSchema:at,ResultSchema:st,PaginatedResultSchema:ct,CallToolResultSchema:lt,ListToolsResultSchema:ut,ListPromptsResultSchema:dt,GetPromptResultSchema:ft,ListResourcesResultSchema:pt,ListResourceTemplatesResultSchema:mt,ReadResourceResultSchema:ht,CompleteResultSchema:gt,CacheableResultSchema:_t,DiscoverResultSchema:vt,CreateMessageRequestParamsSchema:yt,CreateMessageRequestSchema:bt,ListRootsRequestSchema:xt,CreateMessageResultSchema:St,ListRootsResultSchema:Ct,ElicitResultSchema:wt,ElicitRequestURLParamsSchema:Tt,ElicitRequestParamsSchema:Et,ElicitRequestSchema:Dt,InputRequestSchema:Ot,InputResponseSchema:kt,InputRequestsSchema:At,InputResponsesSchema:jt,InputRequiredResultSchema:Mt,InputResponseRequestParamsSchema:Pt,CallToolRequestSchema:Bt,ListToolsRequestSchema:Vt,ListPromptsRequestSchema:Ht,GetPromptRequestSchema:Ut,ListResourcesRequestSchema:Wt,ListResourceTemplatesRequestSchema:Gt,ReadResourceRequestSchema:Kt,CompleteRequestSchema:Jt,DiscoverRequestSchema:Yt,SubscriptionFilterSchema:Xt,SubscriptionsListenRequestSchema:Qt,SubscriptionsListenResultMetaSchema:$t,SubscriptionsListenResultSchema:en,dispatchRequestSchemas:tn,dispatchResultSchemas:nn,NotificationMetaSchema:rn,SubscriptionsAcknowledgedNotificationSchema:an,CancelledNotificationParamsSchema:on,CancelledNotificationSchema:sn,notificationSchemas2026:cn,JSONRPCResultResponseSchema:K(st),CallToolResultResponseSchema:K(S([lt,Mt])),ListToolsResultResponseSchema:K(ut),ListPromptsResultResponseSchema:K(dt),GetPromptResultResponseSchema:K(S([ft,Mt])),ListResourcesResultResponseSchema:K(pt),ListResourceTemplatesResultResponseSchema:K(mt),ReadResourceResultResponseSchema:K(S([ht,Mt])),CompleteResultResponseSchema:K(gt),DiscoverResultResponseSchema:K(vt),SubscriptionsListenResultResponseSchema:K(en)}}var Bi;function Vi(){return Bi??=zi()}var Hi=[`tools/list`,`prompts/list`,`resources/list`,`resources/templates/list`,`resources/read`,`server/discover`];function Ui(e){return Hi.includes(e)}var Wi=Symbol(`modelcontextprotocol.resultCacheHintFallback`);function Gi(e){return e[Wi]}function Ki(e){return typeof e==`number`&&Number.isSafeInteger(e)&&e>=0}function qi(e){return e===`public`||e===`private`}var X=function(e){return e[e.ParseError=-32700]=`ParseError`,e[e.InvalidRequest=-32600]=`InvalidRequest`,e[e.MethodNotFound=-32601]=`MethodNotFound`,e[e.InvalidParams=-32602]=`InvalidParams`,e[e.InternalError=-32603]=`InternalError`,e[e.ResourceNotFound=-32002]=`ResourceNotFound`,e[e.MissingRequiredClientCapability=-32021]=`MissingRequiredClientCapability`,e[e.UnsupportedProtocolVersion=-32022]=`UnsupportedProtocolVersion`,e[e.UrlElicitationRequired=-32042]=`UrlElicitationRequired`,e}({}),Z=class e extends Error{static{Object.defineProperty(this,"mcpBrand",{value:`mcp.ProtocolError`})}static[Symbol.hasInstance](e){return $r(this,e)}static isInstance(e){if(typeof this!=`function`)throw TypeError("isInstance must be called on the class (e.g. `SdkError.isInstance(value)`); for callbacks use `v => SdkError.isInstance(v)`");return $r(this,e)}constructor(e,t,n){super(t),this.code=e,this.data=n,this.name=`ProtocolError`,Qr(this,new.target)}static fromError(t,n,r){if(t===X.UrlElicitationRequired&&r){let e=r;if(e.elicitations)return new Yi(e.elicitations,n)}if(t===X.UnsupportedProtocolVersion&&r){let e=r;if(Array.isArray(e.supported)&&typeof e.requested==`string`)return new Xi({supported:e.supported,requested:e.requested},n)}if(t===X.InvalidParams||t===X.ResourceNotFound){let e=r;if(typeof e?.uri==`string`&&(t===X.ResourceNotFound||Object.keys(e).length===1))return new Ji(e.uri,n)}if(t===X.MissingRequiredClientCapability&&r){let e=r;if(e.requiredCapabilities!==null&&typeof e.requiredCapabilities==`object`&&!Array.isArray(e.requiredCapabilities))return new Zi({requiredCapabilities:e.requiredCapabilities},n)}return new e(t,n,r)}},Ji=class extends Z{static{Object.defineProperty(this,"mcpBrand",{value:`mcp.ResourceNotFoundError`})}constructor(e,t=`Resource not found: ${e}`){super(X.InvalidParams,t,{uri:e})}get uri(){return this.data.uri}},Yi=class extends Z{static{Object.defineProperty(this,"mcpBrand",{value:`mcp.UrlElicitationRequiredError`})}constructor(e,t=`URL elicitation${e.length>1?`s`:``} required`){super(X.UrlElicitationRequired,t,{elicitations:e})}get elicitations(){return this.data?.elicitations??[]}},Xi=class extends Z{static{Object.defineProperty(this,"mcpBrand",{value:`mcp.UnsupportedProtocolVersionError`})}constructor(e,t=`Unsupported protocol version: ${e.requested}`){super(X.UnsupportedProtocolVersion,t,e)}get supported(){return this.data.supported}get requested(){return this.data.requested}},Zi=class extends Z{static{Object.defineProperty(this,"mcpBrand",{value:`mcp.MissingRequiredClientCapabilityError`})}constructor(e,t=`Missing required client capabilities: ${Object.keys(e.requiredCapabilities).join(`, `)}`){super(X.MissingRequiredClientCapability,t,e)}get requiredCapabilities(){return this.data.requiredCapabilities}},Qi=0,$i=`private`,ea=[`tools/call`,`prompts/get`,`resources/read`];function ta(e,t){let n=t.resultType;if(n===void 0)return{...t,resultType:`complete`};if(n===`complete`||ea.includes(e))return t;throw new Z(X.InternalError,`Handler for ${e} returned resultType '${String(n)}', but results of ${e} only support 'complete' on protocol revision 2026-07-28`)}function na(e,t){let n=Gi(t);if(t.resultType!==`complete`||!Ui(e))return n===void 0?t:sa(t);let r=t,i=Ki(r.ttlMs)?r.ttlMs:aa(n),a=qi(r.cacheScope)?r.cacheScope:oa(n),o={...r,ttlMs:i,cacheScope:a};return delete o[Wi],o}function ra(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function ia(e,t){if(t===void 0)return e;let n=e._meta;return n===void 0?{...e,_meta:{[Fe]:t}}:!ra(n)||n[`io.modelcontextprotocol/serverInfo`]!==void 0?e:{...e,_meta:{...n,[Fe]:t}}}function aa(e){return e!==void 0&&Ki(e.ttlMs)?e.ttlMs:Qi}function oa(e){return e!==void 0&&qi(e.cacheScope)?e.cacheScope:$i}function sa(e){let t={...e};return delete t[Wi],t}var ca=[`elicitation/create`,`sampling/createMessage`,`roots/list`],la;function ua(){if(la)return la;let e=Vi();return la={request:{"elicitation/create":D({method:w(`elicitation/create`),params:e.ElicitRequestParamsSchema}),"sampling/createMessage":D({method:w(`sampling/createMessage`),params:e.CreateMessageRequestParamsSchema}),"roots/list":D({method:w(`roots/list`),params:T({}).optional()})},response:{"elicitation/create":e.ElicitResultSchema,"sampling/createMessage":e.CreateMessageResultSchema,"roots/list":e.ListRootsResultSchema}},la}function da(e){return ca.includes(e)}function fa(e){return da(e)?ua().request[e]:void 0}function pa(e){return da(e)?ua().response[e]:void 0}var ma={"tools/call":null,"tools/list":null,"prompts/get":null,"prompts/list":null,"resources/list":null,"resources/templates/list":null,"resources/read":null,"completion/complete":null,"server/discover":null,"subscriptions/listen":null},ha={"notifications/cancelled":null,"notifications/progress":null,"notifications/message":null,"notifications/resources/updated":null,"notifications/resources/list_changed":null,"notifications/tools/list_changed":null,"notifications/prompts/list_changed":null,"notifications/subscriptions/acknowledged":null};function ga(e){return Object.prototype.hasOwnProperty.call(ma,e)}function _a(e){return Object.prototype.hasOwnProperty.call(ha,e)}function va(e){return Object.prototype.hasOwnProperty.call(ma,e)}function ya(e){return ga(e)?Vi().dispatchRequestSchemas[e]:void 0}function ba(e){return va(e)?Vi().dispatchResultSchemas[e]:void 0}function xa(e){return _a(e)?Vi().notificationSchemas2026[e]:void 0}Object.keys(ma),Object.keys(ha);function Sa(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function Ca(e,t){if(e===void 0)return{ok:!1,reason:`not-in-era`};let n=e.safeParse(t);return n.success?{ok:!0,value:n.data}:{ok:!1,reason:`invalid`,message:String(n.error)}}var wa={ok:!1,reason:`not-in-era`},Ta=[Ne,Ie];function Ea(e,t){let n=t,r=!1,i=()=>(r||=(n={...n},!0),n),a=t.tools;e===`tools/list`&&Array.isArray(a)&&a.some(e=>Sa(e)&&`execution`in e)&&(i().tools=a.map(e=>{if(!Sa(e)||!(`execution`in e))return e;let t={...e};return delete t.execution,t}));let o=t.capabilities;if(Sa(o)&&`tasks`in o){let e={...o};delete e.tasks,i().capabilities=e}return n}var Da={era:`2026-07-28`,hasRequestMethod:ga,hasNotificationMethod:_a,hasInputRequestMethod:e=>fa(e)!==void 0,validateRequest:(e,t)=>Ca(ya(e),t),validateResult:(e,t)=>Ca(ba(e),t),validateNotification:(e,t)=>Ca(xa(e),t),validateInputRequest:(e,t)=>Ca(fa(e),t),validateInputResponse:(e,t)=>Ca(pa(e),t),samplingResultVariant:()=>wa,outboundEnvelope(e){return{[Ne]:e.protocolVersion,[Pe]:e.clientInfo,[Ie]:e.clientCapabilities,...e.logLevel!==void 0&&{"io.modelcontextprotocol/logLevel":e.logLevel}}},validateEnvelopeMeta(e){let t=[];for(let n of Ta)n in e||t.push({key:n,problem:`missing`});let n=Vi().RequestMetaEnvelopeSchema.safeParse(e);if(!n.success)for(let e of n.error.issues){let n=e.path.map(String),r=n.length>0?n.join(`.`):`_meta`;n.length===1&&t.some(e=>e.key===r&&e.problem===`missing`)||t.push({key:r,problem:e.message})}return t},projectCallToolResult:e=>di(e),inputRequestSchema:fa,decodeResult(e,t){if(!Sa(t))return{kind:`invalid`,error:new Y(J.InvalidResult,`Invalid result for ${e}: not an object`,{method:e})};let n=t.resultType;if(n===void 0)return{kind:`invalid`,error:new Y(J.InvalidResult,`Invalid result for ${e}: missing required resultType — servers implementing protocol revision 2026-07-28 MUST include it (the absent-means-complete bridge applies only to earlier-revision servers)`,{method:e,violation:`missing-resultType`})};if(typeof n!=`string`)return{kind:`invalid`,error:new Y(J.InvalidResult,`Invalid result for ${e}: non-string resultType`,{method:e,resultType:n})};if(n===`input_required`){let n=t.inputRequests,r=Sa(n)?n:{},i=t.requestState,a=t._meta===void 0?void 0:Vi().ResultMetaSchema.safeParse(t._meta),o=a?.success?a.data:void 0;return Object.keys(r).length===0&&typeof i!=`string`?{kind:`invalid`,error:new Y(J.InvalidResult,`Invalid result for ${e}: input_required carries neither inputRequests nor requestState (every input_required result must include at least one of the two)`,{method:e,violation:`input-required-missing-both`})}:{kind:`input_required`,inputRequests:r,...typeof i==`string`&&{requestState:i},...o!==void 0&&{_meta:o}}}if(n!==`complete`)return{kind:`invalid`,error:new Y(J.UnsupportedResultType,`Unsupported result type '${n}' for ${e}`,{resultType:n,method:e})};let r=ka(),i=Object.hasOwn(r,e)?r[e]:void 0;if(i!==void 0){let n=i.safeParse(t);if(!n.success)return{kind:`invalid`,error:new Y(J.InvalidResult,`Invalid result for ${e}: ${n.error}`,{method:e})}}let a={...t};return delete a.resultType,{kind:`complete`,result:a}},encodeResult(e,t,n){return ia(na(e,ta(e,Ea(e,t))),n)},encodeErrorCode:e=>e===-32002?-32602:e,checkInboundEnvelope(e){if(e.envelope===void 0)return`Request is missing the required _meta envelope for protocol revision 2026-07-28 (io.modelcontextprotocol/protocolVersion, io.modelcontextprotocol/clientCapabilities)`;let t=Vi().RequestMetaEnvelopeSchema.safeParse(e.envelope);if(!t.success)return`Invalid _meta envelope for protocol revision 2026-07-28: ${t.error.issues.map(e=>e.message).join(`; `)}`}},Oa;function ka(){if(Oa)return Oa;let e=Vi();return Oa={"tools/call":e.CallToolResultSchema,"tools/list":e.ListToolsResultSchema,"prompts/get":e.GetPromptResultSchema,"prompts/list":e.ListPromptsResultSchema,"resources/list":e.ListResourcesResultSchema,"resources/templates/list":e.ListResourceTemplatesResultSchema,"resources/read":e.ReadResourceResultSchema,"completion/complete":e.CompleteResultSchema,"server/discover":e.DiscoverResultSchema},Oa}var Aa=`2026-07-28`;function ja(e){return e!==void 0&&ci(e)?Da:Ri}function Ma(e){return e.revision===void 0?e.era===`modern`?Da.era:Ri.era:ja(e.revision).era}function Na(e){return Ia.some(t=>t.hasRequestMethod(e))}function Pa(e){return Ia.some(t=>t.hasNotificationMethod(e))}function Fa(e){return e===`tasks/get`||e===`tasks/cancel`}var Ia=[Ri,Da],La=xe({AnnotationsSchema:()=>jt,AudioContentSchema:()=>ln,BaseMetadataSchema:()=>ot,BaseRequestParamsSchema:()=>z,BlobResourceContentsSchema:()=>kt,BooleanSchemaSchema:()=>Wn,CallToolRequestParamsSchema:()=>wn,CallToolRequestSchema:()=>Tn,CallToolResultSchema:()=>Sn,CancelTaskRequestSchema:()=>Ar,CancelTaskResultSchema:()=>jr,CancelledNotificationParamsSchema:()=>nt,CancelledNotificationSchema:()=>rt,ClientCapabilitiesSchema:()=>dt,ClientNotificationSchema:()=>Nr,ClientRequestSchema:()=>Mr,ClientResultSchema:()=>Pr,ClientTasksCapabilitySchema:()=>lt,CompatibilityCallToolResultSchema:()=>Cn,CompleteRequestParamsSchema:()=>dr,CompleteRequestSchema:()=>fr,CompleteResultSchema:()=>pr,ContentBlockSchema:()=>pn,CreateMessageRequestParamsSchema:()=>Bn,CreateMessageRequestSchema:()=>Vn,CreateMessageResultSchema:()=>Hn,CreateMessageResultWithToolsSchema:()=>Un,CreateTaskResultSchema:()=>xr,CursorSchema:()=>He,DiscoverRequestSchema:()=>_t,DiscoverResultSchema:()=>vt,ElicitRequestFormParamsSchema:()=>nr,ElicitRequestParamsSchema:()=>ir,ElicitRequestSchema:()=>ar,ElicitRequestURLParamsSchema:()=>rr,ElicitResultSchema:()=>cr,ElicitationCompleteNotificationParamsSchema:()=>or,ElicitationCompleteNotificationSchema:()=>sr,EmbeddedResourceSchema:()=>dn,EmptyResultSchema:()=>tt,EnumSchemaSchema:()=>er,GetPromptRequestParamsSchema:()=>on,GetPromptRequestSchema:()=>sn,GetPromptResultSchema:()=>hn,GetTaskPayloadRequestSchema:()=>Er,GetTaskPayloadResultSchema:()=>Dr,GetTaskRequestSchema:()=>wr,GetTaskResultSchema:()=>Tr,IconSchema:()=>it,IconsSchema:()=>at,ImageContentSchema:()=>K,ImplementationSchema:()=>W,InitializeRequestParamsSchema:()=>ft,InitializeRequestSchema:()=>pt,InitializeResultSchema:()=>ht,InitializedNotificationSchema:()=>gt,JSONArraySchema:()=>Be,JSONObjectSchema:()=>R,JSONRPCErrorResponseSchema:()=>Qe,JSONRPCMessageSchema:()=>$e,JSONRPCNotificationSchema:()=>Xe,JSONRPCRequestSchema:()=>Ye,JSONRPCResponseSchema:()=>et,JSONRPCResultResponseSchema:()=>Ze,JSONValueSchema:()=>ze,LegacyTitledEnumSchemaSchema:()=>Yn,ListChangedOptionsBaseSchema:()=>Dn,ListPromptsRequestSchema:()=>rn,ListPromptsResultSchema:()=>an,ListResourceTemplatesRequestSchema:()=>It,ListResourceTemplatesResultSchema:()=>Lt,ListResourcesRequestSchema:()=>Pt,ListResourcesResultSchema:()=>Ft,ListRootsRequestSchema:()=>hr,ListRootsResultSchema:()=>gr,ListTasksRequestSchema:()=>Or,ListTasksResultSchema:()=>kr,ListToolsRequestSchema:()=>bn,ListToolsResultSchema:()=>xn,LoggingLevelSchema:()=>On,LoggingMessageNotificationParamsSchema:()=>jn,LoggingMessageNotificationSchema:()=>Mn,ModelHintSchema:()=>Nn,ModelPreferencesSchema:()=>Pn,MultiSelectEnumSchemaSchema:()=>$n,NotificationSchema:()=>H,NotificationsParamsSchema:()=>V,NumberSchemaSchema:()=>Kn,PaginatedRequestParamsSchema:()=>Ct,PaginatedRequestSchema:()=>wt,PaginatedResultSchema:()=>Tt,PingRequestSchema:()=>yt,PrimitiveSchemaDefinitionSchema:()=>tr,ProgressNotificationParamsSchema:()=>xt,ProgressNotificationSchema:()=>St,ProgressSchema:()=>bt,ProgressTokenSchema:()=>Ve,PromptArgumentSchema:()=>G,PromptListChangedNotificationSchema:()=>gn,PromptMessageSchema:()=>mn,PromptReferenceSchema:()=>ur,PromptSchema:()=>nn,ReadResourceRequestParamsSchema:()=>zt,ReadResourceRequestSchema:()=>Bt,ReadResourceResultSchema:()=>Vt,RelatedTaskMetadataSchema:()=>We,RequestIdSchema:()=>Je,RequestMetaSchema:()=>Ge,RequestSchema:()=>B,ResourceContentsSchema:()=>Et,ResourceLinkSchema:()=>fn,ResourceListChangedNotificationSchema:()=>Ht,ResourceRequestParamsSchema:()=>Rt,ResourceSchema:()=>Mt,ResourceTemplateReferenceSchema:()=>lr,ResourceTemplateSchema:()=>Nt,ResourceUpdatedNotificationParamsSchema:()=>en,ResourceUpdatedNotificationSchema:()=>tn,ResultMetaObjectSchema:()=>qe,ResultSchema:()=>U,RoleSchema:()=>At,RootSchema:()=>mr,RootsListChangedNotificationSchema:()=>_r,SamplingContentSchema:()=>Ln,SamplingMessageContentBlockSchema:()=>Rn,SamplingMessageSchema:()=>zn,ServerCapabilitiesSchema:()=>mt,ServerNotificationSchema:()=>Ir,ServerRequestSchema:()=>Fr,ServerResultSchema:()=>Lr,ServerTasksCapabilitySchema:()=>ut,SetLevelRequestParamsSchema:()=>kn,SetLevelRequestSchema:()=>An,SingleSelectEnumSchemaSchema:()=>Xn,StringSchemaSchema:()=>Gn,SubscribeRequestParamsSchema:()=>Ut,SubscribeRequestSchema:()=>Wt,SubscriptionFilterSchema:()=>qt,SubscriptionsAcknowledgedNotificationParamsSchema:()=>Xt,SubscriptionsAcknowledgedNotificationSchema:()=>Zt,SubscriptionsListenRequestParamsSchema:()=>Jt,SubscriptionsListenRequestSchema:()=>Yt,SubscriptionsListenResultMetaSchema:()=>Qt,SubscriptionsListenResultSchema:()=>$t,TaskAugmentedRequestParamsSchema:()=>Ke,TaskCreationParamsSchema:()=>vr,TaskMetadataSchema:()=>Ue,TaskSchema:()=>br,TaskStatusNotificationParamsSchema:()=>Sr,TaskStatusNotificationSchema:()=>Cr,TaskStatusSchema:()=>yr,TextContentSchema:()=>cn,TextResourceContentsSchema:()=>Dt,TitledMultiSelectEnumSchemaSchema:()=>Qn,TitledSingleSelectEnumSchemaSchema:()=>Jn,ToolAnnotationsSchema:()=>_n,ToolChoiceSchema:()=>Fn,ToolExecutionSchema:()=>vn,ToolListChangedNotificationSchema:()=>En,ToolResultContentSchema:()=>In,ToolSchema:()=>yn,ToolUseContentSchema:()=>un,UnsubscribeRequestParamsSchema:()=>Gt,UnsubscribeRequestSchema:()=>Kt,UntitledMultiSelectEnumSchemaSchema:()=>Zn,UntitledSingleSelectEnumSchemaSchema:()=>qn}),Ra=e=>Ye.safeParse(e).success,za=e=>Xe.safeParse(e).success,Ba=e=>Ze.safeParse(e).success,Va=e=>Qe.safeParse(e).success,Ha=e=>typeof e==`object`&&!!e&&!Array.isArray(e)&&e.resultType===`input_required`,Ua=e=>pt.safeParse(e).success,Wa=e=>gt.safeParse(e).success,Ga=`Mcp-Param-`,Ka=`x-mcp-header`,qa=/^[!#$%&'*+\-.^_`|~0-9A-Za-z]+$/,Ja=new Set([`string`,`integer`,`boolean`,`number`]);function Ya(e){let t=[],n=new Map,r=(e,i,a)=>{if(typeof e!=`object`||!e)return;let o=e;if(Ka in o){if(!a||i.length===0)return`${Qa(i)}: x-mcp-header is only permitted on properties statically reachable via a chain of 'properties' keys (not under items, additionalProperties, oneOf/anyOf/allOf/not, if/then/else, or $ref)`;let e=o[Ka];if(typeof e!=`string`||e.length===0)return`${Qa(i)}: x-mcp-header MUST be a non-empty string`;if(!qa.test(e))return`${Qa(i)}: x-mcp-header '${e}' is not a valid RFC 9110 token (no spaces, control characters or HTTP delimiters)`;let r=typeof o.type==`string`?o.type:void 0;if(r===void 0||!Ja.has(r))return`${Qa(i)}: x-mcp-header is only permitted on primitive-typed properties (string, integer, boolean); got ${r??``}`;let s=e.toLowerCase(),c=n.get(s);if(c!==void 0)return`x-mcp-header '${e}' is not case-insensitively unique (also declared as '${c}')`;n.set(s,e),t.push({path:i,headerName:e,type:r})}let s=o.properties;if(typeof s==`object`&&s)for(let[e,t]of Object.entries(s)){let n=r(t,[...i,e],a);if(n!==void 0)return n}for(let e of Xa){let t=o[e];if(t===void 0)continue;let n=Array.isArray(t)?t:typeof t==`object`&&t&&Za.has(e)?Object.values(t):[t];for(let t of n){let n=r(t,[...i,`<${e}>`],!1);if(n!==void 0)return n}}},i=r(e,[],!0);return i===void 0?{valid:!0,declarations:t}:{valid:!1,reason:i}}var Xa=[`items`,`prefixItems`,`contains`,`additionalProperties`,`unevaluatedProperties`,`unevaluatedItems`,`propertyNames`,`patternProperties`,`dependentSchemas`,`oneOf`,`anyOf`,`allOf`,`not`,`if`,`then`,`else`,`$defs`,`definitions`],Za=new Set([`patternProperties`,`dependentSchemas`,`$defs`,`definitions`]);function Qa(e){return e.length===0?``:e.join(`.`)}var $a=`=?base64?`,eo=`?=`;function to(e){if(typeof e==`string`)return e;if(typeof e==`boolean`)return e?`true`:`false`;if(typeof e==`number`)return!Number.isFinite(e)||Number.isInteger(e)&&!Number.isSafeInteger(e)?void 0:String(e)}function no(e){if(e.length===0||e.startsWith($a)&&e.endsWith(eo)||e!==e.trim())return!0;for(let t=0;t=32&&n<=126))return!0}return!1}function ro(e){let t=new TextEncoder().encode(e),n=``;for(let e of t)n+=String.fromCodePoint(e);return btoa(n)}function io(e){return no(e)?`${$a}${ro(e)}${eo}`:e}function ao(e,t){let n=e;for(let e of t){if(typeof n!=`object`||!n)return;n=n[e]}return n}function oo(e,t){let n={};for(let r of e){let e=ao(t,r.path);if(e==null)continue;let i=to(e);i!==void 0&&(n[`${Ga}${r.headerName}`]=io(i))}return n}X.InvalidRequest,X.UnsupportedProtocolVersion,X.InvalidParams,X.MethodNotFound,X.InvalidParams,X.MissingRequiredClientCapability,X.ParseError,X.InvalidRequest,X.MethodNotFound,X.UnsupportedProtocolVersion,X.MissingRequiredClientCapability;var so={"tools/call":`name`,"prompts/get":`name`,"resources/read":`uri`,"tasks/get":`taskId`,"tasks/update":`taskId`,"tasks/cancel":`taskId`};function co(e,t){let n=Object.hasOwn(so,e)?so[e]:void 0;if(n===void 0)return;let r=lo(t)?t[n]:void 0;return{field:n,value:typeof r==`string`?r:void 0}}function lo(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function uo(e,t){return f(e,t)}function fo(e){return new Set(e.flatMap(e=>Object.keys(e.shape)))}function po(e){if(e==null)return!1;let t=typeof e;return t!==`object`&&t!==`function`||!(`~standard`in e)?!1:typeof e[`~standard`]?.validate==`function`}var mo=!1,ho=`draft-2020-12`;function go(e,t=`input`){let n=e[`~standard`],r;if(n.jsonSchema)r=n.jsonSchema[t]({target:ho});else if(n.vendor===`zod`){if(!(`_zod`in e))throw Error(`Schema appears to be from zod 3, which the SDK cannot convert to JSON Schema. Upgrade to zod >=4.2.0, or wrap your JSON Schema with fromJsonSchema().`);mo||(mo=!0,console.warn("[mcp-sdk] Your zod version does not implement `~standard.jsonSchema` (added in zod 4.2.0). Falling back to z.toJSONSchema(). Upgrade to zod >=4.2.0 to silence this warning.")),r=M(e,{target:ho,io:t})}else throw Error(`Schema library "${n.vendor}" does not implement StandardJSONSchemaV1 (\`~standard.jsonSchema\`). Upgrade to a version that does, or wrap your JSON Schema with fromJsonSchema().`);if(t===`output`)return r.type===void 0&&_o(r)?{type:`object`,...r}:r;if(r.type!==void 0&&r.type!==`object`)throw Error(`MCP tool and prompt schemas must describe objects (got type: ${JSON.stringify(r.type)}). Wrap your schema in z.object({...}) or equivalent.`);return{type:`object`,...r}}function _o(e){if(`properties`in e||`patternProperties`in e||`additionalProperties`in e||`required`in e)return!0;for(let t of[`oneOf`,`anyOf`,`allOf`]){let n=e[t];if(Array.isArray(n)&&n.length>0)return n.every(e=>typeof e==`object`&&!!e&&(e.type===`object`||_o(e)))}return!1}function vo(e){return e.path?.length?`${e.path.map(e=>String(typeof e==`object`?e.key:e)).join(`.`)}: ${e.message}`:e.message}async function yo(e,t){let n=await e[`~standard`].validate(t);return n.issues&&n.issues.length>0?{success:!1,error:n.issues.map(e=>vo(e)).join(`, `)}:{success:!0,data:n.value}}function bo(e){let t=M(e,{target:ho,io:`input`});return typeof t.pattern==`string`?t.pattern:void 0}var xo=/\\\.\\d\{(\d+)\}/;function So(e){let t=xo.exec(e),n=[void 0,-1,0];return t&&n.push(Number(t[1])),[!1,!0].flatMap(e=>[!1,!0].flatMap(t=>n.map(n=>de({local:e,offset:t,precision:n}))))}function Co(e,t){let n;switch(e){case`email`:n=[C()];break;case`uri`:n=[y()];break;case`date`:n=[fe()];break;case`date-time`:n=So(t)}return new Set(n.map(e=>bo(e)).filter(e=>e!==void 0))}function wo(e,t,n){return n!==`zod`||Co(e,t).has(t)}function To(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function Eo(e){try{return go(e,`input`)}catch(e){let t=e instanceof Error?e.message:String(e);throw new Z(X.InvalidParams,`Elicitation requestedSchema must describe an object with flat primitive properties: ${t}`)}}var Do=new Set([`$comment`,`deprecated`,`description`,`examples`,`readOnly`,`title`,`writeOnly`]);function Oo(e){return Do.has(e)||e.startsWith(`x-`)}var ko=new Set([`$schema`,...Object.keys(nr.shape.requestedSchema.shape)]),Ao={string:fo([Gn,qn,Jn,Yn]),number:fo([Kn]),integer:fo([Kn]),boolean:fo([Wn]),array:fo([Zn,Qn])},jo=new Set(Gn.shape.format.unwrap().options);function Mo(e,t,n,r){if(!To(e))return e;let i=typeof e.type==`string`&&Object.hasOwn(Ao,e.type)?Ao[e.type]:void 0;if(i===void 0)return e;let a={};for(let[o,s]of Object.entries(e))i.has(o)||Oo(o)?a[o]=s:o===`pattern`&&e.type===`string`&&typeof e.format==`string`?jo.has(e.format)?(typeof s!=`string`||!wo(e.format,s,n))&&r.push(`${t}.${o}`):a[o]=s:r.push(`${t}.${o}`);return a}function No(e,t){let n={},r=[];for(let[i,a]of Object.entries(e))i===`properties`&&To(a)?n[i]=Object.fromEntries(Object.entries(a).map(([e,n])=>[e,Mo(n,`properties.${e}`,t,r)])):ko.has(i)?n[i]=a:Oo(i)||r.push(i);if(r.length>0)throw new Z(X.InvalidParams,`Elicitation requestedSchema contains unsupported JSON Schema constraint(s) after Standard Schema conversion: ${r.join(`, `)}`);return n}function Po(e,t){if(!To(e.properties))return t;let n=Object.entries(e.properties).filter(([,e])=>!uo(tr,e).success).map(([e])=>`properties.${e}`);return n.length>0?n.join(`, `):t}function Fo(e,t,n=``){return Array.isArray(e)&&Array.isArray(t)?e.flatMap((e,r)=>Fo(e,t[r],`${n}[${r}]`)):!To(e)||!To(t)?[]:Object.entries(e).flatMap(([e,r])=>{let i=n?`${n}.${e}`:e;return Object.prototype.hasOwnProperty.call(t,e)?Fo(r,t[e],i):Oo(e)?[]:[i]})}function Io(e){if(!po(e.requestedSchema))return{...e,mode:`form`,requestedSchema:e.requestedSchema};let t=e.requestedSchema[`~standard`].vendor,n=No(Eo(e.requestedSchema),t),r=uo(nr.shape.requestedSchema,n);if(!r.success)throw new Z(X.InvalidParams,`Elicitation requestedSchema only supports flat primitive properties (string, number, integer, boolean, and string enums): ${Po(n,r.error.message)}`);let i=Fo(n,r.data);if(i.length>0)throw new Z(X.InvalidParams,`Elicitation requestedSchema contains unsupported JSON Schema constraint(s) after Standard Schema conversion: ${i.join(`, `)}`);let a=(r.data.required??[]).filter(e=>!Object.prototype.hasOwnProperty.call(r.data.properties,e));if(a.length>0)throw new Z(X.InvalidParams,`Elicitation requestedSchema lists required properties that are not defined in properties: ${a.join(`, `)}`);return{...e,mode:`form`,requestedSchema:r.data}}function Lo(e){let t=e.inputRequests!==void 0&&Object.keys(e.inputRequests).length>0,n=typeof e.requestState==`string`;if(!t&&!n)throw TypeError(`inputRequired() requires at least one of inputRequests (with at least one entry) or requestState (spec: every InputRequiredResult MUST include at least one of the two)`);return{resultType:`input_required`,...e.inputRequests!==void 0&&{inputRequests:e.inputRequests},...e.requestState!==void 0&&{requestState:e.requestState}}}Object.assign(Lo,{elicit(e){try{return{method:`elicitation/create`,params:Io(e)}}catch(e){throw e instanceof Z?TypeError(e.message,{cause:e}):e}},elicitUrl(e){return{method:`elicitation/create`,params:{...e,mode:`url`}}},createMessage(e){return{method:`sampling/createMessage`,params:e}},listRoots(){return{method:`roots/list`}}});var Ro=!0,zo=10,Bo=250;function Vo(e){return{autoFulfill:e?.autoFulfill??Ro,maxRounds:e?.maxRounds??zo}}function Ho(e,t,n){let r=t!==void 0&&Object.keys(t).length>0;return!r&&n===void 0?e:{...e,...r&&{inputResponses:t},...n!==void 0&&{requestState:n}}}function Uo(e,t){return`Multi-round-trip request '${e}' still required input after ${t} rounds (inputRequired.maxRounds)`}function Wo(e,t){return new Promise((n,r)=>{if(t?.aborted){r(t.reason instanceof Y?t.reason:new Y(J.RequestTimeout,String(t.reason)));return}let i=setTimeout(()=>{t?.removeEventListener(`abort`,a),n()},e),a=()=>{clearTimeout(i),r(t?.reason instanceof Y?t.reason:new Y(J.RequestTimeout,String(t?.reason)))};t?.addEventListener(`abort`,a,{once:!0})})}function Go(e){let t=new AbortController,n=()=>t.abort(e?.reason);return e?.addEventListener(`abort`,n,{once:!0}),e?.aborted&&t.abort(e.reason),{signal:t.signal,abort:e=>t.abort(e),dispose:()=>e?.removeEventListener(`abort`,n)}}async function Ko(e){let{config:t,method:n,originalParams:r,requestOptions:i,hooks:a,signal:o}=e,s=e.flowStartedAt??Date.now(),c=e.firstPayload,l=0;for(;;){if(l+=1,l>t.maxRounds)throw new Y(J.InputRequiredRoundsExceeded,Uo(n,t.maxRounds),{rounds:t.maxRounds,lastResult:{inputRequests:c.inputRequests,...c.requestState!==void 0&&{requestState:c.requestState}}});i.onprogress?.({progress:l,message:`Fulfilling input required by '${n}' (round ${l})`});let e=Object.entries(c.inputRequests??{}),u;if(e.length>0){let t=Go(o);try{let n=await Promise.all(e.map(async([e,n])=>{try{return[e,await a.dispatchInputRequest(e,n,t.signal)]}catch(e){throw t.abort(e),e}}));u=Object.fromEntries(n)}finally{t.dispose()}}else await Wo(Bo,o);let d={...i.timeout!==void 0&&{timeout:i.timeout}};if(i.maxTotalTimeout!==void 0){let e=Date.now()-s,t=i.maxTotalTimeout-e;if(t<=0)throw new Y(J.RequestTimeout,`Maximum total timeout exceeded`,{maxTotalTimeout:i.maxTotalTimeout,totalElapsed:e});d.maxTotalTimeout=t}let f=await a.retry(Ho(r,u,c.requestState),d);if(Ha(f)){c={inputRequests:f.inputRequests??{},...f.requestState!==void 0&&{requestState:f.requestState}};continue}return f}}var qo=`AnnotationsSchema.AudioContentSchema.BaseMetadataSchema.BlobResourceContentsSchema.BooleanSchemaSchema.CallToolRequestSchema.CallToolRequestParamsSchema.CallToolResultSchema.CancelledNotificationSchema.CancelledNotificationParamsSchema.CancelTaskRequestSchema.CancelTaskResultSchema.ClientCapabilitiesSchema.ClientNotificationSchema.ClientRequestSchema.ClientResultSchema.CompatibilityCallToolResultSchema.CompleteRequestSchema.CompleteRequestParamsSchema.CompleteResultSchema.ContentBlockSchema.CreateMessageRequestSchema.CreateMessageRequestParamsSchema.CreateMessageResultSchema.CreateMessageResultWithToolsSchema.CreateTaskResultSchema.CursorSchema.DiscoverRequestSchema.DiscoverResultSchema.ElicitationCompleteNotificationSchema.ElicitationCompleteNotificationParamsSchema.ElicitRequestSchema.ElicitRequestFormParamsSchema.ElicitRequestParamsSchema.ElicitRequestURLParamsSchema.ElicitResultSchema.EmbeddedResourceSchema.EmptyResultSchema.EnumSchemaSchema.GetPromptRequestSchema.GetPromptRequestParamsSchema.GetPromptResultSchema.GetTaskPayloadRequestSchema.GetTaskPayloadResultSchema.GetTaskRequestSchema.GetTaskResultSchema.IconSchema.IconsSchema.ImageContentSchema.ImplementationSchema.InitializedNotificationSchema.InitializeRequestSchema.InitializeRequestParamsSchema.InitializeResultSchema.JSONArraySchema.JSONObjectSchema.JSONRPCErrorResponseSchema.JSONRPCMessageSchema.JSONRPCNotificationSchema.JSONRPCRequestSchema.JSONRPCResponseSchema.JSONRPCResultResponseSchema.JSONValueSchema.LegacyTitledEnumSchemaSchema.ListPromptsRequestSchema.ListPromptsResultSchema.ListResourcesRequestSchema.ListResourcesResultSchema.ListResourceTemplatesRequestSchema.ListResourceTemplatesResultSchema.ListRootsRequestSchema.ListRootsResultSchema.ListTasksRequestSchema.ListTasksResultSchema.ListToolsRequestSchema.ListToolsResultSchema.LoggingLevelSchema.LoggingMessageNotificationSchema.LoggingMessageNotificationParamsSchema.ModelHintSchema.ModelPreferencesSchema.MultiSelectEnumSchemaSchema.NotificationSchema.NumberSchemaSchema.PaginatedRequestSchema.PaginatedRequestParamsSchema.PaginatedResultSchema.PingRequestSchema.PrimitiveSchemaDefinitionSchema.ProgressSchema.ProgressNotificationSchema.ProgressNotificationParamsSchema.ProgressTokenSchema.PromptSchema.PromptArgumentSchema.PromptListChangedNotificationSchema.PromptMessageSchema.PromptReferenceSchema.ReadResourceRequestSchema.ReadResourceRequestParamsSchema.ReadResourceResultSchema.RelatedTaskMetadataSchema.RequestSchema.RequestIdSchema.RequestMetaSchema.ResourceSchema.ResourceContentsSchema.ResourceLinkSchema.ResourceListChangedNotificationSchema.ResourceRequestParamsSchema.ResourceTemplateSchema.ResourceTemplateReferenceSchema.ResourceUpdatedNotificationSchema.ResourceUpdatedNotificationParamsSchema.ResultMetaObjectSchema.ResultSchema.RoleSchema.RootSchema.RootsListChangedNotificationSchema.SamplingContentSchema.SamplingMessageSchema.SamplingMessageContentBlockSchema.ServerCapabilitiesSchema.ServerNotificationSchema.ServerRequestSchema.ServerResultSchema.SetLevelRequestSchema.SetLevelRequestParamsSchema.SingleSelectEnumSchemaSchema.StringSchemaSchema.SubscribeRequestSchema.SubscribeRequestParamsSchema.SubscriptionFilterSchema.SubscriptionsAcknowledgedNotificationSchema.SubscriptionsAcknowledgedNotificationParamsSchema.SubscriptionsListenRequestSchema.SubscriptionsListenRequestParamsSchema.SubscriptionsListenResultSchema.SubscriptionsListenResultMetaSchema.TaskAugmentedRequestParamsSchema.TaskCreationParamsSchema.TaskMetadataSchema.TaskSchema.TaskStatusSchema.TaskStatusNotificationSchema.TaskStatusNotificationParamsSchema.TextContentSchema.TextResourceContentsSchema.TitledMultiSelectEnumSchemaSchema.TitledSingleSelectEnumSchemaSchema.ToolSchema.ToolAnnotationsSchema.ToolChoiceSchema.ToolExecutionSchema.ToolListChangedNotificationSchema.ToolResultContentSchema.ToolUseContentSchema.UnsubscribeRequestSchema.UnsubscribeRequestParamsSchema.UntitledMultiSelectEnumSchemaSchema.UntitledSingleSelectEnumSchemaSchema`.split(`.`),Jo={IdJagTokenExchangeResponseSchema:Ur,OAuthClientInformationFullSchema:Jr,OAuthClientInformationSchema:qr,OAuthClientMetadataSchema:Kr,OAuthClientRegistrationErrorSchema:Yr,OAuthErrorResponseSchema:Wr,OAuthMetadataSchema:zr,OAuthProtectedResourceMetadataSchema:Rr,OAuthTokenRevocationRequestSchema:Xr,OAuthTokensSchema:Hr,OpenIdProviderDiscoveryMetadataSchema:Vr,OpenIdProviderMetadataSchema:Br},Yo={},Xo={};function Zo(e,t){let n=e.slice(0,-6);Yo[n]=t,Xo[n]=e=>t.safeParse(e).success}for(let e of qo)Zo(e,La[e]);for(let[e,t]of Object.entries(Jo))Zo(e,t);Object.freeze(Yo);var Qo=Object.freeze(Xo);function $o(e){switch(e){case`initialize`:case`notifications/initialized`:return ja(void 0);case`server/discover`:return ja(Aa);default:return}}var es=[Ne,Pe,Ie,Re],ts=[`inputResponses`,`requestState`];function ns(e,t){let n=e.params;if(!ss(n))return{message:e,lifted:{}};let r=n._meta,i=ss(r)?es.filter(e=>e in r):[],a=t===`request`?ts.filter(e=>e in n):[];if(i.length===0&&a.length===0)return{message:e,lifted:{}};let o={},s={...n};if(i.length>0&&ss(r)){let e={},t={...r};for(let n of i)e[n]=r[n],delete t[n];o.envelope=e,Object.keys(t).length>0?s._meta=t:delete s._meta}for(let e of a)e===`inputResponses`&&(o.inputResponses=s[e]),e===`requestState`&&(o.requestState=s[e]),delete s[e];return{message:{...e,params:s},lifted:o}}function rs(e,t){let n=e.validateResult(t,void 0);if(n.ok||n.reason!==`not-in-era`)return{"~standard":{version:1,vendor:`mcp-wire-codec`,validate(n){let r=e.validateResult(t,n);return r.ok?{value:r.value}:{issues:[{message:r.reason===`invalid`?r.message:`not-in-era: ${t}`}]}}}}}function is(e){return()=>e}var as=is(void 0),os=class{_transport;_requestMessageId=0;_requestHandlers=new Map;_customSchemaRequestMethods=new Set;_requestHandlerAbortControllers=new Map;_notificationHandlers=new Map;_responseHandlers=new Map;_progressHandlers=new Map;_timeoutInfo=new Map;_pendingDebouncedNotifications=new Set;_negotiatedProtocolVersion;_supportedProtocolVersions;onclose;onerror;fallbackRequestHandler;fallbackNotificationHandler;constructor(e){this._options=e,this._supportedProtocolVersions=e?.supportedProtocolVersions??je,this.setNotificationHandler(`notifications/cancelled`,e=>{this._oncancel(e)}),this.setNotificationHandler(`notifications/progress`,e=>{this._onprogress(e)}),this.setRequestHandler(`ping`,e=>({}))}_shouldDropInbound(e){}_outboundMetaEnvelope(){}_envelopeOutbound(e){let t=this._outboundMetaEnvelope();if(t===void 0)return e;let n=e.params??{};return{...e,params:{...n,_meta:{...t,...n._meta}}}}_resolveNonCompleteResult(e,t){return Promise.reject(new Y(J.UnsupportedResultType,`Unsupported result type '${e.kind}' for ${t.request.method}`,{resultType:e.kind,method:t.request.method}))}_getRequestHandler(e){return this._requestHandlers.get(e)}async _oncancel(e){e.params.requestId!==void 0&&this._requestHandlerAbortControllers.get(e.params.requestId)?.abort(e.params.reason)}_setupTimeout(e,t,n,r,i=!1){this._timeoutInfo.set(e,{timeoutId:setTimeout(r,t),startTime:Date.now(),timeout:t,maxTotalTimeout:n,resetTimeoutOnProgress:i,onTimeout:r})}_resetTimeout(e){let t=this._timeoutInfo.get(e);if(!t)return!1;let n=Date.now()-t.startTime;if(t.maxTotalTimeout&&n>=t.maxTotalTimeout)throw this._timeoutInfo.delete(e),new Y(J.RequestTimeout,`Maximum total timeout exceeded`,{maxTotalTimeout:t.maxTotalTimeout,totalElapsed:n});return clearTimeout(t.timeoutId),t.timeoutId=setTimeout(t.onTimeout,t.timeout),!0}_cleanupTimeout(e){let t=this._timeoutInfo.get(e);t&&(clearTimeout(t.timeoutId),this._timeoutInfo.delete(e))}async connect(e){this._transport=e;let t=this.transport?.onclose;this._transport.onclose=()=>{try{t?.()}finally{this._onclose()}};let n=this.transport?.onerror;this._transport.onerror=e=>{n?.(e),this._onerror(e)};let r=this._transport?.onmessage;this._transport.onmessage=(e,t)=>{r?.(e,t),Ba(e)||Va(e)?this._onresponse(e):Ra(e)?this._onrequest(e,t):za(e)?this._onnotification(e,t):this._onerror(Error(`Unknown message type: ${JSON.stringify(e)}`))},e.setSupportedProtocolVersions?.(this._supportedProtocolVersions),await this._transport.start()}_onclose(){let e=this._responseHandlers;this._responseHandlers=new Map,this._progressHandlers.clear(),this._pendingDebouncedNotifications.clear();for(let e of this._timeoutInfo.values())clearTimeout(e.timeoutId);this._timeoutInfo.clear();let t=this._requestHandlerAbortControllers;this._requestHandlerAbortControllers=new Map;let n=new Y(J.ConnectionClosed,`Connection closed`);this._transport=void 0;try{this.onclose?.()}finally{for(let t of e.values())t(n);for(let e of t.values())e.abort(n)}}_onerror(e){this.onerror?.(e)}_onnotification(e,t){let{message:n}=ns(e,`notification`),r=this._negotiatedWireCodec();if(t?.classification===void 0&&this._shouldDropInbound(e)===`drop`)return;if(t?.classification!==void 0){let e=Ma(t.classification);if(e!==r.era){this._onerror(Error(`Era mismatch on inbound notification '${n.method}': classified as ${e} but this instance serves ${r.era}`));return}}if(Pa(n.method)&&!r.hasNotificationMethod(n.method))return;let i=this._notificationHandlers.get(n.method),a=this.fallbackNotificationHandler;(i!==void 0||a!==void 0)&&Promise.resolve().then(()=>i===void 0?a(n):i(n,r)).catch(e=>this._onerror(Error(`Uncaught error in notification handler: ${e}`)))}_onrequest(e,t){let{message:n,lifted:r}=ns(e,`request`),i=this._negotiatedWireCodec();if(t?.classification===void 0&&this._shouldDropInbound(e)===`drop`){this._onerror(Error(`Dropped inbound request '${e.method}': not servable on this connection's protocol era`));return}let a=this._transport,o=(e,t,r)=>{let i={jsonrpc:`2.0`,id:n.id,error:{code:e,message:t,...r!==void 0&&{data:r}}};a?.send(i).catch(e=>this._onerror(Error(`Failed to send an error response: ${e}`)))};if(t?.classification!==void 0){let e=Ma(t.classification);if(e!==i.era){this._onerror(Error(`Era mismatch on inbound request '${n.method}': classified as ${e} but this instance serves ${i.era}`));let r=t.classification.revision??e;o(X.UnsupportedProtocolVersion,`Unsupported protocol version: ${r}`,{supported:this._supportedProtocolVersions,requested:r});return}}if(Na(n.method)&&!i.hasRequestMethod(n.method)&&!(Fa(n.method)&&this._customSchemaRequestMethods.has(n.method))){o(X.MethodNotFound,`Method not found`);return}let s=this._requestHandlers.get(n.method)??this.fallbackRequestHandler;if(s===void 0){o(X.MethodNotFound,`Method not found`);return}let c=i.checkInboundEnvelope(r);if(c!==void 0){o(X.InvalidParams,c);return}let l=(e,t)=>this._notificationViaCodec(this._resolveOutboundCodec(e.method),e,{...t,relatedRequestId:n.id}),u=(e,t,r)=>this._requestWithSchemaViaCodec(this._resolveOutboundCodec(e.method),e,t,{...r,relatedRequestId:n.id}),d=new AbortController;this._requestHandlerAbortControllers.set(n.id,d);let f=r.inputResponses===void 0?void 0:us(r.inputResponses),p={sessionId:a?.sessionId,mcpReq:{id:n.id,method:n.method,_meta:n.params?._meta,...r.envelope!==void 0&&{envelope:r.envelope},...f!==void 0&&{inputResponses:f.accepted},...f!==void 0&&f.droppedKeys.length>0&&{droppedInputResponseKeys:f.droppedKeys},requestState:r.requestState===void 0?as:is(r.requestState),signal:d.signal,send:((e,t,n)=>{let r=this._resolveOutboundCodec(e.method);if(this._assertOutboundRequestInEra(r,e.method),po(t))return u(e,t,n);let i=rs(r,e.method);if(i===void 0)throw TypeError(`'${e.method}' is not a spec method; pass a result schema as the second argument to ctx.mcpReq.send().`);return u(e,i,t)}),notify:l},http:t?.authInfo?{authInfo:t.authInfo}:void 0},m=this.buildContext(p,t);Promise.resolve().then(()=>s(n,m)).then(async e=>{if(d.signal.aborted)return;let t;try{t=i.encodeResult(n.method,e,this._outboundServerInfo())}catch(e){this._onerror(Error(`Failed to encode result for ${n.method}: ${e}`)),o(X.InternalError,`Internal error`);return}let r={result:t,jsonrpc:`2.0`,id:n.id};await a?.send(r)},async e=>{if(d.signal.aborted)return;let t=Number.isSafeInteger(e.code)?e.code:X.InternalError,r={jsonrpc:`2.0`,id:n.id,error:{code:i.encodeErrorCode(t),message:e.message??`Internal error`,...e.data!==void 0&&{data:e.data}}};await a?.send(r)}).catch(e=>this._onerror(Error(`Failed to send response: ${e}`))).finally(()=>{this._requestHandlerAbortControllers.get(n.id)===d&&this._requestHandlerAbortControllers.delete(n.id)})}_onprogress(e){let{progressToken:t,...n}=e.params,r=Number(t),i=this._progressHandlers.get(r);if(!i){this._onerror(Error(`Received a progress notification for an unknown token: ${JSON.stringify(e)}`));return}let a=this._responseHandlers.get(r),o=this._timeoutInfo.get(r);if(o&&a&&o.resetTimeoutOnProgress)try{this._resetTimeout(r)}catch(e){this._responseHandlers.delete(r),this._progressHandlers.delete(r),this._cleanupTimeout(r),a(e);return}i(n)}_onresponse(e){let t=Number(e.id),n=this._responseHandlers.get(t);if(n===void 0){this._onerror(Error(`Received a response for an unknown message ID: ${JSON.stringify(e)}`));return}this._responseHandlers.delete(t),this._cleanupTimeout(t),this._progressHandlers.delete(t),Ba(e)?n(e):n(Z.fromError(e.error.code,e.error.message,e.error.data))}get transport(){return this._transport}async close(){await this._transport?.close()}request(e,t,n){let r=this._resolveOutboundCodec(e.method);if(po(t))return Fa(e.method)||this._assertOutboundRequestInEra(r,e.method),this._requestWithSchemaViaCodec(r,e,t,n);this._assertOutboundRequestInEra(r,e.method);let i=rs(r,e.method);if(i===void 0)throw TypeError(`'${e.method}' is not a spec method; pass a result schema as the second argument to request().`);return this._requestWithSchemaViaCodec(r,e,i,t)}_negotiatedWireCodec(){return ja(this._negotiatedProtocolVersion)}_wireCodec(){return this._negotiatedWireCodec()}_resolveOutboundCodec(e){if(this._negotiatedProtocolVersion===void 0){let t=$o(e);if(t)return t}return this._negotiatedWireCodec()}_assertOutboundRequestInEra(e,t){if(Na(t)&&!e.hasRequestMethod(t))throw new Y(J.MethodNotSupportedByProtocolVersion,`Method '${t}' is not supported by the negotiated protocol version (wire era ${e.era})`,{method:t,era:e.era})}_requestWithSchema(e,t,n){let r=this._resolveOutboundCodec(e.method);return this._assertOutboundRequestInEra(r,e.method),this._requestWithSchemaViaCodec(r,e,t,n)}_requestWithSchemaViaCodec(e,t,n,r){let{relatedRequestId:i,resumptionToken:a,onresumptiontoken:o,headers:s}=r??{},c=Date.now(),l,u;return new Promise((d,f)=>{let p=e=>{f(e)};if(!this._transport){p(Error(`Not connected`));return}if(this._options?.enforceStrictCapabilities===!0)try{this.assertCapabilityForMethod(t.method)}catch(e){p(e);return}if(r?.signal?.aborted){let e=r.signal.reason;throw e instanceof Y?e:new Y(J.RequestTimeout,String(e))}let m=e.era===`2026-07-28`&&this._transport.hasPerRequestStream===!0?new AbortController:void 0,h=this._requestMessageId++;u=h;let g={...t,jsonrpc:`2.0`,id:h};r?.onprogress&&(this._progressHandlers.set(h,r.onprogress),g.params={...t.params,_meta:{...t.params?._meta,progressToken:h}});let _=this._envelopeOutbound(g),v=!1,y=e=>{v||(this._progressHandlers.delete(h),m===void 0?t.method!==`initialize`&&this._transport?.send(this._envelopeOutbound({jsonrpc:`2.0`,method:`notifications/cancelled`,params:{requestId:h,reason:String(e)}}),{relatedRequestId:i,resumptionToken:a,onresumptiontoken:o}).catch(e=>this._onerror(Error(`Failed to send cancellation: ${e}`))):m.abort(),f(e instanceof Y?e:new Y(J.RequestTimeout,String(e))))};this._responseHandlers.set(h,i=>{if(r?.signal?.aborted)return;if(v=!0,i instanceof Error)return f(i);let a;try{a=e.decodeResult(t.method,i.result)}catch(e){return f(e instanceof Error?e:Error(String(e)))}if(a.kind===`invalid`)return f(a.error);if(a.kind===`input_required`){if(r?.allowInputRequired===!0)return d(gs(a));let i={codec:e,request:t,resultSchema:n,options:r,flowStartedAt:c,retry:(r,i)=>this._requestWithSchemaViaCodec(e,r===void 0?{method:t.method}:{method:t.method,params:r},n,i)};return d(this._resolveNonCompleteResult(a,i))}let o=a.result;yo(n,o).then(e=>{e.success?d(e.data):f(new Y(J.InvalidResult,`Invalid result for ${t.method}: ${e.error}`))},f)}),l=()=>y(r?.signal?.reason),r?.signal?.addEventListener(`abort`,l,{once:!0});let b=r?.timeout??6e4;this._setupTimeout(h,b,r?.maxTotalTimeout,()=>y(new Y(J.RequestTimeout,`Request timed out`,{timeout:b})),r?.resetTimeoutOnProgress??!1),this._transport.send(_,{relatedRequestId:i,resumptionToken:a,onresumptiontoken:o,headers:s,requestSignal:m?.signal}).catch(e=>{this._progressHandlers.delete(h),f(e)})}).finally(()=>{l&&r?.signal?.removeEventListener(`abort`,l),u!==void 0&&(this._responseHandlers.delete(u),this._cleanupTimeout(u))})}async notification(e,t){return await this._notificationViaCodec(this._resolveOutboundCodec(e.method),e,t)}async _notificationViaCodec(e,t,n){if(!this._transport)throw new Y(J.NotConnected,`Not connected`);if(Pa(t.method)&&!e.hasNotificationMethod(t.method))throw new Y(J.MethodNotSupportedByProtocolVersion,`Notification '${t.method}' is not supported by the negotiated protocol version (wire era ${e.era})`,{method:t.method,era:e.era});this.assertNotificationCapability(t.method);let r=this._envelopeOutbound({jsonrpc:`2.0`,...t});if((this._options?.debouncedNotificationMethods??[]).includes(t.method)&&!t.params&&n?.relatedRequestId===void 0){if(this._pendingDebouncedNotifications.has(t.method))return;this._pendingDebouncedNotifications.add(t.method),Promise.resolve().then(()=>{this._pendingDebouncedNotifications.delete(t.method),this._transport&&this._transport?.send(r,n).catch(e=>this._onerror(e))});return}await this._transport.send(r,n)}setRequestHandler(e,t,n){this.assertRequestHandlerCapability(e);let r;if(typeof t==`function`){if(!Na(e))throw TypeError(`'${e}' is not a spec request method; pass schemas as the second argument to setRequestHandler().`);r=(n,r)=>{let i=this._negotiatedWireCodec(),a=i.validateRequest(e,n);if(!a.ok&&a.reason===`not-in-era`&&(a=i.validateInputRequest(e,n)),!a.ok)throw a.reason===`not-in-era`?new Z(X.InternalError,`No wire schema for ${e} in the resolved era`):Error(a.message);return Promise.resolve(t(a.value,r))}}else if(n)r=async(r,i)=>{let a=await yo(t.params,{...r.params});if(!a.success)throw new Z(X.InvalidParams,`Invalid params for ${e}: ${a.error}`);return n(a.data,i)};else throw TypeError(`setRequestHandler: handler is required`);typeof t==`function`?this._customSchemaRequestMethods.delete(e):this._customSchemaRequestMethods.add(e),this._requestHandlers.set(e,this._wrapHandler(e,r))}_wrapHandler(e,t){return t}_outboundServerInfo(){}removeRequestHandler(e){this._requestHandlers.delete(e),this._customSchemaRequestMethods.delete(e)}assertCanSetRequestHandler(e){if(this._requestHandlers.has(e))throw Error(`A request handler for ${e} already exists, which would be overridden`)}setNotificationHandler(e,t,n){if(typeof t==`function`){if(!Pa(e))throw TypeError(`'${e}' is not a spec notification method; pass schemas as the second argument to setNotificationHandler().`);this._notificationHandlers.set(e,(n,r)=>{let i=r.validateNotification(e,n);if(!i.ok)throw i.reason===`not-in-era`?new Z(X.InternalError,`No wire schema for ${e} in the resolved era`):Error(i.message);return Promise.resolve(t(i.value))});return}if(!n)throw TypeError(`setNotificationHandler: handler is required`);this._notificationHandlers.set(e,async r=>{let i=await yo(t.params,{...r.params});if(!i.success)throw new Z(X.InvalidParams,`Invalid params for notification ${e}: ${i.error}`);await n(i.data,r)})}removeNotificationHandler(e){this._notificationHandlers.delete(e)}};function ss(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function cs(e,t){let n={...e};for(let e in t){let r=e,i=t[r];if(i===void 0)continue;let a=n[r];n[r]=ss(a)&&ss(i)?{...a,...i}:i}return n}function ls(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function us(e){let t={},n=[];if(!ls(e))return{accepted:t,droppedKeys:n};for(let[r,i]of Object.entries(e)){if(!ls(i)||`method`in i||`result`in i){n.push(r);continue}t[r]=i}return{accepted:t,droppedKeys:n}}function ds(e){throw new Y(J.SendFailed,`ctx.mcpReq.${e} is not available while fulfilling an embedded input request: the request is fulfilled locally and has no related peer request`)}function fs(e,t,n,r,i){return{sessionId:i,mcpReq:{id:e,method:t,_meta:n?._meta,requestState:is(void 0),signal:r,send:(()=>ds(`send`)),notify:()=>ds(`notify`)}}}async function ps(e,t,n,r,i){if(!ls(r)||typeof r.method!=`string`)throw new Y(J.InvalidResult,`Invalid input request '${n}': each inputRequests entry must be an embedded request object with a method`,{key:n});let a=r.method;if(!t.hasInputRequestMethod(a))throw new Y(J.InvalidResult,`Invalid input request '${n}': '${a}' is not an embedded request the ${t.era} revision defines (expected elicitation/create, sampling/createMessage, or roots/list)`,{key:n,method:a});let o=e.getRequestHandler(a);if(o===void 0)throw new Y(J.CapabilityNotSupported,`Cannot fulfil input request '${n}': no handler is registered for '${a}' on this client. Declare the corresponding capability and register a handler, or handle input_required results manually.`,{key:n,method:a});let s=ls(r.params)?r.params:void 0;return await o({jsonrpc:`2.0`,id:n,method:a,...s!==void 0&&{params:s}},e.buildContext(fs(n,a,s,i,e.sessionId)))}function ms(e,t){return{...e?.signal!==void 0&&{signal:e.signal},...e?.onprogress!==void 0&&{onprogress:e.onprogress},...e?.resetTimeoutOnProgress!==void 0&&{resetTimeoutOnProgress:e.resetTimeoutOnProgress},...e?.headers!==void 0&&{headers:e.headers},...t.timeout!==void 0&&{timeout:t.timeout},...t.maxTotalTimeout!==void 0&&{maxTotalTimeout:t.maxTotalTimeout},allowInputRequired:!0}}function hs(e,t,n,r){let{codec:i,request:a,options:o,flowStartedAt:s}=r,c={inputRequests:n.inputRequests,...n.requestState!==void 0&&{requestState:n.requestState}},l={dispatchInputRequest:(t,n,r)=>ps(e,i,t,n,r),retry:(e,t)=>r.retry(e,ms(o,t))};return Ko({config:t,method:a.method,originalParams:a.params,firstPayload:c,flowStartedAt:s,signal:o?.signal,requestOptions:{...o?.timeout!==void 0&&{timeout:o.timeout},...o?.maxTotalTimeout!==void 0&&{maxTotalTimeout:o.maxTotalTimeout},...o?.onprogress!==void 0&&{onprogress:o.onprogress}},hooks:l})}function gs(e){return{resultType:`input_required`,inputRequests:e.inputRequests,...e.requestState!==void 0&&{requestState:e.requestState},...e._meta!==void 0&&{_meta:e._meta}}}var _s=Ce(be((e=>{var t=/; *([!#$%&'*+.^_`|~0-9A-Za-z-]+) *= *("(?:[\u000b\u0020\u0021\u0023-\u005b\u005d-\u007e\u0080-\u00ff]|\\[\u000b\u0020-\u00ff])*"|[!#$%&'*+.^_`|~0-9A-Za-z-]+) */g,n=/\\([\u000b\u0020-\u00ff])/g,r=/^[!#$%&'*+.^_`|~0-9A-Za-z-]+\/[!#$%&'*+.^_`|~0-9A-Za-z-]+$/;e.parse=i;function i(e){if(!e)throw TypeError(`argument string is required`);var i=typeof e==`object`?a(e):e;if(typeof i!=`string`)throw TypeError(`argument string is required to be a string`);var s=i.indexOf(`;`),c=s===-1?i.trim():i.slice(0,s).trim();if(!r.test(c))throw TypeError(`invalid media type`);var l=new o(c.toLowerCase());if(s!==-1){var u,d,f;for(t.lastIndex=s;d=t.exec(i);){if(d.index!==s)throw TypeError(`invalid parameter format`);s+=d[0].length,u=d[1].toLowerCase(),f=d[2],f.charCodeAt(0)===34&&(f=f.slice(1,-1),f.indexOf(`\\`)!==-1&&(f=f.replace(n,`$1`))),l.parameters[u]=f}if(s!==i.length)throw TypeError(`invalid parameter format`)}return l}function a(e){var t;if(typeof e.getHeader==`function`?t=e.getHeader(`content-type`):typeof e.headers==`object`&&(t=e.headers&&e.headers[`content-type`]),typeof t!=`string`)throw TypeError(`content-type header is missing from object`);return t}function o(e){this.parameters=Object.create(null),this.type=e}}))(),1);function vs(e){if(e)try{return _s.parse(e).type}catch{let t=(e.split(`;`,1)[0]??``).trim().toLowerCase();return t===``||e.slice(t.length).includes(`,`)?void 0:t}}function ys(e){return e?e instanceof Headers?Object.fromEntries(e.entries()):Array.isArray(e)?Object.fromEntries(e):{...e}:{}}function bs(e=fetch,t){return t?async(n,r)=>e(n,{...t,...r,headers:r?.headers?{...ys(t.headers),...ys(r.headers)}:t.headers}):e}var xs=new Set([301,302,303,307,308]),Ss=5;function Cs(e,t){return e.protocol===t.protocol&&e.host===t.host||e.protocol===`http:`&&t.protocol===`https:`&&e.hostname===t.hostname&&!e.port&&!t.port}function ws(e,t){let n=xs.has(t.status)?t.headers?.get(`location`):void 0;if(n)try{return new URL(n,e)}catch{return}}var Ts=new WeakSet;function Es(e){let t=(t,n)=>e(t,n);return Ts.add(t),t}function Ds(e){return Ts.has(e)?e:async(t,n)=>{if(n?.redirect===`error`||n?.redirect===`manual`)return e(t,n);let r=(n?.method??`GET`).toUpperCase(),i=t;for(let t=0;;t++){let a=await e(i,{...n,redirect:`manual`}),o=ws(i,a);if(!o||t===Ss)return a;let s=new URL(i),c=r===`GET`||a.status===307||a.status===308,l=!(o.username||o.password)||o.username===s.username&&o.password===s.password;if(!c||!l||!Cs(s,o))return a;await a.text?.().catch(()=>{}),i=o}}}function Os(e,t){if(t.type===`opaqueredirect`)return`Redirect not followed: this runtime does not expose where it points`;let n=ws(t.url||e,t);if(n)return n.username=n.password=n.search=n.hash=``,n.protocol===`http:`&&new URL(t.url||e).protocol===`https:`?(n.protocol=`https:`,`Redirect from https to plain http not followed; try ${n.href} as the endpoint`):`Redirect to ${n.href} not followed; use that URL as the endpoint if it is the intended server`}function ks(e,t){let n=typeof e;if(n!==typeof t)return!1;if(Array.isArray(e)){if(!Array.isArray(t))return!1;let n=e.length;if(n!==t.length)return!1;for(let r=0;r1?t[a.href]=e:(a.hash=``,r===``?n=a:Is(e,t,n))}}else if(e!==!0&&e!==!1)return t;let i=n.href+(r?`#`+r:``);if(t[i]!==void 0)throw Error(`Duplicate schema URI "${i}".`);if(t[i]=e,e===!0||e===!1)return t;if(e.__absolute_uri__===void 0&&Object.defineProperty(e,"__absolute_uri__",{enumerable:!1,value:i}),e.$ref&&e.__absolute_ref__===void 0){let t=new URL(e.$ref,n.href);t.hash=t.hash,Object.defineProperty(e,"__absolute_ref__",{enumerable:!1,value:t.href})}if(e.$recursiveRef&&e.__absolute_recursive_ref__===void 0){let t=new URL(e.$recursiveRef,n.href);t.hash=t.hash,Object.defineProperty(e,"__absolute_recursive_ref__",{enumerable:!1,value:t.href})}if(e.$anchor){let r=new URL(`#`+e.$anchor,n.href);t[r.href]=e}for(let i in e){if(Ps[i])continue;let a=`${r}/${As(i)}`,o=e[i];if(Array.isArray(o)){if(Ms[i]){let e=o.length;for(let r=0;r%\\^`{|}]|%[0-9a-f]{2})|\{[+#./;?&=,!@|]?(?:[a-z0-9_]|%[0-9a-f]{2})+(?::[1-9][0-9]{0,3}|\*)?(?:,(?:[a-z0-9_]|%[0-9a-f]{2})+(?::[1-9][0-9]{0,3}|\*)?)*\})*$/i,Us=/^(?:(?:https?|ftp):\/\/)(?:\S+(?::\S*)?@)?(?:(?!10(?:\.\d{1,3}){3})(?!127(?:\.\d{1,3}){3})(?!169\.254(?:\.\d{1,3}){2})(?!192\.168(?:\.\d{1,3}){2})(?!172\.(?:1[6-9]|2\d|3[0-1])(?:\.\d{1,3}){2})(?:[1-9]\d?|1\d\d|2[01]\d|22[0-3])(?:\.(?:1?\d{1,2}|2[0-4]\d|25[0-5])){2}(?:\.(?:[1-9]\d?|1\d\d|2[0-4]\d|25[0-4]))|(?:(?:[a-z\u{00a1}-\u{ffff}0-9]+-?)*[a-z\u{00a1}-\u{ffff}0-9]+)(?:\.(?:[a-z\u{00a1}-\u{ffff}0-9]+-?)*[a-z\u{00a1}-\u{ffff}0-9]+)*(?:\.(?:[a-z\u{00a1}-\u{ffff}]{2,})))(?::\d{2,5})?(?:\/[^\s]*)?$/iu,Ws=/^(?:urn:uuid:)?[0-9a-f]{8}-(?:[0-9a-f]{4}-){3}[0-9a-f]{12}$/i,Gs=/^(?:\/(?:[^~/]|~0|~1)*)*$/,Ks=/^#(?:\/(?:[a-z0-9_\-.!$&'()*+,;:=@]|%[0-9a-f]{2}|~0|~1)*)*$/i,qs=/^(?:0|[1-9][0-9]*)(?:#|(?:\/(?:[^~/]|~0|~1)*)*)$/,Js=e=>{if(e[0]===`"`)return!1;let[t,n,...r]=e.split(`@`);return!t||!n||r.length!==0||t.length>64||n.length>253||t[0]===`.`||t.endsWith(`.`)||t.includes(`..`)||!/^[a-z0-9.-]+$/i.test(n)||!/^[a-z0-9.!#$%&'*+/=?^_`{|}~-]+$/i.test(t)?!1:n.split(`.`).every(e=>/^[a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?$/i.test(e))},Ys=/^(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)$/,Xs=/^((([0-9a-f]{1,4}:){7}([0-9a-f]{1,4}|:))|(([0-9a-f]{1,4}:){6}(:[0-9a-f]{1,4}|((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9a-f]{1,4}:){5}(((:[0-9a-f]{1,4}){1,2})|:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9a-f]{1,4}:){4}(((:[0-9a-f]{1,4}){1,3})|((:[0-9a-f]{1,4})?:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){3}(((:[0-9a-f]{1,4}){1,4})|((:[0-9a-f]{1,4}){0,2}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){2}(((:[0-9a-f]{1,4}){1,5})|((:[0-9a-f]{1,4}){0,3}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){1}(((:[0-9a-f]{1,4}){1,6})|((:[0-9a-f]{1,4}){0,4}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(:(((:[0-9a-f]{1,4}){1,7})|((:[0-9a-f]{1,4}){0,5}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:)))$/i,Zs=e=>e.length>1&&e.length<80&&(/^P\d+([.,]\d+)?W$/.test(e)||/^P[\dYMDTHS]*(\d[.,]\d+)?[YMDHS]$/.test(e)&&/^P([.,\d]+Y)?([.,\d]+M)?([.,\d]+D)?(T([.,\d]+H)?([.,\d]+M)?([.,\d]+S)?)?$/.test(e));function Qs(e){return e.test.bind(e)}var $s={date:tc,time:nc.bind(void 0,!1),"date-time":ic,duration:Zs,uri:sc,"uri-reference":Qs(Vs),"uri-template":Qs(Hs),url:Qs(Us),email:Js,hostname:Qs(Bs),ipv4:Qs(Ys),ipv6:Qs(Xs),regex:lc,uuid:Qs(Ws),"json-pointer":Qs(Gs),"json-pointer-uri-fragment":Qs(Ks),"relative-json-pointer":Qs(qs)};function ec(e){return e%4==0&&(e%100!=0||e%400==0)}function tc(e){let t=e.match(Ls);if(!t)return!1;let n=+t[1],r=+t[2],i=+t[3];return r>=1&&r<=12&&i>=1&&i<=(r==2&&ec(n)?29:Rs[r])}function nc(e,t){let n=t.match(zs);if(!n)return!1;let r=+n[1],i=+n[2],a=+n[3],o=!!n[5];return(r<=23&&i<=59&&a<=59||r==23&&i==59&&a==60)&&(!e||o)}var rc=/t|\s/i;function ic(e){let t=e.split(rc);return t.length==2&&tc(t[0])&&nc(!0,t[1])}var ac=/\/|:/,oc=/^(?:[a-z][a-z0-9+\-.]*:)(?:\/?\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:]|%[0-9a-f]{2})*@)?(?:\[(?:(?:(?:(?:[0-9a-f]{1,4}:){6}|::(?:[0-9a-f]{1,4}:){5}|(?:[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){4}|(?:(?:[0-9a-f]{1,4}:){0,1}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){3}|(?:(?:[0-9a-f]{1,4}:){0,2}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){2}|(?:(?:[0-9a-f]{1,4}:){0,3}[0-9a-f]{1,4})?::[0-9a-f]{1,4}:|(?:(?:[0-9a-f]{1,4}:){0,4}[0-9a-f]{1,4})?::)(?:[0-9a-f]{1,4}:[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?))|(?:(?:[0-9a-f]{1,4}:){0,5}[0-9a-f]{1,4})?::[0-9a-f]{1,4}|(?:(?:[0-9a-f]{1,4}:){0,6}[0-9a-f]{1,4})?::)|[Vv][0-9a-f]+\.[a-z0-9\-._~!$&'()*+,;=:]+)\]|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)|(?:[a-z0-9\-._~!$&'()*+,;=]|%[0-9a-f]{2})*)(?::\d*)?(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*|\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*)?|(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*)(?:\?(?:[a-z0-9\-._~!$&'()*+,;=:@/?]|%[0-9a-f]{2})*)?(?:#(?:[a-z0-9\-._~!$&'()*+,;=:@/?]|%[0-9a-f]{2})*)?$/i;function sc(e){return ac.test(e)&&oc.test(e)}var cc=/[^\\]\\Z/;function lc(e){if(cc.test(e))return!1;try{return new RegExp(e,`u`),!0}catch{return!1}}function uc(e){let t=0,n=e.length,r=0,i;for(;r=55296&&i<=56319&&rks(e,t))||L.push({instanceLocation:o,keyword:`enum`,keywordLocation:`${s}/enum`,error:`Instance does not match any of ${JSON.stringify(g)}.`}):g.some(t=>e===t)||L.push({instanceLocation:o,keyword:`enum`,keywordLocation:`${s}/enum`,error:`Instance does not match any of ${JSON.stringify(g)}.`})),v!==void 0){let t=`${s}/not`;Q(e,v,n,r,i,a,o,t).valid&&L.push({instanceLocation:o,keyword:`not`,keywordLocation:t,error:`Instance matched "not" schema.`})}let ye=[];if(y!==void 0){let t=`${s}/anyOf`,l=L.length,u=!1;for(let s=0;s{let u=Object.create(c),d=Q(e,s,n,r,i,p===!0?a:null,o,`${t}/${l}`,u);return L.push(...d.errors),d.valid&&ye.push(u),d.valid}).length;u===1?L.length=l:L.splice(l,0,{instanceLocation:o,keyword:`oneOf`,keywordLocation:t,error:`Instance does not match exactly one subschema (${u} matches).`})}if((u===`object`||u===`array`)&&Object.assign(c,...ye),x!==void 0){let t=`${s}/if`;if(Q(e,x,n,r,i,a,o,t,c).valid){if(S!==void 0){let l=Q(e,S,n,r,i,a,o,`${s}/then`,c);l.valid||L.push({instanceLocation:o,keyword:`if`,keywordLocation:t,error:`Instance does not match "then" schema.`},...l.errors)}}else if(C!==void 0){let l=Q(e,C,n,r,i,a,o,`${s}/else`,c);l.valid||L.push({instanceLocation:o,keyword:`if`,keywordLocation:t,error:`Instance does not match "else" schema.`},...l.errors)}}if(u===`object`){if(_!==void 0)for(let t of _)t in e||L.push({instanceLocation:o,keyword:`required`,keywordLocation:`${s}/required`,error:`Instance does not have required property "${t}".`});let t=Object.keys(e);if(ne!==void 0&&t.lengthre&&L.push({instanceLocation:o,keyword:`maxProperties`,keywordLocation:`${s}/maxProperties`,error:`Instance does not have at least ${re} properties.`}),O!==void 0){let t=`${s}/propertyNames`;for(let s in e){let e=`${o}/${As(s)}`,c=Q(s,O,n,r,i,a,e,t);c.valid||L.push({instanceLocation:o,keyword:`propertyNames`,keywordLocation:t,error:`Property name "${s}" does not match schema.`},...c.errors)}}if(ie!==void 0){let t=`${s}/dependantRequired`;for(let n in ie)if(n in e){let r=ie[n];for(let i of r)i in e||L.push({instanceLocation:o,keyword:`dependentRequired`,keywordLocation:t,error:`Instance has "${n}" but does not have "${i}".`})}}if(k!==void 0)for(let t in k){let l=`${s}/dependentSchemas`;if(t in e){let s=Q(e,k[t],n,r,i,a,o,`${l}/${As(t)}`,c);s.valid||L.push({instanceLocation:o,keyword:`dependentSchemas`,keywordLocation:l,error:`Instance has "${t}" but does not match dependant schema.`},...s.errors)}}if(ae!==void 0){let t=`${s}/dependencies`;for(let s in ae)if(s in e){let c=ae[s];if(Array.isArray(c))for(let n of c)n in e||L.push({instanceLocation:o,keyword:`dependencies`,keywordLocation:t,error:`Instance has "${s}" but does not have "${n}".`});else{let l=Q(e,c,n,r,i,a,o,`${t}/${As(s)}`);l.valid||L.push({instanceLocation:o,keyword:`dependencies`,keywordLocation:t,error:`Instance has "${s}" but does not match dependant schema.`},...l.errors)}}}let l=Object.create(null),u=!1;if(te!==void 0){let t=`${s}/properties`;for(let s in te){if(!(s in e))continue;let d=`${o}/${As(s)}`,f=Q(e[s],te[s],n,r,i,a,d,`${t}/${As(s)}`);if(f.valid)c[s]=l[s]=!0;else if(u=i,L.push({instanceLocation:o,keyword:`properties`,keywordLocation:t,error:`Property "${s}" does not match schema.`},...f.errors),u)break}}if(!u&&T!==void 0){let t=`${s}/patternProperties`;for(let s in T){let d=new RegExp(s,`u`),f=T[s];for(let p in e){if(!d.test(p))continue;let m=`${o}/${As(p)}`,h=Q(e[p],f,n,r,i,a,m,`${t}/${As(s)}`);h.valid?c[p]=l[p]=!0:(u=i,L.push({instanceLocation:o,keyword:`patternProperties`,keywordLocation:t,error:`Property "${p}" matches pattern "${s}" but does not match associated schema.`},...h.errors))}}}if(!u&&E!==void 0){let t=`${s}/additionalProperties`;for(let s in e){if(l[s])continue;let d=`${o}/${As(s)}`,f=Q(e[s],E,n,r,i,a,d,t);f.valid?c[s]=!0:(u=i,L.push({instanceLocation:o,keyword:`additionalProperties`,keywordLocation:t,error:`Property "${s}" does not match additional properties schema.`},...f.errors))}}else if(!u&&D!==void 0){let t=`${s}/unevaluatedProperties`;for(let s in e)if(!c[s]){let l=`${o}/${As(s)}`,u=Q(e[s],D,n,r,i,a,l,t);u.valid?c[s]=!0:L.push({instanceLocation:o,keyword:`unevaluatedProperties`,keywordLocation:t,error:`Property "${s}" does not match unevaluated properties schema.`},...u.errors)}}}else if(u===`array`){le!==void 0&&e.length>le&&L.push({instanceLocation:o,keyword:`maxItems`,keywordLocation:`${s}/maxItems`,error:`Array has too many items (${e.length} > ${le}).`}),P!==void 0&&e.length=(M||0)&&(L.length=u),M===void 0&&N===void 0&&d===0?L.splice(u,0,{instanceLocation:o,keyword:`contains`,keywordLocation:l,error:`Array does not contain item matching schema.`}):M!==void 0&&dN&&L.push({instanceLocation:o,keyword:`maxContains`,keywordLocation:`${s}/maxContains`,error:`Array may contain at most ${N} items matching schema. ${d} items were found.`})}}if(!u&&ce!==void 0){let u=`${s}/unevaluatedItems`;for(;l=fe||e>fe)&&L.push({instanceLocation:o,keyword:`maximum`,keywordLocation:`${s}/maximum`,error:`${e} is greater than ${F?`or equal to `:``} ${fe}.`})):(de!==void 0&&efe&&L.push({instanceLocation:o,keyword:`maximum`,keywordLocation:`${s}/maximum`,error:`${e} is greater than ${fe}.`}),pe!==void 0&&e<=pe&&L.push({instanceLocation:o,keyword:`exclusiveMinimum`,keywordLocation:`${s}/exclusiveMinimum`,error:`${e} is less than ${pe}.`}),F!==void 0&&e>=F&&L.push({instanceLocation:o,keyword:`exclusiveMaximum`,keywordLocation:`${s}/exclusiveMaximum`,error:`${e} is greater than or equal to ${F}.`})),I!==void 0){let t=e%I;Math.abs(0-t)>=1.1920929e-7&&Math.abs(I-t)>=1.1920929e-7&&L.push({instanceLocation:o,keyword:`multipleOf`,keywordLocation:`${s}/multipleOf`,error:`${e} is not a multiple of ${I}.`})}}else if(u===`string`){let t=me===void 0&&he===void 0?0:uc(e);me!==void 0&&the&&L.push({instanceLocation:o,keyword:`maxLength`,keywordLocation:`${s}/maxLength`,error:`String is too long (${t} > ${he}).`}),ge!==void 0&&!new RegExp(ge,`u`).test(e)&&L.push({instanceLocation:o,keyword:`pattern`,keywordLocation:`${s}/pattern`,error:`String does not match pattern.`}),w!==void 0&&$s[w]&&!$s[w](e)&&L.push({instanceLocation:o,keyword:`format`,keywordLocation:`${s}/format`,error:`String does not match format "${w}".`})}return{valid:L.length===0,errors:L}}var dc=class{schema;draft;shortCircuit;lookup;constructor(e,t=`2019-09`,n=!0){this.schema=e,this.draft=t,this.shortCircuit=n,this.lookup=Is(e)}validate(e){return Q(e,this.schema,this.draft,this.lookup,this.shortCircuit)}addSchema(e,t){t&&(e={...e,$id:t}),Is(e,this.lookup)}},fc=class{shortcircuit;draft;constructor(e){this.shortcircuit=e?.shortcircuit??!0,this.draft=e?.draft}_draftFor(e){let t=ke(e,`pass an explicit { draft } to CfWorkerJsonSchemaValidator to validate other dialects.`);return t===`draft-7`?`7`:t}getValidator(e){let t=new dc(e,this.draft??this._draftFor(e),this.shortcircuit);return e=>{let n=t.validate(e);return n.valid?{valid:!0,data:e,errorMessage:void 0}:{valid:!1,data:void 0,errorMessage:n.errors.map(e=>`${e.instanceLocation}: ${e.error}`).join(`; `)}}}},pc=globalThis.crypto;async function mc(e){return(await pc).getRandomValues(new Uint8Array(e))}async function hc(e){let t=``;for(;t.length128)throw`Expected a length between 43 and 128. Received ${e}.`;let t=await gc(e);return{code_verifier:t,code_challenge:await _c(t)}}var yc=class extends Error{constructor(e,t){super(e),this.name=`ParseError`,this.type=t.type,this.field=t.field,this.value=t.value,this.line=t.line}},bc=10,xc=13,Sc=32;function Cc(e){}function wc(e){if(typeof e==`function`)throw TypeError("`config` must be an object, got a function instead. Did you mean `createParser({onEvent: fn})`?");let{onEvent:t=Cc,onError:n=Cc,onRetry:r=Cc,onComment:i,maxBufferSize:a}=e,o=[],s=0,c=!0,l,u=``,d=0,f,p=!1;function m(e){if(p)throw Error("Cannot feed parser: it was terminated after exceeding the configured max buffer size. Call `reset()` to resume parsing.");if(c&&(c=!1,e.charCodeAt(0)===239&&e.charCodeAt(1)===187&&e.charCodeAt(2)===191&&(e=e.slice(3))),o.length===0){let t=g(e);t!==``&&(o.push(t),s=t.length),h();return}if(e.indexOf(` +`)===-1&&e.indexOf(`\r`)===-1){o.push(e),s+=e.length,h();return}o.push(e);let t=o.join(``);o.length=0,s=0;let n=g(t);n!==``&&(o.push(n),s=n.length),h()}function h(){a!==void 0&&(s+u.length<=a||(p=!0,o.length=0,s=0,l=void 0,u=``,d=0,f=void 0,n(new yc(`Buffered data exceeded max buffer size of ${a} characters`,{type:`max-buffer-size-exceeded`}))))}function g(e){let n=0;if(e.indexOf(`\r`)===-1){let r=e.indexOf(` +`,n);for(;r!==-1;){if(n===r){d>0&&t({id:l,event:f,data:u}),l=void 0,u=``,d=0,f=void 0,n=r+1,r=e.indexOf(` +`,n);continue}let i=e.charCodeAt(n);if(Tc(e,n,i)){let i=e.charCodeAt(n+5)===Sc?n+6:n+5,a=e.slice(i,r);if(d===0&&e.charCodeAt(r+1)===bc){t({id:l,event:f,data:a}),l=void 0,u=``,f=void 0,n=r+2,r=e.indexOf(` +`,n);continue}u=d===0?a:`${u} +${a}`,d++}else Ec(e,n,i)?f=e.slice(e.charCodeAt(n+6)===Sc?n+7:n+6,r)||void 0:_(e,n,r);n=r+1,r=e.indexOf(` +`,n)}return e.slice(n)}for(;n20?`${e.slice(0,20)}\u2026`:e}"`,{type:`unknown-field`,field:e,value:t,line:i}))}}function y(){d>0&&t({id:l,event:f,data:u}),l=void 0,u=``,d=0,f=void 0}function b(e={}){if(e.consume&&o.length>0){let e=o.join(``);_(e,0,e.length)}c=!0,l=void 0,u=``,d=0,f=void 0,o.length=0,s=0,p=!1}return{feed:m,reset:b}}function Tc(e,t,n){return n===100&&e.charCodeAt(t+1)===97&&e.charCodeAt(t+2)===116&&e.charCodeAt(t+3)===97&&e.charCodeAt(t+4)===58}function Ec(e,t,n){return n===101&&e.charCodeAt(t+1)===118&&e.charCodeAt(t+2)===101&&e.charCodeAt(t+3)===110&&e.charCodeAt(t+4)===116&&e.charCodeAt(t+5)===58}var Dc=class extends TransformStream{constructor({onError:e,onRetry:t,onComment:n,maxBufferSize:r}={}){let i;super({start(a){i=wc({onEvent:e=>{a.enqueue(e)},onError(t){typeof e==`function`&&e(t),(e===`terminate`||t.type===`max-buffer-size-exceeded`)&&a.error(t)},onRetry:t,onComment:n,maxBufferSize:r})},transform(e){i.feed(e)}})}},Oc=class extends Error{static{Object.defineProperty(this,"mcpBrand",{value:`mcp.OAuthClientFlowError`})}static[Symbol.hasInstance](e){return $r(this,e)}static isInstance(e){if(typeof this!=`function`)throw TypeError("isInstance must be called on the class (e.g. `SdkError.isInstance(value)`); for callbacks use `v => SdkError.isInstance(v)`");return $r(this,e)}constructor(e){super(e),this.name=new.target.name,Qr(this,new.target)}},kc=class extends Oc{static{Object.defineProperty(this,"mcpBrand",{value:`mcp.IssuerMismatchError`})}kind;expected;received;constructor(e,t,n){super(`Issuer mismatch in ${e===`metadata`?`authorization server metadata (RFC 8414 §3.3)`:`authorization response (RFC 9207)`}: expected ${JSON.stringify(t)}, received ${JSON.stringify(n)}`),this.kind=e,this.expected=t,this.received=n}},Ac=class extends Oc{static{Object.defineProperty(this,"mcpBrand",{value:`mcp.RegistrationRejectedError`})}status;body;submittedMetadata;constructor(e){super(`Dynamic Client Registration rejected (HTTP ${e.status}): ${e.body}`),this.status=e.status,this.body=e.body,this.submittedMetadata=e.submittedMetadata}},jc=class extends Oc{static{Object.defineProperty(this,"mcpBrand",{value:`mcp.InsecureTokenEndpointError`})}tokenEndpoint;constructor(e){super(`Refusing to send credentials to non-https token endpoint '${e}'. OAuth token requests MUST use TLS (localhost / *.localhost / 127.0.0.1 / ::1 are exempt).`),this.tokenEndpoint=e}},Mc=class extends Oc{static{Object.defineProperty(this,"mcpBrand",{value:`mcp.AuthorizationServerMismatchError`})}constructor(e,t){super(`Authorization server mismatch: credentials are bound to ${JSON.stringify(e)} but this call resolved ${JSON.stringify(t)}; refusing to present them to a different authorization server`),this.recordedIssuer=e,this.currentIssuer=t}},Nc=class extends Oc{static{Object.defineProperty(this,"mcpBrand",{value:`mcp.InsufficientScopeError`})}requiredScope;resourceMetadataUrl;errorDescription;constructor(e){super(`Insufficient scope${e.requiredScope?`: required "${e.requiredScope}"`:``}`),this.requiredScope=e.requiredScope,this.resourceMetadataUrl=e.resourceMetadataUrl,this.errorDescription=e.errorDescription}};function Pc(e,t,n){if(e)return typeof e.issuer==`string`?Fc(e.issuer,t)?e:void 0:(n?.canPersistStamp!==!1&&console.warn(`[mcp-sdk] SEP-2352: stored OAuth credential has no 'issuer' stamp (pre-upgrade storage or provider not round-tripping the value). SEP-2352 isolation is inactive for this read; ensure your provider round-trips the issuer field.`),e.issuer===void 0?e:{...e,issuer:void 0})}function Fc(e,t){return e===t||e.endsWith(`/`)&&e.slice(0,-1)===t||t.endsWith(`/`)&&t.slice(0,-1)===e}function Ic(e){if(e==null)return!1;let t=e;return typeof t.tokens==`function`&&typeof t.clientInformation==`function`}async function Lc(e,t,n){let{resourceMetadataUrl:r,scope:i}=dl(t.response);if(await al(e,{serverUrl:t.serverUrl,resourceMetadataUrl:r,scope:i,fetchFn:t.fetchFn,...n})!==`AUTHORIZED`)throw new zc}function Rc(e,t){return{token:async()=>(await e.tokens())?.access_token,onUnauthorized:async n=>Lc(e,n,t)}}var zc=class extends Error{static{Object.defineProperty(this,"mcpBrand",{value:`mcp.UnauthorizedError`})}static[Symbol.hasInstance](e){return $r(this,e)}static isInstance(e){if(typeof this!=`function`)throw TypeError("isInstance must be called on the class (e.g. `SdkError.isInstance(value)`); for callbacks use `v => SdkError.isInstance(v)`");return $r(this,e)}constructor(e){super(e??`Unauthorized`),this.name=`UnauthorizedError`,Qr(this,new.target)}};function Bc(e){return e?.authorization_response_iss_parameter_supported===!0}function Vc({iss:e,expectedIssuer:t,issParameterSupported:n}){if(t!==void 0){if(e===void 0){if(n)throw new kc(`authorization_response`,t,void 0);return}if(e!==t)throw new kc(`authorization_response`,t,e)}}function Hc(...e){let t=new Set;for(let n of e)if(n)for(let e of n.split(/\s+/))e&&t.add(e);return t.size>0?[...t].join(` `):void 0}function Uc(e,t){if(!e)return!1;let n=new Set((t??``).split(/\s+/).filter(Boolean));for(let t of e.split(/\s+/))if(t&&!n.has(t))return!0;return!1}async function Wc(e,t,n,r,i){if(typeof e==`string`)return{authorizationCode:e,iss:t};let a=e.get(`iss`)??void 0,o=e.get(`code`);if(o)return{authorizationCode:o,iss:a};let s=(await n.discoveryState?.())?.authorizationServerMetadata;if(!s)try{s=(await xl(r,i)).authorizationServerMetadata}catch{s=void 0}if(!s)throw new zc(`Authorization callback failed and the issuer could not be verified`);Vc({iss:a,expectedIssuer:s.issuer,issParameterSupported:Bc(s)});let c=e.get(`error`);throw c?new ti(c,e.get(`error_description`)??c,e.get(`error_uri`)??void 0):new zc("Authorization callback contained neither `code` nor `error`")}function Gc(e){return[`client_secret_basic`,`client_secret_post`,`none`].includes(e)}var Kc=`code`,qc=`S256`;function Jc(e,t){let n=e.client_secret!==void 0;return`token_endpoint_auth_method`in e&&e.token_endpoint_auth_method&&Gc(e.token_endpoint_auth_method)&&(t.length===0||t.includes(e.token_endpoint_auth_method))?e.token_endpoint_auth_method:t.length===0?n?`client_secret_basic`:`none`:n&&t.includes(`client_secret_basic`)?`client_secret_basic`:n&&t.includes(`client_secret_post`)?`client_secret_post`:t.includes(`none`)?`none`:n?`client_secret_post`:`none`}function Yc(e,t,n,r){let{client_id:i,client_secret:a}=t;switch(e){case`client_secret_basic`:Xc(i,a,n);return;case`client_secret_post`:Zc(i,a,r);return;case`none`:Qc(i,r);return;default:throw Error(`Unsupported client authentication method: ${e}`)}}function Xc(e,t,n){if(!t)throw Error(`client_secret_basic authentication requires a client_secret`);let r=btoa(`${e}:${t}`);n.set(`Authorization`,`Basic ${r}`)}function Zc(e,t,n){n.set(`client_id`,e),t&&n.set(`client_secret`,t)}function Qc(e,t){t.set(`client_id`,e)}function $c(e){return e===`localhost`||e.endsWith(`.localhost`)||e===`127.0.0.1`||e===`[::1]`||e===`::1`}function el(e){let t=new URL(String(e));if(t.protocol!==`https:`&&!$c(t.hostname))throw new jc(t.href);return t}function tl(e){for(let t of e??[]){let e;try{e=new URL(t)}catch{continue}if(e.protocol!==`http:`&&e.protocol!==`https:`||$c(e.hostname))return`native`}return`web`}function nl(e){let t=e.clientMetadata;return{...t,grant_types:t.grant_types??(e.redirectUrl===void 0?void 0:[`authorization_code`,`refresh_token`]),application_type:t.application_type??tl(t.redirect_uris)}}async function rl(e){let t=e instanceof Response?e.status:void 0,n=e instanceof Response?await e.text():e;try{let e=Wr.parse(JSON.parse(n));return ti.fromResponse(e)}catch(e){let r=`${t?`HTTP ${t}: `:``}Invalid OAuth error response: ${e}. Raw body: ${n}`;return new ti(ei.ServerError,r)}}function il(e,t,n){let r=e.invalidateCredentials===void 0?`retrying authorization without discarding the stored ${n} (provider implements no invalidateCredentials())`:`invalidating the stored ${n} and retrying authorization`;console.warn(`[mcp-sdk] OAuth ${JSON.stringify(t.code)} — ${r}. Cause: ${JSON.stringify(t.message)}`)}async function al(e,t){try{return await sl(e,t)}catch(n){if(n instanceof ti){if(n.code===ei.InvalidClient||n.code===ei.UnauthorizedClient)return il(e,n,`client credentials and tokens`),await e.invalidateCredentials?.(`client`),await e.invalidateCredentials?.(`tokens`),await sl(e,t);if(n.code===ei.InvalidGrant||n.code===ei.InvalidDpopProof)return il(e,n,`tokens`),await e.invalidateCredentials?.(`tokens`),await sl(e,t)}throw n}}function ol(e){let{requestedScope:t,resourceMetadata:n,authServerMetadata:r,clientMetadata:i}=e,a=t||n?.scopes_supported?.join(` `)||i.scope;return a&&r?.scopes_supported?.includes(`offline_access`)&&!a.split(` `).includes(`offline_access`)&&i.grant_types?.includes(`refresh_token`)&&(a=`${a} offline_access`),a}async function sl(e,{serverUrl:t,authorizationCode:n,iss:r,scope:i,resourceMetadataUrl:a,fetchFn:o,skipIssuerMetadataValidation:s,forceReauthorization:c}){let l=nl(e),u=await e.discoveryState?.(),d,f,p,m,h=a;if(!h&&u?.resourceMetadataUrl&&(h=new URL(u.resourceMetadataUrl)),u?.authorizationServerUrl){if(f=u.authorizationServerUrl,d=u.resourceMetadata,p=u.authorizationServerMetadata??await bl(f,{fetchFn:o,skipIssuerValidation:s}),!d)try{d=await pl(t,{resourceMetadataUrl:h},o)}catch(e){if(e instanceof TypeError)throw e}(p!==u.authorizationServerMetadata||d!==u.resourceMetadata)&&await e.saveDiscoveryState?.({authorizationServerUrl:String(f),resourceMetadataUrl:h?.toString(),resourceMetadata:d,authorizationServerMetadata:p})}else{let e=await xl(t,{resourceMetadataUrl:h,fetchFn:o,skipIssuerMetadataValidation:s});f=e.authorizationServerUrl,p=e.authorizationServerMetadata,d=e.resourceMetadata,m={authorizationServerUrl:String(f),resourceMetadataUrl:h?.toString(),resourceMetadata:d,authorizationServerMetadata:p}}let g=p?.issuer??String(f),_={issuer:g};if(await e.saveAuthorizationServerUrl?.(g),n!==void 0){let t=u?.authorizationServerMetadata?.issuer??u?.authorizationServerUrl;if(t===void 0){if(e.saveDiscoveryState!==void 0)throw new Mc(`discoveryState was not available on the callback leg; ensure your provider persists discoveryState alongside codeVerifier`,g);console.warn(`[mcp-sdk] OAuthClientProvider does not implement saveDiscoveryState()/discoveryState(); the SEP-2352 callback-leg authorization-server binding cannot be checked. Implement discoveryState (persist alongside codeVerifier) — see docs/migration/upgrade-to-v2.md §SEP-2352.`)}else if(!Fc(t,g))throw new Mc(t,g)}m&&await e.saveDiscoveryState?.(m);let v=await ll(t,e,d),y=v&&d&&!e.validateResourceURL?d.resource:v;y&&await e.saveResourceUrl?.(Sl(y));let b=ol({requestedScope:i,resourceMetadata:d,authServerMetadata:p,clientMetadata:e.clientMetadata}),ee=await Promise.resolve(e.clientInformation(_)),x=Pc(ee,g,{canPersistStamp:e.saveClientInformation!==void 0});if(x===void 0&&ee?.issuer&&e.saveClientInformation===void 0)throw new Mc(ee.issuer,g);if(x&&x.issuer===void 0&&(x={...x,issuer:g},await e.saveClientInformation?.(x,_)),!x){if(n!==void 0)throw Error(`Existing OAuth client information is required when exchanging an authorization code`);let t=p?.client_id_metadata_document_supported===!0,r=e.clientMetadataUrl;if(r&&!cl(r))throw new ti(ei.InvalidClientMetadata,`clientMetadataUrl must be a valid HTTPS URL with a non-root pathname, got: ${r}`);if(t&&r)x={client_id:r,issuer:g},await e.saveClientInformation?.(x,_);else{if(!e.saveClientInformation)throw Error(`OAuth client information must be saveable for dynamic registration`);x={...await Ol(f,{metadata:p,clientMetadata:l,scope:b,fetchFn:o}),issuer:g},await e.saveClientInformation(x,_)}}let S=!e.redirectUrl;if(n!==void 0||S){n!==void 0&&Vc({iss:r,expectedIssuer:p?.issuer,issParameterSupported:Bc(p)});let t=await Dl(e,f,{metadata:p,resource:y,authorizationCode:n,iss:r,scope:b,fetchFn:o});return await e.saveTokens({...t,issuer:g},_),`AUTHORIZED`}let C=Pc(await e.tokens(_),g);if(C&&C.issuer===void 0&&(C={...C,issuer:g},await e.saveTokens(C,_)),C?.refresh_token&&!c){let t;try{t=await El(f,{metadata:p,clientInformation:x,refreshToken:C.refresh_token,resource:y,addClientAuthentication:e.addClientAuthentication,dpop:await e.dpop?.(),fetchFn:o})}catch(e){if(e instanceof jc)throw e;if(!(e instanceof ti)||e.code===ei.ServerError)console.warn(`[mcp-sdk] Could not refresh OAuth tokens; falling back to a new authorization request. Cause: ${JSON.stringify(e instanceof Error?e.message:String(e))}`);else throw e}if(t)return await e.saveTokens({...t,issuer:g},_),`AUTHORIZED`}let w=e.state?await e.state():void 0,{authorizationUrl:te,codeVerifier:T}=await Cl(f,{metadata:p,clientInformation:x,state:w,redirectUrl:e.redirectUrl,scope:b,resource:y});return await e.saveCodeVerifier(T),await e.redirectToAuthorization(te),`REDIRECT`}function cl(e){if(!e)return!1;try{let t=new URL(e);return t.protocol===`https:`&&t.pathname!==`/`}catch{return!1}}async function ll(e,t,n){let r=ri(e);if(t.validateResourceURL)return await t.validateResourceURL(r,n?.resource);if(n){if(!ai({requestedResource:r,configuredResource:n.resource}))throw Error(`Protected resource ${n.resource} does not match expected ${r} (or origin)`);return new URL(n.resource)}}var ul=new Set([`bearer`,`dpop`]);function dl(e){let t=e.headers.get(`WWW-Authenticate`);if(!t)return{};let[n,r]=t.split(` `);if(!n||!ul.has(n.toLowerCase())||!r)return{};let i=fl(e,`resource_metadata`)||void 0,a;if(i)try{a=new URL(i)}catch{}let o=fl(e,`scope`)||void 0,s=fl(e,`error`)||void 0,c=fl(e,`error_description`)||void 0;return{resourceMetadataUrl:a,scope:o,error:s,errorDescription:c}}function fl(e,t){let n=e.headers.get(`WWW-Authenticate`);if(!n)return null;let r=new RegExp(String.raw`${t}=(?:"([^"]+)"|([^\s,]+))`),i=n.match(r);if(i){let e=i[1]||i[2];if(e)return e}return null}async function pl(e,t,n=fetch){let r=await vl(e,`oauth-protected-resource`,n,{protocolVersion:t?.protocolVersion,metadataUrl:t?.resourceMetadataUrl});if(!r||r.status===404)throw await r?.text?.().catch(()=>{}),Error(`Resource server does not implement OAuth 2.0 Protected Resource Metadata.`);if(!r.ok)throw await r.text?.().catch(()=>{}),Error(`HTTP ${r.status} trying to load well-known OAuth protected resource metadata.`);return Rr.parse(await r.json())}async function ml(e,t,n=fetch){let r=Ds(n);try{return await r(e,{headers:t})}catch(n){if(!(n instanceof TypeError))throw n;if(t)try{return await r(e,{})}catch(e){if(!(e instanceof TypeError))throw e;return}return}}function hl(e,t=``,n={}){return t.endsWith(`/`)&&(t=t.slice(0,-1)),n.prependPathname?`${t}/.well-known/${e}`:`/.well-known/${e}${t}`}async function gl(e,t,n=fetch){return await ml(e,{"MCP-Protocol-Version":t},n)}function _l(e,t){return e?t===`/`?!1:!e.ok&&e.status<500||e.status===502:!0}async function vl(e,t,n,r){let i=new URL(e),a=r?.protocolVersion??`2025-11-25`,o;if(r?.metadataUrl)o=new URL(r.metadataUrl);else{let e=hl(t,i.pathname);o=new URL(e,r?.metadataServerUrl??i),o.search=i.search}let s=await gl(o,a,n);return!r?.metadataUrl&&_l(s,i.pathname)&&(s=await gl(new URL(`/.well-known/${t}`,i),a,n)),s}function yl(e){let t=typeof e==`string`?new URL(e):e,n=t.pathname!==`/`,r=[];if(!n)return r.push({url:new URL(`/.well-known/oauth-authorization-server`,t.origin),type:`oauth`},{url:new URL(`/.well-known/openid-configuration`,t.origin),type:`oidc`}),r;let i=t.pathname;return i.endsWith(`/`)&&(i=i.slice(0,-1)),r.push({url:new URL(`/.well-known/oauth-authorization-server${i}`,t.origin),type:`oauth`},{url:new URL(`/.well-known/openid-configuration${i}`,t.origin),type:`oidc`},{url:new URL(`${i}/.well-known/openid-configuration`,t.origin),type:`oidc`}),r}async function bl(e,{fetchFn:t=fetch,protocolVersion:n=Ae,skipIssuerValidation:r=!1}={}){let i={"MCP-Protocol-Version":n,Accept:`application/json`},a=yl(e);for(let{url:n,type:o}of a){let a=await ml(n,i,t);if(!a)continue;if(!a.ok){if(await a.text?.().catch(()=>{}),a.status<500||a.status===502)continue;throw Error(`HTTP ${a.status} trying to load ${o===`oauth`?`OAuth`:`OpenID provider`} metadata from ${n}`)}let s=o===`oauth`?zr.parse(await a.json()):Vr.parse(await a.json());if(!r){let t=typeof e==`string`?e:e.href;if(!(s.issuer===t||t.endsWith(`/`)&&s.issuer===t.slice(0,-1)))throw new kc(`metadata`,t,s.issuer)}return s}}async function xl(e,t){let n,r;try{n=await pl(e,{resourceMetadataUrl:t?.resourceMetadataUrl},t?.fetchFn),n.authorization_servers&&n.authorization_servers.length>0&&(r=n.authorization_servers[0])}catch(e){if(e instanceof TypeError)throw e}r||=String(new URL(`/`,e));let i=await bl(r,{fetchFn:t?.fetchFn,skipIssuerValidation:t?.skipIssuerMetadataValidation});return{authorizationServerUrl:r,authorizationServerMetadata:i,resourceMetadata:n}}function Sl(e){return typeof e==`string`?e:e.href}async function Cl(e,{metadata:t,clientInformation:n,redirectUrl:r,scope:i,state:a,resource:o}){let s;if(t){if(s=new URL(t.authorization_endpoint),!t.response_types_supported.includes(Kc))throw Error(`Incompatible auth server: does not support response type ${Kc}`);if(t.code_challenge_methods_supported&&!t.code_challenge_methods_supported.includes(qc))throw Error(`Incompatible auth server: does not support code challenge method ${qc}`)}else s=new URL(`/authorize`,e);let c=await vc(),l=c.code_verifier,u=c.code_challenge;return s.searchParams.set(`response_type`,Kc),s.searchParams.set(`client_id`,n.client_id),s.searchParams.set(`code_challenge`,u),s.searchParams.set(`code_challenge_method`,qc),s.searchParams.set(`redirect_uri`,String(r)),a&&s.searchParams.set(`state`,a),i&&s.searchParams.set(`scope`,i),i?.split(` `).includes(`offline_access`)&&s.searchParams.append(`prompt`,`consent`),o&&s.searchParams.set(`resource`,Sl(o)),{authorizationUrl:s,codeVerifier:l}}function wl(e,t,n){return new URLSearchParams({grant_type:`authorization_code`,code:e,code_verifier:t,redirect_uri:String(n)})}async function Tl(e,{metadata:t,tokenRequestParams:n,clientInformation:r,addClientAuthentication:i,resource:a,dpop:o,fetchFn:s}){let c=el(t?.token_endpoint??new URL(`/token`,e)),l=new Headers({"Content-Type":`application/x-www-form-urlencoded`,Accept:`application/json`});a&&n.set(`resource`,Sl(a)),!i&&r&&Yc(Jc(r,t?.token_endpoint_auth_methods_supported??[]),r,l,n);let u=async()=>{let e=new Headers(l);return i&&await i(e,n,c,t),o&&e.set(`DPoP`,await o.buildProof({htm:`POST`,htu:c})),Ds(s??fetch)(c,{method:`POST`,headers:e,body:n})},d=await u();if(o&&d.status===400&&(await d.clone().json().catch(()=>{}))?.error===ei.UseDpopNonce&&(o.observeNonce(d,c),d=await u()),o?.observeNonce(d,c),!d.ok)throw await rl(d);let f=await d.json();try{return Hr.parse(ii(f))}catch(e){throw typeof f==`object`&&f&&`error`in f?await rl(JSON.stringify(f)):e}}async function El(e,{metadata:t,clientInformation:n,refreshToken:r,resource:i,addClientAuthentication:a,dpop:o,fetchFn:s}){return{refresh_token:r,...await Tl(e,{metadata:t,tokenRequestParams:new URLSearchParams({grant_type:`refresh_token`,refresh_token:r}),clientInformation:n,addClientAuthentication:a,resource:i,dpop:o,fetchFn:s})}}async function Dl(e,t,{metadata:n,resource:r,authorizationCode:i,iss:a,scope:o,fetchFn:s}={}){i!==void 0&&Vc({iss:a,expectedIssuer:n?.issuer,issParameterSupported:Bc(n)});let c=n?.issuer??String(t),l=async()=>{let t=await e.clientInformation({issuer:c}),n=Pc(t,c,{canPersistStamp:!1});if(t&&n===void 0)throw new Mc(String(t.issuer),c);return n},u=await l(),d=o??e.clientMetadata.scope,f;if(e.prepareTokenRequest&&(f=await e.prepareTokenRequest(d)),!f){if(!i)throw Error(`Either provider.prepareTokenRequest() or authorizationCode is required`);if(!e.redirectUrl)throw Error(`redirectUrl is required for authorization_code flow`);f=wl(i,await e.codeVerifier(),e.redirectUrl)}return u??=await l(),Tl(t,{metadata:n,tokenRequestParams:f,clientInformation:u,addClientAuthentication:e.addClientAuthentication,resource:r,dpop:await e.dpop?.(),fetchFn:s})}async function Ol(e,{metadata:t,clientMetadata:n,scope:r,fetchFn:i}){let a;if(t){if(!t.registration_endpoint)throw Error(`Incompatible auth server: does not support dynamic client registration`);a=new URL(t.registration_endpoint)}else a=new URL(`/register`,e);let o={...n,...r===void 0?{}:{scope:r}},s=await Ds(i??fetch)(a,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify(o)});if(!s.ok)throw new Ac({status:s.status,body:await s.text(),submittedMetadata:o});return Jr.parse(ii(await s.json()))}var kl=new Set([`tools/list`,`prompts/list`,`resources/list`,`resources/templates/list`,`server/discover`]),Al=class{_entries=new Map;_maxEntries;_stamp=0;_cappedSize=0;constructor(e){this._maxEntries=e?.maxEntries??512}get size(){return this._entries.size}get(e){return this._entries.get(jl(e))}set(e,t){let n=jl(e),r=kl.has(e.method),i=!this._entries.has(n);if(!r&&i&&this._maxEntries>0&&this._cappedSize>=this._maxEntries){for(let e of this._entries.keys())if(!kl.has(e.slice(0,e.indexOf(`\0`)))){this._entries.delete(e),this._cappedSize--;break}}let a=++this._stamp;return this._entries.set(n,{...t,stamp:a}),i&&!r&&this._cappedSize++,a}delete(e){this._entries.delete(jl(e))&&!kl.has(e.method)&&this._cappedSize--}evict(e){let t=`${e}\0`,n=kl.has(e);for(let e of this._entries.keys())e.startsWith(t)&&(this._entries.delete(e),n||this._cappedSize--)}clear(){this._entries.clear(),this._cappedSize=0}};function jl(e){return`${e.method}\0${JSON.stringify([e.partition??``,e.params??``])}`}function Ml(e,t){return t===void 0?e:`${e}\0${t}`}var Nl=864e5,Pl=class{_evictionGeneration=new Map;_toolIndex;_toolOutputValidatorIndex;_serverIdentity=``;constructor(e,t,n=()=>{},r=``,i=Date.now){this._store=e,this._isUserSupplied=t,this._reportError=n,this._cachePartition=r,this._now=i}now(){return this._now()}setServerIdentity(e){this._serverIdentity=e}_partitionFor(e){return JSON.stringify([this._serverIdentity,e===`public`?``:this._cachePartition])}async _probe(e,t){let n={method:e,params:t??``},r=this._partitionFor(`private`),i=await this._store.get({...n,partition:r});if(i!==void 0)return i;let a=this._partitionFor(`public`);if(a===r)return;let o=await this._store.get({...n,partition:a});return o?.scope===`public`?o:void 0}async evict(e){this._evictionGeneration.set(e,(this._evictionGeneration.get(e)??0)+1),await this._deleteBoth(e,``)}async _deleteBoth(e,t){let n=this._partitionFor(`private`),r=this._partitionFor(`public`);try{await this._store.delete({method:e,params:t,partition:n})}catch(e){this._reportError(e)}if(r!==n)try{await this._store.delete({method:e,params:t,partition:r})}catch(e){this._reportError(e)}}async evictKey(e,t){let n=Ml(e,t),r=this._evictionGeneration.get(n);r!==void 0&&this._evictionGeneration.set(n,r+1),await this._deleteBoth(e,t)}captureGeneration(e,t){let n=Ml(e,t),r=this._evictionGeneration.get(n)??0;return this._evictionGeneration.set(n,r),r}async write(e,t,n,r){if((this._evictionGeneration.get(Ml(e,r?.params))??0)!==n)return;let i=r?.params??``,a=this._partitionFor(`private`),o=this._partitionFor(`public`),s=(r?.scope??`private`)===`public`?o:a;try{await this._store.set({method:e,params:i,partition:s},{value:Fl(t),expiresAt:r?.expiresAt,scope:r?.scope})}catch(e){this._reportError(e)}if(o!==a)try{await this._store.delete({method:e,params:i,partition:s===a?o:a})}catch(e){this._reportError(e)}}async read(e,t){let n=await this._probe(e,t);if(n?.expiresAt!==void 0&&n.expiresAt>this.now())try{let e=JSON.parse(n.value);if(typeof e!=`object`||!e||Array.isArray(e))throw TypeError(`cached document is not an object`);return{value:e}}catch(n){this._reportError(n),await this._deleteBoth(e,t??``);return}}resetForReconnect(){this._isUserSupplied||this._store.clear(),this._evictionGeneration.clear(),this._toolIndex=void 0,this._toolOutputValidatorIndex=void 0,this._serverIdentity=``}async toolDefinition(e){let t=await this._probe(`tools/list`);if(t===void 0){this._toolIndex=void 0;return}if(this._toolIndex?.stamp!==t.stamp){let e=this._decodeListTools(t),n=new Map;if(e!==void 0)for(let t of e.tools)n.set(t.name,t);this._toolIndex={stamp:t.stamp,byName:n}}return this._toolIndex.byName.get(e)}async outputValidator(e,t){let n=await this._probe(`tools/list`);if(n===void 0){this._toolOutputValidatorIndex=void 0;return}if(this._toolOutputValidatorIndex?.stamp!==n.stamp){let e=this._decodeListTools(n)??{tools:[]},r=new Map;for(let n of e.tools){let e=t(n);e!==void 0&&r.set(n.name,e)}this._toolOutputValidatorIndex={stamp:n.stamp,byName:r}}return this._toolOutputValidatorIndex.byName.get(e)}_decodeListTools(e){try{let t=JSON.parse(e.value);if(!Array.isArray(t?.tools)||!t.tools.every(e=>typeof e==`object`&&!!e))throw TypeError(`cached tools/list document has a malformed tools array`);return t}catch(e){this._reportError(e);return}}};function Fl(e){let t;try{t=JSON.stringify(e)}catch(e){throw TypeError(`cache value is not JSON-serializable: ${e instanceof Error?e.message:String(e)}`)}if(typeof t!=`string`)throw TypeError(`cache value is not JSON-serializable: it has no JSON representation`);return t}var Il=Symbol.for(`mcp.authSeamEscape`);function Ll(e){if(typeof e==`object`&&e||typeof e==`function`)try{Object.defineProperty(e,Il,{value:!0,configurable:!0})}catch{}return e}function Rl(e){return(typeof e==`object`&&!!e||typeof e==`function`)&&e[Il]===!0}var zl=-32022,Bl=new Set([-32001,-32020,-32021]);function Vl(e,t){switch(e.kind){case`result`:return Hl(e.result,t);case`rpc-error`:return Ul(e,t);case`http-error`:return Wl(e,t);case`network-error`:return Gl(e.error,t);case`unusable-reply`:return{kind:`error`,error:new Y(J.EraNegotiationFailed,`Version negotiation probe failed: the server answered with an unusable reply (${ql(e.error)})`,{cause:e.error},{cause:e.error})};case`auth-required`:return{kind:`error`,error:e.error};case`closed`:return t.transportKind===`stdio`?{kind:`legacy`}:Gl(Error(`Connection closed during the version negotiation probe`),t);case`timeout`:return t.transportKind===`stdio`?{kind:`legacy`}:{kind:`error`,error:new Y(J.RequestTimeout,`Version negotiation probe timed out after ${e.timeoutMs}ms`,{timeout:e.timeoutMs})}}}function Hl(e,t){let n=ja(Aa).validateResult(`server/discover`,e);if(!n.ok)return{kind:`legacy`};let r=n.value.supportedVersions,i=t.clientModernVersions.find(e=>r.includes(e));return i===void 0?t.fallbackAvailable?{kind:`legacy`}:{kind:`error`,error:new Xi({supported:[...r],requested:t.requestedVersion})}:{kind:`modern`,version:i,discover:n.value}}function Ul(e,t){let{code:n,message:r,data:i}=e;if(n===zl){let e=Jl(i);if(e===void 0)return{kind:`legacy`};let n=new Xi({supported:e,requested:Yl(i)??t.requestedVersion},r),a=ui(e),o=t.clientModernVersions.find(e=>a.includes(e));return o===void 0?a.length>0?{kind:`error`,error:n}:t.fallbackAvailable?{kind:`legacy`}:{kind:`error`,error:n}:{kind:`corrective`,version:o,error:n}}return Bl.has(n),{kind:`legacy`}}function Wl(e,t){if(e.status===401||e.status===403){let t=e.status===403;return{kind:`error`,error:new ni(t?J.ClientHttpForbidden:J.ClientHttpAuthentication,`Version negotiation failed: ${t?`the server denied access (HTTP 403)`:`the server requires authorization (HTTP 401)`}`,{status:e.status,statusText:e.statusText,text:e.body})}}if(e.status>=500)return{kind:`error`,error:new ni(J.EraNegotiationFailed,`Version negotiation failed: the server answered the probe with HTTP ${e.status}`,{status:e.status,statusText:e.statusText,text:e.body})};let n=Xl(e.body);return n===void 0?{kind:`legacy`}:Ul(n,t)}function Gl(e,t){return t.environment===`browser`&&Kl(e)?{kind:`legacy`}:{kind:`error`,error:new Y(J.EraNegotiationFailed,`Version negotiation probe failed: ${ql(e)}`,{cause:e},{cause:e})}}function Kl(e){return e instanceof TypeError||e instanceof Error&&e.name===`TypeError`}function ql(e){return e instanceof Error?e.message:String(e)}function Jl(e){if(typeof e!=`object`||!e)return;let t=e.supported;if(Array.isArray(t)&&t.length!==0&&t.every(e=>typeof e==`string`))return t}function Yl(e){if(typeof e!=`object`||!e)return;let t=e.requested;return typeof t==`string`?t:void 0}function Xl(e){if(e===void 0||e===``)return;let t;try{t=JSON.parse(e)}catch{return}if(typeof t!=`object`||!t)return;let n=t.error;if(typeof n!=`object`||!n)return;let{code:r,message:i,data:a}=n;if(typeof r==`number`)return{code:r,message:typeof i==`string`?i:``,data:a}}var Zl=`legacy`;function Ql(e,t){let n=e?.mode??Zl;if(n===`legacy`)return{kind:`legacy`};let r=e?.probe??{};if(typeof n==`object`){if(!ci(n.pin))throw TypeError(`versionNegotiation: { pin: '${n.pin}' } is not a modern protocol revision — pinning is for 2026-07-28 and later; omit versionNegotiation (or use mode: 'legacy') for 2025-era servers.`);return{kind:`pin`,version:n.pin,probe:r}}let i=t?ui(t):[];return{kind:`auto`,modernVersions:i.length>0?i:[...si],fallbackAvailable:!t||li(t).length>0,probe:r}}function $l(){let e=globalThis;return e.window!==void 0&&e.document!==void 0?`browser`:`node`}function eu(e){return`stderr`in e&&`pid`in e?`stdio`:`http`}var tu=class e{_pending;_probeCounter=0;_savedOnMessage;_savedOnError;_savedOnClose;_closeDelivered=!1;constructor(e){this._transport=e,this._savedOnMessage=e.onmessage,this._savedOnError=e.onerror,this._savedOnClose=e.onclose}static async open(t){let n=new e(t);t.onmessage=e=>{let t=n._pending;if(t!==void 0&&(Ba(e)||Va(e))&&e.id===t.id){n._pending=void 0,Ba(e)?t.resolve({kind:`response`,result:e.result}):t.resolve({kind:`response`,error:e.error});return}},t.onerror=e=>{n._savedOnError?.(e)},t.onclose=()=>{let e=n._pending;e!==void 0&&(n._pending=void 0,e.resolve({kind:`closed`})),n._closeDelivered=!0,n._savedOnClose?.()};try{await t.start()}catch(e){throw n.detach(),e}return n}async exchange(e,t){let n=`server-discover-probe-${++this._probeCounter}`;return new Promise(r=>{let i=!1,a=e=>{i||(i=!0,clearTimeout(o),this._pending?.id===n&&(this._pending=void 0),r(e))},o=setTimeout(()=>a({kind:`timeout`}),t);this._pending={id:n,resolve:a},this._transport.send(e(n)).catch(e=>a({kind:`send-error`,error:e}))})}detach(){if(this._pending=void 0,this._transport.onmessage=this._savedOnMessage,this._transport.onerror=this._savedOnError,this._closeDelivered&&this._savedOnClose!==void 0){let e=this._savedOnClose,t=this._transport,n=!1,r=()=>{if(!n){n=!0;return}e()};t.onclose=r,nu.set(t,()=>{t.onclose===r&&(t.onclose=e)})}else this._transport.onclose=this._savedOnClose}release(){this.detach();let e=this._transport,t=e.start,n=!0;e.start=async function(){if(n){n=!1,e.start=t;return}return t.call(e)}}},nu=new WeakMap;function ru(e){let t=nu.get(e);nu.delete(e),t?.()}function iu(e,t,n,r){return{jsonrpc:`2.0`,id:e,method:`server/discover`,params:{_meta:ja(t).outboundEnvelope({protocolVersion:t,clientInfo:n,clientCapabilities:r})}}}function au(e){return e instanceof Y&&e.code===J.ClientHttpUnexpectedContent||e instanceof Error&&e.name===`SyntaxError`}function ou(e,t){switch(e.kind){case`response`:return e.error===void 0?{kind:`result`,result:e.result}:{kind:`rpc-error`,...e.error};case`send-error`:{let t=e.error;if(Rl(t)||t instanceof zc||t instanceof Error&&t.name===`UnauthorizedError`)return{kind:`auth-required`,error:t};if(t instanceof ni){let e=t.data?.text;return{kind:`http-error`,status:t.data.status,body:typeof e==`string`?e:void 0,statusText:t.data.statusText}}return au(t)?{kind:`unusable-reply`,error:t}:{kind:`network-error`,error:t}}case`closed`:return{kind:`closed`};case`timeout`:return{kind:`timeout`,timeoutMs:t}}}async function su(e,t){let n=e.probe.timeoutMs??t.defaultTimeoutMs,r=Math.max(0,e.probe.maxRetries??0),i=e.kind===`pin`?[e.version]:e.modernVersions,a=e.kind===`auto`&&e.fallbackAvailable,o=await tu.open(t.transport),s=async()=>{let s=i[0],c=!1,l=r;for(;;){let r=await o.exchange(e=>iu(e,s,t.clientInfo,t.capabilities),n);if(r.kind===`timeout`&&l>0){l--;continue}let u=ou(r,n),d=Vl(u,{clientModernVersions:i,requestedVersion:s,fallbackAvailable:a,environment:t.environment,transportKind:t.transportKind});switch(d.kind){case`modern`:return{era:`modern`,version:d.version,discover:d.discover};case`corrective`:if(c)throw d.error;c=!0,s=d.version;continue;case`legacy`:{let n=u.kind===`closed`?`the connection closed during the server/discover probe`:void 0;if(e.kind===`pin`)throw new Y(J.EraNegotiationFailed,n===void 0?`Version negotiation failed: the server did not offer pinned protocol version ${e.version} via server/discover (no fallback in pin mode)`:`Version negotiation failed: ${n} before the server offered pinned protocol version ${e.version} (no fallback in pin mode)`);if(!e.fallbackAvailable)throw new Y(J.EraNegotiationFailed,n===void 0?`Version negotiation failed: the server gave no modern evidence and this client supports no pre-2026-07-28 protocol version to fall back to`:`Version negotiation failed: ${n} and this client supports no pre-2026-07-28 protocol version to fall back to`);if(n!==void 0&&t.disposableProbe!==!0)throw new Y(J.EraNegotiationFailed,`Version negotiation failed: ${n} (this transport probed in place — the disposable sibling probe requires the SDK's base StdioClientTransport)`);return{era:`legacy`}}case`error`:throw d.error}}},c;try{c=await s()}catch(e){throw o.detach(),e}return o.release(),c}function cu(e){let t=Object.getPrototypeOf(e);if(t===null||!Object.prototype.hasOwnProperty.call(t,`_dispose`))return;let n=e._serverParams;return typeof n==`object`&&n&&typeof n.command==`string`?n:void 0}async function lu(e,t,n,r){let i=t.constructor,a=new i({...n,stderr:`ignore`}),o=t.close,s=!1,c,l=new Promise((e,t)=>{c=()=>t(uu())});t.close=async function(){return s=!0,c?.(),o.call(t)};let u;try{let t=su(e,{...r,transport:a,transportKind:`stdio`,disposableProbe:!0});t.catch(()=>{}),u=await Promise.race([t,l])}finally{await du(a),t.close=o}if(s)throw uu();return u}function uu(){return new Y(J.EraNegotiationFailed,`Version negotiation failed: the transport was closed during the server/discover probe`)}async function du(e){try{let t=e._dispose;await(typeof t==`function`?t.call(e):e.close())}catch{}}function fu(e){let t=e._meta?.[Fe];return Qo.Implementation(t)?t:void 0}function pu(e,t){if(e&&typeof t==`object`&&t){if(e.type===`object`&&e.properties&&typeof e.properties==`object`){let n=t,r=e.properties;for(let e of Object.keys(r)){let t=r[e];n[e]===void 0&&Object.prototype.hasOwnProperty.call(t,`default`)&&(n[e]=t.default),n[e]!==void 0&&pu(t,n[e])}}if(Array.isArray(e.anyOf))for(let n of e.anyOf)typeof n!=`boolean`&&pu(n,t);if(Array.isArray(e.oneOf))for(let n of e.oneOf)typeof n!=`boolean`&&pu(n,t)}}function mu(e){if(!e)return{supportsFormMode:!1,supportsUrlMode:!1};let t=e.form!==void 0,n=e.url!==void 0;return{supportsFormMode:t||!t&&!n,supportsUrlMode:n}}function hu(e){if(typeof e==`object`&&e&&(e.kind===`legacy`&&!(`supportedVersions`in e)&&!(`discover`in e)||e.kind===`modern`&&vt.safeParse(e.discover).success))return e;throw new Y(J.EraNegotiationFailed,`connect({ prior }): unrecognized prior — expected { kind: 'modern', discover } or { kind: 'legacy' }`)}var gu={"notifications/tools/list_changed":[`tools/list`],"notifications/prompts/list_changed":[`prompts/list`],"notifications/resources/list_changed":[`resources/list`,`resources/templates/list`]},_u=64,vu=class extends os{_serverCapabilities;_serverVersion;_capabilities;_instructions;_jsonSchemaValidator;_cache;_defaultCacheTtlMs;_listMaxPages;_listChangedDebounceTimers=new Map;_listChangedConfig;_enforceStrictCapabilities;_versionNegotiation;_supportedProtocolVersionsOption;_inputRequiredDriverConfig;_listenState=new Map;_nextListenId=0;_autoOpenedSubscription;_discoverResult;_resetConnectionState(){if(this._negotiatedProtocolVersion=void 0,this._serverCapabilities=void 0,this._serverVersion=void 0,this._instructions=void 0,this._discoverResult=void 0,this._autoOpenedSubscription=void 0,this._listenState.size>0){let e=new Y(J.ConnectionClosed,`subscriptions/listen: client reconnected or closed; subscription state from the previous connection was reset`);for(let t of this._listenState.values())t.settle({cause:`remote`,error:e})}this._listenState.clear();for(let e of this._listChangedDebounceTimers.values())clearTimeout(e);this._listChangedDebounceTimers.clear(),this._cache.resetForReconnect()}async close(){try{await super.close()}finally{this._resetConnectionState()}}constructor(e,t){super(t),this._clientInfo=e,this._capabilities=t?.capabilities?{...t.capabilities}:{},this._jsonSchemaValidator=t?.jsonSchemaValidator??new fc,this._enforceStrictCapabilities=t?.enforceStrictCapabilities??!1,this._versionNegotiation=t?.versionNegotiation,this._supportedProtocolVersionsOption=t?.supportedProtocolVersions,this._inputRequiredDriverConfig=Vo(t?.inputRequired),this._cache=new Pl(t?.responseCacheStore??new Al,t?.responseCacheStore!==void 0,e=>this._reportStoreError(e),t?.cachePartition??``),this._defaultCacheTtlMs=t?.defaultCacheTtlMs??0,this._listMaxPages=t?.listMaxPages??_u,t?.listChanged&&(this._listChangedConfig=t.listChanged)}buildContext(e,t){return e}_shouldDropInbound(e){if(this._negotiatedProtocolVersion!==void 0&&ci(this._negotiatedProtocolVersion)&&Ra(e))return`drop`}_outboundMetaEnvelope(){let e=this._negotiatedProtocolVersion;if(e!==void 0)return this._wireCodec().outboundEnvelope({protocolVersion:e,clientInfo:this._clientInfo,clientCapabilities:this._capabilities})}_resolveNonCompleteResult(e,t){return this._inputRequiredDriverConfig.autoFulfill?hs({getRequestHandler:e=>this._getRequestHandler(e),buildContext:e=>this.buildContext(e,void 0),sessionId:this.transport?.sessionId},this._inputRequiredDriverConfig,e,t):Promise.reject(new Y(J.UnsupportedResultType,`Unsupported result type 'input_required' for ${t.request.method}: multi-round-trip auto-fulfilment is not enabled on this instance — pass allowInputRequired: true to handle it manually, or enable inputRequired.autoFulfill`,{resultType:`input_required`,method:t.request.method}))}_setupListChangedHandlers(e){e.tools&&this._serverCapabilities?.tools?.listChanged&&this._setupListChangedHandler(`tools`,`notifications/tools/list_changed`,e.tools,async()=>(await this.listTools(void 0,{cacheMode:`refresh`})).tools),e.prompts&&this._serverCapabilities?.prompts?.listChanged&&this._setupListChangedHandler(`prompts`,`notifications/prompts/list_changed`,e.prompts,async()=>(await this.listPrompts(void 0,{cacheMode:`refresh`})).prompts),e.resources&&this._serverCapabilities?.resources?.listChanged&&this._setupListChangedHandler(`resources`,`notifications/resources/list_changed`,e.resources,async()=>(await this.listResources(void 0,{cacheMode:`refresh`})).resources)}registerCapabilities(e){if(this.transport)throw Error(`Cannot register capabilities after connecting to transport`);this._capabilities=cs(this._capabilities,e)}setVersionNegotiation(e){if(this.transport)throw Error(`Cannot configure version negotiation after connecting to transport`);this._versionNegotiation=e}_wrapHandler(e,t){return e===`elicitation/create`?async(e,n)=>{let r=ja(this._negotiatedProtocolVersion),i=r.validateRequest(`elicitation/create`,e);if(!i.ok&&i.reason===`not-in-era`&&(i=r.validateInputRequest(`elicitation/create`,e)),!i.ok)throw new Z(i.reason===`not-in-era`?X.InternalError:X.InvalidParams,i.reason===`not-in-era`?`No wire schema for elicitation/create in the resolved era`:`Invalid elicitation request: ${i.message}`);let{params:a}=i.value;a.mode=a.mode??`form`;let{supportsFormMode:o,supportsUrlMode:s}=mu(this._capabilities.elicitation);if(a.mode===`form`&&!o)throw new Z(X.InvalidParams,`Client does not support form-mode elicitation requests`);if(a.mode===`url`&&!s)throw new Z(X.InvalidParams,`Client does not support URL-mode elicitation requests`);let c=await t(e,n),l=r.validateResult(`elicitation/create`,c);if(!l.ok&&l.reason===`not-in-era`&&(l=r.validateInputResponse(`elicitation/create`,c)),!l.ok)throw new Z(l.reason===`not-in-era`?X.InternalError:X.InvalidParams,l.reason===`not-in-era`?`No wire schema for elicitation/create in the resolved era`:`Invalid elicitation result: ${l.message}`);let u=l.value,d=a.mode===`form`?a.requestedSchema:void 0;if(a.mode===`form`&&u.action===`accept`&&u.content&&d&&this._capabilities.elicitation?.form?.applyDefaults)try{pu(d,u.content)}catch{}return u}:e===`sampling/createMessage`?async(e,n)=>{let r=ja(this._negotiatedProtocolVersion),i=r.validateRequest(`sampling/createMessage`,e);if(!i.ok&&i.reason===`not-in-era`&&(i=r.validateInputRequest(`sampling/createMessage`,e)),!i.ok)throw new Z(i.reason===`not-in-era`?X.InternalError:X.InvalidParams,i.reason===`not-in-era`?`No wire schema for sampling/createMessage in the resolved era`:`Invalid sampling request: ${i.message}`);let{params:a}=i.value,o=await t(e,n),s=!!(a.tools||a.toolChoice),c=r.samplingResultVariant(s,o);if(!c.ok&&c.reason===`not-in-era`&&(c=r.validateInputResponse(`sampling/createMessage`,o)),!c.ok)throw new Z(c.reason===`not-in-era`?X.InternalError:X.InvalidParams,c.reason===`not-in-era`?`No result schema for sampling/createMessage in the resolved era`:`Invalid sampling result: ${c.message}`);return c.value}:t}assertCapability(e,t){if(!this._serverCapabilities?.[e])throw new Y(J.CapabilityNotSupported,`Server does not support ${e} (required for ${t})`)}async connect(e,t){if(t?.prior!=null)return this._connectFromPrior(e,hu(t.prior),t);let n=Ql(this._versionNegotiation,this._supportedProtocolVersionsOption);return n.kind===`legacy`?this._connectPlainLegacy(e,t):this._connectNegotiated(e,n,t)}async _connectPlainLegacy(e,t){if(await super.connect(e),e.sessionId!==void 0){let t=this._negotiatedProtocolVersion;t!==void 0&&e.setProtocolVersion?.(t);return}this._resetConnectionState(),await this._legacyHandshake(e,t)}async _legacyHandshake(e,t){let n=li(this._supportedProtocolVersions);try{let r=n[0];if(r===void 0)throw new Y(J.EraNegotiationFailed,`Cannot run the initialize handshake: supportedProtocolVersions contains no pre-2026-07-28 protocol version`);let i=await this.request({method:`initialize`,params:{protocolVersion:r,capabilities:this._capabilities,clientInfo:this._clientInfo}},t);if(i===void 0)throw Error(`Server sent invalid initialize result: ${i}`);if(!n.includes(i.protocolVersion))throw Error(`Server's protocol version is not supported: ${i.protocolVersion}`);this._serverCapabilities=i.capabilities,this._serverVersion=i.serverInfo,this._cache.setServerIdentity(this._deriveServerIdentity(e)),e.setProtocolVersion&&e.setProtocolVersion(i.protocolVersion),this._instructions=i.instructions,await this.notification({method:`notifications/initialized`}),this._negotiatedProtocolVersion=i.protocolVersion,this._listChangedConfig&&this._setupListChangedHandlers(this._listChangedConfig)}catch(e){throw this.close(),e}}async _connectNegotiated(e,t,n){if(e.sessionId!==void 0){await super.connect(e);let t=this._negotiatedProtocolVersion;t!==void 0&&e.setProtocolVersion&&e.setProtocolVersion(t);return}this._resetConnectionState();let r;try{let i=eu(e),a={clientInfo:this._clientInfo,capabilities:this._capabilities,environment:$l(),defaultTimeoutMs:n?.timeout??6e4},o=i===`stdio`?cu(e):void 0;r=o===void 0?await su(t,{...a,transport:e,transportKind:i}):await lu(t,e,o,a)}catch(t){throw await e.close().catch(()=>{}),ru(e),t}if(ru(e),await super.connect(e),r.era===`legacy`){await this._legacyHandshake(e,n);return}if(this._serverCapabilities=r.discover.capabilities,this._serverVersion=fu(r.discover),this._cache.setServerIdentity(this._deriveServerIdentity(e)),this._instructions=r.discover.instructions,this._discoverResult=r.discover,this._negotiatedProtocolVersion=r.version,e.setProtocolVersion&&e.setProtocolVersion(r.version),this._listChangedConfig){let e=this._listChangedConfig,t=this._serverCapabilities,r={...e.tools&&t?.tools?.listChanged&&{tools:e.tools},...e.prompts&&t?.prompts?.listChanged&&{prompts:e.prompts},...e.resources&&t?.resources?.listChanged&&{resources:e.resources}},i=!0;try{this._setupListChangedHandlers(r)}catch(e){i=!1,this.onerror?.(e instanceof Error?e:Error(String(e)))}let a=i?{...r.tools&&{toolsListChanged:!0},...r.prompts&&{promptsListChanged:!0},...r.resources&&{resourcesListChanged:!0}}:{};if(Object.keys(a).length>0){let e=new AbortController,t=()=>e.abort(n?.signal?.reason);n?.signal?.aborted&&t(),n?.signal?.addEventListener(`abort`,t);try{this._autoOpenedSubscription=await this.listen(a,{timeout:n?.timeout,signal:e.signal})}catch(e){if(n?.signal?.aborted)throw await this.close().catch(()=>{}),e;this.onerror?.(e instanceof Error?e:Error(String(e)))}finally{n?.signal?.removeEventListener(`abort`,t)}}}}async _connectFromPrior(e,t,n){if(t.kind===`legacy`)return this._connectPlainLegacy(e,n);let r=t.discover;this._resetConnectionState();let i=this._supportedProtocolVersionsOption,a=(i&&ui(i).length>0?ui(i):si).find(e=>r.supportedVersions.includes(e));if(a===void 0)throw new Y(J.EraNegotiationFailed,`connect({ prior }) with a modern verdict requires a 2026-07-28+ mutual protocol version; the supplied DiscoverResult and this client's supportedProtocolVersions have no modern overlap. For a server known to be legacy, pass prior: { kind: 'legacy' } to skip the probe and initialize directly, or use versionNegotiation: { mode: 'auto' } to re-probe with legacy fallback.`);if(await super.connect(e),this._discoverResult=r,this._serverCapabilities=r.capabilities,this._serverVersion=fu(r),this._cache.setServerIdentity(this._deriveServerIdentity(e)),this._instructions=r.instructions,this._negotiatedProtocolVersion=a,e.setProtocolVersion?.(a),this._listChangedConfig)try{this._setupListChangedHandlers(this._listChangedConfig)}catch(e){this.onerror?.(e instanceof Error?e:Error(String(e)))}}getServerCapabilities(){return this._serverCapabilities}getServerVersion(){return this._serverVersion}_deriveServerIdentity(e){let t=this._serverVersion;return t===void 0?e.sessionId??`anonymous:${Date.now()}-${Math.random().toString(36).slice(2)}`:`${t.name}@${t.version}`}getNegotiatedProtocolVersion(){return this._negotiatedProtocolVersion}getProtocolEra(){let e=this._negotiatedProtocolVersion;if(e!==void 0)return ci(e)?`modern`:`legacy`}getInstructions(){return this._instructions}getDiscoverResult(){return this._discoverResult}assertCapabilityForMethod(e){switch(e){case`logging/setLevel`:if(!this._serverCapabilities?.logging)throw new Y(J.CapabilityNotSupported,`Server does not support logging (required for ${e})`);break;case`prompts/get`:case`prompts/list`:if(!this._serverCapabilities?.prompts)throw new Y(J.CapabilityNotSupported,`Server does not support prompts (required for ${e})`);break;case`resources/list`:case`resources/templates/list`:case`resources/read`:case`resources/subscribe`:case`resources/unsubscribe`:if(!this._serverCapabilities?.resources)throw new Y(J.CapabilityNotSupported,`Server does not support resources (required for ${e})`);if(e===`resources/subscribe`&&!this._serverCapabilities.resources.subscribe)throw new Y(J.CapabilityNotSupported,`Server does not support resource subscriptions (required for ${e})`);break;case`tools/call`:case`tools/list`:if(!this._serverCapabilities?.tools)throw new Y(J.CapabilityNotSupported,`Server does not support tools (required for ${e})`);break;case`completion/complete`:if(!this._serverCapabilities?.completions)throw new Y(J.CapabilityNotSupported,`Server does not support completions (required for ${e})`)}}assertNotificationCapability(e){if(e===`notifications/roots/list_changed`&&!this._capabilities.roots?.listChanged)throw new Y(J.CapabilityNotSupported,`Client does not support roots list changed notifications (required for ${e})`)}assertRequestHandlerCapability(e){switch(e){case`sampling/createMessage`:if(!this._capabilities.sampling)throw new Y(J.CapabilityNotSupported,`Client does not support sampling capability (required for ${e})`);break;case`elicitation/create`:if(!this._capabilities.elicitation)throw new Y(J.CapabilityNotSupported,`Client does not support elicitation capability (required for ${e})`);break;case`roots/list`:if(!this._capabilities.roots)throw new Y(J.CapabilityNotSupported,`Client does not support roots capability (required for ${e})`)}}async ping(e){return this.request({method:`ping`},e)}async discover(e){let t=await this._requestWithSchema({method:`server/discover`},vt,e);return this._discoverResult=t,t}async complete(e,t){return this.request({method:`completion/complete`,params:e},t)}async setLoggingLevel(e,t){return this.request({method:`logging/setLevel`,params:{level:e}},t)}async getPrompt(e,t){return this.request({method:`prompts/get`,params:e},t)}async listPrompts(e,t){if(!this._serverCapabilities?.prompts&&!this._enforceStrictCapabilities)return console.debug(`Client.listPrompts() called but server does not advertise prompts capability - returning empty list`),{prompts:[]};if(e?.cursor!==void 0)return this.request({method:`prompts/list`,params:e},t);let n=await this._serveFromCache(`prompts/list`,void 0,t);return n===void 0?this._listAllPages(`prompts/list`,e,t,e=>e.prompts):n}async listResources(e,t){if(!this._serverCapabilities?.resources&&!this._enforceStrictCapabilities)return console.debug(`Client.listResources() called but server does not advertise resources capability - returning empty list`),{resources:[]};if(e?.cursor!==void 0)return this.request({method:`resources/list`,params:e},t);let n=await this._serveFromCache(`resources/list`,void 0,t);return n===void 0?this._listAllPages(`resources/list`,e,t,e=>e.resources):n}async listResourceTemplates(e,t){if(!this._serverCapabilities?.resources&&!this._enforceStrictCapabilities)return console.debug(`Client.listResourceTemplates() called but server does not advertise resources capability - returning empty list`),{resourceTemplates:[]};if(e?.cursor!==void 0)return this.request({method:`resources/templates/list`,params:e},t);let n=await this._serveFromCache(`resources/templates/list`,void 0,t);return n===void 0?this._listAllPages(`resources/templates/list`,e,t,e=>e.resourceTemplates):n}async _listAllPages(e,t,n,r,i){let a=n?.cacheMode===`bypass`,o=this._cache.captureGeneration(e),s=await this.request({method:e,...t&&{params:{...t}}},n),c=s.nextCursor,l=s,u=1;for(;c!==void 0;){if(this._listMaxPages!==0&&u>=this._listMaxPages)throw new Y(J.ListPaginationExceeded,`${e}: exceeded listMaxPages (${this._listMaxPages}); server pagination did not terminate`,{method:e,listMaxPages:this._listMaxPages});let i=await this.request({method:e,params:{...t,cursor:c}},n);if(i.nextCursor===c&&JSON.stringify(r(i))===JSON.stringify(r(l)))break;r(s).push(...r(i)),l=i,c=i.nextCursor,u++}return delete s.nextCursor,i?.(s),a||await this._cache.write(e,s,o,this._freshness(s)),s}_freshness(e,t){let n=e,r=typeof n.ttlMs==`number`?n.ttlMs:this._defaultCacheTtlMs,i=n.cacheScope===`public`?`public`:`private`;return{expiresAt:this._cache.now()+Math.min(Math.max(0,r),Nl),scope:i,params:t}}async _serveFromCache(e,t,n){if(n?.cacheMode===`bypass`||n?.cacheMode===`refresh`)return;let r=await this._cache.read(e,t).catch(e=>void this._reportStoreError(e));if(r!==void 0){if(n?.signal?.aborted){let e=n.signal.reason;throw e instanceof Y?e:new Y(J.RequestTimeout,String(e))}return r.value}}_reportStoreError(e){this.onerror?.(e instanceof Error?e:Error(String(e)))}_compileOutputValidator(e){if(e.outputSchema)try{return{ok:!0,validator:this._jsonSchemaValidator.getValidator(e.outputSchema)}}catch(e){return{ok:!1,compileError:e}}}async _resolveXMcpHeaderScan(e,t){let n=t??await this._cache.toolDefinition(e);return n===void 0?void 0:Ya(n.inputSchema)}async readResource(e,t){let n=await this._serveFromCache(`resources/read`,e.uri,t);if(n!==void 0)return n;let r=this._cache.captureGeneration(`resources/read`,e.uri),i=await this.request({method:`resources/read`,params:e},t);if(t?.cacheMode!==`bypass`){let n=this._freshness(i,e.uri);n.expiresAt>this._cache.now()?await this._cache.write(`resources/read`,i,r,n):t?.cacheMode===`refresh`&&await this._cache.evictKey(`resources/read`,e.uri)}return i}async subscribeResource(e,t){return this.request({method:`resources/subscribe`,params:e},t)}async unsubscribeResource(e,t){return this.request({method:`resources/unsubscribe`,params:e},t)}async listen(e,t){if(this.transport===void 0)throw new Y(J.NotConnected,`Not connected`);let n=this._negotiatedProtocolVersion;if(n===void 0||!ci(n))throw new Y(J.MethodNotSupportedByProtocolVersion,`subscriptions/listen requires a 2026-07-28-era connection (negotiated: ${n??`none`}). On a 2025-era connection, change notifications are delivered unsolicited: use ClientOptions.listChanged and resources/subscribe instead.`,{method:`subscriptions/listen`,protocolVersion:n});if(t?.signal?.aborted){let e=t.signal.reason;throw e instanceof Y?e:new Y(J.RequestTimeout,String(e))}let r=new AbortController,i=`listen:${this._nextListenId++}`,a=`opening`,o,s,c,l,u=new Promise((e,t)=>{c=e,l=t}),d,f=new Promise(e=>{d=e}),p=e=>{if(a===`closed`)return;let n=a===`opening`;if(o!==void 0&&(clearTimeout(o),o=void 0),`ack`in e){a=`open`,c(e.ack);return}a=`closed`,s!==void 0&&t?.signal?.removeEventListener(`abort`,s),this._listenState.delete(i),r.abort(),d(e.cause),n&&l(e.error??new Y(J.ConnectionClosed,`subscriptions/listen closed before the server acknowledged`))},m=async()=>{r.abort(),await this.notification({method:`notifications/cancelled`,params:{requestId:i}}).catch(()=>{})},h=async()=>{a!==`closed`&&(p({cause:`local`}),await m())};this._listenState.set(i,{settle:p});let g=t?.timeout??6e4;if(o=setTimeout(()=>{p({cause:`remote`,error:new Y(J.RequestTimeout,`subscriptions/listen ack timed out`,{timeout:g})}),m().catch(()=>{})},g),t?.signal){let e=t.signal;s=()=>{if(a===`closed`)return;let t=e.reason;p({cause:`local`,error:t instanceof Error?t:Error(String(t??`Aborted`))}),m().catch(()=>{})},e.addEventListener(`abort`,s,{once:!0})}let _={jsonrpc:`2.0`,id:i,method:`subscriptions/listen`,params:{_meta:{...this._outboundMetaEnvelope()},notifications:e}},v=e=>{p({cause:`remote`,error:e instanceof Error?e:Error(String(e))})};try{this.transport.send(_,{requestSignal:r.signal,onRequestStreamEnd:()=>p({cause:`remote`,error:Error(`subscriptions/listen: stream ended`)})}).catch(v)}catch(e){v(e)}return{honoredFilter:await u,close:h,closed:f}}get autoOpenedSubscription(){return this._autoOpenedSubscription}_onnotification(e,t){let n=Object.hasOwn(gu,e.method)?gu[e.method]:void 0;if(e.method===`notifications/resources/updated`){let t=e.params?.uri;typeof t==`string`&&this._cache.evictKey(`resources/read`,t)}else if(n!==void 0)for(let e of n)this._cache.evict(e);if(e.method===`notifications/subscriptions/acknowledged`){let t=e.params?._meta?.[Le],n=typeof t==`string`?this._listenState.get(t):void 0;if(n!==void 0){let t=this._wireCodec().validateNotification(`notifications/subscriptions/acknowledged`,e);n.settle({ack:t.ok?t.value.params.notifications:{}});return}}if(e.method===`notifications/cancelled`){let t=e.params?.requestId,n=typeof t==`string`?this._listenState.get(t):void 0;if(n!==void 0){n.settle({cause:`remote`,error:Error(`subscriptions/listen: server cancelled the subscription`)});return}}super._onnotification(e,t)}_onresponse(e){let t=e.id,n=typeof t==`string`?this._listenState.get(t):void 0;if(n!==void 0){Va(e)?n.settle({cause:`remote`,error:Z.fromError(e.error.code,e.error.message,e.error.data)}):n.settle({cause:`graceful`,error:new Y(J.ConnectionClosed,`subscriptions/listen: server closed the subscription gracefully before acknowledging`)});return}super._onresponse(e)}_onclose(){if(this._listenState.size>0){let e=new Y(J.ConnectionClosed,`Connection closed`);for(let t of this._listenState.values())t.settle({cause:`remote`,error:e});this._listenState.clear()}super._onclose()}async callTool(e,t){let n=this.getProtocolEra()===`modern`&&$l()!==`browser`,r=async()=>{if(!n)return t;let r;try{r=await this._resolveXMcpHeaderScan(e.name,t?.toolDefinition)}catch(e){this._reportStoreError(e)}if(!r?.valid||r.declarations.length===0)return t;let i=oo(r.declarations,e.arguments);return Object.keys(i).length===0?t:{...t,headers:{...t?.headers,...i}}},i=t?.toolDefinition===void 0?await this._cache.outputValidator(e.name,e=>this._compileOutputValidator(e)).catch(e=>void this._reportStoreError(e)):this._compileOutputValidator(t.toolDefinition),a=()=>{if(i===void 0||i.ok)return;let t=i.compileError,n=(t instanceof Error?t.message:String(t)).slice(0,200);throw new Z(X.InvalidParams,`Tool '${e.name}' has an invalid outputSchema: ${n}`)};a();let o;try{o=await this.request({method:`tools/call`,params:e},await r())}catch(s){let c=s instanceof Z&&s.code===-32020;if(!n||!c||t?.toolDefinition!==void 0)throw s;let l={signal:t?.signal,timeout:t?.timeout,cacheMode:`refresh`};await this._cache.evict(`tools/list`),await this.listTools(void 0,l).catch(e=>this._reportStoreError(e)),i=await this._cache.outputValidator(e.name,e=>this._compileOutputValidator(e)).catch(e=>void this._reportStoreError(e)),a(),o=await this.request({method:`tools/call`,params:e},await r())}let s=i!==void 0&&i.ok?i.validator:void 0;if(s){if(o.structuredContent===void 0&&!o.isError)throw new Z(X.InvalidRequest,`Tool ${e.name} has an output schema but did not return structured content`);if(o.structuredContent!==void 0&&!o.isError)try{let e=s(o.structuredContent);if(!e.valid)throw new Z(X.InvalidParams,`Structured content does not match the tool's output schema: ${e.errorMessage}`)}catch(e){throw e instanceof Z?e:new Z(X.InvalidParams,`Failed to validate structured content: ${e instanceof Error?e.message:String(e)}`)}}return o}async listTools(e,t){if(!this._serverCapabilities?.tools&&!this._enforceStrictCapabilities)return console.debug(`Client.listTools() called but server does not advertise tools capability - returning empty list`),{tools:[]};if(e?.cursor!==void 0){let n=await this.request({method:`tools/list`,params:e},t);return this._excludeInvalidXMcpHeaderTools(n),n}let n=await this._serveFromCache(`tools/list`,void 0,t);return n===void 0?this._listAllPages(`tools/list`,e,t,e=>e.tools,e=>this._excludeInvalidXMcpHeaderTools(e)):n}_excludeInvalidXMcpHeaderTools(e){if(this.getProtocolEra()!==`modern`||!this.transport||eu(this.transport)===`stdio`)return;let t=e.tools.filter(e=>{let t=Ya(e.inputSchema);return t.valid?!0:(console.warn(`[mcp-sdk] excluding tool '${e.name}' from tools/list: invalid x-mcp-header declaration — ${t.reason}`),!1)});t.length!==e.tools.length&&(e.tools=t)}_setupListChangedHandler(e,t,n,r){let i=uo(Dn,n);if(!i.success)throw Error(`Invalid ${e} listChanged options: ${i.error.message}`);if(typeof n.onChanged!=`function`)throw TypeError(`Invalid ${e} listChanged options: onChanged must be a function`);let{autoRefresh:a,debounceMs:o}=i.data,{onChanged:s}=n,c=async()=>{if(!a){s(null,null);return}try{s(null,await r())}catch(e){s(e instanceof Error?e:Error(String(e)),null)}};this.setNotificationHandler(t,()=>{if(o){let t=this._listChangedDebounceTimers.get(e);t&&clearTimeout(t);let n=setTimeout(c,o);this._listChangedDebounceTimers.set(e,n)}else c()})}async sendRootsListChanged(){return this.notification({method:`notifications/roots/list_changed`})}};function yu(e){return/(?:^|,)\s*dpop(?:\s|$|,)/i.test(e)}function bu(e){if(e.status!==401)return!1;let t=e.headers.get(`www-authenticate`)??``;return yu(t)&&/use_dpop_nonce/i.test(t)}var xu=(e,t)=>n=>{let r=typeof e==`function`?e:()=>e;return async(e,i)=>{let a=(i?.method??`GET`).toUpperCase(),o=new URL(e.toString()),s=await r();if(!s)return n(e,i);let c=async()=>{let r=await t();if(!r)return n(e,i);let c=new Headers(i?.headers),l=await s.buildProof({htm:a,htu:o,accessToken:r});return c.set(`Authorization`,`DPoP ${r}`),c.set(`DPoP`,l),n(e,{...i,headers:c})},l=await c();return bu(l)&&l.headers.has(`dpop-nonce`)&&(s.observeNonce(l,o),await l.text?.().catch(()=>{}),l=await c()),s.observeNonce(l,o),l}},Su=e=>xu(async()=>{try{return await e.dpop?.()}catch(e){throw Ll(e)}},async()=>{let t;try{t=await e.tokens()}catch(e){throw Ll(e)}return t?.token_type?.toLowerCase()===`dpop`?t.access_token:void 0});(class extends Error{static{Object.defineProperty(this,"mcpBrand",{value:`mcp.SseError`})}static[Symbol.hasInstance](e){return $r(this,e)}static isInstance(e){if(typeof this!=`function`)throw TypeError("isInstance must be called on the class (e.g. `SdkError.isInstance(value)`); for callbacks use `v => SdkError.isInstance(v)`");return $r(this,e)}constructor(e,t,n){super(`SSE error: ${t}`),this.code=e,this.event=n,Qr(this,new.target)}});var Cu=1,wu={initialReconnectionDelay:1e3,maxReconnectionDelay:3e4,reconnectionDelayGrowFactor:1.5,maxRetries:2},Tu=new Set([`authorization`,`dpop`,`content-type`,`mcp-protocol-version`,`mcp-method`,`mcp-name`,`mcp-session-id`]);function Eu(e,t){if(typeof AbortSignal.any==`function`)return AbortSignal.any([e,t]);let n=new AbortController;if(e.aborted)return n.abort(e.reason),n.signal;if(t.aborted)return n.abort(t.reason),n.signal;let r=()=>{e.removeEventListener(`abort`,i),t.removeEventListener(`abort`,a)};function i(){r(),n.abort(e.reason)}function a(){r(),n.abort(t.reason)}return e.addEventListener(`abort`,i,{once:!0}),t.addEventListener(`abort`,a,{once:!0}),n.signal}var Du=class{_abortController;_url;_resourceMetadataUrl;_scope;_requestInit;_authProvider;_oauthProvider;_skipIssuerMetadataValidation;_fetch;_fetchWithInit;_redirectPolicy;_sessionId;_reconnectionOptions;_protocolVersion;_onInsufficientScope;_maxStepUpRetries;_serverRetryMs;_reconnectionScheduler;_cancelReconnection;onclose;onerror;onmessage;hasPerRequestStream=!0;constructor(e,t){this._url=e,this._resourceMetadataUrl=void 0,this._scope=void 0,this._requestInit=t?.requestInit,this._skipIssuerMetadataValidation=t?.skipIssuerMetadataValidation,this._fetch=t?.fetch,Ic(t?.authProvider)?(this._oauthProvider=t.authProvider,this._authProvider=Rc(t.authProvider,{skipIssuerMetadataValidation:t.skipIssuerMetadataValidation}),t.authProvider.dpop&&(this._fetch=Su(t.authProvider)(t.fetch??fetch))):this._authProvider=t?.authProvider,this._redirectPolicy=t?.redirectPolicy,this._fetchWithInit=bs(t?.fetch,t?.requestInit),this._redirectPolicy===`follow`&&(this._fetchWithInit=Es(this._fetchWithInit)),this._sessionId=t?.sessionId,this._protocolVersion=t?.protocolVersion,this._reconnectionOptions=t?.reconnectionOptions??wu,this._reconnectionScheduler=t?.reconnectionScheduler,this._onInsufficientScope=t?.onInsufficientScope??`reauthorize`,this._maxStepUpRetries=Math.max(0,t?.maxStepUpRetries??Cu)}async _stepUpAuthorize(e,t){try{return await this._stepUpAuthorizeInner(e,t)}catch(e){throw Ll(e)}}async _stepUpAuthorizeInner(e,t){if(this._onInsufficientScope===`throw`||!this._oauthProvider)throw new Nc({requiredScope:e.scope,resourceMetadataUrl:e.resourceMetadataUrl,errorDescription:e.errorDescription});if(t>=this._maxStepUpRetries)throw new ni(J.ClientHttpForbidden,`Server returned 403 insufficient_scope after step-up re-authorization (retry limit ${this._maxStepUpRetries} reached)`,{status:403,statusText:e.statusText??`Forbidden`,text:e.text});e.resourceMetadataUrl&&(this._resourceMetadataUrl=e.resourceMetadataUrl);let n=await this._oauthProvider.tokens(),r=Hc(this._scope,n?.scope,e.scope);this._scope=r;let i=Uc(r,n?.scope);return al(this._oauthProvider,{serverUrl:this._url,resourceMetadataUrl:this._resourceMetadataUrl,scope:r,forceReauthorization:i,fetchFn:this._fetchWithInit,skipIssuerMetadataValidation:this._skipIssuerMetadataValidation})}_redirects(e){return this._redirectPolicy===`follow`?e:Ds(e)}_unfollowedRedirect(e,t){let n=this._redirectPolicy===`follow`?void 0:Os(e,t);return n&&`${n} (redirectPolicy: 'same-origin')`}async _commonHeaders(){let e=new Headers(this._requestInit?.headers||void 0),t;try{t=await this._authProvider?.token()}catch(e){throw Ll(e)}return t&&e.set(`Authorization`,`Bearer ${t}`),this._sessionId&&e.set(`mcp-session-id`,this._sessionId),this._protocolVersion&&e.set(`mcp-protocol-version`,this._protocolVersion),e}_applyBodyDerivedHeaders(e,t){if(Array.isArray(t)||!Ra(t))return;let n=t.params?._meta?.[Ne];if(typeof n!=`string`)return;e.set(`mcp-protocol-version`,n),e.set(`mcp-method`,t.method);let r=co(t.method,t.params);r?.value!==void 0&&e.set(`mcp-name`,io(r.value))}_isModernEnvelopedRequest(e){if(Array.isArray(e)||!Ra(e))return!1;let t=e.params?._meta?.[Ne];return typeof t==`string`&&ci(t)}async _startOrAuthSse(e,t=!1,n=0){let{resumptionToken:r,requestSignal:i}=e,a=()=>this._abortController?.signal.aborted===!0||i?.aborted===!0;try{let a=await this._commonHeaders(),o=[...a.get(`accept`)?.split(`,`).map(e=>e.trim().toLowerCase())??[],`text/event-stream`];a.set(`accept`,[...new Set(o)].join(`, `)),r&&a.set(`last-event-id`,r);let s=this._abortController?.signal,c=i!==void 0&&s!==void 0?Eu(s,i):i??s,l=await this._redirects(this._fetch??fetch)(this._url,{...this._requestInit,method:`GET`,headers:a,signal:c});if(!l.ok){if(l.status===401&&this._authProvider){if(l.headers.has(`www-authenticate`)){let{resourceMetadataUrl:e,scope:t}=dl(l);this._resourceMetadataUrl=e,this._scope=Hc(this._scope,t)}if(this._authProvider.onUnauthorized&&!t){try{await this._authProvider.onUnauthorized({response:l,serverUrl:this._url,fetchFn:this._fetchWithInit})}catch(e){throw Ll(e)}return await l.text?.().catch(()=>{}),this._startOrAuthSse(e,!0,n)}throw await l.text?.().catch(()=>{}),Ll(t?new ni(J.ClientHttpAuthentication,`Server returned 401 after re-authentication`,{status:401,statusText:l.statusText}):new zc)}if(l.status===403){let{resourceMetadataUrl:r,scope:i,error:a,errorDescription:o}=dl(l);if(a===`insufficient_scope`){let a=await l.text?.().catch(()=>null);if(await this._stepUpAuthorize({scope:i,resourceMetadataUrl:r,errorDescription:o,statusText:l.statusText,text:a},n)!==`AUTHORIZED`)throw Ll(new zc);return this._startOrAuthSse(e,t,n+1)}}if(await l.text?.().catch(()=>{}),l.status===405){e.onRequestStreamEnd?.();return}let r=this._unfollowedRedirect(this._url,l)??l.statusText;throw new ni(J.ClientHttpFailedToOpenStream,`Failed to open SSE stream: ${r}`,{status:l.status,statusText:l.statusText})}this._handleSseStream(l.body,e,!0)}catch(e){throw a()||this.onerror?.(e),e}}_getNextReconnectionDelay(e){if(this._serverRetryMs!==void 0)return this._serverRetryMs;let t=this._reconnectionOptions.initialReconnectionDelay,n=this._reconnectionOptions.reconnectionDelayGrowFactor,r=this._reconnectionOptions.maxReconnectionDelay;return Math.min(t*n**+e,r)}_scheduleReconnection(e,t=0){let n=this._reconnectionOptions.maxRetries;if(t>=n){this.onerror?.(Error(`Maximum reconnection attempts (${n}) exceeded.`)),e.onRequestStreamEnd?.();return}let r=this._getNextReconnectionDelay(t),i=()=>{this._cancelReconnection=void 0,!(this._abortController?.signal.aborted||e.requestSignal?.aborted)&&this._startOrAuthSse(e).catch(n=>{if(!(this._abortController?.signal.aborted||e.requestSignal?.aborted)){this.onerror?.(Error(`Failed to reconnect SSE stream: ${n instanceof Error?n.message:String(n)}`));try{this._scheduleReconnection(e,t+1)}catch(e){this.onerror?.(e instanceof Error?e:Error(String(e)))}}})};if(this._reconnectionScheduler){let e=this._reconnectionScheduler(i,r,t);this._cancelReconnection=typeof e==`function`?e:void 0}else{let e=setTimeout(i,r);this._cancelReconnection=()=>clearTimeout(e)}}_handleSseStream(e,t,n){if(!e){t.onRequestStreamEnd?.();return}let{onresumptiontoken:r,replayMessageId:i,requestSignal:a,onRequestStreamEnd:o}=t,s=()=>this._abortController?.signal.aborted===!0||a?.aborted===!0,c,l=!1,u=!1;(async()=>{try{let t=e.pipeThrough(new TextDecoderStream).pipeThrough(new Dc({onRetry:e=>{this._serverRetryMs=e}})).getReader();for(;;){let{value:e,done:n}=await t.read();if(n)break;if(e.id&&(c=e.id,l=!0,r?.(e.id)),e.data&&(!e.event||e.event===`message`))try{let t=$e.parse(JSON.parse(e.data));(Ba(t)||Va(t))&&(u=!0,i!==void 0&&(t.id=i)),this.onmessage?.(t)}catch(e){this.onerror?.(e)}}(n||l)&&!u&&this._abortController&&!s()?this._scheduleReconnection({resumptionToken:c,onresumptiontoken:r,replayMessageId:i,requestSignal:a,onRequestStreamEnd:o},0):s()||o?.()}catch(e){if(s())return;if(this.onerror?.(Error(`SSE stream disconnected: ${e}`)),(n||l)&&!u&&this._abortController&&!s())try{this._scheduleReconnection({resumptionToken:c,onresumptiontoken:r,replayMessageId:i,requestSignal:a,onRequestStreamEnd:o},0)}catch(e){this.onerror?.(Error(`Failed to reconnect: ${e instanceof Error?e.message:String(e)}`)),o?.()}else o?.()}})()}async start(){if(this._abortController)throw Error(`StreamableHTTPClientTransport already started! If using Client class, note that connect() calls start() automatically.`);this._abortController=new AbortController}async finishAuth(e,t){if(!this._oauthProvider)throw new zc(`finishAuth requires an OAuthClientProvider`);let{authorizationCode:n,iss:r}=await Wc(e,t,this._oauthProvider,this._url,{fetchFn:this._fetchWithInit,resourceMetadataUrl:this._resourceMetadataUrl});if(await al(this._oauthProvider,{serverUrl:this._url,authorizationCode:n,iss:r,resourceMetadataUrl:this._resourceMetadataUrl,scope:this._scope,fetchFn:this._fetchWithInit,skipIssuerMetadataValidation:this._skipIssuerMetadataValidation})!==`AUTHORIZED`)throw new zc(`Failed to authorize`)}async close(){try{this._cancelReconnection?.()}finally{this._cancelReconnection=void 0,this._abortController?.abort(),this.onclose?.()}}async send(e,t){return this._send(e,t,!1)}async _send(e,t,n,r=0){try{let{resumptionToken:i,onresumptiontoken:a}=t||{};if(i){this._startOrAuthSse({resumptionToken:i,replayMessageId:Ra(e)?e.id:void 0,requestSignal:t?.requestSignal}).catch(e=>this.onerror?.(e));return}let o=await this._commonHeaders();this._applyBodyDerivedHeaders(o,e);let s=Array.isArray(e)?e.some(e=>Ua(e)):Ua(e);if(s&&o.delete(`mcp-session-id`),t?.headers!==void 0)for(let[e,n]of Object.entries(t.headers))Tu.has(e.toLowerCase())||o.set(e,n);o.set(`content-type`,`application/json`);let c=[...o.get(`accept`)?.split(`,`).map(e=>e.trim().toLowerCase())??[],`application/json`,`text/event-stream`];o.set(`accept`,[...new Set(c)].join(`, `));let l=this._abortController?.signal,u=t?.requestSignal!==void 0&&l!==void 0?Eu(l,t.requestSignal):t?.requestSignal??l,d={...this._requestInit,method:`POST`,headers:o,body:JSON.stringify(e),signal:u},f=await this._redirects(this._fetch??fetch)(this._url,d);if(s&&f.ok&&(this._sessionId=f.headers.get(`mcp-session-id`)||void 0),!f.ok){if(f.status===401&&this._authProvider){if(f.headers.has(`www-authenticate`)){let{resourceMetadataUrl:e,scope:t}=dl(f);this._resourceMetadataUrl=e,this._scope=Hc(this._scope,t)}if(this._authProvider.onUnauthorized&&!n){try{await this._authProvider.onUnauthorized({response:f,serverUrl:this._url,fetchFn:this._fetchWithInit})}catch(e){throw Ll(e)}return await f.text?.().catch(()=>{}),this._send(e,t,!0,r)}throw await f.text?.().catch(()=>{}),Ll(n?new ni(J.ClientHttpAuthentication,`Server returned 401 after re-authentication`,{status:401,statusText:f.statusText}):new zc)}let i=await f.text?.().catch(()=>null);if(f.status===403){let{resourceMetadataUrl:a,scope:o,error:s,errorDescription:c}=dl(f);if(s===`insufficient_scope`){if(await this._stepUpAuthorize({scope:o,resourceMetadataUrl:a,errorDescription:c,statusText:f.statusText,text:i},r)!==`AUTHORIZED`)throw Ll(new zc);return this._send(e,t,n,r+1)}}if(f.status===400&&typeof i==`string`&&this._isModernEnvelopedRequest(e))try{let t=$e.parse(JSON.parse(i)),n=(Array.isArray(e)?e:[e]).filter(e=>Ra(e));if(Va(t)&&n.some(e=>e.id===t.id)){this.onmessage?.(t);return}}catch{}let a=this._unfollowedRedirect(this._url,f)??i;throw new ni(J.ClientHttpNotImplemented,`Error POSTing to endpoint: ${a}`,{status:f.status,statusText:f.statusText,text:i})}if(f.status===202){await f.text?.().catch(()=>{}),Wa(e)&&this._startOrAuthSse({resumptionToken:void 0}).catch(e=>this.onerror?.(e));return}let p=(Array.isArray(e)?e:[e]).some(e=>`method`in e&&`id`in e&&e.id!==void 0),m=f.headers.get(`content-type`),h=vs(m);if(p){if(h===`text/event-stream`)this._handleSseStream(f.body,{onresumptiontoken:a,requestSignal:t?.requestSignal,onRequestStreamEnd:t?.onRequestStreamEnd},!1);else if(h===`application/json`){let e=await f.json(),t=Array.isArray(e)?e.map(e=>$e.parse(e)):[$e.parse(e)];for(let e of t)this.onmessage?.(e)}else throw await f.text?.().catch(()=>{}),new Y(J.ClientHttpUnexpectedContent,`Unexpected content type: ${m}`,{contentType:m})}else await f.text?.().catch(()=>{})}catch(e){throw t?.requestSignal?.aborted!==!0&&this.onerror?.(e),e}}get sessionId(){return this._sessionId}async terminateSession(){if(this._sessionId)try{let e=await this._commonHeaders(),t={...this._requestInit,method:`DELETE`,headers:e,signal:this._abortController?.signal},n=await this._redirects(this._fetch??fetch)(this._url,t);if(await n.text?.().catch(()=>{}),!n.ok&&n.status!==405)throw new ni(J.ClientHttpFailedToTerminateSession,`Failed to terminate session: ${this._unfollowedRedirect(this._url,n)??n.statusText}`,{status:n.status,statusText:n.statusText});this._sessionId=void 0}catch(e){throw this.onerror?.(e),e}}setProtocolVersion(e){this._protocolVersion=e}get protocolVersion(){return this._protocolVersion}async resumeStream(e,t){await this._startOrAuthSse({resumptionToken:e,onresumptiontoken:t?.onresumptiontoken})}},Ou=class{_eventSlots=new Map;setHandler(e,t){let n=this._ensureEventSlot(e);n.onHandler&&t&&console.warn(`[MCP Apps] on${String(e)} handler replaced. Use addEventListener("${String(e)}", …) to add multiple listeners without replacing.`),n.onHandler=t}getHandler(e){return this._eventSlots.get(e)?.onHandler}addEventListener(e,t){this._ensureEventSlot(e).listeners.push(t)}removeEventListener(e,t){let n=this._eventSlots.get(e);if(!n)return;let r=n.listeners.indexOf(t);r!==-1&&n.listeners.splice(r,1)}dispatch(e,t){let n=this._eventSlots.get(e);if(n){n.onHandler?.(t);for(let e of[...n.listeners])e(t)}}_ensureEventSlot(e){let t=this._eventSlots.get(e);return t||(t={listeners:[]},this._eventSlots.set(e,t)),t}},ku=class{_methods=new Set;claim(e,t){if(this._methods.has(e))throw Error(`Handler for "${e}" already registered (via ${t}). Use addEventListener() to attach multiple listeners, or the on* setter for replace semantics.`);this._methods.add(e)}replace(e){this._methods.add(e)}release(e){this._methods.delete(e)}has(e){return this._methods.has(e)}},Au=new Set;function ju(e,t){let[n,r]=t,i=n?.shape;if(typeof i?.method?.value!=`string`)return;let a=i.method.value,o=e===`request`?`setRequestHandler`:`setNotificationHandler`;Au.has(o)||(Au.add(o),console.warn(`[ext-apps] ${o}(Schema, handler) is deprecated; use ${o}("${a}", { params: Schema.shape.params }, handler).`));let s=r;return[a,{params:i.params},e===`request`?(e,t)=>s({method:a,params:e},Mu(t)):e=>s({method:a,params:e})]}function Mu(e){return{signal:e.mcpReq.signal,requestId:e.mcpReq.id,sessionId:e.sessionId,_meta:e.mcpReq._meta,sendRequest:e.mcpReq.send,sendNotification:e.mcpReq.notify,authInfo:e.http?.authInfo}}var Nu=`2026-01-26`,Pu=S([w(`light`),w(`dark`)]).describe(`Color theme preference for the host environment.`),Fu=S([w(`inline`),w(`fullscreen`),w(`pip`)]).describe(`Display mode for UI presentation.`),Iu=S([w(`--color-background-primary`),w(`--color-background-secondary`),w(`--color-background-tertiary`),w(`--color-background-inverse`),w(`--color-background-ghost`),w(`--color-background-info`),w(`--color-background-danger`),w(`--color-background-success`),w(`--color-background-warning`),w(`--color-background-disabled`),w(`--color-text-primary`),w(`--color-text-secondary`),w(`--color-text-tertiary`),w(`--color-text-inverse`),w(`--color-text-ghost`),w(`--color-text-info`),w(`--color-text-danger`),w(`--color-text-success`),w(`--color-text-warning`),w(`--color-text-disabled`),w(`--color-border-primary`),w(`--color-border-secondary`),w(`--color-border-tertiary`),w(`--color-border-inverse`),w(`--color-border-ghost`),w(`--color-border-info`),w(`--color-border-danger`),w(`--color-border-success`),w(`--color-border-warning`),w(`--color-border-disabled`),w(`--color-ring-primary`),w(`--color-ring-secondary`),w(`--color-ring-inverse`),w(`--color-ring-info`),w(`--color-ring-danger`),w(`--color-ring-success`),w(`--color-ring-warning`),w(`--font-sans`),w(`--font-mono`),w(`--font-weight-normal`),w(`--font-weight-medium`),w(`--font-weight-semibold`),w(`--font-weight-bold`),w(`--font-text-xs-size`),w(`--font-text-sm-size`),w(`--font-text-md-size`),w(`--font-text-lg-size`),w(`--font-heading-xs-size`),w(`--font-heading-sm-size`),w(`--font-heading-md-size`),w(`--font-heading-lg-size`),w(`--font-heading-xl-size`),w(`--font-heading-2xl-size`),w(`--font-heading-3xl-size`),w(`--font-text-xs-line-height`),w(`--font-text-sm-line-height`),w(`--font-text-md-line-height`),w(`--font-text-lg-line-height`),w(`--font-heading-xs-line-height`),w(`--font-heading-sm-line-height`),w(`--font-heading-md-line-height`),w(`--font-heading-lg-line-height`),w(`--font-heading-xl-line-height`),w(`--font-heading-2xl-line-height`),w(`--font-heading-3xl-line-height`),w(`--border-radius-xs`),w(`--border-radius-sm`),w(`--border-radius-md`),w(`--border-radius-lg`),w(`--border-radius-xl`),w(`--border-radius-full`),w(`--border-width-regular`),w(`--shadow-hairline`),w(`--shadow-sm`),w(`--shadow-md`),w(`--shadow-lg`)]).describe(`CSS variable keys available to MCP apps for theming.`),Lu=j(Iu.describe(`Style variables for theming MCP apps. + +Individual style keys are optional - hosts may provide any subset of these values. +Values are strings containing CSS values (colors, sizes, font stacks, etc.). + +Note: This type uses \`Record\` rather than \`Partial>\` +for compatibility with Zod schema generation. Both are functionally equivalent for validation.`),S([P(),oe()]).describe(`Style variables for theming MCP apps. + +Individual style keys are optional - hosts may provide any subset of these values. +Values are strings containing CSS values (colors, sizes, font stacks, etc.). + +Note: This type uses \`Record\` rather than \`Partial>\` +for compatibility with Zod schema generation. Both are functionally equivalent for validation.`)).describe(`Style variables for theming MCP apps. + +Individual style keys are optional - hosts may provide any subset of these values. +Values are strings containing CSS values (colors, sizes, font stacks, etc.). + +Note: This type uses \`Record\` rather than \`Partial>\` +for compatibility with Zod schema generation. Both are functionally equivalent for validation.`),Ru=D({method:w(`ui/open-link`),params:D({url:P().describe(`URL to open in the host's browser`)})}),zu=D({isError:k().optional().describe(`True if the host failed to open the URL (e.g., due to security policy).`)}).passthrough(),Bu=D({isError:k().optional().describe(`True if the download failed (e.g., user cancelled or host denied).`)}).passthrough(),Vu=D({isError:k().optional().describe(`True if the host rejected or failed to deliver the message.`)}).passthrough(),Hu=D({method:w(`ui/notifications/sandbox-proxy-ready`),params:D({})}),Uu=D({connectDomains:x(P()).optional().describe(`Origins for network requests (fetch/XHR/WebSocket). + +- Maps to CSP \`connect-src\` directive +- Empty or omitted → no network connections (secure default)`),resourceDomains:x(P()).optional().describe("Origins for static resources (images, scripts, stylesheets, fonts, media).\n\n- Maps to CSP `img-src`, `script-src`, `style-src`, `font-src`, `media-src` directives\n- Wildcard subdomains supported: `https://*.example.com`\n- Empty or omitted → no network resources (secure default)"),frameDomains:x(P()).optional().describe("Origins for nested iframes.\n\n- Maps to CSP `frame-src` directive\n- Empty or omitted → no nested iframes allowed (`frame-src 'none'`)"),baseUriDomains:x(P()).optional().describe("Allowed base URIs for the document.\n\n- Maps to CSP `base-uri` directive\n- Empty or omitted → only same origin allowed (`base-uri 'self'`)")}),Wu=D({camera:D({}).optional().describe(`Request camera access. + +Maps to Permission Policy \`camera\` feature.`),microphone:D({}).optional().describe(`Request microphone access. + +Maps to Permission Policy \`microphone\` feature.`),geolocation:D({}).optional().describe(`Request geolocation access. + +Maps to Permission Policy \`geolocation\` feature.`),clipboardWrite:D({}).optional().describe(`Request clipboard write access. + +Maps to Permission Policy \`clipboard-write\` feature.`)}),Gu=D({method:w(`ui/notifications/size-changed`),params:D({width:O().optional().describe(`New width in pixels.`),height:O().optional().describe(`New height in pixels.`)})});D({method:w(`ui/notifications/tool-input`),params:D({arguments:j(P(),N().describe(`Complete tool call arguments as key-value pairs.`)).optional().describe(`Complete tool call arguments as key-value pairs.`)})}),D({method:w(`ui/notifications/tool-input-partial`),params:D({arguments:j(P(),N().describe(`Partial tool call arguments (incomplete, may change).`)).optional().describe(`Partial tool call arguments (incomplete, may change).`)})}),D({method:w(`ui/notifications/tool-cancelled`),params:D({reason:P().optional().describe(`Optional reason for the cancellation (e.g., "user action", "timeout").`)})});var Ku=D({fonts:P().optional()}),qu=D({variables:Lu.optional().describe(`CSS variables for theming the app.`),css:Ku.optional().describe(`CSS blocks that apps can inject.`)});D({method:w(`ui/resource-teardown`),params:D({})});var Ju=j(P(),N()),Yu=D({text:D({}).optional().describe(`Host supports text content blocks.`),image:D({}).optional().describe(`Host supports image content blocks.`),audio:D({}).optional().describe(`Host supports audio content blocks.`),resource:D({}).optional().describe(`Host supports resource content blocks.`),resourceLink:D({}).optional().describe(`Host supports resource link content blocks.`),structuredContent:D({}).optional().describe(`Host supports structured content.`)}),Xu=D({method:w(`ui/notifications/request-teardown`),params:D({}).optional()}),Zu=D({experimental:j(P(),j(P(),ne()).describe(`Experimental features keyed by identifier.`)).optional().describe(`Experimental features keyed by identifier.`),openLinks:D({}).optional().describe(`Host supports opening external URLs.`),downloadFile:D({}).optional().describe(`Host supports file downloads via ui/download-file.`),serverTools:D({listChanged:k().optional().describe(`Host supports tools/list_changed notifications.`)}).optional().describe(`Host can proxy tool calls to the MCP server.`),serverResources:D({listChanged:k().optional().describe(`Host supports resources/list_changed notifications.`)}).optional().describe(`Host can proxy resource reads to the MCP server.`),logging:D({}).optional().describe(`Host accepts log messages.`),sandbox:D({permissions:Wu.optional().describe(`Permissions granted by the host (camera, microphone, geolocation).`),csp:Uu.optional().describe(`CSP domains approved by the host.`)}).optional().describe(`Sandbox configuration applied by the host.`),updateModelContext:Yu.optional().describe(`Host accepts context updates (ui/update-model-context) to be included in the model's context for future turns.`),message:Yu.optional().describe(`Host supports receiving content messages (ui/message) from the view.`),sampling:D({tools:D({}).optional().describe("Host supports tool use via `tools` and `toolChoice` parameters.")}).optional().describe("Host supports LLM sampling (sampling/createMessage) from the view.\nMirrors the MCP `ClientCapabilities.sampling` shape so hosts can pass it through.")}),Qu=D({experimental:j(P(),j(P(),ne()).describe(`Experimental features keyed by identifier.`)).optional().describe(`Experimental features keyed by identifier.`),tools:D({listChanged:k().optional().describe(`App supports tools/list_changed notifications.`)}).optional().describe(`App exposes MCP-style tools that the host can call.`),availableDisplayModes:x(Fu).optional().describe(`Display modes the app supports.`)}),$u=D({method:w(`ui/notifications/initialized`),params:D({}).optional()});D({csp:Uu.optional().describe(`Content Security Policy configuration for UI resources.`),permissions:Wu.optional().describe(`Sandbox permissions requested by the UI resource.`),domain:P().optional().describe(`Dedicated origin for view sandbox. + +Useful when views need stable, dedicated origins for OAuth callbacks, CORS policies, or API key allowlists. + +**Host-dependent:** The format and validation rules for this field are determined by each host. Servers MUST consult host-specific documentation for the expected domain format. Common patterns include: +- Hash-based subdomains (e.g., \`{hash}.claudemcpcontent.com\`) +- URL-derived subdomains (e.g., \`www-example-com.oaiusercontent.com\`) + +If omitted, host uses default sandbox origin (typically per-conversation).`),prefersBorder:k().optional().describe(`Visual boundary preference - true if view prefers a visible border. + +Boolean requesting whether a visible border and background is provided by the host. Specifying an explicit value for this is recommended because hosts' defaults may vary. + +- \`true\`: request visible border + background +- \`false\`: request no visible border + background +- omitted: host decides border`)});var ed=D({method:w(`ui/request-display-mode`),params:D({mode:Fu.describe(`The display mode being requested.`)})}),td=D({mode:Fu.describe(`The display mode that was actually set. May differ from requested if not supported.`)}).passthrough(),nd=S([w(`model`),w(`app`)]).describe(`Tool visibility scope - who can access the tool.`);D({resourceUri:P().optional(),visibility:x(nd).optional().describe(`Who can access this tool. Default: ["model", "app"] +- "model": Tool visible to and callable by the agent +- "app": Tool callable by the app from this server only`),csp:ae().optional(),permissions:ae().optional()}),D({mimeTypes:x(P()).optional().describe('Array of supported MIME types for UI resources.\nMust include `"text/html;profile=mcp-app"` for MCP Apps support.')});var rd=D({method:w(`ui/download-file`),params:D({contents:x(S([dn,fn])).describe(`Resource contents to download — embedded (inline data) or linked (host fetches). Uses standard MCP resource types.`)})}),id=D({method:w(`ui/message`),params:D({role:w(`user`).describe(`Message role, currently only "user" is supported.`),content:x(pn).describe(`Message content blocks (text, image, etc.).`)})});D({method:w(`ui/notifications/sandbox-resource-ready`),params:D({html:P().describe(`HTML content to load into the inner iframe.`),sandbox:P().optional().describe(`Optional override for the inner iframe's sandbox attribute.`),csp:Uu.optional().describe(`CSP configuration from resource metadata.`),permissions:Wu.optional().describe(`Sandbox permissions from resource metadata.`)})}),D({method:w(`ui/notifications/tool-result`),params:Sn.describe(`Standard MCP tool execution result.`)});var ad=D({toolInfo:D({id:Je.optional().describe(`JSON-RPC id of the tools/call request.`),tool:yn.describe(`Tool definition including name, inputSchema, etc.`)}).optional().describe(`Metadata of the tool call that instantiated this App.`),theme:Pu.optional().describe(`Current color theme preference.`),styles:qu.optional().describe(`Style configuration for theming the app.`),displayMode:Fu.optional().describe(`How the UI is currently displayed.`),availableDisplayModes:x(Fu).optional().describe(`Display modes the host supports.`),containerDimensions:S([D({height:O().describe(`Fixed container height in pixels.`)}),D({maxHeight:S([O(),oe()]).optional().describe(`Maximum container height in pixels.`)})]).and(S([D({width:O().describe(`Fixed container width in pixels.`)}),D({maxWidth:S([O(),oe()]).optional().describe(`Maximum container width in pixels.`)})])).optional().describe(`Container dimensions. Represents the dimensions of the iframe or other +container holding the app. Specify either width or maxWidth, and either height or maxHeight.`),locale:P().optional().describe(`User's language and region preference in BCP 47 format.`),timeZone:P().optional().describe(`User's timezone in IANA format.`),userAgent:P().optional().describe(`Host application identifier.`),platform:S([w(`web`),w(`desktop`),w(`mobile`)]).optional().describe(`Platform type for responsive design decisions.`),deviceCapabilities:D({touch:k().optional().describe(`Whether the device supports touch input.`),hover:k().optional().describe(`Whether the device supports hover interactions.`)}).optional().describe(`Device input capabilities.`),safeAreaInsets:D({top:O().describe(`Top safe area inset in pixels.`),right:O().describe(`Right safe area inset in pixels.`),bottom:O().describe(`Bottom safe area inset in pixels.`),left:O().describe(`Left safe area inset in pixels.`)}).optional().describe(`Mobile safe area boundaries in pixels.`)}).passthrough();D({method:w(`ui/notifications/host-context-changed`),params:ad.describe(`Partial context update containing only changed fields.`)});var od=D({method:w(`ui/update-model-context`),params:D({content:x(pn).optional().describe(`Context content blocks (text, image, etc.).`),structuredContent:j(P(),N().describe(`Structured content for machine-readable context data.`)).optional().describe(`Structured content for machine-readable context data.`)})}),sd=D({method:w(`ui/initialize`),params:D({appInfo:W.describe(`App identification (name and version).`),appCapabilities:Qu.describe(`Features and capabilities this app provides.`),protocolVersion:P().describe(`Protocol version this app supports.`)})}),cd=D({protocolVersion:P().describe(`Negotiated protocol version string (e.g., "2025-11-21").`),hostInfo:W.describe(`Host application identification and version.`),hostCapabilities:Zu.describe(`Features and capabilities provided by the host.`),hostContext:ad.describe(`Rich context about the host environment.`)}).passthrough(),ld=class{eventTarget;eventSource;messageListener;constructor(e=window.parent,t){this.eventTarget=e,this.eventSource=t,this.messageListener=e=>{if(t&&e.source!==this.eventSource){console.debug(`Ignoring message from unknown source`,e);return}let n=$e.safeParse(e.data);n.success?(console.debug(`Parsed message`,n.data),this.onmessage?.(n.data)):e.data?.jsonrpc===`2.0`?(console.error(`Failed to parse message`,n.error.message,e),this.onerror?.(Error(`Invalid JSON-RPC message received: `+n.error.message))):console.debug(`Ignoring non-JSON-RPC message`,n.error.message,e)}}async start(){window.addEventListener(`message`,this.messageListener)}async send(e,t){e.method!==`ui/notifications/tool-input-partial`&&console.debug(`Sending message`,e),this.eventTarget.postMessage(e,`*`)}async close(){window.removeEventListener(`message`,this.messageListener),this.onclose?.()}onclose;onerror;onmessage;sessionId;setProtocolVersion},ud=[Nu],dd=class extends os{_client;_hostInfo;_hostCapabilities;_appCapabilities;_hostContext={};_appInfo;_initializedReceived=!1;_registeredEvents=new Set;_events=new Ou;_methods=new ku;setRequestHandler=(...e)=>{let[t,...n]=ju(`request`,e)??e;this._methods.claim(t,`setRequestHandler`),super.setRequestHandler.call(this,t,...n)};setNotificationHandler=(...e)=>{let[t,...n]=ju(`notification`,e)??e;this._methods.claim(t,`setNotificationHandler`),super.setNotificationHandler.call(this,t,...n)};removeRequestHandler=e=>{this._methods.release(e),super.removeRequestHandler(e)};removeNotificationHandler=e=>{this._methods.release(e),super.removeNotificationHandler(e)};replaceRequestHandler=(e,...t)=>{this._methods.replace(e),super.setRequestHandler.call(this,e,...t)};_wrapHandler(e,t){let n=super._wrapHandler(e,t);return e===`ui/initialize`||e===`ping`?n:async(t,r)=>(this._initializedReceived||console.warn(`[ext-apps] AppBridge received '${e}' before ui/notifications/initialized. The View is calling host methods before completing the handshake; it should await app.connect() first.`),n(t,r))}eventSchemas={sizechange:Gu,sandboxready:Hu,initialized:$u,requestteardown:Xu,loggingmessage:Mn};setEventHandler(e,t){this._ensureEventSlot(e),this._events.setHandler(e,t)}getEventHandler(e){return this._events.getHandler(e)}addEventListener(e,t){this._ensureEventSlot(e),this._events.addEventListener(e,t)}removeEventListener(e,t){this._events.removeEventListener(e,t)}_ensureEventSlot(e){if(this._registeredEvents.has(e))return;let t=this.eventSchemas[e];if(!t)throw Error(`Unknown event: ${String(e)}`);let n=t=>{e===`initialized`&&(this._initializedReceived=!0),this._events.dispatch(e,t)};e===`loggingmessage`?this.setNotificationHandler(`notifications/message`,e=>{n(e.params)}):this.setNotificationHandler(t.shape.method.value,{params:t.shape.params},e=>n(e)),this._registeredEvents.add(e)}warnIfRequestHandlerReplaced(e,t,n){t&&n&&console.warn(`[MCP Apps] ${e} handler replaced. Previous handler will no longer be called.`)}constructor(e,t,n,r){super(r),this._client=e,this._hostInfo=t,this._hostCapabilities=n,this._methods.replace(`notifications/cancelled`),this._methods.replace(`notifications/progress`),this._ensureEventSlot(`initialized`),this._hostContext=r?.hostContext||{},this.replaceRequestHandler(`ui/initialize`,{params:sd.shape.params,result:cd},e=>this._onAppsInitialize(e)),this.replaceRequestHandler(`ping`,(e,t)=>(this.onping?.(e.params,t),{})),this.replaceRequestHandler(`ui/request-display-mode`,{params:ed.shape.params,result:td},()=>({mode:this._hostContext.displayMode??`inline`}))}buildContext(e){return e}assertCapabilityForMethod(e){}assertRequestHandlerCapability(e){}assertNotificationCapability(e){}getAppCapabilities(){return this._appCapabilities}getAppVersion(){return this._appInfo}onping;get onsizechange(){return this.getEventHandler(`sizechange`)}set onsizechange(e){this.setEventHandler(`sizechange`,e)}get onsandboxready(){return this.getEventHandler(`sandboxready`)}set onsandboxready(e){this.setEventHandler(`sandboxready`,e)}get oninitialized(){return this.getEventHandler(`initialized`)}set oninitialized(e){this.setEventHandler(`initialized`,e)}_onmessage;get onmessage(){return this._onmessage}set onmessage(e){this.warnIfRequestHandlerReplaced(`onmessage`,this._onmessage,e),this._onmessage=e,this.replaceRequestHandler(`ui/message`,{params:id.shape.params,result:Vu},async(e,t)=>{if(!this._onmessage)throw Error(`No onmessage handler set`);return this._onmessage(e,t)})}_onopenlink;get onopenlink(){return this._onopenlink}set onopenlink(e){this.warnIfRequestHandlerReplaced(`onopenlink`,this._onopenlink,e),this._onopenlink=e,this.replaceRequestHandler(`ui/open-link`,{params:Ru.shape.params,result:zu},async(e,t)=>{if(!this._onopenlink)throw Error(`No onopenlink handler set`);return this._onopenlink(e,t)})}_ondownloadfile;get ondownloadfile(){return this._ondownloadfile}set ondownloadfile(e){this.warnIfRequestHandlerReplaced(`ondownloadfile`,this._ondownloadfile,e),this._ondownloadfile=e,this.replaceRequestHandler(`ui/download-file`,{params:rd.shape.params,result:Bu},async(e,t)=>{if(!this._ondownloadfile)throw Error(`No ondownloadfile handler set`);return this._ondownloadfile(e,t)})}get onrequestteardown(){return this.getEventHandler(`requestteardown`)}set onrequestteardown(e){this.setEventHandler(`requestteardown`,e)}_onrequestdisplaymode;get onrequestdisplaymode(){return this._onrequestdisplaymode}set onrequestdisplaymode(e){this.warnIfRequestHandlerReplaced(`onrequestdisplaymode`,this._onrequestdisplaymode,e),this._onrequestdisplaymode=e,this.replaceRequestHandler(`ui/request-display-mode`,{params:ed.shape.params,result:td},async(e,t)=>{if(!this._onrequestdisplaymode)throw Error(`No onrequestdisplaymode handler set`);return this._onrequestdisplaymode(e,t)})}get onloggingmessage(){return this.getEventHandler(`loggingmessage`)}set onloggingmessage(e){this.setEventHandler(`loggingmessage`,e)}_onupdatemodelcontext;get onupdatemodelcontext(){return this._onupdatemodelcontext}set onupdatemodelcontext(e){this.warnIfRequestHandlerReplaced(`onupdatemodelcontext`,this._onupdatemodelcontext,e),this._onupdatemodelcontext=e,this.replaceRequestHandler(`ui/update-model-context`,{params:od.shape.params,result:tt},async(e,t)=>{if(!this._onupdatemodelcontext)throw Error(`No onupdatemodelcontext handler set`);return this._onupdatemodelcontext(e,t)})}_oncalltool;get oncalltool(){return this._oncalltool}set oncalltool(e){this.warnIfRequestHandlerReplaced(`oncalltool`,this._oncalltool,e),this._oncalltool=e,this.replaceRequestHandler(`tools/call`,async(e,t)=>{if(!this._oncalltool)throw Error(`No oncalltool handler set`);return this._oncalltool(e.params,t)})}_oncreatesamplingmessage;get oncreatesamplingmessage(){return this._oncreatesamplingmessage}set oncreatesamplingmessage(e){this.warnIfRequestHandlerReplaced(`oncreatesamplingmessage`,this._oncreatesamplingmessage,e),this._oncreatesamplingmessage=e,this.replaceRequestHandler(`sampling/createMessage`,async(e,t)=>{if(!this._oncreatesamplingmessage)throw Error(`No oncreatesamplingmessage handler set`);return this._oncreatesamplingmessage(e.params,t)})}sendToolListChanged(e={}){return this.notification({method:`notifications/tools/list_changed`,params:e})}_onlistresources;get onlistresources(){return this._onlistresources}set onlistresources(e){this.warnIfRequestHandlerReplaced(`onlistresources`,this._onlistresources,e),this._onlistresources=e,this.replaceRequestHandler(`resources/list`,async(e,t)=>{if(!this._onlistresources)throw Error(`No onlistresources handler set`);return this._onlistresources(e.params,t)})}_onlistresourcetemplates;get onlistresourcetemplates(){return this._onlistresourcetemplates}set onlistresourcetemplates(e){this.warnIfRequestHandlerReplaced(`onlistresourcetemplates`,this._onlistresourcetemplates,e),this._onlistresourcetemplates=e,this.replaceRequestHandler(`resources/templates/list`,async(e,t)=>{if(!this._onlistresourcetemplates)throw Error(`No onlistresourcetemplates handler set`);return this._onlistresourcetemplates(e.params,t)})}_onreadresource;get onreadresource(){return this._onreadresource}set onreadresource(e){this.warnIfRequestHandlerReplaced(`onreadresource`,this._onreadresource,e),this._onreadresource=e,this.replaceRequestHandler(`resources/read`,async(e,t)=>{if(!this._onreadresource)throw Error(`No onreadresource handler set`);return this._onreadresource(e.params,t)})}sendResourceListChanged(e={}){return this.notification({method:`notifications/resources/list_changed`,params:e})}_onlistprompts;get onlistprompts(){return this._onlistprompts}set onlistprompts(e){this.warnIfRequestHandlerReplaced(`onlistprompts`,this._onlistprompts,e),this._onlistprompts=e,this.replaceRequestHandler(`prompts/list`,async(e,t)=>{if(!this._onlistprompts)throw Error(`No onlistprompts handler set`);return this._onlistprompts(e.params,t)})}sendPromptListChanged(e={}){return this.notification({method:`notifications/prompts/list_changed`,params:e})}getCapabilities(){return this._hostCapabilities}async _onAppsInitialize(e){let t=e.protocolVersion;return this._appInfo!==void 0&&console.warn(`[ext-apps] AppBridge received a second ui/initialize. The View may be double-mounting (e.g. React StrictMode in dev) without closing the previous App instance. Responding normally; the latest appInfo/appCapabilities replace the previous values.`),this._appCapabilities=e.appCapabilities,this._appInfo=e.appInfo,{protocolVersion:ud.includes(t)?t:Nu,hostCapabilities:this.getCapabilities(),hostInfo:this._hostInfo,hostContext:this._hostContext}}setHostContext(e){let t={},n=!1;for(let r of Object.keys(e)){let i=this._hostContext[r],a=e[r];fd(i,a)||(t[r]=a,n=!0)}n&&(this._hostContext=e,this.sendHostContextChange(t))}sendHostContextChange(e){return this.notification({method:`ui/notifications/host-context-changed`,params:e})}sendToolInput(e){return this.notification({method:`ui/notifications/tool-input`,params:e})}sendToolInputPartial(e){return this.notification({method:`ui/notifications/tool-input-partial`,params:e})}sendToolResult(e){return this.notification({method:`ui/notifications/tool-result`,params:e})}sendToolCancelled(e){return this.notification({method:`ui/notifications/tool-cancelled`,params:e})}sendSandboxResourceReady(e){return this.notification({method:`ui/notifications/sandbox-resource-ready`,params:e})}teardownResource(e,t){return this.request({method:`ui/resource-teardown`,params:e},Ju,t)}sendResourceTeardown=this.teardownResource;callTool(e,t){return this.request({method:`tools/call`,params:e},t)}listTools(e,t){return this.request({method:`tools/list`,params:e},t)}async connect(e){if(this.transport)throw Error(`AppBridge is already connected. Call close() before connecting again.`);if(this._initializedReceived=!1,this._client){let e=this._client.getServerCapabilities();if(!e)throw Error(`Client server capabilities not available`);e.tools&&(this.oncalltool=async(e,t)=>this._client.request({method:`tools/call`,params:e},{signal:t.mcpReq.signal}),e.tools.listChanged&&this._client.setNotificationHandler(`notifications/tools/list_changed`,e=>this.sendToolListChanged(e.params))),e.resources&&(this.onlistresources=async(e,t)=>this._client.request({method:`resources/list`,params:e},{signal:t.mcpReq.signal}),this.onlistresourcetemplates=async(e,t)=>this._client.request({method:`resources/templates/list`,params:e},{signal:t.mcpReq.signal}),this.onreadresource=async(e,t)=>this._client.request({method:`resources/read`,params:e},{signal:t.mcpReq.signal}),e.resources.listChanged&&this._client.setNotificationHandler(`notifications/resources/list_changed`,e=>this.sendResourceListChanged(e.params))),e.prompts&&(this.onlistprompts=async(e,t)=>this._client.request({method:`prompts/list`,params:e},{signal:t.mcpReq.signal}),e.prompts.listChanged&&this._client.setNotificationHandler(`notifications/prompts/list_changed`,e=>this.sendPromptListChanged(e.params)))}return super.connect(e)}};function fd(e,t){return JSON.stringify(e)===JSON.stringify(t)}var $=n(e(),1),pd=t(),md=`text/html;profile=mcp-app`,hd=`io.modelcontextprotocol/ui`,gd=3,_d=5,vd=2e3,yd=class extends Error{},bd=null,xd=null;async function Sd(){let e=new Du(new URL(`/api/mcp`,location.origin),{fetch:(e,t)=>_(e,t)}),t=new vu({name:`fanout-browser`,version:`0.2.0`},{capabilities:{extensions:{[hd]:{mimeTypes:[md]}}}});try{await t.connect(e);let n={client:t,tools:t.listTools(),references:0,closed:!1,closeListeners:new Set};return n.tools.catch(()=>void 0),t.onclose=()=>wd(n,!1),t.onerror=()=>wd(n,!0),n}catch(t){throw await e.close().catch(()=>void 0),t}}async function Cd(){for(let e=0;e{xd===e&&!t.closed&&(bd=t)}).catch(()=>{xd===e&&(xd=null)})}let e=xd;if(!e)continue;let t=await e;if(t.closed){xd===e&&(xd=null);continue}return t.closeTimer&&=(clearTimeout(t.closeTimer),void 0),t.references+=1,t}throw Error(`MCP connection closed during setup`)}function wd(e,t){if(!e.closed){e.closed=!0,e.closeTimer&&clearTimeout(e.closeTimer),e.closeTimer=void 0,bd===e&&(bd=null),xd=null;for(let t of[...e.closeListeners])t();t&&e.client.close().catch(()=>void 0)}}function Td(e){e.references=Math.max(0,e.references-1),!(e.closed||e.references||e.closeTimer)&&(e.closeTimer=setTimeout(()=>{e.closeTimer=void 0,!(e.references||bd!==e)&&(e.closed=!0,bd=null,xd=null,e.client.close().catch(()=>void 0))},0))}function Ed(e){return typeof e==`object`&&e&&!Array.isArray(e)?e:void 0}var Dd=new Map;async function Od(e,t){let n=Dd.get(t);if(n&&n.expires>Date.now())return n.pending;let r={pending:Promise.resolve({text:``}),expires:1/0};return r.pending=e.readResource({uri:t}).then(e=>{let n=e.contents[0];if(e.contents.length!==1||!n||!(`text`in n)||!n.text)throw new yd(`MCP App resource has no HTML content`);if(n.uri!==t)throw new yd(`MCP App resource URI does not match the requested URI`);if(n.mimeType!==md)throw new yd(`MCP App resource has an unsupported MIME type`);let i=Ed(e)?.ttlMs;return r.expires=Date.now()+(typeof i==`number`&&i>0?i:3e5),{text:n.text,_meta:n._meta}}).catch(e=>{throw Dd.get(t)===r&&Dd.delete(t),e}),Dd.set(t,r),r.pending}function kd(e,t){let n=``;return/]*)?>/i.test(e)?e.replace(/]*)?>/i,e=>`${e}${n}`):/]*)?>/i.test(e)?e.replace(/]*)?>/i,e=>`${e}${n}`):`${n}${e}`}function Ad({content:e}){let t=l(e);return t?(0,pd.jsx)(jd,{content:t}):(0,pd.jsx)(o,{color:`bad`,m:`md`,children:`This view could not be loaded. Please try again.`})}function jd({content:e}){let t=(0,$.useRef)(null),n=(0,$.useRef)(null),l=(0,$.useRef)(null),u=(0,$.useRef)(null),[f,p]=(0,$.useState)(``),[m,h]=(0,$.useState)(`inline`),g=(0,$.useRef)(null),_=(0,$.useRef)(m);_.current=m;let y=e=>{h(e),u.current?.setHostContext({theme:E.current,displayMode:e,availableDisplayModes:[`inline`,`fullscreen`]}),e===`inline`&&document.activeElement!==t.current&&t.current?.focus()};(0,$.useEffect)(()=>{if(m!==`fullscreen`)return;g.current?.focus();let e=document.body.style.overflow;document.body.style.overflow=`hidden`;let n=e=>{e.key===`Escape`&&(e.preventDefault(),y(`inline`))},r=e=>{t.current?.parentElement?.contains(e.target)||g.current?.focus()};return window.addEventListener(`keydown`,n),document.addEventListener(`focusin`,r),()=>{document.body.style.overflow=e,window.removeEventListener(`keydown`,n),document.removeEventListener(`focusin`,r)}},[m]);let[b,ee]=(0,$.useState)(240),[x,S]=(0,$.useState)(``),[C,w]=(0,$.useState)(0),te=(0,$.useRef)(0),T=d(`light`),E=(0,$.useRef)(T);E.current=T,(0,$.useEffect)(()=>{u.current?.setHostContext({theme:T,displayMode:_.current,availableDisplayModes:[`inline`,`fullscreen`]})},[T]),(0,$.useEffect)(()=>{te.current=0},[e.resource_uri]),(0,$.useEffect)(()=>{let t=!1,r;h(`inline`),p(``),S(``);let i=()=>{let e=te.current+1;if(e>_d)return;te.current=e;let t=e===1?0:Math.min(750*2**(e-2),6e3);t===0?w(e=>e+1):r=setTimeout(()=>w(e=>e+1),t)},a=()=>i();async function o(){try{let r=await Cd();if(t){Td(r);return}l.current=r,r.closeListeners.add(a),n.current=r.client;let i=await Od(r.client,e.resource_uri);await r.tools,t||(te.current=0,p(kd(i.text,i._meta)))}catch(e){console.error(`MCP app resource load failed`,e),t||(S(`This view could not be loaded. Please try again.`),te.current>0&&!(e instanceof yd)&&i())}}return o(),()=>{t=!0,r&&clearTimeout(r);let e=u.current?.teardownResource({}).catch(()=>void 0)??Promise.resolve(),i=l.current;i&&(i.closeListeners.delete(a),e.finally(()=>Td(i))),u.current=null,n.current=null,l.current=null}},[e.resource_uri,C]);async function D(){let r=t.current,i=n.current;if(r?.contentWindow&&f&&i&&!u.current)try{let t=new dd(null,{name:`Fanout`,version:`0.2.0`},{serverTools:{},logging:{}},{hostContext:{theme:E.current,displayMode:`inline`,availableDisplayModes:[`inline`,`fullscreen`]}}),n=l.current;if(!n)throw Error(`MCP connection unavailable`);t.oncalltool=async(e,t)=>{let r=Ed(Ed((await n.tools).tools.find(t=>t.name===e.name)?._meta)?.ui)?.visibility;if(!Array.isArray(r)||!r.includes(`app`)||/^(?:create|edit|replace|restore|delete)_/.test(e.name))throw Error(`This tool is unavailable in the app`);return i.callTool(e,{signal:t.mcpReq.signal})},t.onrequestdisplaymode=async({mode:e})=>e!==`inline`&&e!==`fullscreen`?{mode:_.current}:(y(e),{mode:e}),u.current=t,t.onsizechange=({height:e})=>{e&&ee(Math.min(vd,Math.max(240,Math.round(e))))},t.onmessage=async()=>({isError:!0}),t.oninitialized=async()=>{await t.sendToolInput({arguments:e.tool_input??{}}),await t.sendToolResult({content:[{type:`text`,text:JSON.stringify(e.tool_result??{})}],structuredContent:e.tool_result,isError:e.is_error})},await t.connect(new ld(r.contentWindow,r.contentWindow))}catch(e){console.error(`MCP app bridge connect failed`,e),S(`This view could not be loaded. Please try again.`)}}return x?(0,pd.jsx)(o,{color:`bad`,m:`md`,children:x}):f?(0,pd.jsx)(v,{active:m===`fullscreen`,children:(0,pd.jsxs)(r,{"data-app-fullscreen":m===`fullscreen`?``:void 0,role:m===`fullscreen`?`dialog`:void 0,"aria-modal":m===`fullscreen`||void 0,"aria-label":m===`fullscreen`?`Fanout analysis view`:void 0,bg:`var(--mantine-color-body)`,style:m===`fullscreen`?{position:`fixed`,inset:0,zIndex:1e3,display:`flex`,flexDirection:`column`}:void 0,children:[m===`fullscreen`&&(0,pd.jsx)(r,{p:`xs`,ta:`right`,children:(0,pd.jsx)(i,{ref:g,"data-autofocus":!0,size:`compact-sm`,variant:`default`,"aria-label":`Close analysis view`,onClick:()=>y(`inline`),children:`Close`})}),(0,pd.jsx)(r,{component:`iframe`,tabIndex:0,ref:t,title:`Fanout analysis view`,sandbox:`allow-scripts`,scrolling:`auto`,srcDoc:f,w:`100%`,bd:0,bg:`var(--mantine-color-body)`,style:{display:`block`,height:m===`fullscreen`?`100%`:b,...m===`fullscreen`?{flex:`1 1 0`,minHeight:0}:{}},onLoad:()=>void D()})]})}):(0,pd.jsxs)(s,{mih:180,p:`xl`,children:[(0,pd.jsx)(c,{size:`sm`}),(0,pd.jsx)(a,{c:`dimmed`,size:`sm`,ml:`sm`,children:`Preparing view…`})]})}export{Ad as default}; \ No newline at end of file diff --git a/internal/ui/dist/assets/mcp-app-frame-tweTxib0.js b/internal/ui/dist/assets/mcp-app-frame-tweTxib0.js deleted file mode 100644 index 1c645027d..000000000 --- a/internal/ui/dist/assets/mcp-app-frame-tweTxib0.js +++ /dev/null @@ -1,57 +0,0 @@ -import{i as e,r as t,s as n}from"./useRouter-ByJ6_rwb.js";import{C as r,d as i,f as a,p as o,u as s,y as c}from"./brand-Bcp2Tp5I.js";import{t as l}from"./use-computed-color-scheme-BIja2o3c.js";import{i as u,l as d}from"./auth-C8kS8ur3.js";import{n as f}from"./chat-_owdy9Bf.js";import{A as p,C as m,D as h,E as g,F as _,M as v,N as y,O as b,P as x,S,T as C,_ as ee,a as w,b as T,c as E,d as te,f as D,g as ne,h as re,j as ie,k as ae,l as oe,m as se,o as ce,p as O,s as le,u as ue,v as k,w as A,x as j,y as M}from"./index-CNsdEvGl.js";var de={invalid_type:`invalid_type`,too_big:`too_big`,too_small:`too_small`,invalid_format:`invalid_format`,not_multiple_of:`not_multiple_of`,unrecognized_keys:`unrecognized_keys`,invalid_union:`invalid_union`,invalid_key:`invalid_key`,invalid_element:`invalid_element`,invalid_value:`invalid_value`,custom:`custom`},fe;fe||={};function pe(e){return x(ce,e)}function me(e){return y(w,e)}function he(e){return v(le,e)}function N(e){return typeof e==`object`&&e&&!Array.isArray(e)?e:void 0}function P(e,t){if(!Array.isArray(e))return[];let n=new Set(t);return e.filter(e=>{if(typeof e!=`string`||/[\s;'\"]/.test(e))return!1;let t=e.match(/^([a-z]+):\/\/([^/]+)$/i);return!!(t&&n.has(t[1].toLowerCase()))})}function ge(e){let t=N(N(N(e)?.ui)?.csp),n=P(t?.connectDomains,[`http`,`https`,`ws`,`wss`]),r=P(t?.resourceDomains,[`http`,`https`]),i=P(t?.frameDomains,[`http`,`https`]),a=P(t?.baseUriDomains,[`http`,`https`]),o=r.length?` ${r.join(` `)}`:``,s=[`default-src 'none'`,`worker-src blob:`,`script-src 'self' 'unsafe-inline'${o}`,`style-src 'self' 'unsafe-inline'${o}`,`img-src 'self' data:${o}`,`media-src 'self' data:${o}`,`font-src 'self' data:${o}`,`connect-src ${n.length?n.join(` `):`'none'`}`];return i.length&&s.push(`frame-src ${i.join(` `)}`),a.length&&s.push(`base-uri ${a.join(` `)}`),`${s.join(`; `)};`}var _e=Object.create,ve=Object.defineProperty,ye=Object.getOwnPropertyDescriptor,be=Object.getOwnPropertyNames,F=Object.getPrototypeOf,xe=Object.prototype.hasOwnProperty,Se=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),Ce=(e,t)=>{let n={};for(var r in e)ve(n,r,{get:e[r],enumerable:!0});return t&&ve(n,Symbol.toStringTag,{value:`Module`}),n},we=(e,t,n,r)=>{if(t&&typeof t==`object`||typeof t==`function`)for(var i=be(t),a=0,o=i.length,s;at[e]).bind(null,s),enumerable:!(r=ye(t,s))||r.enumerable});return e},Te=(e,t,n)=>(n=e==null?{}:_e(F(e)),we(t||!e||!e.__esModule?ve(n,`default`,{value:e,enumerable:!0}):n,e)),Ee=new Set([`https://json-schema.org/draft/2020-12/schema`,`http://json-schema.org/draft/2020-12/schema`]),De=new Set([`https://json-schema.org/draft/2019-09/schema`,`http://json-schema.org/draft/2019-09/schema`]),Oe=new Set([`https://json-schema.org/draft-07/schema`,`http://json-schema.org/draft-07/schema`]),ke=new Set([`https://json-schema.org/draft-06/schema`,`http://json-schema.org/draft-06/schema`]);function Ae(e){return typeof e==`string`&&De.has(e.replace(/#$/,``))}function je(e,t){if(!(`$schema`in e)||typeof e.$schema!=`string`)return`2020-12`;let n=e.$schema.replace(/#$/,``);if(Ee.has(n))return`2020-12`;if(De.has(n))return`2019-09`;if(Oe.has(n)||ke.has(n))return`draft-7`;throw Error(`JSON Schema declares an unsupported dialect ("$schema": "${e.$schema.slice(0,200)}"). The default validator supports JSON Schema 2020-12, 2019-09, draft-07, and draft-06; ${t}`)}var Me=`2025-11-25`,Ne=[Me,`2025-06-18`,`2025-03-26`,`2024-11-05`,`2024-10-07`],Pe=`io.modelcontextprotocol/related-task`,Fe=`io.modelcontextprotocol/protocolVersion`,Ie=`io.modelcontextprotocol/clientInfo`,Le=`io.modelcontextprotocol/serverInfo`,Re=`io.modelcontextprotocol/clientCapabilities`,ze=`io.modelcontextprotocol/subscriptionId`,Be=`io.modelcontextprotocol/logLevel`,Ve=ee(()=>h([g(),j(),O(),oe(),C(g(),Ve),D(Ve)])),I=C(g(),Ve),He=D(Ve),Ue=h([g(),j().int()]),We=g(),Ge=S({ttl:j().optional()}),Ke=S({taskId:g()}),qe=M({progressToken:Ue.optional(),[Pe]:Ke.optional()}),L=S({_meta:qe.optional()}),Je=L.extend({task:Ge.optional()}),R=S({method:g(),params:L.loose().optional()}),z=S({_meta:qe.optional()}),B=S({method:g(),params:z.loose().optional()}),Ye=M({get[Le](){return H.optional().catch(void 0)}}),V=M({_meta:Ye.optional()}),Xe=h([g(),j().int()]),Ze=S({jsonrpc:k(`2.0`),id:Xe,...R.shape}).strict(),Qe=S({jsonrpc:k(`2.0`),...B.shape}).strict(),$e=S({jsonrpc:k(`2.0`),id:Xe,result:V}).strict(),et=S({jsonrpc:k(`2.0`),id:Xe.optional(),error:S({code:j().int(),message:g(),data:b().optional()})}).strict(),tt=h([Ze,Qe,$e,et]),nt=h([$e,et]),rt=V.strict(),it=z.extend({requestId:Xe.optional(),reason:g().optional()}),at=B.extend({method:k(`notifications/cancelled`),params:it}),ot=S({src:g(),mimeType:g().optional(),sizes:D(g()).optional(),theme:E([`light`,`dark`]).optional()}),st=S({icons:D(ot).optional()}),ct=S({name:g(),title:g().optional()}),H=ct.extend({...ct.shape,...st.shape,version:g(),websiteUrl:g().optional(),description:g().optional()}),lt=ne(S({applyDefaults:O().optional()}),I),ut=A(e=>e&&typeof e==`object`&&!Array.isArray(e)&&Object.keys(e).length===0?{form:{}}:e,ne(S({form:lt.optional(),url:I.optional()}),I.optional())),dt=M({list:I.optional(),cancel:I.optional(),requests:M({sampling:M({createMessage:I.optional()}).optional(),elicitation:M({create:I.optional()}).optional()}).optional()}),ft=M({list:I.optional(),cancel:I.optional(),requests:M({tools:M({call:I.optional()}).optional()}).optional()}),pt=S({experimental:C(g(),I).optional(),sampling:S({context:I.optional(),tools:I.optional()}).optional(),elicitation:ut.optional(),roots:S({listChanged:O().optional()}).optional(),tasks:dt.optional(),extensions:C(g(),I).optional()}),mt=L.extend({protocolVersion:g(),capabilities:pt,clientInfo:H}),ht=R.extend({method:k(`initialize`),params:mt}),gt=S({experimental:C(g(),I).optional(),logging:I.optional(),completions:I.optional(),prompts:S({listChanged:O().optional()}).optional(),resources:S({subscribe:O().optional(),listChanged:O().optional()}).optional(),tools:S({listChanged:O().optional()}).optional(),tasks:ft.optional(),extensions:C(g(),I).optional()}),_t=V.extend({protocolVersion:g(),capabilities:gt,serverInfo:H,instructions:g().optional()}),vt=B.extend({method:k(`notifications/initialized`),params:z.optional()}),yt=R.extend({method:k(`server/discover`),params:L.optional()}),bt=V.extend({supportedVersions:D(g()),capabilities:gt,instructions:g().optional()}),xt=R.extend({method:k(`ping`),params:L.optional()}),St=S({progress:j(),total:m(j()),message:m(g())}),Ct=S({...z.shape,...St.shape,progressToken:Ue}),wt=B.extend({method:k(`notifications/progress`),params:Ct}),Tt=L.extend({cursor:We.optional()}),Et=R.extend({params:Tt.optional()}),Dt=V.extend({nextCursor:We.optional()}),Ot=S({uri:g(),mimeType:m(g()),_meta:C(g(),b()).optional()}),kt=Ot.extend({text:g()}),At=g().refine(e=>{try{return atob(e),!0}catch{return!1}},{message:`Invalid Base64 string`}),jt=Ot.extend({blob:At}),Mt=E([`user`,`assistant`]),Nt=S({audience:D(Mt).optional(),priority:j().min(0).max(1).optional(),lastModified:pe({offset:!0}).optional()}),Pt=S({...ct.shape,...st.shape,uri:g(),description:m(g()),mimeType:m(g()),size:m(j()),annotations:Nt.optional(),_meta:m(M({}))}),Ft=S({...ct.shape,...st.shape,uriTemplate:g(),description:m(g()),mimeType:m(g()),annotations:Nt.optional(),_meta:m(M({}))}),It=Et.extend({method:k(`resources/list`)}),Lt=Dt.extend({resources:D(Pt)}),U=Et.extend({method:k(`resources/templates/list`)}),W=Dt.extend({resourceTemplates:D(Ft)}),Rt=L.extend({uri:g()}),zt=Rt,Bt=R.extend({method:k(`resources/read`),params:zt}),Vt=V.extend({contents:D(h([kt,jt]))}),Ht=B.extend({method:k(`notifications/resources/list_changed`),params:z.optional()}),Ut=Rt,Wt=R.extend({method:k(`resources/subscribe`),params:Ut}),Gt=Rt,Kt=R.extend({method:k(`resources/unsubscribe`),params:Gt}),qt=S({toolsListChanged:O().optional(),promptsListChanged:O().optional(),resourcesListChanged:O().optional(),resourceSubscriptions:D(g()).optional()}),Jt=L.extend({notifications:qt}),Yt=R.extend({method:k(`subscriptions/listen`),params:Jt}),Xt=z.extend({notifications:qt}),Zt=B.extend({method:k(`notifications/subscriptions/acknowledged`),params:Xt}),Qt=Ye.extend({[ze]:Xe}),$t=V.extend({_meta:Qt}),en=z.extend({uri:g()}),tn=B.extend({method:k(`notifications/resources/updated`),params:en}),G=S({name:g(),description:m(g()),required:m(O())}),nn=S({...ct.shape,...st.shape,description:m(g()),arguments:m(D(G)),_meta:m(M({}))}),rn=Et.extend({method:k(`prompts/list`)}),an=Dt.extend({prompts:D(nn)}),on=L.extend({name:g(),arguments:C(g(),g()).optional()}),sn=R.extend({method:k(`prompts/get`),params:on}),cn=S({type:k(`text`),text:g(),annotations:Nt.optional(),_meta:C(g(),b()).optional()}),K=S({type:k(`image`),data:At,mimeType:g(),annotations:Nt.optional(),_meta:C(g(),b()).optional()}),ln=S({type:k(`audio`),data:At,mimeType:g(),annotations:Nt.optional(),_meta:C(g(),b()).optional()}),un=S({type:k(`tool_use`),name:g(),id:g(),input:C(g(),b()),_meta:C(g(),b()).optional()}),dn=S({type:k(`resource`),resource:h([kt,jt]),annotations:Nt.optional(),_meta:C(g(),b()).optional()}),fn=Pt.extend({type:k(`resource_link`)}),pn=h([cn,K,ln,fn,dn]),mn=S({role:Mt,content:pn}),hn=V.extend({description:g().optional(),messages:D(mn)}),gn=B.extend({method:k(`notifications/prompts/list_changed`),params:z.optional()}),_n=S({title:g().optional(),readOnlyHint:O().optional(),destructiveHint:O().optional(),idempotentHint:O().optional(),openWorldHint:O().optional()}),vn=S({taskSupport:E([`required`,`optional`,`forbidden`]).optional()}),yn=S({...ct.shape,...st.shape,description:g().optional(),inputSchema:S({type:k(`object`),properties:C(g(),Ve).optional(),required:D(g()).optional()}).catchall(b()),outputSchema:M({$schema:g().optional()}).optional(),annotations:_n.optional(),execution:vn.optional(),_meta:C(g(),b()).optional()}),bn=Et.extend({method:k(`tools/list`)}),xn=Dt.extend({tools:D(yn)}),Sn=V.extend({content:D(pn).default([]),structuredContent:b().optional(),isError:O().optional()}),Cn=Sn.or(V.extend({toolResult:b()})),wn=Je.extend({name:g(),arguments:C(g(),b()).optional()}),Tn=R.extend({method:k(`tools/call`),params:wn}),En=B.extend({method:k(`notifications/tools/list_changed`),params:z.optional()}),Dn=S({autoRefresh:O().default(!0),debounceMs:j().int().nonnegative().default(300)}),On=E([`debug`,`info`,`notice`,`warning`,`error`,`critical`,`alert`,`emergency`]),kn=L.extend({level:On}),An=R.extend({method:k(`logging/setLevel`),params:kn}),jn=z.extend({level:On,logger:g().optional(),data:b()}),Mn=B.extend({method:k(`notifications/message`),params:jn}),Nn=S({name:g().optional()}),Pn=S({hints:D(Nn).optional(),costPriority:j().min(0).max(1).optional(),speedPriority:j().min(0).max(1).optional(),intelligencePriority:j().min(0).max(1).optional()}),Fn=S({mode:E([`auto`,`required`,`none`]).optional()}),In=S({type:k(`tool_result`),toolUseId:g().describe(`The unique identifier for the corresponding tool call.`),content:D(pn),structuredContent:b().optional(),isError:O().optional(),_meta:C(g(),b()).optional()}),Ln=se(`type`,[cn,K,ln]),Rn=se(`type`,[cn,K,ln,un,In]),zn=S({role:Mt,content:h([Rn,D(Rn)]),_meta:C(g(),b()).optional()}),Bn=Je.extend({messages:D(zn),modelPreferences:Pn.optional(),systemPrompt:g().optional(),includeContext:E([`none`,`thisServer`,`allServers`]).optional(),temperature:j().optional(),maxTokens:j().int(),stopSequences:D(g()).optional(),metadata:I.optional(),tools:D(yn).optional(),toolChoice:Fn.optional()}),Vn=R.extend({method:k(`sampling/createMessage`),params:Bn}),Hn=V.extend({model:g(),stopReason:m(E([`endTurn`,`stopSequence`,`maxTokens`]).or(g())),role:Mt,content:Ln}),Un=V.extend({model:g(),stopReason:m(E([`endTurn`,`stopSequence`,`maxTokens`,`toolUse`]).or(g())),role:Mt,content:h([Rn,D(Rn)])}),Wn=S({type:k(`boolean`),title:g().optional(),description:g().optional(),default:O().optional()}),Gn=S({type:k(`string`),title:g().optional(),description:g().optional(),minLength:j().optional(),maxLength:j().optional(),format:E([`email`,`uri`,`date`,`date-time`]).optional(),default:g().optional()}),Kn=S({type:E([`number`,`integer`]),title:g().optional(),description:g().optional(),minimum:j().optional(),maximum:j().optional(),default:j().optional()}),qn=S({type:k(`string`),title:g().optional(),description:g().optional(),enum:D(g()),default:g().optional()}),Jn=S({type:k(`string`),title:g().optional(),description:g().optional(),oneOf:D(S({const:g(),title:g()})),default:g().optional()}),Yn=S({type:k(`string`),title:g().optional(),description:g().optional(),enum:D(g()),enumNames:D(g()).optional(),default:g().optional()}),Xn=h([qn,Jn]),Zn=S({type:k(`array`),title:g().optional(),description:g().optional(),minItems:j().optional(),maxItems:j().optional(),items:S({type:k(`string`),enum:D(g())}),default:D(g()).optional()}),Qn=S({type:k(`array`),title:g().optional(),description:g().optional(),minItems:j().optional(),maxItems:j().optional(),items:S({anyOf:D(S({const:g(),title:g()}))}),default:D(g()).optional()}),$n=h([Zn,Qn]),er=h([Yn,Xn,$n]),tr=h([er,Wn,Gn,Kn]),nr=Je.extend({mode:k(`form`).optional(),message:g(),requestedSchema:S({type:k(`object`),properties:C(g(),tr),required:D(g()).optional()}).catchall(b())}),rr=Je.extend({mode:k(`url`),message:g(),elicitationId:g(),url:g().url()}),ir=h([nr,rr]),ar=R.extend({method:k(`elicitation/create`),params:ir}),or=z.extend({elicitationId:g()}),sr=B.extend({method:k(`notifications/elicitation/complete`),params:or}),cr=V.extend({action:E([`accept`,`decline`,`cancel`]),content:A(e=>e===null?void 0:e,C(g(),h([g(),j(),O(),D(g())])).optional())}),lr=S({type:k(`ref/resource`),uri:g()}),ur=S({type:k(`ref/prompt`),name:g()}),dr=L.extend({ref:h([ur,lr]),argument:S({name:g(),value:g()}),context:S({arguments:C(g(),g()).optional()}).optional()}),fr=R.extend({method:k(`completion/complete`),params:dr}),pr=V.extend({completion:M({values:D(g()).max(100),total:m(j().int()),hasMore:m(O())})}),mr=S({uri:g().startsWith(`file://`),name:g().optional(),_meta:C(g(),b()).optional()}),hr=R.extend({method:k(`roots/list`),params:L.optional()}),gr=V.extend({roots:D(mr)}),_r=B.extend({method:k(`notifications/roots/list_changed`),params:z.optional()}),vr=M({ttl:j().optional(),pollInterval:j().optional()}),yr=E([`working`,`input_required`,`completed`,`failed`,`cancelled`]),br=S({taskId:g(),status:yr,ttl:h([j(),oe()]),createdAt:g(),lastUpdatedAt:g(),pollInterval:m(j()),statusMessage:m(g())}),xr=V.extend({task:br}),Sr=z.merge(br),Cr=B.extend({method:k(`notifications/tasks/status`),params:Sr}),wr=R.extend({method:k(`tasks/get`),params:L.extend({taskId:g()})}),Tr=V.merge(br),Er=R.extend({method:k(`tasks/result`),params:L.extend({taskId:g()})}),Dr=V.loose(),Or=Et.extend({method:k(`tasks/list`)}),kr=Dt.extend({tasks:D(br)}),Ar=R.extend({method:k(`tasks/cancel`),params:L.extend({taskId:g()})}),jr=V.merge(br),Mr=h([xt,ht,yt,fr,An,sn,rn,It,U,Bt,Wt,Kt,Yt,Tn,bn]),Nr=h([at,wt,vt,_r]),Pr=h([rt,Hn,Un,cr,gr]),Fr=h([xt,Vn,ar,hr]),Ir=h([at,wt,Mn,tn,Ht,En,gn,Zt,sr]),Lr=h([rt,_t,bt,pr,hn,an,Lt,W,Vt,Sn,xn,$t]),q=ae().superRefine((e,t)=>{if(!URL.canParse(e))return t.addIssue({code:de.custom,message:`URL must be parseable`,fatal:!0}),_}).refine(e=>{let t=new URL(e);return t.protocol!==`javascript:`&&t.protocol!==`data:`&&t.protocol!==`vbscript:`},{message:`URL cannot use javascript:, data:, or vbscript: scheme`}),Rr=M({resource:g().url(),authorization_servers:D(q).optional(),jwks_uri:g().url().optional(),scopes_supported:D(g()).optional(),bearer_methods_supported:D(g()).optional(),resource_signing_alg_values_supported:D(g()).optional(),resource_name:g().optional(),resource_documentation:g().optional(),resource_policy_uri:g().url().optional(),resource_tos_uri:g().url().optional(),tls_client_certificate_bound_access_tokens:O().optional(),authorization_details_types_supported:D(g()).optional(),dpop_signing_alg_values_supported:D(g()).optional(),dpop_bound_access_tokens_required:O().optional()}),zr=M({issuer:g(),authorization_endpoint:q,token_endpoint:q,registration_endpoint:q.optional(),scopes_supported:D(g()).optional(),response_types_supported:D(g()),response_modes_supported:D(g()).optional(),grant_types_supported:D(g()).optional(),token_endpoint_auth_methods_supported:D(g()).optional(),token_endpoint_auth_signing_alg_values_supported:D(g()).optional(),service_documentation:q.optional(),revocation_endpoint:q.optional(),revocation_endpoint_auth_methods_supported:D(g()).optional(),revocation_endpoint_auth_signing_alg_values_supported:D(g()).optional(),introspection_endpoint:g().optional(),introspection_endpoint_auth_methods_supported:D(g()).optional(),introspection_endpoint_auth_signing_alg_values_supported:D(g()).optional(),code_challenge_methods_supported:D(g()).optional(),client_id_metadata_document_supported:O().optional(),authorization_response_iss_parameter_supported:O().optional().catch(void 0),dpop_signing_alg_values_supported:D(g()).optional()}),Br=M({issuer:g(),authorization_endpoint:q,token_endpoint:q,userinfo_endpoint:q.optional(),jwks_uri:q,registration_endpoint:q.optional(),scopes_supported:D(g()).optional(),response_types_supported:D(g()),response_modes_supported:D(g()).optional(),grant_types_supported:D(g()).optional(),acr_values_supported:D(g()).optional(),subject_types_supported:D(g()),id_token_signing_alg_values_supported:D(g()),id_token_encryption_alg_values_supported:D(g()).optional(),id_token_encryption_enc_values_supported:D(g()).optional(),userinfo_signing_alg_values_supported:D(g()).optional(),userinfo_encryption_alg_values_supported:D(g()).optional(),userinfo_encryption_enc_values_supported:D(g()).optional(),request_object_signing_alg_values_supported:D(g()).optional(),request_object_encryption_alg_values_supported:D(g()).optional(),request_object_encryption_enc_values_supported:D(g()).optional(),token_endpoint_auth_methods_supported:D(g()).optional(),token_endpoint_auth_signing_alg_values_supported:D(g()).optional(),display_values_supported:D(g()).optional(),claim_types_supported:D(g()).optional(),claims_supported:D(g()).optional(),service_documentation:g().optional(),claims_locales_supported:D(g()).optional(),ui_locales_supported:D(g()).optional(),claims_parameter_supported:O().optional(),request_parameter_supported:O().optional(),request_uri_parameter_supported:O().optional(),require_request_uri_registration:O().optional(),op_policy_uri:q.optional(),op_tos_uri:q.optional(),client_id_metadata_document_supported:O().optional(),authorization_response_iss_parameter_supported:O().optional().catch(void 0)}),Vr=S({...Br.shape,...zr.pick({code_challenge_methods_supported:!0}).shape}),Hr=S({access_token:g(),id_token:g().optional(),token_type:g(),expires_in:he().optional(),scope:g().optional(),refresh_token:g().optional(),issuer:g().optional().catch(void 0)}).strip(),Ur=S({issued_token_type:k(`urn:ietf:params:oauth:token-type:id-jag`),access_token:g(),token_type:g().optional(),expires_in:j().optional(),scope:g().optional()}).strip(),Wr=S({error:g(),error_description:g().optional(),error_uri:g().optional()}),Gr=q.optional().or(k(``).transform(()=>void 0)),Kr=S({redirect_uris:D(q),token_endpoint_auth_method:g().optional(),grant_types:D(g()).optional(),response_types:D(g()).optional(),application_type:g().optional(),client_name:g().optional(),client_uri:q.optional(),logo_uri:Gr,scope:g().optional(),contacts:D(g()).optional(),tos_uri:Gr,policy_uri:g().optional(),jwks_uri:q.optional(),jwks:te().optional(),software_id:g().optional(),software_version:g().optional(),software_statement:g().optional()}).strip(),qr=S({client_id:g(),client_secret:g().optional(),client_id_issued_at:j().optional(),client_secret_expires_at:j().optional(),issuer:g().optional().catch(void 0)}).strip(),Jr=Kr.merge(qr),Yr=S({error:g(),error_description:g().optional()}).strip(),Xr=S({token:g(),token_type_hint:g().optional()}).strip(),Zr=Symbol.for(`mcp.sdk.errorBrands`);function Qr(e,t){let n=new Set,r=t;for(;typeof r==`function`;){let e=r.mcpBrand;Object.prototype.hasOwnProperty.call(r,`mcpBrand`)&&typeof e==`string`&&n.add(e),r=Object.getPrototypeOf(r)}n.size!==0&&Object.defineProperty(e,Zr,{value:n,enumerable:!1,configurable:!0})}function $r(e,t){try{if(typeof t==`object`&&t&&Object.prototype.hasOwnProperty.call(e,`mcpBrand`)&&typeof e.mcpBrand==`string`&&Object.prototype.hasOwnProperty.call(t,Zr)){let n=t[Zr];if(n&&typeof n.has==`function`&&n.has(e.mcpBrand))return!0}}catch{}return Function.prototype[Symbol.hasInstance].call(e,t)}var ei=function(e){return e.InvalidRequest=`invalid_request`,e.InvalidClient=`invalid_client`,e.InvalidGrant=`invalid_grant`,e.UnauthorizedClient=`unauthorized_client`,e.UnsupportedGrantType=`unsupported_grant_type`,e.InvalidScope=`invalid_scope`,e.AccessDenied=`access_denied`,e.ServerError=`server_error`,e.TemporarilyUnavailable=`temporarily_unavailable`,e.UnsupportedResponseType=`unsupported_response_type`,e.UnsupportedTokenType=`unsupported_token_type`,e.InvalidToken=`invalid_token`,e.MethodNotAllowed=`method_not_allowed`,e.TooManyRequests=`too_many_requests`,e.InvalidClientMetadata=`invalid_client_metadata`,e.InvalidRedirectUri=`invalid_redirect_uri`,e.InsufficientScope=`insufficient_scope`,e.InvalidTarget=`invalid_target`,e.InvalidDpopProof=`invalid_dpop_proof`,e.UseDpopNonce=`use_dpop_nonce`,e}({}),ti=class e extends Error{static{Object.defineProperty(this,"mcpBrand",{value:`mcp.OAuthError`})}static[Symbol.hasInstance](e){return $r(this,e)}static isInstance(e){if(typeof this!=`function`)throw TypeError("isInstance must be called on the class (e.g. `SdkError.isInstance(value)`); for callbacks use `v => SdkError.isInstance(v)`");return $r(this,e)}constructor(e,t,n){super(t),this.code=e,this.errorUri=n,this.name=`OAuthError`,Qr(this,new.target)}toResponseObject(){let e={error:this.code,error_description:this.message};return this.errorUri&&(e.error_uri=this.errorUri),e}static fromResponse(t){return new e(t.error,t.error_description??t.error,t.error_uri)}},J=function(e){return e.NotConnected=`NOT_CONNECTED`,e.AlreadyConnected=`ALREADY_CONNECTED`,e.NotInitialized=`NOT_INITIALIZED`,e.CapabilityNotSupported=`CAPABILITY_NOT_SUPPORTED`,e.RequestTimeout=`REQUEST_TIMEOUT`,e.ConnectionClosed=`CONNECTION_CLOSED`,e.SendFailed=`SEND_FAILED`,e.InvalidResult=`INVALID_RESULT`,e.UnsupportedResultType=`UNSUPPORTED_RESULT_TYPE`,e.InputRequiredRoundsExceeded=`INPUT_REQUIRED_ROUNDS_EXCEEDED`,e.ListPaginationExceeded=`LIST_PAGINATION_EXCEEDED`,e.MethodNotSupportedByProtocolVersion=`METHOD_NOT_SUPPORTED_BY_PROTOCOL_VERSION`,e.EraNegotiationFailed=`ERA_NEGOTIATION_FAILED`,e.ClientHttpNotImplemented=`CLIENT_HTTP_NOT_IMPLEMENTED`,e.ClientHttpAuthentication=`CLIENT_HTTP_AUTHENTICATION`,e.ClientHttpForbidden=`CLIENT_HTTP_FORBIDDEN`,e.ClientHttpUnexpectedContent=`CLIENT_HTTP_UNEXPECTED_CONTENT`,e.ClientHttpFailedToOpenStream=`CLIENT_HTTP_FAILED_TO_OPEN_STREAM`,e.ClientHttpFailedToTerminateSession=`CLIENT_HTTP_FAILED_TO_TERMINATE_SESSION`,e}({}),Y=class extends Error{static{Object.defineProperty(this,"mcpBrand",{value:`mcp.SdkError`})}static[Symbol.hasInstance](e){return $r(this,e)}static isInstance(e){if(typeof this!=`function`)throw TypeError("isInstance must be called on the class (e.g. `SdkError.isInstance(value)`); for callbacks use `v => SdkError.isInstance(v)`");return $r(this,e)}constructor(e,t,n,r){super(t,r),this.code=e,this.data=n,this.name=`SdkError`,Qr(this,new.target)}},ni=class extends Y{static{Object.defineProperty(this,"mcpBrand",{value:`mcp.SdkHttpError`})}constructor(e,t,n,r){super(e,t,n,r),this.name=`SdkHttpError`}get status(){return this.data.status}get statusText(){return this.data.statusText}};function ri(e){let t=typeof e==`string`?new URL(e):new URL(e.href);return t.hash=``,t}function ii(e){if(typeof e!=`object`||!e||Array.isArray(e))return e;let t={...e};return delete t.issuer,t}function ai({requestedResource:e,configuredResource:t}){let n=typeof e==`string`?new URL(e):new URL(e.href),r=typeof t==`string`?new URL(t):new URL(t.href);if(n.origin!==r.origin||n.pathname.length=oi}function li(e){return e.filter(e=>!ci(e))}function ui(e){return e.filter(e=>ci(e))}function di(e){let t=e.structuredContent;return t===void 0||typeof t==`object`&&t&&!Array.isArray(t)||(e.content?.some(e=>e.type===`text`)??!1)?e:{...e,content:[...e.content??[],{type:`text`,text:JSON.stringify(t)}]}}var fi=[`task`,`inputRequests`,`requestState`];function pi(e){return typeof e!=`object`||!e||Array.isArray(e)||e.content!==void 0||fi.some(t=>t in e)?e:{...e,content:[]}}function mi(){let e=ee(()=>h([g(),j(),O(),oe(),C(g(),e),D(e)])),t=C(g(),e),n=h([g(),j().int()]),r=g(),i=S({ttl:j().optional()}),a=S({taskId:g()}),o=M({progressToken:n.optional(),"io.modelcontextprotocol/related-task":a.optional()}),s=S({_meta:o.optional()}),c=s.extend({task:i.optional()}),l=S({method:g(),params:s.loose().optional()}),u=S({_meta:o.optional()}),d=S({method:g(),params:u.loose().optional()}),f=M({_meta:o.optional()}),p=h([g(),j().int()]),_=f.strict(),v=u.extend({requestId:p.optional(),reason:g().optional()}),y=d.extend({method:k(`notifications/cancelled`),params:v}),x=S({src:g(),mimeType:g().optional(),sizes:D(g()).optional(),theme:E([`light`,`dark`]).optional()}),w=S({icons:D(x).optional()}),T=S({name:g(),title:g().optional()}),te=T.extend({...T.shape,...w.shape,version:g(),websiteUrl:g().optional(),description:g().optional()}),re=ne(S({applyDefaults:O().optional()}),t),ie=A(e=>e&&typeof e==`object`&&!Array.isArray(e)&&Object.keys(e).length===0?{form:{}}:e,ne(S({form:re.optional(),url:t.optional()}),t.optional())),ae=M({list:t.optional(),cancel:t.optional(),requests:M({sampling:M({createMessage:t.optional()}).optional(),elicitation:M({create:t.optional()}).optional()}).optional()}),ce=M({list:t.optional(),cancel:t.optional(),requests:M({tools:M({call:t.optional()}).optional()}).optional()}),le=S({experimental:C(g(),t).optional(),sampling:S({context:t.optional(),tools:t.optional()}).optional(),elicitation:ie.optional(),roots:S({listChanged:O().optional()}).optional(),tasks:ae.optional(),extensions:C(g(),t).optional()}),ue=s.extend({protocolVersion:g(),capabilities:le,clientInfo:te}),de=l.extend({method:k(`initialize`),params:ue}),fe=S({experimental:C(g(),t).optional(),logging:t.optional(),completions:t.optional(),prompts:S({listChanged:O().optional()}).optional(),resources:S({subscribe:O().optional(),listChanged:O().optional()}).optional(),tools:S({listChanged:O().optional()}).optional(),tasks:ce.optional(),extensions:C(g(),t).optional()}),me=f.extend({protocolVersion:g(),capabilities:fe,serverInfo:te,instructions:g().optional()}),he=d.extend({method:k(`notifications/initialized`),params:u.optional()}),N=l.extend({method:k(`ping`),params:s.optional()}),P=S({progress:j(),total:m(j()),message:m(g())}),ge=S({...u.shape,...P.shape,progressToken:n}),_e=d.extend({method:k(`notifications/progress`),params:ge}),ve=s.extend({cursor:r.optional()}),ye=l.extend({params:ve.optional()}),be=f.extend({nextCursor:r.optional()}),F=S({uri:g(),mimeType:m(g()),_meta:C(g(),b()).optional()}),xe=F.extend({text:g()}),Se=g().refine(e=>{try{return atob(e),!0}catch{return!1}},{message:`Invalid Base64 string`}),Ce=F.extend({blob:Se}),we=E([`user`,`assistant`]),Te=S({audience:D(we).optional(),priority:j().min(0).max(1).optional(),lastModified:pe({offset:!0}).optional()}),Ee=S({...T.shape,...w.shape,uri:g(),description:m(g()),mimeType:m(g()),size:m(j()),annotations:Te.optional(),_meta:m(M({}))}),De=S({...T.shape,...w.shape,uriTemplate:g(),description:m(g()),mimeType:m(g()),annotations:Te.optional(),_meta:m(M({}))}),Oe=ye.extend({method:k(`resources/list`)}),ke=be.extend({resources:D(Ee)}),Ae=ye.extend({method:k(`resources/templates/list`)}),je=be.extend({resourceTemplates:D(De)}),Me=s.extend({uri:g()}),Ne=Me,Pe=l.extend({method:k(`resources/read`),params:Ne}),Fe=f.extend({contents:D(h([xe,Ce]))}),Ie=d.extend({method:k(`notifications/resources/list_changed`),params:u.optional()}),Le=Me,Re=l.extend({method:k(`resources/subscribe`),params:Le}),ze=Me,Be=l.extend({method:k(`resources/unsubscribe`),params:ze}),Ve=u.extend({uri:g()}),I=d.extend({method:k(`notifications/resources/updated`),params:Ve}),He=S({name:g(),description:m(g()),required:m(O())}),Ue=S({...T.shape,...w.shape,description:m(g()),arguments:m(D(He)),_meta:m(M({}))}),We=ye.extend({method:k(`prompts/list`)}),Ge=be.extend({prompts:D(Ue)}),Ke=s.extend({name:g(),arguments:C(g(),g()).optional()}),qe=l.extend({method:k(`prompts/get`),params:Ke}),L=S({type:k(`text`),text:g(),annotations:Te.optional(),_meta:C(g(),b()).optional()}),Je=S({type:k(`image`),data:Se,mimeType:g(),annotations:Te.optional(),_meta:C(g(),b()).optional()}),R=S({type:k(`audio`),data:Se,mimeType:g(),annotations:Te.optional(),_meta:C(g(),b()).optional()}),z=S({type:k(`tool_use`),name:g(),id:g(),input:C(g(),b()),_meta:C(g(),b()).optional()}),B=S({type:k(`resource`),resource:h([xe,Ce]),annotations:Te.optional(),_meta:C(g(),b()).optional()}),Ye=Ee.extend({type:k(`resource_link`)}),V=h([L,Je,R,Ye,B]),Xe=S({role:we,content:V}),Ze=f.extend({description:g().optional(),messages:D(Xe)}),Qe=d.extend({method:k(`notifications/prompts/list_changed`),params:u.optional()}),$e=S({title:g().optional(),readOnlyHint:O().optional(),destructiveHint:O().optional(),idempotentHint:O().optional(),openWorldHint:O().optional()}),et=S({taskSupport:E([`required`,`optional`,`forbidden`]).optional()}),tt=S({...T.shape,...w.shape,description:g().optional(),inputSchema:S({type:k(`object`),properties:C(g(),e).optional(),required:D(g()).optional()}).catchall(b()),outputSchema:S({type:k(`object`),properties:C(g(),e).optional(),required:D(g()).optional()}).catchall(b()).optional(),annotations:$e.optional(),execution:et.optional(),_meta:C(g(),b()).optional()}),nt=ye.extend({method:k(`tools/list`)}),rt=be.extend({tools:D(tt)}),it=f.extend({content:D(V),structuredContent:C(g(),b()).optional(),isError:O().optional()}),at=c.extend({name:g(),arguments:C(g(),b()).optional()}),ot=l.extend({method:k(`tools/call`),params:at}),st=d.extend({method:k(`notifications/tools/list_changed`),params:u.optional()}),ct=E([`debug`,`info`,`notice`,`warning`,`error`,`critical`,`alert`,`emergency`]),H=s.extend({level:ct}),lt=l.extend({method:k(`logging/setLevel`),params:H}),ut=u.extend({level:ct,logger:g().optional(),data:b()}),dt=d.extend({method:k(`notifications/message`),params:ut}),ft=S({name:g().optional()}),pt=S({hints:D(ft).optional(),costPriority:j().min(0).max(1).optional(),speedPriority:j().min(0).max(1).optional(),intelligencePriority:j().min(0).max(1).optional()}),mt=S({mode:E([`auto`,`required`,`none`]).optional()}),ht=S({type:k(`tool_result`),toolUseId:g().describe(`The unique identifier for the corresponding tool call.`),content:D(V),structuredContent:S({}).loose().optional(),isError:O().optional(),_meta:C(g(),b()).optional()}),gt=se(`type`,[L,Je,R]),_t=se(`type`,[L,Je,R,z,ht]),vt=S({role:we,content:h([_t,D(_t)]),_meta:C(g(),b()).optional()}),yt=c.extend({messages:D(vt),modelPreferences:pt.optional(),systemPrompt:g().optional(),includeContext:E([`none`,`thisServer`,`allServers`]).optional(),temperature:j().optional(),maxTokens:j().int(),stopSequences:D(g()).optional(),metadata:t.optional(),tools:D(tt).optional(),toolChoice:mt.optional()}),bt=l.extend({method:k(`sampling/createMessage`),params:yt}),xt=f.extend({model:g(),stopReason:m(E([`endTurn`,`stopSequence`,`maxTokens`]).or(g())),role:we,content:gt}),St=f.extend({model:g(),stopReason:m(E([`endTurn`,`stopSequence`,`maxTokens`,`toolUse`]).or(g())),role:we,content:h([_t,D(_t)])}),Ct=S({type:k(`boolean`),title:g().optional(),description:g().optional(),default:O().optional()}),wt=S({type:k(`string`),title:g().optional(),description:g().optional(),minLength:j().optional(),maxLength:j().optional(),format:E([`email`,`uri`,`date`,`date-time`]).optional(),default:g().optional()}),Tt=S({type:E([`number`,`integer`]),title:g().optional(),description:g().optional(),minimum:j().optional(),maximum:j().optional(),default:j().optional()}),Et=S({type:k(`string`),title:g().optional(),description:g().optional(),enum:D(g()),default:g().optional()}),Dt=S({type:k(`string`),title:g().optional(),description:g().optional(),oneOf:D(S({const:g(),title:g()})),default:g().optional()}),Ot=S({type:k(`string`),title:g().optional(),description:g().optional(),enum:D(g()),enumNames:D(g()).optional(),default:g().optional()}),kt=h([Et,Dt]),At=S({type:k(`array`),title:g().optional(),description:g().optional(),minItems:j().optional(),maxItems:j().optional(),items:S({type:k(`string`),enum:D(g())}),default:D(g()).optional()}),jt=S({type:k(`array`),title:g().optional(),description:g().optional(),minItems:j().optional(),maxItems:j().optional(),items:S({anyOf:D(S({const:g(),title:g()}))}),default:D(g()).optional()}),Mt=h([At,jt]),Nt=h([Ot,kt,Mt]),Pt=h([Nt,Ct,wt,Tt]),Ft=c.extend({mode:k(`form`).optional(),message:g(),requestedSchema:S({type:k(`object`),properties:C(g(),Pt),required:D(g()).optional()}).catchall(b())}),It=c.extend({mode:k(`url`),message:g(),elicitationId:g(),url:g().url()}),Lt=h([Ft,It]),U=l.extend({method:k(`elicitation/create`),params:Lt}),W=u.extend({elicitationId:g()}),Rt=d.extend({method:k(`notifications/elicitation/complete`),params:W}),zt=f.extend({action:E([`accept`,`decline`,`cancel`]),content:A(e=>e===null?void 0:e,C(g(),h([g(),j(),O(),D(g())])).optional())}),Bt=S({type:k(`ref/resource`),uri:g()}),Vt=S({type:k(`ref/prompt`),name:g()}),Ht=s.extend({ref:h([Vt,Bt]),argument:S({name:g(),value:g()}),context:S({arguments:C(g(),g()).optional()}).optional()}),Ut=l.extend({method:k(`completion/complete`),params:Ht}),Wt=f.extend({completion:M({values:D(g()).max(100),total:m(j().int()),hasMore:m(O())})}),Gt=S({uri:g().startsWith(`file://`),name:g().optional(),_meta:C(g(),b()).optional()}),Kt=l.extend({method:k(`roots/list`),params:s.optional()}),qt=f.extend({roots:D(Gt)}),Jt=d.extend({method:k(`notifications/roots/list_changed`),params:u.optional()}),Yt=M({ttl:j().optional(),pollInterval:j().optional()}),Xt=E([`working`,`input_required`,`completed`,`failed`,`cancelled`]),Zt=S({taskId:g(),status:Xt,ttl:h([j(),oe()]),createdAt:g(),lastUpdatedAt:g(),pollInterval:m(j()),statusMessage:m(g())}),Qt=f.extend({task:Zt}),$t=u.merge(Zt),en=d.extend({method:k(`notifications/tasks/status`),params:$t}),tn=l.extend({method:k(`tasks/get`),params:s.extend({taskId:g()})}),G=f.merge(Zt),nn=l.extend({method:k(`tasks/result`),params:s.extend({taskId:g()})}),rn=f.loose(),an=ye.extend({method:k(`tasks/list`)}),on=be.extend({tasks:D(Zt)}),sn=l.extend({method:k(`tasks/cancel`),params:s.extend({taskId:g()})});return{JSONValueSchema:e,JSONObjectSchema:t,ProgressTokenSchema:n,CursorSchema:r,TaskMetadataSchema:i,RelatedTaskMetadataSchema:a,RequestMetaSchema:o,BaseRequestParamsSchema:s,TaskAugmentedRequestParamsSchema:c,RequestSchema:l,NotificationsParamsSchema:u,NotificationSchema:d,ResultSchema:f,RequestIdSchema:p,EmptyResultSchema:_,CancelledNotificationParamsSchema:v,CancelledNotificationSchema:y,IconSchema:x,IconsSchema:w,BaseMetadataSchema:T,ImplementationSchema:te,ClientTasksCapabilitySchema:ae,ServerTasksCapabilitySchema:ce,ClientCapabilitiesSchema:le,InitializeRequestParamsSchema:ue,InitializeRequestSchema:de,ServerCapabilitiesSchema:fe,InitializeResultSchema:me,InitializedNotificationSchema:he,PingRequestSchema:N,ProgressSchema:P,ProgressNotificationParamsSchema:ge,ProgressNotificationSchema:_e,PaginatedRequestParamsSchema:ve,PaginatedRequestSchema:ye,PaginatedResultSchema:be,ResourceContentsSchema:F,TextResourceContentsSchema:xe,BlobResourceContentsSchema:Ce,RoleSchema:we,AnnotationsSchema:Te,ResourceSchema:Ee,ResourceTemplateSchema:De,ListResourcesRequestSchema:Oe,ListResourcesResultSchema:ke,ListResourceTemplatesRequestSchema:Ae,ListResourceTemplatesResultSchema:je,ResourceRequestParamsSchema:Me,ReadResourceRequestParamsSchema:Ne,ReadResourceRequestSchema:Pe,ReadResourceResultSchema:Fe,ResourceListChangedNotificationSchema:Ie,SubscribeRequestParamsSchema:Le,SubscribeRequestSchema:Re,UnsubscribeRequestParamsSchema:ze,UnsubscribeRequestSchema:Be,ResourceUpdatedNotificationParamsSchema:Ve,ResourceUpdatedNotificationSchema:I,PromptArgumentSchema:He,PromptSchema:Ue,ListPromptsRequestSchema:We,ListPromptsResultSchema:Ge,GetPromptRequestParamsSchema:Ke,GetPromptRequestSchema:qe,TextContentSchema:L,ImageContentSchema:Je,AudioContentSchema:R,ToolUseContentSchema:z,EmbeddedResourceSchema:B,ResourceLinkSchema:Ye,ContentBlockSchema:V,PromptMessageSchema:Xe,GetPromptResultSchema:Ze,PromptListChangedNotificationSchema:Qe,ToolAnnotationsSchema:$e,ToolExecutionSchema:et,ToolSchema:tt,ListToolsRequestSchema:nt,ListToolsResultSchema:rt,CallToolResultSchema:it,CallToolRequestParamsSchema:at,CallToolRequestSchema:ot,ToolListChangedNotificationSchema:st,LoggingLevelSchema:ct,SetLevelRequestParamsSchema:H,SetLevelRequestSchema:lt,LoggingMessageNotificationParamsSchema:ut,LoggingMessageNotificationSchema:dt,ModelHintSchema:ft,ModelPreferencesSchema:pt,ToolChoiceSchema:mt,ToolResultContentSchema:ht,SamplingContentSchema:gt,SamplingMessageContentBlockSchema:_t,SamplingMessageSchema:vt,CreateMessageRequestParamsSchema:yt,CreateMessageRequestSchema:bt,CreateMessageResultSchema:xt,CreateMessageResultWithToolsSchema:St,BooleanSchemaSchema:Ct,StringSchemaSchema:wt,NumberSchemaSchema:Tt,UntitledSingleSelectEnumSchemaSchema:Et,TitledSingleSelectEnumSchemaSchema:Dt,LegacyTitledEnumSchemaSchema:Ot,SingleSelectEnumSchemaSchema:kt,UntitledMultiSelectEnumSchemaSchema:At,TitledMultiSelectEnumSchemaSchema:jt,MultiSelectEnumSchemaSchema:Mt,EnumSchemaSchema:Nt,PrimitiveSchemaDefinitionSchema:Pt,ElicitRequestFormParamsSchema:Ft,ElicitRequestURLParamsSchema:It,ElicitRequestParamsSchema:Lt,ElicitRequestSchema:U,ElicitationCompleteNotificationParamsSchema:W,ElicitationCompleteNotificationSchema:Rt,ElicitResultSchema:zt,ResourceTemplateReferenceSchema:Bt,PromptReferenceSchema:Vt,CompleteRequestParamsSchema:Ht,CompleteRequestSchema:Ut,CompleteResultSchema:Wt,RootSchema:Gt,ListRootsRequestSchema:Kt,ListRootsResultSchema:qt,RootsListChangedNotificationSchema:Jt,TaskCreationParamsSchema:Yt,TaskStatusSchema:Xt,TaskSchema:Zt,CreateTaskResultSchema:Qt,TaskStatusNotificationParamsSchema:$t,TaskStatusNotificationSchema:en,GetTaskRequestSchema:tn,GetTaskResultSchema:G,GetTaskPayloadRequestSchema:nn,GetTaskPayloadResultSchema:rn,ListTasksRequestSchema:an,ListTasksResultSchema:on,CancelTaskRequestSchema:sn,CancelTaskResultSchema:f.merge(Zt),ClientRequestSchema:h([N,de,Ut,lt,qe,We,Oe,Ae,Pe,Re,Be,ot,nt,tn,nn,an,sn]),ClientNotificationSchema:h([y,_e,he,Jt,en]),ClientResultSchema:h([_,xt,St,zt,qt,G,on,Qt]),ServerRequestSchema:h([N,bt,U,Kt,tn,nn,an,sn]),ServerNotificationSchema:h([y,_e,dt,I,Ie,st,Qe,en,Rt]),ServerResultSchema:h([_,me,Wt,Ze,Ge,ke,je,Fe,it,rt,G,on,Qt]),CallToolResultWireSchema:b().superRefine((e,t)=>{if(typeof e==`object`&&e&&!Array.isArray(e)&&e.content===void 0){for(let n of fi)if(n in e){t.addIssue({code:`custom`,message:`content is required when the body carries '${n}' — another result family cannot default into an empty tools/call success`});return}}}).transform(pi).pipe(it)}}var hi;function gi(){return hi??=mi()}function _i(e){return e.type!==`object`}var vi=new Set([`const`,`enum`,`default`,`examples`]),yi=new Set([`properties`,`patternProperties`,`$defs`,`definitions`,`dependentSchemas`,`dependencies`]);function bi(e){return e!==void 0&&!(typeof e==`string`&&e.startsWith(`#`))}function xi(e){let t=typeof e.$schema==`string`?e.$schema:void 0;if(bi(e.$id))return{...t!==void 0&&{$schema:t},type:`object`,properties:{result:e},required:[`result`]};let n=Ae(e.$schema)&&e.$recursiveAnchor!==!0,r=(e,t)=>{if(Array.isArray(e))return e.map(e=>r(e,!1));if(typeof e!=`object`||!e||!t&&bi(e.$id))return e;let i={},a=!1;for(let[o,s]of Object.entries(e))t?i[o]=r(s,!1):(o===`$ref`||o===`$dynamicRef`)&&typeof s==`string`?i[o]=s===`#`?`#/properties/result`:s.startsWith(`#/`)?`#/properties/result${s.slice(1)}`:s:o===`$recursiveRef`&&s===`#`&&n?a=!0:i[o]=vi.has(o)?s:yi.has(o)?r(s,!0):r(s,!1);return a&&(`$ref`in i?i.allOf=[...Array.isArray(i.allOf)?i.allOf:[],{$ref:`#/properties/result`}]:i.$ref=`#/properties/result`),i};return{...t!==void 0&&{$schema:t},type:`object`,properties:{result:r(e,!1)},required:[`result`]}}var Si={ping:null,initialize:null,"completion/complete":null,"logging/setLevel":null,"prompts/get":null,"prompts/list":null,"resources/list":null,"resources/templates/list":null,"resources/read":null,"resources/subscribe":null,"resources/unsubscribe":null,"tools/call":null,"tools/list":null,"tasks/get":null,"tasks/result":null,"tasks/list":null,"tasks/cancel":null,"sampling/createMessage":null,"elicitation/create":null,"roots/list":null},Ci={"notifications/cancelled":null,"notifications/progress":null,"notifications/initialized":null,"notifications/roots/list_changed":null,"notifications/tasks/status":null,"notifications/message":null,"notifications/resources/updated":null,"notifications/resources/list_changed":null,"notifications/tools/list_changed":null,"notifications/prompts/list_changed":null,"notifications/elicitation/complete":null},wi={ping:null,initialize:null,"completion/complete":null,"logging/setLevel":null,"prompts/get":null,"prompts/list":null,"resources/list":null,"resources/templates/list":null,"resources/read":null,"resources/subscribe":null,"resources/unsubscribe":null,"tools/call":null,"tools/list":null,"sampling/createMessage":null,"elicitation/create":null,"roots/list":null},Ti;function Ei(){if(Ti)return Ti;let e=gi();return Ti={requestSchemas:{ping:e.PingRequestSchema,initialize:e.InitializeRequestSchema,"completion/complete":e.CompleteRequestSchema,"logging/setLevel":e.SetLevelRequestSchema,"prompts/get":e.GetPromptRequestSchema,"prompts/list":e.ListPromptsRequestSchema,"resources/list":e.ListResourcesRequestSchema,"resources/templates/list":e.ListResourceTemplatesRequestSchema,"resources/read":e.ReadResourceRequestSchema,"resources/subscribe":e.SubscribeRequestSchema,"resources/unsubscribe":e.UnsubscribeRequestSchema,"tools/call":e.CallToolRequestSchema,"tools/list":e.ListToolsRequestSchema,"tasks/get":e.GetTaskRequestSchema,"tasks/result":e.GetTaskPayloadRequestSchema,"tasks/list":e.ListTasksRequestSchema,"tasks/cancel":e.CancelTaskRequestSchema,"sampling/createMessage":e.CreateMessageRequestSchema,"elicitation/create":e.ElicitRequestSchema,"roots/list":e.ListRootsRequestSchema},notificationSchemas:{"notifications/cancelled":e.CancelledNotificationSchema,"notifications/progress":e.ProgressNotificationSchema,"notifications/initialized":e.InitializedNotificationSchema,"notifications/roots/list_changed":e.RootsListChangedNotificationSchema,"notifications/tasks/status":e.TaskStatusNotificationSchema,"notifications/message":e.LoggingMessageNotificationSchema,"notifications/resources/updated":e.ResourceUpdatedNotificationSchema,"notifications/resources/list_changed":e.ResourceListChangedNotificationSchema,"notifications/tools/list_changed":e.ToolListChangedNotificationSchema,"notifications/prompts/list_changed":e.PromptListChangedNotificationSchema,"notifications/elicitation/complete":e.ElicitationCompleteNotificationSchema},resultSchemas:{ping:e.EmptyResultSchema,initialize:e.InitializeResultSchema,"completion/complete":e.CompleteResultSchema,"logging/setLevel":e.EmptyResultSchema,"prompts/get":e.GetPromptResultSchema,"prompts/list":e.ListPromptsResultSchema,"resources/list":e.ListResourcesResultSchema,"resources/templates/list":e.ListResourceTemplatesResultSchema,"resources/read":e.ReadResourceResultSchema,"resources/subscribe":e.EmptyResultSchema,"resources/unsubscribe":e.EmptyResultSchema,"tools/call":e.CallToolResultWireSchema,"tools/list":e.ListToolsResultSchema,"sampling/createMessage":e.CreateMessageResultWithToolsSchema,"elicitation/create":e.ElicitResultSchema,"roots/list":e.ListRootsResultSchema}},Ti}function Di(e){return Object.prototype.hasOwnProperty.call(Si,e)}function Oi(e){return Object.prototype.hasOwnProperty.call(Ci,e)}function ki(e){return Object.prototype.hasOwnProperty.call(wi,e)}function Ai(e){return ki(e)?Ei().resultSchemas[e]:void 0}function ji(e){return Di(e)?Ei().requestSchemas[e]:void 0}function Mi(e){return Oi(e)?Ei().notificationSchemas[e]:void 0}Object.keys(Si),Object.keys(Ci);function Ni(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function Pi(e,t){if(e===void 0)return{ok:!1,reason:`not-in-era`};let n=e.safeParse(t);return n.success?{ok:!0,value:n.data}:{ok:!1,reason:`invalid`,message:String(n.error)}}var Fi={ok:!1,reason:`not-in-era`};function Ii(e){return Ni(e)&&Ni(e.outputSchema)&&_i(e.outputSchema)}function Li(e){return e}var Ri={era:`2025-11-25`,hasRequestMethod:Di,hasNotificationMethod:Oi,validateRequest:(e,t)=>Pi(ji(e),t),validateResult:(e,t)=>Pi(Ai(e),t),validateNotification:(e,t)=>Pi(Mi(e),t),hasInputRequestMethod:()=>!1,validateInputRequest:()=>Fi,validateInputResponse:()=>Fi,samplingResultVariant:((e,t)=>{let n=gi();return Pi(e?n.CreateMessageResultWithToolsSchema:n.CreateMessageResultSchema,t)}),outboundEnvelope:e=>void 0,validateEnvelopeMeta:e=>[],projectCallToolResult(e,t){let n=di(e),r=n.structuredContent;if(r===void 0)return n;let i=typeof r!=`object`||!r||Array.isArray(r),a=t!==void 0&&_i(t);return!i&&!a?n:{...n,structuredContent:{result:r}}},decodeResult(e,t){if(Ni(t)&&`resultType`in t){let e={...t};return delete e.resultType,{kind:`complete`,result:Li(e)}}return{kind:`complete`,result:Li(t)}},encodeResult(e,t){if(e!==`tools/list`)return t;let n=t.tools;return!Array.isArray(n)||!n.some(e=>Ii(e))?t:{...t,tools:n.map(e=>Ii(e)?{...e,outputSchema:xi(e.outputSchema)}:e)}},encodeErrorCode:e=>e===-32002?-32602:e,checkInboundEnvelope:e=>void 0};function zi(){let e=ee(()=>h([g(),j(),O(),oe(),C(g(),e),D(e)])),t=C(g(),e),n=h([g(),j().int()]),r=g(),i=h([g(),j().int()]),a=E([`user`,`assistant`]),o=E([`debug`,`info`,`notice`,`warning`,`error`,`critical`,`alert`,`emergency`]),s=g().refine(e=>{try{return atob(e),!0}catch{return!1}},{message:`Invalid Base64 string`}),c=S({ttl:j().optional()}),l=S({taskId:g()}),u=M({progressToken:n.optional(),"io.modelcontextprotocol/related-task":l.optional()}),d=S({_meta:u.optional()}),f=d.extend({task:c.optional()}),p=S({_meta:u.optional()}),_=S({method:g(),params:p.loose().optional()}),v=S({src:g(),mimeType:g().optional(),sizes:D(g()).optional(),theme:E([`light`,`dark`]).optional()}),y=S({icons:D(v).optional()}),x=S({name:g(),title:g().optional()}),w=x.extend({...x.shape,...y.shape,version:g(),websiteUrl:g().optional(),description:g().optional()}),T=ne(S({applyDefaults:O().optional()}),t),te=A(e=>e&&typeof e==`object`&&!Array.isArray(e)&&Object.keys(e).length===0?{form:{}}:e,ne(S({form:T.optional(),url:t.optional()}),t.optional())),re=M({list:t.optional(),cancel:t.optional(),requests:M({sampling:M({createMessage:t.optional()}).optional(),elicitation:M({create:t.optional()}).optional()}).optional()}),ie=M({list:t.optional(),cancel:t.optional(),requests:M({tools:M({call:t.optional()}).optional()}).optional()}),ae=S({experimental:C(g(),t).optional(),sampling:S({context:t.optional(),tools:t.optional()}).optional(),elicitation:te.optional(),roots:S({listChanged:O().optional()}).optional(),tasks:re.optional(),extensions:C(g(),t).optional()}),se=S({experimental:C(g(),t).optional(),logging:t.optional(),completions:t.optional(),prompts:S({listChanged:O().optional()}).optional(),resources:S({subscribe:O().optional(),listChanged:O().optional()}).optional(),tools:S({listChanged:O().optional()}).optional(),tasks:ie.optional(),extensions:C(g(),t).optional()}),ce=S({progress:j(),total:m(j()),message:m(g())}),le=S({...p.shape,...ce.shape,progressToken:n}),ue=_.extend({method:k(`notifications/progress`),params:le}),de=p.extend({level:o,logger:g().optional(),data:b()}),fe=_.extend({method:k(`notifications/message`),params:de}),me=S({uri:g(),mimeType:m(g()),_meta:C(g(),b()).optional()}),he=me.extend({text:g()}),N=me.extend({blob:s}),P=S({audience:D(a).optional(),priority:j().min(0).max(1).optional(),lastModified:pe({offset:!0}).optional()}),ge=S({...x.shape,...y.shape,uri:g(),description:m(g()),mimeType:m(g()),size:m(j()),annotations:P.optional(),_meta:m(M({}))}),_e=S({...x.shape,...y.shape,uriTemplate:g(),description:m(g()),mimeType:m(g()),annotations:P.optional(),_meta:m(M({}))}),ve=_.extend({method:k(`notifications/resources/list_changed`),params:p.optional()}),ye=p.extend({uri:g()}),be=_.extend({method:k(`notifications/resources/updated`),params:ye}),F=S({name:g(),description:m(g()),required:m(O())}),xe=S({...x.shape,...y.shape,description:m(g()),arguments:m(D(F)),_meta:m(M({}))}),Se=_.extend({method:k(`notifications/prompts/list_changed`),params:p.optional()}),Ce=S({type:k(`text`),text:g(),annotations:P.optional(),_meta:C(g(),b()).optional()}),we=S({type:k(`image`),data:s,mimeType:g(),annotations:P.optional(),_meta:C(g(),b()).optional()}),Te=S({type:k(`audio`),data:s,mimeType:g(),annotations:P.optional(),_meta:C(g(),b()).optional()}),Ee=S({type:k(`tool_use`),name:g(),id:g(),input:C(g(),b()),_meta:C(g(),b()).optional()}),De=S({type:k(`resource`),resource:h([he,N]),annotations:P.optional(),_meta:C(g(),b()).optional()}),Oe=ge.extend({type:k(`resource_link`)}),ke=h([Ce,we,Te,Oe,De]),Ae=S({role:a,content:ke}),je=S({title:g().optional(),readOnlyHint:O().optional(),destructiveHint:O().optional(),idempotentHint:O().optional(),openWorldHint:O().optional()}),Me=_.extend({method:k(`notifications/tools/list_changed`),params:p.optional()}),Ne=S({name:g().optional()}),Pe=S({hints:D(Ne).optional(),costPriority:j().min(0).max(1).optional(),speedPriority:j().min(0).max(1).optional(),intelligencePriority:j().min(0).max(1).optional()}),ze=S({mode:E([`auto`,`required`,`none`]).optional()}),Ve=S({type:k(`boolean`),title:g().optional(),description:g().optional(),default:O().optional()}),I=S({type:k(`string`),title:g().optional(),description:g().optional(),minLength:j().optional(),maxLength:j().optional(),format:E([`email`,`uri`,`date`,`date-time`]).optional(),default:g().optional()}),He=S({type:E([`number`,`integer`]),title:g().optional(),description:g().optional(),minimum:j().optional(),maximum:j().optional(),default:j().optional()}),Ue=S({type:k(`string`),title:g().optional(),description:g().optional(),enum:D(g()),default:g().optional()}),We=S({type:k(`string`),title:g().optional(),description:g().optional(),oneOf:D(S({const:g(),title:g()})),default:g().optional()}),Ge=S({type:k(`string`),title:g().optional(),description:g().optional(),enum:D(g()),enumNames:D(g()).optional(),default:g().optional()}),Ke=h([Ue,We]),qe=S({type:k(`array`),title:g().optional(),description:g().optional(),minItems:j().optional(),maxItems:j().optional(),items:S({type:k(`string`),enum:D(g())}),default:D(g()).optional()}),L=S({type:k(`array`),title:g().optional(),description:g().optional(),minItems:j().optional(),maxItems:j().optional(),items:S({anyOf:D(S({const:g(),title:g()}))}),default:D(g()).optional()}),Je=h([qe,L]),R=h([Ge,Ke,Je]),z=h([R,Ve,I,He]),B=f.extend({mode:k(`form`).optional(),message:g(),requestedSchema:S({type:k(`object`),properties:C(g(),z),required:D(g()).optional()}).catchall(b())}),Ye=S({type:k(`ref/resource`),uri:g()}),V=S({type:k(`ref/prompt`),name:g()}),Xe=S({uri:g().startsWith(`file://`),name:g().optional(),_meta:C(g(),b()).optional()}),Ze=ae.shape,Qe=S({experimental:Ze.experimental,sampling:Ze.sampling,elicitation:Ze.elicitation,roots:Ze.roots,extensions:Ze.extensions}),$e=se.shape,et=S({experimental:$e.experimental,logging:$e.logging,completions:$e.completions,prompts:$e.prompts,resources:$e.resources,tools:$e.tools,extensions:$e.extensions}),tt=M({progressToken:n.optional(),[Fe]:g(),[Ie]:w.optional(),[Re]:Qe,[Be]:o.optional()}),nt=S({...x.shape,...y.shape,description:g().optional(),inputSchema:M({$schema:g().optional(),type:k(`object`)}),outputSchema:M({$schema:g().optional()}).optional(),annotations:je.optional(),_meta:C(g(),b()).optional()}),rt=S({type:k(`tool_result`),toolUseId:g(),content:D(ke),structuredContent:b().optional(),isError:O().optional(),_meta:C(g(),b()).optional()}),it=h([Ce,we,Te,Ee,rt]),at=S({role:a,content:h([it,D(it)]),_meta:C(g(),b()).optional()}),ot=g(),st=M({[Le]:w.optional().catch(void 0)}),ct=st.optional();function H(e){return M({_meta:ct,resultType:ot.default(`complete`),...e})}let lt=H({}),ut=H({nextCursor:r.optional()}),dt=H({content:D(ke),structuredContent:b().optional(),isError:O().optional()}),ft=H({ttlMs:j().int().min(0),cacheScope:E([`public`,`private`]),tools:D(nt),nextCursor:r.optional()}),pt=H({ttlMs:j().int().min(0),cacheScope:E([`public`,`private`]),prompts:D(xe),nextCursor:r.optional()}),mt=H({description:g().optional(),messages:D(Ae)}),ht=H({ttlMs:j().int().min(0),cacheScope:E([`public`,`private`]),resources:D(ge),nextCursor:r.optional()}),gt=H({ttlMs:j().int().min(0),cacheScope:E([`public`,`private`]),resourceTemplates:D(_e),nextCursor:r.optional()}),_t=H({ttlMs:j().int().min(0),cacheScope:E([`public`,`private`]),contents:D(h([he,N]))}),vt=H({completion:S({values:D(g()).max(100),total:j().int().optional(),hasMore:O().optional()}).loose()}),yt=H({ttlMs:j().int().min(0),cacheScope:E([`public`,`private`])}),bt=H({ttlMs:j().int().min(0).catch(0),cacheScope:E([`public`,`private`]).catch(`private`),supportedVersions:D(g()),capabilities:et,instructions:g().optional()}),xt=S({messages:D(at),modelPreferences:Pe.optional(),systemPrompt:g().optional(),includeContext:E([`none`,`thisServer`,`allServers`]).optional(),temperature:j().optional(),maxTokens:j().int(),stopSequences:D(g()).optional(),metadata:t.optional(),tools:D(nt).optional(),toolChoice:ze.optional()}),St=S({method:k(`sampling/createMessage`),params:xt}),Ct=S({method:k(`roots/list`),params:S({_meta:C(g(),b()).optional()}).optional()}),wt=S({...at.shape,model:g(),stopReason:g().optional()}),Tt=S({roots:D(Xe)}),Et=S({action:E([`accept`,`decline`,`cancel`]),content:C(g(),h([g(),j(),O(),D(g())])).optional()}),Dt=S({mode:k(`url`),message:g(),url:g().url()}),Ot=h([B,Dt]),kt=S({method:k(`elicitation/create`),params:Ot}),At=h([St,Ct,kt]),jt=h([wt,Tt,Et]),Mt=C(g(),At),Nt=C(g(),jt),Pt=H({inputRequests:Mt.optional(),requestState:g().optional()}),Ft={inputResponses:Nt.optional(),requestState:g().optional()},It=S({_meta:tt,...Ft}),Lt=M({progressToken:n.optional()});function U(e,t){return S({method:k(e),params:S({_meta:tt,...t})})}function W(e,t){return S({method:k(e),params:S({_meta:Lt.optional(),...t}).optional()})}let Rt={name:g(),arguments:C(g(),b()).optional(),...Ft},zt={cursor:r.optional()},Bt=U(`tools/call`,Rt),Vt=U(`tools/list`,zt),Ht=U(`prompts/list`,zt),Ut=U(`prompts/get`,{name:g(),arguments:C(g(),g()).optional(),...Ft}),Wt=U(`resources/list`,zt),Gt=U(`resources/templates/list`,zt),Kt=U(`resources/read`,{uri:g(),...Ft}),qt={ref:h([V,Ye]),argument:S({name:g(),value:g()}),context:S({arguments:C(g(),g()).optional()}).optional()},Jt=U(`completion/complete`,qt),Yt=U(`server/discover`,{}),Xt=S({toolsListChanged:O().optional(),promptsListChanged:O().optional(),resourcesListChanged:O().optional(),resourceSubscriptions:D(g()).optional()}),Zt={notifications:Xt},Qt=U(`subscriptions/listen`,Zt),$t=st.extend({"io.modelcontextprotocol/subscriptionId":i}),en=M({_meta:$t,resultType:ot.default(`complete`)}),tn={"tools/call":W(`tools/call`,Rt),"tools/list":W(`tools/list`,zt),"prompts/get":W(`prompts/get`,{name:g(),arguments:C(g(),g()).optional()}),"prompts/list":W(`prompts/list`,zt),"resources/list":W(`resources/list`,zt),"resources/templates/list":W(`resources/templates/list`,zt),"resources/read":W(`resources/read`,{uri:g()}),"completion/complete":W(`completion/complete`,qt),"server/discover":W(`server/discover`,{}),"subscriptions/listen":W(`subscriptions/listen`,Zt)};function G(e){return M({_meta:ct,...e})}let nn={"tools/call":G({content:D(ke),structuredContent:b().optional(),isError:O().optional()}),"tools/list":G({ttlMs:j().int().min(0),cacheScope:E([`public`,`private`]),tools:D(nt),nextCursor:r.optional()}),"prompts/get":G({description:g().optional(),messages:D(Ae)}),"prompts/list":G({ttlMs:j().int().min(0),cacheScope:E([`public`,`private`]),prompts:D(xe),nextCursor:r.optional()}),"resources/list":G({ttlMs:j().int().min(0),cacheScope:E([`public`,`private`]),resources:D(ge),nextCursor:r.optional()}),"resources/templates/list":G({ttlMs:j().int().min(0),cacheScope:E([`public`,`private`]),resourceTemplates:D(_e),nextCursor:r.optional()}),"resources/read":G({ttlMs:j().int().min(0),cacheScope:E([`public`,`private`]),contents:D(h([he,N]))}),"completion/complete":G({completion:S({values:D(g()).max(100),total:j().int().optional(),hasMore:O().optional()}).loose()}),"server/discover":G({ttlMs:j().int().min(0).catch(0),cacheScope:E([`public`,`private`]).catch(`private`),supportedVersions:D(g()),capabilities:et,instructions:g().optional()}),"subscriptions/listen":G({})},rn=M({"io.modelcontextprotocol/subscriptionId":i.optional()}),an=S({method:k(`notifications/subscriptions/acknowledged`),params:S({_meta:rn.optional(),notifications:Xt})}),on=S({_meta:rn.optional(),requestId:i,reason:g().optional()}),sn=S({method:k(`notifications/cancelled`),params:on}),cn={"notifications/cancelled":sn,"notifications/progress":ue,"notifications/message":fe,"notifications/resources/updated":be,"notifications/resources/list_changed":ve,"notifications/tools/list_changed":Me,"notifications/prompts/list_changed":Se,"notifications/subscriptions/acknowledged":an},K=e=>S({jsonrpc:k(`2.0`),id:h([g(),j().int()]),result:e}).strict();return{JSONValueSchema:e,JSONObjectSchema:t,ProgressTokenSchema:n,CursorSchema:r,RequestIdSchema:i,RoleSchema:a,LoggingLevelSchema:o,TaskMetadataSchema:c,RelatedTaskMetadataSchema:l,RequestMetaSchema:u,BaseRequestParamsSchema:d,TaskAugmentedRequestParamsSchema:f,NotificationsParamsSchema:p,NotificationSchema:_,IconSchema:v,IconsSchema:y,BaseMetadataSchema:x,ImplementationSchema:w,ClientTasksCapabilitySchema:re,ServerTasksCapabilitySchema:ie,ClientCapabilitiesSchema:ae,ServerCapabilitiesSchema:se,ProgressSchema:ce,ProgressNotificationParamsSchema:le,ProgressNotificationSchema:ue,LoggingMessageNotificationParamsSchema:de,LoggingMessageNotificationSchema:fe,ResourceContentsSchema:me,TextResourceContentsSchema:he,BlobResourceContentsSchema:N,AnnotationsSchema:P,ResourceSchema:ge,ResourceTemplateSchema:_e,ResourceListChangedNotificationSchema:ve,ResourceUpdatedNotificationParamsSchema:ye,ResourceUpdatedNotificationSchema:be,PromptArgumentSchema:F,PromptSchema:xe,PromptListChangedNotificationSchema:Se,TextContentSchema:Ce,ImageContentSchema:we,AudioContentSchema:Te,ToolUseContentSchema:Ee,EmbeddedResourceSchema:De,ResourceLinkSchema:Oe,ContentBlockSchema:ke,PromptMessageSchema:Ae,ToolAnnotationsSchema:je,ToolListChangedNotificationSchema:Me,ModelHintSchema:Ne,ModelPreferencesSchema:Pe,ToolChoiceSchema:ze,BooleanSchemaSchema:Ve,StringSchemaSchema:I,NumberSchemaSchema:He,UntitledSingleSelectEnumSchemaSchema:Ue,TitledSingleSelectEnumSchemaSchema:We,LegacyTitledEnumSchemaSchema:Ge,SingleSelectEnumSchemaSchema:Ke,UntitledMultiSelectEnumSchemaSchema:qe,TitledMultiSelectEnumSchemaSchema:L,MultiSelectEnumSchemaSchema:Je,EnumSchemaSchema:R,PrimitiveSchemaDefinitionSchema:z,ElicitRequestFormParamsSchema:B,ResourceTemplateReferenceSchema:Ye,PromptReferenceSchema:V,RootSchema:Xe,ClientCapabilities2026Schema:Qe,ServerCapabilities2026Schema:et,RequestMetaEnvelopeSchema:tt,ToolSchema:nt,ToolResultContentSchema:rt,SamplingMessageContentBlockSchema:it,SamplingMessageSchema:at,ResultTypeSchema:ot,ResultMetaSchema:st,ResultSchema:lt,PaginatedResultSchema:ut,CallToolResultSchema:dt,ListToolsResultSchema:ft,ListPromptsResultSchema:pt,GetPromptResultSchema:mt,ListResourcesResultSchema:ht,ListResourceTemplatesResultSchema:gt,ReadResourceResultSchema:_t,CompleteResultSchema:vt,CacheableResultSchema:yt,DiscoverResultSchema:bt,CreateMessageRequestParamsSchema:xt,CreateMessageRequestSchema:St,ListRootsRequestSchema:Ct,CreateMessageResultSchema:wt,ListRootsResultSchema:Tt,ElicitResultSchema:Et,ElicitRequestURLParamsSchema:Dt,ElicitRequestParamsSchema:Ot,ElicitRequestSchema:kt,InputRequestSchema:At,InputResponseSchema:jt,InputRequestsSchema:Mt,InputResponsesSchema:Nt,InputRequiredResultSchema:Pt,InputResponseRequestParamsSchema:It,CallToolRequestSchema:Bt,ListToolsRequestSchema:Vt,ListPromptsRequestSchema:Ht,GetPromptRequestSchema:Ut,ListResourcesRequestSchema:Wt,ListResourceTemplatesRequestSchema:Gt,ReadResourceRequestSchema:Kt,CompleteRequestSchema:Jt,DiscoverRequestSchema:Yt,SubscriptionFilterSchema:Xt,SubscriptionsListenRequestSchema:Qt,SubscriptionsListenResultMetaSchema:$t,SubscriptionsListenResultSchema:en,dispatchRequestSchemas:tn,dispatchResultSchemas:nn,NotificationMetaSchema:rn,SubscriptionsAcknowledgedNotificationSchema:an,CancelledNotificationParamsSchema:on,CancelledNotificationSchema:sn,notificationSchemas2026:cn,JSONRPCResultResponseSchema:K(lt),CallToolResultResponseSchema:K(h([dt,Pt])),ListToolsResultResponseSchema:K(ft),ListPromptsResultResponseSchema:K(pt),GetPromptResultResponseSchema:K(h([mt,Pt])),ListResourcesResultResponseSchema:K(ht),ListResourceTemplatesResultResponseSchema:K(gt),ReadResourceResultResponseSchema:K(h([_t,Pt])),CompleteResultResponseSchema:K(vt),DiscoverResultResponseSchema:K(bt),SubscriptionsListenResultResponseSchema:K(en)}}var Bi;function Vi(){return Bi??=zi()}var Hi=[`tools/list`,`prompts/list`,`resources/list`,`resources/templates/list`,`resources/read`,`server/discover`];function Ui(e){return Hi.includes(e)}var Wi=Symbol(`modelcontextprotocol.resultCacheHintFallback`);function Gi(e){return e[Wi]}function Ki(e){return typeof e==`number`&&Number.isSafeInteger(e)&&e>=0}function qi(e){return e===`public`||e===`private`}var X=function(e){return e[e.ParseError=-32700]=`ParseError`,e[e.InvalidRequest=-32600]=`InvalidRequest`,e[e.MethodNotFound=-32601]=`MethodNotFound`,e[e.InvalidParams=-32602]=`InvalidParams`,e[e.InternalError=-32603]=`InternalError`,e[e.ResourceNotFound=-32002]=`ResourceNotFound`,e[e.MissingRequiredClientCapability=-32021]=`MissingRequiredClientCapability`,e[e.UnsupportedProtocolVersion=-32022]=`UnsupportedProtocolVersion`,e[e.UrlElicitationRequired=-32042]=`UrlElicitationRequired`,e}({}),Z=class e extends Error{static{Object.defineProperty(this,"mcpBrand",{value:`mcp.ProtocolError`})}static[Symbol.hasInstance](e){return $r(this,e)}static isInstance(e){if(typeof this!=`function`)throw TypeError("isInstance must be called on the class (e.g. `SdkError.isInstance(value)`); for callbacks use `v => SdkError.isInstance(v)`");return $r(this,e)}constructor(e,t,n){super(t),this.code=e,this.data=n,this.name=`ProtocolError`,Qr(this,new.target)}static fromError(t,n,r){if(t===X.UrlElicitationRequired&&r){let e=r;if(e.elicitations)return new Yi(e.elicitations,n)}if(t===X.UnsupportedProtocolVersion&&r){let e=r;if(Array.isArray(e.supported)&&typeof e.requested==`string`)return new Xi({supported:e.supported,requested:e.requested},n)}if(t===X.InvalidParams||t===X.ResourceNotFound){let e=r;if(typeof e?.uri==`string`&&(t===X.ResourceNotFound||Object.keys(e).length===1))return new Ji(e.uri,n)}if(t===X.MissingRequiredClientCapability&&r){let e=r;if(e.requiredCapabilities!==null&&typeof e.requiredCapabilities==`object`&&!Array.isArray(e.requiredCapabilities))return new Zi({requiredCapabilities:e.requiredCapabilities},n)}return new e(t,n,r)}},Ji=class extends Z{static{Object.defineProperty(this,"mcpBrand",{value:`mcp.ResourceNotFoundError`})}constructor(e,t=`Resource not found: ${e}`){super(X.InvalidParams,t,{uri:e})}get uri(){return this.data.uri}},Yi=class extends Z{static{Object.defineProperty(this,"mcpBrand",{value:`mcp.UrlElicitationRequiredError`})}constructor(e,t=`URL elicitation${e.length>1?`s`:``} required`){super(X.UrlElicitationRequired,t,{elicitations:e})}get elicitations(){return this.data?.elicitations??[]}},Xi=class extends Z{static{Object.defineProperty(this,"mcpBrand",{value:`mcp.UnsupportedProtocolVersionError`})}constructor(e,t=`Unsupported protocol version: ${e.requested}`){super(X.UnsupportedProtocolVersion,t,e)}get supported(){return this.data.supported}get requested(){return this.data.requested}},Zi=class extends Z{static{Object.defineProperty(this,"mcpBrand",{value:`mcp.MissingRequiredClientCapabilityError`})}constructor(e,t=`Missing required client capabilities: ${Object.keys(e.requiredCapabilities).join(`, `)}`){super(X.MissingRequiredClientCapability,t,e)}get requiredCapabilities(){return this.data.requiredCapabilities}},Qi=0,$i=`private`,ea=[`tools/call`,`prompts/get`,`resources/read`];function ta(e,t){let n=t.resultType;if(n===void 0)return{...t,resultType:`complete`};if(n===`complete`||ea.includes(e))return t;throw new Z(X.InternalError,`Handler for ${e} returned resultType '${String(n)}', but results of ${e} only support 'complete' on protocol revision 2026-07-28`)}function na(e,t){let n=Gi(t);if(t.resultType!==`complete`||!Ui(e))return n===void 0?t:sa(t);let r=t,i=Ki(r.ttlMs)?r.ttlMs:aa(n),a=qi(r.cacheScope)?r.cacheScope:oa(n),o={...r,ttlMs:i,cacheScope:a};return delete o[Wi],o}function ra(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function ia(e,t){if(t===void 0)return e;let n=e._meta;return n===void 0?{...e,_meta:{[Le]:t}}:!ra(n)||n[`io.modelcontextprotocol/serverInfo`]!==void 0?e:{...e,_meta:{...n,[Le]:t}}}function aa(e){return e!==void 0&&Ki(e.ttlMs)?e.ttlMs:Qi}function oa(e){return e!==void 0&&qi(e.cacheScope)?e.cacheScope:$i}function sa(e){let t={...e};return delete t[Wi],t}var ca=[`elicitation/create`,`sampling/createMessage`,`roots/list`],la;function ua(){if(la)return la;let e=Vi();return la={request:{"elicitation/create":S({method:k(`elicitation/create`),params:e.ElicitRequestParamsSchema}),"sampling/createMessage":S({method:k(`sampling/createMessage`),params:e.CreateMessageRequestParamsSchema}),"roots/list":S({method:k(`roots/list`),params:M({}).optional()})},response:{"elicitation/create":e.ElicitResultSchema,"sampling/createMessage":e.CreateMessageResultSchema,"roots/list":e.ListRootsResultSchema}},la}function da(e){return ca.includes(e)}function fa(e){return da(e)?ua().request[e]:void 0}function pa(e){return da(e)?ua().response[e]:void 0}var ma={"tools/call":null,"tools/list":null,"prompts/get":null,"prompts/list":null,"resources/list":null,"resources/templates/list":null,"resources/read":null,"completion/complete":null,"server/discover":null,"subscriptions/listen":null},ha={"notifications/cancelled":null,"notifications/progress":null,"notifications/message":null,"notifications/resources/updated":null,"notifications/resources/list_changed":null,"notifications/tools/list_changed":null,"notifications/prompts/list_changed":null,"notifications/subscriptions/acknowledged":null};function ga(e){return Object.prototype.hasOwnProperty.call(ma,e)}function _a(e){return Object.prototype.hasOwnProperty.call(ha,e)}function va(e){return Object.prototype.hasOwnProperty.call(ma,e)}function ya(e){return ga(e)?Vi().dispatchRequestSchemas[e]:void 0}function ba(e){return va(e)?Vi().dispatchResultSchemas[e]:void 0}function xa(e){return _a(e)?Vi().notificationSchemas2026[e]:void 0}Object.keys(ma),Object.keys(ha);function Sa(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function Ca(e,t){if(e===void 0)return{ok:!1,reason:`not-in-era`};let n=e.safeParse(t);return n.success?{ok:!0,value:n.data}:{ok:!1,reason:`invalid`,message:String(n.error)}}var wa={ok:!1,reason:`not-in-era`},Ta=[Fe,Re];function Ea(e,t){let n=t,r=!1,i=()=>(r||=(n={...n},!0),n),a=t.tools;e===`tools/list`&&Array.isArray(a)&&a.some(e=>Sa(e)&&`execution`in e)&&(i().tools=a.map(e=>{if(!Sa(e)||!(`execution`in e))return e;let t={...e};return delete t.execution,t}));let o=t.capabilities;if(Sa(o)&&`tasks`in o){let e={...o};delete e.tasks,i().capabilities=e}return n}var Da={era:`2026-07-28`,hasRequestMethod:ga,hasNotificationMethod:_a,hasInputRequestMethod:e=>fa(e)!==void 0,validateRequest:(e,t)=>Ca(ya(e),t),validateResult:(e,t)=>Ca(ba(e),t),validateNotification:(e,t)=>Ca(xa(e),t),validateInputRequest:(e,t)=>Ca(fa(e),t),validateInputResponse:(e,t)=>Ca(pa(e),t),samplingResultVariant:()=>wa,outboundEnvelope(e){return{[Fe]:e.protocolVersion,[Ie]:e.clientInfo,[Re]:e.clientCapabilities,...e.logLevel!==void 0&&{"io.modelcontextprotocol/logLevel":e.logLevel}}},validateEnvelopeMeta(e){let t=[];for(let n of Ta)n in e||t.push({key:n,problem:`missing`});let n=Vi().RequestMetaEnvelopeSchema.safeParse(e);if(!n.success)for(let e of n.error.issues){let n=e.path.map(String),r=n.length>0?n.join(`.`):`_meta`;n.length===1&&t.some(e=>e.key===r&&e.problem===`missing`)||t.push({key:r,problem:e.message})}return t},projectCallToolResult:e=>di(e),inputRequestSchema:fa,decodeResult(e,t){if(!Sa(t))return{kind:`invalid`,error:new Y(J.InvalidResult,`Invalid result for ${e}: not an object`,{method:e})};let n=t.resultType;if(n===void 0)return{kind:`invalid`,error:new Y(J.InvalidResult,`Invalid result for ${e}: missing required resultType — servers implementing protocol revision 2026-07-28 MUST include it (the absent-means-complete bridge applies only to earlier-revision servers)`,{method:e,violation:`missing-resultType`})};if(typeof n!=`string`)return{kind:`invalid`,error:new Y(J.InvalidResult,`Invalid result for ${e}: non-string resultType`,{method:e,resultType:n})};if(n===`input_required`){let n=t.inputRequests,r=Sa(n)?n:{},i=t.requestState,a=t._meta===void 0?void 0:Vi().ResultMetaSchema.safeParse(t._meta),o=a?.success?a.data:void 0;return Object.keys(r).length===0&&typeof i!=`string`?{kind:`invalid`,error:new Y(J.InvalidResult,`Invalid result for ${e}: input_required carries neither inputRequests nor requestState (every input_required result must include at least one of the two)`,{method:e,violation:`input-required-missing-both`})}:{kind:`input_required`,inputRequests:r,...typeof i==`string`&&{requestState:i},...o!==void 0&&{_meta:o}}}if(n!==`complete`)return{kind:`invalid`,error:new Y(J.UnsupportedResultType,`Unsupported result type '${n}' for ${e}`,{resultType:n,method:e})};let r=ka(),i=Object.hasOwn(r,e)?r[e]:void 0;if(i!==void 0){let n=i.safeParse(t);if(!n.success)return{kind:`invalid`,error:new Y(J.InvalidResult,`Invalid result for ${e}: ${n.error}`,{method:e})}}let a={...t};return delete a.resultType,{kind:`complete`,result:a}},encodeResult(e,t,n){return ia(na(e,ta(e,Ea(e,t))),n)},encodeErrorCode:e=>e===-32002?-32602:e,checkInboundEnvelope(e){if(e.envelope===void 0)return`Request is missing the required _meta envelope for protocol revision 2026-07-28 (io.modelcontextprotocol/protocolVersion, io.modelcontextprotocol/clientCapabilities)`;let t=Vi().RequestMetaEnvelopeSchema.safeParse(e.envelope);if(!t.success)return`Invalid _meta envelope for protocol revision 2026-07-28: ${t.error.issues.map(e=>e.message).join(`; `)}`}},Oa;function ka(){if(Oa)return Oa;let e=Vi();return Oa={"tools/call":e.CallToolResultSchema,"tools/list":e.ListToolsResultSchema,"prompts/get":e.GetPromptResultSchema,"prompts/list":e.ListPromptsResultSchema,"resources/list":e.ListResourcesResultSchema,"resources/templates/list":e.ListResourceTemplatesResultSchema,"resources/read":e.ReadResourceResultSchema,"completion/complete":e.CompleteResultSchema,"server/discover":e.DiscoverResultSchema},Oa}var Aa=`2026-07-28`;function ja(e){return e!==void 0&&ci(e)?Da:Ri}function Ma(e){return e.revision===void 0?e.era===`modern`?Da.era:Ri.era:ja(e.revision).era}function Na(e){return Ia.some(t=>t.hasRequestMethod(e))}function Pa(e){return Ia.some(t=>t.hasNotificationMethod(e))}function Fa(e){return e===`tasks/get`||e===`tasks/cancel`}var Ia=[Ri,Da],La=Ce({AnnotationsSchema:()=>Nt,AudioContentSchema:()=>ln,BaseMetadataSchema:()=>ct,BaseRequestParamsSchema:()=>L,BlobResourceContentsSchema:()=>jt,BooleanSchemaSchema:()=>Wn,CallToolRequestParamsSchema:()=>wn,CallToolRequestSchema:()=>Tn,CallToolResultSchema:()=>Sn,CancelTaskRequestSchema:()=>Ar,CancelTaskResultSchema:()=>jr,CancelledNotificationParamsSchema:()=>it,CancelledNotificationSchema:()=>at,ClientCapabilitiesSchema:()=>pt,ClientNotificationSchema:()=>Nr,ClientRequestSchema:()=>Mr,ClientResultSchema:()=>Pr,ClientTasksCapabilitySchema:()=>dt,CompatibilityCallToolResultSchema:()=>Cn,CompleteRequestParamsSchema:()=>dr,CompleteRequestSchema:()=>fr,CompleteResultSchema:()=>pr,ContentBlockSchema:()=>pn,CreateMessageRequestParamsSchema:()=>Bn,CreateMessageRequestSchema:()=>Vn,CreateMessageResultSchema:()=>Hn,CreateMessageResultWithToolsSchema:()=>Un,CreateTaskResultSchema:()=>xr,CursorSchema:()=>We,DiscoverRequestSchema:()=>yt,DiscoverResultSchema:()=>bt,ElicitRequestFormParamsSchema:()=>nr,ElicitRequestParamsSchema:()=>ir,ElicitRequestSchema:()=>ar,ElicitRequestURLParamsSchema:()=>rr,ElicitResultSchema:()=>cr,ElicitationCompleteNotificationParamsSchema:()=>or,ElicitationCompleteNotificationSchema:()=>sr,EmbeddedResourceSchema:()=>dn,EmptyResultSchema:()=>rt,EnumSchemaSchema:()=>er,GetPromptRequestParamsSchema:()=>on,GetPromptRequestSchema:()=>sn,GetPromptResultSchema:()=>hn,GetTaskPayloadRequestSchema:()=>Er,GetTaskPayloadResultSchema:()=>Dr,GetTaskRequestSchema:()=>wr,GetTaskResultSchema:()=>Tr,IconSchema:()=>ot,IconsSchema:()=>st,ImageContentSchema:()=>K,ImplementationSchema:()=>H,InitializeRequestParamsSchema:()=>mt,InitializeRequestSchema:()=>ht,InitializeResultSchema:()=>_t,InitializedNotificationSchema:()=>vt,JSONArraySchema:()=>He,JSONObjectSchema:()=>I,JSONRPCErrorResponseSchema:()=>et,JSONRPCMessageSchema:()=>tt,JSONRPCNotificationSchema:()=>Qe,JSONRPCRequestSchema:()=>Ze,JSONRPCResponseSchema:()=>nt,JSONRPCResultResponseSchema:()=>$e,JSONValueSchema:()=>Ve,LegacyTitledEnumSchemaSchema:()=>Yn,ListChangedOptionsBaseSchema:()=>Dn,ListPromptsRequestSchema:()=>rn,ListPromptsResultSchema:()=>an,ListResourceTemplatesRequestSchema:()=>U,ListResourceTemplatesResultSchema:()=>W,ListResourcesRequestSchema:()=>It,ListResourcesResultSchema:()=>Lt,ListRootsRequestSchema:()=>hr,ListRootsResultSchema:()=>gr,ListTasksRequestSchema:()=>Or,ListTasksResultSchema:()=>kr,ListToolsRequestSchema:()=>bn,ListToolsResultSchema:()=>xn,LoggingLevelSchema:()=>On,LoggingMessageNotificationParamsSchema:()=>jn,LoggingMessageNotificationSchema:()=>Mn,ModelHintSchema:()=>Nn,ModelPreferencesSchema:()=>Pn,MultiSelectEnumSchemaSchema:()=>$n,NotificationSchema:()=>B,NotificationsParamsSchema:()=>z,NumberSchemaSchema:()=>Kn,PaginatedRequestParamsSchema:()=>Tt,PaginatedRequestSchema:()=>Et,PaginatedResultSchema:()=>Dt,PingRequestSchema:()=>xt,PrimitiveSchemaDefinitionSchema:()=>tr,ProgressNotificationParamsSchema:()=>Ct,ProgressNotificationSchema:()=>wt,ProgressSchema:()=>St,ProgressTokenSchema:()=>Ue,PromptArgumentSchema:()=>G,PromptListChangedNotificationSchema:()=>gn,PromptMessageSchema:()=>mn,PromptReferenceSchema:()=>ur,PromptSchema:()=>nn,ReadResourceRequestParamsSchema:()=>zt,ReadResourceRequestSchema:()=>Bt,ReadResourceResultSchema:()=>Vt,RelatedTaskMetadataSchema:()=>Ke,RequestIdSchema:()=>Xe,RequestMetaSchema:()=>qe,RequestSchema:()=>R,ResourceContentsSchema:()=>Ot,ResourceLinkSchema:()=>fn,ResourceListChangedNotificationSchema:()=>Ht,ResourceRequestParamsSchema:()=>Rt,ResourceSchema:()=>Pt,ResourceTemplateReferenceSchema:()=>lr,ResourceTemplateSchema:()=>Ft,ResourceUpdatedNotificationParamsSchema:()=>en,ResourceUpdatedNotificationSchema:()=>tn,ResultMetaObjectSchema:()=>Ye,ResultSchema:()=>V,RoleSchema:()=>Mt,RootSchema:()=>mr,RootsListChangedNotificationSchema:()=>_r,SamplingContentSchema:()=>Ln,SamplingMessageContentBlockSchema:()=>Rn,SamplingMessageSchema:()=>zn,ServerCapabilitiesSchema:()=>gt,ServerNotificationSchema:()=>Ir,ServerRequestSchema:()=>Fr,ServerResultSchema:()=>Lr,ServerTasksCapabilitySchema:()=>ft,SetLevelRequestParamsSchema:()=>kn,SetLevelRequestSchema:()=>An,SingleSelectEnumSchemaSchema:()=>Xn,StringSchemaSchema:()=>Gn,SubscribeRequestParamsSchema:()=>Ut,SubscribeRequestSchema:()=>Wt,SubscriptionFilterSchema:()=>qt,SubscriptionsAcknowledgedNotificationParamsSchema:()=>Xt,SubscriptionsAcknowledgedNotificationSchema:()=>Zt,SubscriptionsListenRequestParamsSchema:()=>Jt,SubscriptionsListenRequestSchema:()=>Yt,SubscriptionsListenResultMetaSchema:()=>Qt,SubscriptionsListenResultSchema:()=>$t,TaskAugmentedRequestParamsSchema:()=>Je,TaskCreationParamsSchema:()=>vr,TaskMetadataSchema:()=>Ge,TaskSchema:()=>br,TaskStatusNotificationParamsSchema:()=>Sr,TaskStatusNotificationSchema:()=>Cr,TaskStatusSchema:()=>yr,TextContentSchema:()=>cn,TextResourceContentsSchema:()=>kt,TitledMultiSelectEnumSchemaSchema:()=>Qn,TitledSingleSelectEnumSchemaSchema:()=>Jn,ToolAnnotationsSchema:()=>_n,ToolChoiceSchema:()=>Fn,ToolExecutionSchema:()=>vn,ToolListChangedNotificationSchema:()=>En,ToolResultContentSchema:()=>In,ToolSchema:()=>yn,ToolUseContentSchema:()=>un,UnsubscribeRequestParamsSchema:()=>Gt,UnsubscribeRequestSchema:()=>Kt,UntitledMultiSelectEnumSchemaSchema:()=>Zn,UntitledSingleSelectEnumSchemaSchema:()=>qn}),Ra=e=>Ze.safeParse(e).success,za=e=>Qe.safeParse(e).success,Ba=e=>$e.safeParse(e).success,Va=e=>et.safeParse(e).success,Ha=e=>typeof e==`object`&&!!e&&!Array.isArray(e)&&e.resultType===`input_required`,Ua=e=>ht.safeParse(e).success,Wa=e=>vt.safeParse(e).success,Ga=`Mcp-Param-`,Ka=`x-mcp-header`,qa=/^[!#$%&'*+\-.^_`|~0-9A-Za-z]+$/,Ja=new Set([`string`,`integer`,`boolean`,`number`]);function Ya(e){let t=[],n=new Map,r=(e,i,a)=>{if(typeof e!=`object`||!e)return;let o=e;if(Ka in o){if(!a||i.length===0)return`${Qa(i)}: x-mcp-header is only permitted on properties statically reachable via a chain of 'properties' keys (not under items, additionalProperties, oneOf/anyOf/allOf/not, if/then/else, or $ref)`;let e=o[Ka];if(typeof e!=`string`||e.length===0)return`${Qa(i)}: x-mcp-header MUST be a non-empty string`;if(!qa.test(e))return`${Qa(i)}: x-mcp-header '${e}' is not a valid RFC 9110 token (no spaces, control characters or HTTP delimiters)`;let r=typeof o.type==`string`?o.type:void 0;if(r===void 0||!Ja.has(r))return`${Qa(i)}: x-mcp-header is only permitted on primitive-typed properties (string, integer, boolean); got ${r??``}`;let s=e.toLowerCase(),c=n.get(s);if(c!==void 0)return`x-mcp-header '${e}' is not case-insensitively unique (also declared as '${c}')`;n.set(s,e),t.push({path:i,headerName:e,type:r})}let s=o.properties;if(typeof s==`object`&&s)for(let[e,t]of Object.entries(s)){let n=r(t,[...i,e],a);if(n!==void 0)return n}for(let e of Xa){let t=o[e];if(t===void 0)continue;let n=Array.isArray(t)?t:typeof t==`object`&&t&&Za.has(e)?Object.values(t):[t];for(let t of n){let n=r(t,[...i,`<${e}>`],!1);if(n!==void 0)return n}}},i=r(e,[],!0);return i===void 0?{valid:!0,declarations:t}:{valid:!1,reason:i}}var Xa=[`items`,`prefixItems`,`contains`,`additionalProperties`,`unevaluatedProperties`,`unevaluatedItems`,`propertyNames`,`patternProperties`,`dependentSchemas`,`oneOf`,`anyOf`,`allOf`,`not`,`if`,`then`,`else`,`$defs`,`definitions`],Za=new Set([`patternProperties`,`dependentSchemas`,`$defs`,`definitions`]);function Qa(e){return e.length===0?``:e.join(`.`)}var $a=`=?base64?`,eo=`?=`;function to(e){if(typeof e==`string`)return e;if(typeof e==`boolean`)return e?`true`:`false`;if(typeof e==`number`)return!Number.isFinite(e)||Number.isInteger(e)&&!Number.isSafeInteger(e)?void 0:String(e)}function no(e){if(e.length===0||e.startsWith($a)&&e.endsWith(eo)||e!==e.trim())return!0;for(let t=0;t=32&&n<=126))return!0}return!1}function ro(e){let t=new TextEncoder().encode(e),n=``;for(let e of t)n+=String.fromCodePoint(e);return btoa(n)}function io(e){return no(e)?`${$a}${ro(e)}${eo}`:e}function ao(e,t){let n=e;for(let e of t){if(typeof n!=`object`||!n)return;n=n[e]}return n}function oo(e,t){let n={};for(let r of e){let e=ao(t,r.path);if(e==null)continue;let i=to(e);i!==void 0&&(n[`${Ga}${r.headerName}`]=io(i))}return n}X.InvalidRequest,X.UnsupportedProtocolVersion,X.InvalidParams,X.MethodNotFound,X.InvalidParams,X.MissingRequiredClientCapability,X.ParseError,X.InvalidRequest,X.MethodNotFound,X.UnsupportedProtocolVersion,X.MissingRequiredClientCapability;var so={"tools/call":`name`,"prompts/get":`name`,"resources/read":`uri`,"tasks/get":`taskId`,"tasks/update":`taskId`,"tasks/cancel":`taskId`};function co(e,t){let n=Object.hasOwn(so,e)?so[e]:void 0;if(n===void 0)return;let r=lo(t)?t[n]:void 0;return{field:n,value:typeof r==`string`?r:void 0}}function lo(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function uo(e,t){return p(e,t)}function fo(e){return new Set(e.flatMap(e=>Object.keys(e.shape)))}function po(e){if(e==null)return!1;let t=typeof e;return t!==`object`&&t!==`function`||!(`~standard`in e)?!1:typeof e[`~standard`]?.validate==`function`}var mo=!1,ho=`draft-2020-12`;function go(e,t=`input`){let n=e[`~standard`],r;if(n.jsonSchema)r=n.jsonSchema[t]({target:ho});else if(n.vendor===`zod`){if(!(`_zod`in e))throw Error(`Schema appears to be from zod 3, which the SDK cannot convert to JSON Schema. Upgrade to zod >=4.2.0, or wrap your JSON Schema with fromJsonSchema().`);mo||(mo=!0,console.warn("[mcp-sdk] Your zod version does not implement `~standard.jsonSchema` (added in zod 4.2.0). Falling back to z.toJSONSchema(). Upgrade to zod >=4.2.0 to silence this warning.")),r=ie(e,{target:ho,io:t})}else throw Error(`Schema library "${n.vendor}" does not implement StandardJSONSchemaV1 (\`~standard.jsonSchema\`). Upgrade to a version that does, or wrap your JSON Schema with fromJsonSchema().`);if(t===`output`)return r.type===void 0&&_o(r)?{type:`object`,...r}:r;if(r.type!==void 0&&r.type!==`object`)throw Error(`MCP tool and prompt schemas must describe objects (got type: ${JSON.stringify(r.type)}). Wrap your schema in z.object({...}) or equivalent.`);return{type:`object`,...r}}function _o(e){if(`properties`in e||`patternProperties`in e||`additionalProperties`in e||`required`in e)return!0;for(let t of[`oneOf`,`anyOf`,`allOf`]){let n=e[t];if(Array.isArray(n)&&n.length>0)return n.every(e=>typeof e==`object`&&!!e&&(e.type===`object`||_o(e)))}return!1}function vo(e){return e.path?.length?`${e.path.map(e=>String(typeof e==`object`?e.key:e)).join(`.`)}: ${e.message}`:e.message}async function yo(e,t){let n=await e[`~standard`].validate(t);return n.issues&&n.issues.length>0?{success:!1,error:n.issues.map(e=>vo(e)).join(`, `)}:{success:!0,data:n.value}}function bo(e){let t=ie(e,{target:ho,io:`input`});return typeof t.pattern==`string`?t.pattern:void 0}var xo=/\\\.\\d\{(\d+)\}/;function So(e){let t=xo.exec(e),n=[void 0,-1,0];return t&&n.push(Number(t[1])),[!1,!0].flatMap(e=>[!1,!0].flatMap(t=>n.map(n=>pe({local:e,offset:t,precision:n}))))}function Co(e,t){let n;switch(e){case`email`:n=[re()];break;case`uri`:n=[ae()];break;case`date`:n=[me()];break;case`date-time`:n=So(t)}return new Set(n.map(e=>bo(e)).filter(e=>e!==void 0))}function wo(e,t,n){return n!==`zod`||Co(e,t).has(t)}function To(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function Eo(e){try{return go(e,`input`)}catch(e){let t=e instanceof Error?e.message:String(e);throw new Z(X.InvalidParams,`Elicitation requestedSchema must describe an object with flat primitive properties: ${t}`)}}var Do=new Set([`$comment`,`deprecated`,`description`,`examples`,`readOnly`,`title`,`writeOnly`]);function Oo(e){return Do.has(e)||e.startsWith(`x-`)}var ko=new Set([`$schema`,...Object.keys(nr.shape.requestedSchema.shape)]),Ao={string:fo([Gn,qn,Jn,Yn]),number:fo([Kn]),integer:fo([Kn]),boolean:fo([Wn]),array:fo([Zn,Qn])},jo=new Set(Gn.shape.format.unwrap().options);function Mo(e,t,n,r){if(!To(e))return e;let i=typeof e.type==`string`&&Object.hasOwn(Ao,e.type)?Ao[e.type]:void 0;if(i===void 0)return e;let a={};for(let[o,s]of Object.entries(e))i.has(o)||Oo(o)?a[o]=s:o===`pattern`&&e.type===`string`&&typeof e.format==`string`?jo.has(e.format)?(typeof s!=`string`||!wo(e.format,s,n))&&r.push(`${t}.${o}`):a[o]=s:r.push(`${t}.${o}`);return a}function No(e,t){let n={},r=[];for(let[i,a]of Object.entries(e))i===`properties`&&To(a)?n[i]=Object.fromEntries(Object.entries(a).map(([e,n])=>[e,Mo(n,`properties.${e}`,t,r)])):ko.has(i)?n[i]=a:Oo(i)||r.push(i);if(r.length>0)throw new Z(X.InvalidParams,`Elicitation requestedSchema contains unsupported JSON Schema constraint(s) after Standard Schema conversion: ${r.join(`, `)}`);return n}function Po(e,t){if(!To(e.properties))return t;let n=Object.entries(e.properties).filter(([,e])=>!uo(tr,e).success).map(([e])=>`properties.${e}`);return n.length>0?n.join(`, `):t}function Fo(e,t,n=``){return Array.isArray(e)&&Array.isArray(t)?e.flatMap((e,r)=>Fo(e,t[r],`${n}[${r}]`)):!To(e)||!To(t)?[]:Object.entries(e).flatMap(([e,r])=>{let i=n?`${n}.${e}`:e;return Object.prototype.hasOwnProperty.call(t,e)?Fo(r,t[e],i):Oo(e)?[]:[i]})}function Io(e){if(!po(e.requestedSchema))return{...e,mode:`form`,requestedSchema:e.requestedSchema};let t=e.requestedSchema[`~standard`].vendor,n=No(Eo(e.requestedSchema),t),r=uo(nr.shape.requestedSchema,n);if(!r.success)throw new Z(X.InvalidParams,`Elicitation requestedSchema only supports flat primitive properties (string, number, integer, boolean, and string enums): ${Po(n,r.error.message)}`);let i=Fo(n,r.data);if(i.length>0)throw new Z(X.InvalidParams,`Elicitation requestedSchema contains unsupported JSON Schema constraint(s) after Standard Schema conversion: ${i.join(`, `)}`);let a=(r.data.required??[]).filter(e=>!Object.prototype.hasOwnProperty.call(r.data.properties,e));if(a.length>0)throw new Z(X.InvalidParams,`Elicitation requestedSchema lists required properties that are not defined in properties: ${a.join(`, `)}`);return{...e,mode:`form`,requestedSchema:r.data}}function Lo(e){let t=e.inputRequests!==void 0&&Object.keys(e.inputRequests).length>0,n=typeof e.requestState==`string`;if(!t&&!n)throw TypeError(`inputRequired() requires at least one of inputRequests (with at least one entry) or requestState (spec: every InputRequiredResult MUST include at least one of the two)`);return{resultType:`input_required`,...e.inputRequests!==void 0&&{inputRequests:e.inputRequests},...e.requestState!==void 0&&{requestState:e.requestState}}}Object.assign(Lo,{elicit(e){try{return{method:`elicitation/create`,params:Io(e)}}catch(e){throw e instanceof Z?TypeError(e.message,{cause:e}):e}},elicitUrl(e){return{method:`elicitation/create`,params:{...e,mode:`url`}}},createMessage(e){return{method:`sampling/createMessage`,params:e}},listRoots(){return{method:`roots/list`}}});var Ro=!0,zo=10,Bo=250;function Vo(e){return{autoFulfill:e?.autoFulfill??Ro,maxRounds:e?.maxRounds??zo}}function Ho(e,t,n){let r=t!==void 0&&Object.keys(t).length>0;return!r&&n===void 0?e:{...e,...r&&{inputResponses:t},...n!==void 0&&{requestState:n}}}function Uo(e,t){return`Multi-round-trip request '${e}' still required input after ${t} rounds (inputRequired.maxRounds)`}function Wo(e,t){return new Promise((n,r)=>{if(t?.aborted){r(t.reason instanceof Y?t.reason:new Y(J.RequestTimeout,String(t.reason)));return}let i=setTimeout(()=>{t?.removeEventListener(`abort`,a),n()},e),a=()=>{clearTimeout(i),r(t?.reason instanceof Y?t.reason:new Y(J.RequestTimeout,String(t?.reason)))};t?.addEventListener(`abort`,a,{once:!0})})}function Go(e){let t=new AbortController,n=()=>t.abort(e?.reason);return e?.addEventListener(`abort`,n,{once:!0}),e?.aborted&&t.abort(e.reason),{signal:t.signal,abort:e=>t.abort(e),dispose:()=>e?.removeEventListener(`abort`,n)}}async function Ko(e){let{config:t,method:n,originalParams:r,requestOptions:i,hooks:a,signal:o}=e,s=e.flowStartedAt??Date.now(),c=e.firstPayload,l=0;for(;;){if(l+=1,l>t.maxRounds)throw new Y(J.InputRequiredRoundsExceeded,Uo(n,t.maxRounds),{rounds:t.maxRounds,lastResult:{inputRequests:c.inputRequests,...c.requestState!==void 0&&{requestState:c.requestState}}});i.onprogress?.({progress:l,message:`Fulfilling input required by '${n}' (round ${l})`});let e=Object.entries(c.inputRequests??{}),u;if(e.length>0){let t=Go(o);try{let n=await Promise.all(e.map(async([e,n])=>{try{return[e,await a.dispatchInputRequest(e,n,t.signal)]}catch(e){throw t.abort(e),e}}));u=Object.fromEntries(n)}finally{t.dispose()}}else await Wo(Bo,o);let d={...i.timeout!==void 0&&{timeout:i.timeout}};if(i.maxTotalTimeout!==void 0){let e=Date.now()-s,t=i.maxTotalTimeout-e;if(t<=0)throw new Y(J.RequestTimeout,`Maximum total timeout exceeded`,{maxTotalTimeout:i.maxTotalTimeout,totalElapsed:e});d.maxTotalTimeout=t}let f=await a.retry(Ho(r,u,c.requestState),d);if(Ha(f)){c={inputRequests:f.inputRequests??{},...f.requestState!==void 0&&{requestState:f.requestState}};continue}return f}}var qo=`AnnotationsSchema.AudioContentSchema.BaseMetadataSchema.BlobResourceContentsSchema.BooleanSchemaSchema.CallToolRequestSchema.CallToolRequestParamsSchema.CallToolResultSchema.CancelledNotificationSchema.CancelledNotificationParamsSchema.CancelTaskRequestSchema.CancelTaskResultSchema.ClientCapabilitiesSchema.ClientNotificationSchema.ClientRequestSchema.ClientResultSchema.CompatibilityCallToolResultSchema.CompleteRequestSchema.CompleteRequestParamsSchema.CompleteResultSchema.ContentBlockSchema.CreateMessageRequestSchema.CreateMessageRequestParamsSchema.CreateMessageResultSchema.CreateMessageResultWithToolsSchema.CreateTaskResultSchema.CursorSchema.DiscoverRequestSchema.DiscoverResultSchema.ElicitationCompleteNotificationSchema.ElicitationCompleteNotificationParamsSchema.ElicitRequestSchema.ElicitRequestFormParamsSchema.ElicitRequestParamsSchema.ElicitRequestURLParamsSchema.ElicitResultSchema.EmbeddedResourceSchema.EmptyResultSchema.EnumSchemaSchema.GetPromptRequestSchema.GetPromptRequestParamsSchema.GetPromptResultSchema.GetTaskPayloadRequestSchema.GetTaskPayloadResultSchema.GetTaskRequestSchema.GetTaskResultSchema.IconSchema.IconsSchema.ImageContentSchema.ImplementationSchema.InitializedNotificationSchema.InitializeRequestSchema.InitializeRequestParamsSchema.InitializeResultSchema.JSONArraySchema.JSONObjectSchema.JSONRPCErrorResponseSchema.JSONRPCMessageSchema.JSONRPCNotificationSchema.JSONRPCRequestSchema.JSONRPCResponseSchema.JSONRPCResultResponseSchema.JSONValueSchema.LegacyTitledEnumSchemaSchema.ListPromptsRequestSchema.ListPromptsResultSchema.ListResourcesRequestSchema.ListResourcesResultSchema.ListResourceTemplatesRequestSchema.ListResourceTemplatesResultSchema.ListRootsRequestSchema.ListRootsResultSchema.ListTasksRequestSchema.ListTasksResultSchema.ListToolsRequestSchema.ListToolsResultSchema.LoggingLevelSchema.LoggingMessageNotificationSchema.LoggingMessageNotificationParamsSchema.ModelHintSchema.ModelPreferencesSchema.MultiSelectEnumSchemaSchema.NotificationSchema.NumberSchemaSchema.PaginatedRequestSchema.PaginatedRequestParamsSchema.PaginatedResultSchema.PingRequestSchema.PrimitiveSchemaDefinitionSchema.ProgressSchema.ProgressNotificationSchema.ProgressNotificationParamsSchema.ProgressTokenSchema.PromptSchema.PromptArgumentSchema.PromptListChangedNotificationSchema.PromptMessageSchema.PromptReferenceSchema.ReadResourceRequestSchema.ReadResourceRequestParamsSchema.ReadResourceResultSchema.RelatedTaskMetadataSchema.RequestSchema.RequestIdSchema.RequestMetaSchema.ResourceSchema.ResourceContentsSchema.ResourceLinkSchema.ResourceListChangedNotificationSchema.ResourceRequestParamsSchema.ResourceTemplateSchema.ResourceTemplateReferenceSchema.ResourceUpdatedNotificationSchema.ResourceUpdatedNotificationParamsSchema.ResultMetaObjectSchema.ResultSchema.RoleSchema.RootSchema.RootsListChangedNotificationSchema.SamplingContentSchema.SamplingMessageSchema.SamplingMessageContentBlockSchema.ServerCapabilitiesSchema.ServerNotificationSchema.ServerRequestSchema.ServerResultSchema.SetLevelRequestSchema.SetLevelRequestParamsSchema.SingleSelectEnumSchemaSchema.StringSchemaSchema.SubscribeRequestSchema.SubscribeRequestParamsSchema.SubscriptionFilterSchema.SubscriptionsAcknowledgedNotificationSchema.SubscriptionsAcknowledgedNotificationParamsSchema.SubscriptionsListenRequestSchema.SubscriptionsListenRequestParamsSchema.SubscriptionsListenResultSchema.SubscriptionsListenResultMetaSchema.TaskAugmentedRequestParamsSchema.TaskCreationParamsSchema.TaskMetadataSchema.TaskSchema.TaskStatusSchema.TaskStatusNotificationSchema.TaskStatusNotificationParamsSchema.TextContentSchema.TextResourceContentsSchema.TitledMultiSelectEnumSchemaSchema.TitledSingleSelectEnumSchemaSchema.ToolSchema.ToolAnnotationsSchema.ToolChoiceSchema.ToolExecutionSchema.ToolListChangedNotificationSchema.ToolResultContentSchema.ToolUseContentSchema.UnsubscribeRequestSchema.UnsubscribeRequestParamsSchema.UntitledMultiSelectEnumSchemaSchema.UntitledSingleSelectEnumSchemaSchema`.split(`.`),Jo={IdJagTokenExchangeResponseSchema:Ur,OAuthClientInformationFullSchema:Jr,OAuthClientInformationSchema:qr,OAuthClientMetadataSchema:Kr,OAuthClientRegistrationErrorSchema:Yr,OAuthErrorResponseSchema:Wr,OAuthMetadataSchema:zr,OAuthProtectedResourceMetadataSchema:Rr,OAuthTokenRevocationRequestSchema:Xr,OAuthTokensSchema:Hr,OpenIdProviderDiscoveryMetadataSchema:Vr,OpenIdProviderMetadataSchema:Br},Yo={},Xo={};function Zo(e,t){let n=e.slice(0,-6);Yo[n]=t,Xo[n]=e=>t.safeParse(e).success}for(let e of qo)Zo(e,La[e]);for(let[e,t]of Object.entries(Jo))Zo(e,t);Object.freeze(Yo);var Qo=Object.freeze(Xo);function $o(e){switch(e){case`initialize`:case`notifications/initialized`:return ja(void 0);case`server/discover`:return ja(Aa);default:return}}var es=[Fe,Ie,Re,Be],ts=[`inputResponses`,`requestState`];function ns(e,t){let n=e.params;if(!ss(n))return{message:e,lifted:{}};let r=n._meta,i=ss(r)?es.filter(e=>e in r):[],a=t===`request`?ts.filter(e=>e in n):[];if(i.length===0&&a.length===0)return{message:e,lifted:{}};let o={},s={...n};if(i.length>0&&ss(r)){let e={},t={...r};for(let n of i)e[n]=r[n],delete t[n];o.envelope=e,Object.keys(t).length>0?s._meta=t:delete s._meta}for(let e of a)e===`inputResponses`&&(o.inputResponses=s[e]),e===`requestState`&&(o.requestState=s[e]),delete s[e];return{message:{...e,params:s},lifted:o}}function rs(e,t){let n=e.validateResult(t,void 0);if(n.ok||n.reason!==`not-in-era`)return{"~standard":{version:1,vendor:`mcp-wire-codec`,validate(n){let r=e.validateResult(t,n);return r.ok?{value:r.value}:{issues:[{message:r.reason===`invalid`?r.message:`not-in-era: ${t}`}]}}}}}function is(e){return()=>e}var as=is(void 0),os=class{_transport;_requestMessageId=0;_requestHandlers=new Map;_customSchemaRequestMethods=new Set;_requestHandlerAbortControllers=new Map;_notificationHandlers=new Map;_responseHandlers=new Map;_progressHandlers=new Map;_timeoutInfo=new Map;_pendingDebouncedNotifications=new Set;_negotiatedProtocolVersion;_supportedProtocolVersions;onclose;onerror;fallbackRequestHandler;fallbackNotificationHandler;constructor(e){this._options=e,this._supportedProtocolVersions=e?.supportedProtocolVersions??Ne,this.setNotificationHandler(`notifications/cancelled`,e=>{this._oncancel(e)}),this.setNotificationHandler(`notifications/progress`,e=>{this._onprogress(e)}),this.setRequestHandler(`ping`,e=>({}))}_shouldDropInbound(e){}_outboundMetaEnvelope(){}_envelopeOutbound(e){let t=this._outboundMetaEnvelope();if(t===void 0)return e;let n=e.params??{};return{...e,params:{...n,_meta:{...t,...n._meta}}}}_resolveNonCompleteResult(e,t){return Promise.reject(new Y(J.UnsupportedResultType,`Unsupported result type '${e.kind}' for ${t.request.method}`,{resultType:e.kind,method:t.request.method}))}_getRequestHandler(e){return this._requestHandlers.get(e)}async _oncancel(e){e.params.requestId!==void 0&&this._requestHandlerAbortControllers.get(e.params.requestId)?.abort(e.params.reason)}_setupTimeout(e,t,n,r,i=!1){this._timeoutInfo.set(e,{timeoutId:setTimeout(r,t),startTime:Date.now(),timeout:t,maxTotalTimeout:n,resetTimeoutOnProgress:i,onTimeout:r})}_resetTimeout(e){let t=this._timeoutInfo.get(e);if(!t)return!1;let n=Date.now()-t.startTime;if(t.maxTotalTimeout&&n>=t.maxTotalTimeout)throw this._timeoutInfo.delete(e),new Y(J.RequestTimeout,`Maximum total timeout exceeded`,{maxTotalTimeout:t.maxTotalTimeout,totalElapsed:n});return clearTimeout(t.timeoutId),t.timeoutId=setTimeout(t.onTimeout,t.timeout),!0}_cleanupTimeout(e){let t=this._timeoutInfo.get(e);t&&(clearTimeout(t.timeoutId),this._timeoutInfo.delete(e))}async connect(e){this._transport=e;let t=this.transport?.onclose;this._transport.onclose=()=>{try{t?.()}finally{this._onclose()}};let n=this.transport?.onerror;this._transport.onerror=e=>{n?.(e),this._onerror(e)};let r=this._transport?.onmessage;this._transport.onmessage=(e,t)=>{r?.(e,t),Ba(e)||Va(e)?this._onresponse(e):Ra(e)?this._onrequest(e,t):za(e)?this._onnotification(e,t):this._onerror(Error(`Unknown message type: ${JSON.stringify(e)}`))},e.setSupportedProtocolVersions?.(this._supportedProtocolVersions),await this._transport.start()}_onclose(){let e=this._responseHandlers;this._responseHandlers=new Map,this._progressHandlers.clear(),this._pendingDebouncedNotifications.clear();for(let e of this._timeoutInfo.values())clearTimeout(e.timeoutId);this._timeoutInfo.clear();let t=this._requestHandlerAbortControllers;this._requestHandlerAbortControllers=new Map;let n=new Y(J.ConnectionClosed,`Connection closed`);this._transport=void 0;try{this.onclose?.()}finally{for(let t of e.values())t(n);for(let e of t.values())e.abort(n)}}_onerror(e){this.onerror?.(e)}_onnotification(e,t){let{message:n}=ns(e,`notification`),r=this._negotiatedWireCodec();if(t?.classification===void 0&&this._shouldDropInbound(e)===`drop`)return;if(t?.classification!==void 0){let e=Ma(t.classification);if(e!==r.era){this._onerror(Error(`Era mismatch on inbound notification '${n.method}': classified as ${e} but this instance serves ${r.era}`));return}}if(Pa(n.method)&&!r.hasNotificationMethod(n.method))return;let i=this._notificationHandlers.get(n.method),a=this.fallbackNotificationHandler;(i!==void 0||a!==void 0)&&Promise.resolve().then(()=>i===void 0?a(n):i(n,r)).catch(e=>this._onerror(Error(`Uncaught error in notification handler: ${e}`)))}_onrequest(e,t){let{message:n,lifted:r}=ns(e,`request`),i=this._negotiatedWireCodec();if(t?.classification===void 0&&this._shouldDropInbound(e)===`drop`){this._onerror(Error(`Dropped inbound request '${e.method}': not servable on this connection's protocol era`));return}let a=this._transport,o=(e,t,r)=>{let i={jsonrpc:`2.0`,id:n.id,error:{code:e,message:t,...r!==void 0&&{data:r}}};a?.send(i).catch(e=>this._onerror(Error(`Failed to send an error response: ${e}`)))};if(t?.classification!==void 0){let e=Ma(t.classification);if(e!==i.era){this._onerror(Error(`Era mismatch on inbound request '${n.method}': classified as ${e} but this instance serves ${i.era}`));let r=t.classification.revision??e;o(X.UnsupportedProtocolVersion,`Unsupported protocol version: ${r}`,{supported:this._supportedProtocolVersions,requested:r});return}}if(Na(n.method)&&!i.hasRequestMethod(n.method)&&!(Fa(n.method)&&this._customSchemaRequestMethods.has(n.method))){o(X.MethodNotFound,`Method not found`);return}let s=this._requestHandlers.get(n.method)??this.fallbackRequestHandler;if(s===void 0){o(X.MethodNotFound,`Method not found`);return}let c=i.checkInboundEnvelope(r);if(c!==void 0){o(X.InvalidParams,c);return}let l=(e,t)=>this._notificationViaCodec(this._resolveOutboundCodec(e.method),e,{...t,relatedRequestId:n.id}),u=(e,t,r)=>this._requestWithSchemaViaCodec(this._resolveOutboundCodec(e.method),e,t,{...r,relatedRequestId:n.id}),d=new AbortController;this._requestHandlerAbortControllers.set(n.id,d);let f=r.inputResponses===void 0?void 0:us(r.inputResponses),p={sessionId:a?.sessionId,mcpReq:{id:n.id,method:n.method,_meta:n.params?._meta,...r.envelope!==void 0&&{envelope:r.envelope},...f!==void 0&&{inputResponses:f.accepted},...f!==void 0&&f.droppedKeys.length>0&&{droppedInputResponseKeys:f.droppedKeys},requestState:r.requestState===void 0?as:is(r.requestState),signal:d.signal,send:((e,t,n)=>{let r=this._resolveOutboundCodec(e.method);if(this._assertOutboundRequestInEra(r,e.method),po(t))return u(e,t,n);let i=rs(r,e.method);if(i===void 0)throw TypeError(`'${e.method}' is not a spec method; pass a result schema as the second argument to ctx.mcpReq.send().`);return u(e,i,t)}),notify:l},http:t?.authInfo?{authInfo:t.authInfo}:void 0},m=this.buildContext(p,t);Promise.resolve().then(()=>s(n,m)).then(async e=>{if(d.signal.aborted)return;let t;try{t=i.encodeResult(n.method,e,this._outboundServerInfo())}catch(e){this._onerror(Error(`Failed to encode result for ${n.method}: ${e}`)),o(X.InternalError,`Internal error`);return}let r={result:t,jsonrpc:`2.0`,id:n.id};await a?.send(r)},async e=>{if(d.signal.aborted)return;let t=Number.isSafeInteger(e.code)?e.code:X.InternalError,r={jsonrpc:`2.0`,id:n.id,error:{code:i.encodeErrorCode(t),message:e.message??`Internal error`,...e.data!==void 0&&{data:e.data}}};await a?.send(r)}).catch(e=>this._onerror(Error(`Failed to send response: ${e}`))).finally(()=>{this._requestHandlerAbortControllers.get(n.id)===d&&this._requestHandlerAbortControllers.delete(n.id)})}_onprogress(e){let{progressToken:t,...n}=e.params,r=Number(t),i=this._progressHandlers.get(r);if(!i){this._onerror(Error(`Received a progress notification for an unknown token: ${JSON.stringify(e)}`));return}let a=this._responseHandlers.get(r),o=this._timeoutInfo.get(r);if(o&&a&&o.resetTimeoutOnProgress)try{this._resetTimeout(r)}catch(e){this._responseHandlers.delete(r),this._progressHandlers.delete(r),this._cleanupTimeout(r),a(e);return}i(n)}_onresponse(e){let t=Number(e.id),n=this._responseHandlers.get(t);if(n===void 0){this._onerror(Error(`Received a response for an unknown message ID: ${JSON.stringify(e)}`));return}this._responseHandlers.delete(t),this._cleanupTimeout(t),this._progressHandlers.delete(t),Ba(e)?n(e):n(Z.fromError(e.error.code,e.error.message,e.error.data))}get transport(){return this._transport}async close(){await this._transport?.close()}request(e,t,n){let r=this._resolveOutboundCodec(e.method);if(po(t))return Fa(e.method)||this._assertOutboundRequestInEra(r,e.method),this._requestWithSchemaViaCodec(r,e,t,n);this._assertOutboundRequestInEra(r,e.method);let i=rs(r,e.method);if(i===void 0)throw TypeError(`'${e.method}' is not a spec method; pass a result schema as the second argument to request().`);return this._requestWithSchemaViaCodec(r,e,i,t)}_negotiatedWireCodec(){return ja(this._negotiatedProtocolVersion)}_wireCodec(){return this._negotiatedWireCodec()}_resolveOutboundCodec(e){if(this._negotiatedProtocolVersion===void 0){let t=$o(e);if(t)return t}return this._negotiatedWireCodec()}_assertOutboundRequestInEra(e,t){if(Na(t)&&!e.hasRequestMethod(t))throw new Y(J.MethodNotSupportedByProtocolVersion,`Method '${t}' is not supported by the negotiated protocol version (wire era ${e.era})`,{method:t,era:e.era})}_requestWithSchema(e,t,n){let r=this._resolveOutboundCodec(e.method);return this._assertOutboundRequestInEra(r,e.method),this._requestWithSchemaViaCodec(r,e,t,n)}_requestWithSchemaViaCodec(e,t,n,r){let{relatedRequestId:i,resumptionToken:a,onresumptiontoken:o,headers:s}=r??{},c=Date.now(),l,u;return new Promise((d,f)=>{let p=e=>{f(e)};if(!this._transport){p(Error(`Not connected`));return}if(this._options?.enforceStrictCapabilities===!0)try{this.assertCapabilityForMethod(t.method)}catch(e){p(e);return}if(r?.signal?.aborted){let e=r.signal.reason;throw e instanceof Y?e:new Y(J.RequestTimeout,String(e))}let m=e.era===`2026-07-28`&&this._transport.hasPerRequestStream===!0?new AbortController:void 0,h=this._requestMessageId++;u=h;let g={...t,jsonrpc:`2.0`,id:h};r?.onprogress&&(this._progressHandlers.set(h,r.onprogress),g.params={...t.params,_meta:{...t.params?._meta,progressToken:h}});let _=this._envelopeOutbound(g),v=!1,y=e=>{v||(this._progressHandlers.delete(h),m===void 0?t.method!==`initialize`&&this._transport?.send(this._envelopeOutbound({jsonrpc:`2.0`,method:`notifications/cancelled`,params:{requestId:h,reason:String(e)}}),{relatedRequestId:i,resumptionToken:a,onresumptiontoken:o}).catch(e=>this._onerror(Error(`Failed to send cancellation: ${e}`))):m.abort(),f(e instanceof Y?e:new Y(J.RequestTimeout,String(e))))};this._responseHandlers.set(h,i=>{if(r?.signal?.aborted)return;if(v=!0,i instanceof Error)return f(i);let a;try{a=e.decodeResult(t.method,i.result)}catch(e){return f(e instanceof Error?e:Error(String(e)))}if(a.kind===`invalid`)return f(a.error);if(a.kind===`input_required`){if(r?.allowInputRequired===!0)return d(gs(a));let i={codec:e,request:t,resultSchema:n,options:r,flowStartedAt:c,retry:(r,i)=>this._requestWithSchemaViaCodec(e,r===void 0?{method:t.method}:{method:t.method,params:r},n,i)};return d(this._resolveNonCompleteResult(a,i))}let o=a.result;yo(n,o).then(e=>{e.success?d(e.data):f(new Y(J.InvalidResult,`Invalid result for ${t.method}: ${e.error}`))},f)}),l=()=>y(r?.signal?.reason),r?.signal?.addEventListener(`abort`,l,{once:!0});let b=r?.timeout??6e4;this._setupTimeout(h,b,r?.maxTotalTimeout,()=>y(new Y(J.RequestTimeout,`Request timed out`,{timeout:b})),r?.resetTimeoutOnProgress??!1),this._transport.send(_,{relatedRequestId:i,resumptionToken:a,onresumptiontoken:o,headers:s,requestSignal:m?.signal}).catch(e=>{this._progressHandlers.delete(h),f(e)})}).finally(()=>{l&&r?.signal?.removeEventListener(`abort`,l),u!==void 0&&(this._responseHandlers.delete(u),this._cleanupTimeout(u))})}async notification(e,t){return await this._notificationViaCodec(this._resolveOutboundCodec(e.method),e,t)}async _notificationViaCodec(e,t,n){if(!this._transport)throw new Y(J.NotConnected,`Not connected`);if(Pa(t.method)&&!e.hasNotificationMethod(t.method))throw new Y(J.MethodNotSupportedByProtocolVersion,`Notification '${t.method}' is not supported by the negotiated protocol version (wire era ${e.era})`,{method:t.method,era:e.era});this.assertNotificationCapability(t.method);let r=this._envelopeOutbound({jsonrpc:`2.0`,...t});if((this._options?.debouncedNotificationMethods??[]).includes(t.method)&&!t.params&&n?.relatedRequestId===void 0){if(this._pendingDebouncedNotifications.has(t.method))return;this._pendingDebouncedNotifications.add(t.method),Promise.resolve().then(()=>{this._pendingDebouncedNotifications.delete(t.method),this._transport&&this._transport?.send(r,n).catch(e=>this._onerror(e))});return}await this._transport.send(r,n)}setRequestHandler(e,t,n){this.assertRequestHandlerCapability(e);let r;if(typeof t==`function`){if(!Na(e))throw TypeError(`'${e}' is not a spec request method; pass schemas as the second argument to setRequestHandler().`);r=(n,r)=>{let i=this._negotiatedWireCodec(),a=i.validateRequest(e,n);if(!a.ok&&a.reason===`not-in-era`&&(a=i.validateInputRequest(e,n)),!a.ok)throw a.reason===`not-in-era`?new Z(X.InternalError,`No wire schema for ${e} in the resolved era`):Error(a.message);return Promise.resolve(t(a.value,r))}}else if(n)r=async(r,i)=>{let a=await yo(t.params,{...r.params});if(!a.success)throw new Z(X.InvalidParams,`Invalid params for ${e}: ${a.error}`);return n(a.data,i)};else throw TypeError(`setRequestHandler: handler is required`);typeof t==`function`?this._customSchemaRequestMethods.delete(e):this._customSchemaRequestMethods.add(e),this._requestHandlers.set(e,this._wrapHandler(e,r))}_wrapHandler(e,t){return t}_outboundServerInfo(){}removeRequestHandler(e){this._requestHandlers.delete(e),this._customSchemaRequestMethods.delete(e)}assertCanSetRequestHandler(e){if(this._requestHandlers.has(e))throw Error(`A request handler for ${e} already exists, which would be overridden`)}setNotificationHandler(e,t,n){if(typeof t==`function`){if(!Pa(e))throw TypeError(`'${e}' is not a spec notification method; pass schemas as the second argument to setNotificationHandler().`);this._notificationHandlers.set(e,(n,r)=>{let i=r.validateNotification(e,n);if(!i.ok)throw i.reason===`not-in-era`?new Z(X.InternalError,`No wire schema for ${e} in the resolved era`):Error(i.message);return Promise.resolve(t(i.value))});return}if(!n)throw TypeError(`setNotificationHandler: handler is required`);this._notificationHandlers.set(e,async r=>{let i=await yo(t.params,{...r.params});if(!i.success)throw new Z(X.InvalidParams,`Invalid params for notification ${e}: ${i.error}`);await n(i.data,r)})}removeNotificationHandler(e){this._notificationHandlers.delete(e)}};function ss(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function cs(e,t){let n={...e};for(let e in t){let r=e,i=t[r];if(i===void 0)continue;let a=n[r];n[r]=ss(a)&&ss(i)?{...a,...i}:i}return n}function ls(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function us(e){let t={},n=[];if(!ls(e))return{accepted:t,droppedKeys:n};for(let[r,i]of Object.entries(e)){if(!ls(i)||`method`in i||`result`in i){n.push(r);continue}t[r]=i}return{accepted:t,droppedKeys:n}}function ds(e){throw new Y(J.SendFailed,`ctx.mcpReq.${e} is not available while fulfilling an embedded input request: the request is fulfilled locally and has no related peer request`)}function fs(e,t,n,r,i){return{sessionId:i,mcpReq:{id:e,method:t,_meta:n?._meta,requestState:is(void 0),signal:r,send:(()=>ds(`send`)),notify:()=>ds(`notify`)}}}async function ps(e,t,n,r,i){if(!ls(r)||typeof r.method!=`string`)throw new Y(J.InvalidResult,`Invalid input request '${n}': each inputRequests entry must be an embedded request object with a method`,{key:n});let a=r.method;if(!t.hasInputRequestMethod(a))throw new Y(J.InvalidResult,`Invalid input request '${n}': '${a}' is not an embedded request the ${t.era} revision defines (expected elicitation/create, sampling/createMessage, or roots/list)`,{key:n,method:a});let o=e.getRequestHandler(a);if(o===void 0)throw new Y(J.CapabilityNotSupported,`Cannot fulfil input request '${n}': no handler is registered for '${a}' on this client. Declare the corresponding capability and register a handler, or handle input_required results manually.`,{key:n,method:a});let s=ls(r.params)?r.params:void 0;return await o({jsonrpc:`2.0`,id:n,method:a,...s!==void 0&&{params:s}},e.buildContext(fs(n,a,s,i,e.sessionId)))}function ms(e,t){return{...e?.signal!==void 0&&{signal:e.signal},...e?.onprogress!==void 0&&{onprogress:e.onprogress},...e?.resetTimeoutOnProgress!==void 0&&{resetTimeoutOnProgress:e.resetTimeoutOnProgress},...e?.headers!==void 0&&{headers:e.headers},...t.timeout!==void 0&&{timeout:t.timeout},...t.maxTotalTimeout!==void 0&&{maxTotalTimeout:t.maxTotalTimeout},allowInputRequired:!0}}function hs(e,t,n,r){let{codec:i,request:a,options:o,flowStartedAt:s}=r,c={inputRequests:n.inputRequests,...n.requestState!==void 0&&{requestState:n.requestState}},l={dispatchInputRequest:(t,n,r)=>ps(e,i,t,n,r),retry:(e,t)=>r.retry(e,ms(o,t))};return Ko({config:t,method:a.method,originalParams:a.params,firstPayload:c,flowStartedAt:s,signal:o?.signal,requestOptions:{...o?.timeout!==void 0&&{timeout:o.timeout},...o?.maxTotalTimeout!==void 0&&{maxTotalTimeout:o.maxTotalTimeout},...o?.onprogress!==void 0&&{onprogress:o.onprogress}},hooks:l})}function gs(e){return{resultType:`input_required`,inputRequests:e.inputRequests,...e.requestState!==void 0&&{requestState:e.requestState},...e._meta!==void 0&&{_meta:e._meta}}}var _s=Te(Se((e=>{var t=/; *([!#$%&'*+.^_`|~0-9A-Za-z-]+) *= *("(?:[\u000b\u0020\u0021\u0023-\u005b\u005d-\u007e\u0080-\u00ff]|\\[\u000b\u0020-\u00ff])*"|[!#$%&'*+.^_`|~0-9A-Za-z-]+) */g,n=/\\([\u000b\u0020-\u00ff])/g,r=/^[!#$%&'*+.^_`|~0-9A-Za-z-]+\/[!#$%&'*+.^_`|~0-9A-Za-z-]+$/;e.parse=i;function i(e){if(!e)throw TypeError(`argument string is required`);var i=typeof e==`object`?a(e):e;if(typeof i!=`string`)throw TypeError(`argument string is required to be a string`);var s=i.indexOf(`;`),c=s===-1?i.trim():i.slice(0,s).trim();if(!r.test(c))throw TypeError(`invalid media type`);var l=new o(c.toLowerCase());if(s!==-1){var u,d,f;for(t.lastIndex=s;d=t.exec(i);){if(d.index!==s)throw TypeError(`invalid parameter format`);s+=d[0].length,u=d[1].toLowerCase(),f=d[2],f.charCodeAt(0)===34&&(f=f.slice(1,-1),f.indexOf(`\\`)!==-1&&(f=f.replace(n,`$1`))),l.parameters[u]=f}if(s!==i.length)throw TypeError(`invalid parameter format`)}return l}function a(e){var t;if(typeof e.getHeader==`function`?t=e.getHeader(`content-type`):typeof e.headers==`object`&&(t=e.headers&&e.headers[`content-type`]),typeof t!=`string`)throw TypeError(`content-type header is missing from object`);return t}function o(e){this.parameters=Object.create(null),this.type=e}}))(),1);function vs(e){if(e)try{return _s.parse(e).type}catch{let t=(e.split(`;`,1)[0]??``).trim().toLowerCase();return t===``||e.slice(t.length).includes(`,`)?void 0:t}}function ys(e){return e?e instanceof Headers?Object.fromEntries(e.entries()):Array.isArray(e)?Object.fromEntries(e):{...e}:{}}function bs(e=fetch,t){return t?async(n,r)=>e(n,{...t,...r,headers:r?.headers?{...ys(t.headers),...ys(r.headers)}:t.headers}):e}var xs=new Set([301,302,303,307,308]),Ss=5;function Cs(e,t){return e.protocol===t.protocol&&e.host===t.host||e.protocol===`http:`&&t.protocol===`https:`&&e.hostname===t.hostname&&!e.port&&!t.port}function ws(e,t){let n=xs.has(t.status)?t.headers?.get(`location`):void 0;if(n)try{return new URL(n,e)}catch{return}}var Ts=new WeakSet;function Es(e){let t=(t,n)=>e(t,n);return Ts.add(t),t}function Ds(e){return Ts.has(e)?e:async(t,n)=>{if(n?.redirect===`error`||n?.redirect===`manual`)return e(t,n);let r=(n?.method??`GET`).toUpperCase(),i=t;for(let t=0;;t++){let a=await e(i,{...n,redirect:`manual`}),o=ws(i,a);if(!o||t===Ss)return a;let s=new URL(i),c=r===`GET`||a.status===307||a.status===308,l=!(o.username||o.password)||o.username===s.username&&o.password===s.password;if(!c||!l||!Cs(s,o))return a;await a.text?.().catch(()=>{}),i=o}}}function Os(e,t){if(t.type===`opaqueredirect`)return`Redirect not followed: this runtime does not expose where it points`;let n=ws(t.url||e,t);if(n)return n.username=n.password=n.search=n.hash=``,n.protocol===`http:`&&new URL(t.url||e).protocol===`https:`?(n.protocol=`https:`,`Redirect from https to plain http not followed; try ${n.href} as the endpoint`):`Redirect to ${n.href} not followed; use that URL as the endpoint if it is the intended server`}function ks(e,t){let n=typeof e;if(n!==typeof t)return!1;if(Array.isArray(e)){if(!Array.isArray(t))return!1;let n=e.length;if(n!==t.length)return!1;for(let r=0;r1?t[a.href]=e:(a.hash=``,r===``?n=a:Is(e,t,n))}}else if(e!==!0&&e!==!1)return t;let i=n.href+(r?`#`+r:``);if(t[i]!==void 0)throw Error(`Duplicate schema URI "${i}".`);if(t[i]=e,e===!0||e===!1)return t;if(e.__absolute_uri__===void 0&&Object.defineProperty(e,"__absolute_uri__",{enumerable:!1,value:i}),e.$ref&&e.__absolute_ref__===void 0){let t=new URL(e.$ref,n.href);t.hash=t.hash,Object.defineProperty(e,"__absolute_ref__",{enumerable:!1,value:t.href})}if(e.$recursiveRef&&e.__absolute_recursive_ref__===void 0){let t=new URL(e.$recursiveRef,n.href);t.hash=t.hash,Object.defineProperty(e,"__absolute_recursive_ref__",{enumerable:!1,value:t.href})}if(e.$anchor){let r=new URL(`#`+e.$anchor,n.href);t[r.href]=e}for(let i in e){if(Ps[i])continue;let a=`${r}/${As(i)}`,o=e[i];if(Array.isArray(o)){if(Ms[i]){let e=o.length;for(let r=0;r%\\^`{|}]|%[0-9a-f]{2})|\{[+#./;?&=,!@|]?(?:[a-z0-9_]|%[0-9a-f]{2})+(?::[1-9][0-9]{0,3}|\*)?(?:,(?:[a-z0-9_]|%[0-9a-f]{2})+(?::[1-9][0-9]{0,3}|\*)?)*\})*$/i,Us=/^(?:(?:https?|ftp):\/\/)(?:\S+(?::\S*)?@)?(?:(?!10(?:\.\d{1,3}){3})(?!127(?:\.\d{1,3}){3})(?!169\.254(?:\.\d{1,3}){2})(?!192\.168(?:\.\d{1,3}){2})(?!172\.(?:1[6-9]|2\d|3[0-1])(?:\.\d{1,3}){2})(?:[1-9]\d?|1\d\d|2[01]\d|22[0-3])(?:\.(?:1?\d{1,2}|2[0-4]\d|25[0-5])){2}(?:\.(?:[1-9]\d?|1\d\d|2[0-4]\d|25[0-4]))|(?:(?:[a-z\u{00a1}-\u{ffff}0-9]+-?)*[a-z\u{00a1}-\u{ffff}0-9]+)(?:\.(?:[a-z\u{00a1}-\u{ffff}0-9]+-?)*[a-z\u{00a1}-\u{ffff}0-9]+)*(?:\.(?:[a-z\u{00a1}-\u{ffff}]{2,})))(?::\d{2,5})?(?:\/[^\s]*)?$/iu,Ws=/^(?:urn:uuid:)?[0-9a-f]{8}-(?:[0-9a-f]{4}-){3}[0-9a-f]{12}$/i,Gs=/^(?:\/(?:[^~/]|~0|~1)*)*$/,Ks=/^#(?:\/(?:[a-z0-9_\-.!$&'()*+,;:=@]|%[0-9a-f]{2}|~0|~1)*)*$/i,qs=/^(?:0|[1-9][0-9]*)(?:#|(?:\/(?:[^~/]|~0|~1)*)*)$/,Js=e=>{if(e[0]===`"`)return!1;let[t,n,...r]=e.split(`@`);return!t||!n||r.length!==0||t.length>64||n.length>253||t[0]===`.`||t.endsWith(`.`)||t.includes(`..`)||!/^[a-z0-9.-]+$/i.test(n)||!/^[a-z0-9.!#$%&'*+/=?^_`{|}~-]+$/i.test(t)?!1:n.split(`.`).every(e=>/^[a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?$/i.test(e))},Ys=/^(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)$/,Xs=/^((([0-9a-f]{1,4}:){7}([0-9a-f]{1,4}|:))|(([0-9a-f]{1,4}:){6}(:[0-9a-f]{1,4}|((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9a-f]{1,4}:){5}(((:[0-9a-f]{1,4}){1,2})|:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9a-f]{1,4}:){4}(((:[0-9a-f]{1,4}){1,3})|((:[0-9a-f]{1,4})?:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){3}(((:[0-9a-f]{1,4}){1,4})|((:[0-9a-f]{1,4}){0,2}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){2}(((:[0-9a-f]{1,4}){1,5})|((:[0-9a-f]{1,4}){0,3}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){1}(((:[0-9a-f]{1,4}){1,6})|((:[0-9a-f]{1,4}){0,4}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(:(((:[0-9a-f]{1,4}){1,7})|((:[0-9a-f]{1,4}){0,5}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:)))$/i,Zs=e=>e.length>1&&e.length<80&&(/^P\d+([.,]\d+)?W$/.test(e)||/^P[\dYMDTHS]*(\d[.,]\d+)?[YMDHS]$/.test(e)&&/^P([.,\d]+Y)?([.,\d]+M)?([.,\d]+D)?(T([.,\d]+H)?([.,\d]+M)?([.,\d]+S)?)?$/.test(e));function Qs(e){return e.test.bind(e)}var $s={date:tc,time:nc.bind(void 0,!1),"date-time":ic,duration:Zs,uri:sc,"uri-reference":Qs(Vs),"uri-template":Qs(Hs),url:Qs(Us),email:Js,hostname:Qs(Bs),ipv4:Qs(Ys),ipv6:Qs(Xs),regex:lc,uuid:Qs(Ws),"json-pointer":Qs(Gs),"json-pointer-uri-fragment":Qs(Ks),"relative-json-pointer":Qs(qs)};function ec(e){return e%4==0&&(e%100!=0||e%400==0)}function tc(e){let t=e.match(Ls);if(!t)return!1;let n=+t[1],r=+t[2],i=+t[3];return r>=1&&r<=12&&i>=1&&i<=(r==2&&ec(n)?29:Rs[r])}function nc(e,t){let n=t.match(zs);if(!n)return!1;let r=+n[1],i=+n[2],a=+n[3],o=!!n[5];return(r<=23&&i<=59&&a<=59||r==23&&i==59&&a==60)&&(!e||o)}var rc=/t|\s/i;function ic(e){let t=e.split(rc);return t.length==2&&tc(t[0])&&nc(!0,t[1])}var ac=/\/|:/,oc=/^(?:[a-z][a-z0-9+\-.]*:)(?:\/?\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:]|%[0-9a-f]{2})*@)?(?:\[(?:(?:(?:(?:[0-9a-f]{1,4}:){6}|::(?:[0-9a-f]{1,4}:){5}|(?:[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){4}|(?:(?:[0-9a-f]{1,4}:){0,1}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){3}|(?:(?:[0-9a-f]{1,4}:){0,2}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){2}|(?:(?:[0-9a-f]{1,4}:){0,3}[0-9a-f]{1,4})?::[0-9a-f]{1,4}:|(?:(?:[0-9a-f]{1,4}:){0,4}[0-9a-f]{1,4})?::)(?:[0-9a-f]{1,4}:[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?))|(?:(?:[0-9a-f]{1,4}:){0,5}[0-9a-f]{1,4})?::[0-9a-f]{1,4}|(?:(?:[0-9a-f]{1,4}:){0,6}[0-9a-f]{1,4})?::)|[Vv][0-9a-f]+\.[a-z0-9\-._~!$&'()*+,;=:]+)\]|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)|(?:[a-z0-9\-._~!$&'()*+,;=]|%[0-9a-f]{2})*)(?::\d*)?(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*|\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*)?|(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*)(?:\?(?:[a-z0-9\-._~!$&'()*+,;=:@/?]|%[0-9a-f]{2})*)?(?:#(?:[a-z0-9\-._~!$&'()*+,;=:@/?]|%[0-9a-f]{2})*)?$/i;function sc(e){return ac.test(e)&&oc.test(e)}var cc=/[^\\]\\Z/;function lc(e){if(cc.test(e))return!1;try{return new RegExp(e,`u`),!0}catch{return!1}}function uc(e){let t=0,n=e.length,r=0,i;for(;r=55296&&i<=56319&&rks(e,t))||F.push({instanceLocation:o,keyword:`enum`,keywordLocation:`${s}/enum`,error:`Instance does not match any of ${JSON.stringify(g)}.`}):g.some(t=>e===t)||F.push({instanceLocation:o,keyword:`enum`,keywordLocation:`${s}/enum`,error:`Instance does not match any of ${JSON.stringify(g)}.`})),v!==void 0){let t=`${s}/not`;Q(e,v,n,r,i,a,o,t).valid&&F.push({instanceLocation:o,keyword:`not`,keywordLocation:t,error:`Instance matched "not" schema.`})}let xe=[];if(y!==void 0){let t=`${s}/anyOf`,l=F.length,u=!1;for(let s=0;s{let u=Object.create(c),d=Q(e,s,n,r,i,p===!0?a:null,o,`${t}/${l}`,u);return F.push(...d.errors),d.valid&&xe.push(u),d.valid}).length;u===1?F.length=l:F.splice(l,0,{instanceLocation:o,keyword:`oneOf`,keywordLocation:t,error:`Instance does not match exactly one subschema (${u} matches).`})}if((u===`object`||u===`array`)&&Object.assign(c,...xe),S!==void 0){let t=`${s}/if`;if(Q(e,S,n,r,i,a,o,t,c).valid){if(C!==void 0){let l=Q(e,C,n,r,i,a,o,`${s}/then`,c);l.valid||F.push({instanceLocation:o,keyword:`if`,keywordLocation:t,error:`Instance does not match "then" schema.`},...l.errors)}}else if(ee!==void 0){let l=Q(e,ee,n,r,i,a,o,`${s}/else`,c);l.valid||F.push({instanceLocation:o,keyword:`if`,keywordLocation:t,error:`Instance does not match "else" schema.`},...l.errors)}}if(u===`object`){if(_!==void 0)for(let t of _)t in e||F.push({instanceLocation:o,keyword:`required`,keywordLocation:`${s}/required`,error:`Instance does not have required property "${t}".`});let t=Object.keys(e);if(ne!==void 0&&t.lengthre&&F.push({instanceLocation:o,keyword:`maxProperties`,keywordLocation:`${s}/maxProperties`,error:`Instance does not have at least ${re} properties.`}),ie!==void 0){let t=`${s}/propertyNames`;for(let s in e){let e=`${o}/${As(s)}`,c=Q(s,ie,n,r,i,a,e,t);c.valid||F.push({instanceLocation:o,keyword:`propertyNames`,keywordLocation:t,error:`Property name "${s}" does not match schema.`},...c.errors)}}if(ae!==void 0){let t=`${s}/dependantRequired`;for(let n in ae)if(n in e){let r=ae[n];for(let i of r)i in e||F.push({instanceLocation:o,keyword:`dependentRequired`,keywordLocation:t,error:`Instance has "${n}" but does not have "${i}".`})}}if(oe!==void 0)for(let t in oe){let l=`${s}/dependentSchemas`;if(t in e){let s=Q(e,oe[t],n,r,i,a,o,`${l}/${As(t)}`,c);s.valid||F.push({instanceLocation:o,keyword:`dependentSchemas`,keywordLocation:l,error:`Instance has "${t}" but does not match dependant schema.`},...s.errors)}}if(se!==void 0){let t=`${s}/dependencies`;for(let s in se)if(s in e){let c=se[s];if(Array.isArray(c))for(let n of c)n in e||F.push({instanceLocation:o,keyword:`dependencies`,keywordLocation:t,error:`Instance has "${s}" but does not have "${n}".`});else{let l=Q(e,c,n,r,i,a,o,`${t}/${As(s)}`);l.valid||F.push({instanceLocation:o,keyword:`dependencies`,keywordLocation:t,error:`Instance has "${s}" but does not match dependant schema.`},...l.errors)}}}let l=Object.create(null),u=!1;if(T!==void 0){let t=`${s}/properties`;for(let s in T){if(!(s in e))continue;let d=`${o}/${As(s)}`,f=Q(e[s],T[s],n,r,i,a,d,`${t}/${As(s)}`);if(f.valid)c[s]=l[s]=!0;else if(u=i,F.push({instanceLocation:o,keyword:`properties`,keywordLocation:t,error:`Property "${s}" does not match schema.`},...f.errors),u)break}}if(!u&&E!==void 0){let t=`${s}/patternProperties`;for(let s in E){let d=new RegExp(s,`u`),f=E[s];for(let p in e){if(!d.test(p))continue;let m=`${o}/${As(p)}`,h=Q(e[p],f,n,r,i,a,m,`${t}/${As(s)}`);h.valid?c[p]=l[p]=!0:(u=i,F.push({instanceLocation:o,keyword:`patternProperties`,keywordLocation:t,error:`Property "${p}" matches pattern "${s}" but does not match associated schema.`},...h.errors))}}}if(!u&&te!==void 0){let t=`${s}/additionalProperties`;for(let s in e){if(l[s])continue;let d=`${o}/${As(s)}`,f=Q(e[s],te,n,r,i,a,d,t);f.valid?c[s]=!0:(u=i,F.push({instanceLocation:o,keyword:`additionalProperties`,keywordLocation:t,error:`Property "${s}" does not match additional properties schema.`},...f.errors))}}else if(!u&&D!==void 0){let t=`${s}/unevaluatedProperties`;for(let s in e)if(!c[s]){let l=`${o}/${As(s)}`,u=Q(e[s],D,n,r,i,a,l,t);u.valid?c[s]=!0:F.push({instanceLocation:o,keyword:`unevaluatedProperties`,keywordLocation:t,error:`Property "${s}" does not match unevaluated properties schema.`},...u.errors)}}}else if(u===`array`){de!==void 0&&e.length>de&&F.push({instanceLocation:o,keyword:`maxItems`,keywordLocation:`${s}/maxItems`,error:`Array has too many items (${e.length} > ${de}).`}),M!==void 0&&e.length=(A||0)&&(F.length=u),A===void 0&&j===void 0&&d===0?F.splice(u,0,{instanceLocation:o,keyword:`contains`,keywordLocation:l,error:`Array does not contain item matching schema.`}):A!==void 0&&dj&&F.push({instanceLocation:o,keyword:`maxContains`,keywordLocation:`${s}/maxContains`,error:`Array may contain at most ${j} items matching schema. ${d} items were found.`})}}if(!u&&ue!==void 0){let u=`${s}/unevaluatedItems`;for(;l=me||e>me)&&F.push({instanceLocation:o,keyword:`maximum`,keywordLocation:`${s}/maximum`,error:`${e} is greater than ${N?`or equal to `:``} ${me}.`})):(pe!==void 0&&eme&&F.push({instanceLocation:o,keyword:`maximum`,keywordLocation:`${s}/maximum`,error:`${e} is greater than ${me}.`}),he!==void 0&&e<=he&&F.push({instanceLocation:o,keyword:`exclusiveMinimum`,keywordLocation:`${s}/exclusiveMinimum`,error:`${e} is less than ${he}.`}),N!==void 0&&e>=N&&F.push({instanceLocation:o,keyword:`exclusiveMaximum`,keywordLocation:`${s}/exclusiveMaximum`,error:`${e} is greater than or equal to ${N}.`})),P!==void 0){let t=e%P;Math.abs(0-t)>=1.1920929e-7&&Math.abs(P-t)>=1.1920929e-7&&F.push({instanceLocation:o,keyword:`multipleOf`,keywordLocation:`${s}/multipleOf`,error:`${e} is not a multiple of ${P}.`})}}else if(u===`string`){let t=ge===void 0&&_e===void 0?0:uc(e);ge!==void 0&&t_e&&F.push({instanceLocation:o,keyword:`maxLength`,keywordLocation:`${s}/maxLength`,error:`String is too long (${t} > ${_e}).`}),ve!==void 0&&!new RegExp(ve,`u`).test(e)&&F.push({instanceLocation:o,keyword:`pattern`,keywordLocation:`${s}/pattern`,error:`String does not match pattern.`}),w!==void 0&&$s[w]&&!$s[w](e)&&F.push({instanceLocation:o,keyword:`format`,keywordLocation:`${s}/format`,error:`String does not match format "${w}".`})}return{valid:F.length===0,errors:F}}var dc=class{schema;draft;shortCircuit;lookup;constructor(e,t=`2019-09`,n=!0){this.schema=e,this.draft=t,this.shortCircuit=n,this.lookup=Is(e)}validate(e){return Q(e,this.schema,this.draft,this.lookup,this.shortCircuit)}addSchema(e,t){t&&(e={...e,$id:t}),Is(e,this.lookup)}},fc=class{shortcircuit;draft;constructor(e){this.shortcircuit=e?.shortcircuit??!0,this.draft=e?.draft}_draftFor(e){let t=je(e,`pass an explicit { draft } to CfWorkerJsonSchemaValidator to validate other dialects.`);return t===`draft-7`?`7`:t}getValidator(e){let t=new dc(e,this.draft??this._draftFor(e),this.shortcircuit);return e=>{let n=t.validate(e);return n.valid?{valid:!0,data:e,errorMessage:void 0}:{valid:!1,data:void 0,errorMessage:n.errors.map(e=>`${e.instanceLocation}: ${e.error}`).join(`; `)}}}},pc=globalThis.crypto;async function mc(e){return(await pc).getRandomValues(new Uint8Array(e))}async function hc(e){let t=``;for(;t.length128)throw`Expected a length between 43 and 128. Received ${e}.`;let t=await gc(e);return{code_verifier:t,code_challenge:await _c(t)}}var yc=class extends Error{constructor(e,t){super(e),this.name=`ParseError`,this.type=t.type,this.field=t.field,this.value=t.value,this.line=t.line}},bc=10,xc=13,Sc=32;function Cc(e){}function wc(e){if(typeof e==`function`)throw TypeError("`config` must be an object, got a function instead. Did you mean `createParser({onEvent: fn})`?");let{onEvent:t=Cc,onError:n=Cc,onRetry:r=Cc,onComment:i,maxBufferSize:a}=e,o=[],s=0,c=!0,l,u=``,d=0,f,p=!1;function m(e){if(p)throw Error("Cannot feed parser: it was terminated after exceeding the configured max buffer size. Call `reset()` to resume parsing.");if(c&&(c=!1,e.charCodeAt(0)===239&&e.charCodeAt(1)===187&&e.charCodeAt(2)===191&&(e=e.slice(3))),o.length===0){let t=g(e);t!==``&&(o.push(t),s=t.length),h();return}if(e.indexOf(` -`)===-1&&e.indexOf(`\r`)===-1){o.push(e),s+=e.length,h();return}o.push(e);let t=o.join(``);o.length=0,s=0;let n=g(t);n!==``&&(o.push(n),s=n.length),h()}function h(){a!==void 0&&(s+u.length<=a||(p=!0,o.length=0,s=0,l=void 0,u=``,d=0,f=void 0,n(new yc(`Buffered data exceeded max buffer size of ${a} characters`,{type:`max-buffer-size-exceeded`}))))}function g(e){let n=0;if(e.indexOf(`\r`)===-1){let r=e.indexOf(` -`,n);for(;r!==-1;){if(n===r){d>0&&t({id:l,event:f,data:u}),l=void 0,u=``,d=0,f=void 0,n=r+1,r=e.indexOf(` -`,n);continue}let i=e.charCodeAt(n);if(Tc(e,n,i)){let i=e.charCodeAt(n+5)===Sc?n+6:n+5,a=e.slice(i,r);if(d===0&&e.charCodeAt(r+1)===bc){t({id:l,event:f,data:a}),l=void 0,u=``,f=void 0,n=r+2,r=e.indexOf(` -`,n);continue}u=d===0?a:`${u} -${a}`,d++}else Ec(e,n,i)?f=e.slice(e.charCodeAt(n+6)===Sc?n+7:n+6,r)||void 0:_(e,n,r);n=r+1,r=e.indexOf(` -`,n)}return e.slice(n)}for(;n20?`${e.slice(0,20)}\u2026`:e}"`,{type:`unknown-field`,field:e,value:t,line:i}))}}function y(){d>0&&t({id:l,event:f,data:u}),l=void 0,u=``,d=0,f=void 0}function b(e={}){if(e.consume&&o.length>0){let e=o.join(``);_(e,0,e.length)}c=!0,l=void 0,u=``,d=0,f=void 0,o.length=0,s=0,p=!1}return{feed:m,reset:b}}function Tc(e,t,n){return n===100&&e.charCodeAt(t+1)===97&&e.charCodeAt(t+2)===116&&e.charCodeAt(t+3)===97&&e.charCodeAt(t+4)===58}function Ec(e,t,n){return n===101&&e.charCodeAt(t+1)===118&&e.charCodeAt(t+2)===101&&e.charCodeAt(t+3)===110&&e.charCodeAt(t+4)===116&&e.charCodeAt(t+5)===58}var Dc=class extends TransformStream{constructor({onError:e,onRetry:t,onComment:n,maxBufferSize:r}={}){let i;super({start(a){i=wc({onEvent:e=>{a.enqueue(e)},onError(t){typeof e==`function`&&e(t),(e===`terminate`||t.type===`max-buffer-size-exceeded`)&&a.error(t)},onRetry:t,onComment:n,maxBufferSize:r})},transform(e){i.feed(e)}})}},Oc=class extends Error{static{Object.defineProperty(this,"mcpBrand",{value:`mcp.OAuthClientFlowError`})}static[Symbol.hasInstance](e){return $r(this,e)}static isInstance(e){if(typeof this!=`function`)throw TypeError("isInstance must be called on the class (e.g. `SdkError.isInstance(value)`); for callbacks use `v => SdkError.isInstance(v)`");return $r(this,e)}constructor(e){super(e),this.name=new.target.name,Qr(this,new.target)}},kc=class extends Oc{static{Object.defineProperty(this,"mcpBrand",{value:`mcp.IssuerMismatchError`})}kind;expected;received;constructor(e,t,n){super(`Issuer mismatch in ${e===`metadata`?`authorization server metadata (RFC 8414 §3.3)`:`authorization response (RFC 9207)`}: expected ${JSON.stringify(t)}, received ${JSON.stringify(n)}`),this.kind=e,this.expected=t,this.received=n}},Ac=class extends Oc{static{Object.defineProperty(this,"mcpBrand",{value:`mcp.RegistrationRejectedError`})}status;body;submittedMetadata;constructor(e){super(`Dynamic Client Registration rejected (HTTP ${e.status}): ${e.body}`),this.status=e.status,this.body=e.body,this.submittedMetadata=e.submittedMetadata}},jc=class extends Oc{static{Object.defineProperty(this,"mcpBrand",{value:`mcp.InsecureTokenEndpointError`})}tokenEndpoint;constructor(e){super(`Refusing to send credentials to non-https token endpoint '${e}'. OAuth token requests MUST use TLS (localhost / *.localhost / 127.0.0.1 / ::1 are exempt).`),this.tokenEndpoint=e}},Mc=class extends Oc{static{Object.defineProperty(this,"mcpBrand",{value:`mcp.AuthorizationServerMismatchError`})}constructor(e,t){super(`Authorization server mismatch: credentials are bound to ${JSON.stringify(e)} but this call resolved ${JSON.stringify(t)}; refusing to present them to a different authorization server`),this.recordedIssuer=e,this.currentIssuer=t}},Nc=class extends Oc{static{Object.defineProperty(this,"mcpBrand",{value:`mcp.InsufficientScopeError`})}requiredScope;resourceMetadataUrl;errorDescription;constructor(e){super(`Insufficient scope${e.requiredScope?`: required "${e.requiredScope}"`:``}`),this.requiredScope=e.requiredScope,this.resourceMetadataUrl=e.resourceMetadataUrl,this.errorDescription=e.errorDescription}};function Pc(e,t,n){if(e)return typeof e.issuer==`string`?Fc(e.issuer,t)?e:void 0:(n?.canPersistStamp!==!1&&console.warn(`[mcp-sdk] SEP-2352: stored OAuth credential has no 'issuer' stamp (pre-upgrade storage or provider not round-tripping the value). SEP-2352 isolation is inactive for this read; ensure your provider round-trips the issuer field.`),e.issuer===void 0?e:{...e,issuer:void 0})}function Fc(e,t){return e===t||e.endsWith(`/`)&&e.slice(0,-1)===t||t.endsWith(`/`)&&t.slice(0,-1)===e}function Ic(e){if(e==null)return!1;let t=e;return typeof t.tokens==`function`&&typeof t.clientInformation==`function`}async function Lc(e,t,n){let{resourceMetadataUrl:r,scope:i}=dl(t.response);if(await al(e,{serverUrl:t.serverUrl,resourceMetadataUrl:r,scope:i,fetchFn:t.fetchFn,...n})!==`AUTHORIZED`)throw new zc}function Rc(e,t){return{token:async()=>(await e.tokens())?.access_token,onUnauthorized:async n=>Lc(e,n,t)}}var zc=class extends Error{static{Object.defineProperty(this,"mcpBrand",{value:`mcp.UnauthorizedError`})}static[Symbol.hasInstance](e){return $r(this,e)}static isInstance(e){if(typeof this!=`function`)throw TypeError("isInstance must be called on the class (e.g. `SdkError.isInstance(value)`); for callbacks use `v => SdkError.isInstance(v)`");return $r(this,e)}constructor(e){super(e??`Unauthorized`),this.name=`UnauthorizedError`,Qr(this,new.target)}};function Bc(e){return e?.authorization_response_iss_parameter_supported===!0}function Vc({iss:e,expectedIssuer:t,issParameterSupported:n}){if(t!==void 0){if(e===void 0){if(n)throw new kc(`authorization_response`,t,void 0);return}if(e!==t)throw new kc(`authorization_response`,t,e)}}function Hc(...e){let t=new Set;for(let n of e)if(n)for(let e of n.split(/\s+/))e&&t.add(e);return t.size>0?[...t].join(` `):void 0}function Uc(e,t){if(!e)return!1;let n=new Set((t??``).split(/\s+/).filter(Boolean));for(let t of e.split(/\s+/))if(t&&!n.has(t))return!0;return!1}async function Wc(e,t,n,r,i){if(typeof e==`string`)return{authorizationCode:e,iss:t};let a=e.get(`iss`)??void 0,o=e.get(`code`);if(o)return{authorizationCode:o,iss:a};let s=(await n.discoveryState?.())?.authorizationServerMetadata;if(!s)try{s=(await xl(r,i)).authorizationServerMetadata}catch{s=void 0}if(!s)throw new zc(`Authorization callback failed and the issuer could not be verified`);Vc({iss:a,expectedIssuer:s.issuer,issParameterSupported:Bc(s)});let c=e.get(`error`);throw c?new ti(c,e.get(`error_description`)??c,e.get(`error_uri`)??void 0):new zc("Authorization callback contained neither `code` nor `error`")}function Gc(e){return[`client_secret_basic`,`client_secret_post`,`none`].includes(e)}var Kc=`code`,qc=`S256`;function Jc(e,t){let n=e.client_secret!==void 0;return`token_endpoint_auth_method`in e&&e.token_endpoint_auth_method&&Gc(e.token_endpoint_auth_method)&&(t.length===0||t.includes(e.token_endpoint_auth_method))?e.token_endpoint_auth_method:t.length===0?n?`client_secret_basic`:`none`:n&&t.includes(`client_secret_basic`)?`client_secret_basic`:n&&t.includes(`client_secret_post`)?`client_secret_post`:t.includes(`none`)?`none`:n?`client_secret_post`:`none`}function Yc(e,t,n,r){let{client_id:i,client_secret:a}=t;switch(e){case`client_secret_basic`:Xc(i,a,n);return;case`client_secret_post`:Zc(i,a,r);return;case`none`:Qc(i,r);return;default:throw Error(`Unsupported client authentication method: ${e}`)}}function Xc(e,t,n){if(!t)throw Error(`client_secret_basic authentication requires a client_secret`);let r=btoa(`${e}:${t}`);n.set(`Authorization`,`Basic ${r}`)}function Zc(e,t,n){n.set(`client_id`,e),t&&n.set(`client_secret`,t)}function Qc(e,t){t.set(`client_id`,e)}function $c(e){return e===`localhost`||e.endsWith(`.localhost`)||e===`127.0.0.1`||e===`[::1]`||e===`::1`}function el(e){let t=new URL(String(e));if(t.protocol!==`https:`&&!$c(t.hostname))throw new jc(t.href);return t}function tl(e){for(let t of e??[]){let e;try{e=new URL(t)}catch{continue}if(e.protocol!==`http:`&&e.protocol!==`https:`||$c(e.hostname))return`native`}return`web`}function nl(e){let t=e.clientMetadata;return{...t,grant_types:t.grant_types??(e.redirectUrl===void 0?void 0:[`authorization_code`,`refresh_token`]),application_type:t.application_type??tl(t.redirect_uris)}}async function rl(e){let t=e instanceof Response?e.status:void 0,n=e instanceof Response?await e.text():e;try{let e=Wr.parse(JSON.parse(n));return ti.fromResponse(e)}catch(e){let r=`${t?`HTTP ${t}: `:``}Invalid OAuth error response: ${e}. Raw body: ${n}`;return new ti(ei.ServerError,r)}}function il(e,t,n){let r=e.invalidateCredentials===void 0?`retrying authorization without discarding the stored ${n} (provider implements no invalidateCredentials())`:`invalidating the stored ${n} and retrying authorization`;console.warn(`[mcp-sdk] OAuth ${JSON.stringify(t.code)} — ${r}. Cause: ${JSON.stringify(t.message)}`)}async function al(e,t){try{return await sl(e,t)}catch(n){if(n instanceof ti){if(n.code===ei.InvalidClient||n.code===ei.UnauthorizedClient)return il(e,n,`client credentials and tokens`),await e.invalidateCredentials?.(`client`),await e.invalidateCredentials?.(`tokens`),await sl(e,t);if(n.code===ei.InvalidGrant||n.code===ei.InvalidDpopProof)return il(e,n,`tokens`),await e.invalidateCredentials?.(`tokens`),await sl(e,t)}throw n}}function ol(e){let{requestedScope:t,resourceMetadata:n,authServerMetadata:r,clientMetadata:i}=e,a=t||n?.scopes_supported?.join(` `)||i.scope;return a&&r?.scopes_supported?.includes(`offline_access`)&&!a.split(` `).includes(`offline_access`)&&i.grant_types?.includes(`refresh_token`)&&(a=`${a} offline_access`),a}async function sl(e,{serverUrl:t,authorizationCode:n,iss:r,scope:i,resourceMetadataUrl:a,fetchFn:o,skipIssuerMetadataValidation:s,forceReauthorization:c}){let l=nl(e),u=await e.discoveryState?.(),d,f,p,m,h=a;if(!h&&u?.resourceMetadataUrl&&(h=new URL(u.resourceMetadataUrl)),u?.authorizationServerUrl){if(f=u.authorizationServerUrl,d=u.resourceMetadata,p=u.authorizationServerMetadata??await bl(f,{fetchFn:o,skipIssuerValidation:s}),!d)try{d=await pl(t,{resourceMetadataUrl:h},o)}catch(e){if(e instanceof TypeError)throw e}(p!==u.authorizationServerMetadata||d!==u.resourceMetadata)&&await e.saveDiscoveryState?.({authorizationServerUrl:String(f),resourceMetadataUrl:h?.toString(),resourceMetadata:d,authorizationServerMetadata:p})}else{let e=await xl(t,{resourceMetadataUrl:h,fetchFn:o,skipIssuerMetadataValidation:s});f=e.authorizationServerUrl,p=e.authorizationServerMetadata,d=e.resourceMetadata,m={authorizationServerUrl:String(f),resourceMetadataUrl:h?.toString(),resourceMetadata:d,authorizationServerMetadata:p}}let g=p?.issuer??String(f),_={issuer:g};if(await e.saveAuthorizationServerUrl?.(g),n!==void 0){let t=u?.authorizationServerMetadata?.issuer??u?.authorizationServerUrl;if(t===void 0){if(e.saveDiscoveryState!==void 0)throw new Mc(`discoveryState was not available on the callback leg; ensure your provider persists discoveryState alongside codeVerifier`,g);console.warn(`[mcp-sdk] OAuthClientProvider does not implement saveDiscoveryState()/discoveryState(); the SEP-2352 callback-leg authorization-server binding cannot be checked. Implement discoveryState (persist alongside codeVerifier) — see docs/migration/upgrade-to-v2.md §SEP-2352.`)}else if(!Fc(t,g))throw new Mc(t,g)}m&&await e.saveDiscoveryState?.(m);let v=await ll(t,e,d),y=v&&d&&!e.validateResourceURL?d.resource:v;y&&await e.saveResourceUrl?.(Sl(y));let b=ol({requestedScope:i,resourceMetadata:d,authServerMetadata:p,clientMetadata:e.clientMetadata}),x=await Promise.resolve(e.clientInformation(_)),S=Pc(x,g,{canPersistStamp:e.saveClientInformation!==void 0});if(S===void 0&&x?.issuer&&e.saveClientInformation===void 0)throw new Mc(x.issuer,g);if(S&&S.issuer===void 0&&(S={...S,issuer:g},await e.saveClientInformation?.(S,_)),!S){if(n!==void 0)throw Error(`Existing OAuth client information is required when exchanging an authorization code`);let t=p?.client_id_metadata_document_supported===!0,r=e.clientMetadataUrl;if(r&&!cl(r))throw new ti(ei.InvalidClientMetadata,`clientMetadataUrl must be a valid HTTPS URL with a non-root pathname, got: ${r}`);if(t&&r)S={client_id:r,issuer:g},await e.saveClientInformation?.(S,_);else{if(!e.saveClientInformation)throw Error(`OAuth client information must be saveable for dynamic registration`);S={...await Ol(f,{metadata:p,clientMetadata:l,scope:b,fetchFn:o}),issuer:g},await e.saveClientInformation(S,_)}}let C=!e.redirectUrl;if(n!==void 0||C){n!==void 0&&Vc({iss:r,expectedIssuer:p?.issuer,issParameterSupported:Bc(p)});let t=await Dl(e,f,{metadata:p,resource:y,authorizationCode:n,iss:r,scope:b,fetchFn:o});return await e.saveTokens({...t,issuer:g},_),`AUTHORIZED`}let ee=Pc(await e.tokens(_),g);if(ee&&ee.issuer===void 0&&(ee={...ee,issuer:g},await e.saveTokens(ee,_)),ee?.refresh_token&&!c){let t;try{t=await El(f,{metadata:p,clientInformation:S,refreshToken:ee.refresh_token,resource:y,addClientAuthentication:e.addClientAuthentication,dpop:await e.dpop?.(),fetchFn:o})}catch(e){if(e instanceof jc)throw e;if(!(e instanceof ti)||e.code===ei.ServerError)console.warn(`[mcp-sdk] Could not refresh OAuth tokens; falling back to a new authorization request. Cause: ${JSON.stringify(e instanceof Error?e.message:String(e))}`);else throw e}if(t)return await e.saveTokens({...t,issuer:g},_),`AUTHORIZED`}let w=e.state?await e.state():void 0,{authorizationUrl:T,codeVerifier:E}=await Cl(f,{metadata:p,clientInformation:S,state:w,redirectUrl:e.redirectUrl,scope:b,resource:y});return await e.saveCodeVerifier(E),await e.redirectToAuthorization(T),`REDIRECT`}function cl(e){if(!e)return!1;try{let t=new URL(e);return t.protocol===`https:`&&t.pathname!==`/`}catch{return!1}}async function ll(e,t,n){let r=ri(e);if(t.validateResourceURL)return await t.validateResourceURL(r,n?.resource);if(n){if(!ai({requestedResource:r,configuredResource:n.resource}))throw Error(`Protected resource ${n.resource} does not match expected ${r} (or origin)`);return new URL(n.resource)}}var ul=new Set([`bearer`,`dpop`]);function dl(e){let t=e.headers.get(`WWW-Authenticate`);if(!t)return{};let[n,r]=t.split(` `);if(!n||!ul.has(n.toLowerCase())||!r)return{};let i=fl(e,`resource_metadata`)||void 0,a;if(i)try{a=new URL(i)}catch{}let o=fl(e,`scope`)||void 0,s=fl(e,`error`)||void 0,c=fl(e,`error_description`)||void 0;return{resourceMetadataUrl:a,scope:o,error:s,errorDescription:c}}function fl(e,t){let n=e.headers.get(`WWW-Authenticate`);if(!n)return null;let r=new RegExp(String.raw`${t}=(?:"([^"]+)"|([^\s,]+))`),i=n.match(r);if(i){let e=i[1]||i[2];if(e)return e}return null}async function pl(e,t,n=fetch){let r=await vl(e,`oauth-protected-resource`,n,{protocolVersion:t?.protocolVersion,metadataUrl:t?.resourceMetadataUrl});if(!r||r.status===404)throw await r?.text?.().catch(()=>{}),Error(`Resource server does not implement OAuth 2.0 Protected Resource Metadata.`);if(!r.ok)throw await r.text?.().catch(()=>{}),Error(`HTTP ${r.status} trying to load well-known OAuth protected resource metadata.`);return Rr.parse(await r.json())}async function ml(e,t,n=fetch){let r=Ds(n);try{return await r(e,{headers:t})}catch(n){if(!(n instanceof TypeError))throw n;if(t)try{return await r(e,{})}catch(e){if(!(e instanceof TypeError))throw e;return}return}}function hl(e,t=``,n={}){return t.endsWith(`/`)&&(t=t.slice(0,-1)),n.prependPathname?`${t}/.well-known/${e}`:`/.well-known/${e}${t}`}async function gl(e,t,n=fetch){return await ml(e,{"MCP-Protocol-Version":t},n)}function _l(e,t){return e?t===`/`?!1:!e.ok&&e.status<500||e.status===502:!0}async function vl(e,t,n,r){let i=new URL(e),a=r?.protocolVersion??`2025-11-25`,o;if(r?.metadataUrl)o=new URL(r.metadataUrl);else{let e=hl(t,i.pathname);o=new URL(e,r?.metadataServerUrl??i),o.search=i.search}let s=await gl(o,a,n);return!r?.metadataUrl&&_l(s,i.pathname)&&(s=await gl(new URL(`/.well-known/${t}`,i),a,n)),s}function yl(e){let t=typeof e==`string`?new URL(e):e,n=t.pathname!==`/`,r=[];if(!n)return r.push({url:new URL(`/.well-known/oauth-authorization-server`,t.origin),type:`oauth`},{url:new URL(`/.well-known/openid-configuration`,t.origin),type:`oidc`}),r;let i=t.pathname;return i.endsWith(`/`)&&(i=i.slice(0,-1)),r.push({url:new URL(`/.well-known/oauth-authorization-server${i}`,t.origin),type:`oauth`},{url:new URL(`/.well-known/openid-configuration${i}`,t.origin),type:`oidc`},{url:new URL(`${i}/.well-known/openid-configuration`,t.origin),type:`oidc`}),r}async function bl(e,{fetchFn:t=fetch,protocolVersion:n=Me,skipIssuerValidation:r=!1}={}){let i={"MCP-Protocol-Version":n,Accept:`application/json`},a=yl(e);for(let{url:n,type:o}of a){let a=await ml(n,i,t);if(!a)continue;if(!a.ok){if(await a.text?.().catch(()=>{}),a.status<500||a.status===502)continue;throw Error(`HTTP ${a.status} trying to load ${o===`oauth`?`OAuth`:`OpenID provider`} metadata from ${n}`)}let s=o===`oauth`?zr.parse(await a.json()):Vr.parse(await a.json());if(!r){let t=typeof e==`string`?e:e.href;if(!(s.issuer===t||t.endsWith(`/`)&&s.issuer===t.slice(0,-1)))throw new kc(`metadata`,t,s.issuer)}return s}}async function xl(e,t){let n,r;try{n=await pl(e,{resourceMetadataUrl:t?.resourceMetadataUrl},t?.fetchFn),n.authorization_servers&&n.authorization_servers.length>0&&(r=n.authorization_servers[0])}catch(e){if(e instanceof TypeError)throw e}r||=String(new URL(`/`,e));let i=await bl(r,{fetchFn:t?.fetchFn,skipIssuerValidation:t?.skipIssuerMetadataValidation});return{authorizationServerUrl:r,authorizationServerMetadata:i,resourceMetadata:n}}function Sl(e){return typeof e==`string`?e:e.href}async function Cl(e,{metadata:t,clientInformation:n,redirectUrl:r,scope:i,state:a,resource:o}){let s;if(t){if(s=new URL(t.authorization_endpoint),!t.response_types_supported.includes(Kc))throw Error(`Incompatible auth server: does not support response type ${Kc}`);if(t.code_challenge_methods_supported&&!t.code_challenge_methods_supported.includes(qc))throw Error(`Incompatible auth server: does not support code challenge method ${qc}`)}else s=new URL(`/authorize`,e);let c=await vc(),l=c.code_verifier,u=c.code_challenge;return s.searchParams.set(`response_type`,Kc),s.searchParams.set(`client_id`,n.client_id),s.searchParams.set(`code_challenge`,u),s.searchParams.set(`code_challenge_method`,qc),s.searchParams.set(`redirect_uri`,String(r)),a&&s.searchParams.set(`state`,a),i&&s.searchParams.set(`scope`,i),i?.split(` `).includes(`offline_access`)&&s.searchParams.append(`prompt`,`consent`),o&&s.searchParams.set(`resource`,Sl(o)),{authorizationUrl:s,codeVerifier:l}}function wl(e,t,n){return new URLSearchParams({grant_type:`authorization_code`,code:e,code_verifier:t,redirect_uri:String(n)})}async function Tl(e,{metadata:t,tokenRequestParams:n,clientInformation:r,addClientAuthentication:i,resource:a,dpop:o,fetchFn:s}){let c=el(t?.token_endpoint??new URL(`/token`,e)),l=new Headers({"Content-Type":`application/x-www-form-urlencoded`,Accept:`application/json`});a&&n.set(`resource`,Sl(a)),!i&&r&&Yc(Jc(r,t?.token_endpoint_auth_methods_supported??[]),r,l,n);let u=async()=>{let e=new Headers(l);return i&&await i(e,n,c,t),o&&e.set(`DPoP`,await o.buildProof({htm:`POST`,htu:c})),Ds(s??fetch)(c,{method:`POST`,headers:e,body:n})},d=await u();if(o&&d.status===400&&(await d.clone().json().catch(()=>{}))?.error===ei.UseDpopNonce&&(o.observeNonce(d,c),d=await u()),o?.observeNonce(d,c),!d.ok)throw await rl(d);let f=await d.json();try{return Hr.parse(ii(f))}catch(e){throw typeof f==`object`&&f&&`error`in f?await rl(JSON.stringify(f)):e}}async function El(e,{metadata:t,clientInformation:n,refreshToken:r,resource:i,addClientAuthentication:a,dpop:o,fetchFn:s}){return{refresh_token:r,...await Tl(e,{metadata:t,tokenRequestParams:new URLSearchParams({grant_type:`refresh_token`,refresh_token:r}),clientInformation:n,addClientAuthentication:a,resource:i,dpop:o,fetchFn:s})}}async function Dl(e,t,{metadata:n,resource:r,authorizationCode:i,iss:a,scope:o,fetchFn:s}={}){i!==void 0&&Vc({iss:a,expectedIssuer:n?.issuer,issParameterSupported:Bc(n)});let c=n?.issuer??String(t),l=async()=>{let t=await e.clientInformation({issuer:c}),n=Pc(t,c,{canPersistStamp:!1});if(t&&n===void 0)throw new Mc(String(t.issuer),c);return n},u=await l(),d=o??e.clientMetadata.scope,f;if(e.prepareTokenRequest&&(f=await e.prepareTokenRequest(d)),!f){if(!i)throw Error(`Either provider.prepareTokenRequest() or authorizationCode is required`);if(!e.redirectUrl)throw Error(`redirectUrl is required for authorization_code flow`);f=wl(i,await e.codeVerifier(),e.redirectUrl)}return u??=await l(),Tl(t,{metadata:n,tokenRequestParams:f,clientInformation:u,addClientAuthentication:e.addClientAuthentication,resource:r,dpop:await e.dpop?.(),fetchFn:s})}async function Ol(e,{metadata:t,clientMetadata:n,scope:r,fetchFn:i}){let a;if(t){if(!t.registration_endpoint)throw Error(`Incompatible auth server: does not support dynamic client registration`);a=new URL(t.registration_endpoint)}else a=new URL(`/register`,e);let o={...n,...r===void 0?{}:{scope:r}},s=await Ds(i??fetch)(a,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify(o)});if(!s.ok)throw new Ac({status:s.status,body:await s.text(),submittedMetadata:o});return Jr.parse(ii(await s.json()))}var kl=new Set([`tools/list`,`prompts/list`,`resources/list`,`resources/templates/list`,`server/discover`]),Al=class{_entries=new Map;_maxEntries;_stamp=0;_cappedSize=0;constructor(e){this._maxEntries=e?.maxEntries??512}get size(){return this._entries.size}get(e){return this._entries.get(jl(e))}set(e,t){let n=jl(e),r=kl.has(e.method),i=!this._entries.has(n);if(!r&&i&&this._maxEntries>0&&this._cappedSize>=this._maxEntries){for(let e of this._entries.keys())if(!kl.has(e.slice(0,e.indexOf(`\0`)))){this._entries.delete(e),this._cappedSize--;break}}let a=++this._stamp;return this._entries.set(n,{...t,stamp:a}),i&&!r&&this._cappedSize++,a}delete(e){this._entries.delete(jl(e))&&!kl.has(e.method)&&this._cappedSize--}evict(e){let t=`${e}\0`,n=kl.has(e);for(let e of this._entries.keys())e.startsWith(t)&&(this._entries.delete(e),n||this._cappedSize--)}clear(){this._entries.clear(),this._cappedSize=0}};function jl(e){return`${e.method}\0${JSON.stringify([e.partition??``,e.params??``])}`}function Ml(e,t){return t===void 0?e:`${e}\0${t}`}var Nl=864e5,Pl=class{_evictionGeneration=new Map;_toolIndex;_toolOutputValidatorIndex;_serverIdentity=``;constructor(e,t,n=()=>{},r=``,i=Date.now){this._store=e,this._isUserSupplied=t,this._reportError=n,this._cachePartition=r,this._now=i}now(){return this._now()}setServerIdentity(e){this._serverIdentity=e}_partitionFor(e){return JSON.stringify([this._serverIdentity,e===`public`?``:this._cachePartition])}async _probe(e,t){let n={method:e,params:t??``},r=this._partitionFor(`private`),i=await this._store.get({...n,partition:r});if(i!==void 0)return i;let a=this._partitionFor(`public`);if(a===r)return;let o=await this._store.get({...n,partition:a});return o?.scope===`public`?o:void 0}async evict(e){this._evictionGeneration.set(e,(this._evictionGeneration.get(e)??0)+1),await this._deleteBoth(e,``)}async _deleteBoth(e,t){let n=this._partitionFor(`private`),r=this._partitionFor(`public`);try{await this._store.delete({method:e,params:t,partition:n})}catch(e){this._reportError(e)}if(r!==n)try{await this._store.delete({method:e,params:t,partition:r})}catch(e){this._reportError(e)}}async evictKey(e,t){let n=Ml(e,t),r=this._evictionGeneration.get(n);r!==void 0&&this._evictionGeneration.set(n,r+1),await this._deleteBoth(e,t)}captureGeneration(e,t){let n=Ml(e,t),r=this._evictionGeneration.get(n)??0;return this._evictionGeneration.set(n,r),r}async write(e,t,n,r){if((this._evictionGeneration.get(Ml(e,r?.params))??0)!==n)return;let i=r?.params??``,a=this._partitionFor(`private`),o=this._partitionFor(`public`),s=(r?.scope??`private`)===`public`?o:a;try{await this._store.set({method:e,params:i,partition:s},{value:Fl(t),expiresAt:r?.expiresAt,scope:r?.scope})}catch(e){this._reportError(e)}if(o!==a)try{await this._store.delete({method:e,params:i,partition:s===a?o:a})}catch(e){this._reportError(e)}}async read(e,t){let n=await this._probe(e,t);if(n?.expiresAt!==void 0&&n.expiresAt>this.now())try{let e=JSON.parse(n.value);if(typeof e!=`object`||!e||Array.isArray(e))throw TypeError(`cached document is not an object`);return{value:e}}catch(n){this._reportError(n),await this._deleteBoth(e,t??``);return}}resetForReconnect(){this._isUserSupplied||this._store.clear(),this._evictionGeneration.clear(),this._toolIndex=void 0,this._toolOutputValidatorIndex=void 0,this._serverIdentity=``}async toolDefinition(e){let t=await this._probe(`tools/list`);if(t===void 0){this._toolIndex=void 0;return}if(this._toolIndex?.stamp!==t.stamp){let e=this._decodeListTools(t),n=new Map;if(e!==void 0)for(let t of e.tools)n.set(t.name,t);this._toolIndex={stamp:t.stamp,byName:n}}return this._toolIndex.byName.get(e)}async outputValidator(e,t){let n=await this._probe(`tools/list`);if(n===void 0){this._toolOutputValidatorIndex=void 0;return}if(this._toolOutputValidatorIndex?.stamp!==n.stamp){let e=this._decodeListTools(n)??{tools:[]},r=new Map;for(let n of e.tools){let e=t(n);e!==void 0&&r.set(n.name,e)}this._toolOutputValidatorIndex={stamp:n.stamp,byName:r}}return this._toolOutputValidatorIndex.byName.get(e)}_decodeListTools(e){try{let t=JSON.parse(e.value);if(!Array.isArray(t?.tools)||!t.tools.every(e=>typeof e==`object`&&!!e))throw TypeError(`cached tools/list document has a malformed tools array`);return t}catch(e){this._reportError(e);return}}};function Fl(e){let t;try{t=JSON.stringify(e)}catch(e){throw TypeError(`cache value is not JSON-serializable: ${e instanceof Error?e.message:String(e)}`)}if(typeof t!=`string`)throw TypeError(`cache value is not JSON-serializable: it has no JSON representation`);return t}var Il=Symbol.for(`mcp.authSeamEscape`);function Ll(e){if(typeof e==`object`&&e||typeof e==`function`)try{Object.defineProperty(e,Il,{value:!0,configurable:!0})}catch{}return e}function Rl(e){return(typeof e==`object`&&!!e||typeof e==`function`)&&e[Il]===!0}var zl=-32022,Bl=new Set([-32001,-32020,-32021]);function Vl(e,t){switch(e.kind){case`result`:return Hl(e.result,t);case`rpc-error`:return Ul(e,t);case`http-error`:return Wl(e,t);case`network-error`:return Gl(e.error,t);case`unusable-reply`:return{kind:`error`,error:new Y(J.EraNegotiationFailed,`Version negotiation probe failed: the server answered with an unusable reply (${ql(e.error)})`,{cause:e.error},{cause:e.error})};case`auth-required`:return{kind:`error`,error:e.error};case`closed`:return t.transportKind===`stdio`?{kind:`legacy`}:Gl(Error(`Connection closed during the version negotiation probe`),t);case`timeout`:return t.transportKind===`stdio`?{kind:`legacy`}:{kind:`error`,error:new Y(J.RequestTimeout,`Version negotiation probe timed out after ${e.timeoutMs}ms`,{timeout:e.timeoutMs})}}}function Hl(e,t){let n=ja(Aa).validateResult(`server/discover`,e);if(!n.ok)return{kind:`legacy`};let r=n.value.supportedVersions,i=t.clientModernVersions.find(e=>r.includes(e));return i===void 0?t.fallbackAvailable?{kind:`legacy`}:{kind:`error`,error:new Xi({supported:[...r],requested:t.requestedVersion})}:{kind:`modern`,version:i,discover:n.value}}function Ul(e,t){let{code:n,message:r,data:i}=e;if(n===zl){let e=Jl(i);if(e===void 0)return{kind:`legacy`};let n=new Xi({supported:e,requested:Yl(i)??t.requestedVersion},r),a=ui(e),o=t.clientModernVersions.find(e=>a.includes(e));return o===void 0?a.length>0?{kind:`error`,error:n}:t.fallbackAvailable?{kind:`legacy`}:{kind:`error`,error:n}:{kind:`corrective`,version:o,error:n}}return Bl.has(n),{kind:`legacy`}}function Wl(e,t){if(e.status===401||e.status===403){let t=e.status===403;return{kind:`error`,error:new ni(t?J.ClientHttpForbidden:J.ClientHttpAuthentication,`Version negotiation failed: ${t?`the server denied access (HTTP 403)`:`the server requires authorization (HTTP 401)`}`,{status:e.status,statusText:e.statusText,text:e.body})}}if(e.status>=500)return{kind:`error`,error:new ni(J.EraNegotiationFailed,`Version negotiation failed: the server answered the probe with HTTP ${e.status}`,{status:e.status,statusText:e.statusText,text:e.body})};let n=Xl(e.body);return n===void 0?{kind:`legacy`}:Ul(n,t)}function Gl(e,t){return t.environment===`browser`&&Kl(e)?{kind:`legacy`}:{kind:`error`,error:new Y(J.EraNegotiationFailed,`Version negotiation probe failed: ${ql(e)}`,{cause:e},{cause:e})}}function Kl(e){return e instanceof TypeError||e instanceof Error&&e.name===`TypeError`}function ql(e){return e instanceof Error?e.message:String(e)}function Jl(e){if(typeof e!=`object`||!e)return;let t=e.supported;if(Array.isArray(t)&&t.length!==0&&t.every(e=>typeof e==`string`))return t}function Yl(e){if(typeof e!=`object`||!e)return;let t=e.requested;return typeof t==`string`?t:void 0}function Xl(e){if(e===void 0||e===``)return;let t;try{t=JSON.parse(e)}catch{return}if(typeof t!=`object`||!t)return;let n=t.error;if(typeof n!=`object`||!n)return;let{code:r,message:i,data:a}=n;if(typeof r==`number`)return{code:r,message:typeof i==`string`?i:``,data:a}}var Zl=`legacy`;function Ql(e,t){let n=e?.mode??Zl;if(n===`legacy`)return{kind:`legacy`};let r=e?.probe??{};if(typeof n==`object`){if(!ci(n.pin))throw TypeError(`versionNegotiation: { pin: '${n.pin}' } is not a modern protocol revision — pinning is for 2026-07-28 and later; omit versionNegotiation (or use mode: 'legacy') for 2025-era servers.`);return{kind:`pin`,version:n.pin,probe:r}}let i=t?ui(t):[];return{kind:`auto`,modernVersions:i.length>0?i:[...si],fallbackAvailable:!t||li(t).length>0,probe:r}}function $l(){let e=globalThis;return e.window!==void 0&&e.document!==void 0?`browser`:`node`}function eu(e){return`stderr`in e&&`pid`in e?`stdio`:`http`}var tu=class e{_pending;_probeCounter=0;_savedOnMessage;_savedOnError;_savedOnClose;_closeDelivered=!1;constructor(e){this._transport=e,this._savedOnMessage=e.onmessage,this._savedOnError=e.onerror,this._savedOnClose=e.onclose}static async open(t){let n=new e(t);t.onmessage=e=>{let t=n._pending;if(t!==void 0&&(Ba(e)||Va(e))&&e.id===t.id){n._pending=void 0,Ba(e)?t.resolve({kind:`response`,result:e.result}):t.resolve({kind:`response`,error:e.error});return}},t.onerror=e=>{n._savedOnError?.(e)},t.onclose=()=>{let e=n._pending;e!==void 0&&(n._pending=void 0,e.resolve({kind:`closed`})),n._closeDelivered=!0,n._savedOnClose?.()};try{await t.start()}catch(e){throw n.detach(),e}return n}async exchange(e,t){let n=`server-discover-probe-${++this._probeCounter}`;return new Promise(r=>{let i=!1,a=e=>{i||(i=!0,clearTimeout(o),this._pending?.id===n&&(this._pending=void 0),r(e))},o=setTimeout(()=>a({kind:`timeout`}),t);this._pending={id:n,resolve:a},this._transport.send(e(n)).catch(e=>a({kind:`send-error`,error:e}))})}detach(){if(this._pending=void 0,this._transport.onmessage=this._savedOnMessage,this._transport.onerror=this._savedOnError,this._closeDelivered&&this._savedOnClose!==void 0){let e=this._savedOnClose,t=this._transport,n=!1,r=()=>{if(!n){n=!0;return}e()};t.onclose=r,nu.set(t,()=>{t.onclose===r&&(t.onclose=e)})}else this._transport.onclose=this._savedOnClose}release(){this.detach();let e=this._transport,t=e.start,n=!0;e.start=async function(){if(n){n=!1,e.start=t;return}return t.call(e)}}},nu=new WeakMap;function ru(e){let t=nu.get(e);nu.delete(e),t?.()}function iu(e,t,n,r){return{jsonrpc:`2.0`,id:e,method:`server/discover`,params:{_meta:ja(t).outboundEnvelope({protocolVersion:t,clientInfo:n,clientCapabilities:r})}}}function au(e){return e instanceof Y&&e.code===J.ClientHttpUnexpectedContent||e instanceof Error&&e.name===`SyntaxError`}function ou(e,t){switch(e.kind){case`response`:return e.error===void 0?{kind:`result`,result:e.result}:{kind:`rpc-error`,...e.error};case`send-error`:{let t=e.error;if(Rl(t)||t instanceof zc||t instanceof Error&&t.name===`UnauthorizedError`)return{kind:`auth-required`,error:t};if(t instanceof ni){let e=t.data?.text;return{kind:`http-error`,status:t.data.status,body:typeof e==`string`?e:void 0,statusText:t.data.statusText}}return au(t)?{kind:`unusable-reply`,error:t}:{kind:`network-error`,error:t}}case`closed`:return{kind:`closed`};case`timeout`:return{kind:`timeout`,timeoutMs:t}}}async function su(e,t){let n=e.probe.timeoutMs??t.defaultTimeoutMs,r=Math.max(0,e.probe.maxRetries??0),i=e.kind===`pin`?[e.version]:e.modernVersions,a=e.kind===`auto`&&e.fallbackAvailable,o=await tu.open(t.transport),s=async()=>{let s=i[0],c=!1,l=r;for(;;){let r=await o.exchange(e=>iu(e,s,t.clientInfo,t.capabilities),n);if(r.kind===`timeout`&&l>0){l--;continue}let u=ou(r,n),d=Vl(u,{clientModernVersions:i,requestedVersion:s,fallbackAvailable:a,environment:t.environment,transportKind:t.transportKind});switch(d.kind){case`modern`:return{era:`modern`,version:d.version,discover:d.discover};case`corrective`:if(c)throw d.error;c=!0,s=d.version;continue;case`legacy`:{let n=u.kind===`closed`?`the connection closed during the server/discover probe`:void 0;if(e.kind===`pin`)throw new Y(J.EraNegotiationFailed,n===void 0?`Version negotiation failed: the server did not offer pinned protocol version ${e.version} via server/discover (no fallback in pin mode)`:`Version negotiation failed: ${n} before the server offered pinned protocol version ${e.version} (no fallback in pin mode)`);if(!e.fallbackAvailable)throw new Y(J.EraNegotiationFailed,n===void 0?`Version negotiation failed: the server gave no modern evidence and this client supports no pre-2026-07-28 protocol version to fall back to`:`Version negotiation failed: ${n} and this client supports no pre-2026-07-28 protocol version to fall back to`);if(n!==void 0&&t.disposableProbe!==!0)throw new Y(J.EraNegotiationFailed,`Version negotiation failed: ${n} (this transport probed in place — the disposable sibling probe requires the SDK's base StdioClientTransport)`);return{era:`legacy`}}case`error`:throw d.error}}},c;try{c=await s()}catch(e){throw o.detach(),e}return o.release(),c}function cu(e){let t=Object.getPrototypeOf(e);if(t===null||!Object.prototype.hasOwnProperty.call(t,`_dispose`))return;let n=e._serverParams;return typeof n==`object`&&n&&typeof n.command==`string`?n:void 0}async function lu(e,t,n,r){let i=t.constructor,a=new i({...n,stderr:`ignore`}),o=t.close,s=!1,c,l=new Promise((e,t)=>{c=()=>t(uu())});t.close=async function(){return s=!0,c?.(),o.call(t)};let u;try{let t=su(e,{...r,transport:a,transportKind:`stdio`,disposableProbe:!0});t.catch(()=>{}),u=await Promise.race([t,l])}finally{await du(a),t.close=o}if(s)throw uu();return u}function uu(){return new Y(J.EraNegotiationFailed,`Version negotiation failed: the transport was closed during the server/discover probe`)}async function du(e){try{let t=e._dispose;await(typeof t==`function`?t.call(e):e.close())}catch{}}function fu(e){let t=e._meta?.[Le];return Qo.Implementation(t)?t:void 0}function pu(e,t){if(e&&typeof t==`object`&&t){if(e.type===`object`&&e.properties&&typeof e.properties==`object`){let n=t,r=e.properties;for(let e of Object.keys(r)){let t=r[e];n[e]===void 0&&Object.prototype.hasOwnProperty.call(t,`default`)&&(n[e]=t.default),n[e]!==void 0&&pu(t,n[e])}}if(Array.isArray(e.anyOf))for(let n of e.anyOf)typeof n!=`boolean`&&pu(n,t);if(Array.isArray(e.oneOf))for(let n of e.oneOf)typeof n!=`boolean`&&pu(n,t)}}function mu(e){if(!e)return{supportsFormMode:!1,supportsUrlMode:!1};let t=e.form!==void 0,n=e.url!==void 0;return{supportsFormMode:t||!t&&!n,supportsUrlMode:n}}function hu(e){if(typeof e==`object`&&e&&(e.kind===`legacy`&&!(`supportedVersions`in e)&&!(`discover`in e)||e.kind===`modern`&&bt.safeParse(e.discover).success))return e;throw new Y(J.EraNegotiationFailed,`connect({ prior }): unrecognized prior — expected { kind: 'modern', discover } or { kind: 'legacy' }`)}var gu={"notifications/tools/list_changed":[`tools/list`],"notifications/prompts/list_changed":[`prompts/list`],"notifications/resources/list_changed":[`resources/list`,`resources/templates/list`]},_u=64,vu=class extends os{_serverCapabilities;_serverVersion;_capabilities;_instructions;_jsonSchemaValidator;_cache;_defaultCacheTtlMs;_listMaxPages;_listChangedDebounceTimers=new Map;_listChangedConfig;_enforceStrictCapabilities;_versionNegotiation;_supportedProtocolVersionsOption;_inputRequiredDriverConfig;_listenState=new Map;_nextListenId=0;_autoOpenedSubscription;_discoverResult;_resetConnectionState(){if(this._negotiatedProtocolVersion=void 0,this._serverCapabilities=void 0,this._serverVersion=void 0,this._instructions=void 0,this._discoverResult=void 0,this._autoOpenedSubscription=void 0,this._listenState.size>0){let e=new Y(J.ConnectionClosed,`subscriptions/listen: client reconnected or closed; subscription state from the previous connection was reset`);for(let t of this._listenState.values())t.settle({cause:`remote`,error:e})}this._listenState.clear();for(let e of this._listChangedDebounceTimers.values())clearTimeout(e);this._listChangedDebounceTimers.clear(),this._cache.resetForReconnect()}async close(){try{await super.close()}finally{this._resetConnectionState()}}constructor(e,t){super(t),this._clientInfo=e,this._capabilities=t?.capabilities?{...t.capabilities}:{},this._jsonSchemaValidator=t?.jsonSchemaValidator??new fc,this._enforceStrictCapabilities=t?.enforceStrictCapabilities??!1,this._versionNegotiation=t?.versionNegotiation,this._supportedProtocolVersionsOption=t?.supportedProtocolVersions,this._inputRequiredDriverConfig=Vo(t?.inputRequired),this._cache=new Pl(t?.responseCacheStore??new Al,t?.responseCacheStore!==void 0,e=>this._reportStoreError(e),t?.cachePartition??``),this._defaultCacheTtlMs=t?.defaultCacheTtlMs??0,this._listMaxPages=t?.listMaxPages??_u,t?.listChanged&&(this._listChangedConfig=t.listChanged)}buildContext(e,t){return e}_shouldDropInbound(e){if(this._negotiatedProtocolVersion!==void 0&&ci(this._negotiatedProtocolVersion)&&Ra(e))return`drop`}_outboundMetaEnvelope(){let e=this._negotiatedProtocolVersion;if(e!==void 0)return this._wireCodec().outboundEnvelope({protocolVersion:e,clientInfo:this._clientInfo,clientCapabilities:this._capabilities})}_resolveNonCompleteResult(e,t){return this._inputRequiredDriverConfig.autoFulfill?hs({getRequestHandler:e=>this._getRequestHandler(e),buildContext:e=>this.buildContext(e,void 0),sessionId:this.transport?.sessionId},this._inputRequiredDriverConfig,e,t):Promise.reject(new Y(J.UnsupportedResultType,`Unsupported result type 'input_required' for ${t.request.method}: multi-round-trip auto-fulfilment is not enabled on this instance — pass allowInputRequired: true to handle it manually, or enable inputRequired.autoFulfill`,{resultType:`input_required`,method:t.request.method}))}_setupListChangedHandlers(e){e.tools&&this._serverCapabilities?.tools?.listChanged&&this._setupListChangedHandler(`tools`,`notifications/tools/list_changed`,e.tools,async()=>(await this.listTools(void 0,{cacheMode:`refresh`})).tools),e.prompts&&this._serverCapabilities?.prompts?.listChanged&&this._setupListChangedHandler(`prompts`,`notifications/prompts/list_changed`,e.prompts,async()=>(await this.listPrompts(void 0,{cacheMode:`refresh`})).prompts),e.resources&&this._serverCapabilities?.resources?.listChanged&&this._setupListChangedHandler(`resources`,`notifications/resources/list_changed`,e.resources,async()=>(await this.listResources(void 0,{cacheMode:`refresh`})).resources)}registerCapabilities(e){if(this.transport)throw Error(`Cannot register capabilities after connecting to transport`);this._capabilities=cs(this._capabilities,e)}setVersionNegotiation(e){if(this.transport)throw Error(`Cannot configure version negotiation after connecting to transport`);this._versionNegotiation=e}_wrapHandler(e,t){return e===`elicitation/create`?async(e,n)=>{let r=ja(this._negotiatedProtocolVersion),i=r.validateRequest(`elicitation/create`,e);if(!i.ok&&i.reason===`not-in-era`&&(i=r.validateInputRequest(`elicitation/create`,e)),!i.ok)throw new Z(i.reason===`not-in-era`?X.InternalError:X.InvalidParams,i.reason===`not-in-era`?`No wire schema for elicitation/create in the resolved era`:`Invalid elicitation request: ${i.message}`);let{params:a}=i.value;a.mode=a.mode??`form`;let{supportsFormMode:o,supportsUrlMode:s}=mu(this._capabilities.elicitation);if(a.mode===`form`&&!o)throw new Z(X.InvalidParams,`Client does not support form-mode elicitation requests`);if(a.mode===`url`&&!s)throw new Z(X.InvalidParams,`Client does not support URL-mode elicitation requests`);let c=await t(e,n),l=r.validateResult(`elicitation/create`,c);if(!l.ok&&l.reason===`not-in-era`&&(l=r.validateInputResponse(`elicitation/create`,c)),!l.ok)throw new Z(l.reason===`not-in-era`?X.InternalError:X.InvalidParams,l.reason===`not-in-era`?`No wire schema for elicitation/create in the resolved era`:`Invalid elicitation result: ${l.message}`);let u=l.value,d=a.mode===`form`?a.requestedSchema:void 0;if(a.mode===`form`&&u.action===`accept`&&u.content&&d&&this._capabilities.elicitation?.form?.applyDefaults)try{pu(d,u.content)}catch{}return u}:e===`sampling/createMessage`?async(e,n)=>{let r=ja(this._negotiatedProtocolVersion),i=r.validateRequest(`sampling/createMessage`,e);if(!i.ok&&i.reason===`not-in-era`&&(i=r.validateInputRequest(`sampling/createMessage`,e)),!i.ok)throw new Z(i.reason===`not-in-era`?X.InternalError:X.InvalidParams,i.reason===`not-in-era`?`No wire schema for sampling/createMessage in the resolved era`:`Invalid sampling request: ${i.message}`);let{params:a}=i.value,o=await t(e,n),s=!!(a.tools||a.toolChoice),c=r.samplingResultVariant(s,o);if(!c.ok&&c.reason===`not-in-era`&&(c=r.validateInputResponse(`sampling/createMessage`,o)),!c.ok)throw new Z(c.reason===`not-in-era`?X.InternalError:X.InvalidParams,c.reason===`not-in-era`?`No result schema for sampling/createMessage in the resolved era`:`Invalid sampling result: ${c.message}`);return c.value}:t}assertCapability(e,t){if(!this._serverCapabilities?.[e])throw new Y(J.CapabilityNotSupported,`Server does not support ${e} (required for ${t})`)}async connect(e,t){if(t?.prior!=null)return this._connectFromPrior(e,hu(t.prior),t);let n=Ql(this._versionNegotiation,this._supportedProtocolVersionsOption);return n.kind===`legacy`?this._connectPlainLegacy(e,t):this._connectNegotiated(e,n,t)}async _connectPlainLegacy(e,t){if(await super.connect(e),e.sessionId!==void 0){let t=this._negotiatedProtocolVersion;t!==void 0&&e.setProtocolVersion?.(t);return}this._resetConnectionState(),await this._legacyHandshake(e,t)}async _legacyHandshake(e,t){let n=li(this._supportedProtocolVersions);try{let r=n[0];if(r===void 0)throw new Y(J.EraNegotiationFailed,`Cannot run the initialize handshake: supportedProtocolVersions contains no pre-2026-07-28 protocol version`);let i=await this.request({method:`initialize`,params:{protocolVersion:r,capabilities:this._capabilities,clientInfo:this._clientInfo}},t);if(i===void 0)throw Error(`Server sent invalid initialize result: ${i}`);if(!n.includes(i.protocolVersion))throw Error(`Server's protocol version is not supported: ${i.protocolVersion}`);this._serverCapabilities=i.capabilities,this._serverVersion=i.serverInfo,this._cache.setServerIdentity(this._deriveServerIdentity(e)),e.setProtocolVersion&&e.setProtocolVersion(i.protocolVersion),this._instructions=i.instructions,await this.notification({method:`notifications/initialized`}),this._negotiatedProtocolVersion=i.protocolVersion,this._listChangedConfig&&this._setupListChangedHandlers(this._listChangedConfig)}catch(e){throw this.close(),e}}async _connectNegotiated(e,t,n){if(e.sessionId!==void 0){await super.connect(e);let t=this._negotiatedProtocolVersion;t!==void 0&&e.setProtocolVersion&&e.setProtocolVersion(t);return}this._resetConnectionState();let r;try{let i=eu(e),a={clientInfo:this._clientInfo,capabilities:this._capabilities,environment:$l(),defaultTimeoutMs:n?.timeout??6e4},o=i===`stdio`?cu(e):void 0;r=o===void 0?await su(t,{...a,transport:e,transportKind:i}):await lu(t,e,o,a)}catch(t){throw await e.close().catch(()=>{}),ru(e),t}if(ru(e),await super.connect(e),r.era===`legacy`){await this._legacyHandshake(e,n);return}if(this._serverCapabilities=r.discover.capabilities,this._serverVersion=fu(r.discover),this._cache.setServerIdentity(this._deriveServerIdentity(e)),this._instructions=r.discover.instructions,this._discoverResult=r.discover,this._negotiatedProtocolVersion=r.version,e.setProtocolVersion&&e.setProtocolVersion(r.version),this._listChangedConfig){let e=this._listChangedConfig,t=this._serverCapabilities,r={...e.tools&&t?.tools?.listChanged&&{tools:e.tools},...e.prompts&&t?.prompts?.listChanged&&{prompts:e.prompts},...e.resources&&t?.resources?.listChanged&&{resources:e.resources}},i=!0;try{this._setupListChangedHandlers(r)}catch(e){i=!1,this.onerror?.(e instanceof Error?e:Error(String(e)))}let a=i?{...r.tools&&{toolsListChanged:!0},...r.prompts&&{promptsListChanged:!0},...r.resources&&{resourcesListChanged:!0}}:{};if(Object.keys(a).length>0){let e=new AbortController,t=()=>e.abort(n?.signal?.reason);n?.signal?.aborted&&t(),n?.signal?.addEventListener(`abort`,t);try{this._autoOpenedSubscription=await this.listen(a,{timeout:n?.timeout,signal:e.signal})}catch(e){if(n?.signal?.aborted)throw await this.close().catch(()=>{}),e;this.onerror?.(e instanceof Error?e:Error(String(e)))}finally{n?.signal?.removeEventListener(`abort`,t)}}}}async _connectFromPrior(e,t,n){if(t.kind===`legacy`)return this._connectPlainLegacy(e,n);let r=t.discover;this._resetConnectionState();let i=this._supportedProtocolVersionsOption,a=(i&&ui(i).length>0?ui(i):si).find(e=>r.supportedVersions.includes(e));if(a===void 0)throw new Y(J.EraNegotiationFailed,`connect({ prior }) with a modern verdict requires a 2026-07-28+ mutual protocol version; the supplied DiscoverResult and this client's supportedProtocolVersions have no modern overlap. For a server known to be legacy, pass prior: { kind: 'legacy' } to skip the probe and initialize directly, or use versionNegotiation: { mode: 'auto' } to re-probe with legacy fallback.`);if(await super.connect(e),this._discoverResult=r,this._serverCapabilities=r.capabilities,this._serverVersion=fu(r),this._cache.setServerIdentity(this._deriveServerIdentity(e)),this._instructions=r.instructions,this._negotiatedProtocolVersion=a,e.setProtocolVersion?.(a),this._listChangedConfig)try{this._setupListChangedHandlers(this._listChangedConfig)}catch(e){this.onerror?.(e instanceof Error?e:Error(String(e)))}}getServerCapabilities(){return this._serverCapabilities}getServerVersion(){return this._serverVersion}_deriveServerIdentity(e){let t=this._serverVersion;return t===void 0?e.sessionId??`anonymous:${Date.now()}-${Math.random().toString(36).slice(2)}`:`${t.name}@${t.version}`}getNegotiatedProtocolVersion(){return this._negotiatedProtocolVersion}getProtocolEra(){let e=this._negotiatedProtocolVersion;if(e!==void 0)return ci(e)?`modern`:`legacy`}getInstructions(){return this._instructions}getDiscoverResult(){return this._discoverResult}assertCapabilityForMethod(e){switch(e){case`logging/setLevel`:if(!this._serverCapabilities?.logging)throw new Y(J.CapabilityNotSupported,`Server does not support logging (required for ${e})`);break;case`prompts/get`:case`prompts/list`:if(!this._serverCapabilities?.prompts)throw new Y(J.CapabilityNotSupported,`Server does not support prompts (required for ${e})`);break;case`resources/list`:case`resources/templates/list`:case`resources/read`:case`resources/subscribe`:case`resources/unsubscribe`:if(!this._serverCapabilities?.resources)throw new Y(J.CapabilityNotSupported,`Server does not support resources (required for ${e})`);if(e===`resources/subscribe`&&!this._serverCapabilities.resources.subscribe)throw new Y(J.CapabilityNotSupported,`Server does not support resource subscriptions (required for ${e})`);break;case`tools/call`:case`tools/list`:if(!this._serverCapabilities?.tools)throw new Y(J.CapabilityNotSupported,`Server does not support tools (required for ${e})`);break;case`completion/complete`:if(!this._serverCapabilities?.completions)throw new Y(J.CapabilityNotSupported,`Server does not support completions (required for ${e})`)}}assertNotificationCapability(e){if(e===`notifications/roots/list_changed`&&!this._capabilities.roots?.listChanged)throw new Y(J.CapabilityNotSupported,`Client does not support roots list changed notifications (required for ${e})`)}assertRequestHandlerCapability(e){switch(e){case`sampling/createMessage`:if(!this._capabilities.sampling)throw new Y(J.CapabilityNotSupported,`Client does not support sampling capability (required for ${e})`);break;case`elicitation/create`:if(!this._capabilities.elicitation)throw new Y(J.CapabilityNotSupported,`Client does not support elicitation capability (required for ${e})`);break;case`roots/list`:if(!this._capabilities.roots)throw new Y(J.CapabilityNotSupported,`Client does not support roots capability (required for ${e})`)}}async ping(e){return this.request({method:`ping`},e)}async discover(e){let t=await this._requestWithSchema({method:`server/discover`},bt,e);return this._discoverResult=t,t}async complete(e,t){return this.request({method:`completion/complete`,params:e},t)}async setLoggingLevel(e,t){return this.request({method:`logging/setLevel`,params:{level:e}},t)}async getPrompt(e,t){return this.request({method:`prompts/get`,params:e},t)}async listPrompts(e,t){if(!this._serverCapabilities?.prompts&&!this._enforceStrictCapabilities)return console.debug(`Client.listPrompts() called but server does not advertise prompts capability - returning empty list`),{prompts:[]};if(e?.cursor!==void 0)return this.request({method:`prompts/list`,params:e},t);let n=await this._serveFromCache(`prompts/list`,void 0,t);return n===void 0?this._listAllPages(`prompts/list`,e,t,e=>e.prompts):n}async listResources(e,t){if(!this._serverCapabilities?.resources&&!this._enforceStrictCapabilities)return console.debug(`Client.listResources() called but server does not advertise resources capability - returning empty list`),{resources:[]};if(e?.cursor!==void 0)return this.request({method:`resources/list`,params:e},t);let n=await this._serveFromCache(`resources/list`,void 0,t);return n===void 0?this._listAllPages(`resources/list`,e,t,e=>e.resources):n}async listResourceTemplates(e,t){if(!this._serverCapabilities?.resources&&!this._enforceStrictCapabilities)return console.debug(`Client.listResourceTemplates() called but server does not advertise resources capability - returning empty list`),{resourceTemplates:[]};if(e?.cursor!==void 0)return this.request({method:`resources/templates/list`,params:e},t);let n=await this._serveFromCache(`resources/templates/list`,void 0,t);return n===void 0?this._listAllPages(`resources/templates/list`,e,t,e=>e.resourceTemplates):n}async _listAllPages(e,t,n,r,i){let a=n?.cacheMode===`bypass`,o=this._cache.captureGeneration(e),s=await this.request({method:e,...t&&{params:{...t}}},n),c=s.nextCursor,l=s,u=1;for(;c!==void 0;){if(this._listMaxPages!==0&&u>=this._listMaxPages)throw new Y(J.ListPaginationExceeded,`${e}: exceeded listMaxPages (${this._listMaxPages}); server pagination did not terminate`,{method:e,listMaxPages:this._listMaxPages});let i=await this.request({method:e,params:{...t,cursor:c}},n);if(i.nextCursor===c&&JSON.stringify(r(i))===JSON.stringify(r(l)))break;r(s).push(...r(i)),l=i,c=i.nextCursor,u++}return delete s.nextCursor,i?.(s),a||await this._cache.write(e,s,o,this._freshness(s)),s}_freshness(e,t){let n=e,r=typeof n.ttlMs==`number`?n.ttlMs:this._defaultCacheTtlMs,i=n.cacheScope===`public`?`public`:`private`;return{expiresAt:this._cache.now()+Math.min(Math.max(0,r),Nl),scope:i,params:t}}async _serveFromCache(e,t,n){if(n?.cacheMode===`bypass`||n?.cacheMode===`refresh`)return;let r=await this._cache.read(e,t).catch(e=>void this._reportStoreError(e));if(r!==void 0){if(n?.signal?.aborted){let e=n.signal.reason;throw e instanceof Y?e:new Y(J.RequestTimeout,String(e))}return r.value}}_reportStoreError(e){this.onerror?.(e instanceof Error?e:Error(String(e)))}_compileOutputValidator(e){if(e.outputSchema)try{return{ok:!0,validator:this._jsonSchemaValidator.getValidator(e.outputSchema)}}catch(e){return{ok:!1,compileError:e}}}async _resolveXMcpHeaderScan(e,t){let n=t??await this._cache.toolDefinition(e);return n===void 0?void 0:Ya(n.inputSchema)}async readResource(e,t){let n=await this._serveFromCache(`resources/read`,e.uri,t);if(n!==void 0)return n;let r=this._cache.captureGeneration(`resources/read`,e.uri),i=await this.request({method:`resources/read`,params:e},t);if(t?.cacheMode!==`bypass`){let n=this._freshness(i,e.uri);n.expiresAt>this._cache.now()?await this._cache.write(`resources/read`,i,r,n):t?.cacheMode===`refresh`&&await this._cache.evictKey(`resources/read`,e.uri)}return i}async subscribeResource(e,t){return this.request({method:`resources/subscribe`,params:e},t)}async unsubscribeResource(e,t){return this.request({method:`resources/unsubscribe`,params:e},t)}async listen(e,t){if(this.transport===void 0)throw new Y(J.NotConnected,`Not connected`);let n=this._negotiatedProtocolVersion;if(n===void 0||!ci(n))throw new Y(J.MethodNotSupportedByProtocolVersion,`subscriptions/listen requires a 2026-07-28-era connection (negotiated: ${n??`none`}). On a 2025-era connection, change notifications are delivered unsolicited: use ClientOptions.listChanged and resources/subscribe instead.`,{method:`subscriptions/listen`,protocolVersion:n});if(t?.signal?.aborted){let e=t.signal.reason;throw e instanceof Y?e:new Y(J.RequestTimeout,String(e))}let r=new AbortController,i=`listen:${this._nextListenId++}`,a=`opening`,o,s,c,l,u=new Promise((e,t)=>{c=e,l=t}),d,f=new Promise(e=>{d=e}),p=e=>{if(a===`closed`)return;let n=a===`opening`;if(o!==void 0&&(clearTimeout(o),o=void 0),`ack`in e){a=`open`,c(e.ack);return}a=`closed`,s!==void 0&&t?.signal?.removeEventListener(`abort`,s),this._listenState.delete(i),r.abort(),d(e.cause),n&&l(e.error??new Y(J.ConnectionClosed,`subscriptions/listen closed before the server acknowledged`))},m=async()=>{r.abort(),await this.notification({method:`notifications/cancelled`,params:{requestId:i}}).catch(()=>{})},h=async()=>{a!==`closed`&&(p({cause:`local`}),await m())};this._listenState.set(i,{settle:p});let g=t?.timeout??6e4;if(o=setTimeout(()=>{p({cause:`remote`,error:new Y(J.RequestTimeout,`subscriptions/listen ack timed out`,{timeout:g})}),m().catch(()=>{})},g),t?.signal){let e=t.signal;s=()=>{if(a===`closed`)return;let t=e.reason;p({cause:`local`,error:t instanceof Error?t:Error(String(t??`Aborted`))}),m().catch(()=>{})},e.addEventListener(`abort`,s,{once:!0})}let _={jsonrpc:`2.0`,id:i,method:`subscriptions/listen`,params:{_meta:{...this._outboundMetaEnvelope()},notifications:e}},v=e=>{p({cause:`remote`,error:e instanceof Error?e:Error(String(e))})};try{this.transport.send(_,{requestSignal:r.signal,onRequestStreamEnd:()=>p({cause:`remote`,error:Error(`subscriptions/listen: stream ended`)})}).catch(v)}catch(e){v(e)}return{honoredFilter:await u,close:h,closed:f}}get autoOpenedSubscription(){return this._autoOpenedSubscription}_onnotification(e,t){let n=Object.hasOwn(gu,e.method)?gu[e.method]:void 0;if(e.method===`notifications/resources/updated`){let t=e.params?.uri;typeof t==`string`&&this._cache.evictKey(`resources/read`,t)}else if(n!==void 0)for(let e of n)this._cache.evict(e);if(e.method===`notifications/subscriptions/acknowledged`){let t=e.params?._meta?.[ze],n=typeof t==`string`?this._listenState.get(t):void 0;if(n!==void 0){let t=this._wireCodec().validateNotification(`notifications/subscriptions/acknowledged`,e);n.settle({ack:t.ok?t.value.params.notifications:{}});return}}if(e.method===`notifications/cancelled`){let t=e.params?.requestId,n=typeof t==`string`?this._listenState.get(t):void 0;if(n!==void 0){n.settle({cause:`remote`,error:Error(`subscriptions/listen: server cancelled the subscription`)});return}}super._onnotification(e,t)}_onresponse(e){let t=e.id,n=typeof t==`string`?this._listenState.get(t):void 0;if(n!==void 0){Va(e)?n.settle({cause:`remote`,error:Z.fromError(e.error.code,e.error.message,e.error.data)}):n.settle({cause:`graceful`,error:new Y(J.ConnectionClosed,`subscriptions/listen: server closed the subscription gracefully before acknowledging`)});return}super._onresponse(e)}_onclose(){if(this._listenState.size>0){let e=new Y(J.ConnectionClosed,`Connection closed`);for(let t of this._listenState.values())t.settle({cause:`remote`,error:e});this._listenState.clear()}super._onclose()}async callTool(e,t){let n=this.getProtocolEra()===`modern`&&$l()!==`browser`,r=async()=>{if(!n)return t;let r;try{r=await this._resolveXMcpHeaderScan(e.name,t?.toolDefinition)}catch(e){this._reportStoreError(e)}if(!r?.valid||r.declarations.length===0)return t;let i=oo(r.declarations,e.arguments);return Object.keys(i).length===0?t:{...t,headers:{...t?.headers,...i}}},i=t?.toolDefinition===void 0?await this._cache.outputValidator(e.name,e=>this._compileOutputValidator(e)).catch(e=>void this._reportStoreError(e)):this._compileOutputValidator(t.toolDefinition),a=()=>{if(i===void 0||i.ok)return;let t=i.compileError,n=(t instanceof Error?t.message:String(t)).slice(0,200);throw new Z(X.InvalidParams,`Tool '${e.name}' has an invalid outputSchema: ${n}`)};a();let o;try{o=await this.request({method:`tools/call`,params:e},await r())}catch(s){let c=s instanceof Z&&s.code===-32020;if(!n||!c||t?.toolDefinition!==void 0)throw s;let l={signal:t?.signal,timeout:t?.timeout,cacheMode:`refresh`};await this._cache.evict(`tools/list`),await this.listTools(void 0,l).catch(e=>this._reportStoreError(e)),i=await this._cache.outputValidator(e.name,e=>this._compileOutputValidator(e)).catch(e=>void this._reportStoreError(e)),a(),o=await this.request({method:`tools/call`,params:e},await r())}let s=i!==void 0&&i.ok?i.validator:void 0;if(s){if(o.structuredContent===void 0&&!o.isError)throw new Z(X.InvalidRequest,`Tool ${e.name} has an output schema but did not return structured content`);if(o.structuredContent!==void 0&&!o.isError)try{let e=s(o.structuredContent);if(!e.valid)throw new Z(X.InvalidParams,`Structured content does not match the tool's output schema: ${e.errorMessage}`)}catch(e){throw e instanceof Z?e:new Z(X.InvalidParams,`Failed to validate structured content: ${e instanceof Error?e.message:String(e)}`)}}return o}async listTools(e,t){if(!this._serverCapabilities?.tools&&!this._enforceStrictCapabilities)return console.debug(`Client.listTools() called but server does not advertise tools capability - returning empty list`),{tools:[]};if(e?.cursor!==void 0){let n=await this.request({method:`tools/list`,params:e},t);return this._excludeInvalidXMcpHeaderTools(n),n}let n=await this._serveFromCache(`tools/list`,void 0,t);return n===void 0?this._listAllPages(`tools/list`,e,t,e=>e.tools,e=>this._excludeInvalidXMcpHeaderTools(e)):n}_excludeInvalidXMcpHeaderTools(e){if(this.getProtocolEra()!==`modern`||!this.transport||eu(this.transport)===`stdio`)return;let t=e.tools.filter(e=>{let t=Ya(e.inputSchema);return t.valid?!0:(console.warn(`[mcp-sdk] excluding tool '${e.name}' from tools/list: invalid x-mcp-header declaration — ${t.reason}`),!1)});t.length!==e.tools.length&&(e.tools=t)}_setupListChangedHandler(e,t,n,r){let i=uo(Dn,n);if(!i.success)throw Error(`Invalid ${e} listChanged options: ${i.error.message}`);if(typeof n.onChanged!=`function`)throw TypeError(`Invalid ${e} listChanged options: onChanged must be a function`);let{autoRefresh:a,debounceMs:o}=i.data,{onChanged:s}=n,c=async()=>{if(!a){s(null,null);return}try{s(null,await r())}catch(e){s(e instanceof Error?e:Error(String(e)),null)}};this.setNotificationHandler(t,()=>{if(o){let t=this._listChangedDebounceTimers.get(e);t&&clearTimeout(t);let n=setTimeout(c,o);this._listChangedDebounceTimers.set(e,n)}else c()})}async sendRootsListChanged(){return this.notification({method:`notifications/roots/list_changed`})}};function yu(e){return/(?:^|,)\s*dpop(?:\s|$|,)/i.test(e)}function bu(e){if(e.status!==401)return!1;let t=e.headers.get(`www-authenticate`)??``;return yu(t)&&/use_dpop_nonce/i.test(t)}var xu=(e,t)=>n=>{let r=typeof e==`function`?e:()=>e;return async(e,i)=>{let a=(i?.method??`GET`).toUpperCase(),o=new URL(e.toString()),s=await r();if(!s)return n(e,i);let c=async()=>{let r=await t();if(!r)return n(e,i);let c=new Headers(i?.headers),l=await s.buildProof({htm:a,htu:o,accessToken:r});return c.set(`Authorization`,`DPoP ${r}`),c.set(`DPoP`,l),n(e,{...i,headers:c})},l=await c();return bu(l)&&l.headers.has(`dpop-nonce`)&&(s.observeNonce(l,o),await l.text?.().catch(()=>{}),l=await c()),s.observeNonce(l,o),l}},Su=e=>xu(async()=>{try{return await e.dpop?.()}catch(e){throw Ll(e)}},async()=>{let t;try{t=await e.tokens()}catch(e){throw Ll(e)}return t?.token_type?.toLowerCase()===`dpop`?t.access_token:void 0});(class extends Error{static{Object.defineProperty(this,"mcpBrand",{value:`mcp.SseError`})}static[Symbol.hasInstance](e){return $r(this,e)}static isInstance(e){if(typeof this!=`function`)throw TypeError("isInstance must be called on the class (e.g. `SdkError.isInstance(value)`); for callbacks use `v => SdkError.isInstance(v)`");return $r(this,e)}constructor(e,t,n){super(`SSE error: ${t}`),this.code=e,this.event=n,Qr(this,new.target)}});var Cu=1,wu={initialReconnectionDelay:1e3,maxReconnectionDelay:3e4,reconnectionDelayGrowFactor:1.5,maxRetries:2},Tu=new Set([`authorization`,`dpop`,`content-type`,`mcp-protocol-version`,`mcp-method`,`mcp-name`,`mcp-session-id`]);function Eu(e,t){if(typeof AbortSignal.any==`function`)return AbortSignal.any([e,t]);let n=new AbortController;if(e.aborted)return n.abort(e.reason),n.signal;if(t.aborted)return n.abort(t.reason),n.signal;let r=()=>{e.removeEventListener(`abort`,i),t.removeEventListener(`abort`,a)};function i(){r(),n.abort(e.reason)}function a(){r(),n.abort(t.reason)}return e.addEventListener(`abort`,i,{once:!0}),t.addEventListener(`abort`,a,{once:!0}),n.signal}var Du=class{_abortController;_url;_resourceMetadataUrl;_scope;_requestInit;_authProvider;_oauthProvider;_skipIssuerMetadataValidation;_fetch;_fetchWithInit;_redirectPolicy;_sessionId;_reconnectionOptions;_protocolVersion;_onInsufficientScope;_maxStepUpRetries;_serverRetryMs;_reconnectionScheduler;_cancelReconnection;onclose;onerror;onmessage;hasPerRequestStream=!0;constructor(e,t){this._url=e,this._resourceMetadataUrl=void 0,this._scope=void 0,this._requestInit=t?.requestInit,this._skipIssuerMetadataValidation=t?.skipIssuerMetadataValidation,this._fetch=t?.fetch,Ic(t?.authProvider)?(this._oauthProvider=t.authProvider,this._authProvider=Rc(t.authProvider,{skipIssuerMetadataValidation:t.skipIssuerMetadataValidation}),t.authProvider.dpop&&(this._fetch=Su(t.authProvider)(t.fetch??fetch))):this._authProvider=t?.authProvider,this._redirectPolicy=t?.redirectPolicy,this._fetchWithInit=bs(t?.fetch,t?.requestInit),this._redirectPolicy===`follow`&&(this._fetchWithInit=Es(this._fetchWithInit)),this._sessionId=t?.sessionId,this._protocolVersion=t?.protocolVersion,this._reconnectionOptions=t?.reconnectionOptions??wu,this._reconnectionScheduler=t?.reconnectionScheduler,this._onInsufficientScope=t?.onInsufficientScope??`reauthorize`,this._maxStepUpRetries=Math.max(0,t?.maxStepUpRetries??Cu)}async _stepUpAuthorize(e,t){try{return await this._stepUpAuthorizeInner(e,t)}catch(e){throw Ll(e)}}async _stepUpAuthorizeInner(e,t){if(this._onInsufficientScope===`throw`||!this._oauthProvider)throw new Nc({requiredScope:e.scope,resourceMetadataUrl:e.resourceMetadataUrl,errorDescription:e.errorDescription});if(t>=this._maxStepUpRetries)throw new ni(J.ClientHttpForbidden,`Server returned 403 insufficient_scope after step-up re-authorization (retry limit ${this._maxStepUpRetries} reached)`,{status:403,statusText:e.statusText??`Forbidden`,text:e.text});e.resourceMetadataUrl&&(this._resourceMetadataUrl=e.resourceMetadataUrl);let n=await this._oauthProvider.tokens(),r=Hc(this._scope,n?.scope,e.scope);this._scope=r;let i=Uc(r,n?.scope);return al(this._oauthProvider,{serverUrl:this._url,resourceMetadataUrl:this._resourceMetadataUrl,scope:r,forceReauthorization:i,fetchFn:this._fetchWithInit,skipIssuerMetadataValidation:this._skipIssuerMetadataValidation})}_redirects(e){return this._redirectPolicy===`follow`?e:Ds(e)}_unfollowedRedirect(e,t){let n=this._redirectPolicy===`follow`?void 0:Os(e,t);return n&&`${n} (redirectPolicy: 'same-origin')`}async _commonHeaders(){let e=new Headers(this._requestInit?.headers||void 0),t;try{t=await this._authProvider?.token()}catch(e){throw Ll(e)}return t&&e.set(`Authorization`,`Bearer ${t}`),this._sessionId&&e.set(`mcp-session-id`,this._sessionId),this._protocolVersion&&e.set(`mcp-protocol-version`,this._protocolVersion),e}_applyBodyDerivedHeaders(e,t){if(Array.isArray(t)||!Ra(t))return;let n=t.params?._meta?.[Fe];if(typeof n!=`string`)return;e.set(`mcp-protocol-version`,n),e.set(`mcp-method`,t.method);let r=co(t.method,t.params);r?.value!==void 0&&e.set(`mcp-name`,io(r.value))}_isModernEnvelopedRequest(e){if(Array.isArray(e)||!Ra(e))return!1;let t=e.params?._meta?.[Fe];return typeof t==`string`&&ci(t)}async _startOrAuthSse(e,t=!1,n=0){let{resumptionToken:r,requestSignal:i}=e,a=()=>this._abortController?.signal.aborted===!0||i?.aborted===!0;try{let a=await this._commonHeaders(),o=[...a.get(`accept`)?.split(`,`).map(e=>e.trim().toLowerCase())??[],`text/event-stream`];a.set(`accept`,[...new Set(o)].join(`, `)),r&&a.set(`last-event-id`,r);let s=this._abortController?.signal,c=i!==void 0&&s!==void 0?Eu(s,i):i??s,l=await this._redirects(this._fetch??fetch)(this._url,{...this._requestInit,method:`GET`,headers:a,signal:c});if(!l.ok){if(l.status===401&&this._authProvider){if(l.headers.has(`www-authenticate`)){let{resourceMetadataUrl:e,scope:t}=dl(l);this._resourceMetadataUrl=e,this._scope=Hc(this._scope,t)}if(this._authProvider.onUnauthorized&&!t){try{await this._authProvider.onUnauthorized({response:l,serverUrl:this._url,fetchFn:this._fetchWithInit})}catch(e){throw Ll(e)}return await l.text?.().catch(()=>{}),this._startOrAuthSse(e,!0,n)}throw await l.text?.().catch(()=>{}),Ll(t?new ni(J.ClientHttpAuthentication,`Server returned 401 after re-authentication`,{status:401,statusText:l.statusText}):new zc)}if(l.status===403){let{resourceMetadataUrl:r,scope:i,error:a,errorDescription:o}=dl(l);if(a===`insufficient_scope`){let a=await l.text?.().catch(()=>null);if(await this._stepUpAuthorize({scope:i,resourceMetadataUrl:r,errorDescription:o,statusText:l.statusText,text:a},n)!==`AUTHORIZED`)throw Ll(new zc);return this._startOrAuthSse(e,t,n+1)}}if(await l.text?.().catch(()=>{}),l.status===405){e.onRequestStreamEnd?.();return}let r=this._unfollowedRedirect(this._url,l)??l.statusText;throw new ni(J.ClientHttpFailedToOpenStream,`Failed to open SSE stream: ${r}`,{status:l.status,statusText:l.statusText})}this._handleSseStream(l.body,e,!0)}catch(e){throw a()||this.onerror?.(e),e}}_getNextReconnectionDelay(e){if(this._serverRetryMs!==void 0)return this._serverRetryMs;let t=this._reconnectionOptions.initialReconnectionDelay,n=this._reconnectionOptions.reconnectionDelayGrowFactor,r=this._reconnectionOptions.maxReconnectionDelay;return Math.min(t*n**+e,r)}_scheduleReconnection(e,t=0){let n=this._reconnectionOptions.maxRetries;if(t>=n){this.onerror?.(Error(`Maximum reconnection attempts (${n}) exceeded.`)),e.onRequestStreamEnd?.();return}let r=this._getNextReconnectionDelay(t),i=()=>{this._cancelReconnection=void 0,!(this._abortController?.signal.aborted||e.requestSignal?.aborted)&&this._startOrAuthSse(e).catch(n=>{if(!(this._abortController?.signal.aborted||e.requestSignal?.aborted)){this.onerror?.(Error(`Failed to reconnect SSE stream: ${n instanceof Error?n.message:String(n)}`));try{this._scheduleReconnection(e,t+1)}catch(e){this.onerror?.(e instanceof Error?e:Error(String(e)))}}})};if(this._reconnectionScheduler){let e=this._reconnectionScheduler(i,r,t);this._cancelReconnection=typeof e==`function`?e:void 0}else{let e=setTimeout(i,r);this._cancelReconnection=()=>clearTimeout(e)}}_handleSseStream(e,t,n){if(!e){t.onRequestStreamEnd?.();return}let{onresumptiontoken:r,replayMessageId:i,requestSignal:a,onRequestStreamEnd:o}=t,s=()=>this._abortController?.signal.aborted===!0||a?.aborted===!0,c,l=!1,u=!1;(async()=>{try{let t=e.pipeThrough(new TextDecoderStream).pipeThrough(new Dc({onRetry:e=>{this._serverRetryMs=e}})).getReader();for(;;){let{value:e,done:n}=await t.read();if(n)break;if(e.id&&(c=e.id,l=!0,r?.(e.id)),e.data&&(!e.event||e.event===`message`))try{let t=tt.parse(JSON.parse(e.data));(Ba(t)||Va(t))&&(u=!0,i!==void 0&&(t.id=i)),this.onmessage?.(t)}catch(e){this.onerror?.(e)}}(n||l)&&!u&&this._abortController&&!s()?this._scheduleReconnection({resumptionToken:c,onresumptiontoken:r,replayMessageId:i,requestSignal:a,onRequestStreamEnd:o},0):s()||o?.()}catch(e){if(s())return;if(this.onerror?.(Error(`SSE stream disconnected: ${e}`)),(n||l)&&!u&&this._abortController&&!s())try{this._scheduleReconnection({resumptionToken:c,onresumptiontoken:r,replayMessageId:i,requestSignal:a,onRequestStreamEnd:o},0)}catch(e){this.onerror?.(Error(`Failed to reconnect: ${e instanceof Error?e.message:String(e)}`)),o?.()}else o?.()}})()}async start(){if(this._abortController)throw Error(`StreamableHTTPClientTransport already started! If using Client class, note that connect() calls start() automatically.`);this._abortController=new AbortController}async finishAuth(e,t){if(!this._oauthProvider)throw new zc(`finishAuth requires an OAuthClientProvider`);let{authorizationCode:n,iss:r}=await Wc(e,t,this._oauthProvider,this._url,{fetchFn:this._fetchWithInit,resourceMetadataUrl:this._resourceMetadataUrl});if(await al(this._oauthProvider,{serverUrl:this._url,authorizationCode:n,iss:r,resourceMetadataUrl:this._resourceMetadataUrl,scope:this._scope,fetchFn:this._fetchWithInit,skipIssuerMetadataValidation:this._skipIssuerMetadataValidation})!==`AUTHORIZED`)throw new zc(`Failed to authorize`)}async close(){try{this._cancelReconnection?.()}finally{this._cancelReconnection=void 0,this._abortController?.abort(),this.onclose?.()}}async send(e,t){return this._send(e,t,!1)}async _send(e,t,n,r=0){try{let{resumptionToken:i,onresumptiontoken:a}=t||{};if(i){this._startOrAuthSse({resumptionToken:i,replayMessageId:Ra(e)?e.id:void 0,requestSignal:t?.requestSignal}).catch(e=>this.onerror?.(e));return}let o=await this._commonHeaders();this._applyBodyDerivedHeaders(o,e);let s=Array.isArray(e)?e.some(e=>Ua(e)):Ua(e);if(s&&o.delete(`mcp-session-id`),t?.headers!==void 0)for(let[e,n]of Object.entries(t.headers))Tu.has(e.toLowerCase())||o.set(e,n);o.set(`content-type`,`application/json`);let c=[...o.get(`accept`)?.split(`,`).map(e=>e.trim().toLowerCase())??[],`application/json`,`text/event-stream`];o.set(`accept`,[...new Set(c)].join(`, `));let l=this._abortController?.signal,u=t?.requestSignal!==void 0&&l!==void 0?Eu(l,t.requestSignal):t?.requestSignal??l,d={...this._requestInit,method:`POST`,headers:o,body:JSON.stringify(e),signal:u},f=await this._redirects(this._fetch??fetch)(this._url,d);if(s&&f.ok&&(this._sessionId=f.headers.get(`mcp-session-id`)||void 0),!f.ok){if(f.status===401&&this._authProvider){if(f.headers.has(`www-authenticate`)){let{resourceMetadataUrl:e,scope:t}=dl(f);this._resourceMetadataUrl=e,this._scope=Hc(this._scope,t)}if(this._authProvider.onUnauthorized&&!n){try{await this._authProvider.onUnauthorized({response:f,serverUrl:this._url,fetchFn:this._fetchWithInit})}catch(e){throw Ll(e)}return await f.text?.().catch(()=>{}),this._send(e,t,!0,r)}throw await f.text?.().catch(()=>{}),Ll(n?new ni(J.ClientHttpAuthentication,`Server returned 401 after re-authentication`,{status:401,statusText:f.statusText}):new zc)}let i=await f.text?.().catch(()=>null);if(f.status===403){let{resourceMetadataUrl:a,scope:o,error:s,errorDescription:c}=dl(f);if(s===`insufficient_scope`){if(await this._stepUpAuthorize({scope:o,resourceMetadataUrl:a,errorDescription:c,statusText:f.statusText,text:i},r)!==`AUTHORIZED`)throw Ll(new zc);return this._send(e,t,n,r+1)}}if(f.status===400&&typeof i==`string`&&this._isModernEnvelopedRequest(e))try{let t=tt.parse(JSON.parse(i)),n=(Array.isArray(e)?e:[e]).filter(e=>Ra(e));if(Va(t)&&n.some(e=>e.id===t.id)){this.onmessage?.(t);return}}catch{}let a=this._unfollowedRedirect(this._url,f)??i;throw new ni(J.ClientHttpNotImplemented,`Error POSTing to endpoint: ${a}`,{status:f.status,statusText:f.statusText,text:i})}if(f.status===202){await f.text?.().catch(()=>{}),Wa(e)&&this._startOrAuthSse({resumptionToken:void 0}).catch(e=>this.onerror?.(e));return}let p=(Array.isArray(e)?e:[e]).some(e=>`method`in e&&`id`in e&&e.id!==void 0),m=f.headers.get(`content-type`),h=vs(m);if(p){if(h===`text/event-stream`)this._handleSseStream(f.body,{onresumptiontoken:a,requestSignal:t?.requestSignal,onRequestStreamEnd:t?.onRequestStreamEnd},!1);else if(h===`application/json`){let e=await f.json(),t=Array.isArray(e)?e.map(e=>tt.parse(e)):[tt.parse(e)];for(let e of t)this.onmessage?.(e)}else throw await f.text?.().catch(()=>{}),new Y(J.ClientHttpUnexpectedContent,`Unexpected content type: ${m}`,{contentType:m})}else await f.text?.().catch(()=>{})}catch(e){throw t?.requestSignal?.aborted!==!0&&this.onerror?.(e),e}}get sessionId(){return this._sessionId}async terminateSession(){if(this._sessionId)try{let e=await this._commonHeaders(),t={...this._requestInit,method:`DELETE`,headers:e,signal:this._abortController?.signal},n=await this._redirects(this._fetch??fetch)(this._url,t);if(await n.text?.().catch(()=>{}),!n.ok&&n.status!==405)throw new ni(J.ClientHttpFailedToTerminateSession,`Failed to terminate session: ${this._unfollowedRedirect(this._url,n)??n.statusText}`,{status:n.status,statusText:n.statusText});this._sessionId=void 0}catch(e){throw this.onerror?.(e),e}}setProtocolVersion(e){this._protocolVersion=e}get protocolVersion(){return this._protocolVersion}async resumeStream(e,t){await this._startOrAuthSse({resumptionToken:e,onresumptiontoken:t?.onresumptiontoken})}},Ou=class{_eventSlots=new Map;setHandler(e,t){let n=this._ensureEventSlot(e);n.onHandler&&t&&console.warn(`[MCP Apps] on${String(e)} handler replaced. Use addEventListener("${String(e)}", …) to add multiple listeners without replacing.`),n.onHandler=t}getHandler(e){return this._eventSlots.get(e)?.onHandler}addEventListener(e,t){this._ensureEventSlot(e).listeners.push(t)}removeEventListener(e,t){let n=this._eventSlots.get(e);if(!n)return;let r=n.listeners.indexOf(t);r!==-1&&n.listeners.splice(r,1)}dispatch(e,t){let n=this._eventSlots.get(e);if(n){n.onHandler?.(t);for(let e of[...n.listeners])e(t)}}_ensureEventSlot(e){let t=this._eventSlots.get(e);return t||(t={listeners:[]},this._eventSlots.set(e,t)),t}},ku=class{_methods=new Set;claim(e,t){if(this._methods.has(e))throw Error(`Handler for "${e}" already registered (via ${t}). Use addEventListener() to attach multiple listeners, or the on* setter for replace semantics.`);this._methods.add(e)}replace(e){this._methods.add(e)}release(e){this._methods.delete(e)}has(e){return this._methods.has(e)}},Au=new Set;function ju(e,t){let[n,r]=t,i=n?.shape;if(typeof i?.method?.value!=`string`)return;let a=i.method.value,o=e===`request`?`setRequestHandler`:`setNotificationHandler`;Au.has(o)||(Au.add(o),console.warn(`[ext-apps] ${o}(Schema, handler) is deprecated; use ${o}("${a}", { params: Schema.shape.params }, handler).`));let s=r;return[a,{params:i.params},e===`request`?(e,t)=>s({method:a,params:e},Mu(t)):e=>s({method:a,params:e})]}function Mu(e){return{signal:e.mcpReq.signal,requestId:e.mcpReq.id,sessionId:e.sessionId,_meta:e.mcpReq._meta,sendRequest:e.mcpReq.send,sendNotification:e.mcpReq.notify,authInfo:e.http?.authInfo}}var Nu=`2026-01-26`,Pu=h([k(`light`),k(`dark`)]).describe(`Color theme preference for the host environment.`),Fu=h([k(`inline`),k(`fullscreen`),k(`pip`)]).describe(`Display mode for UI presentation.`),Iu=h([k(`--color-background-primary`),k(`--color-background-secondary`),k(`--color-background-tertiary`),k(`--color-background-inverse`),k(`--color-background-ghost`),k(`--color-background-info`),k(`--color-background-danger`),k(`--color-background-success`),k(`--color-background-warning`),k(`--color-background-disabled`),k(`--color-text-primary`),k(`--color-text-secondary`),k(`--color-text-tertiary`),k(`--color-text-inverse`),k(`--color-text-ghost`),k(`--color-text-info`),k(`--color-text-danger`),k(`--color-text-success`),k(`--color-text-warning`),k(`--color-text-disabled`),k(`--color-border-primary`),k(`--color-border-secondary`),k(`--color-border-tertiary`),k(`--color-border-inverse`),k(`--color-border-ghost`),k(`--color-border-info`),k(`--color-border-danger`),k(`--color-border-success`),k(`--color-border-warning`),k(`--color-border-disabled`),k(`--color-ring-primary`),k(`--color-ring-secondary`),k(`--color-ring-inverse`),k(`--color-ring-info`),k(`--color-ring-danger`),k(`--color-ring-success`),k(`--color-ring-warning`),k(`--font-sans`),k(`--font-mono`),k(`--font-weight-normal`),k(`--font-weight-medium`),k(`--font-weight-semibold`),k(`--font-weight-bold`),k(`--font-text-xs-size`),k(`--font-text-sm-size`),k(`--font-text-md-size`),k(`--font-text-lg-size`),k(`--font-heading-xs-size`),k(`--font-heading-sm-size`),k(`--font-heading-md-size`),k(`--font-heading-lg-size`),k(`--font-heading-xl-size`),k(`--font-heading-2xl-size`),k(`--font-heading-3xl-size`),k(`--font-text-xs-line-height`),k(`--font-text-sm-line-height`),k(`--font-text-md-line-height`),k(`--font-text-lg-line-height`),k(`--font-heading-xs-line-height`),k(`--font-heading-sm-line-height`),k(`--font-heading-md-line-height`),k(`--font-heading-lg-line-height`),k(`--font-heading-xl-line-height`),k(`--font-heading-2xl-line-height`),k(`--font-heading-3xl-line-height`),k(`--border-radius-xs`),k(`--border-radius-sm`),k(`--border-radius-md`),k(`--border-radius-lg`),k(`--border-radius-xl`),k(`--border-radius-full`),k(`--border-width-regular`),k(`--shadow-hairline`),k(`--shadow-sm`),k(`--shadow-md`),k(`--shadow-lg`)]).describe(`CSS variable keys available to MCP apps for theming.`),Lu=C(Iu.describe(`Style variables for theming MCP apps. - -Individual style keys are optional - hosts may provide any subset of these values. -Values are strings containing CSS values (colors, sizes, font stacks, etc.). - -Note: This type uses \`Record\` rather than \`Partial>\` -for compatibility with Zod schema generation. Both are functionally equivalent for validation.`),h([g(),ue()]).describe(`Style variables for theming MCP apps. - -Individual style keys are optional - hosts may provide any subset of these values. -Values are strings containing CSS values (colors, sizes, font stacks, etc.). - -Note: This type uses \`Record\` rather than \`Partial>\` -for compatibility with Zod schema generation. Both are functionally equivalent for validation.`)).describe(`Style variables for theming MCP apps. - -Individual style keys are optional - hosts may provide any subset of these values. -Values are strings containing CSS values (colors, sizes, font stacks, etc.). - -Note: This type uses \`Record\` rather than \`Partial>\` -for compatibility with Zod schema generation. Both are functionally equivalent for validation.`),Ru=S({method:k(`ui/open-link`),params:S({url:g().describe(`URL to open in the host's browser`)})}),zu=S({isError:O().optional().describe(`True if the host failed to open the URL (e.g., due to security policy).`)}).passthrough(),Bu=S({isError:O().optional().describe(`True if the download failed (e.g., user cancelled or host denied).`)}).passthrough(),Vu=S({isError:O().optional().describe(`True if the host rejected or failed to deliver the message.`)}).passthrough(),Hu=S({method:k(`ui/notifications/sandbox-proxy-ready`),params:S({})}),Uu=S({connectDomains:D(g()).optional().describe(`Origins for network requests (fetch/XHR/WebSocket). - -- Maps to CSP \`connect-src\` directive -- Empty or omitted → no network connections (secure default)`),resourceDomains:D(g()).optional().describe("Origins for static resources (images, scripts, stylesheets, fonts, media).\n\n- Maps to CSP `img-src`, `script-src`, `style-src`, `font-src`, `media-src` directives\n- Wildcard subdomains supported: `https://*.example.com`\n- Empty or omitted → no network resources (secure default)"),frameDomains:D(g()).optional().describe("Origins for nested iframes.\n\n- Maps to CSP `frame-src` directive\n- Empty or omitted → no nested iframes allowed (`frame-src 'none'`)"),baseUriDomains:D(g()).optional().describe("Allowed base URIs for the document.\n\n- Maps to CSP `base-uri` directive\n- Empty or omitted → only same origin allowed (`base-uri 'self'`)")}),Wu=S({camera:S({}).optional().describe(`Request camera access. - -Maps to Permission Policy \`camera\` feature.`),microphone:S({}).optional().describe(`Request microphone access. - -Maps to Permission Policy \`microphone\` feature.`),geolocation:S({}).optional().describe(`Request geolocation access. - -Maps to Permission Policy \`geolocation\` feature.`),clipboardWrite:S({}).optional().describe(`Request clipboard write access. - -Maps to Permission Policy \`clipboard-write\` feature.`)}),Gu=S({method:k(`ui/notifications/size-changed`),params:S({width:j().optional().describe(`New width in pixels.`),height:j().optional().describe(`New height in pixels.`)})});S({method:k(`ui/notifications/tool-input`),params:S({arguments:C(g(),b().describe(`Complete tool call arguments as key-value pairs.`)).optional().describe(`Complete tool call arguments as key-value pairs.`)})}),S({method:k(`ui/notifications/tool-input-partial`),params:S({arguments:C(g(),b().describe(`Partial tool call arguments (incomplete, may change).`)).optional().describe(`Partial tool call arguments (incomplete, may change).`)})}),S({method:k(`ui/notifications/tool-cancelled`),params:S({reason:g().optional().describe(`Optional reason for the cancellation (e.g., "user action", "timeout").`)})});var Ku=S({fonts:g().optional()}),qu=S({variables:Lu.optional().describe(`CSS variables for theming the app.`),css:Ku.optional().describe(`CSS blocks that apps can inject.`)});S({method:k(`ui/resource-teardown`),params:S({})});var Ju=C(g(),b()),Yu=S({text:S({}).optional().describe(`Host supports text content blocks.`),image:S({}).optional().describe(`Host supports image content blocks.`),audio:S({}).optional().describe(`Host supports audio content blocks.`),resource:S({}).optional().describe(`Host supports resource content blocks.`),resourceLink:S({}).optional().describe(`Host supports resource link content blocks.`),structuredContent:S({}).optional().describe(`Host supports structured content.`)}),Xu=S({method:k(`ui/notifications/request-teardown`),params:S({}).optional()}),Zu=S({experimental:C(g(),C(g(),te()).describe(`Experimental features keyed by identifier.`)).optional().describe(`Experimental features keyed by identifier.`),openLinks:S({}).optional().describe(`Host supports opening external URLs.`),downloadFile:S({}).optional().describe(`Host supports file downloads via ui/download-file.`),serverTools:S({listChanged:O().optional().describe(`Host supports tools/list_changed notifications.`)}).optional().describe(`Host can proxy tool calls to the MCP server.`),serverResources:S({listChanged:O().optional().describe(`Host supports resources/list_changed notifications.`)}).optional().describe(`Host can proxy resource reads to the MCP server.`),logging:S({}).optional().describe(`Host accepts log messages.`),sandbox:S({permissions:Wu.optional().describe(`Permissions granted by the host (camera, microphone, geolocation).`),csp:Uu.optional().describe(`CSP domains approved by the host.`)}).optional().describe(`Sandbox configuration applied by the host.`),updateModelContext:Yu.optional().describe(`Host accepts context updates (ui/update-model-context) to be included in the model's context for future turns.`),message:Yu.optional().describe(`Host supports receiving content messages (ui/message) from the view.`),sampling:S({tools:S({}).optional().describe("Host supports tool use via `tools` and `toolChoice` parameters.")}).optional().describe("Host supports LLM sampling (sampling/createMessage) from the view.\nMirrors the MCP `ClientCapabilities.sampling` shape so hosts can pass it through.")}),Qu=S({experimental:C(g(),C(g(),te()).describe(`Experimental features keyed by identifier.`)).optional().describe(`Experimental features keyed by identifier.`),tools:S({listChanged:O().optional().describe(`App supports tools/list_changed notifications.`)}).optional().describe(`App exposes MCP-style tools that the host can call.`),availableDisplayModes:D(Fu).optional().describe(`Display modes the app supports.`)}),$u=S({method:k(`ui/notifications/initialized`),params:S({}).optional()});S({csp:Uu.optional().describe(`Content Security Policy configuration for UI resources.`),permissions:Wu.optional().describe(`Sandbox permissions requested by the UI resource.`),domain:g().optional().describe(`Dedicated origin for view sandbox. - -Useful when views need stable, dedicated origins for OAuth callbacks, CORS policies, or API key allowlists. - -**Host-dependent:** The format and validation rules for this field are determined by each host. Servers MUST consult host-specific documentation for the expected domain format. Common patterns include: -- Hash-based subdomains (e.g., \`{hash}.claudemcpcontent.com\`) -- URL-derived subdomains (e.g., \`www-example-com.oaiusercontent.com\`) - -If omitted, host uses default sandbox origin (typically per-conversation).`),prefersBorder:O().optional().describe(`Visual boundary preference - true if view prefers a visible border. - -Boolean requesting whether a visible border and background is provided by the host. Specifying an explicit value for this is recommended because hosts' defaults may vary. - -- \`true\`: request visible border + background -- \`false\`: request no visible border + background -- omitted: host decides border`)});var ed=S({method:k(`ui/request-display-mode`),params:S({mode:Fu.describe(`The display mode being requested.`)})}),td=S({mode:Fu.describe(`The display mode that was actually set. May differ from requested if not supported.`)}).passthrough(),nd=h([k(`model`),k(`app`)]).describe(`Tool visibility scope - who can access the tool.`);S({resourceUri:g().optional(),visibility:D(nd).optional().describe(`Who can access this tool. Default: ["model", "app"] -- "model": Tool visible to and callable by the agent -- "app": Tool callable by the app from this server only`),csp:T().optional(),permissions:T().optional()}),S({mimeTypes:D(g()).optional().describe('Array of supported MIME types for UI resources.\nMust include `"text/html;profile=mcp-app"` for MCP Apps support.')});var rd=S({method:k(`ui/download-file`),params:S({contents:D(h([dn,fn])).describe(`Resource contents to download — embedded (inline data) or linked (host fetches). Uses standard MCP resource types.`)})}),id=S({method:k(`ui/message`),params:S({role:k(`user`).describe(`Message role, currently only "user" is supported.`),content:D(pn).describe(`Message content blocks (text, image, etc.).`)})});S({method:k(`ui/notifications/sandbox-resource-ready`),params:S({html:g().describe(`HTML content to load into the inner iframe.`),sandbox:g().optional().describe(`Optional override for the inner iframe's sandbox attribute.`),csp:Uu.optional().describe(`CSP configuration from resource metadata.`),permissions:Wu.optional().describe(`Sandbox permissions from resource metadata.`)})}),S({method:k(`ui/notifications/tool-result`),params:Sn.describe(`Standard MCP tool execution result.`)});var ad=S({toolInfo:S({id:Xe.optional().describe(`JSON-RPC id of the tools/call request.`),tool:yn.describe(`Tool definition including name, inputSchema, etc.`)}).optional().describe(`Metadata of the tool call that instantiated this App.`),theme:Pu.optional().describe(`Current color theme preference.`),styles:qu.optional().describe(`Style configuration for theming the app.`),displayMode:Fu.optional().describe(`How the UI is currently displayed.`),availableDisplayModes:D(Fu).optional().describe(`Display modes the host supports.`),containerDimensions:h([S({height:j().describe(`Fixed container height in pixels.`)}),S({maxHeight:h([j(),ue()]).optional().describe(`Maximum container height in pixels.`)})]).and(h([S({width:j().describe(`Fixed container width in pixels.`)}),S({maxWidth:h([j(),ue()]).optional().describe(`Maximum container width in pixels.`)})])).optional().describe(`Container dimensions. Represents the dimensions of the iframe or other -container holding the app. Specify either width or maxWidth, and either height or maxHeight.`),locale:g().optional().describe(`User's language and region preference in BCP 47 format.`),timeZone:g().optional().describe(`User's timezone in IANA format.`),userAgent:g().optional().describe(`Host application identifier.`),platform:h([k(`web`),k(`desktop`),k(`mobile`)]).optional().describe(`Platform type for responsive design decisions.`),deviceCapabilities:S({touch:O().optional().describe(`Whether the device supports touch input.`),hover:O().optional().describe(`Whether the device supports hover interactions.`)}).optional().describe(`Device input capabilities.`),safeAreaInsets:S({top:j().describe(`Top safe area inset in pixels.`),right:j().describe(`Right safe area inset in pixels.`),bottom:j().describe(`Bottom safe area inset in pixels.`),left:j().describe(`Left safe area inset in pixels.`)}).optional().describe(`Mobile safe area boundaries in pixels.`)}).passthrough();S({method:k(`ui/notifications/host-context-changed`),params:ad.describe(`Partial context update containing only changed fields.`)});var od=S({method:k(`ui/update-model-context`),params:S({content:D(pn).optional().describe(`Context content blocks (text, image, etc.).`),structuredContent:C(g(),b().describe(`Structured content for machine-readable context data.`)).optional().describe(`Structured content for machine-readable context data.`)})}),sd=S({method:k(`ui/initialize`),params:S({appInfo:H.describe(`App identification (name and version).`),appCapabilities:Qu.describe(`Features and capabilities this app provides.`),protocolVersion:g().describe(`Protocol version this app supports.`)})}),cd=S({protocolVersion:g().describe(`Negotiated protocol version string (e.g., "2025-11-21").`),hostInfo:H.describe(`Host application identification and version.`),hostCapabilities:Zu.describe(`Features and capabilities provided by the host.`),hostContext:ad.describe(`Rich context about the host environment.`)}).passthrough(),ld=class{eventTarget;eventSource;messageListener;constructor(e=window.parent,t){this.eventTarget=e,this.eventSource=t,this.messageListener=e=>{if(t&&e.source!==this.eventSource){console.debug(`Ignoring message from unknown source`,e);return}let n=tt.safeParse(e.data);n.success?(console.debug(`Parsed message`,n.data),this.onmessage?.(n.data)):e.data?.jsonrpc===`2.0`?(console.error(`Failed to parse message`,n.error.message,e),this.onerror?.(Error(`Invalid JSON-RPC message received: `+n.error.message))):console.debug(`Ignoring non-JSON-RPC message`,n.error.message,e)}}async start(){window.addEventListener(`message`,this.messageListener)}async send(e,t){e.method!==`ui/notifications/tool-input-partial`&&console.debug(`Sending message`,e),this.eventTarget.postMessage(e,`*`)}async close(){window.removeEventListener(`message`,this.messageListener),this.onclose?.()}onclose;onerror;onmessage;sessionId;setProtocolVersion},ud=[Nu],dd=class extends os{_client;_hostInfo;_hostCapabilities;_appCapabilities;_hostContext={};_appInfo;_initializedReceived=!1;_registeredEvents=new Set;_events=new Ou;_methods=new ku;setRequestHandler=(...e)=>{let[t,...n]=ju(`request`,e)??e;this._methods.claim(t,`setRequestHandler`),super.setRequestHandler.call(this,t,...n)};setNotificationHandler=(...e)=>{let[t,...n]=ju(`notification`,e)??e;this._methods.claim(t,`setNotificationHandler`),super.setNotificationHandler.call(this,t,...n)};removeRequestHandler=e=>{this._methods.release(e),super.removeRequestHandler(e)};removeNotificationHandler=e=>{this._methods.release(e),super.removeNotificationHandler(e)};replaceRequestHandler=(e,...t)=>{this._methods.replace(e),super.setRequestHandler.call(this,e,...t)};_wrapHandler(e,t){let n=super._wrapHandler(e,t);return e===`ui/initialize`||e===`ping`?n:async(t,r)=>(this._initializedReceived||console.warn(`[ext-apps] AppBridge received '${e}' before ui/notifications/initialized. The View is calling host methods before completing the handshake; it should await app.connect() first.`),n(t,r))}eventSchemas={sizechange:Gu,sandboxready:Hu,initialized:$u,requestteardown:Xu,loggingmessage:Mn};setEventHandler(e,t){this._ensureEventSlot(e),this._events.setHandler(e,t)}getEventHandler(e){return this._events.getHandler(e)}addEventListener(e,t){this._ensureEventSlot(e),this._events.addEventListener(e,t)}removeEventListener(e,t){this._events.removeEventListener(e,t)}_ensureEventSlot(e){if(this._registeredEvents.has(e))return;let t=this.eventSchemas[e];if(!t)throw Error(`Unknown event: ${String(e)}`);let n=t=>{e===`initialized`&&(this._initializedReceived=!0),this._events.dispatch(e,t)};e===`loggingmessage`?this.setNotificationHandler(`notifications/message`,e=>{n(e.params)}):this.setNotificationHandler(t.shape.method.value,{params:t.shape.params},e=>n(e)),this._registeredEvents.add(e)}warnIfRequestHandlerReplaced(e,t,n){t&&n&&console.warn(`[MCP Apps] ${e} handler replaced. Previous handler will no longer be called.`)}constructor(e,t,n,r){super(r),this._client=e,this._hostInfo=t,this._hostCapabilities=n,this._methods.replace(`notifications/cancelled`),this._methods.replace(`notifications/progress`),this._ensureEventSlot(`initialized`),this._hostContext=r?.hostContext||{},this.replaceRequestHandler(`ui/initialize`,{params:sd.shape.params,result:cd},e=>this._onAppsInitialize(e)),this.replaceRequestHandler(`ping`,(e,t)=>(this.onping?.(e.params,t),{})),this.replaceRequestHandler(`ui/request-display-mode`,{params:ed.shape.params,result:td},()=>({mode:this._hostContext.displayMode??`inline`}))}buildContext(e){return e}assertCapabilityForMethod(e){}assertRequestHandlerCapability(e){}assertNotificationCapability(e){}getAppCapabilities(){return this._appCapabilities}getAppVersion(){return this._appInfo}onping;get onsizechange(){return this.getEventHandler(`sizechange`)}set onsizechange(e){this.setEventHandler(`sizechange`,e)}get onsandboxready(){return this.getEventHandler(`sandboxready`)}set onsandboxready(e){this.setEventHandler(`sandboxready`,e)}get oninitialized(){return this.getEventHandler(`initialized`)}set oninitialized(e){this.setEventHandler(`initialized`,e)}_onmessage;get onmessage(){return this._onmessage}set onmessage(e){this.warnIfRequestHandlerReplaced(`onmessage`,this._onmessage,e),this._onmessage=e,this.replaceRequestHandler(`ui/message`,{params:id.shape.params,result:Vu},async(e,t)=>{if(!this._onmessage)throw Error(`No onmessage handler set`);return this._onmessage(e,t)})}_onopenlink;get onopenlink(){return this._onopenlink}set onopenlink(e){this.warnIfRequestHandlerReplaced(`onopenlink`,this._onopenlink,e),this._onopenlink=e,this.replaceRequestHandler(`ui/open-link`,{params:Ru.shape.params,result:zu},async(e,t)=>{if(!this._onopenlink)throw Error(`No onopenlink handler set`);return this._onopenlink(e,t)})}_ondownloadfile;get ondownloadfile(){return this._ondownloadfile}set ondownloadfile(e){this.warnIfRequestHandlerReplaced(`ondownloadfile`,this._ondownloadfile,e),this._ondownloadfile=e,this.replaceRequestHandler(`ui/download-file`,{params:rd.shape.params,result:Bu},async(e,t)=>{if(!this._ondownloadfile)throw Error(`No ondownloadfile handler set`);return this._ondownloadfile(e,t)})}get onrequestteardown(){return this.getEventHandler(`requestteardown`)}set onrequestteardown(e){this.setEventHandler(`requestteardown`,e)}_onrequestdisplaymode;get onrequestdisplaymode(){return this._onrequestdisplaymode}set onrequestdisplaymode(e){this.warnIfRequestHandlerReplaced(`onrequestdisplaymode`,this._onrequestdisplaymode,e),this._onrequestdisplaymode=e,this.replaceRequestHandler(`ui/request-display-mode`,{params:ed.shape.params,result:td},async(e,t)=>{if(!this._onrequestdisplaymode)throw Error(`No onrequestdisplaymode handler set`);return this._onrequestdisplaymode(e,t)})}get onloggingmessage(){return this.getEventHandler(`loggingmessage`)}set onloggingmessage(e){this.setEventHandler(`loggingmessage`,e)}_onupdatemodelcontext;get onupdatemodelcontext(){return this._onupdatemodelcontext}set onupdatemodelcontext(e){this.warnIfRequestHandlerReplaced(`onupdatemodelcontext`,this._onupdatemodelcontext,e),this._onupdatemodelcontext=e,this.replaceRequestHandler(`ui/update-model-context`,{params:od.shape.params,result:rt},async(e,t)=>{if(!this._onupdatemodelcontext)throw Error(`No onupdatemodelcontext handler set`);return this._onupdatemodelcontext(e,t)})}_oncalltool;get oncalltool(){return this._oncalltool}set oncalltool(e){this.warnIfRequestHandlerReplaced(`oncalltool`,this._oncalltool,e),this._oncalltool=e,this.replaceRequestHandler(`tools/call`,async(e,t)=>{if(!this._oncalltool)throw Error(`No oncalltool handler set`);return this._oncalltool(e.params,t)})}_oncreatesamplingmessage;get oncreatesamplingmessage(){return this._oncreatesamplingmessage}set oncreatesamplingmessage(e){this.warnIfRequestHandlerReplaced(`oncreatesamplingmessage`,this._oncreatesamplingmessage,e),this._oncreatesamplingmessage=e,this.replaceRequestHandler(`sampling/createMessage`,async(e,t)=>{if(!this._oncreatesamplingmessage)throw Error(`No oncreatesamplingmessage handler set`);return this._oncreatesamplingmessage(e.params,t)})}sendToolListChanged(e={}){return this.notification({method:`notifications/tools/list_changed`,params:e})}_onlistresources;get onlistresources(){return this._onlistresources}set onlistresources(e){this.warnIfRequestHandlerReplaced(`onlistresources`,this._onlistresources,e),this._onlistresources=e,this.replaceRequestHandler(`resources/list`,async(e,t)=>{if(!this._onlistresources)throw Error(`No onlistresources handler set`);return this._onlistresources(e.params,t)})}_onlistresourcetemplates;get onlistresourcetemplates(){return this._onlistresourcetemplates}set onlistresourcetemplates(e){this.warnIfRequestHandlerReplaced(`onlistresourcetemplates`,this._onlistresourcetemplates,e),this._onlistresourcetemplates=e,this.replaceRequestHandler(`resources/templates/list`,async(e,t)=>{if(!this._onlistresourcetemplates)throw Error(`No onlistresourcetemplates handler set`);return this._onlistresourcetemplates(e.params,t)})}_onreadresource;get onreadresource(){return this._onreadresource}set onreadresource(e){this.warnIfRequestHandlerReplaced(`onreadresource`,this._onreadresource,e),this._onreadresource=e,this.replaceRequestHandler(`resources/read`,async(e,t)=>{if(!this._onreadresource)throw Error(`No onreadresource handler set`);return this._onreadresource(e.params,t)})}sendResourceListChanged(e={}){return this.notification({method:`notifications/resources/list_changed`,params:e})}_onlistprompts;get onlistprompts(){return this._onlistprompts}set onlistprompts(e){this.warnIfRequestHandlerReplaced(`onlistprompts`,this._onlistprompts,e),this._onlistprompts=e,this.replaceRequestHandler(`prompts/list`,async(e,t)=>{if(!this._onlistprompts)throw Error(`No onlistprompts handler set`);return this._onlistprompts(e.params,t)})}sendPromptListChanged(e={}){return this.notification({method:`notifications/prompts/list_changed`,params:e})}getCapabilities(){return this._hostCapabilities}async _onAppsInitialize(e){let t=e.protocolVersion;return this._appInfo!==void 0&&console.warn(`[ext-apps] AppBridge received a second ui/initialize. The View may be double-mounting (e.g. React StrictMode in dev) without closing the previous App instance. Responding normally; the latest appInfo/appCapabilities replace the previous values.`),this._appCapabilities=e.appCapabilities,this._appInfo=e.appInfo,{protocolVersion:ud.includes(t)?t:Nu,hostCapabilities:this.getCapabilities(),hostInfo:this._hostInfo,hostContext:this._hostContext}}setHostContext(e){let t={},n=!1;for(let r of Object.keys(e)){let i=this._hostContext[r],a=e[r];fd(i,a)||(t[r]=a,n=!0)}n&&(this._hostContext=e,this.sendHostContextChange(t))}sendHostContextChange(e){return this.notification({method:`ui/notifications/host-context-changed`,params:e})}sendToolInput(e){return this.notification({method:`ui/notifications/tool-input`,params:e})}sendToolInputPartial(e){return this.notification({method:`ui/notifications/tool-input-partial`,params:e})}sendToolResult(e){return this.notification({method:`ui/notifications/tool-result`,params:e})}sendToolCancelled(e){return this.notification({method:`ui/notifications/tool-cancelled`,params:e})}sendSandboxResourceReady(e){return this.notification({method:`ui/notifications/sandbox-resource-ready`,params:e})}teardownResource(e,t){return this.request({method:`ui/resource-teardown`,params:e},Ju,t)}sendResourceTeardown=this.teardownResource;callTool(e,t){return this.request({method:`tools/call`,params:e},t)}listTools(e,t){return this.request({method:`tools/list`,params:e},t)}async connect(e){if(this.transport)throw Error(`AppBridge is already connected. Call close() before connecting again.`);if(this._initializedReceived=!1,this._client){let e=this._client.getServerCapabilities();if(!e)throw Error(`Client server capabilities not available`);e.tools&&(this.oncalltool=async(e,t)=>this._client.request({method:`tools/call`,params:e},{signal:t.mcpReq.signal}),e.tools.listChanged&&this._client.setNotificationHandler(`notifications/tools/list_changed`,e=>this.sendToolListChanged(e.params))),e.resources&&(this.onlistresources=async(e,t)=>this._client.request({method:`resources/list`,params:e},{signal:t.mcpReq.signal}),this.onlistresourcetemplates=async(e,t)=>this._client.request({method:`resources/templates/list`,params:e},{signal:t.mcpReq.signal}),this.onreadresource=async(e,t)=>this._client.request({method:`resources/read`,params:e},{signal:t.mcpReq.signal}),e.resources.listChanged&&this._client.setNotificationHandler(`notifications/resources/list_changed`,e=>this.sendResourceListChanged(e.params))),e.prompts&&(this.onlistprompts=async(e,t)=>this._client.request({method:`prompts/list`,params:e},{signal:t.mcpReq.signal}),e.prompts.listChanged&&this._client.setNotificationHandler(`notifications/prompts/list_changed`,e=>this.sendPromptListChanged(e.params)))}return super.connect(e)}};function fd(e,t){return JSON.stringify(e)===JSON.stringify(t)}var $=n(e(),1),pd=t(),md=`text/html;profile=mcp-app`,hd=`io.modelcontextprotocol/ui`,gd=3,_d=5,vd=2e3,yd=class extends Error{},bd=null,xd=null;async function Sd(){let e=new Du(new URL(`/api/mcp`,location.origin),{fetch:(e,t)=>u(e,t)}),t=new vu({name:`fanout-browser`,version:`0.2.0`},{capabilities:{extensions:{[hd]:{mimeTypes:[md]}}}});try{await t.connect(e);let n={client:t,tools:t.listTools(),references:0,closed:!1,closeListeners:new Set};return n.tools.catch(()=>void 0),t.onclose=()=>wd(n,!1),t.onerror=()=>wd(n,!0),n}catch(t){throw await e.close().catch(()=>void 0),t}}async function Cd(){for(let e=0;e{xd===e&&!t.closed&&(bd=t)}).catch(()=>{xd===e&&(xd=null)})}let e=xd;if(!e)continue;let t=await e;if(t.closed){xd===e&&(xd=null);continue}return t.closeTimer&&=(clearTimeout(t.closeTimer),void 0),t.references+=1,t}throw Error(`MCP connection closed during setup`)}function wd(e,t){if(!e.closed){e.closed=!0,e.closeTimer&&clearTimeout(e.closeTimer),e.closeTimer=void 0,bd===e&&(bd=null),xd=null;for(let t of[...e.closeListeners])t();t&&e.client.close().catch(()=>void 0)}}function Td(e){e.references=Math.max(0,e.references-1),!(e.closed||e.references||e.closeTimer)&&(e.closeTimer=setTimeout(()=>{e.closeTimer=void 0,!(e.references||bd!==e)&&(e.closed=!0,bd=null,xd=null,e.client.close().catch(()=>void 0))},0))}function Ed(e){return typeof e==`object`&&e&&!Array.isArray(e)?e:void 0}var Dd=new Map;async function Od(e,t){let n=Dd.get(t);if(n&&n.expires>Date.now())return n.pending;let r={pending:Promise.resolve({text:``}),expires:1/0};return r.pending=e.readResource({uri:t}).then(e=>{let n=e.contents[0];if(e.contents.length!==1||!n||!(`text`in n)||!n.text)throw new yd(`MCP App resource has no HTML content`);if(n.uri!==t)throw new yd(`MCP App resource URI does not match the requested URI`);if(n.mimeType!==md)throw new yd(`MCP App resource has an unsupported MIME type`);let i=Ed(e)?.ttlMs;return r.expires=Date.now()+(typeof i==`number`&&i>0?i:3e5),{text:n.text,_meta:n._meta}}).catch(e=>{throw Dd.get(t)===r&&Dd.delete(t),e}),Dd.set(t,r),r.pending}function kd(e,t){let n=``;return/]*)?>/i.test(e)?e.replace(/]*)?>/i,e=>`${e}${n}`):/]*)?>/i.test(e)?e.replace(/]*)?>/i,e=>`${e}${n}`):`${n}${e}`}function Ad({content:e}){let t=f(e);return t?(0,pd.jsx)(jd,{content:t}):(0,pd.jsx)(o,{color:`bad`,m:`md`,children:`This view could not be loaded. Please try again.`})}function jd({content:e}){let t=(0,$.useRef)(null),n=(0,$.useRef)(null),u=(0,$.useRef)(null),f=(0,$.useRef)(null),[p,m]=(0,$.useState)(``),[h,g]=(0,$.useState)(`inline`),_=(0,$.useRef)(null),v=(0,$.useRef)(h);v.current=h;let y=e=>{g(e),f.current?.setHostContext({theme:te.current,displayMode:e,availableDisplayModes:[`inline`,`fullscreen`]}),e===`inline`&&document.activeElement!==t.current&&t.current?.focus()};(0,$.useEffect)(()=>{if(h!==`fullscreen`)return;_.current?.focus();let e=document.body.style.overflow;document.body.style.overflow=`hidden`;let n=e=>{e.key===`Escape`&&(e.preventDefault(),y(`inline`))},r=e=>{t.current?.parentElement?.contains(e.target)||_.current?.focus()};return window.addEventListener(`keydown`,n),document.addEventListener(`focusin`,r),()=>{document.body.style.overflow=e,window.removeEventListener(`keydown`,n),document.removeEventListener(`focusin`,r)}},[h]);let[b,x]=(0,$.useState)(240),[S,C]=(0,$.useState)(``),[ee,w]=(0,$.useState)(0),T=(0,$.useRef)(0),E=l(`light`),te=(0,$.useRef)(E);te.current=E,(0,$.useEffect)(()=>{f.current?.setHostContext({theme:E,displayMode:v.current,availableDisplayModes:[`inline`,`fullscreen`]})},[E]),(0,$.useEffect)(()=>{T.current=0},[e.resource_uri]),(0,$.useEffect)(()=>{let t=!1,r;g(`inline`),m(``),C(``);let i=()=>{let e=T.current+1;if(e>_d)return;T.current=e;let t=e===1?0:Math.min(750*2**(e-2),6e3);t===0?w(e=>e+1):r=setTimeout(()=>w(e=>e+1),t)},a=()=>i();async function o(){try{let r=await Cd();if(t){Td(r);return}u.current=r,r.closeListeners.add(a),n.current=r.client;let i=await Od(r.client,e.resource_uri);await r.tools,t||(T.current=0,m(kd(i.text,i._meta)))}catch(e){console.error(`MCP app resource load failed`,e),t||(C(`This view could not be loaded. Please try again.`),T.current>0&&!(e instanceof yd)&&i())}}return o(),()=>{t=!0,r&&clearTimeout(r);let e=f.current?.teardownResource({}).catch(()=>void 0)??Promise.resolve(),i=u.current;i&&(i.closeListeners.delete(a),e.finally(()=>Td(i))),f.current=null,n.current=null,u.current=null}},[e.resource_uri,ee]);async function D(){let r=t.current,i=n.current;if(r?.contentWindow&&p&&i&&!f.current)try{let t=new dd(null,{name:`Fanout`,version:`0.2.0`},{serverTools:{},logging:{}},{hostContext:{theme:te.current,displayMode:`inline`,availableDisplayModes:[`inline`,`fullscreen`]}}),n=u.current;if(!n)throw Error(`MCP connection unavailable`);t.oncalltool=async(e,t)=>{let r=Ed(Ed((await n.tools).tools.find(t=>t.name===e.name)?._meta)?.ui)?.visibility;if(!Array.isArray(r)||!r.includes(`app`)||/^(?:create|edit|replace|restore|delete)_/.test(e.name))throw Error(`This tool is unavailable in the app`);return i.callTool(e,{signal:t.mcpReq.signal})},t.onrequestdisplaymode=async({mode:e})=>e!==`inline`&&e!==`fullscreen`?{mode:v.current}:(y(e),{mode:e}),f.current=t,t.onsizechange=({height:e})=>{e&&x(Math.min(vd,Math.max(240,Math.round(e))))},t.onmessage=async()=>({isError:!0}),t.oninitialized=async()=>{await t.sendToolInput({arguments:e.tool_input??{}}),await t.sendToolResult({content:[{type:`text`,text:JSON.stringify(e.tool_result??{})}],structuredContent:e.tool_result,isError:e.is_error})},await t.connect(new ld(r.contentWindow,r.contentWindow))}catch(e){console.error(`MCP app bridge connect failed`,e),C(`This view could not be loaded. Please try again.`)}}return S?(0,pd.jsx)(o,{color:`bad`,m:`md`,children:S}):p?(0,pd.jsx)(d,{active:h===`fullscreen`,children:(0,pd.jsxs)(r,{"data-app-fullscreen":h===`fullscreen`?``:void 0,role:h===`fullscreen`?`dialog`:void 0,"aria-modal":h===`fullscreen`||void 0,"aria-label":h===`fullscreen`?`Fanout analysis view`:void 0,bg:`var(--mantine-color-body)`,style:h===`fullscreen`?{position:`fixed`,inset:0,zIndex:1e3,display:`flex`,flexDirection:`column`}:void 0,children:[h===`fullscreen`&&(0,pd.jsx)(r,{p:`xs`,ta:`right`,children:(0,pd.jsx)(i,{ref:_,"data-autofocus":!0,size:`compact-sm`,variant:`default`,"aria-label":`Close analysis view`,onClick:()=>y(`inline`),children:`Close`})}),(0,pd.jsx)(r,{component:`iframe`,tabIndex:0,ref:t,title:`Fanout analysis view`,sandbox:`allow-scripts`,scrolling:`auto`,srcDoc:p,w:`100%`,bd:0,bg:`var(--mantine-color-body)`,style:{display:`block`,height:h===`fullscreen`?`100%`:b,...h===`fullscreen`?{flex:`1 1 0`,minHeight:0}:{}},onLoad:()=>void D()})]})}):(0,pd.jsxs)(s,{mih:180,p:`xl`,children:[(0,pd.jsx)(c,{size:`sm`}),(0,pd.jsx)(a,{c:`dimmed`,size:`sm`,ml:`sm`,children:`Preparing view…`})]})}export{Ad as default}; \ No newline at end of file diff --git a/internal/ui/dist/assets/page-vAmZFsvk.js b/internal/ui/dist/assets/page-BaMlOBRS.js similarity index 51% rename from internal/ui/dist/assets/page-vAmZFsvk.js rename to internal/ui/dist/assets/page-BaMlOBRS.js index 79a2bbeea..45e4bc771 100644 --- a/internal/ui/dist/assets/page-vAmZFsvk.js +++ b/internal/ui/dist/assets/page-BaMlOBRS.js @@ -1,21 +1,21 @@ -import{a as e,i as t,o as n,r,s as i}from"./useRouter-ByJ6_rwb.js";import{A as a,C as o,D as s,E as c,K as l,M as u,O as d,P as f,Q as p,S as m,T as h,X as g,Y as _,Z as v,_ as y,_t as b,a as x,c as S,d as C,dt as w,f as T,ft as E,g as D,gt as O,h as k,j as A,k as j,lt as M,m as N,mt as P,nt as F,o as I,ot as L,p as ee,r as R,s as te,st as ne,tt as re,u as ie,ut as z,v as ae,x as B,y as oe}from"./brand-Bcp2Tp5I.js";import{_ as se,c as ce,h as le,m as ue,s as de}from"./preload-helper-DpsUT6aH.js";import{$ as fe,A as pe,B as me,C as he,D as ge,F as _e,G as ve,H as ye,I as be,J as xe,K as Se,L as Ce,M as we,N as Te,O as Ee,P as De,R as Oe,T as ke,U as Ae,V as je,W as Me,Z as Ne,c as Pe,d as Fe,et as Ie,f as Le,g as Re,h as ze,i as Be,j as Ve,k as He,l as Ue,m as We,o as Ge,ot as Ke,p as qe,q as Je,r as Ye,s as Xe,st as Ze,u as Qe,v as $e,w as et,y as tt,z as nt}from"./theme-DdznftKI.js";import{C as rt,E as it,b as at,o as ot,t as st,w as ct}from"./Tooltip-DhnGSmh7.js";import{t as lt}from"./use-computed-color-scheme-BIja2o3c.js";import{E as ut,T as dt,t as ft}from"./useQuery-CEXOTfck.js";import{c as pt,d as mt,o as ht,r as gt,s as _t,u as vt}from"./auth-C8kS8ur3.js";import{a as yt,c as bt,d as xt,i as St,l as Ct,n as wt,o as Tt,r as Et,s as Dt,t as Ot,u as kt}from"./dashboard-change-chips-C08J6wNb.js";import{n as At,r as jt,t as Mt}from"./WarningCircle.es-CQHtdoVp.js";function Nt(e,t){if(Object.is(e,t))return!0;if(typeof e!=`object`||!e||typeof t!=`object`||!t)return!1;if(e instanceof Map&&t instanceof Map){if(e.size!==t.size)return!1;for(let[n,r]of e)if(!t.has(n)||!Object.is(r,t.get(n)))return!1;return!0}if(e instanceof Set&&t instanceof Set){if(e.size!==t.size)return!1;for(let n of e)if(!t.has(n))return!1;return!0}if(e instanceof Date&&t instanceof Date)return e.getTime()===t.getTime();let n=Pt(e);if(n.length!==Pt(t).length)return!1;for(let r=0;r{if(typeof n!=`string`||n.trim().length===0)throw Error(t);return`${e}-${n}`}}var H=r();function It(e){return typeof e==`object`&&e?`base`in e?e.base:void 0:e}function Lt(e,t){if(e===t||Number.isNaN(e)&&Number.isNaN(t))return!0;if(!(e instanceof Object)||!(t instanceof Object))return!1;let n=Object.keys(e),{length:r}=n;if(r!==Object.keys(t).length)return!1;for(let i=0;i{r.current||=window.setTimeout(()=>{i(...e),r.current=null},t)},[t]),o=(0,V.useCallback)(()=>{r.current&&=(window.clearTimeout(r.current),null)},[]);return(0,V.useEffect)(()=>(n.autoInvoke&&a(),o),[o,a]),{start:a,clear:o}}function Ht(e){let t=(0,V.useRef)(void 0);return(0,V.useEffect)(()=>{t.current=e},[e]),t.current}function Ut(e,t,n){let r=(0,V.useRef)(null);(0,V.useEffect)(()=>{r.current&&=(r.current.disconnect(),null);let i=typeof n==`function`?n():n;return i&&(r.current=new MutationObserver(e),r.current.observe(i,t)),()=>{r.current&&=(r.current.disconnect(),null)}},[e,t,n])}function Wt(){let[e,t]=(0,V.useState)(!1);return(0,V.useEffect)(()=>t(!0),[]),e}function Gt(e){return typeof e==`string`||typeof e==`number`||typeof e==`boolean`||typeof e==`bigint`}function Kt(e,t=document){let n=t.querySelector(e);if(n)return n;let r=t.querySelectorAll(`*`);for(let t=0;t{if(!e||!t||!n.current)return;let r=e.getBoundingClientRect(),i=t.getBoundingClientRect(),a=t.offsetWidth===0?1:i.width/t.offsetWidth,o=t.offsetHeight===0?1:i.height/t.offsetHeight,s=window.getComputedStyle(e),c=window.getComputedStyle(t),l=at(s.borderTopWidth)+at(c.borderTopWidth),u=at(s.borderLeftWidth)+at(c.borderLeftWidth),d={top:(r.top-i.top)/o-l,left:(r.left-i.left)/a-u,width:r.width/a,height:r.height/o};n.current.style.transform=`translateY(${d.top}px) translateX(${d.left}px)`,n.current.style.width=`${d.width}px`,n.current.style.height=`${d.height}px`},p=()=>{window.clearTimeout(o.current),n.current&&(n.current.style.transitionDuration=`0ms`),f(),o.current=window.setTimeout(()=>{n.current&&(n.current.style.transitionDuration=``)},30)},m=(0,V.useRef)(null),h=(0,V.useRef)(null);return(0,V.useEffect)(()=>{if(c&&s.current!==e&&i&&i(),s.current=e,f(),e)return m.current=new ResizeObserver(p),m.current.observe(e),t&&(h.current=new ResizeObserver(p),h.current.observe(t)),()=>{m.current?.disconnect(),h.current?.disconnect()}},[t,e]),(0,V.useEffect)(()=>{if(t){let e=e=>{Xt(e.target,t)&&(p(),d(!1))};return t.addEventListener(`transitionend`,e),()=>{t.removeEventListener(`transitionend`,e)}}},[t]),(0,V.useEffect)(()=>{if(n.current&&a){let e=e=>{e.propertyName===`transform`&&a()};return n.current.addEventListener(`transitionend`,e),()=>{n.current?.removeEventListener(`transitionend`,e)}}},[a]),Vt(()=>{xt()!==`test`&&l(!0)},20,{autoInvoke:!0}),Ut(e=>{e.forEach(e=>{e.type===`attributes`&&e.attributeName===`dir`&&p()})},{attributes:!0,attributeFilter:[`dir`]},()=>document.documentElement),{initialized:c,hidden:u}}var Qt={root:`m_96b553a6`},$t=g((e,{transitionDuration:t},{shouldReduceMotion:n})=>({root:{"--transition-duration":e.respectReducedMotion&&n?`0ms`:typeof t==`number`?`${t}ms`:t||`150ms`}})),en=h(e=>{let t=u(`FloatingIndicator`,null,e),{classNames:n,className:r,style:i,styles:s,unstyled:c,vars:l,target:d,parent:f,transitionDuration:m,mod:h,displayAfterTransitionEnd:g,onTransitionStart:_,onTransitionEnd:v,attributes:y,ref:b,...x}=t,S=p(),C=a({name:`FloatingIndicator`,classes:Qt,props:t,className:r,style:i,classNames:n,styles:s,unstyled:c,attributes:y,vars:l,varsResolver:$t,stylesCtx:{shouldReduceMotion:S}}),w=(0,V.useRef)(null),{initialized:T,hidden:E}=Zt({target:d,parent:f,ref:w,displayAfterTransitionEnd:g,onTransitionStart:_,onTransitionEnd:v}),D=re(b,w);return!d||!f?null:(0,H.jsx)(o,{ref:D,mod:[{initialized:T,hidden:E},h],...C(`root`),...x})});en.displayName=`@mantine/core/FloatingIndicator`,en.classes=Qt,en.varsResolver=$t;var[tn,nn]=it(`Accordion component was not found in the tree`),[rn,an]=it(`Accordion.Item component was not found in the tree`),on={root:`m_9bdbb667`,panel:`m_df78851f`,content:`m_4ba554d4`,itemTitle:`m_8fa820a0`,control:`m_4ba585b8`,"control--default":`m_6939a5e9`,"control--contained":`m_4271d21b`,label:`m_df3ffa0f`,chevron:`m_3f35ae96`,icon:`m_9bd771fe`,item:`m_9bd7b098`,"item--default":`m_fe19b709`,"item--contained":`m_1f921b3b`,"item--filled":`m_2cdf939a`,"item--separated":`m_9f59b069`},sn=h(e=>{let{classNames:t,className:n,style:r,styles:i,vars:a,chevron:s,icon:c,onClick:l,onKeyDown:d,children:f,disabled:p,mod:h,...g}=u(`AccordionControl`,null,e),{value:_}=an(),v=nn(),y=v.isItemActive(_),b=typeof v.order==`number`,x=`h${v.order}`,S=(0,H.jsxs)(m,{...v.getStyles(`control`,{className:n,classNames:t,style:r,styles:i,variant:v.variant}),unstyled:v.unstyled,mod:[`accordion-control`,{active:y,"chevron-position":v.chevronPosition,disabled:p},h],onClick:e=>{l?.(e),v.onChange(_)},type:`button`,disabled:p,"aria-expanded":y,"aria-controls":v.getRegionId(_),id:v.getControlId(_),onKeyDown:fe({siblingSelector:`[data-accordion-control]`,parentSelector:`[data-accordion]`,activateOnFocus:!1,loop:v.loop,orientation:`vertical`,onKeyDown:d}),...g,children:[(0,H.jsx)(o,{component:`span`,mod:{rotate:!v.disableChevronRotation&&y,position:v.chevronPosition},...v.getStyles(`chevron`,{classNames:t,styles:i}),children:s||v.chevron}),(0,H.jsx)(`span`,{...v.getStyles(`label`,{classNames:t,styles:i}),children:f}),c&&(0,H.jsx)(o,{component:`span`,mod:{"chevron-position":v.chevronPosition},...v.getStyles(`icon`,{classNames:t,styles:i}),children:c})]});return b?(0,H.jsx)(x,{...v.getStyles(`itemTitle`,{classNames:t,styles:i}),children:S}):S});sn.displayName=`@mantine/core/AccordionControl`,sn.classes=on;var cn=h(e=>{let{classNames:t,className:n,style:r,styles:i,vars:a,value:s,mod:c,...l}=u(`AccordionItem`,null,e),d=nn();return(0,H.jsx)(rn,{value:{value:s},children:(0,H.jsx)(o,{mod:[{active:d.isItemActive(s)},c],...d.getStyles(`item`,{className:n,classNames:t,styles:i,style:r,variant:d.variant}),...l})})});cn.displayName=`@mantine/core/AccordionItem`,cn.classes=on;var ln=h(e=>{let{classNames:t,className:n,style:r,styles:i,vars:a,children:o,keepMounted:s,keepMountedMode:c,...l}=u(`AccordionPanel`,null,e),{value:d}=an(),f=nn();return(0,H.jsx)(kt,{...f.getStyles(`panel`,{className:n,classNames:t,style:r,styles:i}),expanded:f.isItemActive(d),transitionDuration:f.transitionDuration??200,role:`region`,id:f.getRegionId(d),"aria-labelledby":f.getControlId(d),keepMounted:s??f.keepMounted,keepMountedMode:c??f.keepMountedMode,...l,children:(0,H.jsx)(`div`,{...f.getStyles(`content`,{classNames:t,styles:i}),children:o})})});ln.displayName=`@mantine/core/AccordionPanel`,ln.classes=on;var un={multiple:!1,loop:!0,disableChevronRotation:!1,disableCollapse:!1,chevronPosition:`right`,variant:`default`,chevronSize:`auto`,chevronIconSize:16,keepMountedMode:`activity`},dn=g((e,{transitionDuration:t,chevronSize:n,radius:r})=>({root:{"--accordion-transition-duration":t===void 0?void 0:`${t}ms`,"--accordion-chevron-size":n===void 0?void 0:P(n),"--accordion-radius":r===void 0?void 0:ne(r)}})),fn=c(e=>{let t=u(`Accordion`,un,e),{classNames:n,className:r,style:i,styles:s,unstyled:c,vars:l,children:d,multiple:f,value:p,defaultValue:m,onChange:h,id:g,loop:_,transitionDuration:v,disableChevronRotation:y,disableCollapse:b,chevronPosition:x,chevronSize:S,order:C,chevron:w,variant:T,radius:E,chevronIconSize:D,attributes:O,keepMounted:k,keepMountedMode:A,...j}=t,M=F(g),[N,P]=mt({value:p,defaultValue:m,finalValue:f?[]:null,onChange:h}),I=e=>Array.isArray(N)?N.includes(e):e===N,L=e=>{if(!Array.isArray(N)&&b&&e===N)return;let t=Array.isArray(N)?N.includes(e)?N.filter(t=>t!==e):[...N,e]:e===N?null:e;P(t)},ee=a({name:`Accordion`,classes:on,props:t,className:r,style:i,classNames:n,styles:s,unstyled:c,attributes:O,vars:l,varsResolver:dn});return(0,H.jsx)(tn,{value:{isItemActive:I,onChange:L,getControlId:Ft(`${M}-control`,`Accordion.Item component was rendered with invalid value or without value`),getRegionId:Ft(`${M}-panel`,`Accordion.Item component was rendered with invalid value or without value`),chevron:w===null?null:w||(0,H.jsx)(Se,{size:D}),transitionDuration:v,disableChevronRotation:y,chevronPosition:x,order:C,loop:_,getStyles:ee,variant:T,unstyled:c,keepMounted:k,keepMountedMode:A},children:(0,H.jsx)(o,{...ee(`root`),id:M,...j,variant:T,"data-accordion":!0,children:d})})});fn.classes=on,fn.varsResolver=dn,fn.displayName=`@mantine/core/Accordion`,fn.Item=cn,fn.Panel=ln,fn.Control=sn,fn.Chevron=Se;function pn(e){return typeof e==`string`?{value:e,label:e}:typeof e==`object`&&`value`in e&&!(`label`in e)?{value:e.value,label:`${e.value}`,disabled:e.disabled}:typeof e==`object`&&`group`in e?{group:e.group,items:e.items.map(e=>pn(e))}:typeof e==`number`||typeof e==`bigint`||typeof e==`boolean`?{value:e,label:`${e}`}:e}function mn(e){return e?e.map(e=>pn(e)):[]}function hn(e){return e.reduce((e,t)=>`group`in t?{...e,...hn(t.items)}:(e[`${t.value}`]=t,e),{})}var gn={dropdown:`m_88b62a41`,search:`m_985517d8`,options:`m_b2821a6e`,option:`m_92253aa5`,empty:`m_2530cd1d`,header:`m_858f94bd`,footer:`m_82b967cb`,group:`m_254f3e4f`,groupLabel:`m_2bb2e9e5`,chevron:`m_2943220b`,optionsDropdownOption:`m_390b5f4`,optionsDropdownCheckIcon:`m_8ee53fc2`,optionsDropdownCheckPlaceholder:`m_a530ee0a`},_n={error:null},vn=g((e,{size:t,color:n})=>({chevron:{"--combobox-chevron-size":M(t,`combobox-chevron-size`),"--combobox-chevron-color":n?l(n,e):void 0}})),yn=h(e=>{let t=u(`ComboboxChevron`,_n,e),{size:n,error:r,style:i,className:s,classNames:c,styles:l,unstyled:d,vars:f,attributes:p,mod:m,...h}=t,g=a({name:`ComboboxChevron`,classes:gn,props:t,style:i,className:s,classNames:c,styles:l,unstyled:d,vars:f,varsResolver:vn,attributes:p,rootSelector:`chevron`});return(0,H.jsx)(o,{component:`svg`,...h,...g(`chevron`),size:n,viewBox:`0 0 15 15`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`,mod:[`combobox-chevron`,{error:r},m],children:(0,H.jsx)(`path`,{d:`M4.93179 5.43179C4.75605 5.60753 4.75605 5.89245 4.93179 6.06819C5.10753 6.24392 5.39245 6.24392 5.56819 6.06819L7.49999 4.13638L9.43179 6.06819C9.60753 6.24392 9.89245 6.24392 10.0682 6.06819C10.2439 5.89245 10.2439 5.60753 10.0682 5.43179L7.81819 3.18179C7.73379 3.0974 7.61933 3.04999 7.49999 3.04999C7.38064 3.04999 7.26618 3.0974 7.18179 3.18179L4.93179 5.43179ZM10.0682 9.56819C10.2439 9.39245 10.2439 9.10753 10.0682 8.93179C9.89245 8.75606 9.60753 8.75606 9.43179 8.93179L7.49999 10.8636L5.56819 8.93179C5.39245 8.75606 5.10753 8.75606 4.93179 8.93179C4.75605 9.10753 4.75605 9.39245 4.93179 9.56819L7.18179 11.8182C7.35753 11.9939 7.64245 11.9939 7.81819 11.8182L10.0682 9.56819Z`,fill:`currentColor`,fillRule:`evenodd`,clipRule:`evenodd`})})});yn.classes=gn,yn.varsResolver=vn,yn.displayName=`@mantine/core/ComboboxChevron`;var[bn,xn]=it(`Combobox component was not found in tree`);function Sn({onMouseDown:e,onClick:t,onClear:n,...r}){return(0,H.jsx)(k.ClearButton,{tabIndex:-1,"aria-hidden":!0,...r,onMouseDown:t=>{t.preventDefault(),e?.(t)},onClick:e=>{n(),t?.(e)}})}Sn.displayName=`@mantine/core/ComboboxClearButton`;var Cn=h(e=>{let{classNames:t,styles:n,className:r,style:i,hidden:a,...o}=u(`ComboboxDropdown`,null,e),s=xn();return(0,H.jsx)(Je.Dropdown,{...o,role:`presentation`,"data-hidden":a||void 0,"data-floating-height":s.floatingHeight||void 0,...s.getStyles(`dropdown`,{className:r,style:i,classNames:t,styles:n})})});Cn.classes=gn,Cn.displayName=`@mantine/core/ComboboxDropdown`;var wn={refProp:`ref`},Tn=h(e=>{let{children:t,refProp:n,ref:r}=u(`ComboboxDropdownTarget`,wn,e);if(xn(),!w(t))throw Error(`Combobox.DropdownTarget component children should be an element or a component that accepts ref. Fragments, strings, numbers and other primitive values are not supported`);return(0,H.jsx)(Je.Target,{ref:r,refProp:n,children:t})});Tn.displayName=`@mantine/core/ComboboxDropdownTarget`;var En=h(e=>{let{classNames:t,className:n,style:r,styles:i,vars:a,...s}=u(`ComboboxEmpty`,null,e),c=xn();return(0,H.jsx)(o,{...c.getStyles(`empty`,{className:n,classNames:t,styles:i,style:r}),...s})});En.classes=gn,En.displayName=`@mantine/core/ComboboxEmpty`;function Dn({onKeyDown:e,onClick:t,withKeyboardNavigation:n,withAriaAttributes:r,withExpandedAttribute:i,targetType:a,autoComplete:o}){let s=xn(),[c,l]=(0,V.useState)(null),u=t=>{if(e?.(t),!s.readOnly&&n){if(t.nativeEvent.isComposing)return;if(t.nativeEvent.code===`ArrowDown`&&(t.preventDefault(),s.store.dropdownOpened?l(s.store.selectNextOption()):(s.store.openDropdown(`keyboard`),l(s.store.selectActiveOption()),s.store.updateSelectedOptionIndex(`selected`,{scrollIntoView:!0}))),t.nativeEvent.code===`ArrowUp`&&(t.preventDefault(),s.store.dropdownOpened?l(s.store.selectPreviousOption()):(s.store.openDropdown(`keyboard`),l(s.store.selectActiveOption()),s.store.updateSelectedOptionIndex(`selected`,{scrollIntoView:!0}))),t.nativeEvent.code===`Enter`||t.nativeEvent.code===`NumpadEnter`){if(t.nativeEvent.keyCode===229)return;let e=s.store.getSelectedOptionIndex();s.store.dropdownOpened&&e!==-1?(t.preventDefault(),s.store.clickSelectedOption()):a===`button`&&(t.preventDefault(),s.store.openDropdown(`keyboard`))}t.key===`Escape`&&s.store.closeDropdown(`keyboard`),t.nativeEvent.code===`Space`&&a===`button`&&(t.preventDefault(),s.store.toggleDropdown(`keyboard`))}},d=r?{...i?{role:`combobox`}:{},"aria-haspopup":`listbox`,"aria-expanded":i?!!(s.store.listId&&s.store.dropdownOpened):void 0,"aria-controls":s.store.dropdownOpened&&s.store.listId?s.store.listId:void 0,"aria-activedescendant":s.store.dropdownOpened&&c||void 0,autoComplete:o,"data-expanded":s.store.dropdownOpened||void 0,"data-mantine-stop-propagation":s.store.dropdownOpened||void 0}:{},f=e=>{a===`button`&&e.currentTarget.focus(),t?.(e)};return{...d,onKeyDown:u,onClick:f}}var On={refProp:`ref`,targetType:`input`,withKeyboardNavigation:!0,withAriaAttributes:!0,withExpandedAttribute:!1,autoComplete:`off`},kn=h(e=>{let{children:t,refProp:n,withKeyboardNavigation:r,withAriaAttributes:i,withExpandedAttribute:a,targetType:o,autoComplete:s,ref:c,...l}=u(`ComboboxEventsTarget`,On,e),d=v(t);if(!d)throw Error(`Combobox.EventsTarget component children should be an element or a component that accepts ref. Fragments, strings, numbers and other primitive values are not supported`);let f=xn(),p=Dn({targetType:o,withAriaAttributes:i,withKeyboardNavigation:r,withExpandedAttribute:a,onKeyDown:d.props.onKeyDown,onClick:d.props.onClick,autoComplete:s});return(0,V.cloneElement)(d,{...p,...l,[n]:re(c,f.store.targetRef,rt(d))})});kn.displayName=`@mantine/core/ComboboxEventsTarget`;var An=h(e=>{let{classNames:t,className:n,style:r,styles:i,vars:a,...s}=u(`ComboboxFooter`,null,e),c=xn();return(0,H.jsx)(o,{...c.getStyles(`footer`,{className:n,classNames:t,style:r,styles:i}),...s,onMouseDown:e=>{e.preventDefault()}})});An.classes=gn,An.displayName=`@mantine/core/ComboboxFooter`;var jn=h(e=>{let{classNames:t,className:n,style:r,styles:i,vars:a,children:s,label:c,id:l,...d}=u(`ComboboxGroup`,null,e),f=xn(),p=F(l),m=c!=null&&c!==!1&&c!==``;return(0,H.jsxs)(o,{role:`group`,"aria-labelledby":m?p:void 0,...f.getStyles(`group`,{className:n,classNames:t,style:r,styles:i}),...d,children:[m&&(0,H.jsx)(`div`,{id:p,...f.getStyles(`groupLabel`,{classNames:t,styles:i}),children:c}),s]})});jn.classes=gn,jn.displayName=`@mantine/core/ComboboxGroup`;var Mn=h(e=>{let{classNames:t,className:n,style:r,styles:i,vars:a,...s}=u(`ComboboxHeader`,null,e),c=xn();return(0,H.jsx)(o,{...c.getStyles(`header`,{className:n,classNames:t,style:r,styles:i}),...s,onMouseDown:e=>{e.preventDefault()}})});Mn.classes=gn,Mn.displayName=`@mantine/core/ComboboxHeader`;function Nn({value:e,valuesDivider:t=`,`,...n}){return(0,H.jsx)(`input`,{type:`hidden`,value:Array.isArray(e)?e.join(t):e?`${e}`:``,...n})}Nn.displayName=`@mantine/core/ComboboxHiddenInput`;var Pn=h(e=>{let t=u(`ComboboxOption`,null,e),{classNames:n,className:r,style:i,styles:a,vars:s,onClick:c,id:l,active:d,onMouseDown:f,onMouseOver:p,disabled:m,selected:h,mod:g,..._}=t,v=xn(),y=(0,V.useId)(),b=l||y;return(0,H.jsx)(o,{...v.getStyles(`option`,{className:r,classNames:n,styles:a,style:i}),"aria-disabled":m||void 0,..._,id:b,mod:[`combobox-option`,{"combobox-active":d,"combobox-disabled":m,"combobox-selected":h},g],role:`option`,onClick:e=>{m?e.preventDefault():(v.onOptionSubmit?.(t.value,t),c?.(e))},onMouseDown:e=>{e.preventDefault(),f?.(e)},onMouseOver:e=>{v.resetSelectionOnOptionHover&&v.store.resetSelectedOption(),p?.(e)}})});Pn.classes=gn,Pn.displayName=`@mantine/core/ComboboxOption`;var Fn=h(e=>{let{classNames:t,className:n,style:r,styles:i,id:a,onMouseDown:s,labelledBy:c,...l}=u(`ComboboxOptions`,null,e),d=xn(),f=F(a);return(0,V.useEffect)(()=>{d.store.setListId(f)},[f]),(0,H.jsx)(o,{...d.getStyles(`options`,{className:n,style:r,classNames:t,styles:i}),...l,id:f,role:`listbox`,"aria-labelledby":c,onMouseDown:e=>{e.preventDefault(),s?.(e)}})});Fn.classes=gn,Fn.displayName=`@mantine/core/ComboboxOptions`;var In={withAriaAttributes:!0,withKeyboardNavigation:!0},Ln=h(e=>{let{classNames:t,styles:n,unstyled:r,vars:i,withAriaAttributes:a,onKeyDown:o,onClick:s,withKeyboardNavigation:c,size:l,ref:d,...f}=u(`ComboboxSearch`,In,e),p=xn(),m=p.getStyles(`search`),h=Dn({targetType:`input`,withAriaAttributes:a,withKeyboardNavigation:c,withExpandedAttribute:!1,onKeyDown:o,onClick:s,autoComplete:`off`});return(0,H.jsx)(k,{ref:re(d,p.store.searchRef),classNames:[{input:m.className},t],styles:[{input:m.style},n],size:l||p.size,...h,...f,__staticSelector:`Combobox`})});Ln.classes=gn,Ln.displayName=`@mantine/core/ComboboxSearch`;var Rn={refProp:`ref`,targetType:`input`,withKeyboardNavigation:!0,withAriaAttributes:!0,withExpandedAttribute:!1,autoComplete:`off`},zn=h(e=>{let{children:t,refProp:n,withKeyboardNavigation:r,withAriaAttributes:i,withExpandedAttribute:a,targetType:o,autoComplete:s,ref:c,...l}=u(`ComboboxTarget`,Rn,e),d=v(t);if(!d)throw Error(`Combobox.Target component children should be an element or a component that accepts ref. Fragments, strings, numbers and other primitive values are not supported`);let f=xn(),p=Dn({targetType:o,withAriaAttributes:i,withKeyboardNavigation:r,withExpandedAttribute:a,onKeyDown:d.props.onKeyDown,onClick:d.props.onClick,autoComplete:s}),m=(0,V.cloneElement)(d,{...p,...l});return(0,H.jsx)(Je.Target,{refProp:n,ref:re(c,f.store.targetRef),children:m})});zn.displayName=`@mantine/core/ComboboxTarget`;function Bn(e,t,n){for(let n=e-1;n>=0;--n)if(!t[n].hasAttribute(`data-combobox-disabled`))return n;if(n){for(let e=t.length-1;e>-1;--e)if(!t[e].hasAttribute(`data-combobox-disabled`))return e}return e}function Vn(e,t,n){for(let n=e+1;n{s||(c(!0),i?.(e))},[c,i,s]),_=(0,V.useCallback)((e=`unknown`)=>{s&&(c(!1),r?.(e))},[c,r,s]),v=(0,V.useCallback)((e=`unknown`)=>{s?_(e):g(e)},[_,g,s]),y=(0,V.useCallback)(()=>{let e=Jt(f.current);Kt(`#${l.current} [data-combobox-selected]`,e)?.removeAttribute(`data-combobox-selected`)},[]),b=(0,V.useCallback)(e=>{let t=Jt(f.current),n=Kt(`#${l.current}`,t),r=n?qt(`[data-combobox-option]`,n):null;if(!r)return null;let i=e>=r.length?0:e<0?r.length-1:e;return u.current=i,r?.[i]&&!r[i].hasAttribute(`data-combobox-disabled`)?(y(),r[i].setAttribute(`data-combobox-selected`,`true`),r[i].scrollIntoView({block:`nearest`,behavior:o}),r[i].id):null},[o,y]),x=(0,V.useCallback)(()=>{let e=Jt(f.current),t=Kt(`#${l.current} [data-combobox-active]`,e);if(t){let n=qt(`#${l.current} [data-combobox-option]`,e).findIndex(e=>e===t);return b(n)}return b(0)},[b]),S=(0,V.useCallback)(()=>{let e=Jt(f.current),t=qt(`#${l.current} [data-combobox-option]`,e);return b(Vn(u.current,t,a))},[b,a]),C=(0,V.useCallback)(()=>{let e=Jt(f.current),t=qt(`#${l.current} [data-combobox-option]`,e);return b(Bn(u.current,t,a))},[b,a]),w=(0,V.useCallback)(()=>{let e=Jt(f.current),t=qt(`#${l.current} [data-combobox-option]`,e);return b(Hn(t))},[b]),T=(0,V.useCallback)((e=`selected`,t)=>{if(typeof e==`number`){u.current=e;let n=Jt(f.current),r=qt(`#${l.current} [data-combobox-option]`,n);t?.scrollIntoView&&r[e]?.scrollIntoView({block:`nearest`,behavior:o});return}h.current=window.setTimeout(()=>{let n=Jt(f.current),r=qt(`#${l.current} [data-combobox-option]`,n),i=r.findIndex(t=>t.hasAttribute(`data-combobox-${e}`));u.current=i,t?.scrollIntoView&&r[i]?.scrollIntoView({block:`nearest`,behavior:o})},0)},[]),E=(0,V.useCallback)(()=>{u.current=-1,y()},[y]),D=(0,V.useCallback)(()=>{let e=Jt(f.current);(qt(`#${l.current} [data-combobox-option]`,e)?.[u.current])?.click()},[]),O=(0,V.useCallback)(e=>{l.current=e},[]),k=(0,V.useCallback)(()=>{p.current=window.setTimeout(()=>d.current?.focus(),0)},[]),A=(0,V.useCallback)(()=>{m.current=window.setTimeout(()=>f.current?.focus(),0)},[]),j=(0,V.useCallback)(()=>u.current,[]);return(0,V.useEffect)(()=>()=>{window.clearTimeout(p.current),window.clearTimeout(m.current),window.clearTimeout(h.current)},[]),{dropdownOpened:s,openDropdown:g,closeDropdown:_,toggleDropdown:v,selectedOptionIndex:u.current,getSelectedOptionIndex:j,selectOption:b,selectFirstOption:w,selectActiveOption:x,selectNextOption:S,selectPreviousOption:C,resetSelectedOption:E,updateSelectedOptionIndex:T,listId:l.current,setListId:O,clickSelectedOption:D,searchRef:d,focusSearchInput:k,targetRef:f,focusTarget:A}}var Wn={keepMounted:!0,keepMountedMode:`display-none`,withinPortal:!0,resetSelectionOnOptionHover:!1,width:`target`,transitionProps:{transition:`fade`,duration:0},size:`sm`},Gn=g((e,{size:t,dropdownPadding:n})=>({options:{"--combobox-option-fz":L(t),"--combobox-option-padding":M(t,`combobox-option-padding`)},dropdown:{"--combobox-padding":n===void 0?void 0:P(n),"--combobox-option-fz":L(t),"--combobox-option-padding":M(t,`combobox-option-padding`)}})),Kn=e=>{let t=u(`Combobox`,Wn,e),{classNames:n,styles:r,unstyled:i,children:o,store:s,vars:c,onOptionSubmit:l,onClose:d,size:f,dropdownPadding:p,resetSelectionOnOptionHover:m,__staticSelector:h,readOnly:g,attributes:_,floatingHeight:v,middlewares:y,...b}=t,x=v===`viewport`?{...y,flip:!1,size:{...typeof y?.size==`object`?y.size:{},padding:typeof y?.size==`object`&&y.size.padding!==void 0?y.size.padding:10,apply:({availableHeight:e,availableWidth:t,elements:n,...r})=>{n.floating.style.setProperty(`--combobox-floating-max-height`,`${e}px`);let i=y?.size;typeof i==`object`&&i.apply?i.apply({availableHeight:e,availableWidth:t,elements:n,...r}):i&&Object.assign(n.floating.style,{maxWidth:`${t}px`,maxHeight:`${e}px`})}}}:y,S=Un(),C=s||S,w=a({name:h||`Combobox`,classes:gn,props:t,classNames:n,styles:r,unstyled:i,attributes:_,vars:c,varsResolver:Gn}),T=()=>{d?.(),C.closeDropdown()};return(0,H.jsx)(bn,{value:{getStyles:w,store:C,onOptionSubmit:l,size:f,resetSelectionOnOptionHover:m,readOnly:g,floatingHeight:v},children:(0,H.jsx)(Je,{opened:C.dropdownOpened,...b,middlewares:x,onChange:e=>!e&&T(),withRoles:!1,unstyled:i,children:o})})};Kn.extend=e=>e,Kn.classes=gn,Kn.varsResolver=Gn,Kn.displayName=`@mantine/core/Combobox`,Kn.Target=zn,Kn.Dropdown=Cn,Kn.Options=Fn,Kn.Option=Pn,Kn.Search=Ln,Kn.Empty=En,Kn.Chevron=yn,Kn.Footer=An,Kn.Header=Mn,Kn.EventsTarget=kn,Kn.DropdownTarget=Tn,Kn.Group=jn,Kn.ClearButton=Sn,Kn.HiddenInput=Nn;function qn({children:e,role:t}){let n=(0,V.use)(D);return n?(0,H.jsx)(`div`,{role:t,"aria-labelledby":n.labelId,"aria-describedby":n.describedBy,children:e}):(0,H.jsx)(H.Fragment,{children:e})}var Jn={root:`m_5f75b09e`,body:`m_5f6e695e`,labelWrapper:`m_d3ea56bb`,label:`m_8ee546b8`,description:`m_328f68c0`,error:`m_8e8a99cc`},Yn=Jn;function Xn({__staticSelector:e,__stylesApiProps:t,className:n,classNames:r,styles:i,unstyled:s,children:c,label:l,description:u,id:d,disabled:f,error:p,size:m,labelPosition:h=`left`,bodyElement:g=`div`,labelElement:_=`label`,variant:v,style:y,vars:b,mod:x,attributes:S,...C}){let w=a({name:e,props:t,className:n,style:y,classes:Jn,classNames:r,styles:i,unstyled:s,attributes:S}),T=u?`${d}-description`:void 0,E=p&&typeof p!=`boolean`?`${d}-error`:void 0;return(0,H.jsx)(o,{...w(`root`),__vars:{"--label-fz":L(m),"--label-lh":M(m,`label-lh`)},mod:[{"label-position":h},x],variant:v,size:m,...C,children:(0,H.jsxs)(o,{component:g,htmlFor:g===`label`?d:void 0,...w(`body`),children:[c,(0,H.jsxs)(`div`,{...w(`labelWrapper`),"data-disabled":f||void 0,children:[l&&(0,H.jsx)(o,{component:_,htmlFor:_===`label`?d:void 0,...w(`label`),"data-disabled":f||void 0,children:l}),u&&(0,H.jsx)(k.Description,{id:T,size:m,__inheritStyles:!1,...w(`description`),children:u}),p&&typeof p!=`boolean`&&(0,H.jsx)(k.Error,{id:E,size:m,__inheritStyles:!1,...w(`error`),children:p})]})]})})}Xn.displayName=`@mantine/core/InlineInput`;function Zn(e){return`group`in e}function Qn({options:e,search:t,limit:n}){let r=t.trim().toLowerCase(),i=[];for(let a=0;a0)return!1;return!0}function er(e,t=new Set){if(Array.isArray(e))for(let n of e)if(Zn(n))er(n.items,t);else{if(n.value===void 0)throw Error(`[@mantine/core] Each option must have value property`);if(t.has(n.value))throw Error(`[@mantine/core] Duplicate options are not supported. Option with value "${n.value}" was provided more than once`);t.add(n.value)}}function tr(e,t){return Array.isArray(e)?e.includes(t):e===t}function nr({data:e,withCheckIcon:t,withAlignedLabels:n,value:r,checkIconPosition:i,unstyled:a,renderOption:o}){if(!Zn(e)){let s=tr(r,e.value),c=t&&(s?(0,H.jsx)(ve,{className:gn.optionsDropdownCheckIcon}):n?(0,H.jsx)(`div`,{className:gn.optionsDropdownCheckPlaceholder}):null),l=(0,H.jsxs)(H.Fragment,{children:[i===`left`&&c,(0,H.jsx)(`span`,{children:e.label}),i===`right`&&c]});return(0,H.jsx)(Kn.Option,{value:e.value,disabled:e.disabled,className:_({[gn.optionsDropdownOption]:!a}),"data-reverse":i===`right`||void 0,"data-checked":s||void 0,"aria-selected":s,active:s,children:typeof o==`function`?o({option:e,checked:s}):l})}let s=e.items.map(e=>(0,H.jsx)(nr,{data:e,value:r,unstyled:a,withCheckIcon:t,withAlignedLabels:n,checkIconPosition:i,renderOption:o},`${e.value}`));return(0,H.jsx)(Kn.Group,{label:e.group,children:s})}function rr({data:e,hidden:t,hiddenWhenEmpty:n,filter:r,search:i,limit:a,maxDropdownHeight:o,floatingHeight:s,withScrollArea:c=!0,filterOptions:l=!0,withCheckIcon:u=!1,withAlignedLabels:d=!1,value:f,checkIconPosition:p,nothingFoundMessage:m,unstyled:h,labelId:g,renderOption:_,scrollAreaProps:v,"aria-label":y}){let b=xn();er(e);let x=typeof i==`string`?(r||Qn)({options:e,search:l?i:``,limit:a??1/0}):e,S=$n(x),C=x.map((e,t)=>(0,H.jsx)(nr,{data:e,withCheckIcon:u,withAlignedLabels:d,value:f,checkIconPosition:p,unstyled:h,renderOption:_},Zn(e)?`group-${typeof e.group==`string`?e.group:t}`:`${e.value}`));return(0,H.jsx)(Kn.Dropdown,{hidden:t||n&&S,"data-composed":!0,children:(0,H.jsxs)(Kn.Options,{labelledBy:g,"aria-label":y,children:[c?(0,H.jsx)(ot.Autosize,{mah:(s??b.floatingHeight)===`viewport`?`var(--combobox-floating-options-max-height)`:o??220,type:`scroll`,scrollbarSize:`var(--combobox-padding)`,offsetScrollbars:`y`,...v,children:C}):C,S&&m&&(0,H.jsx)(Kn.Empty,{children:m})]})})}function ir(e,t,n,r){if(t===n||r===`before`&&n===t+1||r===`after`&&n===t-1)return e;let i=e.slice(),[a]=i.splice(t,1),o=t{let t=e.lastElementChild;return t?t instanceof HTMLInputElement?t:t.querySelector(`input`):null},or=(e,t)=>{if(e===t)return!0;if(e.length!==t.length)return!1;for(let n=0;n{let e=i.current;e&&(i.current=null,or(o.current,e.expectedValue)&&e.container?.querySelector(`[data-mantine-pill-index="${e.index}"]`)?.focus())});let s=(0,V.useCallback)(e=>{a.current=e},[]);return{getPillProps:e=>{if(n)return{draggable:!0,tabIndex:-1,"data-mantine-pill-index":e,"aria-keyshortcuts":`Alt+ArrowLeft Alt+ArrowRight`,onMouseDown:e=>{e.button===0&&e.stopPropagation()},onDragStart:t=>{t.stopPropagation(),t.dataTransfer.effectAllowed=`move`,t.dataTransfer.setData(`text/plain`,String(e)),r.current.draggedIndex=e;let n=t.currentTarget,i=n.getBoundingClientRect(),a=n.cloneNode(!0);a.removeAttribute(`data-dragging`),a.removeAttribute(`data-drag-over`),a.style.position=`fixed`,a.style.top=`-9999px`,a.style.left=`-9999px`,a.style.width=`${i.width}px`,a.style.height=`${i.height}px`,a.style.pointerEvents=`none`,document.body.appendChild(a),t.dataTransfer.setDragImage(a,t.clientX-i.left,t.clientY-i.top),setTimeout(()=>a.parentNode?.removeChild(a),0),requestAnimationFrame(()=>{n.setAttribute(`data-dragging`,`true`)})},onDragOver:t=>{let{draggedIndex:n}=r.current;if(n===null||n===e)return;let i=t.currentTarget,a=i.getBoundingClientRect(),o=t.clientX-a.left,s=(getComputedStyle(i).direction===`rtl`?o>a.width/2:o{let t=e.currentTarget,n=e.relatedTarget;n&&t.contains(n)||(t.removeAttribute(`data-drag-over`),r.current.currentDropTarget===t&&(r.current.currentDropTarget=null))},onDrop:n=>{n.preventDefault(),n.stopPropagation();let i=n.currentTarget,a=i.getAttribute(`data-drag-over`);i.removeAttribute(`data-drag-over`);let{draggedIndex:s}=r.current;if(s!==null&&a&&s!==e){let n=ir(o.current,s,e,a);n!==o.current&&t(n)}r.current.draggedIndex=null,r.current.currentDropTarget=null},onDragEnd:e=>{e.currentTarget.removeAttribute(`data-dragging`);let t=r.current.currentDropTarget;t&&t.removeAttribute(`data-drag-over`),r.current.draggedIndex=null,r.current.currentDropTarget=null},onKeyDown:n=>{if(n.key!==`ArrowLeft`&&n.key!==`ArrowRight`)return;let r=n.currentTarget,a=getComputedStyle(r).direction===`rtl`?n.key===`ArrowLeft`:n.key===`ArrowRight`,s=a?e+1:e-1;if(n.altKey){if(s<0||s>=o.current.length)return;n.preventDefault(),n.stopPropagation();let c=a?`after`:`before`,l=ir(o.current,e,s,c);if(l===o.current)return;i.current={container:r.parentElement,index:s,expectedValue:l},t(l);return}if(s<0)return;let c=r.parentElement;if(c){if(n.preventDefault(),n.stopPropagation(),s>=o.current.length){ar(c)?.focus();return}c.querySelector(`[data-mantine-pill-index="${s}"]`)?.focus()}}}},getListProps:()=>n?{ref:s}:{},handleInputKeyDown:e=>{if(!n||e.key!==`ArrowLeft`)return;let t=e.currentTarget;if(!(t.value.length===0||t.selectionStart===0&&t.selectionEnd===0))return;let r=a.current;if(!r)return;let i=r.querySelectorAll(`[data-mantine-pill-index]`);i.length!==0&&(e.preventDefault(),i[i.length-1].focus())}}}function cr({id:e,label:t,labelProps:n,inputWrapperOrder:r}){if(t&&(!r||r.includes(`label`)))return n?.id||`${e}-label`}function lr(e){let t=e.currentTarget;return Jt(t).activeElement!==t}var ur=(0,V.createContext)(null),dr={root:`m_7cda1cd6`,"root--default":`m_44da308b`,"root--contrast":`m_e3a01f8`,label:`m_1e0e6180`,remove:`m_ae386778`,group:`m_1dcfd90b`},fr=(0,V.createContext)(null),pr=g((e,{gap:t},{size:n})=>({group:{"--pg-gap":t===void 0?M(n,`pg-gap`):M(t)}})),mr=h(e=>{let t=u(`PillGroup`,null,e),{classNames:n,className:r,style:i,styles:s,unstyled:c,vars:l,size:d,disabled:f,attributes:p,...m}=t,h=(0,V.use)(ur)?.size||d||void 0,g=a({name:`PillGroup`,classes:dr,props:t,className:r,style:i,classNames:n,styles:s,unstyled:c,attributes:p,vars:l,varsResolver:pr,stylesCtx:{size:h},rootSelector:`group`});return(0,H.jsx)(fr,{value:{size:h,disabled:f},children:(0,H.jsx)(o,{size:h,...g(`group`),...m})})});mr.classes=dr,mr.varsResolver=pr,mr.displayName=`@mantine/core/PillGroup`;var hr={variant:`default`},gr=g((e,{radius:t},{size:n})=>({root:{"--pill-fz":M(n,`pill-fz`),"--pill-height":M(n,`pill-height`),"--pill-radius":t===void 0?void 0:ne(t)}})),_r=h(e=>{let t=u(`Pill`,hr,e),{classNames:n,className:r,style:i,styles:s,unstyled:c,vars:l,variant:d,children:f,withRemoveButton:p,onRemove:m,removeButtonProps:h,radius:g,size:_,disabled:v,mod:y,attributes:b,...x}=t,S=(0,V.use)(fr),C=(0,V.use)(ur),w=_||S?.size||void 0,T=C?.variant===`filled`?`contrast`:d||`default`,E=a({name:`Pill`,classes:dr,props:t,className:r,style:i,classNames:n,styles:s,unstyled:c,attributes:b,vars:l,varsResolver:gr,stylesCtx:{size:w}});return(0,H.jsxs)(o,{component:`span`,variant:T,size:w,...E(`root`,{variant:T}),mod:[{"with-remove":p&&!v,disabled:v||S?.disabled},y],...x,children:[(0,H.jsx)(`span`,{...E(`label`),children:f}),p&&(0,H.jsx)(ae,{variant:`transparent`,radius:g,tabIndex:-1,"aria-hidden":!0,unstyled:c,...h,...E(`remove`,{className:h?.className,style:h?.style}),onMouseDown:e=>{e.preventDefault(),e.stopPropagation(),h?.onMouseDown?.(e)},onClick:e=>{e.stopPropagation(),m?.(),h?.onClick?.(e)}})]})});_r.classes=dr,_r.varsResolver=gr,_r.displayName=`@mantine/core/Pill`,_r.Group=mr;var vr={field:`m_45c4369d`},yr={type:`visible`},br=h(e=>{let t=u(`PillsInputField`,yr,e),{classNames:n,className:r,style:i,styles:s,unstyled:c,vars:l,type:d,disabled:f,id:p,pointer:m,mod:h,attributes:g,ref:_,...v}=t,y=(0,V.use)(ur),b=(0,V.use)(D),x=a({name:`PillsInputField`,classes:vr,props:t,className:r,style:i,classNames:n,styles:s,unstyled:c,attributes:g,rootSelector:`field`}),S=f||y?.disabled;return(0,H.jsx)(o,{component:`input`,ref:re(_,y?.fieldRef),"data-type":d,disabled:S,mod:[{disabled:S,pointer:m},h],...x(`field`),...v,id:b?.inputId||p,"aria-invalid":y?.hasError,"aria-describedby":b?.describedBy,type:`text`,onMouseDown:e=>!m&&e.stopPropagation()})});br.classes=vr,br.displayName=`@mantine/core/PillsInputField`;var xr={size:`sm`},Sr=h(e=>{let{children:t,onMouseDown:n,onClick:r,size:i,disabled:a,__staticSelector:o,error:s,variant:c,...l}=u([`Input`,`InputWrapper`,`PillsInput`],xr,e),d=(0,V.useRef)(null);return(0,H.jsx)(ur,{value:{fieldRef:d,size:i,disabled:a,hasError:!!s,variant:c},children:(0,H.jsx)(N,{size:i,error:s,variant:c,component:`div`,"data-no-overflow":!0,onMouseDown:e=>{e.preventDefault(),n?.(e),d.current?.focus()},onClick:e=>{e.preventDefault(),e.currentTarget.closest(`fieldset`)?.disabled||(d.current?.focus(),r?.(e))},...l,multiline:!0,disabled:a,__staticSelector:o||`PillsInput`,withAria:!1,children:t})})});Sr.displayName=`@mantine/core/PillsInput`,Sr.classes=N.classes,Sr.Field=br;function Cr(e,t){let n=t.trim().toLowerCase();if(n===``)return;let r=Object.values(e).filter(e=>!e.disabled&&e.label.trim().toLowerCase()===n);return r.length===1?r[0]:void 0}function wr(e){return typeof e==`string`?e.trim().toLowerCase():e}function Tr({data:e,value:t}){let n=t.map(wr);return e.reduce((e,t)=>(Zn(t)?e.push({group:t.group,items:t.items.filter(e=>n.indexOf(wr(e.value))===-1)}):n.indexOf(wr(t.value))===-1&&e.push(t),e),[])}var Er={xs:41,sm:50,md:60,lg:72,xl:89},Dr={maxValues:1/0,withCheckIcon:!0,checkIconPosition:`left`,hiddenInputValuesDivider:`,`,clearSearchOnChange:!0,openOnFocus:!0,size:`sm`},Or=c(e=>{let t=u([`Input`,`InputWrapper`,`MultiSelect`],Dr,e),{classNames:n,className:r,style:i,styles:o,unstyled:s,vars:c,size:l,value:f,defaultValue:p,onChange:m,onKeyDown:h,variant:g,data:_,dropdownOpened:v,defaultDropdownOpened:y,onDropdownOpen:b,onDropdownClose:x,selectFirstOptionOnChange:S,selectFirstOptionOnDropdownOpen:C,onOptionSubmit:w,comboboxProps:T,filter:E,limit:D,withScrollArea:O,maxDropdownHeight:k,floatingHeight:j,searchValue:M,defaultSearchValue:N,onSearchChange:P,readOnly:I,disabled:L,onFocus:ee,onBlur:R,radius:te,rightSection:ne,rightSectionWidth:re,rightSectionPointerEvents:ie,rightSectionProps:z,leftSection:ae,leftSectionWidth:B,leftSectionPointerEvents:oe,leftSectionProps:se,inputContainer:ce,inputWrapperOrder:le,withAsterisk:ue,labelProps:de,descriptionProps:fe,errorProps:pe,successProps:me,wrapperProps:he,description:ge,label:_e,error:ve,success:ye,maxValues:be,searchable:xe,nothingFoundMessage:Se,withCheckIcon:Ce,withAlignedLabels:we,checkIconPosition:Te,hidePickedOptions:Ee,withErrorStyles:De,withSuccessStyles:Oe,name:ke,form:Ae,id:je,clearable:Me,clearSectionMode:Ne,clearButtonProps:Pe,hiddenInputProps:Fe,placeholder:Ie,hiddenInputValuesDivider:Le,required:Re,mod:ze,renderOption:Be,renderPill:Ve,onRemove:He,onClear:Ue,onMaxValues:We,scrollAreaProps:Ge,chevronColor:Ke,attributes:qe,clearSearchOnChange:Je,openOnFocus:Ye,loading:Xe,loadingPosition:Ze,withPillsReorder:Qe,...$e}=t,et=F(je),tt=cr({id:et,label:_e,labelProps:de,inputWrapperOrder:le}),nt=mn(_),rt=hn(nt),it=(0,V.useRef)({}),at=Un({opened:v,defaultOpened:y,onDropdownOpen:()=>{b?.(),C&&at.selectFirstOption()},onDropdownClose:()=>{x?.(),at.resetSelectedOption()}}),{styleProps:ot,rest:{type:st,autoComplete:ct,...lt}}=d($e),[ut,dt]=mt({value:f,defaultValue:p,finalValue:[],onChange:m}),{getPillProps:ft,getListProps:pt,handleInputKeyDown:ht}=sr({value:ut,onChange:dt,enabled:Qe&&!L&&!I}),[gt,_t]=mt({value:M,defaultValue:N,finalValue:``,onChange:P}),vt=e=>{_t(e),at.resetSelectedOption()},yt=a({name:`MultiSelect`,classes:{},props:t,classNames:n,styles:o,unstyled:s,attributes:qe}),{resolvedClassNames:bt,resolvedStyles:xt}=A({props:t,styles:o,classNames:n}),St=e=>{h?.(e),!e.defaultPrevented&&(e.key===` `&&!xe&&(e.preventDefault(),at.toggleDropdown()),e.key===`Backspace`&>.length===0&&ut.length>0&&(He?.(ut[ut.length-1]),dt(ut.slice(0,ut.length-1))),ht(e))},Ct=ut.map((e,t)=>{let n=rt[`${e}`]||it.current[`${e}`],r=ft(t);return Ve?(0,H.jsx)(V.Fragment,{children:Ve({option:n,value:e,onRemove:()=>{dt(ut.filter(t=>e!==t)),He?.(e)},disabled:L,reorderProps:r})},`${e}-${t}`):(0,H.jsx)(_r,{withRemoveButton:!I&&!rt[`${e}`]?.disabled,onRemove:()=>{dt(ut.filter(t=>e!==t)),He?.(e)},unstyled:s,disabled:L,...yt(`pill`),...r,children:n?.label||e},`${e}-${t}`)});(0,V.useEffect)(()=>{S&&at.selectFirstOption()},[S,gt]),(0,V.useEffect)(()=>{ut.forEach(e=>{`${e}`in rt&&(it.current[`${e}`]=rt[`${e}`])})},[rt,ut]);let wt=(0,H.jsx)(Kn.ClearButton,{...Pe,onClear:()=>{Ue?.(),dt([]),vt(``)}}),Tt=Tr({data:nt,value:ut}),Et=Me&&ut.length>0&&!L&&!I,Dt=Et?{paddingInlineEnd:Er[l]??Er.sm}:void 0;return(0,H.jsxs)(H.Fragment,{children:[(0,H.jsxs)(Kn,{store:at,classNames:bt,styles:xt,unstyled:s,size:l,readOnly:I,__staticSelector:`MultiSelect`,attributes:qe,floatingHeight:j,onOptionSubmit:e=>{w?.(e),Je&&vt(``),at.updateSelectedOptionIndex(`selected`),ut.includes(rt[`${e}`].value)?(dt(ut.filter(t=>t!==rt[`${e}`].value)),He?.(rt[`${e}`].value)):ut.lengthxe?at.openDropdown():at.toggleDropdown(),"data-expanded":at.dropdownOpened||void 0,id:et,required:Re,mod:ze,attributes:qe,children:(0,H.jsxs)(_r.Group,{attributes:qe,disabled:L,unstyled:s,...yt(`pillsList`,{style:Dt}),...pt(),children:[Ct,(0,H.jsx)(Kn.EventsTarget,{autoComplete:ct,withExpandedAttribute:!0,children:(0,H.jsx)(Sr.Field,{...lt,id:et,placeholder:Ie,type:!xe&&!Ie?`hidden`:`visible`,...yt(`inputField`),unstyled:s,onFocus:e=>{ee?.(e),Ye&&xe&&at.openDropdown()},onBlur:e=>{R?.(e),at.closeDropdown(),vt(``)},onKeyDown:St,value:gt,onChange:e=>{if(lr(e)){if(!I){let t=Cr(rt,e.currentTarget.value);t&&!ut.includes(t.value)&&ut.length{let{classNames:t,className:n,style:r,styles:i,vars:a,...s}=u(`ProgressLabel`,null,e),c=Ar();return(0,H.jsx)(o,{...c.getStyles(`label`,{className:n,style:r,classNames:t,styles:i}),...s})});Mr.classes=jr,Mr.displayName=`@mantine/core/ProgressLabel`;var Nr=g((e,{size:t,radius:n,transitionDuration:r})=>({root:{"--progress-size":M(t,`progress-size`),"--progress-radius":n===void 0?void 0:ne(n),"--progress-transition-duration":typeof r==`number`?`${r}ms`:void 0}})),Pr=h(e=>{let t=u(`ProgressRoot`,null,e),{classNames:n,className:r,style:i,styles:s,unstyled:c,vars:l,autoContrast:d,transitionDuration:f,orientation:p,attributes:m,mod:h,...g}=t,_=a({name:`Progress`,classes:jr,props:t,className:r,style:i,classNames:n,styles:s,unstyled:c,attributes:m,vars:l,varsResolver:Nr});return(0,H.jsx)(kr,{value:{getStyles:_,autoContrast:d},children:(0,H.jsx)(o,{mod:[{orientation:p},h],..._(`root`),...g})})});Pr.classes=jr,Pr.varsResolver=Nr,Pr.displayName=`@mantine/core/ProgressRoot`;var Fr={withAria:!0},Ir=h(e=>{let{classNames:t,className:n,style:r,styles:i,vars:a,value:s,withAria:c,color:d,striped:p,animated:m,mod:h,...g}=u(`ProgressSection`,Fr,e),_=Ar(),v=f(),y=c?{role:`progressbar`,"aria-valuemax":100,"aria-valuemin":0,"aria-valuenow":s,"aria-valuetext":`${s}%`}:{};return(0,H.jsx)(o,{..._.getStyles(`section`,{className:n,classNames:t,styles:i,style:r}),...g,...y,mod:[{striped:p||m,animated:m},h],__vars:{"--progress-section-size":`${s}%`,"--progress-section-color":l(d,v),"--progress-label-color":Yt(_.autoContrast,v)?xe({color:d,theme:v,autoContrast:_.autoContrast}):void 0}})});Ir.classes=jr,Ir.displayName=`@mantine/core/ProgressSection`;var Lr=h(e=>{let t=u(`Progress`,null,e),{value:n,classNames:r,styles:i,vars:a,color:o,striped:s,animated:c,"aria-label":l,...d}=t,{resolvedClassNames:f,resolvedStyles:p}=A({classNames:r,styles:i,props:t});return(0,H.jsx)(Pr,{classNames:f,styles:p,vars:a,...d,children:(0,H.jsx)(Ir,{value:n,color:o,striped:s,animated:c,"aria-label":l})})});Lr.classes=jr,Lr.displayName=`@mantine/core/Progress`,Lr.Section=Ir,Lr.Root=Pr,Lr.Label=Mr;var Rr={root:`m_cf365364`,indicator:`m_9e182ccd`,label:`m_1738fcb2`,input:`m_1714d588`,control:`m_69686b9b`,innerLabel:`m_78882f40`},zr={withItemsBorders:!0},Br=g((e,{radius:t,color:n,transitionDuration:r,size:i,transitionTimingFunction:a})=>({root:{"--sc-radius":t===void 0?void 0:ne(t),"--sc-color":n?l(n,e):void 0,"--sc-shadow":n?void 0:`var(--mantine-shadow-xs)`,"--sc-transition-duration":r===void 0?void 0:`${r}ms`,"--sc-transition-timing-function":a,"--sc-padding":M(i,`sc-padding`),"--sc-font-size":L(i)}})),Vr=c(e=>{let t=u(`SegmentedControl`,zr,e),{classNames:n,className:r,style:i,styles:s,unstyled:c,vars:l,data:d,value:p,defaultValue:m,onChange:h,size:g,name:_,disabled:v,readOnly:y,fullWidth:b,orientation:x,radius:S,color:C,transitionDuration:w,transitionTimingFunction:T,variant:E,autoContrast:D,withItemsBorders:O,mod:k,attributes:A,ref:j,...M}=t,N=a({name:`SegmentedControl`,props:t,classes:Rr,className:r,style:i,classNames:n,styles:s,unstyled:c,attributes:A,vars:l,varsResolver:Br}),P=f(),I=d.map(e=>Gt(e)?{label:`${e}`,value:e}:e),L=Wt(),[ee,R]=(0,V.useState)(0),[te,ne]=(0,V.useState)(null),[ie,z]=(0,V.useState)({}),ae=(e,t)=>{e!==null&&ie[t]!==e&&(ie[t]=e,z({...ie}))},[B,oe]=mt({value:p,defaultValue:m,finalValue:Array.isArray(d)?I.find(e=>!e.disabled)?.value??d[0]?.value??null:null,onChange:h}),se=F(_),ce=I.map(e=>`${e.value}`),le=I.map(e=>(0,V.createElement)(o,{...N(`control`),mod:{active:B===e.value,orientation:x},key:`${e.value}`},(0,V.createElement)(`input`,{...N(`input`),disabled:v||e.disabled,type:`radio`,name:se,value:`${e.value}`,id:`${se}-${e.value}`,checked:B===e.value,onChange:()=>!y&&oe(e.value),"data-focus-ring":P.focusRing,key:`${e.value}-input`}),(0,V.createElement)(o,{component:`label`,...N(`label`),mod:{active:B===e.value&&!(v||e.disabled),disabled:v||e.disabled,"read-only":y},htmlFor:`${se}-${e.value}`,ref:t=>ae(t,`${e.value}`),__vars:{"--sc-label-color":C===void 0?void 0:xe({color:C,theme:P,autoContrast:D})},key:`${e.value}-label`},(0,H.jsx)(`span`,{...N(`innerLabel`),children:e.label})))),ue=re(j,ne);return Bt(()=>{R(e=>e+1)},[d.length]),Bt(()=>{z(e=>{let t={};return ce.forEach(n=>{n in e&&(t[n]=e[n])}),Object.keys(t).length===Object.keys(e).length?e:t})},[ce]),d.length===0?null:(0,H.jsxs)(o,{...N(`root`),variant:E,size:g,ref:ue,mod:[{"full-width":b,orientation:x,initialized:L,"with-items-borders":O},k],...M,role:`radiogroup`,"data-disabled":v,children:[B!==void 0&&(0,H.jsx)(en,{target:ie[`${B}`],parent:te,component:`span`,transitionDuration:`var(--sc-transition-duration)`,...N(`indicator`)},ee),le]})});Vr.classes=Rr,Vr.varsResolver=Br,Vr.displayName=`@mantine/core/SegmentedControl`;var Hr={size:`sm`,withCheckIcon:!0,allowDeselect:!0,checkIconPosition:`left`,openOnFocus:!0},Ur=c(e=>{let t=u([`Input`,`InputWrapper`,`Select`],Hr,e),{classNames:n,styles:r,unstyled:i,vars:a,dropdownOpened:o,defaultDropdownOpened:s,onDropdownClose:c,onDropdownOpen:l,onFocus:d,onBlur:f,onClick:p,onChange:m,data:h,value:g,defaultValue:_,selectFirstOptionOnChange:v,selectFirstOptionOnDropdownOpen:y,onOptionSubmit:b,comboboxProps:x,readOnly:S,disabled:C,filter:w,limit:T,withScrollArea:E,maxDropdownHeight:D,floatingHeight:O,size:k,searchable:j,rightSection:M,checkIconPosition:P,withCheckIcon:I,withAlignedLabels:L,nothingFoundMessage:ee,name:R,form:te,searchValue:ne,defaultSearchValue:re,onSearchChange:ie,allowDeselect:z,error:ae,rightSectionPointerEvents:B,id:oe,clearable:se,clearSectionMode:ce,clearButtonProps:le,hiddenInputProps:ue,renderOption:de,onClear:fe,autoComplete:pe,scrollAreaProps:me,__defaultRightSection:he,__clearSection:ge,__clearable:_e,chevronColor:ve,autoSelectOnBlur:ye,openOnFocus:be,attributes:xe,...Se}=t,Ce=(0,V.useMemo)(()=>mn(h),[h]),we=(0,V.useRef)({}),Te=(0,V.useMemo)(()=>hn(Ce),[Ce]),Ee=F(oe),De=cr({id:Ee,label:Se.label,labelProps:Se.labelProps,inputWrapperOrder:Se.inputWrapperOrder}),[Oe,ke,Ae]=mt({value:g,defaultValue:_,finalValue:null,onChange:m}),je=Oe==null?void 0:`${Oe}`in Te?Te[`${Oe}`]:we.current[`${Oe}`],Me=Ht(je),[Ne,Pe,Fe]=mt({value:ne,defaultValue:re,finalValue:je?je.label:``,onChange:ie}),Ie=Un({opened:o,defaultOpened:s,onDropdownOpen:()=>{l?.(),y?Ie.selectFirstOption():Ie.updateSelectedOptionIndex(`active`,{scrollIntoView:!0})},onDropdownClose:()=>{c?.(),setTimeout(Ie.resetSelectedOption,0)}}),Le=e=>{Pe(e),Ie.resetSelectedOption()},{resolvedClassNames:Re,resolvedStyles:ze}=A({props:t,styles:r,classNames:n});(0,V.useEffect)(()=>{v&&Ie.selectFirstOption()},[v,Ne]),(0,V.useEffect)(()=>{g===null&&Le(``),g!=null&&je&&(Me?.value!==je.value||Me?.label!==je.label)&&Le(je.label)},[g,je]),(0,V.useEffect)(()=>{!Ae&&!Fe&&Le(Oe==null?``:`${Oe}`in Te?Te[`${Oe}`]?.label:we.current[`${Oe}`]?.label||``)},[Te,Oe]),(0,V.useEffect)(()=>{Oe&&`${Oe}`in Te&&(we.current[`${Oe}`]=Te[`${Oe}`])},[Te,Oe]);let Be=(0,H.jsx)(Kn.ClearButton,{...le,onClear:()=>{ke(null,null),Le(``),fe?.()}}),Ve=se&&Oe!=null&&!C&&!S;return(0,H.jsxs)(H.Fragment,{children:[(0,H.jsxs)(Kn,{store:Ie,__staticSelector:`Select`,classNames:Re,styles:ze,unstyled:i,readOnly:S,size:k,attributes:xe,floatingHeight:O,keepMounted:ye,onOptionSubmit:e=>{b?.(e);let t=z&&`${Te[e].value}`==`${Oe}`?null:Te[e],n=t?t.value:null;n!==Oe&&ke(n,t),!Ae&&Le(n==null?``:t?.label||``),Ie.closeDropdown()},...x,children:[(0,H.jsx)(Kn.Target,{targetType:j?`input`:`button`,autoComplete:pe,withExpandedAttribute:!0,children:(0,H.jsx)(N,{id:Ee,__defaultRightSection:(0,H.jsx)(Kn.Chevron,{size:k,error:ae,unstyled:i,color:ve}),__clearSection:Be,__clearable:Ve,__clearSectionMode:ce,rightSection:M,rightSectionPointerEvents:B||`none`,...Se,size:k,__staticSelector:`Select`,disabled:C,readOnly:S||!j,value:Ne,onChange:e=>{if(lr(e)){if(!S){let t=Cr(Te,e.currentTarget.value);t&&`${t.value}`!=`${Oe}`&&(ke(t.value,t),!Ae&&Le(t.label))}return}Le(e.currentTarget.value),Ie.openDropdown(),v&&Ie.selectFirstOption()},onFocus:e=>{be&&j&&Ie.openDropdown(),d?.(e)},onBlur:e=>{ye&&Ie.clickSelectedOption(),Ie.closeDropdown();let t=Oe!=null&&(`${Oe}`in Te?Te[`${Oe}`]:we.current[`${Oe}`]);Le(t&&t.label||``),f?.(e)},onClick:e=>{j?Ie.openDropdown():Ie.toggleDropdown(),p?.(e)},classNames:Re,styles:ze,unstyled:i,pointer:!j,error:ae,attributes:xe})}),(0,H.jsx)(rr,{data:Ce,hidden:S||C,filter:w,search:Ne,limit:T,hiddenWhenEmpty:!ee,withScrollArea:E,maxDropdownHeight:D,filterOptions:!!j&&je?.label!==Ne,value:Oe,checkIconPosition:P,withCheckIcon:I,withAlignedLabels:L,nothingFoundMessage:ee,unstyled:i,labelId:De,"aria-label":De?void 0:Se[`aria-label`],renderOption:de,scrollAreaProps:me})]}),(0,H.jsx)(Kn.HiddenInput,{value:Oe,name:R,form:te,disabled:C,...ue})]})});Ur.classes={...N.classes,...Kn.classes},Ur.displayName=`@mantine/core/Select`;function Wr(e){if(e!==void 0)return typeof e==`number`?P(e):e}function Gr({spacing:e,verticalSpacing:t,cols:n,minColWidth:r,autoRows:i,selector:a}){let o=f(),s=t===void 0?e:t,c=r!==void 0,l=E({"--sg-spacing-x":z(It(e)),"--sg-spacing-y":z(It(s)),"--sg-auto-rows":i,...c?{"--sg-min-col-width":Wr(r)}:{"--sg-cols":It(n)?.toString()}}),u=O(o.breakpoints).reduce((t,r)=>(t[r]||(t[r]={}),typeof e==`object`&&e[r]!==void 0&&(t[r][`--sg-spacing-x`]=z(e[r])),typeof s==`object`&&s[r]!==void 0&&(t[r][`--sg-spacing-y`]=z(s[r])),!c&&typeof n==`object`&&n[r]!==void 0&&(t[r][`--sg-cols`]=n[r]),t),{}),d=Ne(O(u),o.breakpoints).filter(e=>O(u[e.value]).length>0).map(e=>({query:`(min-width: ${o.breakpoints[e.value]})`,styles:u[e.value]}));return(0,H.jsx)(j,{styles:l,media:d,selector:a})}function Kr(e){return typeof e==`object`&&e?O(e):[]}function qr(e){return e.sort((e,t)=>Ie(e)-Ie(t))}function Jr({spacing:e,verticalSpacing:t,cols:n,minColWidth:r}){return qr(Array.from(new Set([...Kr(e),...Kr(t),...r===void 0?Kr(n):[]])))}function Yr({spacing:e,verticalSpacing:t,cols:n,minColWidth:r,autoRows:i,selector:a}){let o=t===void 0?e:t,s=r!==void 0,c=E({"--sg-spacing-x":z(It(e)),"--sg-spacing-y":z(It(o)),"--sg-auto-rows":i,...s?{"--sg-min-col-width":Wr(r)}:{"--sg-cols":It(n)?.toString()}}),l=Jr({spacing:e,verticalSpacing:t,cols:n,minColWidth:r}),u=l.reduce((t,r)=>(t[r]||(t[r]={}),typeof e==`object`&&e[r]!==void 0&&(t[r][`--sg-spacing-x`]=z(e[r])),typeof o==`object`&&o[r]!==void 0&&(t[r][`--sg-spacing-y`]=z(o[r])),!s&&typeof n==`object`&&n[r]!==void 0&&(t[r][`--sg-cols`]=n[r]),t),{}),d=l.map(e=>({query:`simple-grid (min-width: ${e})`,styles:u[e]}));return(0,H.jsx)(j,{styles:c,container:d,selector:a})}var Xr={container:`m_925c2d2c`,root:`m_2415a157`},Zr={cols:1,spacing:`md`,type:`media`},Qr=h(e=>{let t=u(`SimpleGrid`,Zr,e),{classNames:n,className:r,style:i,styles:c,unstyled:l,vars:d,cols:f,verticalSpacing:p,spacing:m,type:h,minColWidth:g,autoFlow:_,autoRows:v,attributes:y,...b}=t,x=a({name:`SimpleGrid`,classes:Xr,props:t,className:r,style:i,classNames:n,styles:c,unstyled:l,attributes:y,vars:d}),S=s(),C=g===void 0?void 0:_||`auto-fill`;return h===`container`?(0,H.jsxs)(H.Fragment,{children:[(0,H.jsx)(Yr,{...t,selector:`.${S}`}),(0,H.jsx)(`div`,{...x(`container`),children:(0,H.jsx)(o,{...x(`root`,{className:S}),...b,"data-auto-cols":C})})]}):(0,H.jsxs)(H.Fragment,{children:[(0,H.jsx)(Gr,{...t,selector:`.${S}`}),(0,H.jsx)(o,{...x(`root`,{className:S}),...b,"data-auto-cols":C})]})});Qr.classes=Xr,Qr.displayName=`@mantine/core/SimpleGrid`;var $r=(0,V.createContext)(null),ei={hiddenInputValuesSeparator:`,`},ti=c((e=>{let{value:t,defaultValue:n,onChange:r,size:i,wrapperProps:a,children:o,readOnly:s,name:c,hiddenInputValuesSeparator:l,hiddenInputProps:d,maxSelectedValues:f,disabled:p,...m}=u(`SwitchGroup`,ei,e),[h,g]=mt({value:t,defaultValue:n,finalValue:[],onChange:r}),_=e=>{let t=e.currentTarget.value;if(s)return;let n=h.includes(t);!n&&f&&h.length>=f||g(n?h.filter(e=>e!==t):[...h,t])},v=e=>{if(p)return!0;if(!f)return!1;let t=h.includes(e),n=h.length>=f;return!t&&n},y=h.join(l);return(0,H.jsx)($r,{value:{value:h,onChange:_,size:i,isDisabled:v},children:(0,H.jsxs)(k.Wrapper,{size:i,...a,...m,labelElement:`div`,__staticSelector:`SwitchGroup`,children:[(0,H.jsx)(qn,{role:`group`,children:o}),(0,H.jsx)(`input`,{type:`hidden`,name:c,value:y,...d})]})})}));ti.classes=k.Wrapper.classes,ti.displayName=`@mantine/core/SwitchGroup`;var ni={root:`m_5f93f3bb`,input:`m_926b4011`,track:`m_9307d992`,thumb:`m_93039a1d`,trackLabel:`m_8277e082`},ri={labelPosition:`right`,withThumbIndicator:!0},ii=g((e,{radius:t,color:n,size:r})=>({root:{"--switch-radius":t===void 0?void 0:ne(t),"--switch-height":M(r,`switch-height`),"--switch-width":M(r,`switch-width`),"--switch-thumb-size":M(r,`switch-thumb-size`),"--switch-label-font-size":M(r,`switch-label-font-size`),"--switch-track-label-padding":M(r,`switch-track-label-padding`),"--switch-color":n?l(n,e):void 0}})),ai=h(e=>{let t=u(`Switch`,ri,e),{classNames:n,className:r,style:i,styles:s,unstyled:c,vars:l,color:f,label:p,offLabel:m,onLabel:h,id:g,size:_,radius:v,wrapperProps:y,thumbIcon:b,checked:x,defaultChecked:S,onChange:C,labelPosition:w,description:T,error:E,disabled:D,variant:O,rootRef:k,mod:A,withThumbIndicator:j,attributes:M,...N}=t,P=(0,V.use)($r),I=_||P?.size,L=a({name:`Switch`,props:t,classes:ni,className:r,style:i,classNames:n,styles:s,unstyled:c,attributes:M,vars:l,varsResolver:ii}),{styleProps:ee,rest:R}=d(N),te=F(g),ne=[T?`${te}-description`:void 0,E&&typeof E!=`boolean`?`${te}-error`:void 0,R[`aria-describedby`]].filter(Boolean).join(` `)||void 0,re={checked:P?.value.includes(R.value)??x,onChange:e=>{P?.onChange(e),C?.(e)}},ie=D||P?.isDisabled?.(R.value),[z,ae]=mt({value:re.checked??x,defaultValue:S,finalValue:!1});return(0,H.jsxs)(Xn,{...L(`root`),__staticSelector:`Switch`,__stylesApiProps:t,id:te,size:I,labelPosition:w,label:p,description:T,error:E,disabled:ie,bodyElement:`label`,labelElement:`span`,classNames:n,styles:s,unstyled:c,"data-checked":re.checked,variant:O,ref:k,mod:A,attributes:M,inert:R.inert,...ee,...y,children:[(0,H.jsx)(`input`,{...R,...re,disabled:ie,checked:z,"data-checked":re.checked,onChange:e=>{re.onChange?.(e),ae(e.currentTarget.checked)},id:te,type:`checkbox`,role:`switch`,inert:R.inert,"aria-describedby":ne,...L(`input`)}),(0,H.jsxs)(o,{"aria-hidden":`true`,component:`span`,mod:{error:E,"label-position":w,"without-labels":!h&&!m},...L(`track`),children:[(0,H.jsx)(o,{component:`span`,mod:{"reduce-motion":!0,"with-thumb-indicator":j&&!b},...L(`thumb`),children:b}),(0,H.jsx)(`span`,{...L(`trackLabel`),children:z?h:m})]})]})});ai.classes={...ni,...Yn},ai.varsResolver=ii,ai.displayName=`@mantine/core/Switch`,ai.Group=ti;var oi=new Map([[`bold`,V.createElement(V.Fragment,null,V.createElement(`path`,{d:`M244,56v48a12,12,0,0,1-12,12H184a12,12,0,1,1,0-24H201.1l-19-17.38c-.13-.12-.26-.24-.38-.37A76,76,0,1,0,127,204h1a75.53,75.53,0,0,0,52.15-20.72,12,12,0,0,1,16.49,17.45A99.45,99.45,0,0,1,128,228h-1.37A100,100,0,1,1,198.51,57.06L220,76.72V56a12,12,0,0,1,24,0Z`}))],[`duotone`,V.createElement(V.Fragment,null,V.createElement(`path`,{d:`M216,128a88,88,0,1,1-88-88A88,88,0,0,1,216,128Z`,opacity:`0.2`}),V.createElement(`path`,{d:`M240,56v48a8,8,0,0,1-8,8H184a8,8,0,0,1,0-16H211.4L184.81,71.64l-.25-.24a80,80,0,1,0-1.67,114.78,8,8,0,0,1,11,11.63A95.44,95.44,0,0,1,128,224h-1.32A96,96,0,1,1,195.75,60L224,85.8V56a8,8,0,1,1,16,0Z`}))],[`fill`,V.createElement(V.Fragment,null,V.createElement(`path`,{d:`M240,56v48a8,8,0,0,1-8,8H184a8,8,0,0,1-5.66-13.66l17-17-10.55-9.65-.25-.24a80,80,0,1,0-1.67,114.78,8,8,0,1,1,11,11.63A95.44,95.44,0,0,1,128,224h-1.32A96,96,0,1,1,195.75,60l10.93,10L226.34,50.3A8,8,0,0,1,240,56Z`}))],[`light`,V.createElement(V.Fragment,null,V.createElement(`path`,{d:`M238,56v48a6,6,0,0,1-6,6H184a6,6,0,0,1,0-12h32.55l-30.38-27.8c-.06-.06-.12-.13-.19-.19a82,82,0,1,0-1.7,117.65,6,6,0,0,1,8.24,8.73A93.46,93.46,0,0,1,128,222h-1.28A94,94,0,1,1,194.37,61.4L226,90.35V56a6,6,0,1,1,12,0Z`}))],[`regular`,V.createElement(V.Fragment,null,V.createElement(`path`,{d:`M240,56v48a8,8,0,0,1-8,8H184a8,8,0,0,1,0-16H211.4L184.81,71.64l-.25-.24a80,80,0,1,0-1.67,114.78,8,8,0,0,1,11,11.63A95.44,95.44,0,0,1,128,224h-1.32A96,96,0,1,1,195.75,60L224,85.8V56a8,8,0,1,1,16,0Z`}))],[`thin`,V.createElement(V.Fragment,null,V.createElement(`path`,{d:`M236,56v48a4,4,0,0,1-4,4H184a4,4,0,0,1,0-8h37.7L187.53,68.69l-.13-.12a84,84,0,1,0-1.75,120.51,4,4,0,0,1,5.5,5.82A91.43,91.43,0,0,1,128,220h-1.26A92,92,0,1,1,193,62.84l35,32.05V56a4,4,0,1,1,8,0Z`}))]]),si=new Map([[`bold`,V.createElement(V.Fragment,null,V.createElement(`path`,{d:`M228,128a100,100,0,0,1-98.66,100H128a99.39,99.39,0,0,1-68.62-27.29,12,12,0,0,1,16.48-17.45,76,76,0,1,0-1.57-109c-.13.13-.25.25-.39.37L54.89,92H72a12,12,0,0,1,0,24H24a12,12,0,0,1-12-12V56a12,12,0,0,1,24,0V76.72L57.48,57.06A100,100,0,0,1,228,128Z`}))],[`duotone`,V.createElement(V.Fragment,null,V.createElement(`path`,{d:`M216,128a88,88,0,1,1-88-88A88,88,0,0,1,216,128Z`,opacity:`0.2`}),V.createElement(`path`,{d:`M224,128a96,96,0,0,1-94.71,96H128A95.38,95.38,0,0,1,62.1,197.8a8,8,0,0,1,11-11.63A80,80,0,1,0,71.43,71.39a3.07,3.07,0,0,1-.26.25L44.59,96H72a8,8,0,0,1,0,16H24a8,8,0,0,1-8-8V56a8,8,0,0,1,16,0V85.8L60.25,60A96,96,0,0,1,224,128Z`}))],[`fill`,V.createElement(V.Fragment,null,V.createElement(`path`,{d:`M224,128a96,96,0,0,1-94.71,96H128A95.38,95.38,0,0,1,62.1,197.8a8,8,0,0,1,11-11.63A80,80,0,1,0,71.43,71.39a3.07,3.07,0,0,1-.26.25L60.63,81.29l17,17A8,8,0,0,1,72,112H24a8,8,0,0,1-8-8V56A8,8,0,0,1,29.66,50.3L49.31,70,60.25,60A96,96,0,0,1,224,128Z`}))],[`light`,V.createElement(V.Fragment,null,V.createElement(`path`,{d:`M222,128a94,94,0,0,1-92.74,94H128a93.43,93.43,0,0,1-64.5-25.65,6,6,0,1,1,8.24-8.72A82,82,0,1,0,70,70l-.19.19L39.44,98H72a6,6,0,0,1,0,12H24a6,6,0,0,1-6-6V56a6,6,0,0,1,12,0V90.34L61.63,61.4A94,94,0,0,1,222,128Z`}))],[`regular`,V.createElement(V.Fragment,null,V.createElement(`path`,{d:`M224,128a96,96,0,0,1-94.71,96H128A95.38,95.38,0,0,1,62.1,197.8a8,8,0,0,1,11-11.63A80,80,0,1,0,71.43,71.39a3.07,3.07,0,0,1-.26.25L44.59,96H72a8,8,0,0,1,0,16H24a8,8,0,0,1-8-8V56a8,8,0,0,1,16,0V85.8L60.25,60A96,96,0,0,1,224,128Z`}))],[`thin`,V.createElement(V.Fragment,null,V.createElement(`path`,{d:`M220,128a92,92,0,0,1-90.77,92H128a91.47,91.47,0,0,1-63.13-25.1,4,4,0,1,1,5.5-5.82A84,84,0,1,0,68.6,68.57l-.13.12L34.3,100H72a4,4,0,0,1,0,8H24a4,4,0,0,1-4-4V56a4,4,0,0,1,8,0V94.89l35-32A92,92,0,0,1,220,128Z`}))]]),ci=new Map([[`bold`,V.createElement(V.Fragment,null,V.createElement(`path`,{d:`M220,48V96a12,12,0,0,1-24,0V77l-35.51,35.52a12,12,0,0,1-17-17L179,60H160a12,12,0,0,1,0-24h48A12,12,0,0,1,220,48ZM95.51,143.51,60,179V160a12,12,0,0,0-24,0v48a12,12,0,0,0,12,12H96a12,12,0,0,0,0-24H77l35.52-35.51a12,12,0,0,0-17-17ZM208,148a12,12,0,0,0-12,12v19l-35.51-35.52a12,12,0,0,0-17,17L179,196H160a12,12,0,0,0,0,24h48a12,12,0,0,0,12-12V160A12,12,0,0,0,208,148ZM77,60H96a12,12,0,0,0,0-24H48A12,12,0,0,0,36,48V96a12,12,0,0,0,24,0V77l35.51,35.52a12,12,0,0,0,17-17Z`}))],[`duotone`,V.createElement(V.Fragment,null,V.createElement(`path`,{d:`M208,48V208H48V48Z`,opacity:`0.2`}),V.createElement(`path`,{d:`M216,48V96a8,8,0,0,1-16,0V67.31l-42.34,42.35a8,8,0,0,1-11.32-11.32L188.69,56H160a8,8,0,0,1,0-16h48A8,8,0,0,1,216,48ZM98.34,146.34,56,188.69V160a8,8,0,0,0-16,0v48a8,8,0,0,0,8,8H96a8,8,0,0,0,0-16H67.31l42.35-42.34a8,8,0,0,0-11.32-11.32ZM208,152a8,8,0,0,0-8,8v28.69l-42.34-42.35a8,8,0,0,0-11.32,11.32L188.69,200H160a8,8,0,0,0,0,16h48a8,8,0,0,0,8-8V160A8,8,0,0,0,208,152ZM67.31,56H96a8,8,0,0,0,0-16H48a8,8,0,0,0-8,8V96a8,8,0,0,0,16,0V67.31l42.34,42.35a8,8,0,0,0,11.32-11.32Z`}))],[`fill`,V.createElement(V.Fragment,null,V.createElement(`path`,{d:`M109.66,146.34a8,8,0,0,1,0,11.32L83.31,184l18.35,18.34A8,8,0,0,1,96,216H48a8,8,0,0,1-8-8V160a8,8,0,0,1,13.66-5.66L72,172.69l26.34-26.35A8,8,0,0,1,109.66,146.34ZM83.31,72l18.35-18.34A8,8,0,0,0,96,40H48a8,8,0,0,0-8,8V96a8,8,0,0,0,13.66,5.66L72,83.31l26.34,26.35a8,8,0,0,0,11.32-11.32ZM208,40H160a8,8,0,0,0-5.66,13.66L172.69,72,146.34,98.34a8,8,0,0,0,11.32,11.32L184,83.31l18.34,18.35A8,8,0,0,0,216,96V48A8,8,0,0,0,208,40Zm3.06,112.61a8,8,0,0,0-8.72,1.73L184,172.69l-26.34-26.35a8,8,0,0,0-11.32,11.32L172.69,184l-18.35,18.34A8,8,0,0,0,160,216h48a8,8,0,0,0,8-8V160A8,8,0,0,0,211.06,152.61Z`}))],[`light`,V.createElement(V.Fragment,null,V.createElement(`path`,{d:`M214,48V96a6,6,0,0,1-12,0V62.48l-45.76,45.76a6,6,0,0,1-8.48-8.48L193.52,54H160a6,6,0,0,1,0-12h48A6,6,0,0,1,214,48ZM99.76,147.76,54,193.52V160a6,6,0,0,0-12,0v48a6,6,0,0,0,6,6H96a6,6,0,0,0,0-12H62.48l45.76-45.76a6,6,0,0,0-8.48-8.48ZM208,154a6,6,0,0,0-6,6v33.52l-45.76-45.76a6,6,0,0,0-8.48,8.48L193.52,202H160a6,6,0,0,0,0,12h48a6,6,0,0,0,6-6V160A6,6,0,0,0,208,154ZM62.48,54H96a6,6,0,0,0,0-12H48a6,6,0,0,0-6,6V96a6,6,0,0,0,12,0V62.48l45.76,45.76a6,6,0,0,0,8.48-8.48Z`}))],[`regular`,V.createElement(V.Fragment,null,V.createElement(`path`,{d:`M216,48V96a8,8,0,0,1-16,0V67.31l-42.34,42.35a8,8,0,0,1-11.32-11.32L188.69,56H160a8,8,0,0,1,0-16h48A8,8,0,0,1,216,48ZM98.34,146.34,56,188.69V160a8,8,0,0,0-16,0v48a8,8,0,0,0,8,8H96a8,8,0,0,0,0-16H67.31l42.35-42.34a8,8,0,0,0-11.32-11.32ZM208,152a8,8,0,0,0-8,8v28.69l-42.34-42.35a8,8,0,0,0-11.32,11.32L188.69,200H160a8,8,0,0,0,0,16h48a8,8,0,0,0,8-8V160A8,8,0,0,0,208,152ZM67.31,56H96a8,8,0,0,0,0-16H48a8,8,0,0,0-8,8V96a8,8,0,0,0,16,0V67.31l42.34,42.35a8,8,0,0,0,11.32-11.32Z`}))],[`thin`,V.createElement(V.Fragment,null,V.createElement(`path`,{d:`M212,48V96a4,4,0,0,1-8,0V57.66l-49.17,49.17a4,4,0,0,1-5.66-5.66L198.34,52H160a4,4,0,0,1,0-8h48A4,4,0,0,1,212,48ZM101.17,149.17,52,198.34V160a4,4,0,0,0-8,0v48a4,4,0,0,0,4,4H96a4,4,0,0,0,0-8H57.66l49.17-49.17a4,4,0,0,0-5.66-5.66ZM208,156a4,4,0,0,0-4,4v38.34l-49.17-49.17a4,4,0,0,0-5.66,5.66L198.34,204H160a4,4,0,0,0,0,8h48a4,4,0,0,0,4-4V160A4,4,0,0,0,208,156ZM57.66,52H96a4,4,0,0,0,0-8H48a4,4,0,0,0-4,4V96a4,4,0,0,0,8,0V57.66l49.17,49.17a4,4,0,0,0,5.66-5.66Z`}))]]),li=new Map([[`bold`,V.createElement(V.Fragment,null,V.createElement(`path`,{d:`M216.49,168.49a12,12,0,0,1-17,0L128,97,56.49,168.49a12,12,0,0,1-17-17l80-80a12,12,0,0,1,17,0l80,80A12,12,0,0,1,216.49,168.49Z`}))],[`duotone`,V.createElement(V.Fragment,null,V.createElement(`path`,{d:`M208,160H48l80-80Z`,opacity:`0.2`}),V.createElement(`path`,{d:`M213.66,154.34l-80-80a8,8,0,0,0-11.32,0l-80,80A8,8,0,0,0,48,168H208a8,8,0,0,0,5.66-13.66ZM67.31,152,128,91.31,188.69,152Z`}))],[`fill`,V.createElement(V.Fragment,null,V.createElement(`path`,{d:`M215.39,163.06A8,8,0,0,1,208,168H48a8,8,0,0,1-5.66-13.66l80-80a8,8,0,0,1,11.32,0l80,80A8,8,0,0,1,215.39,163.06Z`}))],[`light`,V.createElement(V.Fragment,null,V.createElement(`path`,{d:`M212.24,164.24a6,6,0,0,1-8.48,0L128,88.49,52.24,164.24a6,6,0,0,1-8.48-8.48l80-80a6,6,0,0,1,8.48,0l80,80A6,6,0,0,1,212.24,164.24Z`}))],[`regular`,V.createElement(V.Fragment,null,V.createElement(`path`,{d:`M213.66,165.66a8,8,0,0,1-11.32,0L128,91.31,53.66,165.66a8,8,0,0,1-11.32-11.32l80-80a8,8,0,0,1,11.32,0l80,80A8,8,0,0,1,213.66,165.66Z`}))],[`thin`,V.createElement(V.Fragment,null,V.createElement(`path`,{d:`M210.83,162.83a4,4,0,0,1-5.66,0L128,85.66,50.83,162.83a4,4,0,0,1-5.66-5.66l80-80a4,4,0,0,1,5.66,0l80,80A4,4,0,0,1,210.83,162.83Z`}))]]),ui=new Map([[`bold`,V.createElement(V.Fragment,null,V.createElement(`path`,{d:`M172,108a12,12,0,0,1-12,12H96a12,12,0,0,1,0-24h64A12,12,0,0,1,172,108Zm-12,28H96a12,12,0,0,0,0,24h64a12,12,0,0,0,0-24Zm76-8A108,108,0,0,1,78.77,224.15L46.34,235A20,20,0,0,1,21,209.66l10.81-32.43A108,108,0,1,1,236,128Zm-24,0A84,84,0,1,0,55.27,170.06a12,12,0,0,1,1,9.81l-9.93,29.79,29.79-9.93a12.1,12.1,0,0,1,3.8-.62,12,12,0,0,1,6,1.62A84,84,0,0,0,212,128Z`}))],[`duotone`,V.createElement(V.Fragment,null,V.createElement(`path`,{d:`M224,128A96,96,0,0,1,79.93,211.11h0L42.54,223.58a8,8,0,0,1-10.12-10.12l12.47-37.39h0A96,96,0,1,1,224,128Z`,opacity:`0.2`}),V.createElement(`path`,{d:`M128,24A104,104,0,0,0,36.18,176.88L24.83,210.93a16,16,0,0,0,20.24,20.24l34.05-11.35A104,104,0,1,0,128,24Zm0,192a87.87,87.87,0,0,1-44.06-11.81,8,8,0,0,0-4-1.08,7.85,7.85,0,0,0-2.53.42L40,216,52.47,178.6a8,8,0,0,0-.66-6.54A88,88,0,1,1,128,216Zm40-104a8,8,0,0,1-8,8H96a8,8,0,0,1,0-16h64A8,8,0,0,1,168,112Zm0,32a8,8,0,0,1-8,8H96a8,8,0,0,1,0-16h64A8,8,0,0,1,168,144Z`}))],[`fill`,V.createElement(V.Fragment,null,V.createElement(`path`,{d:`M128,24A104,104,0,0,0,36.18,176.88L24.83,210.93a16,16,0,0,0,20.24,20.24l34.05-11.35A104,104,0,1,0,128,24Zm32,128H96a8,8,0,0,1,0-16h64a8,8,0,0,1,0,16Zm0-32H96a8,8,0,0,1,0-16h64a8,8,0,0,1,0,16Z`}))],[`light`,V.createElement(V.Fragment,null,V.createElement(`path`,{d:`M166,112a6,6,0,0,1-6,6H96a6,6,0,0,1,0-12h64A6,6,0,0,1,166,112Zm-6,26H96a6,6,0,0,0,0,12h64a6,6,0,0,0,0-12Zm70-10A102,102,0,0,1,79.31,217.65L44.44,229.27a14,14,0,0,1-17.71-17.71l11.62-34.87A102,102,0,1,1,230,128Zm-12,0A90,90,0,1,0,50.08,173.06a6,6,0,0,1,.5,4.91L38.12,215.35a2,2,0,0,0,2.53,2.53L78,205.42a6.2,6.2,0,0,1,1.9-.31,6.09,6.09,0,0,1,3,.81A90,90,0,0,0,218,128Z`}))],[`regular`,V.createElement(V.Fragment,null,V.createElement(`path`,{d:`M168,112a8,8,0,0,1-8,8H96a8,8,0,0,1,0-16h64A8,8,0,0,1,168,112Zm-8,24H96a8,8,0,0,0,0,16h64a8,8,0,0,0,0-16Zm72-8A104,104,0,0,1,79.12,219.82L45.07,231.17a16,16,0,0,1-20.24-20.24l11.35-34.05A104,104,0,1,1,232,128Zm-16,0A88,88,0,1,0,51.81,172.06a8,8,0,0,1,.66,6.54L40,216,77.4,203.53a7.85,7.85,0,0,1,2.53-.42,8,8,0,0,1,4,1.08A88,88,0,0,0,216,128Z`}))],[`thin`,V.createElement(V.Fragment,null,V.createElement(`path`,{d:`M164,112a4,4,0,0,1-4,4H96a4,4,0,0,1,0-8h64A4,4,0,0,1,164,112Zm-4,28H96a4,4,0,0,0,0,8h64a4,4,0,0,0,0-8Zm68-12A100,100,0,0,1,79.5,215.47l-35.69,11.9a12,12,0,0,1-15.18-15.18l11.9-35.69A100,100,0,1,1,228,128Zm-8,0A92,92,0,1,0,48.35,174.07a4,4,0,0,1,.33,3.27L36.22,214.72a4,4,0,0,0,5.06,5.06l37.38-12.46a3.93,3.93,0,0,1,1.27-.21,4.05,4.05,0,0,1,2,.54A92,92,0,0,0,220,128Z`}))]]),di=new Map([[`bold`,V.createElement(V.Fragment,null,V.createElement(`path`,{d:`M128,20A108,108,0,1,0,236,128,108.12,108.12,0,0,0,128,20Zm0,192a84,84,0,1,1,84-84A84.09,84.09,0,0,1,128,212Zm68-84a12,12,0,0,1-12,12H128a12,12,0,0,1-12-12V72a12,12,0,0,1,24,0v44h44A12,12,0,0,1,196,128Z`}))],[`duotone`,V.createElement(V.Fragment,null,V.createElement(`path`,{d:`M224,128a96,96,0,1,1-96-96A96,96,0,0,1,224,128Z`,opacity:`0.2`}),V.createElement(`path`,{d:`M128,24A104,104,0,1,0,232,128,104.11,104.11,0,0,0,128,24Zm0,192a88,88,0,1,1,88-88A88.1,88.1,0,0,1,128,216Zm64-88a8,8,0,0,1-8,8H128a8,8,0,0,1-8-8V72a8,8,0,0,1,16,0v48h48A8,8,0,0,1,192,128Z`}))],[`fill`,V.createElement(V.Fragment,null,V.createElement(`path`,{d:`M128,24A104,104,0,1,0,232,128,104.11,104.11,0,0,0,128,24Zm56,112H128a8,8,0,0,1-8-8V72a8,8,0,0,1,16,0v48h48a8,8,0,0,1,0,16Z`}))],[`light`,V.createElement(V.Fragment,null,V.createElement(`path`,{d:`M128,26A102,102,0,1,0,230,128,102.12,102.12,0,0,0,128,26Zm0,192a90,90,0,1,1,90-90A90.1,90.1,0,0,1,128,218Zm62-90a6,6,0,0,1-6,6H128a6,6,0,0,1-6-6V72a6,6,0,0,1,12,0v50h50A6,6,0,0,1,190,128Z`}))],[`regular`,V.createElement(V.Fragment,null,V.createElement(`path`,{d:`M128,24A104,104,0,1,0,232,128,104.11,104.11,0,0,0,128,24Zm0,192a88,88,0,1,1,88-88A88.1,88.1,0,0,1,128,216Zm64-88a8,8,0,0,1-8,8H128a8,8,0,0,1-8-8V72a8,8,0,0,1,16,0v48h48A8,8,0,0,1,192,128Z`}))],[`thin`,V.createElement(V.Fragment,null,V.createElement(`path`,{d:`M128,28A100,100,0,1,0,228,128,100.11,100.11,0,0,0,128,28Zm0,192a92,92,0,1,1,92-92A92.1,92.1,0,0,1,128,220Zm60-92a4,4,0,0,1-4,4H128a4,4,0,0,1-4-4V72a4,4,0,0,1,8,0v52h52A4,4,0,0,1,188,128Z`}))]]),fi=new Map([[`bold`,V.createElement(V.Fragment,null,V.createElement(`path`,{d:`M140,80v41.21l34.17,20.5a12,12,0,1,1-12.34,20.58l-40-24A12,12,0,0,1,116,128V80a12,12,0,0,1,24,0ZM128,28A99.38,99.38,0,0,0,57.24,57.34c-4.69,4.74-9,9.37-13.24,14V64a12,12,0,0,0-24,0v40a12,12,0,0,0,12,12H72a12,12,0,0,0,0-24H57.77C63,86,68.37,80.22,74.26,74.26a76,76,0,1,1,1.58,109,12,12,0,0,0-16.48,17.46A100,100,0,1,0,128,28Z`}))],[`duotone`,V.createElement(V.Fragment,null,V.createElement(`path`,{d:`M216,128a88,88,0,1,1-88-88A88,88,0,0,1,216,128Z`,opacity:`0.2`}),V.createElement(`path`,{d:`M136,80v43.47l36.12,21.67a8,8,0,0,1-8.24,13.72l-40-24A8,8,0,0,1,120,128V80a8,8,0,0,1,16,0Zm-8-48A95.44,95.44,0,0,0,60.08,60.15C52.81,67.51,46.35,74.59,40,82V64a8,8,0,0,0-16,0v40a8,8,0,0,0,8,8H72a8,8,0,0,0,0-16H49c7.15-8.42,14.27-16.35,22.39-24.57a80,80,0,1,1,1.66,114.75,8,8,0,1,0-11,11.64A96,96,0,1,0,128,32Z`}))],[`fill`,V.createElement(V.Fragment,null,V.createElement(`path`,{d:`M224,128A96,96,0,0,1,62.11,197.82a8,8,0,1,1,11-11.64A80,80,0,1,0,71.43,71.43C67.9,75,64.58,78.51,61.35,82L77.66,98.34A8,8,0,0,1,72,112H32a8,8,0,0,1-8-8V64a8,8,0,0,1,13.66-5.66L50,70.7c3.22-3.49,6.54-7,10.06-10.55A96,96,0,0,1,224,128ZM128,72a8,8,0,0,0-8,8v48a8,8,0,0,0,3.88,6.86l40,24a8,8,0,1,0,8.24-13.72L136,123.47V80A8,8,0,0,0,128,72Z`}))],[`light`,V.createElement(V.Fragment,null,V.createElement(`path`,{d:`M134,80v44.6l37.09,22.25a6,6,0,0,1-6.18,10.3l-40-24A6,6,0,0,1,122,128V80a6,6,0,0,1,12,0Zm-6-46A93.4,93.4,0,0,0,61.51,61.56c-8.58,8.68-16,17-23.51,25.8V64a6,6,0,0,0-12,0v40a6,6,0,0,0,6,6H72a6,6,0,0,0,0-12H44.73C52.86,88.29,60.79,79.35,70,70a82,82,0,1,1,1.7,117.62,6,6,0,1,0-8.24,8.72A94,94,0,1,0,128,34Z`}))],[`regular`,V.createElement(V.Fragment,null,V.createElement(`path`,{d:`M136,80v43.47l36.12,21.67a8,8,0,0,1-8.24,13.72l-40-24A8,8,0,0,1,120,128V80a8,8,0,0,1,16,0Zm-8-48A95.44,95.44,0,0,0,60.08,60.15C52.81,67.51,46.35,74.59,40,82V64a8,8,0,0,0-16,0v40a8,8,0,0,0,8,8H72a8,8,0,0,0,0-16H49c7.15-8.42,14.27-16.35,22.39-24.57a80,80,0,1,1,1.66,114.75,8,8,0,1,0-11,11.64A96,96,0,1,0,128,32Z`}))],[`thin`,V.createElement(V.Fragment,null,V.createElement(`path`,{d:`M132,80v45.74l38.06,22.83a4,4,0,0,1-4.12,6.86l-40-24A4,4,0,0,1,124,128V80a4,4,0,0,1,8,0Zm-4-44A91.42,91.42,0,0,0,62.93,63C53.05,73,44.66,82.47,36,92.86V64a4,4,0,0,0-8,0v40a4,4,0,0,0,4,4H72a4,4,0,0,0,0-8H40.47C49.61,89,58.3,79,68.6,68.6a84,84,0,1,1,1.75,120.49,4,4,0,1,0-5.5,5.82A92,92,0,1,0,128,36Z`}))]]),pi=new Map([[`bold`,V.createElement(V.Fragment,null,V.createElement(`path`,{d:`M108,84a16,16,0,1,1,16,16A16,16,0,0,1,108,84Zm128,44A108,108,0,1,1,128,20,108.12,108.12,0,0,1,236,128Zm-24,0a84,84,0,1,0-84,84A84.09,84.09,0,0,0,212,128Zm-72,36.68V132a20,20,0,0,0-20-20,12,12,0,0,0-4,23.32V168a20,20,0,0,0,20,20,12,12,0,0,0,4-23.32Z`}))],[`duotone`,V.createElement(V.Fragment,null,V.createElement(`path`,{d:`M224,128a96,96,0,1,1-96-96A96,96,0,0,1,224,128Z`,opacity:`0.2`}),V.createElement(`path`,{d:`M144,176a8,8,0,0,1-8,8,16,16,0,0,1-16-16V128a8,8,0,0,1,0-16,16,16,0,0,1,16,16v40A8,8,0,0,1,144,176Zm88-48A104,104,0,1,1,128,24,104.11,104.11,0,0,1,232,128Zm-16,0a88,88,0,1,0-88,88A88.1,88.1,0,0,0,216,128ZM124,96a12,12,0,1,0-12-12A12,12,0,0,0,124,96Z`}))],[`fill`,V.createElement(V.Fragment,null,V.createElement(`path`,{d:`M128,24A104,104,0,1,0,232,128,104.11,104.11,0,0,0,128,24Zm-4,48a12,12,0,1,1-12,12A12,12,0,0,1,124,72Zm12,112a16,16,0,0,1-16-16V128a8,8,0,0,1,0-16,16,16,0,0,1,16,16v40a8,8,0,0,1,0,16Z`}))],[`light`,V.createElement(V.Fragment,null,V.createElement(`path`,{d:`M142,176a6,6,0,0,1-6,6,14,14,0,0,1-14-14V128a2,2,0,0,0-2-2,6,6,0,0,1,0-12,14,14,0,0,1,14,14v40a2,2,0,0,0,2,2A6,6,0,0,1,142,176ZM124,94a10,10,0,1,0-10-10A10,10,0,0,0,124,94Zm106,34A102,102,0,1,1,128,26,102.12,102.12,0,0,1,230,128Zm-12,0a90,90,0,1,0-90,90A90.1,90.1,0,0,0,218,128Z`}))],[`regular`,V.createElement(V.Fragment,null,V.createElement(`path`,{d:`M128,24A104,104,0,1,0,232,128,104.11,104.11,0,0,0,128,24Zm0,192a88,88,0,1,1,88-88A88.1,88.1,0,0,1,128,216Zm16-40a8,8,0,0,1-8,8,16,16,0,0,1-16-16V128a8,8,0,0,1,0-16,16,16,0,0,1,16,16v40A8,8,0,0,1,144,176ZM112,84a12,12,0,1,1,12,12A12,12,0,0,1,112,84Z`}))],[`thin`,V.createElement(V.Fragment,null,V.createElement(`path`,{d:`M140,176a4,4,0,0,1-4,4,12,12,0,0,1-12-12V128a4,4,0,0,0-4-4,4,4,0,0,1,0-8,12,12,0,0,1,12,12v40a4,4,0,0,0,4,4A4,4,0,0,1,140,176ZM124,92a8,8,0,1,0-8-8A8,8,0,0,0,124,92Zm104,36A100,100,0,1,1,128,28,100.11,100.11,0,0,1,228,128Zm-8,0a92,92,0,1,0-92,92A92.1,92.1,0,0,0,220,128Z`}))]]),mi=new Map([[`bold`,V.createElement(V.Fragment,null,V.createElement(`path`,{d:`M224,44H32A20,20,0,0,0,12,64V192a20,20,0,0,0,20,20H224a20,20,0,0,0,20-20V64A20,20,0,0,0,224,44Zm-4,144H36V68H220ZM52,128a12,12,0,0,1,12-12H192a12,12,0,0,1,0,24H64A12,12,0,0,1,52,128Zm0-36A12,12,0,0,1,64,80H192a12,12,0,0,1,0,24H64A12,12,0,0,1,52,92Zm0,72a12,12,0,0,1,12-12h8a12,12,0,0,1,0,24H64A12,12,0,0,1,52,164Zm108,0a12,12,0,0,1-12,12H108a12,12,0,0,1,0-24h40A12,12,0,0,1,160,164Zm44,0a12,12,0,0,1-12,12h-8a12,12,0,0,1,0-24h8A12,12,0,0,1,204,164Z`}))],[`duotone`,V.createElement(V.Fragment,null,V.createElement(`path`,{d:`M232,64V192a8,8,0,0,1-8,8H32a8,8,0,0,1-8-8V64a8,8,0,0,1,8-8H224A8,8,0,0,1,232,64Z`,opacity:`0.2`}),V.createElement(`path`,{d:`M224,48H32A16,16,0,0,0,16,64V192a16,16,0,0,0,16,16H224a16,16,0,0,0,16-16V64A16,16,0,0,0,224,48Zm0,144H32V64H224V192Zm-16-64a8,8,0,0,1-8,8H56a8,8,0,0,1,0-16H200A8,8,0,0,1,208,128Zm0-32a8,8,0,0,1-8,8H56a8,8,0,0,1,0-16H200A8,8,0,0,1,208,96ZM72,160a8,8,0,0,1-8,8H56a8,8,0,0,1,0-16h8A8,8,0,0,1,72,160Zm96,0a8,8,0,0,1-8,8H96a8,8,0,0,1,0-16h64A8,8,0,0,1,168,160Zm40,0a8,8,0,0,1-8,8h-8a8,8,0,0,1,0-16h8A8,8,0,0,1,208,160Z`}))],[`fill`,V.createElement(V.Fragment,null,V.createElement(`path`,{d:`M224,48H32A16,16,0,0,0,16,64V192a16,16,0,0,0,16,16H224a16,16,0,0,0,16-16V64A16,16,0,0,0,224,48ZM64,168H48a8,8,0,0,1,0-16H64a8,8,0,0,1,0,16Zm96,0H96a8,8,0,0,1,0-16h64a8,8,0,0,1,0,16Zm48,0H192a8,8,0,0,1,0-16h16a8,8,0,0,1,0,16Zm0-32H48a8,8,0,0,1,0-16H208a8,8,0,0,1,0,16Zm0-32H48a8,8,0,0,1,0-16H208a8,8,0,0,1,0,16Z`}))],[`light`,V.createElement(V.Fragment,null,V.createElement(`path`,{d:`M224,50H32A14,14,0,0,0,18,64V192a14,14,0,0,0,14,14H224a14,14,0,0,0,14-14V64A14,14,0,0,0,224,50Zm2,142a2,2,0,0,1-2,2H32a2,2,0,0,1-2-2V64a2,2,0,0,1,2-2H224a2,2,0,0,1,2,2Zm-20-64a6,6,0,0,1-6,6H56a6,6,0,0,1,0-12H200A6,6,0,0,1,206,128Zm0-32a6,6,0,0,1-6,6H56a6,6,0,0,1,0-12H200A6,6,0,0,1,206,96ZM70,160a6,6,0,0,1-6,6H56a6,6,0,0,1,0-12h8A6,6,0,0,1,70,160Zm96,0a6,6,0,0,1-6,6H96a6,6,0,0,1,0-12h64A6,6,0,0,1,166,160Zm40,0a6,6,0,0,1-6,6h-8a6,6,0,0,1,0-12h8A6,6,0,0,1,206,160Z`}))],[`regular`,V.createElement(V.Fragment,null,V.createElement(`path`,{d:`M224,48H32A16,16,0,0,0,16,64V192a16,16,0,0,0,16,16H224a16,16,0,0,0,16-16V64A16,16,0,0,0,224,48Zm0,144H32V64H224V192Zm-16-64a8,8,0,0,1-8,8H56a8,8,0,0,1,0-16H200A8,8,0,0,1,208,128Zm0-32a8,8,0,0,1-8,8H56a8,8,0,0,1,0-16H200A8,8,0,0,1,208,96ZM72,160a8,8,0,0,1-8,8H56a8,8,0,0,1,0-16h8A8,8,0,0,1,72,160Zm96,0a8,8,0,0,1-8,8H96a8,8,0,0,1,0-16h64A8,8,0,0,1,168,160Zm40,0a8,8,0,0,1-8,8h-8a8,8,0,0,1,0-16h8A8,8,0,0,1,208,160Z`}))],[`thin`,V.createElement(V.Fragment,null,V.createElement(`path`,{d:`M224,52H32A12,12,0,0,0,20,64V192a12,12,0,0,0,12,12H224a12,12,0,0,0,12-12V64A12,12,0,0,0,224,52Zm4,140a4,4,0,0,1-4,4H32a4,4,0,0,1-4-4V64a4,4,0,0,1,4-4H224a4,4,0,0,1,4,4Zm-24-64a4,4,0,0,1-4,4H56a4,4,0,0,1,0-8H200A4,4,0,0,1,204,128Zm0-32a4,4,0,0,1-4,4H56a4,4,0,0,1,0-8H200A4,4,0,0,1,204,96ZM68,160a4,4,0,0,1-4,4H56a4,4,0,0,1,0-8h8A4,4,0,0,1,68,160Zm96,0a4,4,0,0,1-4,4H96a4,4,0,0,1,0-8h64A4,4,0,0,1,164,160Zm40,0a4,4,0,0,1-4,4h-8a4,4,0,0,1,0-8h8A4,4,0,0,1,204,160Z`}))]]),hi=new Map([[`bold`,V.createElement(V.Fragment,null,V.createElement(`path`,{d:`M76,64A12,12,0,0,1,88,52H216a12,12,0,0,1,0,24H88A12,12,0,0,1,76,64Zm140,52H88a12,12,0,0,0,0,24H216a12,12,0,0,0,0-24Zm0,64H88a12,12,0,0,0,0,24H216a12,12,0,0,0,0-24ZM44,112a16,16,0,1,0,16,16A16,16,0,0,0,44,112Zm0-64A16,16,0,1,0,60,64,16,16,0,0,0,44,48Zm0,128a16,16,0,1,0,16,16A16,16,0,0,0,44,176Z`}))],[`duotone`,V.createElement(V.Fragment,null,V.createElement(`path`,{d:`M216,64V192H88V64Z`,opacity:`0.2`}),V.createElement(`path`,{d:`M80,64a8,8,0,0,1,8-8H216a8,8,0,0,1,0,16H88A8,8,0,0,1,80,64Zm136,56H88a8,8,0,1,0,0,16H216a8,8,0,0,0,0-16Zm0,64H88a8,8,0,1,0,0,16H216a8,8,0,0,0,0-16ZM44,52A12,12,0,1,0,56,64,12,12,0,0,0,44,52Zm0,64a12,12,0,1,0,12,12A12,12,0,0,0,44,116Zm0,64a12,12,0,1,0,12,12A12,12,0,0,0,44,180Z`}))],[`fill`,V.createElement(V.Fragment,null,V.createElement(`path`,{d:`M208,32H48A16,16,0,0,0,32,48V208a16,16,0,0,0,16,16H208a16,16,0,0,0,16-16V48A16,16,0,0,0,208,32ZM68,188a12,12,0,1,1,12-12A12,12,0,0,1,68,188Zm0-48a12,12,0,1,1,12-12A12,12,0,0,1,68,140Zm0-48A12,12,0,1,1,80,80,12,12,0,0,1,68,92Zm124,92H104a8,8,0,0,1,0-16h88a8,8,0,0,1,0,16Zm0-48H104a8,8,0,0,1,0-16h88a8,8,0,0,1,0,16Zm0-48H104a8,8,0,0,1,0-16h88a8,8,0,0,1,0,16Z`}))],[`light`,V.createElement(V.Fragment,null,V.createElement(`path`,{d:`M82,64a6,6,0,0,1,6-6H216a6,6,0,0,1,0,12H88A6,6,0,0,1,82,64Zm134,58H88a6,6,0,0,0,0,12H216a6,6,0,0,0,0-12Zm0,64H88a6,6,0,0,0,0,12H216a6,6,0,0,0,0-12ZM44,54A10,10,0,1,0,54,64,10,10,0,0,0,44,54Zm0,128a10,10,0,1,0,10,10A10,10,0,0,0,44,182Zm0-64a10,10,0,1,0,10,10A10,10,0,0,0,44,118Z`}))],[`regular`,V.createElement(V.Fragment,null,V.createElement(`path`,{d:`M80,64a8,8,0,0,1,8-8H216a8,8,0,0,1,0,16H88A8,8,0,0,1,80,64Zm136,56H88a8,8,0,0,0,0,16H216a8,8,0,0,0,0-16Zm0,64H88a8,8,0,0,0,0,16H216a8,8,0,0,0,0-16ZM44,52A12,12,0,1,0,56,64,12,12,0,0,0,44,52Zm0,64a12,12,0,1,0,12,12A12,12,0,0,0,44,116Zm0,64a12,12,0,1,0,12,12A12,12,0,0,0,44,180Z`}))],[`thin`,V.createElement(V.Fragment,null,V.createElement(`path`,{d:`M84,64a4,4,0,0,1,4-4H216a4,4,0,0,1,0,8H88A4,4,0,0,1,84,64Zm132,60H88a4,4,0,0,0,0,8H216a4,4,0,0,0,0-8Zm0,64H88a4,4,0,0,0,0,8H216a4,4,0,0,0,0-8ZM44,120a8,8,0,1,0,8,8A8,8,0,0,0,44,120Zm0-64a8,8,0,1,0,8,8A8,8,0,0,0,44,56Zm0,128a8,8,0,1,0,8,8A8,8,0,0,0,44,184Z`}))]]),gi=new Map([[`bold`,V.createElement(V.Fragment,null,V.createElement(`path`,{d:`M28,64A12,12,0,0,1,40,52H216a12,12,0,0,1,0,24H40A12,12,0,0,1,28,64Zm12,76h64a12,12,0,0,0,0-24H40a12,12,0,0,0,0,24Zm80,40H40a12,12,0,0,0,0,24h80a12,12,0,0,0,0-24Zm120.49,20.49a12,12,0,0,1-17,0l-18.08-18.08a44,44,0,1,1,17-17l18.08,18.07A12,12,0,0,1,240.49,200.49ZM184,164a20,20,0,1,0-20-20A20,20,0,0,0,184,164Z`}))],[`duotone`,V.createElement(V.Fragment,null,V.createElement(`path`,{d:`M216,144a32,32,0,1,1-32-32A32,32,0,0,1,216,144Z`,opacity:`0.2`}),V.createElement(`path`,{d:`M32,64a8,8,0,0,1,8-8H216a8,8,0,0,1,0,16H40A8,8,0,0,1,32,64Zm8,72h72a8,8,0,0,0,0-16H40a8,8,0,0,0,0,16Zm88,48H40a8,8,0,0,0,0,16h88a8,8,0,0,0,0-16Zm109.66,13.66a8,8,0,0,1-11.32,0L206,177.36A40,40,0,1,1,217.36,166l20.3,20.3A8,8,0,0,1,237.66,197.66ZM184,168a24,24,0,1,0-24-24A24,24,0,0,0,184,168Z`}))],[`fill`,V.createElement(V.Fragment,null,V.createElement(`path`,{d:`M32,64a8,8,0,0,1,8-8H216a8,8,0,0,1,0,16H40A8,8,0,0,1,32,64Zm8,72h72a8,8,0,0,0,0-16H40a8,8,0,0,0,0,16Zm88,48H40a8,8,0,0,0,0,16h88a8,8,0,0,0,0-16Zm109.66,2.34L217.36,166A40,40,0,1,0,206,177.36l20.3,20.3a8,8,0,0,0,11.32-11.32Z`}))],[`light`,V.createElement(V.Fragment,null,V.createElement(`path`,{d:`M34,64a6,6,0,0,1,6-6H216a6,6,0,0,1,0,12H40A6,6,0,0,1,34,64Zm6,70h72a6,6,0,0,0,0-12H40a6,6,0,0,0,0,12Zm88,52H40a6,6,0,0,0,0,12h88a6,6,0,0,0,0-12Zm108.24,10.24a6,6,0,0,1-8.48,0l-21.49-21.48a38.06,38.06,0,1,1,8.49-8.49l21.48,21.49A6,6,0,0,1,236.24,196.24ZM184,170a26,26,0,1,0-26-26A26,26,0,0,0,184,170Z`}))],[`regular`,V.createElement(V.Fragment,null,V.createElement(`path`,{d:`M32,64a8,8,0,0,1,8-8H216a8,8,0,0,1,0,16H40A8,8,0,0,1,32,64Zm8,72h72a8,8,0,0,0,0-16H40a8,8,0,0,0,0,16Zm88,48H40a8,8,0,0,0,0,16h88a8,8,0,0,0,0-16Zm109.66,13.66a8,8,0,0,1-11.32,0L206,177.36A40,40,0,1,1,217.36,166l20.3,20.3A8,8,0,0,1,237.66,197.66ZM184,168a24,24,0,1,0-24-24A24,24,0,0,0,184,168Z`}))],[`thin`,V.createElement(V.Fragment,null,V.createElement(`path`,{d:`M36,64a4,4,0,0,1,4-4H216a4,4,0,0,1,0,8H40A4,4,0,0,1,36,64Zm4,68h72a4,4,0,0,0,0-8H40a4,4,0,0,0,0,8Zm88,56H40a4,4,0,0,0,0,8h88a4,4,0,0,0,0-8Zm106.83,6.83a4,4,0,0,1-5.66,0l-22.72-22.72a36.06,36.06,0,1,1,5.66-5.66l22.72,22.72A4,4,0,0,1,234.83,194.83ZM184,172a28,28,0,1,0-28-28A28,28,0,0,0,184,172Z`}))]]),_i=new Map([[`bold`,V.createElement(V.Fragment,null,V.createElement(`path`,{d:`M156,112a12,12,0,0,1-12,12H80a12,12,0,0,1,0-24h64A12,12,0,0,1,156,112Zm76.49,120.49a12,12,0,0,1-17,0L168,185a92.12,92.12,0,1,1,17-17l47.54,47.53A12,12,0,0,1,232.49,232.49ZM112,180a68,68,0,1,0-68-68A68.08,68.08,0,0,0,112,180Z`}))],[`duotone`,V.createElement(V.Fragment,null,V.createElement(`path`,{d:`M192,112a80,80,0,1,1-80-80A80,80,0,0,1,192,112Z`,opacity:`0.2`}),V.createElement(`path`,{d:`M229.66,218.34,179.6,168.28a88.21,88.21,0,1,0-11.32,11.31l50.06,50.07a8,8,0,0,0,11.32-11.32ZM40,112a72,72,0,1,1,72,72A72.08,72.08,0,0,1,40,112Zm112,0a8,8,0,0,1-8,8H80a8,8,0,0,1,0-16h64A8,8,0,0,1,152,112Z`}))],[`fill`,V.createElement(V.Fragment,null,V.createElement(`path`,{d:`M229.66,218.34,179.6,168.28a88.21,88.21,0,1,0-11.32,11.31l50.06,50.07a8,8,0,0,0,11.32-11.32ZM144,120H80a8,8,0,0,1,0-16h64a8,8,0,0,1,0,16Z`}))],[`light`,V.createElement(V.Fragment,null,V.createElement(`path`,{d:`M150,112a6,6,0,0,1-6,6H80a6,6,0,0,1,0-12h64A6,6,0,0,1,150,112Zm78.24,116.24a6,6,0,0,1-8.48,0l-51.38-51.38a86.15,86.15,0,1,1,8.48-8.48l51.38,51.38A6,6,0,0,1,228.24,228.24ZM112,186a74,74,0,1,0-74-74A74.09,74.09,0,0,0,112,186Z`}))],[`regular`,V.createElement(V.Fragment,null,V.createElement(`path`,{d:`M152,112a8,8,0,0,1-8,8H80a8,8,0,0,1,0-16h64A8,8,0,0,1,152,112Zm77.66,117.66a8,8,0,0,1-11.32,0l-50.06-50.07a88.11,88.11,0,1,1,11.31-11.31l50.07,50.06A8,8,0,0,1,229.66,229.66ZM112,184a72,72,0,1,0-72-72A72.08,72.08,0,0,0,112,184Z`}))],[`thin`,V.createElement(V.Fragment,null,V.createElement(`path`,{d:`M148,112a4,4,0,0,1-4,4H80a4,4,0,0,1,0-8h64A4,4,0,0,1,148,112Zm78.83,114.83a4,4,0,0,1-5.66,0l-52.7-52.7a84.1,84.1,0,1,1,5.66-5.66l52.7,52.7A4,4,0,0,1,226.83,226.83ZM112,188a76,76,0,1,0-76-76A76.08,76.08,0,0,0,112,188Z`}))]]),vi=new Map([[`bold`,V.createElement(V.Fragment,null,V.createElement(`path`,{d:`M230.47,67.5a12,12,0,0,0-19.26-4.32L172.43,99l-12.68-2.72L157,83.57l35.79-38.78a12,12,0,0,0-4.32-19.26A76.07,76.07,0,0,0,88.41,121.64L30.92,174.18a4.68,4.68,0,0,0-.39.38,36,36,0,0,0,50.91,50.91l.38-.39,52.54-57.49A76.05,76.05,0,0,0,230.47,67.5ZM160,148a51.5,51.5,0,0,1-23.35-5.52,12,12,0,0,0-14.26,2.62L64.31,208.66a12,12,0,0,1-17-17l63.55-58.07a12,12,0,0,0,2.62-14.26A51.5,51.5,0,0,1,108,96a52.06,52.06,0,0,1,52-52h.89L135.17,71.87a12,12,0,0,0-2.91,10.65l5.66,26.35a12,12,0,0,0,9.21,9.21l26.35,5.66a12,12,0,0,0,10.65-2.91L212,95.12c0,.3,0,.59,0,.89A52.06,52.06,0,0,1,160,148Z`}))],[`duotone`,V.createElement(V.Fragment,null,V.createElement(`path`,{d:`M224,96a64,64,0,0,1-94.94,56L73,217A24,24,0,0,1,39,183L104,126.94a64,64,0,0,1,80-90.29L144,80l5.66,26.34L176,112l43.35-40A63.8,63.8,0,0,1,224,96Z`,opacity:`0.2`}),V.createElement(`path`,{d:`M226.76,69a8,8,0,0,0-12.84-2.88l-40.3,37.19-17.23-3.7-3.7-17.23,37.19-40.3A8,8,0,0,0,187,29.24,72,72,0,0,0,88,96,72.34,72.34,0,0,0,94,124.94L33.79,177c-.15.12-.29.26-.43.39a32,32,0,0,0,45.26,45.26c.13-.13.27-.28.39-.42L131.06,162A72,72,0,0,0,232,96,71.56,71.56,0,0,0,226.76,69ZM160,152a56.14,56.14,0,0,1-27.07-7,8,8,0,0,0-9.92,1.77L67.11,211.51a16,16,0,0,1-22.62-22.62L109.18,133a8,8,0,0,0,1.77-9.93,56,56,0,0,1,58.36-82.31l-31.2,33.81a8,8,0,0,0-1.94,7.1L141.83,108a8,8,0,0,0,6.14,6.14l26.35,5.66a8,8,0,0,0,7.1-1.94l33.81-31.2A56.06,56.06,0,0,1,160,152Z`}))],[`fill`,V.createElement(V.Fragment,null,V.createElement(`path`,{d:`M232,96a72,72,0,0,1-100.94,66L79,222.22c-.12.14-.26.29-.39.42a32,32,0,0,1-45.26-45.26c.14-.13.28-.27.43-.39L94,124.94a72.07,72.07,0,0,1,83.54-98.78,8,8,0,0,1,3.93,13.19L144,80l5.66,26.35L176,112l40.65-37.52a8,8,0,0,1,13.19,3.93A72.6,72.6,0,0,1,232,96Z`}))],[`light`,V.createElement(V.Fragment,null,V.createElement(`path`,{d:`M224.91,69.75a6,6,0,0,0-9.63-2.16l-41.07,37.9L154.7,101.3l-4.19-19.51,37.9-41.07a6,6,0,0,0-2.16-9.63,70,70,0,0,0-89.77,94.39l-61.39,53c-.11.09-.21.19-.32.3A30,30,0,0,0,77.2,221.23c.11-.11.21-.21.3-.32l53-61.39a70,70,0,0,0,94.39-89.77ZM160,154a58,58,0,0,1-28-7.22,6,6,0,0,0-7.45,1.33L68.57,212.88a18,18,0,0,1-25.45-25.45l64.76-55.94A6,6,0,0,0,109.2,124a58,58,0,0,1,64-84.53L139.58,75.93a6,6,0,0,0-1.45,5.33l5.65,26.35a6,6,0,0,0,4.61,4.61l26.35,5.65a6,6,0,0,0,5.33-1.45L216.49,82.8A58.06,58.06,0,0,1,160,154Z`}))],[`regular`,V.createElement(V.Fragment,null,V.createElement(`path`,{d:`M226.76,69a8,8,0,0,0-12.84-2.88l-40.3,37.19-17.23-3.7-3.7-17.23,37.19-40.3A8,8,0,0,0,187,29.24,72,72,0,0,0,88,96,72.34,72.34,0,0,0,94,124.94L33.79,177c-.15.12-.29.26-.43.39a32,32,0,0,0,45.26,45.26c.13-.13.27-.28.39-.42L131.06,162A72,72,0,0,0,232,96,71.56,71.56,0,0,0,226.76,69ZM160,152a56.14,56.14,0,0,1-27.07-7,8,8,0,0,0-9.92,1.77L67.11,211.51a16,16,0,0,1-22.62-22.62L109.18,133a8,8,0,0,0,1.77-9.93,56,56,0,0,1,58.36-82.31l-31.2,33.81a8,8,0,0,0-1.94,7.1L141.83,108a8,8,0,0,0,6.14,6.14l26.35,5.66a8,8,0,0,0,7.1-1.94l33.81-31.2A56.06,56.06,0,0,1,160,152Z`}))],[`thin`,V.createElement(V.Fragment,null,V.createElement(`path`,{d:`M223.05,70.5a4,4,0,0,0-6.42-1.44l-41.82,38.6L153,103l-4.68-21.79,38.6-41.82a4,4,0,0,0-1.44-6.43A68,68,0,0,0,98.94,126L36.4,180l-.21.2a28,28,0,0,0,39.6,39.6l.2-.21,54-62.54A68,68,0,0,0,228,96,67.51,67.51,0,0,0,223.05,70.5ZM160,156a60,60,0,0,1-29-7.47,4,4,0,0,0-5,.89L70,214.25A20,20,0,0,1,41.75,186l64.82-56a4,4,0,0,0,.89-5,60,60,0,0,1,69.46-86.59L141.05,77.29a4,4,0,0,0-1,3.55l5.66,26.35a4,4,0,0,0,3.07,3.07l26.35,5.66a4,4,0,0,0,3.55-1l38.87-35.87A60.05,60.05,0,0,1,160,156Z`}))]]),yi=V.forwardRef((e,t)=>V.createElement(x,{ref:t,...e,weights:oi}));yi.displayName=`ArrowClockwiseIcon`;var bi=yi,xi=V.forwardRef((e,t)=>V.createElement(x,{ref:t,...e,weights:si}));xi.displayName=`ArrowCounterClockwiseIcon`;var Si=xi,Ci=V.forwardRef((e,t)=>V.createElement(x,{ref:t,...e,weights:ci}));Ci.displayName=`ArrowsOutIcon`;var wi=Ci,Ti=V.forwardRef((e,t)=>V.createElement(x,{ref:t,...e,weights:li}));Ti.displayName=`CaretUpIcon`;var Ei=Ti,Di=V.forwardRef((e,t)=>V.createElement(x,{ref:t,...e,weights:ui}));Di.displayName=`ChatCircleTextIcon`;var Oi=Di,ki=V.forwardRef((e,t)=>V.createElement(x,{ref:t,...e,weights:di}));ki.displayName=`ClockIcon`;var Ai=ki,ji=V.forwardRef((e,t)=>V.createElement(x,{ref:t,...e,weights:fi}));ji.displayName=`ClockCounterClockwiseIcon`;var Mi=ji,Ni=V.forwardRef((e,t)=>V.createElement(x,{ref:t,...e,weights:pi}));Ni.displayName=`InfoIcon`;var Pi=Ni,Fi=V.forwardRef((e,t)=>V.createElement(x,{ref:t,...e,weights:mi}));Fi.displayName=`KeyboardIcon`;var Ii=Fi,Li=V.forwardRef((e,t)=>V.createElement(x,{ref:t,...e,weights:hi}));Li.displayName=`ListBulletsIcon`;var Ri=Li,zi=V.forwardRef((e,t)=>V.createElement(x,{ref:t,...e,weights:gi}));zi.displayName=`ListMagnifyingGlassIcon`;var Bi=zi,Vi=V.forwardRef((e,t)=>V.createElement(x,{ref:t,...e,weights:_i}));Vi.displayName=`MagnifyingGlassMinusIcon`;var Hi=Vi,Ui=V.forwardRef((e,t)=>V.createElement(x,{ref:t,...e,weights:vi}));Ui.displayName=`WrenchIcon`;var Wi=Ui,Gi=i(b(),1),Ki=`$__all`;function qi(e){let{margin:t,containerPadding:n,containerWidth:r,cols:i}=e;return(r-t[0]*(i-1)-n[0]*2)/i}function Ji(e,t,n){return Number.isFinite(e)?Math.round(t*e+Math.max(0,e-1)*n):e}function Yi(e,t,n,r,i,a,o){let{margin:s,containerPadding:c,rowHeight:l}=e,u=qi(e),d,f,p,m;if(o?(d=Math.round(o.width),f=Math.round(o.height)):(d=Ji(r,u,s[0]),f=Ji(i,l,s[1])),a?(p=Math.round(a.top),m=Math.round(a.left)):o?(p=Math.round(o.top),m=Math.round(o.left)):(p=Math.round((l+s[1])*n+c[1]),m=Math.round((u+s[0])*t+c[0])),!a&&!o){if(Number.isFinite(r)){let e=Math.round((u+s[0])*(t+r)+c[0])-m-d;e!==s[0]&&(d+=e-s[0])}if(Number.isFinite(i)){let e=Math.round((l+s[1])*(n+i)+c[1])-p-f;e!==s[1]&&(f+=e-s[1])}}return{top:p,left:m,width:d,height:f}}function Xi(e,t,n,r,i){let{margin:a,containerPadding:o,cols:s,rowHeight:c,maxRows:l}=e,u=qi(e),d=Math.round((n-o[0])/(u+a[0])),f=Math.round((t-o[1])/(c+a[1]));return d=$i(d,0,s-r),f=$i(f,0,l-i),{x:d,y:f}}function Zi(e,t,n){let{margin:r,containerPadding:i,rowHeight:a}=e,o=qi(e);return{x:Math.round((n-i[0])/(o+r[0])),y:Math.round((t-i[1])/(a+r[1]))}}function Qi(e,t,n){let{margin:r,rowHeight:i}=e,a=qi(e);return{w:Math.max(1,Math.round((t+r[0])/(a+r[0]))),h:Math.max(1,Math.round((n+r[1])/(i+r[1])))}}function $i(e,t,n){return Math.max(Math.min(e,n),t)}function ea(e,t){return!(e.i===t.i||e.x+e.w<=t.x||e.x>=t.x+t.w||e.y+e.h<=t.y||e.y>=t.y+t.h)}function ta(e,t){for(let n=0;nea(e,t))}function ra(e,t){return t===`horizontal`?aa(e):t===`vertical`||t===`wrap`?ia(e):[...e]}function ia(e){return[...e].sort((e,t)=>e.y===t.y?e.x-t.x:e.y-t.y)}function aa(e){return[...e].sort((e,t)=>e.x===t.x?e.y-t.y:e.x-t.x)}function oa(e){let t=0;for(let n=0;nt&&(t=e)}}return t}function sa(e,t){for(let n=0;ne.static===!0)}function la(e){return{i:e.i,x:e.x,y:e.y,w:e.w,h:e.h,minW:e.minW,maxW:e.maxW,minH:e.minH,maxH:e.maxH,moved:!!e.moved,static:!!e.static,isDraggable:e.isDraggable,isResizable:e.isResizable,resizeHandles:e.resizeHandles,constraints:e.constraints,isBounded:e.isBounded}}function ua(e){let t=Array(e.length);for(let n=0;nt.cols&&(i.x=t.cols-i.w),i.x<0&&(i.x=0,i.w=t.cols),i.y===1/0&&(i.y=oa(n)),!i.static)n.push(i);else for(;ta(n,i);)i.y++}}return e}function ma(e,t,n,r,i,a,o,s,c){if(t.static&&t.isDraggable!==!0||t.y===r&&t.x===n)return[...e];let l=t.x,u=t.y;typeof n==`number`&&(t.x=n),typeof r==`number`&&(t.y=r),t.moved=!0;let d=ra(e,o);(o===`vertical`&&typeof r==`number`?u>=r:o===`horizontal`&&typeof n==`number`&&l>=n)&&(d=d.reverse());let f=na(d,t),p=f.length>0;if(p&&c)return ua(e);if(p&&a)return t.x=l,t.y=u,t.moved=!1,e;let m=[...e];for(let e=0;et.y,d=l!==void 0&&t.x+t.w>l.x;if(!l)return ma(e,n,o?a.x:void 0,s?a.y:void 0,r,c,i);if(u&&s)return ma(e,n,void 0,n.y+1,r,c,i);if(u&&i===null){let r=n.y;return t.y=r,n.y=r+t.h,[...e]}if(d&&o)return ma(e,t,n.x,void 0,r,c,i)}let l=o?n.x+1:void 0,u=s?n.y+1:void 0;return l===void 0&&u===void 0?[...e]:ma(e,n,l,u,r,c,i)}function ga(e,t,n){return Math.max(t,Math.min(n,e))}var _a=[{name:`gridBounds`,constrainPosition(e,t,n,{cols:r,maxRows:i}){return{x:ga(t,0,Math.max(0,r-e.w)),y:ga(n,0,Math.max(0,i-e.h))}},constrainSize(e,t,n,r,{cols:i,maxRows:a}){let o=r===`w`||r===`nw`||r===`sw`?e.x+e.w:i-e.x,s=r===`n`||r===`nw`||r===`ne`?e.y+e.h:a-e.y;return{w:ga(t,1,Math.max(1,o)),h:ga(n,1,Math.max(1,s))}}},{name:`minMaxSize`,constrainSize(e,t,n){return{w:ga(t,e.minW??1,e.maxW??1/0),h:ga(n,e.minH??1,e.maxH??1/0)}}}];function va(e,t,n,r,i){let a={x:n,y:r};for(let n of e)n.constrainPosition&&(a=n.constrainPosition(t,a.x,a.y,i));if(t.constraints)for(let e of t.constraints)e.constrainPosition&&(a=e.constrainPosition(t,a.x,a.y,i));return a}function ya(e,t,n,r,i,a){let o={w:n,h:r};for(let n of e)n.constrainSize&&(o=n.constrainSize(t,o.w,o.h,i,a));if(t.constraints)for(let e of t.constraints)e.constrainSize&&(o=e.constrainSize(t,o.w,o.h,i,a));return o}function ba({top:e,left:t,width:n,height:r}){let i=`translate(${t}px,${e}px)`;return{transform:i,WebkitTransform:i,MozTransform:i,msTransform:i,OTransform:i,width:`${n}px`,height:`${r}px`,position:`absolute`}}function xa({top:e,left:t,width:n,height:r}){return{top:`${e}px`,left:`${t}px`,width:`${n}px`,height:`${r}px`,position:`absolute`}}function Sa(e){return e*100+`%`}function Ca(e,t,n,r){return e+n>r?t:n}function wa(e,t,n){return e<0?t:n}function Ta(e){return Math.max(0,e)}function Ea(e){return Math.max(0,e)}var Da=(e,t,n)=>{let{left:r,height:i,width:a}=t,o=e.top-(i-e.height);return{left:r,width:a,height:wa(o,e.height,i),top:Ea(o)}},Oa=(e,t,n)=>{let{top:r,left:i,height:a,width:o}=t;return{top:r,height:a,width:Ca(e.left,e.width,o,n),left:Ta(i)}},ka=(e,t,n)=>{let{top:r,height:i,width:a}=t,o=e.left+e.width-a;return o<0?{height:i,width:e.left+e.width,top:Ea(r),left:0}:{height:i,width:a,top:Ea(r),left:o}},Aa=(e,t,n)=>{let{top:r,left:i,height:a,width:o}=t;return{width:o,left:i,height:wa(r,e.height,a),top:Ea(r)}},ja={n:Da,ne:(e,t,n)=>Da(e,Oa(e,t,n)),e:Oa,se:(e,t,n)=>Aa(e,Oa(e,t,n)),s:Aa,sw:(e,t,n)=>Aa(e,ka(e,t)),w:ka,nw:(e,t,n)=>Da(e,ka(e,t))};function Ma(e,t,n,r){let i=ja[e];return i?i(t,{...t,...n},r):n}var Na={type:`transform`,scale:1,calcStyle(e){return ba(e)}},Pa={cols:12,rowHeight:150,margin:[10,10],containerPadding:null,maxRows:1/0},Fa={enabled:!0,bounded:!1,threshold:3},Ia={enabled:!0,handles:[`se`]},La={enabled:!1,defaultItem:{w:1,h:1},touchEnabled:!0,touchDragSource:`[data-rgl-draggable]`};function Ra(e,t,n,r,i){let a=r===`x`?`w`:`h`;t[r]+=1;let o=e.findIndex(e=>e.i===t.i),s=i??ca(e).length>0;for(let i=o+1;it.y+t.h)break;ea(t,o)&&Ra(e,o,n+t[a],r,s)}}t[r]=n}function za(e,t,n,r){for(t.x=Math.max(t.x,0),t.y=Math.max(t.y,0),t.y=Math.min(r,t.y);t.y>0&&!ta(e,t);)t.y--;let i;for(;(i=ta(e,t))!==void 0;)Ra(n,t,i.y+i.h,`y`);return t.y=Math.max(t.y,0),t}function Ba(e,t,n,r){for(t.x=Math.max(t.x,0),t.y=Math.max(t.y,0);t.x>0&&!ta(e,t);)t.x--;let i;for(;(i=ta(e,t))!==void 0;)if(Ra(r,t,i.x+i.w,`x`),t.x+t.w>n)for(t.x=n-t.w,t.y++;t.x>0&&!ta(e,t);)t.x--;return t.x=Math.max(t.x,0),t}var Va={type:`vertical`,allowOverlap:!1,compact(e,t){let n=ca(e),r=oa(n),i=ia(e),a=Array(e.length);for(let t=0;te[t]-e[n])}function Ya(e,t){let n=Ja(e),r=n[0];if(r===void 0)throw Error(`No breakpoints defined`);for(let i=1;ie[a]&&(r=a)}return r}function Xa(e,t){let n=t[e];if(n===void 0)throw Error(`ResponsiveReactGridLayout: \`cols\` entry for breakpoint ${String(e)} is missing!`);return n}function Za(e,t,n,r,i,a){let o=e[n];if(o)return ua(o);let s=e[r],c=Ja(t),l=c.slice(c.indexOf(n));for(let t=0;t{(function(n,r){typeof e==`object`&&t!==void 0?r(e):typeof define==`function`&&define.amd?define([`exports`],r):(n=typeof globalThis<`u`?globalThis:n||self,r(n[`fast-equals`]={}))})(e,(function(e){function t(e){return function(t,n,r,i,a,o,s){return e(t,n,s)}}function n(e){return function(t,n,r,i){if(!t||!n||typeof t!=`object`||typeof n!=`object`)return e(t,n,r,i);var a=i.get(t),o=i.get(n);if(a&&o)return a===n&&o===t;i.set(t,n),i.set(n,t);var s=e(t,n,r,i);return i.delete(t),i.delete(n),s}}function r(e,t){var n={};for(var r in e)n[r]=e[r];for(var r in t)n[r]=t[r];return n}function i(e){return e.constructor===Object||e.constructor==null}function a(e){return typeof e.then==`function`}function o(e,t){return e===t||e!==e&&t!==t}var s=Object.prototype.toString;function c(e){var t=e.areArraysEqual,n=e.areDatesEqual,r=e.areMapsEqual,c=e.areObjectsEqual,l=e.areRegExpsEqual,u=e.areSetsEqual,d=e.createIsNestedEqual,f=d(p);function p(e,d,p){if(e===d)return!0;if(!e||!d||typeof e!=`object`||typeof d!=`object`)return e!==e&&d!==d;if(i(e)&&i(d))return c(e,d,f,p);var m=Array.isArray(e),h=Array.isArray(d);if(m||h)return m===h&&t(e,d,f,p);var g=s.call(e);return g===s.call(d)?g===`[object Date]`?n(e,d,f,p):g===`[object RegExp]`?l(e,d,f,p):g===`[object Map]`?r(e,d,f,p):g===`[object Set]`?u(e,d,f,p):g===`[object Object]`||g===`[object Arguments]`?a(e)||a(d)?!1:c(e,d,f,p):g===`[object Boolean]`||g===`[object Number]`||g===`[object String]`?o(e.valueOf(),d.valueOf()):!1:!1}return p}function l(e,t,n,r){var i=e.length;if(t.length!==i)return!1;for(;i-->0;)if(!n(e[i],t[i],i,i,e,t,r))return!1;return!0}var u=n(l);function d(e,t){return o(e.valueOf(),t.valueOf())}function f(e,t,n,r){var i=e.size===t.size;if(!i)return!1;if(!e.size)return!0;var a={},o=0;return e.forEach(function(s,c){if(i){var l=!1,u=0;t.forEach(function(i,d){!l&&!a[u]&&(l=n(c,d,o,u,e,t,r)&&n(s,i,c,d,e,t,r))&&(a[u]=!0),u++}),o++,i=l}}),i}var p=n(f),m=`_owner`,h=Object.prototype.hasOwnProperty;function g(e,t,n,r){var i=Object.keys(e),a=i.length;if(Object.keys(t).length!==a)return!1;for(var o;a-->0;){if(o=i[a],o===m){var s=!!e.$$typeof,c=!!t.$$typeof;if((s||c)&&s!==c)return!1}if(!h.call(t,o)||!n(e[o],t[o],o,o,e,t,r))return!1}return!0}var _=n(g);function v(e,t){return e.source===t.source&&e.flags===t.flags}function y(e,t,n,r){var i=e.size===t.size;if(!i)return!1;if(!e.size)return!0;var a={};return e.forEach(function(o,s){if(i){var c=!1,l=0;t.forEach(function(i,u){!c&&!a[l]&&(c=n(o,i,s,u,e,t,r))&&(a[l]=!0),l++}),i=c}}),i}var b=n(y),x=Object.freeze({areArraysEqual:l,areDatesEqual:d,areMapsEqual:f,areObjectsEqual:g,areRegExpsEqual:v,areSetsEqual:y,createIsNestedEqual:t}),S=Object.freeze({areArraysEqual:u,areDatesEqual:d,areMapsEqual:p,areObjectsEqual:_,areRegExpsEqual:v,areSetsEqual:b,createIsNestedEqual:t}),C=c(x);function w(e,t){return C(e,t,void 0)}var T=c(r(x,{createIsNestedEqual:function(){return o}}));function E(e,t){return T(e,t,void 0)}var D=c(S);function O(e,t){return D(e,t,new WeakMap)}var k=c(r(S,{createIsNestedEqual:function(){return o}}));function A(e,t){return k(e,t,new WeakMap)}function j(e){return c(r(x,e(x)))}function M(e){var t=c(r(S,e(S)));return(function(e,n,r){return r===void 0&&(r=new WeakMap),t(e,n,r)})}e.circularDeepEqual=O,e.circularShallowEqual=A,e.createCustomCircularEqual=M,e.createCustomEqual=j,e.deepEqual=w,e.sameValueZeroEqual=o,e.shallowEqual=E,Object.defineProperty(e,"__esModule",{value:!0})}))})),eo=e(((e,t)=>{t.exports=`SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED`})),to=e(((e,t)=>{var n=eo();function r(){}function i(){}i.resetWarningCache=r,t.exports=function(){function e(e,t,r,i,a,o){if(o!==n){var s=Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw s.name=`Invariant Violation`,s}}e.isRequired=e;function t(){return e}var a={array:e,bigint:e,bool:e,func:e,number:e,object:e,string:e,symbol:e,any:e,arrayOf:t,element:e,elementType:e,instanceOf:t,node:e,objectOf:t,oneOf:t,oneOfType:t,shape:t,exact:t,checkPropTypes:i,resetWarningCache:r};return a.PropTypes=a,a}})),no=e(((e,t)=>{t.exports=to()()})),ro=i(no(),1);function io(e,t){for(let n=0,r=e.length;n`u`)return``;let t=window.document?.documentElement?.style;if(!t||e in t)return``;for(let n=0;nt===e.identifier)||e.changedTouches&&io(e.changedTouches,e=>t===e.identifier)}function ko(e){if(e.targetTouches&&e.targetTouches[0])return e.targetTouches[0].identifier;if(e.changedTouches&&e.changedTouches[0])return e.changedTouches[0].identifier}function Ao(){return typeof __webpack_nonce__<`u`?__webpack_nonce__:void 0}function jo(e,t){if(!e)return;let n=e.getElementById(`react-draggable-style-el`);if(!n){n=e.createElement(`style`),n.type=`text/css`,n.id=`react-draggable-style-el`;let r=t??Ao();r&&n.setAttribute(`nonce`,r),n.innerHTML=`.react-draggable-transparent-selection *::-moz-selection {all: inherit;} +import{a as e,i as t,o as n,r,s as i}from"./useRouter-ByJ6_rwb.js";import{A as a,C as o,D as s,E as c,K as l,M as u,O as d,P as f,Q as p,S as m,T as h,X as g,Y as _,Z as v,_ as y,_t as b,a as x,c as S,d as C,dt as w,f as T,ft as E,g as D,gt as O,h as k,j as A,k as j,lt as M,m as N,mt as P,nt as F,o as I,ot as L,p as ee,r as te,s as ne,st as re,tt as ie,u as ae,ut as R,v as oe,x as z,y as se}from"./brand-DUaZkIz1.js";import{c as ce,h as le,m as ue,s as de}from"./preload-helper-FMCtZeYw.js";import{C as fe,E as pe,b as me,o as he,t as ge,w as _e}from"./Tooltip-B3r3s_B9.js";import{a as ve,c as ye,d as be,i as xe,l as B,n as Se,o as Ce,r as we,s as Te,t as Ee,u as De}from"./dashboard-change-chips-BKnD9tpX.js";import{n as Oe,r as ke,t as Ae}from"./WarningCircle.es-DMCNfIHa.js";import{A as je,At as Me,B as Ne,Bt as Pe,C as Fe,D as Ie,E as Le,F as Re,Ft as ze,Gt as Be,H as Ve,Ht as He,It as Ue,Jt as We,Kt as Ge,L as Ke,Lt as qe,M as Je,Mt as Ye,N as Xe,Nt as Ze,O as Qe,P as $e,Pt as et,T as tt,U as nt,Ut as rt,V as it,Vt as at,Wt as ot,Z as st,_ as ct,a as lt,b as ut,c as dt,d as ft,h as pt,i as mt,j as ht,jt as gt,k as _t,kt as vt,l as yt,m as bt,n as xt,o as St,qt as Ct,r as wt,s as Tt,t as Et,u as Dt,v as Ot,w as kt,x as At,z as jt,zt as Mt}from"./index-D1TEoZWj.js";function Nt(e,t){if(Object.is(e,t))return!0;if(typeof e!=`object`||!e||typeof t!=`object`||!t)return!1;if(e instanceof Map&&t instanceof Map){if(e.size!==t.size)return!1;for(let[n,r]of e)if(!t.has(n)||!Object.is(r,t.get(n)))return!1;return!0}if(e instanceof Set&&t instanceof Set){if(e.size!==t.size)return!1;for(let n of e)if(!t.has(n))return!1;return!0}if(e instanceof Date&&t instanceof Date)return e.getTime()===t.getTime();let n=Pt(e);if(n.length!==Pt(t).length)return!1;for(let r=0;r{if(typeof n!=`string`||n.trim().length===0)throw Error(t);return`${e}-${n}`}}var H=r();function It(e){return typeof e==`object`&&e?`base`in e?e.base:void 0:e}function Lt(e,t){if(e===t||Number.isNaN(e)&&Number.isNaN(t))return!0;if(!(e instanceof Object)||!(t instanceof Object))return!1;let n=Object.keys(e),{length:r}=n;if(r!==Object.keys(t).length)return!1;for(let i=0;i{r.current||=window.setTimeout(()=>{i(...e),r.current=null},t)},[t]),o=(0,V.useCallback)(()=>{r.current&&=(window.clearTimeout(r.current),null)},[]);return(0,V.useEffect)(()=>(n.autoInvoke&&a(),o),[o,a]),{start:a,clear:o}}function Ht(e){let t=(0,V.useRef)(void 0);return(0,V.useEffect)(()=>{t.current=e},[e]),t.current}function Ut(e,t,n){let r=(0,V.useRef)(null);(0,V.useEffect)(()=>{r.current&&=(r.current.disconnect(),null);let i=typeof n==`function`?n():n;return i&&(r.current=new MutationObserver(e),r.current.observe(i,t)),()=>{r.current&&=(r.current.disconnect(),null)}},[e,t,n])}function Wt(){let[e,t]=(0,V.useState)(!1);return(0,V.useEffect)(()=>t(!0),[]),e}function Gt(e){return typeof e==`string`||typeof e==`number`||typeof e==`boolean`||typeof e==`bigint`}function Kt(e,t=document){let n=t.querySelector(e);if(n)return n;let r=t.querySelectorAll(`*`);for(let t=0;t{if(!e||!t||!n.current)return;let r=e.getBoundingClientRect(),i=t.getBoundingClientRect(),a=t.offsetWidth===0?1:i.width/t.offsetWidth,o=t.offsetHeight===0?1:i.height/t.offsetHeight,s=window.getComputedStyle(e),c=window.getComputedStyle(t),l=me(s.borderTopWidth)+me(c.borderTopWidth),u=me(s.borderLeftWidth)+me(c.borderLeftWidth),d={top:(r.top-i.top)/o-l,left:(r.left-i.left)/a-u,width:r.width/a,height:r.height/o};n.current.style.transform=`translateY(${d.top}px) translateX(${d.left}px)`,n.current.style.width=`${d.width}px`,n.current.style.height=`${d.height}px`},p=()=>{window.clearTimeout(o.current),n.current&&(n.current.style.transitionDuration=`0ms`),f(),o.current=window.setTimeout(()=>{n.current&&(n.current.style.transitionDuration=``)},30)},m=(0,V.useRef)(null),h=(0,V.useRef)(null);return(0,V.useEffect)(()=>{if(c&&s.current!==e&&i&&i(),s.current=e,f(),e)return m.current=new ResizeObserver(p),m.current.observe(e),t&&(h.current=new ResizeObserver(p),h.current.observe(t)),()=>{m.current?.disconnect(),h.current?.disconnect()}},[t,e]),(0,V.useEffect)(()=>{if(t){let e=e=>{Xt(e.target,t)&&(p(),d(!1))};return t.addEventListener(`transitionend`,e),()=>{t.removeEventListener(`transitionend`,e)}}},[t]),(0,V.useEffect)(()=>{if(n.current&&a){let e=e=>{e.propertyName===`transform`&&a()};return n.current.addEventListener(`transitionend`,e),()=>{n.current?.removeEventListener(`transitionend`,e)}}},[a]),Vt(()=>{be()!==`test`&&l(!0)},20,{autoInvoke:!0}),Ut(e=>{e.forEach(e=>{e.type===`attributes`&&e.attributeName===`dir`&&p()})},{attributes:!0,attributeFilter:[`dir`]},()=>document.documentElement),{initialized:c,hidden:u}}var Qt={root:`m_96b553a6`},$t=g((e,{transitionDuration:t},{shouldReduceMotion:n})=>({root:{"--transition-duration":e.respectReducedMotion&&n?`0ms`:typeof t==`number`?`${t}ms`:t||`150ms`}})),en=h(e=>{let t=u(`FloatingIndicator`,null,e),{classNames:n,className:r,style:i,styles:s,unstyled:c,vars:l,target:d,parent:f,transitionDuration:m,mod:h,displayAfterTransitionEnd:g,onTransitionStart:_,onTransitionEnd:v,attributes:y,ref:b,...x}=t,S=p(),C=a({name:`FloatingIndicator`,classes:Qt,props:t,className:r,style:i,classNames:n,styles:s,unstyled:c,attributes:y,vars:l,varsResolver:$t,stylesCtx:{shouldReduceMotion:S}}),w=(0,V.useRef)(null),{initialized:T,hidden:E}=Zt({target:d,parent:f,ref:w,displayAfterTransitionEnd:g,onTransitionStart:_,onTransitionEnd:v}),D=ie(b,w);return!d||!f?null:(0,H.jsx)(o,{ref:D,mod:[{initialized:T,hidden:E},h],...C(`root`),...x})});en.displayName=`@mantine/core/FloatingIndicator`,en.classes=Qt,en.varsResolver=$t;var[tn,nn]=pe(`Accordion component was not found in the tree`),[rn,an]=pe(`Accordion.Item component was not found in the tree`),on={root:`m_9bdbb667`,panel:`m_df78851f`,content:`m_4ba554d4`,itemTitle:`m_8fa820a0`,control:`m_4ba585b8`,"control--default":`m_6939a5e9`,"control--contained":`m_4271d21b`,label:`m_df3ffa0f`,chevron:`m_3f35ae96`,icon:`m_9bd771fe`,item:`m_9bd7b098`,"item--default":`m_fe19b709`,"item--contained":`m_1f921b3b`,"item--filled":`m_2cdf939a`,"item--separated":`m_9f59b069`},sn=h(e=>{let{classNames:t,className:n,style:r,styles:i,vars:a,chevron:s,icon:c,onClick:l,onKeyDown:d,children:f,disabled:p,mod:h,...g}=u(`AccordionControl`,null,e),{value:_}=an(),v=nn(),y=v.isItemActive(_),b=typeof v.order==`number`,x=`h${v.order}`,S=(0,H.jsxs)(m,{...v.getStyles(`control`,{className:n,classNames:t,style:r,styles:i,variant:v.variant}),unstyled:v.unstyled,mod:[`accordion-control`,{active:y,"chevron-position":v.chevronPosition,disabled:p},h],onClick:e=>{l?.(e),v.onChange(_)},type:`button`,disabled:p,"aria-expanded":y,"aria-controls":v.getRegionId(_),id:v.getControlId(_),onKeyDown:ot({siblingSelector:`[data-accordion-control]`,parentSelector:`[data-accordion]`,activateOnFocus:!1,loop:v.loop,orientation:`vertical`,onKeyDown:d}),...g,children:[(0,H.jsx)(o,{component:`span`,mod:{rotate:!v.disableChevronRotation&&y,position:v.chevronPosition},...v.getStyles(`chevron`,{classNames:t,styles:i}),children:s||v.chevron}),(0,H.jsx)(`span`,{...v.getStyles(`label`,{classNames:t,styles:i}),children:f}),c&&(0,H.jsx)(o,{component:`span`,mod:{"chevron-position":v.chevronPosition},...v.getStyles(`icon`,{classNames:t,styles:i}),children:c})]});return b?(0,H.jsx)(x,{...v.getStyles(`itemTitle`,{classNames:t,styles:i}),children:S}):S});sn.displayName=`@mantine/core/AccordionControl`,sn.classes=on;var cn=h(e=>{let{classNames:t,className:n,style:r,styles:i,vars:a,value:s,mod:c,...l}=u(`AccordionItem`,null,e),d=nn();return(0,H.jsx)(rn,{value:{value:s},children:(0,H.jsx)(o,{mod:[{active:d.isItemActive(s)},c],...d.getStyles(`item`,{className:n,classNames:t,styles:i,style:r,variant:d.variant}),...l})})});cn.displayName=`@mantine/core/AccordionItem`,cn.classes=on;var ln=h(e=>{let{classNames:t,className:n,style:r,styles:i,vars:a,children:o,keepMounted:s,keepMountedMode:c,...l}=u(`AccordionPanel`,null,e),{value:d}=an(),f=nn();return(0,H.jsx)(De,{...f.getStyles(`panel`,{className:n,classNames:t,style:r,styles:i}),expanded:f.isItemActive(d),transitionDuration:f.transitionDuration??200,role:`region`,id:f.getRegionId(d),"aria-labelledby":f.getControlId(d),keepMounted:s??f.keepMounted,keepMountedMode:c??f.keepMountedMode,...l,children:(0,H.jsx)(`div`,{...f.getStyles(`content`,{classNames:t,styles:i}),children:o})})});ln.displayName=`@mantine/core/AccordionPanel`,ln.classes=on;var un={multiple:!1,loop:!0,disableChevronRotation:!1,disableCollapse:!1,chevronPosition:`right`,variant:`default`,chevronSize:`auto`,chevronIconSize:16,keepMountedMode:`activity`},dn=g((e,{transitionDuration:t,chevronSize:n,radius:r})=>({root:{"--accordion-transition-duration":t===void 0?void 0:`${t}ms`,"--accordion-chevron-size":n===void 0?void 0:P(n),"--accordion-radius":r===void 0?void 0:re(r)}})),fn=c(e=>{let t=u(`Accordion`,un,e),{classNames:n,className:r,style:i,styles:s,unstyled:c,vars:l,children:d,multiple:f,value:p,defaultValue:m,onChange:h,id:g,loop:_,transitionDuration:v,disableChevronRotation:y,disableCollapse:b,chevronPosition:x,chevronSize:S,order:C,chevron:w,variant:T,radius:E,chevronIconSize:D,attributes:O,keepMounted:k,keepMountedMode:A,...j}=t,M=F(g),[N,P]=He({value:p,defaultValue:m,finalValue:f?[]:null,onChange:h}),I=e=>Array.isArray(N)?N.includes(e):e===N,L=e=>{if(!Array.isArray(N)&&b&&e===N)return;let t=Array.isArray(N)?N.includes(e)?N.filter(t=>t!==e):[...N,e]:e===N?null:e;P(t)},ee=a({name:`Accordion`,classes:on,props:t,className:r,style:i,classNames:n,styles:s,unstyled:c,attributes:O,vars:l,varsResolver:dn});return(0,H.jsx)(tn,{value:{isItemActive:I,onChange:L,getControlId:Ft(`${M}-control`,`Accordion.Item component was rendered with invalid value or without value`),getRegionId:Ft(`${M}-panel`,`Accordion.Item component was rendered with invalid value or without value`),chevron:w===null?null:w||(0,H.jsx)(Ue,{size:D}),transitionDuration:v,disableChevronRotation:y,chevronPosition:x,order:C,loop:_,getStyles:ee,variant:T,unstyled:c,keepMounted:k,keepMountedMode:A},children:(0,H.jsx)(o,{...ee(`root`),id:M,...j,variant:T,"data-accordion":!0,children:d})})});fn.classes=on,fn.varsResolver=dn,fn.displayName=`@mantine/core/Accordion`,fn.Item=cn,fn.Panel=ln,fn.Control=sn,fn.Chevron=Ue;function pn(e){return typeof e==`string`?{value:e,label:e}:typeof e==`object`&&`value`in e&&!(`label`in e)?{value:e.value,label:`${e.value}`,disabled:e.disabled}:typeof e==`object`&&`group`in e?{group:e.group,items:e.items.map(e=>pn(e))}:typeof e==`number`||typeof e==`bigint`||typeof e==`boolean`?{value:e,label:`${e}`}:e}function mn(e){return e?e.map(e=>pn(e)):[]}function hn(e){return e.reduce((e,t)=>`group`in t?{...e,...hn(t.items)}:(e[`${t.value}`]=t,e),{})}var gn={dropdown:`m_88b62a41`,search:`m_985517d8`,options:`m_b2821a6e`,option:`m_92253aa5`,empty:`m_2530cd1d`,header:`m_858f94bd`,footer:`m_82b967cb`,group:`m_254f3e4f`,groupLabel:`m_2bb2e9e5`,chevron:`m_2943220b`,optionsDropdownOption:`m_390b5f4`,optionsDropdownCheckIcon:`m_8ee53fc2`,optionsDropdownCheckPlaceholder:`m_a530ee0a`},_n={error:null},vn=g((e,{size:t,color:n})=>({chevron:{"--combobox-chevron-size":M(t,`combobox-chevron-size`),"--combobox-chevron-color":n?l(n,e):void 0}})),yn=h(e=>{let t=u(`ComboboxChevron`,_n,e),{size:n,error:r,style:i,className:s,classNames:c,styles:l,unstyled:d,vars:f,attributes:p,mod:m,...h}=t,g=a({name:`ComboboxChevron`,classes:gn,props:t,style:i,className:s,classNames:c,styles:l,unstyled:d,vars:f,varsResolver:vn,attributes:p,rootSelector:`chevron`});return(0,H.jsx)(o,{component:`svg`,...h,...g(`chevron`),size:n,viewBox:`0 0 15 15`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`,mod:[`combobox-chevron`,{error:r},m],children:(0,H.jsx)(`path`,{d:`M4.93179 5.43179C4.75605 5.60753 4.75605 5.89245 4.93179 6.06819C5.10753 6.24392 5.39245 6.24392 5.56819 6.06819L7.49999 4.13638L9.43179 6.06819C9.60753 6.24392 9.89245 6.24392 10.0682 6.06819C10.2439 5.89245 10.2439 5.60753 10.0682 5.43179L7.81819 3.18179C7.73379 3.0974 7.61933 3.04999 7.49999 3.04999C7.38064 3.04999 7.26618 3.0974 7.18179 3.18179L4.93179 5.43179ZM10.0682 9.56819C10.2439 9.39245 10.2439 9.10753 10.0682 8.93179C9.89245 8.75606 9.60753 8.75606 9.43179 8.93179L7.49999 10.8636L5.56819 8.93179C5.39245 8.75606 5.10753 8.75606 4.93179 8.93179C4.75605 9.10753 4.75605 9.39245 4.93179 9.56819L7.18179 11.8182C7.35753 11.9939 7.64245 11.9939 7.81819 11.8182L10.0682 9.56819Z`,fill:`currentColor`,fillRule:`evenodd`,clipRule:`evenodd`})})});yn.classes=gn,yn.varsResolver=vn,yn.displayName=`@mantine/core/ComboboxChevron`;var[bn,xn]=pe(`Combobox component was not found in tree`);function Sn({onMouseDown:e,onClick:t,onClear:n,...r}){return(0,H.jsx)(k.ClearButton,{tabIndex:-1,"aria-hidden":!0,...r,onMouseDown:t=>{t.preventDefault(),e?.(t)},onClick:e=>{n(),t?.(e)}})}Sn.displayName=`@mantine/core/ComboboxClearButton`;var Cn=h(e=>{let{classNames:t,styles:n,className:r,style:i,hidden:a,...o}=u(`ComboboxDropdown`,null,e),s=xn();return(0,H.jsx)(qe.Dropdown,{...o,role:`presentation`,"data-hidden":a||void 0,"data-floating-height":s.floatingHeight||void 0,...s.getStyles(`dropdown`,{className:r,style:i,classNames:t,styles:n})})});Cn.classes=gn,Cn.displayName=`@mantine/core/ComboboxDropdown`;var wn={refProp:`ref`},Tn=h(e=>{let{children:t,refProp:n,ref:r}=u(`ComboboxDropdownTarget`,wn,e);if(xn(),!w(t))throw Error(`Combobox.DropdownTarget component children should be an element or a component that accepts ref. Fragments, strings, numbers and other primitive values are not supported`);return(0,H.jsx)(qe.Target,{ref:r,refProp:n,children:t})});Tn.displayName=`@mantine/core/ComboboxDropdownTarget`;var En=h(e=>{let{classNames:t,className:n,style:r,styles:i,vars:a,...s}=u(`ComboboxEmpty`,null,e),c=xn();return(0,H.jsx)(o,{...c.getStyles(`empty`,{className:n,classNames:t,styles:i,style:r}),...s})});En.classes=gn,En.displayName=`@mantine/core/ComboboxEmpty`;function Dn({onKeyDown:e,onClick:t,withKeyboardNavigation:n,withAriaAttributes:r,withExpandedAttribute:i,targetType:a,autoComplete:o}){let s=xn(),[c,l]=(0,V.useState)(null),u=t=>{if(e?.(t),!s.readOnly&&n){if(t.nativeEvent.isComposing)return;if(t.nativeEvent.code===`ArrowDown`&&(t.preventDefault(),s.store.dropdownOpened?l(s.store.selectNextOption()):(s.store.openDropdown(`keyboard`),l(s.store.selectActiveOption()),s.store.updateSelectedOptionIndex(`selected`,{scrollIntoView:!0}))),t.nativeEvent.code===`ArrowUp`&&(t.preventDefault(),s.store.dropdownOpened?l(s.store.selectPreviousOption()):(s.store.openDropdown(`keyboard`),l(s.store.selectActiveOption()),s.store.updateSelectedOptionIndex(`selected`,{scrollIntoView:!0}))),t.nativeEvent.code===`Enter`||t.nativeEvent.code===`NumpadEnter`){if(t.nativeEvent.keyCode===229)return;let e=s.store.getSelectedOptionIndex();s.store.dropdownOpened&&e!==-1?(t.preventDefault(),s.store.clickSelectedOption()):a===`button`&&(t.preventDefault(),s.store.openDropdown(`keyboard`))}t.key===`Escape`&&s.store.closeDropdown(`keyboard`),t.nativeEvent.code===`Space`&&a===`button`&&(t.preventDefault(),s.store.toggleDropdown(`keyboard`))}},d=r?{...i?{role:`combobox`}:{},"aria-haspopup":`listbox`,"aria-expanded":i?!!(s.store.listId&&s.store.dropdownOpened):void 0,"aria-controls":s.store.dropdownOpened&&s.store.listId?s.store.listId:void 0,"aria-activedescendant":s.store.dropdownOpened&&c||void 0,autoComplete:o,"data-expanded":s.store.dropdownOpened||void 0,"data-mantine-stop-propagation":s.store.dropdownOpened||void 0}:{},f=e=>{a===`button`&&e.currentTarget.focus(),t?.(e)};return{...d,onKeyDown:u,onClick:f}}var On={refProp:`ref`,targetType:`input`,withKeyboardNavigation:!0,withAriaAttributes:!0,withExpandedAttribute:!1,autoComplete:`off`},kn=h(e=>{let{children:t,refProp:n,withKeyboardNavigation:r,withAriaAttributes:i,withExpandedAttribute:a,targetType:o,autoComplete:s,ref:c,...l}=u(`ComboboxEventsTarget`,On,e),d=v(t);if(!d)throw Error(`Combobox.EventsTarget component children should be an element or a component that accepts ref. Fragments, strings, numbers and other primitive values are not supported`);let f=xn(),p=Dn({targetType:o,withAriaAttributes:i,withKeyboardNavigation:r,withExpandedAttribute:a,onKeyDown:d.props.onKeyDown,onClick:d.props.onClick,autoComplete:s});return(0,V.cloneElement)(d,{...p,...l,[n]:ie(c,f.store.targetRef,fe(d))})});kn.displayName=`@mantine/core/ComboboxEventsTarget`;var An=h(e=>{let{classNames:t,className:n,style:r,styles:i,vars:a,...s}=u(`ComboboxFooter`,null,e),c=xn();return(0,H.jsx)(o,{...c.getStyles(`footer`,{className:n,classNames:t,style:r,styles:i}),...s,onMouseDown:e=>{e.preventDefault()}})});An.classes=gn,An.displayName=`@mantine/core/ComboboxFooter`;var jn=h(e=>{let{classNames:t,className:n,style:r,styles:i,vars:a,children:s,label:c,id:l,...d}=u(`ComboboxGroup`,null,e),f=xn(),p=F(l),m=c!=null&&c!==!1&&c!==``;return(0,H.jsxs)(o,{role:`group`,"aria-labelledby":m?p:void 0,...f.getStyles(`group`,{className:n,classNames:t,style:r,styles:i}),...d,children:[m&&(0,H.jsx)(`div`,{id:p,...f.getStyles(`groupLabel`,{classNames:t,styles:i}),children:c}),s]})});jn.classes=gn,jn.displayName=`@mantine/core/ComboboxGroup`;var Mn=h(e=>{let{classNames:t,className:n,style:r,styles:i,vars:a,...s}=u(`ComboboxHeader`,null,e),c=xn();return(0,H.jsx)(o,{...c.getStyles(`header`,{className:n,classNames:t,style:r,styles:i}),...s,onMouseDown:e=>{e.preventDefault()}})});Mn.classes=gn,Mn.displayName=`@mantine/core/ComboboxHeader`;function Nn({value:e,valuesDivider:t=`,`,...n}){return(0,H.jsx)(`input`,{type:`hidden`,value:Array.isArray(e)?e.join(t):e?`${e}`:``,...n})}Nn.displayName=`@mantine/core/ComboboxHiddenInput`;var Pn=h(e=>{let t=u(`ComboboxOption`,null,e),{classNames:n,className:r,style:i,styles:a,vars:s,onClick:c,id:l,active:d,onMouseDown:f,onMouseOver:p,disabled:m,selected:h,mod:g,..._}=t,v=xn(),y=(0,V.useId)(),b=l||y;return(0,H.jsx)(o,{...v.getStyles(`option`,{className:r,classNames:n,styles:a,style:i}),"aria-disabled":m||void 0,..._,id:b,mod:[`combobox-option`,{"combobox-active":d,"combobox-disabled":m,"combobox-selected":h},g],role:`option`,onClick:e=>{m?e.preventDefault():(v.onOptionSubmit?.(t.value,t),c?.(e))},onMouseDown:e=>{e.preventDefault(),f?.(e)},onMouseOver:e=>{v.resetSelectionOnOptionHover&&v.store.resetSelectedOption(),p?.(e)}})});Pn.classes=gn,Pn.displayName=`@mantine/core/ComboboxOption`;var Fn=h(e=>{let{classNames:t,className:n,style:r,styles:i,id:a,onMouseDown:s,labelledBy:c,...l}=u(`ComboboxOptions`,null,e),d=xn(),f=F(a);return(0,V.useEffect)(()=>{d.store.setListId(f)},[f]),(0,H.jsx)(o,{...d.getStyles(`options`,{className:n,style:r,classNames:t,styles:i}),...l,id:f,role:`listbox`,"aria-labelledby":c,onMouseDown:e=>{e.preventDefault(),s?.(e)}})});Fn.classes=gn,Fn.displayName=`@mantine/core/ComboboxOptions`;var In={withAriaAttributes:!0,withKeyboardNavigation:!0},Ln=h(e=>{let{classNames:t,styles:n,unstyled:r,vars:i,withAriaAttributes:a,onKeyDown:o,onClick:s,withKeyboardNavigation:c,size:l,ref:d,...f}=u(`ComboboxSearch`,In,e),p=xn(),m=p.getStyles(`search`),h=Dn({targetType:`input`,withAriaAttributes:a,withKeyboardNavigation:c,withExpandedAttribute:!1,onKeyDown:o,onClick:s,autoComplete:`off`});return(0,H.jsx)(k,{ref:ie(d,p.store.searchRef),classNames:[{input:m.className},t],styles:[{input:m.style},n],size:l||p.size,...h,...f,__staticSelector:`Combobox`})});Ln.classes=gn,Ln.displayName=`@mantine/core/ComboboxSearch`;var Rn={refProp:`ref`,targetType:`input`,withKeyboardNavigation:!0,withAriaAttributes:!0,withExpandedAttribute:!1,autoComplete:`off`},zn=h(e=>{let{children:t,refProp:n,withKeyboardNavigation:r,withAriaAttributes:i,withExpandedAttribute:a,targetType:o,autoComplete:s,ref:c,...l}=u(`ComboboxTarget`,Rn,e),d=v(t);if(!d)throw Error(`Combobox.Target component children should be an element or a component that accepts ref. Fragments, strings, numbers and other primitive values are not supported`);let f=xn(),p=Dn({targetType:o,withAriaAttributes:i,withKeyboardNavigation:r,withExpandedAttribute:a,onKeyDown:d.props.onKeyDown,onClick:d.props.onClick,autoComplete:s}),m=(0,V.cloneElement)(d,{...p,...l});return(0,H.jsx)(qe.Target,{refProp:n,ref:ie(c,f.store.targetRef),children:m})});zn.displayName=`@mantine/core/ComboboxTarget`;function Bn(e,t,n){for(let n=e-1;n>=0;--n)if(!t[n].hasAttribute(`data-combobox-disabled`))return n;if(n){for(let e=t.length-1;e>-1;--e)if(!t[e].hasAttribute(`data-combobox-disabled`))return e}return e}function Vn(e,t,n){for(let n=e+1;n{s||(c(!0),i?.(e))},[c,i,s]),_=(0,V.useCallback)((e=`unknown`)=>{s&&(c(!1),r?.(e))},[c,r,s]),v=(0,V.useCallback)((e=`unknown`)=>{s?_(e):g(e)},[_,g,s]),y=(0,V.useCallback)(()=>{let e=Jt(f.current);Kt(`#${l.current} [data-combobox-selected]`,e)?.removeAttribute(`data-combobox-selected`)},[]),b=(0,V.useCallback)(e=>{let t=Jt(f.current),n=Kt(`#${l.current}`,t),r=n?qt(`[data-combobox-option]`,n):null;if(!r)return null;let i=e>=r.length?0:e<0?r.length-1:e;return u.current=i,r?.[i]&&!r[i].hasAttribute(`data-combobox-disabled`)?(y(),r[i].setAttribute(`data-combobox-selected`,`true`),r[i].scrollIntoView({block:`nearest`,behavior:o}),r[i].id):null},[o,y]),x=(0,V.useCallback)(()=>{let e=Jt(f.current),t=Kt(`#${l.current} [data-combobox-active]`,e);if(t){let n=qt(`#${l.current} [data-combobox-option]`,e).findIndex(e=>e===t);return b(n)}return b(0)},[b]),S=(0,V.useCallback)(()=>{let e=Jt(f.current),t=qt(`#${l.current} [data-combobox-option]`,e);return b(Vn(u.current,t,a))},[b,a]),C=(0,V.useCallback)(()=>{let e=Jt(f.current),t=qt(`#${l.current} [data-combobox-option]`,e);return b(Bn(u.current,t,a))},[b,a]),w=(0,V.useCallback)(()=>{let e=Jt(f.current),t=qt(`#${l.current} [data-combobox-option]`,e);return b(Hn(t))},[b]),T=(0,V.useCallback)((e=`selected`,t)=>{if(typeof e==`number`){u.current=e;let n=Jt(f.current),r=qt(`#${l.current} [data-combobox-option]`,n);t?.scrollIntoView&&r[e]?.scrollIntoView({block:`nearest`,behavior:o});return}h.current=window.setTimeout(()=>{let n=Jt(f.current),r=qt(`#${l.current} [data-combobox-option]`,n),i=r.findIndex(t=>t.hasAttribute(`data-combobox-${e}`));u.current=i,t?.scrollIntoView&&r[i]?.scrollIntoView({block:`nearest`,behavior:o})},0)},[]),E=(0,V.useCallback)(()=>{u.current=-1,y()},[y]),D=(0,V.useCallback)(()=>{let e=Jt(f.current);(qt(`#${l.current} [data-combobox-option]`,e)?.[u.current])?.click()},[]),O=(0,V.useCallback)(e=>{l.current=e},[]),k=(0,V.useCallback)(()=>{p.current=window.setTimeout(()=>d.current?.focus(),0)},[]),A=(0,V.useCallback)(()=>{m.current=window.setTimeout(()=>f.current?.focus(),0)},[]),j=(0,V.useCallback)(()=>u.current,[]);return(0,V.useEffect)(()=>()=>{window.clearTimeout(p.current),window.clearTimeout(m.current),window.clearTimeout(h.current)},[]),{dropdownOpened:s,openDropdown:g,closeDropdown:_,toggleDropdown:v,selectedOptionIndex:u.current,getSelectedOptionIndex:j,selectOption:b,selectFirstOption:w,selectActiveOption:x,selectNextOption:S,selectPreviousOption:C,resetSelectedOption:E,updateSelectedOptionIndex:T,listId:l.current,setListId:O,clickSelectedOption:D,searchRef:d,focusSearchInput:k,targetRef:f,focusTarget:A}}var Wn={keepMounted:!0,keepMountedMode:`display-none`,withinPortal:!0,resetSelectionOnOptionHover:!1,width:`target`,transitionProps:{transition:`fade`,duration:0},size:`sm`},Gn=g((e,{size:t,dropdownPadding:n})=>({options:{"--combobox-option-fz":L(t),"--combobox-option-padding":M(t,`combobox-option-padding`)},dropdown:{"--combobox-padding":n===void 0?void 0:P(n),"--combobox-option-fz":L(t),"--combobox-option-padding":M(t,`combobox-option-padding`)}})),Kn=e=>{let t=u(`Combobox`,Wn,e),{classNames:n,styles:r,unstyled:i,children:o,store:s,vars:c,onOptionSubmit:l,onClose:d,size:f,dropdownPadding:p,resetSelectionOnOptionHover:m,__staticSelector:h,readOnly:g,attributes:_,floatingHeight:v,middlewares:y,...b}=t,x=v===`viewport`?{...y,flip:!1,size:{...typeof y?.size==`object`?y.size:{},padding:typeof y?.size==`object`&&y.size.padding!==void 0?y.size.padding:10,apply:({availableHeight:e,availableWidth:t,elements:n,...r})=>{n.floating.style.setProperty(`--combobox-floating-max-height`,`${e}px`);let i=y?.size;typeof i==`object`&&i.apply?i.apply({availableHeight:e,availableWidth:t,elements:n,...r}):i&&Object.assign(n.floating.style,{maxWidth:`${t}px`,maxHeight:`${e}px`})}}}:y,S=Un(),C=s||S,w=a({name:h||`Combobox`,classes:gn,props:t,classNames:n,styles:r,unstyled:i,attributes:_,vars:c,varsResolver:Gn}),T=()=>{d?.(),C.closeDropdown()};return(0,H.jsx)(bn,{value:{getStyles:w,store:C,onOptionSubmit:l,size:f,resetSelectionOnOptionHover:m,readOnly:g,floatingHeight:v},children:(0,H.jsx)(qe,{opened:C.dropdownOpened,...b,middlewares:x,onChange:e=>!e&&T(),withRoles:!1,unstyled:i,children:o})})};Kn.extend=e=>e,Kn.classes=gn,Kn.varsResolver=Gn,Kn.displayName=`@mantine/core/Combobox`,Kn.Target=zn,Kn.Dropdown=Cn,Kn.Options=Fn,Kn.Option=Pn,Kn.Search=Ln,Kn.Empty=En,Kn.Chevron=yn,Kn.Footer=An,Kn.Header=Mn,Kn.EventsTarget=kn,Kn.DropdownTarget=Tn,Kn.Group=jn,Kn.ClearButton=Sn,Kn.HiddenInput=Nn;function qn({children:e,role:t}){let n=(0,V.use)(D);return n?(0,H.jsx)(`div`,{role:t,"aria-labelledby":n.labelId,"aria-describedby":n.describedBy,children:e}):(0,H.jsx)(H.Fragment,{children:e})}var Jn={root:`m_5f75b09e`,body:`m_5f6e695e`,labelWrapper:`m_d3ea56bb`,label:`m_8ee546b8`,description:`m_328f68c0`,error:`m_8e8a99cc`},Yn=Jn;function Xn({__staticSelector:e,__stylesApiProps:t,className:n,classNames:r,styles:i,unstyled:s,children:c,label:l,description:u,id:d,disabled:f,error:p,size:m,labelPosition:h=`left`,bodyElement:g=`div`,labelElement:_=`label`,variant:v,style:y,vars:b,mod:x,attributes:S,...C}){let w=a({name:e,props:t,className:n,style:y,classes:Jn,classNames:r,styles:i,unstyled:s,attributes:S}),T=u?`${d}-description`:void 0,E=p&&typeof p!=`boolean`?`${d}-error`:void 0;return(0,H.jsx)(o,{...w(`root`),__vars:{"--label-fz":L(m),"--label-lh":M(m,`label-lh`)},mod:[{"label-position":h},x],variant:v,size:m,...C,children:(0,H.jsxs)(o,{component:g,htmlFor:g===`label`?d:void 0,...w(`body`),children:[c,(0,H.jsxs)(`div`,{...w(`labelWrapper`),"data-disabled":f||void 0,children:[l&&(0,H.jsx)(o,{component:_,htmlFor:_===`label`?d:void 0,...w(`label`),"data-disabled":f||void 0,children:l}),u&&(0,H.jsx)(k.Description,{id:T,size:m,__inheritStyles:!1,...w(`description`),children:u}),p&&typeof p!=`boolean`&&(0,H.jsx)(k.Error,{id:E,size:m,__inheritStyles:!1,...w(`error`),children:p})]})]})})}Xn.displayName=`@mantine/core/InlineInput`;function Zn(e){return`group`in e}function Qn({options:e,search:t,limit:n}){let r=t.trim().toLowerCase(),i=[];for(let a=0;a0)return!1;return!0}function er(e,t=new Set){if(Array.isArray(e))for(let n of e)if(Zn(n))er(n.items,t);else{if(n.value===void 0)throw Error(`[@mantine/core] Each option must have value property`);if(t.has(n.value))throw Error(`[@mantine/core] Duplicate options are not supported. Option with value "${n.value}" was provided more than once`);t.add(n.value)}}function tr(e,t){return Array.isArray(e)?e.includes(t):e===t}function nr({data:e,withCheckIcon:t,withAlignedLabels:n,value:r,checkIconPosition:i,unstyled:a,renderOption:o}){if(!Zn(e)){let s=tr(r,e.value),c=t&&(s?(0,H.jsx)(ze,{className:gn.optionsDropdownCheckIcon}):n?(0,H.jsx)(`div`,{className:gn.optionsDropdownCheckPlaceholder}):null),l=(0,H.jsxs)(H.Fragment,{children:[i===`left`&&c,(0,H.jsx)(`span`,{children:e.label}),i===`right`&&c]});return(0,H.jsx)(Kn.Option,{value:e.value,disabled:e.disabled,className:_({[gn.optionsDropdownOption]:!a}),"data-reverse":i===`right`||void 0,"data-checked":s||void 0,"aria-selected":s,active:s,children:typeof o==`function`?o({option:e,checked:s}):l})}let s=e.items.map(e=>(0,H.jsx)(nr,{data:e,value:r,unstyled:a,withCheckIcon:t,withAlignedLabels:n,checkIconPosition:i,renderOption:o},`${e.value}`));return(0,H.jsx)(Kn.Group,{label:e.group,children:s})}function rr({data:e,hidden:t,hiddenWhenEmpty:n,filter:r,search:i,limit:a,maxDropdownHeight:o,floatingHeight:s,withScrollArea:c=!0,filterOptions:l=!0,withCheckIcon:u=!1,withAlignedLabels:d=!1,value:f,checkIconPosition:p,nothingFoundMessage:m,unstyled:h,labelId:g,renderOption:_,scrollAreaProps:v,"aria-label":y}){let b=xn();er(e);let x=typeof i==`string`?(r||Qn)({options:e,search:l?i:``,limit:a??1/0}):e,S=$n(x),C=x.map((e,t)=>(0,H.jsx)(nr,{data:e,withCheckIcon:u,withAlignedLabels:d,value:f,checkIconPosition:p,unstyled:h,renderOption:_},Zn(e)?`group-${typeof e.group==`string`?e.group:t}`:`${e.value}`));return(0,H.jsx)(Kn.Dropdown,{hidden:t||n&&S,"data-composed":!0,children:(0,H.jsxs)(Kn.Options,{labelledBy:g,"aria-label":y,children:[c?(0,H.jsx)(he.Autosize,{mah:(s??b.floatingHeight)===`viewport`?`var(--combobox-floating-options-max-height)`:o??220,type:`scroll`,scrollbarSize:`var(--combobox-padding)`,offsetScrollbars:`y`,...v,children:C}):C,S&&m&&(0,H.jsx)(Kn.Empty,{children:m})]})})}function ir(e,t,n,r){if(t===n||r===`before`&&n===t+1||r===`after`&&n===t-1)return e;let i=e.slice(),[a]=i.splice(t,1),o=t{let t=e.lastElementChild;return t?t instanceof HTMLInputElement?t:t.querySelector(`input`):null},or=(e,t)=>{if(e===t)return!0;if(e.length!==t.length)return!1;for(let n=0;n{let e=i.current;e&&(i.current=null,or(o.current,e.expectedValue)&&e.container?.querySelector(`[data-mantine-pill-index="${e.index}"]`)?.focus())});let s=(0,V.useCallback)(e=>{a.current=e},[]);return{getPillProps:e=>{if(n)return{draggable:!0,tabIndex:-1,"data-mantine-pill-index":e,"aria-keyshortcuts":`Alt+ArrowLeft Alt+ArrowRight`,onMouseDown:e=>{e.button===0&&e.stopPropagation()},onDragStart:t=>{t.stopPropagation(),t.dataTransfer.effectAllowed=`move`,t.dataTransfer.setData(`text/plain`,String(e)),r.current.draggedIndex=e;let n=t.currentTarget,i=n.getBoundingClientRect(),a=n.cloneNode(!0);a.removeAttribute(`data-dragging`),a.removeAttribute(`data-drag-over`),a.style.position=`fixed`,a.style.top=`-9999px`,a.style.left=`-9999px`,a.style.width=`${i.width}px`,a.style.height=`${i.height}px`,a.style.pointerEvents=`none`,document.body.appendChild(a),t.dataTransfer.setDragImage(a,t.clientX-i.left,t.clientY-i.top),setTimeout(()=>a.parentNode?.removeChild(a),0),requestAnimationFrame(()=>{n.setAttribute(`data-dragging`,`true`)})},onDragOver:t=>{let{draggedIndex:n}=r.current;if(n===null||n===e)return;let i=t.currentTarget,a=i.getBoundingClientRect(),o=t.clientX-a.left,s=(getComputedStyle(i).direction===`rtl`?o>a.width/2:o{let t=e.currentTarget,n=e.relatedTarget;n&&t.contains(n)||(t.removeAttribute(`data-drag-over`),r.current.currentDropTarget===t&&(r.current.currentDropTarget=null))},onDrop:n=>{n.preventDefault(),n.stopPropagation();let i=n.currentTarget,a=i.getAttribute(`data-drag-over`);i.removeAttribute(`data-drag-over`);let{draggedIndex:s}=r.current;if(s!==null&&a&&s!==e){let n=ir(o.current,s,e,a);n!==o.current&&t(n)}r.current.draggedIndex=null,r.current.currentDropTarget=null},onDragEnd:e=>{e.currentTarget.removeAttribute(`data-dragging`);let t=r.current.currentDropTarget;t&&t.removeAttribute(`data-drag-over`),r.current.draggedIndex=null,r.current.currentDropTarget=null},onKeyDown:n=>{if(n.key!==`ArrowLeft`&&n.key!==`ArrowRight`)return;let r=n.currentTarget,a=getComputedStyle(r).direction===`rtl`?n.key===`ArrowLeft`:n.key===`ArrowRight`,s=a?e+1:e-1;if(n.altKey){if(s<0||s>=o.current.length)return;n.preventDefault(),n.stopPropagation();let c=a?`after`:`before`,l=ir(o.current,e,s,c);if(l===o.current)return;i.current={container:r.parentElement,index:s,expectedValue:l},t(l);return}if(s<0)return;let c=r.parentElement;if(c){if(n.preventDefault(),n.stopPropagation(),s>=o.current.length){ar(c)?.focus();return}c.querySelector(`[data-mantine-pill-index="${s}"]`)?.focus()}}}},getListProps:()=>n?{ref:s}:{},handleInputKeyDown:e=>{if(!n||e.key!==`ArrowLeft`)return;let t=e.currentTarget;if(!(t.value.length===0||t.selectionStart===0&&t.selectionEnd===0))return;let r=a.current;if(!r)return;let i=r.querySelectorAll(`[data-mantine-pill-index]`);i.length!==0&&(e.preventDefault(),i[i.length-1].focus())}}}function cr({id:e,label:t,labelProps:n,inputWrapperOrder:r}){if(t&&(!r||r.includes(`label`)))return n?.id||`${e}-label`}function lr(e){let t=e.currentTarget;return Jt(t).activeElement!==t}var ur=(0,V.createContext)(null),dr={root:`m_7cda1cd6`,"root--default":`m_44da308b`,"root--contrast":`m_e3a01f8`,label:`m_1e0e6180`,remove:`m_ae386778`,group:`m_1dcfd90b`},fr=(0,V.createContext)(null),pr=g((e,{gap:t},{size:n})=>({group:{"--pg-gap":t===void 0?M(n,`pg-gap`):M(t)}})),mr=h(e=>{let t=u(`PillGroup`,null,e),{classNames:n,className:r,style:i,styles:s,unstyled:c,vars:l,size:d,disabled:f,attributes:p,...m}=t,h=(0,V.use)(ur)?.size||d||void 0,g=a({name:`PillGroup`,classes:dr,props:t,className:r,style:i,classNames:n,styles:s,unstyled:c,attributes:p,vars:l,varsResolver:pr,stylesCtx:{size:h},rootSelector:`group`});return(0,H.jsx)(fr,{value:{size:h,disabled:f},children:(0,H.jsx)(o,{size:h,...g(`group`),...m})})});mr.classes=dr,mr.varsResolver=pr,mr.displayName=`@mantine/core/PillGroup`;var hr={variant:`default`},gr=g((e,{radius:t},{size:n})=>({root:{"--pill-fz":M(n,`pill-fz`),"--pill-height":M(n,`pill-height`),"--pill-radius":t===void 0?void 0:re(t)}})),_r=h(e=>{let t=u(`Pill`,hr,e),{classNames:n,className:r,style:i,styles:s,unstyled:c,vars:l,variant:d,children:f,withRemoveButton:p,onRemove:m,removeButtonProps:h,radius:g,size:_,disabled:v,mod:y,attributes:b,...x}=t,S=(0,V.use)(fr),C=(0,V.use)(ur),w=_||S?.size||void 0,T=C?.variant===`filled`?`contrast`:d||`default`,E=a({name:`Pill`,classes:dr,props:t,className:r,style:i,classNames:n,styles:s,unstyled:c,attributes:b,vars:l,varsResolver:gr,stylesCtx:{size:w}});return(0,H.jsxs)(o,{component:`span`,variant:T,size:w,...E(`root`,{variant:T}),mod:[{"with-remove":p&&!v,disabled:v||S?.disabled},y],...x,children:[(0,H.jsx)(`span`,{...E(`label`),children:f}),p&&(0,H.jsx)(oe,{variant:`transparent`,radius:g,tabIndex:-1,"aria-hidden":!0,unstyled:c,...h,...E(`remove`,{className:h?.className,style:h?.style}),onMouseDown:e=>{e.preventDefault(),e.stopPropagation(),h?.onMouseDown?.(e)},onClick:e=>{e.stopPropagation(),m?.(),h?.onClick?.(e)}})]})});_r.classes=dr,_r.varsResolver=gr,_r.displayName=`@mantine/core/Pill`,_r.Group=mr;var vr={field:`m_45c4369d`},yr={type:`visible`},br=h(e=>{let t=u(`PillsInputField`,yr,e),{classNames:n,className:r,style:i,styles:s,unstyled:c,vars:l,type:d,disabled:f,id:p,pointer:m,mod:h,attributes:g,ref:_,...v}=t,y=(0,V.use)(ur),b=(0,V.use)(D),x=a({name:`PillsInputField`,classes:vr,props:t,className:r,style:i,classNames:n,styles:s,unstyled:c,attributes:g,rootSelector:`field`}),S=f||y?.disabled;return(0,H.jsx)(o,{component:`input`,ref:ie(_,y?.fieldRef),"data-type":d,disabled:S,mod:[{disabled:S,pointer:m},h],...x(`field`),...v,id:b?.inputId||p,"aria-invalid":y?.hasError,"aria-describedby":b?.describedBy,type:`text`,onMouseDown:e=>!m&&e.stopPropagation()})});br.classes=vr,br.displayName=`@mantine/core/PillsInputField`;var xr={size:`sm`},Sr=h(e=>{let{children:t,onMouseDown:n,onClick:r,size:i,disabled:a,__staticSelector:o,error:s,variant:c,...l}=u([`Input`,`InputWrapper`,`PillsInput`],xr,e),d=(0,V.useRef)(null);return(0,H.jsx)(ur,{value:{fieldRef:d,size:i,disabled:a,hasError:!!s,variant:c},children:(0,H.jsx)(N,{size:i,error:s,variant:c,component:`div`,"data-no-overflow":!0,onMouseDown:e=>{e.preventDefault(),n?.(e),d.current?.focus()},onClick:e=>{e.preventDefault(),e.currentTarget.closest(`fieldset`)?.disabled||(d.current?.focus(),r?.(e))},...l,multiline:!0,disabled:a,__staticSelector:o||`PillsInput`,withAria:!1,children:t})})});Sr.displayName=`@mantine/core/PillsInput`,Sr.classes=N.classes,Sr.Field=br;function Cr(e,t){let n=t.trim().toLowerCase();if(n===``)return;let r=Object.values(e).filter(e=>!e.disabled&&e.label.trim().toLowerCase()===n);return r.length===1?r[0]:void 0}function wr(e){return typeof e==`string`?e.trim().toLowerCase():e}function Tr({data:e,value:t}){let n=t.map(wr);return e.reduce((e,t)=>(Zn(t)?e.push({group:t.group,items:t.items.filter(e=>n.indexOf(wr(e.value))===-1)}):n.indexOf(wr(t.value))===-1&&e.push(t),e),[])}var Er={xs:41,sm:50,md:60,lg:72,xl:89},Dr={maxValues:1/0,withCheckIcon:!0,checkIconPosition:`left`,hiddenInputValuesDivider:`,`,clearSearchOnChange:!0,openOnFocus:!0,size:`sm`},Or=c(e=>{let t=u([`Input`,`InputWrapper`,`MultiSelect`],Dr,e),{classNames:n,className:r,style:i,styles:o,unstyled:s,vars:c,size:l,value:f,defaultValue:p,onChange:m,onKeyDown:h,variant:g,data:_,dropdownOpened:v,defaultDropdownOpened:y,onDropdownOpen:b,onDropdownClose:x,selectFirstOptionOnChange:S,selectFirstOptionOnDropdownOpen:C,onOptionSubmit:w,comboboxProps:T,filter:E,limit:D,withScrollArea:O,maxDropdownHeight:k,floatingHeight:j,searchValue:M,defaultSearchValue:N,onSearchChange:P,readOnly:I,disabled:L,onFocus:ee,onBlur:te,radius:ne,rightSection:re,rightSectionWidth:ie,rightSectionPointerEvents:ae,rightSectionProps:R,leftSection:oe,leftSectionWidth:z,leftSectionPointerEvents:se,leftSectionProps:ce,inputContainer:le,inputWrapperOrder:ue,withAsterisk:de,labelProps:fe,descriptionProps:pe,errorProps:me,successProps:he,wrapperProps:ge,description:_e,label:ve,error:ye,success:be,maxValues:xe,searchable:B,nothingFoundMessage:Se,withCheckIcon:Ce,withAlignedLabels:we,checkIconPosition:Te,hidePickedOptions:Ee,withErrorStyles:De,withSuccessStyles:Oe,name:ke,form:Ae,id:je,clearable:Me,clearSectionMode:Ne,clearButtonProps:Pe,hiddenInputProps:Fe,placeholder:Ie,hiddenInputValuesDivider:Le,required:Re,mod:ze,renderOption:Be,renderPill:Ve,onRemove:Ue,onClear:We,onMaxValues:Ge,scrollAreaProps:Ke,chevronColor:qe,attributes:Je,clearSearchOnChange:Ye,openOnFocus:Xe,loading:Ze,loadingPosition:Qe,withPillsReorder:$e,...et}=t,tt=F(je),nt=cr({id:tt,label:ve,labelProps:fe,inputWrapperOrder:ue}),rt=mn(_),it=hn(rt),at=(0,V.useRef)({}),ot=Un({opened:v,defaultOpened:y,onDropdownOpen:()=>{b?.(),C&&ot.selectFirstOption()},onDropdownClose:()=>{x?.(),ot.resetSelectedOption()}}),{styleProps:st,rest:{type:ct,autoComplete:lt,...ut}}=d(et),[dt,ft]=He({value:f,defaultValue:p,finalValue:[],onChange:m}),{getPillProps:pt,getListProps:mt,handleInputKeyDown:ht}=sr({value:dt,onChange:ft,enabled:$e&&!L&&!I}),[gt,_t]=He({value:M,defaultValue:N,finalValue:``,onChange:P}),vt=e=>{_t(e),ot.resetSelectedOption()},yt=a({name:`MultiSelect`,classes:{},props:t,classNames:n,styles:o,unstyled:s,attributes:Je}),{resolvedClassNames:bt,resolvedStyles:xt}=A({props:t,styles:o,classNames:n}),St=e=>{h?.(e),!e.defaultPrevented&&(e.key===` `&&!B&&(e.preventDefault(),ot.toggleDropdown()),e.key===`Backspace`&>.length===0&&dt.length>0&&!I&&(Ue?.(dt[dt.length-1]),ft(dt.slice(0,dt.length-1))),ht(e))},Ct=dt.map((e,t)=>{let n=it[`${e}`]||at.current[`${e}`],r=pt(t);return Ve?(0,H.jsx)(V.Fragment,{children:Ve({option:n,value:e,onRemove:()=>{ft(dt.filter(t=>e!==t)),Ue?.(e)},disabled:L,reorderProps:r})},`${e}-${t}`):(0,H.jsx)(_r,{withRemoveButton:!I&&!it[`${e}`]?.disabled,onRemove:()=>{ft(dt.filter(t=>e!==t)),Ue?.(e)},unstyled:s,disabled:L,...yt(`pill`),...r,children:n?.label||e},`${e}-${t}`)});(0,V.useEffect)(()=>{S&&ot.selectFirstOption()},[S,gt]),(0,V.useEffect)(()=>{dt.forEach(e=>{`${e}`in it&&(at.current[`${e}`]=it[`${e}`])})},[it,dt]);let wt=(0,H.jsx)(Kn.ClearButton,{...Pe,onClear:()=>{We?.(),ft([]),vt(``)}}),Tt=Tr({data:rt,value:dt}),Et=Me&&dt.length>0&&!L&&!I,Dt=Et?{paddingInlineEnd:Er[l]??Er.sm}:void 0;return(0,H.jsxs)(H.Fragment,{children:[(0,H.jsxs)(Kn,{store:ot,classNames:bt,styles:xt,unstyled:s,size:l,readOnly:I,__staticSelector:`MultiSelect`,attributes:Je,floatingHeight:j,onOptionSubmit:e=>{w?.(e),Ye&&vt(``),ot.updateSelectedOptionIndex(`selected`),dt.includes(it[`${e}`].value)?(ft(dt.filter(t=>t!==it[`${e}`].value)),Ue?.(it[`${e}`].value)):dt.lengthB?ot.openDropdown():ot.toggleDropdown(),"data-expanded":ot.dropdownOpened||void 0,id:tt,required:Re,mod:ze,attributes:Je,children:(0,H.jsxs)(_r.Group,{attributes:Je,disabled:L,unstyled:s,...yt(`pillsList`,{style:Dt}),...mt(),children:[Ct,(0,H.jsx)(Kn.EventsTarget,{autoComplete:lt,withExpandedAttribute:!0,children:(0,H.jsx)(Sr.Field,{...ut,id:tt,placeholder:Ie,type:!B&&!Ie?`hidden`:`visible`,...yt(`inputField`),unstyled:s,onFocus:e=>{ee?.(e),Xe&&B&&ot.openDropdown()},onBlur:e=>{te?.(e),ot.closeDropdown(),vt(``)},onKeyDown:St,value:gt,onChange:e=>{if(lr(e)){if(!I){let t=Cr(it,e.currentTarget.value);t&&!dt.includes(t.value)&&dt.length{let{classNames:t,className:n,style:r,styles:i,vars:a,...s}=u(`ProgressLabel`,null,e),c=Ar();return(0,H.jsx)(o,{...c.getStyles(`label`,{className:n,style:r,classNames:t,styles:i}),...s})});Mr.classes=jr,Mr.displayName=`@mantine/core/ProgressLabel`;var Nr=g((e,{size:t,radius:n,transitionDuration:r})=>({root:{"--progress-size":M(t,`progress-size`),"--progress-radius":n===void 0?void 0:re(n),"--progress-transition-duration":typeof r==`number`?`${r}ms`:void 0}})),Pr=h(e=>{let t=u(`ProgressRoot`,null,e),{classNames:n,className:r,style:i,styles:s,unstyled:c,vars:l,autoContrast:d,transitionDuration:f,orientation:p,attributes:m,mod:h,...g}=t,_=a({name:`Progress`,classes:jr,props:t,className:r,style:i,classNames:n,styles:s,unstyled:c,attributes:m,vars:l,varsResolver:Nr});return(0,H.jsx)(kr,{value:{getStyles:_,autoContrast:d},children:(0,H.jsx)(o,{mod:[{orientation:p},h],..._(`root`),...g})})});Pr.classes=jr,Pr.varsResolver=Nr,Pr.displayName=`@mantine/core/ProgressRoot`;var Fr={withAria:!0},Ir=h(e=>{let{classNames:t,className:n,style:r,styles:i,vars:a,value:s,withAria:c,color:d,striped:p,animated:m,mod:h,...g}=u(`ProgressSection`,Fr,e),_=Ar(),v=f(),y=c?{role:`progressbar`,"aria-valuemax":100,"aria-valuemin":0,"aria-valuenow":s,"aria-valuetext":`${s}%`}:{};return(0,H.jsx)(o,{..._.getStyles(`section`,{className:n,classNames:t,styles:i,style:r}),...g,...y,mod:[{striped:p||m,animated:m},h],__vars:{"--progress-section-size":`${s}%`,"--progress-section-color":l(d,v),"--progress-label-color":Yt(_.autoContrast,v)?at({color:d,theme:v,autoContrast:_.autoContrast}):void 0}})});Ir.classes=jr,Ir.displayName=`@mantine/core/ProgressSection`;var Lr=h(e=>{let t=u(`Progress`,null,e),{value:n,classNames:r,styles:i,vars:a,color:o,striped:s,animated:c,"aria-label":l,...d}=t,{resolvedClassNames:f,resolvedStyles:p}=A({classNames:r,styles:i,props:t});return(0,H.jsx)(Pr,{classNames:f,styles:p,vars:a,...d,children:(0,H.jsx)(Ir,{value:n,color:o,striped:s,animated:c,"aria-label":l})})});Lr.classes=jr,Lr.displayName=`@mantine/core/Progress`,Lr.Section=Ir,Lr.Root=Pr,Lr.Label=Mr;var Rr={root:`m_cf365364`,indicator:`m_9e182ccd`,label:`m_1738fcb2`,input:`m_1714d588`,control:`m_69686b9b`,innerLabel:`m_78882f40`},zr={withItemsBorders:!0},Br=g((e,{radius:t,color:n,transitionDuration:r,size:i,transitionTimingFunction:a})=>({root:{"--sc-radius":t===void 0?void 0:re(t),"--sc-color":n?l(n,e):void 0,"--sc-shadow":n?void 0:`var(--mantine-shadow-xs)`,"--sc-transition-duration":r===void 0?void 0:`${r}ms`,"--sc-transition-timing-function":a,"--sc-padding":M(i,`sc-padding`),"--sc-font-size":L(i)}})),Vr=c(e=>{let t=u(`SegmentedControl`,zr,e),{classNames:n,className:r,style:i,styles:s,unstyled:c,vars:l,data:d,value:p,defaultValue:m,onChange:h,size:g,name:_,disabled:v,readOnly:y,fullWidth:b,orientation:x,radius:S,color:C,transitionDuration:w,transitionTimingFunction:T,variant:E,autoContrast:D,withItemsBorders:O,mod:k,attributes:A,ref:j,...M}=t,N=a({name:`SegmentedControl`,props:t,classes:Rr,className:r,style:i,classNames:n,styles:s,unstyled:c,attributes:A,vars:l,varsResolver:Br}),P=f(),I=d.map(e=>Gt(e)?{label:`${e}`,value:e}:e),L=Wt(),[ee,te]=(0,V.useState)(0),[ne,re]=(0,V.useState)(null),[ae,R]=(0,V.useState)({}),oe=(e,t)=>{e!==null&&ae[t]!==e&&(ae[t]=e,R({...ae}))},[z,se]=He({value:p,defaultValue:m,finalValue:Array.isArray(d)?I.find(e=>!e.disabled)?.value??d[0]?.value??null:null,onChange:h}),ce=F(_),le=I.map(e=>`${e.value}`),ue=I.map(e=>(0,V.createElement)(o,{...N(`control`),mod:{active:z===e.value,orientation:x},key:`${e.value}`},(0,V.createElement)(`input`,{...N(`input`),disabled:v||e.disabled,type:`radio`,name:ce,value:`${e.value}`,id:`${ce}-${e.value}`,checked:z===e.value,onChange:()=>!y&&se(e.value),"data-focus-ring":P.focusRing,key:`${e.value}-input`}),(0,V.createElement)(o,{component:`label`,...N(`label`),mod:{active:z===e.value&&!(v||e.disabled),disabled:v||e.disabled,"read-only":y},htmlFor:`${ce}-${e.value}`,ref:t=>oe(t,`${e.value}`),__vars:{"--sc-label-color":C===void 0?void 0:at({color:C,theme:P,autoContrast:D})},key:`${e.value}-label`},(0,H.jsx)(`span`,{...N(`innerLabel`),children:e.label})))),de=ie(j,re);return Bt(()=>{te(e=>e+1)},[d.length]),Bt(()=>{R(e=>{let t={};return le.forEach(n=>{n in e&&(t[n]=e[n])}),Object.keys(t).length===Object.keys(e).length?e:t})},[le]),d.length===0?null:(0,H.jsxs)(o,{...N(`root`),variant:E,size:g,ref:de,mod:[{"full-width":b,orientation:x,initialized:L,"with-items-borders":O},k],...M,role:`radiogroup`,"data-disabled":v,children:[z!==void 0&&(0,H.jsx)(en,{target:ae[`${z}`],parent:ne,component:`span`,transitionDuration:`var(--sc-transition-duration)`,...N(`indicator`)},ee),ue]})});Vr.classes=Rr,Vr.varsResolver=Br,Vr.displayName=`@mantine/core/SegmentedControl`;var Hr={size:`sm`,withCheckIcon:!0,allowDeselect:!0,checkIconPosition:`left`,openOnFocus:!0},Ur=c(e=>{let t=u([`Input`,`InputWrapper`,`Select`],Hr,e),{classNames:n,styles:r,unstyled:i,vars:a,dropdownOpened:o,defaultDropdownOpened:s,onDropdownClose:c,onDropdownOpen:l,onFocus:d,onBlur:f,onClick:p,onChange:m,data:h,value:g,defaultValue:_,selectFirstOptionOnChange:v,selectFirstOptionOnDropdownOpen:y,onOptionSubmit:b,comboboxProps:x,readOnly:S,disabled:C,filter:w,limit:T,withScrollArea:E,maxDropdownHeight:D,floatingHeight:O,size:k,searchable:j,rightSection:M,checkIconPosition:P,withCheckIcon:I,withAlignedLabels:L,nothingFoundMessage:ee,name:te,form:ne,searchValue:re,defaultSearchValue:ie,onSearchChange:ae,allowDeselect:R,error:oe,rightSectionPointerEvents:z,id:se,clearable:ce,clearSectionMode:le,clearButtonProps:ue,hiddenInputProps:de,renderOption:fe,onClear:pe,autoComplete:me,scrollAreaProps:he,__defaultRightSection:ge,__clearSection:_e,__clearable:ve,chevronColor:ye,autoSelectOnBlur:be,openOnFocus:xe,attributes:B,...Se}=t,Ce=(0,V.useMemo)(()=>mn(h),[h]),we=(0,V.useRef)({}),Te=(0,V.useMemo)(()=>hn(Ce),[Ce]),Ee=F(se),De=cr({id:Ee,label:Se.label,labelProps:Se.labelProps,inputWrapperOrder:Se.inputWrapperOrder}),[Oe,ke,Ae]=He({value:g,defaultValue:_,finalValue:null,onChange:m}),je=Oe==null?void 0:`${Oe}`in Te?Te[`${Oe}`]:we.current[`${Oe}`],Me=Ht(je),[Ne,Pe,Fe]=He({value:re,defaultValue:ie,finalValue:je?je.label:``,onChange:ae}),Ie=Un({opened:o,defaultOpened:s,onDropdownOpen:()=>{l?.(),y?Ie.selectFirstOption():Ie.updateSelectedOptionIndex(`active`,{scrollIntoView:!0})},onDropdownClose:()=>{c?.(),setTimeout(Ie.resetSelectedOption,0)}}),Le=e=>{Pe(e),Ie.resetSelectedOption()},{resolvedClassNames:Re,resolvedStyles:ze}=A({props:t,styles:r,classNames:n});(0,V.useEffect)(()=>{v&&Ie.selectFirstOption()},[v,Ne]),(0,V.useEffect)(()=>{g===null&&Le(``),g!=null&&je&&(Me?.value!==je.value||Me?.label!==je.label)&&Le(je.label)},[g,je]),(0,V.useEffect)(()=>{!Ae&&!Fe&&Le(Oe==null?``:`${Oe}`in Te?Te[`${Oe}`]?.label:we.current[`${Oe}`]?.label||``)},[Te,Oe]),(0,V.useEffect)(()=>{Oe&&`${Oe}`in Te&&(we.current[`${Oe}`]=Te[`${Oe}`])},[Te,Oe]);let Be=(0,H.jsx)(Kn.ClearButton,{...ue,onClear:()=>{ke(null,null),Le(``),pe?.()}}),Ve=ce&&Oe!=null&&!C&&!S;return(0,H.jsxs)(H.Fragment,{children:[(0,H.jsxs)(Kn,{store:Ie,__staticSelector:`Select`,classNames:Re,styles:ze,unstyled:i,readOnly:S,size:k,attributes:B,floatingHeight:O,keepMounted:be,onOptionSubmit:e=>{b?.(e);let t=R&&`${Te[e].value}`==`${Oe}`?null:Te[e],n=t?t.value:null;n!==Oe&&ke(n,t),!Ae&&Le(n==null?``:t?.label||``),Ie.closeDropdown()},...x,children:[(0,H.jsx)(Kn.Target,{targetType:j?`input`:`button`,autoComplete:me,withExpandedAttribute:!0,children:(0,H.jsx)(N,{id:Ee,__defaultRightSection:(0,H.jsx)(Kn.Chevron,{size:k,error:oe,unstyled:i,color:ye}),__clearSection:Be,__clearable:Ve,__clearSectionMode:le,rightSection:M,rightSectionPointerEvents:z||`none`,...Se,size:k,__staticSelector:`Select`,disabled:C,readOnly:S||!j,value:Ne,onChange:e=>{if(lr(e)){if(!S){let t=Cr(Te,e.currentTarget.value);t&&`${t.value}`!=`${Oe}`&&(ke(t.value,t),!Ae&&Le(t.label))}return}Le(e.currentTarget.value),Ie.openDropdown(),v&&Ie.selectFirstOption()},onFocus:e=>{xe&&j&&Ie.openDropdown(),d?.(e)},onBlur:e=>{be&&Ie.clickSelectedOption(),Ie.closeDropdown();let t=Oe!=null&&(`${Oe}`in Te?Te[`${Oe}`]:we.current[`${Oe}`]);Le(t&&t.label||``),f?.(e)},onClick:e=>{j?Ie.openDropdown():Ie.toggleDropdown(),p?.(e)},classNames:Re,styles:ze,unstyled:i,pointer:!j,error:oe,attributes:B})}),(0,H.jsx)(rr,{data:Ce,hidden:S||C,filter:w,search:Ne,limit:T,hiddenWhenEmpty:!ee,withScrollArea:E,maxDropdownHeight:D,filterOptions:!!j&&je?.label!==Ne,value:Oe,checkIconPosition:P,withCheckIcon:I,withAlignedLabels:L,nothingFoundMessage:ee,unstyled:i,labelId:De,"aria-label":De?void 0:Se[`aria-label`],renderOption:fe,scrollAreaProps:he})]}),(0,H.jsx)(Kn.HiddenInput,{value:Oe,name:te,form:ne,disabled:C,...de})]})});Ur.classes={...N.classes,...Kn.classes},Ur.displayName=`@mantine/core/Select`;function Wr(e){if(e!==void 0)return typeof e==`number`?P(e):e}function Gr({spacing:e,verticalSpacing:t,cols:n,minColWidth:r,autoRows:i,selector:a}){let o=f(),s=t===void 0?e:t,c=r!==void 0,l=E({"--sg-spacing-x":R(It(e)),"--sg-spacing-y":R(It(s)),"--sg-auto-rows":i,...c?{"--sg-min-col-width":Wr(r)}:{"--sg-cols":It(n)?.toString()}}),u=O(o.breakpoints).reduce((t,r)=>(t[r]||(t[r]={}),typeof e==`object`&&e[r]!==void 0&&(t[r][`--sg-spacing-x`]=R(e[r])),typeof s==`object`&&s[r]!==void 0&&(t[r][`--sg-spacing-y`]=R(s[r])),!c&&typeof n==`object`&&n[r]!==void 0&&(t[r][`--sg-cols`]=n[r]),t),{}),d=rt(O(u),o.breakpoints).filter(e=>O(u[e.value]).length>0).map(e=>({query:`(min-width: ${o.breakpoints[e.value]})`,styles:u[e.value]}));return(0,H.jsx)(j,{styles:l,media:d,selector:a})}function Kr(e){return typeof e==`object`&&e?O(e):[]}function qr(e){return e.sort((e,t)=>Be(e)-Be(t))}function Jr({spacing:e,verticalSpacing:t,cols:n,minColWidth:r}){return qr(Array.from(new Set([...Kr(e),...Kr(t),...r===void 0?Kr(n):[]])))}function Yr({spacing:e,verticalSpacing:t,cols:n,minColWidth:r,autoRows:i,selector:a}){let o=t===void 0?e:t,s=r!==void 0,c=E({"--sg-spacing-x":R(It(e)),"--sg-spacing-y":R(It(o)),"--sg-auto-rows":i,...s?{"--sg-min-col-width":Wr(r)}:{"--sg-cols":It(n)?.toString()}}),l=Jr({spacing:e,verticalSpacing:t,cols:n,minColWidth:r}),u=l.reduce((t,r)=>(t[r]||(t[r]={}),typeof e==`object`&&e[r]!==void 0&&(t[r][`--sg-spacing-x`]=R(e[r])),typeof o==`object`&&o[r]!==void 0&&(t[r][`--sg-spacing-y`]=R(o[r])),!s&&typeof n==`object`&&n[r]!==void 0&&(t[r][`--sg-cols`]=n[r]),t),{}),d=l.map(e=>({query:`simple-grid (min-width: ${e})`,styles:u[e]}));return(0,H.jsx)(j,{styles:c,container:d,selector:a})}var Xr={container:`m_925c2d2c`,root:`m_2415a157`},Zr={cols:1,spacing:`md`,type:`media`},Qr=h(e=>{let t=u(`SimpleGrid`,Zr,e),{classNames:n,className:r,style:i,styles:c,unstyled:l,vars:d,cols:f,verticalSpacing:p,spacing:m,type:h,minColWidth:g,autoFlow:_,autoRows:v,attributes:y,...b}=t,x=a({name:`SimpleGrid`,classes:Xr,props:t,className:r,style:i,classNames:n,styles:c,unstyled:l,attributes:y,vars:d}),S=s(),C=g===void 0?void 0:_||`auto-fill`;return h===`container`?(0,H.jsxs)(H.Fragment,{children:[(0,H.jsx)(Yr,{...t,selector:`.${S}`}),(0,H.jsx)(`div`,{...x(`container`),children:(0,H.jsx)(o,{...x(`root`,{className:S}),...b,"data-auto-cols":C})})]}):(0,H.jsxs)(H.Fragment,{children:[(0,H.jsx)(Gr,{...t,selector:`.${S}`}),(0,H.jsx)(o,{...x(`root`,{className:S}),...b,"data-auto-cols":C})]})});Qr.classes=Xr,Qr.displayName=`@mantine/core/SimpleGrid`;var $r=(0,V.createContext)(null),ei={hiddenInputValuesSeparator:`,`},ti=c((e=>{let{value:t,defaultValue:n,onChange:r,size:i,wrapperProps:a,children:o,readOnly:s,name:c,hiddenInputValuesSeparator:l,hiddenInputProps:d,maxSelectedValues:f,disabled:p,...m}=u(`SwitchGroup`,ei,e),[h,g]=He({value:t,defaultValue:n,finalValue:[],onChange:r}),_=e=>{let t=e.currentTarget.value;if(s)return;let n=h.includes(t);!n&&f&&h.length>=f||g(n?h.filter(e=>e!==t):[...h,t])},v=e=>{if(p)return!0;if(!f)return!1;let t=h.includes(e),n=h.length>=f;return!t&&n},y=h.join(l);return(0,H.jsx)($r,{value:{value:h,onChange:_,size:i,isDisabled:v},children:(0,H.jsxs)(k.Wrapper,{size:i,...a,...m,labelElement:`div`,__staticSelector:`SwitchGroup`,children:[(0,H.jsx)(qn,{role:`group`,children:o}),(0,H.jsx)(`input`,{type:`hidden`,name:c,value:y,...d})]})})}));ti.classes=k.Wrapper.classes,ti.displayName=`@mantine/core/SwitchGroup`;var ni={root:`m_5f93f3bb`,input:`m_926b4011`,track:`m_9307d992`,thumb:`m_93039a1d`,trackLabel:`m_8277e082`},ri={labelPosition:`right`,withThumbIndicator:!0},ii=g((e,{radius:t,color:n,size:r})=>({root:{"--switch-radius":t===void 0?void 0:re(t),"--switch-height":M(r,`switch-height`),"--switch-width":M(r,`switch-width`),"--switch-thumb-size":M(r,`switch-thumb-size`),"--switch-label-font-size":M(r,`switch-label-font-size`),"--switch-track-label-padding":M(r,`switch-track-label-padding`),"--switch-color":n?l(n,e):void 0}})),ai=h(e=>{let t=u(`Switch`,ri,e),{classNames:n,className:r,style:i,styles:s,unstyled:c,vars:l,color:f,label:p,offLabel:m,onLabel:h,id:g,size:_,radius:v,wrapperProps:y,thumbIcon:b,checked:x,defaultChecked:S,onChange:C,labelPosition:w,description:T,error:E,disabled:D,variant:O,rootRef:k,mod:A,withThumbIndicator:j,attributes:M,...N}=t,P=(0,V.use)($r),I=_||P?.size,L=a({name:`Switch`,props:t,classes:ni,className:r,style:i,classNames:n,styles:s,unstyled:c,attributes:M,vars:l,varsResolver:ii}),{styleProps:ee,rest:te}=d(N),ne=F(g),re=[T?`${ne}-description`:void 0,E&&typeof E!=`boolean`?`${ne}-error`:void 0,te[`aria-describedby`]].filter(Boolean).join(` `)||void 0,ie={checked:P?.value.includes(te.value)??x,onChange:e=>{P?.onChange(e),C?.(e)}},ae=D||P?.isDisabled?.(te.value),[R,oe]=He({value:ie.checked??x,defaultValue:S,finalValue:!1});return(0,H.jsxs)(Xn,{...L(`root`),__staticSelector:`Switch`,__stylesApiProps:t,id:ne,size:I,labelPosition:w,label:p,description:T,error:E,disabled:ae,bodyElement:`label`,labelElement:`span`,classNames:n,styles:s,unstyled:c,"data-checked":ie.checked,variant:O,ref:k,mod:A,attributes:M,inert:te.inert,...ee,...y,children:[(0,H.jsx)(`input`,{...te,...ie,disabled:ae,checked:R,"data-checked":ie.checked,onChange:e=>{ie.onChange?.(e),oe(e.currentTarget.checked)},id:ne,type:`checkbox`,role:`switch`,inert:te.inert,"aria-describedby":re,...L(`input`)}),(0,H.jsxs)(o,{"aria-hidden":`true`,component:`span`,mod:{error:E,"label-position":w,"without-labels":!h&&!m},...L(`track`),children:[(0,H.jsx)(o,{component:`span`,mod:{"reduce-motion":!0,"with-thumb-indicator":j&&!b},...L(`thumb`),children:b}),(0,H.jsx)(`span`,{...L(`trackLabel`),children:R?h:m})]})]})});ai.classes={...ni,...Yn},ai.varsResolver=ii,ai.displayName=`@mantine/core/Switch`,ai.Group=ti;var oi=new Map([[`bold`,V.createElement(V.Fragment,null,V.createElement(`path`,{d:`M244,56v48a12,12,0,0,1-12,12H184a12,12,0,1,1,0-24H201.1l-19-17.38c-.13-.12-.26-.24-.38-.37A76,76,0,1,0,127,204h1a75.53,75.53,0,0,0,52.15-20.72,12,12,0,0,1,16.49,17.45A99.45,99.45,0,0,1,128,228h-1.37A100,100,0,1,1,198.51,57.06L220,76.72V56a12,12,0,0,1,24,0Z`}))],[`duotone`,V.createElement(V.Fragment,null,V.createElement(`path`,{d:`M216,128a88,88,0,1,1-88-88A88,88,0,0,1,216,128Z`,opacity:`0.2`}),V.createElement(`path`,{d:`M240,56v48a8,8,0,0,1-8,8H184a8,8,0,0,1,0-16H211.4L184.81,71.64l-.25-.24a80,80,0,1,0-1.67,114.78,8,8,0,0,1,11,11.63A95.44,95.44,0,0,1,128,224h-1.32A96,96,0,1,1,195.75,60L224,85.8V56a8,8,0,1,1,16,0Z`}))],[`fill`,V.createElement(V.Fragment,null,V.createElement(`path`,{d:`M240,56v48a8,8,0,0,1-8,8H184a8,8,0,0,1-5.66-13.66l17-17-10.55-9.65-.25-.24a80,80,0,1,0-1.67,114.78,8,8,0,1,1,11,11.63A95.44,95.44,0,0,1,128,224h-1.32A96,96,0,1,1,195.75,60l10.93,10L226.34,50.3A8,8,0,0,1,240,56Z`}))],[`light`,V.createElement(V.Fragment,null,V.createElement(`path`,{d:`M238,56v48a6,6,0,0,1-6,6H184a6,6,0,0,1,0-12h32.55l-30.38-27.8c-.06-.06-.12-.13-.19-.19a82,82,0,1,0-1.7,117.65,6,6,0,0,1,8.24,8.73A93.46,93.46,0,0,1,128,222h-1.28A94,94,0,1,1,194.37,61.4L226,90.35V56a6,6,0,1,1,12,0Z`}))],[`regular`,V.createElement(V.Fragment,null,V.createElement(`path`,{d:`M240,56v48a8,8,0,0,1-8,8H184a8,8,0,0,1,0-16H211.4L184.81,71.64l-.25-.24a80,80,0,1,0-1.67,114.78,8,8,0,0,1,11,11.63A95.44,95.44,0,0,1,128,224h-1.32A96,96,0,1,1,195.75,60L224,85.8V56a8,8,0,1,1,16,0Z`}))],[`thin`,V.createElement(V.Fragment,null,V.createElement(`path`,{d:`M236,56v48a4,4,0,0,1-4,4H184a4,4,0,0,1,0-8h37.7L187.53,68.69l-.13-.12a84,84,0,1,0-1.75,120.51,4,4,0,0,1,5.5,5.82A91.43,91.43,0,0,1,128,220h-1.26A92,92,0,1,1,193,62.84l35,32.05V56a4,4,0,1,1,8,0Z`}))]]),si=new Map([[`bold`,V.createElement(V.Fragment,null,V.createElement(`path`,{d:`M228,128a100,100,0,0,1-98.66,100H128a99.39,99.39,0,0,1-68.62-27.29,12,12,0,0,1,16.48-17.45,76,76,0,1,0-1.57-109c-.13.13-.25.25-.39.37L54.89,92H72a12,12,0,0,1,0,24H24a12,12,0,0,1-12-12V56a12,12,0,0,1,24,0V76.72L57.48,57.06A100,100,0,0,1,228,128Z`}))],[`duotone`,V.createElement(V.Fragment,null,V.createElement(`path`,{d:`M216,128a88,88,0,1,1-88-88A88,88,0,0,1,216,128Z`,opacity:`0.2`}),V.createElement(`path`,{d:`M224,128a96,96,0,0,1-94.71,96H128A95.38,95.38,0,0,1,62.1,197.8a8,8,0,0,1,11-11.63A80,80,0,1,0,71.43,71.39a3.07,3.07,0,0,1-.26.25L44.59,96H72a8,8,0,0,1,0,16H24a8,8,0,0,1-8-8V56a8,8,0,0,1,16,0V85.8L60.25,60A96,96,0,0,1,224,128Z`}))],[`fill`,V.createElement(V.Fragment,null,V.createElement(`path`,{d:`M224,128a96,96,0,0,1-94.71,96H128A95.38,95.38,0,0,1,62.1,197.8a8,8,0,0,1,11-11.63A80,80,0,1,0,71.43,71.39a3.07,3.07,0,0,1-.26.25L60.63,81.29l17,17A8,8,0,0,1,72,112H24a8,8,0,0,1-8-8V56A8,8,0,0,1,29.66,50.3L49.31,70,60.25,60A96,96,0,0,1,224,128Z`}))],[`light`,V.createElement(V.Fragment,null,V.createElement(`path`,{d:`M222,128a94,94,0,0,1-92.74,94H128a93.43,93.43,0,0,1-64.5-25.65,6,6,0,1,1,8.24-8.72A82,82,0,1,0,70,70l-.19.19L39.44,98H72a6,6,0,0,1,0,12H24a6,6,0,0,1-6-6V56a6,6,0,0,1,12,0V90.34L61.63,61.4A94,94,0,0,1,222,128Z`}))],[`regular`,V.createElement(V.Fragment,null,V.createElement(`path`,{d:`M224,128a96,96,0,0,1-94.71,96H128A95.38,95.38,0,0,1,62.1,197.8a8,8,0,0,1,11-11.63A80,80,0,1,0,71.43,71.39a3.07,3.07,0,0,1-.26.25L44.59,96H72a8,8,0,0,1,0,16H24a8,8,0,0,1-8-8V56a8,8,0,0,1,16,0V85.8L60.25,60A96,96,0,0,1,224,128Z`}))],[`thin`,V.createElement(V.Fragment,null,V.createElement(`path`,{d:`M220,128a92,92,0,0,1-90.77,92H128a91.47,91.47,0,0,1-63.13-25.1,4,4,0,1,1,5.5-5.82A84,84,0,1,0,68.6,68.57l-.13.12L34.3,100H72a4,4,0,0,1,0,8H24a4,4,0,0,1-4-4V56a4,4,0,0,1,8,0V94.89l35-32A92,92,0,0,1,220,128Z`}))]]),ci=new Map([[`bold`,V.createElement(V.Fragment,null,V.createElement(`path`,{d:`M220,48V96a12,12,0,0,1-24,0V77l-35.51,35.52a12,12,0,0,1-17-17L179,60H160a12,12,0,0,1,0-24h48A12,12,0,0,1,220,48ZM95.51,143.51,60,179V160a12,12,0,0,0-24,0v48a12,12,0,0,0,12,12H96a12,12,0,0,0,0-24H77l35.52-35.51a12,12,0,0,0-17-17ZM208,148a12,12,0,0,0-12,12v19l-35.51-35.52a12,12,0,0,0-17,17L179,196H160a12,12,0,0,0,0,24h48a12,12,0,0,0,12-12V160A12,12,0,0,0,208,148ZM77,60H96a12,12,0,0,0,0-24H48A12,12,0,0,0,36,48V96a12,12,0,0,0,24,0V77l35.51,35.52a12,12,0,0,0,17-17Z`}))],[`duotone`,V.createElement(V.Fragment,null,V.createElement(`path`,{d:`M208,48V208H48V48Z`,opacity:`0.2`}),V.createElement(`path`,{d:`M216,48V96a8,8,0,0,1-16,0V67.31l-42.34,42.35a8,8,0,0,1-11.32-11.32L188.69,56H160a8,8,0,0,1,0-16h48A8,8,0,0,1,216,48ZM98.34,146.34,56,188.69V160a8,8,0,0,0-16,0v48a8,8,0,0,0,8,8H96a8,8,0,0,0,0-16H67.31l42.35-42.34a8,8,0,0,0-11.32-11.32ZM208,152a8,8,0,0,0-8,8v28.69l-42.34-42.35a8,8,0,0,0-11.32,11.32L188.69,200H160a8,8,0,0,0,0,16h48a8,8,0,0,0,8-8V160A8,8,0,0,0,208,152ZM67.31,56H96a8,8,0,0,0,0-16H48a8,8,0,0,0-8,8V96a8,8,0,0,0,16,0V67.31l42.34,42.35a8,8,0,0,0,11.32-11.32Z`}))],[`fill`,V.createElement(V.Fragment,null,V.createElement(`path`,{d:`M109.66,146.34a8,8,0,0,1,0,11.32L83.31,184l18.35,18.34A8,8,0,0,1,96,216H48a8,8,0,0,1-8-8V160a8,8,0,0,1,13.66-5.66L72,172.69l26.34-26.35A8,8,0,0,1,109.66,146.34ZM83.31,72l18.35-18.34A8,8,0,0,0,96,40H48a8,8,0,0,0-8,8V96a8,8,0,0,0,13.66,5.66L72,83.31l26.34,26.35a8,8,0,0,0,11.32-11.32ZM208,40H160a8,8,0,0,0-5.66,13.66L172.69,72,146.34,98.34a8,8,0,0,0,11.32,11.32L184,83.31l18.34,18.35A8,8,0,0,0,216,96V48A8,8,0,0,0,208,40Zm3.06,112.61a8,8,0,0,0-8.72,1.73L184,172.69l-26.34-26.35a8,8,0,0,0-11.32,11.32L172.69,184l-18.35,18.34A8,8,0,0,0,160,216h48a8,8,0,0,0,8-8V160A8,8,0,0,0,211.06,152.61Z`}))],[`light`,V.createElement(V.Fragment,null,V.createElement(`path`,{d:`M214,48V96a6,6,0,0,1-12,0V62.48l-45.76,45.76a6,6,0,0,1-8.48-8.48L193.52,54H160a6,6,0,0,1,0-12h48A6,6,0,0,1,214,48ZM99.76,147.76,54,193.52V160a6,6,0,0,0-12,0v48a6,6,0,0,0,6,6H96a6,6,0,0,0,0-12H62.48l45.76-45.76a6,6,0,0,0-8.48-8.48ZM208,154a6,6,0,0,0-6,6v33.52l-45.76-45.76a6,6,0,0,0-8.48,8.48L193.52,202H160a6,6,0,0,0,0,12h48a6,6,0,0,0,6-6V160A6,6,0,0,0,208,154ZM62.48,54H96a6,6,0,0,0,0-12H48a6,6,0,0,0-6,6V96a6,6,0,0,0,12,0V62.48l45.76,45.76a6,6,0,0,0,8.48-8.48Z`}))],[`regular`,V.createElement(V.Fragment,null,V.createElement(`path`,{d:`M216,48V96a8,8,0,0,1-16,0V67.31l-42.34,42.35a8,8,0,0,1-11.32-11.32L188.69,56H160a8,8,0,0,1,0-16h48A8,8,0,0,1,216,48ZM98.34,146.34,56,188.69V160a8,8,0,0,0-16,0v48a8,8,0,0,0,8,8H96a8,8,0,0,0,0-16H67.31l42.35-42.34a8,8,0,0,0-11.32-11.32ZM208,152a8,8,0,0,0-8,8v28.69l-42.34-42.35a8,8,0,0,0-11.32,11.32L188.69,200H160a8,8,0,0,0,0,16h48a8,8,0,0,0,8-8V160A8,8,0,0,0,208,152ZM67.31,56H96a8,8,0,0,0,0-16H48a8,8,0,0,0-8,8V96a8,8,0,0,0,16,0V67.31l42.34,42.35a8,8,0,0,0,11.32-11.32Z`}))],[`thin`,V.createElement(V.Fragment,null,V.createElement(`path`,{d:`M212,48V96a4,4,0,0,1-8,0V57.66l-49.17,49.17a4,4,0,0,1-5.66-5.66L198.34,52H160a4,4,0,0,1,0-8h48A4,4,0,0,1,212,48ZM101.17,149.17,52,198.34V160a4,4,0,0,0-8,0v48a4,4,0,0,0,4,4H96a4,4,0,0,0,0-8H57.66l49.17-49.17a4,4,0,0,0-5.66-5.66ZM208,156a4,4,0,0,0-4,4v38.34l-49.17-49.17a4,4,0,0,0-5.66,5.66L198.34,204H160a4,4,0,0,0,0,8h48a4,4,0,0,0,4-4V160A4,4,0,0,0,208,156ZM57.66,52H96a4,4,0,0,0,0-8H48a4,4,0,0,0-4,4V96a4,4,0,0,0,8,0V57.66l49.17,49.17a4,4,0,0,0,5.66-5.66Z`}))]]),li=new Map([[`bold`,V.createElement(V.Fragment,null,V.createElement(`path`,{d:`M216.49,168.49a12,12,0,0,1-17,0L128,97,56.49,168.49a12,12,0,0,1-17-17l80-80a12,12,0,0,1,17,0l80,80A12,12,0,0,1,216.49,168.49Z`}))],[`duotone`,V.createElement(V.Fragment,null,V.createElement(`path`,{d:`M208,160H48l80-80Z`,opacity:`0.2`}),V.createElement(`path`,{d:`M213.66,154.34l-80-80a8,8,0,0,0-11.32,0l-80,80A8,8,0,0,0,48,168H208a8,8,0,0,0,5.66-13.66ZM67.31,152,128,91.31,188.69,152Z`}))],[`fill`,V.createElement(V.Fragment,null,V.createElement(`path`,{d:`M215.39,163.06A8,8,0,0,1,208,168H48a8,8,0,0,1-5.66-13.66l80-80a8,8,0,0,1,11.32,0l80,80A8,8,0,0,1,215.39,163.06Z`}))],[`light`,V.createElement(V.Fragment,null,V.createElement(`path`,{d:`M212.24,164.24a6,6,0,0,1-8.48,0L128,88.49,52.24,164.24a6,6,0,0,1-8.48-8.48l80-80a6,6,0,0,1,8.48,0l80,80A6,6,0,0,1,212.24,164.24Z`}))],[`regular`,V.createElement(V.Fragment,null,V.createElement(`path`,{d:`M213.66,165.66a8,8,0,0,1-11.32,0L128,91.31,53.66,165.66a8,8,0,0,1-11.32-11.32l80-80a8,8,0,0,1,11.32,0l80,80A8,8,0,0,1,213.66,165.66Z`}))],[`thin`,V.createElement(V.Fragment,null,V.createElement(`path`,{d:`M210.83,162.83a4,4,0,0,1-5.66,0L128,85.66,50.83,162.83a4,4,0,0,1-5.66-5.66l80-80a4,4,0,0,1,5.66,0l80,80A4,4,0,0,1,210.83,162.83Z`}))]]),ui=new Map([[`bold`,V.createElement(V.Fragment,null,V.createElement(`path`,{d:`M172,108a12,12,0,0,1-12,12H96a12,12,0,0,1,0-24h64A12,12,0,0,1,172,108Zm-12,28H96a12,12,0,0,0,0,24h64a12,12,0,0,0,0-24Zm76-8A108,108,0,0,1,78.77,224.15L46.34,235A20,20,0,0,1,21,209.66l10.81-32.43A108,108,0,1,1,236,128Zm-24,0A84,84,0,1,0,55.27,170.06a12,12,0,0,1,1,9.81l-9.93,29.79,29.79-9.93a12.1,12.1,0,0,1,3.8-.62,12,12,0,0,1,6,1.62A84,84,0,0,0,212,128Z`}))],[`duotone`,V.createElement(V.Fragment,null,V.createElement(`path`,{d:`M224,128A96,96,0,0,1,79.93,211.11h0L42.54,223.58a8,8,0,0,1-10.12-10.12l12.47-37.39h0A96,96,0,1,1,224,128Z`,opacity:`0.2`}),V.createElement(`path`,{d:`M128,24A104,104,0,0,0,36.18,176.88L24.83,210.93a16,16,0,0,0,20.24,20.24l34.05-11.35A104,104,0,1,0,128,24Zm0,192a87.87,87.87,0,0,1-44.06-11.81,8,8,0,0,0-4-1.08,7.85,7.85,0,0,0-2.53.42L40,216,52.47,178.6a8,8,0,0,0-.66-6.54A88,88,0,1,1,128,216Zm40-104a8,8,0,0,1-8,8H96a8,8,0,0,1,0-16h64A8,8,0,0,1,168,112Zm0,32a8,8,0,0,1-8,8H96a8,8,0,0,1,0-16h64A8,8,0,0,1,168,144Z`}))],[`fill`,V.createElement(V.Fragment,null,V.createElement(`path`,{d:`M128,24A104,104,0,0,0,36.18,176.88L24.83,210.93a16,16,0,0,0,20.24,20.24l34.05-11.35A104,104,0,1,0,128,24Zm32,128H96a8,8,0,0,1,0-16h64a8,8,0,0,1,0,16Zm0-32H96a8,8,0,0,1,0-16h64a8,8,0,0,1,0,16Z`}))],[`light`,V.createElement(V.Fragment,null,V.createElement(`path`,{d:`M166,112a6,6,0,0,1-6,6H96a6,6,0,0,1,0-12h64A6,6,0,0,1,166,112Zm-6,26H96a6,6,0,0,0,0,12h64a6,6,0,0,0,0-12Zm70-10A102,102,0,0,1,79.31,217.65L44.44,229.27a14,14,0,0,1-17.71-17.71l11.62-34.87A102,102,0,1,1,230,128Zm-12,0A90,90,0,1,0,50.08,173.06a6,6,0,0,1,.5,4.91L38.12,215.35a2,2,0,0,0,2.53,2.53L78,205.42a6.2,6.2,0,0,1,1.9-.31,6.09,6.09,0,0,1,3,.81A90,90,0,0,0,218,128Z`}))],[`regular`,V.createElement(V.Fragment,null,V.createElement(`path`,{d:`M168,112a8,8,0,0,1-8,8H96a8,8,0,0,1,0-16h64A8,8,0,0,1,168,112Zm-8,24H96a8,8,0,0,0,0,16h64a8,8,0,0,0,0-16Zm72-8A104,104,0,0,1,79.12,219.82L45.07,231.17a16,16,0,0,1-20.24-20.24l11.35-34.05A104,104,0,1,1,232,128Zm-16,0A88,88,0,1,0,51.81,172.06a8,8,0,0,1,.66,6.54L40,216,77.4,203.53a7.85,7.85,0,0,1,2.53-.42,8,8,0,0,1,4,1.08A88,88,0,0,0,216,128Z`}))],[`thin`,V.createElement(V.Fragment,null,V.createElement(`path`,{d:`M164,112a4,4,0,0,1-4,4H96a4,4,0,0,1,0-8h64A4,4,0,0,1,164,112Zm-4,28H96a4,4,0,0,0,0,8h64a4,4,0,0,0,0-8Zm68-12A100,100,0,0,1,79.5,215.47l-35.69,11.9a12,12,0,0,1-15.18-15.18l11.9-35.69A100,100,0,1,1,228,128Zm-8,0A92,92,0,1,0,48.35,174.07a4,4,0,0,1,.33,3.27L36.22,214.72a4,4,0,0,0,5.06,5.06l37.38-12.46a3.93,3.93,0,0,1,1.27-.21,4.05,4.05,0,0,1,2,.54A92,92,0,0,0,220,128Z`}))]]),di=new Map([[`bold`,V.createElement(V.Fragment,null,V.createElement(`path`,{d:`M128,20A108,108,0,1,0,236,128,108.12,108.12,0,0,0,128,20Zm0,192a84,84,0,1,1,84-84A84.09,84.09,0,0,1,128,212Zm68-84a12,12,0,0,1-12,12H128a12,12,0,0,1-12-12V72a12,12,0,0,1,24,0v44h44A12,12,0,0,1,196,128Z`}))],[`duotone`,V.createElement(V.Fragment,null,V.createElement(`path`,{d:`M224,128a96,96,0,1,1-96-96A96,96,0,0,1,224,128Z`,opacity:`0.2`}),V.createElement(`path`,{d:`M128,24A104,104,0,1,0,232,128,104.11,104.11,0,0,0,128,24Zm0,192a88,88,0,1,1,88-88A88.1,88.1,0,0,1,128,216Zm64-88a8,8,0,0,1-8,8H128a8,8,0,0,1-8-8V72a8,8,0,0,1,16,0v48h48A8,8,0,0,1,192,128Z`}))],[`fill`,V.createElement(V.Fragment,null,V.createElement(`path`,{d:`M128,24A104,104,0,1,0,232,128,104.11,104.11,0,0,0,128,24Zm56,112H128a8,8,0,0,1-8-8V72a8,8,0,0,1,16,0v48h48a8,8,0,0,1,0,16Z`}))],[`light`,V.createElement(V.Fragment,null,V.createElement(`path`,{d:`M128,26A102,102,0,1,0,230,128,102.12,102.12,0,0,0,128,26Zm0,192a90,90,0,1,1,90-90A90.1,90.1,0,0,1,128,218Zm62-90a6,6,0,0,1-6,6H128a6,6,0,0,1-6-6V72a6,6,0,0,1,12,0v50h50A6,6,0,0,1,190,128Z`}))],[`regular`,V.createElement(V.Fragment,null,V.createElement(`path`,{d:`M128,24A104,104,0,1,0,232,128,104.11,104.11,0,0,0,128,24Zm0,192a88,88,0,1,1,88-88A88.1,88.1,0,0,1,128,216Zm64-88a8,8,0,0,1-8,8H128a8,8,0,0,1-8-8V72a8,8,0,0,1,16,0v48h48A8,8,0,0,1,192,128Z`}))],[`thin`,V.createElement(V.Fragment,null,V.createElement(`path`,{d:`M128,28A100,100,0,1,0,228,128,100.11,100.11,0,0,0,128,28Zm0,192a92,92,0,1,1,92-92A92.1,92.1,0,0,1,128,220Zm60-92a4,4,0,0,1-4,4H128a4,4,0,0,1-4-4V72a4,4,0,0,1,8,0v52h52A4,4,0,0,1,188,128Z`}))]]),fi=new Map([[`bold`,V.createElement(V.Fragment,null,V.createElement(`path`,{d:`M140,80v41.21l34.17,20.5a12,12,0,1,1-12.34,20.58l-40-24A12,12,0,0,1,116,128V80a12,12,0,0,1,24,0ZM128,28A99.38,99.38,0,0,0,57.24,57.34c-4.69,4.74-9,9.37-13.24,14V64a12,12,0,0,0-24,0v40a12,12,0,0,0,12,12H72a12,12,0,0,0,0-24H57.77C63,86,68.37,80.22,74.26,74.26a76,76,0,1,1,1.58,109,12,12,0,0,0-16.48,17.46A100,100,0,1,0,128,28Z`}))],[`duotone`,V.createElement(V.Fragment,null,V.createElement(`path`,{d:`M216,128a88,88,0,1,1-88-88A88,88,0,0,1,216,128Z`,opacity:`0.2`}),V.createElement(`path`,{d:`M136,80v43.47l36.12,21.67a8,8,0,0,1-8.24,13.72l-40-24A8,8,0,0,1,120,128V80a8,8,0,0,1,16,0Zm-8-48A95.44,95.44,0,0,0,60.08,60.15C52.81,67.51,46.35,74.59,40,82V64a8,8,0,0,0-16,0v40a8,8,0,0,0,8,8H72a8,8,0,0,0,0-16H49c7.15-8.42,14.27-16.35,22.39-24.57a80,80,0,1,1,1.66,114.75,8,8,0,1,0-11,11.64A96,96,0,1,0,128,32Z`}))],[`fill`,V.createElement(V.Fragment,null,V.createElement(`path`,{d:`M224,128A96,96,0,0,1,62.11,197.82a8,8,0,1,1,11-11.64A80,80,0,1,0,71.43,71.43C67.9,75,64.58,78.51,61.35,82L77.66,98.34A8,8,0,0,1,72,112H32a8,8,0,0,1-8-8V64a8,8,0,0,1,13.66-5.66L50,70.7c3.22-3.49,6.54-7,10.06-10.55A96,96,0,0,1,224,128ZM128,72a8,8,0,0,0-8,8v48a8,8,0,0,0,3.88,6.86l40,24a8,8,0,1,0,8.24-13.72L136,123.47V80A8,8,0,0,0,128,72Z`}))],[`light`,V.createElement(V.Fragment,null,V.createElement(`path`,{d:`M134,80v44.6l37.09,22.25a6,6,0,0,1-6.18,10.3l-40-24A6,6,0,0,1,122,128V80a6,6,0,0,1,12,0Zm-6-46A93.4,93.4,0,0,0,61.51,61.56c-8.58,8.68-16,17-23.51,25.8V64a6,6,0,0,0-12,0v40a6,6,0,0,0,6,6H72a6,6,0,0,0,0-12H44.73C52.86,88.29,60.79,79.35,70,70a82,82,0,1,1,1.7,117.62,6,6,0,1,0-8.24,8.72A94,94,0,1,0,128,34Z`}))],[`regular`,V.createElement(V.Fragment,null,V.createElement(`path`,{d:`M136,80v43.47l36.12,21.67a8,8,0,0,1-8.24,13.72l-40-24A8,8,0,0,1,120,128V80a8,8,0,0,1,16,0Zm-8-48A95.44,95.44,0,0,0,60.08,60.15C52.81,67.51,46.35,74.59,40,82V64a8,8,0,0,0-16,0v40a8,8,0,0,0,8,8H72a8,8,0,0,0,0-16H49c7.15-8.42,14.27-16.35,22.39-24.57a80,80,0,1,1,1.66,114.75,8,8,0,1,0-11,11.64A96,96,0,1,0,128,32Z`}))],[`thin`,V.createElement(V.Fragment,null,V.createElement(`path`,{d:`M132,80v45.74l38.06,22.83a4,4,0,0,1-4.12,6.86l-40-24A4,4,0,0,1,124,128V80a4,4,0,0,1,8,0Zm-4-44A91.42,91.42,0,0,0,62.93,63C53.05,73,44.66,82.47,36,92.86V64a4,4,0,0,0-8,0v40a4,4,0,0,0,4,4H72a4,4,0,0,0,0-8H40.47C49.61,89,58.3,79,68.6,68.6a84,84,0,1,1,1.75,120.49,4,4,0,1,0-5.5,5.82A92,92,0,1,0,128,36Z`}))]]),pi=new Map([[`bold`,V.createElement(V.Fragment,null,V.createElement(`path`,{d:`M108,84a16,16,0,1,1,16,16A16,16,0,0,1,108,84Zm128,44A108,108,0,1,1,128,20,108.12,108.12,0,0,1,236,128Zm-24,0a84,84,0,1,0-84,84A84.09,84.09,0,0,0,212,128Zm-72,36.68V132a20,20,0,0,0-20-20,12,12,0,0,0-4,23.32V168a20,20,0,0,0,20,20,12,12,0,0,0,4-23.32Z`}))],[`duotone`,V.createElement(V.Fragment,null,V.createElement(`path`,{d:`M224,128a96,96,0,1,1-96-96A96,96,0,0,1,224,128Z`,opacity:`0.2`}),V.createElement(`path`,{d:`M144,176a8,8,0,0,1-8,8,16,16,0,0,1-16-16V128a8,8,0,0,1,0-16,16,16,0,0,1,16,16v40A8,8,0,0,1,144,176Zm88-48A104,104,0,1,1,128,24,104.11,104.11,0,0,1,232,128Zm-16,0a88,88,0,1,0-88,88A88.1,88.1,0,0,0,216,128ZM124,96a12,12,0,1,0-12-12A12,12,0,0,0,124,96Z`}))],[`fill`,V.createElement(V.Fragment,null,V.createElement(`path`,{d:`M128,24A104,104,0,1,0,232,128,104.11,104.11,0,0,0,128,24Zm-4,48a12,12,0,1,1-12,12A12,12,0,0,1,124,72Zm12,112a16,16,0,0,1-16-16V128a8,8,0,0,1,0-16,16,16,0,0,1,16,16v40a8,8,0,0,1,0,16Z`}))],[`light`,V.createElement(V.Fragment,null,V.createElement(`path`,{d:`M142,176a6,6,0,0,1-6,6,14,14,0,0,1-14-14V128a2,2,0,0,0-2-2,6,6,0,0,1,0-12,14,14,0,0,1,14,14v40a2,2,0,0,0,2,2A6,6,0,0,1,142,176ZM124,94a10,10,0,1,0-10-10A10,10,0,0,0,124,94Zm106,34A102,102,0,1,1,128,26,102.12,102.12,0,0,1,230,128Zm-12,0a90,90,0,1,0-90,90A90.1,90.1,0,0,0,218,128Z`}))],[`regular`,V.createElement(V.Fragment,null,V.createElement(`path`,{d:`M128,24A104,104,0,1,0,232,128,104.11,104.11,0,0,0,128,24Zm0,192a88,88,0,1,1,88-88A88.1,88.1,0,0,1,128,216Zm16-40a8,8,0,0,1-8,8,16,16,0,0,1-16-16V128a8,8,0,0,1,0-16,16,16,0,0,1,16,16v40A8,8,0,0,1,144,176ZM112,84a12,12,0,1,1,12,12A12,12,0,0,1,112,84Z`}))],[`thin`,V.createElement(V.Fragment,null,V.createElement(`path`,{d:`M140,176a4,4,0,0,1-4,4,12,12,0,0,1-12-12V128a4,4,0,0,0-4-4,4,4,0,0,1,0-8,12,12,0,0,1,12,12v40a4,4,0,0,0,4,4A4,4,0,0,1,140,176ZM124,92a8,8,0,1,0-8-8A8,8,0,0,0,124,92Zm104,36A100,100,0,1,1,128,28,100.11,100.11,0,0,1,228,128Zm-8,0a92,92,0,1,0-92,92A92.1,92.1,0,0,0,220,128Z`}))]]),mi=new Map([[`bold`,V.createElement(V.Fragment,null,V.createElement(`path`,{d:`M224,44H32A20,20,0,0,0,12,64V192a20,20,0,0,0,20,20H224a20,20,0,0,0,20-20V64A20,20,0,0,0,224,44Zm-4,144H36V68H220ZM52,128a12,12,0,0,1,12-12H192a12,12,0,0,1,0,24H64A12,12,0,0,1,52,128Zm0-36A12,12,0,0,1,64,80H192a12,12,0,0,1,0,24H64A12,12,0,0,1,52,92Zm0,72a12,12,0,0,1,12-12h8a12,12,0,0,1,0,24H64A12,12,0,0,1,52,164Zm108,0a12,12,0,0,1-12,12H108a12,12,0,0,1,0-24h40A12,12,0,0,1,160,164Zm44,0a12,12,0,0,1-12,12h-8a12,12,0,0,1,0-24h8A12,12,0,0,1,204,164Z`}))],[`duotone`,V.createElement(V.Fragment,null,V.createElement(`path`,{d:`M232,64V192a8,8,0,0,1-8,8H32a8,8,0,0,1-8-8V64a8,8,0,0,1,8-8H224A8,8,0,0,1,232,64Z`,opacity:`0.2`}),V.createElement(`path`,{d:`M224,48H32A16,16,0,0,0,16,64V192a16,16,0,0,0,16,16H224a16,16,0,0,0,16-16V64A16,16,0,0,0,224,48Zm0,144H32V64H224V192Zm-16-64a8,8,0,0,1-8,8H56a8,8,0,0,1,0-16H200A8,8,0,0,1,208,128Zm0-32a8,8,0,0,1-8,8H56a8,8,0,0,1,0-16H200A8,8,0,0,1,208,96ZM72,160a8,8,0,0,1-8,8H56a8,8,0,0,1,0-16h8A8,8,0,0,1,72,160Zm96,0a8,8,0,0,1-8,8H96a8,8,0,0,1,0-16h64A8,8,0,0,1,168,160Zm40,0a8,8,0,0,1-8,8h-8a8,8,0,0,1,0-16h8A8,8,0,0,1,208,160Z`}))],[`fill`,V.createElement(V.Fragment,null,V.createElement(`path`,{d:`M224,48H32A16,16,0,0,0,16,64V192a16,16,0,0,0,16,16H224a16,16,0,0,0,16-16V64A16,16,0,0,0,224,48ZM64,168H48a8,8,0,0,1,0-16H64a8,8,0,0,1,0,16Zm96,0H96a8,8,0,0,1,0-16h64a8,8,0,0,1,0,16Zm48,0H192a8,8,0,0,1,0-16h16a8,8,0,0,1,0,16Zm0-32H48a8,8,0,0,1,0-16H208a8,8,0,0,1,0,16Zm0-32H48a8,8,0,0,1,0-16H208a8,8,0,0,1,0,16Z`}))],[`light`,V.createElement(V.Fragment,null,V.createElement(`path`,{d:`M224,50H32A14,14,0,0,0,18,64V192a14,14,0,0,0,14,14H224a14,14,0,0,0,14-14V64A14,14,0,0,0,224,50Zm2,142a2,2,0,0,1-2,2H32a2,2,0,0,1-2-2V64a2,2,0,0,1,2-2H224a2,2,0,0,1,2,2Zm-20-64a6,6,0,0,1-6,6H56a6,6,0,0,1,0-12H200A6,6,0,0,1,206,128Zm0-32a6,6,0,0,1-6,6H56a6,6,0,0,1,0-12H200A6,6,0,0,1,206,96ZM70,160a6,6,0,0,1-6,6H56a6,6,0,0,1,0-12h8A6,6,0,0,1,70,160Zm96,0a6,6,0,0,1-6,6H96a6,6,0,0,1,0-12h64A6,6,0,0,1,166,160Zm40,0a6,6,0,0,1-6,6h-8a6,6,0,0,1,0-12h8A6,6,0,0,1,206,160Z`}))],[`regular`,V.createElement(V.Fragment,null,V.createElement(`path`,{d:`M224,48H32A16,16,0,0,0,16,64V192a16,16,0,0,0,16,16H224a16,16,0,0,0,16-16V64A16,16,0,0,0,224,48Zm0,144H32V64H224V192Zm-16-64a8,8,0,0,1-8,8H56a8,8,0,0,1,0-16H200A8,8,0,0,1,208,128Zm0-32a8,8,0,0,1-8,8H56a8,8,0,0,1,0-16H200A8,8,0,0,1,208,96ZM72,160a8,8,0,0,1-8,8H56a8,8,0,0,1,0-16h8A8,8,0,0,1,72,160Zm96,0a8,8,0,0,1-8,8H96a8,8,0,0,1,0-16h64A8,8,0,0,1,168,160Zm40,0a8,8,0,0,1-8,8h-8a8,8,0,0,1,0-16h8A8,8,0,0,1,208,160Z`}))],[`thin`,V.createElement(V.Fragment,null,V.createElement(`path`,{d:`M224,52H32A12,12,0,0,0,20,64V192a12,12,0,0,0,12,12H224a12,12,0,0,0,12-12V64A12,12,0,0,0,224,52Zm4,140a4,4,0,0,1-4,4H32a4,4,0,0,1-4-4V64a4,4,0,0,1,4-4H224a4,4,0,0,1,4,4Zm-24-64a4,4,0,0,1-4,4H56a4,4,0,0,1,0-8H200A4,4,0,0,1,204,128Zm0-32a4,4,0,0,1-4,4H56a4,4,0,0,1,0-8H200A4,4,0,0,1,204,96ZM68,160a4,4,0,0,1-4,4H56a4,4,0,0,1,0-8h8A4,4,0,0,1,68,160Zm96,0a4,4,0,0,1-4,4H96a4,4,0,0,1,0-8h64A4,4,0,0,1,164,160Zm40,0a4,4,0,0,1-4,4h-8a4,4,0,0,1,0-8h8A4,4,0,0,1,204,160Z`}))]]),hi=new Map([[`bold`,V.createElement(V.Fragment,null,V.createElement(`path`,{d:`M76,64A12,12,0,0,1,88,52H216a12,12,0,0,1,0,24H88A12,12,0,0,1,76,64Zm140,52H88a12,12,0,0,0,0,24H216a12,12,0,0,0,0-24Zm0,64H88a12,12,0,0,0,0,24H216a12,12,0,0,0,0-24ZM44,112a16,16,0,1,0,16,16A16,16,0,0,0,44,112Zm0-64A16,16,0,1,0,60,64,16,16,0,0,0,44,48Zm0,128a16,16,0,1,0,16,16A16,16,0,0,0,44,176Z`}))],[`duotone`,V.createElement(V.Fragment,null,V.createElement(`path`,{d:`M216,64V192H88V64Z`,opacity:`0.2`}),V.createElement(`path`,{d:`M80,64a8,8,0,0,1,8-8H216a8,8,0,0,1,0,16H88A8,8,0,0,1,80,64Zm136,56H88a8,8,0,1,0,0,16H216a8,8,0,0,0,0-16Zm0,64H88a8,8,0,1,0,0,16H216a8,8,0,0,0,0-16ZM44,52A12,12,0,1,0,56,64,12,12,0,0,0,44,52Zm0,64a12,12,0,1,0,12,12A12,12,0,0,0,44,116Zm0,64a12,12,0,1,0,12,12A12,12,0,0,0,44,180Z`}))],[`fill`,V.createElement(V.Fragment,null,V.createElement(`path`,{d:`M208,32H48A16,16,0,0,0,32,48V208a16,16,0,0,0,16,16H208a16,16,0,0,0,16-16V48A16,16,0,0,0,208,32ZM68,188a12,12,0,1,1,12-12A12,12,0,0,1,68,188Zm0-48a12,12,0,1,1,12-12A12,12,0,0,1,68,140Zm0-48A12,12,0,1,1,80,80,12,12,0,0,1,68,92Zm124,92H104a8,8,0,0,1,0-16h88a8,8,0,0,1,0,16Zm0-48H104a8,8,0,0,1,0-16h88a8,8,0,0,1,0,16Zm0-48H104a8,8,0,0,1,0-16h88a8,8,0,0,1,0,16Z`}))],[`light`,V.createElement(V.Fragment,null,V.createElement(`path`,{d:`M82,64a6,6,0,0,1,6-6H216a6,6,0,0,1,0,12H88A6,6,0,0,1,82,64Zm134,58H88a6,6,0,0,0,0,12H216a6,6,0,0,0,0-12Zm0,64H88a6,6,0,0,0,0,12H216a6,6,0,0,0,0-12ZM44,54A10,10,0,1,0,54,64,10,10,0,0,0,44,54Zm0,128a10,10,0,1,0,10,10A10,10,0,0,0,44,182Zm0-64a10,10,0,1,0,10,10A10,10,0,0,0,44,118Z`}))],[`regular`,V.createElement(V.Fragment,null,V.createElement(`path`,{d:`M80,64a8,8,0,0,1,8-8H216a8,8,0,0,1,0,16H88A8,8,0,0,1,80,64Zm136,56H88a8,8,0,0,0,0,16H216a8,8,0,0,0,0-16Zm0,64H88a8,8,0,0,0,0,16H216a8,8,0,0,0,0-16ZM44,52A12,12,0,1,0,56,64,12,12,0,0,0,44,52Zm0,64a12,12,0,1,0,12,12A12,12,0,0,0,44,116Zm0,64a12,12,0,1,0,12,12A12,12,0,0,0,44,180Z`}))],[`thin`,V.createElement(V.Fragment,null,V.createElement(`path`,{d:`M84,64a4,4,0,0,1,4-4H216a4,4,0,0,1,0,8H88A4,4,0,0,1,84,64Zm132,60H88a4,4,0,0,0,0,8H216a4,4,0,0,0,0-8Zm0,64H88a4,4,0,0,0,0,8H216a4,4,0,0,0,0-8ZM44,120a8,8,0,1,0,8,8A8,8,0,0,0,44,120Zm0-64a8,8,0,1,0,8,8A8,8,0,0,0,44,56Zm0,128a8,8,0,1,0,8,8A8,8,0,0,0,44,184Z`}))]]),gi=new Map([[`bold`,V.createElement(V.Fragment,null,V.createElement(`path`,{d:`M28,64A12,12,0,0,1,40,52H216a12,12,0,0,1,0,24H40A12,12,0,0,1,28,64Zm12,76h64a12,12,0,0,0,0-24H40a12,12,0,0,0,0,24Zm80,40H40a12,12,0,0,0,0,24h80a12,12,0,0,0,0-24Zm120.49,20.49a12,12,0,0,1-17,0l-18.08-18.08a44,44,0,1,1,17-17l18.08,18.07A12,12,0,0,1,240.49,200.49ZM184,164a20,20,0,1,0-20-20A20,20,0,0,0,184,164Z`}))],[`duotone`,V.createElement(V.Fragment,null,V.createElement(`path`,{d:`M216,144a32,32,0,1,1-32-32A32,32,0,0,1,216,144Z`,opacity:`0.2`}),V.createElement(`path`,{d:`M32,64a8,8,0,0,1,8-8H216a8,8,0,0,1,0,16H40A8,8,0,0,1,32,64Zm8,72h72a8,8,0,0,0,0-16H40a8,8,0,0,0,0,16Zm88,48H40a8,8,0,0,0,0,16h88a8,8,0,0,0,0-16Zm109.66,13.66a8,8,0,0,1-11.32,0L206,177.36A40,40,0,1,1,217.36,166l20.3,20.3A8,8,0,0,1,237.66,197.66ZM184,168a24,24,0,1,0-24-24A24,24,0,0,0,184,168Z`}))],[`fill`,V.createElement(V.Fragment,null,V.createElement(`path`,{d:`M32,64a8,8,0,0,1,8-8H216a8,8,0,0,1,0,16H40A8,8,0,0,1,32,64Zm8,72h72a8,8,0,0,0,0-16H40a8,8,0,0,0,0,16Zm88,48H40a8,8,0,0,0,0,16h88a8,8,0,0,0,0-16Zm109.66,2.34L217.36,166A40,40,0,1,0,206,177.36l20.3,20.3a8,8,0,0,0,11.32-11.32Z`}))],[`light`,V.createElement(V.Fragment,null,V.createElement(`path`,{d:`M34,64a6,6,0,0,1,6-6H216a6,6,0,0,1,0,12H40A6,6,0,0,1,34,64Zm6,70h72a6,6,0,0,0,0-12H40a6,6,0,0,0,0,12Zm88,52H40a6,6,0,0,0,0,12h88a6,6,0,0,0,0-12Zm108.24,10.24a6,6,0,0,1-8.48,0l-21.49-21.48a38.06,38.06,0,1,1,8.49-8.49l21.48,21.49A6,6,0,0,1,236.24,196.24ZM184,170a26,26,0,1,0-26-26A26,26,0,0,0,184,170Z`}))],[`regular`,V.createElement(V.Fragment,null,V.createElement(`path`,{d:`M32,64a8,8,0,0,1,8-8H216a8,8,0,0,1,0,16H40A8,8,0,0,1,32,64Zm8,72h72a8,8,0,0,0,0-16H40a8,8,0,0,0,0,16Zm88,48H40a8,8,0,0,0,0,16h88a8,8,0,0,0,0-16Zm109.66,13.66a8,8,0,0,1-11.32,0L206,177.36A40,40,0,1,1,217.36,166l20.3,20.3A8,8,0,0,1,237.66,197.66ZM184,168a24,24,0,1,0-24-24A24,24,0,0,0,184,168Z`}))],[`thin`,V.createElement(V.Fragment,null,V.createElement(`path`,{d:`M36,64a4,4,0,0,1,4-4H216a4,4,0,0,1,0,8H40A4,4,0,0,1,36,64Zm4,68h72a4,4,0,0,0,0-8H40a4,4,0,0,0,0,8Zm88,56H40a4,4,0,0,0,0,8h88a4,4,0,0,0,0-8Zm106.83,6.83a4,4,0,0,1-5.66,0l-22.72-22.72a36.06,36.06,0,1,1,5.66-5.66l22.72,22.72A4,4,0,0,1,234.83,194.83ZM184,172a28,28,0,1,0-28-28A28,28,0,0,0,184,172Z`}))]]),_i=new Map([[`bold`,V.createElement(V.Fragment,null,V.createElement(`path`,{d:`M156,112a12,12,0,0,1-12,12H80a12,12,0,0,1,0-24h64A12,12,0,0,1,156,112Zm76.49,120.49a12,12,0,0,1-17,0L168,185a92.12,92.12,0,1,1,17-17l47.54,47.53A12,12,0,0,1,232.49,232.49ZM112,180a68,68,0,1,0-68-68A68.08,68.08,0,0,0,112,180Z`}))],[`duotone`,V.createElement(V.Fragment,null,V.createElement(`path`,{d:`M192,112a80,80,0,1,1-80-80A80,80,0,0,1,192,112Z`,opacity:`0.2`}),V.createElement(`path`,{d:`M229.66,218.34,179.6,168.28a88.21,88.21,0,1,0-11.32,11.31l50.06,50.07a8,8,0,0,0,11.32-11.32ZM40,112a72,72,0,1,1,72,72A72.08,72.08,0,0,1,40,112Zm112,0a8,8,0,0,1-8,8H80a8,8,0,0,1,0-16h64A8,8,0,0,1,152,112Z`}))],[`fill`,V.createElement(V.Fragment,null,V.createElement(`path`,{d:`M229.66,218.34,179.6,168.28a88.21,88.21,0,1,0-11.32,11.31l50.06,50.07a8,8,0,0,0,11.32-11.32ZM144,120H80a8,8,0,0,1,0-16h64a8,8,0,0,1,0,16Z`}))],[`light`,V.createElement(V.Fragment,null,V.createElement(`path`,{d:`M150,112a6,6,0,0,1-6,6H80a6,6,0,0,1,0-12h64A6,6,0,0,1,150,112Zm78.24,116.24a6,6,0,0,1-8.48,0l-51.38-51.38a86.15,86.15,0,1,1,8.48-8.48l51.38,51.38A6,6,0,0,1,228.24,228.24ZM112,186a74,74,0,1,0-74-74A74.09,74.09,0,0,0,112,186Z`}))],[`regular`,V.createElement(V.Fragment,null,V.createElement(`path`,{d:`M152,112a8,8,0,0,1-8,8H80a8,8,0,0,1,0-16h64A8,8,0,0,1,152,112Zm77.66,117.66a8,8,0,0,1-11.32,0l-50.06-50.07a88.11,88.11,0,1,1,11.31-11.31l50.07,50.06A8,8,0,0,1,229.66,229.66ZM112,184a72,72,0,1,0-72-72A72.08,72.08,0,0,0,112,184Z`}))],[`thin`,V.createElement(V.Fragment,null,V.createElement(`path`,{d:`M148,112a4,4,0,0,1-4,4H80a4,4,0,0,1,0-8h64A4,4,0,0,1,148,112Zm78.83,114.83a4,4,0,0,1-5.66,0l-52.7-52.7a84.1,84.1,0,1,1,5.66-5.66l52.7,52.7A4,4,0,0,1,226.83,226.83ZM112,188a76,76,0,1,0-76-76A76.08,76.08,0,0,0,112,188Z`}))]]),vi=new Map([[`bold`,V.createElement(V.Fragment,null,V.createElement(`path`,{d:`M230.47,67.5a12,12,0,0,0-19.26-4.32L172.43,99l-12.68-2.72L157,83.57l35.79-38.78a12,12,0,0,0-4.32-19.26A76.07,76.07,0,0,0,88.41,121.64L30.92,174.18a4.68,4.68,0,0,0-.39.38,36,36,0,0,0,50.91,50.91l.38-.39,52.54-57.49A76.05,76.05,0,0,0,230.47,67.5ZM160,148a51.5,51.5,0,0,1-23.35-5.52,12,12,0,0,0-14.26,2.62L64.31,208.66a12,12,0,0,1-17-17l63.55-58.07a12,12,0,0,0,2.62-14.26A51.5,51.5,0,0,1,108,96a52.06,52.06,0,0,1,52-52h.89L135.17,71.87a12,12,0,0,0-2.91,10.65l5.66,26.35a12,12,0,0,0,9.21,9.21l26.35,5.66a12,12,0,0,0,10.65-2.91L212,95.12c0,.3,0,.59,0,.89A52.06,52.06,0,0,1,160,148Z`}))],[`duotone`,V.createElement(V.Fragment,null,V.createElement(`path`,{d:`M224,96a64,64,0,0,1-94.94,56L73,217A24,24,0,0,1,39,183L104,126.94a64,64,0,0,1,80-90.29L144,80l5.66,26.34L176,112l43.35-40A63.8,63.8,0,0,1,224,96Z`,opacity:`0.2`}),V.createElement(`path`,{d:`M226.76,69a8,8,0,0,0-12.84-2.88l-40.3,37.19-17.23-3.7-3.7-17.23,37.19-40.3A8,8,0,0,0,187,29.24,72,72,0,0,0,88,96,72.34,72.34,0,0,0,94,124.94L33.79,177c-.15.12-.29.26-.43.39a32,32,0,0,0,45.26,45.26c.13-.13.27-.28.39-.42L131.06,162A72,72,0,0,0,232,96,71.56,71.56,0,0,0,226.76,69ZM160,152a56.14,56.14,0,0,1-27.07-7,8,8,0,0,0-9.92,1.77L67.11,211.51a16,16,0,0,1-22.62-22.62L109.18,133a8,8,0,0,0,1.77-9.93,56,56,0,0,1,58.36-82.31l-31.2,33.81a8,8,0,0,0-1.94,7.1L141.83,108a8,8,0,0,0,6.14,6.14l26.35,5.66a8,8,0,0,0,7.1-1.94l33.81-31.2A56.06,56.06,0,0,1,160,152Z`}))],[`fill`,V.createElement(V.Fragment,null,V.createElement(`path`,{d:`M232,96a72,72,0,0,1-100.94,66L79,222.22c-.12.14-.26.29-.39.42a32,32,0,0,1-45.26-45.26c.14-.13.28-.27.43-.39L94,124.94a72.07,72.07,0,0,1,83.54-98.78,8,8,0,0,1,3.93,13.19L144,80l5.66,26.35L176,112l40.65-37.52a8,8,0,0,1,13.19,3.93A72.6,72.6,0,0,1,232,96Z`}))],[`light`,V.createElement(V.Fragment,null,V.createElement(`path`,{d:`M224.91,69.75a6,6,0,0,0-9.63-2.16l-41.07,37.9L154.7,101.3l-4.19-19.51,37.9-41.07a6,6,0,0,0-2.16-9.63,70,70,0,0,0-89.77,94.39l-61.39,53c-.11.09-.21.19-.32.3A30,30,0,0,0,77.2,221.23c.11-.11.21-.21.3-.32l53-61.39a70,70,0,0,0,94.39-89.77ZM160,154a58,58,0,0,1-28-7.22,6,6,0,0,0-7.45,1.33L68.57,212.88a18,18,0,0,1-25.45-25.45l64.76-55.94A6,6,0,0,0,109.2,124a58,58,0,0,1,64-84.53L139.58,75.93a6,6,0,0,0-1.45,5.33l5.65,26.35a6,6,0,0,0,4.61,4.61l26.35,5.65a6,6,0,0,0,5.33-1.45L216.49,82.8A58.06,58.06,0,0,1,160,154Z`}))],[`regular`,V.createElement(V.Fragment,null,V.createElement(`path`,{d:`M226.76,69a8,8,0,0,0-12.84-2.88l-40.3,37.19-17.23-3.7-3.7-17.23,37.19-40.3A8,8,0,0,0,187,29.24,72,72,0,0,0,88,96,72.34,72.34,0,0,0,94,124.94L33.79,177c-.15.12-.29.26-.43.39a32,32,0,0,0,45.26,45.26c.13-.13.27-.28.39-.42L131.06,162A72,72,0,0,0,232,96,71.56,71.56,0,0,0,226.76,69ZM160,152a56.14,56.14,0,0,1-27.07-7,8,8,0,0,0-9.92,1.77L67.11,211.51a16,16,0,0,1-22.62-22.62L109.18,133a8,8,0,0,0,1.77-9.93,56,56,0,0,1,58.36-82.31l-31.2,33.81a8,8,0,0,0-1.94,7.1L141.83,108a8,8,0,0,0,6.14,6.14l26.35,5.66a8,8,0,0,0,7.1-1.94l33.81-31.2A56.06,56.06,0,0,1,160,152Z`}))],[`thin`,V.createElement(V.Fragment,null,V.createElement(`path`,{d:`M223.05,70.5a4,4,0,0,0-6.42-1.44l-41.82,38.6L153,103l-4.68-21.79,38.6-41.82a4,4,0,0,0-1.44-6.43A68,68,0,0,0,98.94,126L36.4,180l-.21.2a28,28,0,0,0,39.6,39.6l.2-.21,54-62.54A68,68,0,0,0,228,96,67.51,67.51,0,0,0,223.05,70.5ZM160,156a60,60,0,0,1-29-7.47,4,4,0,0,0-5,.89L70,214.25A20,20,0,0,1,41.75,186l64.82-56a4,4,0,0,0,.89-5,60,60,0,0,1,69.46-86.59L141.05,77.29a4,4,0,0,0-1,3.55l5.66,26.35a4,4,0,0,0,3.07,3.07l26.35,5.66a4,4,0,0,0,3.55-1l38.87-35.87A60.05,60.05,0,0,1,160,156Z`}))]]),yi=V.forwardRef((e,t)=>V.createElement(x,{ref:t,...e,weights:oi}));yi.displayName=`ArrowClockwiseIcon`;var bi=yi,xi=V.forwardRef((e,t)=>V.createElement(x,{ref:t,...e,weights:si}));xi.displayName=`ArrowCounterClockwiseIcon`;var Si=xi,Ci=V.forwardRef((e,t)=>V.createElement(x,{ref:t,...e,weights:ci}));Ci.displayName=`ArrowsOutIcon`;var wi=Ci,Ti=V.forwardRef((e,t)=>V.createElement(x,{ref:t,...e,weights:li}));Ti.displayName=`CaretUpIcon`;var Ei=Ti,Di=V.forwardRef((e,t)=>V.createElement(x,{ref:t,...e,weights:ui}));Di.displayName=`ChatCircleTextIcon`;var Oi=Di,ki=V.forwardRef((e,t)=>V.createElement(x,{ref:t,...e,weights:di}));ki.displayName=`ClockIcon`;var Ai=ki,ji=V.forwardRef((e,t)=>V.createElement(x,{ref:t,...e,weights:fi}));ji.displayName=`ClockCounterClockwiseIcon`;var Mi=ji,Ni=V.forwardRef((e,t)=>V.createElement(x,{ref:t,...e,weights:pi}));Ni.displayName=`InfoIcon`;var Pi=Ni,Fi=V.forwardRef((e,t)=>V.createElement(x,{ref:t,...e,weights:mi}));Fi.displayName=`KeyboardIcon`;var Ii=Fi,Li=V.forwardRef((e,t)=>V.createElement(x,{ref:t,...e,weights:hi}));Li.displayName=`ListBulletsIcon`;var Ri=Li,zi=V.forwardRef((e,t)=>V.createElement(x,{ref:t,...e,weights:gi}));zi.displayName=`ListMagnifyingGlassIcon`;var Bi=zi,Vi=V.forwardRef((e,t)=>V.createElement(x,{ref:t,...e,weights:_i}));Vi.displayName=`MagnifyingGlassMinusIcon`;var Hi=Vi,Ui=V.forwardRef((e,t)=>V.createElement(x,{ref:t,...e,weights:vi}));Ui.displayName=`WrenchIcon`;var Wi=Ui,Gi=i(b(),1),Ki=`$__all`;function qi(e){let{margin:t,containerPadding:n,containerWidth:r,cols:i}=e;return(r-t[0]*(i-1)-n[0]*2)/i}function Ji(e,t,n){return Number.isFinite(e)?Math.round(t*e+Math.max(0,e-1)*n):e}function Yi(e,t,n,r,i,a,o){let{margin:s,containerPadding:c,rowHeight:l}=e,u=qi(e),d,f,p,m;if(o?(d=Math.round(o.width),f=Math.round(o.height)):(d=Ji(r,u,s[0]),f=Ji(i,l,s[1])),a?(p=Math.round(a.top),m=Math.round(a.left)):o?(p=Math.round(o.top),m=Math.round(o.left)):(p=Math.round((l+s[1])*n+c[1]),m=Math.round((u+s[0])*t+c[0])),!a&&!o){if(Number.isFinite(r)){let e=Math.round((u+s[0])*(t+r)+c[0])-m-d;e!==s[0]&&(d+=e-s[0])}if(Number.isFinite(i)){let e=Math.round((l+s[1])*(n+i)+c[1])-p-f;e!==s[1]&&(f+=e-s[1])}}return{top:p,left:m,width:d,height:f}}function Xi(e,t,n,r,i){let{margin:a,containerPadding:o,cols:s,rowHeight:c,maxRows:l}=e,u=qi(e),d=Math.round((n-o[0])/(u+a[0])),f=Math.round((t-o[1])/(c+a[1]));return d=$i(d,0,s-r),f=$i(f,0,l-i),{x:d,y:f}}function Zi(e,t,n){let{margin:r,containerPadding:i,rowHeight:a}=e,o=qi(e);return{x:Math.round((n-i[0])/(o+r[0])),y:Math.round((t-i[1])/(a+r[1]))}}function Qi(e,t,n){let{margin:r,rowHeight:i}=e,a=qi(e);return{w:Math.max(1,Math.round((t+r[0])/(a+r[0]))),h:Math.max(1,Math.round((n+r[1])/(i+r[1])))}}function $i(e,t,n){return Math.max(Math.min(e,n),t)}function ea(e,t){return!(e.i===t.i||e.x+e.w<=t.x||e.x>=t.x+t.w||e.y+e.h<=t.y||e.y>=t.y+t.h)}function ta(e,t){for(let n=0;nea(e,t))}function ra(e,t){return t===`horizontal`?aa(e):t===`vertical`||t===`wrap`?ia(e):[...e]}function ia(e){return[...e].sort((e,t)=>e.y===t.y?e.x-t.x:e.y-t.y)}function aa(e){return[...e].sort((e,t)=>e.x===t.x?e.y-t.y:e.x-t.x)}function oa(e){let t=0;for(let n=0;nt&&(t=e)}}return t}function sa(e,t){for(let n=0;ne.static===!0)}function la(e){return{i:e.i,x:e.x,y:e.y,w:e.w,h:e.h,minW:e.minW,maxW:e.maxW,minH:e.minH,maxH:e.maxH,moved:!!e.moved,static:!!e.static,isDraggable:e.isDraggable,isResizable:e.isResizable,resizeHandles:e.resizeHandles,constraints:e.constraints,isBounded:e.isBounded}}function ua(e){let t=Array(e.length);for(let n=0;nt.cols&&(i.x=t.cols-i.w),i.x<0&&(i.x=0,i.w=t.cols),i.y===1/0&&(i.y=oa(n)),!i.static)n.push(i);else for(;ta(n,i);)i.y++}}return e}function ma(e,t,n,r,i,a,o,s,c){if(t.static&&t.isDraggable!==!0||t.y===r&&t.x===n)return[...e];let l=t.x,u=t.y;typeof n==`number`&&(t.x=n),typeof r==`number`&&(t.y=r),t.moved=!0;let d=ra(e,o);(o===`vertical`&&typeof r==`number`?u>=r:o===`horizontal`&&typeof n==`number`&&l>=n)&&(d=d.reverse());let f=na(d,t),p=f.length>0;if(p&&c)return ua(e);if(p&&a)return t.x=l,t.y=u,t.moved=!1,e;let m=[...e];for(let e=0;et.y,d=l!==void 0&&t.x+t.w>l.x;if(!l)return ma(e,n,o?a.x:void 0,s?a.y:void 0,r,c,i);if(u&&s)return ma(e,n,void 0,n.y+1,r,c,i);if(u&&i===null){let r=n.y;return t.y=r,n.y=r+t.h,[...e]}if(d&&o)return ma(e,t,n.x,void 0,r,c,i)}let l=o?n.x+1:void 0,u=s?n.y+1:void 0;return l===void 0&&u===void 0?[...e]:ma(e,n,l,u,r,c,i)}function ga(e,t,n){return Math.max(t,Math.min(n,e))}var _a=[{name:`gridBounds`,constrainPosition(e,t,n,{cols:r,maxRows:i}){return{x:ga(t,0,Math.max(0,r-e.w)),y:ga(n,0,Math.max(0,i-e.h))}},constrainSize(e,t,n,r,{cols:i,maxRows:a}){let o=r===`w`||r===`nw`||r===`sw`?e.x+e.w:i-e.x,s=r===`n`||r===`nw`||r===`ne`?e.y+e.h:a-e.y;return{w:ga(t,1,Math.max(1,o)),h:ga(n,1,Math.max(1,s))}}},{name:`minMaxSize`,constrainSize(e,t,n){return{w:ga(t,e.minW??1,e.maxW??1/0),h:ga(n,e.minH??1,e.maxH??1/0)}}}];function va(e,t,n,r,i){let a={x:n,y:r};for(let n of e)n.constrainPosition&&(a=n.constrainPosition(t,a.x,a.y,i));if(t.constraints)for(let e of t.constraints)e.constrainPosition&&(a=e.constrainPosition(t,a.x,a.y,i));return a}function ya(e,t,n,r,i,a){let o={w:n,h:r};for(let n of e)n.constrainSize&&(o=n.constrainSize(t,o.w,o.h,i,a));if(t.constraints)for(let e of t.constraints)e.constrainSize&&(o=e.constrainSize(t,o.w,o.h,i,a));return o}function ba({top:e,left:t,width:n,height:r}){let i=`translate(${t}px,${e}px)`;return{transform:i,WebkitTransform:i,MozTransform:i,msTransform:i,OTransform:i,width:`${n}px`,height:`${r}px`,position:`absolute`}}function xa({top:e,left:t,width:n,height:r}){return{top:`${e}px`,left:`${t}px`,width:`${n}px`,height:`${r}px`,position:`absolute`}}function Sa(e){return e*100+`%`}function Ca(e,t,n,r){return e+n>r?t:n}function wa(e,t,n){return e<0?t:n}function Ta(e){return Math.max(0,e)}function Ea(e){return Math.max(0,e)}var Da=(e,t,n)=>{let{left:r,height:i,width:a}=t,o=e.top-(i-e.height);return{left:r,width:a,height:wa(o,e.height,i),top:Ea(o)}},Oa=(e,t,n)=>{let{top:r,left:i,height:a,width:o}=t;return{top:r,height:a,width:Ca(e.left,e.width,o,n),left:Ta(i)}},ka=(e,t,n)=>{let{top:r,height:i,width:a}=t,o=e.left+e.width-a;return o<0?{height:i,width:e.left+e.width,top:Ea(r),left:0}:{height:i,width:a,top:Ea(r),left:o}},Aa=(e,t,n)=>{let{top:r,left:i,height:a,width:o}=t;return{width:o,left:i,height:wa(r,e.height,a),top:Ea(r)}},ja={n:Da,ne:(e,t,n)=>Da(e,Oa(e,t,n)),e:Oa,se:(e,t,n)=>Aa(e,Oa(e,t,n)),s:Aa,sw:(e,t,n)=>Aa(e,ka(e,t)),w:ka,nw:(e,t,n)=>Da(e,ka(e,t))};function Ma(e,t,n,r){let i=ja[e];return i?i(t,{...t,...n},r):n}var Na={type:`transform`,scale:1,calcStyle(e){return ba(e)}},Pa={cols:12,rowHeight:150,margin:[10,10],containerPadding:null,maxRows:1/0},Fa={enabled:!0,bounded:!1,threshold:3},Ia={enabled:!0,handles:[`se`]},La={enabled:!1,defaultItem:{w:1,h:1},touchEnabled:!0,touchDragSource:`[data-rgl-draggable]`};function Ra(e,t,n,r,i){let a=r===`x`?`w`:`h`;t[r]+=1;let o=e.findIndex(e=>e.i===t.i),s=i??ca(e).length>0;for(let i=o+1;it.y+t.h)break;ea(t,o)&&Ra(e,o,n+t[a],r,s)}}t[r]=n}function za(e,t,n,r){for(t.x=Math.max(t.x,0),t.y=Math.max(t.y,0),t.y=Math.min(r,t.y);t.y>0&&!ta(e,t);)t.y--;let i;for(;(i=ta(e,t))!==void 0;)Ra(n,t,i.y+i.h,`y`);return t.y=Math.max(t.y,0),t}function Ba(e,t,n,r){for(t.x=Math.max(t.x,0),t.y=Math.max(t.y,0);t.x>0&&!ta(e,t);)t.x--;let i;for(;(i=ta(e,t))!==void 0;)if(Ra(r,t,i.x+i.w,`x`),t.x+t.w>n)for(t.x=n-t.w,t.y++;t.x>0&&!ta(e,t);)t.x--;return t.x=Math.max(t.x,0),t}var Va={type:`vertical`,allowOverlap:!1,compact(e,t){let n=ca(e),r=oa(n),i=ia(e),a=Array(e.length);for(let t=0;te[t]-e[n])}function Ya(e,t){let n=Ja(e),r=n[0];if(r===void 0)throw Error(`No breakpoints defined`);for(let i=1;ie[a]&&(r=a)}return r}function Xa(e,t){let n=t[e];if(n===void 0)throw Error(`ResponsiveReactGridLayout: \`cols\` entry for breakpoint ${String(e)} is missing!`);return n}function Za(e,t,n,r,i,a){let o=e[n];if(o)return ua(o);let s=e[r],c=Ja(t),l=c.slice(c.indexOf(n));for(let t=0;t{(function(n,r){typeof e==`object`&&t!==void 0?r(e):typeof define==`function`&&define.amd?define([`exports`],r):(n=typeof globalThis<`u`?globalThis:n||self,r(n[`fast-equals`]={}))})(e,(function(e){function t(e){return function(t,n,r,i,a,o,s){return e(t,n,s)}}function n(e){return function(t,n,r,i){if(!t||!n||typeof t!=`object`||typeof n!=`object`)return e(t,n,r,i);var a=i.get(t),o=i.get(n);if(a&&o)return a===n&&o===t;i.set(t,n),i.set(n,t);var s=e(t,n,r,i);return i.delete(t),i.delete(n),s}}function r(e,t){var n={};for(var r in e)n[r]=e[r];for(var r in t)n[r]=t[r];return n}function i(e){return e.constructor===Object||e.constructor==null}function a(e){return typeof e.then==`function`}function o(e,t){return e===t||e!==e&&t!==t}var s=Object.prototype.toString;function c(e){var t=e.areArraysEqual,n=e.areDatesEqual,r=e.areMapsEqual,c=e.areObjectsEqual,l=e.areRegExpsEqual,u=e.areSetsEqual,d=e.createIsNestedEqual,f=d(p);function p(e,d,p){if(e===d)return!0;if(!e||!d||typeof e!=`object`||typeof d!=`object`)return e!==e&&d!==d;if(i(e)&&i(d))return c(e,d,f,p);var m=Array.isArray(e),h=Array.isArray(d);if(m||h)return m===h&&t(e,d,f,p);var g=s.call(e);return g===s.call(d)?g===`[object Date]`?n(e,d,f,p):g===`[object RegExp]`?l(e,d,f,p):g===`[object Map]`?r(e,d,f,p):g===`[object Set]`?u(e,d,f,p):g===`[object Object]`||g===`[object Arguments]`?a(e)||a(d)?!1:c(e,d,f,p):g===`[object Boolean]`||g===`[object Number]`||g===`[object String]`?o(e.valueOf(),d.valueOf()):!1:!1}return p}function l(e,t,n,r){var i=e.length;if(t.length!==i)return!1;for(;i-->0;)if(!n(e[i],t[i],i,i,e,t,r))return!1;return!0}var u=n(l);function d(e,t){return o(e.valueOf(),t.valueOf())}function f(e,t,n,r){var i=e.size===t.size;if(!i)return!1;if(!e.size)return!0;var a={},o=0;return e.forEach(function(s,c){if(i){var l=!1,u=0;t.forEach(function(i,d){!l&&!a[u]&&(l=n(c,d,o,u,e,t,r)&&n(s,i,c,d,e,t,r))&&(a[u]=!0),u++}),o++,i=l}}),i}var p=n(f),m=`_owner`,h=Object.prototype.hasOwnProperty;function g(e,t,n,r){var i=Object.keys(e),a=i.length;if(Object.keys(t).length!==a)return!1;for(var o;a-->0;){if(o=i[a],o===m){var s=!!e.$$typeof,c=!!t.$$typeof;if((s||c)&&s!==c)return!1}if(!h.call(t,o)||!n(e[o],t[o],o,o,e,t,r))return!1}return!0}var _=n(g);function v(e,t){return e.source===t.source&&e.flags===t.flags}function y(e,t,n,r){var i=e.size===t.size;if(!i)return!1;if(!e.size)return!0;var a={};return e.forEach(function(o,s){if(i){var c=!1,l=0;t.forEach(function(i,u){!c&&!a[l]&&(c=n(o,i,s,u,e,t,r))&&(a[l]=!0),l++}),i=c}}),i}var b=n(y),x=Object.freeze({areArraysEqual:l,areDatesEqual:d,areMapsEqual:f,areObjectsEqual:g,areRegExpsEqual:v,areSetsEqual:y,createIsNestedEqual:t}),S=Object.freeze({areArraysEqual:u,areDatesEqual:d,areMapsEqual:p,areObjectsEqual:_,areRegExpsEqual:v,areSetsEqual:b,createIsNestedEqual:t}),C=c(x);function w(e,t){return C(e,t,void 0)}var T=c(r(x,{createIsNestedEqual:function(){return o}}));function E(e,t){return T(e,t,void 0)}var D=c(S);function O(e,t){return D(e,t,new WeakMap)}var k=c(r(S,{createIsNestedEqual:function(){return o}}));function A(e,t){return k(e,t,new WeakMap)}function j(e){return c(r(x,e(x)))}function M(e){var t=c(r(S,e(S)));return(function(e,n,r){return r===void 0&&(r=new WeakMap),t(e,n,r)})}e.circularDeepEqual=O,e.circularShallowEqual=A,e.createCustomCircularEqual=M,e.createCustomEqual=j,e.deepEqual=w,e.sameValueZeroEqual=o,e.shallowEqual=E,Object.defineProperty(e,"__esModule",{value:!0})}))})),eo=e(((e,t)=>{t.exports=`SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED`})),to=e(((e,t)=>{var n=eo();function r(){}function i(){}i.resetWarningCache=r,t.exports=function(){function e(e,t,r,i,a,o){if(o!==n){var s=Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw s.name=`Invariant Violation`,s}}e.isRequired=e;function t(){return e}var a={array:e,bigint:e,bool:e,func:e,number:e,object:e,string:e,symbol:e,any:e,arrayOf:t,element:e,elementType:e,instanceOf:t,node:e,objectOf:t,oneOf:t,oneOfType:t,shape:t,exact:t,checkPropTypes:i,resetWarningCache:r};return a.PropTypes=a,a}})),no=e(((e,t)=>{t.exports=to()()})),ro=i(no(),1);function io(e,t){for(let n=0,r=e.length;n`u`)return``;let t=window.document?.documentElement?.style;if(!t||e in t)return``;for(let n=0;nt===e.identifier)||e.changedTouches&&io(e.changedTouches,e=>t===e.identifier)}function ko(e){if(e.targetTouches&&e.targetTouches[0])return e.targetTouches[0].identifier;if(e.changedTouches&&e.changedTouches[0])return e.changedTouches[0].identifier}function Ao(){return typeof __webpack_nonce__<`u`?__webpack_nonce__:void 0}function jo(e,t){if(!e)return;let n=e.getElementById(`react-draggable-style-el`);if(!n){n=e.createElement(`style`),n.type=`text/css`,n.id=`react-draggable-style-el`;let r=t??Ao();r&&n.setAttribute(`nonce`,r),n.innerHTML=`.react-draggable-transparent-selection *::-moz-selection {all: inherit;} `,n.innerHTML+=`.react-draggable-transparent-selection *::selection {all: inherit;} -`,e.getElementsByTagName(`head`)[0].appendChild(n)}e.body&&Po(e.body,`react-draggable-transparent-selection`)}function Mo(e){window.requestAnimationFrame?window.requestAnimationFrame(()=>{No(e)}):No(e)}function No(e){if(e)try{e.body&&Fo(e.body,`react-draggable-transparent-selection`);let t=e.selection;if(t)t.empty();else{let t=(e.defaultView||window).getSelection();t&&t.type!==`Caret`&&t.removeAllRanges()}}catch{}}function Po(e,t){e.classList?e.classList.add(t):e.className.match(RegExp(`(?:^|\\s)${t}(?!\\S)`))||(e.className+=` ${t}`)}function Fo(e,t){e.classList?e.classList.remove(t):e.className=e.className.replace(RegExp(`(?:^|\\s)${t}(?!\\S)`,`g`),``)}function Io(e,t,n){if(!e.props.bounds)return[t,n];let{bounds:r}=e.props;r=typeof r==`string`?r:Uo(r);let i=Wo(e);if(typeof r==`string`){let{ownerDocument:e}=i,t=e.defaultView;if(!t)throw Error(`Cannot resolve the owner window of the draggable node.`);let n;if(n=r===`parent`?i.parentNode:i.getRootNode().querySelector(r),!(n instanceof t.HTMLElement))throw Error(`Bounds selector "`+r+`" could not find an element.`);let a=n,o=t.getComputedStyle(i),s=t.getComputedStyle(a);r={left:-i.offsetLeft+so(s.paddingLeft)+so(o.marginLeft),top:-i.offsetTop+so(s.paddingTop)+so(o.marginTop),right:Co(a)-xo(i)-i.offsetLeft+so(s.paddingRight)-so(o.marginRight),bottom:So(a)-bo(i)-i.offsetTop+so(s.paddingBottom)-so(o.marginBottom)}}return oo(r.right)&&(t=Math.min(t,r.right)),oo(r.bottom)&&(n=Math.min(n,r.bottom)),oo(r.left)&&(t=Math.max(t,r.left)),oo(r.top)&&(n=Math.max(n,r.top)),[t,n]}function Lo(e,t,n){return[Math.round(t/e[0])*e[0],Math.round(n/e[1])*e[1]]}function Ro(e){return e.props.axis===`both`||e.props.axis===`x`}function zo(e){return e.props.axis===`both`||e.props.axis===`y`}function Bo(e,t,n){let r=typeof t==`number`?Oo(e,t):null;if(typeof t==`number`&&!r)return null;let i=Wo(n),a=n.props.offsetParent||i.offsetParent||i.ownerDocument.body;return wo(r||e,a,n.props.scale)}function Vo(e,t,n){let r=!oo(e.lastX),i=Wo(e);return r?{node:i,deltaX:0,deltaY:0,lastX:t,lastY:n,x:t,y:n}:{node:i,deltaX:t-e.lastX,deltaY:n-e.lastY,lastX:e.lastX,lastY:e.lastY,x:t,y:n}}function Ho(e,t){let n=e.props.scale;return{node:t.node,x:e.state.x+t.deltaX/n,y:e.state.y+t.deltaY/n,deltaX:t.deltaX/n,deltaY:t.deltaY/n,lastX:e.state.x,lastY:e.state.y}}function Uo(e){return{left:e.left,top:e.top,right:e.right,bottom:e.bottom}}function Wo(e){let t=e.findDOMNode();if(!t)throw Error(`: Unmounted during event!`);return t}var Go=typeof process<`u`&&{}.DRAGGABLE_DEBUG?console.log.bind(console):function(){},Ko={touch:{start:`touchstart`,move:`touchmove`,stop:`touchend`},mouse:{start:`mousedown`,move:`mousemove`,stop:`mouseup`}},qo=Ko.mouse,Jo=class extends V.Component{constructor(){super(...arguments),this.dragging=!1,this.lastX=NaN,this.lastY=NaN,this.touchIdentifier=null,this.mounted=!1,this.handleDragStart=e=>{if(this.props.onMouseDown(e),!this.props.allowAnyClick&&(typeof e.button==`number`&&e.button!==0||e.ctrlKey))return!1;let t=this.findDOMNode();if(!t||!t.ownerDocument||!t.ownerDocument.body)throw Error(` not mounted on DragStart!`);let{ownerDocument:n}=t;if(this.props.disabled||!(e.target instanceof n.defaultView.Node)||this.props.handle&&!_o(e.target,this.props.handle,t)||this.props.cancel&&_o(e.target,this.props.cancel,t))return;e.type===`touchstart`&&!this.props.allowMobileScroll&&e.preventDefault();let r=ko(e);this.touchIdentifier=r;let i=Bo(e,r,this);if(i==null)return;let{x:a,y:o}=i,s=Vo(this,a,o);Go(`DraggableCore: handleDragStart: %j`,s),Go(`calling`,this.props.onStart),this.props.onStart(e,s)!==!1&&this.mounted!==!1&&(this.props.enableUserSelectHack&&jo(n,this.props.nonce),this.dragging=!0,this.lastX=a,this.lastY=o,vo(n,qo.move,this.handleDrag),vo(n,qo.stop,this.handleDragStop))},this.handleDrag=e=>{let t=Bo(e,this.touchIdentifier,this);if(t==null)return;let{x:n,y:r}=t;if(Array.isArray(this.props.grid)){let e=n-this.lastX,t=r-this.lastY;if([e,t]=Lo(this.props.grid,e,t),!e&&!t)return;n=this.lastX+e,r=this.lastY+t}let i=Vo(this,n,r);if(Go(`DraggableCore: handleDrag: %j`,i),this.props.onDrag(e,i)===!1||this.mounted===!1){try{this.handleDragStop(new MouseEvent(`mouseup`))}catch{let e=document.createEvent(`MouseEvents`);e.initMouseEvent(`mouseup`,!0,!0,window,0,0,0,0,0,!1,!1,!1,!1,0,null),this.handleDragStop(e)}return}this.lastX=n,this.lastY=r},this.handleDragStop=e=>{if(!this.dragging)return;let t=Bo(e,this.touchIdentifier,this);if(t==null)return;let{x:n,y:r}=t;if(Array.isArray(this.props.grid)){let e=n-this.lastX||0,t=r-this.lastY||0;[e,t]=Lo(this.props.grid,e,t),n=this.lastX+e,r=this.lastY+t}let i=Vo(this,n,r);if(this.props.onStop(e,i)===!1||this.mounted===!1)return!1;let a=this.findDOMNode();a&&this.props.enableUserSelectHack&&Mo(a.ownerDocument),Go(`DraggableCore: handleDragStop: %j`,i),this.dragging=!1,this.lastX=NaN,this.lastY=NaN,a&&(Go(`DraggableCore: Removing handlers`),yo(a.ownerDocument,qo.move,this.handleDrag),yo(a.ownerDocument,qo.stop,this.handleDragStop))},this.onMouseDown=e=>(qo=Ko.mouse,this.handleDragStart(e)),this.onMouseUp=e=>(qo=Ko.mouse,this.handleDragStop(e)),this.onTouchStart=e=>(qo=Ko.touch,this.handleDragStart(e)),this.onTouchEnd=e=>(qo=Ko.touch,this.handleDragStop(e))}componentDidMount(){this.mounted=!0;let e=this.findDOMNode();e&&vo(e,Ko.touch.start,this.onTouchStart,{passive:!1})}componentWillUnmount(){this.mounted=!1;let e=this.findDOMNode();if(e){let{ownerDocument:t}=e;yo(t,Ko.mouse.move,this.handleDrag),yo(t,Ko.touch.move,this.handleDrag),yo(t,Ko.mouse.stop,this.handleDragStop),yo(t,Ko.touch.stop,this.handleDragStop),yo(e,Ko.touch.start,this.onTouchStart,{passive:!1}),this.props.enableUserSelectHack&&Mo(t)}}findDOMNode(){if(this.props?.nodeRef)return this.props.nodeRef.current;let e=Gi.default;return typeof e.findDOMNode==`function`?e.findDOMNode(this):(Go(`react-draggable: ReactDOM.findDOMNode is not available in React 19+. You must provide a nodeRef prop. See: https://github.com/react-grid-layout/react-draggable#noderef`),null)}render(){return V.cloneElement(V.Children.only(this.props.children),{onMouseDown:this.onMouseDown,onMouseUp:this.onMouseUp,onTouchEnd:this.onTouchEnd})}};Jo.displayName=`DraggableCore`,Jo.propTypes={allowAnyClick:ro.default.bool,allowMobileScroll:ro.default.bool,children:ro.default.node.isRequired,disabled:ro.default.bool,enableUserSelectHack:ro.default.bool,offsetParent:function(e,t){if(e[t]&&e[t].nodeType!==1)throw Error(`Draggable's offsetParent must be a DOM Node.`)},grid:ro.default.arrayOf(ro.default.number),handle:ro.default.string,cancel:ro.default.string,nodeRef:ro.default.object,nonce:ro.default.string,onStart:ro.default.func,onDrag:ro.default.func,onStop:ro.default.func,onMouseDown:ro.default.func,scale:ro.default.number,className:co,style:co,transform:co},Jo.defaultProps={allowAnyClick:!1,allowMobileScroll:!1,disabled:!1,enableUserSelectHack:!0,onStart:function(){},onDrag:function(){},onStop:function(){},onMouseDown:function(){},scale:1};var Yo=class extends V.Component{constructor(e){super(e),this.onDragStart=(e,t)=>{if(Go(`Draggable: onDragStart: %j`,t),this.props.onStart(e,Ho(this,t))===!1)return!1;this.setState({dragging:!0,dragged:!0})},this.onDrag=(e,t)=>{if(!this.state.dragging)return!1;Go(`Draggable: onDrag: %j`,t);let n=Ho(this,t),r={x:n.x,y:n.y,slackX:0,slackY:0};if(this.props.bounds){let{x:e,y:t}=r;r.x+=this.state.slackX,r.y+=this.state.slackY;let[i,a]=Io(this,r.x,r.y);r.x=i,r.y=a,r.slackX=this.state.slackX+(e-r.x),r.slackY=this.state.slackY+(t-r.y),n.x=r.x,n.y=r.y,n.deltaX=r.x-this.state.x,n.deltaY=r.y-this.state.y}if(this.props.onDrag(e,n)===!1)return!1;this.setState(r)},this.onDragStop=(e,t)=>{if(!this.state.dragging||this.props.onStop(e,Ho(this,t))===!1)return!1;Go(`Draggable: onDragStop: %j`,t);let n={dragging:!1,slackX:0,slackY:0};if(this.props.position){let{x:e,y:t}=this.props.position;n.x=e,n.y=t}this.setState(n)},this.state={dragging:!1,dragged:!1,x:e.position?e.position.x:e.defaultPosition.x,y:e.position?e.position.y:e.defaultPosition.y,prevPropsPosition:{...e.position},slackX:0,slackY:0,isElementSVG:!1},e.position&&!(e.onDrag||e.onStop)&&console.warn("A `position` was applied to this , without drag handlers. This will make this component effectively undraggable. Please attach `onDrag` or `onStop` handlers so you can adjust the `position` of this element.")}static getDerivedStateFromProps({position:e},{prevPropsPosition:t}){return e&&(!t||e.x!==t.x||e.y!==t.y)?(Go(`Draggable: getDerivedStateFromProps %j`,{position:e,prevPropsPosition:t}),{x:e.x,y:e.y,prevPropsPosition:{...e}}):null}componentDidMount(){window.SVGElement!==void 0&&this.findDOMNode()instanceof window.SVGElement&&this.setState({isElementSVG:!0})}componentWillUnmount(){this.state.dragging&&this.setState({dragging:!1})}findDOMNode(){if(this.props?.nodeRef)return this.props.nodeRef.current;let e=Gi.default;return typeof e.findDOMNode==`function`?e.findDOMNode(this):null}render(){let{axis:e,bounds:t,children:n,defaultPosition:r,defaultClassName:i,defaultClassNameDragging:a,defaultClassNameDragged:o,position:s,positionOffset:c,scale:l,...u}=this.props,d={},f=null,p=!s||this.state.dragging,m=s||r,h={x:Ro(this)&&p?this.state.x:m.x,y:zo(this)&&p?this.state.y:m.y};this.state.isElementSVG?f=Eo(h,c):d=To(h,c);let g=V.Children.only(n),v=_(g.props.className||``,i,{[a]:this.state.dragging,[o]:this.state.dragged});return V.createElement(Jo,{...u,onStart:this.onDragStart,onDrag:this.onDrag,onStop:this.onDragStop},V.cloneElement(g,{className:v,style:{...g.props.style,...d},transform:f}))}};Yo.displayName=`Draggable`,Yo.propTypes={...Jo.propTypes,axis:ro.default.oneOf([`both`,`x`,`y`,`none`]),bounds:ro.default.oneOfType([ro.default.shape({left:ro.default.number,right:ro.default.number,top:ro.default.number,bottom:ro.default.number}),ro.default.string,ro.default.oneOf([!1])]),defaultClassName:ro.default.string,defaultClassNameDragging:ro.default.string,defaultClassNameDragged:ro.default.string,defaultPosition:ro.default.shape({x:ro.default.number,y:ro.default.number}),positionOffset:ro.default.shape({x:ro.default.oneOfType([ro.default.number,ro.default.string]),y:ro.default.oneOfType([ro.default.number,ro.default.string])}),position:ro.default.shape({x:ro.default.number,y:ro.default.number}),className:co,style:co,transform:co},Yo.defaultProps={...Jo.defaultProps,axis:`both`,bounds:!1,defaultClassName:`react-draggable`,defaultClassNameDragging:`react-draggable-dragging`,defaultClassNameDragged:`react-draggable-dragged`,defaultPosition:{x:0,y:0},scale:1};var Xo=e(((e,t)=>{function n(e){var t,r,i=``;if(typeof e==`string`||typeof e==`number`)i+=e;else if(typeof e==`object`){if(Array.isArray(e)){var a=e.length;for(t=0;t{var r=Object.create,i=Object.defineProperty,a=Object.getOwnPropertyDescriptor,o=Object.getOwnPropertyNames,s=Object.getPrototypeOf,c=Object.prototype.hasOwnProperty,l=(e,t)=>{for(var n in t)i(e,n,{get:t[n],enumerable:!0})},u=(e,t,n,r)=>{if(t&&typeof t==`object`||typeof t==`function`)for(let s of o(t))!c.call(e,s)&&s!==n&&i(e,s,{get:()=>t[s],enumerable:!(r=a(t,s))||r.enumerable});return e},d=(e,t,n)=>(n=e==null?{}:r(s(e)),u(t||!e||!e.__esModule?i(n,`default`,{value:e,enumerable:!0}):n,e)),f=e=>u(i({},`__esModule`,{value:!0}),e),p={};l(p,{DraggableCore:()=>we,default:()=>Te}),n.exports=f(p);var m=d(t()),h=d(no()),g=d(b()),_=Xo();function v(e,t){for(let n=0,r=e.length;n`u`)return``;let t=window.document?.documentElement?.style;if(!t||e in t)return``;for(let n=0;nt===e.identifier)||e.changedTouches&&v(e.changedTouches,e=>t===e.identifier)}function ie(e){if(e.targetTouches&&e.targetTouches[0])return e.targetTouches[0].identifier;if(e.changedTouches&&e.changedTouches[0])return e.changedTouches[0].identifier}function z(){return typeof __webpack_nonce__<`u`?__webpack_nonce__:void 0}function ae(e,t){if(!e)return;let n=e.getElementById(`react-draggable-style-el`);if(!n){n=e.createElement(`style`),n.type=`text/css`,n.id=`react-draggable-style-el`;let r=t??z();r&&n.setAttribute(`nonce`,r),n.innerHTML=`.react-draggable-transparent-selection *::-moz-selection {all: inherit;} +`,e.getElementsByTagName(`head`)[0].appendChild(n)}e.body&&Po(e.body,`react-draggable-transparent-selection`)}function Mo(e){window.requestAnimationFrame?window.requestAnimationFrame(()=>{No(e)}):No(e)}function No(e){if(e)try{e.body&&Fo(e.body,`react-draggable-transparent-selection`);let t=e.selection;if(t)t.empty();else{let t=(e.defaultView||window).getSelection();t&&t.type!==`Caret`&&t.removeAllRanges()}}catch{}}function Po(e,t){e.classList?e.classList.add(t):e.className.match(RegExp(`(?:^|\\s)${t}(?!\\S)`))||(e.className+=` ${t}`)}function Fo(e,t){e.classList?e.classList.remove(t):e.className=e.className.replace(RegExp(`(?:^|\\s)${t}(?!\\S)`,`g`),``)}function Io(e,t,n){if(!e.props.bounds)return[t,n];let{bounds:r}=e.props;r=typeof r==`string`?r:Uo(r);let i=Wo(e);if(typeof r==`string`){let{ownerDocument:e}=i,t=e.defaultView;if(!t)throw Error(`Cannot resolve the owner window of the draggable node.`);let n;if(n=r===`parent`?i.parentNode:i.getRootNode().querySelector(r),!(n instanceof t.HTMLElement))throw Error(`Bounds selector "`+r+`" could not find an element.`);let a=n,o=t.getComputedStyle(i),s=t.getComputedStyle(a);r={left:-i.offsetLeft+so(s.paddingLeft)+so(o.marginLeft),top:-i.offsetTop+so(s.paddingTop)+so(o.marginTop),right:Co(a)-xo(i)-i.offsetLeft+so(s.paddingRight)-so(o.marginRight),bottom:So(a)-bo(i)-i.offsetTop+so(s.paddingBottom)-so(o.marginBottom)}}return oo(r.right)&&(t=Math.min(t,r.right)),oo(r.bottom)&&(n=Math.min(n,r.bottom)),oo(r.left)&&(t=Math.max(t,r.left)),oo(r.top)&&(n=Math.max(n,r.top)),[t,n]}function Lo(e,t,n){return[Math.round(t/e[0])*e[0],Math.round(n/e[1])*e[1]]}function Ro(e){return e.props.axis===`both`||e.props.axis===`x`}function zo(e){return e.props.axis===`both`||e.props.axis===`y`}function Bo(e,t,n){let r=typeof t==`number`?Oo(e,t):null;if(typeof t==`number`&&!r)return null;let i=Wo(n),a=n.props.offsetParent||i.offsetParent||i.ownerDocument.body;return wo(r||e,a,n.props.scale)}function Vo(e,t,n){let r=!oo(e.lastX),i=Wo(e);return r?{node:i,deltaX:0,deltaY:0,lastX:t,lastY:n,x:t,y:n}:{node:i,deltaX:t-e.lastX,deltaY:n-e.lastY,lastX:e.lastX,lastY:e.lastY,x:t,y:n}}function Ho(e,t){let n=e.props.scale;return{node:t.node,x:e.state.x+t.deltaX/n,y:e.state.y+t.deltaY/n,deltaX:t.deltaX/n,deltaY:t.deltaY/n,lastX:e.state.x,lastY:e.state.y}}function Uo(e){return{left:e.left,top:e.top,right:e.right,bottom:e.bottom}}function Wo(e){let t=e.findDOMNode();if(!t)throw Error(`: Unmounted during event!`);return t}var Go=typeof process<`u`&&{}.DRAGGABLE_DEBUG?console.log.bind(console):function(){},Ko={touch:{start:`touchstart`,move:`touchmove`,stop:`touchend`},mouse:{start:`mousedown`,move:`mousemove`,stop:`mouseup`}},qo=Ko.mouse,Jo=class extends V.Component{constructor(){super(...arguments),this.dragging=!1,this.lastX=NaN,this.lastY=NaN,this.touchIdentifier=null,this.mounted=!1,this.handleDragStart=e=>{if(this.props.onMouseDown(e),!this.props.allowAnyClick&&(typeof e.button==`number`&&e.button!==0||e.ctrlKey))return!1;let t=this.findDOMNode();if(!t||!t.ownerDocument||!t.ownerDocument.body)throw Error(` not mounted on DragStart!`);let{ownerDocument:n}=t;if(this.props.disabled||!(e.target instanceof n.defaultView.Node)||this.props.handle&&!_o(e.target,this.props.handle,t)||this.props.cancel&&_o(e.target,this.props.cancel,t))return;e.type===`touchstart`&&!this.props.allowMobileScroll&&e.preventDefault();let r=ko(e);this.touchIdentifier=r;let i=Bo(e,r,this);if(i==null)return;let{x:a,y:o}=i,s=Vo(this,a,o);Go(`DraggableCore: handleDragStart: %j`,s),Go(`calling`,this.props.onStart),this.props.onStart(e,s)!==!1&&this.mounted!==!1&&(this.props.enableUserSelectHack&&jo(n,this.props.nonce),this.dragging=!0,this.lastX=a,this.lastY=o,vo(n,qo.move,this.handleDrag),vo(n,qo.stop,this.handleDragStop))},this.handleDrag=e=>{let t=Bo(e,this.touchIdentifier,this);if(t==null)return;let{x:n,y:r}=t;if(Array.isArray(this.props.grid)){let e=n-this.lastX,t=r-this.lastY;if([e,t]=Lo(this.props.grid,e,t),!e&&!t)return;n=this.lastX+e,r=this.lastY+t}let i=Vo(this,n,r);if(Go(`DraggableCore: handleDrag: %j`,i),this.props.onDrag(e,i)===!1||this.mounted===!1){try{this.handleDragStop(new MouseEvent(`mouseup`))}catch{let e=document.createEvent(`MouseEvents`);e.initMouseEvent(`mouseup`,!0,!0,window,0,0,0,0,0,!1,!1,!1,!1,0,null),this.handleDragStop(e)}return}this.lastX=n,this.lastY=r},this.handleDragStop=e=>{if(!this.dragging)return;let t=Bo(e,this.touchIdentifier,this);if(t==null)return;let{x:n,y:r}=t;if(Array.isArray(this.props.grid)){let e=n-this.lastX||0,t=r-this.lastY||0;[e,t]=Lo(this.props.grid,e,t),n=this.lastX+e,r=this.lastY+t}let i=Vo(this,n,r);if(this.props.onStop(e,i)===!1||this.mounted===!1)return!1;let a=this.findDOMNode();a&&this.props.enableUserSelectHack&&Mo(a.ownerDocument),Go(`DraggableCore: handleDragStop: %j`,i),this.dragging=!1,this.lastX=NaN,this.lastY=NaN,a&&(Go(`DraggableCore: Removing handlers`),yo(a.ownerDocument,qo.move,this.handleDrag),yo(a.ownerDocument,qo.stop,this.handleDragStop))},this.onMouseDown=e=>(qo=Ko.mouse,this.handleDragStart(e)),this.onMouseUp=e=>(qo=Ko.mouse,this.handleDragStop(e)),this.onTouchStart=e=>(qo=Ko.touch,this.handleDragStart(e)),this.onTouchEnd=e=>(qo=Ko.touch,this.handleDragStop(e))}componentDidMount(){this.mounted=!0;let e=this.findDOMNode();e&&vo(e,Ko.touch.start,this.onTouchStart,{passive:!1})}componentWillUnmount(){this.mounted=!1;let e=this.findDOMNode();if(e){let{ownerDocument:t}=e;yo(t,Ko.mouse.move,this.handleDrag),yo(t,Ko.touch.move,this.handleDrag),yo(t,Ko.mouse.stop,this.handleDragStop),yo(t,Ko.touch.stop,this.handleDragStop),yo(e,Ko.touch.start,this.onTouchStart,{passive:!1}),this.props.enableUserSelectHack&&Mo(t)}}findDOMNode(){if(this.props?.nodeRef)return this.props.nodeRef.current;let e=Gi.default;return typeof e.findDOMNode==`function`?e.findDOMNode(this):(Go(`react-draggable: ReactDOM.findDOMNode is not available in React 19+. You must provide a nodeRef prop. See: https://github.com/react-grid-layout/react-draggable#noderef`),null)}render(){return V.cloneElement(V.Children.only(this.props.children),{onMouseDown:this.onMouseDown,onMouseUp:this.onMouseUp,onTouchEnd:this.onTouchEnd})}};Jo.displayName=`DraggableCore`,Jo.propTypes={allowAnyClick:ro.default.bool,allowMobileScroll:ro.default.bool,children:ro.default.node.isRequired,disabled:ro.default.bool,enableUserSelectHack:ro.default.bool,offsetParent:function(e,t){if(e[t]&&e[t].nodeType!==1)throw Error(`Draggable's offsetParent must be a DOM Node.`)},grid:ro.default.arrayOf(ro.default.number),handle:ro.default.string,cancel:ro.default.string,nodeRef:ro.default.object,nonce:ro.default.string,onStart:ro.default.func,onDrag:ro.default.func,onStop:ro.default.func,onMouseDown:ro.default.func,scale:ro.default.number,className:co,style:co,transform:co},Jo.defaultProps={allowAnyClick:!1,allowMobileScroll:!1,disabled:!1,enableUserSelectHack:!0,onStart:function(){},onDrag:function(){},onStop:function(){},onMouseDown:function(){},scale:1};var Yo=class extends V.Component{constructor(e){super(e),this.onDragStart=(e,t)=>{if(Go(`Draggable: onDragStart: %j`,t),this.props.onStart(e,Ho(this,t))===!1)return!1;this.setState({dragging:!0,dragged:!0})},this.onDrag=(e,t)=>{if(!this.state.dragging)return!1;Go(`Draggable: onDrag: %j`,t);let n=Ho(this,t),r={x:n.x,y:n.y,slackX:0,slackY:0};if(this.props.bounds){let{x:e,y:t}=r;r.x+=this.state.slackX,r.y+=this.state.slackY;let[i,a]=Io(this,r.x,r.y);r.x=i,r.y=a,r.slackX=this.state.slackX+(e-r.x),r.slackY=this.state.slackY+(t-r.y),n.x=r.x,n.y=r.y,n.deltaX=r.x-this.state.x,n.deltaY=r.y-this.state.y}if(this.props.onDrag(e,n)===!1)return!1;this.setState(r)},this.onDragStop=(e,t)=>{if(!this.state.dragging||this.props.onStop(e,Ho(this,t))===!1)return!1;Go(`Draggable: onDragStop: %j`,t);let n={dragging:!1,slackX:0,slackY:0};if(this.props.position){let{x:e,y:t}=this.props.position;n.x=e,n.y=t}this.setState(n)},this.state={dragging:!1,dragged:!1,x:e.position?e.position.x:e.defaultPosition.x,y:e.position?e.position.y:e.defaultPosition.y,prevPropsPosition:{...e.position},slackX:0,slackY:0,isElementSVG:!1},e.position&&!(e.onDrag||e.onStop)&&console.warn("A `position` was applied to this , without drag handlers. This will make this component effectively undraggable. Please attach `onDrag` or `onStop` handlers so you can adjust the `position` of this element.")}static getDerivedStateFromProps({position:e},{prevPropsPosition:t}){return e&&(!t||e.x!==t.x||e.y!==t.y)?(Go(`Draggable: getDerivedStateFromProps %j`,{position:e,prevPropsPosition:t}),{x:e.x,y:e.y,prevPropsPosition:{...e}}):null}componentDidMount(){window.SVGElement!==void 0&&this.findDOMNode()instanceof window.SVGElement&&this.setState({isElementSVG:!0})}componentWillUnmount(){this.state.dragging&&this.setState({dragging:!1})}findDOMNode(){if(this.props?.nodeRef)return this.props.nodeRef.current;let e=Gi.default;return typeof e.findDOMNode==`function`?e.findDOMNode(this):null}render(){let{axis:e,bounds:t,children:n,defaultPosition:r,defaultClassName:i,defaultClassNameDragging:a,defaultClassNameDragged:o,position:s,positionOffset:c,scale:l,...u}=this.props,d={},f=null,p=!s||this.state.dragging,m=s||r,h={x:Ro(this)&&p?this.state.x:m.x,y:zo(this)&&p?this.state.y:m.y};this.state.isElementSVG?f=Eo(h,c):d=To(h,c);let g=V.Children.only(n),v=_(g.props.className||``,i,{[a]:this.state.dragging,[o]:this.state.dragged});return V.createElement(Jo,{...u,onStart:this.onDragStart,onDrag:this.onDrag,onStop:this.onDragStop},V.cloneElement(g,{className:v,style:{...g.props.style,...d},transform:f}))}};Yo.displayName=`Draggable`,Yo.propTypes={...Jo.propTypes,axis:ro.default.oneOf([`both`,`x`,`y`,`none`]),bounds:ro.default.oneOfType([ro.default.shape({left:ro.default.number,right:ro.default.number,top:ro.default.number,bottom:ro.default.number}),ro.default.string,ro.default.oneOf([!1])]),defaultClassName:ro.default.string,defaultClassNameDragging:ro.default.string,defaultClassNameDragged:ro.default.string,defaultPosition:ro.default.shape({x:ro.default.number,y:ro.default.number}),positionOffset:ro.default.shape({x:ro.default.oneOfType([ro.default.number,ro.default.string]),y:ro.default.oneOfType([ro.default.number,ro.default.string])}),position:ro.default.shape({x:ro.default.number,y:ro.default.number}),className:co,style:co,transform:co},Yo.defaultProps={...Jo.defaultProps,axis:`both`,bounds:!1,defaultClassName:`react-draggable`,defaultClassNameDragging:`react-draggable-dragging`,defaultClassNameDragged:`react-draggable-dragged`,defaultPosition:{x:0,y:0},scale:1};var Xo=e(((e,t)=>{function n(e){var t,r,i=``;if(typeof e==`string`||typeof e==`number`)i+=e;else if(typeof e==`object`){if(Array.isArray(e)){var a=e.length;for(t=0;t{var r=Object.create,i=Object.defineProperty,a=Object.getOwnPropertyDescriptor,o=Object.getOwnPropertyNames,s=Object.getPrototypeOf,c=Object.prototype.hasOwnProperty,l=(e,t)=>{for(var n in t)i(e,n,{get:t[n],enumerable:!0})},u=(e,t,n,r)=>{if(t&&typeof t==`object`||typeof t==`function`)for(let s of o(t))!c.call(e,s)&&s!==n&&i(e,s,{get:()=>t[s],enumerable:!(r=a(t,s))||r.enumerable});return e},d=(e,t,n)=>(n=e==null?{}:r(s(e)),u(t||!e||!e.__esModule?i(n,`default`,{value:e,enumerable:!0}):n,e)),f=e=>u(i({},`__esModule`,{value:!0}),e),p={};l(p,{DraggableCore:()=>we,default:()=>Te}),n.exports=f(p);var m=d(t()),h=d(no()),g=d(b()),_=Xo();function v(e,t){for(let n=0,r=e.length;n`u`)return``;let t=window.document?.documentElement?.style;if(!t||e in t)return``;for(let n=0;nt===e.identifier)||e.changedTouches&&v(e.changedTouches,e=>t===e.identifier)}function ae(e){if(e.targetTouches&&e.targetTouches[0])return e.targetTouches[0].identifier;if(e.changedTouches&&e.changedTouches[0])return e.changedTouches[0].identifier}function R(){return typeof __webpack_nonce__<`u`?__webpack_nonce__:void 0}function oe(e,t){if(!e)return;let n=e.getElementById(`react-draggable-style-el`);if(!n){n=e.createElement(`style`),n.type=`text/css`,n.id=`react-draggable-style-el`;let r=t??R();r&&n.setAttribute(`nonce`,r),n.innerHTML=`.react-draggable-transparent-selection *::-moz-selection {all: inherit;} `,n.innerHTML+=`.react-draggable-transparent-selection *::selection {all: inherit;} -`,e.getElementsByTagName(`head`)[0].appendChild(n)}e.body&&se(e.body,`react-draggable-transparent-selection`)}function B(e){window.requestAnimationFrame?window.requestAnimationFrame(()=>{oe(e)}):oe(e)}function oe(e){if(e)try{e.body&&ce(e.body,`react-draggable-transparent-selection`);let t=e.selection;if(t)t.empty();else{let t=(e.defaultView||window).getSelection();t&&t.type!==`Caret`&&t.removeAllRanges()}}catch{}}function se(e,t){e.classList?e.classList.add(t):e.className.match(RegExp(`(?:^|\\s)${t}(?!\\S)`))||(e.className+=` ${t}`)}function ce(e,t){e.classList?e.classList.remove(t):e.className=e.className.replace(RegExp(`(?:^|\\s)${t}(?!\\S)`,`g`),``)}function le(e,t,n){if(!e.props.bounds)return[t,n];let{bounds:r}=e.props;r=typeof r==`string`?r:ge(r);let i=_e(e);if(typeof r==`string`){let{ownerDocument:e}=i,t=e.defaultView;if(!t)throw Error(`Cannot resolve the owner window of the draggable node.`);let n;if(n=r===`parent`?i.parentNode:i.getRootNode().querySelector(r),!(n instanceof t.HTMLElement))throw Error(`Bounds selector "`+r+`" could not find an element.`);let a=n,o=t.getComputedStyle(i),s=t.getComputedStyle(a);r={left:-i.offsetLeft+S(s.paddingLeft)+S(o.marginLeft),top:-i.offsetTop+S(s.paddingTop)+S(o.marginTop),right:L(a)-F(i)-i.offsetLeft+S(s.paddingRight)-S(o.marginRight),bottom:I(a)-P(i)-i.offsetTop+S(s.paddingBottom)-S(o.marginBottom)}}return x(r.right)&&(t=Math.min(t,r.right)),x(r.bottom)&&(n=Math.min(n,r.bottom)),x(r.left)&&(t=Math.max(t,r.left)),x(r.top)&&(n=Math.max(n,r.top)),[t,n]}function ue(e,t,n){return[Math.round(t/e[0])*e[0],Math.round(n/e[1])*e[1]]}function de(e){return e.props.axis===`both`||e.props.axis===`x`}function fe(e){return e.props.axis===`both`||e.props.axis===`y`}function pe(e,t,n){let r=typeof t==`number`?re(e,t):null;if(typeof t==`number`&&!r)return null;let i=_e(n),a=n.props.offsetParent||i.offsetParent||i.ownerDocument.body;return ee(r||e,a,n.props.scale)}function me(e,t,n){let r=!x(e.lastX),i=_e(e);return r?{node:i,deltaX:0,deltaY:0,lastX:t,lastY:n,x:t,y:n}:{node:i,deltaX:t-e.lastX,deltaY:n-e.lastY,lastX:e.lastX,lastY:e.lastY,x:t,y:n}}function he(e,t){let n=e.props.scale;return{node:t.node,x:e.state.x+t.deltaX/n,y:e.state.y+t.deltaY/n,deltaX:t.deltaX/n,deltaY:t.deltaY/n,lastX:e.state.x,lastY:e.state.y}}function ge(e){return{left:e.left,top:e.top,right:e.right,bottom:e.bottom}}function _e(e){let t=e.findDOMNode();if(!t)throw Error(`: Unmounted during event!`);return t}var ve=d(t()),ye=d(no()),be=d(b()),xe=typeof process<`u`&&{}.DRAGGABLE_DEBUG?console.log.bind(console):function(){},Se={touch:{start:`touchstart`,move:`touchmove`,stop:`touchend`},mouse:{start:`mousedown`,move:`mousemove`,stop:`mouseup`}},Ce=Se.mouse,we=class extends ve.Component{constructor(){super(...arguments),this.dragging=!1,this.lastX=NaN,this.lastY=NaN,this.touchIdentifier=null,this.mounted=!1,this.handleDragStart=e=>{if(this.props.onMouseDown(e),!this.props.allowAnyClick&&(typeof e.button==`number`&&e.button!==0||e.ctrlKey))return!1;let t=this.findDOMNode();if(!t||!t.ownerDocument||!t.ownerDocument.body)throw Error(` not mounted on DragStart!`);let{ownerDocument:n}=t;if(this.props.disabled||!(e.target instanceof n.defaultView.Node)||this.props.handle&&!j(e.target,this.props.handle,t)||this.props.cancel&&j(e.target,this.props.cancel,t))return;e.type===`touchstart`&&!this.props.allowMobileScroll&&e.preventDefault();let r=ie(e);this.touchIdentifier=r;let i=pe(e,r,this);if(i==null)return;let{x:a,y:o}=i,s=me(this,a,o);xe(`DraggableCore: handleDragStart: %j`,s),xe(`calling`,this.props.onStart),this.props.onStart(e,s)!==!1&&this.mounted!==!1&&(this.props.enableUserSelectHack&&ae(n,this.props.nonce),this.dragging=!0,this.lastX=a,this.lastY=o,M(n,Ce.move,this.handleDrag),M(n,Ce.stop,this.handleDragStop))},this.handleDrag=e=>{let t=pe(e,this.touchIdentifier,this);if(t==null)return;let{x:n,y:r}=t;if(Array.isArray(this.props.grid)){let e=n-this.lastX,t=r-this.lastY;if([e,t]=ue(this.props.grid,e,t),!e&&!t)return;n=this.lastX+e,r=this.lastY+t}let i=me(this,n,r);if(xe(`DraggableCore: handleDrag: %j`,i),this.props.onDrag(e,i)===!1||this.mounted===!1){try{this.handleDragStop(new MouseEvent(`mouseup`))}catch{let e=document.createEvent(`MouseEvents`);e.initMouseEvent(`mouseup`,!0,!0,window,0,0,0,0,0,!1,!1,!1,!1,0,null),this.handleDragStop(e)}return}this.lastX=n,this.lastY=r},this.handleDragStop=e=>{if(!this.dragging)return;let t=pe(e,this.touchIdentifier,this);if(t==null)return;let{x:n,y:r}=t;if(Array.isArray(this.props.grid)){let e=n-this.lastX||0,t=r-this.lastY||0;[e,t]=ue(this.props.grid,e,t),n=this.lastX+e,r=this.lastY+t}let i=me(this,n,r);if(this.props.onStop(e,i)===!1||this.mounted===!1)return!1;let a=this.findDOMNode();a&&this.props.enableUserSelectHack&&B(a.ownerDocument),xe(`DraggableCore: handleDragStop: %j`,i),this.dragging=!1,this.lastX=NaN,this.lastY=NaN,a&&(xe(`DraggableCore: Removing handlers`),N(a.ownerDocument,Ce.move,this.handleDrag),N(a.ownerDocument,Ce.stop,this.handleDragStop))},this.onMouseDown=e=>(Ce=Se.mouse,this.handleDragStart(e)),this.onMouseUp=e=>(Ce=Se.mouse,this.handleDragStop(e)),this.onTouchStart=e=>(Ce=Se.touch,this.handleDragStart(e)),this.onTouchEnd=e=>(Ce=Se.touch,this.handleDragStop(e))}componentDidMount(){this.mounted=!0;let e=this.findDOMNode();e&&M(e,Se.touch.start,this.onTouchStart,{passive:!1})}componentWillUnmount(){this.mounted=!1;let e=this.findDOMNode();if(e){let{ownerDocument:t}=e;N(t,Se.mouse.move,this.handleDrag),N(t,Se.touch.move,this.handleDrag),N(t,Se.mouse.stop,this.handleDragStop),N(t,Se.touch.stop,this.handleDragStop),N(e,Se.touch.start,this.onTouchStart,{passive:!1}),this.props.enableUserSelectHack&&B(t)}}findDOMNode(){if(this.props?.nodeRef)return this.props.nodeRef.current;let e=be.default;return typeof e.findDOMNode==`function`?e.findDOMNode(this):(xe(`react-draggable: ReactDOM.findDOMNode is not available in React 19+. You must provide a nodeRef prop. See: https://github.com/react-grid-layout/react-draggable#noderef`),null)}render(){return ve.cloneElement(ve.Children.only(this.props.children),{onMouseDown:this.onMouseDown,onMouseUp:this.onMouseUp,onTouchEnd:this.onTouchEnd})}};we.displayName=`DraggableCore`,we.propTypes={allowAnyClick:ye.default.bool,allowMobileScroll:ye.default.bool,children:ye.default.node.isRequired,disabled:ye.default.bool,enableUserSelectHack:ye.default.bool,offsetParent:function(e,t){if(e[t]&&e[t].nodeType!==1)throw Error(`Draggable's offsetParent must be a DOM Node.`)},grid:ye.default.arrayOf(ye.default.number),handle:ye.default.string,cancel:ye.default.string,nodeRef:ye.default.object,nonce:ye.default.string,onStart:ye.default.func,onDrag:ye.default.func,onStop:ye.default.func,onMouseDown:ye.default.func,scale:ye.default.number,className:C,style:C,transform:C},we.defaultProps={allowAnyClick:!1,allowMobileScroll:!1,disabled:!1,enableUserSelectHack:!0,onStart:function(){},onDrag:function(){},onStop:function(){},onMouseDown:function(){},scale:1};var Te=class extends m.Component{constructor(e){super(e),this.onDragStart=(e,t)=>{if(xe(`Draggable: onDragStart: %j`,t),this.props.onStart(e,he(this,t))===!1)return!1;this.setState({dragging:!0,dragged:!0})},this.onDrag=(e,t)=>{if(!this.state.dragging)return!1;xe(`Draggable: onDrag: %j`,t);let n=he(this,t),r={x:n.x,y:n.y,slackX:0,slackY:0};if(this.props.bounds){let{x:e,y:t}=r;r.x+=this.state.slackX,r.y+=this.state.slackY;let[i,a]=le(this,r.x,r.y);r.x=i,r.y=a,r.slackX=this.state.slackX+(e-r.x),r.slackY=this.state.slackY+(t-r.y),n.x=r.x,n.y=r.y,n.deltaX=r.x-this.state.x,n.deltaY=r.y-this.state.y}if(this.props.onDrag(e,n)===!1)return!1;this.setState(r)},this.onDragStop=(e,t)=>{if(!this.state.dragging||this.props.onStop(e,he(this,t))===!1)return!1;xe(`Draggable: onDragStop: %j`,t);let n={dragging:!1,slackX:0,slackY:0};if(this.props.position){let{x:e,y:t}=this.props.position;n.x=e,n.y=t}this.setState(n)},this.state={dragging:!1,dragged:!1,x:e.position?e.position.x:e.defaultPosition.x,y:e.position?e.position.y:e.defaultPosition.y,prevPropsPosition:{...e.position},slackX:0,slackY:0,isElementSVG:!1},e.position&&!(e.onDrag||e.onStop)&&console.warn("A `position` was applied to this , without drag handlers. This will make this component effectively undraggable. Please attach `onDrag` or `onStop` handlers so you can adjust the `position` of this element.")}static getDerivedStateFromProps({position:e},{prevPropsPosition:t}){return e&&(!t||e.x!==t.x||e.y!==t.y)?(xe(`Draggable: getDerivedStateFromProps %j`,{position:e,prevPropsPosition:t}),{x:e.x,y:e.y,prevPropsPosition:{...e}}):null}componentDidMount(){window.SVGElement!==void 0&&this.findDOMNode()instanceof window.SVGElement&&this.setState({isElementSVG:!0})}componentWillUnmount(){this.state.dragging&&this.setState({dragging:!1})}findDOMNode(){if(this.props?.nodeRef)return this.props.nodeRef.current;let e=g.default;return typeof e.findDOMNode==`function`?e.findDOMNode(this):null}render(){let{axis:e,bounds:t,children:n,defaultPosition:r,defaultClassName:i,defaultClassNameDragging:a,defaultClassNameDragged:o,position:s,positionOffset:c,scale:l,...u}=this.props,d={},f=null,p=!s||this.state.dragging,h=s||r,g={x:de(this)&&p?this.state.x:h.x,y:fe(this)&&p?this.state.y:h.y};this.state.isElementSVG?f=te(g,c):d=R(g,c);let v=m.Children.only(n),y=(0,_.clsx)(v.props.className||``,i,{[a]:this.state.dragging,[o]:this.state.dragged});return m.createElement(we,{...u,onStart:this.onDragStart,onDrag:this.onDrag,onStop:this.onDragStop},m.cloneElement(v,{className:y,style:{...v.props.style,...d},transform:f}))}};Te.displayName=`Draggable`,Te.propTypes={...we.propTypes,axis:h.default.oneOf([`both`,`x`,`y`,`none`]),bounds:h.default.oneOfType([h.default.shape({left:h.default.number,right:h.default.number,top:h.default.number,bottom:h.default.number}),h.default.string,h.default.oneOf([!1])]),defaultClassName:h.default.string,defaultClassNameDragging:h.default.string,defaultClassNameDragged:h.default.string,defaultPosition:h.default.shape({x:h.default.number,y:h.default.number}),positionOffset:h.default.shape({x:h.default.oneOfType([h.default.number,h.default.string]),y:h.default.oneOfType([h.default.number,h.default.string])}),position:h.default.shape({x:h.default.number,y:h.default.number}),className:C,style:C,transform:C},Te.defaultProps={...we.defaultProps,axis:`both`,bounds:!1,defaultClassName:`react-draggable`,defaultClassNameDragging:`react-draggable-dragging`,defaultClassNameDragged:`react-draggable-dragged`,defaultPosition:{x:0,y:0},scale:1},0&&(n.exports={DraggableCore:we})})),Qo=e(((e,t)=>{var n=Zo(),r=n.DraggableCore,i=n.default||n;t.exports=i,t.exports.default=i,t.exports.DraggableCore=r})),$o=e((e=>{e.__esModule=!0,e.cloneElement=l;var n=r(t());function r(e){return e&&e.__esModule?e:{default:e}}function i(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function a(e){for(var t=1;t{e.__esModule=!0,e.resizableProps=void 0;var t=n(no());Qo();function n(e){return e&&e.__esModule?e:{default:e}}e.resizableProps={axis:t.default.oneOf([`both`,`x`,`y`,`none`]),className:t.default.string,children:t.default.element.isRequired,draggableOpts:t.default.shape({allowAnyClick:t.default.bool,cancel:t.default.string,children:t.default.node,disabled:t.default.bool,enableUserSelectHack:t.default.bool,offsetParent:typeof Element<`u`?t.default.instanceOf(Element):t.default.any,grid:t.default.arrayOf(t.default.number),handle:t.default.string,nodeRef:t.default.object,onStart:t.default.func,onDrag:t.default.func,onStop:t.default.func,onMouseDown:t.default.func,scale:t.default.number}),height:function(){var e=[...arguments];let n=e[0];return n.axis===`both`||n.axis===`y`?t.default.number.isRequired(...e):t.default.number(...e)},handle:t.default.oneOfType([t.default.node,t.default.func]),handleSize:t.default.arrayOf(t.default.number),lockAspectRatio:t.default.bool,maxConstraints:t.default.arrayOf(t.default.number),minConstraints:t.default.arrayOf(t.default.number),onResizeStop:t.default.func,onResizeStart:t.default.func,onResize:t.default.func,resizeHandles:t.default.arrayOf(t.default.oneOf([`s`,`w`,`e`,`n`,`sw`,`nw`,`se`,`ne`])),transformScale:t.default.number,width:function(){var e=[...arguments];let n=e[0];return n.axis===`both`||n.axis===`x`?t.default.number.isRequired(...e):t.default.number(...e)}}})),ts=e((e=>{e.__esModule=!0,e.default=void 0;var n=s(t()),r=Qo(),i=$o(),a=es(),o=[`children`,`className`,`draggableOpts`,`width`,`height`,`handle`,`handleSize`,`lockAspectRatio`,`axis`,`minConstraints`,`maxConstraints`,`onResize`,`onResizeStop`,`onResizeStart`,`resizeHandles`,`transformScale`];function s(e,t){if(typeof WeakMap==`function`)var n=new WeakMap,r=new WeakMap;return(s=function(e,t){if(!t&&e&&e.__esModule)return e;var i,a,o={__proto__:null,default:e};if(e===null||typeof e!=`object`&&typeof e!=`function`)return o;if(i=t?r:n){if(i.has(e))return i.get(e);i.set(e,o)}for(let t in e)t!=="default"&&{}.hasOwnProperty.call(e,t)&&((a=(i=Object.defineProperty)&&Object.getOwnPropertyDescriptor(e,t))&&(a.get||a.set)?i(o,t,a):o[t]=e[t]);return o})(e,t)}function c(){return c=Object.assign?Object.assign.bind():function(e){for(var t=1;tMath.abs(i*n)?t=e/n:e=t*n}let o=e,s=t,c=this.slack||[0,0],l=c[0],u=c[1];return e+=l,t+=u,r&&(e=Math.max(r[0],e),t=Math.max(r[1],t)),i&&(e=Math.min(i[0],e),t=Math.min(i[1],t)),this.slack=[l+(o-e),u+(s-t)],[e,t]}resizeHandler(e,t){return(n,r)=>{let i=r.node,a=r.deltaX,o=r.deltaY;e===`onResizeStart`&&this.resetData();let s=(this.props.axis===`both`||this.props.axis===`x`)&&t!==`n`&&t!==`s`,c=(this.props.axis===`both`||this.props.axis===`y`)&&t!==`e`&&t!==`w`;if(!s&&!c)return;let l=t[0],u=t[t.length-1],d=i.getBoundingClientRect();if(this.lastHandleRect!=null){if(u===`w`){let e=d.left-this.lastHandleRect.left;a+=e}if(l===`n`){let e=d.top-this.lastHandleRect.top;o+=e}}this.lastHandleRect=d,u===`w`&&(a=-a),l===`n`&&(o=-o);let f=this.lastSize?.width??this.props.width,p=this.lastSize?.height??this.props.height,m=f+(s?a/this.props.transformScale:0),h=p+(c?o/this.props.transformScale:0);var g=this.runConstraints(m,h);if(m=g[0],h=g[1],e===`onResizeStop`&&this.lastSize){var _=this.lastSize;m=_.width,h=_.height}let v=m!==f||h!==p;e!==`onResizeStop`&&(this.lastSize={width:m,height:h});let y=typeof this.props[e]==`function`?this.props[e]:null;y&&(e!==`onResize`||v)&&(n.persist==null||n.persist(),y(n,{node:i,size:{width:m,height:h},handle:t})),e===`onResizeStop`&&this.resetData()}}renderResizeHandle(e,t){let r=this.props.handle;if(!r)return n.createElement(`span`,{className:`react-resizable-handle react-resizable-handle-`+e,ref:t});if(typeof r==`function`)return r(e,t);let i=typeof r.type==`string`,a=d({ref:t},i?{}:{handleAxis:e});return n.cloneElement(r,a)}render(){let e=this.props,t=e.children,a=e.className,s=e.draggableOpts;e.width,e.height,e.handle,e.handleSize,e.lockAspectRatio,e.axis,e.minConstraints,e.maxConstraints,e.onResize,e.onResizeStop,e.onResizeStart;let u=e.resizeHandles;e.transformScale;let f=l(e,o);return(0,i.cloneElement)(t,d(d({},f),{},{className:(a?a+` `:``)+`react-resizable`,children:[...n.Children.toArray(t.props.children),...u.map(e=>{let t=this.handleRefs[e]??(this.handleRefs[e]=n.createRef());return n.createElement(r.DraggableCore,c({},s,{nodeRef:t,key:`resizableHandle-`+e,onStop:this.resizeHandler(`onResizeStop`,e),onStart:this.resizeHandler(`onResizeStart`,e),onDrag:this.resizeHandler(`onResize`,e)}),this.renderResizeHandle(e,t))})]}))}};e.default=h,h.propTypes=a.resizableProps,h.defaultProps={axis:`both`,handleSize:[20,20],lockAspectRatio:!1,minConstraints:[20,20],maxConstraints:[1/0,1/0],resizeHandles:[`se`],transformScale:1}})),ns=e((e=>{e.__esModule=!0,e.default=void 0;var n=c(t()),r=s(no()),i=s(ts()),a=es(),o=[`handle`,`handleSize`,`onResize`,`onResizeStart`,`onResizeStop`,`draggableOpts`,`minConstraints`,`maxConstraints`,`lockAspectRatio`,`axis`,`width`,`height`,`resizeHandles`,`style`,`transformScale`];function s(e){return e&&e.__esModule?e:{default:e}}function c(e,t){if(typeof WeakMap==`function`)var n=new WeakMap,r=new WeakMap;return(c=function(e,t){if(!t&&e&&e.__esModule)return e;var i,a,o={__proto__:null,default:e};if(e===null||typeof e!=`object`&&typeof e!=`function`)return o;if(i=t?r:n){if(i.has(e))return i.get(e);i.set(e,o)}for(let t in e)t!=="default"&&{}.hasOwnProperty.call(e,t)&&((a=(i=Object.defineProperty)&&Object.getOwnPropertyDescriptor(e,t))&&(a.get||a.set)?i(o,t,a):o[t]=e[t]);return o})(e,t)}function l(){return l=Object.assign?Object.assign.bind():function(e){for(var t=1;t{let n=t.size;this.props.onResize?(e.persist==null||e.persist(),this.setState(n,()=>this.props.onResize&&this.props.onResize(e,t))):this.setState(n)}}static getDerivedStateFromProps(e,t){return t.propsWidth!==e.width||t.propsHeight!==e.height?{width:e.width,height:e.height,propsWidth:e.width,propsHeight:e.height}:null}render(){let e=this.props,t=e.handle,r=e.handleSize;e.onResize;let a=e.onResizeStart,s=e.onResizeStop,c=e.draggableOpts,u=e.minConstraints,f=e.maxConstraints,p=e.lockAspectRatio,m=e.axis;e.width,e.height;let g=e.resizeHandles,_=e.style,v=e.transformScale,y=h(e,o);return n.createElement(i.default,{axis:m,draggableOpts:c,handle:t,handleSize:r,height:this.state.height,lockAspectRatio:p,maxConstraints:f,minConstraints:u,onResizeStart:a,onResize:this.onResize,onResizeStop:s,resizeHandles:g,transformScale:v,width:this.state.width},n.createElement(`div`,l({},y,{style:d(d({},_),{},{width:this.state.width+`px`,height:this.state.height+`px`})})))}};e.default=g,g.propTypes=d(d({},a.resizableProps),{},{children:r.default.element})})),rs=e(((e,t)=>{t.exports=function(){throw Error(`Don't instantiate Resizable directly! Use require('react-resizable').Resizable`)},t.exports.Resizable=ts().default,t.exports.ResizableBox=ns().default}))(),is=$a(),as=50,os=12;function ss(e){let t=e;for(;t;){let e=window.getComputedStyle(t).overflowY;if((e===`auto`||e===`scroll`)&&t.scrollHeight>t.clientHeight)return t;t=t.parentElement}return null}function cs(e){let t=ss(e),n=null,r=0,i=0,a=!1;function o(){let e=t;if(!e)return;let s=e.getBoundingClientRect(),{clientHeight:c,scrollTop:l,scrollHeight:u}=e,{scrollLeft:d,scrollWidth:f,clientWidth:p}=e,m=0,h=0;i0?m=-os:i>s.bottom-as&&l+c0?h=-os:r>s.right-as&&d+p({cols:n,containerPadding:a,containerWidth:r,margin:i,maxRows:s,rowHeight:o}),[n,a,r,i,s,o]),ye=(0,V.useMemo)(()=>({cols:n,maxRows:s,containerWidth:r,containerHeight:0,rowHeight:o,margin:i,layout:[]}),[n,s,r,o,i]),be=(0,V.useCallback)(e=>({...ye,containerHeight:e??ye.containerHeight,layout:de.current}),[ye]),xe=(0,V.useMemo)(()=>I??{i:M,x:w,y:T,w:E,h:D,minW:O,maxW:k,minH:A,maxH:j},[I,M,w,T,E,D,O,k,A,j]),Se=(0,V.useCallback)(e=>{if(g?.calcStyle)return g.calcStyle(e);if(p)return ba(e);let t=xa(e);return m?{...t,left:Sa(e.left/r),width:Sa(e.width/r)}:t},[g,p,m,r]),Ce=(0,V.useCallback)((e,{node:t})=>{if(!ee)return;let{offsetParent:n}=t;if(!n)return;let r=n.getBoundingClientRect(),i=t.getBoundingClientRect(),a=i.left/h,o=r.left/h,s=i.top/h,c=r.top/h,l;if(g?.calcDragPosition){let t=e;l=g.calcDragPosition(t.clientX,t.clientY,t.clientX-i.left,t.clientY-i.top)}else l={left:a-o+n.scrollLeft,top:s-c+n.scrollTop};if(ce.current=l,_e.current||=cs(t instanceof HTMLElement?t:null),v>0){let t=e;he.current={x:t.clientX,y:t.clientY},me.current=!0,ge.current=!1,ae(!0);return}ae(!0);let u=Zi(ve,l.top,l.left),{x:d,y:f}=va(F,xe,u.x,u.y,be());ee(M,d,f,{e,node:t,newPosition:l})},[ee,h,ve,g,v,F,xe,be,M]),we=(0,V.useCallback)((e,{node:t,deltaX:n,deltaY:a})=>{if(!R||!z)return;let s=e;if(me.current&&!ge.current){let n=s.clientX-he.current.x,r=s.clientY-he.current.y;if(Math.hypot(n,r){if(!te||!z)return;_e.current?.stop(),_e.current=null;let n=me.current;if(me.current=!1,ge.current=!1,he.current={x:0,y:0},n){ae(!1),ce.current={left:0,top:0};return}let{left:r,top:i}=ce.current,a={top:i,left:r};ae(!1),ce.current={left:0,top:0};let o=Zi(ve,i,r),{x:s,y:c}=va(F,xe,o.x,o.y,be());te(M,s,c,{e,node:t,newPosition:a})},[te,z,ve,F,xe,be,M]);fe.current=Ce,pe.current=we;let Ee=(0,V.useCallback)((e,{node:t,size:n,handle:i},a,o)=>{let s=o===`onResizeStart`?ne:o===`onResize`?re:ie;if(!s)return;let c;c=t?Ma(i,a,n,r):{...n,top:a.top,left:a.left},le.current=c;let l=t?.offsetParent?.clientHeight??0,u=Qi(ve,c.width,c.height),{w:d,h:f}=ya(F,xe,u.w,u.h,i,be(l));s(M,d,f,{e:e.nativeEvent??e,node:t,size:c,handle:i})},[ne,re,ie,r,ve,M,F,xe,be]),De=(0,V.useCallback)((e,t)=>{oe(!0);let n=Yi(ve,w,T,E,D),r={...t,handle:t.handle};Ee(e,r,n,`onResizeStart`)},[Ee,ve,w,T,E,D]),Oe=(0,V.useCallback)((e,t)=>{let n=Yi(ve,w,T,E,D),r={...t,handle:t.handle};Ee(e,r,n,`onResize`)},[Ee,ve,w,T,E,D]),ke=(0,V.useCallback)((e,t)=>{oe(!1),le.current={top:0,left:0,width:0,height:0};let n=Yi(ve,w,T,E,D),r={...t,handle:t.handle};Ee(e,r,n,`onResizeStop`)},[Ee,ve,w,T,E,D]);(0,V.useEffect)(()=>{if(!y)return;let e=se.current;if(!e)return;let t=ue.current||{left:0,top:0},n=z&&(y.left!==t.left||y.top!==t.top);if(!z){let t={node:e,deltaX:y.left,deltaY:y.top,lastX:0,lastY:0,x:y.left,y:y.top};fe.current?.(y.e,t)}else if(n){let t={node:e,deltaX:y.left-ce.current.left,deltaY:y.top-ce.current.top,lastX:ce.current.left,lastY:ce.current.top,x:y.left,y:y.top};pe.current?.(y.e,t)}ue.current=y},[y,z,M]);let Ae=Yi(ve,w,T,E,D,z?ce.current:null,B?le.current:null),je=V.Children.only(t),Me=qi(ve),Ne=[Ji(O,Me,i[0]),Ji(A,o,i[1])],Pe=[Ji(k,Me,i[0]),Ji(j,o,i[1])],Fe=je.props,Ie=Fe.className,Le=Fe.style,Re=V.cloneElement(je,{ref:se,className:_(`react-grid-item`,Ie,b,{static:f,resizing:B,"react-draggable":c,"react-draggable-dragging":z,dropping:!!y,cssTransforms:p}),style:{...x,...Le,...Se(Ae)}}),ze=P;return Re=(0,H.jsx)(rs.Resizable,{draggableOpts:{disabled:!l},className:l?void 0:`react-resizable-hide`,width:Ae.width,height:Ae.height,minConstraints:Ne,maxConstraints:Pe,onResizeStart:De,onResize:Oe,onResizeStop:ke,transformScale:h,resizeHandles:N,handle:ze,children:Re}),Re=(0,H.jsx)(Jo,{disabled:!c,onStart:Ce,onDrag:we,onStop:Te,handle:S,cancel:`.react-resizable-handle`+(C?`,`+C:``),scale:h,allowMobileScroll:d,nodeRef:se,children:Re}),Re}var us=V.memo(ls,(e,t)=>e.x===t.x&&e.y===t.y&&e.w===t.w&&e.h===t.h&&e.minW===t.minW&&e.maxW===t.maxW&&e.minH===t.minH&&e.maxH===t.maxH&&e.cols===t.cols&&e.containerWidth===t.containerWidth&&e.rowHeight===t.rowHeight&&e.maxRows===t.maxRows&&e.margin===t.margin&&e.containerPadding===t.containerPadding&&e.transformScale===t.transformScale&&e.isDraggable===t.isDraggable&&e.isResizable===t.isResizable&&e.isBounded===t.isBounded&&e.allowMobileScroll===t.allowMobileScroll&&e.useCSSTransforms===t.useCSSTransforms&&e.usePercentages===t.usePercentages&&e.children===t.children&&e.onDrag===t.onDrag&&e.onDragStop===t.onDragStop&&e.onResize===t.onResize&&e.onResizeStop===t.onResizeStop&&e.droppingPosition===t.droppingPosition);us.displayName=`GridItem`;function ds(e){let{clientX:t,clientY:n,gridElement:r,droppingItem:i,event:a,dragOffsetX:o=0,dragOffsetY:s=0,transformScale:c,cols:l,margin:u,maxRows:d,rowHeight:f,width:p,containerPadding:m}=e,h=r.getBoundingClientRect(),g={cols:l,margin:u,maxRows:d,rowHeight:f,containerWidth:p,containerPadding:m},_=qi(g),v=Ji(i.w,_,u[0]),y=Ji(i.h,f,u[1]),b=v/2,x=y/2,S=r.scrollLeft??0,C=r.scrollTop??0,w=t-h.left+S+o-b,T=n-h.top+C+s-x,E=Math.max(0,w),D=Math.max(0,T);return{newDroppingPosition:{left:E/c,top:D/c,e:a},calculatedXY:Xi(g,D,E,i.w,i.h)}}var fs=()=>{},ps=`react-grid-layout`,ms=!1;try{ms=/firefox/i.test(navigator.userAgent)}catch{}function hs(e,t){let n=V.Children.toArray(e),r=V.Children.toArray(t);if(n.length!==r.length)return!1;for(let e=0;e{if(!V.isValidElement(t)||t.key===null)return;let n=String(t.key);a.add(n);let r=e.find(e=>e.i===n);if(r)i.push(la(r));else{let e=t.props[`data-grid`];e?i.push({i:n,x:e.x??0,y:e.y??0,w:e.w??1,h:e.h??1,minW:e.minW,maxW:e.maxW,minH:e.minH,maxH:e.maxH,static:e.static,isDraggable:e.isDraggable,isResizable:e.isResizable,resizeHandles:e.resizeHandles,isBounded:e.isBounded}):i.push({i:n,x:0,y:oa(i),w:1,h:1})}});let o=pa(i,{cols:n});return r.compact(o,n)}function _s(e){let{children:t,width:n,gridConfig:r,dragConfig:i,resizeConfig:a,dropConfig:o,positionStrategy:s=Na,compactor:c,constraints:l=_a,layout:u=[],droppingItem:d,autoSize:f=!0,className:p=``,style:m={},innerRef:h,onLayoutChange:g=fs,onDragStart:v=fs,onDrag:y=fs,onDragStop:b=fs,onResizeStart:x=fs,onResize:S=fs,onResizeStop:C=fs,onDrop:w=fs,onDropDragOver:T=fs}=e,E=(0,V.useMemo)(()=>({...Pa,...r}),[r]),D=(0,V.useMemo)(()=>({...Fa,...i}),[i]),O=(0,V.useMemo)(()=>({...Ia,...a}),[a]),k=(0,V.useMemo)(()=>({...La,...o}),[o]),{cols:A,rowHeight:j,maxRows:M,margin:N,containerPadding:P}=E,{enabled:F,bounded:I,handle:L,cancel:ee,threshold:R,allowMobileScroll:te}=D,{enabled:ne,handles:re,handleComponent:ie}=O,{enabled:z,defaultItem:ae,onDragOver:B,touchEnabled:oe=!0,touchDragSource:se=`[data-rgl-draggable]`}=k,ce=c??qa(`vertical`),le=ce.type,ue=ce.allowOverlap,de=ce.preventCollision??!1,fe=(0,V.useMemo)(()=>d??{i:`__dropping-elem__`,...ae},[d,ae]),pe=s.type===`transform`,me=s.scale,he=P??N,[ge,_e]=(0,V.useState)(!1),[ve,ye]=(0,V.useState)(()=>gs(u,t,A,ce)),[be,xe]=(0,V.useState)(null),[Se,Ce]=(0,V.useState)(!1),[we,Te]=(0,V.useState)(null),[Ee,De]=(0,V.useState)(),Oe=(0,V.useRef)(void 0);Oe.current=Ee;let ke=(0,V.useRef)(null),Ae=(0,V.useRef)(null),je=(0,V.useRef)(null),Me=(0,V.useRef)(0),Ne=(0,V.useRef)(ve),Pe=(0,V.useRef)(u),Fe=(0,V.useRef)(t),Ie=(0,V.useRef)(le),Le=(0,V.useRef)(null),Re=(0,V.useRef)(!1),ze=(0,V.useRef)(null),Be=(0,V.useRef)(null);Be.current=we;let Ve=(0,V.useRef)(w);(0,V.useLayoutEffect)(()=>{Ve.current=w});let He=(0,V.useRef)(ve);He.current=ve,(0,V.useEffect)(()=>{_e(!0),(0,is.deepEqual)(ve,u)||g(ve)},[]),(0,V.useEffect)(()=>{if(be||we)return;let e=!(0,is.deepEqual)(u,Pe.current),n=!hs(t,Fe.current),r=le!==Ie.current;if(e||n||r){let n=gs(e?u:ve,t,A,ce);(0,is.deepEqual)(n,ve)||ye(n)}Pe.current=u,Fe.current=t,Ie.current=le},[u,t,A,le,ce,be,we,ve]),(0,V.useEffect)(()=>{if(!be&&!we&&!(0,is.deepEqual)(ve,Ne.current)){Ne.current=ve;let e=ve.filter(e=>e.i!==fe.i);g(e)}},[ve,be,we,g,fe.i]);let Ue=(0,V.useMemo)(()=>{if(!f)return;let e=oa(ve),t=he[1];return e*j+(e-1)*N[1]+t*2+`px`},[f,ve,j,N,he]),We=(0,V.useCallback)((e,t,n,r)=>{let i=He.current,a=sa(i,e);if(!a)return;let o={w:a.w,h:a.h,x:a.x,y:a.y,i:e};ke.current=la(a),je.current=i,xe(o),v(i,a,a,null,r.e,r.node)},[v]),Ge=(0,V.useCallback)((e,t,n,r)=>{let i=He.current,a=ke.current,o=sa(i,e);if(!o)return;let s={w:o.w,h:o.h,x:o.x,y:o.y,i:e},c=ma(i,o,t,n,!0,de,le,A,ue);y(c,a,o,s,r.e,r.node),ye(ce.compact(c,A)),xe(s)},[de,le,A,ue,ce,y]),Ke=(0,V.useCallback)((e,t,n,r)=>{if(!ke.current)return;let i=He.current,a=ke.current,o=sa(i,e);if(!o)return;let s=ma(i,o,t,n,!0,de,le,A,ue),c=ce.compact(s,A);b(c,a,o,null,r.e,r.node);let l=je.current;ke.current=null,je.current=null,xe(null),ye(c),l&&!(0,is.deepEqual)(l,c)&&g(c)},[de,le,A,ue,ce,b,g]),qe=(0,V.useCallback)((e,t,n,r)=>{let i=He.current,a=sa(i,e);a&&(Ae.current=la(a),je.current=i,Ce(!0),x(i,a,a,null,r.e,r.node))},[x]),Je=(0,V.useCallback)((e,t,n,r)=>{let i=He.current,a=Ae.current,{handle:o}=r,s=!1,c,l,[u,d]=fa(i,e,e=>(c=e.x,l=e.y,[`sw`,`w`,`nw`,`n`,`ne`].includes(o)&&([`sw`,`nw`,`w`].includes(o)&&(c=e.x+(e.w-t),t=e.x!==c&&c<0?e.w:t,c=c<0?0:c),[`ne`,`n`,`nw`].includes(o)&&(l=e.y+(e.h-n),n=e.y!==l&&l<0?e.h:n,l=l<0?0:l),s=!0),de&&!ue&&na(i,{...e,w:t,h:n,x:c??e.x,y:l??e.y}).filter(t=>t.i!==e.i).length>0&&(l=e.y,n=e.h,c=e.x,t=e.w,s=!1),e.w=t,e.h=n,(o===`n`||o===`nw`||o===`ne`)&&(e.y=l??e.y),e));if(!d)return;let f=u;s&&c!==void 0&&l!==void 0&&(f=ma(u,d,c,l,!0,de,le,A,ue));let p={w:d.w,h:d.h,x:d.x,y:d.y,i:e,static:!0};S(f,a,d,p,r.e,r.node);let m=ce.compact(f,A);if(o===`n`||o===`nw`||o===`ne`){let t=m.find(t=>t.i===e);t&&(t.y=d.y)}ye(m),xe(p)},[de,le,A,ue,ce,S]),Ye=(0,V.useCallback)((e,t,n,r)=>{let i=He.current,a=Ae.current,o=sa(i,e),s=ce.compact(i,A);C(s,a,o??null,null,r.e,r.node);let c=je.current;Ae.current=null,je.current=null,xe(null),Ce(!1),ye(s),c&&!(0,is.deepEqual)(c,s)&&g(s)},[A,ce,C,g]),Xe=(0,V.useCallback)((e,t,n,r)=>{if(r)Oe.current&&(Oe.current.left!==t.left||Oe.current.top!==t.top)&&(De(t),ye(t=>t.map(t=>t.i===e.i&&(t.x!==n.x||t.y!==n.y)?{...t,x:n.x,y:n.y}:t)));else{Te((0,H.jsx)(`div`,{},e.i)),De(t);let r=He.current.filter(t=>t.i!==e.i);ye([...r,{...e,x:n.x,y:n.y,static:!1,isDraggable:!0}])}},[]),Ze=(0,V.useCallback)((e,t,r)=>{let i=Le.current;if(!i)return;let{newDroppingPosition:a,calculatedXY:o}=ds({clientX:e,clientY:t,gridElement:i,droppingItem:fe,event:r,transformScale:me,cols:A,margin:N,maxRows:M,rowHeight:j,width:n,containerPadding:he});Xe(fe,a,o,!!Be.current)},[fe,me,A,N,M,j,n,he,Xe]),Qe=(0,V.useCallback)(()=>{let e=He.current;if(!e.some(e=>e.i===fe.i)){Te(null),xe(null),De(void 0);return}let t=ce.compact(e.filter(e=>e.i!==fe.i),A);ye(t),Te(null),xe(null),De(void 0)},[fe.i,A,ce]),$e=(0,V.useCallback)(e=>{if(e.preventDefault(),e.stopPropagation(),ms&&!e.nativeEvent.target?.classList.contains(ps))return!1;let t=B?B(e.nativeEvent):T(e);if(t===!1)return we&&Qe(),!1;let{dragOffsetX:r=0,dragOffsetY:i=0,...a}=t??{},o={...fe,...a},{newDroppingPosition:s,calculatedXY:c}=ds({clientX:e.clientX,clientY:e.clientY,gridElement:e.currentTarget,droppingItem:o,event:e.nativeEvent,dragOffsetX:r,dragOffsetY:i,transformScale:me,cols:A,margin:N,maxRows:M,rowHeight:j,width:n,containerPadding:he});Xe(o,s,c,!!we)},[we,fe,B,T,Qe,Xe,me,A,N,M,j,n,he]),et=(0,V.useCallback)(e=>{e.preventDefault(),e.stopPropagation(),Me.current--,Me.current<0&&(Me.current=0),Me.current===0&&Qe()},[Qe]),tt=(0,V.useCallback)(e=>{e.preventDefault(),e.stopPropagation(),Me.current++},[]),nt=(0,V.useCallback)(e=>{let t=He.current,n=t.find(e=>e.i===fe.i);Qe(),Ve.current(t,n,e)},[fe.i,Qe]),rt=(0,V.useCallback)(e=>{e.preventDefault(),e.stopPropagation(),Me.current=0,nt(e.nativeEvent)},[nt]);(0,V.useEffect)(()=>{if(!z||!oe)return;let e=Le.current;if(!e)return;let t=(t,n)=>{let r=document.elementFromPoint(t,n);return r?e.contains(r):!1},n=e=>e instanceof HTMLElement&&e.closest(se)!==null,r=e=>{let t=e.changedTouches;if(!t||t.length===0)return;let n=ze.current;if(n===null)return t[0];for(let e=0;e{if(!n(e.target)||ze.current!==null)return;e.preventDefault();let t=e.changedTouches?.[0];t&&(ze.current=t.identifier,Re.current=!0)},a=e=>{if(!Re.current)return;e.preventDefault();let n=r(e);if(n){if(!t(n.clientX,n.clientY)){Be.current&&Qe();return}Ze(n.clientX,n.clientY,e)}},o=e=>{if(!Re.current)return;e.preventDefault();let n=r(e);if(Re.current=!1,ze.current=null,n){if(!t(n.clientX,n.clientY)){Qe();return}nt(e)}},s=()=>{Re.current&&(Re.current=!1,ze.current=null,Qe())},c={passive:!1};return document.addEventListener(`touchstart`,i,c),document.addEventListener(`touchmove`,a,c),document.addEventListener(`touchend`,o,c),document.addEventListener(`touchcancel`,s,c),()=>{document.removeEventListener(`touchstart`,i,c),document.removeEventListener(`touchmove`,a,c),document.removeEventListener(`touchend`,o,c),document.removeEventListener(`touchcancel`,s,c)}},[z,oe,se,Ze,Qe,nt,fe.i]);let it=(0,V.useCallback)((e,t)=>{if(!e||!e.key)return null;let r=sa(ve,String(e.key));if(!r)return null;let i=typeof r.isDraggable==`boolean`?r.isDraggable:!r.static&&F,a=typeof r.isResizable==`boolean`?r.isResizable:!r.static&&ne,o=r.resizeHandles||[...re],c=i&&I&&r.isBounded!==!1,u=ie;return(0,H.jsx)(us,{containerWidth:n,cols:A,margin:N,containerPadding:he,maxRows:M,rowHeight:j,cancel:ee,handle:L,onDragStart:We,onDrag:Ge,onDragStop:Ke,onResizeStart:qe,onResize:Je,onResizeStop:Ye,isDraggable:i,isResizable:a,isBounded:c,allowMobileScroll:te,useCSSTransforms:pe&&ge,usePercentages:!ge,transformScale:me,positionStrategy:s,dragThreshold:R,w:r.w,h:r.h,x:r.x,y:r.y,i:r.i,minH:r.minH,minW:r.minW,maxH:r.maxH,maxW:r.maxW,static:r.static,droppingPosition:t?Ee:void 0,resizeHandles:o,resizeHandle:u,constraints:l,layoutItem:r,layout:ve,children:e},r.i)},[ve,n,A,N,he,M,j,ee,L,We,Ge,Ke,qe,Je,Ye,F,ne,I,pe,ge,me,s,R,Ee,re,ie,l]),at=()=>be?(0,H.jsx)(us,{w:be.w,h:be.h,x:be.x,y:be.y,i:be.i,className:`react-grid-placeholder ${Se?`placeholder-resizing`:``}`,containerWidth:n,cols:A,margin:N,containerPadding:he,maxRows:M,rowHeight:j,isDraggable:!1,isResizable:!1,isBounded:!1,useCSSTransforms:pe,transformScale:me,constraints:l,layout:ve,children:(0,H.jsx)(`div`,{})}):null,ot=(0,V.useCallback)(e=>{Le.current=e,typeof h==`function`?h(e):h&&`current`in h&&(h.current=e)},[h]),st=_(ps,p),ct={height:Ue,...m};return(0,H.jsxs)(`div`,{ref:ot,className:st,style:ct,onDrop:z?rt:void 0,onDragLeave:z?et:void 0,onDragEnter:z?tt:void 0,onDragOver:z?$e:void 0,children:[V.Children.map(t,e=>V.isValidElement(e)?it(e):null),z&&we&&it(we,!0),at()]})}var vs={lg:1200,md:996,sm:768,xs:480,xxs:0},ys={lg:12,md:10,sm:6,xs:4,xxs:2},bs=()=>{};function xs(e,t,n,r,i=!1){let a=[];V.Children.forEach(t,t=>{if(!V.isValidElement(t)||t.key===null)return;let n=String(t.key),r=t.props[`data-grid`],o=e.find(e=>e.i===n);o?i&&r?a.push({...o,i:n,w:r.w??o.w,h:r.h??o.h,minW:r.minW??o.minW,maxW:r.maxW??o.maxW,minH:r.minH??o.minH,maxH:r.maxH??o.maxH}):a.push({...o,i:n}):r?a.push({i:n,x:r.x??0,y:r.y??0,w:r.w??1,h:r.h??1,minW:r.minW,maxW:r.maxW,minH:r.minH,maxH:r.maxH,static:r.static,isDraggable:r.isDraggable,isResizable:r.isResizable,resizeHandles:r.resizeHandles,isBounded:r.isBounded}):a.push({i:n,x:0,y:oa(a),w:1,h:1})});let o=pa(a,{cols:n});return r.compact(o,n)}function Ss(e){let{children:t,width:n,breakpoint:r,breakpoints:i=vs,cols:a=ys,layouts:o={},rowHeight:s=150,maxRows:c=1/0,margin:l=[10,10],containerPadding:u=null,compactor:d,onBreakpointChange:f=bs,onLayoutChange:p=bs,onWidthChange:m=bs,...h}=e,g=d??qa(`vertical`),_=g.type,v=g.allowOverlap,y=(0,V.useMemo)(()=>r??Ya(i,n),[]),b=(0,V.useMemo)(()=>Xa(y,a),[y,a]),x=(0,V.useMemo)(()=>Za(o,i,y,y,b,_),[]),[S,C]=(0,V.useState)(y),[w,T]=(0,V.useState)(b),[E,D]=(0,V.useState)(x),[O,k]=(0,V.useState)(o),A=(0,V.useRef)(n),j=(0,V.useRef)(r),M=(0,V.useRef)(i),N=(0,V.useRef)(a),P=(0,V.useRef)(o),F=(0,V.useRef)(_),I=(0,V.useRef)(O);(0,V.useEffect)(()=>{I.current=O},[O]);let L=(0,V.useMemo)(()=>(0,is.deepEqual)(o,P.current)?null:Za(o,i,S,S,w,g),[o,i,S,w,g]),ee=L??E;(0,V.useEffect)(()=>{L!==null&&(D(L),k(o),I.current=o,P.current=o)},[L,o]),(0,V.useEffect)(()=>{if(_!==F.current){let e=g.compact(ua(ee),w),t={...I.current,[S]:e};D(e),k(t),I.current=t,p(e,t),F.current=_}},[_,g,ee,w,v,S,p]),(0,V.useEffect)(()=>{let e=n!==A.current,o=r!==j.current,s=!(0,is.deepEqual)(i,M.current),c=!(0,is.deepEqual)(a,N.current);if(e||o||s||c){let e=r??Ya(i,n),o=Xa(e,a),d=S;if(d!==e||s||c){let n={...I.current};n[d]||(n[d]=ua(E));let r=Za(n,i,e,d,o,g),a=!n[e];r=xs(r,t,o,g,a),n[e]=r,C(e),T(o),D(r),k(n),I.current=n,f(e,o),p(r,n)}let h=Qa(l,e),_=u?Qa(u,e):null;m(n,h,o,_),A.current=n,j.current=r,M.current=i,N.current=a}},[n,r,i,a,S,w,E,t,g,_,v,l,u,f,p,m]);let R=(0,V.useCallback)(e=>{let t={...I.current,[S]:e};D(e),k(t),I.current=t,p(e,t)},[S,p]),te=(0,V.useMemo)(()=>Qa(l,S),[l,S]),ne=(0,V.useMemo)(()=>u===null?null:Qa(u,S),[u,S]),re=(0,V.useMemo)(()=>({cols:w,rowHeight:s,maxRows:c,margin:te,containerPadding:ne}),[w,s,c,te,ne]);return(0,H.jsx)(_s,{...h,width:n,gridConfig:re,compactor:g,onLayoutChange:R,layout:ee,children:t})}var Cs=V.forwardRef(function(e,t){let{innerRef:n,...r}=e,i=n??t;return(0,H.jsx)(Ss,{...r,innerRef:i})});Cs.displayName=`ResponsiveGridLayout`;function ws(e,t,n){if(e.kind===`constant`)return e.value??``;let r=e.kind===`custom`?e.options?.map(e=>({value:e}))??[]:n===null?[]:n,i=t[e.name],a=!e.multi&&Array.isArray(i)&&i.length===0?void 0:i;if(a===`$__all`){if(e.include_all)return Ki}else if(a!==void 0){if(e.kind===`text`||r===void 0)return a;let t=new Set(r.map(e=>e.value));if(Array.isArray(a)){if(a.length===0&&e.multi)return[];let n=a.filter(e=>t.has(e));if(n.length>0)return n}else if(t.has(a))return a}return e.default?e.default:e.include_all?Ki:r?.[0]?.value??``}var Ts=(e,t)=>e.replace(/\$([a-z][a-z0-9_]*)/g,(e,n)=>{let r=t[n];return r===void 0?e:r===`$__all`?`all`:Array.isArray(r)?r.join(`, `):r});function Es(e,t,n){let r={};for(let i of e??[]){let e=ws(i,t,n?.[i.name]);(i.kind!==`query`||e!==``)&&(r[i.name]=e)}return r}function Ds(e,t,n,r){let i=e=>t?.frame?.columns.some((n,r)=>n.name===e&&t.frame.values[r]?.some(e=>typeof e==`string`&&e!==``));return{onSelect:e.click&&(e.viz===`service_map`||!(e.drill&&r))?t=>n(e.click.set_variable,t):void 0,onPoint:r&&(e.viz===`service_map`||e.click||e.drill||i(`trace_id`)||e.options?.columns?.some(e=>e.format===`trace_link`&&i(e.field)))?r:void 0}}function Os(e,t,n,r){if(!t)return;let i=he(e,t,n);if(!i)return;let a=Object.values(n.dimensions)[0],o=e.click?.set_variable;return{target:i,vars:o&&a!==void 0?{...r,[o]:a}:r}}function ks(e){return e.replace(/[&<>"']/g,e=>({"&":`&`,"<":`<`,">":`>`,'"':`"`,"'":`'`})[e])}var As=e=>e.map(ks).join(`
`);function js(e,t=!1){return n=>{let r=Array.isArray(n)?n:[n];return As([...r[0]?.axisValueLabel?[r[0].axisValueLabel]:[],...r.map(n=>{let r=n.value,i=Array.isArray(r)?t?r.slice(1):r:[r];return`${n.seriesName??``}${n.name?` · ${n.name}`:``}: ${i.map(t=>typeof t==`number`?e(t,n.seriesName):String(t??`—`)).join(` · `)}`})])}}var Ms=e=>/^Other(?: \(\d+\))?$/.test(e??``);function Ns(e,t){let n=Math.min(6,Math.max(1,Math.floor(t.options?.top||6))),r=e.filter(e=>!Ms(e.name)),i=r.slice(0,n).map(e=>({name:e.name,items:[e]})),a=[...e.filter(e=>Ms(e.name)),...r.slice(n)];return a.length&&i.push({name:a.length===1&&Ms(a[0].name)?a[0].name:`Other (${a.reduce((e,t)=>e+(Ms(t.name)?Number(t.name.match(/\d+/)?.[0]??1):1),0)})`,items:a}),i}function Ps(e){let t=e.filter(e=>e!==null);return t.length?t.reduce((e,t)=>e+t,0):null}function Fs(e,t){let n=Math.min(6,Math.max(1,Math.floor(t.options?.top||6))),r=e.filter(e=>!Ms(e.name));return{shown:[...r.slice(0,n),...e.filter(e=>Ms(e.name))],hidden:Math.max(0,r.length-n)}}function Is(e,t){return e>0?[{type:`text`,right:8,bottom:2,silent:!0,style:{text:`${e} more series not shown`,fill:t,fontSize:11}}]:[]}function Ls(e,t,n,r,i=`sans-serif`,a){let o=e=>Array.from(e).length>24?`${Array.from(e).slice(0,23).join(``)}…`:e,s=Math.max(1,t-16),c=1,l=0;for(let t of e){let e=15+(a?.(o(t),`12px ${i}`)??Array.from(o(t)).length*7.2);l&&l+10+e>s&&(c++,l=0),l+=(l?10:0)+e}let u=c>2;return{top:n?u?30:c*20+2:12,option:{type:u?`scroll`:`plain`,show:n,top:0,left:0,right:0,padding:0,itemGap:6,icon:`roundRect`,itemWidth:10,itemHeight:10,itemStyle:{borderColor:r,borderWidth:1},textStyle:{color:r,fontSize:12,lineHeight:14},data:e,formatter:o,tooltip:{show:!0,renderMode:`html`,formatter:e=>ks(e.name)}}}}function Rs(e,t){if(!(!Number.isFinite(e)||!Number.isFinite(t)||e>=t||Math.abs(e)>864e13||Math.abs(t)>864e13))return{from:new Date(Math.floor(e)).toISOString(),to:new Date(Math.ceil(t)).toISOString()}}function zs(e){let t=[e.time?.range?`Range ${e.time.range}`:void 0,e.time?.shift?`Shifted ${e.time.shift}`:void 0].filter(Boolean);return t.length?t.join(` · `):void 0}function Bs(e,t,n){if(n.interactive===!1||n.interactive!==!0&&n.seriesName?.endsWith(` · previous`)||n.data?.value===null)return;let r=n.data?.selection;if(r)return Object.values(r.dimensions).some(Ms)?void 0:r;if(Ms(n.seriesName)||Ms(n.name)||n.value===null||Array.isArray(n.value)&&n.value.at(-1)==null)return;let i=e.query?.by?.[0]??t.frame?.columns.find(e=>e.role===`dimension`)?.name,a=e.viz===`timeseries`?n.seriesName:n.name,o=Array.isArray(n.value)?n.value:[];return{time:e.viz===`timeseries`&&typeof o[0]==`number`?o[0]:void 0,dimensions:i&&a?{[i]:a}:{}}}function Vs(e){return Array.from({length:e.rows},(t,n)=>Object.fromEntries(e.columns.map((t,r)=>{let i=e.values[r]?.[n]??null;return[t.name,typeof i==`number`&&!Number.isFinite(i)?null:i]})))}function Hs(e,t){return e.viz!==`logs`||!t||t.rows<2?[]:t.columns.flatMap((e,n)=>{if(e.role!==`dimension`||e.type!==`string`||[`body`,`body_template`,`severity`,`status`].includes(e.name)||/(^id$|_id$)/.test(e.name))return[];let r=t.values[n][0];return typeof r==`string`&&r!==``&&t.values[n].slice(0,t.rows).every(e=>e===r)?[{name:e.name,value:r}]:[]})}function Us(e,t){let n=t.frame??{columns:[],values:[],rows:0};return{columns:n.columns.map(e=>e.name),rows:Vs(n),selection:t=>{let n={};for(let r of e.query?.by??[]){let e=r.startsWith(`attributes[`)||r.startsWith(`resource[`)?r.slice(r.indexOf(`'`)+1,r.lastIndexOf(`'`)):r;t[e]!==void 0&&t[e]!==null&&(n[r]=String(t[e]))}return{time:typeof t.time==`number`?t.time:typeof t.start==`number`?t.start:void 0,dimensions:n,trace_id:typeof t.trace_id==`string`?t.trace_id:void 0,namespace:typeof t.namespace==`string`?t.namespace:void 0}}}}var Ws=new Intl.NumberFormat(`en`,{notation:`compact`,maximumFractionDigits:1}),Gs=new Intl.NumberFormat(`en`,{maximumFractionDigits:2});function Ks(e){return Math.abs(e)<1e-4?e.toExponential(2).replace(/\.?(0+)(?=e)/,``):String(Number(e.toPrecision(3)))}function qs(e,t=Gs){return e!==0&&Math.abs(e)<1?Ks(e):t.format(e)}function Js(e,t){let n=t===`s`?e*1e3:t===`ns`?e/1e6:e;return e!==0&&n===0?`${Ks(e)}${t}`:n!==0&&Math.abs(n)<1?`${Ks(n)}ms`:wt(n)}function Ys(e){let t=[`B`,`KiB`,`MiB`,`GiB`,`TiB`],n=e,r=0;for(;Math.abs(n)>=1024&&r=1e4?Ws:Gs);default:return qs(t,Math.abs(t)>=1e4?Ws:Gs)}}function Zs(e){return t=>e===`ms`||e===`s`||e===`ns`?Xs(e,t).replace(/(\.\d*?)0+([a-z]*)$/,`$1$2`).replace(/\.([a-z]*)$/,`$1`):Xs(e,t)}function Qs(e,t){return Zs(e)(t??NaN).replace(/(?<=\d)(ms|ns|s|m|h)\b/g,` $1`)}function $s(e){return Math.max(3,Math.min(10,Math.round(e/70)))-1}function ec(e,t){let n=t===`ms`?1:t===`s`?1e3:t===`ns`?1e-6:void 0,r=e=>{let t=10**Math.floor(Math.log10(e));return[1,2,5,10].map(e=>e*t).find(t=>t>=e)};if(n===void 0)return r(e);let i=e*n,a=[1,10,100,1e3,1e4,6e4,6e5,36e5,36e6].flatMap(e=>[1,2,5].map(t=>e*t)).sort((e,t)=>e-t);return(i<1?r(i):a.find(e=>e>=i)??r(i/36e5)*36e5)/n}function tc(e,t,n,r){e=Number.isFinite(e)?Math.min(0,e):0,t=Number.isFinite(t)?Math.max(0,t):1,t===e&&(t=e+1);let i=$s(r),a=ec(Math.max(t-e,2**-52)/i,n);for(;Math.ceil(t/a)-Math.floor(e/a)>i;)a=ec(a*1.01,n);return{min:Math.floor(e/a)*a,max:Math.ceil(t/a)*a,interval:a,splitNumber:i,fanout_unit:n}}function nc(e,t){return e.type!==`value`&&e.type!==`log`?e:{...e,...e.type===`value`&&typeof e.min==`number`&&typeof e.max==`number`?tc(e.min,e.max,typeof e.fanout_unit==`string`?e.fanout_unit:void 0,t):{splitNumber:$s(t)}}}function rc(e,t,n){let r=e=>Xs(n,e),i=``;if(n===`ms`||n===`s`||n===`ns`){let a=n===`s`?1e3:n===`ns`?1e-6:1,o=Math.abs((e??t??0)*a),s=o>=6e4?6e4:o>=1e3?1e3:1;i=s===6e4?` min`:s===1e3?` s`:` ms`;let c=s===6e4?1:s===1e3?+(o<1e4):2,l=new Intl.NumberFormat(void 0,{maximumFractionDigits:c});r=e=>l.format(e*a/s)}return t===null&&e!==null?`≥${r(e)}${i}`:(e===null||e===0)&&t!==null?`<${r(t)}${i}`:`${e===null?`−∞`:r(e)}–${t===null?`∞`:r(t)}${i}`}function ic(e){let t=new Date(e);return t.getHours()===0&&t.getMinutes()===0&&t.getSeconds()===0?t.toLocaleDateString(void 0,{month:`short`,day:`numeric`}):t.toLocaleTimeString(void 0,{hour:`2-digit`,minute:`2-digit`,hourCycle:`h23`})}function ac(e,t=new Date,n){let r=new Date(e);if(!Number.isFinite(r.getTime()))return`—`;let i=new Intl.DateTimeFormat(n,{month:`short`,day:`numeric`,...r.getFullYear()===t.getFullYear()?{}:{year:`numeric`},hour:`2-digit`,minute:`2-digit`,second:`2-digit`,hourCycle:`h23`}).formatToParts(r),a=i.filter(e=>[`month`,`day`,`year`].includes(e.type)).map(e=>e.value),o=i.filter(e=>[`hour`,`minute`,`second`].includes(e.type)).map(e=>e.value);return`${a.join(` `)} ${o.join(`:`)}`}function oc({panel:e,result:t}){let n=t?.frame;return(0,H.jsxs)(`div`,{"data-panel-data":!0,children:[t?.error&&(0,H.jsx)(T,{"data-panel-error-detail":!0,size:`sm`,role:`status`,style:{whiteSpace:`pre-wrap`,overflowWrap:`anywhere`,userSelect:`text`},children:t.error}),n?(0,H.jsxs)(Ct,{fz:12,striped:!0,children:[(0,H.jsx)(Ct.Thead,{children:(0,H.jsx)(Ct.Tr,{children:n.columns.map(e=>(0,H.jsx)(Ct.Th,{ff:Ue.display,children:e.name},e.name))})}),(0,H.jsx)(Ct.Tbody,{children:Array.from({length:Math.min(n.rows,500)},(t,r)=>(0,H.jsx)(Ct.Tr,{children:n.columns.map((t,i)=>{let a=n.values[i][r];return(0,H.jsx)(Ct.Td,{ff:Ue.display,children:a===null?`—`:t.type===`time`?new Date(Number(a)).toISOString():t.role===`measure`?Xs(t.unit??e.unit,Number(a)):String(a)},t.name)})},r))})]}):(0,H.jsx)(T,{c:`dimmed`,size:`sm`,children:`No data.`}),(0,H.jsxs)(T,{c:`dimmed`,fz:12,mt:8,children:[`Ran in `,t?.elapsed_ms??0,` ms`,t?.interval?`, one point per ${t.interval}`:``,n?`, ${n.rows} rows${n.truncated?` (truncated)`:``}`:``,`.`]}),(t?.sql??e.sql)&&(0,H.jsx)(pt,{block:!0,tabIndex:0,mt:8,children:t?.sql??e.sql})]})}function sc({panel:e,dark:t}){let n=JSON.stringify(e,null,2).split(/("(?:[^"\\]|\\.)*"(?=\s*:)|"(?:[^"\\]|\\.)*"|\b(?:true|false|null)\b|-?\d+(?:\.\d+)?)/g);return(0,H.jsx)(`pre`,{"data-panel-spec":!0,style:{margin:0,fontFamily:Ue.display,fontSize:12,color:Pe[t?`dark`:`light`].text},children:n.map((e,r)=>{let i=e.startsWith(`"`)&&/^\s*:/.test(n[r+1]??``)?`key`:e.startsWith(`"`)?`string`:/^(true|false|null)$/.test(e)?`literal`:/^-?\d/.test(e)?`number`:`punctuation`,a=i===`key`?Xe[t?4:7]:i===`string`?Fe[t?4:8]:i===`number`||i===`literal`?Qe[t?4:8]:void 0;return i===`punctuation`?e:(0,H.jsx)(`span`,{"data-json-token":i,style:{color:a},children:e},r)})})}function cc(e){let t=e.event.data?.selection,n=e.event.value;return JSON.stringify([e.event.seriesName,e.event.name,t?.from??t?.time??(Array.isArray(n)?n[0]:void 0),t?.dimensions,t?.bucket])}function lc(e){let t=new Date().toISOString().slice(0,10),n=e.from.slice(0,10),r=e.to.slice(0,10),i=e=>e.slice(11,-1).replace(/\.000$/,``);return`${(n===t?``:n+` `)+i(e.from)} – ${(r!==n&&r!==t?r+` `:``)+i(e.to)} UTC · ${wt(Date.parse(e.to)-Date.parse(e.from))}`}var uc={background:`color-mix(in srgb, var(--mantine-color-body) 92%, transparent)`,border:`1px solid var(--mantine-color-default-border)`,borderRadius:`var(--mantine-radius-sm)`,padding:`2px 6px`};function dc(e){return e.replace(`Enter drill`,`↵ drill`).replace(`Shift+←→`,`⇧←→`)}var fc=(0,V.createContext)(void 0);function pc({points:e,label:t,summary:n,children:r,onClick:i,canSelect:a,onHighlight:s,onActiveChange:c,onRangePending:l,onRangeChange:u,onRangeBarHeight:d,rangeReset:f,height:p=`100%`,onZoom:m,bounds:h,pointWindow:g}){let[_,v]=(0,V.useState)(!1),[b,x]=(0,V.useState)(``),[S,w]=(0,V.useState)(),[E,D]=(0,V.useState)(null),O=(0,V.useRef)(null),k=(0,V.useRef)(!1);(0,V.useEffect)(()=>{let e=e=>{e.key===`Tab`&&(k.current=!1)};return document.addEventListener(`keydown`,e,!0),()=>document.removeEventListener(`keydown`,e,!0)},[]);let A=(0,V.useId)(),j=(0,V.useContext)(fc),M=(0,V.useRef)(null),N=(0,V.useRef)({onHighlight:s,onActiveChange:c,onRangePending:l,onRangeChange:u,onRangeBarHeight:d});N.current={onHighlight:s,onActiveChange:c,onRangePending:l,onRangeChange:u,onRangeBarHeight:d};let P=(0,V.useMemo)(()=>new Map(e.map(e=>[cc(e),e])),[e]),F=(0,V.useRef)(void 0),I=e=>g?.(e)?.from??e.event.name??(Array.isArray(e.event.value)?e.event.value[0]:void 0),L=F.current,ee=L?e.filter(e=>e.event.seriesName===L.event.seriesName):e,R=ee.length?ee:e,te=L&&I(L),ne=typeof te==`number`?R.reduce((e,t)=>{let n=I(t),r=e&&I(e);return typeof n==`number`&&(!e||typeof r!=`number`||Math.abs(n-te)I(e)===te),re=S?P.get(S)??ne??R[0]??e[0]:e[0],ie=!!(m&&h&&Number.isFinite(h.from)&&Number.isFinite(h.to)&&h.from[...new Set(e.map(e=>e.event.seriesName))],[e]),ae=(0,V.useMemo)(()=>e.filter(e=>e.event.seriesName===re?.event.seriesName),[e,re?.event.seriesName]),B=re?ae.indexOf(re):-1;(0,V.useEffect)(()=>{re&&(!S||P.has(S)||!ee.length)&&(F.current=re,(!S||!ee.length)&&w(cc(re))),_&&N.current.onHighlight(re)},[re,S,_]),(0,V.useEffect)(()=>{if(!E)return;let e=Date.parse(E.from),t=Date.parse(E.to);h&&(Number.isFinite(e)&&eh.to)&&D(null)},[h?.from,h?.to,E]),(0,V.useEffect)(()=>{N.current.onRangePending?.(!!E)},[!!E]),(0,V.useEffect)(()=>{N.current.onRangeChange?.(E?{from:Date.parse(E.from),to:Date.parse(E.to)}:void 0)},[E]),(0,V.useEffect)(()=>{D(null)},[f]),(0,V.useEffect)(()=>()=>{N.current.onHighlight(void 0),N.current.onRangePending?.(!1),N.current.onRangeChange?.(void 0)},[]);let oe=(e,t=!1)=>{if(e){if(x(n(e)),t&&ie&&re){let t=E?.anchor??cc(re),n=P.get(t),r=E?.window??(n&&g?.(n)),i=g?.(e);if(r&&i){let e=Math.max(h.from,Math.min(r.from,i.from)),n=Math.min(h.to,Math.max(r.to,i.to));Number.isFinite(e)&&Number.isFinite(n)&&e{if(!re)return;let n=z[Math.max(0,Math.min(z.length-1,z.indexOf(re.event.seriesName)+t))],r=e.filter(e=>e.event.seriesName===n),i=I(re),a=r.find(e=>I(e)===i),o=typeof i==`number`?r.reduce((e,t)=>{let n=I(t),r=e&&I(e);return typeof n==`number`&&(!e||typeof r!=`number`||Math.abs(n-i){e===`ArrowLeft`||e===`ArrowRight`?oe(ae[Math.max(0,Math.min(ae.length-1,B+(e===`ArrowLeft`?-1:1)))],t):!t&&(e===`ArrowUp`||e===`ArrowDown`)?se(e===`ArrowUp`?-1:1):!t&&(e===`Home`||e===`End`)&&oe(e===`Home`?ae[0]:ae.at(-1))},le=()=>{D(null),O.current?.focus()},ue=ie?`←→ points · ↑↓ series · Enter drill · Shift+←→ range`:`←→ points · ↑↓ series · Enter drill`;return(0,V.useLayoutEffect)(()=>(j?.setHint(_?ue:void 0),()=>j?.setHint(void 0)),[j,_,ue]),(0,V.useLayoutEffect)(()=>{let e=M.current;if(!e)return;N.current.onRangeBarHeight?.(e.getBoundingClientRect().height);let t=new ResizeObserver(([t])=>{if(!t)return;let n=getComputedStyle(e),r=[n.paddingTop,n.paddingBottom,n.borderTopWidth,n.borderBottomWidth].reduce((e,t)=>e+(parseFloat(t)||0),0);N.current.onRangeBarHeight?.(t.borderBoxSize?.[0]?.blockSize??t.contentRect.height+r)});return t.observe(e),()=>{t.disconnect(),N.current.onRangeBarHeight?.(0)}},[!!(E&&ie)]),(0,H.jsxs)(o,{ref:O,"data-chart-plot":!0,tabIndex:0,role:`application`,"aria-roledescription":`chart`,"aria-label":t,"aria-describedby":A,"data-mantine-stop-propagation":E?`true`:void 0,className:`chart-keyboard-point`,style:{position:`relative`,height:p,width:`100%`,flex:`1 1 auto`,minHeight:0,minWidth:0},onPointerDownCapture:e=>{M.current?.contains(e.target)||(k.current=!0,v(!1),_&&N.current.onHighlight(void 0),N.current.onActiveChange?.(!1))},onFocus:e=>{e.target!==e.currentTarget||k.current||(N.current.onActiveChange?.(!0),v(!0))},onBlur:e=>{e.currentTarget.contains(e.relatedTarget)||(v(!1),D(null),x(``),N.current.onHighlight(void 0),N.current.onActiveChange?.(!1))},onKeyDown:e=>{if(e.defaultPrevented||e.ctrlKey||e.metaKey||e.altKey||e.nativeEvent.isComposing)return;if(e.key===`Escape`&&!e.repeat){E?(e.preventDefault(),e.stopPropagation(),le()):e.target===e.currentTarget&&!e.currentTarget.closest(`[data-panel-fullscreen],[data-fragment-fullscreen]`)&&(e.preventDefault(),e.stopPropagation(),e.currentTarget.blur());return}if(e.target!==e.currentTarget||e.repeat&&![`ArrowLeft`,`ArrowRight`,`ArrowUp`,`ArrowDown`].includes(e.key))return;let t=[`ArrowLeft`,`ArrowRight`,`ArrowUp`,`ArrowDown`,`Home`,`End`].includes(e.key);if(t&&!_&&(k.current=!1,v(!0),N.current.onActiveChange?.(!0),!re)){e.preventDefault();return}e.key===`Enter`&&_&&!e.shiftKey&&re&&i&&(!a||a(re.event))?(e.preventDefault(),i(re.event)):t&&(!e.shiftKey||e.key===`ArrowLeft`||e.key===`ArrowRight`)&&(e.preventDefault(),ce(e.key,e.shiftKey))},children:[r,(0,H.jsx)(o,{"data-chart-overlay":!0,style:{position:`absolute`,inset:0,zIndex:1,pointerEvents:`none`,overflow:`hidden`},children:E&&ie&&(0,H.jsxs)(y,{ref:M,"data-chart-range-bar":!0,gap:6,style:{...uc,position:`absolute`,bottom:4,left:4,right:4,maxHeight:`100%`,overflow:`auto`,pointerEvents:`auto`},children:[(0,H.jsx)(T,{"data-chart-range-label":!0,size:`xs`,title:E.from+` – `+E.to,truncate:!0,style:{flex:`1 1 140px`,minWidth:0},children:lc(E)}),(0,H.jsx)(C,{size:`compact-xs`,"data-mantine-stop-propagation":`true`,onClick:()=>{m(Date.parse(E.from),Date.parse(E.to)),le()},children:`Zoom to range`}),(0,H.jsx)(C,{size:`compact-xs`,variant:`subtle`,"data-mantine-stop-propagation":`true`,onClick:le,children:`Cancel`})]})}),(0,H.jsx)(vt,{id:A,children:ue}),(0,H.jsx)(vt,{"aria-live":`polite`,"aria-atomic":`true`,children:b})]})}function mc(e){return e===`healthy`?`ok`:e===`degraded`?`warn`:e===`unknown`?`gray`:`bad`}function hc(e){return Pe[e?`dark`:`light`]}function gc(e){let t=e?5:7;return{ok:Fe[t],warn:We[t],bad:Ge[t],info:Qe[t]}}function _c(e,t){return Le[t?`dark`:`light`][e]??hc(t).muted}function vc(e){return e===`unhealthy`?`diamond`:e===`degraded`?`roundRect`:`circle`}function yc(e){return e===`unknown`?`dashed`:`solid`}var bc=e=>typeof e==`number`&&Number.isFinite(e)?e:null;function xc(e){return e.columns.flatMap((e,t)=>e.role===`measure`?[t]:[])}function Sc(e){let t=e.columns.findIndex(e=>e.role===`time`);if(t<0)return[];let n=e.columns.findIndex(e=>e.role===`dimension`),r=xc(e);if(n>=0&&r.length>0){let i=r[0],a=new Map;for(let r=0;r({name:e.columns[n].name,unit:e.columns[n].unit,points:e.values[t].map((t,r)=>[Number(t),bc(e.values[n][r])])}))}function Cc(e){let t=e.columns.flatMap((e,t)=>e.role===`dimension`?[t]:[]),n=xc(e);if(t.length===0||n.length===0)return{categories:[],series:[]};let r=t[0],i=[];for(let t=0;t1){let a=t[1],o=n[0],s=new Map;for(let t=0;tnull)),s.get(n)[i.indexOf(String(e.values[r][t]??``))]=bc(e.values[o][t])}return{categories:i,series:[...s.entries()].map(([t,n])=>({name:t,unit:e.columns[o].unit,values:n}))}}return{categories:i,series:n.map(t=>({name:e.columns[t].name,unit:e.columns[t].unit,values:e.values[t].map(bc)}))}}function wc(e,t){let n=e.filter(e=>e!==null);if(n.length===0)return null;switch(t){case`last`:return n[n.length-1];case`min`:return Math.min(...n);case`max`:return Math.max(...n);case`sum`:return n.reduce((e,t)=>e+t,0);default:return n.reduce((e,t)=>e+t,0)/n.length}}function Tc(e,t){let n=xc(t)[0];return n===void 0?null:(e.reduce??`window`)===`window`?t.totals?bc(t.totals[n]):wc(t.values[n].map(bc),`mean`):wc(t.values[n].map(bc),e.reduce??`mean`)}function Ec(e){let t=xc(e)[0];return t===void 0?[]:e.values[t].map(bc)}var Dc={ok:0,warn:1,bad:2};function Oc(e){if(!e?.length)return;let t=[...e].sort((e,t)=>Dc[e.status]-Dc[t.status]),n=t[0],r=t[t.length-1];return Dc[r.status]>Dc[n.status]&&r.value!==n.value?r.value>n.value?`lower`:`higher`:`lower`}function kc(e,t,n){if(e===null||!t||t.length===0)return null;n??=Oc(t);let r=`ok`;for(let i of t)(n===`lower`?e>=i.value:e<=i.value)&&Dc[i.status]>Dc[r]&&(r=i.status);return r}function Ac(e,t){let n=Be(e),r=Be(t);return(Math.max(n,r)+.05)/(Math.min(n,r)+.05)}function jc(e,t){return`rgba(${[1,3,5].map(t=>parseInt(e.slice(t,t+2),16)).join(`, `)}, ${t})`}function Mc(e,t){return{color:e,...Ac(e,t.surface)<3?{borderColor:t.text,borderWidth:1}:{}}}function Nc(e,t){return{color:e,...Ac(e,t.surface)<3?{shadowColor:t.text,shadowBlur:2}:{}}}function Pc(e,t){return{ok:Fe,warn:We,bad:Ge}[e][t?5:8]}function Fc(e){let t=hc(e),n=gc(e);return{dark:e,text:t.text,muted:t.muted,grid:t.grid,surface:t.surface,border:t.border,status:{ok:n.ok,warn:n.warn,bad:n.bad},font:Ue.display}}function Ic(e,t,n){if(!Array.isArray(e.series))return e;let r=e.series,i=Array.isArray(e.yAxis)?e.yAxis:[e.yAxis],a=[],o=r.map((e,o)=>{let s=e.endLabel;if(!s?.show||!Array.isArray(e.data))return e;let c;for(let t=e.data.length-1;t>=0;t--){let n=e.data[t];if(Array.isArray(n)&&typeof n[1]==`number`&&Number.isFinite(n[1])){c=n;break}}let l=i[Number(e.yAxisIndex??0)];if(!c||!l)return{...e,endLabel:{...s,show:!1}};let u=l.type===`log`?Math.log:e=>e,d=l.min??1/0,f=l.max??0;if(l.type===`log`&&(l.min===void 0||l.max===void 0)){for(let t of r)if(Number(t.yAxisIndex??0)===Number(e.yAxisIndex??0)&&Array.isArray(t.data))for(let e of t.data)Array.isArray(e)&&typeof e[1]==`number`&&Number.isFinite(e[1])&&e[1]>0&&(l.min===void 0&&(d=Math.min(d,e[1])),l.max===void 0&&(f=Math.max(f,e[1])))}Number.isFinite(d)||(d=1);let p=u(l.type===`log`?d:l.min??0),m=u(l.type===`log`?Math.max(f,d*1.01):l.max??1),h=n?.(o,c),g=Number.isFinite(h)?h:t.y+t.height*(1-(u(c[1])-p)/(m-p)),_=((s.lineHeight??14)+2)/2,v=[Math.max(t.y+_,Math.min(t.y+t.height-_,g)),...a.flatMap(e=>[e.y-e.half-_,e.y+e.half+_])].filter(e=>Number.isFinite(e)&&e-_>=t.y&&e+_<=t.y+t.height&&a.every(t=>Math.abs(t.y-e)>=t.half+_)).sort((e,t)=>Math.abs(e-g)-Math.abs(t-g))[0];return v===void 0?{...e,endLabel:{...s,show:!1}}:(a.push({y:v,half:_}),{...e,labelLayout:{dy:v-g,hideOverlap:!0}})});return{...e,series:o}}var Lc=(e,t,n)=>Ms(e)?n.muted:_c(t,n.dark);function Rc(e,t){let n=Sc(e);if(!e.columns.some(e=>e.role===`dimension`))for(let e of n){let t=e.name;e.name=/^p\d+(?:\(.*\))?$/.test(t)&&[`ms`,`s`,`ns`].includes(e.unit??``)?`${t.match(/^p\d+/)[0]} latency`:/^error_rate(?:\(\))?$/.test(t)?`Error rate`:/^rate(?:\(\))?$/.test(t)?`Request rate`:t.replaceAll(`_`,` `).replace(/^./,e=>e.toUpperCase())}return Fs(n,t)}function zc(e,t){return{animationDuration:200,textStyle:{fontFamily:e.font,color:e.muted,fontSize:11},grid:{left:8,right:16,top:28,bottom:8,containLabel:!0},tooltip:{trigger:`axis`,formatter:js(e=>Xs(t,e)),confine:!0,backgroundColor:e.surface,borderColor:e.border,textStyle:{color:e.text,fontSize:12},valueFormatter:e=>Xs(t,e),axisPointer:{type:`line`,lineStyle:{color:e.border}}},aria:{enabled:!0}}}function Bc(e,t,n,r){return(e.thresholds??[]).map(i=>({yAxis:i.value,label:{formatter:`${i.label??i.status} ${Zs(r??e.unit)(i.value).replace(/(?<=\d)(ms|s|m|h)$/,` $1`)}`,position:i.value<=(n.min+n.max)/2?`insideEndTop`:`insideEndBottom`,distance:8,color:t.muted,textBorderColor:t.surface,textBorderWidth:3,fontSize:12},lineStyle:{color:t.status[i.status],type:[4,3],width:1}}))}function Vc(e,t,n,r={width:500,height:248}){let i=t.frame?Rc(t.frame,e):{shown:[],hidden:0},a=i.shown,o=a[0]?.unit??e.unit,s=new Set(a.map(e=>e.name)),c=a.find(e=>Ms(e.name)),l=t.previous&&t.shift_ms!==void 0?Rc(t.previous,e).shown.flatMap(e=>Ms(e.name)?c?[e]:[]:s.has(e.name)?[e]:[]):[],u=[...new Set([...a,...l].map(t=>t.unit??e.unit))];u.length===0&&u.push(e.unit);let d=e.options?.style??`line`,f=a.length>=2&&a.length<=6&&i.hidden===0&&d!==`bars`&&d!==`stacked`,p=f?Math.max(40,...a.map(e=>{let t=Array.from(e.name).slice(0,24).join(``);return r.measureText?.(t,`12px ${n.font}`)??Array.from(t).length*7.2}))+12:0,m=f?p+8:0,h=(e.options?.legend??`auto`)!==`hidden`&&a.length>1,g=Ls(a.map(e=>e.name),r.width,h,n.text,n.font,r.measureText),_=r.height-g.top-(i.hidden?24:8)-22,v=Math.max(0,Math.floor(_/16)),y=t.shift_ms,b=u.map(t=>{let n=[...a,...l].filter(n=>(n.unit??e.unit)===t).flatMap(e=>e.points.flatMap(([,e])=>e===null?[]:[e]));if(d===`stacked`){let r=new Map;for(let n of a.filter(n=>(n.unit??e.unit)===t))for(let[e,t]of n.points){let n=r.get(e)??{positive:0,negative:0};t!==null&&(t>0?n.positive+=t:n.negative+=t),r.set(e,n)}n.push(...[...r.values()].flatMap(e=>[e.positive,e.negative]))}return tc(Math.min(0,...n),Math.max(0,...n),t,_)}),x=a.map((t,r)=>{let i=Lc(t.name,r,n);return{name:t.name,interactive:!0,yAxisIndex:u.indexOf(t.unit??e.unit),tooltip:{valueFormatter:n=>Xs(t.unit??e.unit,n)},type:d===`bars`||d===`stacked`?`bar`:`line`,data:t.points,endLabel:f?{show:r0?{symbol:[`none`,`none`],silent:!0,data:Bc(e,n,b[0],o)}:void 0}}),S=y===void 0?[]:l.map(t=>({name:`${t.name} · previous`,interactive:!1,yAxisIndex:u.indexOf(t.unit??e.unit),tooltip:{valueFormatter:n=>Xs(t.unit??e.unit,n)},type:`line`,data:t.points.map(([e,t])=>[e+y,t]),showSymbol:!1,silent:!0,z:1,lineStyle:{width:1,type:`dashed`,color:n.muted},itemStyle:{color:n.muted}})),C=u.map((t,r)=>({...e.options?.scale===`log`?{splitNumber:$s(_)}:b[r],type:e.options?.scale===`log`?`log`:`value`,position:r===0?`left`:`right`,offset:Math.max(0,r-1)*56,axisLine:{show:!1},splitLine:{show:r===0,lineStyle:{color:n.grid}},axisLabel:{color:n.muted,fontFamily:n.font,fontSize:11,hideOverlap:!0,formatter:Zs(t)}}));return Ic({...zc(n,o),tooltip:{...zc(n,o).tooltip,formatter:js((t,n)=>Xs([...a,...l].find(e=>e.name===n||`${e.name} · previous`===n)?.unit??e.unit,t),!0)},legend:g.option,grid:{left:8,right:16+(f?m:0)+Math.max(0,u.length-2)*56,top:g.top,bottom:i.hidden?24:8,containLabel:!0},xAxis:{type:`time`,min:t.from_ms,max:t.to_ms,axisLine:{lineStyle:{color:n.grid}},axisTick:{show:!1},splitLine:{show:!1},axisLabel:{color:n.muted,fontFamily:n.font,fontSize:11,hideOverlap:!0,formatter:ic}},yAxis:C.length===1?C[0]:C,series:[...x,...S],graphic:Is(i.hidden,n.muted)},{y:g.top,height:_})}function Hc(e,t,n){if(n(e)<=t)return e;let r=Array.from(e);for(let e=r.length-1;e>0;e--){let i=Math.floor(e*.45),a=e-i,o=r.slice(0,i).join(``)+`…`+r.slice(-a).join(``);if(n(o)<=t)return o}return`…`}function Uc(e,t,n,r={width:500,height:248}){let i=Cc(t),a=i.categories,{shown:o,hidden:s}=Fs(i.series,e),c=t.columns.flatMap((e,t)=>e.role===`dimension`?[t]:[]),l=new Map;for(let n=0;nString(t.values[e][n]??``))),{dimensions:r,...i})}let u=o[0]?.unit??e.unit,d=[...new Set(o.map(t=>t.unit??e.unit))];d.length===0&&d.push(e.unit);let f=o.length>1,p=!!(t.periods?.[`Before deploy`]||t.periods?.[`Since deploy`]),m=e=>r.measureText?.(e,`11px ${n.font}`)??Array.from(e).length*6.6,h=Math.min(r.width*.4,Math.max(40,...a.map(m))),g=Ls(o.map(e=>e.name),r.width,f&&e.options?.legend!==`hidden`,n.text,n.font,r.measureText),_=d.map((t,i)=>({...tc(Math.min(0,...o.filter(n=>(n.unit??e.unit)===t).flatMap(e=>e.values.filter(e=>e!==null))),Math.max(0,...o.filter(n=>(n.unit??e.unit)===t).flatMap(e=>e.values.filter(e=>e!==null))),t,r.width-h-80),type:`value`,position:i===0?`bottom`:`top`,offset:Math.max(0,i-1)*36,splitLine:{show:i===0,lineStyle:{color:n.grid}},axisLabel:{color:n.muted,fontFamily:n.font,fontSize:11,formatter:e=>Qs(t,e),hideOverlap:!0}}));return{...zc(n,u),tooltip:{...zc(n,u).tooltip,formatter:js((t,n)=>Xs(o.find(e=>e.name===n)?.unit??e.unit,t)),axisPointer:{type:`shadow`}},legend:g.option,grid:{left:8,right:56,top:(f?g.top:8)+Math.max(0,d.length-1)*36,bottom:s?24:8,containLabel:!0},yAxis:{type:`category`,inverse:!0,data:a,splitLine:{show:!1},axisLine:{lineStyle:{color:n.grid}},axisTick:{show:!1},axisLabel:{color:n.muted,fontFamily:n.font,fontSize:11,width:h,overflow:`truncate`,formatter:e=>Hc(e,h,m)}},xAxis:_.length===1?_[0]:_,series:o.map((t,r)=>({name:t.name,interactive:!0,xAxisIndex:d.indexOf(t.unit??e.unit),tooltip:{valueFormatter:n=>Xs(t.unit??e.unit,n)},type:`bar`,data:t.values.map((e,n)=>({value:e,selection:l.get(JSON.stringify(c.length>1?[a[n],t.name]:[a[n]]))})),barMaxWidth:p&&t.name===`Before deploy`?7:14,barGap:`20%`,itemStyle:{...Mc(p?t.name===`Before deploy`?n.muted:_c(0,n.dark):Lc(t.name,r,n),n),borderRadius:[0,4,4,0]},label:{show:p?t.name===`Since deploy`:!f||r===0,position:`right`,color:n.text,fontFamily:n.font,fontSize:11,formatter:({value:n})=>Qs(t.unit??e.unit,n)}})),graphic:Is(s,n.muted)}}function Wc(e,t,n,r=e.unit,i={width:270,height:140}){let a=e.min??0,o=e.max??100,s=Gc(e,a,o,n),c=Xs(r,t),l=kc(t,e.thresholds,e.better),u=l===`bad`?`◆ Bad`:l===`warn`?`■ Warn`:l===`ok`?`● OK`:t===null?`○ Unknown`:void 0,d=e=>`${e}40`,f=i.measureText?.(c,`600 28px ${n.font}`)??c.length*28*.6,p=i.measureText?.(u??``,`11px ${n.font}`)??(u?.length??0)*11*.6,m=i.width{let r=y;return y=e,{type:`rect`,shape:{x:4+r*_,y:g,width:(e-r)*_,height:10,r:[n===0?5:0,n===s.length-1?5:0,n===s.length-1?5:0,n===0?5:0]},style:{fill:d(t)}}}),{id:`gauge-fill`,type:`rect`,shape:{x:4,y:g,width:v*_,height:10,r:5},style:{fill:l?n.status[l]:_c(0,n.dark)}},{id:`gauge-marker`,type:`rect`,shape:{x:3+v*_,y:g-2,width:2,height:14,r:1},style:{fill:n.text}},{type:`text`,left:4,top:g+12,style:{text:Xs(r,a),fill:n.muted,fontSize:11,fontFamily:n.font}},{type:`text`,right:4,top:g+12,style:{text:Xs(r,o),fill:n.muted,fontSize:11,fontFamily:n.font}}]}}function Gc(e,t,n,r){let i=n-t||1,a=[t,...(e.thresholds??[]).map(e=>Math.min(n,Math.max(t,e.value))),n].sort((e,t)=>e-t),o=[];for(let t=0;t[(e.end-t)/i,r.status[e.status]])}var Kc=function(e,t){return Kc=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},Kc(e,t)};function U(e,t){if(typeof t!=`function`&&t!==null)throw TypeError(`Class extends value `+String(t)+` is not a constructor or null`);Kc(e,t);function n(){this.constructor=e}e.prototype=t===null?Object.create(t):(n.prototype=t.prototype,new n)}var qc=`12px sans-serif`,Jc=20,Yc=100,Xc=`007LLmW'55;N0500LLLLLLLLLL00NNNLzWW\\\\WQb\\0FWLg\\bWb\\WQ\\WrWWQ000CL5LLFLL0LL**F*gLLLL5F0LF\\FFF5.5N`;function Zc(e){var t={};if(typeof JSON>`u`)return t;for(var n=0;n=0)s=o*n.length;else for(var c=0;c=fl&&(dl=0),dl++}function ml(){var e=[...arguments];typeof console<`u`&&console.error.apply(console,e)}function hl(e){if(typeof e!=`object`||!e)return e;var t=e,n=nl.call(e);if(n===`[object Array]`){if(!Jl(e)){t=[];for(var r=0,i=e.length;r`u`&&typeof self<`u`?ou.worker=!0:!ou.hasGlobalWindow||`Deno`in window||typeof navigator<`u`&&typeof navigator.userAgent==`string`&&navigator.userAgent.indexOf(`Node.js`)>-1?(ou.node=!0,ou.svgSupported=!0):su(navigator.userAgent,ou);function su(e,t){var n=t.browser,r=e.match(/Firefox\/([\d.]+)/),i=e.match(/MSIE\s([\d.]+)/)||e.match(/Trident\/.+?rv:(([\d.]+))/),a=e.match(/Edge?\/([\d.]+)/),o=/micromessenger/i.test(e);if(r&&(n.firefox=!0,n.version=r[1]),i&&(n.ie=!0,n.version=i[1]),a&&(n.edge=!0,n.version=a[1],n.newEdge=+a[1].split(`.`)[0]>18),o&&(n.weChat=!0),t.svgSupported=typeof SVGRect<`u`,t.touchEventsSupported=`ontouchstart`in window&&!n.ie&&!n.edge,t.pointerEventsSupported=`onpointerdown`in window&&(n.edge||n.ie&&+n.version>=11),t.domSupported=typeof document<`u`){var s=document.documentElement.style;t.transform3dSupported=(n.ie&&`transition`in s||n.edge||`WebKitCSSMatrix`in window&&`m11`in new WebKitCSSMatrix||`MozPerspective`in s)&&!(`OTransition`in s),t.transformSupported=t.transform3dSupported||n.ie&&+n.version>=9}}var cu=1e-4,lu=20;function uu(e){return e.replace(/^\s+|\s+$/g,``)}var du=Math.min,fu=Math.max,pu=Math.abs,mu=Math.round,hu=Math.floor,gu=Math.ceil,_u=Math.pow,vu=Math.log,yu=Math.LN10,bu=Math.PI,xu=Math.random;function Su(e,t,n,r){var i=t[0],a=t[1],o=n[0],s=n[1],c=a-i,l=s-o;if(c===0)return l===0?o:(o+s)/2;if(r){if(c>0){if(e<=i)return o;if(e>=a)return s}else if(e>=i)return o;else if(e<=a)return s}else{if(e===i)return o;if(e===a)return s}return(e-i)/c*l+o}var Cu=wu;function wu(e,t,n){switch(e){case`center`:case`middle`:e=`50%`;break;case`left`:case`top`:e=`0%`;break;case`right`:case`bottom`:e=`100%`}return Tu(e,t,n)}function Tu(e,t,n){return Y(e)?Eu(e)?parseFloat(e)/100*t+(n||0):parseFloat(e):e==null?NaN:+e}function Eu(e){return!!uu(e).match(/%$/)}function Du(e,t,n){return isNaN(t)?n?``+e:+e:(t=du(fu(0,t),lu),e=(+e).toFixed(t),n?e:+e)}function Ou(e){return e.sort(function(e,t){return e-t}),e}function ku(e){if(e=+e,isNaN(e))return 0;if(e>1e-14){for(var t=1,n=0;n<15;n++,t*=10)if(mu(e*t)/t===e)return n}return Au(e)}function Au(e){var t=e.toString().toLowerCase(),n=t.indexOf(`e`),r=n>0?+t.slice(n+1):0,i=n>0?n:t.length,a=t.indexOf(`.`);return fu(0,(a<0?0:i-1-a)-r)}function ju(e,t,n){var r=pu(e[1]-e[0]);if(!isFinite(r)||r===0)return NaN;var i=vu(2*pu(n||1)*pu(r))/yu,a=vu(pu(t))/yu,o=fu(0,gu(-i+a));return isFinite(o)||(o=NaN),o}function Mu(e,t){var n=fu(ku(e),ku(t)),r=e+t;return n>lu?r:Du(r,n)}var Nu=_u(2,53)-1;function Pu(e){var t=bu*2;return(e%t+t)%t}function Fu(e){return e>-cu&&e=10&&t++,t}function Bu(e,t){var n=zu(e),r=_u(10,n),i=e/r;return e=(t===2?1:t?i<1.5?1:i<2.5?2:i<4?3:i<7?5:10:i<1?1:i<2?2:i<3?3:i<5?5:10)*r,Du(e,-n)}function Vu(e){e.sort(function(e,t){return s(e,t,0)?-1:1});for(var t=-1/0,n=1,r=0;r0?e.length:0),this.item=null,this.key=NaN,this},e.prototype.next=function(){return(this._step>0?this._idx=this._end)&&(this.item=this._list[this._idx],this.key=this._idx+=this._step,!0)},e})();function Ld(){return[1/0,-1/0]}function Rd(e,t){Hd(t)&&(te[1]&&(e[1]=t))}function zd(e,t){Hd(t)&&te[1]&&(e[1]=t)}function Vd(e,t){Ud(t[0],t[1])&&(t[0]e[1]&&(e[1]=t[1]))}function Hd(e){return e!=null&&isFinite(e)}function Ud(e,t){return Hd(e)&&Hd(t)&&e<=t}function Wd(e){var t=e[1]-e[0];return isFinite(t)&&t>=0}function Gd(e){Ud(e[0],e[1])&&e[0]>e[1]&&(e[0]=e[1])}function Kd(){var e=`__ec_once_`+qd++;return function(t,n){Z(t,e)||(t[e]=1,n())}}var qd=Wu();function Jd(e,t,n){var r=$l(),i=0;G(e,function(a){var o=t(a),s=r.get(o)||0;n&&n(a,s),!s&&!n&&(e[i++]=a),r.set(o,s+1)}),n||(e.length=i)}function Yd(e){return e.value+``}function Xd(e){return e+``}function Zd(e,t){return X(t,!0)?e.seriesIndex+2:0}function Qd(e,t,n){var r=e.getData().count();return{progressiveRender:n.progressiveEnabled&&t.incrementalPrepareRender&&r>=n.threshold,large:e.get(`large`)&&r>=e.get(`largeThreshold`),modDataCount:e.get(`progressiveChunkMode`)===`mod`?e.getData().count():null}}function $d(e){return{overallReset:e}}var ef=`.`,tf=`___EC__COMPONENT__CONTAINER___`,nf=`___EC__EXTENDED_CLASS___`;function rf(e){var t={main:``,sub:``};if(e){var n=e.split(ef);t.main=n[0]||``,t.sub=n[1]||``}return t}function af(e){Wl(/^[a-zA-Z0-9_]+([.][a-zA-Z0-9_]+)?$/.test(e),`componentType "`+e+`" illegal`)}function of(e){return!!(e&&e[nf])}function sf(e,t){e.$constructor=e,e.extend=function(e){var t=this,n;return cf(t)?n=function(e){U(t,e);function t(){return e.apply(this,arguments)||this}return t}(t):(n=function(){(e.$constructor||t).apply(this,arguments)},xl(n,this)),W(n.prototype,e),n[nf]=!0,n.extend=this.extend,n.superCall=ff,n.superApply=pf,n.superClass=t,n}}function cf(e){return Al(e)&&/^class\s/.test(Function.prototype.toString.call(e))}function lf(e,t){e.extend=t.extend}var uf=Math.round(Math.random()*10);function df(e){var t=[`__\0is_clz`,uf++].join(`_`);e.prototype[t]=!0,e.isInstance=function(e){return!!(e&&e[t])}}function ff(e,t){var n=[...arguments].slice(2);return this.superClass.prototype[t].apply(e,n)}function pf(e,t,n){return this.superClass.prototype[t].apply(e,n)}function mf(e){var t={};e.registerClass=function(e){var r=e.type||e.prototype.type;if(r){af(r),e.prototype.type=r;var i=rf(r);if(!i.sub)t[i.main]=e;else if(i.sub!==tf){var a=n(i);a[i.sub]=e}}return e},e.getClass=function(e,n,r){var i=t[e];if(i&&i[tf]&&(i=n?i[n]:null),r&&!i)throw Error(n?`Component `+e+`.`+(n||``)+` is used but not imported.`:e+`.type should be specified.`);return i},e.getClassesByMainType=function(e){var n=rf(e),r=[],i=t[n.main];return i&&i[tf]?G(i,function(e,t){t!==tf&&r.push(e)}):r.push(i),r},e.hasClass=function(e){return!!t[rf(e).main]},e.getAllClassMainTypes=function(){var e=[];return G(t,function(t,n){e.push(n)}),e},e.hasSubTypes=function(e){var n=t[rf(e).main];return n&&n[tf]};function n(e){var n=t[e.main];return(!n||!n[tf])&&(n=t[e.main]={},n[tf]=!0),n}}function hf(e,t){for(var n=0;n=0||i&&bl(i,s)<0)){var c=n.getShallow(s,t);c!=null&&(a[e[o][0]]=c)}}return a}}var gf=hf([[`fill`,`color`],[`shadowBlur`],[`shadowOffsetX`],[`shadowOffsetY`],[`opacity`],[`shadowColor`]]),_f=function(){function e(){}return e.prototype.getAreaStyle=function(e,t){return gf(this,e,t)},e}(),vf=function(){function e(e){this.value=e}return e}(),yf=function(){function e(){this._len=0}return e.prototype.insert=function(e){var t=new vf(e);return this.insertEntry(t),t},e.prototype.insertEntry=function(e){this.head?(this.tail.next=e,e.prev=this.tail,e.next=null,this.tail=e):this.head=this.tail=e,this._len++},e.prototype.remove=function(e){var t=e.prev,n=e.next;t?t.next=n:this.head=n,n?n.prev=t:this.tail=t,e.next=e.prev=null,this._len--},e.prototype.len=function(){return this._len},e.prototype.clear=function(){this.head=this.tail=null,this._len=0},e}(),bf=function(){function e(e){this._list=new yf,this._maxSize=10,this._map={},this._maxSize=e}return e.prototype.put=function(e,t){var n=this._list,r=this._map,i=null;if(r[e]==null){var a=n.len(),o=this._lastRemovedEntry;if(a>=this._maxSize&&a>0){var s=n.head;n.remove(s),delete r[s.key],i=s.value,this._lastRemovedEntry=s}o?o.value=t:o=new vf(t),o.key=e,n.insertEntry(o),r[e]=o}return i},e.prototype.get=function(e){var t=this._map[e],n=this._list;if(t!=null)return t!==n.tail&&(n.remove(t),n.insertEntry(t)),t.value},e.prototype.clear=function(){this._list.clear(),this._map={}},e.prototype.len=function(){return this._list.len()},e}(),xf=new bf(50);function Sf(e){if(typeof e==`string`){var t=xf.get(e);return t&&t.image}return e}function Cf(e,t,n,r,i){if(!e)return t;if(typeof e==`string`){if(t&&t.__zrImageSrc===e||!n)return t;var a=xf.get(e),o={hostEl:n,cb:r,cbPayload:i};return a?(t=a.image,!Tf(t)&&a.pending.push(o)):(t=$c.loadImage(e,wf,wf),t.__zrImageSrc=e,xf.put(e,t.__cachedImgObj={image:t,pending:[o]})),t}return e}function wf(){var e=this.__cachedImgObj;this.onload=this.onerror=this.__cachedImgObj=null;for(var t=0;tu||d>f||p>m||h>g)return!1;var _=!(u=e.x&&t<=e.x+e.width&&n>=e.y&&n<=e.y+e.height},e.prototype.contain=function(t,n){return e.contain(this,t,n)},e.prototype.clone=function(){return new e(this.x,this.y,this.width,this.height)},e.prototype.copy=function(e){hp(this,e)},e.prototype.plain=function(){return{x:this.x,y:this.y,width:this.width,height:this.height}},e.prototype.isFinite=function(){return isFinite(this.x)&&isFinite(this.y)&&isFinite(this.width)&&isFinite(this.height)},e.prototype.isZero=function(){return this.width===0||this.height===0},e.create=function(t){return new e(t?t.x:0,t?t.y:0,t?t.width:0,t?t.height:0)},e.copy=function(e,t){return e.x=t.x,e.y=t.y,e.width=t.width,e.height=t.height,e},e.applyTransform=function(e,t,n){if(!n){e!==t&&hp(e,t);return}if(n[1]<1e-5&&n[1]>-1e-5&&n[2]<1e-5&&n[2]>-1e-5){var r=n[0],i=n[3],a=n[4],o=n[5];e.x=t.x*r+a,e.y=t.y*i+o,e.width=t.width*r,e.height=t.height*i,e.width<0&&(e.x+=e.width,e.width=-e.width),e.height<0&&(e.y+=e.height,e.height=-e.height);return}ip.x=op.x=t.x,ip.y=sp.y=t.y,ap.x=sp.x=t.x+t.width,ap.y=op.y=t.y+t.height,ip.transform(n),sp.transform(n),ap.transform(n),op.transform(n),e.x=$f(ip.x,ap.x,op.x,sp.x),e.y=$f(ip.y,ap.y,op.y,sp.y);var s=ep(ip.x,ap.x,op.x,sp.x),c=ep(ip.y,ap.y,op.y,sp.y);e.width=s-e.x,e.height=c-e.y},e.calculateTransform=function(e,t,n){var r=n.width/t.width,i=n.height/t.height;return e=Df(e||[]),Af(e,e,Lf(xp,-t.x,-t.y)),Mf(e,e,Lf(xp,r,i)),Af(e,e,Lf(xp,n.x,n.y)),e},e}(),pp=fp.create,mp=fp.set,hp=fp.copy,gp=fp.calculateTransform,_p=fp.applyTransform,vp=fp.contain,yp=new fp(0,0,0,0),bp=new fp(0,0,0,0),xp=[];function Sp(e,t,n,r,i,a,o,s){var c=tp(t-n),l=tp(r-e),u=$f(c,l),d=np[i],f=np[1-i],p=rp[i];t=l||!cp.bidirectional)&&(lp[d]=-l,lp[f]=0,cp.useDir&&cp.calcDirMTV())))}function Cp(){var e=0,t=new Qf,n=new Qf,r={minTv:new Qf,maxTv:new Qf,useDir:!1,dirMinTv:new Qf,touchThreshold:0,bidirectional:!0,negativeSize:!1,reset:function(i,a){r.touchThreshold=0,i&&i.touchThreshold!=null&&(r.touchThreshold=ep(0,i.touchThreshold)),r.negativeSize=!1,a&&(r.minTv.set(1/0,1/0),r.maxTv.set(0,0),r.useDir=!1,i&&i.direction!=null&&(r.useDir=!0,r.dirMinTv.copy(r.minTv),n.copy(r.minTv),e=i.direction,r.bidirectional=i.bidirectional==null||!!i.bidirectional,r.bidirectional||t.set(Math.cos(e),Math.sin(e))))},calcDirMTV:function(){var a=r.minTv,o=r.dirMinTv,s=a.y*a.y+a.x*a.x,c=Math.sin(e),l=Math.cos(e),u=c*a.y+l*a.x;if(i(u)){i(a.x)&&i(a.y)&&o.set(0,0);return}if(n.x=s*l/u,n.y=s*c/u,i(n.x)&&i(n.y)){o.set(0,0);return}(r.bidirectional||t.dot(n)>0)&&n.len()=Op)){e||=`12px sans-serif`;for(var t=[],n=+new Date,r=0;r<=127;r++)t[r]=$c.measureText(String.fromCharCode(r),e).width;var i=+new Date-n;return i>16?Dp=Op:i>2&&Dp++,t}}var Dp=0,Op=5;function kp(e,t){return e.asciiWidthMapTried||=(e.asciiWidthMap=Ep(e.font),!0),0<=t&&t<=127?e.asciiWidthMap==null?e.asciiCharWidth:e.asciiWidthMap[t]:e.stWideCharWidth}function Ap(e,t){var n=e.strWidthCache,r=n.get(t);return r??(r=$c.measureText(t,e.font).width,n.put(t,r)),r}function jp(e,t,n,r){var i=Ap(wp(t),e),a=Fp(t);return new fp(Np(0,i,n),Pp(0,a,r),i,a)}function Mp(e,t,n,r){var i=((e||``)+``).split(` +`,e.getElementsByTagName(`head`)[0].appendChild(n)}e.body&&ce(e.body,`react-draggable-transparent-selection`)}function z(e){window.requestAnimationFrame?window.requestAnimationFrame(()=>{se(e)}):se(e)}function se(e){if(e)try{e.body&&le(e.body,`react-draggable-transparent-selection`);let t=e.selection;if(t)t.empty();else{let t=(e.defaultView||window).getSelection();t&&t.type!==`Caret`&&t.removeAllRanges()}}catch{}}function ce(e,t){e.classList?e.classList.add(t):e.className.match(RegExp(`(?:^|\\s)${t}(?!\\S)`))||(e.className+=` ${t}`)}function le(e,t){e.classList?e.classList.remove(t):e.className=e.className.replace(RegExp(`(?:^|\\s)${t}(?!\\S)`,`g`),``)}function ue(e,t,n){if(!e.props.bounds)return[t,n];let{bounds:r}=e.props;r=typeof r==`string`?r:_e(r);let i=ve(e);if(typeof r==`string`){let{ownerDocument:e}=i,t=e.defaultView;if(!t)throw Error(`Cannot resolve the owner window of the draggable node.`);let n;if(n=r===`parent`?i.parentNode:i.getRootNode().querySelector(r),!(n instanceof t.HTMLElement))throw Error(`Bounds selector "`+r+`" could not find an element.`);let a=n,o=t.getComputedStyle(i),s=t.getComputedStyle(a);r={left:-i.offsetLeft+S(s.paddingLeft)+S(o.marginLeft),top:-i.offsetTop+S(s.paddingTop)+S(o.marginTop),right:L(a)-F(i)-i.offsetLeft+S(s.paddingRight)-S(o.marginRight),bottom:I(a)-P(i)-i.offsetTop+S(s.paddingBottom)-S(o.marginBottom)}}return x(r.right)&&(t=Math.min(t,r.right)),x(r.bottom)&&(n=Math.min(n,r.bottom)),x(r.left)&&(t=Math.max(t,r.left)),x(r.top)&&(n=Math.max(n,r.top)),[t,n]}function de(e,t,n){return[Math.round(t/e[0])*e[0],Math.round(n/e[1])*e[1]]}function fe(e){return e.props.axis===`both`||e.props.axis===`x`}function pe(e){return e.props.axis===`both`||e.props.axis===`y`}function me(e,t,n){let r=typeof t==`number`?ie(e,t):null;if(typeof t==`number`&&!r)return null;let i=ve(n),a=n.props.offsetParent||i.offsetParent||i.ownerDocument.body;return ee(r||e,a,n.props.scale)}function he(e,t,n){let r=!x(e.lastX),i=ve(e);return r?{node:i,deltaX:0,deltaY:0,lastX:t,lastY:n,x:t,y:n}:{node:i,deltaX:t-e.lastX,deltaY:n-e.lastY,lastX:e.lastX,lastY:e.lastY,x:t,y:n}}function ge(e,t){let n=e.props.scale;return{node:t.node,x:e.state.x+t.deltaX/n,y:e.state.y+t.deltaY/n,deltaX:t.deltaX/n,deltaY:t.deltaY/n,lastX:e.state.x,lastY:e.state.y}}function _e(e){return{left:e.left,top:e.top,right:e.right,bottom:e.bottom}}function ve(e){let t=e.findDOMNode();if(!t)throw Error(`: Unmounted during event!`);return t}var ye=d(t()),be=d(no()),xe=d(b()),B=typeof process<`u`&&{}.DRAGGABLE_DEBUG?console.log.bind(console):function(){},Se={touch:{start:`touchstart`,move:`touchmove`,stop:`touchend`},mouse:{start:`mousedown`,move:`mousemove`,stop:`mouseup`}},Ce=Se.mouse,we=class extends ye.Component{constructor(){super(...arguments),this.dragging=!1,this.lastX=NaN,this.lastY=NaN,this.touchIdentifier=null,this.mounted=!1,this.handleDragStart=e=>{if(this.props.onMouseDown(e),!this.props.allowAnyClick&&(typeof e.button==`number`&&e.button!==0||e.ctrlKey))return!1;let t=this.findDOMNode();if(!t||!t.ownerDocument||!t.ownerDocument.body)throw Error(` not mounted on DragStart!`);let{ownerDocument:n}=t;if(this.props.disabled||!(e.target instanceof n.defaultView.Node)||this.props.handle&&!j(e.target,this.props.handle,t)||this.props.cancel&&j(e.target,this.props.cancel,t))return;e.type===`touchstart`&&!this.props.allowMobileScroll&&e.preventDefault();let r=ae(e);this.touchIdentifier=r;let i=me(e,r,this);if(i==null)return;let{x:a,y:o}=i,s=he(this,a,o);B(`DraggableCore: handleDragStart: %j`,s),B(`calling`,this.props.onStart),this.props.onStart(e,s)!==!1&&this.mounted!==!1&&(this.props.enableUserSelectHack&&oe(n,this.props.nonce),this.dragging=!0,this.lastX=a,this.lastY=o,M(n,Ce.move,this.handleDrag),M(n,Ce.stop,this.handleDragStop))},this.handleDrag=e=>{let t=me(e,this.touchIdentifier,this);if(t==null)return;let{x:n,y:r}=t;if(Array.isArray(this.props.grid)){let e=n-this.lastX,t=r-this.lastY;if([e,t]=de(this.props.grid,e,t),!e&&!t)return;n=this.lastX+e,r=this.lastY+t}let i=he(this,n,r);if(B(`DraggableCore: handleDrag: %j`,i),this.props.onDrag(e,i)===!1||this.mounted===!1){try{this.handleDragStop(new MouseEvent(`mouseup`))}catch{let e=document.createEvent(`MouseEvents`);e.initMouseEvent(`mouseup`,!0,!0,window,0,0,0,0,0,!1,!1,!1,!1,0,null),this.handleDragStop(e)}return}this.lastX=n,this.lastY=r},this.handleDragStop=e=>{if(!this.dragging)return;let t=me(e,this.touchIdentifier,this);if(t==null)return;let{x:n,y:r}=t;if(Array.isArray(this.props.grid)){let e=n-this.lastX||0,t=r-this.lastY||0;[e,t]=de(this.props.grid,e,t),n=this.lastX+e,r=this.lastY+t}let i=he(this,n,r);if(this.props.onStop(e,i)===!1||this.mounted===!1)return!1;let a=this.findDOMNode();a&&this.props.enableUserSelectHack&&z(a.ownerDocument),B(`DraggableCore: handleDragStop: %j`,i),this.dragging=!1,this.lastX=NaN,this.lastY=NaN,a&&(B(`DraggableCore: Removing handlers`),N(a.ownerDocument,Ce.move,this.handleDrag),N(a.ownerDocument,Ce.stop,this.handleDragStop))},this.onMouseDown=e=>(Ce=Se.mouse,this.handleDragStart(e)),this.onMouseUp=e=>(Ce=Se.mouse,this.handleDragStop(e)),this.onTouchStart=e=>(Ce=Se.touch,this.handleDragStart(e)),this.onTouchEnd=e=>(Ce=Se.touch,this.handleDragStop(e))}componentDidMount(){this.mounted=!0;let e=this.findDOMNode();e&&M(e,Se.touch.start,this.onTouchStart,{passive:!1})}componentWillUnmount(){this.mounted=!1;let e=this.findDOMNode();if(e){let{ownerDocument:t}=e;N(t,Se.mouse.move,this.handleDrag),N(t,Se.touch.move,this.handleDrag),N(t,Se.mouse.stop,this.handleDragStop),N(t,Se.touch.stop,this.handleDragStop),N(e,Se.touch.start,this.onTouchStart,{passive:!1}),this.props.enableUserSelectHack&&z(t)}}findDOMNode(){if(this.props?.nodeRef)return this.props.nodeRef.current;let e=xe.default;return typeof e.findDOMNode==`function`?e.findDOMNode(this):(B(`react-draggable: ReactDOM.findDOMNode is not available in React 19+. You must provide a nodeRef prop. See: https://github.com/react-grid-layout/react-draggable#noderef`),null)}render(){return ye.cloneElement(ye.Children.only(this.props.children),{onMouseDown:this.onMouseDown,onMouseUp:this.onMouseUp,onTouchEnd:this.onTouchEnd})}};we.displayName=`DraggableCore`,we.propTypes={allowAnyClick:be.default.bool,allowMobileScroll:be.default.bool,children:be.default.node.isRequired,disabled:be.default.bool,enableUserSelectHack:be.default.bool,offsetParent:function(e,t){if(e[t]&&e[t].nodeType!==1)throw Error(`Draggable's offsetParent must be a DOM Node.`)},grid:be.default.arrayOf(be.default.number),handle:be.default.string,cancel:be.default.string,nodeRef:be.default.object,nonce:be.default.string,onStart:be.default.func,onDrag:be.default.func,onStop:be.default.func,onMouseDown:be.default.func,scale:be.default.number,className:C,style:C,transform:C},we.defaultProps={allowAnyClick:!1,allowMobileScroll:!1,disabled:!1,enableUserSelectHack:!0,onStart:function(){},onDrag:function(){},onStop:function(){},onMouseDown:function(){},scale:1};var Te=class extends m.Component{constructor(e){super(e),this.onDragStart=(e,t)=>{if(B(`Draggable: onDragStart: %j`,t),this.props.onStart(e,ge(this,t))===!1)return!1;this.setState({dragging:!0,dragged:!0})},this.onDrag=(e,t)=>{if(!this.state.dragging)return!1;B(`Draggable: onDrag: %j`,t);let n=ge(this,t),r={x:n.x,y:n.y,slackX:0,slackY:0};if(this.props.bounds){let{x:e,y:t}=r;r.x+=this.state.slackX,r.y+=this.state.slackY;let[i,a]=ue(this,r.x,r.y);r.x=i,r.y=a,r.slackX=this.state.slackX+(e-r.x),r.slackY=this.state.slackY+(t-r.y),n.x=r.x,n.y=r.y,n.deltaX=r.x-this.state.x,n.deltaY=r.y-this.state.y}if(this.props.onDrag(e,n)===!1)return!1;this.setState(r)},this.onDragStop=(e,t)=>{if(!this.state.dragging||this.props.onStop(e,ge(this,t))===!1)return!1;B(`Draggable: onDragStop: %j`,t);let n={dragging:!1,slackX:0,slackY:0};if(this.props.position){let{x:e,y:t}=this.props.position;n.x=e,n.y=t}this.setState(n)},this.state={dragging:!1,dragged:!1,x:e.position?e.position.x:e.defaultPosition.x,y:e.position?e.position.y:e.defaultPosition.y,prevPropsPosition:{...e.position},slackX:0,slackY:0,isElementSVG:!1},e.position&&!(e.onDrag||e.onStop)&&console.warn("A `position` was applied to this , without drag handlers. This will make this component effectively undraggable. Please attach `onDrag` or `onStop` handlers so you can adjust the `position` of this element.")}static getDerivedStateFromProps({position:e},{prevPropsPosition:t}){return e&&(!t||e.x!==t.x||e.y!==t.y)?(B(`Draggable: getDerivedStateFromProps %j`,{position:e,prevPropsPosition:t}),{x:e.x,y:e.y,prevPropsPosition:{...e}}):null}componentDidMount(){window.SVGElement!==void 0&&this.findDOMNode()instanceof window.SVGElement&&this.setState({isElementSVG:!0})}componentWillUnmount(){this.state.dragging&&this.setState({dragging:!1})}findDOMNode(){if(this.props?.nodeRef)return this.props.nodeRef.current;let e=g.default;return typeof e.findDOMNode==`function`?e.findDOMNode(this):null}render(){let{axis:e,bounds:t,children:n,defaultPosition:r,defaultClassName:i,defaultClassNameDragging:a,defaultClassNameDragged:o,position:s,positionOffset:c,scale:l,...u}=this.props,d={},f=null,p=!s||this.state.dragging,h=s||r,g={x:fe(this)&&p?this.state.x:h.x,y:pe(this)&&p?this.state.y:h.y};this.state.isElementSVG?f=ne(g,c):d=te(g,c);let v=m.Children.only(n),y=(0,_.clsx)(v.props.className||``,i,{[a]:this.state.dragging,[o]:this.state.dragged});return m.createElement(we,{...u,onStart:this.onDragStart,onDrag:this.onDrag,onStop:this.onDragStop},m.cloneElement(v,{className:y,style:{...v.props.style,...d},transform:f}))}};Te.displayName=`Draggable`,Te.propTypes={...we.propTypes,axis:h.default.oneOf([`both`,`x`,`y`,`none`]),bounds:h.default.oneOfType([h.default.shape({left:h.default.number,right:h.default.number,top:h.default.number,bottom:h.default.number}),h.default.string,h.default.oneOf([!1])]),defaultClassName:h.default.string,defaultClassNameDragging:h.default.string,defaultClassNameDragged:h.default.string,defaultPosition:h.default.shape({x:h.default.number,y:h.default.number}),positionOffset:h.default.shape({x:h.default.oneOfType([h.default.number,h.default.string]),y:h.default.oneOfType([h.default.number,h.default.string])}),position:h.default.shape({x:h.default.number,y:h.default.number}),className:C,style:C,transform:C},Te.defaultProps={...we.defaultProps,axis:`both`,bounds:!1,defaultClassName:`react-draggable`,defaultClassNameDragging:`react-draggable-dragging`,defaultClassNameDragged:`react-draggable-dragged`,defaultPosition:{x:0,y:0},scale:1},0&&(n.exports={DraggableCore:we})})),Qo=e(((e,t)=>{var n=Zo(),r=n.DraggableCore,i=n.default||n;t.exports=i,t.exports.default=i,t.exports.DraggableCore=r})),$o=e((e=>{e.__esModule=!0,e.cloneElement=l;var n=r(t());function r(e){return e&&e.__esModule?e:{default:e}}function i(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function a(e){for(var t=1;t{e.__esModule=!0,e.resizableProps=void 0;var t=n(no());Qo();function n(e){return e&&e.__esModule?e:{default:e}}e.resizableProps={axis:t.default.oneOf([`both`,`x`,`y`,`none`]),className:t.default.string,children:t.default.element.isRequired,draggableOpts:t.default.shape({allowAnyClick:t.default.bool,cancel:t.default.string,children:t.default.node,disabled:t.default.bool,enableUserSelectHack:t.default.bool,offsetParent:typeof Element<`u`?t.default.instanceOf(Element):t.default.any,grid:t.default.arrayOf(t.default.number),handle:t.default.string,nodeRef:t.default.object,onStart:t.default.func,onDrag:t.default.func,onStop:t.default.func,onMouseDown:t.default.func,scale:t.default.number}),height:function(){var e=[...arguments];let n=e[0];return n.axis===`both`||n.axis===`y`?t.default.number.isRequired(...e):t.default.number(...e)},handle:t.default.oneOfType([t.default.node,t.default.func]),handleSize:t.default.arrayOf(t.default.number),lockAspectRatio:t.default.bool,maxConstraints:t.default.arrayOf(t.default.number),minConstraints:t.default.arrayOf(t.default.number),onResizeStop:t.default.func,onResizeStart:t.default.func,onResize:t.default.func,resizeHandles:t.default.arrayOf(t.default.oneOf([`s`,`w`,`e`,`n`,`sw`,`nw`,`se`,`ne`])),transformScale:t.default.number,width:function(){var e=[...arguments];let n=e[0];return n.axis===`both`||n.axis===`x`?t.default.number.isRequired(...e):t.default.number(...e)}}})),ts=e((e=>{e.__esModule=!0,e.default=void 0;var n=s(t()),r=Qo(),i=$o(),a=es(),o=[`children`,`className`,`draggableOpts`,`width`,`height`,`handle`,`handleSize`,`lockAspectRatio`,`axis`,`minConstraints`,`maxConstraints`,`onResize`,`onResizeStop`,`onResizeStart`,`resizeHandles`,`transformScale`];function s(e,t){if(typeof WeakMap==`function`)var n=new WeakMap,r=new WeakMap;return(s=function(e,t){if(!t&&e&&e.__esModule)return e;var i,a,o={__proto__:null,default:e};if(e===null||typeof e!=`object`&&typeof e!=`function`)return o;if(i=t?r:n){if(i.has(e))return i.get(e);i.set(e,o)}for(let t in e)t!=="default"&&{}.hasOwnProperty.call(e,t)&&((a=(i=Object.defineProperty)&&Object.getOwnPropertyDescriptor(e,t))&&(a.get||a.set)?i(o,t,a):o[t]=e[t]);return o})(e,t)}function c(){return c=Object.assign?Object.assign.bind():function(e){for(var t=1;tMath.abs(i*n)?t=e/n:e=t*n}let o=e,s=t,c=this.slack||[0,0],l=c[0],u=c[1];return e+=l,t+=u,r&&(e=Math.max(r[0],e),t=Math.max(r[1],t)),i&&(e=Math.min(i[0],e),t=Math.min(i[1],t)),this.slack=[l+(o-e),u+(s-t)],[e,t]}resizeHandler(e,t){return(n,r)=>{let i=r.node,a=r.deltaX,o=r.deltaY;e===`onResizeStart`&&this.resetData();let s=(this.props.axis===`both`||this.props.axis===`x`)&&t!==`n`&&t!==`s`,c=(this.props.axis===`both`||this.props.axis===`y`)&&t!==`e`&&t!==`w`;if(!s&&!c)return;let l=t[0],u=t[t.length-1],d=i.getBoundingClientRect();if(this.lastHandleRect!=null){if(u===`w`){let e=d.left-this.lastHandleRect.left;a+=e}if(l===`n`){let e=d.top-this.lastHandleRect.top;o+=e}}this.lastHandleRect=d,u===`w`&&(a=-a),l===`n`&&(o=-o);let f=this.lastSize?.width??this.props.width,p=this.lastSize?.height??this.props.height,m=f+(s?a/this.props.transformScale:0),h=p+(c?o/this.props.transformScale:0);var g=this.runConstraints(m,h);if(m=g[0],h=g[1],e===`onResizeStop`&&this.lastSize){var _=this.lastSize;m=_.width,h=_.height}let v=m!==f||h!==p;e!==`onResizeStop`&&(this.lastSize={width:m,height:h});let y=typeof this.props[e]==`function`?this.props[e]:null;y&&(e!==`onResize`||v)&&(n.persist==null||n.persist(),y(n,{node:i,size:{width:m,height:h},handle:t})),e===`onResizeStop`&&this.resetData()}}renderResizeHandle(e,t){let r=this.props.handle;if(!r)return n.createElement(`span`,{className:`react-resizable-handle react-resizable-handle-`+e,ref:t});if(typeof r==`function`)return r(e,t);let i=typeof r.type==`string`,a=d({ref:t},i?{}:{handleAxis:e});return n.cloneElement(r,a)}render(){let e=this.props,t=e.children,a=e.className,s=e.draggableOpts;e.width,e.height,e.handle,e.handleSize,e.lockAspectRatio,e.axis,e.minConstraints,e.maxConstraints,e.onResize,e.onResizeStop,e.onResizeStart;let u=e.resizeHandles;e.transformScale;let f=l(e,o);return(0,i.cloneElement)(t,d(d({},f),{},{className:(a?a+` `:``)+`react-resizable`,children:[...n.Children.toArray(t.props.children),...u.map(e=>{let t=this.handleRefs[e]??(this.handleRefs[e]=n.createRef());return n.createElement(r.DraggableCore,c({},s,{nodeRef:t,key:`resizableHandle-`+e,onStop:this.resizeHandler(`onResizeStop`,e),onStart:this.resizeHandler(`onResizeStart`,e),onDrag:this.resizeHandler(`onResize`,e)}),this.renderResizeHandle(e,t))})]}))}};e.default=h,h.propTypes=a.resizableProps,h.defaultProps={axis:`both`,handleSize:[20,20],lockAspectRatio:!1,minConstraints:[20,20],maxConstraints:[1/0,1/0],resizeHandles:[`se`],transformScale:1}})),ns=e((e=>{e.__esModule=!0,e.default=void 0;var n=c(t()),r=s(no()),i=s(ts()),a=es(),o=[`handle`,`handleSize`,`onResize`,`onResizeStart`,`onResizeStop`,`draggableOpts`,`minConstraints`,`maxConstraints`,`lockAspectRatio`,`axis`,`width`,`height`,`resizeHandles`,`style`,`transformScale`];function s(e){return e&&e.__esModule?e:{default:e}}function c(e,t){if(typeof WeakMap==`function`)var n=new WeakMap,r=new WeakMap;return(c=function(e,t){if(!t&&e&&e.__esModule)return e;var i,a,o={__proto__:null,default:e};if(e===null||typeof e!=`object`&&typeof e!=`function`)return o;if(i=t?r:n){if(i.has(e))return i.get(e);i.set(e,o)}for(let t in e)t!=="default"&&{}.hasOwnProperty.call(e,t)&&((a=(i=Object.defineProperty)&&Object.getOwnPropertyDescriptor(e,t))&&(a.get||a.set)?i(o,t,a):o[t]=e[t]);return o})(e,t)}function l(){return l=Object.assign?Object.assign.bind():function(e){for(var t=1;t{let n=t.size;this.props.onResize?(e.persist==null||e.persist(),this.setState(n,()=>this.props.onResize&&this.props.onResize(e,t))):this.setState(n)}}static getDerivedStateFromProps(e,t){return t.propsWidth!==e.width||t.propsHeight!==e.height?{width:e.width,height:e.height,propsWidth:e.width,propsHeight:e.height}:null}render(){let e=this.props,t=e.handle,r=e.handleSize;e.onResize;let a=e.onResizeStart,s=e.onResizeStop,c=e.draggableOpts,u=e.minConstraints,f=e.maxConstraints,p=e.lockAspectRatio,m=e.axis;e.width,e.height;let g=e.resizeHandles,_=e.style,v=e.transformScale,y=h(e,o);return n.createElement(i.default,{axis:m,draggableOpts:c,handle:t,handleSize:r,height:this.state.height,lockAspectRatio:p,maxConstraints:f,minConstraints:u,onResizeStart:a,onResize:this.onResize,onResizeStop:s,resizeHandles:g,transformScale:v,width:this.state.width},n.createElement(`div`,l({},y,{style:d(d({},_),{},{width:this.state.width+`px`,height:this.state.height+`px`})})))}};e.default=g,g.propTypes=d(d({},a.resizableProps),{},{children:r.default.element})})),rs=e(((e,t)=>{t.exports=function(){throw Error(`Don't instantiate Resizable directly! Use require('react-resizable').Resizable`)},t.exports.Resizable=ts().default,t.exports.ResizableBox=ns().default}))(),is=$a(),as=50,os=12;function ss(e){let t=e;for(;t;){let e=window.getComputedStyle(t).overflowY;if((e===`auto`||e===`scroll`)&&t.scrollHeight>t.clientHeight)return t;t=t.parentElement}return null}function cs(e){let t=ss(e),n=null,r=0,i=0,a=!1;function o(){let e=t;if(!e)return;let s=e.getBoundingClientRect(),{clientHeight:c,scrollTop:l,scrollHeight:u}=e,{scrollLeft:d,scrollWidth:f,clientWidth:p}=e,m=0,h=0;i0?m=-os:i>s.bottom-as&&l+c0?h=-os:r>s.right-as&&d+p({cols:n,containerPadding:a,containerWidth:r,margin:i,maxRows:s,rowHeight:o}),[n,a,r,i,s,o]),be=(0,V.useMemo)(()=>({cols:n,maxRows:s,containerWidth:r,containerHeight:0,rowHeight:o,margin:i,layout:[]}),[n,s,r,o,i]),xe=(0,V.useCallback)(e=>({...be,containerHeight:e??be.containerHeight,layout:fe.current}),[be]),B=(0,V.useMemo)(()=>I??{i:M,x:w,y:T,w:E,h:D,minW:O,maxW:k,minH:A,maxH:j},[I,M,w,T,E,D,O,k,A,j]),Se=(0,V.useCallback)(e=>{if(g?.calcStyle)return g.calcStyle(e);if(p)return ba(e);let t=xa(e);return m?{...t,left:Sa(e.left/r),width:Sa(e.width/r)}:t},[g,p,m,r]),Ce=(0,V.useCallback)((e,{node:t})=>{if(!ee)return;let{offsetParent:n}=t;if(!n)return;let r=n.getBoundingClientRect(),i=t.getBoundingClientRect(),a=i.left/h,o=r.left/h,s=i.top/h,c=r.top/h,l;if(g?.calcDragPosition){let t=e;l=g.calcDragPosition(t.clientX,t.clientY,t.clientX-i.left,t.clientY-i.top)}else l={left:a-o+n.scrollLeft,top:s-c+n.scrollTop};if(le.current=l,ve.current||=cs(t instanceof HTMLElement?t:null),v>0){let t=e;ge.current={x:t.clientX,y:t.clientY},he.current=!0,_e.current=!1,oe(!0);return}oe(!0);let u=Zi(ye,l.top,l.left),{x:d,y:f}=va(F,B,u.x,u.y,xe());ee(M,d,f,{e,node:t,newPosition:l})},[ee,h,ye,g,v,F,B,xe,M]),we=(0,V.useCallback)((e,{node:t,deltaX:n,deltaY:a})=>{if(!te||!R)return;let s=e;if(he.current&&!_e.current){let n=s.clientX-ge.current.x,r=s.clientY-ge.current.y;if(Math.hypot(n,r){if(!ne||!R)return;ve.current?.stop(),ve.current=null;let n=he.current;if(he.current=!1,_e.current=!1,ge.current={x:0,y:0},n){oe(!1),le.current={left:0,top:0};return}let{left:r,top:i}=le.current,a={top:i,left:r};oe(!1),le.current={left:0,top:0};let o=Zi(ye,i,r),{x:s,y:c}=va(F,B,o.x,o.y,xe());ne(M,s,c,{e,node:t,newPosition:a})},[ne,R,ye,F,B,xe,M]);pe.current=Ce,me.current=we;let Ee=(0,V.useCallback)((e,{node:t,size:n,handle:i},a,o)=>{let s=o===`onResizeStart`?re:o===`onResize`?ie:ae;if(!s)return;let c;c=t?Ma(i,a,n,r):{...n,top:a.top,left:a.left},ue.current=c;let l=t?.offsetParent?.clientHeight??0,u=Qi(ye,c.width,c.height),{w:d,h:f}=ya(F,B,u.w,u.h,i,xe(l));s(M,d,f,{e:e.nativeEvent??e,node:t,size:c,handle:i})},[re,ie,ae,r,ye,M,F,B,xe]),De=(0,V.useCallback)((e,t)=>{se(!0);let n=Yi(ye,w,T,E,D),r={...t,handle:t.handle};Ee(e,r,n,`onResizeStart`)},[Ee,ye,w,T,E,D]),Oe=(0,V.useCallback)((e,t)=>{let n=Yi(ye,w,T,E,D),r={...t,handle:t.handle};Ee(e,r,n,`onResize`)},[Ee,ye,w,T,E,D]),ke=(0,V.useCallback)((e,t)=>{se(!1),ue.current={top:0,left:0,width:0,height:0};let n=Yi(ye,w,T,E,D),r={...t,handle:t.handle};Ee(e,r,n,`onResizeStop`)},[Ee,ye,w,T,E,D]);(0,V.useEffect)(()=>{if(!y)return;let e=ce.current;if(!e)return;let t=de.current||{left:0,top:0},n=R&&(y.left!==t.left||y.top!==t.top);if(!R){let t={node:e,deltaX:y.left,deltaY:y.top,lastX:0,lastY:0,x:y.left,y:y.top};pe.current?.(y.e,t)}else if(n){let t={node:e,deltaX:y.left-le.current.left,deltaY:y.top-le.current.top,lastX:le.current.left,lastY:le.current.top,x:y.left,y:y.top};me.current?.(y.e,t)}de.current=y},[y,R,M]);let Ae=Yi(ye,w,T,E,D,R?le.current:null,z?ue.current:null),je=V.Children.only(t),Me=qi(ye),Ne=[Ji(O,Me,i[0]),Ji(A,o,i[1])],Pe=[Ji(k,Me,i[0]),Ji(j,o,i[1])],Fe=je.props,Ie=Fe.className,Le=Fe.style,Re=V.cloneElement(je,{ref:ce,className:_(`react-grid-item`,Ie,b,{static:f,resizing:z,"react-draggable":c,"react-draggable-dragging":R,dropping:!!y,cssTransforms:p}),style:{...x,...Le,...Se(Ae)}}),ze=P;return Re=(0,H.jsx)(rs.Resizable,{draggableOpts:{disabled:!l},className:l?void 0:`react-resizable-hide`,width:Ae.width,height:Ae.height,minConstraints:Ne,maxConstraints:Pe,onResizeStart:De,onResize:Oe,onResizeStop:ke,transformScale:h,resizeHandles:N,handle:ze,children:Re}),Re=(0,H.jsx)(Jo,{disabled:!c,onStart:Ce,onDrag:we,onStop:Te,handle:S,cancel:`.react-resizable-handle`+(C?`,`+C:``),scale:h,allowMobileScroll:d,nodeRef:ce,children:Re}),Re}var us=V.memo(ls,(e,t)=>e.x===t.x&&e.y===t.y&&e.w===t.w&&e.h===t.h&&e.minW===t.minW&&e.maxW===t.maxW&&e.minH===t.minH&&e.maxH===t.maxH&&e.cols===t.cols&&e.containerWidth===t.containerWidth&&e.rowHeight===t.rowHeight&&e.maxRows===t.maxRows&&e.margin===t.margin&&e.containerPadding===t.containerPadding&&e.transformScale===t.transformScale&&e.isDraggable===t.isDraggable&&e.isResizable===t.isResizable&&e.isBounded===t.isBounded&&e.allowMobileScroll===t.allowMobileScroll&&e.useCSSTransforms===t.useCSSTransforms&&e.usePercentages===t.usePercentages&&e.children===t.children&&e.onDrag===t.onDrag&&e.onDragStop===t.onDragStop&&e.onResize===t.onResize&&e.onResizeStop===t.onResizeStop&&e.droppingPosition===t.droppingPosition);us.displayName=`GridItem`;function ds(e){let{clientX:t,clientY:n,gridElement:r,droppingItem:i,event:a,dragOffsetX:o=0,dragOffsetY:s=0,transformScale:c,cols:l,margin:u,maxRows:d,rowHeight:f,width:p,containerPadding:m}=e,h=r.getBoundingClientRect(),g={cols:l,margin:u,maxRows:d,rowHeight:f,containerWidth:p,containerPadding:m},_=qi(g),v=Ji(i.w,_,u[0]),y=Ji(i.h,f,u[1]),b=v/2,x=y/2,S=r.scrollLeft??0,C=r.scrollTop??0,w=t-h.left+S+o-b,T=n-h.top+C+s-x,E=Math.max(0,w),D=Math.max(0,T);return{newDroppingPosition:{left:E/c,top:D/c,e:a},calculatedXY:Xi(g,D,E,i.w,i.h)}}var fs=()=>{},ps=`react-grid-layout`,ms=!1;try{ms=/firefox/i.test(navigator.userAgent)}catch{}function hs(e,t){let n=V.Children.toArray(e),r=V.Children.toArray(t);if(n.length!==r.length)return!1;for(let e=0;e{if(!V.isValidElement(t)||t.key===null)return;let n=String(t.key);a.add(n);let r=e.find(e=>e.i===n);if(r)i.push(la(r));else{let e=t.props[`data-grid`];e?i.push({i:n,x:e.x??0,y:e.y??0,w:e.w??1,h:e.h??1,minW:e.minW,maxW:e.maxW,minH:e.minH,maxH:e.maxH,static:e.static,isDraggable:e.isDraggable,isResizable:e.isResizable,resizeHandles:e.resizeHandles,isBounded:e.isBounded}):i.push({i:n,x:0,y:oa(i),w:1,h:1})}});let o=pa(i,{cols:n});return r.compact(o,n)}function _s(e){let{children:t,width:n,gridConfig:r,dragConfig:i,resizeConfig:a,dropConfig:o,positionStrategy:s=Na,compactor:c,constraints:l=_a,layout:u=[],droppingItem:d,autoSize:f=!0,className:p=``,style:m={},innerRef:h,onLayoutChange:g=fs,onDragStart:v=fs,onDrag:y=fs,onDragStop:b=fs,onResizeStart:x=fs,onResize:S=fs,onResizeStop:C=fs,onDrop:w=fs,onDropDragOver:T=fs}=e,E=(0,V.useMemo)(()=>({...Pa,...r}),[r]),D=(0,V.useMemo)(()=>({...Fa,...i}),[i]),O=(0,V.useMemo)(()=>({...Ia,...a}),[a]),k=(0,V.useMemo)(()=>({...La,...o}),[o]),{cols:A,rowHeight:j,maxRows:M,margin:N,containerPadding:P}=E,{enabled:F,bounded:I,handle:L,cancel:ee,threshold:te,allowMobileScroll:ne}=D,{enabled:re,handles:ie,handleComponent:ae}=O,{enabled:R,defaultItem:oe,onDragOver:z,touchEnabled:se=!0,touchDragSource:ce=`[data-rgl-draggable]`}=k,le=c??qa(`vertical`),ue=le.type,de=le.allowOverlap,fe=le.preventCollision??!1,pe=(0,V.useMemo)(()=>d??{i:`__dropping-elem__`,...oe},[d,oe]),me=s.type===`transform`,he=s.scale,ge=P??N,[_e,ve]=(0,V.useState)(!1),[ye,be]=(0,V.useState)(()=>gs(u,t,A,le)),[xe,B]=(0,V.useState)(null),[Se,Ce]=(0,V.useState)(!1),[we,Te]=(0,V.useState)(null),[Ee,De]=(0,V.useState)(),Oe=(0,V.useRef)(void 0);Oe.current=Ee;let ke=(0,V.useRef)(null),Ae=(0,V.useRef)(null),je=(0,V.useRef)(null),Me=(0,V.useRef)(0),Ne=(0,V.useRef)(ye),Pe=(0,V.useRef)(u),Fe=(0,V.useRef)(t),Ie=(0,V.useRef)(ue),Le=(0,V.useRef)(null),Re=(0,V.useRef)(!1),ze=(0,V.useRef)(null),Be=(0,V.useRef)(null);Be.current=we;let Ve=(0,V.useRef)(w);(0,V.useLayoutEffect)(()=>{Ve.current=w});let He=(0,V.useRef)(ye);He.current=ye,(0,V.useEffect)(()=>{ve(!0),(0,is.deepEqual)(ye,u)||g(ye)},[]),(0,V.useEffect)(()=>{if(xe||we)return;let e=!(0,is.deepEqual)(u,Pe.current),n=!hs(t,Fe.current),r=ue!==Ie.current;if(e||n||r){let n=gs(e?u:ye,t,A,le);(0,is.deepEqual)(n,ye)||be(n)}Pe.current=u,Fe.current=t,Ie.current=ue},[u,t,A,ue,le,xe,we,ye]),(0,V.useEffect)(()=>{if(!xe&&!we&&!(0,is.deepEqual)(ye,Ne.current)){Ne.current=ye;let e=ye.filter(e=>e.i!==pe.i);g(e)}},[ye,xe,we,g,pe.i]);let Ue=(0,V.useMemo)(()=>{if(!f)return;let e=oa(ye),t=ge[1];return e*j+(e-1)*N[1]+t*2+`px`},[f,ye,j,N,ge]),We=(0,V.useCallback)((e,t,n,r)=>{let i=He.current,a=sa(i,e);if(!a)return;let o={w:a.w,h:a.h,x:a.x,y:a.y,i:e};ke.current=la(a),je.current=i,B(o),v(i,a,a,null,r.e,r.node)},[v]),Ge=(0,V.useCallback)((e,t,n,r)=>{let i=He.current,a=ke.current,o=sa(i,e);if(!o)return;let s={w:o.w,h:o.h,x:o.x,y:o.y,i:e},c=ma(i,o,t,n,!0,fe,ue,A,de);y(c,a,o,s,r.e,r.node),be(le.compact(c,A)),B(s)},[fe,ue,A,de,le,y]),Ke=(0,V.useCallback)((e,t,n,r)=>{if(!ke.current)return;let i=He.current,a=ke.current,o=sa(i,e);if(!o)return;let s=ma(i,o,t,n,!0,fe,ue,A,de),c=le.compact(s,A);b(c,a,o,null,r.e,r.node);let l=je.current;ke.current=null,je.current=null,B(null),be(c),l&&!(0,is.deepEqual)(l,c)&&g(c)},[fe,ue,A,de,le,b,g]),qe=(0,V.useCallback)((e,t,n,r)=>{let i=He.current,a=sa(i,e);a&&(Ae.current=la(a),je.current=i,Ce(!0),x(i,a,a,null,r.e,r.node))},[x]),Je=(0,V.useCallback)((e,t,n,r)=>{let i=He.current,a=Ae.current,{handle:o}=r,s=!1,c,l,[u,d]=fa(i,e,e=>(c=e.x,l=e.y,[`sw`,`w`,`nw`,`n`,`ne`].includes(o)&&([`sw`,`nw`,`w`].includes(o)&&(c=e.x+(e.w-t),t=e.x!==c&&c<0?e.w:t,c=c<0?0:c),[`ne`,`n`,`nw`].includes(o)&&(l=e.y+(e.h-n),n=e.y!==l&&l<0?e.h:n,l=l<0?0:l),s=!0),fe&&!de&&na(i,{...e,w:t,h:n,x:c??e.x,y:l??e.y}).filter(t=>t.i!==e.i).length>0&&(l=e.y,n=e.h,c=e.x,t=e.w,s=!1),e.w=t,e.h=n,(o===`n`||o===`nw`||o===`ne`)&&(e.y=l??e.y),e));if(!d)return;let f=u;s&&c!==void 0&&l!==void 0&&(f=ma(u,d,c,l,!0,fe,ue,A,de));let p={w:d.w,h:d.h,x:d.x,y:d.y,i:e,static:!0};S(f,a,d,p,r.e,r.node);let m=le.compact(f,A);if(o===`n`||o===`nw`||o===`ne`){let t=m.find(t=>t.i===e);t&&(t.y=d.y)}be(m),B(p)},[fe,ue,A,de,le,S]),Ye=(0,V.useCallback)((e,t,n,r)=>{let i=He.current,a=Ae.current,o=sa(i,e),s=le.compact(i,A);C(s,a,o??null,null,r.e,r.node);let c=je.current;Ae.current=null,je.current=null,B(null),Ce(!1),be(s),c&&!(0,is.deepEqual)(c,s)&&g(s)},[A,le,C,g]),Xe=(0,V.useCallback)((e,t,n,r)=>{if(r)Oe.current&&(Oe.current.left!==t.left||Oe.current.top!==t.top)&&(De(t),be(t=>t.map(t=>t.i===e.i&&(t.x!==n.x||t.y!==n.y)?{...t,x:n.x,y:n.y}:t)));else{Te((0,H.jsx)(`div`,{},e.i)),De(t);let r=He.current.filter(t=>t.i!==e.i);be([...r,{...e,x:n.x,y:n.y,static:!1,isDraggable:!0}])}},[]),Ze=(0,V.useCallback)((e,t,r)=>{let i=Le.current;if(!i)return;let{newDroppingPosition:a,calculatedXY:o}=ds({clientX:e,clientY:t,gridElement:i,droppingItem:pe,event:r,transformScale:he,cols:A,margin:N,maxRows:M,rowHeight:j,width:n,containerPadding:ge});Xe(pe,a,o,!!Be.current)},[pe,he,A,N,M,j,n,ge,Xe]),Qe=(0,V.useCallback)(()=>{let e=He.current;if(!e.some(e=>e.i===pe.i)){Te(null),B(null),De(void 0);return}let t=le.compact(e.filter(e=>e.i!==pe.i),A);be(t),Te(null),B(null),De(void 0)},[pe.i,A,le]),$e=(0,V.useCallback)(e=>{if(e.preventDefault(),e.stopPropagation(),ms&&!e.nativeEvent.target?.classList.contains(ps))return!1;let t=z?z(e.nativeEvent):T(e);if(t===!1)return we&&Qe(),!1;let{dragOffsetX:r=0,dragOffsetY:i=0,...a}=t??{},o={...pe,...a},{newDroppingPosition:s,calculatedXY:c}=ds({clientX:e.clientX,clientY:e.clientY,gridElement:e.currentTarget,droppingItem:o,event:e.nativeEvent,dragOffsetX:r,dragOffsetY:i,transformScale:he,cols:A,margin:N,maxRows:M,rowHeight:j,width:n,containerPadding:ge});Xe(o,s,c,!!we)},[we,pe,z,T,Qe,Xe,he,A,N,M,j,n,ge]),et=(0,V.useCallback)(e=>{e.preventDefault(),e.stopPropagation(),Me.current--,Me.current<0&&(Me.current=0),Me.current===0&&Qe()},[Qe]),tt=(0,V.useCallback)(e=>{e.preventDefault(),e.stopPropagation(),Me.current++},[]),nt=(0,V.useCallback)(e=>{let t=He.current,n=t.find(e=>e.i===pe.i);Qe(),Ve.current(t,n,e)},[pe.i,Qe]),rt=(0,V.useCallback)(e=>{e.preventDefault(),e.stopPropagation(),Me.current=0,nt(e.nativeEvent)},[nt]);(0,V.useEffect)(()=>{if(!R||!se)return;let e=Le.current;if(!e)return;let t=(t,n)=>{let r=document.elementFromPoint(t,n);return r?e.contains(r):!1},n=e=>e instanceof HTMLElement&&e.closest(ce)!==null,r=e=>{let t=e.changedTouches;if(!t||t.length===0)return;let n=ze.current;if(n===null)return t[0];for(let e=0;e{if(!n(e.target)||ze.current!==null)return;e.preventDefault();let t=e.changedTouches?.[0];t&&(ze.current=t.identifier,Re.current=!0)},a=e=>{if(!Re.current)return;e.preventDefault();let n=r(e);if(n){if(!t(n.clientX,n.clientY)){Be.current&&Qe();return}Ze(n.clientX,n.clientY,e)}},o=e=>{if(!Re.current)return;e.preventDefault();let n=r(e);if(Re.current=!1,ze.current=null,n){if(!t(n.clientX,n.clientY)){Qe();return}nt(e)}},s=()=>{Re.current&&(Re.current=!1,ze.current=null,Qe())},c={passive:!1};return document.addEventListener(`touchstart`,i,c),document.addEventListener(`touchmove`,a,c),document.addEventListener(`touchend`,o,c),document.addEventListener(`touchcancel`,s,c),()=>{document.removeEventListener(`touchstart`,i,c),document.removeEventListener(`touchmove`,a,c),document.removeEventListener(`touchend`,o,c),document.removeEventListener(`touchcancel`,s,c)}},[R,se,ce,Ze,Qe,nt,pe.i]);let it=(0,V.useCallback)((e,t)=>{if(!e||!e.key)return null;let r=sa(ye,String(e.key));if(!r)return null;let i=typeof r.isDraggable==`boolean`?r.isDraggable:!r.static&&F,a=typeof r.isResizable==`boolean`?r.isResizable:!r.static&&re,o=r.resizeHandles||[...ie],c=i&&I&&r.isBounded!==!1,u=ae;return(0,H.jsx)(us,{containerWidth:n,cols:A,margin:N,containerPadding:ge,maxRows:M,rowHeight:j,cancel:ee,handle:L,onDragStart:We,onDrag:Ge,onDragStop:Ke,onResizeStart:qe,onResize:Je,onResizeStop:Ye,isDraggable:i,isResizable:a,isBounded:c,allowMobileScroll:ne,useCSSTransforms:me&&_e,usePercentages:!_e,transformScale:he,positionStrategy:s,dragThreshold:te,w:r.w,h:r.h,x:r.x,y:r.y,i:r.i,minH:r.minH,minW:r.minW,maxH:r.maxH,maxW:r.maxW,static:r.static,droppingPosition:t?Ee:void 0,resizeHandles:o,resizeHandle:u,constraints:l,layoutItem:r,layout:ye,children:e},r.i)},[ye,n,A,N,ge,M,j,ee,L,We,Ge,Ke,qe,Je,Ye,F,re,I,me,_e,he,s,te,Ee,ie,ae,l]),at=()=>xe?(0,H.jsx)(us,{w:xe.w,h:xe.h,x:xe.x,y:xe.y,i:xe.i,className:`react-grid-placeholder ${Se?`placeholder-resizing`:``}`,containerWidth:n,cols:A,margin:N,containerPadding:ge,maxRows:M,rowHeight:j,isDraggable:!1,isResizable:!1,isBounded:!1,useCSSTransforms:me,transformScale:he,constraints:l,layout:ye,children:(0,H.jsx)(`div`,{})}):null,ot=(0,V.useCallback)(e=>{Le.current=e,typeof h==`function`?h(e):h&&`current`in h&&(h.current=e)},[h]),st=_(ps,p),ct={height:Ue,...m};return(0,H.jsxs)(`div`,{ref:ot,className:st,style:ct,onDrop:R?rt:void 0,onDragLeave:R?et:void 0,onDragEnter:R?tt:void 0,onDragOver:R?$e:void 0,children:[V.Children.map(t,e=>V.isValidElement(e)?it(e):null),R&&we&&it(we,!0),at()]})}var vs={lg:1200,md:996,sm:768,xs:480,xxs:0},ys={lg:12,md:10,sm:6,xs:4,xxs:2},bs=()=>{};function xs(e,t,n,r,i=!1){let a=[];V.Children.forEach(t,t=>{if(!V.isValidElement(t)||t.key===null)return;let n=String(t.key),r=t.props[`data-grid`],o=e.find(e=>e.i===n);o?i&&r?a.push({...o,i:n,w:r.w??o.w,h:r.h??o.h,minW:r.minW??o.minW,maxW:r.maxW??o.maxW,minH:r.minH??o.minH,maxH:r.maxH??o.maxH}):a.push({...o,i:n}):r?a.push({i:n,x:r.x??0,y:r.y??0,w:r.w??1,h:r.h??1,minW:r.minW,maxW:r.maxW,minH:r.minH,maxH:r.maxH,static:r.static,isDraggable:r.isDraggable,isResizable:r.isResizable,resizeHandles:r.resizeHandles,isBounded:r.isBounded}):a.push({i:n,x:0,y:oa(a),w:1,h:1})});let o=pa(a,{cols:n});return r.compact(o,n)}function Ss(e){let{children:t,width:n,breakpoint:r,breakpoints:i=vs,cols:a=ys,layouts:o={},rowHeight:s=150,maxRows:c=1/0,margin:l=[10,10],containerPadding:u=null,compactor:d,onBreakpointChange:f=bs,onLayoutChange:p=bs,onWidthChange:m=bs,...h}=e,g=d??qa(`vertical`),_=g.type,v=g.allowOverlap,y=(0,V.useMemo)(()=>r??Ya(i,n),[]),b=(0,V.useMemo)(()=>Xa(y,a),[y,a]),x=(0,V.useMemo)(()=>Za(o,i,y,y,b,_),[]),[S,C]=(0,V.useState)(y),[w,T]=(0,V.useState)(b),[E,D]=(0,V.useState)(x),[O,k]=(0,V.useState)(o),A=(0,V.useRef)(n),j=(0,V.useRef)(r),M=(0,V.useRef)(i),N=(0,V.useRef)(a),P=(0,V.useRef)(o),F=(0,V.useRef)(_),I=(0,V.useRef)(O);(0,V.useEffect)(()=>{I.current=O},[O]);let L=(0,V.useMemo)(()=>(0,is.deepEqual)(o,P.current)?null:Za(o,i,S,S,w,g),[o,i,S,w,g]),ee=L??E;(0,V.useEffect)(()=>{L!==null&&(D(L),k(o),I.current=o,P.current=o)},[L,o]),(0,V.useEffect)(()=>{if(_!==F.current){let e=g.compact(ua(ee),w),t={...I.current,[S]:e};D(e),k(t),I.current=t,p(e,t),F.current=_}},[_,g,ee,w,v,S,p]),(0,V.useEffect)(()=>{let e=n!==A.current,o=r!==j.current,s=!(0,is.deepEqual)(i,M.current),c=!(0,is.deepEqual)(a,N.current);if(e||o||s||c){let e=r??Ya(i,n),o=Xa(e,a),d=S;if(d!==e||s||c){let n={...I.current};n[d]||(n[d]=ua(E));let r=Za(n,i,e,d,o,g),a=!n[e];r=xs(r,t,o,g,a),n[e]=r,C(e),T(o),D(r),k(n),I.current=n,f(e,o),p(r,n)}let h=Qa(l,e),_=u?Qa(u,e):null;m(n,h,o,_),A.current=n,j.current=r,M.current=i,N.current=a}},[n,r,i,a,S,w,E,t,g,_,v,l,u,f,p,m]);let te=(0,V.useCallback)(e=>{let t={...I.current,[S]:e};D(e),k(t),I.current=t,p(e,t)},[S,p]),ne=(0,V.useMemo)(()=>Qa(l,S),[l,S]),re=(0,V.useMemo)(()=>u===null?null:Qa(u,S),[u,S]),ie=(0,V.useMemo)(()=>({cols:w,rowHeight:s,maxRows:c,margin:ne,containerPadding:re}),[w,s,c,ne,re]);return(0,H.jsx)(_s,{...h,width:n,gridConfig:ie,compactor:g,onLayoutChange:te,layout:ee,children:t})}var Cs=V.forwardRef(function(e,t){let{innerRef:n,...r}=e,i=n??t;return(0,H.jsx)(Ss,{...r,innerRef:i})});Cs.displayName=`ResponsiveGridLayout`;function ws(e,t,n){if(e.kind===`constant`)return e.value??``;let r=e.kind===`custom`?e.options?.map(e=>({value:e}))??[]:n===null?[]:n,i=t[e.name],a=!e.multi&&Array.isArray(i)&&i.length===0?void 0:i;if(a===`$__all`){if(e.include_all)return Ki}else if(a!==void 0){if(e.kind===`text`||r===void 0)return a;let t=new Set(r.map(e=>e.value));if(Array.isArray(a)){if(a.length===0&&e.multi)return[];let n=a.filter(e=>t.has(e));if(n.length>0)return n}else if(t.has(a))return a}return e.default?e.default:e.include_all?Ki:r?.[0]?.value??``}var Ts=(e,t)=>e.replace(/\$([a-z][a-z0-9_]*)/g,(e,n)=>{let r=t[n];return r===void 0?e:r===`$__all`?`all`:Array.isArray(r)?r.join(`, `):r});function Es(e,t,n){let r={};for(let i of e??[]){let e=ws(i,t,n?.[i.name]);(i.kind!==`query`||e!==``)&&(r[i.name]=e)}return r}function Ds(e,t,n,r){let i=e=>t?.frame?.columns.some((n,r)=>n.name===e&&t.frame.values[r]?.some(e=>typeof e==`string`&&e!==``));return{onSelect:e.click&&(e.viz===`service_map`||!(e.drill&&r))?t=>n(e.click.set_variable,t):void 0,onPoint:r&&(e.viz===`service_map`||e.click||e.drill||i(`trace_id`)||e.options?.columns?.some(e=>e.format===`trace_link`&&i(e.field)))?r:void 0}}function Os(e,t,n,r){if(!t)return;let i=ut(e,t,n);if(!i)return;let a=Object.values(n.dimensions)[0],o=e.click?.set_variable;return{target:i,vars:o&&a!==void 0?{...r,[o]:a}:r}}function ks(e){return e.replace(/[&<>"']/g,e=>({"&":`&`,"<":`<`,">":`>`,'"':`"`,"'":`'`})[e])}var As=e=>e.map(ks).join(`
`);function js(e,t=!1){return n=>{let r=Array.isArray(n)?n:[n];return As([...r[0]?.axisValueLabel?[r[0].axisValueLabel]:[],...r.map(n=>{let r=n.value,i=Array.isArray(r)?t?r.slice(1):r:[r];return`${n.seriesName??``}${n.name?` · ${n.name}`:``}: ${i.map(t=>typeof t==`number`?e(t,n.seriesName):String(t??`—`)).join(` · `)}`})])}}var Ms=e=>/^Other(?: \(\d+\))?$/.test(e??``);function Ns(e,t){let n=Math.min(6,Math.max(1,Math.floor(t.options?.top||6))),r=e.filter(e=>!Ms(e.name)),i=r.slice(0,n).map(e=>({name:e.name,items:[e]})),a=[...e.filter(e=>Ms(e.name)),...r.slice(n)];return a.length&&i.push({name:a.length===1&&Ms(a[0].name)?a[0].name:`Other (${a.reduce((e,t)=>e+(Ms(t.name)?Number(t.name.match(/\d+/)?.[0]??1):1),0)})`,items:a}),i}function Ps(e){let t=e.filter(e=>e!==null);return t.length?t.reduce((e,t)=>e+t,0):null}function Fs(e,t){let n=Math.min(6,Math.max(1,Math.floor(t.options?.top||6))),r=e.filter(e=>!Ms(e.name));return{shown:[...r.slice(0,n),...e.filter(e=>Ms(e.name))],hidden:Math.max(0,r.length-n)}}function Is(e,t){return e>0?[{type:`text`,right:8,bottom:2,silent:!0,style:{text:`${e} more series not shown`,fill:t,fontSize:11}}]:[]}function Ls(e,t,n,r,i=`sans-serif`,a){let o=e=>Array.from(e).length>24?`${Array.from(e).slice(0,23).join(``)}…`:e,s=Math.max(1,t-16),c=1,l=0;for(let t of e){let e=15+(a?.(o(t),`12px ${i}`)??Array.from(o(t)).length*7.2);l&&l+10+e>s&&(c++,l=0),l+=(l?10:0)+e}let u=c>2;return{top:n?u?30:c*20+2:12,option:{type:u?`scroll`:`plain`,show:n,top:0,left:0,right:0,padding:0,itemGap:6,icon:`roundRect`,itemWidth:10,itemHeight:10,itemStyle:{borderColor:r,borderWidth:1},textStyle:{color:r,fontSize:12,lineHeight:14},data:e,formatter:o,tooltip:{show:!0,renderMode:`html`,formatter:e=>ks(e.name)}}}}function Rs(e,t){if(!(!Number.isFinite(e)||!Number.isFinite(t)||e>=t||Math.abs(e)>864e13||Math.abs(t)>864e13))return{from:new Date(Math.floor(e)).toISOString(),to:new Date(Math.ceil(t)).toISOString()}}function zs(e){let t=[e.time?.range?`Range ${e.time.range}`:void 0,e.time?.shift?`Shifted ${e.time.shift}`:void 0].filter(Boolean);return t.length?t.join(` · `):void 0}function Bs(e,t,n){if(n.interactive===!1||n.interactive!==!0&&n.seriesName?.endsWith(` · previous`)||n.data?.value===null)return;let r=n.data?.selection;if(r)return Object.values(r.dimensions).some(Ms)?void 0:r;if(Ms(n.seriesName)||Ms(n.name)||n.value===null||Array.isArray(n.value)&&n.value.at(-1)==null)return;let i=e.query?.by?.[0]??t.frame?.columns.find(e=>e.role===`dimension`)?.name,a=e.viz===`timeseries`?n.seriesName:n.name,o=Array.isArray(n.value)?n.value:[];return{time:e.viz===`timeseries`&&typeof o[0]==`number`?o[0]:void 0,dimensions:i&&a?{[i]:a}:{}}}function Vs(e){return Array.from({length:e.rows},(t,n)=>Object.fromEntries(e.columns.map((t,r)=>{let i=e.values[r]?.[n]??null;return[t.name,typeof i==`number`&&!Number.isFinite(i)?null:i]})))}function Hs(e,t){return e.viz!==`logs`||!t||t.rows<2?[]:t.columns.flatMap((e,n)=>{if(e.role!==`dimension`||e.type!==`string`||[`body`,`body_template`,`severity`,`status`].includes(e.name)||/(^id$|_id$)/.test(e.name))return[];let r=t.values[n][0];return typeof r==`string`&&r!==``&&t.values[n].slice(0,t.rows).every(e=>e===r)?[{name:e.name,value:r}]:[]})}function Us(e,t){let n=t.frame??{columns:[],values:[],rows:0};return{columns:n.columns.map(e=>e.name),rows:Vs(n),selection:t=>{let n={};for(let r of e.query?.by??[]){let e=r.startsWith(`attributes[`)||r.startsWith(`resource[`)?r.slice(r.indexOf(`'`)+1,r.lastIndexOf(`'`)):r;t[e]!==void 0&&t[e]!==null&&(n[r]=String(t[e]))}return{time:typeof t.time==`number`?t.time:typeof t.start==`number`?t.start:void 0,dimensions:n,trace_id:typeof t.trace_id==`string`?t.trace_id:void 0,namespace:typeof t.namespace==`string`?t.namespace:void 0}}}}var Ws=new Intl.NumberFormat(`en`,{notation:`compact`,maximumFractionDigits:1}),Gs=new Intl.NumberFormat(`en`,{maximumFractionDigits:2});function Ks(e){return Math.abs(e)<1e-4?e.toExponential(2).replace(/\.?(0+)(?=e)/,``):String(Number(e.toPrecision(3)))}function qs(e,t=Gs){return e!==0&&Math.abs(e)<1?Ks(e):t.format(e)}function Js(e,t){let n=t===`s`?e*1e3:t===`ns`?e/1e6:e;return e!==0&&n===0?`${Ks(e)}${t}`:n!==0&&Math.abs(n)<1?`${Ks(n)}ms`:Se(n)}function Ys(e){let t=[`B`,`KiB`,`MiB`,`GiB`,`TiB`],n=e,r=0;for(;Math.abs(n)>=1024&&r=1e4?Ws:Gs);default:return qs(t,Math.abs(t)>=1e4?Ws:Gs)}}function Zs(e){return t=>e===`ms`||e===`s`||e===`ns`?Xs(e,t).replace(/(\.\d*?)0+([a-z]*)$/,`$1$2`).replace(/\.([a-z]*)$/,`$1`):Xs(e,t)}function Qs(e,t){return Zs(e)(t??NaN).replace(/(?<=\d)(ms|ns|s|m|h)\b/g,` $1`)}function $s(e){return Math.max(3,Math.min(10,Math.round(e/70)))-1}function ec(e,t){let n=t===`ms`?1:t===`s`?1e3:t===`ns`?1e-6:void 0,r=e=>{let t=10**Math.floor(Math.log10(e));return[1,2,5,10].map(e=>e*t).find(t=>t>=e)};if(n===void 0)return r(e);let i=e*n,a=[1,10,100,1e3,1e4,6e4,6e5,36e5,36e6].flatMap(e=>[1,2,5].map(t=>e*t)).sort((e,t)=>e-t);return(i<1?r(i):a.find(e=>e>=i)??r(i/36e5)*36e5)/n}function tc(e,t,n,r){e=Number.isFinite(e)?Math.min(0,e):0,t=Number.isFinite(t)?Math.max(0,t):1,t===e&&(t=e+1);let i=$s(r),a=ec(Math.max(t-e,2**-52)/i,n);for(;Math.ceil(t/a)-Math.floor(e/a)>i;)a=ec(a*1.01,n);return{min:Math.floor(e/a)*a,max:Math.ceil(t/a)*a,interval:a,splitNumber:i,fanout_unit:n}}function nc(e,t){return e.type!==`value`&&e.type!==`log`?e:{...e,...e.type===`value`&&typeof e.min==`number`&&typeof e.max==`number`?tc(e.min,e.max,typeof e.fanout_unit==`string`?e.fanout_unit:void 0,t):{splitNumber:$s(t)}}}function rc(e,t,n){let r=e=>Xs(n,e),i=``;if(n===`ms`||n===`s`||n===`ns`){let a=n===`s`?1e3:n===`ns`?1e-6:1,o=Math.abs((e??t??0)*a),s=o>=6e4?6e4:o>=1e3?1e3:1;i=s===6e4?` min`:s===1e3?` s`:` ms`;let c=s===6e4?1:s===1e3?+(o<1e4):2,l=new Intl.NumberFormat(void 0,{maximumFractionDigits:c});r=e=>l.format(e*a/s)}return t===null&&e!==null?`≥${r(e)}${i}`:(e===null||e===0)&&t!==null?`<${r(t)}${i}`:`${e===null?`−∞`:r(e)}–${t===null?`∞`:r(t)}${i}`}function ic(e){let t=new Date(e);return t.getHours()===0&&t.getMinutes()===0&&t.getSeconds()===0?t.toLocaleDateString(void 0,{month:`short`,day:`numeric`}):t.toLocaleTimeString(void 0,{hour:`2-digit`,minute:`2-digit`,hourCycle:`h23`})}function ac(e,t=new Date,n){let r=new Date(e);if(!Number.isFinite(r.getTime()))return`—`;let i=new Intl.DateTimeFormat(n,{month:`short`,day:`numeric`,...r.getFullYear()===t.getFullYear()?{}:{year:`numeric`},hour:`2-digit`,minute:`2-digit`,second:`2-digit`,hourCycle:`h23`}).formatToParts(r),a=i.filter(e=>[`month`,`day`,`year`].includes(e.type)).map(e=>e.value),o=i.filter(e=>[`hour`,`minute`,`second`].includes(e.type)).map(e=>e.value);return`${a.join(` `)} ${o.join(`:`)}`}function oc({panel:e,result:t}){let n=t?.frame;return(0,H.jsxs)(`div`,{"data-panel-data":!0,children:[t?.error&&(0,H.jsx)(T,{"data-panel-error-detail":!0,size:`sm`,role:`status`,style:{whiteSpace:`pre-wrap`,overflowWrap:`anywhere`,userSelect:`text`},children:t.error}),n?(0,H.jsxs)(B,{fz:12,striped:!0,children:[(0,H.jsx)(B.Thead,{children:(0,H.jsx)(B.Tr,{children:n.columns.map(e=>(0,H.jsx)(B.Th,{ff:St.display,children:e.name},e.name))})}),(0,H.jsx)(B.Tbody,{children:Array.from({length:Math.min(n.rows,500)},(t,r)=>(0,H.jsx)(B.Tr,{children:n.columns.map((t,i)=>{let a=n.values[i][r];return(0,H.jsx)(B.Td,{ff:St.display,children:a===null?`—`:t.type===`time`?new Date(Number(a)).toISOString():t.role===`measure`?Xs(t.unit??e.unit,Number(a)):String(a)},t.name)})},r))})]}):(0,H.jsx)(T,{c:`dimmed`,size:`sm`,children:`No data.`}),(0,H.jsxs)(T,{c:`dimmed`,fz:12,mt:8,children:[`Ran in `,t?.elapsed_ms??0,` ms`,t?.interval?`, one point per ${t.interval}`:``,n?`, ${n.rows} rows${n.truncated?` (truncated)`:``}`:``,`.`]}),(t?.sql??e.sql)&&(0,H.jsx)(et,{block:!0,tabIndex:0,mt:8,children:t?.sql??e.sql})]})}function sc({panel:e,dark:t}){let n=JSON.stringify(e,null,2).split(/("(?:[^"\\]|\\.)*"(?=\s*:)|"(?:[^"\\]|\\.)*"|\b(?:true|false|null)\b|-?\d+(?:\.\d+)?)/g);return(0,H.jsx)(`pre`,{"data-panel-spec":!0,style:{margin:0,fontFamily:St.display,fontSize:12,color:lt[t?`dark`:`light`].text},children:n.map((e,r)=>{let i=e.startsWith(`"`)&&/^\s*:/.test(n[r+1]??``)?`key`:e.startsWith(`"`)?`string`:/^(true|false|null)$/.test(e)?`literal`:/^-?\d/.test(e)?`number`:`punctuation`,a=i===`key`?mt[t?4:7]:i===`string`?dt[t?4:8]:i===`number`||i===`literal`?Tt[t?4:8]:void 0;return i===`punctuation`?e:(0,H.jsx)(`span`,{"data-json-token":i,style:{color:a},children:e},r)})})}function cc(e){let t=e.event.data?.selection,n=e.event.value;return JSON.stringify([e.event.seriesName,e.event.name,t?.from??t?.time??(Array.isArray(n)?n[0]:void 0),t?.dimensions,t?.bucket])}function lc(e){let t=new Date().toISOString().slice(0,10),n=e.from.slice(0,10),r=e.to.slice(0,10),i=e=>e.slice(11,-1).replace(/\.000$/,``);return`${(n===t?``:n+` `)+i(e.from)} – ${(r!==n&&r!==t?r+` `:``)+i(e.to)} UTC · ${Se(Date.parse(e.to)-Date.parse(e.from))}`}var uc={background:`color-mix(in srgb, var(--mantine-color-body) 92%, transparent)`,border:`1px solid var(--mantine-color-default-border)`,borderRadius:`var(--mantine-radius-sm)`,padding:`2px 6px`};function dc(e){return e.replace(`Enter drill`,`↵ drill`).replace(`Shift+←→`,`⇧←→`)}var fc=(0,V.createContext)(void 0);function pc({points:e,label:t,summary:n,children:r,onClick:i,canSelect:a,onHighlight:s,onActiveChange:c,onRangePending:l,onRangeChange:u,onRangeBarHeight:d,rangeReset:f,height:p=`100%`,onZoom:m,bounds:h,pointWindow:g}){let[_,v]=(0,V.useState)(!1),[b,x]=(0,V.useState)(``),[S,w]=(0,V.useState)(),[E,D]=(0,V.useState)(null),O=(0,V.useRef)(null),k=(0,V.useRef)(!1);(0,V.useEffect)(()=>{let e=e=>{e.key===`Tab`&&(k.current=!1)};return document.addEventListener(`keydown`,e,!0),()=>document.removeEventListener(`keydown`,e,!0)},[]);let A=(0,V.useId)(),j=(0,V.useContext)(fc),M=(0,V.useRef)(null),N=(0,V.useRef)({onHighlight:s,onActiveChange:c,onRangePending:l,onRangeChange:u,onRangeBarHeight:d});N.current={onHighlight:s,onActiveChange:c,onRangePending:l,onRangeChange:u,onRangeBarHeight:d};let P=(0,V.useMemo)(()=>new Map(e.map(e=>[cc(e),e])),[e]),F=(0,V.useRef)(void 0),I=e=>g?.(e)?.from??e.event.name??(Array.isArray(e.event.value)?e.event.value[0]:void 0),L=F.current,ee=L?e.filter(e=>e.event.seriesName===L.event.seriesName):e,te=ee.length?ee:e,ne=L&&I(L),re=typeof ne==`number`?te.reduce((e,t)=>{let n=I(t),r=e&&I(e);return typeof n==`number`&&(!e||typeof r!=`number`||Math.abs(n-ne)I(e)===ne),ie=S?P.get(S)??re??te[0]??e[0]:e[0],ae=!!(m&&h&&Number.isFinite(h.from)&&Number.isFinite(h.to)&&h.from[...new Set(e.map(e=>e.event.seriesName))],[e]),oe=(0,V.useMemo)(()=>e.filter(e=>e.event.seriesName===ie?.event.seriesName),[e,ie?.event.seriesName]),z=ie?oe.indexOf(ie):-1;(0,V.useEffect)(()=>{ie&&(!S||P.has(S)||!ee.length)&&(F.current=ie,(!S||!ee.length)&&w(cc(ie))),_&&N.current.onHighlight(ie)},[ie,S,_]),(0,V.useEffect)(()=>{if(!E)return;let e=Date.parse(E.from),t=Date.parse(E.to);h&&(Number.isFinite(e)&&eh.to)&&D(null)},[h?.from,h?.to,E]),(0,V.useEffect)(()=>{N.current.onRangePending?.(!!E)},[!!E]),(0,V.useEffect)(()=>{N.current.onRangeChange?.(E?{from:Date.parse(E.from),to:Date.parse(E.to)}:void 0)},[E]),(0,V.useEffect)(()=>{D(null)},[f]),(0,V.useEffect)(()=>()=>{N.current.onHighlight(void 0),N.current.onRangePending?.(!1),N.current.onRangeChange?.(void 0)},[]);let se=(e,t=!1)=>{if(e){if(x(n(e)),t&&ae&&ie){let t=E?.anchor??cc(ie),n=P.get(t),r=E?.window??(n&&g?.(n)),i=g?.(e);if(r&&i){let e=Math.max(h.from,Math.min(r.from,i.from)),n=Math.min(h.to,Math.max(r.to,i.to));Number.isFinite(e)&&Number.isFinite(n)&&e{if(!ie)return;let n=R[Math.max(0,Math.min(R.length-1,R.indexOf(ie.event.seriesName)+t))],r=e.filter(e=>e.event.seriesName===n),i=I(ie),a=r.find(e=>I(e)===i),o=typeof i==`number`?r.reduce((e,t)=>{let n=I(t),r=e&&I(e);return typeof n==`number`&&(!e||typeof r!=`number`||Math.abs(n-i){e===`ArrowLeft`||e===`ArrowRight`?se(oe[Math.max(0,Math.min(oe.length-1,z+(e===`ArrowLeft`?-1:1)))],t):!t&&(e===`ArrowUp`||e===`ArrowDown`)?ce(e===`ArrowUp`?-1:1):!t&&(e===`Home`||e===`End`)&&se(e===`Home`?oe[0]:oe.at(-1))},ue=()=>{D(null),O.current?.focus()},de=ae?`←→ points · ↑↓ series · Enter drill · Shift+←→ range`:`←→ points · ↑↓ series · Enter drill`;return(0,V.useLayoutEffect)(()=>(j?.setHint(_?de:void 0),()=>j?.setHint(void 0)),[j,_,de]),(0,V.useLayoutEffect)(()=>{let e=M.current;if(!e)return;N.current.onRangeBarHeight?.(e.getBoundingClientRect().height);let t=new ResizeObserver(([t])=>{if(!t)return;let n=getComputedStyle(e),r=[n.paddingTop,n.paddingBottom,n.borderTopWidth,n.borderBottomWidth].reduce((e,t)=>e+(parseFloat(t)||0),0);N.current.onRangeBarHeight?.(t.borderBoxSize?.[0]?.blockSize??t.contentRect.height+r)});return t.observe(e),()=>{t.disconnect(),N.current.onRangeBarHeight?.(0)}},[!!(E&&ae)]),(0,H.jsxs)(o,{ref:O,"data-chart-plot":!0,tabIndex:0,role:`application`,"aria-roledescription":`chart`,"aria-label":t,"aria-describedby":A,"data-mantine-stop-propagation":E?`true`:void 0,className:`chart-keyboard-point`,style:{position:`relative`,height:p,width:`100%`,flex:`1 1 auto`,minHeight:0,minWidth:0},onPointerDownCapture:e=>{M.current?.contains(e.target)||(k.current=!0,v(!1),_&&N.current.onHighlight(void 0),N.current.onActiveChange?.(!1))},onFocus:e=>{e.target!==e.currentTarget||k.current||(N.current.onActiveChange?.(!0),v(!0))},onBlur:e=>{e.currentTarget.contains(e.relatedTarget)||(v(!1),D(null),x(``),N.current.onHighlight(void 0),N.current.onActiveChange?.(!1))},onKeyDown:e=>{if(e.defaultPrevented||e.ctrlKey||e.metaKey||e.altKey||e.nativeEvent.isComposing)return;if(e.key===`Escape`&&!e.repeat){E?(e.preventDefault(),e.stopPropagation(),ue()):e.target===e.currentTarget&&!e.currentTarget.closest(`[data-panel-fullscreen],[data-fragment-fullscreen]`)&&(e.preventDefault(),e.stopPropagation(),e.currentTarget.blur());return}if(e.target!==e.currentTarget||e.repeat&&![`ArrowLeft`,`ArrowRight`,`ArrowUp`,`ArrowDown`].includes(e.key))return;let t=[`ArrowLeft`,`ArrowRight`,`ArrowUp`,`ArrowDown`,`Home`,`End`].includes(e.key);if(t&&!_&&(k.current=!1,v(!0),N.current.onActiveChange?.(!0),!ie)){e.preventDefault();return}e.key===`Enter`&&_&&!e.shiftKey&&ie&&i&&(!a||a(ie.event))?(e.preventDefault(),i(ie.event)):t&&(!e.shiftKey||e.key===`ArrowLeft`||e.key===`ArrowRight`)&&(e.preventDefault(),le(e.key,e.shiftKey))},children:[r,(0,H.jsx)(o,{"data-chart-overlay":!0,style:{position:`absolute`,inset:0,zIndex:1,pointerEvents:`none`,overflow:`hidden`},children:E&&ae&&(0,H.jsxs)(y,{ref:M,"data-chart-range-bar":!0,gap:6,style:{...uc,position:`absolute`,bottom:4,left:4,right:4,maxHeight:`100%`,overflow:`auto`,pointerEvents:`auto`},children:[(0,H.jsx)(T,{"data-chart-range-label":!0,size:`xs`,title:E.from+` – `+E.to,truncate:!0,style:{flex:`1 1 140px`,minWidth:0},children:lc(E)}),(0,H.jsx)(C,{size:`compact-xs`,"data-mantine-stop-propagation":`true`,onClick:()=>{m(Date.parse(E.from),Date.parse(E.to)),ue()},children:`Zoom to range`}),(0,H.jsx)(C,{size:`compact-xs`,variant:`subtle`,"data-mantine-stop-propagation":`true`,onClick:ue,children:`Cancel`})]})}),(0,H.jsx)(Mt,{id:A,children:de}),(0,H.jsx)(Mt,{"aria-live":`polite`,"aria-atomic":`true`,children:b})]})}function mc(e){return e===`healthy`?`ok`:e===`degraded`?`warn`:e===`unknown`?`gray`:`bad`}function hc(e){return lt[e?`dark`:`light`]}function gc(e){let t=e?5:7;return{ok:dt[t],warn:ft[t],bad:wt[t],info:Tt[t]}}function _c(e,t){return yt[t?`dark`:`light`][e]??hc(t).muted}function vc(e){return e===`unhealthy`?`diamond`:e===`degraded`?`roundRect`:`circle`}function yc(e){return e===`unknown`?`dashed`:`solid`}var bc=e=>typeof e==`number`&&Number.isFinite(e)?e:null;function xc(e){return e.columns.flatMap((e,t)=>e.role===`measure`?[t]:[])}function Sc(e){let t=e.columns.findIndex(e=>e.role===`time`);if(t<0)return[];let n=e.columns.findIndex(e=>e.role===`dimension`),r=xc(e);if(n>=0&&r.length>0){let i=r[0],a=new Map;for(let r=0;r({name:e.columns[n].name,unit:e.columns[n].unit,points:e.values[t].map((t,r)=>[Number(t),bc(e.values[n][r])])}))}function Cc(e){let t=e.columns.flatMap((e,t)=>e.role===`dimension`?[t]:[]),n=xc(e);if(t.length===0||n.length===0)return{categories:[],series:[]};let r=t[0],i=[];for(let t=0;t1){let a=t[1],o=n[0],s=new Map;for(let t=0;tnull)),s.get(n)[i.indexOf(String(e.values[r][t]??``))]=bc(e.values[o][t])}return{categories:i,series:[...s.entries()].map(([t,n])=>({name:t,unit:e.columns[o].unit,values:n}))}}return{categories:i,series:n.map(t=>({name:e.columns[t].name,unit:e.columns[t].unit,values:e.values[t].map(bc)}))}}function wc(e,t){let n=e.filter(e=>e!==null);if(n.length===0)return null;switch(t){case`last`:return n[n.length-1];case`min`:return Math.min(...n);case`max`:return Math.max(...n);case`sum`:return n.reduce((e,t)=>e+t,0);default:return n.reduce((e,t)=>e+t,0)/n.length}}function Tc(e,t){let n=xc(t)[0];return n===void 0?null:(e.reduce??`window`)===`window`?t.totals?bc(t.totals[n]):wc(t.values[n].map(bc),`mean`):wc(t.values[n].map(bc),e.reduce??`mean`)}function Ec(e){let t=xc(e)[0];return t===void 0?[]:e.values[t].map(bc)}var Dc={ok:0,warn:1,bad:2};function Oc(e){if(!e?.length)return;let t=[...e].sort((e,t)=>Dc[e.status]-Dc[t.status]),n=t[0],r=t[t.length-1];return Dc[r.status]>Dc[n.status]&&r.value!==n.value?r.value>n.value?`lower`:`higher`:`lower`}function kc(e,t,n){if(e===null||!t||t.length===0)return null;n??=Oc(t);let r=`ok`;for(let i of t)(n===`lower`?e>=i.value:e<=i.value)&&Dc[i.status]>Dc[r]&&(r=i.status);return r}function Ac(e,t){let n=xt(e),r=xt(t);return(Math.max(n,r)+.05)/(Math.min(n,r)+.05)}function jc(e,t){return`rgba(${[1,3,5].map(t=>parseInt(e.slice(t,t+2),16)).join(`, `)}, ${t})`}function Mc(e,t){return{color:e,...Ac(e,t.surface)<3?{borderColor:t.text,borderWidth:1}:{}}}function Nc(e,t){return{color:e,...Ac(e,t.surface)<3?{shadowColor:t.text,shadowBlur:2}:{}}}function Pc(e,t){return{ok:dt,warn:ft,bad:wt}[e][t?5:8]}function Fc(e){let t=hc(e),n=gc(e);return{dark:e,text:t.text,muted:t.muted,grid:t.grid,surface:t.surface,border:t.border,status:{ok:n.ok,warn:n.warn,bad:n.bad},font:St.display}}function Ic(e,t,n){if(!Array.isArray(e.series))return e;let r=e.series,i=Array.isArray(e.yAxis)?e.yAxis:[e.yAxis],a=[],o=r.map((e,o)=>{let s=e.endLabel;if(!s?.show||!Array.isArray(e.data))return e;let c;for(let t=e.data.length-1;t>=0;t--){let n=e.data[t];if(Array.isArray(n)&&typeof n[1]==`number`&&Number.isFinite(n[1])){c=n;break}}let l=i[Number(e.yAxisIndex??0)];if(!c||!l)return{...e,endLabel:{...s,show:!1}};let u=l.type===`log`?Math.log:e=>e,d=l.min??1/0,f=l.max??0;if(l.type===`log`&&(l.min===void 0||l.max===void 0)){for(let t of r)if(Number(t.yAxisIndex??0)===Number(e.yAxisIndex??0)&&Array.isArray(t.data))for(let e of t.data)Array.isArray(e)&&typeof e[1]==`number`&&Number.isFinite(e[1])&&e[1]>0&&(l.min===void 0&&(d=Math.min(d,e[1])),l.max===void 0&&(f=Math.max(f,e[1])))}Number.isFinite(d)||(d=1);let p=u(l.type===`log`?d:l.min??0),m=u(l.type===`log`?Math.max(f,d*1.01):l.max??1),h=n?.(o,c),g=Number.isFinite(h)?h:t.y+t.height*(1-(u(c[1])-p)/(m-p)),_=((s.lineHeight??14)+2)/2,v=[Math.max(t.y+_,Math.min(t.y+t.height-_,g)),...a.flatMap(e=>[e.y-e.half-_,e.y+e.half+_])].filter(e=>Number.isFinite(e)&&e-_>=t.y&&e+_<=t.y+t.height&&a.every(t=>Math.abs(t.y-e)>=t.half+_)).sort((e,t)=>Math.abs(e-g)-Math.abs(t-g))[0];return v===void 0?{...e,endLabel:{...s,show:!1}}:(a.push({y:v,half:_}),{...e,labelLayout:{dy:v-g,hideOverlap:!0}})});return{...e,series:o}}var Lc=(e,t,n)=>Ms(e)?n.muted:_c(t,n.dark);function Rc(e,t){let n=Sc(e);if(!e.columns.some(e=>e.role===`dimension`))for(let e of n){let t=e.name;e.name=/^p\d+(?:\(.*\))?$/.test(t)&&[`ms`,`s`,`ns`].includes(e.unit??``)?`${t.match(/^p\d+/)[0]} latency`:/^error_rate(?:\(\))?$/.test(t)?`Error rate`:/^rate(?:\(\))?$/.test(t)?`Request rate`:t.replaceAll(`_`,` `).replace(/^./,e=>e.toUpperCase())}return Fs(n,t)}function zc(e,t){return{animationDuration:200,textStyle:{fontFamily:e.font,color:e.muted,fontSize:11},grid:{left:8,right:16,top:28,bottom:8,containLabel:!0},tooltip:{trigger:`axis`,formatter:js(e=>Xs(t,e)),confine:!0,backgroundColor:e.surface,borderColor:e.border,textStyle:{color:e.text,fontSize:12},valueFormatter:e=>Xs(t,e),axisPointer:{type:`line`,lineStyle:{color:e.border}}},aria:{enabled:!0}}}function Bc(e,t,n,r){return(e.thresholds??[]).map(i=>({yAxis:i.value,label:{formatter:`${i.label??i.status} ${Zs(r??e.unit)(i.value).replace(/(?<=\d)(ms|s|m|h)$/,` $1`)}`,position:i.value<=(n.min+n.max)/2?`insideEndTop`:`insideEndBottom`,distance:8,color:t.muted,textBorderColor:t.surface,textBorderWidth:3,fontSize:12},lineStyle:{color:t.status[i.status],type:[4,3],width:1}}))}function Vc(e,t,n,r={width:500,height:248}){let i=t.frame?Rc(t.frame,e):{shown:[],hidden:0},a=i.shown,o=a[0]?.unit??e.unit,s=new Set(a.map(e=>e.name)),c=a.find(e=>Ms(e.name)),l=t.previous&&t.shift_ms!==void 0?Rc(t.previous,e).shown.flatMap(e=>Ms(e.name)?c?[e]:[]:s.has(e.name)?[e]:[]):[],u=[...new Set([...a,...l].map(t=>t.unit??e.unit))];u.length===0&&u.push(e.unit);let d=e.options?.style??`line`,f=a.length>=2&&a.length<=6&&i.hidden===0&&d!==`bars`&&d!==`stacked`,p=f?Math.max(40,...a.map(e=>{let t=Array.from(e.name).slice(0,24).join(``);return r.measureText?.(t,`12px ${n.font}`)??Array.from(t).length*7.2}))+12:0,m=f?p+8:0,h=(e.options?.legend??`auto`)!==`hidden`&&a.length>1,g=Ls(a.map(e=>e.name),r.width,h,n.text,n.font,r.measureText),_=r.height-g.top-(i.hidden?24:8)-22,v=Math.max(0,Math.floor(_/16)),y=t.shift_ms,b=u.map(t=>{let n=[...a,...l].filter(n=>(n.unit??e.unit)===t).flatMap(e=>e.points.flatMap(([,e])=>e===null?[]:[e]));if(d===`stacked`){let r=new Map;for(let n of a.filter(n=>(n.unit??e.unit)===t))for(let[e,t]of n.points){let n=r.get(e)??{positive:0,negative:0};t!==null&&(t>0?n.positive+=t:n.negative+=t),r.set(e,n)}n.push(...[...r.values()].flatMap(e=>[e.positive,e.negative]))}return tc(Math.min(0,...n),Math.max(0,...n),t,_)}),x=a.map((t,r)=>{let i=Lc(t.name,r,n);return{name:t.name,interactive:!0,yAxisIndex:u.indexOf(t.unit??e.unit),tooltip:{valueFormatter:n=>Xs(t.unit??e.unit,n)},type:d===`bars`||d===`stacked`?`bar`:`line`,data:t.points,endLabel:f?{show:r0?{symbol:[`none`,`none`],silent:!0,data:Bc(e,n,b[0],o)}:void 0}}),S=y===void 0?[]:l.map(t=>({name:`${t.name} · previous`,interactive:!1,yAxisIndex:u.indexOf(t.unit??e.unit),tooltip:{valueFormatter:n=>Xs(t.unit??e.unit,n)},type:`line`,data:t.points.map(([e,t])=>[e+y,t]),showSymbol:!1,silent:!0,z:1,lineStyle:{width:1,type:`dashed`,color:n.muted},itemStyle:{color:n.muted}})),C=u.map((t,r)=>({...e.options?.scale===`log`?{splitNumber:$s(_)}:b[r],type:e.options?.scale===`log`?`log`:`value`,position:r===0?`left`:`right`,offset:Math.max(0,r-1)*56,axisLine:{show:!1},splitLine:{show:r===0,lineStyle:{color:n.grid}},axisLabel:{color:n.muted,fontFamily:n.font,fontSize:11,hideOverlap:!0,formatter:Zs(t)}}));return Ic({...zc(n,o),tooltip:{...zc(n,o).tooltip,formatter:js((t,n)=>Xs([...a,...l].find(e=>e.name===n||`${e.name} · previous`===n)?.unit??e.unit,t),!0)},legend:g.option,grid:{left:8,right:16+(f?m:0)+Math.max(0,u.length-2)*56,top:g.top,bottom:i.hidden?24:8,containLabel:!0},xAxis:{type:`time`,min:t.from_ms,max:t.to_ms,axisLine:{lineStyle:{color:n.grid}},axisTick:{show:!1},splitLine:{show:!1},axisLabel:{color:n.muted,fontFamily:n.font,fontSize:11,hideOverlap:!0,formatter:ic}},yAxis:C.length===1?C[0]:C,series:[...x,...S],graphic:Is(i.hidden,n.muted)},{y:g.top,height:_})}function Hc(e,t,n){if(n(e)<=t)return e;let r=Array.from(e);for(let e=r.length-1;e>0;e--){let i=Math.floor(e*.45),a=e-i,o=r.slice(0,i).join(``)+`…`+r.slice(-a).join(``);if(n(o)<=t)return o}return`…`}function Uc(e,t,n,r={width:500,height:248}){let i=Cc(t),a=i.categories,{shown:o,hidden:s}=Fs(i.series,e),c=t.columns.flatMap((e,t)=>e.role===`dimension`?[t]:[]),l=new Map;for(let n=0;nString(t.values[e][n]??``))),{dimensions:r,...i})}let u=o[0]?.unit??e.unit,d=[...new Set(o.map(t=>t.unit??e.unit))];d.length===0&&d.push(e.unit);let f=o.length>1,p=!!(t.periods?.[`Before deploy`]||t.periods?.[`Since deploy`]),m=e=>r.measureText?.(e,`11px ${n.font}`)??Array.from(e).length*6.6,h=Math.min(r.width*.4,Math.max(40,...a.map(m))),g=Ls(o.map(e=>e.name),r.width,f&&e.options?.legend!==`hidden`,n.text,n.font,r.measureText),_=d.map((t,i)=>({...tc(Math.min(0,...o.filter(n=>(n.unit??e.unit)===t).flatMap(e=>e.values.filter(e=>e!==null))),Math.max(0,...o.filter(n=>(n.unit??e.unit)===t).flatMap(e=>e.values.filter(e=>e!==null))),t,r.width-h-80),type:`value`,position:i===0?`bottom`:`top`,offset:Math.max(0,i-1)*36,splitLine:{show:i===0,lineStyle:{color:n.grid}},axisLabel:{color:n.muted,fontFamily:n.font,fontSize:11,formatter:e=>Qs(t,e),hideOverlap:!0}}));return{...zc(n,u),tooltip:{...zc(n,u).tooltip,formatter:js((t,n)=>Xs(o.find(e=>e.name===n)?.unit??e.unit,t)),axisPointer:{type:`shadow`}},legend:g.option,grid:{left:8,right:56,top:(f?g.top:8)+Math.max(0,d.length-1)*36,bottom:s?24:8,containLabel:!0},yAxis:{type:`category`,inverse:!0,data:a,splitLine:{show:!1},axisLine:{lineStyle:{color:n.grid}},axisTick:{show:!1},axisLabel:{color:n.muted,fontFamily:n.font,fontSize:11,width:h,overflow:`truncate`,formatter:e=>Hc(e,h,m)}},xAxis:_.length===1?_[0]:_,series:o.map((t,r)=>({name:t.name,interactive:!0,xAxisIndex:d.indexOf(t.unit??e.unit),tooltip:{valueFormatter:n=>Xs(t.unit??e.unit,n)},type:`bar`,data:t.values.map((e,n)=>({value:e,selection:l.get(JSON.stringify(c.length>1?[a[n],t.name]:[a[n]]))})),barMaxWidth:p&&t.name===`Before deploy`?7:14,barGap:`20%`,itemStyle:{...Mc(p?t.name===`Before deploy`?n.muted:_c(0,n.dark):Lc(t.name,r,n),n),borderRadius:[0,4,4,0]},label:{show:p?t.name===`Since deploy`:!f||r===0,position:`right`,color:n.text,fontFamily:n.font,fontSize:11,formatter:({value:n})=>Qs(t.unit??e.unit,n)}})),graphic:Is(s,n.muted)}}function Wc(e,t,n,r=e.unit,i={width:270,height:140}){let a=e.min??0,o=e.max??100,s=Gc(e,a,o,n),c=Xs(r,t),l=kc(t,e.thresholds,e.better),u=l===`bad`?`◆ Bad`:l===`warn`?`■ Warn`:l===`ok`?`● OK`:t===null?`○ Unknown`:void 0,d=e=>`${e}40`,f=i.measureText?.(c,`600 28px ${n.font}`)??c.length*28*.6,p=i.measureText?.(u??``,`11px ${n.font}`)??(u?.length??0)*11*.6,m=i.width{let r=y;return y=e,{type:`rect`,shape:{x:4+r*_,y:g,width:(e-r)*_,height:10,r:[n===0?5:0,n===s.length-1?5:0,n===s.length-1?5:0,n===0?5:0]},style:{fill:d(t)}}}),{id:`gauge-fill`,type:`rect`,shape:{x:4,y:g,width:v*_,height:10,r:5},style:{fill:l?n.status[l]:_c(0,n.dark)}},{id:`gauge-marker`,type:`rect`,shape:{x:3+v*_,y:g-2,width:2,height:14,r:1},style:{fill:n.text}},{type:`text`,left:4,top:g+12,style:{text:Xs(r,a),fill:n.muted,fontSize:11,fontFamily:n.font}},{type:`text`,right:4,top:g+12,style:{text:Xs(r,o),fill:n.muted,fontSize:11,fontFamily:n.font}}]}}function Gc(e,t,n,r){let i=n-t||1,a=[t,...(e.thresholds??[]).map(e=>Math.min(n,Math.max(t,e.value))),n].sort((e,t)=>e-t),o=[];for(let t=0;t[(e.end-t)/i,r.status[e.status]])}var Kc=function(e,t){return Kc=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},Kc(e,t)};function U(e,t){if(typeof t!=`function`&&t!==null)throw TypeError(`Class extends value `+String(t)+` is not a constructor or null`);Kc(e,t);function n(){this.constructor=e}e.prototype=t===null?Object.create(t):(n.prototype=t.prototype,new n)}var qc=`12px sans-serif`,Jc=20,Yc=100,Xc=`007LLmW'55;N0500LLLLLLLLLL00NNNLzWW\\\\WQb\\0FWLg\\bWb\\WQ\\WrWWQ000CL5LLFLL0LL**F*gLLLL5F0LF\\FFF5.5N`;function Zc(e){var t={};if(typeof JSON>`u`)return t;for(var n=0;n=0)s=o*n.length;else for(var c=0;c=fl&&(dl=0),dl++}function ml(){var e=[...arguments];typeof console<`u`&&console.error.apply(console,e)}function hl(e){if(typeof e!=`object`||!e)return e;var t=e,n=nl.call(e);if(n===`[object Array]`){if(!Jl(e)){t=[];for(var r=0,i=e.length;r`u`&&typeof self<`u`?ou.worker=!0:!ou.hasGlobalWindow||`Deno`in window||typeof navigator<`u`&&typeof navigator.userAgent==`string`&&navigator.userAgent.indexOf(`Node.js`)>-1?(ou.node=!0,ou.svgSupported=!0):su(navigator.userAgent,ou);function su(e,t){var n=t.browser,r=e.match(/Firefox\/([\d.]+)/),i=e.match(/MSIE\s([\d.]+)/)||e.match(/Trident\/.+?rv:(([\d.]+))/),a=e.match(/Edge?\/([\d.]+)/),o=/micromessenger/i.test(e);if(r&&(n.firefox=!0,n.version=r[1]),i&&(n.ie=!0,n.version=i[1]),a&&(n.edge=!0,n.version=a[1],n.newEdge=+a[1].split(`.`)[0]>18),o&&(n.weChat=!0),t.svgSupported=typeof SVGRect<`u`,t.touchEventsSupported=`ontouchstart`in window&&!n.ie&&!n.edge,t.pointerEventsSupported=`onpointerdown`in window&&(n.edge||n.ie&&+n.version>=11),t.domSupported=typeof document<`u`){var s=document.documentElement.style;t.transform3dSupported=(n.ie&&`transition`in s||n.edge||`WebKitCSSMatrix`in window&&`m11`in new WebKitCSSMatrix||`MozPerspective`in s)&&!(`OTransition`in s),t.transformSupported=t.transform3dSupported||n.ie&&+n.version>=9}}var cu=1e-4,lu=20;function uu(e){return e.replace(/^\s+|\s+$/g,``)}var du=Math.min,fu=Math.max,pu=Math.abs,mu=Math.round,hu=Math.floor,gu=Math.ceil,_u=Math.pow,vu=Math.log,yu=Math.LN10,bu=Math.PI,xu=Math.random;function Su(e,t,n,r){var i=t[0],a=t[1],o=n[0],s=n[1],c=a-i,l=s-o;if(c===0)return l===0?o:(o+s)/2;if(r){if(c>0){if(e<=i)return o;if(e>=a)return s}else if(e>=i)return o;else if(e<=a)return s}else{if(e===i)return o;if(e===a)return s}return(e-i)/c*l+o}var Cu=wu;function wu(e,t,n){switch(e){case`center`:case`middle`:e=`50%`;break;case`left`:case`top`:e=`0%`;break;case`right`:case`bottom`:e=`100%`}return Tu(e,t,n)}function Tu(e,t,n){return Y(e)?Eu(e)?parseFloat(e)/100*t+(n||0):parseFloat(e):e==null?NaN:+e}function Eu(e){return!!uu(e).match(/%$/)}function Du(e,t,n){return isNaN(t)?n?``+e:+e:(t=du(fu(0,t),lu),e=(+e).toFixed(t),n?e:+e)}function Ou(e){return e.sort(function(e,t){return e-t}),e}function ku(e){if(e=+e,isNaN(e))return 0;if(e>1e-14){for(var t=1,n=0;n<15;n++,t*=10)if(mu(e*t)/t===e)return n}return Au(e)}function Au(e){var t=e.toString().toLowerCase(),n=t.indexOf(`e`),r=n>0?+t.slice(n+1):0,i=n>0?n:t.length,a=t.indexOf(`.`);return fu(0,(a<0?0:i-1-a)-r)}function ju(e,t,n){var r=pu(e[1]-e[0]);if(!isFinite(r)||r===0)return NaN;var i=vu(2*pu(n||1)*pu(r))/yu,a=vu(pu(t))/yu,o=fu(0,gu(-i+a));return isFinite(o)||(o=NaN),o}function Mu(e,t){var n=fu(ku(e),ku(t)),r=e+t;return n>lu?r:Du(r,n)}var Nu=_u(2,53)-1;function Pu(e){var t=bu*2;return(e%t+t)%t}function Fu(e){return e>-cu&&e=10&&t++,t}function Bu(e,t){var n=zu(e),r=_u(10,n),i=e/r;return e=(t===2?1:t?i<1.5?1:i<2.5?2:i<4?3:i<7?5:10:i<1?1:i<2?2:i<3?3:i<5?5:10)*r,Du(e,-n)}function Vu(e){e.sort(function(e,t){return s(e,t,0)?-1:1});for(var t=-1/0,n=1,r=0;r0?e.length:0),this.item=null,this.key=NaN,this},e.prototype.next=function(){return(this._step>0?this._idx=this._end)&&(this.item=this._list[this._idx],this.key=this._idx+=this._step,!0)},e})();function Ld(){return[1/0,-1/0]}function Rd(e,t){Hd(t)&&(te[1]&&(e[1]=t))}function zd(e,t){Hd(t)&&te[1]&&(e[1]=t)}function Vd(e,t){Ud(t[0],t[1])&&(t[0]e[1]&&(e[1]=t[1]))}function Hd(e){return e!=null&&isFinite(e)}function Ud(e,t){return Hd(e)&&Hd(t)&&e<=t}function Wd(e){var t=e[1]-e[0];return isFinite(t)&&t>=0}function Gd(e){Ud(e[0],e[1])&&e[0]>e[1]&&(e[0]=e[1])}function Kd(){var e=`__ec_once_`+qd++;return function(t,n){Z(t,e)||(t[e]=1,n())}}var qd=Wu();function Jd(e,t,n){var r=$l(),i=0;G(e,function(a){var o=t(a),s=r.get(o)||0;n&&n(a,s),!s&&!n&&(e[i++]=a),r.set(o,s+1)}),n||(e.length=i)}function Yd(e){return e.value+``}function Xd(e){return e+``}function Zd(e,t){return X(t,!0)?e.seriesIndex+2:0}function Qd(e,t,n){var r=e.getData().count();return{progressiveRender:n.progressiveEnabled&&t.incrementalPrepareRender&&r>=n.threshold,large:e.get(`large`)&&r>=e.get(`largeThreshold`),modDataCount:e.get(`progressiveChunkMode`)===`mod`?e.getData().count():null}}function $d(e){return{overallReset:e}}var ef=`.`,tf=`___EC__COMPONENT__CONTAINER___`,nf=`___EC__EXTENDED_CLASS___`;function rf(e){var t={main:``,sub:``};if(e){var n=e.split(ef);t.main=n[0]||``,t.sub=n[1]||``}return t}function af(e){Wl(/^[a-zA-Z0-9_]+([.][a-zA-Z0-9_]+)?$/.test(e),`componentType "`+e+`" illegal`)}function of(e){return!!(e&&e[nf])}function sf(e,t){e.$constructor=e,e.extend=function(e){var t=this,n;return cf(t)?n=function(e){U(t,e);function t(){return e.apply(this,arguments)||this}return t}(t):(n=function(){(e.$constructor||t).apply(this,arguments)},xl(n,this)),W(n.prototype,e),n[nf]=!0,n.extend=this.extend,n.superCall=ff,n.superApply=pf,n.superClass=t,n}}function cf(e){return Al(e)&&/^class\s/.test(Function.prototype.toString.call(e))}function lf(e,t){e.extend=t.extend}var uf=Math.round(Math.random()*10);function df(e){var t=[`__\0is_clz`,uf++].join(`_`);e.prototype[t]=!0,e.isInstance=function(e){return!!(e&&e[t])}}function ff(e,t){var n=[...arguments].slice(2);return this.superClass.prototype[t].apply(e,n)}function pf(e,t,n){return this.superClass.prototype[t].apply(e,n)}function mf(e){var t={};e.registerClass=function(e){var r=e.type||e.prototype.type;if(r){af(r),e.prototype.type=r;var i=rf(r);if(!i.sub)t[i.main]=e;else if(i.sub!==tf){var a=n(i);a[i.sub]=e}}return e},e.getClass=function(e,n,r){var i=t[e];if(i&&i[tf]&&(i=n?i[n]:null),r&&!i)throw Error(n?`Component `+e+`.`+(n||``)+` is used but not imported.`:e+`.type should be specified.`);return i},e.getClassesByMainType=function(e){var n=rf(e),r=[],i=t[n.main];return i&&i[tf]?G(i,function(e,t){t!==tf&&r.push(e)}):r.push(i),r},e.hasClass=function(e){return!!t[rf(e).main]},e.getAllClassMainTypes=function(){var e=[];return G(t,function(t,n){e.push(n)}),e},e.hasSubTypes=function(e){var n=t[rf(e).main];return n&&n[tf]};function n(e){var n=t[e.main];return(!n||!n[tf])&&(n=t[e.main]={},n[tf]=!0),n}}function hf(e,t){for(var n=0;n=0||i&&bl(i,s)<0)){var c=n.getShallow(s,t);c!=null&&(a[e[o][0]]=c)}}return a}}var gf=hf([[`fill`,`color`],[`shadowBlur`],[`shadowOffsetX`],[`shadowOffsetY`],[`opacity`],[`shadowColor`]]),_f=function(){function e(){}return e.prototype.getAreaStyle=function(e,t){return gf(this,e,t)},e}(),vf=function(){function e(e){this.value=e}return e}(),yf=function(){function e(){this._len=0}return e.prototype.insert=function(e){var t=new vf(e);return this.insertEntry(t),t},e.prototype.insertEntry=function(e){this.head?(this.tail.next=e,e.prev=this.tail,e.next=null,this.tail=e):this.head=this.tail=e,this._len++},e.prototype.remove=function(e){var t=e.prev,n=e.next;t?t.next=n:this.head=n,n?n.prev=t:this.tail=t,e.next=e.prev=null,this._len--},e.prototype.len=function(){return this._len},e.prototype.clear=function(){this.head=this.tail=null,this._len=0},e}(),bf=function(){function e(e){this._list=new yf,this._maxSize=10,this._map={},this._maxSize=e}return e.prototype.put=function(e,t){var n=this._list,r=this._map,i=null;if(r[e]==null){var a=n.len(),o=this._lastRemovedEntry;if(a>=this._maxSize&&a>0){var s=n.head;n.remove(s),delete r[s.key],i=s.value,this._lastRemovedEntry=s}o?o.value=t:o=new vf(t),o.key=e,n.insertEntry(o),r[e]=o}return i},e.prototype.get=function(e){var t=this._map[e],n=this._list;if(t!=null)return t!==n.tail&&(n.remove(t),n.insertEntry(t)),t.value},e.prototype.clear=function(){this._list.clear(),this._map={}},e.prototype.len=function(){return this._list.len()},e}(),xf=new bf(50);function Sf(e){if(typeof e==`string`){var t=xf.get(e);return t&&t.image}return e}function Cf(e,t,n,r,i){if(!e)return t;if(typeof e==`string`){if(t&&t.__zrImageSrc===e||!n)return t;var a=xf.get(e),o={hostEl:n,cb:r,cbPayload:i};return a?(t=a.image,!Tf(t)&&a.pending.push(o)):(t=$c.loadImage(e,wf,wf),t.__zrImageSrc=e,xf.put(e,t.__cachedImgObj={image:t,pending:[o]})),t}return e}function wf(){var e=this.__cachedImgObj;this.onload=this.onerror=this.__cachedImgObj=null;for(var t=0;tu||d>f||p>m||h>g)return!1;var _=!(u=e.x&&t<=e.x+e.width&&n>=e.y&&n<=e.y+e.height},e.prototype.contain=function(t,n){return e.contain(this,t,n)},e.prototype.clone=function(){return new e(this.x,this.y,this.width,this.height)},e.prototype.copy=function(e){hp(this,e)},e.prototype.plain=function(){return{x:this.x,y:this.y,width:this.width,height:this.height}},e.prototype.isFinite=function(){return isFinite(this.x)&&isFinite(this.y)&&isFinite(this.width)&&isFinite(this.height)},e.prototype.isZero=function(){return this.width===0||this.height===0},e.create=function(t){return new e(t?t.x:0,t?t.y:0,t?t.width:0,t?t.height:0)},e.copy=function(e,t){return e.x=t.x,e.y=t.y,e.width=t.width,e.height=t.height,e},e.applyTransform=function(e,t,n){if(!n){e!==t&&hp(e,t);return}if(n[1]<1e-5&&n[1]>-1e-5&&n[2]<1e-5&&n[2]>-1e-5){var r=n[0],i=n[3],a=n[4],o=n[5];e.x=t.x*r+a,e.y=t.y*i+o,e.width=t.width*r,e.height=t.height*i,e.width<0&&(e.x+=e.width,e.width=-e.width),e.height<0&&(e.y+=e.height,e.height=-e.height);return}ip.x=op.x=t.x,ip.y=sp.y=t.y,ap.x=sp.x=t.x+t.width,ap.y=op.y=t.y+t.height,ip.transform(n),sp.transform(n),ap.transform(n),op.transform(n),e.x=$f(ip.x,ap.x,op.x,sp.x),e.y=$f(ip.y,ap.y,op.y,sp.y);var s=ep(ip.x,ap.x,op.x,sp.x),c=ep(ip.y,ap.y,op.y,sp.y);e.width=s-e.x,e.height=c-e.y},e.calculateTransform=function(e,t,n){var r=n.width/t.width,i=n.height/t.height;return e=Df(e||[]),Af(e,e,Lf(xp,-t.x,-t.y)),Mf(e,e,Lf(xp,r,i)),Af(e,e,Lf(xp,n.x,n.y)),e},e}(),pp=fp.create,mp=fp.set,hp=fp.copy,gp=fp.calculateTransform,_p=fp.applyTransform,vp=fp.contain,yp=new fp(0,0,0,0),bp=new fp(0,0,0,0),xp=[];function Sp(e,t,n,r,i,a,o,s){var c=tp(t-n),l=tp(r-e),u=$f(c,l),d=np[i],f=np[1-i],p=rp[i];t=l||!cp.bidirectional)&&(lp[d]=-l,lp[f]=0,cp.useDir&&cp.calcDirMTV())))}function Cp(){var e=0,t=new Qf,n=new Qf,r={minTv:new Qf,maxTv:new Qf,useDir:!1,dirMinTv:new Qf,touchThreshold:0,bidirectional:!0,negativeSize:!1,reset:function(i,a){r.touchThreshold=0,i&&i.touchThreshold!=null&&(r.touchThreshold=ep(0,i.touchThreshold)),r.negativeSize=!1,a&&(r.minTv.set(1/0,1/0),r.maxTv.set(0,0),r.useDir=!1,i&&i.direction!=null&&(r.useDir=!0,r.dirMinTv.copy(r.minTv),n.copy(r.minTv),e=i.direction,r.bidirectional=i.bidirectional==null||!!i.bidirectional,r.bidirectional||t.set(Math.cos(e),Math.sin(e))))},calcDirMTV:function(){var a=r.minTv,o=r.dirMinTv,s=a.y*a.y+a.x*a.x,c=Math.sin(e),l=Math.cos(e),u=c*a.y+l*a.x;if(i(u)){i(a.x)&&i(a.y)&&o.set(0,0);return}if(n.x=s*l/u,n.y=s*c/u,i(n.x)&&i(n.y)){o.set(0,0);return}(r.bidirectional||t.dot(n)>0)&&n.len()=Op)){e||=`12px sans-serif`;for(var t=[],n=+new Date,r=0;r<=127;r++)t[r]=$c.measureText(String.fromCharCode(r),e).width;var i=+new Date-n;return i>16?Dp=Op:i>2&&Dp++,t}}var Dp=0,Op=5;function kp(e,t){return e.asciiWidthMapTried||=(e.asciiWidthMap=Ep(e.font),!0),0<=t&&t<=127?e.asciiWidthMap==null?e.asciiCharWidth:e.asciiWidthMap[t]:e.stWideCharWidth}function Ap(e,t){var n=e.strWidthCache,r=n.get(t);return r??(r=$c.measureText(t,e.font).width,n.put(t,r)),r}function jp(e,t,n,r){var i=Ap(wp(t),e),a=Fp(t);return new fp(Np(0,i,n),Pp(0,a,r),i,a)}function Mp(e,t,n,r){var i=((e||``)+``).split(` `);if(i.length===1)return jp(i[0],t,n,r);for(var a=new fp(0,0,0,0),o=0;o=0?parseFloat(e)/100*t:parseFloat(e):e}function Lp(e,t,n){var r=t.position||`inside`,i=t.distance==null?5:t.distance,a=n.height,o=n.width,s=a/2,c=n.x,l=n.y,u=`left`,d=`top`;if(r instanceof Array)c+=Ip(r[0],n.width),l+=Ip(r[1],n.height),u=null,d=null;else switch(r){case`left`:c-=i,l+=s,u=`right`,d=`middle`;break;case`right`:c+=i+o,l+=s,d=`middle`;break;case`top`:c+=o/2,l-=i,u=`center`,d=`bottom`;break;case`bottom`:c+=o/2,l+=a+i,u=`center`;break;case`inside`:c+=o/2,l+=s,u=`center`,d=`middle`;break;case`insideLeft`:c+=i,l+=s,d=`middle`;break;case`insideRight`:c+=o-i,l+=s,u=`right`,d=`middle`;break;case`insideTop`:c+=o/2,l+=i,u=`center`;break;case`insideBottom`:c+=o/2,l+=a-i,u=`center`,d=`bottom`;break;case`insideTopLeft`:c+=i,l+=i;break;case`insideTopRight`:c+=o-i,l+=i,u=`right`;break;case`insideBottomLeft`:c+=i,l+=a-i,d=`bottom`;break;case`insideBottomRight`:c+=o-i,l+=a-i,u=`right`,d=`bottom`}return e||={},e.x=c,e.y=l,e.align=u,e.verticalAlign=d,e}var Rp=/\{([a-zA-Z0-9_]+)\|([^}]*)\}/g;function zp(e,t,n,r,i,a){if(!n){e.text=``,e.isTruncated=!1;return}var o=(t+``).split(` `);a=Bp(n,r,i,a);for(var s=!1,c={},l=0,u=o.length;l=s;l++)c-=s;var u=Ap(o,n);return u>c&&(n=``,u=0),c=e-u,i.ellipsis=n,i.ellipsisWidth=u,i.contentWidth=c,i.containerWidth=e,i}function Vp(e,t,n){var r=n.containerWidth,i=n.contentWidth,a=n.fontMeasureInfo;if(!r){e.textLine=``,e.isTruncated=!1;return}var o=Ap(a,t);if(o<=r){e.textLine=t,e.isTruncated=!1;return}for(var s=0;;s++){if(o<=i||s>=n.maxIterations){t+=n.ellipsis;break}var c=s===0?Hp(t,i,a):o>0?Math.floor(t.length*i/o):0;t=t.substr(0,c),o=Ap(a,t)}t===``&&(t=n.placeholder),e.textLine=t,e.isTruncated=!0}function Hp(e,t,n){for(var r=0,i=0,a=e.length;ig&&p){var y=Math.floor(g/f);m||=_.length>y,_=_.slice(0,y),v=_.length*f}if(i&&u&&h!=null)for(var b=Bp(h,l,t.ellipsis,{minChar:t.truncateMinChar,placeholder:t.placeholder}),x={},S=0;S<_.length;S++)Vp(x,_[S],b),_[S]=x.textLine,m||=x.isTruncated;for(var C=g,w=0,T=wp(l),S=0;S<_.length;S++)w=Math.max(Ap(T,_[S]),w);h??=w;var E=h;return C+=c,E+=s,{lines:_,height:g,outerWidth:E,outerHeight:C,lineHeight:f,calculatedLineHeight:d,contentWidth:w,contentHeight:v,width:h,isTruncated:m}}var Wp=function(){function e(){}return e}(),Gp=function(){function e(e){this.tokens=[],e&&(this.tokens=e)}return e}(),Kp=function(){function e(){this.width=0,this.height=0,this.contentWidth=0,this.contentHeight=0,this.outerWidth=0,this.outerHeight=0,this.lines=[],this.isTruncated=!1}return e}();function qp(e,t,n,r,i){var a=new Kp,o=nm(e);if(!o)return a;var s=t.padding,c=s?s[1]+s[3]:0,l=s?s[0]+s[2]:0,u=t.width;u==null&&n!=null&&(u=n-c);var d=t.height;d==null&&r!=null&&(d=r-l);for(var f=t.overflow,p=(f===`break`||f===`breakAll`)&&u!=null?{width:u,accumWidth:0,breakAll:f===`breakAll`}:null,m=Rp.lastIndex=0,h;(h=Rp.exec(o))!=null;){var g=h.index;g>m&&Jp(a,o.substring(m,g),t,p),Jp(a,h[2],t,p,h[1]),m=Rp.lastIndex}md){var F=a.lines.length;O>0?(T.tokens=T.tokens.slice(0,O),C(T,D,E),a.lines=a.lines.slice(0,w+1)):a.lines=a.lines.slice(0,w),a.isTruncated=a.isTruncated||a.lines.length0&&m+r.accumWidth>r.width&&(u=t.split(` +`):[],v=_.length*f;if(g??=v,v>g&&p){var y=Math.floor(g/f);m||=_.length>y,_=_.slice(0,y),v=_.length*f}if(i&&u&&h!=null)for(var b=Bp(h,l,t.ellipsis,{minChar:t.truncateMinChar,placeholder:t.placeholder}),x={},S=0;S<_.length;S++)Vp(x,_[S],b),_[S]=x.textLine,m||=x.isTruncated;for(var C=g,w=0,T=wp(l),S=0;S<_.length;S++)w=Math.max(Ap(T,_[S]),w);h??=w;var E=h;return C+=c,E+=s,{lines:_,height:g,outerWidth:E,outerHeight:C,lineHeight:f,calculatedLineHeight:d,contentWidth:w,contentHeight:v,width:h,isTruncated:m}}var Wp=function(){function e(){}return e}(),Gp=function(){function e(e){this.tokens=[],e&&(this.tokens=e)}return e}(),Kp=function(){function e(){this.width=0,this.height=0,this.contentWidth=0,this.contentHeight=0,this.outerWidth=0,this.outerHeight=0,this.lines=[],this.isTruncated=!1}return e}();function qp(e,t,n,r,i){var a=new Kp,o=nm(e);if(!o)return a;var s=t.padding,c=s?s[1]+s[3]:0,l=s?s[0]+s[2]:0,u=t.width;u==null&&n!=null&&(u=n-c);var d=t.height;d==null&&r!=null&&(d=r-l);for(var f=t.overflow,p=(f===`break`||f===`breakAll`)&&u!=null?{width:u,accumWidth:0,breakAll:f===`breakAll`}:null,m=Rp.lastIndex=0,h;(h=Rp.exec(o))!=null;){var g=h.index;g>m&&Jp(a,o.substring(m,g),t,p),Jp(a,h[2],t,p,h[1]),m=Rp.lastIndex}md){var F=a.lines.length;O>0?(T.tokens=T.tokens.slice(0,O),C(T,D,E),a.lines=a.lines.slice(0,w+1)):a.lines=a.lines.slice(0,w),a.isTruncated=a.isTruncated||a.lines.length0&&m+r.accumWidth>r.width&&(u=t.split(` `),l=!0),r.accumWidth=m}else{var h=Qp(t,c,r.width,r.breakAll,r.accumWidth);r.accumWidth=h.accumWidth+p,d=h.linesWidths,u=h.lines}}u||=t.split(` `);for(var g=wp(c),_=0;_=32&&t<=591||t>=880&&t<=4351||t>=4608&&t<=5119||t>=7680&&t<=8303}var Xp=wl(`,&?/;] `.split(``),function(e,t){return e[t]=!0,e},{});function Zp(e){return!Yp(e)||!!Xp[e]}function Qp(e,t,n,r,i){for(var a=[],o=[],s=``,c=``,l=0,u=0,d=wp(t),f=0;fn:i+u+m>n){u?(s||c)&&(h?(s||(s=c,c=``,l=0,u=l),a.push(s),o.push(u-l),c+=p,l+=m,s=``,u=l):(c&&(s+=c,c=``,l=0),a.push(s),o.push(u),s=p,u=m)):h?(a.push(c),o.push(l),c=p,l=m):(a.push(p),o.push(m));continue}u+=m,h?(c+=p,l+=m):(c&&(s+=c,c=``,l=0),s+=p)}return c&&(s+=c),s&&(a.push(s),o.push(u)),a.length===1&&(u+=i),{accumWidth:u,lines:a,linesWidths:o}}function $p(e,t,n,r,i,a){if(e.baseX=n,e.baseY=r,e.outerWidth=e.outerHeight=null,t){var o=t.width*2,s=t.height*2;fp.set(em,Np(n,o,i),Pp(r,s,a),o,s),fp.intersect(t,em,null,tm);var c=tm.outIntersectRect;e.outerWidth=c.width,e.outerHeight=c.height,e.baseX=Np(c.x,c.width,i,!0),e.baseY=Pp(c.y,c.height,a,!0)}}var em=new fp(0,0,0,0),tm={outIntersectRect:{},clamp:!0};function nm(e){return e==null?e=``:e+=``}function rm(e){var t=nm(e.text),n=e.font;return im(e,Ap(wp(n),t),Fp(n),null)}function im(e,t,n,r){var i=new fp(Np(e.x||0,t,e.textAlign),Pp(e.y||0,n,e.textBaseline),t,n),a=r??(am(e)?e.lineWidth:0);return a>0&&(i.x-=a/2,i.y-=a/2,i.width+=a,i.height+=a),i}function am(e){var t=e.stroke;return t!=null&&t!==`none`&&e.lineWidth>0}var om=Df,sm=5e-5;function cm(e){return e>sm||e<-sm}var lm=[],um=[],dm=Ef(),fm=Math.abs,pm=function(){function e(){}return e.prototype.getLocalTransform=function(e){return mm(this,e)},e.prototype.setPosition=function(e){this.x=e[0],this.y=e[1]},e.prototype.setScale=function(e){this.scaleX=e[0],this.scaleY=e[1]},e.prototype.setSkew=function(e){this.skewX=e[0],this.skewY=e[1]},e.prototype.setOrigin=function(e){this.originX=e[0],this.originY=e[1]},e.prototype.needLocalTransform=function(){return cm(this.rotation)||cm(this.x)||cm(this.y)||cm(this.scaleX-1)||cm(this.scaleY-1)||cm(this.skewX)||cm(this.skewY)},e.prototype.updateTransform=function(){var e=this.parent&&this.parent.transform,t=this.needLocalTransform(),n=this.transform;if(!(t||e)){n&&(om(n),this.invTransform=null);return}n||=Ef(),t?this.getLocalTransform(n):om(n),e&&(t?kf(n,e,n):Of(n,e)),this.transform=n,this._resolveGlobalScaleRatio(n),this.invTransform=this.invTransform||Ef(),Nf(this.invTransform,n)},e.prototype._resolveGlobalScaleRatio=function(e){var t=this.globalScaleRatio;if(t!=null&&t!==1){this.getGlobalScale(lm);var n=lm[0]<0?-1:1,r=lm[1]<0?-1:1,i=((lm[0]-n)*t+n)/lm[0]||0,a=((lm[1]-r)*t+r)/lm[1]||0;e[0]*=i,e[1]*=i,e[2]*=a,e[3]*=a}},e.prototype.getComputedTransform=function(){for(var e=this,t=[];e;)t.push(e),e=e.parent;for(;e=t.pop();)e.updateTransform();return this.transform},e.prototype.setLocalTransform=function(e){if(e){var t=e[0]*e[0]+e[1]*e[1],n=e[2]*e[2]+e[3]*e[3],r=Math.atan2(e[1],e[0]),i=Math.PI/2+r-Math.atan2(e[3],e[2]);n=Math.sqrt(n)*Math.cos(i),t=Math.sqrt(t),this.skewX=i,this.skewY=0,this.rotation=-r,this.x=+e[4],this.y=+e[5],this.scaleX=t,this.scaleY=n,this.originX=0,this.originY=0}},e.prototype.decomposeTransform=function(){if(this.transform){var e=this.parent,t=this.transform;e&&e.transform&&(e.invTransform=e.invTransform||Ef(),kf(um,e.invTransform,t),t=um);var n=this.originX,r=this.originY;(n||r)&&(dm[4]=n,dm[5]=r,kf(um,t,dm),um[4]-=n,um[5]-=r,t=um),this.setLocalTransform(t)}},e.prototype.getGlobalScale=function(e){var t=this.transform;return e||=[],t?(e[0]=Math.sqrt(t[0]*t[0]+t[1]*t[1]),e[1]=Math.sqrt(t[2]*t[2]+t[3]*t[3]),t[0]<0&&(e[0]=-e[0]),t[3]<0&&(e[1]=-e[1]),e):(e[0]=1,e[1]=1,e)},e.prototype.transformCoordToLocal=function(e,t){var n=[e,t],r=this.invTransform;return r&&Yf(n,n,r),n},e.prototype.transformCoordToGlobal=function(e,t){var n=[e,t],r=this.transform;return r&&Yf(n,n,r),n},e.prototype.getLineScale=function(){var e=this.transform;return e&&fm(e[0]-1)>1e-10&&fm(e[3]-1)>1e-10?Math.sqrt(fm(e[0]*e[3]-e[2]*e[1])):1},e.prototype.copyTransform=function(e){_m(this,e)},e.getLocalTransform=function(e,t){t||=[];var n=e.originX||0,r=e.originY||0,i=e.scaleX,a=e.scaleY,o=e.anchorX,s=e.anchorY,c=e.rotation||0,l=e.x,u=e.y,d=e.skewX?Math.tan(e.skewX):0,f=e.skewY?Math.tan(-e.skewY):0;if(n||r||o||s){var p=n+o,m=r+s;t[4]=-p*i-d*m*a,t[5]=-m*a-f*p*i}else t[4]=t[5]=0;return t[0]=i,t[3]=a,t[1]=f*i,t[2]=d*a,c&&jf(t,t,c),t[4]+=n+l,t[5]+=r+u,t},e.initDefaultProps=(function(){var t=e.prototype;t.scaleX=t.scaleY=t.globalScaleRatio=1,t.x=t.y=t.originX=t.originY=t.skewX=t.skewY=t.rotation=t.anchorX=t.anchorY=0})(),e}(),mm=pm.getLocalTransform;function hm(){return new pm}var gm=[`x`,`y`,`originX`,`originY`,`anchorX`,`anchorY`,`rotation`,`scaleX`,`scaleY`,`skewX`,`skewY`];function _m(e,t){return vl(e,t,gm)}var vm={linear:function(e){return e},quadraticIn:function(e){return e*e},quadraticOut:function(e){return e*(2-e)},quadraticInOut:function(e){return(e*=2)<1?.5*e*e:-.5*(--e*(e-2)-1)},cubicIn:function(e){return e*e*e},cubicOut:function(e){return--e*e*e+1},cubicInOut:function(e){return(e*=2)<1?.5*e*e*e:.5*((e-=2)*e*e+2)},quarticIn:function(e){return e*e*e*e},quarticOut:function(e){return 1- --e*e*e*e},quarticInOut:function(e){return(e*=2)<1?.5*e*e*e*e:-.5*((e-=2)*e*e*e-2)},quinticIn:function(e){return e*e*e*e*e},quinticOut:function(e){return--e*e*e*e*e+1},quinticInOut:function(e){return(e*=2)<1?.5*e*e*e*e*e:.5*((e-=2)*e*e*e*e+2)},sinusoidalIn:function(e){return 1-Math.cos(e*Math.PI/2)},sinusoidalOut:function(e){return Math.sin(e*Math.PI/2)},sinusoidalInOut:function(e){return .5*(1-Math.cos(Math.PI*e))},exponentialIn:function(e){return e===0?0:1024**(e-1)},exponentialOut:function(e){return e===1?1:1-2**(-10*e)},exponentialInOut:function(e){return e===0?0:e===1?1:(e*=2)<1?.5*1024**(e-1):.5*(-(2**(-10*(e-1)))+2)},circularIn:function(e){return 1-Math.sqrt(1-e*e)},circularOut:function(e){return Math.sqrt(1- --e*e)},circularInOut:function(e){return(e*=2)<1?-.5*(Math.sqrt(1-e*e)-1):.5*(Math.sqrt(1-(e-=2)*e)+1)},elasticIn:function(e){var t,n=.1,r=.4;return e===0?0:e===1?1:(!n||n<1?(n=1,t=r/4):t=r*Math.asin(1/n)/(2*Math.PI),-(n*2**(10*--e)*Math.sin((e-t)*(2*Math.PI)/r)))},elasticOut:function(e){var t,n=.1,r=.4;return e===0?0:e===1?1:(!n||n<1?(n=1,t=r/4):t=r*Math.asin(1/n)/(2*Math.PI),n*2**(-10*e)*Math.sin((e-t)*(2*Math.PI)/r)+1)},elasticInOut:function(e){var t,n=.1,r=.4;return e===0?0:e===1?1:(!n||n<1?(n=1,t=r/4):t=r*Math.asin(1/n)/(2*Math.PI),(e*=2)<1?-.5*(n*2**(10*--e)*Math.sin((e-t)*(2*Math.PI)/r)):n*2**(-10*--e)*Math.sin((e-t)*(2*Math.PI)/r)*.5+1)},backIn:function(e){var t=1.70158;return e*e*((t+1)*e-t)},backOut:function(e){var t=1.70158;return--e*e*((t+1)*e+t)+1},backInOut:function(e){var t=2.5949095;return(e*=2)<1?.5*(e*e*((t+1)*e-t)):.5*((e-=2)*e*((t+1)*e+t)+2)},bounceIn:function(e){return 1-vm.bounceOut(1-e)},bounceOut:function(e){return e<1/2.75?7.5625*e*e:e<2/2.75?7.5625*(e-=1.5/2.75)*e+.75:e<2.5/2.75?7.5625*(e-=2.25/2.75)*e+.9375:7.5625*(e-=2.625/2.75)*e+.984375},bounceInOut:function(e){return e<.5?vm.bounceIn(e*2)*.5:vm.bounceOut(e*2-1)*.5+.5}},ym=Math.pow,bm=Math.sqrt,xm=1e-8,Sm=1e-4,Cm=bm(3),wm=1/3,Tm=Pf(),Em=Pf(),Dm=Pf();function Om(e){return e>-xm&&exm||e<-xm}function Am(e,t,n,r,i){var a=1-i;return a*a*(a*e+3*i*t)+i*i*(i*r+3*a*n)}function jm(e,t,n,r,i){var a=1-i;return 3*(((t-e)*a+2*(n-t)*i)*a+(r-n)*i*i)}function Mm(e,t,n,r,i,a){var o=r+3*(t-n)-e,s=3*(n-t*2+e),c=3*(t-e),l=e-i,u=s*s-3*o*c,d=s*c-9*o*l,f=c*c-3*s*l,p=0;if(Om(u)&&Om(d)){if(Om(s))a[0]=0;else{var m=-c/s;m>=0&&m<=1&&(a[p++]=m)}}else{var h=d*d-4*u*f;if(Om(h)){var g=d/u,m=-s/o+g,_=-g/2;m>=0&&m<=1&&(a[p++]=m),_>=0&&_<=1&&(a[p++]=_)}else if(h>0){var v=bm(h),y=u*s+1.5*o*(-d+v),b=u*s+1.5*o*(-d-v);y=y<0?-ym(-y,wm):ym(y,wm),b=b<0?-ym(-b,wm):ym(b,wm);var m=(-s-(y+b))/(3*o);m>=0&&m<=1&&(a[p++]=m)}else{var x=(2*u*s-3*o*d)/(2*bm(u*u*u)),S=Math.acos(x)/3,C=bm(u),w=Math.cos(S),m=(-s-2*C*w)/(3*o),_=(-s+C*(w+Cm*Math.sin(S)))/(3*o),T=(-s+C*(w-Cm*Math.sin(S)))/(3*o);m>=0&&m<=1&&(a[p++]=m),_>=0&&_<=1&&(a[p++]=_),T>=0&&T<=1&&(a[p++]=T)}}return p}function Nm(e,t,n,r,i){var a=6*n-12*t+6*e,o=9*t+3*r-3*e-9*n,s=3*t-3*e,c=0;if(Om(o)){if(km(a)){var l=-s/a;l>=0&&l<=1&&(i[c++]=l)}}else{var u=a*a-4*o*s;if(Om(u))i[0]=-a/(2*o);else if(u>0){var d=bm(u),l=(-a+d)/(2*o),f=(-a-d)/(2*o);l>=0&&l<=1&&(i[c++]=l),f>=0&&f<=1&&(i[c++]=f)}}return c}function Pm(e,t,n,r,i,a){var o=(t-e)*i+e,s=(n-t)*i+t,c=(r-n)*i+n,l=(s-o)*i+o,u=(c-s)*i+s,d=(u-l)*i+l;a[0]=e,a[1]=o,a[2]=l,a[3]=d,a[4]=d,a[5]=u,a[6]=c,a[7]=r}function Fm(e,t,n,r,i,a,o,s,c,l,u){var d,f=.005,p=1/0,m,h,g,_;Tm[0]=c,Tm[1]=l;for(var v=0;v<1;v+=.05)Em[0]=Am(e,n,i,o,v),Em[1]=Am(t,r,a,s,v),g=qf(Tm,Em),g=0&&g=0&&l<=1&&(i[c++]=l)}}else{var u=o*o-4*a*s;if(Om(u)){var l=-o/(2*a);l>=0&&l<=1&&(i[c++]=l)}else if(u>0){var d=bm(u),l=(-o+d)/(2*a),f=(-o-d)/(2*a);l>=0&&l<=1&&(i[c++]=l),f>=0&&f<=1&&(i[c++]=f)}}return c}function Bm(e,t,n){var r=e+n-2*t;return r===0?.5:(e-t)/r}function Vm(e,t,n,r,i){var a=(t-e)*r+e,o=(n-t)*r+t,s=(o-a)*r+a;i[0]=e,i[1]=a,i[2]=s,i[3]=s,i[4]=o,i[5]=n}function Hm(e,t,n,r,i,a,o,s,c){var l,u=.005,d=1/0;Tm[0]=o,Tm[1]=s;for(var f=0;f<1;f+=.05){Em[0]=Lm(e,n,i,f),Em[1]=Lm(t,r,a,f);var p=qf(Tm,Em);p=0&&p=1?1:Mm(0,r,a,1,e,s)&&Am(0,i,o,1,s[0])}}}var Km=function(){function e(e){this._inited=!1,this._startTime=0,this._pausedTime=0,this._paused=!1,this._life=e.life||1e3,this._delay=e.delay||0,this.loop=e.loop||!1,this.onframe=e.onframe||ru,this.ondestroy=e.ondestroy||ru,this.onrestart=e.onrestart||ru,e.easing&&this.setEasing(e.easing)}return e.prototype.step=function(e,t){if(this._inited||=(this._startTime=e+this._delay,!0),this._paused){this._pausedTime+=t;return}var n=this._life,r=e-this._startTime-this._pausedTime,i=r/n;i<0&&(i=0),i=Math.min(i,1);var a=this.easingFunc,o=a?a(i):i;if(this.onframe(o),i===1){if(this.loop){var s=r%n;this._startTime=e-s,this._pausedTime=0,this.onrestart()}else return!0}return!1},e.prototype.pause=function(){this._paused=!0},e.prototype.resume=function(){this._paused=!1},e.prototype.setEasing=function(e){this.easing=e,this.easingFunc=Al(e)?e:vm[e]||Gm(e)},e}(),qm={transparent:[0,0,0,0],aliceblue:[240,248,255,1],antiquewhite:[250,235,215,1],aqua:[0,255,255,1],aquamarine:[127,255,212,1],azure:[240,255,255,1],beige:[245,245,220,1],bisque:[255,228,196,1],black:[0,0,0,1],blanchedalmond:[255,235,205,1],blue:[0,0,255,1],blueviolet:[138,43,226,1],brown:[165,42,42,1],burlywood:[222,184,135,1],cadetblue:[95,158,160,1],chartreuse:[127,255,0,1],chocolate:[210,105,30,1],coral:[255,127,80,1],cornflowerblue:[100,149,237,1],cornsilk:[255,248,220,1],crimson:[220,20,60,1],cyan:[0,255,255,1],darkblue:[0,0,139,1],darkcyan:[0,139,139,1],darkgoldenrod:[184,134,11,1],darkgray:[169,169,169,1],darkgreen:[0,100,0,1],darkgrey:[169,169,169,1],darkkhaki:[189,183,107,1],darkmagenta:[139,0,139,1],darkolivegreen:[85,107,47,1],darkorange:[255,140,0,1],darkorchid:[153,50,204,1],darkred:[139,0,0,1],darksalmon:[233,150,122,1],darkseagreen:[143,188,143,1],darkslateblue:[72,61,139,1],darkslategray:[47,79,79,1],darkslategrey:[47,79,79,1],darkturquoise:[0,206,209,1],darkviolet:[148,0,211,1],deeppink:[255,20,147,1],deepskyblue:[0,191,255,1],dimgray:[105,105,105,1],dimgrey:[105,105,105,1],dodgerblue:[30,144,255,1],firebrick:[178,34,34,1],floralwhite:[255,250,240,1],forestgreen:[34,139,34,1],fuchsia:[255,0,255,1],gainsboro:[220,220,220,1],ghostwhite:[248,248,255,1],gold:[255,215,0,1],goldenrod:[218,165,32,1],gray:[128,128,128,1],green:[0,128,0,1],greenyellow:[173,255,47,1],grey:[128,128,128,1],honeydew:[240,255,240,1],hotpink:[255,105,180,1],indianred:[205,92,92,1],indigo:[75,0,130,1],ivory:[255,255,240,1],khaki:[240,230,140,1],lavender:[230,230,250,1],lavenderblush:[255,240,245,1],lawngreen:[124,252,0,1],lemonchiffon:[255,250,205,1],lightblue:[173,216,230,1],lightcoral:[240,128,128,1],lightcyan:[224,255,255,1],lightgoldenrodyellow:[250,250,210,1],lightgray:[211,211,211,1],lightgreen:[144,238,144,1],lightgrey:[211,211,211,1],lightpink:[255,182,193,1],lightsalmon:[255,160,122,1],lightseagreen:[32,178,170,1],lightskyblue:[135,206,250,1],lightslategray:[119,136,153,1],lightslategrey:[119,136,153,1],lightsteelblue:[176,196,222,1],lightyellow:[255,255,224,1],lime:[0,255,0,1],limegreen:[50,205,50,1],linen:[250,240,230,1],magenta:[255,0,255,1],maroon:[128,0,0,1],mediumaquamarine:[102,205,170,1],mediumblue:[0,0,205,1],mediumorchid:[186,85,211,1],mediumpurple:[147,112,219,1],mediumseagreen:[60,179,113,1],mediumslateblue:[123,104,238,1],mediumspringgreen:[0,250,154,1],mediumturquoise:[72,209,204,1],mediumvioletred:[199,21,133,1],midnightblue:[25,25,112,1],mintcream:[245,255,250,1],mistyrose:[255,228,225,1],moccasin:[255,228,181,1],navajowhite:[255,222,173,1],navy:[0,0,128,1],oldlace:[253,245,230,1],olive:[128,128,0,1],olivedrab:[107,142,35,1],orange:[255,165,0,1],orangered:[255,69,0,1],orchid:[218,112,214,1],palegoldenrod:[238,232,170,1],palegreen:[152,251,152,1],paleturquoise:[175,238,238,1],palevioletred:[219,112,147,1],papayawhip:[255,239,213,1],peachpuff:[255,218,185,1],peru:[205,133,63,1],pink:[255,192,203,1],plum:[221,160,221,1],powderblue:[176,224,230,1],purple:[128,0,128,1],red:[255,0,0,1],rosybrown:[188,143,143,1],royalblue:[65,105,225,1],saddlebrown:[139,69,19,1],salmon:[250,128,114,1],sandybrown:[244,164,96,1],seagreen:[46,139,87,1],seashell:[255,245,238,1],sienna:[160,82,45,1],silver:[192,192,192,1],skyblue:[135,206,235,1],slateblue:[106,90,205,1],slategray:[112,128,144,1],slategrey:[112,128,144,1],snow:[255,250,250,1],springgreen:[0,255,127,1],steelblue:[70,130,180,1],tan:[210,180,140,1],teal:[0,128,128,1],thistle:[216,191,216,1],tomato:[255,99,71,1],turquoise:[64,224,208,1],violet:[238,130,238,1],wheat:[245,222,179,1],white:[255,255,255,1],whitesmoke:[245,245,245,1],yellow:[255,255,0,1],yellowgreen:[154,205,50,1]};function Jm(e){return e=Math.round(e),e<0?0:e>255?255:e}function Ym(e){return e=Math.round(e),e<0?0:e>360?360:e}function Xm(e){return e<0?0:e>1?1:e}function Zm(e){var t=e;return t.length&&t.charAt(t.length-1)===`%`?Jm(parseFloat(t)/100*255):Jm(parseInt(t,10))}function Qm(e){var t=e;return t.length&&t.charAt(t.length-1)===`%`?Xm(parseFloat(t)/100):Xm(parseFloat(t))}function $m(e,t,n){return n<0?n+=1:n>1&&--n,n*6<1?e+(t-e)*n*6:n*2<1?t:n*3<2?e+(t-e)*(2/3-n)*6:e}function eh(e,t,n){return e+(t-e)*n}function th(e,t,n,r,i){return e[0]=t,e[1]=n,e[2]=r,e[3]=i,e}function nh(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e}var rh=new bf(20),ih=null;function ah(e,t){ih&&nh(ih,t),ih=rh.put(e,ih||t.slice())}function oh(e,t){if(e){t||=[];var n=rh.get(e);if(n)return nh(t,n);e+=``;var r=e.replace(/ /g,``).toLowerCase();if(r in qm)return nh(t,qm[r]),ah(e,t),t;var i=r.length;if(r.charAt(0)===`#`){if(i===4||i===5){var a=parseInt(r.slice(1,4),16);if(!(a>=0&&a<=4095)){th(t,0,0,0,1);return}return th(t,(a&3840)>>4|(a&3840)>>8,a&240|(a&240)>>4,a&15|(a&15)<<4,i===5?parseInt(r.slice(4),16)/15:1),ah(e,t),t}if(i===7||i===9){var a=parseInt(r.slice(1,7),16);if(!(a>=0&&a<=16777215)){th(t,0,0,0,1);return}return th(t,(a&16711680)>>16,(a&65280)>>8,a&255,i===9?parseInt(r.slice(7),16)/255:1),ah(e,t),t}return}var o=r.indexOf(`(`),s=r.indexOf(`)`);if(o!==-1&&s+1===i){var c=r.substr(0,o),l=r.substr(o+1,s-(o+1)).split(`,`),u=1;switch(c){case`rgba`:if(l.length!==4)return l.length===3?th(t,+l[0],+l[1],+l[2],1):th(t,0,0,0,1);u=Qm(l.pop());case`rgb`:if(l.length>=3)return th(t,Zm(l[0]),Zm(l[1]),Zm(l[2]),l.length===3?u:Qm(l[3])),ah(e,t),t;th(t,0,0,0,1);return;case`hsla`:if(l.length!==4){th(t,0,0,0,1);return}return l[3]=Qm(l[3]),sh(l,t),ah(e,t),t;case`hsl`:if(l.length!==3){th(t,0,0,0,1);return}return sh(l,t),ah(e,t),t;default:return}}th(t,0,0,0,1)}}function sh(e,t){var n=(parseFloat(e[0])%360+360)%360/360,r=Qm(e[1]),i=Qm(e[2]),a=i<=.5?i*(r+1):i+r-i*r,o=i*2-a;return t||=[],th(t,Jm($m(o,a,n+1/3)*255),Jm($m(o,a,n)*255),Jm($m(o,a,n-1/3)*255),1),e.length===4&&(t[3]=e[3]),t}function ch(e){if(e){var t=e[0]/255,n=e[1]/255,r=e[2]/255,i=Math.min(t,n,r),a=Math.max(t,n,r),o=a-i,s=(a+i)/2,c,l;if(o===0)c=0,l=0;else{l=s<.5?o/(a+i):o/(2-a-i);var u=((a-t)/6+o/2)/o,d=((a-n)/6+o/2)/o,f=((a-r)/6+o/2)/o;t===a?c=f-d:n===a?c=1/3+u-f:r===a&&(c=2/3+d-u),c<0&&(c+=1),c>1&&--c}var p=[c*360,l,s];return e[3]!=null&&p.push(e[3]),p}}function lh(e,t){var n=oh(e);if(n){for(var r=0;r<3;r++)t<0?n[r]=n[r]*(1-t)|0:n[r]=(255-n[r])*t+n[r]|0,n[r]>255?n[r]=255:n[r]<0&&(n[r]=0);return mh(n,n.length===4?`rgba`:`rgb`)}}function uh(e,t,n){if(t&&t.length&&e>=0&&e<=1){n||=[];var r=e*(t.length-1),i=Math.floor(r),a=Math.ceil(r),o=t[i],s=t[a],c=r-i;return n[0]=Jm(eh(o[0],s[0],c)),n[1]=Jm(eh(o[1],s[1],c)),n[2]=Jm(eh(o[2],s[2],c)),n[3]=Xm(eh(o[3],s[3],c)),n}}function dh(e,t,n){if(t&&t.length&&e>=0&&e<=1){var r=e*(t.length-1),i=Math.floor(r),a=Math.ceil(r),o=oh(t[i]),s=oh(t[a]),c=r-i,l=mh([Jm(eh(o[0],s[0],c)),Jm(eh(o[1],s[1],c)),Jm(eh(o[2],s[2],c)),Xm(eh(o[3],s[3],c))],`rgba`);return n?{color:l,leftIndex:i,rightIndex:a,value:r}:l}}function fh(e,t,n,r){var i=oh(e);if(e)return i=ch(i),t!=null&&(i[0]=Ym(Al(t)?t(i[0]):t)),n!=null&&(i[1]=Qm(Al(n)?n(i[1]):n)),r!=null&&(i[2]=Qm(Al(r)?r(i[2]):r)),mh(sh(i),`rgba`)}function ph(e,t){var n=oh(e);if(n&&t!=null)return n[3]=Xm(t),mh(n,`rgba`)}function mh(e,t){if(e&&e.length){var n=e[0]+`,`+e[1]+`,`+e[2];return(t===`rgba`||t===`hsva`||t===`hsla`)&&(n+=`,`+e[3]),t+`(`+n+`)`}}function hh(e,t){var n=oh(e);return n?(.299*n[0]+.587*n[1]+.114*n[2])*n[3]/255+(1-n[3])*t:0}var gh=new bf(100);function _h(e){if(Y(e)){var t=gh.get(e);return t||(t=lh(e,-.1),gh.put(e,t)),t}if(Ll(e)){var n=W({},e);return n.colorStops=K(e.colorStops,function(e){return{offset:e.offset,color:lh(e.color,-.1)}}),n}return e}function vh(e){return e.type===`linear`}function yh(e){return e.type===`radial`}(function(){return typeof Buffer<`u`&&typeof Buffer.from==`function`?function(e){return Buffer.from(e).toString(`base64`)}:typeof btoa==`function`&&typeof unescape==`function`&&typeof encodeURIComponent==`function`?function(e){return btoa(unescape(encodeURIComponent(e)))}:function(e){return null}})();var bh=Array.prototype.slice;function xh(e,t,n){return(t-e)*n+e}function Sh(e,t,n,r){for(var i=t.length,a=0;ar?t:e,a=Math.min(n,r),o=i[a-1]||{color:[0,0,0,0],offset:0},s=a;so)r.length=o;else for(var s=a;s=1},e.prototype.getAdditiveTrack=function(){return this._additiveTrack},e.prototype.addKeyframe=function(e,t,n){this._needsSort=!0;var r=this.keyframes,i=r.length,a=!1,o=Lh,s=t;if(Cl(t)){var c=Ah(t);o=c,(c===1&&!Ml(t[0])||c===2&&!Ml(t[0][0]))&&(a=!0)}else if(Ml(t)&&!zl(t))o=jh;else if(Y(t)){if(!isNaN(+t))o=jh;else{var l=oh(t);l&&(s=l,o=Ph)}}else if(Ll(t)){var u=W({},s);u.colorStops=K(t.colorStops,function(e){return{offset:e.offset,color:oh(e.color)}}),vh(t)?o=Fh:yh(t)&&(o=Ih),s=u}i===0?this.valType=o:(o!==this.valType||o===Lh)&&(a=!0),this.discrete=this.discrete||a;var d={time:e,value:s,rawValue:t,percent:0};return n&&(d.easing=n,d.easingFunc=Al(n)?n:vm[n]||Gm(n)),r.push(d),d},e.prototype.prepare=function(e,t){var n=this.keyframes;this._needsSort&&n.sort(function(e,t){return e.time-t.time});for(var r=this.valType,i=n.length,a=n[i-1],o=this.discrete,s=zh(r),c=Rh(r),l=0;l=0&&!(a[l].percent<=t);l--);l=d(l,o-2)}else{for(l=u;lt);l++);l=d(l-1,o-2)}p=a[l+1],f=a[l]}if(f&&p){this._lastFr=l,this._lastFrP=t;var m=p.percent-f.percent,h=m===0?1:d((t-f.percent)/m,1);p.easingFunc&&(h=p.easingFunc(h));var g=n?this._additiveValue:c?Bh:e[s];if((zh(i)||c)&&!g&&(g=this._additiveValue=[]),this.discrete)e[s]=h<1?f.rawValue:p.rawValue;else if(zh(i))i===Mh?Sh(g,f[r],p[r],h):Ch(g,f[r],p[r],h);else if(Rh(i)){var _=f[r],v=p[r],y=i===Fh;e[s]={type:y?`linear`:`radial`,x:xh(_.x,v.x,h),y:xh(_.y,v.y,h),colorStops:K(_.colorStops,function(e,t){var n=v.colorStops[t];return{offset:xh(e.offset,n.offset,h),color:kh(Sh([],e.color,n.color,h))}}),global:v.global},y?(e[s].x2=xh(_.x2,v.x2,h),e[s].y2=xh(_.y2,v.y2,h)):e[s].r=xh(_.r,v.r,h)}else if(c)Sh(g,f[r],p[r],h),n||(e[s]=kh(g));else{var b=xh(f[r],p[r],h);n?this._additiveValue=b:e[s]=b}n&&this._addToTarget(e)}}},e.prototype._addToTarget=function(e){var t=this.valType,n=this.propName,r=this._additiveValue;t===jh?e[n]=e[n]+r:t===Ph?(oh(e[n],Bh),wh(Bh,Bh,r,1),e[n]=kh(Bh)):t===Mh?wh(e[n],e[n],r,1):t===Nh&&Th(e[n],e[n],r,1)},e}(),Hh=function(){function e(e,t,n,r){if(this._tracks={},this._trackKeys=[],this._maxTime=0,this._started=0,this._clip=null,this._target=e,this._loop=t,t&&r){ml(`Can' use additive animation on looped animation.`);return}this._additiveAnimators=r,this._allowDiscrete=n}return e.prototype.getMaxTime=function(){return this._maxTime},e.prototype.getDelay=function(){return this._delay},e.prototype.getLoop=function(){return this._loop},e.prototype.getTarget=function(){return this._target},e.prototype.changeTarget=function(e){this._target=e},e.prototype.when=function(e,t,n){return this.whenWithKeys(e,t,Dl(t),n)},e.prototype.whenWithKeys=function(e,t,n,r){for(var i=this._tracks,a=0;a0&&s.addKeyframe(0,Oh(c),r),this._trackKeys.push(o)}s.addKeyframe(e,Oh(t[o]),r)}return this._maxTime=Math.max(this._maxTime,e),this},e.prototype.pause=function(){this._clip.pause(),this._paused=!0},e.prototype.resume=function(){this._clip.resume(),this._paused=!1},e.prototype.isPaused=function(){return!!this._paused},e.prototype.duration=function(e){return this._maxTime=e,this._force=!0,this},e.prototype._doneCallback=function(){this._setTracksFinished(),this._clip=null;var e=this._doneCbs;if(e)for(var t=e.length,n=0;n0)){this._started=1;for(var t=this,n=[],r=this._maxTime||0,i=0;i1){var o=a.pop();i.addKeyframe(o.time,e[r]),i.prepare(this._maxTime,i.getAdditiveTrack())}}}},e}(),Uh=function(){function e(e){e&&(this._$eventProcessor=e)}return e.prototype.on=function(e,t,n,r){this._$handlers||={};var i=this._$handlers;if(typeof t==`function`&&(r=n,n=t,t=null),!n||!e)return this;var a=this._$eventProcessor;t!=null&&a&&a.normalizeQuery&&(t=a.normalizeQuery(t)),i[e]||(i[e]=[]);for(var o=0;o=0:n.inside,y=void 0,b=void 0,x=void 0;v&&this.canBeInsideText()?(y=n.insideFill,b=n.insideStroke,(y==null||y===`auto`)&&(y=this.getInsideTextFill()),(b==null||b===`auto`)&&(b=this.getInsideTextStroke(y),x=!0)):(y=n.outsideFill,b=n.outsideStroke,(y==null||y===`auto`)&&(y=this.getOutsideFill()),(b==null||b===`auto`)&&(b=this.getOutsideStroke(y),x=!0)),y||=`#000`,(y!==g.fill||b!==g.stroke||x!==g.autoStroke||a!==g.align||o!==g.verticalAlign)&&(s=!0,g.fill=y,g.stroke=b,g.autoStroke=x,g.align=a,g.verticalAlign=o,t.setDefaultTextStyle(g)),t.__dirty|=1,s&&t.dirtyStyle(!0)}},e.prototype.canBeInsideText=function(){return!0},e.prototype.getInsideTextFill=function(){return`#fff`},e.prototype.getInsideTextStroke=function(e){return`#000`},e.prototype.getOutsideFill=function(){return this.__zr&&this.__zr.isDarkMode()?Jh:qh},e.prototype.getOutsideStroke=function(e){var t=this.__zr&&this.__zr.getBackgroundColor(),n=typeof t==`string`&&oh(t);n||=[255,255,255,1];for(var r=n[3],i=this.__zr.isDarkMode(),a=0;a<3;a++)n[a]=n[a]*r+(i?0:255)*(1-r);return n[3]=1,mh(n,`rgba`)},e.prototype.traverse=function(e,t){},e.prototype.attrKV=function(e,t){e===`textConfig`?this.setTextConfig(t):e===`textContent`?this.setTextContent(t):e===`clipPath`?this.setClipPath(t):e===`extra`?(this.extra=this.extra||{},W(this.extra,t)):this[e]=t},e.prototype.hide=function(){this.ignore=!0,this.markRedraw()},e.prototype.show=function(){this.ignore=!1,this.markRedraw()},e.prototype.attr=function(e,t){if(typeof e==`string`)this.attrKV(e,t);else if(Nl(e))for(var n=Dl(e),r=0;r0},e.prototype.getState=function(e){return this.states[e]},e.prototype.ensureState=function(e){var t=this.states;return t[e]||(t[e]={}),t[e]},e.prototype.clearStates=function(e){this.useState(Xh,!1,e)},e.prototype.useState=function(e,t,n,r){var i=e===Xh;if(this.hasState()||!i){var a=this.currentStates,o=this.stateTransition;if(!(bl(a,e)>=0&&(t||a.length===1))){var s;if(this.stateProxy&&!i&&(s=this.stateProxy(e)),s||=this.states&&this.states[e],!s&&!i){ml(`State `+e+` not exists.`);return}i||this.saveCurrentToNormalState(s);var c=this._textContent,l=ug(this,c,s,r);l&&!this.__inHover&&(this.__inHover=l),this._applyStateObj(e,s,this._normalState,t,fg(this,n,o),o);var u=this._textGuide;return c&&c.useState(e,t,n,!!l),u&&u.useState(e,t,n,!!l),i?(this.currentStates=[],this._normalState={}):t?this.currentStates.push(e):this.currentStates=[e],this._updateAnimationTargets(),this.markRedraw(),!l&&this.__inHover&&(this.__inHover=0,this.__dirty&=-2),s}}},e.prototype.useStates=function(e,t,n){if(!e.length)this.clearStates();else{var r=[],i=this.currentStates,a=e.length,o=a===i.length;if(o){for(var s=0;s=0){var n=this.currentStates.slice();n.splice(t,1),this.useStates(n)}},e.prototype.replaceState=function(e,t,n){var r=this.currentStates.slice(),i=bl(r,e),a=bl(r,t)>=0;i>=0?a?r.splice(i,1):r[i]=t:n&&!a&&r.push(t),this.useStates(r)},e.prototype.toggleState=function(e,t){t?this.useState(e,!0):this.removeState(e)},e.prototype._mergeStates=function(e){for(var t={},n,r=0;r=0&&t.splice(n,1)}),this.animators.push(e),n&&n.animation.addAnimator(e),n&&n.wakeUp()},e.prototype.updateDuringAnimation=function(e){this.markRedraw()},e.prototype.stopAnimation=function(e,t){for(var n=this.animators,r=n.length,i=[],a=0;a0&&n.during&&a[0].during(function(e,t){n.during(t)});for(var f=0;f0||i.force&&!o.length){var C=void 0,w=void 0,T=void 0;if(s){w={},f&&(C={});for(var b=0;b0}var pg=`__zr_style_`+Math.round(Math.random()*10),mg={shadowBlur:0,shadowOffsetX:0,shadowOffsetY:0,shadowColor:`#000`,opacity:1,blend:`source-over`},hg={style:{shadowBlur:!0,shadowOffsetX:!0,shadowOffsetY:!0,shadowColor:!0,opacity:!0}};mg[pg]=!0;var gg=[`z`,`z2`,`invisible`],_g=[`invisible`],vg=function(e){U(t,e);function t(t){return e.call(this,t)||this}return t.prototype._init=function(t){for(var n=Dl(t),r=0;r1e-4){s[0]=e-n,s[1]=t-r,c[0]=e+n,c[1]=t+r;return}if(Dg[0]=Tg(i)*n+e,Dg[1]=wg(i)*r+t,Og[0]=Tg(a)*n+e,Og[1]=wg(a)*r+t,l(s,Dg,Og),u(c,Dg,Og),i%=Eg,i<0&&(i+=Eg),a%=Eg,a<0&&(a+=Eg),i>a&&!o?a+=Eg:ii&&(kg[0]=Tg(p)*n+e,kg[1]=wg(p)*r+t,l(s,kg,s),u(c,kg,c))}var Ig={M:1,L:2,C:3,Q:4,A:5,Z:6,R:7},Lg=[],Rg=[],zg=[],Bg=[],Vg=[],Hg=[],Ug=Math.min,Wg=Math.max,Gg=Math.cos,Kg=Math.sin,qg=Math.abs,Jg=Math.PI,Yg=Jg*2,Xg=typeof Float32Array<`u`,Zg=[];function Qg(e){return Math.round(e/Jg*1e8)/1e8%2*Jg}function $g(e,t){var n=Qg(e[0]);n<0&&(n+=Yg);var r=n-e[0],i=e[1];i+=r,!t&&i-n>=Yg?i=n+Yg:t&&n-i>=Yg?i=n-Yg:!t&&n>i?i=n+(Yg-Qg(n-i)):t&&n0&&(this._ux=qg(n/Gh/e)||0,this._uy=qg(n/Gh/t)||0)},e.prototype.setDPR=function(e){this.dpr=e},e.prototype.setContext=function(e){this._ctx=e},e.prototype.getContext=function(){return this._ctx},e.prototype.beginPath=function(){return this._ctx&&this._ctx.beginPath(),this.reset(),this},e.prototype.reset=function(){this._saveData&&(this._len=0),this._pathSegLen&&(this._pathSegLen=null,this._pathLen=0),this._version++},e.prototype.moveTo=function(e,t){return this._drawPendingPt(),this.addData(Ig.M,e,t),this._ctx&&this._ctx.moveTo(e,t),this._x0=e,this._y0=t,this._xi=e,this._yi=t,this},e.prototype.lineTo=function(e,t){var n=qg(e-this._xi),r=qg(t-this._yi),i=n>this._ux||r>this._uy;if(this.addData(Ig.L,e,t),this._ctx&&i&&this._ctx.lineTo(e,t),i)this._xi=e,this._yi=t,this._pendingPtDist=0;else{var a=n*n+r*r;a>this._pendingPtDist&&(this._pendingPtX=e,this._pendingPtY=t,this._pendingPtDist=a)}return this},e.prototype.bezierCurveTo=function(e,t,n,r,i,a){return this._drawPendingPt(),this.addData(Ig.C,e,t,n,r,i,a),this._ctx&&this._ctx.bezierCurveTo(e,t,n,r,i,a),this._xi=i,this._yi=a,this},e.prototype.quadraticCurveTo=function(e,t,n,r){return this._drawPendingPt(),this.addData(Ig.Q,e,t,n,r),this._ctx&&this._ctx.quadraticCurveTo(e,t,n,r),this._xi=n,this._yi=r,this},e.prototype.arc=function(e,t,n,r,i,a){this._drawPendingPt(),Zg[0]=r,Zg[1]=i,$g(Zg,a),r=Zg[0],i=Zg[1];var o=i-r;return this.addData(Ig.A,e,t,n,n,r,o,0,+!a),this._ctx&&this._ctx.arc(e,t,n,r,i,a),this._xi=Gg(i)*n+e,this._yi=Kg(i)*n+t,this},e.prototype.arcTo=function(e,t,n,r,i){return this._drawPendingPt(),this._ctx&&this._ctx.arcTo(e,t,n,r,i),this},e.prototype.rect=function(e,t,n,r){return this._drawPendingPt(),this._ctx&&this._ctx.rect(e,t,n,r),this.addData(Ig.R,e,t,n,r),this},e.prototype.closePath=function(){this._drawPendingPt(),this.addData(Ig.Z);var e=this._ctx,t=this._x0,n=this._y0;return e&&e.closePath(),this._xi=t,this._yi=n,this},e.prototype.fill=function(e){e&&e.fill(),this.toStatic()},e.prototype.stroke=function(e){e&&e.stroke(),this.toStatic()},e.prototype.len=function(){return this._len},e.prototype.setData=function(e){if(this._saveData){var t=e.length;!(this.data&&this.data.length===t)&&Xg&&(this.data=new Float32Array(t));for(var n=0;n0&&a))for(var o=0;ol.length&&(this._expandData(),l=this.data);for(var u=0;u0&&(this._ctx&&this._ctx.lineTo(this._pendingPtX,this._pendingPtY),this._pendingPtDist=0)},e.prototype._expandData=function(){if(!(this.data instanceof Array)){for(var e=[],t=0;t11&&(this.data=new Float32Array(e)))}},e.prototype.getBoundingRect=function(){zg[0]=zg[1]=Vg[0]=Vg[1]=Number.MAX_VALUE,Bg[0]=Bg[1]=Hg[0]=Hg[1]=-Number.MAX_VALUE;for(var e=this.data,t=0,n=0,r=0,i=0,a=0;an||qg(v)>r||d===t-1)&&(m=Math.sqrt(_*_+v*v),i=h,a=g);break;case Ig.C:var y=e[d++],b=e[d++],h=e[d++],g=e[d++],x=e[d++],S=e[d++];m=Im(i,a,y,b,h,g,x,S,10),i=x,a=S;break;case Ig.Q:var y=e[d++],b=e[d++],h=e[d++],g=e[d++];m=Um(i,a,y,b,h,g,10),i=h,a=g;break;case Ig.A:var C=e[d++],w=e[d++],T=e[d++],E=e[d++],D=e[d++],O=e[d++],k=O+D;d+=1,p&&(o=Gg(D)*T+C,s=Kg(D)*E+w),m=Wg(T,E)*Ug(Yg,Math.abs(O)),i=Gg(k)*T+C,a=Kg(k)*E+w;break;case Ig.R:o=i=e[d++],s=a=e[d++];var A=e[d++],j=e[d++];m=A*2+j*2;break;case Ig.Z:var _=o-i,v=s-a;m=Math.sqrt(_*_+v*v),i=o,a=s}m>=0&&(c[u++]=m,l+=m)}return this._pathLen=l,l},e.prototype.rebuildPath=function(e,t){var n=this.data,r=this._ux,i=this._uy,a=this._len,o,s,c,l,u,d,f=t<1,p,m,h=0,g=0,_,v=0,y,b;if(!(f&&(this._pathSegLen||this._calculateLength(),p=this._pathSegLen,m=this._pathLen,_=t*m,!_)))lo:for(var x=0;x0&&(e.lineTo(y,b),v=0),S){case Ig.M:o=c=n[x++],s=l=n[x++],e.moveTo(c,l);break;case Ig.L:u=n[x++],d=n[x++];var w=qg(u-c),T=qg(d-l);if(w>r||T>i){if(f){var E=p[g++];if(h+E>_){var D=(_-h)/E;e.lineTo(c*(1-D)+u*D,l*(1-D)+d*D);break lo}h+=E}e.lineTo(u,d),c=u,l=d,v=0}else{var O=w*w+T*T;O>v&&(y=u,b=d,v=O)}break;case Ig.C:var k=n[x++],A=n[x++],j=n[x++],M=n[x++],N=n[x++],P=n[x++];if(f){var E=p[g++];if(h+E>_){var D=(_-h)/E;Pm(c,k,j,N,D,Lg),Pm(l,A,M,P,D,Rg),e.bezierCurveTo(Lg[1],Rg[1],Lg[2],Rg[2],Lg[3],Rg[3]);break lo}h+=E}e.bezierCurveTo(k,A,j,M,N,P),c=N,l=P;break;case Ig.Q:var k=n[x++],A=n[x++],j=n[x++],M=n[x++];if(f){var E=p[g++];if(h+E>_){var D=(_-h)/E;Vm(c,k,j,D,Lg),Vm(l,A,M,D,Rg),e.quadraticCurveTo(Lg[1],Rg[1],Lg[2],Rg[2]);break lo}h+=E}e.quadraticCurveTo(k,A,j,M),c=j,l=M;break;case Ig.A:var F=n[x++],I=n[x++],L=n[x++],ee=n[x++],R=n[x++],te=n[x++],ne=n[x++],re=!n[x++],ie=L>ee?L:ee,z=qg(L-ee)>.001,ae=R+te,B=!1;if(f){var E=p[g++];h+E>_&&(ae=R+te*(_-h)/E,B=!0),h+=E}if(z&&e.ellipse?e.ellipse(F,I,L,ee,ne,R,ae,re):e.arc(F,I,ie,R,ae,re),B)break lo;C&&(o=Gg(R)*L+F,s=Kg(R)*ee+I),c=Gg(ae)*L+F,l=Kg(ae)*ee+I;break;case Ig.R:o=c=n[x],s=l=n[x+1],u=n[x++],d=n[x++];var oe=n[x++],se=n[x++];if(f){var E=p[g++];if(h+E>_){var ce=_-h;e.moveTo(u,d),e.lineTo(u+Ug(ce,oe),d),ce-=oe,ce>0&&e.lineTo(u+oe,d+Ug(ce,se)),ce-=se,ce>0&&e.lineTo(u+Wg(oe-ce,0),d+se),ce-=oe,ce>0&&e.lineTo(u,d+Wg(se-ce,0));break lo}h+=E}e.rect(u,d,oe,se);break;case Ig.Z:if(f){var E=p[g++];if(h+E>_){var D=(_-h)/E;e.lineTo(c*(1-D)+o*D,l*(1-D)+s*D);break lo}h+=E}e.closePath(),c=o,l=s}}},e.prototype.clone=function(){var t=new e,n=this.data;return t.data=n.slice?n.slice():Array.prototype.slice.call(n),t._len=this._len,t},e.prototype.canSave=function(){return!!this._saveData},e.CMD=Ig,e.initDefaultProps=(function(){var t=e.prototype;t._saveData=!0,t._ux=0,t._uy=0,t._pendingPtDist=0,t._version=0})(),e}();function t_(e,t,n,r,i,a,o){if(i===0)return!1;var s=i,c=0,l=e;if(o>t+s&&o>r+s||oe+s&&a>n+s||at+d&&u>r+d&&u>a+d&&u>s+d||ue+d&&l>n+d&&l>i+d&&l>o+d||lt+l&&c>r+l&&c>a+l||ce+l&&s>n+l&&s>i+l||sn||u+li&&(i+=o_);var f=Math.atan2(c,s);return f<0&&(f+=o_),f>=r&&f<=i||f+o_>=r&&f+o_<=i}function c_(e,t,n,r,i,a){if(a>t&&a>r||ai?s:0}var l_=e_.CMD,u_=Math.PI*2,d_=1e-4;function f_(e,t){return Math.abs(e-t)t&&l>r&&l>a&&l>s||l1&&h_(),p=Am(t,r,a,s,m_[0]),f>1&&(m=Am(t,r,a,s,m_[1]))),f===2?gt&&s>r&&s>a||s=0&&l<=1){for(var u=0,d=Lm(t,r,a,l),f=0;fn||s<-n)return 0;var c=Math.sqrt(n*n-s*s);p_[0]=-c,p_[1]=c;var l=Math.abs(r-i);if(l<1e-4)return 0;if(l>=u_-1e-4){r=0,i=u_;var u=a?1:-1;return o>=p_[0]+e&&o<=p_[1]+e?u:0}if(r>i){var d=r;r=i,i=d}r<0&&(r+=u_,i+=u_);for(var f=0,p=0;p<2;p++){var m=p_[p];if(m+e>o){var h=Math.atan2(s,m),u=a?1:-1;h<0&&(h=u_+h),(h>=r&&h<=i||h+u_>=r&&h+u_<=i)&&(h>Math.PI/2&&h1&&(n||(s+=c_(c,l,u,d,r,i))),g&&(c=a[m],l=a[m+1],u=c,d=l),h){case l_.M:u=a[m++],d=a[m++],c=u,l=d;break;case l_.L:if(n){if(t_(c,l,a[m],a[m+1],t,r,i))return!0}else s+=c_(c,l,a[m],a[m+1],r,i)||0;c=a[m++],l=a[m++];break;case l_.C:if(n){if(n_(c,l,a[m++],a[m++],a[m++],a[m++],a[m],a[m+1],t,r,i))return!0}else s+=g_(c,l,a[m++],a[m++],a[m++],a[m++],a[m],a[m+1],r,i)||0;c=a[m++],l=a[m++];break;case l_.Q:if(n){if(r_(c,l,a[m++],a[m++],a[m],a[m+1],t,r,i))return!0}else s+=__(c,l,a[m++],a[m++],a[m],a[m+1],r,i)||0;c=a[m++],l=a[m++];break;case l_.A:var _=a[m++],v=a[m++],y=a[m++],b=a[m++],x=a[m++],S=a[m++];m+=1;var C=!!(1-a[m++]);f=Math.cos(x)*y+_,p=Math.sin(x)*b+v,g?(u=f,d=p):s+=c_(c,l,f,p,r,i);var w=(r-_)*b/y+_;if(n){if(s_(_,v,b,x,x+S,C,t,w,i))return!0}else s+=v_(_,v,b,x,x+S,C,w,i);c=Math.cos(x+S)*y+_,l=Math.sin(x+S)*b+v;break;case l_.R:u=c=a[m++],d=l=a[m++];var T=a[m++],E=a[m++];if(f=u+T,p=d+E,n){if(t_(u,d,f,d,t,r,i)||t_(f,d,f,p,t,r,i)||t_(f,p,u,p,t,r,i)||t_(u,p,u,d,t,r,i))return!0}else s+=c_(f,d,f,p,r,i),s+=c_(u,p,u,d,r,i);break;case l_.Z:if(n){if(t_(c,l,u,d,t,r,i))return!0}else s+=c_(c,l,u,d,r,i);c=u,l=d}}return!n&&!f_(l,d)&&(s+=c_(c,l,u,d,r,i)||0),s!==0}function b_(e,t,n){return y_(e,0,!1,t,n)}function x_(e,t,n,r){return y_(e,t,!0,n,r)}var S_=yl({fill:`#000`,stroke:null,strokePercent:1,fillOpacity:1,strokeOpacity:1,lineDashOffset:0,lineWidth:1,lineCap:`butt`,miterLimit:10,strokeNoScale:!1,strokeFirst:!1},mg),C_={style:yl({fill:!0,stroke:!0,strokePercent:!0,fillOpacity:!0,strokeOpacity:!0,lineDashOffset:!0,lineWidth:!0,miterLimit:!0},hg.style)},w_=gm.concat([`invisible`,`culling`,`z`,`z2`,`zlevel`,`parent`]),T_=function(e){U(t,e);function t(t){return e.call(this,t)||this}return t.prototype.update=function(){var n=this;e.prototype.update.call(this);var r=this.style;if(r.decal){var i=this._decalEl=this._decalEl||new t;i.buildPath===t.prototype.buildPath&&(i.buildPath=function(e){n.buildPath(e,n.shape)}),i.silent=!0;var a=i.style;for(var o in r)a[o]!==r[o]&&(a[o]=r[o]);a.fill=r.fill?r.decal:null,a.decal=null,a.shadowColor=null,r.strokeFirst&&(a.stroke=null);for(var s=0;s.5?qh:t>.2?Yh:Jh}if(e)return Jh}return qh},t.prototype.getInsideTextStroke=function(e){var t=this.style.fill;if(Y(t)){var n=this.__zr;if(!!(n&&n.isDarkMode())==hh(e,0)<.4)return t}},t.prototype.buildPath=function(e,t,n){},t.prototype.pathUpdated=function(){this.__dirty&=-5},t.prototype.getUpdatedPathProxy=function(e){return!this.path&&this.createPathProxy(),this.path.beginPath(),this.buildPath(this.path,this.shape,e),this.path},t.prototype.createPathProxy=function(){this.path=new e_(!1)},t.prototype.hasStroke=function(){var e=this.style,t=e.stroke;return!(t==null||t===`none`||!(e.lineWidth>0))},t.prototype.hasFill=function(){var e=this.style.fill;return e!=null&&e!==`none`},t.prototype.getBoundingRect=function(){var e=this._rect,t=this.style,n=!e;if(n){var r=!1;this.path||(r=!0,this.createPathProxy());var i=this.path;(r||this.__dirty&4)&&(i.beginPath(),this.buildPath(i,this.shape,!1),this.pathUpdated()),e=i.getBoundingRect()}if(this._rect=e,this.hasStroke()&&this.path&&this.path.len()>0){var a=this._rectStroke||=e.clone();if(this.__dirty||n){a.copy(e);var o=t.strokeNoScale?this.getLineScale():1,s=t.lineWidth;if(!this.hasFill()){var c=this.strokeContainThreshold;s=Math.max(s,c??4)}o>1e-10&&(a.width+=s/o,a.height+=s/o,a.x-=s/o/2,a.y-=s/o/2)}return a}return e},t.prototype.contain=function(e,t){var n=this.transformCoordToLocal(e,t),r=this.getBoundingRect(),i=this.style;if(e=n[0],t=n[1],r.contain(e,t)){var a=this.path;if(this.hasStroke()){var o=i.lineWidth,s=i.strokeNoScale?this.getLineScale():1;if(s>1e-10&&(this.hasFill()||(o=Math.max(o,this.strokeContainThreshold)),x_(a,o/s,e,t)))return!0}if(this.hasFill())return b_(a,e,t)}return!1},t.prototype.dirtyShape=function(){this.__dirty|=4,this._rect&&=null,this._decalEl&&this._decalEl.dirtyShape(),this.markRedraw()},t.prototype.dirty=function(){this.dirtyStyle(),this.dirtyShape()},t.prototype.animateShape=function(e){return this.animate(`shape`,e)},t.prototype.updateDuringAnimation=function(e){e===`style`?this.dirtyStyle():e===`shape`?this.dirtyShape():this.markRedraw()},t.prototype.attrKV=function(t,n){t===`shape`?this.setShape(n):e.prototype.attrKV.call(this,t,n)},t.prototype.setShape=function(e,t){var n=this.shape;return n||=this.shape={},typeof e==`string`?n[e]=t:W(n,e),this.dirtyShape(),this},t.prototype.shapeChanged=function(){return!!(this.__dirty&4)},t.prototype.createStyle=function(e){return tu(S_,e)},t.prototype._innerSaveToNormal=function(t){e.prototype._innerSaveToNormal.call(this,t);var n=this._normalState;t.shape&&!n.shape&&(n.shape=W({},this.shape))},t.prototype._applyStateObj=function(t,n,r,i,a,o){if(e.prototype._applyStateObj.call(this,t,n,r,i,a,o),this.__inHover!==1){var s=!(n&&i),c;if(n&&n.shape?a?i?c=n.shape:(c=W({},r.shape),W(c,n.shape)):(c=W({},i?this.shape:r.shape),W(c,n.shape)):s&&(c=r.shape),c){if(a){this.shape=W({},this.shape);for(var l={},u=Dl(c),d=0;di&&(d=s+c,s*=i/d,c*=i/d),l+u>i&&(d=l+u,l*=i/d,u*=i/d),c+l>a&&(d=c+l,c*=a/d,l*=a/d),s+u>a&&(d=s+u,s*=a/d,u*=a/d),e.moveTo(n+s,r),e.lineTo(n+i-c,r),c!==0&&e.arc(n+i-c,r+c,c,-Math.PI/2,0),e.lineTo(n+i,r+a-l),l!==0&&e.arc(n+i-l,r+a-l,l,0,Math.PI/2),e.lineTo(n+u,r+a),u!==0&&e.arc(n+u,r+a-u,u,Math.PI/2,Math.PI),e.lineTo(n,r+s),s!==0&&e.arc(n+s,r+s,s,Math.PI,Math.PI*1.5),e.closePath()}var N_=Math.round;function P_(e,t,n){if(t){var r=t.x1,i=t.x2,a=t.y1,o=t.y2;e.x1=r,e.x2=i,e.y1=a,e.y2=o;var s=n&&n.lineWidth;return s?(N_(r*2)===N_(i*2)&&(e.x1=e.x2=I_(r,s,!0)),N_(a*2)===N_(o*2)&&(e.y1=e.y2=I_(a,s,!0)),e):e}}function F_(e,t,n){if(t){var r=t.x,i=t.y,a=t.width,o=t.height;e.x=r,e.y=i,e.width=a,e.height=o;var s=n&&n.lineWidth;return s?(e.x=I_(r,s,!0),e.y=I_(i,s,!0),e.width=Math.max(I_(r+a,s,!1)-e.x,a===0?0:1),e.height=Math.max(I_(i+o,s,!1)-e.y,o===0?0:1),e):e}}function I_(e,t,n){if(!t)return e;var r=N_(e*2);return(r+N_(t))%2==0?r/2:(r+(n?1:-1))/2}var L_=function(){function e(){this.x=0,this.y=0,this.width=0,this.height=0}return e}(),R_={},z_=function(e){U(t,e);function t(t){return e.call(this,t)||this}return t.prototype.getDefaultShape=function(){return new L_},t.prototype.buildPath=function(e,t){var n,r,i,a;if(this.subPixelOptimize){var o=F_(R_,t,this.style);n=o.x,r=o.y,i=o.width,a=o.height,o.r=t.r,t=o}else n=t.x,r=t.y,i=t.width,a=t.height;t.r?M_(e,t):e.rect(n,r,i,a)},t.prototype.isZeroArea=function(){return!this.shape.width||!this.shape.height},t}(T_);z_.prototype.type=`rect`;var B_={fill:`#000`},V_=2,H_={},U_={style:yl({fill:!0,stroke:!0,fillOpacity:!0,strokeOpacity:!0,lineWidth:!0,fontSize:!0,lineHeight:!0,width:!0,height:!0,textShadowColor:!0,textShadowBlur:!0,textShadowOffsetX:!0,textShadowOffsetY:!0,backgroundColor:!0,padding:!0,borderColor:!0,borderWidth:!0,borderRadius:!0},hg.style)},W_=function(e){U(t,e);function t(t){var n=e.call(this)||this;return n.type=`text`,n._children=[],n._defaultStyle=B_,n.attr(t),n}return t.prototype.childrenRef=function(){return this._children},t.prototype.update=function(){e.prototype.update.call(this),this.styleChanged()&&this._updateSubTexts();for(var t=0;t0,T=0;T=0&&(D=y[E],D.align===`right`);)this._placeToken(D,e,x,m,T,`right`,g),S-=D.width,T-=D.width,E--;for(w+=(s-(w-p)-(h-T)-S)/2;C<=E;)D=y[C],this._placeToken(D,e,x,m,w+D.width/2,`center`,g),w+=D.width,C++;m+=x}},t.prototype._placeToken=function(e,t,n,r,i,a,o){var s=t.rich[e.styleName]||{};s.text=e.text;var c=e.verticalAlign,l=r+n/2;c===`top`?l=r+e.height/2:c===`bottom`&&(l=r+n-e.height/2),!e.isLineHolder&&rv(s)&&this._renderBackground(s,t,a===`right`?i-e.width:a===`center`?i-e.width/2:i,l-e.height/2,e.width,e.height);var u=!!s.backgroundColor,d=e.textPadding;d&&(i=tv(i,a,d),l-=e.height/2-d[0]-e.innerHeight/2);var f=this._getOrCreateChild(D_),p=f.createStyle();f.useStyle(p);var m=this._defaultStyle,h=!1,g=0,_=!1,v=ev(`fill`in s?s.fill:`fill`in t?t.fill:(h=!0,m.fill)),y=$_(`stroke`in s?s.stroke:`stroke`in t?t.stroke:!u&&!o&&(!m.autoStroke||h)?(g=V_,_=!0,m.stroke):null),b=s.textShadowBlur>0||t.textShadowBlur>0;p.text=e.text,p.x=i,p.y=l,b&&(p.shadowBlur=s.textShadowBlur||t.textShadowBlur||0,p.shadowColor=s.textShadowColor||t.textShadowColor||`transparent`,p.shadowOffsetX=s.textShadowOffsetX||t.textShadowOffsetX||0,p.shadowOffsetY=s.textShadowOffsetY||t.textShadowOffsetY||0),p.textAlign=a,p.textBaseline=`middle`,p.font=e.font||`12px sans-serif`,p.opacity=Vl(s.opacity,t.opacity,1),Y_(p,s),y&&(p.lineWidth=Vl(s.lineWidth,t.lineWidth,g),p.lineDash=X(s.lineDash,t.lineDash),p.lineDashOffset=t.lineDashOffset||0,p.stroke=y),v&&(p.fill=v),f.setBoundingRect(im(p,e.contentWidth,e.contentHeight,_?0:null))},t.prototype._renderBackground=function(e,t,n,r,i,a){var o=e.backgroundColor,s=e.borderWidth,c=e.borderColor,l=o&&o.image,u=o&&!l,d=e.borderRadius,f=this,p,m;if(u||e.lineHeight||s&&c){p=this._getOrCreateChild(z_),p.useStyle(p.createStyle()),p.style.fill=null;var h=p.shape;h.x=n,h.y=r,h.width=i,h.height=a,h.r=d,p.dirtyShape()}if(u){var g=p.style;g.fill=o||null,g.fillOpacity=X(e.fillOpacity,1)}else if(l){m=this._getOrCreateChild(j_),m.onload=function(){f.dirtyStyle()};var _=m.style;_.image=o.image,_.x=n,_.y=r,_.width=i,_.height=a}if(s&&c){var g=p.style;g.lineWidth=s,g.stroke=c,g.strokeOpacity=X(e.strokeOpacity,1),g.lineDash=e.borderDash,g.lineDashOffset=e.borderDashOffset||0,p.strokeContainThreshold=0,p.hasFill()&&p.hasStroke()&&(g.strokeFirst=!0,g.lineWidth*=2)}var v=(p||m).style;v.shadowBlur=e.shadowBlur||0,v.shadowColor=e.shadowColor||`transparent`,v.shadowOffsetX=e.shadowOffsetX||0,v.shadowOffsetY=e.shadowOffsetY||0,v.opacity=Vl(e.opacity,t.opacity,1)},t.makeFont=function(e){var t=``;return X_(e)&&(t=[e.fontStyle,e.fontWeight,J_(e.fontSize),e.fontFamily||`sans-serif`].join(` `)),t&&Gl(t)||e.textFont||e.font},t}(vg),G_={left:!0,right:1,center:1},K_={top:1,bottom:1,middle:1},q_=[`fontStyle`,`fontWeight`,`fontSize`,`fontFamily`];function J_(e){return typeof e==`string`&&(e.indexOf(`px`)!==-1||e.indexOf(`rem`)!==-1||e.indexOf(`em`)!==-1)?e:isNaN(+e)?`12px`:e+`px`}function Y_(e,t){for(var n=0;n=0,a=!1;if(e instanceof T_){var o=yv(e),s=i&&o.selectFill||o.normalFill,c=i&&o.selectStroke||o.normalStroke;if(kv(s)||kv(c)){r||={};var l=r.style||{};l.fill===`inherit`?(a=!0,r=W({},r),l=W({},l),l.fill=s):!kv(l.fill)&&kv(s)?(a=!0,r=W({},r),l=W({},l),l.fill=_h(s)):!kv(l.stroke)&&kv(c)&&(a||(r=W({},r),l=W({},l)),l.stroke=_h(c)),r.style=l}}if(r&&r.z2==null){a||(r=W({},r));var u=e.z2EmphasisLift;r.z2=e.z2+(u??10)}return r}function Hv(e,t,n){if(n&&n.z2==null){n=W({},n);var r=e.z2SelectLift;n.z2=e.z2+(r??9)}return n}function Uv(e,t,n){var r=bl(e.currentStates,t)>=0,i=e.style.opacity,a=r?null:Bv(e,[`opacity`],t,{opacity:1});n||={};var o=n.style||{};return o.opacity??(n=W({},n),o=W({opacity:r?i:a.opacity*.1},o),n.style=o),n}function Wv(e,t){var n=this.states[e];if(this.style){if(e===`emphasis`)return Vv(this,e,t,n);if(e===`blur`)return Uv(this,e,n);if(e===`select`)return Hv(this,e,n)}return n}function Gv(e){e.stateProxy=Wv;var t=e.getTextContent(),n=e.getTextGuideLine();t&&(t.stateProxy=Wv),n&&(n.stateProxy=Wv)}function Kv(e,t){!ey(e,t)&&!e.__highByOuter&&Rv(e,jv)}function qv(e,t){!ey(e,t)&&!e.__highByOuter&&Rv(e,Mv)}function Jv(e,t){e.__highByOuter|=1<<(t||0),Rv(e,jv)}function Yv(e,t){!(e.__highByOuter&=~(1<<(t||0)))&&Rv(e,Mv)}function Xv(e){Rv(e,Nv)}function Zv(e){Rv(e,Pv)}function Qv(e){Rv(e,Fv)}function $v(e){Rv(e,Iv)}function ey(e,t){return e.__highDownSilentOnTouch&&t.zrByTouch}function ty(e){var t=e.getModel(),n=[],r=[];t.eachComponent(function(t,i){var a=bv(i),o=gv(e,i),s=t===`series`;!s&&r.push(o),a.isBlured&&(o.group.traverse(function(e){Pv(e)}),s&&n.push(i)),a.isBlured=!1}),G(r,function(e){e&&e.toggleBlurSeries&&e.toggleBlurSeries(n,!1,t)})}function ny(e,t,n,r){var i=r.getModel();n||=`coordinateSystem`;function a(e,t){for(var n=0;n0){var a={dataIndex:i,seriesIndex:e.seriesIndex};r!=null&&(a.dataType=r),t.push(a)}})}),t}function dy(e,t,n){vy(e,!0),Rv(e,Gv),my(e,t,n)}function fy(e){vy(e,!1)}function py(e,t,n,r){r?fy(e):dy(e,t,n)}function my(e,t,n){var r=iv(e);t==null?r.focus&&=null:(r.focus=t,r.blurScope=n)}var hy=[`emphasis`,`blur`,`select`],gy={itemStyle:`getItemStyle`,lineStyle:`getLineStyle`,areaStyle:`getAreaStyle`};function _y(e,t,n,r){n||=`itemStyle`;for(var i=0;i1&&(o*=ky(m),s*=ky(m));var h=(i===a?-1:1)*ky((o*o*(s*s)-o*o*(p*p)-s*s*(f*f))/(o*o*(p*p)+s*s*(f*f)))||0,g=h*o*p/s,_=h*-s*f/o,v=(e+n)/2+jy(d)*g-Ay(d)*_,y=(t+r)/2+Ay(d)*g+jy(d)*_,b=Fy([1,0],[(f-g)/o,(p-_)/s]),x=[(f-g)/o,(p-_)/s],S=[(-1*f-g)/o,(-1*p-_)/s],C=Fy(x,S);if(Py(x,S)<=-1&&(C=My),Py(x,S)>=1&&(C=0),C<0){var w=Math.round(C/My*1e6)/1e6;C=My*2+w%2*My}u.addData(l,v,y,o,s,b,C,d,a)}var Ly=/([mlvhzcqtsa])([^mlvhzcqtsa]*)/gi,Ry=/-?([0-9]*\.)?[0-9]+([eE]-?[0-9]+)?/g;function zy(e){var t=new e_;if(!e)return t;var n=0,r=0,i=n,a=r,o,s=e_.CMD,c=e.match(Ly);if(!c)return t;for(var l=0;l=0&&(n.splice(r,0,e),this._doAdd(e))}return this},t.prototype.replace=function(e,t){var n=bl(this._children,e);return n>=0&&this.replaceAt(t,n),this},t.prototype.replaceAt=function(e,t){var n=this._children,r=n[t];if(e&&e!==this&&e.parent!==this&&e!==r){n[t]=e,r.parent=null;var i=this.__zr;i&&r.removeSelfFromZr(i),this._doAdd(e)}return this},t.prototype._doAdd=function(e){e.parent&&e.parent.remove(e),e.parent=this;var t=this.__zr;t&&t!==e.__zr&&e.addSelfToZr(t),t&&t.refresh()},t.prototype.remove=function(e){var t=this.__zr,n=this._children,r=bl(n,e);return r<0?this:(n.splice(r,1),e.parent=null,t&&e.removeSelfFromZr(t),t&&t.refresh(),this)},t.prototype.removeAll=function(){for(var e=this._children,t=this.__zr,n=0;nA*A+j*j&&(w=E,T=D),{cx:w,cy:T,x0:-u,y0:-d,x1:w*(i/x-1),y1:T*(i/x-1)}}function ub(e){var t;if(J(e)){var n=e.length;if(!n)return e;t=n===1?[e[0],e[0],0,0]:n===2?[e[0],e[0],e[1],e[1]]:n===3?e.concat(e[2]):e}else t=[e,e,e,e];return t}function db(e,t){var n,r=ab(t.r,0),i=ab(t.r0||0,0),a=r>0;if(a||i>0){if(a||(r=i,i=0),i>r){var o=r;r=i,i=o}var s=t.startAngle,c=t.endAngle;if(!(isNaN(s)||isNaN(c))){var l=t.cx,u=t.cy,d=!!t.clockwise,f=rb(c-s),p=f>Qy&&f%Qy;if(p>sb&&(f=p),!(r>sb))e.moveTo(l,u);else if(f>Qy-sb)e.moveTo(l+r*eb(s),u+r*$y(s)),e.arc(l,u,r,s,c,!d),i>sb&&(e.moveTo(l+i*eb(c),u+i*$y(c)),e.arc(l,u,i,c,s,d));else{var m=void 0,h=void 0,g=void 0,_=void 0,v=void 0,y=void 0,b=void 0,x=void 0,S=void 0,C=void 0,w=void 0,T=void 0,E=void 0,D=void 0,O=void 0,k=void 0,A=r*eb(s),j=r*$y(s),M=i*eb(c),N=i*$y(c),P=f>sb;if(P){var F=t.cornerRadius;F&&(n=ub(F),m=n[0],h=n[1],g=n[2],_=n[3]);var I=rb(r-i)/2;if(v=ob(I,g),y=ob(I,_),b=ob(I,m),x=ob(I,h),w=S=ab(v,y),T=C=ab(b,x),(S>sb||C>sb)&&(E=r*eb(c),D=r*$y(c),O=i*eb(s),k=i*$y(s),fsb){var z=ob(g,w),ae=ob(_,w),B=lb(O,k,A,j,r,z,d),oe=lb(E,D,M,N,r,ae,d);e.moveTo(l+B.cx+B.x0,u+B.cy+B.y0),w0&&e.arc(l+B.cx,u+B.cy,z,nb(B.y0,B.x0),nb(B.y1,B.x1),!d),e.arc(l,u,r,nb(B.cy+B.y1,B.cx+B.x1),nb(oe.cy+oe.y1,oe.cx+oe.x1),!d),ae>0&&e.arc(l+oe.cx,u+oe.cy,ae,nb(oe.y1,oe.x1),nb(oe.y0,oe.x0),!d))}else e.moveTo(l+A,u+j),e.arc(l,u,r,s,c,!d);if(!(i>sb)||!P)e.lineTo(l+M,u+N);else if(T>sb){var z=ob(m,T),ae=ob(h,T),B=lb(M,N,E,D,i,-ae,d),oe=lb(A,j,O,k,i,-z,d);e.lineTo(l+B.cx+B.x0,u+B.cy+B.y0),T0&&e.arc(l+B.cx,u+B.cy,ae,nb(B.y0,B.x0),nb(B.y1,B.x1),!d),e.arc(l,u,i,nb(B.cy+B.y1,B.cx+B.x1),nb(oe.cy+oe.y1,oe.cx+oe.x1),d),z>0&&e.arc(l+oe.cx,u+oe.cy,z,nb(oe.y1,oe.x1),nb(oe.y0,oe.x0),!d))}else e.lineTo(l+M,u+N),e.arc(l,u,i,c,s,d)}e.closePath()}}}var fb=function(){function e(){this.cx=0,this.cy=0,this.r0=0,this.r=0,this.startAngle=0,this.endAngle=Math.PI*2,this.clockwise=!0,this.cornerRadius=0}return e}(),pb=function(e){U(t,e);function t(t){return e.call(this,t)||this}return t.prototype.getDefaultShape=function(){return new fb},t.prototype.buildPath=function(e,t){db(e,t)},t.prototype.isZeroArea=function(){return this.shape.startAngle===this.shape.endAngle||this.shape.r===this.shape.r0},t}(T_);pb.prototype.type=`sector`;var mb=function(){function e(){this.cx=0,this.cy=0,this.r=0,this.r0=0}return e}(),hb=function(e){U(t,e);function t(t){return e.call(this,t)||this}return t.prototype.getDefaultShape=function(){return new mb},t.prototype.buildPath=function(e,t){var n=t.cx,r=t.cy,i=Math.PI*2;e.moveTo(n+t.r,r),e.arc(n,r,t.r,0,i,!1),e.moveTo(n+t.r0,r),e.arc(n,r,t.r0,0,i,!0)},t}(T_);hb.prototype.type=`ring`;function gb(e,t,n,r){var i=[],a=[],o=[],s=[],c,l,u,d;if(r){u=[1/0,1/0],d=[-1/0,-1/0];for(var f=0,p=e.length;f=2){if(r){var a=gb(i,r,n,t.smoothConstraint);e.moveTo(i[0][0],i[0][1]);for(var o=i.length,s=0;s<(n?o:o-1);s++){var c=a[s*2],l=a[s*2+1],u=i[(s+1)%o];e.bezierCurveTo(c[0],c[1],l[0],l[1],u[0],u[1])}}else{e.moveTo(i[0][0],i[0][1]);for(var s=1,d=i.length;szb[1]){if(i=!1,Bb.negativeSize||n)return i;var s=Lb(zb[0]-Rb[1]),c=Lb(Rb[0]-zb[1]);Fb(s,c)>Hb.len()&&(s=c||!Bb.bidirectional)&&(Qf.scale(Vb,o,-c*r),Bb.useDir&&Bb.calcDirMTV()))}}return i},e.prototype._getProjMinMaxOnAxis=function(e,t,n){for(var r=this._axes[e],i=this._origin,a=t[0].dot(r)+i[e],o=a,s=a,c=1;c0){var d=u.duration,f=u.delay,p=u.easing,m={duration:d,delay:f||0,easing:p,done:a,force:!!a||!!o,setToFinal:!l,scope:e,during:o};s?t.animateFrom(n,m):t.animateTo(n,m)}else t.stopAnimation(),!s&&t.attr(n),o&&o(1),a&&a()}function Yb(e,t,n,r,i,a){Jb(`update`,e,t,n,r,i,a)}function Xb(e,t,n,r,i,a){Jb(`enter`,e,t,n,r,i,a)}function Zb(e){if(!e.__zr)return!0;for(var t=0;tAb,BezierCurve:()=>Ob,BoundingRect:()=>fp,Circle:()=>Jy,CompoundPath:()=>jb,Ellipse:()=>Xy,Group:()=>Ky,HOVER_LAYER_FOR_INCREMENTAL:()=>2,HOVER_LAYER_FROM_THRESHOLD:()=>1,HOVER_LAYER_NO:()=>0,Image:()=>j_,IncrementalDisplayable:()=>Gb,Line:()=>wb,LinearGradient:()=>Nb,OrientedBoundingRect:()=>Ub,Path:()=>T_,Point:()=>Qf,Polygon:()=>yb,Polyline:()=>xb,RadialGradient:()=>Pb,Rect:()=>z_,Ring:()=>hb,Sector:()=>pb,Text:()=>W_,WH:()=>ax,XY:()=>ix,applyTransform:()=>bx,calcZ2Range:()=>Wx,clipPointsByRect:()=>Ex,clipRectByRect:()=>Dx,createIcon:()=>Ox,decomposeTransform:()=>Jx,ensureCopyRect:()=>Vx,ensureCopyTransform:()=>Hx,expandOrShrinkRect:()=>Nx,extendPath:()=>cx,extendShape:()=>ox,getCurrentCanvasPainter:()=>Xx,getShapeClass:()=>ux,getTransform:()=>yx,groupTransition:()=>Tx,initProps:()=>Xb,isBoundingRectAxisAligned:()=>zx,isElementRemoved:()=>Zb,lineLineIntersect:()=>Ax,linePolygonIntersect:()=>kx,makeImage:()=>fx,makePath:()=>dx,mergePath:()=>mx,payloadDisableAnimation:()=>qx,registerShape:()=>lx,removeElement:()=>Qb,removeElementWithFadeOut:()=>ex,resizePath:()=>hx,retrieveZInfo:()=>Ux,setTooltipConfig:()=>Ix,subPixelOptimize:()=>vx,subPixelOptimizeLine:()=>gx,subPixelOptimizeRect:()=>_x,transformDirection:()=>xx,traverseElements:()=>Rx,traverseUpdateZ:()=>Gx,updateProps:()=>Yb}),rx={},ix=[`x`,`y`],ax=[`width`,`height`];function ox(e){return T_.extend(e)}var sx=Wy;function cx(e,t){return sx(e,t)}function lx(e,t){rx[e]=t}function ux(e){if(rx.hasOwnProperty(e))return rx[e]}function dx(e,t,n,r){var i=Uy(e,t);return n&&(r===`center`&&(n=px(n,i.getBoundingRect())),hx(i,n)),i}function fx(e,t,n){var r=new j_({style:{image:e,x:t.x,y:t.y,width:t.width,height:t.height},onload:function(e){if(n===`center`){var i={width:e.width,height:e.height};r.setStyle(px(t,i))}}});return r}function px(e,t){var n=t.width/t.height,r=e.height*n,i;r<=e.width?i=e.height:(r=e.width,i=r/n);var a=e.x+e.width/2,o=e.y+e.height/2;return{x:a-r/2,y:o-i/2,width:r,height:i}}var mx=Gy;function hx(e,t){if(e.applyTransform){var n=e.getBoundingRect().calculateTransform(t);e.applyTransform(n)}}function gx(e,t){return P_(e,e,{lineWidth:t}),e}function _x(e,t){return F_(e,e,t),e}var vx=I_;function yx(e,t){for(var n=Df([]);e&&e!==t;)kf(n,e.getLocalTransform(),n),e=e.parent;return n}function bx(e,t,n){return t&&!Cl(t)&&(t=pm.getLocalTransform(t)),n&&(t=Nf([],t)),Yf([],e,t)}function xx(e,t,n){var r=t[4]===0||t[5]===0||t[0]===0?1:pu(2*t[4]/t[0]),i=t[4]===0||t[5]===0||t[2]===0?1:pu(2*t[4]/t[2]),a=[e===`left`?-r:e===`right`?r:0,e===`top`?-i:e===`bottom`?i:0];return a=bx(a,t,n),pu(a[0])>pu(a[1])?a[0]>0?`right`:`left`:a[1]>0?`bottom`:`top`}function Sx(e){return!e.isGroup}function Cx(e){return e.shape!=null}function Tx(e,t,n){if(!e||!t)return;function r(e){var t={};return e.traverse(function(e){Sx(e)&&e.anid&&(t[e.anid]=e)}),t}function i(e){var t={x:e.x,y:e.y,rotation:e.rotation};return Cx(e)&&(t.shape=hl(e.shape)),t}var a=r(e);t.traverse(function(e){if(Sx(e)&&e.anid){var t=a[e.anid];if(t){var r=i(e);e.attr(i(t)),Yb(e,r,n,iv(e).dataIndex)}}})}function Ex(e,t){return K(e,function(e){var n=e[0];n=fu(n,t.x),n=du(n,t.x+t.width);var r=e[1];return r=fu(r,t.y),r=du(r,t.y+t.height),[n,r]})}function Dx(e,t){var n=fu(e.x,t.x),r=du(e.x+e.width,t.x+t.width),i=fu(e.y,t.y),a=du(e.y+e.height,t.y+t.height);if(r>=n&&a>=i)return{x:n,y:i,width:r-n,height:a-i}}function Ox(e,t,n){var r=W({rectHover:!0},t),i=r.style={strokeNoScale:!0};if(n||={x:-1,y:-1,width:2,height:2},e)return e.indexOf(`image://`)===0?(i.image=e.slice(8),yl(i,n),new j_(r)):dx(e.replace(`path://`,``),r,n,`center`)}function kx(e,t,n,r,i){for(var a=0,o=i[i.length-1];a1)return!1;var g=jx(p,m,u,d)/f;return!(g<0||g>1)}function jx(e,t,n,r){return e*r-n*t}function Mx(e){return e<=1e-6&&e>=-1e-6}function Nx(e,t,n,r,i){return t==null?e:(Ml(t)?Px[0]=Px[1]=Px[2]=Px[3]=t:(Px[0]=t[0],Px[1]=t[1],Px[2]=t[2],Px[3]=t[3]),r&&(Px[0]=fu(0,Px[0]),Px[1]=fu(0,Px[1]),Px[2]=fu(0,Px[2]),Px[3]=fu(0,Px[3])),n&&(Px[0]=-Px[0],Px[1]=-Px[1],Px[2]=-Px[2],Px[3]=-Px[3]),Fx(e,Px,`x`,`width`,3,1,i&&i[0]||0),Fx(e,Px,`y`,`height`,0,2,i&&i[1]||0),e)}var Px=[0,0,0,0];function Fx(e,t,n,r,i,a,o){var s=t[a]+t[i],c=e[r];e[r]+=s,o=fu(0,du(o,c)),e[r]=0?-t[i]:t[a]>=0?c+t[a]:pu(s)>1e-8?(c-o)*t[i]/s:0):e[n]-=t[i]}function Ix(e){var t=e.itemTooltipOption,n=e.componentModel,r=e.itemName,i=Y(t)?{formatter:t}:t,a=n.mainType,o=n.componentIndex,s={componentType:a,name:r,$vars:[`name`]};s[a+`Index`]=o;var c=e.formatterParamsExtra;c&&G(Dl(c),function(e){Z(s,e)||(s[e]=c[e],s.$vars.push(e))});var l=iv(e.el);l.componentMainType=a,l.componentIndex=o,l.tooltipConfig={name:r,option:yl({content:r,encodeHTMLContent:!0,formatterParams:s},i)}}function Lx(e,t){var n;e.isGroup&&(n=t(e)),n||e.traverse(t)}function Rx(e,t){if(e){if(J(e))for(var n=0;nt&&(t=r),rt&&(n=t=0),{min:n,max:t}}function Gx(e,t,n){Kx(e,t,n,-1/0)}function Kx(e,t,n,r){if(e.ignoreModelZ)return r;var i=e.getTextContent(),a=e.getTextGuideLine();if(e.isGroup)for(var o=e.childrenRef(),s=0;s=0&&n.push(e)}),n}}function AS(e,t){return gl(gl({},e,!0),t,!0)}var jS=Math.log(2);function MS(e,t,n,r,i,a){var o=r+`-`+i,s=e.length;if(a.hasOwnProperty(o))return a[o];if(t===1){var c=Math.round(Math.log((1<>1)%2;s.cssText=[`position: absolute`,`visibility: hidden`,`padding: 0`,`margin: 0`,`border-width: 0`,`user-select: none`,`width:0`,`height:0`,r[c]+`:0`,i[l]+`:0`,r[1-c]+`:auto`,i[1-l]+`:auto`,``].join(`!important;`),e.appendChild(o),n.push(o)}return t.clearMarkers=function(){G(n,function(e){e.parentNode&&e.parentNode.removeChild(e)})},n}function BS(e,t,n){for(var r=n?`invTrans`:`trans`,i=t[r],a=t.srcCoords,o=[],s=[],c=!0,l=0;l<4;l++){var u=e[l].getBoundingClientRect(),d=2*l,f=u.left,p=u.top;o.push(f,p),c=c&&a&&f===a[d]&&p===a[d+1],s.push(e[l].offsetLeft,e[l].offsetTop)}return c&&i?i:(t.srcCoords=o,t[r]=n?NS(s,o):NS(o,s))}function VS(e){return e.nodeName.toUpperCase()===`CANVAS`}var HS=/([&<>"'])/g,US={"&":`&`,"<":`<`,">":`>`,'"':`"`,"'":`'`};function WS(e){return e==null?``:(e+``).replace(HS,function(e,t){return US[t]})}var GS={time:{month:[`January`,`February`,`March`,`April`,`May`,`June`,`July`,`August`,`September`,`October`,`November`,`December`],monthAbbr:[`Jan`,`Feb`,`Mar`,`Apr`,`May`,`Jun`,`Jul`,`Aug`,`Sep`,`Oct`,`Nov`,`Dec`],dayOfWeek:[`Sunday`,`Monday`,`Tuesday`,`Wednesday`,`Thursday`,`Friday`,`Saturday`],dayOfWeekAbbr:[`Sun`,`Mon`,`Tue`,`Wed`,`Thu`,`Fri`,`Sat`]},legend:{selector:{all:`All`,inverse:`Inv`}},toolbox:{brush:{title:{rect:`Box Select`,polygon:`Lasso Select`,lineX:`Horizontally Select`,lineY:`Vertically Select`,keep:`Keep Selections`,clear:`Clear Selections`}},dataView:{title:`Data View`,lang:[`Data View`,`Close`,`Refresh`]},dataZoom:{title:{zoom:`Zoom`,back:`Zoom Reset`}},magicType:{title:{line:`Switch to Line Chart`,bar:`Switch to Bar Chart`,stack:`Stack`,tiled:`Tile`}},restore:{title:`Restore`},saveAsImage:{title:`Save as Image`,lang:[`Right Click to Save Image`]}},series:{typeNames:{pie:`Pie chart`,bar:`Bar chart`,line:`Line chart`,scatter:`Scatter plot`,effectScatter:`Ripple scatter plot`,radar:`Radar chart`,tree:`Tree`,treemap:`Treemap`,boxplot:`Boxplot`,candlestick:`Candlestick`,k:`K line chart`,heatmap:`Heat map`,map:`Map`,parallel:`Parallel coordinate map`,lines:`Line graph`,graph:`Relationship graph`,sankey:`Sankey diagram`,funnel:`Funnel chart`,gauge:`Gauge`,pictorialBar:`Pictorial bar`,themeRiver:`Theme River Map`,sunburst:`Sunburst`,custom:`Custom chart`,chart:`Chart`}},aria:{general:{withTitle:`This is a chart about "{title}"`,withoutTitle:`This is a chart`},series:{single:{prefix:``,withName:` with type {seriesType} named {seriesName}.`,withoutName:` with type {seriesType}.`},multiple:{prefix:`. It consists of {seriesCount} series count.`,withName:` The {seriesId} series is a {seriesType} representing {seriesName}.`,withoutName:` The {seriesId} series is a {seriesType}.`,separator:{middle:``,end:``}}},data:{allData:`The data is as follows: `,partialData:`The first {displayCnt} items are: `,withName:`the data for {name} is {value}`,withoutName:`{value}`,separator:{middle:`, `,end:`. `}}}},KS={time:{month:[`一月`,`二月`,`三月`,`四月`,`五月`,`六月`,`七月`,`八月`,`九月`,`十月`,`十一月`,`十二月`],monthAbbr:[`1月`,`2月`,`3月`,`4月`,`5月`,`6月`,`7月`,`8月`,`9月`,`10月`,`11月`,`12月`],dayOfWeek:[`星期日`,`星期一`,`星期二`,`星期三`,`星期四`,`星期五`,`星期六`],dayOfWeekAbbr:[`日`,`一`,`二`,`三`,`四`,`五`,`六`]},legend:{selector:{all:`全选`,inverse:`反选`}},toolbox:{brush:{title:{rect:`矩形选择`,polygon:`圈选`,lineX:`横向选择`,lineY:`纵向选择`,keep:`保持选择`,clear:`清除选择`}},dataView:{title:`数据视图`,lang:[`数据视图`,`关闭`,`刷新`]},dataZoom:{title:{zoom:`区域缩放`,back:`区域缩放还原`}},magicType:{title:{line:`切换为折线图`,bar:`切换为柱状图`,stack:`切换为堆叠`,tiled:`切换为平铺`}},restore:{title:`还原`},saveAsImage:{title:`保存为图片`,lang:[`右键另存为图片`]}},series:{typeNames:{pie:`饼图`,bar:`柱状图`,line:`折线图`,scatter:`散点图`,effectScatter:`涟漪散点图`,radar:`雷达图`,tree:`树图`,treemap:`矩形树图`,boxplot:`箱型图`,candlestick:`K线图`,k:`K线图`,heatmap:`热力图`,map:`地图`,parallel:`平行坐标图`,lines:`线图`,graph:`关系图`,sankey:`桑基图`,funnel:`漏斗图`,gauge:`仪表盘图`,pictorialBar:`象形柱图`,themeRiver:`主题河流图`,sunburst:`旭日图`,custom:`自定义图表`,chart:`图表`}},aria:{general:{withTitle:`这是一个关于“{title}”的图表。`,withoutTitle:`这是一个图表,`},series:{single:{prefix:``,withName:`图表类型是{seriesType},表示{seriesName}。`,withoutName:`图表类型是{seriesType}。`},multiple:{prefix:`它由{seriesCount}个图表系列组成。`,withName:`第{seriesId}个系列是一个表示{seriesName}的{seriesType},`,withoutName:`第{seriesId}个系列是一个{seriesType},`,separator:{middle:`;`,end:`。`}}},data:{allData:`其数据是——`,partialData:`其中,前{displayCnt}项是——`,withName:`{name}的数据是{value}`,withoutName:`{value}`,separator:{middle:`,`,end:``}}}},qS=`ZH`,JS=`EN`,YS=JS,XS={},ZS={},QS=ou.domSupported?function(){return(document.documentElement.lang||navigator.language||navigator.browserLanguage||YS).toUpperCase().indexOf(qS)>-1?qS:YS}():YS;function $S(e,t){e=e.toUpperCase(),ZS[e]=new TS(t),XS[e]=t}function eC(e){if(Y(e)){var t=XS[e.toUpperCase()]||{};return e===qS||e===JS?hl(t):gl(hl(t),hl(XS[YS]),!1)}return gl(hl(e),hl(XS[YS]),!1)}function tC(e){return ZS[e]}function nC(){return ZS[YS]}$S(JS,GS),$S(qS,KS);var rC=null;function iC(){return rC}function aC(e,t){var n=iC(),r=t.breakOption,i=t.breakParsed;return!i&&n&&(i=n.parseAxisBreakOption(r,e)),i}function oC(e){var t=e.brk;return t?t.breaks:[]}function sC(e){var t=e.brk;return t?t.hasBreaks():!1}var cC=1e3,lC=cC*60,uC=lC*60,dC=uC*24,fC=dC*365,pC={year:/({yyyy}|{yy})/,month:/({MMMM}|{MMM}|{MM}|{M})/,day:/({dd}|{d})/,hour:/({HH}|{H}|{hh}|{h})/,minute:/({mm}|{m})/,second:/({ss}|{s})/,millisecond:/({SSS}|{S})/},mC={year:`{yyyy}`,month:`{MMM}`,day:`{d}`,hour:`{HH}:{mm}`,minute:`{HH}:{mm}`,second:`{HH}:{mm}:{ss}`,millisecond:`{HH}:{mm}:{ss} {SSS}`},hC=`{yyyy}-{MM}-{dd} {HH}:{mm}:{ss} {SSS}`,gC=`{yyyy}-{MM}-{dd}`,_C={year:`{yyyy}`,month:`{yyyy}-{MM}`,day:gC,hour:gC+` `+mC.hour,minute:gC+` `+mC.minute,second:gC+` `+mC.second,millisecond:hC},vC=[`year`,`month`,`day`,`hour`,`minute`,`second`,`millisecond`],yC=[`year`,`half-year`,`quarter`,`month`,`week`,`half-week`,`day`,`half-day`,`quarter-day`,`hour`,`minute`,`second`,`millisecond`];function bC(e){return!Y(e)&&!Al(e)?xC(e):e}function xC(e){e||={};var t={},n=!0;return G(vC,function(t){n&&=e[t]==null}),G(vC,function(r,i){var a=e[r];t[r]={};for(var o=null,s=i;s>=0;s--){var c=vC[s],l=Nl(a)&&!J(a)?a[c]:a,u=void 0;J(l)?(u=l.slice(),o=u[0]||``):Y(l)?(o=l,u=[o]):(o==null?o=mC[r]:pC[c].test(o)||(o=t[c][c][0]+` `+o),u=[o],n&&(u[1]=`{primary|`+o+`}`)),t[r][c]=u}}),t}function SC(e,t){return e+=``,`0000`.substr(0,t-e.length)+e}function CC(e){switch(e){case`half-year`:case`quarter`:return`month`;case`week`:case`half-week`:return`day`;case`half-day`:case`quarter-day`:return`hour`;default:return e}}function wC(e){return e===CC(e)}function TC(e){switch(e){case`year`:case`month`:return`day`;case`millisecond`:return`millisecond`;default:return`second`}}function EC(e,t,n,r){var i=Lu(e),a=i[AC(n)](),o=i[jC(n)]()+1,s=Math.floor((o-1)/3)+1,c=i[MC(n)](),l=i[`get`+(n?`UTC`:``)+`Day`](),u=i[NC(n)](),d=(u-1)%12+1,f=i[PC(n)](),p=i[FC(n)](),m=i[IC(n)](),h=u>=12?`pm`:`am`,g=h.toUpperCase(),_=(r instanceof TS?r:tC(r||QS)||nC()).getModel(`time`),v=_.get(`month`),y=_.get(`monthAbbr`),b=_.get(`dayOfWeek`),x=_.get(`dayOfWeekAbbr`);return(t||``).replace(/{a}/g,h+``).replace(/{A}/g,g+``).replace(/{yyyy}/g,a+``).replace(/{yy}/g,SC(a%100+``,2)).replace(/{Q}/g,s+``).replace(/{MMMM}/g,v[o-1]).replace(/{MMM}/g,y[o-1]).replace(/{MM}/g,SC(o,2)).replace(/{M}/g,o+``).replace(/{dd}/g,SC(c,2)).replace(/{d}/g,c+``).replace(/{eeee}/g,b[l]).replace(/{ee}/g,x[l]).replace(/{e}/g,l+``).replace(/{HH}/g,SC(u,2)).replace(/{H}/g,u+``).replace(/{hh}/g,SC(d+``,2)).replace(/{h}/g,d+``).replace(/{mm}/g,SC(f,2)).replace(/{m}/g,f+``).replace(/{ss}/g,SC(p,2)).replace(/{s}/g,p+``).replace(/{SSS}/g,SC(m,3)).replace(/{S}/g,m+``)}function DC(e,t,n,r,i){var a=null;if(Y(n))a=n;else if(Al(n)){var o={time:e.time,level:e.time?e.time.level:0},s=iC();s&&s.makeAxisLabelFormatterParamBreak(o,e.break),a=n(e.value,t,o)}else{var c=e.time;if(c){var l=n[c.lowerTimeUnit][c.upperTimeUnit];a=l[Math.min(c.level,l.length-1)]||``}else{var u=OC(e.value,i);a=n[u][u][0]}}return EC(new Date(e.value),a,i,r)}function OC(e,t){var n=Lu(e),r=n[jC(t)]()+1,i=n[MC(t)](),a=n[NC(t)](),o=n[PC(t)](),s=n[FC(t)](),c=n[IC(t)]()===0,l=c&&s===0,u=l&&o===0,d=u&&a===0,f=d&&i===1;return f&&r===1?`year`:f?`month`:d?`day`:u?`hour`:l?`minute`:c?`second`:`millisecond`}function kC(e,t,n){switch(t){case`year`:e[RC(n)](0);case`month`:e[zC(n)](1);case`day`:e[BC(n)](0);case`hour`:e[VC(n)](0);case`minute`:e[HC(n)](0);case`second`:e[UC(n)](0)}return e}function AC(e){return e?`getUTCFullYear`:`getFullYear`}function jC(e){return e?`getUTCMonth`:`getMonth`}function MC(e){return e?`getUTCDate`:`getDate`}function NC(e){return e?`getUTCHours`:`getHours`}function PC(e){return e?`getUTCMinutes`:`getMinutes`}function FC(e){return e?`getUTCSeconds`:`getSeconds`}function IC(e){return e?`getUTCMilliseconds`:`getMilliseconds`}function LC(e){return e?`setUTCFullYear`:`setFullYear`}function RC(e){return e?`setUTCMonth`:`setMonth`}function zC(e){return e?`setUTCDate`:`setDate`}function BC(e){return e?`setUTCHours`:`setHours`}function VC(e){return e?`setUTCMinutes`:`setMinutes`}function HC(e){return e?`setUTCSeconds`:`setSeconds`}function UC(e){return e?`setUTCMilliseconds`:`setMilliseconds`}function WC(e){if(!Uu(e))return Y(e)?e:`-`;var t=(e+``).split(`.`);return t[0].replace(/(\d{1,3})(?=(?:\d{3})+(?!\d))/g,`$1,`)+(t.length>1?`.`+t[1]:``)}function GC(e,t){return e=(e||``).toLowerCase().replace(/-(.)/g,function(e,t){return t.toUpperCase()}),t&&e&&(e=e.charAt(0).toUpperCase()+e.slice(1)),e}var KC=Ul;function qC(e,t,n){var r=`{yyyy}-{MM}-{dd} {HH}:{mm}:{ss}`;function i(e){return e&&Gl(e)?e:`-`}function a(e){return qu(e)}var o=t===`time`,s=e instanceof Date;if(o||s){var c=o?Lu(e):e;if(!isNaN(+c))return EC(c,r,n);if(s)return`-`}if(t===`ordinal`)return jl(e)?i(e):Ml(e)&&a(e)?e+``:`-`;var l=Hu(e);return a(l)?WC(l):jl(e)?i(e):typeof e==`boolean`?e+``:`-`}var JC=[`a`,`b`,`c`,`d`,`e`,`f`,`g`],YC=function(e,t){return`{`+e+(t??``)+`}`};function XC(e,t,n){J(t)||(t=[t]);var r=t.length;if(!r)return``;for(var i=t[0].$vars||[],a=0;a`:``:{renderMode:a,content:`{`+(n.markerId||`markerX`)+`|} `,style:i===`subItem`?{width:4,height:4,borderRadius:2,backgroundColor:r}:{width:10,height:10,borderRadius:5,backgroundColor:r}}:``}function QC(e,t){return t||=`transparent`,Y(e)?e:Nl(e)&&e.colorStops&&(e.colorStops[0]||{}).color||t}var $C={},ew={},tw=function(){function e(){this._normalMasterList=[],this._nonSeriesBoxMasterList=[]}return e.prototype.create=function(e,t){this._nonSeriesBoxMasterList=n($C,!0),this._normalMasterList=n(ew,!1);function n(n,r){var i=[];return G(n,function(n,r){var a=n.create(e,t);i=i.concat(a||[])}),i}},e.prototype.update=function(e,t){G(this._normalMasterList,function(n){n.update&&n.update(e,t)})},e.prototype.getCoordinateSystems=function(){return this._normalMasterList.concat(this._nonSeriesBoxMasterList)},e.register=function(e,t){if(e===`matrix`||e===`calendar`){$C[e]=t;return}ew[e]=t},e.get=function(e){return ew[e]||$C[e]},e}();function nw(e){return!!$C[e]}var rw=$l();function iw(e){var t=e.getShallow(`coord`,!0),n=1;if(t==null){var r=rw.get(e.type);r&&r.getCoord2&&(n=2,t=r.getCoord2(e))}return{coord:t,from:n}}function aw(e,t){var n=e.getShallow(`coordinateSystem`),r=e.getShallow(`coordinateSystemUsage`,!0),i=0;if(n){var a=e.mainType===`series`;r??=a?`data`:`box`,r===`data`?(i=1,a||(i=0)):r===`box`&&(i=2,!a&&!nw(n)&&(i=0))}return{coordSysType:n,kind:i}}function ow(e){var t=e.targetModel,n=e.coordSysType,r=e.coordSysProvider,i=e.isDefaultDataCoordSys;e.allowNotFound;var a=aw(t,!0),o=a.kind,s=a.coordSysType;if(i&&o!==1&&(o=1,s=n),o===0||s!==n)return 0;var c=r(n,t);return c?(o===1?t.coordinateSystem=c:t.boxCoordinateSystem=c,o):0}var sw=G,cw=[`left`,`right`,`top`,`bottom`,`width`,`height`],lw=[[`width`,`left`,`right`],[`height`,`top`,`bottom`]];function uw(e,t,n,r,i){var a=0,o=0;r??=1/0,i??=1/0;var s=0;t.eachChild(function(c,l){var u=c.getBoundingRect(),d=t.childAt(l+1),f=d&&d.getBoundingRect(),p,m;if(e===`horizontal`){var h=u.width+(f?-f.x+u.x:0);p=a+h,p>r||c.newline?(a=0,p=h,o+=s+n,s=u.height):s=Math.max(s,u.height)}else{var g=u.height+(f?-f.y+u.y:0);m=o+g,m>i||c.newline?(a+=s+n,o=0,m=g,s=u.width):s=Math.max(s,u.width)}c.newline||(c.x=a,c.y=o,c.markRedraw(),e===`horizontal`?a=p+n:o=m+n)})}var dw=uw;kl(uw,`vertical`),kl(uw,`horizontal`);function fw(e,t){return{left:e.getShallow(`left`,t),top:e.getShallow(`top`,t),right:e.getShallow(`right`,t),bottom:e.getShallow(`bottom`,t),width:e.getShallow(`width`,t),height:e.getShallow(`height`,t)}}function pw(e,t,n){n=KC(n||0);var r=t.width,i=t.height,a=Cu(e.left,r),o=Cu(e.top,i),s=Cu(e.right,r),c=Cu(e.bottom,i),l=Cu(e.width,r),u=Cu(e.height,i),d=n[2]+n[0],f=n[1]+n[3],p=e.aspect;switch(isNaN(l)&&(l=r-s-f-a),isNaN(u)&&(u=i-c-d-o),p!=null&&(isNaN(l)&&isNaN(u)&&(p>r/i?l=r*.8:u=i*.8),isNaN(l)&&(l=p*u),isNaN(u)&&(u=l/p)),isNaN(a)&&(a=r-s-l-f),isNaN(o)&&(o=i-c-u-d),e.left||e.right){case`center`:a=r/2-l/2-n[3];break;case`right`:a=r-l-f}switch(e.top||e.bottom){case`middle`:case`center`:o=i/2-u/2-n[0];break;case`bottom`:o=i-u-d}a||=0,o||=0,isNaN(l)&&(l=r-f-a-(s||0)),isNaN(u)&&(u=i-d-o-(c||0));var m=new fp((t.x||0)+a+n[3],(t.y||0)+o+n[0],l,u);return m.margin=n,m}var mw={rect:1,point:2};function hw(e,t,n){var r,i,a,o=e.boxCoordinateSystem,s;if(o){var c=iw(e),l=c.coord,u=c.from;if(o.dataToLayout){a=mw.rect,s=u;var d=o.dataToLayout(l);r=d.contentRect||d.rect}else n&&n.enableLayoutOnlyByCenter&&o.dataToPoint&&(a=mw.point,s=u,i=o.dataToPoint(l))}return a??=mw.rect,a===mw.rect&&(r||={x:0,y:0,width:t.getWidth(),height:t.getHeight()},i=[r.x+r.width/2,r.y+r.height/2]),{type:a,refContainer:r,refPoint:i,boxCoordFrom:s}}function gw(e,t,n,r,i,a){var o=!i||!i.hv||i.hv[0],s=!i||!i.hv||i.hv[1],c=i&&i.boundingMode||`all`;if(a||=e,a.x=e.x,a.y=e.y,!o&&!s)return!1;var l;if(c===`raw`)l=e.type===`group`?new fp(0,0,+t.width||0,+t.height||0):e.getBoundingRect();else if(l=e.getBoundingRect(),e.needLocalTransform()){var u=e.getLocalTransform();l=l.clone(),l.applyTransform(u)}var d=pw(yl({width:l.width,height:l.height},t),n,r),f=o?d.x-l.x:0,p=s?d.y-l.y:0;return c===`raw`?(a.x=f,a.y=p):(a.x+=f,a.y+=p),a===e&&e.markRedraw(),!0}function _w(e){var t=e.layoutMode||e.constructor.layoutMode;return Nl(t)?t:t?{type:t}:null}function vw(e,t,n){var r=n&&n.ignoreSize;!J(r)&&(r=[r,r]);var i=o(lw[0],0),a=o(lw[1],1);c(lw[0],e,i),c(lw[1],e,a);function o(n,i){var a={},o=0,c={},l=0,u=2;if(sw(n,function(t){c[t]=e[t]}),sw(n,function(e){Z(t,e)&&(a[e]=c[e]=t[e]),s(a,e)&&o++,s(c,e)&&l++}),r[i])return s(t,n[1])?c[n[2]]=null:s(t,n[2])&&(c[n[1]]=null),c;if(l===u||!o)return c;if(o>=u)return a;for(var d=0;d=0;o--)a=gl(a,n[o],!0);t.defaultOption=a}return t.defaultOption},t.prototype.getReferringComponents=function(e,t){var n=e+`Index`,r=e+`Id`;return jd(this.ecModel,e,{index:this.get(n,!0),id:this.get(r,!0)},t)},t.prototype.getBoxLayoutParams=function(){return fw(this,!1)},t.prototype.getZLevelKey=function(){return``},t.prototype.setZLevel=function(e){this.option.zlevel=e},t.protoInitialize=function(){var e=t.prototype;e.type=`component`,e.id=``,e.name=``,e.mainType=``,e.subType=``,e.componentIndex=0}(),t}(TS);lf(Sw,TS),mf(Sw),OS(Sw),kS(Sw,Cw);function Cw(e){var t=[];return G(Sw.getClassesByMainType(e),function(e){t=t.concat(e.dependencies||e.prototype.dependencies||[])}),t=K(t,function(e){return rf(e).main}),e!==`dataset`&&bl(t,`dataset`)<=0&&t.unshift(`dataset`),t}var ww=Td(),Tw=Td(),Ew=function(){function e(){}return e.prototype.getColorFromPalette=function(e,t,n){var r=rd(this.get(`color`,!0)),i=this.get(`colorLayer`,!0);return kw(this,ww,r,i,e,t,n)},e.prototype.clearColorPalette=function(){Aw(this,ww)},e}();function Dw(e,t,n,r){return kw(e,Tw,rd(e.get([`aria`,`decal`,`decals`])),null,t,n,r)}function Ow(e,t){for(var n=e.length,r=0;rt)return e[r];return e[n-1]}function kw(e,t,n,r,i,a,o){a||=e;var s=t(a),c=s.paletteIdx||0,l=s.paletteNameMap=s.paletteNameMap||{};if(l.hasOwnProperty(i))return l[i];var u=o==null||!r?n:Ow(r,o);if(u||=n,u&&u.length){var d=u[c];return i&&(l[i]=d),s.paletteIdx=(c+1)%u.length,d}}function Aw(e,t){t(e).paletteIdx=0,t(e).paletteNameMap={}}var jw={Must:1,Might:2,Not:3},Mw=Td();function Nw(e){Mw(e).datasetMap=$l()}function Pw(e,t,n){var r={},i=Fw(t);if(!i||!e)return r;var a=[],o=[],s=t.ecModel,c=Mw(s).datasetMap,l=i.uid+`_`+n.seriesLayoutBy,u,d;e=e.slice(),G(e,function(t,n){var i=Nl(t)?t:e[n]={name:t};i.type===`ordinal`&&u==null&&(u=n,d=m(i)),r[i.name]=[]});var f=c.get(l)||c.set(l,{categoryWayDim:d,valueWayDim:0});G(e,function(e,t){var n=e.name,i=m(e);if(u==null){var s=f.valueWayDim;p(r[n],s,i),p(o,s,i),f.valueWayDim+=i}else if(u===t)p(r[n],0,i),p(a,0,i);else{var s=f.categoryWayDim;p(r[n],s,i),p(o,s,i),f.categoryWayDim+=i}});function p(e,t,n){for(var r=0;rl&&(l=p)}s[0]=c,s[1]=l}},r=function(){return this._data?this._data.length/this._dimSize:0};eT=(e={},e[cv+`_`+pv]={pure:!0,appendData:i},e[cv+`_row`]={pure:!0,appendData:function(){throw Error(`Do not support appendData when set seriesLayoutBy: "row".`)}},e[lv]={pure:!0,appendData:i},e[uv]={pure:!0,appendData:function(e){var t=this._data;G(e,function(e,n){for(var r=t[n]||(t[n]=[]),i=0;i<(e||[]).length;i++)r.push(e[i])})}},e[sv]={appendData:i},e[dv]={persistent:!1,pure:!0,appendData:function(e){this._data=e},clean:function(){this._offset+=this.count(),this._data=null}},e);function i(e){for(var t=0;t=0&&(s=a.interpolatedValue[c])}return s==null?``:s+``})},e.prototype.getRawValue=function(e,t){return mT(this.getData(t),e)},e.prototype.formatTooltip=function(e,t,n){},e}();function _T(e){var t,n;return Nl(e)?e.type&&(n=e):t=e,{text:t,frag:n}}function vT(e){return new yT(e)}var yT=function(){function e(e){e||={},this._reset=e.reset,this._plan=e.plan,this._count=e.count,this._onDirty=e.onDirty,this._dirty=!0}return e.prototype.perform=function(e){var t=this._upstream,n=e&&e.skip;if(this._dirty&&t){var r=this.context;r.data=r.outputData=t.context.outputData}this.__pipeline&&(this.__pipeline.currentTask=this);var i;this._plan&&!n&&(i=this._plan(this.context));var a=l(this._modBy),o=this._modDataCount||0,s=l(e&&e.modBy),c=e&&e.modDataCount||0;(a!==s||o!==c)&&(i=`reset`);function l(e){return!(e>=1)&&(e=1),e}var u;(this._dirty||i===`reset`)&&(this._dirty=!1,u=this._doReset(n)),this._modBy=s,this._modDataCount=c;var d=e&&e.step;if(this._dueEnd=t?t._outputDueEnd:this._count?this._count(this.context):1/0,this._progress){var f=this._dueIndex,p=Math.min(d==null?1/0:this._dueIndex+d,this._dueEnd);if(!n&&(u||f1&&r>0?s:o}};return a;function o(){return t=e?null:at},gte:function(e,t){return e>=t}};(function(){function e(e,t){Ml(t)||$u(``),this._opFn=ST[e],this._rvalFloat=Hu(t)}return e.prototype.evaluate=function(e){return Ml(e)?this._opFn(e,this._rvalFloat):this._opFn(Hu(e),this._rvalFloat)},e})();var CT=function(){function e(e,t){var n=e===`desc`;this._resultLT=n?1:-1,t??=n?`min`:`max`,this._incomparable=t===`min`?-1/0:1/0}return e.prototype.evaluate=function(e,t){var n=Ml(e)?e:Hu(e),r=Ml(t)?t:Hu(t),i=isNaN(n),a=isNaN(r);if(i&&(n=this._incomparable),a&&(r=this._incomparable),i&&a){var o=Y(e),s=Y(t);o&&(n=s?e:0),s&&(r=o?t:0)}return nr?-this._resultLT:0},e}();(function(){function e(e,t){this._rval=t,this._isEQ=e,this._rvalTypeof=typeof t,this._rvalFloat=Hu(t)}return e.prototype.evaluate=function(e){var t=e===this._rval;if(!t){var n=typeof e;n!==this._rvalTypeof&&(n===`number`||this._rvalTypeof===`number`)&&(t=Hu(e)===this._rvalFloat)}return this._isEQ?t:!t},e})();function wT(e){var t=``,n=-1/0,r=-1/0,i=1/0,a=1/0;return e&&(e.g!=null&&(t+=`G`+e.g,n=e.g),e.ge!=null&&(t+=`GE`+e.ge,r=e.ge),e.l!=null&&(t+=`L`+e.l,i=e.l),e.le!=null&&(t+=`LE`+e.le,a=e.le)),{key:t,g:n,ge:r,l:i,le:a}}function TT(e,t){return t>e.g&&t>=e.ge&&t`u`?Array:Uint32Array,RT=typeof Uint16Array>`u`?Array:Uint16Array,zT=typeof Int32Array>`u`?Array:Int32Array,BT=typeof Float64Array>`u`?Array:Float64Array,VT={float:BT,int:zT,ordinal:Array,number:Array,time:BT},HT;function UT(e){return e>65535?LT:RT}function WT(e){var t=e.constructor;return t===Array?e.slice():new t(e)}function GT(e,t,n,r,i){var a=VT[n||`float`];if(i){var o=e[t],s=o&&o.length;if(s!==r){for(var c=new a(r),l=0;lh[1]&&(h[1]=m)}return this._rawCount=this._count=s,{start:o,end:s}},e.prototype._initDataFromProvider=function(e,t,n){for(var r=this._provider,i=this._chunks,a=this._dimensions,o=a.length,s=this._rawExtent,c=K(a,function(e){return e.property}),l=0;lg[1]&&(g[1]=h)}}!r.persistent&&r.clean&&r.clean(),this._rawCount=this._count=t,this._extent=[]},e.prototype.count=function(){return this._count},e.prototype.get=function(e,t){if(!(t>=0&&t=0&&t=this._rawCount||e<0)return-1;if(!this._indices)return e;var t=this._indices,n=t[e];if(n!=null&&ne)i=a-1;else return a}return-1},e.prototype.getIndices=function(){var e,t=this._indices;if(t){var n=t.constructor,r=this._count;if(n===Array){e=new n(r);for(var i=0;i=l&&g<=u||isNaN(g))&&(o[s++]=p),p++}f=!0}else if(i===2){for(var m=d[r[0]],_=d[r[1]],v=e[r[1]][0],y=e[r[1]][1],h=0;h=l&&g<=u||isNaN(g))&&(b>=v&&b<=y||isNaN(b))&&(o[s++]=p),p++}f=!0}}if(!f){if(i===1)for(var h=0;h=l&&g<=u||isNaN(g))&&(o[s++]=x)}else for(var h=0;he[w][1])&&(S=!1)}S&&(o[s++]=t.getRawIndex(h))}}return sg[1]&&(g[1]=h)}}}},e.prototype.lttbDownSample=function(e,t){var n=this.clone([e],!0),r=n._chunks[e],i=this.count(),a=0,o=Math.floor(1/t),s=this.getRawIndex(0),c,l,u,d=new(UT(this._rawCount))(Math.min((Math.ceil(i/o)+2)*2,i));d[a++]=s;for(var f=1;fc&&(c=l,u=v)}T>0&&To&&(m=o-l);for(var h=0;hp&&(p=g,f=l+h)}var _=this.getRawIndex(u),v=this.getRawIndex(f);ul-p&&(s=l-p,o.length=s);for(var m=0;mu[1]&&(u[1]=g),d[f++]=_}return i._count=f,i._indices=d,i._updateGetRawIdx(),i},e.prototype.each=function(e,t){if(this._count)for(var n=e.length,r=this._chunks,i=0,a=this.count();id&&(d=p))}return o[c]=[u,d]},e.prototype.getRawDataItem=function(e){var t=this.getRawIndex(e);if(this._provider.persistent)return this._provider.getItem(t);for(var n=[],r=this._chunks,i=0;i=0?this._indices[e]:-1},e.prototype._updateGetRawIdx=function(){this.getRawIndex=this._indices?this._getRawIdx:this._getRawIdxIdentity},e.internalField=function(){function e(e,t,n,r){return xT(e[r],this._dimensions[r])}HT={arrayRows:e,objectRows:function(e,t,n,r){return xT(e[t],this._dimensions[r])},keyedColumns:e,original:function(e,t,n,r){var i=e&&(e.value==null?e:e.value);return xT(i instanceof Array?i[r]:i,this._dimensions[r])},typedArray:function(e,t,n,r){return e[r]}}}(),e}(),qT=function(){function e(e){this._sourceList=[],this._storeList=[],this._upstreamSignList=[],this._versionSignBase=0,this._dirty=!0,this._sourceHost=e}return e.prototype.dirty=function(){this._setLocalSource([],[]),this._storeList=[],this._dirty=!0},e.prototype._setLocalSource=function(e,t){this._sourceList=e,this._upstreamSignList=t,this._versionSignBase++,this._versionSignBase>9e10&&(this._versionSignBase=0)},e.prototype._getVersionSign=function(){return this._sourceHost.uid+`_`+this._versionSignBase},e.prototype.prepareSource=function(){this._isDirty()&&(this._createSource(),this._dirty=!1)},e.prototype._createSource=function(){this._setLocalSource([],[]);var e=this._sourceHost,t=this._getUpstreamSourceManagers(),n=!!t.length,r,i;if(JT(e)){var a=e,o=void 0,s=void 0,c=void 0;if(n){var l=t[0];l.prepareSource(),c=l.getSource(),o=c.data,s=c.sourceFormat,i=[l._getVersionSign()]}else o=a.get(`data`,!0),s=Fl(o)?dv:sv,i=[];var u=this._getSourceMetaRawOption()||{},d=c&&c.metaRawOption||{},f=X(u.seriesLayoutBy,d.seriesLayoutBy)||null,p=X(u.sourceHeader,d.sourceHeader),m=X(u.dimensions,d.dimensions);r=f!==d.seriesLayoutBy||!!p!=!!d.sourceHeader||m?[Vw(o,{seriesLayoutBy:f,sourceHeader:p,dimensions:m},s)]:[]}else{var h=e;if(n){var g=this._applyTransform(t);r=g.sourceList,i=g.upstreamSignList}else r=[Vw(h.get(`source`,!0),this._getSourceMetaRawOption(),null)],i=[]}this._setLocalSource(r,i)},e.prototype._applyTransform=function(e){var t=this._sourceHost,n=t.get(`transform`,!0),r=t.get(`fromTransformResult`,!0);r!=null&&e.length!==1&&YT(``);var i,a=[],o=[];return G(e,function(e){e.prepareSource();var t=e.getSource(r||0);r!=null&&!t&&YT(``),a.push(t),o.push(e._getVersionSign())}),n?i=PT(n,a,{datasetIndex:t.componentIndex}):r!=null&&(i=[Uw(a[0])]),{sourceList:i,upstreamSignList:o}},e.prototype._isDirty=function(){if(this._dirty)return!0;for(var e=this._getUpstreamSourceManagers(),t=0;tn:i+u+m>n){u?(s||c)&&(h?(s||(s=c,c=``,l=0,u=l),a.push(s),o.push(u-l),c+=p,l+=m,s=``,u=l):(c&&(s+=c,c=``,l=0),a.push(s),o.push(u),s=p,u=m)):h?(a.push(c),o.push(l),c=p,l=m):(a.push(p),o.push(m));continue}u+=m,h?(c+=p,l+=m):(c&&(s+=c,c=``,l=0),s+=p)}return c&&(s+=c),s&&(a.push(s),o.push(u)),a.length===1&&(u+=i),{accumWidth:u,lines:a,linesWidths:o}}function $p(e,t,n,r,i,a){if(e.baseX=n,e.baseY=r,e.outerWidth=e.outerHeight=null,t){var o=t.width*2,s=t.height*2;fp.set(em,Np(n,o,i),Pp(r,s,a),o,s),fp.intersect(t,em,null,tm);var c=tm.outIntersectRect;e.outerWidth=c.width,e.outerHeight=c.height,e.baseX=Np(c.x,c.width,i,!0),e.baseY=Pp(c.y,c.height,a,!0)}}var em=new fp(0,0,0,0),tm={outIntersectRect:{},clamp:!0};function nm(e){return e==null?e=``:e+=``}function rm(e){var t=nm(e.text),n=e.font;return im(e,Ap(wp(n),t),Fp(n),null)}function im(e,t,n,r){var i=new fp(Np(e.x||0,t,e.textAlign),Pp(e.y||0,n,e.textBaseline),t,n),a=r??(am(e)?e.lineWidth:0);return a>0&&(i.x-=a/2,i.y-=a/2,i.width+=a,i.height+=a),i}function am(e){var t=e.stroke;return t!=null&&t!==`none`&&e.lineWidth>0}var om=Df,sm=5e-5;function cm(e){return e>sm||e<-sm}var lm=[],um=[],dm=Ef(),fm=Math.abs,pm=function(){function e(){}return e.prototype.getLocalTransform=function(e){return mm(this,e)},e.prototype.setPosition=function(e){this.x=e[0],this.y=e[1]},e.prototype.setScale=function(e){this.scaleX=e[0],this.scaleY=e[1]},e.prototype.setSkew=function(e){this.skewX=e[0],this.skewY=e[1]},e.prototype.setOrigin=function(e){this.originX=e[0],this.originY=e[1]},e.prototype.needLocalTransform=function(){return cm(this.rotation)||cm(this.x)||cm(this.y)||cm(this.scaleX-1)||cm(this.scaleY-1)||cm(this.skewX)||cm(this.skewY)},e.prototype.updateTransform=function(){var e=this.parent&&this.parent.transform,t=this.needLocalTransform(),n=this.transform;if(!(t||e)){n&&(om(n),this.invTransform=null);return}n||=Ef(),t?this.getLocalTransform(n):om(n),e&&(t?kf(n,e,n):Of(n,e)),this.transform=n,this._resolveGlobalScaleRatio(n),this.invTransform=this.invTransform||Ef(),Nf(this.invTransform,n)},e.prototype._resolveGlobalScaleRatio=function(e){var t=this.globalScaleRatio;if(t!=null&&t!==1){this.getGlobalScale(lm);var n=lm[0]<0?-1:1,r=lm[1]<0?-1:1,i=((lm[0]-n)*t+n)/lm[0]||0,a=((lm[1]-r)*t+r)/lm[1]||0;e[0]*=i,e[1]*=i,e[2]*=a,e[3]*=a}},e.prototype.getComputedTransform=function(){for(var e=this,t=[];e;)t.push(e),e=e.parent;for(;e=t.pop();)e.updateTransform();return this.transform},e.prototype.setLocalTransform=function(e){if(e){var t=e[0]*e[0]+e[1]*e[1],n=e[2]*e[2]+e[3]*e[3],r=Math.atan2(e[1],e[0]),i=Math.PI/2+r-Math.atan2(e[3],e[2]);n=Math.sqrt(n)*Math.cos(i),t=Math.sqrt(t),this.skewX=i,this.skewY=0,this.rotation=-r,this.x=+e[4],this.y=+e[5],this.scaleX=t,this.scaleY=n,this.originX=0,this.originY=0}},e.prototype.decomposeTransform=function(){if(this.transform){var e=this.parent,t=this.transform;e&&e.transform&&(e.invTransform=e.invTransform||Ef(),kf(um,e.invTransform,t),t=um);var n=this.originX,r=this.originY;(n||r)&&(dm[4]=n,dm[5]=r,kf(um,t,dm),um[4]-=n,um[5]-=r,t=um),this.setLocalTransform(t)}},e.prototype.getGlobalScale=function(e){var t=this.transform;return e||=[],t?(e[0]=Math.sqrt(t[0]*t[0]+t[1]*t[1]),e[1]=Math.sqrt(t[2]*t[2]+t[3]*t[3]),t[0]<0&&(e[0]=-e[0]),t[3]<0&&(e[1]=-e[1]),e):(e[0]=1,e[1]=1,e)},e.prototype.transformCoordToLocal=function(e,t){var n=[e,t],r=this.invTransform;return r&&Yf(n,n,r),n},e.prototype.transformCoordToGlobal=function(e,t){var n=[e,t],r=this.transform;return r&&Yf(n,n,r),n},e.prototype.getLineScale=function(){var e=this.transform;return e&&fm(e[0]-1)>1e-10&&fm(e[3]-1)>1e-10?Math.sqrt(fm(e[0]*e[3]-e[2]*e[1])):1},e.prototype.copyTransform=function(e){_m(this,e)},e.getLocalTransform=function(e,t){t||=[];var n=e.originX||0,r=e.originY||0,i=e.scaleX,a=e.scaleY,o=e.anchorX,s=e.anchorY,c=e.rotation||0,l=e.x,u=e.y,d=e.skewX?Math.tan(e.skewX):0,f=e.skewY?Math.tan(-e.skewY):0;if(n||r||o||s){var p=n+o,m=r+s;t[4]=-p*i-d*m*a,t[5]=-m*a-f*p*i}else t[4]=t[5]=0;return t[0]=i,t[3]=a,t[1]=f*i,t[2]=d*a,c&&jf(t,t,c),t[4]+=n+l,t[5]+=r+u,t},e.initDefaultProps=(function(){var t=e.prototype;t.scaleX=t.scaleY=t.globalScaleRatio=1,t.x=t.y=t.originX=t.originY=t.skewX=t.skewY=t.rotation=t.anchorX=t.anchorY=0})(),e}(),mm=pm.getLocalTransform;function hm(){return new pm}var gm=[`x`,`y`,`originX`,`originY`,`anchorX`,`anchorY`,`rotation`,`scaleX`,`scaleY`,`skewX`,`skewY`];function _m(e,t){return vl(e,t,gm)}var vm={linear:function(e){return e},quadraticIn:function(e){return e*e},quadraticOut:function(e){return e*(2-e)},quadraticInOut:function(e){return(e*=2)<1?.5*e*e:-.5*(--e*(e-2)-1)},cubicIn:function(e){return e*e*e},cubicOut:function(e){return--e*e*e+1},cubicInOut:function(e){return(e*=2)<1?.5*e*e*e:.5*((e-=2)*e*e+2)},quarticIn:function(e){return e*e*e*e},quarticOut:function(e){return 1- --e*e*e*e},quarticInOut:function(e){return(e*=2)<1?.5*e*e*e*e:-.5*((e-=2)*e*e*e-2)},quinticIn:function(e){return e*e*e*e*e},quinticOut:function(e){return--e*e*e*e*e+1},quinticInOut:function(e){return(e*=2)<1?.5*e*e*e*e*e:.5*((e-=2)*e*e*e*e+2)},sinusoidalIn:function(e){return 1-Math.cos(e*Math.PI/2)},sinusoidalOut:function(e){return Math.sin(e*Math.PI/2)},sinusoidalInOut:function(e){return .5*(1-Math.cos(Math.PI*e))},exponentialIn:function(e){return e===0?0:1024**(e-1)},exponentialOut:function(e){return e===1?1:1-2**(-10*e)},exponentialInOut:function(e){return e===0?0:e===1?1:(e*=2)<1?.5*1024**(e-1):.5*(-(2**(-10*(e-1)))+2)},circularIn:function(e){return 1-Math.sqrt(1-e*e)},circularOut:function(e){return Math.sqrt(1- --e*e)},circularInOut:function(e){return(e*=2)<1?-.5*(Math.sqrt(1-e*e)-1):.5*(Math.sqrt(1-(e-=2)*e)+1)},elasticIn:function(e){var t,n=.1,r=.4;return e===0?0:e===1?1:(!n||n<1?(n=1,t=r/4):t=r*Math.asin(1/n)/(2*Math.PI),-(n*2**(10*--e)*Math.sin((e-t)*(2*Math.PI)/r)))},elasticOut:function(e){var t,n=.1,r=.4;return e===0?0:e===1?1:(!n||n<1?(n=1,t=r/4):t=r*Math.asin(1/n)/(2*Math.PI),n*2**(-10*e)*Math.sin((e-t)*(2*Math.PI)/r)+1)},elasticInOut:function(e){var t,n=.1,r=.4;return e===0?0:e===1?1:(!n||n<1?(n=1,t=r/4):t=r*Math.asin(1/n)/(2*Math.PI),(e*=2)<1?-.5*(n*2**(10*--e)*Math.sin((e-t)*(2*Math.PI)/r)):n*2**(-10*--e)*Math.sin((e-t)*(2*Math.PI)/r)*.5+1)},backIn:function(e){var t=1.70158;return e*e*((t+1)*e-t)},backOut:function(e){var t=1.70158;return--e*e*((t+1)*e+t)+1},backInOut:function(e){var t=2.5949095;return(e*=2)<1?.5*(e*e*((t+1)*e-t)):.5*((e-=2)*e*((t+1)*e+t)+2)},bounceIn:function(e){return 1-vm.bounceOut(1-e)},bounceOut:function(e){return e<1/2.75?7.5625*e*e:e<2/2.75?7.5625*(e-=1.5/2.75)*e+.75:e<2.5/2.75?7.5625*(e-=2.25/2.75)*e+.9375:7.5625*(e-=2.625/2.75)*e+.984375},bounceInOut:function(e){return e<.5?vm.bounceIn(e*2)*.5:vm.bounceOut(e*2-1)*.5+.5}},ym=Math.pow,bm=Math.sqrt,xm=1e-8,Sm=1e-4,Cm=bm(3),wm=1/3,Tm=Pf(),Em=Pf(),Dm=Pf();function Om(e){return e>-xm&&exm||e<-xm}function Am(e,t,n,r,i){var a=1-i;return a*a*(a*e+3*i*t)+i*i*(i*r+3*a*n)}function jm(e,t,n,r,i){var a=1-i;return 3*(((t-e)*a+2*(n-t)*i)*a+(r-n)*i*i)}function Mm(e,t,n,r,i,a){var o=r+3*(t-n)-e,s=3*(n-t*2+e),c=3*(t-e),l=e-i,u=s*s-3*o*c,d=s*c-9*o*l,f=c*c-3*s*l,p=0;if(Om(u)&&Om(d)){if(Om(s))a[0]=0;else{var m=-c/s;m>=0&&m<=1&&(a[p++]=m)}}else{var h=d*d-4*u*f;if(Om(h)){var g=d/u,m=-s/o+g,_=-g/2;m>=0&&m<=1&&(a[p++]=m),_>=0&&_<=1&&(a[p++]=_)}else if(h>0){var v=bm(h),y=u*s+1.5*o*(-d+v),b=u*s+1.5*o*(-d-v);y=y<0?-ym(-y,wm):ym(y,wm),b=b<0?-ym(-b,wm):ym(b,wm);var m=(-s-(y+b))/(3*o);m>=0&&m<=1&&(a[p++]=m)}else{var x=(2*u*s-3*o*d)/(2*bm(u*u*u)),S=Math.acos(x)/3,C=bm(u),w=Math.cos(S),m=(-s-2*C*w)/(3*o),_=(-s+C*(w+Cm*Math.sin(S)))/(3*o),T=(-s+C*(w-Cm*Math.sin(S)))/(3*o);m>=0&&m<=1&&(a[p++]=m),_>=0&&_<=1&&(a[p++]=_),T>=0&&T<=1&&(a[p++]=T)}}return p}function Nm(e,t,n,r,i){var a=6*n-12*t+6*e,o=9*t+3*r-3*e-9*n,s=3*t-3*e,c=0;if(Om(o)){if(km(a)){var l=-s/a;l>=0&&l<=1&&(i[c++]=l)}}else{var u=a*a-4*o*s;if(Om(u))i[0]=-a/(2*o);else if(u>0){var d=bm(u),l=(-a+d)/(2*o),f=(-a-d)/(2*o);l>=0&&l<=1&&(i[c++]=l),f>=0&&f<=1&&(i[c++]=f)}}return c}function Pm(e,t,n,r,i,a){var o=(t-e)*i+e,s=(n-t)*i+t,c=(r-n)*i+n,l=(s-o)*i+o,u=(c-s)*i+s,d=(u-l)*i+l;a[0]=e,a[1]=o,a[2]=l,a[3]=d,a[4]=d,a[5]=u,a[6]=c,a[7]=r}function Fm(e,t,n,r,i,a,o,s,c,l,u){var d,f=.005,p=1/0,m,h,g,_;Tm[0]=c,Tm[1]=l;for(var v=0;v<1;v+=.05)Em[0]=Am(e,n,i,o,v),Em[1]=Am(t,r,a,s,v),g=qf(Tm,Em),g=0&&g=0&&l<=1&&(i[c++]=l)}}else{var u=o*o-4*a*s;if(Om(u)){var l=-o/(2*a);l>=0&&l<=1&&(i[c++]=l)}else if(u>0){var d=bm(u),l=(-o+d)/(2*a),f=(-o-d)/(2*a);l>=0&&l<=1&&(i[c++]=l),f>=0&&f<=1&&(i[c++]=f)}}return c}function Bm(e,t,n){var r=e+n-2*t;return r===0?.5:(e-t)/r}function Vm(e,t,n,r,i){var a=(t-e)*r+e,o=(n-t)*r+t,s=(o-a)*r+a;i[0]=e,i[1]=a,i[2]=s,i[3]=s,i[4]=o,i[5]=n}function Hm(e,t,n,r,i,a,o,s,c){var l,u=.005,d=1/0;Tm[0]=o,Tm[1]=s;for(var f=0;f<1;f+=.05){Em[0]=Lm(e,n,i,f),Em[1]=Lm(t,r,a,f);var p=qf(Tm,Em);p=0&&p=1?1:Mm(0,r,a,1,e,s)&&Am(0,i,o,1,s[0])}}}var Km=function(){function e(e){this._inited=!1,this._startTime=0,this._pausedTime=0,this._paused=!1,this._life=e.life||1e3,this._delay=e.delay||0,this.loop=e.loop||!1,this.onframe=e.onframe||ru,this.ondestroy=e.ondestroy||ru,this.onrestart=e.onrestart||ru,e.easing&&this.setEasing(e.easing)}return e.prototype.step=function(e,t){if(this._inited||=(this._startTime=e+this._delay,!0),this._paused){this._pausedTime+=t;return}var n=this._life,r=e-this._startTime-this._pausedTime,i=r/n;i<0&&(i=0),i=Math.min(i,1);var a=this.easingFunc,o=a?a(i):i;if(this.onframe(o),i===1){if(this.loop){var s=r%n;this._startTime=e-s,this._pausedTime=0,this.onrestart()}else return!0}return!1},e.prototype.pause=function(){this._paused=!0},e.prototype.resume=function(){this._paused=!1},e.prototype.setEasing=function(e){this.easing=e,this.easingFunc=Al(e)?e:vm[e]||Gm(e)},e}(),qm={transparent:[0,0,0,0],aliceblue:[240,248,255,1],antiquewhite:[250,235,215,1],aqua:[0,255,255,1],aquamarine:[127,255,212,1],azure:[240,255,255,1],beige:[245,245,220,1],bisque:[255,228,196,1],black:[0,0,0,1],blanchedalmond:[255,235,205,1],blue:[0,0,255,1],blueviolet:[138,43,226,1],brown:[165,42,42,1],burlywood:[222,184,135,1],cadetblue:[95,158,160,1],chartreuse:[127,255,0,1],chocolate:[210,105,30,1],coral:[255,127,80,1],cornflowerblue:[100,149,237,1],cornsilk:[255,248,220,1],crimson:[220,20,60,1],cyan:[0,255,255,1],darkblue:[0,0,139,1],darkcyan:[0,139,139,1],darkgoldenrod:[184,134,11,1],darkgray:[169,169,169,1],darkgreen:[0,100,0,1],darkgrey:[169,169,169,1],darkkhaki:[189,183,107,1],darkmagenta:[139,0,139,1],darkolivegreen:[85,107,47,1],darkorange:[255,140,0,1],darkorchid:[153,50,204,1],darkred:[139,0,0,1],darksalmon:[233,150,122,1],darkseagreen:[143,188,143,1],darkslateblue:[72,61,139,1],darkslategray:[47,79,79,1],darkslategrey:[47,79,79,1],darkturquoise:[0,206,209,1],darkviolet:[148,0,211,1],deeppink:[255,20,147,1],deepskyblue:[0,191,255,1],dimgray:[105,105,105,1],dimgrey:[105,105,105,1],dodgerblue:[30,144,255,1],firebrick:[178,34,34,1],floralwhite:[255,250,240,1],forestgreen:[34,139,34,1],fuchsia:[255,0,255,1],gainsboro:[220,220,220,1],ghostwhite:[248,248,255,1],gold:[255,215,0,1],goldenrod:[218,165,32,1],gray:[128,128,128,1],green:[0,128,0,1],greenyellow:[173,255,47,1],grey:[128,128,128,1],honeydew:[240,255,240,1],hotpink:[255,105,180,1],indianred:[205,92,92,1],indigo:[75,0,130,1],ivory:[255,255,240,1],khaki:[240,230,140,1],lavender:[230,230,250,1],lavenderblush:[255,240,245,1],lawngreen:[124,252,0,1],lemonchiffon:[255,250,205,1],lightblue:[173,216,230,1],lightcoral:[240,128,128,1],lightcyan:[224,255,255,1],lightgoldenrodyellow:[250,250,210,1],lightgray:[211,211,211,1],lightgreen:[144,238,144,1],lightgrey:[211,211,211,1],lightpink:[255,182,193,1],lightsalmon:[255,160,122,1],lightseagreen:[32,178,170,1],lightskyblue:[135,206,250,1],lightslategray:[119,136,153,1],lightslategrey:[119,136,153,1],lightsteelblue:[176,196,222,1],lightyellow:[255,255,224,1],lime:[0,255,0,1],limegreen:[50,205,50,1],linen:[250,240,230,1],magenta:[255,0,255,1],maroon:[128,0,0,1],mediumaquamarine:[102,205,170,1],mediumblue:[0,0,205,1],mediumorchid:[186,85,211,1],mediumpurple:[147,112,219,1],mediumseagreen:[60,179,113,1],mediumslateblue:[123,104,238,1],mediumspringgreen:[0,250,154,1],mediumturquoise:[72,209,204,1],mediumvioletred:[199,21,133,1],midnightblue:[25,25,112,1],mintcream:[245,255,250,1],mistyrose:[255,228,225,1],moccasin:[255,228,181,1],navajowhite:[255,222,173,1],navy:[0,0,128,1],oldlace:[253,245,230,1],olive:[128,128,0,1],olivedrab:[107,142,35,1],orange:[255,165,0,1],orangered:[255,69,0,1],orchid:[218,112,214,1],palegoldenrod:[238,232,170,1],palegreen:[152,251,152,1],paleturquoise:[175,238,238,1],palevioletred:[219,112,147,1],papayawhip:[255,239,213,1],peachpuff:[255,218,185,1],peru:[205,133,63,1],pink:[255,192,203,1],plum:[221,160,221,1],powderblue:[176,224,230,1],purple:[128,0,128,1],red:[255,0,0,1],rosybrown:[188,143,143,1],royalblue:[65,105,225,1],saddlebrown:[139,69,19,1],salmon:[250,128,114,1],sandybrown:[244,164,96,1],seagreen:[46,139,87,1],seashell:[255,245,238,1],sienna:[160,82,45,1],silver:[192,192,192,1],skyblue:[135,206,235,1],slateblue:[106,90,205,1],slategray:[112,128,144,1],slategrey:[112,128,144,1],snow:[255,250,250,1],springgreen:[0,255,127,1],steelblue:[70,130,180,1],tan:[210,180,140,1],teal:[0,128,128,1],thistle:[216,191,216,1],tomato:[255,99,71,1],turquoise:[64,224,208,1],violet:[238,130,238,1],wheat:[245,222,179,1],white:[255,255,255,1],whitesmoke:[245,245,245,1],yellow:[255,255,0,1],yellowgreen:[154,205,50,1]};function Jm(e){return e=Math.round(e),e<0?0:e>255?255:e}function Ym(e){return e=Math.round(e),e<0?0:e>360?360:e}function Xm(e){return e<0?0:e>1?1:e}function Zm(e){var t=e;return t.length&&t.charAt(t.length-1)===`%`?Jm(parseFloat(t)/100*255):Jm(parseInt(t,10))}function Qm(e){var t=e;return t.length&&t.charAt(t.length-1)===`%`?Xm(parseFloat(t)/100):Xm(parseFloat(t))}function $m(e,t,n){return n<0?n+=1:n>1&&--n,n*6<1?e+(t-e)*n*6:n*2<1?t:n*3<2?e+(t-e)*(2/3-n)*6:e}function eh(e,t,n){return e+(t-e)*n}function th(e,t,n,r,i){return e[0]=t,e[1]=n,e[2]=r,e[3]=i,e}function nh(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e}var rh=new bf(20),ih=null;function ah(e,t){ih&&nh(ih,t),ih=rh.put(e,ih||t.slice())}function oh(e,t){if(e){t||=[];var n=rh.get(e);if(n)return nh(t,n);e+=``;var r=e.replace(/ /g,``).toLowerCase();if(r in qm)return nh(t,qm[r]),ah(e,t),t;var i=r.length;if(r.charAt(0)===`#`){if(i===4||i===5){var a=parseInt(r.slice(1,4),16);if(!(a>=0&&a<=4095)){th(t,0,0,0,1);return}return th(t,(a&3840)>>4|(a&3840)>>8,a&240|(a&240)>>4,a&15|(a&15)<<4,i===5?parseInt(r.slice(4),16)/15:1),ah(e,t),t}if(i===7||i===9){var a=parseInt(r.slice(1,7),16);if(!(a>=0&&a<=16777215)){th(t,0,0,0,1);return}return th(t,(a&16711680)>>16,(a&65280)>>8,a&255,i===9?parseInt(r.slice(7),16)/255:1),ah(e,t),t}return}var o=r.indexOf(`(`),s=r.indexOf(`)`);if(o!==-1&&s+1===i){var c=r.substr(0,o),l=r.substr(o+1,s-(o+1)).split(`,`),u=1;switch(c){case`rgba`:if(l.length!==4)return l.length===3?th(t,+l[0],+l[1],+l[2],1):th(t,0,0,0,1);u=Qm(l.pop());case`rgb`:if(l.length>=3)return th(t,Zm(l[0]),Zm(l[1]),Zm(l[2]),l.length===3?u:Qm(l[3])),ah(e,t),t;th(t,0,0,0,1);return;case`hsla`:if(l.length!==4){th(t,0,0,0,1);return}return l[3]=Qm(l[3]),sh(l,t),ah(e,t),t;case`hsl`:if(l.length!==3){th(t,0,0,0,1);return}return sh(l,t),ah(e,t),t;default:return}}th(t,0,0,0,1)}}function sh(e,t){var n=(parseFloat(e[0])%360+360)%360/360,r=Qm(e[1]),i=Qm(e[2]),a=i<=.5?i*(r+1):i+r-i*r,o=i*2-a;return t||=[],th(t,Jm($m(o,a,n+1/3)*255),Jm($m(o,a,n)*255),Jm($m(o,a,n-1/3)*255),1),e.length===4&&(t[3]=e[3]),t}function ch(e){if(e){var t=e[0]/255,n=e[1]/255,r=e[2]/255,i=Math.min(t,n,r),a=Math.max(t,n,r),o=a-i,s=(a+i)/2,c,l;if(o===0)c=0,l=0;else{l=s<.5?o/(a+i):o/(2-a-i);var u=((a-t)/6+o/2)/o,d=((a-n)/6+o/2)/o,f=((a-r)/6+o/2)/o;t===a?c=f-d:n===a?c=1/3+u-f:r===a&&(c=2/3+d-u),c<0&&(c+=1),c>1&&--c}var p=[c*360,l,s];return e[3]!=null&&p.push(e[3]),p}}function lh(e,t){var n=oh(e);if(n){for(var r=0;r<3;r++)t<0?n[r]=n[r]*(1-t)|0:n[r]=(255-n[r])*t+n[r]|0,n[r]>255?n[r]=255:n[r]<0&&(n[r]=0);return mh(n,n.length===4?`rgba`:`rgb`)}}function uh(e,t,n){if(t&&t.length&&e>=0&&e<=1){n||=[];var r=e*(t.length-1),i=Math.floor(r),a=Math.ceil(r),o=t[i],s=t[a],c=r-i;return n[0]=Jm(eh(o[0],s[0],c)),n[1]=Jm(eh(o[1],s[1],c)),n[2]=Jm(eh(o[2],s[2],c)),n[3]=Xm(eh(o[3],s[3],c)),n}}function dh(e,t,n){if(t&&t.length&&e>=0&&e<=1){var r=e*(t.length-1),i=Math.floor(r),a=Math.ceil(r),o=oh(t[i]),s=oh(t[a]),c=r-i,l=mh([Jm(eh(o[0],s[0],c)),Jm(eh(o[1],s[1],c)),Jm(eh(o[2],s[2],c)),Xm(eh(o[3],s[3],c))],`rgba`);return n?{color:l,leftIndex:i,rightIndex:a,value:r}:l}}function fh(e,t,n,r){var i=oh(e);if(e)return i=ch(i),t!=null&&(i[0]=Ym(Al(t)?t(i[0]):t)),n!=null&&(i[1]=Qm(Al(n)?n(i[1]):n)),r!=null&&(i[2]=Qm(Al(r)?r(i[2]):r)),mh(sh(i),`rgba`)}function ph(e,t){var n=oh(e);if(n&&t!=null)return n[3]=Xm(t),mh(n,`rgba`)}function mh(e,t){if(e&&e.length){var n=e[0]+`,`+e[1]+`,`+e[2];return(t===`rgba`||t===`hsva`||t===`hsla`)&&(n+=`,`+e[3]),t+`(`+n+`)`}}function hh(e,t){var n=oh(e);return n?(.299*n[0]+.587*n[1]+.114*n[2])*n[3]/255+(1-n[3])*t:0}var gh=new bf(100);function _h(e){if(Y(e)){var t=gh.get(e);return t||(t=lh(e,-.1),gh.put(e,t)),t}if(Ll(e)){var n=W({},e);return n.colorStops=K(e.colorStops,function(e){return{offset:e.offset,color:lh(e.color,-.1)}}),n}return e}function vh(e){return e.type===`linear`}function yh(e){return e.type===`radial`}(function(){return typeof Buffer<`u`&&typeof Buffer.from==`function`?function(e){return Buffer.from(e).toString(`base64`)}:typeof btoa==`function`&&typeof unescape==`function`&&typeof encodeURIComponent==`function`?function(e){return btoa(unescape(encodeURIComponent(e)))}:function(e){return null}})();var bh=Array.prototype.slice;function xh(e,t,n){return(t-e)*n+e}function Sh(e,t,n,r){for(var i=t.length,a=0;ar?t:e,a=Math.min(n,r),o=i[a-1]||{color:[0,0,0,0],offset:0},s=a;so)r.length=o;else for(var s=a;s=1},e.prototype.getAdditiveTrack=function(){return this._additiveTrack},e.prototype.addKeyframe=function(e,t,n){this._needsSort=!0;var r=this.keyframes,i=r.length,a=!1,o=Lh,s=t;if(Cl(t)){var c=Ah(t);o=c,(c===1&&!Ml(t[0])||c===2&&!Ml(t[0][0]))&&(a=!0)}else if(Ml(t)&&!zl(t))o=jh;else if(Y(t)){if(!isNaN(+t))o=jh;else{var l=oh(t);l&&(s=l,o=Ph)}}else if(Ll(t)){var u=W({},s);u.colorStops=K(t.colorStops,function(e){return{offset:e.offset,color:oh(e.color)}}),vh(t)?o=Fh:yh(t)&&(o=Ih),s=u}i===0?this.valType=o:(o!==this.valType||o===Lh)&&(a=!0),this.discrete=this.discrete||a;var d={time:e,value:s,rawValue:t,percent:0};return n&&(d.easing=n,d.easingFunc=Al(n)?n:vm[n]||Gm(n)),r.push(d),d},e.prototype.prepare=function(e,t){var n=this.keyframes;this._needsSort&&n.sort(function(e,t){return e.time-t.time});for(var r=this.valType,i=n.length,a=n[i-1],o=this.discrete,s=zh(r),c=Rh(r),l=0;l=0&&!(a[l].percent<=t);l--);l=d(l,o-2)}else{for(l=u;lt);l++);l=d(l-1,o-2)}p=a[l+1],f=a[l]}if(f&&p){this._lastFr=l,this._lastFrP=t;var m=p.percent-f.percent,h=m===0?1:d((t-f.percent)/m,1);p.easingFunc&&(h=p.easingFunc(h));var g=n?this._additiveValue:c?Bh:e[s];if((zh(i)||c)&&!g&&(g=this._additiveValue=[]),this.discrete)e[s]=h<1?f.rawValue:p.rawValue;else if(zh(i))i===Mh?Sh(g,f[r],p[r],h):Ch(g,f[r],p[r],h);else if(Rh(i)){var _=f[r],v=p[r],y=i===Fh;e[s]={type:y?`linear`:`radial`,x:xh(_.x,v.x,h),y:xh(_.y,v.y,h),colorStops:K(_.colorStops,function(e,t){var n=v.colorStops[t];return{offset:xh(e.offset,n.offset,h),color:kh(Sh([],e.color,n.color,h))}}),global:v.global},y?(e[s].x2=xh(_.x2,v.x2,h),e[s].y2=xh(_.y2,v.y2,h)):e[s].r=xh(_.r,v.r,h)}else if(c)Sh(g,f[r],p[r],h),n||(e[s]=kh(g));else{var b=xh(f[r],p[r],h);n?this._additiveValue=b:e[s]=b}n&&this._addToTarget(e)}}},e.prototype._addToTarget=function(e){var t=this.valType,n=this.propName,r=this._additiveValue;t===jh?e[n]=e[n]+r:t===Ph?(oh(e[n],Bh),wh(Bh,Bh,r,1),e[n]=kh(Bh)):t===Mh?wh(e[n],e[n],r,1):t===Nh&&Th(e[n],e[n],r,1)},e}(),Hh=function(){function e(e,t,n,r){if(this._tracks={},this._trackKeys=[],this._maxTime=0,this._started=0,this._clip=null,this._target=e,this._loop=t,t&&r){ml(`Can' use additive animation on looped animation.`);return}this._additiveAnimators=r,this._allowDiscrete=n}return e.prototype.getMaxTime=function(){return this._maxTime},e.prototype.getDelay=function(){return this._delay},e.prototype.getLoop=function(){return this._loop},e.prototype.getTarget=function(){return this._target},e.prototype.changeTarget=function(e){this._target=e},e.prototype.when=function(e,t,n){return this.whenWithKeys(e,t,Dl(t),n)},e.prototype.whenWithKeys=function(e,t,n,r){for(var i=this._tracks,a=0;a0&&s.addKeyframe(0,Oh(c),r),this._trackKeys.push(o)}s.addKeyframe(e,Oh(t[o]),r)}return this._maxTime=Math.max(this._maxTime,e),this},e.prototype.pause=function(){this._clip.pause(),this._paused=!0},e.prototype.resume=function(){this._clip.resume(),this._paused=!1},e.prototype.isPaused=function(){return!!this._paused},e.prototype.duration=function(e){return this._maxTime=e,this._force=!0,this},e.prototype._doneCallback=function(){this._setTracksFinished(),this._clip=null;var e=this._doneCbs;if(e)for(var t=e.length,n=0;n0)){this._started=1;for(var t=this,n=[],r=this._maxTime||0,i=0;i1){var o=a.pop();i.addKeyframe(o.time,e[r]),i.prepare(this._maxTime,i.getAdditiveTrack())}}}},e}(),Uh=function(){function e(e){e&&(this._$eventProcessor=e)}return e.prototype.on=function(e,t,n,r){this._$handlers||={};var i=this._$handlers;if(typeof t==`function`&&(r=n,n=t,t=null),!n||!e)return this;var a=this._$eventProcessor;t!=null&&a&&a.normalizeQuery&&(t=a.normalizeQuery(t)),i[e]||(i[e]=[]);for(var o=0;o=0:n.inside,y=void 0,b=void 0,x=void 0;v&&this.canBeInsideText()?(y=n.insideFill,b=n.insideStroke,(y==null||y===`auto`)&&(y=this.getInsideTextFill()),(b==null||b===`auto`)&&(b=this.getInsideTextStroke(y),x=!0)):(y=n.outsideFill,b=n.outsideStroke,(y==null||y===`auto`)&&(y=this.getOutsideFill()),(b==null||b===`auto`)&&(b=this.getOutsideStroke(y),x=!0)),y||=`#000`,(y!==g.fill||b!==g.stroke||x!==g.autoStroke||a!==g.align||o!==g.verticalAlign)&&(s=!0,g.fill=y,g.stroke=b,g.autoStroke=x,g.align=a,g.verticalAlign=o,t.setDefaultTextStyle(g)),t.__dirty|=1,s&&t.dirtyStyle(!0)}},e.prototype.canBeInsideText=function(){return!0},e.prototype.getInsideTextFill=function(){return`#fff`},e.prototype.getInsideTextStroke=function(e){return`#000`},e.prototype.getOutsideFill=function(){return this.__zr&&this.__zr.isDarkMode()?Jh:qh},e.prototype.getOutsideStroke=function(e){var t=this.__zr&&this.__zr.getBackgroundColor(),n=typeof t==`string`&&oh(t);n||=[255,255,255,1];for(var r=n[3],i=this.__zr.isDarkMode(),a=0;a<3;a++)n[a]=n[a]*r+(i?0:255)*(1-r);return n[3]=1,mh(n,`rgba`)},e.prototype.traverse=function(e,t){},e.prototype.attrKV=function(e,t){e===`textConfig`?this.setTextConfig(t):e===`textContent`?this.setTextContent(t):e===`clipPath`?this.setClipPath(t):e===`extra`?(this.extra=this.extra||{},W(this.extra,t)):this[e]=t},e.prototype.hide=function(){this.ignore=!0,this.markRedraw()},e.prototype.show=function(){this.ignore=!1,this.markRedraw()},e.prototype.attr=function(e,t){if(typeof e==`string`)this.attrKV(e,t);else if(Nl(e))for(var n=Dl(e),r=0;r0},e.prototype.getState=function(e){return this.states[e]},e.prototype.ensureState=function(e){var t=this.states;return t[e]||(t[e]={}),t[e]},e.prototype.clearStates=function(e){this.useState(Xh,!1,e)},e.prototype.useState=function(e,t,n,r){var i=e===Xh;if(this.hasState()||!i){var a=this.currentStates,o=this.stateTransition;if(!(bl(a,e)>=0&&(t||a.length===1))){var s;if(this.stateProxy&&!i&&(s=this.stateProxy(e)),s||=this.states&&this.states[e],!s&&!i){ml(`State `+e+` not exists.`);return}i||this.saveCurrentToNormalState(s);var c=this._textContent,l=ug(this,c,s,r);l&&!this.__inHover&&(this.__inHover=l),this._applyStateObj(e,s,this._normalState,t,fg(this,n,o),o);var u=this._textGuide;return c&&c.useState(e,t,n,!!l),u&&u.useState(e,t,n,!!l),i?(this.currentStates=[],this._normalState={}):t?this.currentStates.push(e):this.currentStates=[e],this._updateAnimationTargets(),this.markRedraw(),!l&&this.__inHover&&(this.__inHover=0,this.__dirty&=-2),s}}},e.prototype.useStates=function(e,t,n){if(!e.length)this.clearStates();else{var r=[],i=this.currentStates,a=e.length,o=a===i.length;if(o){for(var s=0;s=0){var n=this.currentStates.slice();n.splice(t,1),this.useStates(n)}},e.prototype.replaceState=function(e,t,n){var r=this.currentStates.slice(),i=bl(r,e),a=bl(r,t)>=0;i>=0?a?r.splice(i,1):r[i]=t:n&&!a&&r.push(t),this.useStates(r)},e.prototype.toggleState=function(e,t){t?this.useState(e,!0):this.removeState(e)},e.prototype._mergeStates=function(e){for(var t={},n,r=0;r=0&&t.splice(n,1)}),this.animators.push(e),n&&n.animation.addAnimator(e),n&&n.wakeUp()},e.prototype.updateDuringAnimation=function(e){this.markRedraw()},e.prototype.stopAnimation=function(e,t){for(var n=this.animators,r=n.length,i=[],a=0;a0&&n.during&&a[0].during(function(e,t){n.during(t)});for(var f=0;f0||i.force&&!o.length){var C=void 0,w=void 0,T=void 0;if(s){w={},f&&(C={});for(var b=0;b0}var pg=`__zr_style_`+Math.round(Math.random()*10),mg={shadowBlur:0,shadowOffsetX:0,shadowOffsetY:0,shadowColor:`#000`,opacity:1,blend:`source-over`},hg={style:{shadowBlur:!0,shadowOffsetX:!0,shadowOffsetY:!0,shadowColor:!0,opacity:!0}};mg[pg]=!0;var gg=[`z`,`z2`,`invisible`],_g=[`invisible`],vg=function(e){U(t,e);function t(t){return e.call(this,t)||this}return t.prototype._init=function(t){for(var n=Dl(t),r=0;r1e-4){s[0]=e-n,s[1]=t-r,c[0]=e+n,c[1]=t+r;return}if(Dg[0]=Tg(i)*n+e,Dg[1]=wg(i)*r+t,Og[0]=Tg(a)*n+e,Og[1]=wg(a)*r+t,l(s,Dg,Og),u(c,Dg,Og),i%=Eg,i<0&&(i+=Eg),a%=Eg,a<0&&(a+=Eg),i>a&&!o?a+=Eg:ii&&(kg[0]=Tg(p)*n+e,kg[1]=wg(p)*r+t,l(s,kg,s),u(c,kg,c))}var Ig={M:1,L:2,C:3,Q:4,A:5,Z:6,R:7},Lg=[],Rg=[],zg=[],Bg=[],Vg=[],Hg=[],Ug=Math.min,Wg=Math.max,Gg=Math.cos,Kg=Math.sin,qg=Math.abs,Jg=Math.PI,Yg=Jg*2,Xg=typeof Float32Array<`u`,Zg=[];function Qg(e){return Math.round(e/Jg*1e8)/1e8%2*Jg}function $g(e,t){var n=Qg(e[0]);n<0&&(n+=Yg);var r=n-e[0],i=e[1];i+=r,!t&&i-n>=Yg?i=n+Yg:t&&n-i>=Yg?i=n-Yg:!t&&n>i?i=n+(Yg-Qg(n-i)):t&&n0&&(this._ux=qg(n/Gh/e)||0,this._uy=qg(n/Gh/t)||0)},e.prototype.setDPR=function(e){this.dpr=e},e.prototype.setContext=function(e){this._ctx=e},e.prototype.getContext=function(){return this._ctx},e.prototype.beginPath=function(){return this._ctx&&this._ctx.beginPath(),this.reset(),this},e.prototype.reset=function(){this._saveData&&(this._len=0),this._pathSegLen&&(this._pathSegLen=null,this._pathLen=0),this._version++},e.prototype.moveTo=function(e,t){return this._drawPendingPt(),this.addData(Ig.M,e,t),this._ctx&&this._ctx.moveTo(e,t),this._x0=e,this._y0=t,this._xi=e,this._yi=t,this},e.prototype.lineTo=function(e,t){var n=qg(e-this._xi),r=qg(t-this._yi),i=n>this._ux||r>this._uy;if(this.addData(Ig.L,e,t),this._ctx&&i&&this._ctx.lineTo(e,t),i)this._xi=e,this._yi=t,this._pendingPtDist=0;else{var a=n*n+r*r;a>this._pendingPtDist&&(this._pendingPtX=e,this._pendingPtY=t,this._pendingPtDist=a)}return this},e.prototype.bezierCurveTo=function(e,t,n,r,i,a){return this._drawPendingPt(),this.addData(Ig.C,e,t,n,r,i,a),this._ctx&&this._ctx.bezierCurveTo(e,t,n,r,i,a),this._xi=i,this._yi=a,this},e.prototype.quadraticCurveTo=function(e,t,n,r){return this._drawPendingPt(),this.addData(Ig.Q,e,t,n,r),this._ctx&&this._ctx.quadraticCurveTo(e,t,n,r),this._xi=n,this._yi=r,this},e.prototype.arc=function(e,t,n,r,i,a){this._drawPendingPt(),Zg[0]=r,Zg[1]=i,$g(Zg,a),r=Zg[0],i=Zg[1];var o=i-r;return this.addData(Ig.A,e,t,n,n,r,o,0,+!a),this._ctx&&this._ctx.arc(e,t,n,r,i,a),this._xi=Gg(i)*n+e,this._yi=Kg(i)*n+t,this},e.prototype.arcTo=function(e,t,n,r,i){return this._drawPendingPt(),this._ctx&&this._ctx.arcTo(e,t,n,r,i),this},e.prototype.rect=function(e,t,n,r){return this._drawPendingPt(),this._ctx&&this._ctx.rect(e,t,n,r),this.addData(Ig.R,e,t,n,r),this},e.prototype.closePath=function(){this._drawPendingPt(),this.addData(Ig.Z);var e=this._ctx,t=this._x0,n=this._y0;return e&&e.closePath(),this._xi=t,this._yi=n,this},e.prototype.fill=function(e){e&&e.fill(),this.toStatic()},e.prototype.stroke=function(e){e&&e.stroke(),this.toStatic()},e.prototype.len=function(){return this._len},e.prototype.setData=function(e){if(this._saveData){var t=e.length;!(this.data&&this.data.length===t)&&Xg&&(this.data=new Float32Array(t));for(var n=0;n0&&a))for(var o=0;ol.length&&(this._expandData(),l=this.data);for(var u=0;u0&&(this._ctx&&this._ctx.lineTo(this._pendingPtX,this._pendingPtY),this._pendingPtDist=0)},e.prototype._expandData=function(){if(!(this.data instanceof Array)){for(var e=[],t=0;t11&&(this.data=new Float32Array(e)))}},e.prototype.getBoundingRect=function(){zg[0]=zg[1]=Vg[0]=Vg[1]=Number.MAX_VALUE,Bg[0]=Bg[1]=Hg[0]=Hg[1]=-Number.MAX_VALUE;for(var e=this.data,t=0,n=0,r=0,i=0,a=0;an||qg(v)>r||d===t-1)&&(m=Math.sqrt(_*_+v*v),i=h,a=g);break;case Ig.C:var y=e[d++],b=e[d++],h=e[d++],g=e[d++],x=e[d++],S=e[d++];m=Im(i,a,y,b,h,g,x,S,10),i=x,a=S;break;case Ig.Q:var y=e[d++],b=e[d++],h=e[d++],g=e[d++];m=Um(i,a,y,b,h,g,10),i=h,a=g;break;case Ig.A:var C=e[d++],w=e[d++],T=e[d++],E=e[d++],D=e[d++],O=e[d++],k=O+D;d+=1,p&&(o=Gg(D)*T+C,s=Kg(D)*E+w),m=Wg(T,E)*Ug(Yg,Math.abs(O)),i=Gg(k)*T+C,a=Kg(k)*E+w;break;case Ig.R:o=i=e[d++],s=a=e[d++];var A=e[d++],j=e[d++];m=A*2+j*2;break;case Ig.Z:var _=o-i,v=s-a;m=Math.sqrt(_*_+v*v),i=o,a=s}m>=0&&(c[u++]=m,l+=m)}return this._pathLen=l,l},e.prototype.rebuildPath=function(e,t){var n=this.data,r=this._ux,i=this._uy,a=this._len,o,s,c,l,u,d,f=t<1,p,m,h=0,g=0,_,v=0,y,b;if(!(f&&(this._pathSegLen||this._calculateLength(),p=this._pathSegLen,m=this._pathLen,_=t*m,!_)))lo:for(var x=0;x0&&(e.lineTo(y,b),v=0),S){case Ig.M:o=c=n[x++],s=l=n[x++],e.moveTo(c,l);break;case Ig.L:u=n[x++],d=n[x++];var w=qg(u-c),T=qg(d-l);if(w>r||T>i){if(f){var E=p[g++];if(h+E>_){var D=(_-h)/E;e.lineTo(c*(1-D)+u*D,l*(1-D)+d*D);break lo}h+=E}e.lineTo(u,d),c=u,l=d,v=0}else{var O=w*w+T*T;O>v&&(y=u,b=d,v=O)}break;case Ig.C:var k=n[x++],A=n[x++],j=n[x++],M=n[x++],N=n[x++],P=n[x++];if(f){var E=p[g++];if(h+E>_){var D=(_-h)/E;Pm(c,k,j,N,D,Lg),Pm(l,A,M,P,D,Rg),e.bezierCurveTo(Lg[1],Rg[1],Lg[2],Rg[2],Lg[3],Rg[3]);break lo}h+=E}e.bezierCurveTo(k,A,j,M,N,P),c=N,l=P;break;case Ig.Q:var k=n[x++],A=n[x++],j=n[x++],M=n[x++];if(f){var E=p[g++];if(h+E>_){var D=(_-h)/E;Vm(c,k,j,D,Lg),Vm(l,A,M,D,Rg),e.quadraticCurveTo(Lg[1],Rg[1],Lg[2],Rg[2]);break lo}h+=E}e.quadraticCurveTo(k,A,j,M),c=j,l=M;break;case Ig.A:var F=n[x++],I=n[x++],L=n[x++],ee=n[x++],te=n[x++],ne=n[x++],re=n[x++],ie=!n[x++],ae=L>ee?L:ee,R=qg(L-ee)>.001,oe=te+ne,z=!1;if(f){var E=p[g++];h+E>_&&(oe=te+ne*(_-h)/E,z=!0),h+=E}if(R&&e.ellipse?e.ellipse(F,I,L,ee,re,te,oe,ie):e.arc(F,I,ae,te,oe,ie),z)break lo;C&&(o=Gg(te)*L+F,s=Kg(te)*ee+I),c=Gg(oe)*L+F,l=Kg(oe)*ee+I;break;case Ig.R:o=c=n[x],s=l=n[x+1],u=n[x++],d=n[x++];var se=n[x++],ce=n[x++];if(f){var E=p[g++];if(h+E>_){var le=_-h;e.moveTo(u,d),e.lineTo(u+Ug(le,se),d),le-=se,le>0&&e.lineTo(u+se,d+Ug(le,ce)),le-=ce,le>0&&e.lineTo(u+Wg(se-le,0),d+ce),le-=se,le>0&&e.lineTo(u,d+Wg(ce-le,0));break lo}h+=E}e.rect(u,d,se,ce);break;case Ig.Z:if(f){var E=p[g++];if(h+E>_){var D=(_-h)/E;e.lineTo(c*(1-D)+o*D,l*(1-D)+s*D);break lo}h+=E}e.closePath(),c=o,l=s}}},e.prototype.clone=function(){var t=new e,n=this.data;return t.data=n.slice?n.slice():Array.prototype.slice.call(n),t._len=this._len,t},e.prototype.canSave=function(){return!!this._saveData},e.CMD=Ig,e.initDefaultProps=(function(){var t=e.prototype;t._saveData=!0,t._ux=0,t._uy=0,t._pendingPtDist=0,t._version=0})(),e}();function t_(e,t,n,r,i,a,o){if(i===0)return!1;var s=i,c=0,l=e;if(o>t+s&&o>r+s||oe+s&&a>n+s||at+d&&u>r+d&&u>a+d&&u>s+d||ue+d&&l>n+d&&l>i+d&&l>o+d||lt+l&&c>r+l&&c>a+l||ce+l&&s>n+l&&s>i+l||sn||u+li&&(i+=o_);var f=Math.atan2(c,s);return f<0&&(f+=o_),f>=r&&f<=i||f+o_>=r&&f+o_<=i}function c_(e,t,n,r,i,a){if(a>t&&a>r||ai?s:0}var l_=e_.CMD,u_=Math.PI*2,d_=1e-4;function f_(e,t){return Math.abs(e-t)t&&l>r&&l>a&&l>s||l1&&h_(),p=Am(t,r,a,s,m_[0]),f>1&&(m=Am(t,r,a,s,m_[1]))),f===2?gt&&s>r&&s>a||s=0&&l<=1){for(var u=0,d=Lm(t,r,a,l),f=0;fn||s<-n)return 0;var c=Math.sqrt(n*n-s*s);p_[0]=-c,p_[1]=c;var l=Math.abs(r-i);if(l<1e-4)return 0;if(l>=u_-1e-4){r=0,i=u_;var u=a?1:-1;return o>=p_[0]+e&&o<=p_[1]+e?u:0}if(r>i){var d=r;r=i,i=d}r<0&&(r+=u_,i+=u_);for(var f=0,p=0;p<2;p++){var m=p_[p];if(m+e>o){var h=Math.atan2(s,m),u=a?1:-1;h<0&&(h=u_+h),(h>=r&&h<=i||h+u_>=r&&h+u_<=i)&&(h>Math.PI/2&&h1&&(n||(s+=c_(c,l,u,d,r,i))),g&&(c=a[m],l=a[m+1],u=c,d=l),h){case l_.M:u=a[m++],d=a[m++],c=u,l=d;break;case l_.L:if(n){if(t_(c,l,a[m],a[m+1],t,r,i))return!0}else s+=c_(c,l,a[m],a[m+1],r,i)||0;c=a[m++],l=a[m++];break;case l_.C:if(n){if(n_(c,l,a[m++],a[m++],a[m++],a[m++],a[m],a[m+1],t,r,i))return!0}else s+=g_(c,l,a[m++],a[m++],a[m++],a[m++],a[m],a[m+1],r,i)||0;c=a[m++],l=a[m++];break;case l_.Q:if(n){if(r_(c,l,a[m++],a[m++],a[m],a[m+1],t,r,i))return!0}else s+=__(c,l,a[m++],a[m++],a[m],a[m+1],r,i)||0;c=a[m++],l=a[m++];break;case l_.A:var _=a[m++],v=a[m++],y=a[m++],b=a[m++],x=a[m++],S=a[m++];m+=1;var C=!!(1-a[m++]);f=Math.cos(x)*y+_,p=Math.sin(x)*b+v,g?(u=f,d=p):s+=c_(c,l,f,p,r,i);var w=(r-_)*b/y+_;if(n){if(s_(_,v,b,x,x+S,C,t,w,i))return!0}else s+=v_(_,v,b,x,x+S,C,w,i);c=Math.cos(x+S)*y+_,l=Math.sin(x+S)*b+v;break;case l_.R:u=c=a[m++],d=l=a[m++];var T=a[m++],E=a[m++];if(f=u+T,p=d+E,n){if(t_(u,d,f,d,t,r,i)||t_(f,d,f,p,t,r,i)||t_(f,p,u,p,t,r,i)||t_(u,p,u,d,t,r,i))return!0}else s+=c_(f,d,f,p,r,i),s+=c_(u,p,u,d,r,i);break;case l_.Z:if(n){if(t_(c,l,u,d,t,r,i))return!0}else s+=c_(c,l,u,d,r,i);c=u,l=d}}return!n&&!f_(l,d)&&(s+=c_(c,l,u,d,r,i)||0),s!==0}function b_(e,t,n){return y_(e,0,!1,t,n)}function x_(e,t,n,r){return y_(e,t,!0,n,r)}var S_=yl({fill:`#000`,stroke:null,strokePercent:1,fillOpacity:1,strokeOpacity:1,lineDashOffset:0,lineWidth:1,lineCap:`butt`,miterLimit:10,strokeNoScale:!1,strokeFirst:!1},mg),C_={style:yl({fill:!0,stroke:!0,strokePercent:!0,fillOpacity:!0,strokeOpacity:!0,lineDashOffset:!0,lineWidth:!0,miterLimit:!0},hg.style)},w_=gm.concat([`invisible`,`culling`,`z`,`z2`,`zlevel`,`parent`]),T_=function(e){U(t,e);function t(t){return e.call(this,t)||this}return t.prototype.update=function(){var n=this;e.prototype.update.call(this);var r=this.style;if(r.decal){var i=this._decalEl=this._decalEl||new t;i.buildPath===t.prototype.buildPath&&(i.buildPath=function(e){n.buildPath(e,n.shape)}),i.silent=!0;var a=i.style;for(var o in r)a[o]!==r[o]&&(a[o]=r[o]);a.fill=r.fill?r.decal:null,a.decal=null,a.shadowColor=null,r.strokeFirst&&(a.stroke=null);for(var s=0;s.5?qh:t>.2?Yh:Jh}if(e)return Jh}return qh},t.prototype.getInsideTextStroke=function(e){var t=this.style.fill;if(Y(t)){var n=this.__zr;if(!!(n&&n.isDarkMode())==hh(e,0)<.4)return t}},t.prototype.buildPath=function(e,t,n){},t.prototype.pathUpdated=function(){this.__dirty&=-5},t.prototype.getUpdatedPathProxy=function(e){return!this.path&&this.createPathProxy(),this.path.beginPath(),this.buildPath(this.path,this.shape,e),this.path},t.prototype.createPathProxy=function(){this.path=new e_(!1)},t.prototype.hasStroke=function(){var e=this.style,t=e.stroke;return!(t==null||t===`none`||!(e.lineWidth>0))},t.prototype.hasFill=function(){var e=this.style.fill;return e!=null&&e!==`none`},t.prototype.getBoundingRect=function(){var e=this._rect,t=this.style,n=!e;if(n){var r=!1;this.path||(r=!0,this.createPathProxy());var i=this.path;(r||this.__dirty&4)&&(i.beginPath(),this.buildPath(i,this.shape,!1),this.pathUpdated()),e=i.getBoundingRect()}if(this._rect=e,this.hasStroke()&&this.path&&this.path.len()>0){var a=this._rectStroke||=e.clone();if(this.__dirty||n){a.copy(e);var o=t.strokeNoScale?this.getLineScale():1,s=t.lineWidth;if(!this.hasFill()){var c=this.strokeContainThreshold;s=Math.max(s,c??4)}o>1e-10&&(a.width+=s/o,a.height+=s/o,a.x-=s/o/2,a.y-=s/o/2)}return a}return e},t.prototype.contain=function(e,t){var n=this.transformCoordToLocal(e,t),r=this.getBoundingRect(),i=this.style;if(e=n[0],t=n[1],r.contain(e,t)){var a=this.path;if(this.hasStroke()){var o=i.lineWidth,s=i.strokeNoScale?this.getLineScale():1;if(s>1e-10&&(this.hasFill()||(o=Math.max(o,this.strokeContainThreshold)),x_(a,o/s,e,t)))return!0}if(this.hasFill())return b_(a,e,t)}return!1},t.prototype.dirtyShape=function(){this.__dirty|=4,this._rect&&=null,this._decalEl&&this._decalEl.dirtyShape(),this.markRedraw()},t.prototype.dirty=function(){this.dirtyStyle(),this.dirtyShape()},t.prototype.animateShape=function(e){return this.animate(`shape`,e)},t.prototype.updateDuringAnimation=function(e){e===`style`?this.dirtyStyle():e===`shape`?this.dirtyShape():this.markRedraw()},t.prototype.attrKV=function(t,n){t===`shape`?this.setShape(n):e.prototype.attrKV.call(this,t,n)},t.prototype.setShape=function(e,t){var n=this.shape;return n||=this.shape={},typeof e==`string`?n[e]=t:W(n,e),this.dirtyShape(),this},t.prototype.shapeChanged=function(){return!!(this.__dirty&4)},t.prototype.createStyle=function(e){return tu(S_,e)},t.prototype._innerSaveToNormal=function(t){e.prototype._innerSaveToNormal.call(this,t);var n=this._normalState;t.shape&&!n.shape&&(n.shape=W({},this.shape))},t.prototype._applyStateObj=function(t,n,r,i,a,o){if(e.prototype._applyStateObj.call(this,t,n,r,i,a,o),this.__inHover!==1){var s=!(n&&i),c;if(n&&n.shape?a?i?c=n.shape:(c=W({},r.shape),W(c,n.shape)):(c=W({},i?this.shape:r.shape),W(c,n.shape)):s&&(c=r.shape),c){if(a){this.shape=W({},this.shape);for(var l={},u=Dl(c),d=0;di&&(d=s+c,s*=i/d,c*=i/d),l+u>i&&(d=l+u,l*=i/d,u*=i/d),c+l>a&&(d=c+l,c*=a/d,l*=a/d),s+u>a&&(d=s+u,s*=a/d,u*=a/d),e.moveTo(n+s,r),e.lineTo(n+i-c,r),c!==0&&e.arc(n+i-c,r+c,c,-Math.PI/2,0),e.lineTo(n+i,r+a-l),l!==0&&e.arc(n+i-l,r+a-l,l,0,Math.PI/2),e.lineTo(n+u,r+a),u!==0&&e.arc(n+u,r+a-u,u,Math.PI/2,Math.PI),e.lineTo(n,r+s),s!==0&&e.arc(n+s,r+s,s,Math.PI,Math.PI*1.5),e.closePath()}var N_=Math.round;function P_(e,t,n){if(t){var r=t.x1,i=t.x2,a=t.y1,o=t.y2;e.x1=r,e.x2=i,e.y1=a,e.y2=o;var s=n&&n.lineWidth;return s?(N_(r*2)===N_(i*2)&&(e.x1=e.x2=I_(r,s,!0)),N_(a*2)===N_(o*2)&&(e.y1=e.y2=I_(a,s,!0)),e):e}}function F_(e,t,n){if(t){var r=t.x,i=t.y,a=t.width,o=t.height;e.x=r,e.y=i,e.width=a,e.height=o;var s=n&&n.lineWidth;return s?(e.x=I_(r,s,!0),e.y=I_(i,s,!0),e.width=Math.max(I_(r+a,s,!1)-e.x,a===0?0:1),e.height=Math.max(I_(i+o,s,!1)-e.y,o===0?0:1),e):e}}function I_(e,t,n){if(!t)return e;var r=N_(e*2);return(r+N_(t))%2==0?r/2:(r+(n?1:-1))/2}var L_=function(){function e(){this.x=0,this.y=0,this.width=0,this.height=0}return e}(),R_={},z_=function(e){U(t,e);function t(t){return e.call(this,t)||this}return t.prototype.getDefaultShape=function(){return new L_},t.prototype.buildPath=function(e,t){var n,r,i,a;if(this.subPixelOptimize){var o=F_(R_,t,this.style);n=o.x,r=o.y,i=o.width,a=o.height,o.r=t.r,t=o}else n=t.x,r=t.y,i=t.width,a=t.height;t.r?M_(e,t):e.rect(n,r,i,a)},t.prototype.isZeroArea=function(){return!this.shape.width||!this.shape.height},t}(T_);z_.prototype.type=`rect`;var B_={fill:`#000`},V_=2,H_={},U_={style:yl({fill:!0,stroke:!0,fillOpacity:!0,strokeOpacity:!0,lineWidth:!0,fontSize:!0,lineHeight:!0,width:!0,height:!0,textShadowColor:!0,textShadowBlur:!0,textShadowOffsetX:!0,textShadowOffsetY:!0,backgroundColor:!0,padding:!0,borderColor:!0,borderWidth:!0,borderRadius:!0},hg.style)},W_=function(e){U(t,e);function t(t){var n=e.call(this)||this;return n.type=`text`,n._children=[],n._defaultStyle=B_,n.attr(t),n}return t.prototype.childrenRef=function(){return this._children},t.prototype.update=function(){e.prototype.update.call(this),this.styleChanged()&&this._updateSubTexts();for(var t=0;t0,T=0;T=0&&(D=y[E],D.align===`right`);)this._placeToken(D,e,x,m,T,`right`,g),S-=D.width,T-=D.width,E--;for(w+=(s-(w-p)-(h-T)-S)/2;C<=E;)D=y[C],this._placeToken(D,e,x,m,w+D.width/2,`center`,g),w+=D.width,C++;m+=x}},t.prototype._placeToken=function(e,t,n,r,i,a,o){var s=t.rich[e.styleName]||{};s.text=e.text;var c=e.verticalAlign,l=r+n/2;c===`top`?l=r+e.height/2:c===`bottom`&&(l=r+n-e.height/2),!e.isLineHolder&&rv(s)&&this._renderBackground(s,t,a===`right`?i-e.width:a===`center`?i-e.width/2:i,l-e.height/2,e.width,e.height);var u=!!s.backgroundColor,d=e.textPadding;d&&(i=tv(i,a,d),l-=e.height/2-d[0]-e.innerHeight/2);var f=this._getOrCreateChild(D_),p=f.createStyle();f.useStyle(p);var m=this._defaultStyle,h=!1,g=0,_=!1,v=ev(`fill`in s?s.fill:`fill`in t?t.fill:(h=!0,m.fill)),y=$_(`stroke`in s?s.stroke:`stroke`in t?t.stroke:!u&&!o&&(!m.autoStroke||h)?(g=V_,_=!0,m.stroke):null),b=s.textShadowBlur>0||t.textShadowBlur>0;p.text=e.text,p.x=i,p.y=l,b&&(p.shadowBlur=s.textShadowBlur||t.textShadowBlur||0,p.shadowColor=s.textShadowColor||t.textShadowColor||`transparent`,p.shadowOffsetX=s.textShadowOffsetX||t.textShadowOffsetX||0,p.shadowOffsetY=s.textShadowOffsetY||t.textShadowOffsetY||0),p.textAlign=a,p.textBaseline=`middle`,p.font=e.font||`12px sans-serif`,p.opacity=Vl(s.opacity,t.opacity,1),Y_(p,s),y&&(p.lineWidth=Vl(s.lineWidth,t.lineWidth,g),p.lineDash=X(s.lineDash,t.lineDash),p.lineDashOffset=t.lineDashOffset||0,p.stroke=y),v&&(p.fill=v),f.setBoundingRect(im(p,e.contentWidth,e.contentHeight,_?0:null))},t.prototype._renderBackground=function(e,t,n,r,i,a){var o=e.backgroundColor,s=e.borderWidth,c=e.borderColor,l=o&&o.image,u=o&&!l,d=e.borderRadius,f=this,p,m;if(u||e.lineHeight||s&&c){p=this._getOrCreateChild(z_),p.useStyle(p.createStyle()),p.style.fill=null;var h=p.shape;h.x=n,h.y=r,h.width=i,h.height=a,h.r=d,p.dirtyShape()}if(u){var g=p.style;g.fill=o||null,g.fillOpacity=X(e.fillOpacity,1)}else if(l){m=this._getOrCreateChild(j_),m.onload=function(){f.dirtyStyle()};var _=m.style;_.image=o.image,_.x=n,_.y=r,_.width=i,_.height=a}if(s&&c){var g=p.style;g.lineWidth=s,g.stroke=c,g.strokeOpacity=X(e.strokeOpacity,1),g.lineDash=e.borderDash,g.lineDashOffset=e.borderDashOffset||0,p.strokeContainThreshold=0,p.hasFill()&&p.hasStroke()&&(g.strokeFirst=!0,g.lineWidth*=2)}var v=(p||m).style;v.shadowBlur=e.shadowBlur||0,v.shadowColor=e.shadowColor||`transparent`,v.shadowOffsetX=e.shadowOffsetX||0,v.shadowOffsetY=e.shadowOffsetY||0,v.opacity=Vl(e.opacity,t.opacity,1)},t.makeFont=function(e){var t=``;return X_(e)&&(t=[e.fontStyle,e.fontWeight,J_(e.fontSize),e.fontFamily||`sans-serif`].join(` `)),t&&Gl(t)||e.textFont||e.font},t}(vg),G_={left:!0,right:1,center:1},K_={top:1,bottom:1,middle:1},q_=[`fontStyle`,`fontWeight`,`fontSize`,`fontFamily`];function J_(e){return typeof e==`string`&&(e.indexOf(`px`)!==-1||e.indexOf(`rem`)!==-1||e.indexOf(`em`)!==-1)?e:isNaN(+e)?`12px`:e+`px`}function Y_(e,t){for(var n=0;n=0,a=!1;if(e instanceof T_){var o=yv(e),s=i&&o.selectFill||o.normalFill,c=i&&o.selectStroke||o.normalStroke;if(kv(s)||kv(c)){r||={};var l=r.style||{};l.fill===`inherit`?(a=!0,r=W({},r),l=W({},l),l.fill=s):!kv(l.fill)&&kv(s)?(a=!0,r=W({},r),l=W({},l),l.fill=_h(s)):!kv(l.stroke)&&kv(c)&&(a||(r=W({},r),l=W({},l)),l.stroke=_h(c)),r.style=l}}if(r&&r.z2==null){a||(r=W({},r));var u=e.z2EmphasisLift;r.z2=e.z2+(u??10)}return r}function Hv(e,t,n){if(n&&n.z2==null){n=W({},n);var r=e.z2SelectLift;n.z2=e.z2+(r??9)}return n}function Uv(e,t,n){var r=bl(e.currentStates,t)>=0,i=e.style.opacity,a=r?null:Bv(e,[`opacity`],t,{opacity:1});n||={};var o=n.style||{};return o.opacity??(n=W({},n),o=W({opacity:r?i:a.opacity*.1},o),n.style=o),n}function Wv(e,t){var n=this.states[e];if(this.style){if(e===`emphasis`)return Vv(this,e,t,n);if(e===`blur`)return Uv(this,e,n);if(e===`select`)return Hv(this,e,n)}return n}function Gv(e){e.stateProxy=Wv;var t=e.getTextContent(),n=e.getTextGuideLine();t&&(t.stateProxy=Wv),n&&(n.stateProxy=Wv)}function Kv(e,t){!ey(e,t)&&!e.__highByOuter&&Rv(e,jv)}function qv(e,t){!ey(e,t)&&!e.__highByOuter&&Rv(e,Mv)}function Jv(e,t){e.__highByOuter|=1<<(t||0),Rv(e,jv)}function Yv(e,t){!(e.__highByOuter&=~(1<<(t||0)))&&Rv(e,Mv)}function Xv(e){Rv(e,Nv)}function Zv(e){Rv(e,Pv)}function Qv(e){Rv(e,Fv)}function $v(e){Rv(e,Iv)}function ey(e,t){return e.__highDownSilentOnTouch&&t.zrByTouch}function ty(e){var t=e.getModel(),n=[],r=[];t.eachComponent(function(t,i){var a=bv(i),o=gv(e,i),s=t===`series`;!s&&r.push(o),a.isBlured&&(o.group.traverse(function(e){Pv(e)}),s&&n.push(i)),a.isBlured=!1}),G(r,function(e){e&&e.toggleBlurSeries&&e.toggleBlurSeries(n,!1,t)})}function ny(e,t,n,r){var i=r.getModel();n||=`coordinateSystem`;function a(e,t){for(var n=0;n0){var a={dataIndex:i,seriesIndex:e.seriesIndex};r!=null&&(a.dataType=r),t.push(a)}})}),t}function dy(e,t,n){vy(e,!0),Rv(e,Gv),my(e,t,n)}function fy(e){vy(e,!1)}function py(e,t,n,r){r?fy(e):dy(e,t,n)}function my(e,t,n){var r=iv(e);t==null?r.focus&&=null:(r.focus=t,r.blurScope=n)}var hy=[`emphasis`,`blur`,`select`],gy={itemStyle:`getItemStyle`,lineStyle:`getLineStyle`,areaStyle:`getAreaStyle`};function _y(e,t,n,r){n||=`itemStyle`;for(var i=0;i1&&(o*=ky(m),s*=ky(m));var h=(i===a?-1:1)*ky((o*o*(s*s)-o*o*(p*p)-s*s*(f*f))/(o*o*(p*p)+s*s*(f*f)))||0,g=h*o*p/s,_=h*-s*f/o,v=(e+n)/2+jy(d)*g-Ay(d)*_,y=(t+r)/2+Ay(d)*g+jy(d)*_,b=Fy([1,0],[(f-g)/o,(p-_)/s]),x=[(f-g)/o,(p-_)/s],S=[(-1*f-g)/o,(-1*p-_)/s],C=Fy(x,S);if(Py(x,S)<=-1&&(C=My),Py(x,S)>=1&&(C=0),C<0){var w=Math.round(C/My*1e6)/1e6;C=My*2+w%2*My}u.addData(l,v,y,o,s,b,C,d,a)}var Ly=/([mlvhzcqtsa])([^mlvhzcqtsa]*)/gi,Ry=/-?([0-9]*\.)?[0-9]+([eE]-?[0-9]+)?/g;function zy(e){var t=new e_;if(!e)return t;var n=0,r=0,i=n,a=r,o,s=e_.CMD,c=e.match(Ly);if(!c)return t;for(var l=0;l=0&&(n.splice(r,0,e),this._doAdd(e))}return this},t.prototype.replace=function(e,t){var n=bl(this._children,e);return n>=0&&this.replaceAt(t,n),this},t.prototype.replaceAt=function(e,t){var n=this._children,r=n[t];if(e&&e!==this&&e.parent!==this&&e!==r){n[t]=e,r.parent=null;var i=this.__zr;i&&r.removeSelfFromZr(i),this._doAdd(e)}return this},t.prototype._doAdd=function(e){e.parent&&e.parent.remove(e),e.parent=this;var t=this.__zr;t&&t!==e.__zr&&e.addSelfToZr(t),t&&t.refresh()},t.prototype.remove=function(e){var t=this.__zr,n=this._children,r=bl(n,e);return r<0?this:(n.splice(r,1),e.parent=null,t&&e.removeSelfFromZr(t),t&&t.refresh(),this)},t.prototype.removeAll=function(){for(var e=this._children,t=this.__zr,n=0;nA*A+j*j&&(w=E,T=D),{cx:w,cy:T,x0:-u,y0:-d,x1:w*(i/x-1),y1:T*(i/x-1)}}function ub(e){var t;if(J(e)){var n=e.length;if(!n)return e;t=n===1?[e[0],e[0],0,0]:n===2?[e[0],e[0],e[1],e[1]]:n===3?e.concat(e[2]):e}else t=[e,e,e,e];return t}function db(e,t){var n,r=ab(t.r,0),i=ab(t.r0||0,0),a=r>0;if(a||i>0){if(a||(r=i,i=0),i>r){var o=r;r=i,i=o}var s=t.startAngle,c=t.endAngle;if(!(isNaN(s)||isNaN(c))){var l=t.cx,u=t.cy,d=!!t.clockwise,f=rb(c-s),p=f>Qy&&f%Qy;if(p>sb&&(f=p),!(r>sb))e.moveTo(l,u);else if(f>Qy-sb)e.moveTo(l+r*eb(s),u+r*$y(s)),e.arc(l,u,r,s,c,!d),i>sb&&(e.moveTo(l+i*eb(c),u+i*$y(c)),e.arc(l,u,i,c,s,d));else{var m=void 0,h=void 0,g=void 0,_=void 0,v=void 0,y=void 0,b=void 0,x=void 0,S=void 0,C=void 0,w=void 0,T=void 0,E=void 0,D=void 0,O=void 0,k=void 0,A=r*eb(s),j=r*$y(s),M=i*eb(c),N=i*$y(c),P=f>sb;if(P){var F=t.cornerRadius;F&&(n=ub(F),m=n[0],h=n[1],g=n[2],_=n[3]);var I=rb(r-i)/2;if(v=ob(I,g),y=ob(I,_),b=ob(I,m),x=ob(I,h),w=S=ab(v,y),T=C=ab(b,x),(S>sb||C>sb)&&(E=r*eb(c),D=r*$y(c),O=i*eb(s),k=i*$y(s),fsb){var R=ob(g,w),oe=ob(_,w),z=lb(O,k,A,j,r,R,d),se=lb(E,D,M,N,r,oe,d);e.moveTo(l+z.cx+z.x0,u+z.cy+z.y0),w0&&e.arc(l+z.cx,u+z.cy,R,nb(z.y0,z.x0),nb(z.y1,z.x1),!d),e.arc(l,u,r,nb(z.cy+z.y1,z.cx+z.x1),nb(se.cy+se.y1,se.cx+se.x1),!d),oe>0&&e.arc(l+se.cx,u+se.cy,oe,nb(se.y1,se.x1),nb(se.y0,se.x0),!d))}else e.moveTo(l+A,u+j),e.arc(l,u,r,s,c,!d);if(!(i>sb)||!P)e.lineTo(l+M,u+N);else if(T>sb){var R=ob(m,T),oe=ob(h,T),z=lb(M,N,E,D,i,-oe,d),se=lb(A,j,O,k,i,-R,d);e.lineTo(l+z.cx+z.x0,u+z.cy+z.y0),T0&&e.arc(l+z.cx,u+z.cy,oe,nb(z.y0,z.x0),nb(z.y1,z.x1),!d),e.arc(l,u,i,nb(z.cy+z.y1,z.cx+z.x1),nb(se.cy+se.y1,se.cx+se.x1),d),R>0&&e.arc(l+se.cx,u+se.cy,R,nb(se.y1,se.x1),nb(se.y0,se.x0),!d))}else e.lineTo(l+M,u+N),e.arc(l,u,i,c,s,d)}e.closePath()}}}var fb=function(){function e(){this.cx=0,this.cy=0,this.r0=0,this.r=0,this.startAngle=0,this.endAngle=Math.PI*2,this.clockwise=!0,this.cornerRadius=0}return e}(),pb=function(e){U(t,e);function t(t){return e.call(this,t)||this}return t.prototype.getDefaultShape=function(){return new fb},t.prototype.buildPath=function(e,t){db(e,t)},t.prototype.isZeroArea=function(){return this.shape.startAngle===this.shape.endAngle||this.shape.r===this.shape.r0},t}(T_);pb.prototype.type=`sector`;var mb=function(){function e(){this.cx=0,this.cy=0,this.r=0,this.r0=0}return e}(),hb=function(e){U(t,e);function t(t){return e.call(this,t)||this}return t.prototype.getDefaultShape=function(){return new mb},t.prototype.buildPath=function(e,t){var n=t.cx,r=t.cy,i=Math.PI*2;e.moveTo(n+t.r,r),e.arc(n,r,t.r,0,i,!1),e.moveTo(n+t.r0,r),e.arc(n,r,t.r0,0,i,!0)},t}(T_);hb.prototype.type=`ring`;function gb(e,t,n,r){var i=[],a=[],o=[],s=[],c,l,u,d;if(r){u=[1/0,1/0],d=[-1/0,-1/0];for(var f=0,p=e.length;f=2){if(r){var a=gb(i,r,n,t.smoothConstraint);e.moveTo(i[0][0],i[0][1]);for(var o=i.length,s=0;s<(n?o:o-1);s++){var c=a[s*2],l=a[s*2+1],u=i[(s+1)%o];e.bezierCurveTo(c[0],c[1],l[0],l[1],u[0],u[1])}}else{e.moveTo(i[0][0],i[0][1]);for(var s=1,d=i.length;szb[1]){if(i=!1,Bb.negativeSize||n)return i;var s=Lb(zb[0]-Rb[1]),c=Lb(Rb[0]-zb[1]);Fb(s,c)>Hb.len()&&(s=c||!Bb.bidirectional)&&(Qf.scale(Vb,o,-c*r),Bb.useDir&&Bb.calcDirMTV()))}}return i},e.prototype._getProjMinMaxOnAxis=function(e,t,n){for(var r=this._axes[e],i=this._origin,a=t[0].dot(r)+i[e],o=a,s=a,c=1;c0){var d=u.duration,f=u.delay,p=u.easing,m={duration:d,delay:f||0,easing:p,done:a,force:!!a||!!o,setToFinal:!l,scope:e,during:o};s?t.animateFrom(n,m):t.animateTo(n,m)}else t.stopAnimation(),!s&&t.attr(n),o&&o(1),a&&a()}function Yb(e,t,n,r,i,a){Jb(`update`,e,t,n,r,i,a)}function Xb(e,t,n,r,i,a){Jb(`enter`,e,t,n,r,i,a)}function Zb(e){if(!e.__zr)return!0;for(var t=0;tAb,BezierCurve:()=>Ob,BoundingRect:()=>fp,Circle:()=>Jy,CompoundPath:()=>jb,Ellipse:()=>Xy,Group:()=>Ky,HOVER_LAYER_FOR_INCREMENTAL:()=>2,HOVER_LAYER_FROM_THRESHOLD:()=>1,HOVER_LAYER_NO:()=>0,Image:()=>j_,IncrementalDisplayable:()=>Gb,Line:()=>wb,LinearGradient:()=>Nb,OrientedBoundingRect:()=>Ub,Path:()=>T_,Point:()=>Qf,Polygon:()=>yb,Polyline:()=>xb,RadialGradient:()=>Pb,Rect:()=>z_,Ring:()=>hb,Sector:()=>pb,Text:()=>W_,WH:()=>ax,XY:()=>ix,applyTransform:()=>bx,calcZ2Range:()=>Wx,clipPointsByRect:()=>Ex,clipRectByRect:()=>Dx,createIcon:()=>Ox,decomposeTransform:()=>Jx,ensureCopyRect:()=>Vx,ensureCopyTransform:()=>Hx,expandOrShrinkRect:()=>Nx,extendPath:()=>cx,extendShape:()=>ox,getCurrentCanvasPainter:()=>Xx,getShapeClass:()=>ux,getTransform:()=>yx,groupTransition:()=>Tx,initProps:()=>Xb,isBoundingRectAxisAligned:()=>zx,isElementRemoved:()=>Zb,lineLineIntersect:()=>Ax,linePolygonIntersect:()=>kx,makeImage:()=>fx,makePath:()=>dx,mergePath:()=>mx,payloadDisableAnimation:()=>qx,registerShape:()=>lx,removeElement:()=>Qb,removeElementWithFadeOut:()=>ex,resizePath:()=>hx,retrieveZInfo:()=>Ux,setTooltipConfig:()=>Ix,subPixelOptimize:()=>vx,subPixelOptimizeLine:()=>gx,subPixelOptimizeRect:()=>_x,transformDirection:()=>xx,traverseElements:()=>Rx,traverseUpdateZ:()=>Gx,updateProps:()=>Yb}),rx={},ix=[`x`,`y`],ax=[`width`,`height`];function ox(e){return T_.extend(e)}var sx=Wy;function cx(e,t){return sx(e,t)}function lx(e,t){rx[e]=t}function ux(e){if(rx.hasOwnProperty(e))return rx[e]}function dx(e,t,n,r){var i=Uy(e,t);return n&&(r===`center`&&(n=px(n,i.getBoundingRect())),hx(i,n)),i}function fx(e,t,n){var r=new j_({style:{image:e,x:t.x,y:t.y,width:t.width,height:t.height},onload:function(e){if(n===`center`){var i={width:e.width,height:e.height};r.setStyle(px(t,i))}}});return r}function px(e,t){var n=t.width/t.height,r=e.height*n,i;r<=e.width?i=e.height:(r=e.width,i=r/n);var a=e.x+e.width/2,o=e.y+e.height/2;return{x:a-r/2,y:o-i/2,width:r,height:i}}var mx=Gy;function hx(e,t){if(e.applyTransform){var n=e.getBoundingRect().calculateTransform(t);e.applyTransform(n)}}function gx(e,t){return P_(e,e,{lineWidth:t}),e}function _x(e,t){return F_(e,e,t),e}var vx=I_;function yx(e,t){for(var n=Df([]);e&&e!==t;)kf(n,e.getLocalTransform(),n),e=e.parent;return n}function bx(e,t,n){return t&&!Cl(t)&&(t=pm.getLocalTransform(t)),n&&(t=Nf([],t)),Yf([],e,t)}function xx(e,t,n){var r=t[4]===0||t[5]===0||t[0]===0?1:pu(2*t[4]/t[0]),i=t[4]===0||t[5]===0||t[2]===0?1:pu(2*t[4]/t[2]),a=[e===`left`?-r:e===`right`?r:0,e===`top`?-i:e===`bottom`?i:0];return a=bx(a,t,n),pu(a[0])>pu(a[1])?a[0]>0?`right`:`left`:a[1]>0?`bottom`:`top`}function Sx(e){return!e.isGroup}function Cx(e){return e.shape!=null}function Tx(e,t,n){if(!e||!t)return;function r(e){var t={};return e.traverse(function(e){Sx(e)&&e.anid&&(t[e.anid]=e)}),t}function i(e){var t={x:e.x,y:e.y,rotation:e.rotation};return Cx(e)&&(t.shape=hl(e.shape)),t}var a=r(e);t.traverse(function(e){if(Sx(e)&&e.anid){var t=a[e.anid];if(t){var r=i(e);e.attr(i(t)),Yb(e,r,n,iv(e).dataIndex)}}})}function Ex(e,t){return K(e,function(e){var n=e[0];n=fu(n,t.x),n=du(n,t.x+t.width);var r=e[1];return r=fu(r,t.y),r=du(r,t.y+t.height),[n,r]})}function Dx(e,t){var n=fu(e.x,t.x),r=du(e.x+e.width,t.x+t.width),i=fu(e.y,t.y),a=du(e.y+e.height,t.y+t.height);if(r>=n&&a>=i)return{x:n,y:i,width:r-n,height:a-i}}function Ox(e,t,n){var r=W({rectHover:!0},t),i=r.style={strokeNoScale:!0};if(n||={x:-1,y:-1,width:2,height:2},e)return e.indexOf(`image://`)===0?(i.image=e.slice(8),yl(i,n),new j_(r)):dx(e.replace(`path://`,``),r,n,`center`)}function kx(e,t,n,r,i){for(var a=0,o=i[i.length-1];a1)return!1;var g=jx(p,m,u,d)/f;return!(g<0||g>1)}function jx(e,t,n,r){return e*r-n*t}function Mx(e){return e<=1e-6&&e>=-1e-6}function Nx(e,t,n,r,i){return t==null?e:(Ml(t)?Px[0]=Px[1]=Px[2]=Px[3]=t:(Px[0]=t[0],Px[1]=t[1],Px[2]=t[2],Px[3]=t[3]),r&&(Px[0]=fu(0,Px[0]),Px[1]=fu(0,Px[1]),Px[2]=fu(0,Px[2]),Px[3]=fu(0,Px[3])),n&&(Px[0]=-Px[0],Px[1]=-Px[1],Px[2]=-Px[2],Px[3]=-Px[3]),Fx(e,Px,`x`,`width`,3,1,i&&i[0]||0),Fx(e,Px,`y`,`height`,0,2,i&&i[1]||0),e)}var Px=[0,0,0,0];function Fx(e,t,n,r,i,a,o){var s=t[a]+t[i],c=e[r];e[r]+=s,o=fu(0,du(o,c)),e[r]=0?-t[i]:t[a]>=0?c+t[a]:pu(s)>1e-8?(c-o)*t[i]/s:0):e[n]-=t[i]}function Ix(e){var t=e.itemTooltipOption,n=e.componentModel,r=e.itemName,i=Y(t)?{formatter:t}:t,a=n.mainType,o=n.componentIndex,s={componentType:a,name:r,$vars:[`name`]};s[a+`Index`]=o;var c=e.formatterParamsExtra;c&&G(Dl(c),function(e){Z(s,e)||(s[e]=c[e],s.$vars.push(e))});var l=iv(e.el);l.componentMainType=a,l.componentIndex=o,l.tooltipConfig={name:r,option:yl({content:r,encodeHTMLContent:!0,formatterParams:s},i)}}function Lx(e,t){var n;e.isGroup&&(n=t(e)),n||e.traverse(t)}function Rx(e,t){if(e){if(J(e))for(var n=0;nt&&(t=r),rt&&(n=t=0),{min:n,max:t}}function Gx(e,t,n){Kx(e,t,n,-1/0)}function Kx(e,t,n,r){if(e.ignoreModelZ)return r;var i=e.getTextContent(),a=e.getTextGuideLine();if(e.isGroup)for(var o=e.childrenRef(),s=0;s=0&&n.push(e)}),n}}function AS(e,t){return gl(gl({},e,!0),t,!0)}var jS=Math.log(2);function MS(e,t,n,r,i,a){var o=r+`-`+i,s=e.length;if(a.hasOwnProperty(o))return a[o];if(t===1){var c=Math.round(Math.log((1<>1)%2;s.cssText=[`position: absolute`,`visibility: hidden`,`padding: 0`,`margin: 0`,`border-width: 0`,`user-select: none`,`width:0`,`height:0`,r[c]+`:0`,i[l]+`:0`,r[1-c]+`:auto`,i[1-l]+`:auto`,``].join(`!important;`),e.appendChild(o),n.push(o)}return t.clearMarkers=function(){G(n,function(e){e.parentNode&&e.parentNode.removeChild(e)})},n}function BS(e,t,n){for(var r=n?`invTrans`:`trans`,i=t[r],a=t.srcCoords,o=[],s=[],c=!0,l=0;l<4;l++){var u=e[l].getBoundingClientRect(),d=2*l,f=u.left,p=u.top;o.push(f,p),c=c&&a&&f===a[d]&&p===a[d+1],s.push(e[l].offsetLeft,e[l].offsetTop)}return c&&i?i:(t.srcCoords=o,t[r]=n?NS(s,o):NS(o,s))}function VS(e){return e.nodeName.toUpperCase()===`CANVAS`}var HS=/([&<>"'])/g,US={"&":`&`,"<":`<`,">":`>`,'"':`"`,"'":`'`};function WS(e){return e==null?``:(e+``).replace(HS,function(e,t){return US[t]})}var GS={time:{month:[`January`,`February`,`March`,`April`,`May`,`June`,`July`,`August`,`September`,`October`,`November`,`December`],monthAbbr:[`Jan`,`Feb`,`Mar`,`Apr`,`May`,`Jun`,`Jul`,`Aug`,`Sep`,`Oct`,`Nov`,`Dec`],dayOfWeek:[`Sunday`,`Monday`,`Tuesday`,`Wednesday`,`Thursday`,`Friday`,`Saturday`],dayOfWeekAbbr:[`Sun`,`Mon`,`Tue`,`Wed`,`Thu`,`Fri`,`Sat`]},legend:{selector:{all:`All`,inverse:`Inv`}},toolbox:{brush:{title:{rect:`Box Select`,polygon:`Lasso Select`,lineX:`Horizontally Select`,lineY:`Vertically Select`,keep:`Keep Selections`,clear:`Clear Selections`}},dataView:{title:`Data View`,lang:[`Data View`,`Close`,`Refresh`]},dataZoom:{title:{zoom:`Zoom`,back:`Zoom Reset`}},magicType:{title:{line:`Switch to Line Chart`,bar:`Switch to Bar Chart`,stack:`Stack`,tiled:`Tile`}},restore:{title:`Restore`},saveAsImage:{title:`Save as Image`,lang:[`Right Click to Save Image`]}},series:{typeNames:{pie:`Pie chart`,bar:`Bar chart`,line:`Line chart`,scatter:`Scatter plot`,effectScatter:`Ripple scatter plot`,radar:`Radar chart`,tree:`Tree`,treemap:`Treemap`,boxplot:`Boxplot`,candlestick:`Candlestick`,k:`K line chart`,heatmap:`Heat map`,map:`Map`,parallel:`Parallel coordinate map`,lines:`Line graph`,graph:`Relationship graph`,sankey:`Sankey diagram`,funnel:`Funnel chart`,gauge:`Gauge`,pictorialBar:`Pictorial bar`,themeRiver:`Theme River Map`,sunburst:`Sunburst`,custom:`Custom chart`,chart:`Chart`}},aria:{general:{withTitle:`This is a chart about "{title}"`,withoutTitle:`This is a chart`},series:{single:{prefix:``,withName:` with type {seriesType} named {seriesName}.`,withoutName:` with type {seriesType}.`},multiple:{prefix:`. It consists of {seriesCount} series count.`,withName:` The {seriesId} series is a {seriesType} representing {seriesName}.`,withoutName:` The {seriesId} series is a {seriesType}.`,separator:{middle:``,end:``}}},data:{allData:`The data is as follows: `,partialData:`The first {displayCnt} items are: `,withName:`the data for {name} is {value}`,withoutName:`{value}`,separator:{middle:`, `,end:`. `}}}},KS={time:{month:[`一月`,`二月`,`三月`,`四月`,`五月`,`六月`,`七月`,`八月`,`九月`,`十月`,`十一月`,`十二月`],monthAbbr:[`1月`,`2月`,`3月`,`4月`,`5月`,`6月`,`7月`,`8月`,`9月`,`10月`,`11月`,`12月`],dayOfWeek:[`星期日`,`星期一`,`星期二`,`星期三`,`星期四`,`星期五`,`星期六`],dayOfWeekAbbr:[`日`,`一`,`二`,`三`,`四`,`五`,`六`]},legend:{selector:{all:`全选`,inverse:`反选`}},toolbox:{brush:{title:{rect:`矩形选择`,polygon:`圈选`,lineX:`横向选择`,lineY:`纵向选择`,keep:`保持选择`,clear:`清除选择`}},dataView:{title:`数据视图`,lang:[`数据视图`,`关闭`,`刷新`]},dataZoom:{title:{zoom:`区域缩放`,back:`区域缩放还原`}},magicType:{title:{line:`切换为折线图`,bar:`切换为柱状图`,stack:`切换为堆叠`,tiled:`切换为平铺`}},restore:{title:`还原`},saveAsImage:{title:`保存为图片`,lang:[`右键另存为图片`]}},series:{typeNames:{pie:`饼图`,bar:`柱状图`,line:`折线图`,scatter:`散点图`,effectScatter:`涟漪散点图`,radar:`雷达图`,tree:`树图`,treemap:`矩形树图`,boxplot:`箱型图`,candlestick:`K线图`,k:`K线图`,heatmap:`热力图`,map:`地图`,parallel:`平行坐标图`,lines:`线图`,graph:`关系图`,sankey:`桑基图`,funnel:`漏斗图`,gauge:`仪表盘图`,pictorialBar:`象形柱图`,themeRiver:`主题河流图`,sunburst:`旭日图`,custom:`自定义图表`,chart:`图表`}},aria:{general:{withTitle:`这是一个关于“{title}”的图表。`,withoutTitle:`这是一个图表,`},series:{single:{prefix:``,withName:`图表类型是{seriesType},表示{seriesName}。`,withoutName:`图表类型是{seriesType}。`},multiple:{prefix:`它由{seriesCount}个图表系列组成。`,withName:`第{seriesId}个系列是一个表示{seriesName}的{seriesType},`,withoutName:`第{seriesId}个系列是一个{seriesType},`,separator:{middle:`;`,end:`。`}}},data:{allData:`其数据是——`,partialData:`其中,前{displayCnt}项是——`,withName:`{name}的数据是{value}`,withoutName:`{value}`,separator:{middle:`,`,end:``}}}},qS=`ZH`,JS=`EN`,YS=JS,XS={},ZS={},QS=ou.domSupported?function(){return(document.documentElement.lang||navigator.language||navigator.browserLanguage||YS).toUpperCase().indexOf(qS)>-1?qS:YS}():YS;function $S(e,t){e=e.toUpperCase(),ZS[e]=new TS(t),XS[e]=t}function eC(e){if(Y(e)){var t=XS[e.toUpperCase()]||{};return e===qS||e===JS?hl(t):gl(hl(t),hl(XS[YS]),!1)}return gl(hl(e),hl(XS[YS]),!1)}function tC(e){return ZS[e]}function nC(){return ZS[YS]}$S(JS,GS),$S(qS,KS);var rC=null;function iC(){return rC}function aC(e,t){var n=iC(),r=t.breakOption,i=t.breakParsed;return!i&&n&&(i=n.parseAxisBreakOption(r,e)),i}function oC(e){var t=e.brk;return t?t.breaks:[]}function sC(e){var t=e.brk;return t?t.hasBreaks():!1}var cC=1e3,lC=cC*60,uC=lC*60,dC=uC*24,fC=dC*365,pC={year:/({yyyy}|{yy})/,month:/({MMMM}|{MMM}|{MM}|{M})/,day:/({dd}|{d})/,hour:/({HH}|{H}|{hh}|{h})/,minute:/({mm}|{m})/,second:/({ss}|{s})/,millisecond:/({SSS}|{S})/},mC={year:`{yyyy}`,month:`{MMM}`,day:`{d}`,hour:`{HH}:{mm}`,minute:`{HH}:{mm}`,second:`{HH}:{mm}:{ss}`,millisecond:`{HH}:{mm}:{ss} {SSS}`},hC=`{yyyy}-{MM}-{dd} {HH}:{mm}:{ss} {SSS}`,gC=`{yyyy}-{MM}-{dd}`,_C={year:`{yyyy}`,month:`{yyyy}-{MM}`,day:gC,hour:gC+` `+mC.hour,minute:gC+` `+mC.minute,second:gC+` `+mC.second,millisecond:hC},vC=[`year`,`month`,`day`,`hour`,`minute`,`second`,`millisecond`],yC=[`year`,`half-year`,`quarter`,`month`,`week`,`half-week`,`day`,`half-day`,`quarter-day`,`hour`,`minute`,`second`,`millisecond`];function bC(e){return!Y(e)&&!Al(e)?xC(e):e}function xC(e){e||={};var t={},n=!0;return G(vC,function(t){n&&=e[t]==null}),G(vC,function(r,i){var a=e[r];t[r]={};for(var o=null,s=i;s>=0;s--){var c=vC[s],l=Nl(a)&&!J(a)?a[c]:a,u=void 0;J(l)?(u=l.slice(),o=u[0]||``):Y(l)?(o=l,u=[o]):(o==null?o=mC[r]:pC[c].test(o)||(o=t[c][c][0]+` `+o),u=[o],n&&(u[1]=`{primary|`+o+`}`)),t[r][c]=u}}),t}function SC(e,t){return e+=``,`0000`.substr(0,t-e.length)+e}function CC(e){switch(e){case`half-year`:case`quarter`:return`month`;case`week`:case`half-week`:return`day`;case`half-day`:case`quarter-day`:return`hour`;default:return e}}function wC(e){return e===CC(e)}function TC(e){switch(e){case`year`:case`month`:return`day`;case`millisecond`:return`millisecond`;default:return`second`}}function EC(e,t,n,r){var i=Lu(e),a=i[AC(n)](),o=i[jC(n)]()+1,s=Math.floor((o-1)/3)+1,c=i[MC(n)](),l=i[`get`+(n?`UTC`:``)+`Day`](),u=i[NC(n)](),d=(u-1)%12+1,f=i[PC(n)](),p=i[FC(n)](),m=i[IC(n)](),h=u>=12?`pm`:`am`,g=h.toUpperCase(),_=(r instanceof TS?r:tC(r||QS)||nC()).getModel(`time`),v=_.get(`month`),y=_.get(`monthAbbr`),b=_.get(`dayOfWeek`),x=_.get(`dayOfWeekAbbr`);return(t||``).replace(/{a}/g,h+``).replace(/{A}/g,g+``).replace(/{yyyy}/g,a+``).replace(/{yy}/g,SC(a%100+``,2)).replace(/{Q}/g,s+``).replace(/{MMMM}/g,v[o-1]).replace(/{MMM}/g,y[o-1]).replace(/{MM}/g,SC(o,2)).replace(/{M}/g,o+``).replace(/{dd}/g,SC(c,2)).replace(/{d}/g,c+``).replace(/{eeee}/g,b[l]).replace(/{ee}/g,x[l]).replace(/{e}/g,l+``).replace(/{HH}/g,SC(u,2)).replace(/{H}/g,u+``).replace(/{hh}/g,SC(d+``,2)).replace(/{h}/g,d+``).replace(/{mm}/g,SC(f,2)).replace(/{m}/g,f+``).replace(/{ss}/g,SC(p,2)).replace(/{s}/g,p+``).replace(/{SSS}/g,SC(m,3)).replace(/{S}/g,m+``)}function DC(e,t,n,r,i){var a=null;if(Y(n))a=n;else if(Al(n)){var o={time:e.time,level:e.time?e.time.level:0},s=iC();s&&s.makeAxisLabelFormatterParamBreak(o,e.break),a=n(e.value,t,o)}else{var c=e.time;if(c){var l=n[c.lowerTimeUnit][c.upperTimeUnit];a=l[Math.min(c.level,l.length-1)]||``}else{var u=OC(e.value,i);a=n[u][u][0]}}return EC(new Date(e.value),a,i,r)}function OC(e,t){var n=Lu(e),r=n[jC(t)]()+1,i=n[MC(t)](),a=n[NC(t)](),o=n[PC(t)](),s=n[FC(t)](),c=n[IC(t)]()===0,l=c&&s===0,u=l&&o===0,d=u&&a===0,f=d&&i===1;return f&&r===1?`year`:f?`month`:d?`day`:u?`hour`:l?`minute`:c?`second`:`millisecond`}function kC(e,t,n){switch(t){case`year`:e[RC(n)](0);case`month`:e[zC(n)](1);case`day`:e[BC(n)](0);case`hour`:e[VC(n)](0);case`minute`:e[HC(n)](0);case`second`:e[UC(n)](0)}return e}function AC(e){return e?`getUTCFullYear`:`getFullYear`}function jC(e){return e?`getUTCMonth`:`getMonth`}function MC(e){return e?`getUTCDate`:`getDate`}function NC(e){return e?`getUTCHours`:`getHours`}function PC(e){return e?`getUTCMinutes`:`getMinutes`}function FC(e){return e?`getUTCSeconds`:`getSeconds`}function IC(e){return e?`getUTCMilliseconds`:`getMilliseconds`}function LC(e){return e?`setUTCFullYear`:`setFullYear`}function RC(e){return e?`setUTCMonth`:`setMonth`}function zC(e){return e?`setUTCDate`:`setDate`}function BC(e){return e?`setUTCHours`:`setHours`}function VC(e){return e?`setUTCMinutes`:`setMinutes`}function HC(e){return e?`setUTCSeconds`:`setSeconds`}function UC(e){return e?`setUTCMilliseconds`:`setMilliseconds`}function WC(e){if(!Uu(e))return Y(e)?e:`-`;var t=(e+``).split(`.`);return t[0].replace(/(\d{1,3})(?=(?:\d{3})+(?!\d))/g,`$1,`)+(t.length>1?`.`+t[1]:``)}function GC(e,t){return e=(e||``).toLowerCase().replace(/-(.)/g,function(e,t){return t.toUpperCase()}),t&&e&&(e=e.charAt(0).toUpperCase()+e.slice(1)),e}var KC=Ul;function qC(e,t,n){var r=`{yyyy}-{MM}-{dd} {HH}:{mm}:{ss}`;function i(e){return e&&Gl(e)?e:`-`}function a(e){return qu(e)}var o=t===`time`,s=e instanceof Date;if(o||s){var c=o?Lu(e):e;if(!isNaN(+c))return EC(c,r,n);if(s)return`-`}if(t===`ordinal`)return jl(e)?i(e):Ml(e)&&a(e)?e+``:`-`;var l=Hu(e);return a(l)?WC(l):jl(e)?i(e):typeof e==`boolean`?e+``:`-`}var JC=[`a`,`b`,`c`,`d`,`e`,`f`,`g`],YC=function(e,t){return`{`+e+(t??``)+`}`};function XC(e,t,n){J(t)||(t=[t]);var r=t.length;if(!r)return``;for(var i=t[0].$vars||[],a=0;a`:``:{renderMode:a,content:`{`+(n.markerId||`markerX`)+`|} `,style:i===`subItem`?{width:4,height:4,borderRadius:2,backgroundColor:r}:{width:10,height:10,borderRadius:5,backgroundColor:r}}:``}function QC(e,t){return t||=`transparent`,Y(e)?e:Nl(e)&&e.colorStops&&(e.colorStops[0]||{}).color||t}var $C={},ew={},tw=function(){function e(){this._normalMasterList=[],this._nonSeriesBoxMasterList=[]}return e.prototype.create=function(e,t){this._nonSeriesBoxMasterList=n($C,!0),this._normalMasterList=n(ew,!1);function n(n,r){var i=[];return G(n,function(n,r){var a=n.create(e,t);i=i.concat(a||[])}),i}},e.prototype.update=function(e,t){G(this._normalMasterList,function(n){n.update&&n.update(e,t)})},e.prototype.getCoordinateSystems=function(){return this._normalMasterList.concat(this._nonSeriesBoxMasterList)},e.register=function(e,t){if(e===`matrix`||e===`calendar`){$C[e]=t;return}ew[e]=t},e.get=function(e){return ew[e]||$C[e]},e}();function nw(e){return!!$C[e]}var rw=$l();function iw(e){var t=e.getShallow(`coord`,!0),n=1;if(t==null){var r=rw.get(e.type);r&&r.getCoord2&&(n=2,t=r.getCoord2(e))}return{coord:t,from:n}}function aw(e,t){var n=e.getShallow(`coordinateSystem`),r=e.getShallow(`coordinateSystemUsage`,!0),i=0;if(n){var a=e.mainType===`series`;r??=a?`data`:`box`,r===`data`?(i=1,a||(i=0)):r===`box`&&(i=2,!a&&!nw(n)&&(i=0))}return{coordSysType:n,kind:i}}function ow(e){var t=e.targetModel,n=e.coordSysType,r=e.coordSysProvider,i=e.isDefaultDataCoordSys;e.allowNotFound;var a=aw(t,!0),o=a.kind,s=a.coordSysType;if(i&&o!==1&&(o=1,s=n),o===0||s!==n)return 0;var c=r(n,t);return c?(o===1?t.coordinateSystem=c:t.boxCoordinateSystem=c,o):0}var sw=G,cw=[`left`,`right`,`top`,`bottom`,`width`,`height`],lw=[[`width`,`left`,`right`],[`height`,`top`,`bottom`]];function uw(e,t,n,r,i){var a=0,o=0;r??=1/0,i??=1/0;var s=0;t.eachChild(function(c,l){var u=c.getBoundingRect(),d=t.childAt(l+1),f=d&&d.getBoundingRect(),p,m;if(e===`horizontal`){var h=u.width+(f?-f.x+u.x:0);p=a+h,p>r||c.newline?(a=0,p=h,o+=s+n,s=u.height):s=Math.max(s,u.height)}else{var g=u.height+(f?-f.y+u.y:0);m=o+g,m>i||c.newline?(a+=s+n,o=0,m=g,s=u.width):s=Math.max(s,u.width)}c.newline||(c.x=a,c.y=o,c.markRedraw(),e===`horizontal`?a=p+n:o=m+n)})}var dw=uw;kl(uw,`vertical`),kl(uw,`horizontal`);function fw(e,t){return{left:e.getShallow(`left`,t),top:e.getShallow(`top`,t),right:e.getShallow(`right`,t),bottom:e.getShallow(`bottom`,t),width:e.getShallow(`width`,t),height:e.getShallow(`height`,t)}}function pw(e,t,n){n=KC(n||0);var r=t.width,i=t.height,a=Cu(e.left,r),o=Cu(e.top,i),s=Cu(e.right,r),c=Cu(e.bottom,i),l=Cu(e.width,r),u=Cu(e.height,i),d=n[2]+n[0],f=n[1]+n[3],p=e.aspect;switch(isNaN(l)&&(l=r-s-f-a),isNaN(u)&&(u=i-c-d-o),p!=null&&(isNaN(l)&&isNaN(u)&&(p>r/i?l=r*.8:u=i*.8),isNaN(l)&&(l=p*u),isNaN(u)&&(u=l/p)),isNaN(a)&&(a=r-s-l-f),isNaN(o)&&(o=i-c-u-d),e.left||e.right){case`center`:a=r/2-l/2-n[3];break;case`right`:a=r-l-f}switch(e.top||e.bottom){case`middle`:case`center`:o=i/2-u/2-n[0];break;case`bottom`:o=i-u-d}a||=0,o||=0,isNaN(l)&&(l=r-f-a-(s||0)),isNaN(u)&&(u=i-d-o-(c||0));var m=new fp((t.x||0)+a+n[3],(t.y||0)+o+n[0],l,u);return m.margin=n,m}var mw={rect:1,point:2};function hw(e,t,n){var r,i,a,o=e.boxCoordinateSystem,s;if(o){var c=iw(e),l=c.coord,u=c.from;if(o.dataToLayout){a=mw.rect,s=u;var d=o.dataToLayout(l);r=d.contentRect||d.rect}else n&&n.enableLayoutOnlyByCenter&&o.dataToPoint&&(a=mw.point,s=u,i=o.dataToPoint(l))}return a??=mw.rect,a===mw.rect&&(r||={x:0,y:0,width:t.getWidth(),height:t.getHeight()},i=[r.x+r.width/2,r.y+r.height/2]),{type:a,refContainer:r,refPoint:i,boxCoordFrom:s}}function gw(e,t,n,r,i,a){var o=!i||!i.hv||i.hv[0],s=!i||!i.hv||i.hv[1],c=i&&i.boundingMode||`all`;if(a||=e,a.x=e.x,a.y=e.y,!o&&!s)return!1;var l;if(c===`raw`)l=e.type===`group`?new fp(0,0,+t.width||0,+t.height||0):e.getBoundingRect();else if(l=e.getBoundingRect(),e.needLocalTransform()){var u=e.getLocalTransform();l=l.clone(),l.applyTransform(u)}var d=pw(yl({width:l.width,height:l.height},t),n,r),f=o?d.x-l.x:0,p=s?d.y-l.y:0;return c===`raw`?(a.x=f,a.y=p):(a.x+=f,a.y+=p),a===e&&e.markRedraw(),!0}function _w(e){var t=e.layoutMode||e.constructor.layoutMode;return Nl(t)?t:t?{type:t}:null}function vw(e,t,n){var r=n&&n.ignoreSize;!J(r)&&(r=[r,r]);var i=o(lw[0],0),a=o(lw[1],1);c(lw[0],e,i),c(lw[1],e,a);function o(n,i){var a={},o=0,c={},l=0,u=2;if(sw(n,function(t){c[t]=e[t]}),sw(n,function(e){Z(t,e)&&(a[e]=c[e]=t[e]),s(a,e)&&o++,s(c,e)&&l++}),r[i])return s(t,n[1])?c[n[2]]=null:s(t,n[2])&&(c[n[1]]=null),c;if(l===u||!o)return c;if(o>=u)return a;for(var d=0;d=0;o--)a=gl(a,n[o],!0);t.defaultOption=a}return t.defaultOption},t.prototype.getReferringComponents=function(e,t){var n=e+`Index`,r=e+`Id`;return jd(this.ecModel,e,{index:this.get(n,!0),id:this.get(r,!0)},t)},t.prototype.getBoxLayoutParams=function(){return fw(this,!1)},t.prototype.getZLevelKey=function(){return``},t.prototype.setZLevel=function(e){this.option.zlevel=e},t.protoInitialize=function(){var e=t.prototype;e.type=`component`,e.id=``,e.name=``,e.mainType=``,e.subType=``,e.componentIndex=0}(),t}(TS);lf(Sw,TS),mf(Sw),OS(Sw),kS(Sw,Cw);function Cw(e){var t=[];return G(Sw.getClassesByMainType(e),function(e){t=t.concat(e.dependencies||e.prototype.dependencies||[])}),t=K(t,function(e){return rf(e).main}),e!==`dataset`&&bl(t,`dataset`)<=0&&t.unshift(`dataset`),t}var ww=Td(),Tw=Td(),Ew=function(){function e(){}return e.prototype.getColorFromPalette=function(e,t,n){var r=rd(this.get(`color`,!0)),i=this.get(`colorLayer`,!0);return kw(this,ww,r,i,e,t,n)},e.prototype.clearColorPalette=function(){Aw(this,ww)},e}();function Dw(e,t,n,r){return kw(e,Tw,rd(e.get([`aria`,`decal`,`decals`])),null,t,n,r)}function Ow(e,t){for(var n=e.length,r=0;rt)return e[r];return e[n-1]}function kw(e,t,n,r,i,a,o){a||=e;var s=t(a),c=s.paletteIdx||0,l=s.paletteNameMap=s.paletteNameMap||{};if(l.hasOwnProperty(i))return l[i];var u=o==null||!r?n:Ow(r,o);if(u||=n,u&&u.length){var d=u[c];return i&&(l[i]=d),s.paletteIdx=(c+1)%u.length,d}}function Aw(e,t){t(e).paletteIdx=0,t(e).paletteNameMap={}}var jw={Must:1,Might:2,Not:3},Mw=Td();function Nw(e){Mw(e).datasetMap=$l()}function Pw(e,t,n){var r={},i=Fw(t);if(!i||!e)return r;var a=[],o=[],s=t.ecModel,c=Mw(s).datasetMap,l=i.uid+`_`+n.seriesLayoutBy,u,d;e=e.slice(),G(e,function(t,n){var i=Nl(t)?t:e[n]={name:t};i.type===`ordinal`&&u==null&&(u=n,d=m(i)),r[i.name]=[]});var f=c.get(l)||c.set(l,{categoryWayDim:d,valueWayDim:0});G(e,function(e,t){var n=e.name,i=m(e);if(u==null){var s=f.valueWayDim;p(r[n],s,i),p(o,s,i),f.valueWayDim+=i}else if(u===t)p(r[n],0,i),p(a,0,i);else{var s=f.categoryWayDim;p(r[n],s,i),p(o,s,i),f.categoryWayDim+=i}});function p(e,t,n){for(var r=0;rl&&(l=p)}s[0]=c,s[1]=l}},r=function(){return this._data?this._data.length/this._dimSize:0};eT=(e={},e[cv+`_`+pv]={pure:!0,appendData:i},e[cv+`_row`]={pure:!0,appendData:function(){throw Error(`Do not support appendData when set seriesLayoutBy: "row".`)}},e[lv]={pure:!0,appendData:i},e[uv]={pure:!0,appendData:function(e){var t=this._data;G(e,function(e,n){for(var r=t[n]||(t[n]=[]),i=0;i<(e||[]).length;i++)r.push(e[i])})}},e[sv]={appendData:i},e[dv]={persistent:!1,pure:!0,appendData:function(e){this._data=e},clean:function(){this._offset+=this.count(),this._data=null}},e);function i(e){for(var t=0;t=0&&(s=a.interpolatedValue[c])}return s==null?``:s+``})},e.prototype.getRawValue=function(e,t){return mT(this.getData(t),e)},e.prototype.formatTooltip=function(e,t,n){},e}();function _T(e){var t,n;return Nl(e)?e.type&&(n=e):t=e,{text:t,frag:n}}function vT(e){return new yT(e)}var yT=function(){function e(e){e||={},this._reset=e.reset,this._plan=e.plan,this._count=e.count,this._onDirty=e.onDirty,this._dirty=!0}return e.prototype.perform=function(e){var t=this._upstream,n=e&&e.skip;if(this._dirty&&t){var r=this.context;r.data=r.outputData=t.context.outputData}this.__pipeline&&(this.__pipeline.currentTask=this);var i;this._plan&&!n&&(i=this._plan(this.context));var a=l(this._modBy),o=this._modDataCount||0,s=l(e&&e.modBy),c=e&&e.modDataCount||0;(a!==s||o!==c)&&(i=`reset`);function l(e){return!(e>=1)&&(e=1),e}var u;(this._dirty||i===`reset`)&&(this._dirty=!1,u=this._doReset(n)),this._modBy=s,this._modDataCount=c;var d=e&&e.step;if(this._dueEnd=t?t._outputDueEnd:this._count?this._count(this.context):1/0,this._progress){var f=this._dueIndex,p=Math.min(d==null?1/0:this._dueIndex+d,this._dueEnd);if(!n&&(u||f1&&r>0?s:o}};return a;function o(){return t=e?null:at},gte:function(e,t){return e>=t}};(function(){function e(e,t){Ml(t)||$u(``),this._opFn=ST[e],this._rvalFloat=Hu(t)}return e.prototype.evaluate=function(e){return Ml(e)?this._opFn(e,this._rvalFloat):this._opFn(Hu(e),this._rvalFloat)},e})();var CT=function(){function e(e,t){var n=e===`desc`;this._resultLT=n?1:-1,t??=n?`min`:`max`,this._incomparable=t===`min`?-1/0:1/0}return e.prototype.evaluate=function(e,t){var n=Ml(e)?e:Hu(e),r=Ml(t)?t:Hu(t),i=isNaN(n),a=isNaN(r);if(i&&(n=this._incomparable),a&&(r=this._incomparable),i&&a){var o=Y(e),s=Y(t);o&&(n=s?e:0),s&&(r=o?t:0)}return nr?-this._resultLT:0},e}();(function(){function e(e,t){this._rval=t,this._isEQ=e,this._rvalTypeof=typeof t,this._rvalFloat=Hu(t)}return e.prototype.evaluate=function(e){var t=e===this._rval;if(!t){var n=typeof e;n!==this._rvalTypeof&&(n===`number`||this._rvalTypeof===`number`)&&(t=Hu(e)===this._rvalFloat)}return this._isEQ?t:!t},e})();function wT(e){var t=``,n=-1/0,r=-1/0,i=1/0,a=1/0;return e&&(e.g!=null&&(t+=`G`+e.g,n=e.g),e.ge!=null&&(t+=`GE`+e.ge,r=e.ge),e.l!=null&&(t+=`L`+e.l,i=e.l),e.le!=null&&(t+=`LE`+e.le,a=e.le)),{key:t,g:n,ge:r,l:i,le:a}}function TT(e,t){return t>e.g&&t>=e.ge&&t`u`?Array:Uint32Array,RT=typeof Uint16Array>`u`?Array:Uint16Array,zT=typeof Int32Array>`u`?Array:Int32Array,BT=typeof Float64Array>`u`?Array:Float64Array,VT={float:BT,int:zT,ordinal:Array,number:Array,time:BT},HT;function UT(e){return e>65535?LT:RT}function WT(e){var t=e.constructor;return t===Array?e.slice():new t(e)}function GT(e,t,n,r,i){var a=VT[n||`float`];if(i){var o=e[t],s=o&&o.length;if(s!==r){for(var c=new a(r),l=0;lh[1]&&(h[1]=m)}return this._rawCount=this._count=s,{start:o,end:s}},e.prototype._initDataFromProvider=function(e,t,n){for(var r=this._provider,i=this._chunks,a=this._dimensions,o=a.length,s=this._rawExtent,c=K(a,function(e){return e.property}),l=0;lg[1]&&(g[1]=h)}}!r.persistent&&r.clean&&r.clean(),this._rawCount=this._count=t,this._extent=[]},e.prototype.count=function(){return this._count},e.prototype.get=function(e,t){if(!(t>=0&&t=0&&t=this._rawCount||e<0)return-1;if(!this._indices)return e;var t=this._indices,n=t[e];if(n!=null&&ne)i=a-1;else return a}return-1},e.prototype.getIndices=function(){var e,t=this._indices;if(t){var n=t.constructor,r=this._count;if(n===Array){e=new n(r);for(var i=0;i=l&&g<=u||isNaN(g))&&(o[s++]=p),p++}f=!0}else if(i===2){for(var m=d[r[0]],_=d[r[1]],v=e[r[1]][0],y=e[r[1]][1],h=0;h=l&&g<=u||isNaN(g))&&(b>=v&&b<=y||isNaN(b))&&(o[s++]=p),p++}f=!0}}if(!f){if(i===1)for(var h=0;h=l&&g<=u||isNaN(g))&&(o[s++]=x)}else for(var h=0;he[w][1])&&(S=!1)}S&&(o[s++]=t.getRawIndex(h))}}return sg[1]&&(g[1]=h)}}}},e.prototype.lttbDownSample=function(e,t){var n=this.clone([e],!0),r=n._chunks[e],i=this.count(),a=0,o=Math.floor(1/t),s=this.getRawIndex(0),c,l,u,d=new(UT(this._rawCount))(Math.min((Math.ceil(i/o)+2)*2,i));d[a++]=s;for(var f=1;fc&&(c=l,u=v)}T>0&&To&&(m=o-l);for(var h=0;hp&&(p=g,f=l+h)}var _=this.getRawIndex(u),v=this.getRawIndex(f);ul-p&&(s=l-p,o.length=s);for(var m=0;mu[1]&&(u[1]=g),d[f++]=_}return i._count=f,i._indices=d,i._updateGetRawIdx(),i},e.prototype.each=function(e,t){if(this._count)for(var n=e.length,r=this._chunks,i=0,a=this.count();id&&(d=p))}return o[c]=[u,d]},e.prototype.getRawDataItem=function(e){var t=this.getRawIndex(e);if(this._provider.persistent)return this._provider.getItem(t);for(var n=[],r=this._chunks,i=0;i=0?this._indices[e]:-1},e.prototype._updateGetRawIdx=function(){this.getRawIndex=this._indices?this._getRawIdx:this._getRawIdxIdentity},e.internalField=function(){function e(e,t,n,r){return xT(e[r],this._dimensions[r])}HT={arrayRows:e,objectRows:function(e,t,n,r){return xT(e[t],this._dimensions[r])},keyedColumns:e,original:function(e,t,n,r){var i=e&&(e.value==null?e:e.value);return xT(i instanceof Array?i[r]:i,this._dimensions[r])},typedArray:function(e,t,n,r){return e[r]}}}(),e}(),qT=function(){function e(e){this._sourceList=[],this._storeList=[],this._upstreamSignList=[],this._versionSignBase=0,this._dirty=!0,this._sourceHost=e}return e.prototype.dirty=function(){this._setLocalSource([],[]),this._storeList=[],this._dirty=!0},e.prototype._setLocalSource=function(e,t){this._sourceList=e,this._upstreamSignList=t,this._versionSignBase++,this._versionSignBase>9e10&&(this._versionSignBase=0)},e.prototype._getVersionSign=function(){return this._sourceHost.uid+`_`+this._versionSignBase},e.prototype.prepareSource=function(){this._isDirty()&&(this._createSource(),this._dirty=!1)},e.prototype._createSource=function(){this._setLocalSource([],[]);var e=this._sourceHost,t=this._getUpstreamSourceManagers(),n=!!t.length,r,i;if(JT(e)){var a=e,o=void 0,s=void 0,c=void 0;if(n){var l=t[0];l.prepareSource(),c=l.getSource(),o=c.data,s=c.sourceFormat,i=[l._getVersionSign()]}else o=a.get(`data`,!0),s=Fl(o)?dv:sv,i=[];var u=this._getSourceMetaRawOption()||{},d=c&&c.metaRawOption||{},f=X(u.seriesLayoutBy,d.seriesLayoutBy)||null,p=X(u.sourceHeader,d.sourceHeader),m=X(u.dimensions,d.dimensions);r=f!==d.seriesLayoutBy||!!p!=!!d.sourceHeader||m?[Vw(o,{seriesLayoutBy:f,sourceHeader:p,dimensions:m},s)]:[]}else{var h=e;if(n){var g=this._applyTransform(t);r=g.sourceList,i=g.upstreamSignList}else r=[Vw(h.get(`source`,!0),this._getSourceMetaRawOption(),null)],i=[]}this._setLocalSource(r,i)},e.prototype._applyTransform=function(e){var t=this._sourceHost,n=t.get(`transform`,!0),r=t.get(`fromTransformResult`,!0);r!=null&&e.length!==1&&YT(``);var i,a=[],o=[];return G(e,function(e){e.prepareSource();var t=e.getSource(r||0);r!=null&&!t&&YT(``),a.push(t),o.push(e._getVersionSign())}),n?i=PT(n,a,{datasetIndex:t.componentIndex}):r!=null&&(i=[Uw(a[0])]),{sourceList:i,upstreamSignList:o}},e.prototype._isDirty=function(){if(this._dirty)return!0;for(var e=this._getUpstreamSourceManagers(),t=0;t1||n>0&&!e.noHeader;return G(e.blocks,function(e){var n=sE(e);n>=t&&(t=n+ +(r&&(!n||aE(e)&&!e.noHeader)))}),t}return 0}function cE(e,t,n,r){var i=t.noHeader,a=dE(sE(t)),o=[],s=t.blocks||[];Wl(!s||J(s)),s||=[];var c=e.orderMode;if(t.sortBlocks&&c){s=s.slice();var l={valueAsc:`asc`,valueDesc:`desc`};if(Z(l,c)){var u=new CT(l[c],null);s.sort(function(e,t){return u.evaluate(e.sortParam,t.sortParam)})}else c===`seriesDesc`&&s.reverse()}G(s,function(n,i){var s=t.valueFormatter,c=oE(n)(s?W(W({},e),{valueFormatter:s}):e,n,i>0?a.html:0,r);c!=null&&o.push(c)});var d=e.renderMode===`richText`?o.join(a.richText):fE(r,o.join(``),i?n:a.html);if(i)return d;var f=qC(t.header,`ordinal`,e.useUTC),p=tE(r,e.renderMode).nameStyle,m=eE(r);return e.renderMode===`richText`?hE(e,f,p)+a.richText+d:fE(r,`
`+WS(f)+`
`+d,n)}function lE(e,t,n,r){var i=e.renderMode,a=t.noName,o=t.noValue,s=!t.markerType,c=t.name,l=e.useUTC,u=t.valueFormatter||e.valueFormatter||function(e){return e=J(e)?e:[e],K(e,function(e,t){return qC(e,J(p)?p[t]:p,l)})};if(!(a&&o)){var d=s?``:e.markupStyleCreator.makeTooltipMarker(t.markerType,t.markerColor||Q.color.secondary,i),f=a?``:qC(c,`ordinal`,l),p=t.valueType,m=o?[]:u(t.value,t.rawDataIndex),h=!s||!a,g=!s&&a,_=tE(r,i),v=_.nameStyle,y=_.valueStyle;return i===`richText`?(s?``:d)+(a?``:hE(e,f,v))+(o?``:gE(e,m,h,g,y)):fE(r,(s?``:d)+(a?``:pE(f,!s,v))+(o?``:mE(m,h,g,y)),n)}}function uE(e,t,n,r,i,a){if(e)return oE(e)({useUTC:i,renderMode:n,orderMode:r,markupStyleCreator:t,valueFormatter:e.valueFormatter},e,0,a)}function dE(e){return{html:nE[e],richText:rE[e]}}function fE(e,t,n){var r=`
`,i=`margin: `+n+`px 0 0`,a=eE(e);return`
`+t+r+`
`}function pE(e,t,n){var r=t?`margin-left:2px`:``;return``+WS(e)+``}function mE(e,t,n,r){var i=t?`float:right;margin-left:`+(n?`10px`:`20px`):``;return e=J(e)?e:[e],``+K(e,function(e){return WS(e)}).join(`  `)+``}function hE(e,t,n){return e.markupStyleCreator.wrapRichTextStyle(t,n)}function gE(e,t,n,r,i){var a=[i],o=r?10:20;return n&&a.push({padding:[0,0,0,o],align:`right`}),e.markupStyleCreator.wrapRichTextStyle(J(t)?t.join(` `):t,a)}function _E(e,t){var n=e.getData().getItemVisual(t,`style`)[e.visualDrawType];return QC(n)}function vE(e,t){return e.get(`padding`)??(t===`richText`?[8,10]:10)}var yE=function(){function e(){this.richTextStyles={},this._nextStyleNameId=Wu()}return e.prototype._generateStyleName=function(){return`__EC_aUTo_`+this._nextStyleNameId++},e.prototype.makeTooltipMarker=function(e,t,n){var r=n===`richText`?this._generateStyleName():null,i=ZC({color:t,type:e,renderMode:n,markerId:r});return Y(i)?i:(this.richTextStyles[r]=i.style,i.content)},e.prototype.wrapRichTextStyle=function(e,t){var n={};J(t)?G(t,function(e){return W(n,e)}):W(n,t);var r=this._generateStyleName();return this.richTextStyles[r]=n,`{`+r+`|`+e+`}`},e}();function bE(e){var t=e.series,n=e.dataIndex,r=e.multipleSeries,i=t.getData(),a=i.mapDimensionsAll(`defaultedTooltip`),o=a.length,s=t.getRawValue(n),c=J(s),l=_E(t,n),u,d,f,p;if(o>1||c&&!o){var m=xE(s,t,n,a,l);u=m.inlineValues,d=m.inlineValueTypes,f=m.blocks,p=m.inlineValues[0]}else if(o){var h=i.getDimensionInfo(a[0]);p=u=mT(i,n,a[0]),d=h.type}else p=u=c?s[0]:s;var g=vd(t),_=g&&t.name||``,v=i.getName(n),y=r?_:v;return iE(`section`,{header:_,noHeader:r||!g,sortParam:p,blocks:[iE(`nameValue`,{markerType:`item`,markerColor:l,name:y,noName:!Gl(y),value:u,valueType:d,rawDataIndex:i.getRawIndex(n)})].concat(f||[])})}function xE(e,t,n,r,i){var a=t.getData(),o=wl(e,function(e,t,n){var r=a.getDimensionInfo(n);return e||=r&&r.tooltip!==!1&&r.displayName!=null},!1),s=[],c=[],l=[];r.length?G(r,function(e){u(mT(a,n,e),e)}):G(e,u);function u(e,t){var n=a.getDimensionInfo(t);n&&n.otherDims.tooltip!==!1&&(o?l.push(iE(`nameValue`,{markerType:`subItem`,markerColor:i,name:n.displayName,value:e,valueType:n.type})):(s.push(e),c.push(n.type)))}return{inlineValues:s,inlineValueTypes:c,blocks:l}}var SE=Td();function CE(e,t){return e.getName(t)||e.getId(t)}var wE=function(e){U(t,e);function t(){var t=e!==null&&e.apply(this,arguments)||this;return t._selectedDataIndicesMap={},t}return t.prototype.init=function(e,t,n){this.seriesIndex=this.componentIndex,this.dataTask=vT({count:DE,reset:OE}),this.dataTask.context={model:this},this.mergeDefaultAndTheme(e,n),(SE(this).sourceManager=new qT(this)).prepareSource();var r=this.getInitialData(e,n);AE(r,this),this.dataTask.context.data=r,SE(this).dataBeforeProcessed=r,TE(this),this._initSelectedMapFromData(r)},t.prototype.mergeDefaultAndTheme=function(e,t){var n=_w(this),r=n?yw(e):{},i=this.subType;Sw.hasClass(i)&&(i+=`Series`),gl(e,t.getTheme().get(this.subType)),gl(e,this.getDefaultOption()),id(e,`label`,[`show`]),this.fillDataTextStyle(e.data),n&&vw(e,r,n)},t.prototype.mergeOption=function(e,t){e=gl(this.option,e,!0),this.fillDataTextStyle(e.data);var n=_w(this);n&&vw(this.option,e,n);var r=SE(this).sourceManager;r.dirty(),r.prepareSource();var i=this.getInitialData(e,t);AE(i,this),this.dataTask.dirty(),this.dataTask.context.data=i,SE(this).dataBeforeProcessed=i,TE(this),this._initSelectedMapFromData(i)},t.prototype.fillDataTextStyle=function(e){if(e&&!Fl(e))for(var t=[`show`],n=0;n=0&&u<0)&&(l=v,u=_,d=0),_===u&&(c[d++]=m))}return c.length=d,c},t.prototype.formatTooltip=function(e,t,n){return bE({series:this,dataIndex:e,multipleSeries:t})},t.prototype.isAnimationEnabled=function(){var e=this.ecModel;if(ou.node&&!(e&&e.ssr))return!1;var t=this.getShallow(`animation`);return t&&this.getData().count()>this.getShallow(`animationThreshold`)&&(t=!1),!!t},t.prototype.restoreData=function(){this.dataTask.dirty()},t.prototype.getColorFromPalette=function(e,t,n){var r=this.ecModel,i=Ew.prototype.getColorFromPalette.call(this,e,t,n);return i||=r.getColorFromPalette(e,t,n),i},t.prototype.coordDimToDataDim=function(e){return this.getRawData().mapDimensionsAll(e)},t.prototype.getProgressive=function(){return this.get(`progressive`)},t.prototype.getProgressiveThreshold=function(){return this.get(`progressiveThreshold`)},t.prototype.select=function(e,t){this._innerSelect(this.getData(t),e)},t.prototype.unselect=function(e,t){var n=this.option.selectedMap;if(n){var r=this.option.selectedMode,i=this.getData(t);if(r===`series`||n===`all`){this.option.selectedMap={},this._selectedDataIndicesMap={};return}for(var a=0;a=0&&n.push(i)}return n},t.prototype.isSelected=function(e,t){var n=this.option.selectedMap;if(!n)return!1;var r=this.getData(t);return(n===`all`||n[CE(r,e)])&&!r.getItemModel(e).get([`select`,`disabled`])},t.prototype.isUniversalTransitionEnabled=function(){if(this.__universalTransitionEnabled)return!0;var e=this.option.universalTransition;return e?e===!0||e&&e.enabled:!1},t.prototype._innerSelect=function(e,t){var n,r,i=this.option,a=i.selectedMode,o=t.length;if(a&&o){if(a===`series`)i.selectedMap=`all`;else if(a===`multiple`){Nl(i.selectedMap)||(i.selectedMap={});for(var s=i.selectedMap,c=0;c0&&this._innerSelect(e,t)}},t.registerClass=function(e){return Sw.registerClass(e)},t.protoInitialize=function(){var e=t.prototype;e.type=`series.__base__`,e.seriesIndex=0,e.ignoreStyleOnData=!1,e.hasSymbolVisual=!1,e.defaultSymbol=`circle`,e.visualStyleAccessPath=`itemStyle`,e.visualDrawType=`fill`}(),t}(Sw);Sl(wE,gT),Sl(wE,Ew),lf(wE,Sw);function TE(e){var t=e.name;vd(e)||(e.name=EE(e)||t)}function EE(e){var t=e.getRawData(),n=t.mapDimensionsAll(`seriesName`),r=[];return G(n,function(e){var n=t.getDimensionInfo(e);n.displayName&&r.push(n.displayName)}),r.join(` `)}function DE(e){return e.model.getRawData().count()}function OE(e){var t=e.model;return t.setData(t.getRawData().cloneShallow()),kE}function kE(e,t){t.outputData&&e.end>t.outputData.count()&&t.model.getRawData().cloneShallow(t.outputData)}function AE(e,t){G(eu(e.CHANGABLE_METHODS,e.DOWNSAMPLE_METHODS),function(n){e.wrapMethod(n,kl(jE,t))})}function jE(e,t){var n=ME(e);return n&&n.setOutputEnd((t||this).count()),t}function ME(e){var t=(e.ecModel||{}).scheduler,n=t&&t.getPipeline(e.uid);if(n){var r=n.currentTask;if(r){var i=r.agentStubMap;i&&(r=i.get(e.uid))}return r}}function NE(e){return e==null?0:e.length||1}function PE(e){return e}var FE=function(){function e(e,t,n,r,i,a){this._old=e,this._new=t,this._oldKeyGetter=n||PE,this._newKeyGetter=r||PE,this.context=i,this._diffModeMultiple=a===`multiple`}return e.prototype.add=function(e){return this._add=e,this},e.prototype.update=function(e){return this._update=e,this},e.prototype.updateManyToOne=function(e){return this._updateManyToOne=e,this},e.prototype.updateOneToMany=function(e){return this._updateOneToMany=e,this},e.prototype.updateManyToMany=function(e){return this._updateManyToMany=e,this},e.prototype.remove=function(e){return this._remove=e,this},e.prototype.execute=function(){this[this._diffModeMultiple?`_executeMultiple`:`_executeOneToOne`]()},e.prototype._executeOneToOne=function(){var e=this._old,t=this._new,n={},r=Array(e.length),i=Array(t.length);this._initIndexMap(e,null,r,`_oldKeyGetter`),this._initIndexMap(t,n,i,`_newKeyGetter`);for(var a=0;a1){var l=s.shift();s.length===1&&(n[o]=s[0]),this._update&&this._update(l,a)}else c===1?(n[o]=null,this._update&&this._update(s,a)):this._remove&&this._remove(a)}this._performRestAdd(i,n)},e.prototype._executeMultiple=function(){var e=this._old,t=this._new,n={},r={},i=[],a=[];this._initIndexMap(e,n,i,`_oldKeyGetter`),this._initIndexMap(t,r,a,`_newKeyGetter`);for(var o=0;o1&&d===1)this._updateManyToOne&&this._updateManyToOne(l,c),r[s]=null;else if(u===1&&d>1)this._updateOneToMany&&this._updateOneToMany(l,c),r[s]=null;else if(u===1&&d===1)this._update&&this._update(l,c),r[s]=null;else if(u>1&&d>1)this._updateManyToMany&&this._updateManyToMany(l,c),r[s]=null;else if(u>1)for(var f=0;f1)for(var o=0;oi&&(i+=IE);var p=Math.atan2(s,o);if(p<0&&(p+=IE),p>=r&&p<=i||p+IE>=r&&p+IE<=i)return c[0]=u,c[1]=d,l-n;var m=n*Math.cos(r)+e,h=n*Math.sin(r)+t,g=n*Math.cos(i)+e,_=n*Math.sin(i)+t,v=(m-o)*(m-o)+(h-s)*(h-s),y=(g-o)*(g-o)+(_-s)*(_-s);return v0){t=t/180*Math.PI,KE.fromArray(e[0]),qE.fromArray(e[1]),JE.fromArray(e[2]),Qf.sub(YE,KE,qE),Qf.sub(XE,JE,qE);var n=YE.len(),r=XE.len();if(!(n<.001||r<.001)){YE.scale(1/n),XE.scale(1/r);var i=YE.dot(XE);if(Math.cos(t)1&&Qf.copy($E,JE),$E.toArray(e[1])}}}}function tD(e,t,n,r){var i=n===`normal`,a=i?e:e.ensureState(n);a.ignore=t;var o=r.get(`smooth`);o=o===!0?.3:Math.max(+o,0)||0,a.shape=a.shape||{},a.shape.smooth=o;var s=r.getModel(`lineStyle`).getLineStyle();i?e.useStyle(s):a.style=s}function nD(e,t){var n=t.smooth,r=t.points;if(r){if(e.moveTo(r[0][0],r[0][1]),n>0&&r.length>=3){var i=Gf(r[0],r[1]),a=Gf(r[1],r[2]);if(!i||!a){e.lineTo(r[1][0],r[1][1]),e.lineTo(r[2][0],r[2][1]);return}var o=Math.min(i,a)*n,s=Jf([],r[1],r[0],o/i),c=Jf([],r[1],r[2],o/a),l=Jf([],s,c,.5);e.bezierCurveTo(s[0],s[1],s[0],s[1],l[0],l[1]),e.bezierCurveTo(c[0],c[1],c[0],c[1],r[2][0],r[2][1])}else for(var u=1;u0&&i&&S(-d/a,0,a);var g=e[0],_=e[a-1],v,y;b(),v<0&&C(-v,.8),y<0&&C(y,.8),b(),x(v,y,1),x(y,v,-1),b(),v<0&&w(-v),y<0&&w(y);function b(){v=g.rect[o]-n,y=r-_.rect[o]-_.rect[s]}function x(e,t,n){if(e<0){var r=Math.min(t,-e);if(r>0){S(r*n,0,a);var i=r+e;i<0&&C(-i*n,1)}else C(-e*n,1)}}function S(t,n,r){t!==0&&(u=!0);for(var i=n;i0)for(var c=0;c0;c--){var f=r[c-1]*d;S(-f,c,a)}}}function w(e){var t=e<0?-1:1;e=Math.abs(e);for(var n=Math.ceil(e/(a-1)),r=0;r0?S(n,0,r+1):S(-n,a-r-1,a),e-=n,e<=0)return}return u}function yD(e){for(var t=0;t=0&&n.attr(i.oldLayoutSelect),bl(u,`emphasis`)>=0&&n.attr(i.oldLayoutEmphasis)),Yb(n,c,t,s)}else if(n.attr(c),!dS(n).valueAnimation){var d=X(n.style.opacity,1);n.style.opacity=0,Xb(n,{style:{opacity:d}},t,s)}if(i.oldLayout=c,n.states.select){var f=i.oldLayoutSelect={};OD(f,c,kD),OD(f,n.states.select,kD)}if(n.states.emphasis){var p=i.oldLayoutEmphasis={};OD(p,c,kD),OD(p,n.states.emphasis,kD)}pS(n,s,l,t,t)}if(r&&!r.ignore&&!r.invisible){var i=DD(r),a=i.oldLayout,m={points:r.shape.points};a?(r.attr({shape:a}),Yb(r,{shape:m},t)):(r.setShape(m),r.style.strokePercent=0,Xb(r,{style:{strokePercent:1}},t)),i.oldLayout=m}},e}(),jD=Td();function MD(e){e.registerUpdateLifecycle(`series:beforeupdate`,function(e,t,n){var r=jD(t).labelManager;r||=jD(t).labelManager=new AD,r.clearLabels()}),e.registerUpdateLifecycle(`series:layoutlabels`,function(e,t,n){var r=jD(t).labelManager;G(n.updatedSeries,function(e){r.addLabelsOfSeries(t.getViewOfSeriesModel(e))}),r.updateLayoutConfig(t),r.layout(t),r.processLabelsOverall()})}var ND=Dl({needTransform:1,normalize:1,scale:1,transformIn:1,transformOut:1,contain:1,getExtent:1,getExtentUnsafe:1,setExtent:1,setExtent2:1,getFilter:1,sanitize:1,getDefaultStartValue:1,freeze:1});function PD(e,t,n){var r;e||={};var i=iC();if(i){var a=i.createBreakScaleMapper(t,n);a.hasBreaks()&&(G(ND,function(t){a[t]&&(e[t]=q(a[t],a))}),r=a)}return r??VD(e,n),{brk:r,mapper:e}}function FD(e,t){G(ND,function(n){e[n]=t[n]})}function ID(e,t){e.freeze=ru}function LD(e){return e.getExtentUnsafe(0,2)}function RD(e,t){return e.getExtentUnsafe(1,t)||e.getExtentUnsafe(0,t)}function zD(e){var t=RD(e,3);return t[1]-t[0]}function BD(e){var t=e.getExtentUnsafe(0,3);return t[1]-t[0]}function VD(e,t){var n=e||{},r=[];return n._extents=r,r[0]=t?t.slice():Ld(),W(n,HD),n}var HD={needTransform:function(){return!1},normalize:function(e){var t=this._extents[1]||this._extents[0];return t[1]===t[0]?.5:(e-t[0])/(t[1]-t[0])},scale:function(e){var t=this._extents[1]||this._extents[0];return e*(t[1]-t[0])+t[0]},transformIn:function(e){return e},transformOut:function(e){return e},contain:function(e){var t=RD(this,null);return e>=t[0]&&e<=t[1]},getExtent:function(){return this._extents[0].slice()},getExtentUnsafe:function(e){return this._extents[e]},setExtent:function(e,t){UD(this._extents,0,e,t)},setExtent2:function(e,t,n){var r=this._extents;r[e]||(r[e]=r[0].slice()),UD(r,e,t,n)},freeze:function(){}};function UD(e,t,n,r){Ud(n,r)&&(e[t][0]=n,e[t][1]=r)}var WD=`expandAxisBreak`,GD=null;function KD(){return GD}var qD=function(){function e(){}return e.prototype.isBlank=function(){return this._isBlank},e.prototype.setBlank=function(e){this._isBlank=e},e}();mf(qD);var JD=0,YD=function(){function e(e){this.categories=e.categories||[],this._needCollect=e.needCollect,this._deduplication=e.deduplication,this.uid=++JD,this._onCollect=e.onCollect}return e.createByAxisModel=function(t){var n=t.option,r=n.data,i=r&&K(r,XD);return new e({categories:i,needCollect:!i,deduplication:n.dedplication!==!1})},e.prototype.getOrdinal=function(e){return this._getOrCreateMap().get(e)},e.prototype.parseAndCollect=function(e){var t,n=this._needCollect;if(!Y(e)&&!n)return e;if(n&&!this._deduplication)return t=this.categories.length,this.categories[t]=e,this._onCollect&&this._onCollect(e,t),t;var r=this._getOrCreateMap();return t=r.get(e),t??(n?(t=this.categories.length,this.categories[t]=e,r.set(e,t),this._onCollect&&this._onCollect(e,t)):t=NaN),t},e.prototype._getOrCreateMap=function(){return this._map||=$l(this.categories)},e}();function XD(e){return Nl(e)&&e.value!=null?e.value:e+``}function ZD(e){return QD(e)||eO(e)}function QD(e){return e.type===`interval`}function $D(e){return e.type===`time`}function eO(e){return e.type===`log`}function tO(e){return e.type===`ordinal`}function nO(e){var t=zu(e),n=_u(10,t),r=mu(e/n);return r?r===2?r=3:r===3?r=5:r*=2:r=1,Du(r*n,-t)}function rO(e){return ku(e)+2}function iO(e,t){return vu(e)/vu(t)}function aO(e,t,n){var r=n&&n.lookup;if(r){for(var i=0;i1&&a/o>2&&(i=Math.round(Math.ceil(i/o)*o)),i!==r[0]&&c(r[0],!0,!0);for(var s=i;s<=r[1];s+=o)c(s,!1,s===r[0]||s===r[1]);s-o!==r[1]&&c(r[1],!0,!0);function c(e,t,r){n({value:e,offInterval:t},r)}}var uO=function(e){U(t,e);function t(n){var r=e.call(this)||this;r.type=`ordinal`,r.parse=t.parse,FD(r,t.decoratedMethods);var i=n.ordinalMeta;i||=new YD({}),J(i)&&(i=new YD({categories:K(i,function(e){return Nl(e)?e.value:e})})),r._ordinalMeta=i;var a=PD(null,null,n.extent||[0,i.categories.length-1]);return r._mapper=a.mapper,ID(r,a.mapper),r}return t.parse=function(e){return e==null?e=NaN:Y(e)?(e=this._ordinalMeta.getOrdinal(e),e??=NaN):e=mu(e),e},t.prototype.getTicks=function(){var e=[];return lO(this,0,function(t){e.push(t)}),e},t.prototype.getMinorTicks=function(e){},t.prototype.setSortInfo=function(e){if(e==null){this._ordinalNumbersByTick=this._ticksByOrdinalNumber=null;return}for(var t=e.ordinalNumbers,n=this._ordinalNumbersByTick=[],r=this._ticksByOrdinalNumber=[],i=0,a=this._ordinalMeta.categories.length,o=du(a,t.length);i=0&&e=0&&e=0&&eo[0]&&mi[1]||!isFinite(p)||!isFinite(i[1]))break}else{if(m>f)break;p=du(p,i[1]),m===f&&(p=i[1])}if(l.push({value:p}),p=Du(p+n,a),s){var h=s.calcNiceTickMultiple(p,d);h>=0&&(p=Du(p+h*n,a))}if(l.length>0&&p===l[l.length-1].value)break;if(l.length>u)return[]}var g=l.length?l[l.length-1].value:i[1];return r[1]>g&&l.push({value:e.expandToNicedExtent?Du(g+n,a):r[1]}),c&&o.pruneTicksByBreak(e.pruneByBreak,l,s.breaks,function(e){return e.value},t.interval,r),c&&e.breakTicks!==`none`&&o.addBreaksToTicks(l,s.breaks,r),l},t.prototype.getMinorTicks=function(e){return dO(this,e,oC(this),this._cfg.interval)},t.prototype.getLabel=function(e,t){if(e==null)return``;var n=t&&t.precision;return n==null?n=ku(e.value)||0:n===`auto`&&(n=this._cfg.intervalPrecision),WC(Du(e.value,n,!0))},t.type=`interval`,t}(qD);qD.registerClass(fO);var pO=function(e,t,n,r){for(;n>>1;e[i][1]16?16:e>7.5?7:e>3.5?4:e>1.5?2:1}function vO(e){var t=30*dC;return e/=t,e>6?6:e>3?3:e>2?2:1}function yO(e){return e/=uC,e>12?12:e>6?6:e>3.5?4:e>2?2:1}function bO(e,t){return e/=t?lC:cC,e>30?30:e>20?20:e>15?15:e>10?10:e>5?5:e>2?2:1}function xO(e){return fu(Bu(e,!0),1)}function SO(e,t,n){var r=Math.max(0,bl(vC,t)-1);return kC(new Date(e),vC[r],n).getTime()}function CO(e,t){var n=new Date(0);n[e](1);var r=n.getTime();n[e](1+t);var i=n.getTime()-r;return function(e,t){return Math.max(0,Math.round((t-e)/i))}}function wO(e,t,n,r,i,a){var o=yC,s=0;function c(e,t,n,i,o,c,l){for(var u=CO(o,e),d=t,f=new Date(d);d3e3));)if(f[o](f[i]()+e),d=f.getTime(),a){var p=a.calcNiceTickMultiple(d,u);p>0&&(f[o](f[i]()+p*e),d=f.getTime())}l.push({value:d,notAdd:d>r[1]})}function l(e,i,a){var o=[],s=!i.length;if(!gO(CC(e),r[0],r[1],n)){s&&(i=[{value:SO(r[0],e,n)},{value:r[1]}]);for(var l=0;l=r[0]&&u<=r[1]&&c(f,u,d,p,m,h,o),e===`year`&&a.length>1&&l===0&&a.unshift({value:a[0].value-f})}}for(var l=0;l=r[0]&&v<=r[1]&&f++)}var y=i/t;if(f>y*1.5&&p>y/1.5||(u.push(g),f>y||e===o[m]))break}d=[]}}for(var b=Tl(K(u,function(e){return Tl(e,function(e){return e.value>=r[0]&&e.value<=r[1]&&!e.notAdd})}),function(e){return e.length>0}),x=b.length-1,S=[],m=0;mr[0])&&S.unshift({value:r[0],time:{level:0,upperTimeUnit:O,lowerTimeUnit:O},notNice:!0}),(!D||D.values&&(a=s);var c=hO.length,l=Math.min(pO(hO,a,0,c),c-1),u=hO[l][1],d=hO[Math.max(l-1,0)][0];e.setTimeInterval({approxInterval:a,interval:u,minLevelUnit:d})};qD.registerClass(mO);var EO=0,DO=1,OO=2,kO=function(e){U(t,e);function t(n){var r=e.call(this)||this;r.type=`log`,r.parse=fO.parse,r.base=n.logBase||10;var i=[],a=[],o=r._lookup={from:i,to:a};i[EO]=i[DO]=a[EO]=a[DO]=NaN,FD(r,t.mapperMethods);var s=iC(),c=n.breakOption,l={lookup:o};return s&&s.parseAxisBreakOptionInwardTransform(c,r,{noNegative:!0},OO,l),r.powStub=new fO({breakParsed:l.original}),r.intervalStub=new fO({breakParsed:l.transformed}),ID(r,r.intervalStub),r}return t.prototype.getTicks=function(e){var t=this.base,n=this.powStub,r=iC(),i=this.intervalStub,a={lookup:{from:i.getExtent(),to:n.getExtent()}};return K(i.getTicks(e||{}),function(e){var i=e.value,o=aO(i,t,a),s;if(r){var c=r.getTicksBreakOutwardTransform(this,e,oC(n),this._lookup);c&&(s=c.vBreak,o=c.tickVal)}return{value:o,break:s}},this)},t.prototype.getMinorTicks=function(e){return dO(this,e,oC(this.powStub),this.intervalStub.getConfig().interval)},t.prototype.getLabel=function(e,t){return this.intervalStub.getLabel(e,t)},t.type=`log`,t.mapperMethods={needTransform:function(){return!0},normalize:function(e){return this.intervalStub.normalize(iO(e,this.base))},scale:function(e){return aO(this.intervalStub.scale(e),this.base,null)},transformIn:function(e,t){return e=iO(e,this.base),t&&t.depth===2?e:this.intervalStub.transformIn(e,t)},transformOut:function(e,t){var n=t?t.depth:null;return AO.depth=n,jO.lookup=this._lookup,aO(n===2?e:this.intervalStub.transformOut(e,AO),this.base,jO)},contain:function(e){return this.powStub.contain(e)},setExtent:function(e,t){this.setExtent2(0,e,t)},setExtent2:function(e,t,n){if(!(!Ud(t,n)||t<=0||n<=0)){var r=MO,i=MO;if(e===0){var a=this._lookup;r=a.to,i=a.from}this.powStub.setExtent2(e,r[EO]=t,r[DO]=n);var o=this.base;this.intervalStub.setExtent2(e,i[EO]=iO(t,o),i[DO]=iO(n,o))}},getFilter:function(){return{g:0}},sanitize:function(e,t){return Ud(t[0],t[1])&&qu(e)&&e<=0&&(e=t[0]),e},getDefaultStartValue:function(){return 1},getExtent:function(){return this.powStub.getExtent()},getExtentUnsafe:function(e,t){return t===null?this.powStub.getExtentUnsafe(e,null):this.intervalStub.getExtentUnsafe(e,t)}},t}(qD);qD.registerClass(kO);var AO={},jO={},MO=[],NO={value:1,category:1,time:1,log:1},PO=Td(),FO={float:`f`,int:`i`,ordinal:`o`,number:`n`,time:`t`},IO=function(){function e(e){this.dimensions=e.dimensions,this._dimOmitted=e.dimensionOmitted,this.source=e.source,this._fullDimCount=e.fullDimensionCount,this._updateDimOmitted(e.dimensionOmitted)}return e.prototype.isDimensionOmitted=function(){return this._dimOmitted},e.prototype._updateDimOmitted=function(e){this._dimOmitted=e,e&&(this._dimNameMap||=zO(this.source))},e.prototype.getSourceDimensionIndex=function(e){return X(this._dimNameMap.get(e),-1)},e.prototype.getSourceDimension=function(e){var t=this.source.dimensionsDefine;if(t)return t[e]},e.prototype.makeStoreSchema=function(){for(var e=this._fullDimCount,t=Yw(this.source),n=!BO(e),r=``,i=[],a=0,o=0;a30}function VO(e,t,n){n||={};var r=n.byIndex,i=n.stackedCoordDimension,a,o,s;HO(t)?a=t:(o=t.schema,a=o.dimensions,s=t.store);var c=!!(e&&e.get(`stack`)),l,u,d,f,p=!0;function m(e){return e.type!==`ordinal`&&e.type!==`time`}if(G(a,function(e,t){Y(e)&&(a[t]=e={name:e}),m(e)||(p=!1)}),G(a,function(e,t){c&&!e.isExtraCoord&&(!r&&!l&&e.ordinalMeta&&(l=e),!u&&m(e)&&(!p||e.coordDim!==`x`&&e.coordDim!==`angle`)&&(!i||i===e.coordDim)&&(u=e))}),u&&!r&&!l&&(r=!0),u){d=`__\0ecstackresult_`+e.id,f=`__\0ecstackedover_`+e.id,l&&(l.createInvertedIndices=!0);var h=u.coordDim,g=u.type,_=0;G(a,function(e){e.coordDim===h&&_++});var v={name:d,coordDim:h,coordDimIndex:_,type:g,isExtraCoord:!0,isCalculationCoord:!0,storeDimIndex:a.length},y={name:f,coordDim:f,coordDimIndex:_+1,type:g,isExtraCoord:!0,isCalculationCoord:!0,storeDimIndex:a.length+1};o?(s&&(v.storeDimIndex=s.ensureCalculationDimension(f,g),y.storeDimIndex=s.ensureCalculationDimension(d,g)),o.appendCalculationDimension(v),o.appendCalculationDimension(y)):(a.push(v),a.push(y))}return{stackedDimension:u&&u.name,stackedByDimension:l&&l.name,isStackedByIndex:r,stackedOverDimension:f,stackResultDimension:d}}function HO(e){return!LO(e.schema)}function UO(e,t){return!!t&&t===e.getCalculationInfo(`stackedDimension`)}function WO(e,t){return UO(e,t)?e.getCalculationInfo(`stackResultDimension`):t}var GO=Td();function KO(e){var t=e.get(`type`);return(t==null||!Z(NO,t)&&!qD.getClass(t))&&(t=`value`),t}function qO(e,t,n){var r=iC(),i;switch(r&&(i=ik(e,t,n)),t){case`category`:return new uO({ordinalMeta:e.getOrdinalMeta?e.getOrdinalMeta():e.getCategories(),extent:Ld()});case`time`:return new mO({locale:e.ecModel.getLocaleModel(),useUTC:e.ecModel.get(`useUTC`),breakOption:i});case`log`:return new kO({logBase:e.get(`logBase`),breakOption:i});case`value`:return new fO({breakOption:i});default:return new((qD.getClass(t))||fO)({})}}function JO(e,t,n){var r=n?RD(e,null):e.getExtentUnsafe(0,null),i=r[0],a=r[1];return Ud(i,a)?i===t||a===t?2:it?1:3:3}function YO(e){GO(e).noOnMyZero=!0}function XO(e){return GO(e).noOnMyZero}function ZO(e){var t=e.getLabelModel().get(`formatter`);if(e.type===`time`){var n=bC(t);return function(t,r){return e.scale.getFormattedLabel(t,r,n)}}if(Y(t))return function(n){var r=e.scale.getLabel(n);return t.replace(`{value}`,r??``)};if(Al(t)){if(e.type===`category`)return function(n,r){return t(QO(e,n),n.value-e.scale.getExtent()[0],null)};var r=iC();return function(n,i){var a=null;return r&&(a=r.makeAxisLabelFormatterParamBreak(a,n.break)),t(QO(e,n),i,a)}}return function(t){return e.scale.getLabel(t)}}function QO(e,t){var n=e.scale;return tO(n)?n.getLabel(t):t.value}function $O(e){return e.get(`interval`)??`auto`}function ek(e){return e.type===`category`&&$O(e.getLabelModel())===0}function tk(e,t){var n={};return G(e.mapDimensionsAll(t),function(t){n[WO(e,t)]=!0}),Dl(n)}function nk(e){return e===`middle`||e===`center`}function rk(e){return e.getShallow(`show`)}function ik(e,t,n){var r=e.get(`breaks`,!0);if(r!=null)return!iC()||!n||!ak(t)?void 0:r}function ak(e){return e!==`category`}function ok(e,t,n,r,i,a){var o=eO(e),s=o?e.intervalStub:e;if(s.setExtent(r[0],r[1]),o){var c=e.powStub,l={depth:2},u=e.transformOut(r[0],l),d=e.transformOut(r[1],l),f=sO(n,r);t[0]&&!f[0]&&(u=i[0]),t[1]&&!f[1]&&(d=i[1]),c.setExtent(u,d)}s.setConfig(a)}function sk(e,t){return tO(e)?e.getRawOrdinalNumber(t.value):t.value}function ck(e,t){return tO(e)&&!!t.get(`boundaryGap`)}var lk=function(){function e(e){this.type=`cartesian`,this._dimList=[],this._axes={},this.name=e||``}return e.prototype.getAxis=function(e){return this._axes[e]},e.prototype.getAxes=function(){return K(this._dimList,function(e){return this._axes[e]},this)},e.prototype.getAxesByScale=function(e){return e=e.toLowerCase(),Tl(this.getAxes(),function(t){return t.scale.type===e})},e.prototype.addAxis=function(e){var t=e.dim;this._axes[t]=e,this._dimList.push(t)},e}(),uk={left:0,right:0,top:0,bottom:0},dk=[`25%`,`25%`],fk=`cartesian2d`,pk=function(e){U(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}return t.prototype.mergeDefaultAndTheme=function(t,n){var r=yw(t.outerBounds);e.prototype.mergeDefaultAndTheme.apply(this,arguments),r&&t.outerBounds&&vw(t.outerBounds,r)},t.prototype.mergeOption=function(t,n){e.prototype.mergeOption.apply(this,arguments),this.option.outerBounds&&t.outerBounds&&vw(this.option.outerBounds,t.outerBounds)},t.type=`grid`,t.dependencies=[`xAxis`,`yAxis`],t.layoutMode=`box`,t.defaultOption={show:!1,z:0,left:`15%`,top:65,right:`10%`,bottom:80,containLabel:!1,outerBoundsMode:`auto`,outerBounds:uk,outerBoundsContain:`all`,outerBoundsClampWidth:dk[0],outerBoundsClampHeight:dk[1],backgroundColor:Q.color.transparent,borderWidth:1,borderColor:Q.color.neutral30},t}(Sw),mk=[`x`,`y`];function hk(e){return(e.type===`interval`||e.type===`time`)&&!sC(e)}var gk=function(e){U(t,e);function t(){var t=e!==null&&e.apply(this,arguments)||this;return t.type=fk,t.dimensions=mk,t}return t.prototype.calcAffineTransform=function(){this._transform=this._invTransform=null;var e=this.getAxis(`x`).scale,t=this.getAxis(`y`).scale;if(hk(e)&&hk(t)){var n=RD(e,null),r=RD(t,null),i=this.dataToPoint([n[0],r[0]]),a=this.dataToPoint([n[1],r[1]]),o=n[1]-n[0],s=r[1]-r[0];if(o&&s){var c=(a[0]-i[0])/o,l=(a[1]-i[1])/s,u=i[0]-n[0]*c,d=i[1]-r[0]*l,f=this._transform=[c,0,0,l,u,d];this._invTransform=Nf([],f)}}},t.prototype.getBaseAxis=function(){return this.getAxesByScale(`ordinal`)[0]||this.getAxesByScale(`time`)[0]||this.getAxis(`x`)},t.prototype.containPoint=function(e){var t=this.getAxis(`x`),n=this.getAxis(`y`);return t.contain(t.toLocalCoord(e[0]))&&n.contain(n.toLocalCoord(e[1]))},t.prototype.containData=function(e){return this.getAxis(`x`).containData(e[0])&&this.getAxis(`y`).containData(e[1])},t.prototype.containZone=function(e,t){var n=this.dataToPoint(e),r=this.dataToPoint(t),i=this.getArea(),a=new fp(n[0],n[1],r[0]-n[0],r[1]-n[1]);return i.intersect(a)},t.prototype.dataToPoint=function(e,t,n){n||=[];var r=e[0],i=e[1];if(this._transform&&r!=null&&isFinite(r)&&i!=null&&isFinite(i))return Yf(n,e,this._transform);var a=this.getAxis(`x`),o=this.getAxis(`y`);return n[0]=a.toGlobalCoord(a.dataToCoord(r,t)),n[1]=o.toGlobalCoord(o.dataToCoord(i,t)),n},t.prototype.clampData=function(e,t){var n=this.getAxis(`x`).scale,r=this.getAxis(`y`).scale,i=n.getExtent(),a=r.getExtent(),o=n.parse(e[0]),s=r.parse(e[1]);return t||=[],t[0]=Math.min(Math.max(Math.min(i[0],i[1]),o),Math.max(i[0],i[1])),t[1]=Math.min(Math.max(Math.min(a[0],a[1]),s),Math.max(a[0],a[1])),t},t.prototype.pointToData=function(e,t,n){if(n||=[],this._invTransform)return Yf(n,e,this._invTransform);var r=this.getAxis(`x`),i=this.getAxis(`y`);return n[0]=r.coordToData(r.toLocalCoord(e[0]),t),n[1]=i.coordToData(i.toLocalCoord(e[1]),t),n},t.prototype.getOtherAxis=function(e){return this.getAxis(e.dim===`x`?`y`:`x`)},t.prototype.getArea=function(e){e||=0;var t=this.getAxis(`x`).getGlobalExtent(),n=this.getAxis(`y`).getGlobalExtent(),r=Math.min(t[0],t[1])-e,i=Math.min(n[0],n[1])-e;return new fp(r,i,Math.max(t[0],t[1])-r+e,Math.max(n[0],n[1])-i+e)},t}(lk),_k=Td(),vk=Td(),yk={estimate:1,determine:2};function bk(e){return{out:{noPxChangeTryDetermine:[]},kind:e}}function xk(e,t){var n=e.getLabelModel().get(`customValues`);if(n){var r=e.scale;return{labels:K(Ck(n,r),function(t,n){return{formattedLabel:ZO(e)(t,n),rawLabel:r.getLabel(t),tick:t}})}}return e.type===`category`?wk(e,t):Dk(e)}function Sk(e,t,n){var r=e.scale,i=e.getTickModel().get(`customValues`);return i?{ticks:Ck(i,r)}:e.type===`category`?Ek(e,t):{ticks:r.getTicks(n)}}function Ck(e,t){var n=t.getExtent(),r=[];return G(e,function(e){e=t.parse(e),e>=n[0]&&e<=n[1]&&r.push(e)}),Jd(r,Xd,null),Ou(r),K(r,function(e){return{value:e}})}function wk(e,t){var n=e.getLabelModel(),r=Tk(e,n,t);return!n.get(`show`)||e.scale.isBlank()?{labels:[]}:r}function Tk(e,t,n){var r=kk(e),i=$O(t),a=n.kind===yk.estimate;if(!a){var o=jk(r,i);if(o)return o}var s,c;Al(i)?s=Rk(e,i,!1):(c=i===`auto`?Nk(e,n):i,s=Rk(e,c,!1));var l={labels:s,labelCategoryInterval:c};return a?n.out.noPxChangeTryDetermine.push(function(){return Mk(r,i,l),!0}):Mk(r,i,l),l}function Ek(e,t){var n=Ok(e),r=$O(t),i=jk(n,r);if(i)return i;var a,o;if((!t.get(`show`)||e.scale.isBlank())&&(a=[]),Al(r))a=Rk(e,r,!0);else if(r===`auto`){var s=Tk(e,e.getLabelModel(),bk(yk.determine));o=s.labelCategoryInterval,a=K(s.labels,function(e){return e.tick})}else o=r,a=Rk(e,o,!0);return Mk(n,r,{ticks:a,tickCategoryInterval:o})}function Dk(e){var t=e.scale.getTicks(),n=ZO(e);return{labels:K(t,function(t,r){return{formattedLabel:n(t,r),rawLabel:e.scale.getLabel(t),tick:t}})}}var Ok=Ak(`axisTick`),kk=Ak(`axisLabel`);function Ak(e){return function(t){return vk(t)[e]||(vk(t)[e]={list:[]})}}function jk(e,t){for(var n=0;nu&&(l=Math.max(1,Math.floor(c/u)));for(var d=s[0],f=e.dataToCoord(d+1)-e.dataToCoord(d),p=Math.abs(f*Math.cos(a)),m=Math.abs(f*Math.sin(a)),h=0,g=0;d<=s[1];d+=l){var _=0,v=0,y=Mp(i({value:d}),r.font,`center`,`top`);_=y.width*1.3,v=y.height*1.3,h=Math.max(h,_,7),g=Math.max(g,v,7)}var b=h/p,x=g/m;isNaN(b)&&(b=1/0),isNaN(x)&&(x=1/0);var S=Math.max(0,Math.floor(Math.min(b,x)));return n===yk.estimate?(t.out.noPxChangeTryDetermine.push(q(Fk,null,e,S,c)),S):Ik(e,S,c)??S}function Fk(e,t,n){return Ik(e,t,n)==null}function Ik(e,t,n){var r=_k(e.model),i=e.getExtent(),a=r.lastAutoInterval,o=r.lastTickCount;if(a!=null&&o!=null&&Math.abs(a-t)<=1&&Math.abs(o-n)<=1&&a>t&&r.axisExtent0===i[0]&&r.axisExtent1===i[1])return a;r.lastTickCount=n,r.lastAutoInterval=t,r.axisExtent0=i[0],r.axisExtent1=i[1]}function Lk(e){var t=e.getLabelModel();return{axisRotate:e.getRotate?e.getRotate():e.isHorizontal&&!e.isHorizontal()?90:0,labelRotate:t.get(`rotate`)||0,font:t.getFont()}}function Rk(e,t,n){var r=ZO(e),i=e.scale,a=[],o=Al(t);return lO(i,o?0:t,function(e,s){var c=i.getLabel(e);if(o){var l=!!t(e.value,c);if(e.offInterval=!l,!l&&!s)return}a.push(n?e:{formattedLabel:r(e),rawLabel:c,tick:e})}),a}var zk=Td();function Bk(e){zk(e).prepare={}}function Vk(e){zk(e).fullUpdate={}}function Hk(e){return zk(e).prepare}function Uk(e){return zk(e).fullUpdate}var Wk=Kd(),Gk=Td(),Kk=Td();function qk(e,t){var n=e.model,r=Gk(Uk(n.ecModel)).keyed,i=r&&r.get(t);return i&&i.get(n.uid)}function Jk(e,t){return Zk(qk(e,t))}function Yk(e,t){var n=[];return Xk(e.model.ecModel,function(e){for(var r=0;r0?(t>o&&(o=t),a=!1):t===-2&&(a=!0))}),qu(n)&&n>0&&qu(o)?(e.w=r/n*o,e.w2=o):a&&(e.w=r*uA,e.w2=e.w*n/r)}var mA=[0,1],hA=function(){function e(e,t,n){this.onBand=!1,this.inverse=!1,this.dim=e,this.scale=t,this._extent=n||[0,0]}return e.prototype.contain=function(e){var t=this._extent,n=Math.min(t[0],t[1]),r=Math.max(t[0],t[1]);return e>=n&&e<=r},e.prototype.containData=function(e){return this.scale.contain(this.scale.parse(e))},e.prototype.getExtent=function(){return this._extent.slice()},e.prototype.setExtent=function(e,t){var n=this._extent;n[0]=e,n[1]=t},e.prototype.dataToCoord=function(e,t){var n=this.scale;return e=n.normalize(n.parse(e)),Su(e,mA,gA(this),t)},e.prototype.coordToData=function(e,t){var n=Su(e,gA(this),mA,t);return this.scale.scale(n)},e.prototype.pointToData=function(e,t){},e.prototype.getTicksCoords=function(e){e||={};var t=e.tickModel||this.getTickModel(),n=K(Sk(this,t,{breakTicks:e.breakTicks,pruneByBreak:e.pruneByBreak}).ticks,function(e){return{coord:this.dataToCoord(sk(this.scale,e)),tick:e}},this),r=t.get(`alignWithLabel`),i=_A(this,n,r);return K(n,function(e){return{coord:e.coord,tickValue:e.tick.value,onBand:i}})},e.prototype.getMinorTicksCoords=function(){if(tO(this.scale))return[];var e=this.model.getModel(`minorTick`).get(`splitNumber`);return e>0&&e<100||(e=5),K(this.scale.getMinorTicks(e),function(e){return K(e,function(e){return{coord:this.dataToCoord(e),tickValue:e}},this)},this)},e.prototype.getViewLabels=function(e){return e||=bk(yk.determine),xk(this,e).labels},e.prototype.getLabelModel=function(){return this.model.getModel(`axisLabel`)},e.prototype.getTickModel=function(){return this.model.getModel(`axisTick`)},e.prototype.getBandWidth=function(){return dA(this,{min:1}).w},e.prototype.calculateCategoryInterval=function(e){return e||=bk(yk.determine),Pk(this,e)},e}();function gA(e){var t=e.getExtent();if(e.onBand){var n=(t[1]-t[0])/e.scale.count()/2;t[0]+=n,t[1]-=n}return t}function _A(e,t,n){var r=t.length;if(!e.onBand||n||!r)return!1;var i=dA(e).w;if(!i)return!1;G(t,function(e){e.coord-=i/2});var a=e.scale.getExtent(),o=t[r-1];return o.tick.offInterval&&t.pop(),t.push({coord:o.coord+i,tick:{value:a[1]+1}}),!0}var vA=function(e){U(t,e);function t(t,n,r,i,a){var o=e.call(this,t,n,r)||this;return o.index=0,o.type=i||`value`,o.position=a||`bottom`,o}return t.prototype.isHorizontal=function(){var e=this.position;return e===`top`||e===`bottom`},t.prototype.getGlobalExtent=function(e){var t=this.getExtent();return t[0]=this.toGlobalCoord(t[0]),t[1]=this.toGlobalCoord(t[1]),e&&t[0]>t[1]&&t.reverse(),t},t.prototype.pointToData=function(e,t){return this.coordToData(this.toLocalCoord(e[this.dim===`x`?0:1]),t)},t.prototype.setCategorySortInfo=function(e){if(this.type!==`category`)return!1;this.model.option.categorySortInfo=e,this.scale.setSortInfo(e)},t}(hA),yA=T_.extend({type:`triangle`,shape:{cx:0,cy:0,width:0,height:0},buildPath:function(e,t){var n=t.cx,r=t.cy,i=t.width/2,a=t.height/2;e.moveTo(n,r-a),e.lineTo(n+i,r+a),e.lineTo(n-i,r+a),e.closePath()}}),bA={line:wb,rect:z_,roundRect:z_,square:z_,circle:Jy,diamond:T_.extend({type:`diamond`,shape:{cx:0,cy:0,width:0,height:0},buildPath:function(e,t){var n=t.cx,r=t.cy,i=t.width/2,a=t.height/2;e.moveTo(n,r-a),e.lineTo(n+i,r),e.lineTo(n,r+a),e.lineTo(n-i,r),e.closePath()}}),pin:T_.extend({type:`pin`,shape:{x:0,y:0,width:0,height:0},buildPath:function(e,t){var n=t.x,r=t.y,i=t.width/5*3,a=Math.max(i,t.height),o=i/2,s=o*o/(a-o),c=r-a+o+s,l=Math.asin(s/o),u=Math.cos(l)*o,d=Math.sin(l),f=Math.cos(l),p=o*.6,m=o*.7;e.moveTo(n-u,c+s),e.arc(n,c,o,Math.PI-l,Math.PI*2+l),e.bezierCurveTo(n+u-d*p,c+s+f*p,n,r-m,n,r),e.bezierCurveTo(n,r-m,n-u+d*p,c+s+f*p,n-u,c+s),e.closePath()}}),arrow:T_.extend({type:`arrow`,shape:{x:0,y:0,width:0,height:0},buildPath:function(e,t){var n=t.height,r=t.width,i=t.x,a=t.y,o=r/3*2;e.moveTo(i,a),e.lineTo(i+o,a+n),e.lineTo(i,a+n/4*3),e.lineTo(i-o,a+n),e.lineTo(i,a),e.closePath()}}),triangle:yA},xA={line:function(e,t,n,r,i){i.x1=e,i.y1=t+r/2,i.x2=e+n,i.y2=t+r/2},rect:function(e,t,n,r,i){i.x=e,i.y=t,i.width=n,i.height=r},roundRect:function(e,t,n,r,i){i.x=e,i.y=t,i.width=n,i.height=r,i.r=Math.min(n,r)/4},square:function(e,t,n,r,i){var a=Math.min(n,r);i.x=e,i.y=t,i.width=a,i.height=a},circle:function(e,t,n,r,i){i.cx=e+n/2,i.cy=t+r/2,i.r=Math.min(n,r)/2},diamond:function(e,t,n,r,i){i.cx=e+n/2,i.cy=t+r/2,i.width=n,i.height=r},pin:function(e,t,n,r,i){i.x=e+n/2,i.y=t+r/2,i.width=n,i.height=r},arrow:function(e,t,n,r,i){i.x=e+n/2,i.y=t+r/2,i.width=n,i.height=r},triangle:function(e,t,n,r,i){i.cx=e+n/2,i.cy=t+r/2,i.width=n,i.height=r}},SA={};G(bA,function(e,t){SA[t]=new e});var CA=T_.extend({type:`symbol`,shape:{symbolType:``,x:0,y:0,width:0,height:0},calculateTextPosition:function(e,t,n){var r=Lp(e,t,n),i=this.shape;return i&&i.symbolType===`pin`&&t.position===`inside`&&(r.y=n.y+n.height*.4),r},buildPath:function(e,t,n){var r=t.symbolType;if(r!==`none`){var i=SA[r];i||=(r=`rect`,SA[r]),xA[r](t.x,t.y,t.width,t.height,i.shape),i.buildPath(e,i.shape,n)}}});function wA(e,t){if(this.type!==`image`){var n=this.style;this.__isEmptyBrush?(n.stroke=e,n.fill=t||Q.color.neutral00,n.lineWidth=2):this.shape.symbolType===`line`?n.stroke=e:n.fill=e,this.markRedraw()}}function TA(e,t,n,r,i,a,o){var s=e.indexOf(`empty`)===0;s&&(e=e.substr(5,1).toLowerCase()+e.substr(6));var c=e.indexOf(`image://`)===0?fx(e.slice(8),new fp(t,n,r,i),o?`center`:`cover`):e.indexOf(`path://`)===0?dx(e.slice(7),{},new fp(t,n,r,i),o?`center`:`cover`):new CA({shape:{symbolType:e,x:t,y:n,width:r,height:i}});return c.__isEmptyBrush=s,c.setColor=wA,a&&c.setColor(a),c}function EA(e){return J(e)||(e=[+e,+e]),[e[0]||0,e[1]||0]}function DA(e,t){if(e!=null)return J(e)||(e=[e,e]),[Cu(e[0],t[0])||0,Cu(X(e[1],e[0]),t[1])||0]}var OA=Math.PI,kA=[[1,2,1,2],[5,3,5,3],[8,3,8,3]],AA=[[0,1,0,1],[0,3,0,3],[0,3,0,3]],jA=Td(),MA=Td(),NA=function(){function e(e){this.recordMap={},this.resolveAxisNameOverlap=e}return e.prototype.ensureRecord=function(e){var t=e.axis.dim,n=e.componentIndex,r=this.recordMap,i=r[t]||(r[t]=[]);return i[n]||(i[n]={ready:{}})},e}();function PA(e,t,n,r){var i=n.axis,a=t.ensureRecord(n),o=[],s,c=ij(e.axisName)&&nk(e.nameLocation);G(r,function(e){var t=dD(e);if(t&&!t.label.ignore){o.push(t);var n=a.transGroup;c&&(n.transform?Nf(FA,n.transform):Df(FA),t.transform&&kf(FA,FA,t.transform),fp.copy(IA,t.localRect),IA.applyTransform(FA),s?s.union(IA):fp.copy(s=new fp(0,0,0,0),IA))}});var l=Math.abs(a.dirVec.x)>.1?`x`:`y`,u=a.transGroup[l];if(o.sort(function(e,t){return Math.abs(e.label[l]-u)-Math.abs(t.label[l]-u)}),c&&s){var d=i.getExtent(),f=Math.min(d[0],d[1]),p=Math.max(d[0],d[1])-f;s.union(new fp(f,0,p,1))}a.stOccupiedRect=s,a.labelInfoList=o}var FA=Ef(),IA=new fp(0,0,0,0),LA=function(e,t,n,r,i,a){if(nk(e.nameLocation)){var o=a.stOccupiedRect;o&&RA(mD({},o,a.transGroup.transform),r,i)}else zA(a.labelInfoList,a.dirVec,r,i)};function RA(e,t,n){var r=new Qf;xD(e,t,r,{direction:Math.atan2(n.y,n.x),bidirectional:!1,touchThreshold:.05})&&hD(t,r)}function zA(e,t,n,r){for(var i=Qf.dot(r,t)>=0,a=0,o=e.length;a0?`top`:`bottom`,i=`center`):Fu(r-OA)?(a=n>0?`bottom`:`top`,i=`center`):(a=`middle`,i=r>0&&r0?`right`:`left`:n>0?`left`:`right`),{rotation:r,textAlign:i,textVerticalAlign:a}},e.makeAxisEventDataBase=function(e){var t={componentType:e.mainType,componentIndex:e.componentIndex};return t[e.mainType+`Index`]=e.componentIndex,t},e.isLabelSilent=function(e){var t=e.get(`tooltip`);return e.get(`silent`)||!(e.get(`triggerEvent`)||t&&t.show)},e}(),VA=[`axisLine`,`axisTickLabelEstimate`,`axisTickLabelDetermine`,`axisName`],HA={axisLine:function(e,t,n,r,i,a,o){var s=r.get([`axisLine`,`show`]);if(s===`auto`&&(s=!0,e.raw.axisLineAutoShow!=null&&(s=!!e.raw.axisLineAutoShow)),s){var c=r.axis.getExtent(),l=a.transform,u=[c[0],0],d=[c[1],0],f=u[0]>d[0];l&&(Yf(u,u,l),Yf(d,d,l));var p=W({lineCap:`round`},r.getModel([`axisLine`,`lineStyle`]).getLineStyle()),m={strokeContainThreshold:e.raw.strokeContainThreshold||5,silent:!0,z2:1,style:p};if(r.get([`axisLine`,`breakLine`])&&sC(r.axis.scale))KD().buildAxisBreakLine(r,i,a,m);else{var h=new wb(W({shape:{x1:u[0],y1:u[1],x2:d[0],y2:d[1]}},m));gx(h.shape,h.style.lineWidth),h.anid=`line`,i.add(h)}var g=r.get([`axisLine`,`symbol`]);if(g!=null){var _=r.get([`axisLine`,`symbolSize`]);Y(g)&&(g=[g,g]),(Y(_)||Ml(_))&&(_=[_,_]);var v=DA(r.get([`axisLine`,`symbolOffset`])||0,_),y=_[0],b=_[1];G([{rotate:e.rotation+Math.PI/2,offset:v[0],r:0},{rotate:e.rotation-Math.PI/2,offset:v[1],r:Math.sqrt((u[0]-d[0])*(u[0]-d[0])+(u[1]-d[1])*(u[1]-d[1]))}],function(t,n){if(g[n]!==`none`&&g[n]!=null){var r=TA(g[n],-y/2,-b/2,y,b,p.stroke,!0),a=t.r+t.offset,o=f?d:u;r.attr({rotation:t.rotate,x:o[0]+a*Math.cos(e.rotation),y:o[1]-a*Math.sin(e.rotation),silent:!0,z2:11}),i.add(r)}})}}},axisTickLabelEstimate:function(e,t,n,r,i,a,o,s){ZA(t,i,s)&&UA(e,t,n,r,i,a,o,yk.estimate)},axisTickLabelDetermine:function(e,t,n,r,i,a,o,s){ZA(t,i,s)&&UA(e,t,n,r,i,a,o,yk.determine);var c=YA(e,i,a,r);KA(e,t.labelLayoutList,c),XA(e,i,a,r,e.tickDirection)},axisName:function(e,t,n,r,i,a,o,s){var c=n.ensureRecord(r);t.nameEl&&=(i.remove(t.nameEl),c.nameLayout=c.nameLocation=null);var l=e.axisName;if(ij(l)){var u=e.nameLocation,d=e.nameDirection,f=r.getModel(`nameTextStyle`),p=r.get(`nameGap`)||0,m=r.axis.getExtent(),h=r.axis.inverse?-1:1,g=new Qf(0,0),_=new Qf(0,0);u===`start`?(g.x=m[0]-h*p,_.x=-h):u===`end`?(g.x=m[1]+h*p,_.x=h):(g.x=(m[0]+m[1])/2,g.y=e.labelOffset+d*p,_.y=d);var v=Ef();_.transform(jf(v,v,e.rotation));var y=r.get(`nameRotate`);y!=null&&(y=y*OA/180);var b,x;nk(u)?b=BA.innerTextLayout(e.rotation,y??e.rotation,d):(b=WA(e.rotation,u,y||0,m),x=e.raw.axisNameAvailableWidth,x!=null&&(x=Math.abs(x/Math.sin(b.rotation)),!isFinite(x)&&(x=null)));var S=f.getFont(),C=r.get(`nameTruncate`,!0)||{},w=C.ellipsis,T=Bl(e.raw.nameTruncateMaxWidth,C.maxWidth,x),E=s.nameMarginLevel||0,D=new W_({x:g.x,y:g.y,rotation:b.rotation,silent:BA.isLabelSilent(r),style:nS(f,{text:l,font:S,overflow:`truncate`,width:T,ellipsis:w,fill:f.getTextColor()||r.get([`axisLine`,`lineStyle`,`color`]),align:f.get(`align`)||b.textAlign,verticalAlign:f.get(`verticalAlign`)||b.textVerticalAlign}),z2:1});if(Ix({el:D,componentModel:r,itemName:l}),D.__fullText=l,D.anid=`name`,r.get(`triggerEvent`)){var O=BA.makeAxisEventDataBase(r);O.targetType=`axisName`,O.name=l,iv(D).eventData=O}a.add(D),D.updateTransform(),t.nameEl=D;var k=c.nameLayout=dD({label:D,priority:D.z2,defaultAttr:{ignore:D.ignore},marginDefault:nk(u)?kA[E]:AA[E]});if(c.nameLocation=u,i.add(D),D.decomposeTransform(),e.shouldNameMoveOverlap&&k){var A=n.ensureRecord(r);n.resolveAxisNameOverlap(e,n,r,k,_,A)}}}};function UA(e,t,n,r,i,a,o,s){$A(t)||QA(e,t,i,s,r,o);var c=t.labelLayoutList;tj(e,r,c,a),oj(r,e.rotation,c);var l=e.optionHideOverlap;GA(r,c,l),l&&bD(Tl(c,function(e){return e&&!e.label.ignore})),PA(e,n,r,c)}function WA(e,t,n,r){var i=Pu(n-e),a,o,s=r[0]>r[1],c=t===`start`&&!s||t!==`start`&&s;return Fu(i-OA/2)?(o=c?`bottom`:`top`,a=`center`):Fu(i-OA*1.5)?(o=c?`top`:`bottom`,a=`center`):(o=`middle`,a=iOA/2?c?`left`:`right`:c?`right`:`left`),{rotation:i,textAlign:a,textVerticalAlign:o}}function GA(e,t,n){var r=e.axis,i=e.get([`axisLabel`,`customValues`]);if(ek(r))return;function a(e,a,o){var s=dD(t[a]),c=dD(t[o]),l=r.scale;if(s&&c){if(e==null){if(!n&&i)return;var u=jA(s.label).labelInfo.tick;if($D(l)&&u.notNice||tO(l)&&u.offInterval){qA(s.label);return}}if(e===!1||s.suggestIgnore){qA(s.label);return}if(c.suggestIgnore){qA(c.label);return}var d=.1;if(!n){var f=[0,0,0,0];s=gD({marginForce:f},s),c=gD({marginForce:f},c)}xD(s,c,null,{touchThreshold:d})&&qA(e?c.label:s.label)}}var o=e.get([`axisLabel`,`showMinLabel`]),s=e.get([`axisLabel`,`showMaxLabel`]),c=t.length;a(o,0,1),a(s,c-1,c-2)}function KA(e,t,n){e.showMinorTicks||G(t,function(e){if(e&&e.label.ignore)for(var t=0;t0&&u[1]>0&&!d[0]&&(u[0]=0),u[0]<0&&u[1]<0&&!d[1]&&(u[1]=0));var y=!1;u[0]>u[1]&&(u.reverse(),y=!0);var b=_j(e,t.get(`startValue`,!0)),x=b!=null;!qu(b)&&r&&(b=e.getDefaultStartValue?e.getDefaultStartValue():0),qu(b)&&(x||!_||v)&&(bu[1]&&!d[1]&&(u[1]=b,d[1]=!0)),gj(this._i={scale:e,dataMM:l,noZoomEffMM:u,zoomMM:[],fixMM:d,zoomFixMM:[!1,!1],startValue:b,isBlank:g,incl0:v,tggAxInv:y,ctnShp:i},u)}return e.prototype.makeNoZoom=function(){return this._i.noZoomEffMM.slice()},e.prototype.makeFinal=function(){var e=this._i,t=e.zoomMM,n=e.noZoomEffMM,r=e.zoomFixMM,i=e.fixMM,a={fixMM:i,zoomFixMM:r,isBlank:e.isBlank,incl0:e.incl0,tggAxInv:e.tggAxInv,ctnShp:e.ctnShp,effMM:n.slice()},o=a.effMM;return t[0]!=null&&(o[0]=t[0],i[0]=r[0]=!0),t[1]!=null&&(o[1]=t[1],i[1]=r[1]=!0),gj(e,o),a},e.prototype.makeRenderInfo=function(){return{startValue:this._i.startValue}},e.prototype.setZoomMM=function(e,t){this._i.zoomMM[e]=t},e}();function gj(e,t){var n=e.scale,r=e.dataMM;n.sanitize&&(t[0]=n.sanitize(t[0],r),t[1]=n.sanitize(t[1],r),Gd(t))}function _j(e,t){return t==null?null:zl(t)?NaN:e.parse(t)}function vj(e,t){var n;if(tO(e))n=[0,0];else{var r=t.get(`boundaryGap`);typeof r==`boolean`&&(r=null),n=J(r)?r:[r,r]}return[yj(n[0]),yj(n[1])]}function yj(e){return Ip(typeof e==`boolean`?0:e,1)||0}function bj(e){var t=pj(e.scale);return t.extent||=Ld(),t}function xj(e,t){bj(e).dimIdxInCoord=t.get(e.dim)}function Sj(e,t){var n=e.scale,r=e.model,i=e.dim;n.rawExtentInfo||Cj(n,e,i,r,t)}function Cj(e,t,n,r,i){var a=bj(t),o=a.extent,s=!1;Qk(t,function(r){if(r.boxCoordinateSystem){var i=iw(r).coord,c=a.dimIdxInCoord;if(c>=0&&J(i)){var l=i[c];l!=null&&!J(l)&&Rd(o,e.parse(l))}}else if(r.coordinateSystem){var u=r.getData();if(u){var d=e.getFilter?e.getFilter():null;G(tk(u,n),function(e){Vd(o,u.getApproximateExtent(e,d))})}r.__requireStartValue&&r.__requireStartValue(t)&&(s=!0)}});var c=kj(e,t,r);Tj(e,new hj(e,r,o,s,c),i),a.extent=null}function wj(e,t){var n=e.scale;Tj(n,new hj(n,e.model,t,!1,!1),mj)}function Tj(e,t,n){e.rawExtentInfo=t,t.from=n}function Ej(e,t){Dj.set(e,t)}var Dj=$l();function Oj(e,t,n,r,i){e.rawExtentInfo||wj({scale:e,model:t},i||Ld());var a=e.rawExtentInfo.makeFinal(),o=a.effMM;return e.setExtent(o[0],o[1]),e.setBlank(a.isBlank),r&&a.tggAxInv&&n&&!n.get(`legacyMinMaxDontInverseAxis`)&&(r.inverse=!r.inverse),a}function kj(e,t,n){var r=ck(e,n),i=n.get(`containShape`,!0);if(i==null&&!r&&(i=!0),!i)return!1;var a=!1;return nA(t,function(e){a=!!Dj.get(e)||a}),a}function Aj(e,t,n,r){if(n.ctnShp){var i;if(nA(e,function(t){var n=Dj.get(t);if(n){var a=n(e,r);a&&(i||=[0,0],zd(i,a[0]),Bd(i,a[1]),YO(e))}}),i){var a=t.getExtent();if(tO(t))e.onBand||t.setExtent2(1,du(a[0],a[0]+i[0]),fu(a[1],a[1]+i[1]));else{var o=a.slice();n.zoomFixMM[0]||(o[0]=du(o[0],t.transformOut(t.transformIn(o[0],null)+i[0],null))),n.zoomFixMM[1]||(o[1]=fu(o[1],t.transformOut(t.transformIn(o[1],null)+i[1],null))),(o[0]a[1])&&t.setExtent2(1,o[0],o[1])}}}}function jj(e,t){var n=e.scale,r=e.model,i=Oj(n,r,r.ecModel,e,null),a=eO(n),o=eO(t)?t.intervalStub:t,s=a?n.intervalStub:n,c=n.base,l=o.getTicks(),u=o.getTicks({expandToNicedExtent:!0}),d=l.length-1,f,p,m;if(d===1)f=p=0,m=1;else if(d===2){var h=pu(l[0].value-l[1].value),g=pu(l[1].value-l[2].value);f=p=0,h===g?m=2:(m=1,h=C[1])return!0})):b[1]?(T=C[1],A(function(){if(P(),k=Du(O-E*m,D),j(),w<=C[0])return!0})):A(function(){k=Du(gu(C[0]/E)*E,D),O=Du(hu(C[1]/E)*E,D);var e=mu((O-k)/E);if(e<=m){var t=m-e,n=void 0,r=i.incl0||a;if(r&&C[0]===0)n=[0,t];else if(r&&C[1]===0)n=[t,0];else{var o=hu(t/2);n=t%2==0?[o,o]:w+T=C[1])return!0}})}ok(n,b,S,[w,T],x,{interval:E,intervalCount:m,intervalPrecision:D,niceExtent:[k,O]})}function Mj(e,t){var n=eO(e),r=n?e.intervalStub:e,i=t.fixMinMax||[],a=n?e.getExtent():null,o=r.getExtent(),s=oO(o,i,t.rawExtentResult);r.setExtent(s[0],s[1]),s=r.getExtent();var c=n?Pj(r,t):Nj(r,t),l=c.intervalPrecision,u=c.interval,d=t.userInterval;d!=null&&(c.interval=d,c.intervalPrecision=rO(d)),i[0]||(s[0]=Du(hu(s[0]/u)*u,l)),i[1]||(s[1]=Du(gu(s[1]/u)*u,l)),d!=null&&(c.niceExtent=s.slice()),ok(e,i,o,s,a,c)}function Nj(e,t){var n=cO(t.splitNumber,5),r=BD(e),i=t.minInterval,a=t.maxInterval,o=Bu(r/n,!0);i!=null&&oa&&(o=a);var s=rO(o),c=e.getExtent(),l=[Du(gu(c[0]/o)*o,s),Du(hu(c[1]/o)*o,s)];return{interval:o,intervalPrecision:s,niceExtent:l}}function Pj(e,t){var n=cO(t.splitNumber,10),r=e.getExtent(),i=BD(e),a=fu(Ru(i),1);n/i*a<=.5&&(a*=10);var o=rO(a),s=[Du(gu(r[0]/a)*a,o),Du(hu(r[1]/a)*a,o)];return{intervalPrecision:o,interval:a,niceExtent:s}}function Fj(e){var t=e.scale,n=e.model,r=n.axis,i=n.ecModel;Ij(t,n,r,i,null)}function Ij(e,t,n,r,i){var a=Oj(e,t,r,n,i),o=QD(e)||$D(e);Lj(e,{splitNumber:t.get(`splitNumber`),fixMinMax:a.fixMM,userInterval:t.get(`interval`),minInterval:o?t.get(`minInterval`):null,maxInterval:o?t.get(`maxInterval`):null,rawExtentResult:a}),n&&r&&Aj(n,e,a,r)}function Lj(e,t){Rj[e.type](e,t)}var Rj={interval:Mj,log:Mj,time:TO,ordinal:ru},zj=[[3,1],[0,2]],Bj=function(){function e(e,t,n){this.type=`grid`,this._coordsMap={},this._coordsList=[],this._axesMap={},this._axesList=[],this.axisPointerEnabled=!0,this.dimensions=mk,this._initCartesian(e,t,n),this.model=e}return e.prototype.getRect=function(){return this._rect},e.prototype.update=function(e,t){var n=this._axesMap;G(this._axesList,function(e){Sj(e,1);var t=e.scale;tO(t)&&t.setSortInfo(e.model.get(`categorySortInfo`))});function r(e){for(var t=Dl(e),n=[],r=t.length-1;r>=0;r--){var i=e[+t[r]];i.__alignTo?n.push(i):Fj(i)}G(n,function(e){Gj(e,e.__alignTo)?Fj(e):jj(e,e.__alignTo.scale)})}r(n.x),r(n.y);var i={};G(n.x,function(e){Hj(n,`y`,e,i)}),G(n.y,function(e){Hj(n,`x`,e,i)}),this.resize(this.model,t)},e.prototype.resize=function(e,t,n){var r=hw(e,t),i=this._rect=pw(e.getBoxLayoutParams(),r.refContainer),a=this._axesMap,o=this._coordsList,s=e.get(`containLabel`);if(qj(a,i),!n){var c=Zj(i,o,a,s,t),l=void 0;if(s)Yj?(Yj(this._axesList,i),qj(a,i)):l=Xj(i.clone(),`axisLabel`,null,i,a,c,r);else{var u=$j(e,i,r),d=u.outerBoundsRect,f=u.parsedOuterBoundsContain,p=u.outerBoundsClamp;d&&(l=Xj(d,f,p,i,a,c,r))}Qj(i,a,yk.determine,null,l,r),G(this._coordsList,function(e){e.calcAffineTransform()})}},e.prototype.getAxis=function(e,t){var n=this._axesMap[e];if(n!=null)return n[t||0]},e.prototype.getAxes=function(){return this._axesList.slice()},e.prototype.getCartesian=function(e,t){if(e!=null&&t!=null){var n=`x`+e+`y`+t;return this._coordsMap[n]}Nl(e)&&(t=e.yAxisIndex,e=e.xAxisIndex);for(var r=0,i=this._coordsList;r=0;i--){var a=e[+t[i]];ZD(a.scale)&&ik(a.model,a.type,!0)==null&&(a.model.get(`alignTicks`)&&a.model.get(`interval`)==null?r.push(a):n=a)}n||=r.pop(),n&&G(r,function(e){e.__alignTo=n})}function Gj(e,t){return sC(e.scale)||sC(t.scale)||t.scale.getTicks().length<2}function Kj(e,t){var n=e.getExtent(),r=n[0]+n[1];e.toGlobalCoord=e.dim===`x`?function(e){return e+t}:function(e){return r-e+t},e.toLocalCoord=e.dim===`x`?function(e){return e-t}:function(e){return r-e+t}}function qj(e,t){G(e.x,function(e){return Jj(e,t.x,t.width)}),G(e.y,function(e){return Jj(e,t.y,t.height)})}function Jj(e,t,n){var r=[0,n],i=+!!e.inverse;e.setExtent(r[i],r[1-i]),Kj(e,t)}var Yj;function Xj(e,t,n,r,i,a,o){Qj(r,i,yk.estimate,t,!1,o);var s=[0,0,0,0];l(0),l(1),u(r,0,NaN),u(r,1,NaN);var c=El(s,function(e){return e>0})==null;return Nx(r,s,!0,!0,n),qj(i,r),c;function l(e){G(i[ix[e]],function(t){if(rk(t.model)){var n=a.ensureRecord(t.model),r=n.labelInfoList;if(r)for(var i=0;i0&&!zl(t)&&t>1e-4&&(e/=t),e}}function Zj(e,t,n,r,i){var a=new NA(eM);return G(n,function(n){return G(n,function(n){if(rk(n.model)){var o=!r;n.axisBuilder=uj(e,t,n.model,i,a,o)}})}),a}function Qj(e,t,n,r,i,a){var o=n===yk.determine;G(t,function(t){return G(t,function(t){rk(t.model)&&(dj(t.axisBuilder,e,t.model),t.axisBuilder.build(o?{axisTickLabelDetermine:!0}:{axisTickLabelEstimate:!0},{noPxChange:i}))})});var s={x:0,y:0};c(0),c(1);function c(t){s[ix[1-t]]=e[ax[t]]<=a.refContainer[ax[t]]*.5?0:1-t==1?2:1}G(t,function(e,t){return G(e,function(e){rk(e.model)&&((r===`all`||o)&&e.axisBuilder.build({axisName:!0},{nameMarginLevel:s[t]}),o&&e.axisBuilder.build({axisLine:!0}))})})}function $j(e,t,n){var r,i=e.get(`outerBoundsMode`,!0);i===`same`?r=t.clone():(i==null||i===`auto`)&&(r=pw(e.get(`outerBounds`,!0)||uk,n.refContainer));var a=e.get(`outerBoundsContain`,!0),o=a==null||a===`auto`||bl([`all`,`axisLabel`],a)<0?`all`:a,s=[Tu(X(e.get(`outerBoundsClampWidth`,!0),dk[0]),t.width),Tu(X(e.get(`outerBoundsClampHeight`,!0),dk[1]),t.height)];return{outerBoundsRect:r,parsedOuterBoundsContain:o,outerBoundsClamp:s}}var eM=function(e,t,n,r,i,a){var o=n.axis.dim===`x`?`y`:`x`;LA(e,t,n,r,i,a),nk(e.nameLocation)||G(t.recordMap[o],function(e){e&&e.labelInfoList&&e.dirVec&&zA(e.labelInfoList,e.dirVec,r,i)})},tM=function(){function e(e,t){this.target=e,this.topTarget=t&&t.topTarget}return e}(),nM=function(){function e(e){this.handler=e,e.on(`mousedown`,this._dragStart,this),e.on(`mousemove`,this._drag,this),e.on(`mouseup`,this._dragEnd,this)}return e.prototype._dragStart=function(e){for(var t=e.target;t&&!t.draggable;)t=t.parent||t.__hostTarget;t&&(this._draggingTarget=t,t.dragging=!0,this._x=e.offsetX,this._y=e.offsetY,this.handler.dispatchToElement(new tM(t,e),`dragstart`,e.event))},e.prototype._drag=function(e){var t=this._draggingTarget;if(t){var n=e.offsetX,r=e.offsetY,i=n-this._x,a=r-this._y;this._x=n,this._y=r,t.drift(i,a,e),this.handler.dispatchToElement(new tM(t,e),`drag`,e.event);var o=this.handler.findHover(n,r,t).target,s=this._dropTarget;this._dropTarget=o,t!==o&&(s&&o!==s&&this.handler.dispatchToElement(new tM(s,e),`dragleave`,e.event),o&&o!==s&&this.handler.dispatchToElement(new tM(o,e),`dragenter`,e.event))}},e.prototype._dragEnd=function(e){var t=this._draggingTarget;t&&(t.dragging=!1),this.handler.dispatchToElement(new tM(t,e),`dragend`,e.event),this._dropTarget&&this.handler.dispatchToElement(new tM(this._dropTarget,e),`drop`,e.event),this._draggingTarget=null,this._dropTarget=null},e}(),rM=/^(?:mouse|pointer|contextmenu|drag|drop)|click/,iM=[],aM=ou.browser.firefox&&+ou.browser.version.split(`.`)[0]<39;function oM(e,t,n,r){return n||={},r?sM(e,t,n):aM&&t.layerX!=null&&t.layerX!==t.offsetX?(n.zrX=t.layerX,n.zrY=t.layerY):t.offsetX==null?sM(e,t,n):(n.zrX=t.offsetX,n.zrY=t.offsetY),n}function sM(e,t,n){if(ou.domSupported&&e.getBoundingClientRect){var r=t.clientX,i=t.clientY;if(VS(e)){var a=e.getBoundingClientRect();n.zrX=r-a.left,n.zrY=i-a.top;return}if(RS(iM,e,r,i)){n.zrX=iM[0],n.zrY=iM[1];return}}n.zrX=n.zrY=0}function cM(e){return e||window.event}function lM(e,t,n){if(t=cM(t),t.zrX!=null)return t;var r=t.type;if(r&&r.indexOf(`touch`)>=0){var i=r===`touchend`?t.changedTouches[0]:t.targetTouches[0];i&&oM(e,i,t,n)}else{oM(e,t,t,n);var a=uM(t);t.zrDelta=a?a/120:-(t.detail||0)/3}var o=t.button;return t.which==null&&o!==void 0&&rM.test(t.type)&&(t.which=o&1?1:o&2?3:o&4?2:0),t}function uM(e){var t=e.wheelDelta;if(t)return t;var n=e.deltaX,r=e.deltaY;if(n==null||r==null)return t;var i=Math.abs(r===0?n:r),a=r>0?-1:r<0?1:n>0?-1:1;return 3*i*a}function dM(e,t,n,r){e.addEventListener(t,n,r)}function fM(e,t,n,r){e.removeEventListener(t,n,r)}var pM=function(e){e.preventDefault(),e.stopPropagation(),e.cancelBubble=!0};function mM(e){return e.which===2||e.which===3}var hM=function(){function e(){this._track=[]}return e.prototype.recognize=function(e,t,n){return this._doTrack(e,t,n),this._recognize(e)},e.prototype.clear=function(){return this._track.length=0,this},e.prototype._doTrack=function(e,t,n){var r=e.touches;if(r){for(var i={points:[],touches:[],target:t,event:e},a=0,o=r.length;a1&&r&&r.length>1){var a=gM(r)/gM(i);!isFinite(a)&&(a=1),t.pinchScale=a;var o=_M(r);return t.pinchX=o[0],t.pinchY=o[1],{type:`pinch`,target:e[0].target,event:t}}}}},yM=`silent`;function bM(e,t,n){return{type:e,event:n,target:t.target,topTarget:t.topTarget,cancelBubble:!1,offsetX:n.zrX,offsetY:n.zrY,gestureEvent:n.gestureEvent,pinchX:n.pinchX,pinchY:n.pinchY,pinchScale:n.pinchScale,wheelDelta:n.zrDelta,zrByTouch:n.zrByTouch,which:n.which,stop:xM}}function xM(){pM(this.event)}var SM=function(e){U(t,e);function t(){var t=e!==null&&e.apply(this,arguments)||this;return t.handler=null,t}return t.prototype.dispose=function(){},t.prototype.setCursor=function(){},t}(Uh),CM=function(){function e(e,t){this.x=e,this.y=t}return e}(),wM=[`click`,`dblclick`,`mousewheel`,`mouseout`,`mouseup`,`mousedown`,`mousemove`,`contextmenu`],TM=new fp(0,0,0,0),EM=function(e){U(t,e);function t(t,n,r,i,a){var o=e.call(this)||this;return o._hovered=new CM(0,0),o.storage=t,o.painter=n,o.painterRoot=i,o._pointerSize=a,r||=new SM,o.proxy=null,o.setHandlerProxy(r),o._draggingMgr=new nM(o),o}return t.prototype.setHandlerProxy=function(e){this.proxy&&this.proxy.dispose(),e&&(G(wM,function(t){e.on&&e.on(t,this[t],this)},this),e.handler=this),this.proxy=e},t.prototype.mousemove=function(e){var t=e.zrX,n=e.zrY,r=kM(this,t,n),i=this._hovered,a=i.target;a&&!a.__zr&&(i=this.findHover(i.x,i.y),a=i.target);var o=this._hovered=r?new CM(t,n):this.findHover(t,n),s=o.target,c=this.proxy;c.setCursor&&c.setCursor(s?s.cursor:`default`),a&&s!==a&&this.dispatchToElement(i,`mouseout`,e),this.dispatchToElement(o,`mousemove`,e),s&&s!==a&&this.dispatchToElement(o,`mouseover`,e)},t.prototype.mouseout=function(e){var t=e.zrEventControl;t!==`only_globalout`&&this.dispatchToElement(this._hovered,`mouseout`,e),t!==`no_globalout`&&this.trigger(`globalout`,{type:`globalout`,event:e})},t.prototype.resize=function(){this._hovered=new CM(0,0)},t.prototype.dispatch=function(e,t){var n=this[e];n&&n.call(this,t)},t.prototype.dispose=function(){this.proxy.dispose(),this.storage=null,this.proxy=null,this.painter=null},t.prototype.setCursorStyle=function(e){var t=this.proxy;t.setCursor&&t.setCursor(e)},t.prototype.dispatchToElement=function(e,t,n){e||={};var r=e.target;if(!(r&&r.silent)){for(var i=`on`+t,a=bM(t,e,n);r&&(r[i]&&(a.cancelBubble=!!r[i].call(r,a)),r.trigger(t,a),r=r.__hostTarget?r.__hostTarget:r.parent,!a.cancelBubble););a.cancelBubble||(this.trigger(t,a),this.painter&&this.painter.eachOtherLayer&&this.painter.eachOtherLayer(function(e){typeof e[i]==`function`&&e[i].call(e,a),e.trigger&&e.trigger(t,a)}))}},t.prototype.findHover=function(e,t,n){var r=this.storage.getDisplayList(),i=new CM(e,t);if(OM(r,i,e,t,n),this._pointerSize&&!i.target){for(var a=[],o=this._pointerSize,s=o/2,c=new fp(e-s,t-s,o,o),l=r.length-1;l>=0;l--){var u=r[l];u!==n&&!u.ignore&&!u.ignoreCoarsePointer&&(!u.parent||!u.parent.ignoreCoarsePointer)&&(TM.copy(u.getBoundingRect()),u.transform&&TM.applyTransform(u.transform),TM.intersect(c)&&a.push(u))}if(a.length){for(var d=4,f=Math.PI/12,p=Math.PI*2,m=0;m4)return;this._downPoint=null}this.dispatchToElement(a,e,t)}});function DM(e,t,n){if(e[e.rectHover?`rectContain`:`contain`](t,n)){for(var r=e,i=void 0,a=!1;r;){if(r.ignoreClip&&(a=!0),!a){var o=r.getClipPath();if(o&&!o.contain(t,n))return!1}r.silent&&(i=!0);var s=r.__hostTarget;r=s?r.ignoreHostSilent?null:s:r.parent}return!i||yM}return!1}function OM(e,t,n,r,i){for(var a=e.length-1;a>=0;a--){var o=e[a],s=void 0;if(o!==i&&!o.ignore&&(s=DM(o,n,r))&&(!t.topTarget&&(t.topTarget=o),s!==yM)){t.target=o;break}}}function kM(e,t,n){var r=e.painter;return t<0||t>r.getWidth()||n<0||n>r.getHeight()}var AM=32,jM=7;function MM(e){for(var t=0;e>=AM;)t|=e&1,e>>=1;return e+t}function NM(e,t,n,r){var i=t+1;if(i===n)return 1;if(r(e[i++],e[t])<0){for(;i=0;)i++;return i-t}function PM(e,t,n){for(n--;t>>1,i(a,e[c])<0?s=c:o=c+1;var l=r-o;switch(l){case 3:e[o+3]=e[o+2];case 2:e[o+2]=e[o+1];case 1:e[o+1]=e[o];break;default:for(;l>0;)e[o+l]=e[o+l-1],l--}e[o]=a}}function IM(e,t,n,r,i,a){var o=0,s=0,c=1;if(a(e,t[n+i])>0){for(s=r-i;c0;)o=c,c=(c<<1)+1,c<=0&&(c=s);c>s&&(c=s),o+=i,c+=i}else{for(s=i+1;cs&&(c=s);var l=o;o=i-c,c=i-l}for(o++;o>>1);a(e,t[n+u])>0?o=u+1:c=u}return c}function LM(e,t,n,r,i,a){var o=0,s=0,c=1;if(a(e,t[n+i])<0){for(s=i+1;cs&&(c=s);var l=o;o=i-c,c=i-l}else{for(s=r-i;c=0;)o=c,c=(c<<1)+1,c<=0&&(c=s);c>s&&(c=s),o+=i,c+=i}for(o++;o>>1);a(e,t[n+u])<0?c=u:o=u+1}return c}function RM(e,t){var n=jM,r,i,a=0,o=[];r=[],i=[];function s(e,t){r[a]=e,i[a]=t,a+=1}function c(){for(;a>1;){var e=a-2;if(e>=1&&i[e-1]<=i[e]+i[e+1]||e>=2&&i[e-2]<=i[e]+i[e-1])i[e-1]i[e+1])break;u(e)}}function l(){for(;a>1;){var e=a-2;e>0&&i[e-1]=jM||m>=jM);if(h)break;f<0&&(f=0),f+=2}if(n=f,n<1&&(n=1),i===1){for(c=0;c=0;c--)e[p+c]=e[f+c];e[d]=o[u];return}for(var m=n;;){var h=0,g=0,_=!1;do if(t(o[u],e[l])<0){if(e[d--]=e[l--],h++,g=0,--i===0){_=!0;break}}else if(e[d--]=o[u--],g++,h=0,--s===1){_=!0;break}while((h|g)=0;c--)e[p+c]=e[f+c];if(i===0){_=!0;break}}if(e[d--]=o[u--],--s===1){_=!0;break}if(g=s-IM(e[l],o,0,s,s-1,t),g!==0){for(d-=g,u-=g,s-=g,p=d+1,f=u+1,c=0;c=jM||g>=jM);if(_)break;m<0&&(m=0),m+=2}if(n=m,n<1&&(n=1),s===1){for(d-=i,l-=i,p=d+1,f=l+1,c=i-1;c>=0;c--)e[p+c]=e[f+c];e[d]=o[u]}else if(s===0)throw Error();else for(f=d-(s-1),c=0;cs&&(c=s),FM(e,n,n+c,n+a,t),a=c}o.pushRun(n,a),o.mergeRuns(),i-=a,n+=a}while(i!==0);o.forceMergeRuns()}}var BM=!1;function VM(){BM||(BM=!0,console.warn(`z / z2 / zlevel of displayable is invalid, which may cause unexpected errors`))}function HM(e,t){return e.zlevel===t.zlevel?e.z===t.z?e.z2-t.z2:e.z-t.z:e.zlevel-t.zlevel}var UM=function(){function e(){this._roots=[],this._displayList=[],this._displayListLen=0,this.displayableSortFunc=HM}return e.prototype.traverse=function(e,t){for(var n=0;n=0&&this._roots.splice(r,1)},e.prototype.delAllRoots=function(){this._roots=[],this._displayList=[],this._displayListLen=0},e.prototype.getRoots=function(){return this._roots},e.prototype.dispose=function(){this._displayList=null,this._roots=null},e}(),WM=ou.hasGlobalWindow&&(window.requestAnimationFrame&&window.requestAnimationFrame.bind(window)||window.msRequestAnimationFrame&&window.msRequestAnimationFrame.bind(window)||window.mozRequestAnimationFrame||window.webkitRequestAnimationFrame)||function(e){return setTimeout(e,16)};function GM(){return new Date().getTime()}var KM=function(e){U(t,e);function t(t){var n=e.call(this)||this;return n._running=!1,n._time=0,n._pausedTime=0,n._pauseStart=0,n._paused=!1,t||={},n.stage=t.stage||{},n}return t.prototype.addClip=function(e){e.animation&&this.removeClip(e),this._head?(this._tail.next=e,e.prev=this._tail,e.next=null,this._tail=e):this._head=this._tail=e,e.animation=this},t.prototype.addAnimator=function(e){e.animation=this;var t=e.getClip();t&&this.addClip(t)},t.prototype.removeClip=function(e){if(e.animation){var t=e.prev,n=e.next;t?t.next=n:this._head=n,n?n.prev=t:this._tail=t,e.next=e.prev=e.animation=null}},t.prototype.removeAnimator=function(e){var t=e.getClip();t&&this.removeClip(t),e.animation=null},t.prototype.update=function(e){for(var t=GM()-this._pausedTime,n=t-this._time,r=this._head;r;){var i=r.next;r.step(t,n)?(r.ondestroy(),this.removeClip(r),r=i):r=i}this._time=t,e||(this.trigger(`frame`,n),this.stage.update&&this.stage.update())},t.prototype._startLoop=function(){var e=this;this._running=!0;function t(){e._running&&(WM(t),!e._paused&&e.update())}WM(t)},t.prototype.start=function(){this._running||(this._time=GM(),this._pausedTime=0,this._startLoop())},t.prototype.stop=function(){this._running=!1},t.prototype.pause=function(){this._paused||=(this._pauseStart=GM(),!0)},t.prototype.resume=function(){this._paused&&=(this._pausedTime+=GM()-this._pauseStart,!1)},t.prototype.clear=function(){for(var e=this._head;e;){var t=e.next;e.prev=e.next=e.animation=null,e=t}this._head=this._tail=null},t.prototype.isFinished=function(){return this._head==null},t.prototype.animate=function(e,t){t||={},this.start();var n=new Hh(e,t.loop);return this.addAnimator(n),n},t}(Uh),qM=300,JM=ou.domSupported,YM=(function(){var e=[`click`,`dblclick`,`mousewheel`,`wheel`,`mouseout`,`mouseup`,`mousedown`,`mousemove`,`contextmenu`],t=[`touchstart`,`touchend`,`touchmove`],n={pointerdown:1,pointerup:1,pointermove:1,pointerout:1};return{mouse:e,touch:t,pointer:K(e,function(e){var t=e.replace(`mouse`,`pointer`);return n.hasOwnProperty(t)?t:e})}})(),XM={mouse:[`mousemove`,`mouseup`],pointer:[`pointermove`,`pointerup`]},ZM=!1;function QM(e){var t=e.pointerType;return t===`pen`||t===`touch`}function $M(e){e.touching=!0,e.touchTimer!=null&&(clearTimeout(e.touchTimer),e.touchTimer=null),e.touchTimer=setTimeout(function(){e.touching=!1,e.touchTimer=null},700)}function eN(e){e&&(e.zrByTouch=!0)}function tN(e,t){return lM(e.dom,new rN(e,t),!0)}function nN(e,t){for(var n=t,r=!1;n&&n.nodeType!==9&&!(r=n.domBelongToZr||n!==t&&n===e.painterRoot);)n=n.parentNode;return r}var rN=function(){function e(e,t){this.stopPropagation=ru,this.stopImmediatePropagation=ru,this.preventDefault=ru,this.type=t.type,this.target=this.currentTarget=e.dom,this.pointerType=t.pointerType,this.clientX=t.clientX,this.clientY=t.clientY}return e}(),iN={mousedown:function(e){e=lM(this.dom,e),this.__mayPointerCapture=[e.zrX,e.zrY],this.trigger(`mousedown`,e)},mousemove:function(e){e=lM(this.dom,e);var t=this.__mayPointerCapture;t&&(e.zrX!==t[0]||e.zrY!==t[1])&&this.__togglePointerCapture(!0),this.trigger(`mousemove`,e)},mouseup:function(e){e=lM(this.dom,e),this.__togglePointerCapture(!1),this.trigger(`mouseup`,e)},mouseout:function(e){e=lM(this.dom,e);var t=e.toElement||e.relatedTarget;nN(this,t)||(this.__pointerCapturing&&(e.zrEventControl=`no_globalout`),this.trigger(`mouseout`,e))},wheel:function(e){ZM=!0,e=lM(this.dom,e),this.trigger(`mousewheel`,e)},mousewheel:function(e){ZM||(e=lM(this.dom,e),this.trigger(`mousewheel`,e))},touchstart:function(e){e=lM(this.dom,e),eN(e),this.__lastTouchMoment=new Date,this.handler.processGesture(e,`start`),iN.mousemove.call(this,e),iN.mousedown.call(this,e)},touchmove:function(e){e=lM(this.dom,e),eN(e),this.handler.processGesture(e,`change`),iN.mousemove.call(this,e)},touchend:function(e){e=lM(this.dom,e),eN(e),this.handler.processGesture(e,`end`),iN.mouseup.call(this,e),+new Date-this.__lastTouchMoment0&&(this._stillFrameAccum++,this._stillFrameAccum>this._sleepAfterStill&&this.animation.stop())},e.prototype.setSleepAfterStill=function(e){this._sleepAfterStill=e},e.prototype.wakeUp=function(){this._disposed||(this.animation.start(),this._stillFrameAccum=0)},e.prototype.refreshHover=function(){this._needsRefreshHover=!0},e.prototype.refreshHoverImmediately=function(){this._disposed||this._refresh({animUpdate:!1,refresh:!1,refreshHover:!0})},e.prototype.resize=function(e){this._disposed||(e||={},this.painter.resize(e.width,e.height),this.handler.resize())},e.prototype.clearAnimation=function(){this._disposed||this.animation.clear()},e.prototype.getWidth=function(){if(!this._disposed)return this.painter.getWidth()},e.prototype.getHeight=function(){if(!this._disposed)return this.painter.getHeight()},e.prototype.setCursorStyle=function(e){this._disposed||this.handler.setCursorStyle(e)},e.prototype.findHover=function(e,t){if(!this._disposed)return this.handler.findHover(e,t)},e.prototype.on=function(e,t,n){return this._disposed||this.handler.on(e,t,n),this},e.prototype.off=function(e,t){this._disposed||this.handler.off(e,t)},e.prototype.trigger=function(e,t){this._disposed||this.handler.trigger(e,t)},e.prototype.clear=function(){if(!this._disposed){for(var e=this.storage.getRoots(),t=0;t=0;o--)r[o]&&!yd(r[o])?a=!0:(r[o]=null,!a&&i--);r.length=i,e[n]=r}}),delete e[AN],e},t.prototype.setTheme=function(e){this._theme=new TS(e),this._resetOption(`recreate`,null)},t.prototype.getTheme=function(){return this._theme},t.prototype.getLocaleModel=function(){return this._locale},t.prototype.setUpdatePayload=function(e){this._payload=e},t.prototype.getUpdatePayload=function(){return this._payload},t.prototype.getComponent=function(e,t){var n=this._componentsMap.get(e);if(n){var r=n[t||0];if(r)return r;if(t==null){for(var i=0;i=t:n===`max`?e<=t:e===t}function UN(e,t){return e.join(`,`)===t.join(`,`)}var WN=G,GN=Nl,KN=[`areaStyle`,`lineStyle`,`nodeStyle`,`linkStyle`,`chordStyle`,`label`,`labelLine`];function qN(e){var t=e&&e.itemStyle;if(t)for(var n=0,r=KN.length;n0?e[n-1].seriesModel:null)}),gP(e))})}function gP(e){G(e,function(t,n){var r=[],i=[NaN,NaN],a=[t.stackResultDimension,t.stackedOverDimension],o=t.data,s=t.isStackedByIndex,c=t.seriesModel.get(`stackStrategy`)||`samesign`;o.modify(a,function(a,l,u){var d=o.get(t.stackedDimension,u);if(isNaN(d))return i;var f,p;s?p=o.getRawIndex(u):f=o.get(t.stackedByDimension,u);for(var m=NaN,h=n-1;h>=0;h--){var g=e[h];if(s||(p=g.data.rawIndexOf(g.stackedByDimension,f)),p>=0){var _=g.data.getByRawIndex(g.stackResultDimension,p);if(c===`all`||c===`positive`&&_>0||c===`negative`&&_<0||c===`samesign`&&d>=0&&_>0||c===`samesign`&&d<=0&&_<0){d=Mu(d,_),m=_;break}}}return r[0]=d,r[1]=m,r})})}var _P=function(){function e(){this.group=new Ky,this.uid=DS(`viewComponent`)}return e.prototype.init=function(e,t){},e.prototype.render=function(e,t,n,r){},e.prototype.dispose=function(e,t){},e.prototype.updateView=function(e,t,n,r){},e.prototype.updateLayout=function(e,t,n,r){},e.prototype.updateVisual=function(e,t,n,r){},e.prototype.toggleBlurSeries=function(e,t,n){},e.prototype.eachRendered=function(e){var t=this.group;t&&t.traverse(e)},e}();sf(_P),mf(_P);function vP(){var e=Td();return function(t){var n=e(t),r=t.pipelineContext,i=!!n.large,a=!!n.progressiveRender,o=n.large=!!(r&&r.large),s=n.progressiveRender=!!(r&&r.progressiveRender);return(i!==o||a!==s)&&`reset`}}var yP=Td(),bP=vP(),xP=function(){function e(){this.group=new Ky,this.uid=DS(`viewChart`),this.renderTask=vT({plan:wP,reset:TP}),this.renderTask.context={view:this}}return e.prototype.init=function(e,t){},e.prototype.render=function(e,t,n,r){},e.prototype.highlight=function(e,t,n,r){var i=e.getData(r&&r.dataType);i&&CP(i,r,`emphasis`)},e.prototype.downplay=function(e,t,n,r){var i=e.getData(r&&r.dataType);i&&CP(i,r,`normal`)},e.prototype.remove=function(e,t){this.group.removeAll()},e.prototype.dispose=function(e,t){},e.prototype.updateView=function(e,t,n,r){this.render(e,t,n,r)},e.prototype.updateVisual=function(e,t,n,r){this.render(e,t,n,r)},e.prototype.eachRendered=function(e){Rx(this.group,e)},e.markUpdateMethod=function(e,t){yP(e).updateMethod=t},e.protoInitialize=function(){var t=e.prototype;t.type=`chart`}(),e}();function SP(e,t,n){e&&yy(e)&&(t===`emphasis`?Jv:Yv)(e,n)}function CP(e,t,n){var r=wd(e,t),i=t&&t.highlightKey!=null?by(t.highlightKey):null;r==null?e.eachItemGraphicEl(function(e){SP(e,n,i)}):G(rd(r),function(t){SP(e.getItemGraphicEl(t),n,i)})}sf(xP,[`dispose`]),mf(xP);function wP(e){return bP(e.model)}function TP(e){var t=e.model,n=e.ecModel,r=e.api,i=e.payload,a=t.pipelineContext.progressiveRender,o=e.view,s=i&&yP(i).updateMethod,c=a?`incrementalPrepareRender`:s&&o[s]?s:`render`;return c!==`render`&&o[c](t,n,r,i),EP[c]}var EP={incrementalPrepareRender:{progress:function(e,t){t.view.incrementalRender(e,t.model,t.ecModel,t.api,t.payload)}},render:{forceFirstProgress:!0,progress:function(e,t){t.view.render(t.model,t.ecModel,t.api,t.payload)}}},DP=`\0__throttleOriginMethod`,OP=`\0__throttleRate`,kP=`\0__throttleType`;function AP(e,t,n){var r,i=0,a=0,o=null,s,c,l,u;t||=0;function d(){a=new Date().getTime(),o=null,e.apply(c,l||[])}var f=function(){var e=[...arguments];r=new Date().getTime(),c=this,l=e;var f=u||t,p=u||n;u=null,s=r-(p?i:a)-f,clearTimeout(o),p?o=setTimeout(d,f):s>=0?d():o=setTimeout(d,-s),i=r};return f.clear=function(){o&&=(clearTimeout(o),null)},f.debounceNextCall=function(e){u=e},f}function jP(e,t,n,r){var i=e[t];if(i){var a=i[DP]||i,o=i[kP];if(i[OP]!==n||o!==r){if(n==null||!r)return e[t]=a;i=e[t]=AP(a,n,r===`debounce`),i[DP]=a,i[kP]=r,i[OP]=n}return i}}function MP(e,t){var n=e[t];n&&n[DP]&&(n.clear&&n.clear(),e[t]=n[DP])}var NP=Td(),PP={itemStyle:hf(SS,!0),lineStyle:hf(yS,!0)},FP={lineStyle:`stroke`,itemStyle:`fill`};function IP(e,t){return e.visualStyleMapper||PP[t]||(console.warn(`Unknown style type '`+t+`'.`),PP.itemStyle)}function LP(e,t){return e.visualDrawType||FP[t]||(console.warn(`Unknown style type '`+t+`'.`),`fill`)}var RP={createOnAllSeries:!0,performRawSeries:!0,reset:function(e,t){var n=e.getData(),r=e.visualStyleAccessPath||`itemStyle`,i=e.getModel(r),a=IP(e,r)(i),o=i.getShallow(`decal`);o&&(n.setVisual(`decal`,o),o.dirty=!0);var s=LP(e,r),c=a[s],l=Al(c)?c:null,u=a.fill===`auto`||a.stroke===`auto`;if(!a[s]||l||u){var d=e.getColorFromPalette(e.name,null,t.getSeriesCount());a[s]||(a[s]=d,n.setVisual(`colorFromPalette`,!0)),a.fill=a.fill===`auto`||Al(a.fill)?d:a.fill,a.stroke=a.stroke===`auto`||Al(a.stroke)?d:a.stroke}if(n.setVisual(`style`,a),n.setVisual(`drawType`,s),!t.isSeriesFiltered(e)&&l)return n.setVisual(`colorFromPalette`,!1),{dataEach:function(t,n){var r=e.getDataParams(n),i=W({},a);i[s]=l(r),t.setItemVisual(n,`style`,i)}}}},zP=new TS,BP={createOnAllSeries:!0,reset:function(e,t){if(!e.ignoreStyleOnData){var n=e.getData(),r=e.visualStyleAccessPath||`itemStyle`,i=IP(e,r),a=n.getVisual(`drawType`);return{dataEach:n.hasItemOption?function(e,t){var n=e.getRawDataItem(t);if(n&&n[r]){zP.option=n[r];var o=i(zP);W(e.ensureUniqueItemVisual(t,`style`),o),zP.option.decal&&(e.setItemVisual(t,`decal`,zP.option.decal),zP.option.decal.dirty=!0),a in o&&e.setItemVisual(t,`colorFromPalette`,!1)}}:null}}}},VP={performRawSeries:!0,overallReset:function(e){var t=$l();e.eachSeries(function(e){if(!e.isColorBySeries()){var n=e.type+`-`+e.getColorBy();NP(e).scope=t.get(n)||t.set(n,{})}}),e.eachSeries(function(e){if(!e.isColorBySeries()){var t=e.getRawData(),n={},r=e.getData(),i=NP(e).scope,a=LP(e,e.visualStyleAccessPath||`itemStyle`);r.each(function(e){var t=r.getRawIndex(e);n[t]=e}),t.each(function(o){var s=n[o];if(r.getItemVisual(s,`colorFromPalette`)){var c=r.ensureUniqueItemVisual(s,`style`),l=t.getName(o)||o+``,u=t.count();c[a]=e.getColorFromPalette(l,i,u)}})}})}},HP=Math.PI;function UP(e,t){t||={},yl(t,{text:`loading`,textColor:Q.color.primary,fontSize:12,fontWeight:`normal`,fontStyle:`normal`,fontFamily:`sans-serif`,maskColor:`rgba(255,255,255,0.8)`,showSpinner:!0,color:Q.color.theme[0],spinnerRadius:10,lineWidth:5,zlevel:0});var n=new Ky,r=new z_({style:{fill:t.maskColor},zlevel:t.zlevel,z:1e4});n.add(r);var i=new W_({style:{text:t.text,fill:t.textColor,fontSize:t.fontSize,fontWeight:t.fontWeight,fontStyle:t.fontStyle,fontFamily:t.fontFamily},zlevel:t.zlevel,z:10001}),a=new z_({style:{fill:`none`},textContent:i,textConfig:{position:`right`,distance:10},zlevel:t.zlevel,z:10001});n.add(a);var o;return t.showSpinner&&(o=new Ab({shape:{startAngle:-HP/2,endAngle:-HP/2+.1,r:t.spinnerRadius},style:{stroke:t.color,lineCap:`round`,lineWidth:t.lineWidth},zlevel:t.zlevel,z:10001}),o.animateShape(!0).when(1e3,{endAngle:HP*3/2}).start(`circularInOut`),o.animateShape(!0).when(1e3,{startAngle:HP*3/2}).delay(300).start(`circularInOut`),n.add(o)),n.resize=function(){var n=i.getBoundingRect().width,s=t.showSpinner?t.spinnerRadius:0,c=(e.getWidth()-s*2-(t.showSpinner&&n?10:0)-n)/2-(t.showSpinner&&n?0:5+n/2)+(t.showSpinner?0:n/2)+(n?0:s),l=e.getHeight()/2;t.showSpinner&&o.setShape({cx:c,cy:l}),a.setShape({x:c-s,y:l-s,width:s*2,height:s*2}),r.setShape({x:0,y:0,width:e.getWidth(),height:e.getHeight()})},n.resize(),n}var WP=function(){function e(e,t,n,r){this._stageTaskMap=$l(),this.ecInstance=e,this.api=t,n=this._dataProcessorHandlers=n.slice(),r=this._visualHandlers=r.slice(),this._allHandlers=n.concat(r)}return e.prototype.restoreData=function(e,t){e.restoreData(t),this._stageTaskMap.each(function(e){var t=e.overallTask;t&&t.dirty()})},e.prototype.getPerformArgs=function(e,t){if(e.__pipeline){var n=this._pipelineMap.get(e.__pipeline.id),r=n.context,i=!t&&n.progressiveEnabled&&(!r||r.progressiveRender)&&e.__idxInPipeline>n.blockIndex?n.step:null,a=r&&r.modDataCount;return{step:i,modBy:a==null?null:Math.ceil(a/i),modDataCount:a}}},e.prototype.getPipeline=function(e){return this._pipelineMap.get(e)},e.prototype.updateStreamModes=function(e,t){var n=this._pipelineMap.get(e.uid);e.pipelineContext=n.context=e.__preparePipelineContext?e.__preparePipelineContext(t,n):Qd(e,t,n)},e.prototype.restorePipelines=function(e,t){var n=this,r=n._pipelineMap=$l();t.eachSeries(function(t){var i=e.painter.type===`canvas`&&t.getProgressive(),a=t.uid;r.set(a,{id:a,head:null,tail:null,threshold:t.getProgressiveThreshold(),progressiveEnabled:i&&!(t.preventIncremental&&t.preventIncremental()),blockIndex:-1,step:Math.round(i||700),count:0}),n._pipe(t,t.dataTask)})},e.prototype.prepareStageTasks=function(){var e=this._stageTaskMap,t=this.api.getModel(),n=this.api;G(this._allHandlers,function(r){var i=e.get(r.uid)||e.set(r.uid,{});Wl(!(r.reset&&r.overallReset),``),r.reset&&this._createSeriesStageTask(r,i,t,n),r.overallReset&&this._createOverallStageTask(r,i,t,n)},this)},e.prototype.prepareView=function(e,t,n,r){var i=e.renderTask,a=i.context;a.model=t,a.ecModel=n,a.api=r,i.__block=!e.incrementalPrepareRender,this._pipe(t,i)},e.prototype.performDataProcessorTasks=function(e,t){this._performStageTasks(this._dataProcessorHandlers,e,t,{block:!0})},e.prototype.performVisualTasks=function(e,t,n){this._performStageTasks(this._visualHandlers,e,t,n)},e.prototype._performStageTasks=function(e,t,n,r){r||={};var i=!1,a=this;G(e,function(e,s){if(!(r.visualType&&r.visualType!==e.visualType)){var c=a._stageTaskMap.get(e.uid),l=c.seriesTaskMap,u=c.overallTask;if(u){var d,f=u.agentStubMap;f.each(function(e){o(r,e)&&(e.dirty(),d=!0)}),d&&u.dirty(),a.updatePayload(u,n);var p=a.getPerformArgs(u,r.block);f.each(function(e){e.perform(p)}),u.perform(p)&&(i=!0)}else l&&l.each(function(s,c){o(r,s)&&s.dirty();var l=a.getPerformArgs(s,r.block);l.skip=!e.performRawSeries&&t.isSeriesFiltered(s.context.model),a.updatePayload(s,n),s.perform(l)&&(i=!0)})}});function o(e,t){return e.setDirty&&(!e.dirtyMap||e.dirtyMap.get(t.__pipeline.id))}this.unfinished=i||this.unfinished},e.prototype.performSeriesTasks=function(e){var t;e.eachSeries(function(e){t=e.dataTask.perform()||t}),this.unfinished=t||this.unfinished},e.prototype.plan=function(){this._pipelineMap.each(function(e){var t=e.tail;do{if(t.__block){e.blockIndex=t.__idxInPipeline;break}t=t.getUpstream()}while(t)})},e.prototype.updatePayload=function(e,t){t!==`remain`&&(e.context.payload=t)},e.prototype._createSeriesStageTask=function(e,t,n,r){var i=this,a=t.seriesTaskMap,o=t.seriesTaskMap=$l(),s=e.seriesType,c=e.getTargetSeries;e.createOnAllSeries?n.eachRawSeries(l):s?n.eachRawSeriesByType(s,l):c&&c(n,r).each(l);function l(t){var s=t.uid,c=o.set(s,a&&a.get(s)||vT({plan:YP,reset:XP,count:$P}));c.context={model:t,ecModel:n,api:r,useClearVisual:e.isVisual&&!e.isLayout,plan:e.plan,reset:e.reset,scheduler:i},i._pipe(t,c)}},e.prototype._createOverallStageTask=function(e,t,n,r){var i=this,a=t.overallTask=t.overallTask||vT({reset:GP});a.context={ecModel:n,api:r,overallReset:e.overallReset,scheduler:i};var o=a.agentStubMap,s=a.agentStubMap=$l(),c=e.seriesType,l=e.getTargetSeries,u=e.dirtyOnOverallProgress,d=!1;Wl(!e.createOnAllSeries,``),c?n.eachRawSeriesByType(c,f):l?l(n,r).each(f):G(n.getSeries(),f);function f(e){var t=e.uid,n=s.set(t,o&&o.get(t)||(d=!0,vT({reset:KP,onDirty:JP})));n.context={model:e,dirtyOnOverallProgress:u},n.agent=a,n.__block=u,i._pipe(e,n)}d&&a.dirty()},e.prototype._pipe=function(e,t){var n=e.uid,r=this._pipelineMap.get(n);!r.head&&(r.head=t),r.tail&&r.tail.pipe(t),r.tail=t,t.__idxInPipeline=r.count++,t.__pipeline=r},e.wrapStageHandler=function(e,t){return Al(e)&&(e={overallReset:e,seriesType:eF(e)}),e.uid=DS(`stageHandler`),t&&(e.visualType=t),e},e}();function GP(e){e.overallReset(e.ecModel,e.api,e.payload)}function KP(e){return e.dirtyOnOverallProgress&&qP}function qP(){this.agent.dirty(),this.getDownstream().dirty()}function JP(){this.agent&&this.agent.dirty()}function YP(e){return e.plan?e.plan(e.model,e.ecModel,e.api,e.payload):null}function XP(e){e.useClearVisual&&e.data.clearAllVisual();var t=e.resetDefines=rd(e.reset(e.model,e.ecModel,e.api,e.payload));return t.length>1?K(t,function(e,t){return QP(t)}):ZP}var ZP=QP(0);function QP(e){return function(t,n){var r=n.data,i=n.resetDefines[e];if(i&&i.dataEach)for(var a=t.start;a0&&u===i.length-l.length){var d=i.slice(0,u);d!==`data`&&(t.mainType=d,t[l.toLowerCase()]=e,s=!0)}}o.hasOwnProperty(i)&&(n[i]=e,s=!0),s||(r[i]=e)})}return{cptQuery:t,dataQuery:n,otherQuery:r}},e.prototype.filter=function(e,t){var n=this.eventInfo;if(!n)return!0;var r=n.targetEl,i=n.packedEvent,a=n.model,o=n.view;if(!a||!o)return!0;var s=t.cptQuery,c=t.dataQuery;return l(s,a,`mainType`)&&l(s,a,`subType`)&&l(s,a,`index`,`componentIndex`)&&l(s,a,`name`)&&l(s,a,`id`)&&l(c,i,`name`)&&l(c,i,`dataIndex`)&&l(c,i,`dataType`)&&(!o.filterForExposedEvent||o.filterForExposedEvent(e,t.otherQuery,r,i));function l(e,t,n,r){return e[n]==null||t[r||n]===e[n]}},e.prototype.afterTrigger=function(){this.eventInfo=null},e}(),uF=[`symbol`,`symbolSize`,`symbolRotate`,`symbolOffset`],dF=uF.concat([`symbolKeepAspect`]),fF={createOnAllSeries:!0,performRawSeries:!0,reset:function(e,t){var n=e.getData();if(e.legendIcon&&n.setVisual(`legendIcon`,e.legendIcon),!e.hasSymbolVisual)return;for(var r={},i={},a=!1,o=0;o=0&&AF(c)?c:.5,e.createRadialGradient(o,s,0,o,s,c)}function NF(e,t,n){for(var r=t.type===`radial`?MF(e,t,n):jF(e,t,n),i=t.colorStops,a=0;a0)?null:e===`dashed`?[4*t,2*t]:e===`dotted`?[t]:Ml(e)?[e]:J(e)?e:null}function RF(e){var t=e.style,n=t.lineDash&&t.lineWidth>0&&LF(t.lineDash,t.lineWidth),r=t.lineDashOffset;if(n){var i=t.strokeNoScale&&e.getLineScale?e.getLineScale():1;i&&i!==1&&(n=K(n,function(e){return e/i}),r/=i)}return[n,r]}var zF=new e_(!0);function BF(e){var t=e.stroke;return!(t==null||t===`none`||!(e.lineWidth>0))}function VF(e){return typeof e==`string`&&e!==`none`}function HF(e){var t=e.fill;return t!=null&&t!==`none`}function UF(e,t){if(t.fillOpacity!=null&&t.fillOpacity!==1){var n=e.globalAlpha;e.globalAlpha=t.fillOpacity*t.opacity,e.fill(),e.globalAlpha=n}else e.fill()}function WF(e,t){if(t.strokeOpacity!=null&&t.strokeOpacity!==1){var n=e.globalAlpha;e.globalAlpha=t.strokeOpacity*t.opacity,e.stroke(),e.globalAlpha=n}else e.stroke()}function GF(e,t,n){var r=Cf(t.image,t.__image,n);if(Tf(r)){var i=e.createPattern(r,t.repeat||`repeat`);if(typeof DOMMatrix==`function`&&i&&i.setTransform){var a=new DOMMatrix;a.translateSelf(t.x||0,t.y||0),a.rotateSelf(0,0,(t.rotation||0)*iu),a.scaleSelf(t.scaleX||1,t.scaleY||1),i.setTransform(a)}return i}}function KF(e,t,n,r,i){var a,o=BF(n),s=HF(n),c=n.strokePercent,l=c<1,u=!t.path;(!t.silent||l)&&u&&t.createPathProxy();var d=t.path||zF,f=t.__dirty;if(!r){var p=n.fill,m=n.stroke,h=s&&!!p.colorStops,g=o&&!!m.colorStops,_=s&&!!p.image,v=o&&!!m.image,y=void 0,b=void 0,x=void 0,S=void 0,C=void 0;(h||g)&&(C=t.getBoundingRect()),h&&(y=f?NF(e,p,C):t.__canvasFillGradient,t.__canvasFillGradient=y),g&&(b=f?NF(e,m,C):t.__canvasStrokeGradient,t.__canvasStrokeGradient=b),_&&(x=f||!t.__canvasFillPattern?GF(e,p,t):t.__canvasFillPattern,t.__canvasFillPattern=x),v&&(S=f||!t.__canvasStrokePattern?GF(e,m,t):t.__canvasStrokePattern,t.__canvasStrokePattern=S),h?e.fillStyle=y:_&&(x?e.fillStyle=x:s=!1),g?e.strokeStyle=b:v&&(S?e.strokeStyle=S:o=!1)}var w=t.getGlobalScale();d.setScale(w[0],w[1],t.segmentIgnoreThreshold);var T,E;e.setLineDash&&n.lineDash&&(a=RF(t),T=a[0],E=a[1]);var D=!0;(u||f&4)&&(d.setDPR(e.dpr),l?d.setContext(null):(d.setContext(e),D=!1),d.reset(),t.buildPath(d,t.shape,r),d.toStatic(),t.pathUpdated()),D&&d.rebuildPath(e,l?c:1),T&&(e.setLineDash(T),e.lineDashOffset=E),r?(i.batchFill=s,i.batchStroke=o):n.strokeFirst?(o&&WF(e,n),s&&UF(e,n)):(s&&UF(e,n),o&&WF(e,n)),T&&e.setLineDash([])}function qF(e,t,n){var r=t.__image=Cf(n.image,t.__image,t,t.onload);if(r&&Tf(r)){var i=n.x||0,a=n.y||0,o=t.getWidth(),s=t.getHeight(),c=r.width/r.height;if(o==null&&s!=null?o=s*c:s==null&&o!=null?s=o/c:o==null&&s==null&&(o=r.width,s=r.height),n.sWidth&&n.sHeight){var l=n.sx||0,u=n.sy||0;e.drawImage(r,l,u,n.sWidth,n.sHeight,i,a,o,s)}else if(n.sx&&n.sy){var l=n.sx,u=n.sy,d=o-l,f=s-u;e.drawImage(r,l,u,d,f,i,a,o,s)}else e.drawImage(r,i,a,o,s)}}function JF(e,t,n){var r,i=n.text;if(i!=null&&(i+=``),i){e.font=n.font||`12px sans-serif`,e.textAlign=n.textAlign,e.textBaseline=n.textBaseline;var a=void 0,o=void 0;e.setLineDash&&n.lineDash&&(r=RF(t),a=r[0],o=r[1]),a&&(e.setLineDash(a),e.lineDashOffset=o),n.strokeFirst?(BF(n)&&e.strokeText(i,n.x,n.y),HF(n)&&e.fillText(i,n.x,n.y)):(HF(n)&&e.fillText(i,n.x,n.y),BF(n)&&e.strokeText(i,n.x,n.y)),a&&e.setLineDash([])}}var YF=[`shadowBlur`,`shadowOffsetX`,`shadowOffsetY`],XF=[[`lineCap`,`butt`],[`lineJoin`,`miter`],[`miterLimit`,10]];function ZF(e,t,n,r,i){var a=!1;if(!r&&(n||={},t===n))return!1;if(r||t.opacity!==n.opacity){cI(e,i),a=!0;var o=Math.max(Math.min(t.opacity,1),0);e.globalAlpha=isNaN(o)?mg.opacity:o}(r||t.blend!==n.blend)&&(a||=(cI(e,i),!0),e.globalCompositeOperation=t.blend||mg.blend);for(var s=0;s0&&e.unfinished);e.unfinished||this._zr.flush()}}},t.prototype.getDom=function(){return this._dom},t.prototype.getId=function(){return this.id},t.prototype.getZr=function(){return this._zr},t.prototype.isSSR=function(){return this._ssr},t.prototype.setOption=function(e,t,n){if(!this[HI]){if(this._disposed){this.id;return}var r,i,a;if(Nl(t)&&(n=t.lazyUpdate,r=t.silent,i=t.replaceMerge,a=t.transition,t=t.notMerge),this[HI]=!0,bL(this),!this._model||t){var o=new zN(this._api),s=this._theme,c=this._model=new MN;c.scheduler=this._scheduler,c.ssr=this._ssr,c.init(null,null,null,s,this._locale,o)}this._model.setOption(e,{replaceMerge:i},OL);var l={seriesTransition:a,optionChanged:!0};if(n)this[WI]={silent:r,updateParams:l},this[HI]=!1,this.getZr().wakeUp();else{try{nL(this),aL.update.call(this,null,l)}catch(e){throw this[WI]=null,this[HI]=!1,e}this._ssr||this._zr.flush(),this[WI]=null,this[HI]=!1,lL.call(this,r),uL.call(this,r)}}},t.prototype.setTheme=function(e,t){if(!this[HI]){if(this._disposed){this.id;return}var n=this._model;if(n){var r=t&&t.silent,i=null;this[WI]&&(r??=this[WI].silent,i=this[WI].updateParams,this[WI]=null),this[HI]=!0,bL(this);try{this._updateTheme(e),n.setTheme(this._theme),nL(this),aL.update.call(this,{type:`setTheme`},i)}catch(e){throw this[HI]=!1,e}this[HI]=!1,lL.call(this,r),uL.call(this,r)}}},t.prototype._updateTheme=function(e){Y(e)&&(e=AL[e]),e&&(e=hl(e),e&&pP(e,!0),this._theme=e)},t.prototype.getModel=function(){return this._model},t.prototype.getOption=function(){return this._model&&this._model.getOption()},t.prototype.getWidth=function(){return this._zr.getWidth()},t.prototype.getHeight=function(){return this._zr.getHeight()},t.prototype.getDevicePixelRatio=function(){return this._zr.painter.dpr||ou.hasGlobalWindow&&window.devicePixelRatio||1},t.prototype.getRenderedCanvas=function(e){return this.renderToCanvas(e)},t.prototype.renderToCanvas=function(e){return e||={},this._zr.painter.getRenderedCanvas({backgroundColor:e.backgroundColor||this._model.get(`backgroundColor`),pixelRatio:e.pixelRatio||this.getDevicePixelRatio()})},t.prototype.renderToSVGString=function(e){return e||={},this._zr.painter.renderToString({useViewBox:e.useViewBox})},t.prototype.getSvgDataURL=function(){var e=this._zr;return G(e.storage.getDisplayList(),function(e){e.stopAnimation(null,!0)}),e.painter.toDataURL()},t.prototype.getDataURL=function(e){if(this._disposed){this.id;return}e||={};var t=e.excludeComponents,n=this._model,r=[],i=this;G(t,function(e){n.eachComponent({mainType:e},function(e){var t=i._componentsMap[e.__viewId];t.group.ignore||(r.push(t),t.group.ignore=!0)})});var a=this._zr.painter.getType()===`svg`?this.getSvgDataURL():this.renderToCanvas(e).toDataURL(`image/`+(e&&e.type||`png`));return G(r,function(e){e.group.ignore=!1}),a},t.prototype.getConnectedDataURL=function(e){if(this._disposed){this.id;return}var t=e.type===`svg`,n=this.group,r=Math.min,i=Math.max,a=1/0;if(NL[n]){var o=a,s=a,c=-a,l=-a,u=[],d=e&&e.pixelRatio||this.getDevicePixelRatio();G(ML,function(a,d){if(a.group===n){var f=t?a.getZr().painter.getSvgDom().innerHTML:a.renderToCanvas(hl(e)),p=a.getDom().getBoundingClientRect();o=r(p.left,o),s=r(p.top,s),c=i(p.right,c),l=i(p.bottom,l),u.push({dom:f,left:p.left,top:p.top})}}),o*=d,s*=d,c*=d,l*=d;var f=c-o,p=l-s,m=$c.createCanvas(),h=_N(m,{renderer:t?`svg`:`canvas`});if(h.resize({width:f,height:p}),t){var g=``;return G(u,function(e){var t=e.left-o,n=e.top-s;g+=``+e.dom+``}),h.painter.getSvgRoot().innerHTML=g,e.connectedBackgroundColor&&h.painter.setBackgroundColor(e.connectedBackgroundColor),h.refreshImmediately(),h.painter.toDataURL()}return e.connectedBackgroundColor&&h.add(new z_({shape:{x:0,y:0,width:f,height:p},style:{fill:e.connectedBackgroundColor}})),G(u,function(e){var t=new j_({style:{x:e.left*d-o,y:e.top*d-s,image:e.dom}});h.add(t)}),h.refreshImmediately(),m.toDataURL(`image/`+(e&&e.type||`png`))}return this.getDataURL(e)},t.prototype.convertToPixel=function(e,t,n){return oL(this,`convertToPixel`,e,t,n)},t.prototype.convertToLayout=function(e,t,n){return oL(this,`convertToLayout`,e,t,n)},t.prototype.convertFromPixel=function(e,t,n){return oL(this,`convertFromPixel`,e,t,n)},t.prototype.containPixel=function(e,t){if(this._disposed){this.id;return}var n=this._model,r;return G(Dd(n,e),function(e,n){n.indexOf(`Models`)>=0&&G(e,function(e){var i=e.coordinateSystem;if(i&&i.containPoint)r||=!!i.containPoint(t);else if(n===`seriesModels`){var a=this._chartsMap[e.__viewId];a&&a.containPoint&&(r||=a.containPoint(t,e))}},this)},this),!!r},t.prototype.getVisual=function(e,t){var n=this._model,r=Dd(n,e,{defaultMainType:`series`}),i=r.seriesModel.getData(),a=r.hasOwnProperty(`dataIndexInside`)?r.dataIndexInside:r.hasOwnProperty(`dataIndex`)?i.indexOfRawIndex(r.dataIndex):null;return a==null?hF(i,t):mF(i,a,t)},t.prototype.getViewOfComponentModel=function(e){return this._componentsMap[e.__viewId]},t.prototype.getViewOfSeriesModel=function(e){return this._chartsMap[e.__viewId]},t.prototype._initEvents=function(){var e=this;G(CL,function(t){var n=function(n){var r=e.getModel(),i=n.target,a;if(t===`globalout`?a={}:i&&yF(i,function(e){var t=iv(e);if(t&&t.dataIndex!=null){var n=t.dataModel||r.getSeriesByIndex(t.seriesIndex);return a=n&&n.getDataParams(t.dataIndex,t.dataType,i)||{},!0}if(t.eventData)return a=W({},t.eventData),!0},!0),a){var o=a.componentType,s=a.componentIndex;(o===`markLine`||o===`markPoint`||o===`markArea`)&&(o=`series`,s=a.seriesIndex);var c=o&&s!=null&&r.getComponent(o,s),l=c&&e[c.mainType===`series`?`_chartsMap`:`_componentsMap`][c.__viewId];a.event=n,a.type=t,e._$eventProcessor.eventInfo={targetEl:i,packedEvent:a,model:c,view:l},e.trigger(t,a)}};n.zrEventfulCallAtLast=!0,e._zr.on(t,n,e)});var t=this._messageCenter;G(EL,function(n,r){t.on(r,function(t){e.trigger(r,t)})}),vF(t,this,this._api)},t.prototype.isDisposed=function(){return this._disposed},t.prototype.clear=function(){if(this._disposed){this.id;return}this.setOption({series:[]},!0)},t.prototype.dispose=function(){if(this._disposed){this.id;return}this._disposed=!0,this.getDom()&&Nd(this.getDom(),IL,``);var e=this,t=e._api,n=e._model;G(e._componentsViews,function(e){e.dispose(n,t)}),G(e._chartsViews,function(e){e.dispose(n,t)}),e._zr.dispose(),e._dom=e._model=e._chartsMap=e._componentsMap=e._chartsViews=e._componentsViews=e._scheduler=e._api=e._zr=e._throttledZrFlush=e._theme=e._coordSysMgr=e._messageCenter=null,delete ML[e.id]},t.prototype.resize=function(e){if(!this[HI]){if(this._disposed){this.id;return}this._zr.resize(e);var t=this._model;if(this._loadingFX&&this._loadingFX.resize(),t){var n=t.resetOption(`media`),r=e&&e.silent;this[WI]&&(r??=this[WI].silent,n=!0,this[WI]=null),this[HI]=!0,bL(this);try{n&&nL(this),aL.update.call(this,{type:`resize`,animation:W({duration:0},e&&e.animation)})}catch(e){throw this[HI]=!1,e}this[HI]=!1,lL.call(this,r),uL.call(this,r)}}},t.prototype.showLoading=function(e,t){if(this._disposed){this.id;return}if(Nl(e)&&(t=e,e=``),e||=`default`,this.hideLoading(),jL[e]){var n=jL[e](this._api,t),r=this._zr;this._loadingFX=n,r.add(n)}},t.prototype.hideLoading=function(){if(this._disposed){this.id;return}this._loadingFX&&this._zr.remove(this._loadingFX),this._loadingFX=null},t.prototype.makeActionFromEvent=function(e){var t=W({},e);return t.type=TL[e.type],t},t.prototype.dispatchAction=function(e,t){if(this._disposed){this.id;return}if(Nl(t)||(t={silent:!!t}),wL[e.type]&&this._model){if(this[HI]){this._pendingActions.push(e);return}var n=t.silent;cL.call(this,e,n);var r=t.flush;r?this._zr.flush():r!==!1&&ou.browser.weChat&&this._throttledZrFlush(),lL.call(this,n),uL.call(this,n)}},t.prototype.updateLabelLayout=function(){bF.trigger(`series:layoutlabels`,this._model,this._api,{updatedSeries:[]})},t.prototype.appendData=function(e){if(this._disposed){this.id;return}var t=e.seriesIndex;this.getModel().getSeriesByIndex(t).appendData(e),this._scheduler.unfinished=!0,this.getZr().wakeUp()},t.internalField=function(){nL=function(e){Bk(e._model);var t=e._scheduler;t.restorePipelines(e._zr,e._model),t.prepareStageTasks(),rL(e,!0),rL(e,!1),t.plan()},rL=function(e,t){for(var n=e._model,r=e._scheduler,i=t?e._componentsViews:e._chartsViews,a=t?e._componentsMap:e._chartsMap,o=e._zr,s=e._api,c=0;cX(t.get(`hoverLayerThreshold`),CN.hoverLayerThreshold)&&!ou.node&&!ou.worker;(e._usingTHL||a)&&(t.eachSeries(function(t){if(!t.preventUsingHoverLayer){var n=e._chartsMap[t.__viewId];n.__alive&&n.eachRendered(function(e){var t=e.states.emphasis;t&&t.hoverLayer!==2&&(t.hoverLayer=+!!a)})}}),e._usingTHL=a)}}function a(e,t){var n=e.get(`blendMode`)||null;t.eachRendered(function(e){e.isGroup||(e.style.blend=n)})}function o(e,t){if(!e.preventAutoZ){var n=Ux(e);t.eachRendered(function(e){return Gx(e,n.z,n.zlevel),!0})}}function s(e,t){t.eachRendered(function(e){if(!Zb(e)){var t=e.getTextContent(),n=e.getTextGuideLine();e.stateTransition&&=null,t&&t.stateTransition&&(t.stateTransition=null),n&&n.stateTransition&&(n.stateTransition=null),e.hasState()?(e.prevStates=e.currentStates,e.clearStates()):e.prevStates&&=null}})}function c(e,t){var n=e.getModel(`stateAnimation`),i=e.isAnimationEnabled(),a=n.get(`duration`),o=a>0?{duration:a,delay:n.get(`delay`),easing:n.get(`easing`)}:null;t.eachRendered(function(e){if(e.states&&e.states.emphasis){if(Zb(e))return;if(e instanceof T_&&Cy(e),e.__dirty){var t=e.prevStates;t&&e.useStates(t)}if(i){e.stateTransition=o;var n=e.getTextContent(),a=e.getTextGuideLine();n&&(n.stateTransition=o),a&&(a.stateTransition=o)}e.__dirty&&r(e)}})}gL=function(e){return new(function(t){U(n,t);function n(){return t!==null&&t.apply(this,arguments)||this}return n.prototype.getCoordinateSystems=function(){return e._coordSysMgr.getCoordinateSystems()},n.prototype.getComponentByElement=function(t){for(;t;){var n=t.__ecComponentInfo;if(n!=null)return e._model.getComponent(n.mainType,n.index);t=t.parent}},n.prototype.enterEmphasis=function(t,n){Jv(t,n),vL(e)},n.prototype.leaveEmphasis=function(t,n){Yv(t,n),vL(e)},n.prototype.enterBlur=function(t){Xv(t),vL(e)},n.prototype.leaveBlur=function(t){Zv(t),vL(e)},n.prototype.enterSelect=function(t){Qv(t),vL(e)},n.prototype.leaveSelect=function(t){$v(t),vL(e)},n.prototype.getModel=function(){return e.getModel()},n.prototype.getViewOfComponentModel=function(t){return e.getViewOfComponentModel(t)},n.prototype.getViewOfSeriesModel=function(t){return e.getViewOfSeriesModel(t)},n.prototype.getECUpdateCycleVersion=function(){return e[UI]},n.prototype.usingTHL=function(){return e._usingTHL},n}(hv))(e)},_L=function(e){function t(e,t){for(var n=0;n=0)){ZL.push(n);var o=WP.wrapStageHandler(n,i);o.__prio=t,o.__raw=n,e.push(o)}}function $L(e,t){jL[e]=t}function eR(e,t,n){var r=CF(`registerMap`);r&&r(e,t,n)}var tR=NT;XL(NI,RP),XL(II,BP),XL(II,VP),XL(NI,fF),XL(II,pF),XL(BI,SI),HL(pP),UL(EI,mP),$L(`default`,UP),qL({type:Cv,event:Cv,update:Cv},ru),qL({type:wv,event:wv,update:wv},ru),qL({type:Tv,event:Ov,update:Tv,action:ru,refineEvent:nR,publishNonRefinedEvent:!0}),qL({type:Ev,event:Ov,update:Ev,action:ru,refineEvent:nR,publishNonRefinedEvent:!0}),qL({type:Dv,event:Ov,update:Dv,action:ru,refineEvent:nR,publishNonRefinedEvent:!0});function nR(e,t,n,r){return{eventContent:{selected:uy(n),isFromClick:t.isFromClick||!1}}}VL(`default`,{}),VL(`dark`,cF);var rR=[],iR={registerPreprocessor:HL,registerProcessor:UL,registerPostInit:WL,registerPostUpdate:GL,registerUpdateLifecycle:KL,registerAction:qL,registerCoordinateSystem:JL,registerLayout:YL,registerVisual:XL,registerTransform:tR,registerLoading:$L,registerMap:eR,registerImpl:SF,PRIORITY:VI,ComponentModel:Sw,ComponentView:_P,SeriesModel:wE,ChartView:xP,registerComponentModel:function(e){Sw.registerClass(e)},registerComponentView:function(e){_P.registerClass(e)},registerSeriesModel:function(e){wE.registerClass(e)},registerChartView:function(e){xP.registerClass(e)},registerCustomSeries:function(e,t){TF(e,t)},registerSubTypeDefaulter:function(e,t){Sw.registerSubTypeDefaulter(e,t)},registerPainter:function(e,t){vN(e,t)}};function aR(e){if(J(e)){G(e,function(e){aR(e)});return}bl(rR,e)>=0||(rR.push(e),Al(e)&&(e={install:e}),e.install(iR))}var oR=function(){function e(e,t){this._encode=e,this._schema=t}return e.prototype.get=function(){return{fullDimensions:this._getFullDimensionNames(),encode:this._encode}},e.prototype._getFullDimensionNames=function(){return this._cachedDimNames||=this._schema?this._schema.makeOutputDimensionNames():[],this._cachedDimNames},e}();function sR(e,t){var n={},r=n.encode={},i=$l(),a=[],o=[],s={};G(e.dimensions,function(t){var n=e.getDimensionInfo(t),c=n.coordDim;if(c){var l=n.coordDimIndex;cR(r,c)[l]=t,n.isExtraCoord||(i.set(c,1),uR(n.type)&&(a[0]=t),cR(s,c)[l]=e.getDimensionIndex(n.name)),n.defaultTooltip&&o.push(t)}ov.each(function(e,t){var i=cR(r,t),a=n.otherDims[t];a!=null&&a!==!1&&(i[a]=n.name)})});var c=[],l={};i.each(function(e,t){var n=r[t];l[t]=n[0],c=c.concat(n)}),n.dataDimsOnCoord=c,n.dataDimIndicesOnCoord=K(c,function(t){return e.getDimensionInfo(t).storeDimIndex}),n.encodeFirstDimNotExtra=l;var u=r.label;u&&u.length&&(a=u.slice());var d=r.tooltip;return d&&d.length?o=d.slice():o.length||(o=a.slice()),r.defaultedLabel=a,r.defaultedTooltip=o,n.userOutput=new oR(s,t),n}function cR(e,t){return e.hasOwnProperty(t)||(e[t]=[]),e[t]}function lR(e){return e===`category`?`ordinal`:e===`time`?`time`:`float`}function uR(e){return e!==`ordinal`&&e!==`time`}var dR=function(){function e(e){this.otherDims={},e!=null&&W(this,e)}return e}(),fR=Nl,pR=K,mR=typeof Int32Array>`u`?Array:Int32Array,hR=`e\0\0`,gR=-1,_R=[`hasItemOption`,`_nameList`,`_idList`,`_invertedIndicesMap`,`_dimSummary`,`userOutput`,`_rawData`,`_dimValueGetter`,`_nameDimIdx`,`_idDimIdx`,`_nameRepeatCount`],vR=[`_approximateExtent`],yR,bR,xR,SR,CR,wR,TR,ER=function(){function e(e,t){this.type=`list`,this._dimOmitted=!1,this._nameList=[],this._idList=[],this._visual={},this._layout={},this._itemVisuals=[],this._itemLayouts=[],this._graphicEls=[],this._approximateExtent={},this._calculationInfo={},this.hasItemOption=!1,this.TRANSFERABLE_METHODS=[`cloneShallow`,`downSample`,`minmaxDownSample`,`lttbDownSample`,`map`],this.CHANGABLE_METHODS=[`filterSelf`,`selectRange`],this.DOWNSAMPLE_METHODS=[`downSample`,`minmaxDownSample`,`lttbDownSample`];var n,r=!1;LO(e)?(n=e.dimensions,this._dimOmitted=e.isDimensionOmitted(),this._schema=e):(r=!0,n=e),n||=[`x`,`y`];for(var i={},a=[],o={},s=!1,c={},l=0;l=t)){var n=this._store.getProvider();this._updateOrdinalMeta();var r=this._nameList,i=this._idList;if(n.getSource().sourceFormat===`original`&&!n.pure)for(var a=[],o=e;o0},e.prototype.ensureUniqueItemVisual=function(e,t){var n=this._itemVisuals,r=n[e];r||=n[e]={};var i=r[t];return i??(i=this.getVisual(t),J(i)?i=i.slice():fR(i)&&(i=W({},i)),r[t]=i),i},e.prototype.setItemVisual=function(e,t,n){var r=this._itemVisuals[e]||{};this._itemVisuals[e]=r,fR(t)?W(r,t):r[t]=n},e.prototype.clearAllVisual=function(){this._visual={},this._itemVisuals=[]},e.prototype.setLayout=function(e,t){fR(e)?W(this._layout,e):this._layout[e]=t},e.prototype.getLayout=function(e){return this._layout[e]},e.prototype.getItemLayout=function(e){return this._itemLayouts[e]},e.prototype.setItemLayout=function(e,t,n){this._itemLayouts[e]=n?W(this._itemLayouts[e]||{},t):t},e.prototype.clearItemLayouts=function(){this._itemLayouts.length=0},e.prototype.setItemGraphicEl=function(e,t){av(this.hostModel&&this.hostModel.seriesIndex,this.dataType,e,t),this._graphicEls[e]=t},e.prototype.getItemGraphicEl=function(e){return this._graphicEls[e]},e.prototype.eachItemGraphicEl=function(e,t){G(this._graphicEls,function(n,r){n&&e&&e.call(t,n,r)})},e.prototype.cloneShallow=function(t){return t||=new e(this._schema?this._schema:pR(this.dimensions,this._getDimInfo,this),this.hostModel),CR(t,this),t._store=this._store,t},e.prototype.wrapMethod=function(e,t){var n=this[e];Al(n)&&(this.__wrappedMethods=this.__wrappedMethods||[],this.__wrappedMethods.push(e),this[e]=function(){var e=n.apply(this,arguments);return t.apply(this,[e].concat(Hl(arguments)))})},e.internalField=function(){yR=function(e){var t=e._invertedIndicesMap;G(t,function(n,r){var i=e._dimInfos[r],a=i.ordinalMeta,o=e._store;if(a){n=t[r]=new mR(a.categories.length);for(var s=0;s1&&(s+=`__ec__`+l),r[t]=s}}}(),e}();function DR(e,t){Bw(e)||(e=Hw(e)),t||={};var n=t.coordDimensions||[],r=t.dimensionsDefine||e.dimensionsDefine||[],i=$l(),a=[],o=OR(e,n,r,t.dimensionsCount),s=t.canOmitUnusedDimensions&&BO(o),c=r===e.dimensionsDefine,l=c?zO(e):RO(r),u=t.encodeDefine;!u&&t.encodeDefaulter&&(u=t.encodeDefaulter(e,o));for(var d=$l(u),f=new zT(o),p=0;p0&&(e.name+=t-1)}),new IO({source:e,dimensions:a,fullDimensionCount:o,dimensionOmitted:s})}function OR(e,t,n,r){var i=Math.max(e.dimensionsDetectedCount||1,t.length,n.length,r||0);return G(t,function(e){var t;Nl(e)&&(t=e.dimsDef)&&(i=Math.max(i,t.length))}),i}function kR(e,t,n){if(n||t.hasKey(e)){for(var r=0;t.hasKey(e+r);)r++;e+=r}return t.set(e,!0),e}var AR=function(){function e(e){this.coordSysDims=[],this.axisMap=$l(),this.categoryAxisMap=$l(),this.coordSysName=e}return e}();function jR(e){var t=e.get(`coordinateSystem`),n=new AR(t),r=MR[t];if(r)return r(e,n,n.axisMap,n.categoryAxisMap),n}var MR={cartesian2d:function(e,t,n,r){var i=e.getReferringComponents(`xAxis`,kd).models[0],a=e.getReferringComponents(`yAxis`,kd).models[0];t.coordSysDims=[`x`,`y`],n.set(`x`,i),n.set(`y`,a),NR(i)&&(r.set(`x`,i),t.firstCategoryDimIndex=0),NR(a)&&(r.set(`y`,a),t.firstCategoryDimIndex??=1)},singleAxis:function(e,t,n,r){var i=e.getReferringComponents(`singleAxis`,kd).models[0];t.coordSysDims=[`single`],n.set(`single`,i),NR(i)&&(r.set(`single`,i),t.firstCategoryDimIndex=0)},polar:function(e,t,n,r){var i=e.getReferringComponents(`polar`,kd).models[0],a=i.findAxisModel(`radiusAxis`),o=i.findAxisModel(`angleAxis`);t.coordSysDims=[`radius`,`angle`],n.set(`radius`,a),n.set(`angle`,o),NR(a)&&(r.set(`radius`,a),t.firstCategoryDimIndex=0),NR(o)&&(r.set(`angle`,o),t.firstCategoryDimIndex??=1)},geo:function(e,t,n,r){t.coordSysDims=[`lng`,`lat`]},parallel:function(e,t,n,r){var i=e.ecModel,a=i.getComponent(`parallel`,e.get(`parallelIndex`)),o=t.coordSysDims=a.dimensions.slice();G(a.parallelAxisIndex,function(e,a){var s=i.getComponent(`parallelAxis`,e),c=o[a];n.set(c,s),NR(s)&&(r.set(c,s),t.firstCategoryDimIndex??=a)})},matrix:function(e,t,n,r){var i=e.getReferringComponents(`matrix`,kd).models[0];t.coordSysDims=[`x`,`y`];var a=i.getDimensionModel(`x`),o=i.getDimensionModel(`y`);n.set(`x`,a),n.set(`y`,o),r.set(`x`,a),r.set(`y`,o)}};function NR(e){return e.get(`type`)===`category`}function PR(e,t){var n=e.get(`coordinateSystem`),r=tw.get(n),i;return t&&t.coordSysDims&&(i=K(t.coordSysDims,function(e){var n={name:e},r=t.axisMap.get(e);return r&&(n.type=lR(r.get(`type`))),n})),i||=r&&(r.getDimensionsInfo?r.getDimensionsInfo():r.dimensions.slice())||[`x`,`y`],i}function FR(e,t,n){var r,i;return n&&G(e,function(e,a){var o=e.coordDim,s=n.categoryAxisMap.get(o);s&&(r??=a,e.ordinalMeta=s.getOrdinalMeta(),t&&(e.createInvertedIndices=!0)),e.otherDims.itemName!=null&&(i=!0)}),!i&&r!=null&&(e[r].otherDims.itemName=0),r}function IR(e,t,n){n||={};var r=t.getSourceManager(),i,a=!1;e?(a=!0,i=Hw(e)):(i=r.getSource(),a=i.sourceFormat===sv);var o=jR(t),s=PR(t,o),c=n.useEncodeDefaulter,l=Al(c)?c:c?kl(Pw,s,t):null,u={coordDimensions:s,generateCoord:n.generateCoord,encodeDefine:t.getEncode(),encodeDefaulter:l,canOmitUnusedDimensions:!a},d=DR(i,u),f=FR(d.dimensions,n.createInvertedIndices,o),p=a?null:r.getSharedDataStore(d),m=VO(t,{schema:d,store:p}),h=new ER(d,t);h.setCalculationInfo(m);var g=f!=null&&LR(i)?function(e,t,n,r){return r===f?n:this.defaultDimValueGetter(e,t,n,r)}:null;return h.hasItemOption=!1,h.initData(a?i:p,null,g),h}function LR(e){if(e.sourceFormat===`original`)return!J(od(RR(e.data||[])))}function RR(e){for(var t=0;tthis.getProgressiveThreshold()?this.id:``},t.type=`series.scatter`,t.dependencies=[`grid`,`polar`,`geo`,`singleAxis`,`calendar`,`matrix`],t.defaultOption={coordinateSystem:`cartesian2d`,z:2,legendHoverLink:!0,symbolSize:10,large:!1,largeThreshold:2e3,itemStyle:{opacity:.8},emphasis:{scale:!0},clip:!0,select:{itemStyle:{borderColor:Q.color.primary}},universalTransition:{divideShape:`clone`}},t}(wE);function BR(e,t){var n=e.mapDimensionsAll(`defaultedLabel`),r=n.length;if(r===1){var i=mT(e,t,n[0]);return i==null?null:i+``}if(r){for(var a=[],o=0;o=0&&r.push(t[a])}return r.join(` `)}var HR=function(e){U(t,e);function t(t,n,r,i){var a=e.call(this)||this;return a.updateData(t,n,r,i),a}return t.prototype._createSymbol=function(e,t,n,r,i,a){this.removeAll();var o=TA(e,-1,-1,2,2,null,a);o.attr({z2:X(i,100),culling:!0,scaleX:r[0]/2,scaleY:r[1]/2}),o.drift=UR,this._symbolType=e,this.add(o)},t.prototype.stopSymbolAnimation=function(e){this.childAt(0).stopAnimation(null,e)},t.prototype.getSymbolType=function(){return this._symbolType},t.prototype.getSymbolPath=function(){return this.childAt(0)},t.prototype.highlight=function(){Jv(this.childAt(0))},t.prototype.downplay=function(){Yv(this.childAt(0))},t.prototype.setZ=function(e,t){var n=this.childAt(0);n.zlevel=e,n.z=t},t.prototype.setDraggable=function(e,t){var n=this.childAt(0);n.draggable=e,n.cursor=!t&&e?`move`:n.cursor},t.prototype.updateData=function(e,n,r,i){this.silent=!1;var a=e.getItemVisual(n,`symbol`)||`circle`,o=e.hostModel,s=t.getSymbolSize(e,n),c=t.getSymbolZ2(e,n),l=a!==this._symbolType,u=i&&i.disableAnimation;if(l){var d=e.getItemVisual(n,`symbolKeepAspect`);this._createSymbol(a,e,n,s,c,d)}else{var f=this.childAt(0);f.silent=!1;var p={scaleX:s[0]/2,scaleY:s[1]/2};u?f.attr(p):Yb(f,p,o,n),tx(f)}if(this._updateCommon(e,n,s,r,i),l){var f=this.childAt(0);if(!u){var p={scaleX:this._sizeX,scaleY:this._sizeY,style:{opacity:f.style.opacity}};f.scaleX=f.scaleY=0,f.style.opacity=0,Xb(f,p,o,n)}}u&&this.childAt(0).stopAnimation(`leave`)},t.prototype._updateCommon=function(e,t,n,r,i){var a=this.childAt(0),o=e.hostModel,s,c,l,u,d,f,p,m,h;if(r&&(s=r.emphasisItemStyle,c=r.blurItemStyle,l=r.selectItemStyle,u=r.focus,d=r.blurScope,p=r.labelStatesModels,m=r.hoverScale,h=r.cursorStyle,f=r.emphasisDisabled),!r||e.hasItemOption){var g=r&&r.itemModel?r.itemModel:e.getItemModel(t),_=g.getModel(`emphasis`);s=_.getModel(`itemStyle`).getItemStyle(),l=g.getModel([`select`,`itemStyle`]).getItemStyle(),c=g.getModel([`blur`,`itemStyle`]).getItemStyle(),u=_.get(`focus`),d=_.get(`blurScope`),f=_.get(`disabled`),p=tS(g),m=_.getShallow(`scale`),h=g.getShallow(`cursor`)}var v=e.getItemVisual(t,`symbolRotate`);a.attr(`rotation`,(v||0)*Math.PI/180||0);var y=DA(e.getItemVisual(t,`symbolOffset`),n);y&&(a.x=y[0],a.y=y[1]),h&&a.attr(`cursor`,h);var b=e.getItemVisual(t,`style`),x=b.fill;if(a instanceof j_){var S=a.style;a.useStyle(W({image:S.image,x:S.x,y:S.y,width:S.width,height:S.height},b))}else a.__isEmptyBrush?a.useStyle(W({},b)):a.useStyle(b),a.style.decal=null,a.setColor(x,i&&i.symbolInnerColor),a.style.strokeNoScale=!0;var C=e.getItemVisual(t,`liftZ`),w=this._z2;C==null?w!=null&&(a.z2=w,this._z2=null):w??(this._z2=a.z2,a.z2+=C);var T=i&&i.useNameLabel;eS(a,p,{labelFetcher:o,labelDataIndex:t,defaultText:E,inheritColor:x,defaultOpacity:b.opacity});function E(t){return T?e.getName(t):BR(e,t)}this._sizeX=n[0]/2,this._sizeY=n[1]/2;var D=a.ensureState(`emphasis`);D.style=s,a.ensureState(`select`).style=l,a.ensureState(`blur`).style=c;var O=m==null||m===!0?Math.max(1.1,3/this._sizeY):isFinite(m)&&m>0?+m:1;D.scaleX=this._sizeX*O,D.scaleY=this._sizeY*O,this.setSymbolScale(1),py(this,u,d,f)},t.prototype.setSymbolScale=function(e){this.scaleX=this.scaleY=e},t.prototype.fadeOut=function(e,t,n){var r=this.childAt(0),i=iv(this).dataIndex,a=n&&n.animation;if(this.silent=r.silent=!0,n&&n.fadeLabel){var o=r.getTextContent();o&&Qb(o,{style:{opacity:0}},t,{dataIndex:i,removeOpt:a,cb:function(){r.removeTextContent()}})}else r.removeTextContent();Qb(r,{style:{opacity:0},scaleX:0,scaleY:0},t,{dataIndex:i,cb:e,removeOpt:a})},t.getSymbolSize=function(e,t){return EA(e.getItemVisual(t,`symbolSize`))},t.getSymbolZ2=function(e,t){return e.getItemVisual(t,`z2`)},t}(Ky);function UR(e,t){this.parent.drift(e,t)}function WR(e,t,n,r){return t&&!isNaN(t[0])&&!isNaN(t[1])&&!(r&&r.isIgnore&&r.isIgnore(n))&&!(r&&r.clipShape&&!r.clipShape.contain(t[0],t[1]))&&e.getItemVisual(n,`symbol`)!==`none`}function GR(e){return e!=null&&!Nl(e)&&(e={isIgnore:e}),e||{}}function KR(e){var t=e.hostModel,n=t.getModel(`emphasis`);return{emphasisItemStyle:n.getModel(`itemStyle`).getItemStyle(),blurItemStyle:t.getModel([`blur`,`itemStyle`]).getItemStyle(),selectItemStyle:t.getModel([`select`,`itemStyle`]).getItemStyle(),focus:n.get(`focus`),blurScope:n.get(`blurScope`),emphasisDisabled:n.get(`disabled`),hoverScale:n.get(`scale`),labelStatesModels:tS(t),cursorStyle:t.get(`cursor`)}}function qR(e,t,n,r,i,a,o){var s=new e(t,n,r,i);return s.setPosition(a),t.setItemGraphicEl(n,s),o.add(s),s}var JR=function(){function e(e){this.group=new Ky,this._SymbolCtor=e||HR}return e.prototype.updateData=function(e,t){this._progressiveEls=null,t=GR(t);var n=this.group,r=e.hostModel,i=this._data,a=this._SymbolCtor,o=t.disableAnimation,s=this._seriesScope=KR(e),c={disableAnimation:o},l=t.getSymbolPoint||function(t){return e.getItemLayout(t)};i||n.removeAll(),e.diff(i).add(function(r){var i=l(r);WR(e,i,r,t)&&qR(a,e,r,s,c,i,n)}).update(function(u,d){var f=i.getItemGraphicEl(d),p=l(u);if(!WR(e,p,u,t)){n.remove(f);return}var m=e.getItemVisual(u,`symbol`)||`circle`,h=f&&f.getSymbolType&&f.getSymbolType();if(!f||h&&h!==m)n.remove(f),f=new a(e,u,s,c),f.setPosition(p);else{f.updateData(e,u,s,c);var g={x:p[0],y:p[1]};o?f.attr(g):Yb(f,g,r)}n.add(f),e.setItemGraphicEl(u,f)}).remove(function(e){var t=i.getItemGraphicEl(e);t&&t.fadeOut(function(){n.remove(t)},r)}).execute(),this._getSymbolPoint=l,this._data=e},e.prototype.updateLayout=function(e){var t=this._data;if(t)for(var n=this,r=t.getStore(),i=0,a=r.count();i=0;s--){var c=s*2,l=r[c]-a/2,u=r[c+1]-o/2;if(e>=l&&t>=u&&e<=l+a&&t<=u+o)return s}return-1},t.prototype.contain=function(e,t){var n=this.transformCoordToLocal(e,t),r=this.getBoundingRect();return e=n[0],t=n[1],r.contain(e,t)?(this.hoverDataIdx=this.findDataIndex(e,t))>=0:(this.hoverDataIdx=-1,!1)},t.prototype.getBoundingRect=function(){var e=this._rect;if(!e){for(var t=this.shape,n=t.points,r=t.size,i=r[0],a=r[1],o=1/0,s=1/0,c=-1/0,l=-1/0,u=0;u=0&&(c.dataIndex=n+(e.startIndex||0))})},e.prototype.remove=function(){this._clear()},e.prototype._clear=function(){this._newAdded=[],this.group.removeAll()},e}(),$R=typeof Float32Array<`u`?Float32Array:void 0,ez=typeof Float64Array<`u`?Float64Array:void 0;function tz(e){return nz({ctor:$R},e).arr}function nz(e,t){var n=e.arr,r=e.ctor;if(t>Nu&&(t=Nu),!n||e.typed&&n.length=0||e===t}function wz(e){var t=Tz(e);if(t){var n=t.axisPointerModel,r=t.axis.scale,i=n.option,a=n.get(`status`),o=n.get(`value`);o!=null&&(o=r.parse(o));var s=Dz(n);a??(i.status=s?`show`:`hide`);var c=r.getExtent();(o==null||o>c[1])&&(o=c[1]),o-1&&(s.style.stroke=s.style.fill,s.style.fill=Q.color.neutral00,s.style.lineWidth=2),t},t.type=`series.line`,t.dependencies=[`grid`,`polar`],t.defaultOption={z:3,coordinateSystem:`cartesian2d`,legendHoverLink:!0,clip:!0,label:{position:`top`},endLabel:{show:!1,valueAnimation:!0,distance:8},lineStyle:{width:2,type:`solid`},emphasis:{scale:!0},step:!1,smooth:!1,smoothMonotone:null,symbol:`emptyCircle`,symbolSize:6,symbolRotate:null,showSymbol:!0,showAllSymbol:`auto`,connectNulls:!1,sampling:`none`,animationEasing:`linear`,progressive:0,hoverLayerThreshold:1/0,universalTransition:{divideShape:`clone`},triggerLineEvent:!1,triggerEvent:!1},t}(wE);function Wz(e,t,n){var r=e.getBaseAxis(),i=e.getOtherAxis(r),a=Gz(i,n),o=r.dim,s=i.dim,c=t.mapDimension(s),l=t.mapDimension(o),u=+(s===`x`||s===`radius`),d=K(e.dimensions,function(e){return t.mapDimension(e)}),f=!1,p=t.getCalculationInfo(`stackResultDimension`);return UO(t,d[0])&&(f=!0,d[0]=p),UO(t,d[1])&&(f=!0,d[1]=p),{dataDimsForPoint:d,valueStart:a,valueAxisDim:s,baseAxisDim:o,stacked:!!f,valueDim:c,baseDim:l,baseDataOffset:u,stackedOverDimension:t.getCalculationInfo(`stackedOverDimension`)}}function Gz(e,t){var n=0,r=e.scale.getExtent();return t===`start`?n=r[0]:t===`end`?n=r[1]:Ml(t)&&!isNaN(t)?n=t:r[0]>0?n=r[0]:r[1]<0&&(n=r[1]),n}function Kz(e,t,n,r){var i=NaN;e.stacked&&(i=n.get(n.getCalculationInfo(`stackedOverDimension`),r)),isNaN(i)&&(i=e.valueStart);var a=e.baseDataOffset,o=[];return o[a]=n.get(e.baseDim,r),o[1-a]=i,t.dataToPoint(o)}function qz(e,t){return!isFinite(e)||!isFinite(t)}function Jz(e,t){var n=[];return t.diff(e).add(function(e){n.push({cmd:`+`,idx:e})}).update(function(e,t){n.push({cmd:`=`,idx:t,idx1:e})}).remove(function(e){n.push({cmd:`-`,idx:e})}).execute(),n}function Yz(e,t,n,r,i,a,o,s){for(var c=Jz(e,t),l=[],u=[],d=[],f=[],p=[],m=[],h=[],g=Wz(i,t,o),_=e.getLayout(`points`)||[],v=t.getLayout(`points`)||[],y=0;y=i||h<0)break;if(qz(_,v)){if(c){h+=a;continue}break}if(h===n)e[a>0?`moveTo`:`lineTo`](_,v),d=_,f=v;else{var y=_-l,b=v-u;if(y*y+b*b<.5){h+=a;continue}if(o>0){for(var x=h+a,S=t[x*2],C=t[x*2+1];S===_&&C===v&&g=r||qz(S,C))p=_,m=v;else{E=S-l,D=C-u;var A=_-l,j=S-_,M=v-u,N=C-v,P=void 0,F=void 0;if(s===`x`){P=Math.abs(A),F=Math.abs(j);var I=E>0?1:-1;p=_-I*P*o,m=v,O=_+I*F*o,k=v}else if(s===`y`){P=Math.abs(M),F=Math.abs(N);var L=D>0?1:-1;p=_,m=v-L*P*o,O=_,k=v+L*F*o}else P=Math.sqrt(A*A+M*M),F=Math.sqrt(j*j+N*N),T=F/(F+P),p=_-E*o*(1-T),m=v-D*o*(1-T),O=_+E*o*T,k=v+D*o*T,O=Xz(O,Zz(S,_)),k=Xz(k,Zz(C,v)),O=Zz(O,Xz(S,_)),k=Zz(k,Xz(C,v)),E=O-_,D=k-v,p=_-E*P/F,m=v-D*P/F,p=Xz(p,Zz(l,_)),m=Xz(m,Zz(u,v)),p=Zz(p,Xz(l,_)),m=Zz(m,Xz(u,v)),E=_-p,D=v-m,O=_+E*F/P,k=v+D*F/P}e.bezierCurveTo(d,f,p,m,_,v),d=O,f=k}else e.lineTo(_,v)}l=_,u=v,h+=a}return g}var $z=function(){function e(){this.smooth=0,this.smoothConstraint=!0}return e}(),eB=function(e){U(t,e);function t(t){var n=e.call(this,t)||this;return n.type=`ec-polyline`,n}return t.prototype.getDefaultStyle=function(){return{stroke:Q.color.neutral99,fill:null}},t.prototype.getDefaultShape=function(){return new $z},t.prototype.buildPath=function(e,t){var n=t.points,r=0,i=n.length/2;if(t.connectNulls){for(;i>0&&qz(n[i*2-2],n[i*2-1]);i--);for(;r=0){var _=o?(d-a)*g+a:(u-i)*g+i;return o?[e,_]:[_,e]}i=u,a=d;break;case r.C:u=n[c++],d=n[c++],f=n[c++],p=n[c++],m=n[c++],h=n[c++];var v=o?Mm(i,u,f,m,e,s):Mm(a,d,p,h,e,s);if(v>0)for(var y=0;y=0){var _=o?Am(a,d,p,h,b):Am(i,u,f,m,b);return o?[e,_]:[_,e]}}i=m,a=h}}},t}(T_),tB=function(e){U(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}return t}($z),nB=function(e){U(t,e);function t(t){var n=e.call(this,t)||this;return n.type=`ec-polygon`,n}return t.prototype.getDefaultShape=function(){return new tB},t.prototype.buildPath=function(e,t){var n=t.points,r=t.stackedOnPoints,i=0,a=n.length/2,o=t.smoothMonotone;if(t.connectNulls){for(;a>0&&qz(n[a*2-2],n[a*2-1]);a--);for(;i=0,a=e.fill||Q.color.neutral99;lB(r,t);var o=r.textFill==null;return i?o&&(r.textFill=n.insideFill||Q.color.neutral00,!r.textStroke&&n.insideStroke&&(r.textStroke=n.insideStroke),!r.textStroke&&(r.textStroke=a),r.textStrokeWidth??=2):(o&&(r.textFill=e.fill||n.outsideFill||Q.color.neutral00),!r.textStroke&&n.outsideStroke&&(r.textStroke=n.outsideStroke)),r.text=t.text,r.rich=t.rich,G(t.rich,function(e){lB(e,e)}),r}function lB(e,t){t&&(Z(t,`fill`)&&(e.textFill=t.fill),Z(t,`stroke`)&&(e.textStroke=t.fill),Z(t,`lineWidth`)&&(e.textStrokeWidth=t.lineWidth),Z(t,`font`)&&(e.font=t.font),Z(t,`fontStyle`)&&(e.fontStyle=t.fontStyle),Z(t,`fontWeight`)&&(e.fontWeight=t.fontWeight),Z(t,`fontSize`)&&(e.fontSize=t.fontSize),Z(t,`fontFamily`)&&(e.fontFamily=t.fontFamily),Z(t,`align`)&&(e.textAlign=t.align),Z(t,`verticalAlign`)&&(e.textVerticalAlign=t.verticalAlign),Z(t,`lineHeight`)&&(e.textLineHeight=t.lineHeight),Z(t,`width`)&&(e.textWidth=t.width),Z(t,`height`)&&(e.textHeight=t.height),Z(t,`backgroundColor`)&&(e.textBackgroundColor=t.backgroundColor),Z(t,`padding`)&&(e.textPadding=t.padding),Z(t,`borderColor`)&&(e.textBorderColor=t.borderColor),Z(t,`borderWidth`)&&(e.textBorderWidth=t.borderWidth),Z(t,`borderRadius`)&&(e.textBorderRadius=t.borderRadius),Z(t,`shadowColor`)&&(e.textBoxShadowColor=t.shadowColor),Z(t,`shadowBlur`)&&(e.textBoxShadowBlur=t.shadowBlur),Z(t,`shadowOffsetX`)&&(e.textBoxShadowOffsetX=t.shadowOffsetX),Z(t,`shadowOffsetY`)&&(e.textBoxShadowOffsetY=t.shadowOffsetY),Z(t,`textShadowColor`)&&(e.textShadowColor=t.textShadowColor),Z(t,`textShadowBlur`)&&(e.textShadowBlur=t.textShadowBlur),Z(t,`textShadowOffsetX`)&&(e.textShadowOffsetX=t.textShadowOffsetX),Z(t,`textShadowOffsetY`)&&(e.textShadowOffsetY=t.textShadowOffsetY))}function uB(e,t){if(e.length===t.length){for(var n=0;nt){a?n.push(o(a,c,t)):i&&n.push(o(i,c,0),o(i,c,t));break}else i&&=(n.push(o(i,c,0)),null),n.push(c),a=c}return n}function _B(e,t,n){var r=e.getVisual(`visualMeta`);if(r&&r.length&&e.count()&&t.type===`cartesian2d`){for(var i,a,o=r.length-1;o>=0;o--){var s=e.getDimensionInfo(r[o].dimension);if(i=s&&s.coordDim,i===`x`||i===`y`){a=r[o];break}}if(a){var c=t.getAxis(i),l=K(a.stops,function(e){return{coord:c.toGlobalCoord(c.dataToCoord(e.value)),color:e.color}}),u=l.length,d=a.outerColors.slice();u&&l[0].coord>l[u-1].coord&&(l.reverse(),d.reverse());var f=gB(l,i===`x`?n.getWidth():n.getHeight()),p=f.length;if(!p&&u)return l[0].coord<0?d[1]?d[1]:l[u-1].color:d[0]?d[0]:l[0].color;var m=10,h=f[0].coord-m,g=f[p-1].coord+m,_=g-h;if(_<.001)return`transparent`;G(f,function(e){e.offset=(e.coord-h)/_}),f.push({offset:p?f[p-1].offset:.5,color:d[1]||`transparent`}),f.unshift({offset:p?f[0].offset:.5,color:d[0]||`transparent`});var v=new Nb(0,0,0,0,f,!0);return v[i]=h,v[i+`2`]=g,v}}}function vB(e,t,n){var r=e.get(`showAllSymbol`),i=r===`auto`;if(!r||i){var a=n.getAxesByScale(`ordinal`)[0];if(a&&!(i&&yB(a,t))){var o=t.mapDimension(a.dim),s={};return G(a.getViewLabels(),function(e){e.tick.offInterval||(s[sk(a.scale,e.tick)]=1)}),function(e){return!s.hasOwnProperty(t.get(o,e))}}}}function yB(e,t){var n=e.getExtent(),r=Math.abs(n[1]-n[0])/e.scale.count();isNaN(r)&&(r=0);for(var i=t.count(),a=Math.max(1,Math.round(i/5)),o=0;or)return!1;return!0}function bB(e){for(var t=e.length/2;t>0&&qz(e[t*2-2],e[t*2-1]);t--);return t-1}function xB(e,t){return[e[t*2],e[t*2+1]]}function SB(e,t,n){for(var r=e.length/2,i=n===`x`?0:1,a,o,s=0,c=-1,l=0;l=t||a>=t&&o<=t){c=l;break}s=l,a=o}return{range:[s,c],t:(t-a)/(o-a)}}function CB(e){if(e.get([`endLabel`,`show`]))return!0;for(var t=0;t0&&e.get([`emphasis`,`lineStyle`,`width`])===`bolder`){var M=f.getState(`emphasis`).style;M.lineWidth=+f.style.lineWidth+1}iv(f).seriesIndex=e.seriesIndex,py(f,k,A,j);var N=pB(e.get(`smooth`)),P=e.get(`smoothMonotone`);if(f.setShape({smooth:N,smoothMonotone:P,connectNulls:x}),p){var F=a.getCalculationInfo(`stackedOnSeries`),I=0;p.useStyle(yl(s.getAreaStyle(),{fill:E,opacity:.7,lineJoin:`bevel`,decal:a.getVisual(`style`).decal})),F&&(I=pB(F.get(`smooth`))),p.setShape({smooth:N,stackedOnSmooth:I,smoothMonotone:P,connectNulls:x}),_y(p,e,`areaStyle`),iv(p).seriesIndex=e.seriesIndex,py(p,k,A,j)}var L=this._changePolyState;a.eachItemGraphicEl(function(e){e&&(e.onHoverStateChange=L)}),this._polyline.onHoverStateChange=L,this._data=a,this._coordSys=r,this._stackedOnPoints=y,this._points=c,this._step=w,this._valueOrigin=_;var ee=e.get(`triggerEvent`),R=e.get(`triggerLineEvent`),te=R===!0||ee===!0||ee===`line`,ne=R===!0||ee===!0||ee===`area`;this.packEventData(e,f,te),p&&this.packEventData(e,p,ne)},t.prototype.packEventData=function(e,t,n){iv(t).eventData=n?{componentType:`series`,componentSubType:`line`,componentIndex:e.componentIndex,seriesIndex:e.seriesIndex,seriesName:e.name,seriesType:`line`,selfType:t===this._polygon?`area`:`line`}:null},t.prototype.highlight=function(e,t,n,r){var i=e.getData(),a=wd(i,r);if(this._changePolyState(`emphasis`),!(a instanceof Array)&&a!=null&&a>=0){var o=i.getLayout(`points`),s=i.getItemGraphicEl(a);if(!s){var c=o[a*2],l=o[a*2+1];if(qz(c,l)||this._clipShapeForSymbol&&!this._clipShapeForSymbol.contain(c,l))return;var u=e.get(`zlevel`)||0,d=e.get(`z`)||0;s=new HR(i,a),s.x=c,s.y=l,s.setZ(u,d);var f=s.getSymbolPath().getTextContent();f&&(f.zlevel=u,f.z=d,f.z2=this._polyline.z2+1),s.__temp=!0,i.setItemGraphicEl(a,s),s.stopSymbolAnimation(!0),this.group.add(s)}s.highlight()}else xP.prototype.highlight.call(this,e,t,n,r)},t.prototype.downplay=function(e,t,n,r){var i=e.getData(),a=wd(i,r);if(this._changePolyState(`normal`),a!=null&&a>=0){var o=i.getItemGraphicEl(a);o&&(o.__temp?(i.setItemGraphicEl(a,null),this.group.remove(o)):o.downplay())}else xP.prototype.downplay.call(this,e,t,n,r)},t.prototype._changePolyState=function(e){var t=this._polygon;zv(this._polyline,e),t&&zv(t,e)},t.prototype._newPolyline=function(e){var t=this._polyline;return t&&this._lineGroup.remove(t),t=new eB({shape:{points:e},segmentIgnoreThreshold:2,z2:10}),this._lineGroup.add(t),this._polyline=t,t},t.prototype._newPolygon=function(e,t){var n=this._polygon;return n&&this._lineGroup.remove(n),n=new nB({shape:{points:e,stackedOnPoints:t},segmentIgnoreThreshold:2}),this._lineGroup.add(n),this._polygon=n,n},t.prototype._initSymbolLabelAnimation=function(e,t,n){var r,i,a=t.getBaseAxis(),o=a.inverse;t.type===`cartesian2d`?(r=a.isHorizontal(),i=!1):t.type===`polar`&&(r=a.dim===`angle`,i=!0);var s=e.hostModel,c=s.get(`animationDuration`);Al(c)&&(c=c(null));var l=s.get(`animationDelay`)||0,u=Al(l)?l(null):l;e.eachItemGraphicEl(function(e,a){var s=e;if(s){var d=[e.x,e.y],f=void 0,p=void 0,m=void 0;if(n){if(i){var h=n,g=t.pointToCoord(d);r?(f=h.startAngle,p=h.endAngle,m=-g[1]/180*Math.PI):(f=h.r0,p=h.r,m=g[0])}else{var _=n;r?(f=_.x,p=_.x+_.width,m=e.x):(f=_.y+_.height,p=_.y,m=e.y)}}var v=p===f?0:(m-f)/(p-f);o&&(v=1-v);var y=Al(l)?l(a):c*v+u,b=s.getSymbolPath(),x=b.getTextContent();s.attr({scaleX:0,scaleY:0}),s.animateTo({scaleX:1,scaleY:1},{duration:200,setToFinal:!0,delay:y}),x&&x.animateFrom({style:{opacity:0}},{duration:300,delay:y}),b.disableLabelAnimation=!0}})},t.prototype._initOrUpdateEndLabel=function(e,t,n){var r=e.getModel(`endLabel`);if(CB(e)){var i=e.getData(),a=this._polyline,o=i.getLayout(`points`);if(!o){a.removeTextContent(),this._endLabel=null;return}var s=this._endLabel;s||(s=this._endLabel=new W_({z2:200}),s.ignoreClip=!0,a.setTextContent(this._endLabel),a.disableLabelAnimation=!0);var c=bB(o);c>=0&&(eS(a,tS(e,`endLabel`),{inheritColor:n,labelFetcher:e,labelDataIndex:c,defaultText:function(e,t,n){return n==null?BR(i,e):VR(i,n)},enableTextSetter:!0},TB(r,t)),a.textConfig.position=null)}else this._endLabel&&=(this._polyline.removeTextContent(),null)},t.prototype._endLabelOnDuring=function(e,t,n,r,i,a,o){var s=this._endLabel,c=this._polyline;if(s){e<1&&r.originalX==null&&(r.originalX=s.x,r.originalY=s.y);var l=n.getLayout(`points`),u=n.hostModel,d=u.get(`connectNulls`),f=a.get(`precision`),p=a.get(`distance`)||0,m=o.getBaseAxis(),h=m.isHorizontal(),g=m.inverse,_=t.shape,v=g?h?_.x:_.y+_.height:h?_.x+_.width:_.y,y=(h?p:0)*(g?-1:1),b=(h?0:-p)*(g?-1:1),x=h?`x`:`y`,S=SB(l,v,x),C=S.range,w=C[1]-C[0],T=void 0;if(w>=1){if(w>1&&!d){var E=xB(l,C[0]);s.attr({x:E[0]+y,y:E[1]+b}),i&&(T=u.getRawValue(C[0]))}else{var E=c.getPointOn(v,x);E&&s.attr({x:E[0]+y,y:E[1]+b});var D=u.getRawValue(C[0]),O=u.getRawValue(C[1]);i&&(T=Id(n,f,D,O,S.t))}r.lastFrameIndex=C[0]}else{var k=e===1||r.lastFrameIndex>0?C[0]:0,E=xB(l,k);i&&(T=u.getRawValue(k)),s.attr({x:E[0]+y,y:E[1]+b})}if(i){var A=dS(s);typeof A.setLabelText==`function`&&A.setLabelText(T)}}},t.prototype._doUpdateAnimation=function(e,t,n,r,i,a,o){var s=this._polyline,c=this._polygon,l=e.hostModel,u=Yz(this._data,e,this._stackedOnPoints,t,this._coordSys,n,this._valueOrigin,a),d=u.current,f=u.stackedOnCurrent,p=u.next,m=u.stackedOnNext;if(i&&(f=hB(u.stackedOnCurrent,u.current,n,i,o),d=hB(u.current,null,n,i,o),m=hB(u.stackedOnNext,u.next,n,i,o),p=hB(u.next,null,n,i,o)),fB(d,p)>3e3||c&&fB(f,m)>3e3){s.stopAnimation(),s.setShape({points:p}),c&&(c.stopAnimation(),c.setShape({points:p,stackedOnPoints:m}));return}s.shape.__points=u.current,s.shape.points=d;var h={shape:{points:p}};u.current!==d&&(h.shape.__points=u.next),s.stopAnimation(),Yb(s,h,l),c&&(c.setShape({points:d,stackedOnPoints:f}),c.stopAnimation(),Yb(c,{shape:{stackedOnPoints:m}},l),s.shape.points!==c.shape.points&&(c.shape.points=s.shape.points));for(var g=[],_=u.status,v=0;v<_.length;v++)if(_[v].cmd===`=`){var y=e.getItemGraphicEl(_[v].idx1);y&&g.push({el:y,ptIdx:v})}s.animators&&s.animators.length&&s.animators[0].during(function(){c&&c.dirtyShape();for(var e=s.shape.__points,t=0;tt&&(t=e[n]);return isFinite(t)?t:NaN},min:function(e){for(var t=1/0,n=0;n10&&a.type===`cartesian2d`&&i){var s=a.getBaseAxis(),c=a.getOtherAxis(s),l=s.getExtent(),u=n.getDevicePixelRatio(),d=Math.abs(l[1]-l[0])*(u||1),f=Math.round(o/d);if(isFinite(f)&&f>1){i===`lttb`?e.setData(r.lttbDownSample(r.mapDimension(c.dim),1/f)):i===`minmax`&&e.setData(r.minmaxDownSample(r.mapDimension(c.dim),1/f));var p=void 0;Y(i)?p=DB[i]:Al(i)&&(p=i),p&&e.setData(r.downSample(r.mapDimension(c.dim),1/f,p,OB))}}}}}function AB(e){e.registerChartView(EB),e.registerSeriesModel(Uz),e.registerLayout(rz(`line`,!0)),e.registerVisual({seriesType:`line`,reset:function(e){var t=e.getData(),n=e.getModel(`lineStyle`).getLineStyle();n&&!n.stroke&&(n.stroke=t.getVisual(`style`).fill),t.setVisual(`legendLineStyle`,n)}}),e.registerProcessor(e.PRIORITY.PROCESSOR.STATISTIC,kB(`line`))}function jB(){iA(`liPosMinGap`,MB)}function MB(e,t,n){var r=$l(),i=n.serUids,a=n.liPosMinGap,o,s=t.axis,c=s.scale,l=c.needTransform(),u=c.getFilter?c.getFilter():null,d=wT(u);function f(n){eA(e,t.sers,function(e){var t=e.getRawData(),r=t.getDimensionIndex(t.mapDimension(s.dim));r>=0&&n(r,e,t.getStore())})}var p=0;if(f(function(e,t,n){r.set(t.uid,1),(!i||!i.hasKey(t.uid))&&(o=!0),p+=n.count()}),(!i||i.keys().length!==r.keys().length)&&(o=!0),!o&&a!=null){t.liPosMinGap=a;return}nz(NB,p);var m=0;f(function(e,t,n){for(var r=0,i=n.count();r0&&v0?-2:-1,n.serUids=r}var NB=nz({ctor:ez},50);function PB(e){return function(t,n){var r=dA(t,{fromStat:{key:e}});if(qu(r.w2))return[-r.w2/2,r.w2/2]}}function FB(e,t){return e+`|&`+t}function IB(e){return jB(),{liPosMinGap:!tO(e.scale)}}function LB(e,t,n,r){cA(e,{key:t,seriesType:n,coordSysType:r,getMetrics:IB})}function RB(e){return e.scale.rawExtentInfo.makeRenderInfo().startValue}var zB=Kd(),BB=`__ec_stack_`;function VB(e){return e.get(`stack`)||BB+e.seriesIndex}function HB(e){if(tO(e.axis.scale)){for(var t=dA(e.axis),n=[],r=0;ro&&(o=a),o!==u&&(t.width=o,n-=o+l*o,r--)}}),u=(n-c)/(r+(r-1)*l),u=fu(u,0);var d=0,f;G(o,function(e){var t=s[e];t.width||=u,f=t,d+=t.width*(1+l)}),f&&(d-=f.width*l);var p={},m=-d/2;return G(o,function(e){var n=s[e];p[e]=p[e]||{bandWidth:t,offset:m,width:n.width},m+=n.width*(1+l)}),p}function KB(e){return{seriesType:e,overallReset:function(t){var n=FB(e,fk);tA(t,n,function(t){var r=UB(t,e);$k(t,n,function(e){var t=r.columnMap[VB(e)];e.getData().setLayout({bandWidth:t.bandWidth,offset:t.offset,size:t.width})})})}}}function qB(e){return{seriesType:e,plan:vP(),reset:function(e){if(cj(e)){var t=e.getData(),n=e.coordinateSystem,r=n.getBaseAxis(),i=n.getOtherAxis(r),a=t.getDimensionIndex(t.mapDimension(i.dim)),o=t.getDimensionIndex(t.mapDimension(r.dim)),s=e.get(`showBackground`,!0),c=t.mapDimension(i.dim),l=t.getCalculationInfo(`stackResultDimension`),u=UO(t,c)&&!!t.getCalculationInfo(`stackedOnSeries`),d=i.isHorizontal(),f=i.toGlobalCoord(i.dataToCoord(RB(i))),p=JB(e),m=e.get(`barMinHeight`)||0,h=l&&t.getDimensionIndex(l),g=t.getLayout(`size`),_=t.getLayout(`offset`);return{progress:function(e,t){for(var r=e.count,i=p&&tz(r*3),c=p&&s&&tz(r*3),l=p&&tz(r),v=n.master.getRect(),y=d?v.width:v.height,b,x=t.getStore(),S=0;(b=e.next())!=null;){var C=x.get(u?h:a,b),w=x.get(o,b),T=f,E=void 0;u&&(E=+C-x.get(a,b));var D=void 0,O=void 0,k=void 0,A=void 0;if(d){var j=n.dataToPoint([C,w]);u&&(T=n.dataToPoint([E,w])[0]),D=T,O=j[1]+_,k=j[0]-T,A=g,pu(k)s){u=(p+l)/2;break}f===1&&(d=m-r[0].tickValue)}u??(l?l&&(u=r[r.length-1].coord):u=r[0].coord),a[n]=e.toGlobalCoord(u)}});else{var o=this.getData(),s=o.getLayout(`offset`),c=o.getLayout(`size`),l=+!r.getBaseAxis().isHorizontal();a[l]+=s+c/2}return a}return[NaN,NaN]},t.prototype.__requireStartValue=function(e){return this.getBaseAxis()!==e},t.type=`series.__base_bar__`,t.defaultOption={z:2,coordinateSystem:`cartesian2d`,legendHoverLink:!0,barMinHeight:0,barMinAngle:0,large:!1,largeThreshold:400,progressive:3e3,progressiveChunkMode:`mod`,defaultBarGap:`10%`},t}(wE);wE.registerClass(ZB);var QB=function(e){U(t,e);function t(){var n=e!==null&&e.apply(this,arguments)||this;return n.type=t.type,n}return t.prototype.getInitialData=function(){return IR(null,this,{useEncodeDefaulter:!0,createInvertedIndices:!!this.get(`realtimeSort`,!0)||null})},t.prototype.getProgressive=function(){return this.get(`large`)?this.get(`progressive`):!1},t.prototype.__preparePipelineContext=function(e,t){var n=Qd(this,e,t);return n.progressiveRender&&(n.large=!0),n},t.prototype.brushSelector=function(e,t,n){return n.rect(t.getItemLayout(e))},t.type=`series.bar`,t.dependencies=[`grid`,`polar`],t.defaultOption=AS(ZB.defaultOption,{clip:!0,roundCap:!1,showBackground:!1,backgroundStyle:{color:`rgba(180, 180, 180, 0.2)`,borderColor:null,borderWidth:0,borderType:`solid`,borderRadius:0,shadowBlur:0,shadowColor:null,shadowOffsetX:0,shadowOffsetY:0,opacity:1},select:{itemStyle:{borderColor:Q.color.primary,borderWidth:2}},realtimeSort:!1}),t}(ZB),$B=function(){function e(){this.cx=0,this.cy=0,this.r0=0,this.r=0,this.startAngle=0,this.endAngle=Math.PI*2,this.clockwise=!0}return e}(),eV=function(e){U(t,e);function t(t){var n=e.call(this,t)||this;return n.type=`sausage`,n}return t.prototype.getDefaultShape=function(){return new $B},t.prototype.buildPath=function(e,t){var n=t.cx,r=t.cy,i=Math.max(t.r0||0,0),a=Math.max(t.r,0),o=(a-i)*.5,s=i+o,c=t.startAngle,l=t.endAngle,u=t.clockwise,d=Math.PI*2,f=u?l-cMath.PI/2&&ua)return!0;a=l}return!1},t.prototype._isOrderDifferentInView=function(e,t){for(var n=t.scale,r=n.getExtent(),i=Math.max(0,r[0]),a=Math.min(r[1],n.getOrdinalMeta().categories.length-1);i<=a;++i)if(e.ordinalNumbers[i]!==n.getRawOrdinalNumber(i))return!0},t.prototype._updateSortWithinSameData=function(e,t,n,r){if(this._isOrderChangedWithinSameData(e,t,n)){var i=this._dataSort(e,n,t);this._isOrderDifferentInView(i,n)&&(this._removeOnRenderedListener(r),r.dispatchAction({type:`changeAxisOrder`,componentType:n.dim+`Axis`,axisId:n.index,sortInfo:i}))}},t.prototype._dispatchInitSort=function(e,t,n){var r=t.baseAxis,i=this._dataSort(e,r,function(n){return e.get(e.mapDimension(t.otherAxis.dim),n)});n.dispatchAction({type:`changeAxisOrder`,componentType:r.dim+`Axis`,isInitSort:!0,axisId:r.index,sortInfo:i})},t.prototype.remove=function(e,t){this._clear(this._model),this._removeOnRenderedListener(t)},t.prototype.dispose=function(e,t){this._removeOnRenderedListener(t)},t.prototype._removeOnRenderedListener=function(e){this._onRendered&&=(e.getZr().off(`rendered`,this._onRendered),null)},t.prototype._clear=function(e){var t=this.group,n=this._data;e&&e.isAnimationEnabled()&&n&&!this._isLargeDraw?(this._removeBackground(),this._backgroundEls=[],n.eachItemGraphicEl(function(t){ex(t,e,iv(t).dataIndex)})):t.removeAll(),this._data=null,this._isFirstFrame=!0},t.prototype._removeBackground=function(){this.group.remove(this._backgroundGroup),this._backgroundGroup=null},t.type=`bar`,t}(xP),lV={cartesian2d:function(e,t){var n=t.width<0?-1:1,r=t.height<0?-1:1;n<0&&(t.x+=t.width,t.width=-t.width),r<0&&(t.y+=t.height,t.height=-t.height);var i=e.x+e.width,a=e.y+e.height,o=oV(t.x,e.x),s=sV(t.x+t.width,i),c=oV(t.y,e.y),l=sV(t.y+t.height,a),u=si?s:o,t.y=d&&c>a?l:c,t.width=u?0:s-o,t.height=d?0:l-c,n<0&&(t.x+=t.width,t.width=-t.width),r<0&&(t.y+=t.height,t.height=-t.height),u||d},polar:function(e,t){var n=t.r0<=t.r?1:-1;if(n<0){var r=t.r;t.r=t.r0,t.r0=r}var i=sV(t.r,e.r),a=oV(t.r0,e.r0);t.r=i,t.r0=a;var o=i-a<0;if(n<0){var r=t.r;t.r=t.r0,t.r0=r}return o}},uV={cartesian2d:function(e,t,n,r,i,a,o,s,c){var l=new z_({shape:W({},r),z2:1});if(l.__dataIndex=n,l.name=`item`,a){var u=l.shape,d=i?`height`:`width`;u[d]=0}return l},polar:function(e,t,n,r,i,a,o,s,c){var l=!i&&c?eV:pb,u=new l({shape:r,z2:1});if(u.name=`item`,u.calculateTextPosition=tV(yV(i),{isRoundCap:l===eV}),a){var d=u.shape,f=i?`r`:`endAngle`,p={};d[f]=i?r.r0:r.startAngle,p[f]=r[f],(s?Yb:Xb)(u,{shape:p},a)}return u}};function dV(e,t){var n=e.get(`realtimeSort`,!0),r=t.getBaseAxis();if(n&&r.type===`category`&&t.type===`cartesian2d`)return{baseAxis:r,otherAxis:t.getOtherAxis(r)}}function fV(e,t,n,r,i,a,o,s){var c,l;a?(l={x:r.x,width:r.width},c={y:r.y,height:r.height}):(l={y:r.y,height:r.height},c={x:r.x,width:r.width}),s||(o?Yb:Xb)(n,{shape:c},t,i,null);var u=t?e.baseAxis.model:null;(o?Yb:Xb)(n,{shape:l},u,i)}function pV(e,t){for(var n=0;n0?1:-1,o=r.height>0?1:-1;return{x:r.x+a*i/2,y:r.y+o*i/2,width:r.width-a*i,height:r.height-o*i}},polar:function(e,t,n){var r=e.getItemLayout(t);return{cx:r.cx,cy:r.cy,r0:r.r0,r:r.r,startAngle:r.startAngle,endAngle:r.endAngle,clockwise:r.clockwise}}};function vV(e){return e.startAngle!=null&&e.endAngle!=null&&e.startAngle===e.endAngle}function yV(e){return function(e){var t=e?`Arc`:`Angle`;return function(e){switch(e){case`start`:case`insideStart`:case`end`:case`insideEnd`:return e+t;default:return e}}}(e)}function bV(e,t,n,r,i,a,o,s){var c=t.getItemVisual(n,`style`);if(!s){var l=r.get([`itemStyle`,`borderRadius`])||0;e.setShape(`r`,l)}else if(!a.get(`roundCap`)){var u=e.shape;W(u,aV(r.getModel(`itemStyle`),u,!0)),e.setShape(u)}e.useStyle(c);var d=r.getShallow(`cursor`);d&&e.attr(`cursor`,d);var f=s?o?i.r>=i.r0?`endArc`:`startArc`:i.endAngle>=i.startAngle?`endAngle`:`startAngle`:o?kV(i,a.coordinateSystem):AV(i,a.coordinateSystem),p=tS(r);eS(e,p,{labelFetcher:a,labelDataIndex:n,defaultText:BR(a.getData(),n),inheritColor:c.fill,defaultOpacity:c.opacity,defaultOutsidePosition:f});var m=e.getTextContent();if(s&&m){var h=r.get([`label`,`position`]);e.textConfig.inside=h===`middle`||null,nV(e,h===`outside`?f:h,yV(o),r.get([`label`,`rotate`]))}fS(m,p,a.getRawValue(n),function(e){return VR(t,e)});var g=r.getModel([`emphasis`]);py(e,g.get(`focus`),g.get(`blurScope`),g.get(`disabled`)),_y(e,r),vV(i)&&(e.style.fill=`none`,e.style.stroke=`none`,G(e.states,function(e){e.style&&(e.style.fill=e.style.stroke=`none`)}))}function xV(e,t){var n=e.get([`itemStyle`,`borderColor`]);if(!n||n===`none`)return 0;var r=e.get([`itemStyle`,`borderWidth`])||0,i=isNaN(t.width)?Number.MAX_VALUE:Math.abs(t.width),a=isNaN(t.height)?Number.MAX_VALUE:Math.abs(t.height);return Math.min(r,i,a)}var SV=function(){function e(){}return e}(),CV=function(e){U(t,e);function t(t){var n=e.call(this,t)||this;return n.type=`largeBar`,n}return t.prototype.getDefaultShape=function(){return new SV},t.prototype.buildPath=function(e,t){for(var n=t.points,r=this.baseDimIdx,i=1-this.baseDimIdx,a=[],o=[],s=this.barWidth,c=0;c=0?n:null},30,!1);function EV(e,t,n){for(var r=e.baseDimIdx,i=1-r,a=e.shape.points,o=e.largeDataIndices,s=[],c=[],l=e.barWidth,u=0,d=a.length/3;u=s[0]&&t<=s[0]+c[0]&&n>=s[1]&&n<=s[1]+c[1])return o[u]}return-1}function DV(e,t,n){if(rB(n,`cartesian2d`)){var r=t,i=n.getArea();return{x:e?r.x:i.x,y:e?i.y:r.y,width:e?r.width:i.width,height:e?i.height:r.height}}var i=n.getArea(),a=t;return{cx:i.cx,cy:i.cy,r0:e?i.r0:a.r0,r:e?i.r:a.r,startAngle:e?a.startAngle:0,endAngle:e?a.endAngle:Math.PI*2}}function OV(e,t,n){return new(e.type===`polar`?pb:z_)({shape:DV(t,n,e),silent:!0,z2:0})}function kV(e,t){return e.height===0?t.getOtherAxis(t.getBaseAxis()).inverse?`bottom`:`top`:e.height>0?`bottom`:`top`}function AV(e,t){return e.width===0?t.getOtherAxis(t.getBaseAxis()).inverse?`left`:`right`:e.width>=0?`right`:`left`}function jV(e){e.registerChartView(cV),e.registerSeriesModel(QB),e.registerLayout(e.PRIORITY.VISUAL.LAYOUT,KB(`bar`)),e.registerLayout(e.PRIORITY.VISUAL.PROGRESSIVE_LAYOUT,qB(`bar`)),e.registerProcessor(e.PRIORITY.PROCESSOR.STATISTIC,kB(`bar`)),e.registerAction({type:`changeAxisOrder`,event:`changeAxisOrder`,update:`update`},function(e,t){var n=e.componentType||`series`;t.eachComponent({mainType:n,query:e},function(t){e.sortInfo&&t.axis.setCategorySortInfo(e.sortInfo)})}),XB(e)}var MV=Td();function NV(e,t,n){MV(e)[t]=n}function PV(e,t,n){var r=MV(e);r[t]===n&&(r[t]=null)}function FV(e,t){return!!MV(e)[t]}qL({type:`takeGlobalCursor`,event:`globalCursorTaken`,update:`update`},ru);var IV={axisPointer:1,tooltip:1,brush:1};function LV(e,t,n){var r=t.getComponentByElement(e.topTarget);if(!r||r===n||IV.hasOwnProperty(r.mainType))return!1;var i=r.coordinateSystem;if(!i||i.model===n)return!1;var a=Ux(r),o=Ux(n);return!((a.zlevel-o.zlevel||a.z-o.z)<=0)}var RV=function(e){U(t,e);function t(t){var n=e.call(this)||this;n._zr=t;var r=q(n._mousedownHandler,n),i=q(n._mousemoveHandler,n),a=q(n._mouseupHandler,n),o=q(n._mousewheelHandler,n),s=q(n._pinchHandler,n);return n.enable=function(e,n){var c=n.zInfo,l=Ux(c.component),u=l.z,d=l.zlevel,f={component:c.component,z:u,zlevel:d,z2:X(c.z2,-1/0)},p=W({},n.triggerInfo);this._opt=yl(W({},n),{zoomOnMouseWheel:!0,moveOnMouseMove:!0,moveOnMouseWheel:!1,preventDefaultMouseMove:!0,zInfoParsed:f,triggerInfo:p,cursorGrab:`grab`,cursorGrabbing:`grabbing`}),e??=!0,(!this._enabled||this._controlType!==e)&&(this.disable(),this._enabled=!0,(e===!0||e===`move`||e===`pan`)&&(HV(t,`mousedown`,r,f),HV(t,`mousemove`,i,f),HV(t,`mouseup`,a,f)),(e===!0||e===`scale`||e===`zoom`)&&(HV(t,`mousewheel`,o,f),HV(t,`pinch`,s,f)))},n.disable=function(){this._enabled&&(this._enabled=!1,UV(t,`mousedown`,r),UV(t,`mousemove`,i),UV(t,`mouseup`,a),UV(t,`mousewheel`,o),UV(t,`pinch`,s))},n}return t.prototype.isDragging=function(){return this._dragging},t.prototype.isPinching=function(){return this._pinching},t.prototype._checkPointer=function(e,t,n){var r=this._opt,i=r.zInfoParsed;if(LV(e,r.api,i.component))return!1;var a=r.triggerInfo,o=a.roamTrigger,s=!1;return o===`global`&&(s=!0),s||=a.isInSelf(e,t,n),s&&a.isInClip&&!a.isInClip(e,t,n)&&(s=!1),s},t.prototype._decideCursorStyle=function(e,t,n,r){var i=e.target;if(!i&&this._checkPointer(e,t,n))return this._opt.cursorGrab;if(r)return i&&i.cursor||`default`},t.prototype.dispose=function(){this.disable()},t.prototype._mousedownHandler=function(e){if(!(mM(e)||zV(e))){for(var t=e.target;t;){if(t.draggable)return;t=t.__hostTarget||t.parent}var n=e.offsetX,r=e.offsetY;this._checkPointer(e,n,r)&&(this._x=n,this._y=r,this._dragging=!0)}},t.prototype._mousemoveHandler=function(e){var t=this._zr;if(!(e.gestureEvent===`pinch`||FV(t,`globalPan`)||zV(e))){var n=e.offsetX,r=e.offsetY;if(!this._dragging||!qV(`moveOnMouseMove`,e,this._opt)){var i=this._decideCursorStyle(e,n,r,!1);i&&t.setCursorStyle(i);return}t.setCursorStyle(this._opt.cursorGrabbing);var a=this._x,o=this._y,s=n-a,c=r-o;this._x=n,this._y=r,this._opt.preventDefaultMouseMove&&pM(e.event),e.__ecRoamConsumed=!0,KV(this,`pan`,`moveOnMouseMove`,e,{dx:s,dy:c,oldX:a,oldY:o,newX:n,newY:r,isAvailableBehavior:null})}},t.prototype._mouseupHandler=function(e){if(!zV(e)){var t=this._zr;if(!mM(e)){this._dragging=!1;var n=this._decideCursorStyle(e,e.offsetX,e.offsetY,!0);n&&t.setCursorStyle(n)}}},t.prototype._mousewheelHandler=function(e){if(!zV(e)){var t=qV(`zoomOnMouseWheel`,e,this._opt),n=qV(`moveOnMouseWheel`,e,this._opt),r=e.wheelDelta,i=Math.abs(r),a=e.offsetX,o=e.offsetY;if(r!==0&&(t||n)){if(t){var s=i>3?1.4:i>1?1.2:1.1,c=r>0?s:1/s;this._checkTriggerMoveZoom(this,`zoom`,`zoomOnMouseWheel`,e,{scale:c,originX:a,originY:o,isAvailableBehavior:null})}if(n){var l=Math.abs(r),u=(r>0?1:-1)*(l>3?.4:l>1?.15:.05);this._checkTriggerMoveZoom(this,`scrollMove`,`moveOnMouseWheel`,e,{scrollDelta:u,originX:a,originY:o,isAvailableBehavior:null})}}}},t.prototype._pinchHandler=function(e){if(!(FV(this._zr,`globalPan`)||zV(e))){var t=e.pinchScale>1?1.1:1/1.1;this._checkTriggerMoveZoom(this,`zoom`,null,e,{scale:t,originX:e.pinchX,originY:e.pinchY,isAvailableBehavior:null})}},t.prototype._checkTriggerMoveZoom=function(e,t,n,r,i){e._checkPointer(r,i.originX,i.originY)&&(pM(r.event),r.__ecRoamConsumed=!0,KV(e,t,n,r,i))},t}(Uh);function zV(e){return e.__ecRoamConsumed}var BV=Td();function VV(e){var t=BV(e);return t.roam=t.roam||{},t.uniform=t.uniform||{},t}function HV(e,t,n,r){for(var i=VV(e).roam,a=i[t]=i[t]||[],o=0;o=0;a--)r[a]??(delete n[t[a]],t.pop())}function dH(e,t){var n=e.visual,r=[];Nl(n)?aH(n,function(e){r.push(e)}):n!=null&&r.push(n),!t&&r.length===1&&!{color:1,symbol:1}.hasOwnProperty(e.type)&&(r[1]=r[0]),yH(e,r)}function fH(e){return{applyVisual:function(t,n,r){var i=this.mapValueToVisual(t);r(`color`,e(n(`color`),i))},_normalizedToVisual:_H([0,1])}}function pH(e){var t=this.option.visual;return t[Math.round(Su(e,[0,1],[0,t.length-1],!0))]||{}}function mH(e){return function(t,n,r){r(e,this.mapValueToVisual(t))}}function hH(e){var t=this.option.visual;return t[this.option.loop&&e!==sH?e%t.length:e]}function gH(){return this.option.visual[0]}function _H(e){return{linear:function(t){return Su(t,e,this.option.visual,!0)},category:hH,piecewise:function(t,n){var r=vH.call(this,n);return r??=Su(t,e,this.option.visual,!0),r},fixed:gH}}function vH(e){var t=this.option,n=t.pieceList;if(t.hasSpecialVisual){var r=n[cH.findPieceIndex(e,n)];if(r&&r.visual)return r.visual[this.type]}}function yH(e,t){return e.visual=t,e.type===`color`&&(e.parsedVisual=K(t,function(e){return oh(e)||[0,0,0,1]})),t}var bH={linear:function(e){return Su(e,this.option.dataExtent,[0,1],!0)},piecewise:function(e){var t=this.option.pieceList,n=cH.findPieceIndex(e,t,!0);if(n!=null)return Su(n,[0,t.length-1],[0,1],!0)},category:function(e){return(this.option.categories?this.option.categoryMap[e]:e)??sH},fixed:ru};function xH(e,t,n){return e?t<=n:t0&&(y[0]=-y[0],y[1]=-y[1]);var x=v[0]<0?-1:1;if(r.__position!==`start`&&r.__position!==`end`){var S=-Math.atan2(v[1],v[0]);l[0].8?`left`:u[0]<-.8?`right`:`center`,p=u[1]>.8?`top`:u[1]<-.8?`bottom`:`middle`;break;case`start`:r.x=-u[0]*h+c[0],r.y=-u[1]*g+c[1],f=u[0]>.8?`right`:u[0]<-.8?`left`:`center`,p=u[1]>.8?`bottom`:u[1]<-.8?`top`:`middle`;break;case`insideStartTop`:case`insideStart`:case`insideStartBottom`:r.x=h*x+c[0],r.y=c[1]+C,f=v[0]<0?`right`:`left`,r.originX=-h*x,r.originY=-C;break;case`insideMiddleTop`:case`insideMiddle`:case`insideMiddleBottom`:case`middle`:r.x=b[0],r.y=b[1]+C,f=`center`,r.originY=-C;break;case`insideEndTop`:case`insideEnd`:case`insideEndBottom`:r.x=-h*x+l[0],r.y=l[1]+C,f=v[0]>=0?`right`:`left`,r.originX=h*x,r.originY=-C}r.scaleX=r.scaleY=i,r.setStyle({verticalAlign:r.__verticalAlign||p,align:r.__align||f})}},t}(Ky),PH=function(){function e(e){this.group=new Ky,this._LineCtor=e||NH}return e.prototype.updateData=function(e){var t=this;this._progressiveEls=null;var n=this,r=n.group,i=n._lineData;n._lineData=e,i||r.removeAll();var a=IH(e);e.diff(i).add(function(n){t._doAdd(e,n,a)}).update(function(n,r){t._doUpdate(i,e,r,n,a)}).remove(function(e){r.remove(i.getItemGraphicEl(e))}).execute()},e.prototype.updateLayout=function(){var e=this._lineData;e&&e.eachItemGraphicEl(function(t,n){t.updateLayout(e,n)},this)},e.prototype.incrementalPrepareUpdate=function(e){this._seriesScope=IH(e),this._lineData=null,this.group.removeAll()},e.prototype.incrementalUpdate=function(e,t,n){this._progressiveEls=[];function r(e){!e.isGroup&&!FH(e)&&(e.incremental=n,e.ensureState(`emphasis`).hoverLayer=2)}for(var i=e.start;i0}function IH(e){var t=e.hostModel,n=t.getModel(`emphasis`);return{lineStyle:t.getModel(`lineStyle`).getLineStyle(),emphasisLineStyle:n.getModel([`lineStyle`]).getLineStyle(),blurLineStyle:t.getModel([`blur`,`lineStyle`]).getLineStyle(),selectLineStyle:t.getModel([`select`,`lineStyle`]).getLineStyle(),emphasisDisabled:n.get(`disabled`),blurScope:n.get(`blurScope`),focus:n.get(`focus`),labelStatesModels:tS(t)}}function LH(e){return isNaN(e[0])||isNaN(e[1])}function RH(e){return e&&!LH(e[0])&&!LH(e[1])}function zH(e,t,n,r,i,a){e||=0;var o=Mu(n[1],-n[0]);if(i!=null&&(i=VH(i,[0,o])),a!=null&&(a=Math.max(a,i??0)),r===`all`){var s=Math.abs(Mu(t[1],-t[0]));s=VH(s,[0,o]),i=a=VH(s,[i,a]),r=0}t[0]=VH(t[0],n),t[1]=VH(t[1],n);var c=BH(t,r);t[r]+=e;var l=i||0,u=n.slice();c.sign<0?u[0]=Mu(u[0],l):u[1]=Mu(u[1],-l),t[r]=VH(t[r],u);var d=BH(t,r);return i!=null&&(d.sign!==c.sign||d.spana&&(t[1-r]=Mu(t[r],d.sign*a)),t}function BH(e,t){var n=e[t]-e[1-t];return{span:Math.abs(n),sign:n>0?-1:n<0?1:t?-1:1}}function VH(e,t){return Math.min(t[1]==null?1/0:t[1],Math.max(t[0]==null?-1/0:t[0],e))}var HH=!0,UH=Math.min,WH=Math.max,GH=Math.pow,KH=1e4,qH=6,JH=6,YH=`globalPan`,XH={w:[0,0],e:[0,1],n:[1,0],s:[1,1]},ZH={w:`ew`,e:`ew`,n:`ns`,s:`ns`,ne:`nesw`,sw:`nesw`,nw:`nwse`,se:`nwse`},QH={brushStyle:{lineWidth:2,stroke:Q.color.backgroundTint,fill:Q.color.borderTint},transformable:!0,brushMode:`single`,removeOnClick:!1},$H=0,eU=function(e){U(t,e);function t(t){var n=e.call(this)||this;return n._track=[],n._covers=[],n._handlers={},n._zr=t,n.group=new Ky,n._uid=`brushController_`+$H++,G(MU,function(e,t){this._handlers[t]=q(e,this)},n),n}return t.prototype.enableBrush=function(e){return this._brushType&&this._doDisableBrush(),e.brushType&&this._doEnableBrush(e),this},t.prototype._doEnableBrush=function(e){var t=this._zr;this._enableGlobalPan||NV(t,YH,this._uid),G(this._handlers,function(e,n){t.on(n,e)}),this._brushType=e.brushType,this._brushOption=gl(hl(QH),e,!0)},t.prototype._doDisableBrush=function(){var e=this._zr;PV(e,YH,this._uid),G(this._handlers,function(t,n){e.off(n,t)}),this._brushType=this._brushOption=null},t.prototype.setPanels=function(e){if(e&&e.length){var t=this._panels={};G(e,function(e){t[e.panelId]=hl(e)})}else this._panels=null;return this},t.prototype.mount=function(e){e||={},this._enableGlobalPan=e.enableGlobalPan;var t=this.group;return this._zr.add(t),t.attr({x:e.x||0,y:e.y||0,rotation:e.rotation||0,scaleX:e.scaleX||1,scaleY:e.scaleY||1}),this._transform=t.getLocalTransform(),this},t.prototype.updateCovers=function(e){e=K(e,function(e){return gl(hl(QH),e,!0)});var t=`\0-brush-index-`,n=this._covers,r=this._covers=[],i=this,a=this._creatingCover;return new FE(n,e,s,o).add(c).update(c).remove(l).execute(),this;function o(e,n){return(e.id==null?t+n:e.id)+`-`+e.brushType}function s(e,t){return o(e.__brushOption,t)}function c(t,o){var s=e[t];o!=null&&n[o]===a?r[t]=n[o]:aU(i,r[t]=o==null?nU(i,tU(i,s)):(n[o].__brushOption=s,n[o]))}function l(e){n[e]!==a&&i.group.remove(n[e])}},t.prototype.unmount=function(){return this.enableBrush(!1),lU(this),this._zr.remove(this.group),this},t.prototype.dispose=function(){this.unmount(),this.off()},t}(Uh);function tU(e,t){var n=FU[t.brushType].createCover(e,t);return n.__brushOption=t,iU(n,t),e.group.add(n),n}function nU(e,t){var n=oU(t);return n.endCreating&&(n.endCreating(e,t),iU(t,t.__brushOption)),t}function rU(e,t){var n=t.__brushOption;oU(t).updateCoverShape(e,t,n.range,n)}function iU(e,t){var n=t.z;n??=KH,e.traverse(function(e){e.z=n,e.z2=n})}function aU(e,t){oU(t).updateCommon(e,t),rU(e,t)}function oU(e){return FU[e.__brushOption.brushType]}function sU(e,t,n){var r=e._panels;if(!r)return HH;var i,a=e._transform;return G(r,function(e){e.isTargetByCursor(t,n,a)&&(i=e)}),i}function cU(e,t){var n=e._panels;if(!n)return HH;var r=t.__brushOption.panelId;return r==null?HH:n[r]}function lU(e){var t=e._covers,n=t.length;return G(t,function(t){e.group.remove(t)},e),t.length=0,!!n}function uU(e,t){var n=K(e._covers,function(e){var t=e.__brushOption,n=hl(t.range);return{brushType:t.brushType,panelId:t.panelId,range:n}});e.trigger(`brush`,{areas:n,isEnd:!!t.isEnd,removeOnClick:!!t.removeOnClick})}function dU(e){var t=e._track;if(!t.length)return!1;var n=t[t.length-1],r=t[0],i=n[0]-r[0],a=n[1]-r[1];return GH(i*i+a*a,.5)>qH}function fU(e){var t=e.length-1;return t<0&&(t=0),[e[0],e[t]]}function pU(e,t,n,r){var i=new Ky;return i.add(new z_({name:`main`,style:_U(n),silent:!0,draggable:!0,cursor:`move`,drift:kl(SU,e,t,i,[`n`,`s`,`w`,`e`]),ondragend:kl(uU,t,{isEnd:!0})})),G(r,function(n){i.add(new z_({name:n.join(``),style:{opacity:0},draggable:!0,silent:!0,invisible:!0,drift:kl(SU,e,t,i,n),ondragend:kl(uU,t,{isEnd:!0})}))}),i}function mU(e,t,n,r){var i=r.brushStyle.lineWidth||0,a=WH(i,JH),o=n[0][0],s=n[1][0],c=o-i/2,l=s-i/2,u=n[0][1],d=n[1][1],f=u-a+i/2,p=d-a+i/2,m=u-o,h=d-s,g=m+i,_=h+i;gU(e,t,`main`,o,s,m,h),r.transformable&&(gU(e,t,`w`,c,l,a,_),gU(e,t,`e`,f,l,a,_),gU(e,t,`n`,c,l,g,a),gU(e,t,`s`,c,p,g,a),gU(e,t,`nw`,c,l,a,a),gU(e,t,`ne`,f,l,a,a),gU(e,t,`sw`,c,p,a,a),gU(e,t,`se`,f,p,a,a))}function hU(e,t){var n=t.__brushOption,r=n.transformable,i=t.childAt(0);i.useStyle(_U(n)),i.attr({silent:!r,cursor:r?`move`:`default`}),G([[`w`],[`e`],[`n`],[`s`],[`s`,`e`],[`s`,`w`],[`n`,`e`],[`n`,`w`]],function(n){var i=t.childOfName(n.join(``)),a=n.length===1?bU(e,n[0]):xU(e,n);i&&i.attr({silent:!r,invisible:!r,cursor:r?ZH[a]+`-resize`:null})})}function gU(e,t,n,r,i,a,o){var s=t.childOfName(n);s&&s.setShape(EU(TU(e,t,[[r,i],[r+a,i+o]])))}function _U(e){return yl({strokeNoScale:!0},e.brushStyle)}function vU(e,t,n,r){var i=[UH(e,n),UH(t,r)],a=[WH(e,n),WH(t,r)];return[[i[0],a[0]],[i[1],a[1]]]}function yU(e){return yx(e.group)}function bU(e,t){return{left:`w`,right:`e`,top:`n`,bottom:`s`}[xx({w:`left`,e:`right`,n:`top`,s:`bottom`}[t],yU(e))]}function xU(e,t){var n=[bU(e,t[0]),bU(e,t[1])];return(n[0]===`e`||n[0]===`w`)&&n.reverse(),n.join(``)}function SU(e,t,n,r,i,a){var o=n.__brushOption,s=e.toRectRange(o.range),c=wU(t,i,a);G(r,function(e){var t=XH[e];s[t[0]][t[1]]+=c[t[0]]}),o.range=e.fromRectRange(vU(s[0][0],s[1][0],s[0][1],s[1][1])),aU(t,n),uU(t,{isEnd:!1})}function CU(e,t,n,r){var i=t.__brushOption.range,a=wU(e,n,r);G(i,function(e){e[0]+=a[0],e[1]+=a[1]}),aU(e,t),uU(e,{isEnd:!1})}function wU(e,t,n){var r=e.group,i=r.transformCoordToLocal(t,n),a=r.transformCoordToLocal(0,0);return[i[0]-a[0],i[1]-a[1]]}function TU(e,t,n){var r=cU(e,t);return r&&r!==HH?r.clipPath(n,e._transform):hl(n)}function EU(e){var t=UH(e[0][0],e[1][0]),n=UH(e[0][1],e[1][1]),r=WH(e[0][0],e[1][0]),i=WH(e[0][1],e[1][1]);return{x:t,y:n,width:r-t,height:i-n}}function DU(e,t,n){if(e._brushType&&!PU(e,t.offsetX,t.offsetY)){var r=e._zr,i=e._covers,a=sU(e,t,n);if(!e._dragging)for(var o=0;or.getWidth()||n<0||n>r.getHeight()}var FU={lineX:IU(0),lineY:IU(1),rect:{createCover:function(e,t){function n(e){return e}return pU({toRectRange:n,fromRectRange:n},e,t,[[`w`],[`e`],[`n`],[`s`],[`s`,`e`],[`s`,`w`],[`n`,`e`],[`n`,`w`]])},getCreatingRange:function(e){var t=fU(e);return vU(t[1][0],t[1][1],t[0][0],t[0][1])},updateCoverShape:function(e,t,n,r){mU(e,t,n,r)},updateCommon:hU,contain:kU},polygon:{createCover:function(e,t){var n=new Ky;return n.add(new xb({name:`main`,style:_U(t),silent:!0})),n},getCreatingRange:function(e){return e},endCreating:function(e,t){t.remove(t.childAt(0)),t.add(new yb({name:`main`,draggable:!0,drift:kl(CU,e,t),ondragend:kl(uU,e,{isEnd:!0})}))},updateCoverShape:function(e,t,n,r){t.childAt(0).setShape({points:TU(e,t,n)})},updateCommon:hU,contain:kU}};function IU(e){return{createCover:function(t,n){return pU({toRectRange:function(t){var n=[t,[0,100]];return e&&n.reverse(),n},fromRectRange:function(t){return t[e]}},t,n,[[[`w`],[`e`]],[[`n`],[`s`]]][e])},getCreatingRange:function(t){var n=fU(t);return[UH(n[0][e],n[1][e]),WH(n[0][e],n[1][e])]},updateCoverShape:function(t,n,r,i){var a,o=cU(t,n);if(o!==HH&&o.getLinearBrushOtherExtent)a=o.getLinearBrushOtherExtent(e);else{var s=t._zr;a=[0,[s.getWidth(),s.getHeight()][1-e]]}var c=[r,a];e&&c.reverse(),mU(t,n,c,i)},updateCommon:hU,contain:kU}}function LU(e){return e=BU(e),function(t){return Ex(t,e)}}function RU(e,t){return e=BU(e),function(n){var r=t??n,i=r?e.width:e.height,a=r?e.x:e.y;return[a,a+(i||0)]}}function zU(e,t,n){var r=BU(e);return function(e,i){return r.contain(i[0],i[1])&&!LV(e,t,n)}}function BU(e){return fp.create(e)}var VU=256,HU=function(){function e(){this.blurSize=30,this.pointSize=20,this.maxOpacity=1,this.minOpacity=0,this._gradientPixels={inRange:null,outOfRange:null};var e=$c.createCanvas();this.canvas=e}return e.prototype.update=function(e,t,n,r,i,a){var o=this._getBrush(),s=this._getGradient(i,`inRange`),c=this._getGradient(i,`outOfRange`),l=this.pointSize+this.blurSize,u=this.canvas,d=u.getContext(`2d`),f=e.length;u.width=t,u.height=n;for(var p=0;p0){var E=a(v)?s:c;v>0&&(v=v*w+C),b[x++]=E[T],b[x++]=E[T+1],b[x++]=E[T+2],b[x++]=E[T+3]*v*256}else x+=4}return d.putImageData(y,0,0),u},e.prototype._getBrush=function(){var e=this._brushCanvas||=$c.createCanvas(),t=this.pointSize+this.blurSize,n=t*2;e.width=n,e.height=n;var r=e.getContext(`2d`);return r.clearRect(0,0,n,n),r.shadowOffsetX=n,r.shadowBlur=this.blurSize,r.shadowColor=Q.color.neutral99,r.beginPath(),r.arc(-t,t,this.pointSize,0,Math.PI*2,!0),r.closePath(),r.fill(),e},e.prototype._getGradient=function(e,t){for(var n=this._gradientPixels,r=n[t]||(n[t]=new Uint8ClampedArray(1024)),i=[0,0,0,0],a=0,o=0;o<256;o++)e[t](o/255,!0,i),r[a++]=i[0],r[a++]=i[1],r[a++]=i[2],r[a++]=i[3];return r},e}();function UU(e,t,n){var r=e[1]-e[0];t=K(t,function(t){return{interval:[(t.interval[0]-e[0])/r,(t.interval[1]-e[0])/r]}});var i=t.length,a=0;return function(e){for(var r=a;r=0;r--){var o=t[r].interval;if(o[0]<=e&&e<=o[1]){a=r;break}}return r>=0&&r=t[0]&&e<=t[1]}}var GU=function(e){U(t,e);function t(){var n=e!==null&&e.apply(this,arguments)||this;return n.type=t.type,n}return t.prototype.render=function(e,t,n){var r;t.eachComponent(`visualMap`,function(t){t.eachTargetSeries(function(n){n===e&&(r=t)})}),this._progressiveEls=null,this.group.removeAll();var i=e.coordinateSystem;i.type===`cartesian2d`||i.type===`calendar`||i.type===`matrix`?this._renderOnGridLike(e,n,0,e.getData().count()):iB(i)&&this._renderOnGeo(i,e,r,n)},t.prototype.incrementalPrepareRender=function(e,t,n){this.group.removeAll()},t.prototype.incrementalRender=function(e,t,n,r){var i=t.coordinateSystem;i&&(iB(i)?this.render(t,n,r):(this._progressiveEls=[],this._renderOnGridLike(t,r,e.start,e.end,!0)))},t.prototype.eachRendered=function(e){Rx(this._progressiveEls||this.group,e)},t.prototype._renderOnGridLike=function(e,t,n,r,i){var a=e.coordinateSystem,o=rB(a,`cartesian2d`),s=rB(a,`matrix`),c,l,u,d;if(o){var f=a.getAxis(`x`),p=a.getAxis(`y`);c=dA(f).w+.5,l=dA(p).w+.5,u=f.scale.getExtent(),d=p.scale.getExtent()}for(var m=this.group,h=e.getData(),g=e.getModel([`emphasis`,`itemStyle`]).getItemStyle(),_=e.getModel([`blur`,`itemStyle`]).getItemStyle(),v=e.getModel([`select`,`itemStyle`]).getItemStyle(),y=e.get([`itemStyle`,`borderRadius`]),b=tS(e),x=e.getModel(`emphasis`),S=x.get(`focus`),C=x.get(`blurScope`),w=x.get(`disabled`),T=o||s?[h.mapDimension(`x`),h.mapDimension(`y`),h.mapDimension(`value`)]:[h.mapDimension(`time`),h.mapDimension(`value`)],E=n;Eu[1]||Ad[1])continue;var j=a.dataToPoint([k,A]);D=new z_({shape:{x:j[0]-c/2,y:j[1]-l/2,width:c,height:l},style:O})}else if(s){var M=a.dataToLayout([h.get(T[0],E),h.get(T[1],E)]).rect;if(zl(M.x))continue;D=new z_({z2:1,shape:M,style:O})}else{if(isNaN(h.get(T[1],E)))continue;var N=a.dataToLayout([h.get(T[0],E)]),M=N.contentRect||N.rect;if(zl(M.x)||zl(M.y))continue;D=new z_({z2:1,shape:M,style:O})}if(h.hasItemOption){var P=h.getItemModel(E),F=P.getModel(`emphasis`);g=F.getModel(`itemStyle`).getItemStyle(),_=P.getModel([`blur`,`itemStyle`]).getItemStyle(),v=P.getModel([`select`,`itemStyle`]).getItemStyle(),y=P.get([`itemStyle`,`borderRadius`]),S=F.get(`focus`),C=F.get(`blurScope`),w=F.get(`disabled`),b=tS(P)}D.shape.r=y;var I=e.getRawValue(E),L=`-`;I&&I[2]!=null&&(L=I[2]+``),eS(D,b,{labelFetcher:e,labelDataIndex:E,defaultOpacity:O.opacity,defaultText:L}),D.ensureState(`emphasis`).style=g,D.ensureState(`blur`).style=_,D.ensureState(`select`).style=v,py(D,S,C,w),D.incremental=Zd(e,i),i&&(D.states.emphasis.hoverLayer=2),m.add(D),h.setItemGraphicEl(E,D),this._progressiveEls&&this._progressiveEls.push(D)}},t.prototype._renderOnGeo=function(e,t,n,r){var i=n.targetVisuals.inRange,a=n.targetVisuals.outOfRange,o=t.getData(),s=this._hmLayer||this._hmLayer||new HU;s.blurSize=t.get(`blurSize`),s.pointSize=t.get(`pointSize`),s.minOpacity=t.get(`minOpacity`),s.maxOpacity=t.get(`maxOpacity`);var c=e.getViewRect().clone(),l=e.getRoamTransform();c.applyTransform(l);var u=Math.max(c.x,0),d=Math.max(c.y,0),f=Math.min(c.width+c.x,r.getWidth()),p=Math.min(c.height+c.y,r.getHeight()),m=f-u,h=p-d,g=[o.mapDimension(`lng`),o.mapDimension(`lat`),o.mapDimension(`value`)],_=o.mapArray(g,function(t,n,r){var i=e.dataToPoint([t,n]);return i[0]-=u,i[1]-=d,i.push(r),i}),v=n.getExtent(),y=n.type===`visualMap.continuous`?WU(v,n.option.range):UU(v,n.getPieceList(),n.option.selected);s.update(_,m,h,i.color.getNormalizer(),{inRange:i.color.getColorMapper(),outOfRange:a.color.getColorMapper()},y);var b=new j_({style:{width:m,height:h,x:u,y:d,image:s.canvas},silent:!0});this.group.add(b)},t.type=`heatmap`,t}(xP),KU=function(e){U(t,e);function t(){var n=e!==null&&e.apply(this,arguments)||this;return n.type=t.type,n}return t.prototype.getInitialData=function(e,t){return IR(null,this,{generateCoord:`value`})},t.prototype.preventIncremental=function(){var e=tw.get(this.get(`coordinateSystem`));if(e&&e.dimensions)return e.dimensions[0]===`lng`&&e.dimensions[1]===`lat`},t.type=`series.heatmap`,t.dependencies=[`grid`,`geo`,`calendar`,`matrix`],t.defaultOption={coordinateSystem:`cartesian2d`,z:2,geoIndex:0,blurSize:30,pointSize:20,maxOpacity:1,minOpacity:0,select:{itemStyle:{borderColor:Q.color.primary}}},t}(wE);function qU(e){e.registerChartView(GU),e.registerSeriesModel(KU)}var JU={color:`fill`,borderColor:`stroke`},YU={symbol:1,symbolSize:1,symbolKeepAspect:1,legendIcon:1,visualMeta:1,liftZ:1,decal:1},XU=Td(),ZU=function(e){U(t,e);function t(){var n=e!==null&&e.apply(this,arguments)||this;return n.type=t.type,n}return t.prototype.optionUpdated=function(){this.currentZLevel=this.get(`zlevel`,!0),this.currentZ=this.get(`z`,!0)},t.prototype.getInitialData=function(e,t){return IR(null,this)},t.prototype.getDataParams=function(t,n,r){var i=e.prototype.getDataParams.call(this,t,n);return r&&(i.info=XU(r).info),i},t.type=`series.custom`,t.dependencies=[`grid`,`polar`,`geo`,`singleAxis`,`calendar`,`matrix`],t.defaultOption={coordinateSystem:`cartesian2d`,z:2,legendHoverLink:!0,clip:!1},t}(wE);function QU(e,t){return t||=[0,0],K([`x`,`y`],function(n,r){var i=this.getAxis(n),a=t[r],o=e[r]/2;return i.type===`category`?dA(i).w:Math.abs(i.dataToCoord(a-o)-i.dataToCoord(a+o))},this)}function $U(e){var t=e.master.getRect();return{coordSys:{type:`cartesian2d`,x:t.x,y:t.y,width:t.width,height:t.height},api:{coord:function(t){return e.dataToPoint(t)},size:q(QU,e)}}}function eW(e,t){return t||=[0,0],K([0,1],function(n){var r=t[n],i=e[n]/2,a=[],o=[];return a[n]=r-i,o[n]=r+i,a[1-n]=o[1-n]=t[1-n],Math.abs(this.dataToPoint(a)[n]-this.dataToPoint(o)[n])},this)}function tW(e){var t=e.view,n=t.getBoundingRect();return{coordSys:{type:`geo`,x:n.x,y:n.y,width:n.width,height:n.height,zoom:tH(t)},api:{coord:function(t){return e.dataToPoint(t)},size:q(eW,e)}}}function nW(e,t){var n=this.getAxis(),r=t instanceof Array?t[0]:t,i=(e instanceof Array?e[0]:e)/2;return n.type===`category`?dA(n).w:Math.abs(n.dataToCoord(r-i)-n.dataToCoord(r+i))}function rW(e){var t=e.getRect();return{coordSys:{type:`singleAxis`,x:t.x,y:t.y,width:t.width,height:t.height},api:{coord:function(t){return e.dataToPoint(t)},size:q(nW,e)}}}function iW(e,t){return t||=[0,0],K([`Radius`,`Angle`],function(n,r){var i=`get`+n+`Axis`,a=this[i](),o=t[r],s=e[r]/2,c=a.type===`category`?dA(a).w:Math.abs(a.dataToCoord(o-s)-a.dataToCoord(o+s));return n===`Angle`&&(c=c*Math.PI/180),c},this)}function aW(e){var t=e.getRadiusAxis(),n=e.getAngleAxis(),r=t.getExtent();return r[0]>r[1]&&r.reverse(),{coordSys:{type:`polar`,cx:e.cx,cy:e.cy,r:r[1],r0:r[0]},api:{coord:function(r){var i=t.dataToRadius(r[0]),a=n.dataToAngle(r[1]),o=e.coordToPoint([i,a]);return o.push(i,a*Math.PI/180),o},size:q(iW,e)}}}function oW(e){var t=e.getRect(),n=e.getRangeInfo();return{coordSys:{type:`calendar`,x:t.x,y:t.y,width:t.width,height:t.height,cellWidth:e.getCellWidth(),cellHeight:e.getCellHeight(),rangeInfo:{start:n.start,end:n.end,weeks:n.weeks,dayCount:n.allDay}},api:{coord:function(t,n){return e.dataToPoint(t,n)},layout:function(t,n){return e.dataToLayout(t,n)}}}}function sW(e){var t=e.getRect();return{coordSys:{type:`matrix`,x:t.x,y:t.y,width:t.width,height:t.height},api:{coord:function(t,n){return e.dataToPoint(t,n)},layout:function(t,n){return e.dataToLayout(t,n)}}}}var cW={position:[`x`,`y`],scale:[`scaleX`,`scaleY`],origin:[`originX`,`originY`]},lW=Dl(cW);wl(gm,function(e,t){return e[t]=1,e},{}),gm.join(`, `);var uW=[``,`style`,`shape`,`extra`],dW=Td();function fW(e,t,n,r,i){var a=e+`Animation`,o=qb(e,r,i)||{},s=dW(t).userDuring;return o.duration>0&&(o.during=s?q(SW,{el:t,userDuring:s}):null,o.setToFinal=!0,o.scope=e),W(o,n[a]),o}function pW(e,t,n,r){r||={};var i=r.dataIndex,a=r.isInit,o=r.clearStyle,s=n.isAnimationEnabled(),c=dW(e),l=t.style;c.userDuring=t.during;var u={},d={};if(EW(e,t,d),e.type===`compound`)for(var f=e.shape.paths,p=t.shape.paths,m=0;m0&&e.animateFrom(g,_)}else vW(e,t,i||0,n,u)}mW(e,t),l?e.dirty():e.markRedraw()}function mW(e,t){for(var n=dW(e).leaveToProps,r=0;r0&&e.animateFrom(i,a)}}function yW(e,t){Z(t,`silent`)&&(e.silent=t.silent),Z(t,`ignore`)&&(e.ignore=t.ignore),e instanceof vg&&Z(t,`invisible`)&&(e.invisible=t.invisible),e instanceof T_&&Z(t,`autoBatch`)&&(e.autoBatch=t.autoBatch)}var bW={},xW={setTransform:function(e,t){return bW.el[e]=t,this},getTransform:function(e){return bW.el[e]},setShape:function(e,t){var n=bW.el,r=n.shape||={};return r[e]=t,n.dirtyShape&&n.dirtyShape(),this},getShape:function(e){var t=bW.el.shape;if(t)return t[e]},setStyle:function(e,t){var n=bW.el,r=n.style;return r&&(r[e]=t,n.dirtyStyle&&n.dirtyStyle()),this},getStyle:function(e){var t=bW.el.style;if(t)return t[e]},setExtra:function(e,t){var n=bW.el.extra||(bW.el.extra={});return n[e]=t,this},getExtra:function(e){var t=bW.el.extra;if(t)return t[e]}};function SW(){var e=this,t=e.el;if(t){var n=dW(t).userDuring,r=e.userDuring;if(n!==r){e.el=e.userDuring=null;return}bW.el=t,r(xW)}}function CW(e,t,n,r){var i=n[e];if(i){var a=t[e],o;if(a){var s=n.transition,c=i.transition;if(c){if(!o&&(o=r[e]={}),gW(c))W(o,a);else for(var l=rd(c),u=0;u=0){!o&&(o=r[e]={});for(var p=Dl(a),u=0;u=0)){var f=e.getAnimationStyleProps(),p=f?f.style:null;if(p){!a&&(a=r.style={});for(var m=Dl(n),l=0;l=0?t.getStore().get(i,n):void 0}var a=t.get(r.name,n),o=r&&r.ordinalMeta;return o?o.categories[a]:a}function C(n,r){r??=u;var i=t.getItemVisual(r,`style`),a=i&&i.fill,o=i&&i.opacity,s=y(r,PW).getItemStyle();a!=null&&(s.fill=a),o!=null&&(s.opacity=o);var c={inheritColor:Y(a)?a:Q.color.neutral99},l=b(r,PW),d=nS(l,null,c,!1,!0);d.text=l.getShallow(`show`)?X(e.getFormattedLabel(r,PW),BR(t,r)):null;var f=rS(l,c,!1);return E(n,s),s=cB(s,d,f),n&&T(s,n),s.legacy=!0,s}function w(n,r){r??=u;var i=y(r,NW).getItemStyle(),a=b(r,NW),o=nS(a,null,null,!0,!0);o.text=a.getShallow(`show`)?Vl(e.getFormattedLabel(r,NW),e.getFormattedLabel(r,PW),BR(t,r)):null;var s=rS(a,null,!0);return E(n,i),i=cB(i,o,s),n&&T(i,n),i.legacy=!0,i}function T(e,t){for(var n in t)Z(t,n)&&(e[n]=t[n])}function E(e,t){e&&(e.textFill&&(t.textFill=e.textFill),e.textPosition&&(t.textPosition=e.textPosition))}function D(e,n){if(n??=u,Z(JU,e)){var r=t.getItemVisual(n,`style`);return r?r[JU[e]]:null}if(Z(YU,e))return t.getItemVisual(n,e)}function O(e){if(o.type===`cartesian2d`)return HB(yl({axis:o.getBaseAxis()},e))}function k(){return n.getCurrentSeriesIndices()}function A(e){return uS(e,n)}}function eG(e){var t={};return G(e.dimensions,function(n){var r=e.getDimensionInfo(n);if(!r.isExtraCoord){var i=r.coordDim,a=t[i]=t[i]||[];a[r.coordDimIndex]=e.getDimensionIndex(n)}}),t}function tG(e,t,n,r,i,a,o){if(!r){a.remove(t);return}var s=nG(e,t,n,r,i,a);return s&&o.setItemGraphicEl(n,s),s&&py(s,r.focus,r.blurScope,r.emphasisDisabled),s}function nG(e,t,n,r,i,a){var o=-1,s=t;t&&rG(t,r,i)&&(o=bl(a.childrenRef(),t),t=null);var c=!t,l=t;l?l.clearStates():(l=JW(r),s&&KW(s,l)),r.morph===!1?l.disableMorphing=!0:l.disableMorphing&&(l.disableMorphing=!1),r.tooltipDisabled&&(l.tooltipDisabled=!0),HW.normal.cfg=HW.normal.conOpt=HW.emphasis.cfg=HW.emphasis.conOpt=HW.blur.cfg=HW.blur.conOpt=HW.select.cfg=HW.select.conOpt=null,HW.isLegacy=!1,aG(l,n,r,i,c,HW),iG(l,n,r,i,c),YW(e,l,n,r,HW,i,c),Z(r,`info`)&&(XU(l).info=r.info);for(var u=0;u=0?a.replaceAt(l,o):a.add(l),l}function rG(e,t,n){var r=XU(e),i=t.type,a=t.shape,o=t.style;return n.isUniversalTransitionEnabled()||i!=null&&i!==r.customGraphicType||i===`path`&&gG(a)&&hG(a)!==r.customPathData||i===`image`&&Z(o,`image`)&&o.image!==r.customImagePath}function iG(e,t,n,r,i){var a=n.clipPath;if(a===!1)e&&e.getClipPath()&&e.removeClipPath();else if(a){var o=e.getClipPath();o&&rG(o,a,r)&&(o=null),o||(o=JW(a),e.setClipPath(o)),YW(null,o,t,a,null,r,i)}}function aG(e,t,n,r,i,a){if(!(e.isGroup||e.type===`compoundPath`)){oG(n,null,a),oG(n,NW,a);var o=a.normal.conOpt,s=a.emphasis.conOpt,c=a.blur.conOpt,l=a.select.conOpt;if(o!=null||s!=null||l!=null||c!=null){var u=e.getTextContent();if(o===!1)u&&e.removeTextContent();else{o=a.normal.conOpt=o||{type:`text`},u?u.clearStates():(u=JW(o),e.setTextContent(u)),YW(null,u,t,o,null,r,i);for(var d=o&&o.style,f=0;f=u;p--)uG(t,t.childAt(p),i)}}function uG(e,t,n){t&&hW(t,XU(e).option,n)}function dG(e){new FE(e.oldChildren,e.newChildren,fG,fG,e).add(pG).update(pG).remove(mG).execute()}function fG(e,t){return(e&&e.name)??VW+t}function pG(e,t){var n=this.context,r=e==null?null:n.newChildren[e],i=t==null?null:n.oldChildren[t];nG(n.api,i,n.dataIndex,r,n.seriesModel,n.group)}function mG(e){var t=this.context,n=t.oldChildren[e];n&&hW(n,XU(n).option,t.seriesModel)}function hG(e){return e&&(e.pathData||e.d)}function gG(e){return e&&(Z(e,`pathData`)||Z(e,`d`))}function _G(e){e.registerChartView(qW),e.registerSeriesModel(ZU)}var vG=Td(),yG=hl,bG=q,xG=function(){function e(){this._dragging=!1,this.animationThreshold=15}return e.prototype.render=function(e,t,n,r){var i=t.get(`value`),a=t.get(`status`);if(this._axisModel=e,this._axisPointerModel=t,this._api=n,r||this._lastValue!==i||this._lastStatus!==a){this._lastValue=i,this._lastStatus=a;var o=this._group,s=this._handle;if(!a||a===`hide`){o&&o.hide(),s&&s.hide();return}o&&o.show(),s&&s.show();var c={};this.makeElOption(c,i,e,t,n);var l=c.graphicKey;l!==this._lastGraphicKey&&this.clear(n),this._lastGraphicKey=l;var u=this._moveAnimation=this.determineAnimation(e,t);if(!o)o=this._group=new Ky,this.createPointerEl(o,c,e,t),this.createLabelEl(o,c,e,t),n.getZr().add(o);else{var d=kl(SG,t,u);this.updatePointerEl(o,c,d),this.updateLabelEl(o,c,d,t)}EG(o,t,!0),this._renderHandle(i)}},e.prototype.remove=function(e){this.clear(e)},e.prototype.dispose=function(e){this.clear(e)},e.prototype.determineAnimation=function(e,t){var n=t.get(`animation`),r=e.axis,i=r.type===`category`,a=t.get(`snap`);if(!a&&!i)return!1;if(n===`auto`||n==null){var o=this.animationThreshold;if(i&&dA(r).w>o)return!0;if(a){var s=Tz(e).seriesDataCount,c=r.getExtent();return Math.abs(c[0]-c[1])/s>o}return!1}return n===!0},e.prototype.makeElOption=function(e,t,n,r,i){},e.prototype.createPointerEl=function(e,t,n,r){var i=t.pointer;if(i){var a=vG(e).pointerEl=new nx[i.type](yG(t.pointer));e.add(a)}},e.prototype.createLabelEl=function(e,t,n,r){if(t.label){var i=vG(e).labelEl=new W_(yG(t.label));e.add(i),wG(i,r)}},e.prototype.updatePointerEl=function(e,t,n){var r=vG(e).pointerEl;r&&t.pointer&&(r.setStyle(t.pointer.style),n(r,{shape:t.pointer.shape}))},e.prototype.updateLabelEl=function(e,t,n,r){var i=vG(e).labelEl;i&&(i.setStyle(t.label.style),n(i,{x:t.label.x,y:t.label.y}),wG(i,r))},e.prototype._renderHandle=function(e){if(!this._dragging&&this.updateHandleTransform){var t=this._axisPointerModel,n=this._api.getZr(),r=this._handle,i=t.getModel(`handle`),a=t.get(`status`);if(!i.get(`show`)||!a||a===`hide`){r&&n.remove(r),this._handle=null;return}var o;this._handle||(o=!0,r=this._handle=Ox(i.get(`icon`),{cursor:`move`,draggable:!0,onmousemove:function(e){pM(e.event)},onmousedown:bG(this._onHandleDragMove,this,0,0),drift:bG(this._onHandleDragMove,this),ondragend:bG(this._onHandleDragEnd,this)}),n.add(r)),EG(r,t,!1),r.setStyle(i.getItemStyle(null,[`color`,`borderColor`,`borderWidth`,`opacity`,`shadowColor`,`shadowBlur`,`shadowOffsetX`,`shadowOffsetY`]));var s=i.get(`size`);J(s)||(s=[s,s]),r.scaleX=s[0]/2,r.scaleY=s[1]/2,jP(this,`_doDispatchAxisPointer`,i.get(`throttle`)||0,`fixRate`),this._moveHandleToValue(e,o)}},e.prototype._moveHandleToValue=function(e,t){SG(this._axisPointerModel,!t&&this._moveAnimation,this._handle,TG(this.getHandleTransform(e,this._axisModel,this._axisPointerModel)))},e.prototype._onHandleDragMove=function(e,t){var n=this._handle;if(n){this._dragging=!0;var r=this.updateHandleTransform(TG(n),[e,t],this._axisModel,this._axisPointerModel);this._payloadInfo=r,n.stopAnimation(),n.attr(TG(r)),vG(n).lastProp=null,this._doDispatchAxisPointer()}},e.prototype._doDispatchAxisPointer=function(){if(this._handle){var e=this._payloadInfo,t=this._axisModel;this._api.dispatchAction({type:`updateAxisPointer`,x:e.cursorPoint[0],y:e.cursorPoint[1],tooltipOption:e.tooltipOption,axesInfo:[{axisDim:t.axis.dim,axisIndex:t.componentIndex}]})}},e.prototype._onHandleDragEnd=function(){if(this._dragging=!1,this._handle){var e=this._axisPointerModel.get(`value`);this._moveHandleToValue(e),this._api.dispatchAction({type:`hideTip`})}},e.prototype.clear=function(e){this._lastValue=null,this._lastStatus=null;var t=e.getZr(),n=this._group,r=this._handle;t&&n&&(this._lastGraphicKey=null,n&&t.remove(n),r&&t.remove(r),this._group=null,this._handle=null,this._payloadInfo=null),MP(this,`_doDispatchAxisPointer`)},e.prototype.doClear=function(){},e.prototype.buildLabel=function(e,t,n){return n||=0,{x:e[n],y:e[1-n],width:t[n],height:t[1-n]}},e}();function SG(e,t,n,r){CG(vG(n).lastProp,r)||(vG(n).lastProp=r,t?Yb(n,r,e):(n.stopAnimation(),n.attr(r)))}function CG(e,t){if(Nl(e)&&Nl(t)){var n=!0;return G(t,function(t,r){n&&=CG(e[r],t)}),!!n}return e===t}function wG(e,t){e[t.get([`label`,`show`])?`show`:`hide`]()}function TG(e){return{x:e.x||0,y:e.y||0,rotation:e.rotation||0}}function EG(e,t,n){var r=t.get(`z`),i=t.get(`zlevel`);e&&e.traverse(function(e){e.type!==`group`&&(r!=null&&(e.z=r),i!=null&&(e.zlevel=i),e.silent=n)})}function DG(e){var t=e.get(`type`),n=e.getModel(t+`Style`),r;return t===`line`?(r=n.getLineStyle(),r.fill=null):t===`shadow`&&(r=n.getAreaStyle(),r.stroke=null),r}function OG(e,t,n,r,i){var a=AG(n.get(`value`),t.axis,t.ecModel,n.get(`seriesDataIndices`),{precision:n.get([`label`,`precision`]),formatter:n.get([`label`,`formatter`])}),o=n.getModel(`label`),s=KC(o.get(`padding`)||0),c=o.getFont(),l=Mp(a,c),u=i.position,d=l.width+s[1]+s[3],f=l.height+s[0]+s[2],p=i.align;p===`right`&&(u[0]-=d),p===`center`&&(u[0]-=d/2);var m=i.verticalAlign;m===`bottom`&&(u[1]-=f),m===`middle`&&(u[1]-=f/2),kG(u,d,f,r);var h=o.get(`backgroundColor`);(!h||h===`auto`)&&(h=t.get([`axisLine`,`lineStyle`,`color`])),e.label={x:u[0],y:u[1],style:nS(o,{text:a,font:c,fill:o.getTextColor(),padding:s,backgroundColor:h}),z2:10}}function kG(e,t,n,r){var i=r.getWidth(),a=r.getHeight();e[0]=Math.min(e[0]+t,i)-t,e[1]=Math.min(e[1]+n,a)-n,e[0]=Math.max(e[0],0),e[1]=Math.max(e[1],0)}function AG(e,t,n,r,i){e=t.scale.parse(e);var a=t.scale.getLabel({value:e},{precision:i.precision}),o=i.formatter;if(o){var s={value:QO(t,{value:e}),axisDimension:t.dim,axisIndex:t.index,seriesData:[]};G(r,function(e){var t=n.getSeriesByIndex(e.seriesIndex),r=e.dataIndexInside,i=t&&t.getDataParams(r);i&&s.seriesData.push(i)}),Y(o)?a=o.replace(`{value}`,a):Al(o)&&(a=o(s))}return a}function jG(e,t,n){var r=Ef();return jf(r,r,n.rotation),Af(r,r,n.position),bx([e.dataToCoord(t),(n.labelOffset||0)+(n.labelDirection||1)*(n.labelMargin||0)],r)}function MG(e,t,n,r,i,a){var o=BA.innerTextLayout(n.rotation,0,n.labelDirection);n.labelMargin=i.get([`label`,`margin`]),OG(t,r,i,a,{position:jG(r.axis,e,n),align:o.textAlign,verticalAlign:o.textVerticalAlign})}function NG(e,t,n){return n||=0,{x1:e[n],y1:e[1-n],x2:t[n],y2:t[1-n]}}function PG(e,t,n){return n||=0,{x:e[n],y:e[1-n],width:t[n],height:t[1-n]}}function FG(e,t,n){return dA(e,{fromStat:{sers:K(t,function(e){return n.getSeriesByIndex(e.seriesIndex)})},min:1}).w}function IG(e,t,n){return[fu(du(t[0],t[1]),e-n/2),du(e+n/2,fu(t[0],t[1]))]}var LG=function(e){U(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}return t.prototype.makeElOption=function(e,t,n,r,i){var a=n.axis,o=a.grid,s=r.get(`type`),c=a.getGlobalExtent(),l=RG(o,a).getOtherAxis(a).getGlobalExtent(),u=a.toGlobalCoord(a.dataToCoord(t,!0));if(s&&s!==`none`){var d=DG(r),f=zG[s](a,u,c,l,r.get(`seriesDataIndices`),r.ecModel);f.style=d,e.graphicKey=f.type,e.pointer=f}MG(t,e,sj(o.getRect(),n),n,r,i)},t.prototype.getHandleTransform=function(e,t,n){var r=sj(t.axis.grid.getRect(),t,{labelInside:!1});r.labelMargin=n.get([`handle`,`margin`]);var i=jG(t.axis,e,r);return{x:i[0],y:i[1],rotation:r.rotation+(r.labelDirection<0?Math.PI:0)}},t.prototype.updateHandleTransform=function(e,t,n,r){var i=n.axis,a=i.grid,o=i.getGlobalExtent(!0),s=RG(a,i).getOtherAxis(i).getGlobalExtent(),c=i.dim===`x`?0:1,l=[e.x,e.y];l[c]+=t[c],l[c]=du(o[1],l[c]),l[c]=fu(o[0],l[c]);var u=(s[1]+s[0])/2,d=[u,u];return d[c]=l[c],{x:l[0],y:l[1],rotation:e.rotation,cursorPoint:d,tooltipOption:[{verticalAlign:`middle`},{align:`center`}][c]}},t}(xG);function RG(e,t){var n={};return n[t.dim+`AxisIndex`]=t.index,e.getCartesian(n)}var zG={line:function(e,t,n,r){return{type:`Line`,subPixelOptimize:!0,shape:NG([t,r[0]],[t,r[1]],BG(e))}},shadow:function(e,t,n,r,i,a){var o=FG(e,i,a),s=r[1]-r[0],c=IG(t,n,o),l=c[0],u=c[1];return{type:`Rect`,shape:PG([l,r[0]],[u-l,s],BG(e))}}};function BG(e){return e.dim===`x`?0:1}var VG=function(e){U(t,e);function t(){var n=e!==null&&e.apply(this,arguments)||this;return n.type=t.type,n}return t.type=`axisPointer`,t.defaultOption={show:`auto`,z:50,type:`line`,snap:!1,triggerTooltip:!0,triggerEmphasis:!0,value:null,status:null,link:[],animation:null,animationDurationUpdate:200,lineStyle:{color:Q.color.border,width:1,type:`dashed`},shadowStyle:{color:Q.color.shadowTint},label:{show:!0,formatter:null,precision:`auto`,margin:3,color:Q.color.neutral00,padding:[5,7,5,7],backgroundColor:Q.color.accent60,borderColor:null,borderWidth:0,borderRadius:3},handle:{show:!1,icon:`M10.7,11.9v-1.3H9.3v1.3c-4.9,0.3-8.8,4.4-8.8,9.4c0,5,3.9,9.1,8.8,9.4h1.3c4.9-0.3,8.8-4.4,8.8-9.4C19.5,16.3,15.6,12.2,10.7,11.9z M13.3,24.4H6.7v-1.2h6.6z M13.3,22H6.7v-1.2h6.6z M13.3,19.6H6.7v-1.2h6.6z`,size:45,margin:50,color:Q.color.accent40,throttle:40}},t}(Sw),HG=Td(),UG=G;function WG(e,t,n){if(!ou.node){var r=t.getZr();HG(r).records||(HG(r).records={}),GG(r,t);var i=HG(r).records[e]||(HG(r).records[e]={});i.handler=n}}function GG(e,t){if(HG(e).initialized)return;HG(e).initialized=!0,n(`click`,kl(JG,`click`)),n(`mousemove`,kl(JG,`mousemove`)),n(`mousewheel`,kl(JG,`mousewheel`)),n(`globalout`,qG);function n(n,r){e.on(n,function(n){var i=YG(t);UG(HG(e).records,function(e){e&&r(e,n,i.dispatchAction)}),KG(i.pendings,t)})}}function KG(e,t){var n=e.showTip.length,r=e.hideTip.length,i;n?i=e.showTip[n-1]:r&&(i=e.hideTip[r-1]),i&&(i.dispatchAction=null,t.dispatchAction(i))}function qG(e,t,n){e.handler(`leave`,null,n)}function JG(e,t,n,r){t.handler(e,n,r)}function YG(e){var t={showTip:[],hideTip:[]},n=function(r){var i=t[r.type];i?i.push(r):(r.dispatchAction=n,e.dispatchAction(r))};return{dispatchAction:n,pendings:t}}function XG(e,t){if(!ou.node){var n=t.getZr();(HG(n).records||{})[e]&&(HG(n).records[e]=null)}}var ZG=function(e){U(t,e);function t(){var n=e!==null&&e.apply(this,arguments)||this;return n.type=t.type,n}return t.prototype.render=function(e,t,n){var r=t.getComponent(`tooltip`),i=e.get(`triggerOn`)||r&&r.get(`triggerOn`)||`mousemove|click|mousewheel`;WG(`axisPointer`,n,function(e,t,n){i!==`none`&&(e===`leave`||i.indexOf(e)>=0)&&n({type:`updateAxisPointer`,currTrigger:e,x:t&&t.offsetX,y:t&&t.offsetY})})},t.prototype.remove=function(e,t){XG(`axisPointer`,t)},t.prototype.dispose=function(e,t){XG(`axisPointer`,t)},t.type=`axisPointer`,t}(_P);function QG(e,t){var n=[],r=e.seriesIndex,i;if(r==null||!(i=t.getSeriesByIndex(r)))return{point:[]};var a=i.getData(),o=wd(a,e);if(o==null||o<0||J(o))return{point:[]};var s=a.getItemGraphicEl(o),c=i.coordinateSystem;if(i.getTooltipPosition)n=i.getTooltipPosition(o)||[];else if(c&&c.dataToPoint){if(e.isStacked){var l=c.getBaseAxis(),u=c.getOtherAxis(l).dim,d=l.dim,f=+(u===`x`||u===`radius`),p=a.mapDimension(d),m=[];m[f]=a.get(p,o),m[1-f]=a.get(a.getCalculationInfo(`stackResultDimension`),o),n=c.dataToPoint(m)||[]}else n=c.dataToPoint(a.getValues(K(c.dimensions,function(e){return a.mapDimension(e)}),o))||[]}else if(s){var h=s.getBoundingRect().clone();h.applyTransform(s.transform),n=[h.x+h.width/2,h.y+h.height/2]}return{point:n,el:s}}var $G=Td();function eK(e,t,n){var r=e.currTrigger,i=[e.x,e.y],a=e,o=e.dispatchAction||q(n.dispatchAction,n),s=t.getComponent(`axisPointer`).coordSysAxesInfo;if(s){uK(i)&&(i=QG({seriesIndex:a.seriesIndex,dataIndex:a.dataIndex},t).point);var c=uK(i),l=a.axesInfo,u=s.axesInfo,d=r===`leave`||uK(i),f={},p={},m={list:[],map:{}},h={showPointer:kl(rK,p),showTooltip:kl(iK,m)};G(s.coordSysMap,function(e,t){var n=c||e.containPoint(i);G(s.coordSysAxesInfo[t],function(e,t){var r=e.axis,a=cK(l,e);if(!d&&n&&(!l||a)){var o=a&&a.value;o==null&&!c&&(o=r.pointToData(i)),o!=null&&tK(e,o,h,!1,f)}})});var g={};return G(u,function(e,t){var n=e.linkGroup;n&&!p[t]&&G(n.axesInfo,function(t,r){var i=p[r];if(t!==e&&i){var a=i.value;n.mapper&&(a=e.axis.scale.parse(n.mapper(a,lK(t),lK(e)))),g[e.key]=a}})}),G(g,function(e,t){tK(u[t],e,h,!0,f)}),aK(p,u,f),oK(m,i,e,o),sK(u,o,n),f}}function tK(e,t,n,r,i){var a=e.axis;if(!a.scale.isBlank()&&a.containData(t)){if(!e.involveSeries){n.showPointer(e,t);return}var o=nK(t,e),s=o.payloadBatch,c=o.snapToValue;s[0]&&i.seriesIndex==null&&W(i,s[0]),!r&&e.snap&&a.containData(c)&&c!=null&&(t=c),n.showPointer(e,t,s),n.showTooltip(e,o,c)}}function nK(e,t){var n=t.axis,r=n.dim,i=e,a=[],o=Number.MAX_VALUE,s=-1;return G(t.seriesModels,function(t,c){var l=t.getData().mapDimensionsAll(r),u,d;if(t.getAxisTooltipData){var f=t.getAxisTooltipData(l,e,n);d=f.dataIndices,u=f.nestestValue}else{if(d=t.indicesOfNearest(r,l[0],e,n.type===`category`?.5:null),!d.length)return;u=t.getData().get(l[0],d[0])}if(qu(u)){var p=e-u,m=Math.abs(p);m<=o&&((m=0&&s<0)&&(o=m,s=p,i=u,a.length=0),G(d,function(e){a.push({seriesIndex:t.seriesIndex,dataIndexInside:e,dataIndex:t.getData().getRawIndex(e)})}))}}),{payloadBatch:a,snapToValue:i}}function rK(e,t,n,r){e[t.key]={value:n,payloadBatch:r}}function iK(e,t,n,r){var i=n.payloadBatch,a=t.axis,o=a.model,s=t.axisPointerModel;if(t.triggerTooltip&&i.length){var c=t.coordSys.model,l=Oz(c),u=e.map[l];u||(u=e.map[l]={coordSysId:c.id,coordSysIndex:c.componentIndex,coordSysType:c.type,coordSysMainType:c.mainType,dataByAxis:[]},e.list.push(u)),u.dataByAxis.push({axisDim:a.dim,axisIndex:o.componentIndex,axisType:o.type,axisId:o.id,value:r,valueLabelOpt:{precision:s.get([`label`,`precision`]),formatter:s.get([`label`,`formatter`])},seriesDataIndices:i.slice()})}}function aK(e,t,n){var r=n.axesInfo=[];G(t,function(t,n){var i=t.axisPointerModel.option,a=e[n];a?(!t.useHandle&&(i.status=`show`),i.value=a.value,i.seriesDataIndices=(a.payloadBatch||[]).slice()):!t.useHandle&&(i.status=`hide`),i.status===`show`&&r.push({axisDim:t.axis.dim,axisIndex:t.axis.model.componentIndex,value:i.value})})}function oK(e,t,n,r){if(uK(t)||!e.list.length){r({type:`hideTip`});return}var i=((e.list[0].dataByAxis[0]||{}).seriesDataIndices||[])[0]||{};r({type:`showTip`,escapeConnect:!0,x:t[0],y:t[1],tooltipOption:n.tooltipOption,position:n.position,dataIndexInside:i.dataIndexInside,dataIndex:i.dataIndex,seriesIndex:i.seriesIndex,dataByCoordSys:e.list})}function sK(e,t,n){var r=n.getZr(),i=`axisPointerLastHighlights`,a=$G(r)[i]||{},o=$G(r)[i]={};G(e,function(e,t){var n=e.axisPointerModel.option;n.status===`show`&&e.triggerEmphasis&&G(n.seriesDataIndices,function(e){o[e.seriesIndex+`|`+e.dataIndex]=e})});var s=[],c=[];function l(e){return{seriesIndex:e.seriesIndex,dataIndex:e.dataIndex}}G(a,function(e,t){!o[t]&&c.push(l(e))}),G(o,function(e,t){!a[t]&&s.push(l(e))}),c.length&&n.dispatchAction({type:`downplay`,escapeConnect:!0,notBlur:!0,batch:c}),s.length&&n.dispatchAction({type:`highlight`,escapeConnect:!0,notBlur:!0,batch:s})}function cK(e,t){for(var n=0;n<(e||[]).length;n++){var r=e[n];if(t.axis.dim===r.axisDim&&t.axis.model.componentIndex===r.axisIndex)return r}}function lK(e){var t=e.axis.model,n={},r=n.axisDim=e.axis.dim;return n.axisIndex=n[r+`AxisIndex`]=t.componentIndex,n.axisName=n[r+`AxisName`]=t.name,n.axisId=n[r+`AxisId`]=t.id,n}function uK(e){return!e||e[0]==null||isNaN(e[0])||e[1]==null||isNaN(e[1])}function dK(e){Az.registerAxisPointerClass(`CartesianAxisPointer`,LG),e.registerComponentModel(VG),e.registerComponentView(ZG),e.registerPreprocessor(function(e){if(e){(!e.axisPointer||e.axisPointer.length===0)&&(e.axisPointer={});var t=e.axisPointer.link;t&&!J(t)&&(e.axisPointer.link=[t])}}),e.registerProcessor(e.PRIORITY.PROCESSOR.STATISTIC,{overallReset:function(e,t){e.getComponent(`axisPointer`).coordSysAxesInfo=vz(e,t)}}),e.registerAction({type:`updateAxisPointer`,event:`updateAxisPointer`,update:`:updateAxisPointer`},eK)}function fK(e){aR(Vz),aR(dK)}function pK(e,t){var n=e.existing;if(t.id=e.keyInfo.id,!t.type&&n&&(t.type=n.type),t.parentId==null){var r=t.parentOption;r?t.parentId=r.id:n&&(t.parentId=n.parentId)}t.parentOption=null}function mK(e,t){var n;return G(t,function(t){e[t]!=null&&e[t]!==`auto`&&(n=!0)}),n}function hK(e,t,n){var r=W({},n),i=e[t],a=n.$action||`merge`;a===`merge`?i?(gl(i,r,!0),vw(i,r,{ignoreSize:!0}),bw(n,i),vK(n,i),vK(n,i,`shape`),vK(n,i,`style`),vK(n,i,`extra`),n.clipPath=i.clipPath):e[t]=r:a===`replace`?e[t]=r:a===`remove`&&i&&(e[t]=null)}var gK=[`transition`,`enterFrom`,`leaveTo`],_K=gK.concat([`enterAnimation`,`updateAnimation`,`leaveAnimation`]);function vK(e,t,n){if(n&&(!e[n]&&t[n]&&(e[n]={}),e=e[n],t=t[n]),e&&t)for(var r=n?gK:_K,i=0;i=0;c--){var l=n[c],u=_d(l.id,null),d=u==null?null:i.get(u);if(d){var f=d.parent,h=SK(f),g=f===r?{width:a,height:o}:{width:h.width,height:h.height},_={},v=gw(d,l,g,null,{hv:l.hv,boundingMode:l.bounding},_);if(!SK(d).isNew&&v){for(var y=l.transition,b={},x=0;x=0)?b[S]=C:d[S]=C}Yb(d,b,e,0)}else d.attr(_)}}},t.prototype._clear=function(){var e=this,t=this._elMap;t.each(function(n){EK(n,SK(n).option,t,e._lastGraphicModel)}),this._elMap=$l()},t.prototype.dispose=function(){this._clear()},t.type=`graphic`,t}(_P);function wK(e){var t=new(Z(xK,e)?xK[e]:ux(e))({});return SK(t).type=e,t}function TK(e,t,n,r){var i=wK(n);return t.add(i),r.set(e,i),SK(i).id=e,SK(i).isNew=!0,i}function EK(e,t,n,r){e&&e.parent&&(e.type===`group`&&e.traverse(function(e){EK(e,t,n,r)}),hW(e,t,r),n.removeKey(SK(e).id))}function DK(e,t,n,r){e.isGroup||G([[`cursor`,vg.prototype.cursor],[`zlevel`,r||0],[`z`,n||0],[`z2`,0]],function(n){var r=n[0];Z(t,r)?e[r]=X(t[r],n[1]):e[r]??(e[r]=n[1])}),G(Dl(t),function(n){if(n.indexOf(`on`)===0){var r=t[n];e[n]=Al(r)?r:null}}),Z(t,`draggable`)&&(e.draggable=t.draggable),t.name!=null&&(e.name=t.name),t.id!=null&&(e.id=t.id)}function OK(e){return e=W({},e),G([`id`,`parentId`,`$action`,`hv`,`bounding`,`textContent`,`clipPath`].concat(cw),function(t){delete e[t]}),e}function kK(e,t,n){var r=iv(e).eventData;!e.silent&&!e.ignore&&!r&&(r=iv(e).eventData={componentType:`graphic`,componentIndex:t.componentIndex,name:e.name}),r&&(r.info=n.info)}function AK(e){e.registerComponentModel(bK),e.registerComponentView(CK),e.registerPreprocessor(function(e){var t=e.graphic;J(t)?e.graphic=!t[0]||!t[0].elements?[{elements:t}]:[e.graphic[0]]:t&&!t.elements&&(e.graphic=[{elements:[t]}])})}var jK=[`x`,`y`,`radius`,`angle`,`single`],MK=Td(),NK=[`cartesian2d`,`polar`,`singleAxis`];function PK(e){return bl(NK,e.get(`coordinateSystem`))>=0}function FK(e){return e+`Axis`}function IK(e,t){var n=$l(),r=[],i=$l();e.eachComponent({mainType:`dataZoom`,query:t},function(e){i.get(e.uid)||s(e)});var a;do a=!1,e.eachComponent(`dataZoom`,o);while(a);function o(e){!i.get(e.uid)&&c(e)&&(s(e),a=!0)}function s(e){i.set(e.uid,!0),r.push(e),l(e)}function c(e){var t=!1;return e.eachTargetAxis(function(e,r){var i=n.get(e);i&&i[r]&&(t=!0)}),t}function l(e){e.eachTargetAxis(function(e,t){(n.get(e)||n.set(e,[]))[t]=!0})}return r}function LK(e){var t=e.ecModel,n={infoList:[],infoMap:$l()};return e.eachTargetAxis(function(e,r){var i=t.getComponent(FK(e),r);if(i){var a=i.getCoordSysModel();if(a){var o=a.uid,s=n.infoMap.get(o);s||(s={model:a,axisModels:[]},n.infoList.push(s),n.infoMap.set(o,s)),s.axisModels.push(i)}}}),n}function RK(e){var t=MK(Hk(e));return t.axisProxyMap||=$l()}function zK(e){if(e)return RK(e.ecModel).get(e.uid)}function BK(e,t){RK(e.ecModel).set(e.uid,t)}function VK(e,t){var n=t.getAxisModel().axis.__alignTo;return n&&e.getAxisProxy(n.dim,n.model.componentIndex)?zK(n.model):null}var HK=function(){function e(){this.indexList=[],this.indexMap=[]}return e.prototype.add=function(e){this.indexMap[e]||(this.indexList.push(e),this.indexMap[e]=!0)},e}(),UK=function(e){U(t,e);function t(){var n=e!==null&&e.apply(this,arguments)||this;return n.type=t.type,n._autoThrottle=!0,n._noTarget=!0,n._rangePropMode=[`percent`,`percent`],n}return t.prototype.init=function(e,t,n){var r=WK(e);this.settledOption=r,this.mergeDefaultAndTheme(e,n),this._doInit(r)},t.prototype.mergeOption=function(e){var t=WK(e);gl(this.option,e,!0),gl(this.settledOption,t,!0),this._doInit(t)},t.prototype._doInit=function(e){var t=this.option;this._setDefaultThrottle(e),this._updateRangeUse(e);var n=this.settledOption;G([[`start`,`startValue`],[`end`,`endValue`]],function(e,r){this._rangePropMode[r]===`value`&&(t[e[0]]=n[e[0]]=null)},this),this._resetTarget()},t.prototype._resetTarget=function(){var e=this.get(`orient`,!0),t=this._targetAxisInfoMap=$l();this._fillSpecifiedTargetAxis(t)?this._orient=e||this._makeAutoOrientByTargetAxis():(this._orient=e||`horizontal`,this._fillAutoTargetAxisByOrient(t,this._orient)),this._noTarget=!0,t.each(function(e){e.indexList.length&&(this._noTarget=!1)},this)},t.prototype._fillSpecifiedTargetAxis=function(e){var t=!1;return G(jK,function(n){var r=this.getReferringComponents(FK(n),Ad);if(r.specified){t=!0;var i=new HK;G(r.models,function(e){i.add(e.componentIndex)}),e.set(n,i)}},this),t},t.prototype._fillAutoTargetAxisByOrient=function(e,t){var n=this.ecModel,r=!0;if(r){var i=t===`vertical`?`y`:`x`,a=n.findComponents({mainType:i+`Axis`});o(a,i)}if(r){var a=n.findComponents({mainType:`singleAxis`,filter:function(e){return e.get(`orient`,!0)===t}});o(a,`single`)}function o(t,n){var i=t[0];if(i){var a=new HK;if(a.add(i.componentIndex),e.set(n,a),r=!1,n===`x`||n===`y`){var o=i.getReferringComponents(`grid`,kd).models[0];o&&G(t,function(e){i.componentIndex!==e.componentIndex&&o===e.getReferringComponents(`grid`,kd).models[0]&&a.add(e.componentIndex)})}}}r&&G(jK,function(t){if(r){var i=n.findComponents({mainType:FK(t),filter:function(e){return e.get(`type`,!0)===`category`}});if(i[0]){var a=new HK;a.add(i[0].componentIndex),e.set(t,a),r=!1}}},this)},t.prototype._makeAutoOrientByTargetAxis=function(){var e;return this.eachTargetAxis(function(t){!e&&(e=t)},this),e===`y`?`vertical`:`horizontal`},t.prototype._setDefaultThrottle=function(e){if(e.hasOwnProperty(`throttle`)&&(this._autoThrottle=!1),this._autoThrottle){var t=this.ecModel.option;this.option.throttle=t.animation&&t.animationDurationUpdate>0?100:20}},t.prototype._updateRangeUse=function(e){var t=this._rangePropMode,n=this.get(`rangeMode`);G([[`start`,`startValue`],[`end`,`endValue`]],function(r,i){var a=e[r[0]]!=null,o=e[r[1]]!=null;a&&!o?t[i]=`percent`:!a&&o?t[i]=`value`:n?t[i]=n[i]:a&&(t[i]=`percent`)})},t.prototype.noTarget=function(){return this._noTarget},t.prototype.getFirstTargetAxisModel=function(){var e;return this.eachTargetAxis(function(t,n){e??=this.ecModel.getComponent(FK(t),n)},this),e},t.prototype.eachTargetAxis=function(e,t){this._targetAxisInfoMap.each(function(n,r){G(n.indexList,function(n){e.call(t,r,n)})})},t.prototype.getAxisProxy=function(e,t){return zK(this.getAxisModel(e,t))},t.prototype.getAxisModel=function(e,t){var n=this._targetAxisInfoMap.get(e);if(n&&n.indexMap[t])return this.ecModel.getComponent(FK(e),t)},t.prototype.setRawRange=function(e){var t=this.option,n=this.settledOption;G([[`start`,`startValue`],[`end`,`endValue`]],function(r){(e[r[0]]!=null||e[r[1]]!=null)&&(t[r[0]]=n[r[0]]=e[r[0]],t[r[1]]=n[r[1]]=e[r[1]])},this),this._updateRangeUse(e)},t.prototype.setCalculatedRange=function(e){var t=this.option;G([`start`,`startValue`,`end`,`endValue`],function(n){t[n]=e[n]})},t.prototype.getPercentRange=function(){var e=this.findRepresentativeAxisProxy();if(e)return e.getWindow().percent},t.prototype.getValueRange=function(e,t){if(e==null&&t==null){var n=this.findRepresentativeAxisProxy();if(n)return n.getWindow().value}else return this.getAxisProxy(e,t).getWindow().value},t.prototype.findRepresentativeAxisProxy=function(e){if(e)return zK(e);for(var t,n=this._targetAxisInfoMap.keys(),r=0;ra[1];if(u&&!d&&!f)return!0;u&&(i=!0),d&&(t=!0),f&&(n=!0)}return i&&t&&n})}else G(r,function(n){if(i===`empty`)e.setData(t=t.map(n,function(e){return o(e)?e:NaN}));else{var r={};r[n]=a,t.selectRange(r)}});G(r,function(e){t.setApproximateExtent(a,e)})}});function o(e){return e>=a[0]&&e<=a[1]}},e.prototype._updateMinMaxSpan=function(){var e=this._minMaxSpan={},t=this._dataZoomModel,n=this._extent;G([`min`,`max`],function(r){var i=t.get(r+`Span`),a=t.get(r+`ValueSpan`);a!=null&&(a=this.getAxisModel().axis.scale.parse(a)),a==null?i!=null&&(a=Su(i,[0,100],n,!0)-n[0]):i=Su(n[0]+a,n,[0,100],!0),e[r+`Span`]=i,e[r+`ValueSpan`]=a},this)},e}(),YK={dirtyOnOverallProgress:!0,getTargetSeries:function(e){function t(t){e.eachComponent(`dataZoom`,function(n){n.eachTargetAxis(function(r,i){t(r,i,e.getComponent(FK(r),i),n)})})}var n=[];t(function(t,r,i,a){if(!zK(i)){var o=new JK(t,r,a,e);n.push(o),BK(i,o)}});var r=$l();return G(n,function(e){G(e.getTargetSeriesModels(),function(e){r.set(e.uid,e)})}),r},overallReset:function(e,t){e.eachComponent(`dataZoom`,function(e){var n=[];e.eachTargetAxis(function(t,r){var i=e.getAxisProxy(t,r),a=VK(e,i);a?n.push([i,a]):i.reset(e,null)}),G(n,function(t){t[0].reset(e,t[1].getWindow().percentInverted)}),e.eachTargetAxis(function(n,r){e.getAxisProxy(n,r).filterData(e,t)})}),e.eachComponent(`dataZoom`,function(e){var t=e.findRepresentativeAxisProxy();if(t){var n=t.getWindow(),r=n.percent,i=n.value;e.setCalculatedRange({start:r[0],end:r[1],startValue:i[0],endValue:i[1]})}})}};function XK(e){e.registerAction(`dataZoom`,function(e,t){G(IK(t,e),function(t){t.setRawRange({start:e.start,end:e.end,startValue:e.startValue,endValue:e.endValue})})})}var ZK=Kd();function QK(e){ZK(e,function(){e.registerProcessor(e.PRIORITY.PROCESSOR.FILTER,YK),XK(e),e.registerSubTypeDefaulter(`dataZoom`,function(){return`slider`})})}function $K(e){e.registerComponentModel(GK),e.registerComponentView(qK),QK(e)}var eq=function(){function e(){}return e}(),tq={};function nq(e,t){tq[e]=t}function rq(e){return tq[e]}var iq=function(e){U(t,e);function t(){var n=e!==null&&e.apply(this,arguments)||this;return n.type=t.type,n}return t.prototype.init=function(t,n,r){var i=r.getTheme().get(`toolbox`),a=i?i.feature:null;a&&(this._themeFeatureOption=W({},a),i.feature={}),e.prototype.init.call(this,t,n,r),a&&(i.feature=a)},t.prototype.optionUpdated=function(){G(this.option.feature,function(e,t){var n=this._themeFeatureOption,r=rq(t);r&&(r.getDefaultOption&&(r.defaultOption=r.getDefaultOption(this.ecModel)),n&&n[t]&&(gl(e,n[t]),n[t]=null),gl(e,r.defaultOption))},this)},t.type=`toolbox`,t.layoutMode={type:`box`,ignoreSize:!0},t.defaultOption={show:!0,z:6,orient:`horizontal`,left:`right`,top:`top`,backgroundColor:`transparent`,borderColor:Q.color.border,borderRadius:0,borderWidth:0,padding:Q.size.m,itemSize:15,itemGap:Q.size.s,showTitle:!0,iconStyle:{borderColor:Q.color.accent50,color:`none`},emphasis:{iconStyle:{borderColor:Q.color.accent70}},tooltip:{show:!1,position:`bottom`}},t}(Sw);function aq(e,t){var n=KC(t.get(`padding`)),r=t.getItemStyle([`color`,`opacity`]);return r.fill=t.get(`backgroundColor`),new z_({shape:{x:e.x-n[3],y:e.y-n[0],width:e.width+n[1]+n[3],height:e.height+n[0]+n[2],r:t.get(`borderRadius`)},style:r,silent:!0,z2:-1})}var oq=function(e){U(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}return t.prototype.render=function(e,t,n,r){var i=this.group;if(i.removeAll(),!e.get(`show`))return;var a=+e.get(`itemSize`),o=e.get(`orient`)===`vertical`,s=e.get(`feature`)||{},c=this._features||=$l(),l=[];G(s,function(e,t){l.push(t)}),new FE(this._featureNames||[],l).add(u).update(u).remove(kl(u,null)).execute(),this._featureNames=Tl(l,function(e){return c.hasKey(e)});function u(i,a){var o=i!=null&&a==null,u=i!=null&&a!=null,f=i==null,p=o||u?l[i]:l[a],m=s[p],h=o||u?new TS(m,e,t):null,g=h&&h.get(`show`),_;if(o){if(!g)return;if(sq(p))_={onclick:h.option.onclick,featureName:p};else{var v=rq(p);if(!v)return;_=new v}c.set(p,_)}else _=c.get(p);if(f||!g){cq(_)&&_.dispose&&_.dispose(t,n),c.removeKey(p);return}r&&r.newTitle!=null&&r.featureName===p&&(m.title=r.newTitle),o&&(_.uid=DS(`toolbox-feature`)),_.model=h,_.ecModel=t,_.api=n,d(h,_,p),h.setIconStatus=function(e,t){var n=this.option,r=this.iconPaths;n.iconStatus=n.iconStatus||{},n.iconStatus[e]=t,r[e]&&(t===`emphasis`?Jv:Yv)(r[e])},cq(_)&&_.render&&_.render(h,t,n,r)}function d(r,s,c){var l=r.getModel(`iconStyle`),u=r.getModel([`emphasis`,`iconStyle`]),d=s instanceof eq&&s.getIcons?s.getIcons():r.get(`icon`),f=r.get(`title`)||{},p,m;Y(d)?(p={},p[c]=d):p=d,Y(f)?(m={},m[c]=f):m=f;var h=r.iconPaths={};G(p,function(c,d){var f=Ox(c,{},{x:-a/2,y:-a/2,width:a,height:a});f.setStyle(l.getItemStyle());var p=f.ensureState(`emphasis`);p.style=u.getItemStyle();var g=new W_({style:{text:m[d],align:u.get(`textAlign`),borderRadius:u.get(`textBorderRadius`),padding:u.get(`textPadding`),fill:null,font:uS({fontStyle:u.get(`textFontStyle`),fontFamily:u.get(`textFontFamily`),fontSize:u.get(`textFontSize`),fontWeight:u.get(`textFontWeight`)},t)},ignore:!0});f.setTextContent(g),Ix({el:f,componentModel:e,itemName:d,formatterParamsExtra:{title:m[d]}}),f.__title=m[d],f.on(`mouseover`,function(){var t=u.getItemStyle(),r=o?e.get(`right`)==null&&e.get(`left`)!==`right`?`right`:`left`:e.get(`bottom`)==null&&e.get(`top`)!==`bottom`?`bottom`:`top`;g.setStyle({fill:u.get(`textFill`)||t.fill||t.stroke||Q.color.neutral99,backgroundColor:u.get(`textBackgroundColor`)}),f.setTextConfig({position:u.get(`textPosition`)||r}),g.ignore=!e.get(`showTitle`),n.enterEmphasis(this)}).on(`mouseout`,function(){r.get([`iconStatus`,d])!==`emphasis`&&n.leaveEmphasis(this),g.hide()}),(r.get([`iconStatus`,d])===`emphasis`?Jv:Yv)(f),i.add(f),f.on(`click`,q(s.onclick,s,t,n,d)),h[d]=f})}var f=hw(e,n).refContainer,p=e.getBoxLayoutParams(),m=e.get(`padding`),h=pw(p,f,m);dw(e.get(`orient`),i,e.get(`itemGap`),h.width,h.height),gw(i,p,f,m),i.add(aq(i.getBoundingRect(),e)),o||i.eachChild(function(e){var t=e.__title,r=e.ensureState(`emphasis`),o=r.textConfig||={},s=e.getTextContent(),c=s&&s.ensureState(`emphasis`);if(c&&!Al(c)&&t){var l=c.style||={},u=Mp(t,W_.makeFont(l)),d=e.x+i.x,f=e.y+i.y+a,p=!1;f+u.height>n.getHeight()&&(o.position=`top`,p=!0);var m=p?-5-u.height:a+10;d+u.width/2>n.getWidth()?(o.position=[`100%`,m],l.align=`right`):d-u.width/2<0&&(o.position=[0,m],l.align=`left`)}})},t.prototype.updateView=function(e,t,n,r){G(this._features,function(e){e&&e instanceof eq&&e.updateView&&e.updateView(e.model,t,n,r)})},t.prototype.dispose=function(e,t){G(this._features,function(n){n&&n instanceof eq&&n.dispose&&n.dispose(e,t)})},t.type=`toolbox`,t}(_P);function sq(e){return e.indexOf(`my`)===0}function cq(e){return e instanceof eq}var lq=function(e){U(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}return t.prototype.onclick=function(e,t){var n=this.model,r=n.get(`name`)||e.get(`title.0.text`)||`echarts`,i=t.getZr().painter.getType()===`svg`,a=i?`svg`:n.get(`type`,!0)||`png`,o=t.getConnectedDataURL({type:a,backgroundColor:n.get(`backgroundColor`,!0)||e.get(`backgroundColor`)||Q.color.neutral00,connectedBackgroundColor:n.get(`connectedBackgroundColor`),excludeComponents:n.get(`excludeComponents`),pixelRatio:n.get(`pixelRatio`)}),s=ou.browser;if(typeof MouseEvent==`function`&&(s.newEdge||!s.ie&&!s.edge)){var c=document.createElement(`a`);c.download=r+`.`+a,c.target=`_blank`,c.href=o;var l=new MouseEvent(`click`,{view:document.defaultView,bubbles:!0,cancelable:!1});c.dispatchEvent(l)}else if(window.navigator.msSaveOrOpenBlob||i){var u=o.split(`,`),d=u[0].indexOf(`base64`)>-1,f=i?decodeURIComponent(u[1]):u[1];d&&(f=window.atob(f));var p=r+`.`+a;if(window.navigator.msSaveOrOpenBlob){for(var m=f.length,h=new Uint8Array(m);m--;)h[m]=f.charCodeAt(m);var g=new Blob([h]);window.navigator.msSaveOrOpenBlob(g,p)}else{var _=document.createElement(`iframe`);document.body.appendChild(_);var v=_.contentWindow,y=v.document;y.open(`image/svg+xml`,`replace`),y.write(f),y.close(),v.focus(),y.execCommand(`SaveAs`,!0,p),document.body.removeChild(_)}}else{var b=n.get(`lang`),x=``,S=window.open();S.document.write(x),S.document.title=r}},t.getDefaultOption=function(e){return{show:!0,icon:`M4.7,22.9L29.3,45.5L54.7,23.4M4.6,43.6L4.6,58L53.8,58L53.8,43.6M29.2,45.1L29.2,0`,title:e.getLocaleModel().get([`toolbox`,`saveAsImage`,`title`]),type:`png`,connectedBackgroundColor:Q.color.neutral00,name:``,excludeComponents:[`toolbox`],lang:e.getLocaleModel().get([`toolbox`,`saveAsImage`,`lang`])}},t}(eq),uq=`__ec_magicType_stack__`,dq=[[`line`,`bar`],[`stack`]],fq=function(e){U(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}return t.prototype.getIcons=function(){var e=this.model,t=e.get(`icon`),n={};return G(e.get(`type`),function(e){t[e]&&(n[e]=t[e])}),n},t.getDefaultOption=function(e){return{show:!0,type:[],icon:{line:`M4.1,28.9h7.1l9.3-22l7.4,38l9.7-19.7l3,12.8h14.9M4.1,58h51.4`,bar:`M6.7,22.9h10V48h-10V22.9zM24.9,13h10v35h-10V13zM43.2,2h10v46h-10V2zM3.1,58h53.7`,stack:`M8.2,38.4l-8.4,4.1l30.6,15.3L60,42.5l-8.1-4.1l-21.5,11L8.2,38.4z M51.9,30l-8.1,4.2l-13.4,6.9l-13.9-6.9L8.2,30l-8.4,4.2l8.4,4.2l22.2,11l21.5-11l8.1-4.2L51.9,30z M51.9,21.7l-8.1,4.2L35.7,30l-5.3,2.8L24.9,30l-8.4-4.1l-8.3-4.2l-8.4,4.2L8.2,30l8.3,4.2l13.9,6.9l13.4-6.9l8.1-4.2l8.1-4.1L51.9,21.7zM30.4,2.2L-0.2,17.5l8.4,4.1l8.3,4.2l8.4,4.2l5.5,2.7l5.3-2.7l8.1-4.2l8.1-4.2l8.1-4.1L30.4,2.2z`},title:e.getLocaleModel().get([`toolbox`,`magicType`,`title`]),option:{},seriesIndex:{}}},t.prototype.onclick=function(e,t,n){var r=this.model,i=r.get([`seriesIndex`,n]);if(pq[n]){var a={series:[]};G(dq,function(e){bl(e,n)>=0&&G(e,function(e){r.setIconStatus(e,`normal`)})}),r.setIconStatus(n,`emphasis`),e.eachComponent({mainType:`series`,query:i==null?null:{seriesIndex:i}},function(e){var t=e.subType,i=e.id,o=pq[n](t,i,e,r);o&&(yl(o,e.option),a.series.push(o));var s=e.coordinateSystem;if(s&&s.type===`cartesian2d`&&(n===`line`||n===`bar`)){var c=s.getAxesByScale(`ordinal`)[0];if(c){var l=c.dim+`Axis`,u=e.getReferringComponents(l,kd).models[0].componentIndex;a[l]=a[l]||[];for(var d=0;d<=u;d++)a[l][u]=a[l][u]||{};a[l][u].boundaryGap=n===`bar`}}});var o,s=n;n===`stack`&&(o=gl({stack:r.option.title.tiled,tiled:r.option.title.stack},r.option.title),r.get([`iconStatus`,n])!==`emphasis`&&(s=`tiled`)),t.dispatchAction({type:`changeMagicType`,currentType:s,newOption:a,newTitle:o,featureName:`magicType`})}},t}(eq),pq={line:function(e,t,n,r){if(e===`bar`)return gl({id:t,type:`line`,data:n.get(`data`),stack:n.get(`stack`),markPoint:n.get(`markPoint`),markLine:n.get(`markLine`)},r.get([`option`,`line`])||{},!0)},bar:function(e,t,n,r){if(e===`line`)return gl({id:t,type:`bar`,data:n.get(`data`),stack:n.get(`stack`),markPoint:n.get(`markPoint`),markLine:n.get(`markLine`)},r.get([`option`,`bar`])||{},!0)},stack:function(e,t,n,r){var i=n.get(`stack`)===uq;if(e===`line`||e===`bar`)return r.setIconStatus(`stack`,i?`normal`:`emphasis`),gl({id:t,stack:i?``:uq},r.get([`option`,`stack`])||{},!0)}};qL({type:`changeMagicType`,event:`magicTypeChanged`,update:`prepareAndUpdate`},function(e,t){t.mergeOption(e.newOption)});var mq=Array(60).join(`-`),hq=` `;function gq(e){var t={},n=[],r=[];return e.eachRawSeries(function(e){var i=e.coordinateSystem;if(i&&(i.type===`cartesian2d`||i.type===`polar`)){var a=i.getBaseAxis();if(a.type===`category`){var o=fj(a);t[o]||(t[o]={categoryAxis:a,valueAxis:i.getOtherAxis(a),series:[]},r.push({axisDim:a.dim,axisIndex:a.index})),t[o].series.push(e)}else n.push(e)}else n.push(e)}),{seriesGroupByCategoryAxis:t,other:n,meta:r}}function _q(e){var t=[];return G(e,function(e,n){var r=e.categoryAxis,i=e.valueAxis.dim,a=[` `].concat(K(e.series,function(e){return e.name})),o=[r.model.getCategories()];G(e.series,function(e){var t=e.getRawData();o.push(e.getRawData().mapArray(t.mapDimension(i),function(e){return e}))});for(var s=[a.join(hq)],c=0;c1||n>0&&!e.noHeader;return G(e.blocks,function(e){var n=sE(e);n>=t&&(t=n+ +(r&&(!n||aE(e)&&!e.noHeader)))}),t}return 0}function cE(e,t,n,r){var i=t.noHeader,a=dE(sE(t)),o=[],s=t.blocks||[];Wl(!s||J(s)),s||=[];var c=e.orderMode;if(t.sortBlocks&&c){s=s.slice();var l={valueAsc:`asc`,valueDesc:`desc`};if(Z(l,c)){var u=new CT(l[c],null);s.sort(function(e,t){return u.evaluate(e.sortParam,t.sortParam)})}else c===`seriesDesc`&&s.reverse()}G(s,function(n,i){var s=t.valueFormatter,c=oE(n)(s?W(W({},e),{valueFormatter:s}):e,n,i>0?a.html:0,r);c!=null&&o.push(c)});var d=e.renderMode===`richText`?o.join(a.richText):fE(r,o.join(``),i?n:a.html);if(i)return d;var f=qC(t.header,`ordinal`,e.useUTC),p=tE(r,e.renderMode).nameStyle,m=eE(r);return e.renderMode===`richText`?hE(e,f,p)+a.richText+d:fE(r,`
`+WS(f)+`
`+d,n)}function lE(e,t,n,r){var i=e.renderMode,a=t.noName,o=t.noValue,s=!t.markerType,c=t.name,l=e.useUTC,u=t.valueFormatter||e.valueFormatter||function(e){return e=J(e)?e:[e],K(e,function(e,t){return qC(e,J(p)?p[t]:p,l)})};if(!(a&&o)){var d=s?``:e.markupStyleCreator.makeTooltipMarker(t.markerType,t.markerColor||Q.color.secondary,i),f=a?``:qC(c,`ordinal`,l),p=t.valueType,m=o?[]:u(t.value,t.rawDataIndex),h=!s||!a,g=!s&&a,_=tE(r,i),v=_.nameStyle,y=_.valueStyle;return i===`richText`?(s?``:d)+(a?``:hE(e,f,v))+(o?``:gE(e,m,h,g,y)):fE(r,(s?``:d)+(a?``:pE(f,!s,v))+(o?``:mE(m,h,g,y)),n)}}function uE(e,t,n,r,i,a){if(e)return oE(e)({useUTC:i,renderMode:n,orderMode:r,markupStyleCreator:t,valueFormatter:e.valueFormatter},e,0,a)}function dE(e){return{html:nE[e],richText:rE[e]}}function fE(e,t,n){var r=`
`,i=`margin: `+n+`px 0 0`,a=eE(e);return`
`+t+r+`
`}function pE(e,t,n){var r=t?`margin-left:2px`:``;return``+WS(e)+``}function mE(e,t,n,r){var i=t?`float:right;margin-left:`+(n?`10px`:`20px`):``;return e=J(e)?e:[e],``+K(e,function(e){return WS(e)}).join(`  `)+``}function hE(e,t,n){return e.markupStyleCreator.wrapRichTextStyle(t,n)}function gE(e,t,n,r,i){var a=[i],o=r?10:20;return n&&a.push({padding:[0,0,0,o],align:`right`}),e.markupStyleCreator.wrapRichTextStyle(J(t)?t.join(` `):t,a)}function _E(e,t){var n=e.getData().getItemVisual(t,`style`)[e.visualDrawType];return QC(n)}function vE(e,t){return e.get(`padding`)??(t===`richText`?[8,10]:10)}var yE=function(){function e(){this.richTextStyles={},this._nextStyleNameId=Wu()}return e.prototype._generateStyleName=function(){return`__EC_aUTo_`+this._nextStyleNameId++},e.prototype.makeTooltipMarker=function(e,t,n){var r=n===`richText`?this._generateStyleName():null,i=ZC({color:t,type:e,renderMode:n,markerId:r});return Y(i)?i:(this.richTextStyles[r]=i.style,i.content)},e.prototype.wrapRichTextStyle=function(e,t){var n={};J(t)?G(t,function(e){return W(n,e)}):W(n,t);var r=this._generateStyleName();return this.richTextStyles[r]=n,`{`+r+`|`+e+`}`},e}();function bE(e){var t=e.series,n=e.dataIndex,r=e.multipleSeries,i=t.getData(),a=i.mapDimensionsAll(`defaultedTooltip`),o=a.length,s=t.getRawValue(n),c=J(s),l=_E(t,n),u,d,f,p;if(o>1||c&&!o){var m=xE(s,t,n,a,l);u=m.inlineValues,d=m.inlineValueTypes,f=m.blocks,p=m.inlineValues[0]}else if(o){var h=i.getDimensionInfo(a[0]);p=u=mT(i,n,a[0]),d=h.type}else p=u=c?s[0]:s;var g=vd(t),_=g&&t.name||``,v=i.getName(n),y=r?_:v;return iE(`section`,{header:_,noHeader:r||!g,sortParam:p,blocks:[iE(`nameValue`,{markerType:`item`,markerColor:l,name:y,noName:!Gl(y),value:u,valueType:d,rawDataIndex:i.getRawIndex(n)})].concat(f||[])})}function xE(e,t,n,r,i){var a=t.getData(),o=wl(e,function(e,t,n){var r=a.getDimensionInfo(n);return e||=r&&r.tooltip!==!1&&r.displayName!=null},!1),s=[],c=[],l=[];r.length?G(r,function(e){u(mT(a,n,e),e)}):G(e,u);function u(e,t){var n=a.getDimensionInfo(t);n&&n.otherDims.tooltip!==!1&&(o?l.push(iE(`nameValue`,{markerType:`subItem`,markerColor:i,name:n.displayName,value:e,valueType:n.type})):(s.push(e),c.push(n.type)))}return{inlineValues:s,inlineValueTypes:c,blocks:l}}var SE=Td();function CE(e,t){return e.getName(t)||e.getId(t)}var wE=function(e){U(t,e);function t(){var t=e!==null&&e.apply(this,arguments)||this;return t._selectedDataIndicesMap={},t}return t.prototype.init=function(e,t,n){this.seriesIndex=this.componentIndex,this.dataTask=vT({count:DE,reset:OE}),this.dataTask.context={model:this},this.mergeDefaultAndTheme(e,n),(SE(this).sourceManager=new qT(this)).prepareSource();var r=this.getInitialData(e,n);AE(r,this),this.dataTask.context.data=r,SE(this).dataBeforeProcessed=r,TE(this),this._initSelectedMapFromData(r)},t.prototype.mergeDefaultAndTheme=function(e,t){var n=_w(this),r=n?yw(e):{},i=this.subType;Sw.hasClass(i)&&(i+=`Series`),gl(e,t.getTheme().get(this.subType)),gl(e,this.getDefaultOption()),id(e,`label`,[`show`]),this.fillDataTextStyle(e.data),n&&vw(e,r,n)},t.prototype.mergeOption=function(e,t){e=gl(this.option,e,!0),this.fillDataTextStyle(e.data);var n=_w(this);n&&vw(this.option,e,n);var r=SE(this).sourceManager;r.dirty(),r.prepareSource();var i=this.getInitialData(e,t);AE(i,this),this.dataTask.dirty(),this.dataTask.context.data=i,SE(this).dataBeforeProcessed=i,TE(this),this._initSelectedMapFromData(i)},t.prototype.fillDataTextStyle=function(e){if(e&&!Fl(e))for(var t=[`show`],n=0;n=0&&u<0)&&(l=v,u=_,d=0),_===u&&(c[d++]=m))}return c.length=d,c},t.prototype.formatTooltip=function(e,t,n){return bE({series:this,dataIndex:e,multipleSeries:t})},t.prototype.isAnimationEnabled=function(){var e=this.ecModel;if(ou.node&&!(e&&e.ssr))return!1;var t=this.getShallow(`animation`);return t&&this.getData().count()>this.getShallow(`animationThreshold`)&&(t=!1),!!t},t.prototype.restoreData=function(){this.dataTask.dirty()},t.prototype.getColorFromPalette=function(e,t,n){var r=this.ecModel,i=Ew.prototype.getColorFromPalette.call(this,e,t,n);return i||=r.getColorFromPalette(e,t,n),i},t.prototype.coordDimToDataDim=function(e){return this.getRawData().mapDimensionsAll(e)},t.prototype.getProgressive=function(){return this.get(`progressive`)},t.prototype.getProgressiveThreshold=function(){return this.get(`progressiveThreshold`)},t.prototype.select=function(e,t){this._innerSelect(this.getData(t),e)},t.prototype.unselect=function(e,t){var n=this.option.selectedMap;if(n){var r=this.option.selectedMode,i=this.getData(t);if(r===`series`||n===`all`){this.option.selectedMap={},this._selectedDataIndicesMap={};return}for(var a=0;a=0&&n.push(i)}return n},t.prototype.isSelected=function(e,t){var n=this.option.selectedMap;if(!n)return!1;var r=this.getData(t);return(n===`all`||n[CE(r,e)])&&!r.getItemModel(e).get([`select`,`disabled`])},t.prototype.isUniversalTransitionEnabled=function(){if(this.__universalTransitionEnabled)return!0;var e=this.option.universalTransition;return e?e===!0||e&&e.enabled:!1},t.prototype._innerSelect=function(e,t){var n,r,i=this.option,a=i.selectedMode,o=t.length;if(a&&o){if(a===`series`)i.selectedMap=`all`;else if(a===`multiple`){Nl(i.selectedMap)||(i.selectedMap={});for(var s=i.selectedMap,c=0;c0&&this._innerSelect(e,t)}},t.registerClass=function(e){return Sw.registerClass(e)},t.protoInitialize=function(){var e=t.prototype;e.type=`series.__base__`,e.seriesIndex=0,e.ignoreStyleOnData=!1,e.hasSymbolVisual=!1,e.defaultSymbol=`circle`,e.visualStyleAccessPath=`itemStyle`,e.visualDrawType=`fill`}(),t}(Sw);Sl(wE,gT),Sl(wE,Ew),lf(wE,Sw);function TE(e){var t=e.name;vd(e)||(e.name=EE(e)||t)}function EE(e){var t=e.getRawData(),n=t.mapDimensionsAll(`seriesName`),r=[];return G(n,function(e){var n=t.getDimensionInfo(e);n.displayName&&r.push(n.displayName)}),r.join(` `)}function DE(e){return e.model.getRawData().count()}function OE(e){var t=e.model;return t.setData(t.getRawData().cloneShallow()),kE}function kE(e,t){t.outputData&&e.end>t.outputData.count()&&t.model.getRawData().cloneShallow(t.outputData)}function AE(e,t){G(eu(e.CHANGABLE_METHODS,e.DOWNSAMPLE_METHODS),function(n){e.wrapMethod(n,kl(jE,t))})}function jE(e,t){var n=ME(e);return n&&n.setOutputEnd((t||this).count()),t}function ME(e){var t=(e.ecModel||{}).scheduler,n=t&&t.getPipeline(e.uid);if(n){var r=n.currentTask;if(r){var i=r.agentStubMap;i&&(r=i.get(e.uid))}return r}}function NE(e){return e==null?0:e.length||1}function PE(e){return e}var FE=function(){function e(e,t,n,r,i,a){this._old=e,this._new=t,this._oldKeyGetter=n||PE,this._newKeyGetter=r||PE,this.context=i,this._diffModeMultiple=a===`multiple`}return e.prototype.add=function(e){return this._add=e,this},e.prototype.update=function(e){return this._update=e,this},e.prototype.updateManyToOne=function(e){return this._updateManyToOne=e,this},e.prototype.updateOneToMany=function(e){return this._updateOneToMany=e,this},e.prototype.updateManyToMany=function(e){return this._updateManyToMany=e,this},e.prototype.remove=function(e){return this._remove=e,this},e.prototype.execute=function(){this[this._diffModeMultiple?`_executeMultiple`:`_executeOneToOne`]()},e.prototype._executeOneToOne=function(){var e=this._old,t=this._new,n={},r=Array(e.length),i=Array(t.length);this._initIndexMap(e,null,r,`_oldKeyGetter`),this._initIndexMap(t,n,i,`_newKeyGetter`);for(var a=0;a1){var l=s.shift();s.length===1&&(n[o]=s[0]),this._update&&this._update(l,a)}else c===1?(n[o]=null,this._update&&this._update(s,a)):this._remove&&this._remove(a)}this._performRestAdd(i,n)},e.prototype._executeMultiple=function(){var e=this._old,t=this._new,n={},r={},i=[],a=[];this._initIndexMap(e,n,i,`_oldKeyGetter`),this._initIndexMap(t,r,a,`_newKeyGetter`);for(var o=0;o1&&d===1)this._updateManyToOne&&this._updateManyToOne(l,c),r[s]=null;else if(u===1&&d>1)this._updateOneToMany&&this._updateOneToMany(l,c),r[s]=null;else if(u===1&&d===1)this._update&&this._update(l,c),r[s]=null;else if(u>1&&d>1)this._updateManyToMany&&this._updateManyToMany(l,c),r[s]=null;else if(u>1)for(var f=0;f1)for(var o=0;oi&&(i+=IE);var p=Math.atan2(s,o);if(p<0&&(p+=IE),p>=r&&p<=i||p+IE>=r&&p+IE<=i)return c[0]=u,c[1]=d,l-n;var m=n*Math.cos(r)+e,h=n*Math.sin(r)+t,g=n*Math.cos(i)+e,_=n*Math.sin(i)+t,v=(m-o)*(m-o)+(h-s)*(h-s),y=(g-o)*(g-o)+(_-s)*(_-s);return v0){t=t/180*Math.PI,KE.fromArray(e[0]),qE.fromArray(e[1]),JE.fromArray(e[2]),Qf.sub(YE,KE,qE),Qf.sub(XE,JE,qE);var n=YE.len(),r=XE.len();if(!(n<.001||r<.001)){YE.scale(1/n),XE.scale(1/r);var i=YE.dot(XE);if(Math.cos(t)1&&Qf.copy($E,JE),$E.toArray(e[1])}}}}function tD(e,t,n,r){var i=n===`normal`,a=i?e:e.ensureState(n);a.ignore=t;var o=r.get(`smooth`);o=o===!0?.3:Math.max(+o,0)||0,a.shape=a.shape||{},a.shape.smooth=o;var s=r.getModel(`lineStyle`).getLineStyle();i?e.useStyle(s):a.style=s}function nD(e,t){var n=t.smooth,r=t.points;if(r){if(e.moveTo(r[0][0],r[0][1]),n>0&&r.length>=3){var i=Gf(r[0],r[1]),a=Gf(r[1],r[2]);if(!i||!a){e.lineTo(r[1][0],r[1][1]),e.lineTo(r[2][0],r[2][1]);return}var o=Math.min(i,a)*n,s=Jf([],r[1],r[0],o/i),c=Jf([],r[1],r[2],o/a),l=Jf([],s,c,.5);e.bezierCurveTo(s[0],s[1],s[0],s[1],l[0],l[1]),e.bezierCurveTo(c[0],c[1],c[0],c[1],r[2][0],r[2][1])}else for(var u=1;u0&&i&&S(-d/a,0,a);var g=e[0],_=e[a-1],v,y;b(),v<0&&C(-v,.8),y<0&&C(y,.8),b(),x(v,y,1),x(y,v,-1),b(),v<0&&w(-v),y<0&&w(y);function b(){v=g.rect[o]-n,y=r-_.rect[o]-_.rect[s]}function x(e,t,n){if(e<0){var r=Math.min(t,-e);if(r>0){S(r*n,0,a);var i=r+e;i<0&&C(-i*n,1)}else C(-e*n,1)}}function S(t,n,r){t!==0&&(u=!0);for(var i=n;i0)for(var c=0;c0;c--){var f=r[c-1]*d;S(-f,c,a)}}}function w(e){var t=e<0?-1:1;e=Math.abs(e);for(var n=Math.ceil(e/(a-1)),r=0;r0?S(n,0,r+1):S(-n,a-r-1,a),e-=n,e<=0)return}return u}function yD(e){for(var t=0;t=0&&n.attr(i.oldLayoutSelect),bl(u,`emphasis`)>=0&&n.attr(i.oldLayoutEmphasis)),Yb(n,c,t,s)}else if(n.attr(c),!dS(n).valueAnimation){var d=X(n.style.opacity,1);n.style.opacity=0,Xb(n,{style:{opacity:d}},t,s)}if(i.oldLayout=c,n.states.select){var f=i.oldLayoutSelect={};OD(f,c,kD),OD(f,n.states.select,kD)}if(n.states.emphasis){var p=i.oldLayoutEmphasis={};OD(p,c,kD),OD(p,n.states.emphasis,kD)}pS(n,s,l,t,t)}if(r&&!r.ignore&&!r.invisible){var i=DD(r),a=i.oldLayout,m={points:r.shape.points};a?(r.attr({shape:a}),Yb(r,{shape:m},t)):(r.setShape(m),r.style.strokePercent=0,Xb(r,{style:{strokePercent:1}},t)),i.oldLayout=m}},e}(),jD=Td();function MD(e){e.registerUpdateLifecycle(`series:beforeupdate`,function(e,t,n){var r=jD(t).labelManager;r||=jD(t).labelManager=new AD,r.clearLabels()}),e.registerUpdateLifecycle(`series:layoutlabels`,function(e,t,n){var r=jD(t).labelManager;G(n.updatedSeries,function(e){r.addLabelsOfSeries(t.getViewOfSeriesModel(e))}),r.updateLayoutConfig(t),r.layout(t),r.processLabelsOverall()})}var ND=Dl({needTransform:1,normalize:1,scale:1,transformIn:1,transformOut:1,contain:1,getExtent:1,getExtentUnsafe:1,setExtent:1,setExtent2:1,getFilter:1,sanitize:1,getDefaultStartValue:1,freeze:1});function PD(e,t,n){var r;e||={};var i=iC();if(i){var a=i.createBreakScaleMapper(t,n);a.hasBreaks()&&(G(ND,function(t){a[t]&&(e[t]=q(a[t],a))}),r=a)}return r??VD(e,n),{brk:r,mapper:e}}function FD(e,t){G(ND,function(n){e[n]=t[n]})}function ID(e,t){e.freeze=ru}function LD(e){return e.getExtentUnsafe(0,2)}function RD(e,t){return e.getExtentUnsafe(1,t)||e.getExtentUnsafe(0,t)}function zD(e){var t=RD(e,3);return t[1]-t[0]}function BD(e){var t=e.getExtentUnsafe(0,3);return t[1]-t[0]}function VD(e,t){var n=e||{},r=[];return n._extents=r,r[0]=t?t.slice():Ld(),W(n,HD),n}var HD={needTransform:function(){return!1},normalize:function(e){var t=this._extents[1]||this._extents[0];return t[1]===t[0]?.5:(e-t[0])/(t[1]-t[0])},scale:function(e){var t=this._extents[1]||this._extents[0];return e*(t[1]-t[0])+t[0]},transformIn:function(e){return e},transformOut:function(e){return e},contain:function(e){var t=RD(this,null);return e>=t[0]&&e<=t[1]},getExtent:function(){return this._extents[0].slice()},getExtentUnsafe:function(e){return this._extents[e]},setExtent:function(e,t){UD(this._extents,0,e,t)},setExtent2:function(e,t,n){var r=this._extents;r[e]||(r[e]=r[0].slice()),UD(r,e,t,n)},freeze:function(){}};function UD(e,t,n,r){Ud(n,r)&&(e[t][0]=n,e[t][1]=r)}var WD=`expandAxisBreak`,GD=null;function KD(){return GD}var qD=function(){function e(){}return e.prototype.isBlank=function(){return this._isBlank},e.prototype.setBlank=function(e){this._isBlank=e},e}();mf(qD);var JD=0,YD=function(){function e(e){this.categories=e.categories||[],this._needCollect=e.needCollect,this._deduplication=e.deduplication,this.uid=++JD,this._onCollect=e.onCollect}return e.createByAxisModel=function(t){var n=t.option,r=n.data,i=r&&K(r,XD);return new e({categories:i,needCollect:!i,deduplication:n.dedplication!==!1})},e.prototype.getOrdinal=function(e){return this._getOrCreateMap().get(e)},e.prototype.parseAndCollect=function(e){var t,n=this._needCollect;if(!Y(e)&&!n)return e;if(n&&!this._deduplication)return t=this.categories.length,this.categories[t]=e,this._onCollect&&this._onCollect(e,t),t;var r=this._getOrCreateMap();return t=r.get(e),t??(n?(t=this.categories.length,this.categories[t]=e,r.set(e,t),this._onCollect&&this._onCollect(e,t)):t=NaN),t},e.prototype._getOrCreateMap=function(){return this._map||=$l(this.categories)},e}();function XD(e){return Nl(e)&&e.value!=null?e.value:e+``}function ZD(e){return QD(e)||eO(e)}function QD(e){return e.type===`interval`}function $D(e){return e.type===`time`}function eO(e){return e.type===`log`}function tO(e){return e.type===`ordinal`}function nO(e){var t=zu(e),n=_u(10,t),r=mu(e/n);return r?r===2?r=3:r===3?r=5:r*=2:r=1,Du(r*n,-t)}function rO(e){return ku(e)+2}function iO(e,t){return vu(e)/vu(t)}function aO(e,t,n){var r=n&&n.lookup;if(r){for(var i=0;i1&&a/o>2&&(i=Math.round(Math.ceil(i/o)*o)),i!==r[0]&&c(r[0],!0,!0);for(var s=i;s<=r[1];s+=o)c(s,!1,s===r[0]||s===r[1]);s-o!==r[1]&&c(r[1],!0,!0);function c(e,t,r){n({value:e,offInterval:t},r)}}var uO=function(e){U(t,e);function t(n){var r=e.call(this)||this;r.type=`ordinal`,r.parse=t.parse,FD(r,t.decoratedMethods);var i=n.ordinalMeta;i||=new YD({}),J(i)&&(i=new YD({categories:K(i,function(e){return Nl(e)?e.value:e})})),r._ordinalMeta=i;var a=PD(null,null,n.extent||[0,i.categories.length-1]);return r._mapper=a.mapper,ID(r,a.mapper),r}return t.parse=function(e){return e==null?e=NaN:Y(e)?(e=this._ordinalMeta.getOrdinal(e),e??=NaN):e=mu(e),e},t.prototype.getTicks=function(){var e=[];return lO(this,0,function(t){e.push(t)}),e},t.prototype.getMinorTicks=function(e){},t.prototype.setSortInfo=function(e){if(e==null){this._ordinalNumbersByTick=this._ticksByOrdinalNumber=null;return}for(var t=e.ordinalNumbers,n=this._ordinalNumbersByTick=[],r=this._ticksByOrdinalNumber=[],i=0,a=this._ordinalMeta.categories.length,o=du(a,t.length);i=0&&e=0&&e=0&&eo[0]&&mi[1]||!isFinite(p)||!isFinite(i[1]))break}else{if(m>f)break;p=du(p,i[1]),m===f&&(p=i[1])}if(l.push({value:p}),p=Du(p+n,a),s){var h=s.calcNiceTickMultiple(p,d);h>=0&&(p=Du(p+h*n,a))}if(l.length>0&&p===l[l.length-1].value)break;if(l.length>u)return[]}var g=l.length?l[l.length-1].value:i[1];return r[1]>g&&l.push({value:e.expandToNicedExtent?Du(g+n,a):r[1]}),c&&o.pruneTicksByBreak(e.pruneByBreak,l,s.breaks,function(e){return e.value},t.interval,r),c&&e.breakTicks!==`none`&&o.addBreaksToTicks(l,s.breaks,r),l},t.prototype.getMinorTicks=function(e){return dO(this,e,oC(this),this._cfg.interval)},t.prototype.getLabel=function(e,t){if(e==null)return``;var n=t&&t.precision;return n==null?n=ku(e.value)||0:n===`auto`&&(n=this._cfg.intervalPrecision),WC(Du(e.value,n,!0))},t.type=`interval`,t}(qD);qD.registerClass(fO);var pO=function(e,t,n,r){for(;n>>1;e[i][1]16?16:e>7.5?7:e>3.5?4:e>1.5?2:1}function vO(e){var t=30*dC;return e/=t,e>6?6:e>3?3:e>2?2:1}function yO(e){return e/=uC,e>12?12:e>6?6:e>3.5?4:e>2?2:1}function bO(e,t){return e/=t?lC:cC,e>30?30:e>20?20:e>15?15:e>10?10:e>5?5:e>2?2:1}function xO(e){return fu(Bu(e,!0),1)}function SO(e,t,n){var r=Math.max(0,bl(vC,t)-1);return kC(new Date(e),vC[r],n).getTime()}function CO(e,t){var n=new Date(0);n[e](1);var r=n.getTime();n[e](1+t);var i=n.getTime()-r;return function(e,t){return Math.max(0,Math.round((t-e)/i))}}function wO(e,t,n,r,i,a){var o=yC,s=0;function c(e,t,n,i,o,c,l){for(var u=CO(o,e),d=t,f=new Date(d);d3e3));)if(f[o](f[i]()+e),d=f.getTime(),a){var p=a.calcNiceTickMultiple(d,u);p>0&&(f[o](f[i]()+p*e),d=f.getTime())}l.push({value:d,notAdd:d>r[1]})}function l(e,i,a){var o=[],s=!i.length;if(!gO(CC(e),r[0],r[1],n)){s&&(i=[{value:SO(r[0],e,n)},{value:r[1]}]);for(var l=0;l=r[0]&&u<=r[1]&&c(f,u,d,p,m,h,o),e===`year`&&a.length>1&&l===0&&a.unshift({value:a[0].value-f})}}for(var l=0;l=r[0]&&v<=r[1]&&f++)}var y=i/t;if(f>y*1.5&&p>y/1.5||(u.push(g),f>y||e===o[m]))break}d=[]}}for(var b=Tl(K(u,function(e){return Tl(e,function(e){return e.value>=r[0]&&e.value<=r[1]&&!e.notAdd})}),function(e){return e.length>0}),x=b.length-1,S=[],m=0;mr[0])&&S.unshift({value:r[0],time:{level:0,upperTimeUnit:O,lowerTimeUnit:O},notNice:!0}),(!D||D.values&&(a=s);var c=hO.length,l=Math.min(pO(hO,a,0,c),c-1),u=hO[l][1],d=hO[Math.max(l-1,0)][0];e.setTimeInterval({approxInterval:a,interval:u,minLevelUnit:d})};qD.registerClass(mO);var EO=0,DO=1,OO=2,kO=function(e){U(t,e);function t(n){var r=e.call(this)||this;r.type=`log`,r.parse=fO.parse,r.base=n.logBase||10;var i=[],a=[],o=r._lookup={from:i,to:a};i[EO]=i[DO]=a[EO]=a[DO]=NaN,FD(r,t.mapperMethods);var s=iC(),c=n.breakOption,l={lookup:o};return s&&s.parseAxisBreakOptionInwardTransform(c,r,{noNegative:!0},OO,l),r.powStub=new fO({breakParsed:l.original}),r.intervalStub=new fO({breakParsed:l.transformed}),ID(r,r.intervalStub),r}return t.prototype.getTicks=function(e){var t=this.base,n=this.powStub,r=iC(),i=this.intervalStub,a={lookup:{from:i.getExtent(),to:n.getExtent()}};return K(i.getTicks(e||{}),function(e){var i=e.value,o=aO(i,t,a),s;if(r){var c=r.getTicksBreakOutwardTransform(this,e,oC(n),this._lookup);c&&(s=c.vBreak,o=c.tickVal)}return{value:o,break:s}},this)},t.prototype.getMinorTicks=function(e){return dO(this,e,oC(this.powStub),this.intervalStub.getConfig().interval)},t.prototype.getLabel=function(e,t){return this.intervalStub.getLabel(e,t)},t.type=`log`,t.mapperMethods={needTransform:function(){return!0},normalize:function(e){return this.intervalStub.normalize(iO(e,this.base))},scale:function(e){return aO(this.intervalStub.scale(e),this.base,null)},transformIn:function(e,t){return e=iO(e,this.base),t&&t.depth===2?e:this.intervalStub.transformIn(e,t)},transformOut:function(e,t){var n=t?t.depth:null;return AO.depth=n,jO.lookup=this._lookup,aO(n===2?e:this.intervalStub.transformOut(e,AO),this.base,jO)},contain:function(e){return this.powStub.contain(e)},setExtent:function(e,t){this.setExtent2(0,e,t)},setExtent2:function(e,t,n){if(!(!Ud(t,n)||t<=0||n<=0)){var r=MO,i=MO;if(e===0){var a=this._lookup;r=a.to,i=a.from}this.powStub.setExtent2(e,r[EO]=t,r[DO]=n);var o=this.base;this.intervalStub.setExtent2(e,i[EO]=iO(t,o),i[DO]=iO(n,o))}},getFilter:function(){return{g:0}},sanitize:function(e,t){return Ud(t[0],t[1])&&qu(e)&&e<=0&&(e=t[0]),e},getDefaultStartValue:function(){return 1},getExtent:function(){return this.powStub.getExtent()},getExtentUnsafe:function(e,t){return t===null?this.powStub.getExtentUnsafe(e,null):this.intervalStub.getExtentUnsafe(e,t)}},t}(qD);qD.registerClass(kO);var AO={},jO={},MO=[],NO={value:1,category:1,time:1,log:1},PO=Td(),FO={float:`f`,int:`i`,ordinal:`o`,number:`n`,time:`t`},IO=function(){function e(e){this.dimensions=e.dimensions,this._dimOmitted=e.dimensionOmitted,this.source=e.source,this._fullDimCount=e.fullDimensionCount,this._updateDimOmitted(e.dimensionOmitted)}return e.prototype.isDimensionOmitted=function(){return this._dimOmitted},e.prototype._updateDimOmitted=function(e){this._dimOmitted=e,e&&(this._dimNameMap||=zO(this.source))},e.prototype.getSourceDimensionIndex=function(e){return X(this._dimNameMap.get(e),-1)},e.prototype.getSourceDimension=function(e){var t=this.source.dimensionsDefine;if(t)return t[e]},e.prototype.makeStoreSchema=function(){for(var e=this._fullDimCount,t=Yw(this.source),n=!BO(e),r=``,i=[],a=0,o=0;a30}function VO(e,t,n){n||={};var r=n.byIndex,i=n.stackedCoordDimension,a,o,s;HO(t)?a=t:(o=t.schema,a=o.dimensions,s=t.store);var c=!!(e&&e.get(`stack`)),l,u,d,f,p=!0;function m(e){return e.type!==`ordinal`&&e.type!==`time`}if(G(a,function(e,t){Y(e)&&(a[t]=e={name:e}),m(e)||(p=!1)}),G(a,function(e,t){c&&!e.isExtraCoord&&(!r&&!l&&e.ordinalMeta&&(l=e),!u&&m(e)&&(!p||e.coordDim!==`x`&&e.coordDim!==`angle`)&&(!i||i===e.coordDim)&&(u=e))}),u&&!r&&!l&&(r=!0),u){d=`__\0ecstackresult_`+e.id,f=`__\0ecstackedover_`+e.id,l&&(l.createInvertedIndices=!0);var h=u.coordDim,g=u.type,_=0;G(a,function(e){e.coordDim===h&&_++});var v={name:d,coordDim:h,coordDimIndex:_,type:g,isExtraCoord:!0,isCalculationCoord:!0,storeDimIndex:a.length},y={name:f,coordDim:f,coordDimIndex:_+1,type:g,isExtraCoord:!0,isCalculationCoord:!0,storeDimIndex:a.length+1};o?(s&&(v.storeDimIndex=s.ensureCalculationDimension(f,g),y.storeDimIndex=s.ensureCalculationDimension(d,g)),o.appendCalculationDimension(v),o.appendCalculationDimension(y)):(a.push(v),a.push(y))}return{stackedDimension:u&&u.name,stackedByDimension:l&&l.name,isStackedByIndex:r,stackedOverDimension:f,stackResultDimension:d}}function HO(e){return!LO(e.schema)}function UO(e,t){return!!t&&t===e.getCalculationInfo(`stackedDimension`)}function WO(e,t){return UO(e,t)?e.getCalculationInfo(`stackResultDimension`):t}var GO=Td();function KO(e){var t=e.get(`type`);return(t==null||!Z(NO,t)&&!qD.getClass(t))&&(t=`value`),t}function qO(e,t,n){var r=iC(),i;switch(r&&(i=ik(e,t,n)),t){case`category`:return new uO({ordinalMeta:e.getOrdinalMeta?e.getOrdinalMeta():e.getCategories(),extent:Ld()});case`time`:return new mO({locale:e.ecModel.getLocaleModel(),useUTC:e.ecModel.get(`useUTC`),breakOption:i});case`log`:return new kO({logBase:e.get(`logBase`),breakOption:i});case`value`:return new fO({breakOption:i});default:return new((qD.getClass(t))||fO)({})}}function JO(e,t,n){var r=n?RD(e,null):e.getExtentUnsafe(0,null),i=r[0],a=r[1];return Ud(i,a)?i===t||a===t?2:it?1:3:3}function YO(e){GO(e).noOnMyZero=!0}function XO(e){return GO(e).noOnMyZero}function ZO(e){var t=e.getLabelModel().get(`formatter`);if(e.type===`time`){var n=bC(t);return function(t,r){return e.scale.getFormattedLabel(t,r,n)}}if(Y(t))return function(n){var r=e.scale.getLabel(n);return t.replace(`{value}`,r??``)};if(Al(t)){if(e.type===`category`)return function(n,r){return t(QO(e,n),n.value-e.scale.getExtent()[0],null)};var r=iC();return function(n,i){var a=null;return r&&(a=r.makeAxisLabelFormatterParamBreak(a,n.break)),t(QO(e,n),i,a)}}return function(t){return e.scale.getLabel(t)}}function QO(e,t){var n=e.scale;return tO(n)?n.getLabel(t):t.value}function $O(e){return e.get(`interval`)??`auto`}function ek(e){return e.type===`category`&&$O(e.getLabelModel())===0}function tk(e,t){var n={};return G(e.mapDimensionsAll(t),function(t){n[WO(e,t)]=!0}),Dl(n)}function nk(e){return e===`middle`||e===`center`}function rk(e){return e.getShallow(`show`)}function ik(e,t,n){var r=e.get(`breaks`,!0);if(r!=null)return!iC()||!n||!ak(t)?void 0:r}function ak(e){return e!==`category`}function ok(e,t,n,r,i,a){var o=eO(e),s=o?e.intervalStub:e;if(s.setExtent(r[0],r[1]),o){var c=e.powStub,l={depth:2},u=e.transformOut(r[0],l),d=e.transformOut(r[1],l),f=sO(n,r);t[0]&&!f[0]&&(u=i[0]),t[1]&&!f[1]&&(d=i[1]),c.setExtent(u,d)}s.setConfig(a)}function sk(e,t){return tO(e)?e.getRawOrdinalNumber(t.value):t.value}function ck(e,t){return tO(e)&&!!t.get(`boundaryGap`)}var lk=function(){function e(e){this.type=`cartesian`,this._dimList=[],this._axes={},this.name=e||``}return e.prototype.getAxis=function(e){return this._axes[e]},e.prototype.getAxes=function(){return K(this._dimList,function(e){return this._axes[e]},this)},e.prototype.getAxesByScale=function(e){return e=e.toLowerCase(),Tl(this.getAxes(),function(t){return t.scale.type===e})},e.prototype.addAxis=function(e){var t=e.dim;this._axes[t]=e,this._dimList.push(t)},e}(),uk={left:0,right:0,top:0,bottom:0},dk=[`25%`,`25%`],fk=`cartesian2d`,pk=function(e){U(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}return t.prototype.mergeDefaultAndTheme=function(t,n){var r=yw(t.outerBounds);e.prototype.mergeDefaultAndTheme.apply(this,arguments),r&&t.outerBounds&&vw(t.outerBounds,r)},t.prototype.mergeOption=function(t,n){e.prototype.mergeOption.apply(this,arguments),this.option.outerBounds&&t.outerBounds&&vw(this.option.outerBounds,t.outerBounds)},t.type=`grid`,t.dependencies=[`xAxis`,`yAxis`],t.layoutMode=`box`,t.defaultOption={show:!1,z:0,left:`15%`,top:65,right:`10%`,bottom:80,containLabel:!1,outerBoundsMode:`auto`,outerBounds:uk,outerBoundsContain:`all`,outerBoundsClampWidth:dk[0],outerBoundsClampHeight:dk[1],backgroundColor:Q.color.transparent,borderWidth:1,borderColor:Q.color.neutral30},t}(Sw),mk=[`x`,`y`];function hk(e){return(e.type===`interval`||e.type===`time`)&&!sC(e)}var gk=function(e){U(t,e);function t(){var t=e!==null&&e.apply(this,arguments)||this;return t.type=fk,t.dimensions=mk,t}return t.prototype.calcAffineTransform=function(){this._transform=this._invTransform=null;var e=this.getAxis(`x`).scale,t=this.getAxis(`y`).scale;if(hk(e)&&hk(t)){var n=RD(e,null),r=RD(t,null),i=this.dataToPoint([n[0],r[0]]),a=this.dataToPoint([n[1],r[1]]),o=n[1]-n[0],s=r[1]-r[0];if(o&&s){var c=(a[0]-i[0])/o,l=(a[1]-i[1])/s,u=i[0]-n[0]*c,d=i[1]-r[0]*l,f=this._transform=[c,0,0,l,u,d];this._invTransform=Nf([],f)}}},t.prototype.getBaseAxis=function(){return this.getAxesByScale(`ordinal`)[0]||this.getAxesByScale(`time`)[0]||this.getAxis(`x`)},t.prototype.containPoint=function(e){var t=this.getAxis(`x`),n=this.getAxis(`y`);return t.contain(t.toLocalCoord(e[0]))&&n.contain(n.toLocalCoord(e[1]))},t.prototype.containData=function(e){return this.getAxis(`x`).containData(e[0])&&this.getAxis(`y`).containData(e[1])},t.prototype.containZone=function(e,t){var n=this.dataToPoint(e),r=this.dataToPoint(t),i=this.getArea(),a=new fp(n[0],n[1],r[0]-n[0],r[1]-n[1]);return i.intersect(a)},t.prototype.dataToPoint=function(e,t,n){n||=[];var r=e[0],i=e[1];if(this._transform&&r!=null&&isFinite(r)&&i!=null&&isFinite(i))return Yf(n,e,this._transform);var a=this.getAxis(`x`),o=this.getAxis(`y`);return n[0]=a.toGlobalCoord(a.dataToCoord(r,t)),n[1]=o.toGlobalCoord(o.dataToCoord(i,t)),n},t.prototype.clampData=function(e,t){var n=this.getAxis(`x`).scale,r=this.getAxis(`y`).scale,i=n.getExtent(),a=r.getExtent(),o=n.parse(e[0]),s=r.parse(e[1]);return t||=[],t[0]=Math.min(Math.max(Math.min(i[0],i[1]),o),Math.max(i[0],i[1])),t[1]=Math.min(Math.max(Math.min(a[0],a[1]),s),Math.max(a[0],a[1])),t},t.prototype.pointToData=function(e,t,n){if(n||=[],this._invTransform)return Yf(n,e,this._invTransform);var r=this.getAxis(`x`),i=this.getAxis(`y`);return n[0]=r.coordToData(r.toLocalCoord(e[0]),t),n[1]=i.coordToData(i.toLocalCoord(e[1]),t),n},t.prototype.getOtherAxis=function(e){return this.getAxis(e.dim===`x`?`y`:`x`)},t.prototype.getArea=function(e){e||=0;var t=this.getAxis(`x`).getGlobalExtent(),n=this.getAxis(`y`).getGlobalExtent(),r=Math.min(t[0],t[1])-e,i=Math.min(n[0],n[1])-e;return new fp(r,i,Math.max(t[0],t[1])-r+e,Math.max(n[0],n[1])-i+e)},t}(lk),_k=Td(),vk=Td(),yk={estimate:1,determine:2};function bk(e){return{out:{noPxChangeTryDetermine:[]},kind:e}}function xk(e,t){var n=e.getLabelModel().get(`customValues`);if(n){var r=e.scale;return{labels:K(Ck(n,r),function(t,n){return{formattedLabel:ZO(e)(t,n),rawLabel:r.getLabel(t),tick:t}})}}return e.type===`category`?wk(e,t):Dk(e)}function Sk(e,t,n){var r=e.scale,i=e.getTickModel().get(`customValues`);return i?{ticks:Ck(i,r)}:e.type===`category`?Ek(e,t):{ticks:r.getTicks(n)}}function Ck(e,t){var n=t.getExtent(),r=[];return G(e,function(e){e=t.parse(e),e>=n[0]&&e<=n[1]&&r.push(e)}),Jd(r,Xd,null),Ou(r),K(r,function(e){return{value:e}})}function wk(e,t){var n=e.getLabelModel(),r=Tk(e,n,t);return!n.get(`show`)||e.scale.isBlank()?{labels:[]}:r}function Tk(e,t,n){var r=kk(e),i=$O(t),a=n.kind===yk.estimate;if(!a){var o=jk(r,i);if(o)return o}var s,c;Al(i)?s=Rk(e,i,!1):(c=i===`auto`?Nk(e,n):i,s=Rk(e,c,!1));var l={labels:s,labelCategoryInterval:c};return a?n.out.noPxChangeTryDetermine.push(function(){return Mk(r,i,l),!0}):Mk(r,i,l),l}function Ek(e,t){var n=Ok(e),r=$O(t),i=jk(n,r);if(i)return i;var a,o;if((!t.get(`show`)||e.scale.isBlank())&&(a=[]),Al(r))a=Rk(e,r,!0);else if(r===`auto`){var s=Tk(e,e.getLabelModel(),bk(yk.determine));o=s.labelCategoryInterval,a=K(s.labels,function(e){return e.tick})}else o=r,a=Rk(e,o,!0);return Mk(n,r,{ticks:a,tickCategoryInterval:o})}function Dk(e){var t=e.scale.getTicks(),n=ZO(e);return{labels:K(t,function(t,r){return{formattedLabel:n(t,r),rawLabel:e.scale.getLabel(t),tick:t}})}}var Ok=Ak(`axisTick`),kk=Ak(`axisLabel`);function Ak(e){return function(t){return vk(t)[e]||(vk(t)[e]={list:[]})}}function jk(e,t){for(var n=0;nu&&(l=Math.max(1,Math.floor(c/u)));for(var d=s[0],f=e.dataToCoord(d+1)-e.dataToCoord(d),p=Math.abs(f*Math.cos(a)),m=Math.abs(f*Math.sin(a)),h=0,g=0;d<=s[1];d+=l){var _=0,v=0,y=Mp(i({value:d}),r.font,`center`,`top`);_=y.width*1.3,v=y.height*1.3,h=Math.max(h,_,7),g=Math.max(g,v,7)}var b=h/p,x=g/m;isNaN(b)&&(b=1/0),isNaN(x)&&(x=1/0);var S=Math.max(0,Math.floor(Math.min(b,x)));return n===yk.estimate?(t.out.noPxChangeTryDetermine.push(q(Fk,null,e,S,c)),S):Ik(e,S,c)??S}function Fk(e,t,n){return Ik(e,t,n)==null}function Ik(e,t,n){var r=_k(e.model),i=e.getExtent(),a=r.lastAutoInterval,o=r.lastTickCount;if(a!=null&&o!=null&&Math.abs(a-t)<=1&&Math.abs(o-n)<=1&&a>t&&r.axisExtent0===i[0]&&r.axisExtent1===i[1])return a;r.lastTickCount=n,r.lastAutoInterval=t,r.axisExtent0=i[0],r.axisExtent1=i[1]}function Lk(e){var t=e.getLabelModel();return{axisRotate:e.getRotate?e.getRotate():e.isHorizontal&&!e.isHorizontal()?90:0,labelRotate:t.get(`rotate`)||0,font:t.getFont()}}function Rk(e,t,n){var r=ZO(e),i=e.scale,a=[],o=Al(t);return lO(i,o?0:t,function(e,s){var c=i.getLabel(e);if(o){var l=!!t(e.value,c);if(e.offInterval=!l,!l&&!s)return}a.push(n?e:{formattedLabel:r(e),rawLabel:c,tick:e})}),a}var zk=Td();function Bk(e){zk(e).prepare={}}function Vk(e){zk(e).fullUpdate={}}function Hk(e){return zk(e).prepare}function Uk(e){return zk(e).fullUpdate}var Wk=Kd(),Gk=Td(),Kk=Td();function qk(e,t){var n=e.model,r=Gk(Uk(n.ecModel)).keyed,i=r&&r.get(t);return i&&i.get(n.uid)}function Jk(e,t){return Zk(qk(e,t))}function Yk(e,t){var n=[];return Xk(e.model.ecModel,function(e){for(var r=0;r0?(t>o&&(o=t),a=!1):t===-2&&(a=!0))}),qu(n)&&n>0&&qu(o)?(e.w=r/n*o,e.w2=o):a&&(e.w=r*uA,e.w2=e.w*n/r)}var mA=[0,1],hA=function(){function e(e,t,n){this.onBand=!1,this.inverse=!1,this.dim=e,this.scale=t,this._extent=n||[0,0]}return e.prototype.contain=function(e){var t=this._extent,n=Math.min(t[0],t[1]),r=Math.max(t[0],t[1]);return e>=n&&e<=r},e.prototype.containData=function(e){return this.scale.contain(this.scale.parse(e))},e.prototype.getExtent=function(){return this._extent.slice()},e.prototype.setExtent=function(e,t){var n=this._extent;n[0]=e,n[1]=t},e.prototype.dataToCoord=function(e,t){var n=this.scale;return e=n.normalize(n.parse(e)),Su(e,mA,gA(this),t)},e.prototype.coordToData=function(e,t){var n=Su(e,gA(this),mA,t);return this.scale.scale(n)},e.prototype.pointToData=function(e,t){},e.prototype.getTicksCoords=function(e){e||={};var t=e.tickModel||this.getTickModel(),n=K(Sk(this,t,{breakTicks:e.breakTicks,pruneByBreak:e.pruneByBreak}).ticks,function(e){return{coord:this.dataToCoord(sk(this.scale,e)),tick:e}},this),r=t.get(`alignWithLabel`),i=_A(this,n,r);return K(n,function(e){return{coord:e.coord,tickValue:e.tick.value,onBand:i}})},e.prototype.getMinorTicksCoords=function(){if(tO(this.scale))return[];var e=this.model.getModel(`minorTick`).get(`splitNumber`);return e>0&&e<100||(e=5),K(this.scale.getMinorTicks(e),function(e){return K(e,function(e){return{coord:this.dataToCoord(e),tickValue:e}},this)},this)},e.prototype.getViewLabels=function(e){return e||=bk(yk.determine),xk(this,e).labels},e.prototype.getLabelModel=function(){return this.model.getModel(`axisLabel`)},e.prototype.getTickModel=function(){return this.model.getModel(`axisTick`)},e.prototype.getBandWidth=function(){return dA(this,{min:1}).w},e.prototype.calculateCategoryInterval=function(e){return e||=bk(yk.determine),Pk(this,e)},e}();function gA(e){var t=e.getExtent();if(e.onBand){var n=(t[1]-t[0])/e.scale.count()/2;t[0]+=n,t[1]-=n}return t}function _A(e,t,n){var r=t.length;if(!e.onBand||n||!r)return!1;var i=dA(e).w;if(!i)return!1;G(t,function(e){e.coord-=i/2});var a=e.scale.getExtent(),o=t[r-1];return o.tick.offInterval&&t.pop(),t.push({coord:o.coord+i,tick:{value:a[1]+1}}),!0}var vA=function(e){U(t,e);function t(t,n,r,i,a){var o=e.call(this,t,n,r)||this;return o.index=0,o.type=i||`value`,o.position=a||`bottom`,o}return t.prototype.isHorizontal=function(){var e=this.position;return e===`top`||e===`bottom`},t.prototype.getGlobalExtent=function(e){var t=this.getExtent();return t[0]=this.toGlobalCoord(t[0]),t[1]=this.toGlobalCoord(t[1]),e&&t[0]>t[1]&&t.reverse(),t},t.prototype.pointToData=function(e,t){return this.coordToData(this.toLocalCoord(e[this.dim===`x`?0:1]),t)},t.prototype.setCategorySortInfo=function(e){if(this.type!==`category`)return!1;this.model.option.categorySortInfo=e,this.scale.setSortInfo(e)},t}(hA),yA=T_.extend({type:`triangle`,shape:{cx:0,cy:0,width:0,height:0},buildPath:function(e,t){var n=t.cx,r=t.cy,i=t.width/2,a=t.height/2;e.moveTo(n,r-a),e.lineTo(n+i,r+a),e.lineTo(n-i,r+a),e.closePath()}}),bA={line:wb,rect:z_,roundRect:z_,square:z_,circle:Jy,diamond:T_.extend({type:`diamond`,shape:{cx:0,cy:0,width:0,height:0},buildPath:function(e,t){var n=t.cx,r=t.cy,i=t.width/2,a=t.height/2;e.moveTo(n,r-a),e.lineTo(n+i,r),e.lineTo(n,r+a),e.lineTo(n-i,r),e.closePath()}}),pin:T_.extend({type:`pin`,shape:{x:0,y:0,width:0,height:0},buildPath:function(e,t){var n=t.x,r=t.y,i=t.width/5*3,a=Math.max(i,t.height),o=i/2,s=o*o/(a-o),c=r-a+o+s,l=Math.asin(s/o),u=Math.cos(l)*o,d=Math.sin(l),f=Math.cos(l),p=o*.6,m=o*.7;e.moveTo(n-u,c+s),e.arc(n,c,o,Math.PI-l,Math.PI*2+l),e.bezierCurveTo(n+u-d*p,c+s+f*p,n,r-m,n,r),e.bezierCurveTo(n,r-m,n-u+d*p,c+s+f*p,n-u,c+s),e.closePath()}}),arrow:T_.extend({type:`arrow`,shape:{x:0,y:0,width:0,height:0},buildPath:function(e,t){var n=t.height,r=t.width,i=t.x,a=t.y,o=r/3*2;e.moveTo(i,a),e.lineTo(i+o,a+n),e.lineTo(i,a+n/4*3),e.lineTo(i-o,a+n),e.lineTo(i,a),e.closePath()}}),triangle:yA},xA={line:function(e,t,n,r,i){i.x1=e,i.y1=t+r/2,i.x2=e+n,i.y2=t+r/2},rect:function(e,t,n,r,i){i.x=e,i.y=t,i.width=n,i.height=r},roundRect:function(e,t,n,r,i){i.x=e,i.y=t,i.width=n,i.height=r,i.r=Math.min(n,r)/4},square:function(e,t,n,r,i){var a=Math.min(n,r);i.x=e,i.y=t,i.width=a,i.height=a},circle:function(e,t,n,r,i){i.cx=e+n/2,i.cy=t+r/2,i.r=Math.min(n,r)/2},diamond:function(e,t,n,r,i){i.cx=e+n/2,i.cy=t+r/2,i.width=n,i.height=r},pin:function(e,t,n,r,i){i.x=e+n/2,i.y=t+r/2,i.width=n,i.height=r},arrow:function(e,t,n,r,i){i.x=e+n/2,i.y=t+r/2,i.width=n,i.height=r},triangle:function(e,t,n,r,i){i.cx=e+n/2,i.cy=t+r/2,i.width=n,i.height=r}},SA={};G(bA,function(e,t){SA[t]=new e});var CA=T_.extend({type:`symbol`,shape:{symbolType:``,x:0,y:0,width:0,height:0},calculateTextPosition:function(e,t,n){var r=Lp(e,t,n),i=this.shape;return i&&i.symbolType===`pin`&&t.position===`inside`&&(r.y=n.y+n.height*.4),r},buildPath:function(e,t,n){var r=t.symbolType;if(r!==`none`){var i=SA[r];i||=(r=`rect`,SA[r]),xA[r](t.x,t.y,t.width,t.height,i.shape),i.buildPath(e,i.shape,n)}}});function wA(e,t){if(this.type!==`image`){var n=this.style;this.__isEmptyBrush?(n.stroke=e,n.fill=t||Q.color.neutral00,n.lineWidth=2):this.shape.symbolType===`line`?n.stroke=e:n.fill=e,this.markRedraw()}}function TA(e,t,n,r,i,a,o){var s=e.indexOf(`empty`)===0;s&&(e=e.substr(5,1).toLowerCase()+e.substr(6));var c=e.indexOf(`image://`)===0?fx(e.slice(8),new fp(t,n,r,i),o?`center`:`cover`):e.indexOf(`path://`)===0?dx(e.slice(7),{},new fp(t,n,r,i),o?`center`:`cover`):new CA({shape:{symbolType:e,x:t,y:n,width:r,height:i}});return c.__isEmptyBrush=s,c.setColor=wA,a&&c.setColor(a),c}function EA(e){return J(e)||(e=[+e,+e]),[e[0]||0,e[1]||0]}function DA(e,t){if(e!=null)return J(e)||(e=[e,e]),[Cu(e[0],t[0])||0,Cu(X(e[1],e[0]),t[1])||0]}var OA=Math.PI,kA=[[1,2,1,2],[5,3,5,3],[8,3,8,3]],AA=[[0,1,0,1],[0,3,0,3],[0,3,0,3]],jA=Td(),MA=Td(),NA=function(){function e(e){this.recordMap={},this.resolveAxisNameOverlap=e}return e.prototype.ensureRecord=function(e){var t=e.axis.dim,n=e.componentIndex,r=this.recordMap,i=r[t]||(r[t]=[]);return i[n]||(i[n]={ready:{}})},e}();function PA(e,t,n,r){var i=n.axis,a=t.ensureRecord(n),o=[],s,c=ij(e.axisName)&&nk(e.nameLocation);G(r,function(e){var t=dD(e);if(t&&!t.label.ignore){o.push(t);var n=a.transGroup;c&&(n.transform?Nf(FA,n.transform):Df(FA),t.transform&&kf(FA,FA,t.transform),fp.copy(IA,t.localRect),IA.applyTransform(FA),s?s.union(IA):fp.copy(s=new fp(0,0,0,0),IA))}});var l=Math.abs(a.dirVec.x)>.1?`x`:`y`,u=a.transGroup[l];if(o.sort(function(e,t){return Math.abs(e.label[l]-u)-Math.abs(t.label[l]-u)}),c&&s){var d=i.getExtent(),f=Math.min(d[0],d[1]),p=Math.max(d[0],d[1])-f;s.union(new fp(f,0,p,1))}a.stOccupiedRect=s,a.labelInfoList=o}var FA=Ef(),IA=new fp(0,0,0,0),LA=function(e,t,n,r,i,a){if(nk(e.nameLocation)){var o=a.stOccupiedRect;o&&RA(mD({},o,a.transGroup.transform),r,i)}else zA(a.labelInfoList,a.dirVec,r,i)};function RA(e,t,n){var r=new Qf;xD(e,t,r,{direction:Math.atan2(n.y,n.x),bidirectional:!1,touchThreshold:.05})&&hD(t,r)}function zA(e,t,n,r){for(var i=Qf.dot(r,t)>=0,a=0,o=e.length;a0?`top`:`bottom`,i=`center`):Fu(r-OA)?(a=n>0?`bottom`:`top`,i=`center`):(a=`middle`,i=r>0&&r0?`right`:`left`:n>0?`left`:`right`),{rotation:r,textAlign:i,textVerticalAlign:a}},e.makeAxisEventDataBase=function(e){var t={componentType:e.mainType,componentIndex:e.componentIndex};return t[e.mainType+`Index`]=e.componentIndex,t},e.isLabelSilent=function(e){var t=e.get(`tooltip`);return e.get(`silent`)||!(e.get(`triggerEvent`)||t&&t.show)},e}(),VA=[`axisLine`,`axisTickLabelEstimate`,`axisTickLabelDetermine`,`axisName`],HA={axisLine:function(e,t,n,r,i,a,o){var s=r.get([`axisLine`,`show`]);if(s===`auto`&&(s=!0,e.raw.axisLineAutoShow!=null&&(s=!!e.raw.axisLineAutoShow)),s){var c=r.axis.getExtent(),l=a.transform,u=[c[0],0],d=[c[1],0],f=u[0]>d[0];l&&(Yf(u,u,l),Yf(d,d,l));var p=W({lineCap:`round`},r.getModel([`axisLine`,`lineStyle`]).getLineStyle()),m={strokeContainThreshold:e.raw.strokeContainThreshold||5,silent:!0,z2:1,style:p};if(r.get([`axisLine`,`breakLine`])&&sC(r.axis.scale))KD().buildAxisBreakLine(r,i,a,m);else{var h=new wb(W({shape:{x1:u[0],y1:u[1],x2:d[0],y2:d[1]}},m));gx(h.shape,h.style.lineWidth),h.anid=`line`,i.add(h)}var g=r.get([`axisLine`,`symbol`]);if(g!=null){var _=r.get([`axisLine`,`symbolSize`]);Y(g)&&(g=[g,g]),(Y(_)||Ml(_))&&(_=[_,_]);var v=DA(r.get([`axisLine`,`symbolOffset`])||0,_),y=_[0],b=_[1];G([{rotate:e.rotation+Math.PI/2,offset:v[0],r:0},{rotate:e.rotation-Math.PI/2,offset:v[1],r:Math.sqrt((u[0]-d[0])*(u[0]-d[0])+(u[1]-d[1])*(u[1]-d[1]))}],function(t,n){if(g[n]!==`none`&&g[n]!=null){var r=TA(g[n],-y/2,-b/2,y,b,p.stroke,!0),a=t.r+t.offset,o=f?d:u;r.attr({rotation:t.rotate,x:o[0]+a*Math.cos(e.rotation),y:o[1]-a*Math.sin(e.rotation),silent:!0,z2:11}),i.add(r)}})}}},axisTickLabelEstimate:function(e,t,n,r,i,a,o,s){ZA(t,i,s)&&UA(e,t,n,r,i,a,o,yk.estimate)},axisTickLabelDetermine:function(e,t,n,r,i,a,o,s){ZA(t,i,s)&&UA(e,t,n,r,i,a,o,yk.determine);var c=YA(e,i,a,r);KA(e,t.labelLayoutList,c),XA(e,i,a,r,e.tickDirection)},axisName:function(e,t,n,r,i,a,o,s){var c=n.ensureRecord(r);t.nameEl&&=(i.remove(t.nameEl),c.nameLayout=c.nameLocation=null);var l=e.axisName;if(ij(l)){var u=e.nameLocation,d=e.nameDirection,f=r.getModel(`nameTextStyle`),p=r.get(`nameGap`)||0,m=r.axis.getExtent(),h=r.axis.inverse?-1:1,g=new Qf(0,0),_=new Qf(0,0);u===`start`?(g.x=m[0]-h*p,_.x=-h):u===`end`?(g.x=m[1]+h*p,_.x=h):(g.x=(m[0]+m[1])/2,g.y=e.labelOffset+d*p,_.y=d);var v=Ef();_.transform(jf(v,v,e.rotation));var y=r.get(`nameRotate`);y!=null&&(y=y*OA/180);var b,x;nk(u)?b=BA.innerTextLayout(e.rotation,y??e.rotation,d):(b=WA(e.rotation,u,y||0,m),x=e.raw.axisNameAvailableWidth,x!=null&&(x=Math.abs(x/Math.sin(b.rotation)),!isFinite(x)&&(x=null)));var S=f.getFont(),C=r.get(`nameTruncate`,!0)||{},w=C.ellipsis,T=Bl(e.raw.nameTruncateMaxWidth,C.maxWidth,x),E=s.nameMarginLevel||0,D=new W_({x:g.x,y:g.y,rotation:b.rotation,silent:BA.isLabelSilent(r),style:nS(f,{text:l,font:S,overflow:`truncate`,width:T,ellipsis:w,fill:f.getTextColor()||r.get([`axisLine`,`lineStyle`,`color`]),align:f.get(`align`)||b.textAlign,verticalAlign:f.get(`verticalAlign`)||b.textVerticalAlign}),z2:1});if(Ix({el:D,componentModel:r,itemName:l}),D.__fullText=l,D.anid=`name`,r.get(`triggerEvent`)){var O=BA.makeAxisEventDataBase(r);O.targetType=`axisName`,O.name=l,iv(D).eventData=O}a.add(D),D.updateTransform(),t.nameEl=D;var k=c.nameLayout=dD({label:D,priority:D.z2,defaultAttr:{ignore:D.ignore},marginDefault:nk(u)?kA[E]:AA[E]});if(c.nameLocation=u,i.add(D),D.decomposeTransform(),e.shouldNameMoveOverlap&&k){var A=n.ensureRecord(r);n.resolveAxisNameOverlap(e,n,r,k,_,A)}}}};function UA(e,t,n,r,i,a,o,s){$A(t)||QA(e,t,i,s,r,o);var c=t.labelLayoutList;tj(e,r,c,a),oj(r,e.rotation,c);var l=e.optionHideOverlap;GA(r,c,l),l&&bD(Tl(c,function(e){return e&&!e.label.ignore})),PA(e,n,r,c)}function WA(e,t,n,r){var i=Pu(n-e),a,o,s=r[0]>r[1],c=t===`start`&&!s||t!==`start`&&s;return Fu(i-OA/2)?(o=c?`bottom`:`top`,a=`center`):Fu(i-OA*1.5)?(o=c?`top`:`bottom`,a=`center`):(o=`middle`,a=iOA/2?c?`left`:`right`:c?`right`:`left`),{rotation:i,textAlign:a,textVerticalAlign:o}}function GA(e,t,n){var r=e.axis,i=e.get([`axisLabel`,`customValues`]);if(ek(r))return;function a(e,a,o){var s=dD(t[a]),c=dD(t[o]),l=r.scale;if(s&&c){if(e==null){if(!n&&i)return;var u=jA(s.label).labelInfo.tick;if($D(l)&&u.notNice||tO(l)&&u.offInterval){qA(s.label);return}}if(e===!1||s.suggestIgnore){qA(s.label);return}if(c.suggestIgnore){qA(c.label);return}var d=.1;if(!n){var f=[0,0,0,0];s=gD({marginForce:f},s),c=gD({marginForce:f},c)}xD(s,c,null,{touchThreshold:d})&&qA(e?c.label:s.label)}}var o=e.get([`axisLabel`,`showMinLabel`]),s=e.get([`axisLabel`,`showMaxLabel`]),c=t.length;a(o,0,1),a(s,c-1,c-2)}function KA(e,t,n){e.showMinorTicks||G(t,function(e){if(e&&e.label.ignore)for(var t=0;t0&&u[1]>0&&!d[0]&&(u[0]=0),u[0]<0&&u[1]<0&&!d[1]&&(u[1]=0));var y=!1;u[0]>u[1]&&(u.reverse(),y=!0);var b=_j(e,t.get(`startValue`,!0)),x=b!=null;!qu(b)&&r&&(b=e.getDefaultStartValue?e.getDefaultStartValue():0),qu(b)&&(x||!_||v)&&(bu[1]&&!d[1]&&(u[1]=b,d[1]=!0)),gj(this._i={scale:e,dataMM:l,noZoomEffMM:u,zoomMM:[],fixMM:d,zoomFixMM:[!1,!1],startValue:b,isBlank:g,incl0:v,tggAxInv:y,ctnShp:i},u)}return e.prototype.makeNoZoom=function(){return this._i.noZoomEffMM.slice()},e.prototype.makeFinal=function(){var e=this._i,t=e.zoomMM,n=e.noZoomEffMM,r=e.zoomFixMM,i=e.fixMM,a={fixMM:i,zoomFixMM:r,isBlank:e.isBlank,incl0:e.incl0,tggAxInv:e.tggAxInv,ctnShp:e.ctnShp,effMM:n.slice()},o=a.effMM;return t[0]!=null&&(o[0]=t[0],i[0]=r[0]=!0),t[1]!=null&&(o[1]=t[1],i[1]=r[1]=!0),gj(e,o),a},e.prototype.makeRenderInfo=function(){return{startValue:this._i.startValue}},e.prototype.setZoomMM=function(e,t){this._i.zoomMM[e]=t},e}();function gj(e,t){var n=e.scale,r=e.dataMM;n.sanitize&&(t[0]=n.sanitize(t[0],r),t[1]=n.sanitize(t[1],r),Gd(t))}function _j(e,t){return t==null?null:zl(t)?NaN:e.parse(t)}function vj(e,t){var n;if(tO(e))n=[0,0];else{var r=t.get(`boundaryGap`);typeof r==`boolean`&&(r=null),n=J(r)?r:[r,r]}return[yj(n[0]),yj(n[1])]}function yj(e){return Ip(typeof e==`boolean`?0:e,1)||0}function bj(e){var t=pj(e.scale);return t.extent||=Ld(),t}function xj(e,t){bj(e).dimIdxInCoord=t.get(e.dim)}function Sj(e,t){var n=e.scale,r=e.model,i=e.dim;n.rawExtentInfo||Cj(n,e,i,r,t)}function Cj(e,t,n,r,i){var a=bj(t),o=a.extent,s=!1;Qk(t,function(r){if(r.boxCoordinateSystem){var i=iw(r).coord,c=a.dimIdxInCoord;if(c>=0&&J(i)){var l=i[c];l!=null&&!J(l)&&Rd(o,e.parse(l))}}else if(r.coordinateSystem){var u=r.getData();if(u){var d=e.getFilter?e.getFilter():null;G(tk(u,n),function(e){Vd(o,u.getApproximateExtent(e,d))})}r.__requireStartValue&&r.__requireStartValue(t)&&(s=!0)}});var c=kj(e,t,r);Tj(e,new hj(e,r,o,s,c),i),a.extent=null}function wj(e,t){var n=e.scale;Tj(n,new hj(n,e.model,t,!1,!1),mj)}function Tj(e,t,n){e.rawExtentInfo=t,t.from=n}function Ej(e,t){Dj.set(e,t)}var Dj=$l();function Oj(e,t,n,r,i){e.rawExtentInfo||wj({scale:e,model:t},i||Ld());var a=e.rawExtentInfo.makeFinal(),o=a.effMM;return e.setExtent(o[0],o[1]),e.setBlank(a.isBlank),r&&a.tggAxInv&&n&&!n.get(`legacyMinMaxDontInverseAxis`)&&(r.inverse=!r.inverse),a}function kj(e,t,n){var r=ck(e,n),i=n.get(`containShape`,!0);if(i==null&&!r&&(i=!0),!i)return!1;var a=!1;return nA(t,function(e){a=!!Dj.get(e)||a}),a}function Aj(e,t,n,r){if(n.ctnShp){var i;if(nA(e,function(t){var n=Dj.get(t);if(n){var a=n(e,r);a&&(i||=[0,0],zd(i,a[0]),Bd(i,a[1]),YO(e))}}),i){var a=t.getExtent();if(tO(t))e.onBand||t.setExtent2(1,du(a[0],a[0]+i[0]),fu(a[1],a[1]+i[1]));else{var o=a.slice();n.zoomFixMM[0]||(o[0]=du(o[0],t.transformOut(t.transformIn(o[0],null)+i[0],null))),n.zoomFixMM[1]||(o[1]=fu(o[1],t.transformOut(t.transformIn(o[1],null)+i[1],null))),(o[0]a[1])&&t.setExtent2(1,o[0],o[1])}}}}function jj(e,t){var n=e.scale,r=e.model,i=Oj(n,r,r.ecModel,e,null),a=eO(n),o=eO(t)?t.intervalStub:t,s=a?n.intervalStub:n,c=n.base,l=o.getTicks(),u=o.getTicks({expandToNicedExtent:!0}),d=l.length-1,f,p,m;if(d===1)f=p=0,m=1;else if(d===2){var h=pu(l[0].value-l[1].value),g=pu(l[1].value-l[2].value);f=p=0,h===g?m=2:(m=1,h=C[1])return!0})):b[1]?(T=C[1],A(function(){if(P(),k=Du(O-E*m,D),j(),w<=C[0])return!0})):A(function(){k=Du(gu(C[0]/E)*E,D),O=Du(hu(C[1]/E)*E,D);var e=mu((O-k)/E);if(e<=m){var t=m-e,n=void 0,r=i.incl0||a;if(r&&C[0]===0)n=[0,t];else if(r&&C[1]===0)n=[t,0];else{var o=hu(t/2);n=t%2==0?[o,o]:w+T=C[1])return!0}})}ok(n,b,S,[w,T],x,{interval:E,intervalCount:m,intervalPrecision:D,niceExtent:[k,O]})}function Mj(e,t){var n=eO(e),r=n?e.intervalStub:e,i=t.fixMinMax||[],a=n?e.getExtent():null,o=r.getExtent(),s=oO(o,i,t.rawExtentResult);r.setExtent(s[0],s[1]),s=r.getExtent();var c=n?Pj(r,t):Nj(r,t),l=c.intervalPrecision,u=c.interval,d=t.userInterval;d!=null&&(c.interval=d,c.intervalPrecision=rO(d)),i[0]||(s[0]=Du(hu(s[0]/u)*u,l)),i[1]||(s[1]=Du(gu(s[1]/u)*u,l)),d!=null&&(c.niceExtent=s.slice()),ok(e,i,o,s,a,c)}function Nj(e,t){var n=cO(t.splitNumber,5),r=BD(e),i=t.minInterval,a=t.maxInterval,o=Bu(r/n,!0);i!=null&&oa&&(o=a);var s=rO(o),c=e.getExtent(),l=[Du(gu(c[0]/o)*o,s),Du(hu(c[1]/o)*o,s)];return{interval:o,intervalPrecision:s,niceExtent:l}}function Pj(e,t){var n=cO(t.splitNumber,10),r=e.getExtent(),i=BD(e),a=fu(Ru(i),1);n/i*a<=.5&&(a*=10);var o=rO(a),s=[Du(gu(r[0]/a)*a,o),Du(hu(r[1]/a)*a,o)];return{intervalPrecision:o,interval:a,niceExtent:s}}function Fj(e){var t=e.scale,n=e.model,r=n.axis,i=n.ecModel;Ij(t,n,r,i,null)}function Ij(e,t,n,r,i){var a=Oj(e,t,r,n,i),o=QD(e)||$D(e);Lj(e,{splitNumber:t.get(`splitNumber`),fixMinMax:a.fixMM,userInterval:t.get(`interval`),minInterval:o?t.get(`minInterval`):null,maxInterval:o?t.get(`maxInterval`):null,rawExtentResult:a}),n&&r&&Aj(n,e,a,r)}function Lj(e,t){Rj[e.type](e,t)}var Rj={interval:Mj,log:Mj,time:TO,ordinal:ru},zj=[[3,1],[0,2]],Bj=function(){function e(e,t,n){this.type=`grid`,this._coordsMap={},this._coordsList=[],this._axesMap={},this._axesList=[],this.axisPointerEnabled=!0,this.dimensions=mk,this._initCartesian(e,t,n),this.model=e}return e.prototype.getRect=function(){return this._rect},e.prototype.update=function(e,t){var n=this._axesMap;G(this._axesList,function(e){Sj(e,1);var t=e.scale;tO(t)&&t.setSortInfo(e.model.get(`categorySortInfo`))});function r(e){for(var t=Dl(e),n=[],r=t.length-1;r>=0;r--){var i=e[+t[r]];i.__alignTo?n.push(i):Fj(i)}G(n,function(e){Gj(e,e.__alignTo)?Fj(e):jj(e,e.__alignTo.scale)})}r(n.x),r(n.y);var i={};G(n.x,function(e){Hj(n,`y`,e,i)}),G(n.y,function(e){Hj(n,`x`,e,i)}),this.resize(this.model,t)},e.prototype.resize=function(e,t,n){var r=hw(e,t),i=this._rect=pw(e.getBoxLayoutParams(),r.refContainer),a=this._axesMap,o=this._coordsList,s=e.get(`containLabel`);if(qj(a,i),!n){var c=Zj(i,o,a,s,t),l=void 0;if(s)Yj?(Yj(this._axesList,i),qj(a,i)):l=Xj(i.clone(),`axisLabel`,null,i,a,c,r);else{var u=$j(e,i,r),d=u.outerBoundsRect,f=u.parsedOuterBoundsContain,p=u.outerBoundsClamp;d&&(l=Xj(d,f,p,i,a,c,r))}Qj(i,a,yk.determine,null,l,r),G(this._coordsList,function(e){e.calcAffineTransform()})}},e.prototype.getAxis=function(e,t){var n=this._axesMap[e];if(n!=null)return n[t||0]},e.prototype.getAxes=function(){return this._axesList.slice()},e.prototype.getCartesian=function(e,t){if(e!=null&&t!=null){var n=`x`+e+`y`+t;return this._coordsMap[n]}Nl(e)&&(t=e.yAxisIndex,e=e.xAxisIndex);for(var r=0,i=this._coordsList;r=0;i--){var a=e[+t[i]];ZD(a.scale)&&ik(a.model,a.type,!0)==null&&(a.model.get(`alignTicks`)&&a.model.get(`interval`)==null?r.push(a):n=a)}n||=r.pop(),n&&G(r,function(e){e.__alignTo=n})}function Gj(e,t){return sC(e.scale)||sC(t.scale)||t.scale.getTicks().length<2}function Kj(e,t){var n=e.getExtent(),r=n[0]+n[1];e.toGlobalCoord=e.dim===`x`?function(e){return e+t}:function(e){return r-e+t},e.toLocalCoord=e.dim===`x`?function(e){return e-t}:function(e){return r-e+t}}function qj(e,t){G(e.x,function(e){return Jj(e,t.x,t.width)}),G(e.y,function(e){return Jj(e,t.y,t.height)})}function Jj(e,t,n){var r=[0,n],i=+!!e.inverse;e.setExtent(r[i],r[1-i]),Kj(e,t)}var Yj;function Xj(e,t,n,r,i,a,o){Qj(r,i,yk.estimate,t,!1,o);var s=[0,0,0,0];l(0),l(1),u(r,0,NaN),u(r,1,NaN);var c=El(s,function(e){return e>0})==null;return Nx(r,s,!0,!0,n),qj(i,r),c;function l(e){G(i[ix[e]],function(t){if(rk(t.model)){var n=a.ensureRecord(t.model),r=n.labelInfoList;if(r)for(var i=0;i0&&!zl(t)&&t>1e-4&&(e/=t),e}}function Zj(e,t,n,r,i){var a=new NA(eM);return G(n,function(n){return G(n,function(n){if(rk(n.model)){var o=!r;n.axisBuilder=uj(e,t,n.model,i,a,o)}})}),a}function Qj(e,t,n,r,i,a){var o=n===yk.determine;G(t,function(t){return G(t,function(t){rk(t.model)&&(dj(t.axisBuilder,e,t.model),t.axisBuilder.build(o?{axisTickLabelDetermine:!0}:{axisTickLabelEstimate:!0},{noPxChange:i}))})});var s={x:0,y:0};c(0),c(1);function c(t){s[ix[1-t]]=e[ax[t]]<=a.refContainer[ax[t]]*.5?0:1-t==1?2:1}G(t,function(e,t){return G(e,function(e){rk(e.model)&&((r===`all`||o)&&e.axisBuilder.build({axisName:!0},{nameMarginLevel:s[t]}),o&&e.axisBuilder.build({axisLine:!0}))})})}function $j(e,t,n){var r,i=e.get(`outerBoundsMode`,!0);i===`same`?r=t.clone():(i==null||i===`auto`)&&(r=pw(e.get(`outerBounds`,!0)||uk,n.refContainer));var a=e.get(`outerBoundsContain`,!0),o=a==null||a===`auto`||bl([`all`,`axisLabel`],a)<0?`all`:a,s=[Tu(X(e.get(`outerBoundsClampWidth`,!0),dk[0]),t.width),Tu(X(e.get(`outerBoundsClampHeight`,!0),dk[1]),t.height)];return{outerBoundsRect:r,parsedOuterBoundsContain:o,outerBoundsClamp:s}}var eM=function(e,t,n,r,i,a){var o=n.axis.dim===`x`?`y`:`x`;LA(e,t,n,r,i,a),nk(e.nameLocation)||G(t.recordMap[o],function(e){e&&e.labelInfoList&&e.dirVec&&zA(e.labelInfoList,e.dirVec,r,i)})},tM=function(){function e(e,t){this.target=e,this.topTarget=t&&t.topTarget}return e}(),nM=function(){function e(e){this.handler=e,e.on(`mousedown`,this._dragStart,this),e.on(`mousemove`,this._drag,this),e.on(`mouseup`,this._dragEnd,this)}return e.prototype._dragStart=function(e){for(var t=e.target;t&&!t.draggable;)t=t.parent||t.__hostTarget;t&&(this._draggingTarget=t,t.dragging=!0,this._x=e.offsetX,this._y=e.offsetY,this.handler.dispatchToElement(new tM(t,e),`dragstart`,e.event))},e.prototype._drag=function(e){var t=this._draggingTarget;if(t){var n=e.offsetX,r=e.offsetY,i=n-this._x,a=r-this._y;this._x=n,this._y=r,t.drift(i,a,e),this.handler.dispatchToElement(new tM(t,e),`drag`,e.event);var o=this.handler.findHover(n,r,t).target,s=this._dropTarget;this._dropTarget=o,t!==o&&(s&&o!==s&&this.handler.dispatchToElement(new tM(s,e),`dragleave`,e.event),o&&o!==s&&this.handler.dispatchToElement(new tM(o,e),`dragenter`,e.event))}},e.prototype._dragEnd=function(e){var t=this._draggingTarget;t&&(t.dragging=!1),this.handler.dispatchToElement(new tM(t,e),`dragend`,e.event),this._dropTarget&&this.handler.dispatchToElement(new tM(this._dropTarget,e),`drop`,e.event),this._draggingTarget=null,this._dropTarget=null},e}(),rM=/^(?:mouse|pointer|contextmenu|drag|drop)|click/,iM=[],aM=ou.browser.firefox&&+ou.browser.version.split(`.`)[0]<39;function oM(e,t,n,r){return n||={},r?sM(e,t,n):aM&&t.layerX!=null&&t.layerX!==t.offsetX?(n.zrX=t.layerX,n.zrY=t.layerY):t.offsetX==null?sM(e,t,n):(n.zrX=t.offsetX,n.zrY=t.offsetY),n}function sM(e,t,n){if(ou.domSupported&&e.getBoundingClientRect){var r=t.clientX,i=t.clientY;if(VS(e)){var a=e.getBoundingClientRect();n.zrX=r-a.left,n.zrY=i-a.top;return}if(RS(iM,e,r,i)){n.zrX=iM[0],n.zrY=iM[1];return}}n.zrX=n.zrY=0}function cM(e){return e||window.event}function lM(e,t,n){if(t=cM(t),t.zrX!=null)return t;var r=t.type;if(r&&r.indexOf(`touch`)>=0){var i=r===`touchend`?t.changedTouches[0]:t.targetTouches[0];i&&oM(e,i,t,n)}else{oM(e,t,t,n);var a=uM(t);t.zrDelta=a?a/120:-(t.detail||0)/3}var o=t.button;return t.which==null&&o!==void 0&&rM.test(t.type)&&(t.which=o&1?1:o&2?3:o&4?2:0),t}function uM(e){var t=e.wheelDelta;if(t)return t;var n=e.deltaX,r=e.deltaY;if(n==null||r==null)return t;var i=Math.abs(r===0?n:r),a=r>0?-1:r<0?1:n>0?-1:1;return 3*i*a}function dM(e,t,n,r){e.addEventListener(t,n,r)}function fM(e,t,n,r){e.removeEventListener(t,n,r)}var pM=function(e){e.preventDefault(),e.stopPropagation(),e.cancelBubble=!0};function mM(e){return e.which===2||e.which===3}var hM=function(){function e(){this._track=[]}return e.prototype.recognize=function(e,t,n){return this._doTrack(e,t,n),this._recognize(e)},e.prototype.clear=function(){return this._track.length=0,this},e.prototype._doTrack=function(e,t,n){var r=e.touches;if(r){for(var i={points:[],touches:[],target:t,event:e},a=0,o=r.length;a1&&r&&r.length>1){var a=gM(r)/gM(i);!isFinite(a)&&(a=1),t.pinchScale=a;var o=_M(r);return t.pinchX=o[0],t.pinchY=o[1],{type:`pinch`,target:e[0].target,event:t}}}}},yM=`silent`;function bM(e,t,n){return{type:e,event:n,target:t.target,topTarget:t.topTarget,cancelBubble:!1,offsetX:n.zrX,offsetY:n.zrY,gestureEvent:n.gestureEvent,pinchX:n.pinchX,pinchY:n.pinchY,pinchScale:n.pinchScale,wheelDelta:n.zrDelta,zrByTouch:n.zrByTouch,which:n.which,stop:xM}}function xM(){pM(this.event)}var SM=function(e){U(t,e);function t(){var t=e!==null&&e.apply(this,arguments)||this;return t.handler=null,t}return t.prototype.dispose=function(){},t.prototype.setCursor=function(){},t}(Uh),CM=function(){function e(e,t){this.x=e,this.y=t}return e}(),wM=[`click`,`dblclick`,`mousewheel`,`mouseout`,`mouseup`,`mousedown`,`mousemove`,`contextmenu`],TM=new fp(0,0,0,0),EM=function(e){U(t,e);function t(t,n,r,i,a){var o=e.call(this)||this;return o._hovered=new CM(0,0),o.storage=t,o.painter=n,o.painterRoot=i,o._pointerSize=a,r||=new SM,o.proxy=null,o.setHandlerProxy(r),o._draggingMgr=new nM(o),o}return t.prototype.setHandlerProxy=function(e){this.proxy&&this.proxy.dispose(),e&&(G(wM,function(t){e.on&&e.on(t,this[t],this)},this),e.handler=this),this.proxy=e},t.prototype.mousemove=function(e){var t=e.zrX,n=e.zrY,r=kM(this,t,n),i=this._hovered,a=i.target;a&&!a.__zr&&(i=this.findHover(i.x,i.y),a=i.target);var o=this._hovered=r?new CM(t,n):this.findHover(t,n),s=o.target,c=this.proxy;c.setCursor&&c.setCursor(s?s.cursor:`default`),a&&s!==a&&this.dispatchToElement(i,`mouseout`,e),this.dispatchToElement(o,`mousemove`,e),s&&s!==a&&this.dispatchToElement(o,`mouseover`,e)},t.prototype.mouseout=function(e){var t=e.zrEventControl;t!==`only_globalout`&&this.dispatchToElement(this._hovered,`mouseout`,e),t!==`no_globalout`&&this.trigger(`globalout`,{type:`globalout`,event:e})},t.prototype.resize=function(){this._hovered=new CM(0,0)},t.prototype.dispatch=function(e,t){var n=this[e];n&&n.call(this,t)},t.prototype.dispose=function(){this.proxy.dispose(),this.storage=null,this.proxy=null,this.painter=null},t.prototype.setCursorStyle=function(e){var t=this.proxy;t.setCursor&&t.setCursor(e)},t.prototype.dispatchToElement=function(e,t,n){e||={};var r=e.target;if(!(r&&r.silent)){for(var i=`on`+t,a=bM(t,e,n);r&&(r[i]&&(a.cancelBubble=!!r[i].call(r,a)),r.trigger(t,a),r=r.__hostTarget?r.__hostTarget:r.parent,!a.cancelBubble););a.cancelBubble||(this.trigger(t,a),this.painter&&this.painter.eachOtherLayer&&this.painter.eachOtherLayer(function(e){typeof e[i]==`function`&&e[i].call(e,a),e.trigger&&e.trigger(t,a)}))}},t.prototype.findHover=function(e,t,n){var r=this.storage.getDisplayList(),i=new CM(e,t);if(OM(r,i,e,t,n),this._pointerSize&&!i.target){for(var a=[],o=this._pointerSize,s=o/2,c=new fp(e-s,t-s,o,o),l=r.length-1;l>=0;l--){var u=r[l];u!==n&&!u.ignore&&!u.ignoreCoarsePointer&&(!u.parent||!u.parent.ignoreCoarsePointer)&&(TM.copy(u.getBoundingRect()),u.transform&&TM.applyTransform(u.transform),TM.intersect(c)&&a.push(u))}if(a.length){for(var d=4,f=Math.PI/12,p=Math.PI*2,m=0;m4)return;this._downPoint=null}this.dispatchToElement(a,e,t)}});function DM(e,t,n){if(e[e.rectHover?`rectContain`:`contain`](t,n)){for(var r=e,i=void 0,a=!1;r;){if(r.ignoreClip&&(a=!0),!a){var o=r.getClipPath();if(o&&!o.contain(t,n))return!1}r.silent&&(i=!0);var s=r.__hostTarget;r=s?r.ignoreHostSilent?null:s:r.parent}return!i||yM}return!1}function OM(e,t,n,r,i){for(var a=e.length-1;a>=0;a--){var o=e[a],s=void 0;if(o!==i&&!o.ignore&&(s=DM(o,n,r))&&(!t.topTarget&&(t.topTarget=o),s!==yM)){t.target=o;break}}}function kM(e,t,n){var r=e.painter;return t<0||t>r.getWidth()||n<0||n>r.getHeight()}var AM=32,jM=7;function MM(e){for(var t=0;e>=AM;)t|=e&1,e>>=1;return e+t}function NM(e,t,n,r){var i=t+1;if(i===n)return 1;if(r(e[i++],e[t])<0){for(;i=0;)i++;return i-t}function PM(e,t,n){for(n--;t>>1,i(a,e[c])<0?s=c:o=c+1;var l=r-o;switch(l){case 3:e[o+3]=e[o+2];case 2:e[o+2]=e[o+1];case 1:e[o+1]=e[o];break;default:for(;l>0;)e[o+l]=e[o+l-1],l--}e[o]=a}}function IM(e,t,n,r,i,a){var o=0,s=0,c=1;if(a(e,t[n+i])>0){for(s=r-i;c0;)o=c,c=(c<<1)+1,c<=0&&(c=s);c>s&&(c=s),o+=i,c+=i}else{for(s=i+1;cs&&(c=s);var l=o;o=i-c,c=i-l}for(o++;o>>1);a(e,t[n+u])>0?o=u+1:c=u}return c}function LM(e,t,n,r,i,a){var o=0,s=0,c=1;if(a(e,t[n+i])<0){for(s=i+1;cs&&(c=s);var l=o;o=i-c,c=i-l}else{for(s=r-i;c=0;)o=c,c=(c<<1)+1,c<=0&&(c=s);c>s&&(c=s),o+=i,c+=i}for(o++;o>>1);a(e,t[n+u])<0?c=u:o=u+1}return c}function RM(e,t){var n=jM,r,i,a=0,o=[];r=[],i=[];function s(e,t){r[a]=e,i[a]=t,a+=1}function c(){for(;a>1;){var e=a-2;if(e>=1&&i[e-1]<=i[e]+i[e+1]||e>=2&&i[e-2]<=i[e]+i[e-1])i[e-1]i[e+1])break;u(e)}}function l(){for(;a>1;){var e=a-2;e>0&&i[e-1]=jM||m>=jM);if(h)break;f<0&&(f=0),f+=2}if(n=f,n<1&&(n=1),i===1){for(c=0;c=0;c--)e[p+c]=e[f+c];e[d]=o[u];return}for(var m=n;;){var h=0,g=0,_=!1;do if(t(o[u],e[l])<0){if(e[d--]=e[l--],h++,g=0,--i===0){_=!0;break}}else if(e[d--]=o[u--],g++,h=0,--s===1){_=!0;break}while((h|g)=0;c--)e[p+c]=e[f+c];if(i===0){_=!0;break}}if(e[d--]=o[u--],--s===1){_=!0;break}if(g=s-IM(e[l],o,0,s,s-1,t),g!==0){for(d-=g,u-=g,s-=g,p=d+1,f=u+1,c=0;c=jM||g>=jM);if(_)break;m<0&&(m=0),m+=2}if(n=m,n<1&&(n=1),s===1){for(d-=i,l-=i,p=d+1,f=l+1,c=i-1;c>=0;c--)e[p+c]=e[f+c];e[d]=o[u]}else if(s===0)throw Error();else for(f=d-(s-1),c=0;cs&&(c=s),FM(e,n,n+c,n+a,t),a=c}o.pushRun(n,a),o.mergeRuns(),i-=a,n+=a}while(i!==0);o.forceMergeRuns()}}var BM=!1;function VM(){BM||(BM=!0,console.warn(`z / z2 / zlevel of displayable is invalid, which may cause unexpected errors`))}function HM(e,t){return e.zlevel===t.zlevel?e.z===t.z?e.z2-t.z2:e.z-t.z:e.zlevel-t.zlevel}var UM=function(){function e(){this._roots=[],this._displayList=[],this._displayListLen=0,this.displayableSortFunc=HM}return e.prototype.traverse=function(e,t){for(var n=0;n=0&&this._roots.splice(r,1)},e.prototype.delAllRoots=function(){this._roots=[],this._displayList=[],this._displayListLen=0},e.prototype.getRoots=function(){return this._roots},e.prototype.dispose=function(){this._displayList=null,this._roots=null},e}(),WM=ou.hasGlobalWindow&&(window.requestAnimationFrame&&window.requestAnimationFrame.bind(window)||window.msRequestAnimationFrame&&window.msRequestAnimationFrame.bind(window)||window.mozRequestAnimationFrame||window.webkitRequestAnimationFrame)||function(e){return setTimeout(e,16)};function GM(){return new Date().getTime()}var KM=function(e){U(t,e);function t(t){var n=e.call(this)||this;return n._running=!1,n._time=0,n._pausedTime=0,n._pauseStart=0,n._paused=!1,t||={},n.stage=t.stage||{},n}return t.prototype.addClip=function(e){e.animation&&this.removeClip(e),this._head?(this._tail.next=e,e.prev=this._tail,e.next=null,this._tail=e):this._head=this._tail=e,e.animation=this},t.prototype.addAnimator=function(e){e.animation=this;var t=e.getClip();t&&this.addClip(t)},t.prototype.removeClip=function(e){if(e.animation){var t=e.prev,n=e.next;t?t.next=n:this._head=n,n?n.prev=t:this._tail=t,e.next=e.prev=e.animation=null}},t.prototype.removeAnimator=function(e){var t=e.getClip();t&&this.removeClip(t),e.animation=null},t.prototype.update=function(e){for(var t=GM()-this._pausedTime,n=t-this._time,r=this._head;r;){var i=r.next;r.step(t,n)?(r.ondestroy(),this.removeClip(r),r=i):r=i}this._time=t,e||(this.trigger(`frame`,n),this.stage.update&&this.stage.update())},t.prototype._startLoop=function(){var e=this;this._running=!0;function t(){e._running&&(WM(t),!e._paused&&e.update())}WM(t)},t.prototype.start=function(){this._running||(this._time=GM(),this._pausedTime=0,this._startLoop())},t.prototype.stop=function(){this._running=!1},t.prototype.pause=function(){this._paused||=(this._pauseStart=GM(),!0)},t.prototype.resume=function(){this._paused&&=(this._pausedTime+=GM()-this._pauseStart,!1)},t.prototype.clear=function(){for(var e=this._head;e;){var t=e.next;e.prev=e.next=e.animation=null,e=t}this._head=this._tail=null},t.prototype.isFinished=function(){return this._head==null},t.prototype.animate=function(e,t){t||={},this.start();var n=new Hh(e,t.loop);return this.addAnimator(n),n},t}(Uh),qM=300,JM=ou.domSupported,YM=(function(){var e=[`click`,`dblclick`,`mousewheel`,`wheel`,`mouseout`,`mouseup`,`mousedown`,`mousemove`,`contextmenu`],t=[`touchstart`,`touchend`,`touchmove`],n={pointerdown:1,pointerup:1,pointermove:1,pointerout:1};return{mouse:e,touch:t,pointer:K(e,function(e){var t=e.replace(`mouse`,`pointer`);return n.hasOwnProperty(t)?t:e})}})(),XM={mouse:[`mousemove`,`mouseup`],pointer:[`pointermove`,`pointerup`]},ZM=!1;function QM(e){var t=e.pointerType;return t===`pen`||t===`touch`}function $M(e){e.touching=!0,e.touchTimer!=null&&(clearTimeout(e.touchTimer),e.touchTimer=null),e.touchTimer=setTimeout(function(){e.touching=!1,e.touchTimer=null},700)}function eN(e){e&&(e.zrByTouch=!0)}function tN(e,t){return lM(e.dom,new rN(e,t),!0)}function nN(e,t){for(var n=t,r=!1;n&&n.nodeType!==9&&!(r=n.domBelongToZr||n!==t&&n===e.painterRoot);)n=n.parentNode;return r}var rN=function(){function e(e,t){this.stopPropagation=ru,this.stopImmediatePropagation=ru,this.preventDefault=ru,this.type=t.type,this.target=this.currentTarget=e.dom,this.pointerType=t.pointerType,this.clientX=t.clientX,this.clientY=t.clientY}return e}(),iN={mousedown:function(e){e=lM(this.dom,e),this.__mayPointerCapture=[e.zrX,e.zrY],this.trigger(`mousedown`,e)},mousemove:function(e){e=lM(this.dom,e);var t=this.__mayPointerCapture;t&&(e.zrX!==t[0]||e.zrY!==t[1])&&this.__togglePointerCapture(!0),this.trigger(`mousemove`,e)},mouseup:function(e){e=lM(this.dom,e),this.__togglePointerCapture(!1),this.trigger(`mouseup`,e)},mouseout:function(e){e=lM(this.dom,e);var t=e.toElement||e.relatedTarget;nN(this,t)||(this.__pointerCapturing&&(e.zrEventControl=`no_globalout`),this.trigger(`mouseout`,e))},wheel:function(e){ZM=!0,e=lM(this.dom,e),this.trigger(`mousewheel`,e)},mousewheel:function(e){ZM||(e=lM(this.dom,e),this.trigger(`mousewheel`,e))},touchstart:function(e){e=lM(this.dom,e),eN(e),this.__lastTouchMoment=new Date,this.handler.processGesture(e,`start`),iN.mousemove.call(this,e),iN.mousedown.call(this,e)},touchmove:function(e){e=lM(this.dom,e),eN(e),this.handler.processGesture(e,`change`),iN.mousemove.call(this,e)},touchend:function(e){e=lM(this.dom,e),eN(e),this.handler.processGesture(e,`end`),iN.mouseup.call(this,e),+new Date-this.__lastTouchMoment0&&(this._stillFrameAccum++,this._stillFrameAccum>this._sleepAfterStill&&this.animation.stop())},e.prototype.setSleepAfterStill=function(e){this._sleepAfterStill=e},e.prototype.wakeUp=function(){this._disposed||(this.animation.start(),this._stillFrameAccum=0)},e.prototype.refreshHover=function(){this._needsRefreshHover=!0},e.prototype.refreshHoverImmediately=function(){this._disposed||this._refresh({animUpdate:!1,refresh:!1,refreshHover:!0})},e.prototype.resize=function(e){this._disposed||(e||={},this.painter.resize(e.width,e.height),this.handler.resize())},e.prototype.clearAnimation=function(){this._disposed||this.animation.clear()},e.prototype.getWidth=function(){if(!this._disposed)return this.painter.getWidth()},e.prototype.getHeight=function(){if(!this._disposed)return this.painter.getHeight()},e.prototype.setCursorStyle=function(e){this._disposed||this.handler.setCursorStyle(e)},e.prototype.findHover=function(e,t){if(!this._disposed)return this.handler.findHover(e,t)},e.prototype.on=function(e,t,n){return this._disposed||this.handler.on(e,t,n),this},e.prototype.off=function(e,t){this._disposed||this.handler.off(e,t)},e.prototype.trigger=function(e,t){this._disposed||this.handler.trigger(e,t)},e.prototype.clear=function(){if(!this._disposed){for(var e=this.storage.getRoots(),t=0;t=0;o--)r[o]&&!yd(r[o])?a=!0:(r[o]=null,!a&&i--);r.length=i,e[n]=r}}),delete e[AN],e},t.prototype.setTheme=function(e){this._theme=new TS(e),this._resetOption(`recreate`,null)},t.prototype.getTheme=function(){return this._theme},t.prototype.getLocaleModel=function(){return this._locale},t.prototype.setUpdatePayload=function(e){this._payload=e},t.prototype.getUpdatePayload=function(){return this._payload},t.prototype.getComponent=function(e,t){var n=this._componentsMap.get(e);if(n){var r=n[t||0];if(r)return r;if(t==null){for(var i=0;i=t:n===`max`?e<=t:e===t}function UN(e,t){return e.join(`,`)===t.join(`,`)}var WN=G,GN=Nl,KN=[`areaStyle`,`lineStyle`,`nodeStyle`,`linkStyle`,`chordStyle`,`label`,`labelLine`];function qN(e){var t=e&&e.itemStyle;if(t)for(var n=0,r=KN.length;n0?e[n-1].seriesModel:null)}),gP(e))})}function gP(e){G(e,function(t,n){var r=[],i=[NaN,NaN],a=[t.stackResultDimension,t.stackedOverDimension],o=t.data,s=t.isStackedByIndex,c=t.seriesModel.get(`stackStrategy`)||`samesign`;o.modify(a,function(a,l,u){var d=o.get(t.stackedDimension,u);if(isNaN(d))return i;var f,p;s?p=o.getRawIndex(u):f=o.get(t.stackedByDimension,u);for(var m=NaN,h=n-1;h>=0;h--){var g=e[h];if(s||(p=g.data.rawIndexOf(g.stackedByDimension,f)),p>=0){var _=g.data.getByRawIndex(g.stackResultDimension,p);if(c===`all`||c===`positive`&&_>0||c===`negative`&&_<0||c===`samesign`&&d>=0&&_>0||c===`samesign`&&d<=0&&_<0){d=Mu(d,_),m=_;break}}}return r[0]=d,r[1]=m,r})})}var _P=function(){function e(){this.group=new Ky,this.uid=DS(`viewComponent`)}return e.prototype.init=function(e,t){},e.prototype.render=function(e,t,n,r){},e.prototype.dispose=function(e,t){},e.prototype.updateView=function(e,t,n,r){},e.prototype.updateLayout=function(e,t,n,r){},e.prototype.updateVisual=function(e,t,n,r){},e.prototype.toggleBlurSeries=function(e,t,n){},e.prototype.eachRendered=function(e){var t=this.group;t&&t.traverse(e)},e}();sf(_P),mf(_P);function vP(){var e=Td();return function(t){var n=e(t),r=t.pipelineContext,i=!!n.large,a=!!n.progressiveRender,o=n.large=!!(r&&r.large),s=n.progressiveRender=!!(r&&r.progressiveRender);return(i!==o||a!==s)&&`reset`}}var yP=Td(),bP=vP(),xP=function(){function e(){this.group=new Ky,this.uid=DS(`viewChart`),this.renderTask=vT({plan:wP,reset:TP}),this.renderTask.context={view:this}}return e.prototype.init=function(e,t){},e.prototype.render=function(e,t,n,r){},e.prototype.highlight=function(e,t,n,r){var i=e.getData(r&&r.dataType);i&&CP(i,r,`emphasis`)},e.prototype.downplay=function(e,t,n,r){var i=e.getData(r&&r.dataType);i&&CP(i,r,`normal`)},e.prototype.remove=function(e,t){this.group.removeAll()},e.prototype.dispose=function(e,t){},e.prototype.updateView=function(e,t,n,r){this.render(e,t,n,r)},e.prototype.updateVisual=function(e,t,n,r){this.render(e,t,n,r)},e.prototype.eachRendered=function(e){Rx(this.group,e)},e.markUpdateMethod=function(e,t){yP(e).updateMethod=t},e.protoInitialize=function(){var t=e.prototype;t.type=`chart`}(),e}();function SP(e,t,n){e&&yy(e)&&(t===`emphasis`?Jv:Yv)(e,n)}function CP(e,t,n){var r=wd(e,t),i=t&&t.highlightKey!=null?by(t.highlightKey):null;r==null?e.eachItemGraphicEl(function(e){SP(e,n,i)}):G(rd(r),function(t){SP(e.getItemGraphicEl(t),n,i)})}sf(xP,[`dispose`]),mf(xP);function wP(e){return bP(e.model)}function TP(e){var t=e.model,n=e.ecModel,r=e.api,i=e.payload,a=t.pipelineContext.progressiveRender,o=e.view,s=i&&yP(i).updateMethod,c=a?`incrementalPrepareRender`:s&&o[s]?s:`render`;return c!==`render`&&o[c](t,n,r,i),EP[c]}var EP={incrementalPrepareRender:{progress:function(e,t){t.view.incrementalRender(e,t.model,t.ecModel,t.api,t.payload)}},render:{forceFirstProgress:!0,progress:function(e,t){t.view.render(t.model,t.ecModel,t.api,t.payload)}}},DP=`\0__throttleOriginMethod`,OP=`\0__throttleRate`,kP=`\0__throttleType`;function AP(e,t,n){var r,i=0,a=0,o=null,s,c,l,u;t||=0;function d(){a=new Date().getTime(),o=null,e.apply(c,l||[])}var f=function(){var e=[...arguments];r=new Date().getTime(),c=this,l=e;var f=u||t,p=u||n;u=null,s=r-(p?i:a)-f,clearTimeout(o),p?o=setTimeout(d,f):s>=0?d():o=setTimeout(d,-s),i=r};return f.clear=function(){o&&=(clearTimeout(o),null)},f.debounceNextCall=function(e){u=e},f}function jP(e,t,n,r){var i=e[t];if(i){var a=i[DP]||i,o=i[kP];if(i[OP]!==n||o!==r){if(n==null||!r)return e[t]=a;i=e[t]=AP(a,n,r===`debounce`),i[DP]=a,i[kP]=r,i[OP]=n}return i}}function MP(e,t){var n=e[t];n&&n[DP]&&(n.clear&&n.clear(),e[t]=n[DP])}var NP=Td(),PP={itemStyle:hf(SS,!0),lineStyle:hf(yS,!0)},FP={lineStyle:`stroke`,itemStyle:`fill`};function IP(e,t){return e.visualStyleMapper||PP[t]||(console.warn(`Unknown style type '`+t+`'.`),PP.itemStyle)}function LP(e,t){return e.visualDrawType||FP[t]||(console.warn(`Unknown style type '`+t+`'.`),`fill`)}var RP={createOnAllSeries:!0,performRawSeries:!0,reset:function(e,t){var n=e.getData(),r=e.visualStyleAccessPath||`itemStyle`,i=e.getModel(r),a=IP(e,r)(i),o=i.getShallow(`decal`);o&&(n.setVisual(`decal`,o),o.dirty=!0);var s=LP(e,r),c=a[s],l=Al(c)?c:null,u=a.fill===`auto`||a.stroke===`auto`;if(!a[s]||l||u){var d=e.getColorFromPalette(e.name,null,t.getSeriesCount());a[s]||(a[s]=d,n.setVisual(`colorFromPalette`,!0)),a.fill=a.fill===`auto`||Al(a.fill)?d:a.fill,a.stroke=a.stroke===`auto`||Al(a.stroke)?d:a.stroke}if(n.setVisual(`style`,a),n.setVisual(`drawType`,s),!t.isSeriesFiltered(e)&&l)return n.setVisual(`colorFromPalette`,!1),{dataEach:function(t,n){var r=e.getDataParams(n),i=W({},a);i[s]=l(r),t.setItemVisual(n,`style`,i)}}}},zP=new TS,BP={createOnAllSeries:!0,reset:function(e,t){if(!e.ignoreStyleOnData){var n=e.getData(),r=e.visualStyleAccessPath||`itemStyle`,i=IP(e,r),a=n.getVisual(`drawType`);return{dataEach:n.hasItemOption?function(e,t){var n=e.getRawDataItem(t);if(n&&n[r]){zP.option=n[r];var o=i(zP);W(e.ensureUniqueItemVisual(t,`style`),o),zP.option.decal&&(e.setItemVisual(t,`decal`,zP.option.decal),zP.option.decal.dirty=!0),a in o&&e.setItemVisual(t,`colorFromPalette`,!1)}}:null}}}},VP={performRawSeries:!0,overallReset:function(e){var t=$l();e.eachSeries(function(e){if(!e.isColorBySeries()){var n=e.type+`-`+e.getColorBy();NP(e).scope=t.get(n)||t.set(n,{})}}),e.eachSeries(function(e){if(!e.isColorBySeries()){var t=e.getRawData(),n={},r=e.getData(),i=NP(e).scope,a=LP(e,e.visualStyleAccessPath||`itemStyle`);r.each(function(e){var t=r.getRawIndex(e);n[t]=e}),t.each(function(o){var s=n[o];if(r.getItemVisual(s,`colorFromPalette`)){var c=r.ensureUniqueItemVisual(s,`style`),l=t.getName(o)||o+``,u=t.count();c[a]=e.getColorFromPalette(l,i,u)}})}})}},HP=Math.PI;function UP(e,t){t||={},yl(t,{text:`loading`,textColor:Q.color.primary,fontSize:12,fontWeight:`normal`,fontStyle:`normal`,fontFamily:`sans-serif`,maskColor:`rgba(255,255,255,0.8)`,showSpinner:!0,color:Q.color.theme[0],spinnerRadius:10,lineWidth:5,zlevel:0});var n=new Ky,r=new z_({style:{fill:t.maskColor},zlevel:t.zlevel,z:1e4});n.add(r);var i=new W_({style:{text:t.text,fill:t.textColor,fontSize:t.fontSize,fontWeight:t.fontWeight,fontStyle:t.fontStyle,fontFamily:t.fontFamily},zlevel:t.zlevel,z:10001}),a=new z_({style:{fill:`none`},textContent:i,textConfig:{position:`right`,distance:10},zlevel:t.zlevel,z:10001});n.add(a);var o;return t.showSpinner&&(o=new Ab({shape:{startAngle:-HP/2,endAngle:-HP/2+.1,r:t.spinnerRadius},style:{stroke:t.color,lineCap:`round`,lineWidth:t.lineWidth},zlevel:t.zlevel,z:10001}),o.animateShape(!0).when(1e3,{endAngle:HP*3/2}).start(`circularInOut`),o.animateShape(!0).when(1e3,{startAngle:HP*3/2}).delay(300).start(`circularInOut`),n.add(o)),n.resize=function(){var n=i.getBoundingRect().width,s=t.showSpinner?t.spinnerRadius:0,c=(e.getWidth()-s*2-(t.showSpinner&&n?10:0)-n)/2-(t.showSpinner&&n?0:5+n/2)+(t.showSpinner?0:n/2)+(n?0:s),l=e.getHeight()/2;t.showSpinner&&o.setShape({cx:c,cy:l}),a.setShape({x:c-s,y:l-s,width:s*2,height:s*2}),r.setShape({x:0,y:0,width:e.getWidth(),height:e.getHeight()})},n.resize(),n}var WP=function(){function e(e,t,n,r){this._stageTaskMap=$l(),this.ecInstance=e,this.api=t,n=this._dataProcessorHandlers=n.slice(),r=this._visualHandlers=r.slice(),this._allHandlers=n.concat(r)}return e.prototype.restoreData=function(e,t){e.restoreData(t),this._stageTaskMap.each(function(e){var t=e.overallTask;t&&t.dirty()})},e.prototype.getPerformArgs=function(e,t){if(e.__pipeline){var n=this._pipelineMap.get(e.__pipeline.id),r=n.context,i=!t&&n.progressiveEnabled&&(!r||r.progressiveRender)&&e.__idxInPipeline>n.blockIndex?n.step:null,a=r&&r.modDataCount;return{step:i,modBy:a==null?null:Math.ceil(a/i),modDataCount:a}}},e.prototype.getPipeline=function(e){return this._pipelineMap.get(e)},e.prototype.updateStreamModes=function(e,t){var n=this._pipelineMap.get(e.uid);e.pipelineContext=n.context=e.__preparePipelineContext?e.__preparePipelineContext(t,n):Qd(e,t,n)},e.prototype.restorePipelines=function(e,t){var n=this,r=n._pipelineMap=$l();t.eachSeries(function(t){var i=e.painter.type===`canvas`&&t.getProgressive(),a=t.uid;r.set(a,{id:a,head:null,tail:null,threshold:t.getProgressiveThreshold(),progressiveEnabled:i&&!(t.preventIncremental&&t.preventIncremental()),blockIndex:-1,step:Math.round(i||700),count:0}),n._pipe(t,t.dataTask)})},e.prototype.prepareStageTasks=function(){var e=this._stageTaskMap,t=this.api.getModel(),n=this.api;G(this._allHandlers,function(r){var i=e.get(r.uid)||e.set(r.uid,{});Wl(!(r.reset&&r.overallReset),``),r.reset&&this._createSeriesStageTask(r,i,t,n),r.overallReset&&this._createOverallStageTask(r,i,t,n)},this)},e.prototype.prepareView=function(e,t,n,r){var i=e.renderTask,a=i.context;a.model=t,a.ecModel=n,a.api=r,i.__block=!e.incrementalPrepareRender,this._pipe(t,i)},e.prototype.performDataProcessorTasks=function(e,t){this._performStageTasks(this._dataProcessorHandlers,e,t,{block:!0})},e.prototype.performVisualTasks=function(e,t,n){this._performStageTasks(this._visualHandlers,e,t,n)},e.prototype._performStageTasks=function(e,t,n,r){r||={};var i=!1,a=this;G(e,function(e,s){if(!(r.visualType&&r.visualType!==e.visualType)){var c=a._stageTaskMap.get(e.uid),l=c.seriesTaskMap,u=c.overallTask;if(u){var d,f=u.agentStubMap;f.each(function(e){o(r,e)&&(e.dirty(),d=!0)}),d&&u.dirty(),a.updatePayload(u,n);var p=a.getPerformArgs(u,r.block);f.each(function(e){e.perform(p)}),u.perform(p)&&(i=!0)}else l&&l.each(function(s,c){o(r,s)&&s.dirty();var l=a.getPerformArgs(s,r.block);l.skip=!e.performRawSeries&&t.isSeriesFiltered(s.context.model),a.updatePayload(s,n),s.perform(l)&&(i=!0)})}});function o(e,t){return e.setDirty&&(!e.dirtyMap||e.dirtyMap.get(t.__pipeline.id))}this.unfinished=i||this.unfinished},e.prototype.performSeriesTasks=function(e){var t;e.eachSeries(function(e){t=e.dataTask.perform()||t}),this.unfinished=t||this.unfinished},e.prototype.plan=function(){this._pipelineMap.each(function(e){var t=e.tail;do{if(t.__block){e.blockIndex=t.__idxInPipeline;break}t=t.getUpstream()}while(t)})},e.prototype.updatePayload=function(e,t){t!==`remain`&&(e.context.payload=t)},e.prototype._createSeriesStageTask=function(e,t,n,r){var i=this,a=t.seriesTaskMap,o=t.seriesTaskMap=$l(),s=e.seriesType,c=e.getTargetSeries;e.createOnAllSeries?n.eachRawSeries(l):s?n.eachRawSeriesByType(s,l):c&&c(n,r).each(l);function l(t){var s=t.uid,c=o.set(s,a&&a.get(s)||vT({plan:YP,reset:XP,count:$P}));c.context={model:t,ecModel:n,api:r,useClearVisual:e.isVisual&&!e.isLayout,plan:e.plan,reset:e.reset,scheduler:i},i._pipe(t,c)}},e.prototype._createOverallStageTask=function(e,t,n,r){var i=this,a=t.overallTask=t.overallTask||vT({reset:GP});a.context={ecModel:n,api:r,overallReset:e.overallReset,scheduler:i};var o=a.agentStubMap,s=a.agentStubMap=$l(),c=e.seriesType,l=e.getTargetSeries,u=e.dirtyOnOverallProgress,d=!1;Wl(!e.createOnAllSeries,``),c?n.eachRawSeriesByType(c,f):l?l(n,r).each(f):G(n.getSeries(),f);function f(e){var t=e.uid,n=s.set(t,o&&o.get(t)||(d=!0,vT({reset:KP,onDirty:JP})));n.context={model:e,dirtyOnOverallProgress:u},n.agent=a,n.__block=u,i._pipe(e,n)}d&&a.dirty()},e.prototype._pipe=function(e,t){var n=e.uid,r=this._pipelineMap.get(n);!r.head&&(r.head=t),r.tail&&r.tail.pipe(t),r.tail=t,t.__idxInPipeline=r.count++,t.__pipeline=r},e.wrapStageHandler=function(e,t){return Al(e)&&(e={overallReset:e,seriesType:eF(e)}),e.uid=DS(`stageHandler`),t&&(e.visualType=t),e},e}();function GP(e){e.overallReset(e.ecModel,e.api,e.payload)}function KP(e){return e.dirtyOnOverallProgress&&qP}function qP(){this.agent.dirty(),this.getDownstream().dirty()}function JP(){this.agent&&this.agent.dirty()}function YP(e){return e.plan?e.plan(e.model,e.ecModel,e.api,e.payload):null}function XP(e){e.useClearVisual&&e.data.clearAllVisual();var t=e.resetDefines=rd(e.reset(e.model,e.ecModel,e.api,e.payload));return t.length>1?K(t,function(e,t){return QP(t)}):ZP}var ZP=QP(0);function QP(e){return function(t,n){var r=n.data,i=n.resetDefines[e];if(i&&i.dataEach)for(var a=t.start;a0&&u===i.length-l.length){var d=i.slice(0,u);d!==`data`&&(t.mainType=d,t[l.toLowerCase()]=e,s=!0)}}o.hasOwnProperty(i)&&(n[i]=e,s=!0),s||(r[i]=e)})}return{cptQuery:t,dataQuery:n,otherQuery:r}},e.prototype.filter=function(e,t){var n=this.eventInfo;if(!n)return!0;var r=n.targetEl,i=n.packedEvent,a=n.model,o=n.view;if(!a||!o)return!0;var s=t.cptQuery,c=t.dataQuery;return l(s,a,`mainType`)&&l(s,a,`subType`)&&l(s,a,`index`,`componentIndex`)&&l(s,a,`name`)&&l(s,a,`id`)&&l(c,i,`name`)&&l(c,i,`dataIndex`)&&l(c,i,`dataType`)&&(!o.filterForExposedEvent||o.filterForExposedEvent(e,t.otherQuery,r,i));function l(e,t,n,r){return e[n]==null||t[r||n]===e[n]}},e.prototype.afterTrigger=function(){this.eventInfo=null},e}(),uF=[`symbol`,`symbolSize`,`symbolRotate`,`symbolOffset`],dF=uF.concat([`symbolKeepAspect`]),fF={createOnAllSeries:!0,performRawSeries:!0,reset:function(e,t){var n=e.getData();if(e.legendIcon&&n.setVisual(`legendIcon`,e.legendIcon),!e.hasSymbolVisual)return;for(var r={},i={},a=!1,o=0;o=0&&AF(c)?c:.5,e.createRadialGradient(o,s,0,o,s,c)}function NF(e,t,n){for(var r=t.type===`radial`?MF(e,t,n):jF(e,t,n),i=t.colorStops,a=0;a0)?null:e===`dashed`?[4*t,2*t]:e===`dotted`?[t]:Ml(e)?[e]:J(e)?e:null}function RF(e){var t=e.style,n=t.lineDash&&t.lineWidth>0&&LF(t.lineDash,t.lineWidth),r=t.lineDashOffset;if(n){var i=t.strokeNoScale&&e.getLineScale?e.getLineScale():1;i&&i!==1&&(n=K(n,function(e){return e/i}),r/=i)}return[n,r]}var zF=new e_(!0);function BF(e){var t=e.stroke;return!(t==null||t===`none`||!(e.lineWidth>0))}function VF(e){return typeof e==`string`&&e!==`none`}function HF(e){var t=e.fill;return t!=null&&t!==`none`}function UF(e,t){if(t.fillOpacity!=null&&t.fillOpacity!==1){var n=e.globalAlpha;e.globalAlpha=t.fillOpacity*t.opacity,e.fill(),e.globalAlpha=n}else e.fill()}function WF(e,t){if(t.strokeOpacity!=null&&t.strokeOpacity!==1){var n=e.globalAlpha;e.globalAlpha=t.strokeOpacity*t.opacity,e.stroke(),e.globalAlpha=n}else e.stroke()}function GF(e,t,n){var r=Cf(t.image,t.__image,n);if(Tf(r)){var i=e.createPattern(r,t.repeat||`repeat`);if(typeof DOMMatrix==`function`&&i&&i.setTransform){var a=new DOMMatrix;a.translateSelf(t.x||0,t.y||0),a.rotateSelf(0,0,(t.rotation||0)*iu),a.scaleSelf(t.scaleX||1,t.scaleY||1),i.setTransform(a)}return i}}function KF(e,t,n,r,i){var a,o=BF(n),s=HF(n),c=n.strokePercent,l=c<1,u=!t.path;(!t.silent||l)&&u&&t.createPathProxy();var d=t.path||zF,f=t.__dirty;if(!r){var p=n.fill,m=n.stroke,h=s&&!!p.colorStops,g=o&&!!m.colorStops,_=s&&!!p.image,v=o&&!!m.image,y=void 0,b=void 0,x=void 0,S=void 0,C=void 0;(h||g)&&(C=t.getBoundingRect()),h&&(y=f?NF(e,p,C):t.__canvasFillGradient,t.__canvasFillGradient=y),g&&(b=f?NF(e,m,C):t.__canvasStrokeGradient,t.__canvasStrokeGradient=b),_&&(x=f||!t.__canvasFillPattern?GF(e,p,t):t.__canvasFillPattern,t.__canvasFillPattern=x),v&&(S=f||!t.__canvasStrokePattern?GF(e,m,t):t.__canvasStrokePattern,t.__canvasStrokePattern=S),h?e.fillStyle=y:_&&(x?e.fillStyle=x:s=!1),g?e.strokeStyle=b:v&&(S?e.strokeStyle=S:o=!1)}var w=t.getGlobalScale();d.setScale(w[0],w[1],t.segmentIgnoreThreshold);var T,E;e.setLineDash&&n.lineDash&&(a=RF(t),T=a[0],E=a[1]);var D=!0;(u||f&4)&&(d.setDPR(e.dpr),l?d.setContext(null):(d.setContext(e),D=!1),d.reset(),t.buildPath(d,t.shape,r),d.toStatic(),t.pathUpdated()),D&&d.rebuildPath(e,l?c:1),T&&(e.setLineDash(T),e.lineDashOffset=E),r?(i.batchFill=s,i.batchStroke=o):n.strokeFirst?(o&&WF(e,n),s&&UF(e,n)):(s&&UF(e,n),o&&WF(e,n)),T&&e.setLineDash([])}function qF(e,t,n){var r=t.__image=Cf(n.image,t.__image,t,t.onload);if(r&&Tf(r)){var i=n.x||0,a=n.y||0,o=t.getWidth(),s=t.getHeight(),c=r.width/r.height;if(o==null&&s!=null?o=s*c:s==null&&o!=null?s=o/c:o==null&&s==null&&(o=r.width,s=r.height),n.sWidth&&n.sHeight){var l=n.sx||0,u=n.sy||0;e.drawImage(r,l,u,n.sWidth,n.sHeight,i,a,o,s)}else if(n.sx&&n.sy){var l=n.sx,u=n.sy,d=o-l,f=s-u;e.drawImage(r,l,u,d,f,i,a,o,s)}else e.drawImage(r,i,a,o,s)}}function JF(e,t,n){var r,i=n.text;if(i!=null&&(i+=``),i){e.font=n.font||`12px sans-serif`,e.textAlign=n.textAlign,e.textBaseline=n.textBaseline;var a=void 0,o=void 0;e.setLineDash&&n.lineDash&&(r=RF(t),a=r[0],o=r[1]),a&&(e.setLineDash(a),e.lineDashOffset=o),n.strokeFirst?(BF(n)&&e.strokeText(i,n.x,n.y),HF(n)&&e.fillText(i,n.x,n.y)):(HF(n)&&e.fillText(i,n.x,n.y),BF(n)&&e.strokeText(i,n.x,n.y)),a&&e.setLineDash([])}}var YF=[`shadowBlur`,`shadowOffsetX`,`shadowOffsetY`],XF=[[`lineCap`,`butt`],[`lineJoin`,`miter`],[`miterLimit`,10]];function ZF(e,t,n,r,i){var a=!1;if(!r&&(n||={},t===n))return!1;if(r||t.opacity!==n.opacity){cI(e,i),a=!0;var o=Math.max(Math.min(t.opacity,1),0);e.globalAlpha=isNaN(o)?mg.opacity:o}(r||t.blend!==n.blend)&&(a||=(cI(e,i),!0),e.globalCompositeOperation=t.blend||mg.blend);for(var s=0;s0&&e.unfinished);e.unfinished||this._zr.flush()}}},t.prototype.getDom=function(){return this._dom},t.prototype.getId=function(){return this.id},t.prototype.getZr=function(){return this._zr},t.prototype.isSSR=function(){return this._ssr},t.prototype.setOption=function(e,t,n){if(!this[HI]){if(this._disposed){this.id;return}var r,i,a;if(Nl(t)&&(n=t.lazyUpdate,r=t.silent,i=t.replaceMerge,a=t.transition,t=t.notMerge),this[HI]=!0,bL(this),!this._model||t){var o=new zN(this._api),s=this._theme,c=this._model=new MN;c.scheduler=this._scheduler,c.ssr=this._ssr,c.init(null,null,null,s,this._locale,o)}this._model.setOption(e,{replaceMerge:i},OL);var l={seriesTransition:a,optionChanged:!0};if(n)this[WI]={silent:r,updateParams:l},this[HI]=!1,this.getZr().wakeUp();else{try{nL(this),aL.update.call(this,null,l)}catch(e){throw this[WI]=null,this[HI]=!1,e}this._ssr||this._zr.flush(),this[WI]=null,this[HI]=!1,lL.call(this,r),uL.call(this,r)}}},t.prototype.setTheme=function(e,t){if(!this[HI]){if(this._disposed){this.id;return}var n=this._model;if(n){var r=t&&t.silent,i=null;this[WI]&&(r??=this[WI].silent,i=this[WI].updateParams,this[WI]=null),this[HI]=!0,bL(this);try{this._updateTheme(e),n.setTheme(this._theme),nL(this),aL.update.call(this,{type:`setTheme`},i)}catch(e){throw this[HI]=!1,e}this[HI]=!1,lL.call(this,r),uL.call(this,r)}}},t.prototype._updateTheme=function(e){Y(e)&&(e=AL[e]),e&&(e=hl(e),e&&pP(e,!0),this._theme=e)},t.prototype.getModel=function(){return this._model},t.prototype.getOption=function(){return this._model&&this._model.getOption()},t.prototype.getWidth=function(){return this._zr.getWidth()},t.prototype.getHeight=function(){return this._zr.getHeight()},t.prototype.getDevicePixelRatio=function(){return this._zr.painter.dpr||ou.hasGlobalWindow&&window.devicePixelRatio||1},t.prototype.getRenderedCanvas=function(e){return this.renderToCanvas(e)},t.prototype.renderToCanvas=function(e){return e||={},this._zr.painter.getRenderedCanvas({backgroundColor:e.backgroundColor||this._model.get(`backgroundColor`),pixelRatio:e.pixelRatio||this.getDevicePixelRatio()})},t.prototype.renderToSVGString=function(e){return e||={},this._zr.painter.renderToString({useViewBox:e.useViewBox})},t.prototype.getSvgDataURL=function(){var e=this._zr;return G(e.storage.getDisplayList(),function(e){e.stopAnimation(null,!0)}),e.painter.toDataURL()},t.prototype.getDataURL=function(e){if(this._disposed){this.id;return}e||={};var t=e.excludeComponents,n=this._model,r=[],i=this;G(t,function(e){n.eachComponent({mainType:e},function(e){var t=i._componentsMap[e.__viewId];t.group.ignore||(r.push(t),t.group.ignore=!0)})});var a=this._zr.painter.getType()===`svg`?this.getSvgDataURL():this.renderToCanvas(e).toDataURL(`image/`+(e&&e.type||`png`));return G(r,function(e){e.group.ignore=!1}),a},t.prototype.getConnectedDataURL=function(e){if(this._disposed){this.id;return}var t=e.type===`svg`,n=this.group,r=Math.min,i=Math.max,a=1/0;if(NL[n]){var o=a,s=a,c=-a,l=-a,u=[],d=e&&e.pixelRatio||this.getDevicePixelRatio();G(ML,function(a,d){if(a.group===n){var f=t?a.getZr().painter.getSvgDom().innerHTML:a.renderToCanvas(hl(e)),p=a.getDom().getBoundingClientRect();o=r(p.left,o),s=r(p.top,s),c=i(p.right,c),l=i(p.bottom,l),u.push({dom:f,left:p.left,top:p.top})}}),o*=d,s*=d,c*=d,l*=d;var f=c-o,p=l-s,m=$c.createCanvas(),h=_N(m,{renderer:t?`svg`:`canvas`});if(h.resize({width:f,height:p}),t){var g=``;return G(u,function(e){var t=e.left-o,n=e.top-s;g+=``+e.dom+``}),h.painter.getSvgRoot().innerHTML=g,e.connectedBackgroundColor&&h.painter.setBackgroundColor(e.connectedBackgroundColor),h.refreshImmediately(),h.painter.toDataURL()}return e.connectedBackgroundColor&&h.add(new z_({shape:{x:0,y:0,width:f,height:p},style:{fill:e.connectedBackgroundColor}})),G(u,function(e){var t=new j_({style:{x:e.left*d-o,y:e.top*d-s,image:e.dom}});h.add(t)}),h.refreshImmediately(),m.toDataURL(`image/`+(e&&e.type||`png`))}return this.getDataURL(e)},t.prototype.convertToPixel=function(e,t,n){return oL(this,`convertToPixel`,e,t,n)},t.prototype.convertToLayout=function(e,t,n){return oL(this,`convertToLayout`,e,t,n)},t.prototype.convertFromPixel=function(e,t,n){return oL(this,`convertFromPixel`,e,t,n)},t.prototype.containPixel=function(e,t){if(this._disposed){this.id;return}var n=this._model,r;return G(Dd(n,e),function(e,n){n.indexOf(`Models`)>=0&&G(e,function(e){var i=e.coordinateSystem;if(i&&i.containPoint)r||=!!i.containPoint(t);else if(n===`seriesModels`){var a=this._chartsMap[e.__viewId];a&&a.containPoint&&(r||=a.containPoint(t,e))}},this)},this),!!r},t.prototype.getVisual=function(e,t){var n=this._model,r=Dd(n,e,{defaultMainType:`series`}),i=r.seriesModel.getData(),a=r.hasOwnProperty(`dataIndexInside`)?r.dataIndexInside:r.hasOwnProperty(`dataIndex`)?i.indexOfRawIndex(r.dataIndex):null;return a==null?hF(i,t):mF(i,a,t)},t.prototype.getViewOfComponentModel=function(e){return this._componentsMap[e.__viewId]},t.prototype.getViewOfSeriesModel=function(e){return this._chartsMap[e.__viewId]},t.prototype._initEvents=function(){var e=this;G(CL,function(t){var n=function(n){var r=e.getModel(),i=n.target,a;if(t===`globalout`?a={}:i&&yF(i,function(e){var t=iv(e);if(t&&t.dataIndex!=null){var n=t.dataModel||r.getSeriesByIndex(t.seriesIndex);return a=n&&n.getDataParams(t.dataIndex,t.dataType,i)||{},!0}if(t.eventData)return a=W({},t.eventData),!0},!0),a){var o=a.componentType,s=a.componentIndex;(o===`markLine`||o===`markPoint`||o===`markArea`)&&(o=`series`,s=a.seriesIndex);var c=o&&s!=null&&r.getComponent(o,s),l=c&&e[c.mainType===`series`?`_chartsMap`:`_componentsMap`][c.__viewId];a.event=n,a.type=t,e._$eventProcessor.eventInfo={targetEl:i,packedEvent:a,model:c,view:l},e.trigger(t,a)}};n.zrEventfulCallAtLast=!0,e._zr.on(t,n,e)});var t=this._messageCenter;G(EL,function(n,r){t.on(r,function(t){e.trigger(r,t)})}),vF(t,this,this._api)},t.prototype.isDisposed=function(){return this._disposed},t.prototype.clear=function(){if(this._disposed){this.id;return}this.setOption({series:[]},!0)},t.prototype.dispose=function(){if(this._disposed){this.id;return}this._disposed=!0,this.getDom()&&Nd(this.getDom(),IL,``);var e=this,t=e._api,n=e._model;G(e._componentsViews,function(e){e.dispose(n,t)}),G(e._chartsViews,function(e){e.dispose(n,t)}),e._zr.dispose(),e._dom=e._model=e._chartsMap=e._componentsMap=e._chartsViews=e._componentsViews=e._scheduler=e._api=e._zr=e._throttledZrFlush=e._theme=e._coordSysMgr=e._messageCenter=null,delete ML[e.id]},t.prototype.resize=function(e){if(!this[HI]){if(this._disposed){this.id;return}this._zr.resize(e);var t=this._model;if(this._loadingFX&&this._loadingFX.resize(),t){var n=t.resetOption(`media`),r=e&&e.silent;this[WI]&&(r??=this[WI].silent,n=!0,this[WI]=null),this[HI]=!0,bL(this);try{n&&nL(this),aL.update.call(this,{type:`resize`,animation:W({duration:0},e&&e.animation)})}catch(e){throw this[HI]=!1,e}this[HI]=!1,lL.call(this,r),uL.call(this,r)}}},t.prototype.showLoading=function(e,t){if(this._disposed){this.id;return}if(Nl(e)&&(t=e,e=``),e||=`default`,this.hideLoading(),jL[e]){var n=jL[e](this._api,t),r=this._zr;this._loadingFX=n,r.add(n)}},t.prototype.hideLoading=function(){if(this._disposed){this.id;return}this._loadingFX&&this._zr.remove(this._loadingFX),this._loadingFX=null},t.prototype.makeActionFromEvent=function(e){var t=W({},e);return t.type=TL[e.type],t},t.prototype.dispatchAction=function(e,t){if(this._disposed){this.id;return}if(Nl(t)||(t={silent:!!t}),wL[e.type]&&this._model){if(this[HI]){this._pendingActions.push(e);return}var n=t.silent;cL.call(this,e,n);var r=t.flush;r?this._zr.flush():r!==!1&&ou.browser.weChat&&this._throttledZrFlush(),lL.call(this,n),uL.call(this,n)}},t.prototype.updateLabelLayout=function(){bF.trigger(`series:layoutlabels`,this._model,this._api,{updatedSeries:[]})},t.prototype.appendData=function(e){if(this._disposed){this.id;return}var t=e.seriesIndex;this.getModel().getSeriesByIndex(t).appendData(e),this._scheduler.unfinished=!0,this.getZr().wakeUp()},t.internalField=function(){nL=function(e){Bk(e._model);var t=e._scheduler;t.restorePipelines(e._zr,e._model),t.prepareStageTasks(),rL(e,!0),rL(e,!1),t.plan()},rL=function(e,t){for(var n=e._model,r=e._scheduler,i=t?e._componentsViews:e._chartsViews,a=t?e._componentsMap:e._chartsMap,o=e._zr,s=e._api,c=0;cX(t.get(`hoverLayerThreshold`),CN.hoverLayerThreshold)&&!ou.node&&!ou.worker;(e._usingTHL||a)&&(t.eachSeries(function(t){if(!t.preventUsingHoverLayer){var n=e._chartsMap[t.__viewId];n.__alive&&n.eachRendered(function(e){var t=e.states.emphasis;t&&t.hoverLayer!==2&&(t.hoverLayer=+!!a)})}}),e._usingTHL=a)}}function a(e,t){var n=e.get(`blendMode`)||null;t.eachRendered(function(e){e.isGroup||(e.style.blend=n)})}function o(e,t){if(!e.preventAutoZ){var n=Ux(e);t.eachRendered(function(e){return Gx(e,n.z,n.zlevel),!0})}}function s(e,t){t.eachRendered(function(e){if(!Zb(e)){var t=e.getTextContent(),n=e.getTextGuideLine();e.stateTransition&&=null,t&&t.stateTransition&&(t.stateTransition=null),n&&n.stateTransition&&(n.stateTransition=null),e.hasState()?(e.prevStates=e.currentStates,e.clearStates()):e.prevStates&&=null}})}function c(e,t){var n=e.getModel(`stateAnimation`),i=e.isAnimationEnabled(),a=n.get(`duration`),o=a>0?{duration:a,delay:n.get(`delay`),easing:n.get(`easing`)}:null;t.eachRendered(function(e){if(e.states&&e.states.emphasis){if(Zb(e))return;if(e instanceof T_&&Cy(e),e.__dirty){var t=e.prevStates;t&&e.useStates(t)}if(i){e.stateTransition=o;var n=e.getTextContent(),a=e.getTextGuideLine();n&&(n.stateTransition=o),a&&(a.stateTransition=o)}e.__dirty&&r(e)}})}gL=function(e){return new(function(t){U(n,t);function n(){return t!==null&&t.apply(this,arguments)||this}return n.prototype.getCoordinateSystems=function(){return e._coordSysMgr.getCoordinateSystems()},n.prototype.getComponentByElement=function(t){for(;t;){var n=t.__ecComponentInfo;if(n!=null)return e._model.getComponent(n.mainType,n.index);t=t.parent}},n.prototype.enterEmphasis=function(t,n){Jv(t,n),vL(e)},n.prototype.leaveEmphasis=function(t,n){Yv(t,n),vL(e)},n.prototype.enterBlur=function(t){Xv(t),vL(e)},n.prototype.leaveBlur=function(t){Zv(t),vL(e)},n.prototype.enterSelect=function(t){Qv(t),vL(e)},n.prototype.leaveSelect=function(t){$v(t),vL(e)},n.prototype.getModel=function(){return e.getModel()},n.prototype.getViewOfComponentModel=function(t){return e.getViewOfComponentModel(t)},n.prototype.getViewOfSeriesModel=function(t){return e.getViewOfSeriesModel(t)},n.prototype.getECUpdateCycleVersion=function(){return e[UI]},n.prototype.usingTHL=function(){return e._usingTHL},n}(hv))(e)},_L=function(e){function t(e,t){for(var n=0;n=0)){ZL.push(n);var o=WP.wrapStageHandler(n,i);o.__prio=t,o.__raw=n,e.push(o)}}function $L(e,t){jL[e]=t}function eR(e,t,n){var r=CF(`registerMap`);r&&r(e,t,n)}var tR=NT;XL(NI,RP),XL(II,BP),XL(II,VP),XL(NI,fF),XL(II,pF),XL(BI,SI),HL(pP),UL(EI,mP),$L(`default`,UP),qL({type:Cv,event:Cv,update:Cv},ru),qL({type:wv,event:wv,update:wv},ru),qL({type:Tv,event:Ov,update:Tv,action:ru,refineEvent:nR,publishNonRefinedEvent:!0}),qL({type:Ev,event:Ov,update:Ev,action:ru,refineEvent:nR,publishNonRefinedEvent:!0}),qL({type:Dv,event:Ov,update:Dv,action:ru,refineEvent:nR,publishNonRefinedEvent:!0});function nR(e,t,n,r){return{eventContent:{selected:uy(n),isFromClick:t.isFromClick||!1}}}VL(`default`,{}),VL(`dark`,cF);var rR=[],iR={registerPreprocessor:HL,registerProcessor:UL,registerPostInit:WL,registerPostUpdate:GL,registerUpdateLifecycle:KL,registerAction:qL,registerCoordinateSystem:JL,registerLayout:YL,registerVisual:XL,registerTransform:tR,registerLoading:$L,registerMap:eR,registerImpl:SF,PRIORITY:VI,ComponentModel:Sw,ComponentView:_P,SeriesModel:wE,ChartView:xP,registerComponentModel:function(e){Sw.registerClass(e)},registerComponentView:function(e){_P.registerClass(e)},registerSeriesModel:function(e){wE.registerClass(e)},registerChartView:function(e){xP.registerClass(e)},registerCustomSeries:function(e,t){TF(e,t)},registerSubTypeDefaulter:function(e,t){Sw.registerSubTypeDefaulter(e,t)},registerPainter:function(e,t){vN(e,t)}};function aR(e){if(J(e)){G(e,function(e){aR(e)});return}bl(rR,e)>=0||(rR.push(e),Al(e)&&(e={install:e}),e.install(iR))}var oR=function(){function e(e,t){this._encode=e,this._schema=t}return e.prototype.get=function(){return{fullDimensions:this._getFullDimensionNames(),encode:this._encode}},e.prototype._getFullDimensionNames=function(){return this._cachedDimNames||=this._schema?this._schema.makeOutputDimensionNames():[],this._cachedDimNames},e}();function sR(e,t){var n={},r=n.encode={},i=$l(),a=[],o=[],s={};G(e.dimensions,function(t){var n=e.getDimensionInfo(t),c=n.coordDim;if(c){var l=n.coordDimIndex;cR(r,c)[l]=t,n.isExtraCoord||(i.set(c,1),uR(n.type)&&(a[0]=t),cR(s,c)[l]=e.getDimensionIndex(n.name)),n.defaultTooltip&&o.push(t)}ov.each(function(e,t){var i=cR(r,t),a=n.otherDims[t];a!=null&&a!==!1&&(i[a]=n.name)})});var c=[],l={};i.each(function(e,t){var n=r[t];l[t]=n[0],c=c.concat(n)}),n.dataDimsOnCoord=c,n.dataDimIndicesOnCoord=K(c,function(t){return e.getDimensionInfo(t).storeDimIndex}),n.encodeFirstDimNotExtra=l;var u=r.label;u&&u.length&&(a=u.slice());var d=r.tooltip;return d&&d.length?o=d.slice():o.length||(o=a.slice()),r.defaultedLabel=a,r.defaultedTooltip=o,n.userOutput=new oR(s,t),n}function cR(e,t){return e.hasOwnProperty(t)||(e[t]=[]),e[t]}function lR(e){return e===`category`?`ordinal`:e===`time`?`time`:`float`}function uR(e){return e!==`ordinal`&&e!==`time`}var dR=function(){function e(e){this.otherDims={},e!=null&&W(this,e)}return e}(),fR=Nl,pR=K,mR=typeof Int32Array>`u`?Array:Int32Array,hR=`e\0\0`,gR=-1,_R=[`hasItemOption`,`_nameList`,`_idList`,`_invertedIndicesMap`,`_dimSummary`,`userOutput`,`_rawData`,`_dimValueGetter`,`_nameDimIdx`,`_idDimIdx`,`_nameRepeatCount`],vR=[`_approximateExtent`],yR,bR,xR,SR,CR,wR,TR,ER=function(){function e(e,t){this.type=`list`,this._dimOmitted=!1,this._nameList=[],this._idList=[],this._visual={},this._layout={},this._itemVisuals=[],this._itemLayouts=[],this._graphicEls=[],this._approximateExtent={},this._calculationInfo={},this.hasItemOption=!1,this.TRANSFERABLE_METHODS=[`cloneShallow`,`downSample`,`minmaxDownSample`,`lttbDownSample`,`map`],this.CHANGABLE_METHODS=[`filterSelf`,`selectRange`],this.DOWNSAMPLE_METHODS=[`downSample`,`minmaxDownSample`,`lttbDownSample`];var n,r=!1;LO(e)?(n=e.dimensions,this._dimOmitted=e.isDimensionOmitted(),this._schema=e):(r=!0,n=e),n||=[`x`,`y`];for(var i={},a=[],o={},s=!1,c={},l=0;l=t)){var n=this._store.getProvider();this._updateOrdinalMeta();var r=this._nameList,i=this._idList;if(n.getSource().sourceFormat===`original`&&!n.pure)for(var a=[],o=e;o0},e.prototype.ensureUniqueItemVisual=function(e,t){var n=this._itemVisuals,r=n[e];r||=n[e]={};var i=r[t];return i??(i=this.getVisual(t),J(i)?i=i.slice():fR(i)&&(i=W({},i)),r[t]=i),i},e.prototype.setItemVisual=function(e,t,n){var r=this._itemVisuals[e]||{};this._itemVisuals[e]=r,fR(t)?W(r,t):r[t]=n},e.prototype.clearAllVisual=function(){this._visual={},this._itemVisuals=[]},e.prototype.setLayout=function(e,t){fR(e)?W(this._layout,e):this._layout[e]=t},e.prototype.getLayout=function(e){return this._layout[e]},e.prototype.getItemLayout=function(e){return this._itemLayouts[e]},e.prototype.setItemLayout=function(e,t,n){this._itemLayouts[e]=n?W(this._itemLayouts[e]||{},t):t},e.prototype.clearItemLayouts=function(){this._itemLayouts.length=0},e.prototype.setItemGraphicEl=function(e,t){av(this.hostModel&&this.hostModel.seriesIndex,this.dataType,e,t),this._graphicEls[e]=t},e.prototype.getItemGraphicEl=function(e){return this._graphicEls[e]},e.prototype.eachItemGraphicEl=function(e,t){G(this._graphicEls,function(n,r){n&&e&&e.call(t,n,r)})},e.prototype.cloneShallow=function(t){return t||=new e(this._schema?this._schema:pR(this.dimensions,this._getDimInfo,this),this.hostModel),CR(t,this),t._store=this._store,t},e.prototype.wrapMethod=function(e,t){var n=this[e];Al(n)&&(this.__wrappedMethods=this.__wrappedMethods||[],this.__wrappedMethods.push(e),this[e]=function(){var e=n.apply(this,arguments);return t.apply(this,[e].concat(Hl(arguments)))})},e.internalField=function(){yR=function(e){var t=e._invertedIndicesMap;G(t,function(n,r){var i=e._dimInfos[r],a=i.ordinalMeta,o=e._store;if(a){n=t[r]=new mR(a.categories.length);for(var s=0;s1&&(s+=`__ec__`+l),r[t]=s}}}(),e}();function DR(e,t){Bw(e)||(e=Hw(e)),t||={};var n=t.coordDimensions||[],r=t.dimensionsDefine||e.dimensionsDefine||[],i=$l(),a=[],o=OR(e,n,r,t.dimensionsCount),s=t.canOmitUnusedDimensions&&BO(o),c=r===e.dimensionsDefine,l=c?zO(e):RO(r),u=t.encodeDefine;!u&&t.encodeDefaulter&&(u=t.encodeDefaulter(e,o));for(var d=$l(u),f=new zT(o),p=0;p0&&(e.name+=t-1)}),new IO({source:e,dimensions:a,fullDimensionCount:o,dimensionOmitted:s})}function OR(e,t,n,r){var i=Math.max(e.dimensionsDetectedCount||1,t.length,n.length,r||0);return G(t,function(e){var t;Nl(e)&&(t=e.dimsDef)&&(i=Math.max(i,t.length))}),i}function kR(e,t,n){if(n||t.hasKey(e)){for(var r=0;t.hasKey(e+r);)r++;e+=r}return t.set(e,!0),e}var AR=function(){function e(e){this.coordSysDims=[],this.axisMap=$l(),this.categoryAxisMap=$l(),this.coordSysName=e}return e}();function jR(e){var t=e.get(`coordinateSystem`),n=new AR(t),r=MR[t];if(r)return r(e,n,n.axisMap,n.categoryAxisMap),n}var MR={cartesian2d:function(e,t,n,r){var i=e.getReferringComponents(`xAxis`,kd).models[0],a=e.getReferringComponents(`yAxis`,kd).models[0];t.coordSysDims=[`x`,`y`],n.set(`x`,i),n.set(`y`,a),NR(i)&&(r.set(`x`,i),t.firstCategoryDimIndex=0),NR(a)&&(r.set(`y`,a),t.firstCategoryDimIndex??=1)},singleAxis:function(e,t,n,r){var i=e.getReferringComponents(`singleAxis`,kd).models[0];t.coordSysDims=[`single`],n.set(`single`,i),NR(i)&&(r.set(`single`,i),t.firstCategoryDimIndex=0)},polar:function(e,t,n,r){var i=e.getReferringComponents(`polar`,kd).models[0],a=i.findAxisModel(`radiusAxis`),o=i.findAxisModel(`angleAxis`);t.coordSysDims=[`radius`,`angle`],n.set(`radius`,a),n.set(`angle`,o),NR(a)&&(r.set(`radius`,a),t.firstCategoryDimIndex=0),NR(o)&&(r.set(`angle`,o),t.firstCategoryDimIndex??=1)},geo:function(e,t,n,r){t.coordSysDims=[`lng`,`lat`]},parallel:function(e,t,n,r){var i=e.ecModel,a=i.getComponent(`parallel`,e.get(`parallelIndex`)),o=t.coordSysDims=a.dimensions.slice();G(a.parallelAxisIndex,function(e,a){var s=i.getComponent(`parallelAxis`,e),c=o[a];n.set(c,s),NR(s)&&(r.set(c,s),t.firstCategoryDimIndex??=a)})},matrix:function(e,t,n,r){var i=e.getReferringComponents(`matrix`,kd).models[0];t.coordSysDims=[`x`,`y`];var a=i.getDimensionModel(`x`),o=i.getDimensionModel(`y`);n.set(`x`,a),n.set(`y`,o),r.set(`x`,a),r.set(`y`,o)}};function NR(e){return e.get(`type`)===`category`}function PR(e,t){var n=e.get(`coordinateSystem`),r=tw.get(n),i;return t&&t.coordSysDims&&(i=K(t.coordSysDims,function(e){var n={name:e},r=t.axisMap.get(e);return r&&(n.type=lR(r.get(`type`))),n})),i||=r&&(r.getDimensionsInfo?r.getDimensionsInfo():r.dimensions.slice())||[`x`,`y`],i}function FR(e,t,n){var r,i;return n&&G(e,function(e,a){var o=e.coordDim,s=n.categoryAxisMap.get(o);s&&(r??=a,e.ordinalMeta=s.getOrdinalMeta(),t&&(e.createInvertedIndices=!0)),e.otherDims.itemName!=null&&(i=!0)}),!i&&r!=null&&(e[r].otherDims.itemName=0),r}function IR(e,t,n){n||={};var r=t.getSourceManager(),i,a=!1;e?(a=!0,i=Hw(e)):(i=r.getSource(),a=i.sourceFormat===sv);var o=jR(t),s=PR(t,o),c=n.useEncodeDefaulter,l=Al(c)?c:c?kl(Pw,s,t):null,u={coordDimensions:s,generateCoord:n.generateCoord,encodeDefine:t.getEncode(),encodeDefaulter:l,canOmitUnusedDimensions:!a},d=DR(i,u),f=FR(d.dimensions,n.createInvertedIndices,o),p=a?null:r.getSharedDataStore(d),m=VO(t,{schema:d,store:p}),h=new ER(d,t);h.setCalculationInfo(m);var g=f!=null&&LR(i)?function(e,t,n,r){return r===f?n:this.defaultDimValueGetter(e,t,n,r)}:null;return h.hasItemOption=!1,h.initData(a?i:p,null,g),h}function LR(e){if(e.sourceFormat===`original`)return!J(od(RR(e.data||[])))}function RR(e){for(var t=0;tthis.getProgressiveThreshold()?this.id:``},t.type=`series.scatter`,t.dependencies=[`grid`,`polar`,`geo`,`singleAxis`,`calendar`,`matrix`],t.defaultOption={coordinateSystem:`cartesian2d`,z:2,legendHoverLink:!0,symbolSize:10,large:!1,largeThreshold:2e3,itemStyle:{opacity:.8},emphasis:{scale:!0},clip:!0,select:{itemStyle:{borderColor:Q.color.primary}},universalTransition:{divideShape:`clone`}},t}(wE);function BR(e,t){var n=e.mapDimensionsAll(`defaultedLabel`),r=n.length;if(r===1){var i=mT(e,t,n[0]);return i==null?null:i+``}if(r){for(var a=[],o=0;o=0&&r.push(t[a])}return r.join(` `)}var HR=function(e){U(t,e);function t(t,n,r,i){var a=e.call(this)||this;return a.updateData(t,n,r,i),a}return t.prototype._createSymbol=function(e,t,n,r,i,a){this.removeAll();var o=TA(e,-1,-1,2,2,null,a);o.attr({z2:X(i,100),culling:!0,scaleX:r[0]/2,scaleY:r[1]/2}),o.drift=UR,this._symbolType=e,this.add(o)},t.prototype.stopSymbolAnimation=function(e){this.childAt(0).stopAnimation(null,e)},t.prototype.getSymbolType=function(){return this._symbolType},t.prototype.getSymbolPath=function(){return this.childAt(0)},t.prototype.highlight=function(){Jv(this.childAt(0))},t.prototype.downplay=function(){Yv(this.childAt(0))},t.prototype.setZ=function(e,t){var n=this.childAt(0);n.zlevel=e,n.z=t},t.prototype.setDraggable=function(e,t){var n=this.childAt(0);n.draggable=e,n.cursor=!t&&e?`move`:n.cursor},t.prototype.updateData=function(e,n,r,i){this.silent=!1;var a=e.getItemVisual(n,`symbol`)||`circle`,o=e.hostModel,s=t.getSymbolSize(e,n),c=t.getSymbolZ2(e,n),l=a!==this._symbolType,u=i&&i.disableAnimation;if(l){var d=e.getItemVisual(n,`symbolKeepAspect`);this._createSymbol(a,e,n,s,c,d)}else{var f=this.childAt(0);f.silent=!1;var p={scaleX:s[0]/2,scaleY:s[1]/2};u?f.attr(p):Yb(f,p,o,n),tx(f)}if(this._updateCommon(e,n,s,r,i),l){var f=this.childAt(0);if(!u){var p={scaleX:this._sizeX,scaleY:this._sizeY,style:{opacity:f.style.opacity}};f.scaleX=f.scaleY=0,f.style.opacity=0,Xb(f,p,o,n)}}u&&this.childAt(0).stopAnimation(`leave`)},t.prototype._updateCommon=function(e,t,n,r,i){var a=this.childAt(0),o=e.hostModel,s,c,l,u,d,f,p,m,h;if(r&&(s=r.emphasisItemStyle,c=r.blurItemStyle,l=r.selectItemStyle,u=r.focus,d=r.blurScope,p=r.labelStatesModels,m=r.hoverScale,h=r.cursorStyle,f=r.emphasisDisabled),!r||e.hasItemOption){var g=r&&r.itemModel?r.itemModel:e.getItemModel(t),_=g.getModel(`emphasis`);s=_.getModel(`itemStyle`).getItemStyle(),l=g.getModel([`select`,`itemStyle`]).getItemStyle(),c=g.getModel([`blur`,`itemStyle`]).getItemStyle(),u=_.get(`focus`),d=_.get(`blurScope`),f=_.get(`disabled`),p=tS(g),m=_.getShallow(`scale`),h=g.getShallow(`cursor`)}var v=e.getItemVisual(t,`symbolRotate`);a.attr(`rotation`,(v||0)*Math.PI/180||0);var y=DA(e.getItemVisual(t,`symbolOffset`),n);y&&(a.x=y[0],a.y=y[1]),h&&a.attr(`cursor`,h);var b=e.getItemVisual(t,`style`),x=b.fill;if(a instanceof j_){var S=a.style;a.useStyle(W({image:S.image,x:S.x,y:S.y,width:S.width,height:S.height},b))}else a.__isEmptyBrush?a.useStyle(W({},b)):a.useStyle(b),a.style.decal=null,a.setColor(x,i&&i.symbolInnerColor),a.style.strokeNoScale=!0;var C=e.getItemVisual(t,`liftZ`),w=this._z2;C==null?w!=null&&(a.z2=w,this._z2=null):w??(this._z2=a.z2,a.z2+=C);var T=i&&i.useNameLabel;eS(a,p,{labelFetcher:o,labelDataIndex:t,defaultText:E,inheritColor:x,defaultOpacity:b.opacity});function E(t){return T?e.getName(t):BR(e,t)}this._sizeX=n[0]/2,this._sizeY=n[1]/2;var D=a.ensureState(`emphasis`);D.style=s,a.ensureState(`select`).style=l,a.ensureState(`blur`).style=c;var O=m==null||m===!0?Math.max(1.1,3/this._sizeY):isFinite(m)&&m>0?+m:1;D.scaleX=this._sizeX*O,D.scaleY=this._sizeY*O,this.setSymbolScale(1),py(this,u,d,f)},t.prototype.setSymbolScale=function(e){this.scaleX=this.scaleY=e},t.prototype.fadeOut=function(e,t,n){var r=this.childAt(0),i=iv(this).dataIndex,a=n&&n.animation;if(this.silent=r.silent=!0,n&&n.fadeLabel){var o=r.getTextContent();o&&Qb(o,{style:{opacity:0}},t,{dataIndex:i,removeOpt:a,cb:function(){r.removeTextContent()}})}else r.removeTextContent();Qb(r,{style:{opacity:0},scaleX:0,scaleY:0},t,{dataIndex:i,cb:e,removeOpt:a})},t.getSymbolSize=function(e,t){return EA(e.getItemVisual(t,`symbolSize`))},t.getSymbolZ2=function(e,t){return e.getItemVisual(t,`z2`)},t}(Ky);function UR(e,t){this.parent.drift(e,t)}function WR(e,t,n,r){return t&&!isNaN(t[0])&&!isNaN(t[1])&&!(r&&r.isIgnore&&r.isIgnore(n))&&!(r&&r.clipShape&&!r.clipShape.contain(t[0],t[1]))&&e.getItemVisual(n,`symbol`)!==`none`}function GR(e){return e!=null&&!Nl(e)&&(e={isIgnore:e}),e||{}}function KR(e){var t=e.hostModel,n=t.getModel(`emphasis`);return{emphasisItemStyle:n.getModel(`itemStyle`).getItemStyle(),blurItemStyle:t.getModel([`blur`,`itemStyle`]).getItemStyle(),selectItemStyle:t.getModel([`select`,`itemStyle`]).getItemStyle(),focus:n.get(`focus`),blurScope:n.get(`blurScope`),emphasisDisabled:n.get(`disabled`),hoverScale:n.get(`scale`),labelStatesModels:tS(t),cursorStyle:t.get(`cursor`)}}function qR(e,t,n,r,i,a,o){var s=new e(t,n,r,i);return s.setPosition(a),t.setItemGraphicEl(n,s),o.add(s),s}var JR=function(){function e(e){this.group=new Ky,this._SymbolCtor=e||HR}return e.prototype.updateData=function(e,t){this._progressiveEls=null,t=GR(t);var n=this.group,r=e.hostModel,i=this._data,a=this._SymbolCtor,o=t.disableAnimation,s=this._seriesScope=KR(e),c={disableAnimation:o},l=t.getSymbolPoint||function(t){return e.getItemLayout(t)};i||n.removeAll(),e.diff(i).add(function(r){var i=l(r);WR(e,i,r,t)&&qR(a,e,r,s,c,i,n)}).update(function(u,d){var f=i.getItemGraphicEl(d),p=l(u);if(!WR(e,p,u,t)){n.remove(f);return}var m=e.getItemVisual(u,`symbol`)||`circle`,h=f&&f.getSymbolType&&f.getSymbolType();if(!f||h&&h!==m)n.remove(f),f=new a(e,u,s,c),f.setPosition(p);else{f.updateData(e,u,s,c);var g={x:p[0],y:p[1]};o?f.attr(g):Yb(f,g,r)}n.add(f),e.setItemGraphicEl(u,f)}).remove(function(e){var t=i.getItemGraphicEl(e);t&&t.fadeOut(function(){n.remove(t)},r)}).execute(),this._getSymbolPoint=l,this._data=e},e.prototype.updateLayout=function(e){var t=this._data;if(t)for(var n=this,r=t.getStore(),i=0,a=r.count();i=0;s--){var c=s*2,l=r[c]-a/2,u=r[c+1]-o/2;if(e>=l&&t>=u&&e<=l+a&&t<=u+o)return s}return-1},t.prototype.contain=function(e,t){var n=this.transformCoordToLocal(e,t),r=this.getBoundingRect();return e=n[0],t=n[1],r.contain(e,t)?(this.hoverDataIdx=this.findDataIndex(e,t))>=0:(this.hoverDataIdx=-1,!1)},t.prototype.getBoundingRect=function(){var e=this._rect;if(!e){for(var t=this.shape,n=t.points,r=t.size,i=r[0],a=r[1],o=1/0,s=1/0,c=-1/0,l=-1/0,u=0;u=0&&(c.dataIndex=n+(e.startIndex||0))})},e.prototype.remove=function(){this._clear()},e.prototype._clear=function(){this._newAdded=[],this.group.removeAll()},e}(),$R=typeof Float32Array<`u`?Float32Array:void 0,ez=typeof Float64Array<`u`?Float64Array:void 0;function tz(e){return nz({ctor:$R},e).arr}function nz(e,t){var n=e.arr,r=e.ctor;if(t>Nu&&(t=Nu),!n||e.typed&&n.length=0||e===t}function wz(e){var t=Tz(e);if(t){var n=t.axisPointerModel,r=t.axis.scale,i=n.option,a=n.get(`status`),o=n.get(`value`);o!=null&&(o=r.parse(o));var s=Dz(n);a??(i.status=s?`show`:`hide`);var c=r.getExtent();(o==null||o>c[1])&&(o=c[1]),o-1&&(s.style.stroke=s.style.fill,s.style.fill=Q.color.neutral00,s.style.lineWidth=2),t},t.type=`series.line`,t.dependencies=[`grid`,`polar`],t.defaultOption={z:3,coordinateSystem:`cartesian2d`,legendHoverLink:!0,clip:!0,label:{position:`top`},endLabel:{show:!1,valueAnimation:!0,distance:8},lineStyle:{width:2,type:`solid`},emphasis:{scale:!0},step:!1,smooth:!1,smoothMonotone:null,symbol:`emptyCircle`,symbolSize:6,symbolRotate:null,showSymbol:!0,showAllSymbol:`auto`,connectNulls:!1,sampling:`none`,animationEasing:`linear`,progressive:0,hoverLayerThreshold:1/0,universalTransition:{divideShape:`clone`},triggerLineEvent:!1,triggerEvent:!1},t}(wE);function Wz(e,t,n){var r=e.getBaseAxis(),i=e.getOtherAxis(r),a=Gz(i,n),o=r.dim,s=i.dim,c=t.mapDimension(s),l=t.mapDimension(o),u=+(s===`x`||s===`radius`),d=K(e.dimensions,function(e){return t.mapDimension(e)}),f=!1,p=t.getCalculationInfo(`stackResultDimension`);return UO(t,d[0])&&(f=!0,d[0]=p),UO(t,d[1])&&(f=!0,d[1]=p),{dataDimsForPoint:d,valueStart:a,valueAxisDim:s,baseAxisDim:o,stacked:!!f,valueDim:c,baseDim:l,baseDataOffset:u,stackedOverDimension:t.getCalculationInfo(`stackedOverDimension`)}}function Gz(e,t){var n=0,r=e.scale.getExtent();return t===`start`?n=r[0]:t===`end`?n=r[1]:Ml(t)&&!isNaN(t)?n=t:r[0]>0?n=r[0]:r[1]<0&&(n=r[1]),n}function Kz(e,t,n,r){var i=NaN;e.stacked&&(i=n.get(n.getCalculationInfo(`stackedOverDimension`),r)),isNaN(i)&&(i=e.valueStart);var a=e.baseDataOffset,o=[];return o[a]=n.get(e.baseDim,r),o[1-a]=i,t.dataToPoint(o)}function qz(e,t){return!isFinite(e)||!isFinite(t)}function Jz(e,t){var n=[];return t.diff(e).add(function(e){n.push({cmd:`+`,idx:e})}).update(function(e,t){n.push({cmd:`=`,idx:t,idx1:e})}).remove(function(e){n.push({cmd:`-`,idx:e})}).execute(),n}function Yz(e,t,n,r,i,a,o,s){for(var c=Jz(e,t),l=[],u=[],d=[],f=[],p=[],m=[],h=[],g=Wz(i,t,o),_=e.getLayout(`points`)||[],v=t.getLayout(`points`)||[],y=0;y=i||h<0)break;if(qz(_,v)){if(c){h+=a;continue}break}if(h===n)e[a>0?`moveTo`:`lineTo`](_,v),d=_,f=v;else{var y=_-l,b=v-u;if(y*y+b*b<.5){h+=a;continue}if(o>0){for(var x=h+a,S=t[x*2],C=t[x*2+1];S===_&&C===v&&g=r||qz(S,C))p=_,m=v;else{E=S-l,D=C-u;var A=_-l,j=S-_,M=v-u,N=C-v,P=void 0,F=void 0;if(s===`x`){P=Math.abs(A),F=Math.abs(j);var I=E>0?1:-1;p=_-I*P*o,m=v,O=_+I*F*o,k=v}else if(s===`y`){P=Math.abs(M),F=Math.abs(N);var L=D>0?1:-1;p=_,m=v-L*P*o,O=_,k=v+L*F*o}else P=Math.sqrt(A*A+M*M),F=Math.sqrt(j*j+N*N),T=F/(F+P),p=_-E*o*(1-T),m=v-D*o*(1-T),O=_+E*o*T,k=v+D*o*T,O=Xz(O,Zz(S,_)),k=Xz(k,Zz(C,v)),O=Zz(O,Xz(S,_)),k=Zz(k,Xz(C,v)),E=O-_,D=k-v,p=_-E*P/F,m=v-D*P/F,p=Xz(p,Zz(l,_)),m=Xz(m,Zz(u,v)),p=Zz(p,Xz(l,_)),m=Zz(m,Xz(u,v)),E=_-p,D=v-m,O=_+E*F/P,k=v+D*F/P}e.bezierCurveTo(d,f,p,m,_,v),d=O,f=k}else e.lineTo(_,v)}l=_,u=v,h+=a}return g}var $z=function(){function e(){this.smooth=0,this.smoothConstraint=!0}return e}(),eB=function(e){U(t,e);function t(t){var n=e.call(this,t)||this;return n.type=`ec-polyline`,n}return t.prototype.getDefaultStyle=function(){return{stroke:Q.color.neutral99,fill:null}},t.prototype.getDefaultShape=function(){return new $z},t.prototype.buildPath=function(e,t){var n=t.points,r=0,i=n.length/2;if(t.connectNulls){for(;i>0&&qz(n[i*2-2],n[i*2-1]);i--);for(;r=0){var _=o?(d-a)*g+a:(u-i)*g+i;return o?[e,_]:[_,e]}i=u,a=d;break;case r.C:u=n[c++],d=n[c++],f=n[c++],p=n[c++],m=n[c++],h=n[c++];var v=o?Mm(i,u,f,m,e,s):Mm(a,d,p,h,e,s);if(v>0)for(var y=0;y=0){var _=o?Am(a,d,p,h,b):Am(i,u,f,m,b);return o?[e,_]:[_,e]}}i=m,a=h}}},t}(T_),tB=function(e){U(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}return t}($z),nB=function(e){U(t,e);function t(t){var n=e.call(this,t)||this;return n.type=`ec-polygon`,n}return t.prototype.getDefaultShape=function(){return new tB},t.prototype.buildPath=function(e,t){var n=t.points,r=t.stackedOnPoints,i=0,a=n.length/2,o=t.smoothMonotone;if(t.connectNulls){for(;a>0&&qz(n[a*2-2],n[a*2-1]);a--);for(;i=0,a=e.fill||Q.color.neutral99;lB(r,t);var o=r.textFill==null;return i?o&&(r.textFill=n.insideFill||Q.color.neutral00,!r.textStroke&&n.insideStroke&&(r.textStroke=n.insideStroke),!r.textStroke&&(r.textStroke=a),r.textStrokeWidth??=2):(o&&(r.textFill=e.fill||n.outsideFill||Q.color.neutral00),!r.textStroke&&n.outsideStroke&&(r.textStroke=n.outsideStroke)),r.text=t.text,r.rich=t.rich,G(t.rich,function(e){lB(e,e)}),r}function lB(e,t){t&&(Z(t,`fill`)&&(e.textFill=t.fill),Z(t,`stroke`)&&(e.textStroke=t.fill),Z(t,`lineWidth`)&&(e.textStrokeWidth=t.lineWidth),Z(t,`font`)&&(e.font=t.font),Z(t,`fontStyle`)&&(e.fontStyle=t.fontStyle),Z(t,`fontWeight`)&&(e.fontWeight=t.fontWeight),Z(t,`fontSize`)&&(e.fontSize=t.fontSize),Z(t,`fontFamily`)&&(e.fontFamily=t.fontFamily),Z(t,`align`)&&(e.textAlign=t.align),Z(t,`verticalAlign`)&&(e.textVerticalAlign=t.verticalAlign),Z(t,`lineHeight`)&&(e.textLineHeight=t.lineHeight),Z(t,`width`)&&(e.textWidth=t.width),Z(t,`height`)&&(e.textHeight=t.height),Z(t,`backgroundColor`)&&(e.textBackgroundColor=t.backgroundColor),Z(t,`padding`)&&(e.textPadding=t.padding),Z(t,`borderColor`)&&(e.textBorderColor=t.borderColor),Z(t,`borderWidth`)&&(e.textBorderWidth=t.borderWidth),Z(t,`borderRadius`)&&(e.textBorderRadius=t.borderRadius),Z(t,`shadowColor`)&&(e.textBoxShadowColor=t.shadowColor),Z(t,`shadowBlur`)&&(e.textBoxShadowBlur=t.shadowBlur),Z(t,`shadowOffsetX`)&&(e.textBoxShadowOffsetX=t.shadowOffsetX),Z(t,`shadowOffsetY`)&&(e.textBoxShadowOffsetY=t.shadowOffsetY),Z(t,`textShadowColor`)&&(e.textShadowColor=t.textShadowColor),Z(t,`textShadowBlur`)&&(e.textShadowBlur=t.textShadowBlur),Z(t,`textShadowOffsetX`)&&(e.textShadowOffsetX=t.textShadowOffsetX),Z(t,`textShadowOffsetY`)&&(e.textShadowOffsetY=t.textShadowOffsetY))}function uB(e,t){if(e.length===t.length){for(var n=0;nt){a?n.push(o(a,c,t)):i&&n.push(o(i,c,0),o(i,c,t));break}else i&&=(n.push(o(i,c,0)),null),n.push(c),a=c}return n}function _B(e,t,n){var r=e.getVisual(`visualMeta`);if(r&&r.length&&e.count()&&t.type===`cartesian2d`){for(var i,a,o=r.length-1;o>=0;o--){var s=e.getDimensionInfo(r[o].dimension);if(i=s&&s.coordDim,i===`x`||i===`y`){a=r[o];break}}if(a){var c=t.getAxis(i),l=K(a.stops,function(e){return{coord:c.toGlobalCoord(c.dataToCoord(e.value)),color:e.color}}),u=l.length,d=a.outerColors.slice();u&&l[0].coord>l[u-1].coord&&(l.reverse(),d.reverse());var f=gB(l,i===`x`?n.getWidth():n.getHeight()),p=f.length;if(!p&&u)return l[0].coord<0?d[1]?d[1]:l[u-1].color:d[0]?d[0]:l[0].color;var m=10,h=f[0].coord-m,g=f[p-1].coord+m,_=g-h;if(_<.001)return`transparent`;G(f,function(e){e.offset=(e.coord-h)/_}),f.push({offset:p?f[p-1].offset:.5,color:d[1]||`transparent`}),f.unshift({offset:p?f[0].offset:.5,color:d[0]||`transparent`});var v=new Nb(0,0,0,0,f,!0);return v[i]=h,v[i+`2`]=g,v}}}function vB(e,t,n){var r=e.get(`showAllSymbol`),i=r===`auto`;if(!r||i){var a=n.getAxesByScale(`ordinal`)[0];if(a&&!(i&&yB(a,t))){var o=t.mapDimension(a.dim),s={};return G(a.getViewLabels(),function(e){e.tick.offInterval||(s[sk(a.scale,e.tick)]=1)}),function(e){return!s.hasOwnProperty(t.get(o,e))}}}}function yB(e,t){var n=e.getExtent(),r=Math.abs(n[1]-n[0])/e.scale.count();isNaN(r)&&(r=0);for(var i=t.count(),a=Math.max(1,Math.round(i/5)),o=0;or)return!1;return!0}function bB(e){for(var t=e.length/2;t>0&&qz(e[t*2-2],e[t*2-1]);t--);return t-1}function xB(e,t){return[e[t*2],e[t*2+1]]}function SB(e,t,n){for(var r=e.length/2,i=n===`x`?0:1,a,o,s=0,c=-1,l=0;l=t||a>=t&&o<=t){c=l;break}s=l,a=o}return{range:[s,c],t:(t-a)/(o-a)}}function CB(e){if(e.get([`endLabel`,`show`]))return!0;for(var t=0;t0&&e.get([`emphasis`,`lineStyle`,`width`])===`bolder`){var M=f.getState(`emphasis`).style;M.lineWidth=+f.style.lineWidth+1}iv(f).seriesIndex=e.seriesIndex,py(f,k,A,j);var N=pB(e.get(`smooth`)),P=e.get(`smoothMonotone`);if(f.setShape({smooth:N,smoothMonotone:P,connectNulls:x}),p){var F=a.getCalculationInfo(`stackedOnSeries`),I=0;p.useStyle(yl(s.getAreaStyle(),{fill:E,opacity:.7,lineJoin:`bevel`,decal:a.getVisual(`style`).decal})),F&&(I=pB(F.get(`smooth`))),p.setShape({smooth:N,stackedOnSmooth:I,smoothMonotone:P,connectNulls:x}),_y(p,e,`areaStyle`),iv(p).seriesIndex=e.seriesIndex,py(p,k,A,j)}var L=this._changePolyState;a.eachItemGraphicEl(function(e){e&&(e.onHoverStateChange=L)}),this._polyline.onHoverStateChange=L,this._data=a,this._coordSys=r,this._stackedOnPoints=y,this._points=c,this._step=w,this._valueOrigin=_;var ee=e.get(`triggerEvent`),te=e.get(`triggerLineEvent`),ne=te===!0||ee===!0||ee===`line`,re=te===!0||ee===!0||ee===`area`;this.packEventData(e,f,ne),p&&this.packEventData(e,p,re)},t.prototype.packEventData=function(e,t,n){iv(t).eventData=n?{componentType:`series`,componentSubType:`line`,componentIndex:e.componentIndex,seriesIndex:e.seriesIndex,seriesName:e.name,seriesType:`line`,selfType:t===this._polygon?`area`:`line`}:null},t.prototype.highlight=function(e,t,n,r){var i=e.getData(),a=wd(i,r);if(this._changePolyState(`emphasis`),!(a instanceof Array)&&a!=null&&a>=0){var o=i.getLayout(`points`),s=i.getItemGraphicEl(a);if(!s){var c=o[a*2],l=o[a*2+1];if(qz(c,l)||this._clipShapeForSymbol&&!this._clipShapeForSymbol.contain(c,l))return;var u=e.get(`zlevel`)||0,d=e.get(`z`)||0;s=new HR(i,a),s.x=c,s.y=l,s.setZ(u,d);var f=s.getSymbolPath().getTextContent();f&&(f.zlevel=u,f.z=d,f.z2=this._polyline.z2+1),s.__temp=!0,i.setItemGraphicEl(a,s),s.stopSymbolAnimation(!0),this.group.add(s)}s.highlight()}else xP.prototype.highlight.call(this,e,t,n,r)},t.prototype.downplay=function(e,t,n,r){var i=e.getData(),a=wd(i,r);if(this._changePolyState(`normal`),a!=null&&a>=0){var o=i.getItemGraphicEl(a);o&&(o.__temp?(i.setItemGraphicEl(a,null),this.group.remove(o)):o.downplay())}else xP.prototype.downplay.call(this,e,t,n,r)},t.prototype._changePolyState=function(e){var t=this._polygon;zv(this._polyline,e),t&&zv(t,e)},t.prototype._newPolyline=function(e){var t=this._polyline;return t&&this._lineGroup.remove(t),t=new eB({shape:{points:e},segmentIgnoreThreshold:2,z2:10}),this._lineGroup.add(t),this._polyline=t,t},t.prototype._newPolygon=function(e,t){var n=this._polygon;return n&&this._lineGroup.remove(n),n=new nB({shape:{points:e,stackedOnPoints:t},segmentIgnoreThreshold:2}),this._lineGroup.add(n),this._polygon=n,n},t.prototype._initSymbolLabelAnimation=function(e,t,n){var r,i,a=t.getBaseAxis(),o=a.inverse;t.type===`cartesian2d`?(r=a.isHorizontal(),i=!1):t.type===`polar`&&(r=a.dim===`angle`,i=!0);var s=e.hostModel,c=s.get(`animationDuration`);Al(c)&&(c=c(null));var l=s.get(`animationDelay`)||0,u=Al(l)?l(null):l;e.eachItemGraphicEl(function(e,a){var s=e;if(s){var d=[e.x,e.y],f=void 0,p=void 0,m=void 0;if(n){if(i){var h=n,g=t.pointToCoord(d);r?(f=h.startAngle,p=h.endAngle,m=-g[1]/180*Math.PI):(f=h.r0,p=h.r,m=g[0])}else{var _=n;r?(f=_.x,p=_.x+_.width,m=e.x):(f=_.y+_.height,p=_.y,m=e.y)}}var v=p===f?0:(m-f)/(p-f);o&&(v=1-v);var y=Al(l)?l(a):c*v+u,b=s.getSymbolPath(),x=b.getTextContent();s.attr({scaleX:0,scaleY:0}),s.animateTo({scaleX:1,scaleY:1},{duration:200,setToFinal:!0,delay:y}),x&&x.animateFrom({style:{opacity:0}},{duration:300,delay:y}),b.disableLabelAnimation=!0}})},t.prototype._initOrUpdateEndLabel=function(e,t,n){var r=e.getModel(`endLabel`);if(CB(e)){var i=e.getData(),a=this._polyline,o=i.getLayout(`points`);if(!o){a.removeTextContent(),this._endLabel=null;return}var s=this._endLabel;s||(s=this._endLabel=new W_({z2:200}),s.ignoreClip=!0,a.setTextContent(this._endLabel),a.disableLabelAnimation=!0);var c=bB(o);c>=0&&(eS(a,tS(e,`endLabel`),{inheritColor:n,labelFetcher:e,labelDataIndex:c,defaultText:function(e,t,n){return n==null?BR(i,e):VR(i,n)},enableTextSetter:!0},TB(r,t)),a.textConfig.position=null)}else this._endLabel&&=(this._polyline.removeTextContent(),null)},t.prototype._endLabelOnDuring=function(e,t,n,r,i,a,o){var s=this._endLabel,c=this._polyline;if(s){e<1&&r.originalX==null&&(r.originalX=s.x,r.originalY=s.y);var l=n.getLayout(`points`),u=n.hostModel,d=u.get(`connectNulls`),f=a.get(`precision`),p=a.get(`distance`)||0,m=o.getBaseAxis(),h=m.isHorizontal(),g=m.inverse,_=t.shape,v=g?h?_.x:_.y+_.height:h?_.x+_.width:_.y,y=(h?p:0)*(g?-1:1),b=(h?0:-p)*(g?-1:1),x=h?`x`:`y`,S=SB(l,v,x),C=S.range,w=C[1]-C[0],T=void 0;if(w>=1){if(w>1&&!d){var E=xB(l,C[0]);s.attr({x:E[0]+y,y:E[1]+b}),i&&(T=u.getRawValue(C[0]))}else{var E=c.getPointOn(v,x);E&&s.attr({x:E[0]+y,y:E[1]+b});var D=u.getRawValue(C[0]),O=u.getRawValue(C[1]);i&&(T=Id(n,f,D,O,S.t))}r.lastFrameIndex=C[0]}else{var k=e===1||r.lastFrameIndex>0?C[0]:0,E=xB(l,k);i&&(T=u.getRawValue(k)),s.attr({x:E[0]+y,y:E[1]+b})}if(i){var A=dS(s);typeof A.setLabelText==`function`&&A.setLabelText(T)}}},t.prototype._doUpdateAnimation=function(e,t,n,r,i,a,o){var s=this._polyline,c=this._polygon,l=e.hostModel,u=Yz(this._data,e,this._stackedOnPoints,t,this._coordSys,n,this._valueOrigin,a),d=u.current,f=u.stackedOnCurrent,p=u.next,m=u.stackedOnNext;if(i&&(f=hB(u.stackedOnCurrent,u.current,n,i,o),d=hB(u.current,null,n,i,o),m=hB(u.stackedOnNext,u.next,n,i,o),p=hB(u.next,null,n,i,o)),fB(d,p)>3e3||c&&fB(f,m)>3e3){s.stopAnimation(),s.setShape({points:p}),c&&(c.stopAnimation(),c.setShape({points:p,stackedOnPoints:m}));return}s.shape.__points=u.current,s.shape.points=d;var h={shape:{points:p}};u.current!==d&&(h.shape.__points=u.next),s.stopAnimation(),Yb(s,h,l),c&&(c.setShape({points:d,stackedOnPoints:f}),c.stopAnimation(),Yb(c,{shape:{stackedOnPoints:m}},l),s.shape.points!==c.shape.points&&(c.shape.points=s.shape.points));for(var g=[],_=u.status,v=0;v<_.length;v++)if(_[v].cmd===`=`){var y=e.getItemGraphicEl(_[v].idx1);y&&g.push({el:y,ptIdx:v})}s.animators&&s.animators.length&&s.animators[0].during(function(){c&&c.dirtyShape();for(var e=s.shape.__points,t=0;tt&&(t=e[n]);return isFinite(t)?t:NaN},min:function(e){for(var t=1/0,n=0;n10&&a.type===`cartesian2d`&&i){var s=a.getBaseAxis(),c=a.getOtherAxis(s),l=s.getExtent(),u=n.getDevicePixelRatio(),d=Math.abs(l[1]-l[0])*(u||1),f=Math.round(o/d);if(isFinite(f)&&f>1){i===`lttb`?e.setData(r.lttbDownSample(r.mapDimension(c.dim),1/f)):i===`minmax`&&e.setData(r.minmaxDownSample(r.mapDimension(c.dim),1/f));var p=void 0;Y(i)?p=DB[i]:Al(i)&&(p=i),p&&e.setData(r.downSample(r.mapDimension(c.dim),1/f,p,OB))}}}}}function AB(e){e.registerChartView(EB),e.registerSeriesModel(Uz),e.registerLayout(rz(`line`,!0)),e.registerVisual({seriesType:`line`,reset:function(e){var t=e.getData(),n=e.getModel(`lineStyle`).getLineStyle();n&&!n.stroke&&(n.stroke=t.getVisual(`style`).fill),t.setVisual(`legendLineStyle`,n)}}),e.registerProcessor(e.PRIORITY.PROCESSOR.STATISTIC,kB(`line`))}function jB(){iA(`liPosMinGap`,MB)}function MB(e,t,n){var r=$l(),i=n.serUids,a=n.liPosMinGap,o,s=t.axis,c=s.scale,l=c.needTransform(),u=c.getFilter?c.getFilter():null,d=wT(u);function f(n){eA(e,t.sers,function(e){var t=e.getRawData(),r=t.getDimensionIndex(t.mapDimension(s.dim));r>=0&&n(r,e,t.getStore())})}var p=0;if(f(function(e,t,n){r.set(t.uid,1),(!i||!i.hasKey(t.uid))&&(o=!0),p+=n.count()}),(!i||i.keys().length!==r.keys().length)&&(o=!0),!o&&a!=null){t.liPosMinGap=a;return}nz(NB,p);var m=0;f(function(e,t,n){for(var r=0,i=n.count();r0&&v0?-2:-1,n.serUids=r}var NB=nz({ctor:ez},50);function PB(e){return function(t,n){var r=dA(t,{fromStat:{key:e}});if(qu(r.w2))return[-r.w2/2,r.w2/2]}}function FB(e,t){return e+`|&`+t}function IB(e){return jB(),{liPosMinGap:!tO(e.scale)}}function LB(e,t,n,r){cA(e,{key:t,seriesType:n,coordSysType:r,getMetrics:IB})}function RB(e){return e.scale.rawExtentInfo.makeRenderInfo().startValue}var zB=Kd(),BB=`__ec_stack_`;function VB(e){return e.get(`stack`)||BB+e.seriesIndex}function HB(e){if(tO(e.axis.scale)){for(var t=dA(e.axis),n=[],r=0;ro&&(o=a),o!==u&&(t.width=o,n-=o+l*o,r--)}}),u=(n-c)/(r+(r-1)*l),u=fu(u,0);var d=0,f;G(o,function(e){var t=s[e];t.width||=u,f=t,d+=t.width*(1+l)}),f&&(d-=f.width*l);var p={},m=-d/2;return G(o,function(e){var n=s[e];p[e]=p[e]||{bandWidth:t,offset:m,width:n.width},m+=n.width*(1+l)}),p}function KB(e){return{seriesType:e,overallReset:function(t){var n=FB(e,fk);tA(t,n,function(t){var r=UB(t,e);$k(t,n,function(e){var t=r.columnMap[VB(e)];e.getData().setLayout({bandWidth:t.bandWidth,offset:t.offset,size:t.width})})})}}}function qB(e){return{seriesType:e,plan:vP(),reset:function(e){if(cj(e)){var t=e.getData(),n=e.coordinateSystem,r=n.getBaseAxis(),i=n.getOtherAxis(r),a=t.getDimensionIndex(t.mapDimension(i.dim)),o=t.getDimensionIndex(t.mapDimension(r.dim)),s=e.get(`showBackground`,!0),c=t.mapDimension(i.dim),l=t.getCalculationInfo(`stackResultDimension`),u=UO(t,c)&&!!t.getCalculationInfo(`stackedOnSeries`),d=i.isHorizontal(),f=i.toGlobalCoord(i.dataToCoord(RB(i))),p=JB(e),m=e.get(`barMinHeight`)||0,h=l&&t.getDimensionIndex(l),g=t.getLayout(`size`),_=t.getLayout(`offset`);return{progress:function(e,t){for(var r=e.count,i=p&&tz(r*3),c=p&&s&&tz(r*3),l=p&&tz(r),v=n.master.getRect(),y=d?v.width:v.height,b,x=t.getStore(),S=0;(b=e.next())!=null;){var C=x.get(u?h:a,b),w=x.get(o,b),T=f,E=void 0;u&&(E=+C-x.get(a,b));var D=void 0,O=void 0,k=void 0,A=void 0;if(d){var j=n.dataToPoint([C,w]);u&&(T=n.dataToPoint([E,w])[0]),D=T,O=j[1]+_,k=j[0]-T,A=g,pu(k)s){u=(p+l)/2;break}f===1&&(d=m-r[0].tickValue)}u??(l?l&&(u=r[r.length-1].coord):u=r[0].coord),a[n]=e.toGlobalCoord(u)}});else{var o=this.getData(),s=o.getLayout(`offset`),c=o.getLayout(`size`),l=+!r.getBaseAxis().isHorizontal();a[l]+=s+c/2}return a}return[NaN,NaN]},t.prototype.__requireStartValue=function(e){return this.getBaseAxis()!==e},t.type=`series.__base_bar__`,t.defaultOption={z:2,coordinateSystem:`cartesian2d`,legendHoverLink:!0,barMinHeight:0,barMinAngle:0,large:!1,largeThreshold:400,progressive:3e3,progressiveChunkMode:`mod`,defaultBarGap:`10%`},t}(wE);wE.registerClass(ZB);var QB=function(e){U(t,e);function t(){var n=e!==null&&e.apply(this,arguments)||this;return n.type=t.type,n}return t.prototype.getInitialData=function(){return IR(null,this,{useEncodeDefaulter:!0,createInvertedIndices:!!this.get(`realtimeSort`,!0)||null})},t.prototype.getProgressive=function(){return this.get(`large`)?this.get(`progressive`):!1},t.prototype.__preparePipelineContext=function(e,t){var n=Qd(this,e,t);return n.progressiveRender&&(n.large=!0),n},t.prototype.brushSelector=function(e,t,n){return n.rect(t.getItemLayout(e))},t.type=`series.bar`,t.dependencies=[`grid`,`polar`],t.defaultOption=AS(ZB.defaultOption,{clip:!0,roundCap:!1,showBackground:!1,backgroundStyle:{color:`rgba(180, 180, 180, 0.2)`,borderColor:null,borderWidth:0,borderType:`solid`,borderRadius:0,shadowBlur:0,shadowColor:null,shadowOffsetX:0,shadowOffsetY:0,opacity:1},select:{itemStyle:{borderColor:Q.color.primary,borderWidth:2}},realtimeSort:!1}),t}(ZB),$B=function(){function e(){this.cx=0,this.cy=0,this.r0=0,this.r=0,this.startAngle=0,this.endAngle=Math.PI*2,this.clockwise=!0}return e}(),eV=function(e){U(t,e);function t(t){var n=e.call(this,t)||this;return n.type=`sausage`,n}return t.prototype.getDefaultShape=function(){return new $B},t.prototype.buildPath=function(e,t){var n=t.cx,r=t.cy,i=Math.max(t.r0||0,0),a=Math.max(t.r,0),o=(a-i)*.5,s=i+o,c=t.startAngle,l=t.endAngle,u=t.clockwise,d=Math.PI*2,f=u?l-cMath.PI/2&&ua)return!0;a=l}return!1},t.prototype._isOrderDifferentInView=function(e,t){for(var n=t.scale,r=n.getExtent(),i=Math.max(0,r[0]),a=Math.min(r[1],n.getOrdinalMeta().categories.length-1);i<=a;++i)if(e.ordinalNumbers[i]!==n.getRawOrdinalNumber(i))return!0},t.prototype._updateSortWithinSameData=function(e,t,n,r){if(this._isOrderChangedWithinSameData(e,t,n)){var i=this._dataSort(e,n,t);this._isOrderDifferentInView(i,n)&&(this._removeOnRenderedListener(r),r.dispatchAction({type:`changeAxisOrder`,componentType:n.dim+`Axis`,axisId:n.index,sortInfo:i}))}},t.prototype._dispatchInitSort=function(e,t,n){var r=t.baseAxis,i=this._dataSort(e,r,function(n){return e.get(e.mapDimension(t.otherAxis.dim),n)});n.dispatchAction({type:`changeAxisOrder`,componentType:r.dim+`Axis`,isInitSort:!0,axisId:r.index,sortInfo:i})},t.prototype.remove=function(e,t){this._clear(this._model),this._removeOnRenderedListener(t)},t.prototype.dispose=function(e,t){this._removeOnRenderedListener(t)},t.prototype._removeOnRenderedListener=function(e){this._onRendered&&=(e.getZr().off(`rendered`,this._onRendered),null)},t.prototype._clear=function(e){var t=this.group,n=this._data;e&&e.isAnimationEnabled()&&n&&!this._isLargeDraw?(this._removeBackground(),this._backgroundEls=[],n.eachItemGraphicEl(function(t){ex(t,e,iv(t).dataIndex)})):t.removeAll(),this._data=null,this._isFirstFrame=!0},t.prototype._removeBackground=function(){this.group.remove(this._backgroundGroup),this._backgroundGroup=null},t.type=`bar`,t}(xP),lV={cartesian2d:function(e,t){var n=t.width<0?-1:1,r=t.height<0?-1:1;n<0&&(t.x+=t.width,t.width=-t.width),r<0&&(t.y+=t.height,t.height=-t.height);var i=e.x+e.width,a=e.y+e.height,o=oV(t.x,e.x),s=sV(t.x+t.width,i),c=oV(t.y,e.y),l=sV(t.y+t.height,a),u=si?s:o,t.y=d&&c>a?l:c,t.width=u?0:s-o,t.height=d?0:l-c,n<0&&(t.x+=t.width,t.width=-t.width),r<0&&(t.y+=t.height,t.height=-t.height),u||d},polar:function(e,t){var n=t.r0<=t.r?1:-1;if(n<0){var r=t.r;t.r=t.r0,t.r0=r}var i=sV(t.r,e.r),a=oV(t.r0,e.r0);t.r=i,t.r0=a;var o=i-a<0;if(n<0){var r=t.r;t.r=t.r0,t.r0=r}return o}},uV={cartesian2d:function(e,t,n,r,i,a,o,s,c){var l=new z_({shape:W({},r),z2:1});if(l.__dataIndex=n,l.name=`item`,a){var u=l.shape,d=i?`height`:`width`;u[d]=0}return l},polar:function(e,t,n,r,i,a,o,s,c){var l=!i&&c?eV:pb,u=new l({shape:r,z2:1});if(u.name=`item`,u.calculateTextPosition=tV(yV(i),{isRoundCap:l===eV}),a){var d=u.shape,f=i?`r`:`endAngle`,p={};d[f]=i?r.r0:r.startAngle,p[f]=r[f],(s?Yb:Xb)(u,{shape:p},a)}return u}};function dV(e,t){var n=e.get(`realtimeSort`,!0),r=t.getBaseAxis();if(n&&r.type===`category`&&t.type===`cartesian2d`)return{baseAxis:r,otherAxis:t.getOtherAxis(r)}}function fV(e,t,n,r,i,a,o,s){var c,l;a?(l={x:r.x,width:r.width},c={y:r.y,height:r.height}):(l={y:r.y,height:r.height},c={x:r.x,width:r.width}),s||(o?Yb:Xb)(n,{shape:c},t,i,null);var u=t?e.baseAxis.model:null;(o?Yb:Xb)(n,{shape:l},u,i)}function pV(e,t){for(var n=0;n0?1:-1,o=r.height>0?1:-1;return{x:r.x+a*i/2,y:r.y+o*i/2,width:r.width-a*i,height:r.height-o*i}},polar:function(e,t,n){var r=e.getItemLayout(t);return{cx:r.cx,cy:r.cy,r0:r.r0,r:r.r,startAngle:r.startAngle,endAngle:r.endAngle,clockwise:r.clockwise}}};function vV(e){return e.startAngle!=null&&e.endAngle!=null&&e.startAngle===e.endAngle}function yV(e){return function(e){var t=e?`Arc`:`Angle`;return function(e){switch(e){case`start`:case`insideStart`:case`end`:case`insideEnd`:return e+t;default:return e}}}(e)}function bV(e,t,n,r,i,a,o,s){var c=t.getItemVisual(n,`style`);if(!s){var l=r.get([`itemStyle`,`borderRadius`])||0;e.setShape(`r`,l)}else if(!a.get(`roundCap`)){var u=e.shape;W(u,aV(r.getModel(`itemStyle`),u,!0)),e.setShape(u)}e.useStyle(c);var d=r.getShallow(`cursor`);d&&e.attr(`cursor`,d);var f=s?o?i.r>=i.r0?`endArc`:`startArc`:i.endAngle>=i.startAngle?`endAngle`:`startAngle`:o?kV(i,a.coordinateSystem):AV(i,a.coordinateSystem),p=tS(r);eS(e,p,{labelFetcher:a,labelDataIndex:n,defaultText:BR(a.getData(),n),inheritColor:c.fill,defaultOpacity:c.opacity,defaultOutsidePosition:f});var m=e.getTextContent();if(s&&m){var h=r.get([`label`,`position`]);e.textConfig.inside=h===`middle`||null,nV(e,h===`outside`?f:h,yV(o),r.get([`label`,`rotate`]))}fS(m,p,a.getRawValue(n),function(e){return VR(t,e)});var g=r.getModel([`emphasis`]);py(e,g.get(`focus`),g.get(`blurScope`),g.get(`disabled`)),_y(e,r),vV(i)&&(e.style.fill=`none`,e.style.stroke=`none`,G(e.states,function(e){e.style&&(e.style.fill=e.style.stroke=`none`)}))}function xV(e,t){var n=e.get([`itemStyle`,`borderColor`]);if(!n||n===`none`)return 0;var r=e.get([`itemStyle`,`borderWidth`])||0,i=isNaN(t.width)?Number.MAX_VALUE:Math.abs(t.width),a=isNaN(t.height)?Number.MAX_VALUE:Math.abs(t.height);return Math.min(r,i,a)}var SV=function(){function e(){}return e}(),CV=function(e){U(t,e);function t(t){var n=e.call(this,t)||this;return n.type=`largeBar`,n}return t.prototype.getDefaultShape=function(){return new SV},t.prototype.buildPath=function(e,t){for(var n=t.points,r=this.baseDimIdx,i=1-this.baseDimIdx,a=[],o=[],s=this.barWidth,c=0;c=0?n:null},30,!1);function EV(e,t,n){for(var r=e.baseDimIdx,i=1-r,a=e.shape.points,o=e.largeDataIndices,s=[],c=[],l=e.barWidth,u=0,d=a.length/3;u=s[0]&&t<=s[0]+c[0]&&n>=s[1]&&n<=s[1]+c[1])return o[u]}return-1}function DV(e,t,n){if(rB(n,`cartesian2d`)){var r=t,i=n.getArea();return{x:e?r.x:i.x,y:e?i.y:r.y,width:e?r.width:i.width,height:e?i.height:r.height}}var i=n.getArea(),a=t;return{cx:i.cx,cy:i.cy,r0:e?i.r0:a.r0,r:e?i.r:a.r,startAngle:e?a.startAngle:0,endAngle:e?a.endAngle:Math.PI*2}}function OV(e,t,n){return new(e.type===`polar`?pb:z_)({shape:DV(t,n,e),silent:!0,z2:0})}function kV(e,t){return e.height===0?t.getOtherAxis(t.getBaseAxis()).inverse?`bottom`:`top`:e.height>0?`bottom`:`top`}function AV(e,t){return e.width===0?t.getOtherAxis(t.getBaseAxis()).inverse?`left`:`right`:e.width>=0?`right`:`left`}function jV(e){e.registerChartView(cV),e.registerSeriesModel(QB),e.registerLayout(e.PRIORITY.VISUAL.LAYOUT,KB(`bar`)),e.registerLayout(e.PRIORITY.VISUAL.PROGRESSIVE_LAYOUT,qB(`bar`)),e.registerProcessor(e.PRIORITY.PROCESSOR.STATISTIC,kB(`bar`)),e.registerAction({type:`changeAxisOrder`,event:`changeAxisOrder`,update:`update`},function(e,t){var n=e.componentType||`series`;t.eachComponent({mainType:n,query:e},function(t){e.sortInfo&&t.axis.setCategorySortInfo(e.sortInfo)})}),XB(e)}var MV=Td();function NV(e,t,n){MV(e)[t]=n}function PV(e,t,n){var r=MV(e);r[t]===n&&(r[t]=null)}function FV(e,t){return!!MV(e)[t]}qL({type:`takeGlobalCursor`,event:`globalCursorTaken`,update:`update`},ru);var IV={axisPointer:1,tooltip:1,brush:1};function LV(e,t,n){var r=t.getComponentByElement(e.topTarget);if(!r||r===n||IV.hasOwnProperty(r.mainType))return!1;var i=r.coordinateSystem;if(!i||i.model===n)return!1;var a=Ux(r),o=Ux(n);return!((a.zlevel-o.zlevel||a.z-o.z)<=0)}var RV=function(e){U(t,e);function t(t){var n=e.call(this)||this;n._zr=t;var r=q(n._mousedownHandler,n),i=q(n._mousemoveHandler,n),a=q(n._mouseupHandler,n),o=q(n._mousewheelHandler,n),s=q(n._pinchHandler,n);return n.enable=function(e,n){var c=n.zInfo,l=Ux(c.component),u=l.z,d=l.zlevel,f={component:c.component,z:u,zlevel:d,z2:X(c.z2,-1/0)},p=W({},n.triggerInfo);this._opt=yl(W({},n),{zoomOnMouseWheel:!0,moveOnMouseMove:!0,moveOnMouseWheel:!1,preventDefaultMouseMove:!0,zInfoParsed:f,triggerInfo:p,cursorGrab:`grab`,cursorGrabbing:`grabbing`}),e??=!0,(!this._enabled||this._controlType!==e)&&(this.disable(),this._enabled=!0,(e===!0||e===`move`||e===`pan`)&&(HV(t,`mousedown`,r,f),HV(t,`mousemove`,i,f),HV(t,`mouseup`,a,f)),(e===!0||e===`scale`||e===`zoom`)&&(HV(t,`mousewheel`,o,f),HV(t,`pinch`,s,f)))},n.disable=function(){this._enabled&&(this._enabled=!1,UV(t,`mousedown`,r),UV(t,`mousemove`,i),UV(t,`mouseup`,a),UV(t,`mousewheel`,o),UV(t,`pinch`,s))},n}return t.prototype.isDragging=function(){return this._dragging},t.prototype.isPinching=function(){return this._pinching},t.prototype._checkPointer=function(e,t,n){var r=this._opt,i=r.zInfoParsed;if(LV(e,r.api,i.component))return!1;var a=r.triggerInfo,o=a.roamTrigger,s=!1;return o===`global`&&(s=!0),s||=a.isInSelf(e,t,n),s&&a.isInClip&&!a.isInClip(e,t,n)&&(s=!1),s},t.prototype._decideCursorStyle=function(e,t,n,r){var i=e.target;if(!i&&this._checkPointer(e,t,n))return this._opt.cursorGrab;if(r)return i&&i.cursor||`default`},t.prototype.dispose=function(){this.disable()},t.prototype._mousedownHandler=function(e){if(!(mM(e)||zV(e))){for(var t=e.target;t;){if(t.draggable)return;t=t.__hostTarget||t.parent}var n=e.offsetX,r=e.offsetY;this._checkPointer(e,n,r)&&(this._x=n,this._y=r,this._dragging=!0)}},t.prototype._mousemoveHandler=function(e){var t=this._zr;if(!(e.gestureEvent===`pinch`||FV(t,`globalPan`)||zV(e))){var n=e.offsetX,r=e.offsetY;if(!this._dragging||!qV(`moveOnMouseMove`,e,this._opt)){var i=this._decideCursorStyle(e,n,r,!1);i&&t.setCursorStyle(i);return}t.setCursorStyle(this._opt.cursorGrabbing);var a=this._x,o=this._y,s=n-a,c=r-o;this._x=n,this._y=r,this._opt.preventDefaultMouseMove&&pM(e.event),e.__ecRoamConsumed=!0,KV(this,`pan`,`moveOnMouseMove`,e,{dx:s,dy:c,oldX:a,oldY:o,newX:n,newY:r,isAvailableBehavior:null})}},t.prototype._mouseupHandler=function(e){if(!zV(e)){var t=this._zr;if(!mM(e)){this._dragging=!1;var n=this._decideCursorStyle(e,e.offsetX,e.offsetY,!0);n&&t.setCursorStyle(n)}}},t.prototype._mousewheelHandler=function(e){if(!zV(e)){var t=qV(`zoomOnMouseWheel`,e,this._opt),n=qV(`moveOnMouseWheel`,e,this._opt),r=e.wheelDelta,i=Math.abs(r),a=e.offsetX,o=e.offsetY;if(r!==0&&(t||n)){if(t){var s=i>3?1.4:i>1?1.2:1.1,c=r>0?s:1/s;this._checkTriggerMoveZoom(this,`zoom`,`zoomOnMouseWheel`,e,{scale:c,originX:a,originY:o,isAvailableBehavior:null})}if(n){var l=Math.abs(r),u=(r>0?1:-1)*(l>3?.4:l>1?.15:.05);this._checkTriggerMoveZoom(this,`scrollMove`,`moveOnMouseWheel`,e,{scrollDelta:u,originX:a,originY:o,isAvailableBehavior:null})}}}},t.prototype._pinchHandler=function(e){if(!(FV(this._zr,`globalPan`)||zV(e))){var t=e.pinchScale>1?1.1:1/1.1;this._checkTriggerMoveZoom(this,`zoom`,null,e,{scale:t,originX:e.pinchX,originY:e.pinchY,isAvailableBehavior:null})}},t.prototype._checkTriggerMoveZoom=function(e,t,n,r,i){e._checkPointer(r,i.originX,i.originY)&&(pM(r.event),r.__ecRoamConsumed=!0,KV(e,t,n,r,i))},t}(Uh);function zV(e){return e.__ecRoamConsumed}var BV=Td();function VV(e){var t=BV(e);return t.roam=t.roam||{},t.uniform=t.uniform||{},t}function HV(e,t,n,r){for(var i=VV(e).roam,a=i[t]=i[t]||[],o=0;o=0;a--)r[a]??(delete n[t[a]],t.pop())}function dH(e,t){var n=e.visual,r=[];Nl(n)?aH(n,function(e){r.push(e)}):n!=null&&r.push(n),!t&&r.length===1&&!{color:1,symbol:1}.hasOwnProperty(e.type)&&(r[1]=r[0]),yH(e,r)}function fH(e){return{applyVisual:function(t,n,r){var i=this.mapValueToVisual(t);r(`color`,e(n(`color`),i))},_normalizedToVisual:_H([0,1])}}function pH(e){var t=this.option.visual;return t[Math.round(Su(e,[0,1],[0,t.length-1],!0))]||{}}function mH(e){return function(t,n,r){r(e,this.mapValueToVisual(t))}}function hH(e){var t=this.option.visual;return t[this.option.loop&&e!==sH?e%t.length:e]}function gH(){return this.option.visual[0]}function _H(e){return{linear:function(t){return Su(t,e,this.option.visual,!0)},category:hH,piecewise:function(t,n){var r=vH.call(this,n);return r??=Su(t,e,this.option.visual,!0),r},fixed:gH}}function vH(e){var t=this.option,n=t.pieceList;if(t.hasSpecialVisual){var r=n[cH.findPieceIndex(e,n)];if(r&&r.visual)return r.visual[this.type]}}function yH(e,t){return e.visual=t,e.type===`color`&&(e.parsedVisual=K(t,function(e){return oh(e)||[0,0,0,1]})),t}var bH={linear:function(e){return Su(e,this.option.dataExtent,[0,1],!0)},piecewise:function(e){var t=this.option.pieceList,n=cH.findPieceIndex(e,t,!0);if(n!=null)return Su(n,[0,t.length-1],[0,1],!0)},category:function(e){return(this.option.categories?this.option.categoryMap[e]:e)??sH},fixed:ru};function xH(e,t,n){return e?t<=n:t0&&(y[0]=-y[0],y[1]=-y[1]);var x=v[0]<0?-1:1;if(r.__position!==`start`&&r.__position!==`end`){var S=-Math.atan2(v[1],v[0]);l[0].8?`left`:u[0]<-.8?`right`:`center`,p=u[1]>.8?`top`:u[1]<-.8?`bottom`:`middle`;break;case`start`:r.x=-u[0]*h+c[0],r.y=-u[1]*g+c[1],f=u[0]>.8?`right`:u[0]<-.8?`left`:`center`,p=u[1]>.8?`bottom`:u[1]<-.8?`top`:`middle`;break;case`insideStartTop`:case`insideStart`:case`insideStartBottom`:r.x=h*x+c[0],r.y=c[1]+C,f=v[0]<0?`right`:`left`,r.originX=-h*x,r.originY=-C;break;case`insideMiddleTop`:case`insideMiddle`:case`insideMiddleBottom`:case`middle`:r.x=b[0],r.y=b[1]+C,f=`center`,r.originY=-C;break;case`insideEndTop`:case`insideEnd`:case`insideEndBottom`:r.x=-h*x+l[0],r.y=l[1]+C,f=v[0]>=0?`right`:`left`,r.originX=h*x,r.originY=-C}r.scaleX=r.scaleY=i,r.setStyle({verticalAlign:r.__verticalAlign||p,align:r.__align||f})}},t}(Ky),PH=function(){function e(e){this.group=new Ky,this._LineCtor=e||NH}return e.prototype.updateData=function(e){var t=this;this._progressiveEls=null;var n=this,r=n.group,i=n._lineData;n._lineData=e,i||r.removeAll();var a=IH(e);e.diff(i).add(function(n){t._doAdd(e,n,a)}).update(function(n,r){t._doUpdate(i,e,r,n,a)}).remove(function(e){r.remove(i.getItemGraphicEl(e))}).execute()},e.prototype.updateLayout=function(){var e=this._lineData;e&&e.eachItemGraphicEl(function(t,n){t.updateLayout(e,n)},this)},e.prototype.incrementalPrepareUpdate=function(e){this._seriesScope=IH(e),this._lineData=null,this.group.removeAll()},e.prototype.incrementalUpdate=function(e,t,n){this._progressiveEls=[];function r(e){!e.isGroup&&!FH(e)&&(e.incremental=n,e.ensureState(`emphasis`).hoverLayer=2)}for(var i=e.start;i0}function IH(e){var t=e.hostModel,n=t.getModel(`emphasis`);return{lineStyle:t.getModel(`lineStyle`).getLineStyle(),emphasisLineStyle:n.getModel([`lineStyle`]).getLineStyle(),blurLineStyle:t.getModel([`blur`,`lineStyle`]).getLineStyle(),selectLineStyle:t.getModel([`select`,`lineStyle`]).getLineStyle(),emphasisDisabled:n.get(`disabled`),blurScope:n.get(`blurScope`),focus:n.get(`focus`),labelStatesModels:tS(t)}}function LH(e){return isNaN(e[0])||isNaN(e[1])}function RH(e){return e&&!LH(e[0])&&!LH(e[1])}function zH(e,t,n,r,i,a){e||=0;var o=Mu(n[1],-n[0]);if(i!=null&&(i=VH(i,[0,o])),a!=null&&(a=Math.max(a,i??0)),r===`all`){var s=Math.abs(Mu(t[1],-t[0]));s=VH(s,[0,o]),i=a=VH(s,[i,a]),r=0}t[0]=VH(t[0],n),t[1]=VH(t[1],n);var c=BH(t,r);t[r]+=e;var l=i||0,u=n.slice();c.sign<0?u[0]=Mu(u[0],l):u[1]=Mu(u[1],-l),t[r]=VH(t[r],u);var d=BH(t,r);return i!=null&&(d.sign!==c.sign||d.spana&&(t[1-r]=Mu(t[r],d.sign*a)),t}function BH(e,t){var n=e[t]-e[1-t];return{span:Math.abs(n),sign:n>0?-1:n<0?1:t?-1:1}}function VH(e,t){return Math.min(t[1]==null?1/0:t[1],Math.max(t[0]==null?-1/0:t[0],e))}var HH=!0,UH=Math.min,WH=Math.max,GH=Math.pow,KH=1e4,qH=6,JH=6,YH=`globalPan`,XH={w:[0,0],e:[0,1],n:[1,0],s:[1,1]},ZH={w:`ew`,e:`ew`,n:`ns`,s:`ns`,ne:`nesw`,sw:`nesw`,nw:`nwse`,se:`nwse`},QH={brushStyle:{lineWidth:2,stroke:Q.color.backgroundTint,fill:Q.color.borderTint},transformable:!0,brushMode:`single`,removeOnClick:!1},$H=0,eU=function(e){U(t,e);function t(t){var n=e.call(this)||this;return n._track=[],n._covers=[],n._handlers={},n._zr=t,n.group=new Ky,n._uid=`brushController_`+$H++,G(MU,function(e,t){this._handlers[t]=q(e,this)},n),n}return t.prototype.enableBrush=function(e){return this._brushType&&this._doDisableBrush(),e.brushType&&this._doEnableBrush(e),this},t.prototype._doEnableBrush=function(e){var t=this._zr;this._enableGlobalPan||NV(t,YH,this._uid),G(this._handlers,function(e,n){t.on(n,e)}),this._brushType=e.brushType,this._brushOption=gl(hl(QH),e,!0)},t.prototype._doDisableBrush=function(){var e=this._zr;PV(e,YH,this._uid),G(this._handlers,function(t,n){e.off(n,t)}),this._brushType=this._brushOption=null},t.prototype.setPanels=function(e){if(e&&e.length){var t=this._panels={};G(e,function(e){t[e.panelId]=hl(e)})}else this._panels=null;return this},t.prototype.mount=function(e){e||={},this._enableGlobalPan=e.enableGlobalPan;var t=this.group;return this._zr.add(t),t.attr({x:e.x||0,y:e.y||0,rotation:e.rotation||0,scaleX:e.scaleX||1,scaleY:e.scaleY||1}),this._transform=t.getLocalTransform(),this},t.prototype.updateCovers=function(e){e=K(e,function(e){return gl(hl(QH),e,!0)});var t=`\0-brush-index-`,n=this._covers,r=this._covers=[],i=this,a=this._creatingCover;return new FE(n,e,s,o).add(c).update(c).remove(l).execute(),this;function o(e,n){return(e.id==null?t+n:e.id)+`-`+e.brushType}function s(e,t){return o(e.__brushOption,t)}function c(t,o){var s=e[t];o!=null&&n[o]===a?r[t]=n[o]:aU(i,r[t]=o==null?nU(i,tU(i,s)):(n[o].__brushOption=s,n[o]))}function l(e){n[e]!==a&&i.group.remove(n[e])}},t.prototype.unmount=function(){return this.enableBrush(!1),lU(this),this._zr.remove(this.group),this},t.prototype.dispose=function(){this.unmount(),this.off()},t}(Uh);function tU(e,t){var n=FU[t.brushType].createCover(e,t);return n.__brushOption=t,iU(n,t),e.group.add(n),n}function nU(e,t){var n=oU(t);return n.endCreating&&(n.endCreating(e,t),iU(t,t.__brushOption)),t}function rU(e,t){var n=t.__brushOption;oU(t).updateCoverShape(e,t,n.range,n)}function iU(e,t){var n=t.z;n??=KH,e.traverse(function(e){e.z=n,e.z2=n})}function aU(e,t){oU(t).updateCommon(e,t),rU(e,t)}function oU(e){return FU[e.__brushOption.brushType]}function sU(e,t,n){var r=e._panels;if(!r)return HH;var i,a=e._transform;return G(r,function(e){e.isTargetByCursor(t,n,a)&&(i=e)}),i}function cU(e,t){var n=e._panels;if(!n)return HH;var r=t.__brushOption.panelId;return r==null?HH:n[r]}function lU(e){var t=e._covers,n=t.length;return G(t,function(t){e.group.remove(t)},e),t.length=0,!!n}function uU(e,t){var n=K(e._covers,function(e){var t=e.__brushOption,n=hl(t.range);return{brushType:t.brushType,panelId:t.panelId,range:n}});e.trigger(`brush`,{areas:n,isEnd:!!t.isEnd,removeOnClick:!!t.removeOnClick})}function dU(e){var t=e._track;if(!t.length)return!1;var n=t[t.length-1],r=t[0],i=n[0]-r[0],a=n[1]-r[1];return GH(i*i+a*a,.5)>qH}function fU(e){var t=e.length-1;return t<0&&(t=0),[e[0],e[t]]}function pU(e,t,n,r){var i=new Ky;return i.add(new z_({name:`main`,style:_U(n),silent:!0,draggable:!0,cursor:`move`,drift:kl(SU,e,t,i,[`n`,`s`,`w`,`e`]),ondragend:kl(uU,t,{isEnd:!0})})),G(r,function(n){i.add(new z_({name:n.join(``),style:{opacity:0},draggable:!0,silent:!0,invisible:!0,drift:kl(SU,e,t,i,n),ondragend:kl(uU,t,{isEnd:!0})}))}),i}function mU(e,t,n,r){var i=r.brushStyle.lineWidth||0,a=WH(i,JH),o=n[0][0],s=n[1][0],c=o-i/2,l=s-i/2,u=n[0][1],d=n[1][1],f=u-a+i/2,p=d-a+i/2,m=u-o,h=d-s,g=m+i,_=h+i;gU(e,t,`main`,o,s,m,h),r.transformable&&(gU(e,t,`w`,c,l,a,_),gU(e,t,`e`,f,l,a,_),gU(e,t,`n`,c,l,g,a),gU(e,t,`s`,c,p,g,a),gU(e,t,`nw`,c,l,a,a),gU(e,t,`ne`,f,l,a,a),gU(e,t,`sw`,c,p,a,a),gU(e,t,`se`,f,p,a,a))}function hU(e,t){var n=t.__brushOption,r=n.transformable,i=t.childAt(0);i.useStyle(_U(n)),i.attr({silent:!r,cursor:r?`move`:`default`}),G([[`w`],[`e`],[`n`],[`s`],[`s`,`e`],[`s`,`w`],[`n`,`e`],[`n`,`w`]],function(n){var i=t.childOfName(n.join(``)),a=n.length===1?bU(e,n[0]):xU(e,n);i&&i.attr({silent:!r,invisible:!r,cursor:r?ZH[a]+`-resize`:null})})}function gU(e,t,n,r,i,a,o){var s=t.childOfName(n);s&&s.setShape(EU(TU(e,t,[[r,i],[r+a,i+o]])))}function _U(e){return yl({strokeNoScale:!0},e.brushStyle)}function vU(e,t,n,r){var i=[UH(e,n),UH(t,r)],a=[WH(e,n),WH(t,r)];return[[i[0],a[0]],[i[1],a[1]]]}function yU(e){return yx(e.group)}function bU(e,t){return{left:`w`,right:`e`,top:`n`,bottom:`s`}[xx({w:`left`,e:`right`,n:`top`,s:`bottom`}[t],yU(e))]}function xU(e,t){var n=[bU(e,t[0]),bU(e,t[1])];return(n[0]===`e`||n[0]===`w`)&&n.reverse(),n.join(``)}function SU(e,t,n,r,i,a){var o=n.__brushOption,s=e.toRectRange(o.range),c=wU(t,i,a);G(r,function(e){var t=XH[e];s[t[0]][t[1]]+=c[t[0]]}),o.range=e.fromRectRange(vU(s[0][0],s[1][0],s[0][1],s[1][1])),aU(t,n),uU(t,{isEnd:!1})}function CU(e,t,n,r){var i=t.__brushOption.range,a=wU(e,n,r);G(i,function(e){e[0]+=a[0],e[1]+=a[1]}),aU(e,t),uU(e,{isEnd:!1})}function wU(e,t,n){var r=e.group,i=r.transformCoordToLocal(t,n),a=r.transformCoordToLocal(0,0);return[i[0]-a[0],i[1]-a[1]]}function TU(e,t,n){var r=cU(e,t);return r&&r!==HH?r.clipPath(n,e._transform):hl(n)}function EU(e){var t=UH(e[0][0],e[1][0]),n=UH(e[0][1],e[1][1]),r=WH(e[0][0],e[1][0]),i=WH(e[0][1],e[1][1]);return{x:t,y:n,width:r-t,height:i-n}}function DU(e,t,n){if(e._brushType&&!PU(e,t.offsetX,t.offsetY)){var r=e._zr,i=e._covers,a=sU(e,t,n);if(!e._dragging)for(var o=0;or.getWidth()||n<0||n>r.getHeight()}var FU={lineX:IU(0),lineY:IU(1),rect:{createCover:function(e,t){function n(e){return e}return pU({toRectRange:n,fromRectRange:n},e,t,[[`w`],[`e`],[`n`],[`s`],[`s`,`e`],[`s`,`w`],[`n`,`e`],[`n`,`w`]])},getCreatingRange:function(e){var t=fU(e);return vU(t[1][0],t[1][1],t[0][0],t[0][1])},updateCoverShape:function(e,t,n,r){mU(e,t,n,r)},updateCommon:hU,contain:kU},polygon:{createCover:function(e,t){var n=new Ky;return n.add(new xb({name:`main`,style:_U(t),silent:!0})),n},getCreatingRange:function(e){return e},endCreating:function(e,t){t.remove(t.childAt(0)),t.add(new yb({name:`main`,draggable:!0,drift:kl(CU,e,t),ondragend:kl(uU,e,{isEnd:!0})}))},updateCoverShape:function(e,t,n,r){t.childAt(0).setShape({points:TU(e,t,n)})},updateCommon:hU,contain:kU}};function IU(e){return{createCover:function(t,n){return pU({toRectRange:function(t){var n=[t,[0,100]];return e&&n.reverse(),n},fromRectRange:function(t){return t[e]}},t,n,[[[`w`],[`e`]],[[`n`],[`s`]]][e])},getCreatingRange:function(t){var n=fU(t);return[UH(n[0][e],n[1][e]),WH(n[0][e],n[1][e])]},updateCoverShape:function(t,n,r,i){var a,o=cU(t,n);if(o!==HH&&o.getLinearBrushOtherExtent)a=o.getLinearBrushOtherExtent(e);else{var s=t._zr;a=[0,[s.getWidth(),s.getHeight()][1-e]]}var c=[r,a];e&&c.reverse(),mU(t,n,c,i)},updateCommon:hU,contain:kU}}function LU(e){return e=BU(e),function(t){return Ex(t,e)}}function RU(e,t){return e=BU(e),function(n){var r=t??n,i=r?e.width:e.height,a=r?e.x:e.y;return[a,a+(i||0)]}}function zU(e,t,n){var r=BU(e);return function(e,i){return r.contain(i[0],i[1])&&!LV(e,t,n)}}function BU(e){return fp.create(e)}var VU=256,HU=function(){function e(){this.blurSize=30,this.pointSize=20,this.maxOpacity=1,this.minOpacity=0,this._gradientPixels={inRange:null,outOfRange:null};var e=$c.createCanvas();this.canvas=e}return e.prototype.update=function(e,t,n,r,i,a){var o=this._getBrush(),s=this._getGradient(i,`inRange`),c=this._getGradient(i,`outOfRange`),l=this.pointSize+this.blurSize,u=this.canvas,d=u.getContext(`2d`),f=e.length;u.width=t,u.height=n;for(var p=0;p0){var E=a(v)?s:c;v>0&&(v=v*w+C),b[x++]=E[T],b[x++]=E[T+1],b[x++]=E[T+2],b[x++]=E[T+3]*v*256}else x+=4}return d.putImageData(y,0,0),u},e.prototype._getBrush=function(){var e=this._brushCanvas||=$c.createCanvas(),t=this.pointSize+this.blurSize,n=t*2;e.width=n,e.height=n;var r=e.getContext(`2d`);return r.clearRect(0,0,n,n),r.shadowOffsetX=n,r.shadowBlur=this.blurSize,r.shadowColor=Q.color.neutral99,r.beginPath(),r.arc(-t,t,this.pointSize,0,Math.PI*2,!0),r.closePath(),r.fill(),e},e.prototype._getGradient=function(e,t){for(var n=this._gradientPixels,r=n[t]||(n[t]=new Uint8ClampedArray(1024)),i=[0,0,0,0],a=0,o=0;o<256;o++)e[t](o/255,!0,i),r[a++]=i[0],r[a++]=i[1],r[a++]=i[2],r[a++]=i[3];return r},e}();function UU(e,t,n){var r=e[1]-e[0];t=K(t,function(t){return{interval:[(t.interval[0]-e[0])/r,(t.interval[1]-e[0])/r]}});var i=t.length,a=0;return function(e){for(var r=a;r=0;r--){var o=t[r].interval;if(o[0]<=e&&e<=o[1]){a=r;break}}return r>=0&&r=t[0]&&e<=t[1]}}var GU=function(e){U(t,e);function t(){var n=e!==null&&e.apply(this,arguments)||this;return n.type=t.type,n}return t.prototype.render=function(e,t,n){var r;t.eachComponent(`visualMap`,function(t){t.eachTargetSeries(function(n){n===e&&(r=t)})}),this._progressiveEls=null,this.group.removeAll();var i=e.coordinateSystem;i.type===`cartesian2d`||i.type===`calendar`||i.type===`matrix`?this._renderOnGridLike(e,n,0,e.getData().count()):iB(i)&&this._renderOnGeo(i,e,r,n)},t.prototype.incrementalPrepareRender=function(e,t,n){this.group.removeAll()},t.prototype.incrementalRender=function(e,t,n,r){var i=t.coordinateSystem;i&&(iB(i)?this.render(t,n,r):(this._progressiveEls=[],this._renderOnGridLike(t,r,e.start,e.end,!0)))},t.prototype.eachRendered=function(e){Rx(this._progressiveEls||this.group,e)},t.prototype._renderOnGridLike=function(e,t,n,r,i){var a=e.coordinateSystem,o=rB(a,`cartesian2d`),s=rB(a,`matrix`),c,l,u,d;if(o){var f=a.getAxis(`x`),p=a.getAxis(`y`);c=dA(f).w+.5,l=dA(p).w+.5,u=f.scale.getExtent(),d=p.scale.getExtent()}for(var m=this.group,h=e.getData(),g=e.getModel([`emphasis`,`itemStyle`]).getItemStyle(),_=e.getModel([`blur`,`itemStyle`]).getItemStyle(),v=e.getModel([`select`,`itemStyle`]).getItemStyle(),y=e.get([`itemStyle`,`borderRadius`]),b=tS(e),x=e.getModel(`emphasis`),S=x.get(`focus`),C=x.get(`blurScope`),w=x.get(`disabled`),T=o||s?[h.mapDimension(`x`),h.mapDimension(`y`),h.mapDimension(`value`)]:[h.mapDimension(`time`),h.mapDimension(`value`)],E=n;Eu[1]||Ad[1])continue;var j=a.dataToPoint([k,A]);D=new z_({shape:{x:j[0]-c/2,y:j[1]-l/2,width:c,height:l},style:O})}else if(s){var M=a.dataToLayout([h.get(T[0],E),h.get(T[1],E)]).rect;if(zl(M.x))continue;D=new z_({z2:1,shape:M,style:O})}else{if(isNaN(h.get(T[1],E)))continue;var N=a.dataToLayout([h.get(T[0],E)]),M=N.contentRect||N.rect;if(zl(M.x)||zl(M.y))continue;D=new z_({z2:1,shape:M,style:O})}if(h.hasItemOption){var P=h.getItemModel(E),F=P.getModel(`emphasis`);g=F.getModel(`itemStyle`).getItemStyle(),_=P.getModel([`blur`,`itemStyle`]).getItemStyle(),v=P.getModel([`select`,`itemStyle`]).getItemStyle(),y=P.get([`itemStyle`,`borderRadius`]),S=F.get(`focus`),C=F.get(`blurScope`),w=F.get(`disabled`),b=tS(P)}D.shape.r=y;var I=e.getRawValue(E),L=`-`;I&&I[2]!=null&&(L=I[2]+``),eS(D,b,{labelFetcher:e,labelDataIndex:E,defaultOpacity:O.opacity,defaultText:L}),D.ensureState(`emphasis`).style=g,D.ensureState(`blur`).style=_,D.ensureState(`select`).style=v,py(D,S,C,w),D.incremental=Zd(e,i),i&&(D.states.emphasis.hoverLayer=2),m.add(D),h.setItemGraphicEl(E,D),this._progressiveEls&&this._progressiveEls.push(D)}},t.prototype._renderOnGeo=function(e,t,n,r){var i=n.targetVisuals.inRange,a=n.targetVisuals.outOfRange,o=t.getData(),s=this._hmLayer||this._hmLayer||new HU;s.blurSize=t.get(`blurSize`),s.pointSize=t.get(`pointSize`),s.minOpacity=t.get(`minOpacity`),s.maxOpacity=t.get(`maxOpacity`);var c=e.getViewRect().clone(),l=e.getRoamTransform();c.applyTransform(l);var u=Math.max(c.x,0),d=Math.max(c.y,0),f=Math.min(c.width+c.x,r.getWidth()),p=Math.min(c.height+c.y,r.getHeight()),m=f-u,h=p-d,g=[o.mapDimension(`lng`),o.mapDimension(`lat`),o.mapDimension(`value`)],_=o.mapArray(g,function(t,n,r){var i=e.dataToPoint([t,n]);return i[0]-=u,i[1]-=d,i.push(r),i}),v=n.getExtent(),y=n.type===`visualMap.continuous`?WU(v,n.option.range):UU(v,n.getPieceList(),n.option.selected);s.update(_,m,h,i.color.getNormalizer(),{inRange:i.color.getColorMapper(),outOfRange:a.color.getColorMapper()},y);var b=new j_({style:{width:m,height:h,x:u,y:d,image:s.canvas},silent:!0});this.group.add(b)},t.type=`heatmap`,t}(xP),KU=function(e){U(t,e);function t(){var n=e!==null&&e.apply(this,arguments)||this;return n.type=t.type,n}return t.prototype.getInitialData=function(e,t){return IR(null,this,{generateCoord:`value`})},t.prototype.preventIncremental=function(){var e=tw.get(this.get(`coordinateSystem`));if(e&&e.dimensions)return e.dimensions[0]===`lng`&&e.dimensions[1]===`lat`},t.type=`series.heatmap`,t.dependencies=[`grid`,`geo`,`calendar`,`matrix`],t.defaultOption={coordinateSystem:`cartesian2d`,z:2,geoIndex:0,blurSize:30,pointSize:20,maxOpacity:1,minOpacity:0,select:{itemStyle:{borderColor:Q.color.primary}}},t}(wE);function qU(e){e.registerChartView(GU),e.registerSeriesModel(KU)}var JU={color:`fill`,borderColor:`stroke`},YU={symbol:1,symbolSize:1,symbolKeepAspect:1,legendIcon:1,visualMeta:1,liftZ:1,decal:1},XU=Td(),ZU=function(e){U(t,e);function t(){var n=e!==null&&e.apply(this,arguments)||this;return n.type=t.type,n}return t.prototype.optionUpdated=function(){this.currentZLevel=this.get(`zlevel`,!0),this.currentZ=this.get(`z`,!0)},t.prototype.getInitialData=function(e,t){return IR(null,this)},t.prototype.getDataParams=function(t,n,r){var i=e.prototype.getDataParams.call(this,t,n);return r&&(i.info=XU(r).info),i},t.type=`series.custom`,t.dependencies=[`grid`,`polar`,`geo`,`singleAxis`,`calendar`,`matrix`],t.defaultOption={coordinateSystem:`cartesian2d`,z:2,legendHoverLink:!0,clip:!1},t}(wE);function QU(e,t){return t||=[0,0],K([`x`,`y`],function(n,r){var i=this.getAxis(n),a=t[r],o=e[r]/2;return i.type===`category`?dA(i).w:Math.abs(i.dataToCoord(a-o)-i.dataToCoord(a+o))},this)}function $U(e){var t=e.master.getRect();return{coordSys:{type:`cartesian2d`,x:t.x,y:t.y,width:t.width,height:t.height},api:{coord:function(t){return e.dataToPoint(t)},size:q(QU,e)}}}function eW(e,t){return t||=[0,0],K([0,1],function(n){var r=t[n],i=e[n]/2,a=[],o=[];return a[n]=r-i,o[n]=r+i,a[1-n]=o[1-n]=t[1-n],Math.abs(this.dataToPoint(a)[n]-this.dataToPoint(o)[n])},this)}function tW(e){var t=e.view,n=t.getBoundingRect();return{coordSys:{type:`geo`,x:n.x,y:n.y,width:n.width,height:n.height,zoom:tH(t)},api:{coord:function(t){return e.dataToPoint(t)},size:q(eW,e)}}}function nW(e,t){var n=this.getAxis(),r=t instanceof Array?t[0]:t,i=(e instanceof Array?e[0]:e)/2;return n.type===`category`?dA(n).w:Math.abs(n.dataToCoord(r-i)-n.dataToCoord(r+i))}function rW(e){var t=e.getRect();return{coordSys:{type:`singleAxis`,x:t.x,y:t.y,width:t.width,height:t.height},api:{coord:function(t){return e.dataToPoint(t)},size:q(nW,e)}}}function iW(e,t){return t||=[0,0],K([`Radius`,`Angle`],function(n,r){var i=`get`+n+`Axis`,a=this[i](),o=t[r],s=e[r]/2,c=a.type===`category`?dA(a).w:Math.abs(a.dataToCoord(o-s)-a.dataToCoord(o+s));return n===`Angle`&&(c=c*Math.PI/180),c},this)}function aW(e){var t=e.getRadiusAxis(),n=e.getAngleAxis(),r=t.getExtent();return r[0]>r[1]&&r.reverse(),{coordSys:{type:`polar`,cx:e.cx,cy:e.cy,r:r[1],r0:r[0]},api:{coord:function(r){var i=t.dataToRadius(r[0]),a=n.dataToAngle(r[1]),o=e.coordToPoint([i,a]);return o.push(i,a*Math.PI/180),o},size:q(iW,e)}}}function oW(e){var t=e.getRect(),n=e.getRangeInfo();return{coordSys:{type:`calendar`,x:t.x,y:t.y,width:t.width,height:t.height,cellWidth:e.getCellWidth(),cellHeight:e.getCellHeight(),rangeInfo:{start:n.start,end:n.end,weeks:n.weeks,dayCount:n.allDay}},api:{coord:function(t,n){return e.dataToPoint(t,n)},layout:function(t,n){return e.dataToLayout(t,n)}}}}function sW(e){var t=e.getRect();return{coordSys:{type:`matrix`,x:t.x,y:t.y,width:t.width,height:t.height},api:{coord:function(t,n){return e.dataToPoint(t,n)},layout:function(t,n){return e.dataToLayout(t,n)}}}}var cW={position:[`x`,`y`],scale:[`scaleX`,`scaleY`],origin:[`originX`,`originY`]},lW=Dl(cW);wl(gm,function(e,t){return e[t]=1,e},{}),gm.join(`, `);var uW=[``,`style`,`shape`,`extra`],dW=Td();function fW(e,t,n,r,i){var a=e+`Animation`,o=qb(e,r,i)||{},s=dW(t).userDuring;return o.duration>0&&(o.during=s?q(SW,{el:t,userDuring:s}):null,o.setToFinal=!0,o.scope=e),W(o,n[a]),o}function pW(e,t,n,r){r||={};var i=r.dataIndex,a=r.isInit,o=r.clearStyle,s=n.isAnimationEnabled(),c=dW(e),l=t.style;c.userDuring=t.during;var u={},d={};if(EW(e,t,d),e.type===`compound`)for(var f=e.shape.paths,p=t.shape.paths,m=0;m0&&e.animateFrom(g,_)}else vW(e,t,i||0,n,u)}mW(e,t),l?e.dirty():e.markRedraw()}function mW(e,t){for(var n=dW(e).leaveToProps,r=0;r0&&e.animateFrom(i,a)}}function yW(e,t){Z(t,`silent`)&&(e.silent=t.silent),Z(t,`ignore`)&&(e.ignore=t.ignore),e instanceof vg&&Z(t,`invisible`)&&(e.invisible=t.invisible),e instanceof T_&&Z(t,`autoBatch`)&&(e.autoBatch=t.autoBatch)}var bW={},xW={setTransform:function(e,t){return bW.el[e]=t,this},getTransform:function(e){return bW.el[e]},setShape:function(e,t){var n=bW.el,r=n.shape||={};return r[e]=t,n.dirtyShape&&n.dirtyShape(),this},getShape:function(e){var t=bW.el.shape;if(t)return t[e]},setStyle:function(e,t){var n=bW.el,r=n.style;return r&&(r[e]=t,n.dirtyStyle&&n.dirtyStyle()),this},getStyle:function(e){var t=bW.el.style;if(t)return t[e]},setExtra:function(e,t){var n=bW.el.extra||(bW.el.extra={});return n[e]=t,this},getExtra:function(e){var t=bW.el.extra;if(t)return t[e]}};function SW(){var e=this,t=e.el;if(t){var n=dW(t).userDuring,r=e.userDuring;if(n!==r){e.el=e.userDuring=null;return}bW.el=t,r(xW)}}function CW(e,t,n,r){var i=n[e];if(i){var a=t[e],o;if(a){var s=n.transition,c=i.transition;if(c){if(!o&&(o=r[e]={}),gW(c))W(o,a);else for(var l=rd(c),u=0;u=0){!o&&(o=r[e]={});for(var p=Dl(a),u=0;u=0)){var f=e.getAnimationStyleProps(),p=f?f.style:null;if(p){!a&&(a=r.style={});for(var m=Dl(n),l=0;l=0?t.getStore().get(i,n):void 0}var a=t.get(r.name,n),o=r&&r.ordinalMeta;return o?o.categories[a]:a}function C(n,r){r??=u;var i=t.getItemVisual(r,`style`),a=i&&i.fill,o=i&&i.opacity,s=y(r,PW).getItemStyle();a!=null&&(s.fill=a),o!=null&&(s.opacity=o);var c={inheritColor:Y(a)?a:Q.color.neutral99},l=b(r,PW),d=nS(l,null,c,!1,!0);d.text=l.getShallow(`show`)?X(e.getFormattedLabel(r,PW),BR(t,r)):null;var f=rS(l,c,!1);return E(n,s),s=cB(s,d,f),n&&T(s,n),s.legacy=!0,s}function w(n,r){r??=u;var i=y(r,NW).getItemStyle(),a=b(r,NW),o=nS(a,null,null,!0,!0);o.text=a.getShallow(`show`)?Vl(e.getFormattedLabel(r,NW),e.getFormattedLabel(r,PW),BR(t,r)):null;var s=rS(a,null,!0);return E(n,i),i=cB(i,o,s),n&&T(i,n),i.legacy=!0,i}function T(e,t){for(var n in t)Z(t,n)&&(e[n]=t[n])}function E(e,t){e&&(e.textFill&&(t.textFill=e.textFill),e.textPosition&&(t.textPosition=e.textPosition))}function D(e,n){if(n??=u,Z(JU,e)){var r=t.getItemVisual(n,`style`);return r?r[JU[e]]:null}if(Z(YU,e))return t.getItemVisual(n,e)}function O(e){if(o.type===`cartesian2d`)return HB(yl({axis:o.getBaseAxis()},e))}function k(){return n.getCurrentSeriesIndices()}function A(e){return uS(e,n)}}function eG(e){var t={};return G(e.dimensions,function(n){var r=e.getDimensionInfo(n);if(!r.isExtraCoord){var i=r.coordDim,a=t[i]=t[i]||[];a[r.coordDimIndex]=e.getDimensionIndex(n)}}),t}function tG(e,t,n,r,i,a,o){if(!r){a.remove(t);return}var s=nG(e,t,n,r,i,a);return s&&o.setItemGraphicEl(n,s),s&&py(s,r.focus,r.blurScope,r.emphasisDisabled),s}function nG(e,t,n,r,i,a){var o=-1,s=t;t&&rG(t,r,i)&&(o=bl(a.childrenRef(),t),t=null);var c=!t,l=t;l?l.clearStates():(l=JW(r),s&&KW(s,l)),r.morph===!1?l.disableMorphing=!0:l.disableMorphing&&(l.disableMorphing=!1),r.tooltipDisabled&&(l.tooltipDisabled=!0),HW.normal.cfg=HW.normal.conOpt=HW.emphasis.cfg=HW.emphasis.conOpt=HW.blur.cfg=HW.blur.conOpt=HW.select.cfg=HW.select.conOpt=null,HW.isLegacy=!1,aG(l,n,r,i,c,HW),iG(l,n,r,i,c),YW(e,l,n,r,HW,i,c),Z(r,`info`)&&(XU(l).info=r.info);for(var u=0;u=0?a.replaceAt(l,o):a.add(l),l}function rG(e,t,n){var r=XU(e),i=t.type,a=t.shape,o=t.style;return n.isUniversalTransitionEnabled()||i!=null&&i!==r.customGraphicType||i===`path`&&gG(a)&&hG(a)!==r.customPathData||i===`image`&&Z(o,`image`)&&o.image!==r.customImagePath}function iG(e,t,n,r,i){var a=n.clipPath;if(a===!1)e&&e.getClipPath()&&e.removeClipPath();else if(a){var o=e.getClipPath();o&&rG(o,a,r)&&(o=null),o||(o=JW(a),e.setClipPath(o)),YW(null,o,t,a,null,r,i)}}function aG(e,t,n,r,i,a){if(!(e.isGroup||e.type===`compoundPath`)){oG(n,null,a),oG(n,NW,a);var o=a.normal.conOpt,s=a.emphasis.conOpt,c=a.blur.conOpt,l=a.select.conOpt;if(o!=null||s!=null||l!=null||c!=null){var u=e.getTextContent();if(o===!1)u&&e.removeTextContent();else{o=a.normal.conOpt=o||{type:`text`},u?u.clearStates():(u=JW(o),e.setTextContent(u)),YW(null,u,t,o,null,r,i);for(var d=o&&o.style,f=0;f=u;p--)uG(t,t.childAt(p),i)}}function uG(e,t,n){t&&hW(t,XU(e).option,n)}function dG(e){new FE(e.oldChildren,e.newChildren,fG,fG,e).add(pG).update(pG).remove(mG).execute()}function fG(e,t){return(e&&e.name)??VW+t}function pG(e,t){var n=this.context,r=e==null?null:n.newChildren[e],i=t==null?null:n.oldChildren[t];nG(n.api,i,n.dataIndex,r,n.seriesModel,n.group)}function mG(e){var t=this.context,n=t.oldChildren[e];n&&hW(n,XU(n).option,t.seriesModel)}function hG(e){return e&&(e.pathData||e.d)}function gG(e){return e&&(Z(e,`pathData`)||Z(e,`d`))}function _G(e){e.registerChartView(qW),e.registerSeriesModel(ZU)}var vG=Td(),yG=hl,bG=q,xG=function(){function e(){this._dragging=!1,this.animationThreshold=15}return e.prototype.render=function(e,t,n,r){var i=t.get(`value`),a=t.get(`status`);if(this._axisModel=e,this._axisPointerModel=t,this._api=n,r||this._lastValue!==i||this._lastStatus!==a){this._lastValue=i,this._lastStatus=a;var o=this._group,s=this._handle;if(!a||a===`hide`){o&&o.hide(),s&&s.hide();return}o&&o.show(),s&&s.show();var c={};this.makeElOption(c,i,e,t,n);var l=c.graphicKey;l!==this._lastGraphicKey&&this.clear(n),this._lastGraphicKey=l;var u=this._moveAnimation=this.determineAnimation(e,t);if(!o)o=this._group=new Ky,this.createPointerEl(o,c,e,t),this.createLabelEl(o,c,e,t),n.getZr().add(o);else{var d=kl(SG,t,u);this.updatePointerEl(o,c,d),this.updateLabelEl(o,c,d,t)}EG(o,t,!0),this._renderHandle(i)}},e.prototype.remove=function(e){this.clear(e)},e.prototype.dispose=function(e){this.clear(e)},e.prototype.determineAnimation=function(e,t){var n=t.get(`animation`),r=e.axis,i=r.type===`category`,a=t.get(`snap`);if(!a&&!i)return!1;if(n===`auto`||n==null){var o=this.animationThreshold;if(i&&dA(r).w>o)return!0;if(a){var s=Tz(e).seriesDataCount,c=r.getExtent();return Math.abs(c[0]-c[1])/s>o}return!1}return n===!0},e.prototype.makeElOption=function(e,t,n,r,i){},e.prototype.createPointerEl=function(e,t,n,r){var i=t.pointer;if(i){var a=vG(e).pointerEl=new nx[i.type](yG(t.pointer));e.add(a)}},e.prototype.createLabelEl=function(e,t,n,r){if(t.label){var i=vG(e).labelEl=new W_(yG(t.label));e.add(i),wG(i,r)}},e.prototype.updatePointerEl=function(e,t,n){var r=vG(e).pointerEl;r&&t.pointer&&(r.setStyle(t.pointer.style),n(r,{shape:t.pointer.shape}))},e.prototype.updateLabelEl=function(e,t,n,r){var i=vG(e).labelEl;i&&(i.setStyle(t.label.style),n(i,{x:t.label.x,y:t.label.y}),wG(i,r))},e.prototype._renderHandle=function(e){if(!this._dragging&&this.updateHandleTransform){var t=this._axisPointerModel,n=this._api.getZr(),r=this._handle,i=t.getModel(`handle`),a=t.get(`status`);if(!i.get(`show`)||!a||a===`hide`){r&&n.remove(r),this._handle=null;return}var o;this._handle||(o=!0,r=this._handle=Ox(i.get(`icon`),{cursor:`move`,draggable:!0,onmousemove:function(e){pM(e.event)},onmousedown:bG(this._onHandleDragMove,this,0,0),drift:bG(this._onHandleDragMove,this),ondragend:bG(this._onHandleDragEnd,this)}),n.add(r)),EG(r,t,!1),r.setStyle(i.getItemStyle(null,[`color`,`borderColor`,`borderWidth`,`opacity`,`shadowColor`,`shadowBlur`,`shadowOffsetX`,`shadowOffsetY`]));var s=i.get(`size`);J(s)||(s=[s,s]),r.scaleX=s[0]/2,r.scaleY=s[1]/2,jP(this,`_doDispatchAxisPointer`,i.get(`throttle`)||0,`fixRate`),this._moveHandleToValue(e,o)}},e.prototype._moveHandleToValue=function(e,t){SG(this._axisPointerModel,!t&&this._moveAnimation,this._handle,TG(this.getHandleTransform(e,this._axisModel,this._axisPointerModel)))},e.prototype._onHandleDragMove=function(e,t){var n=this._handle;if(n){this._dragging=!0;var r=this.updateHandleTransform(TG(n),[e,t],this._axisModel,this._axisPointerModel);this._payloadInfo=r,n.stopAnimation(),n.attr(TG(r)),vG(n).lastProp=null,this._doDispatchAxisPointer()}},e.prototype._doDispatchAxisPointer=function(){if(this._handle){var e=this._payloadInfo,t=this._axisModel;this._api.dispatchAction({type:`updateAxisPointer`,x:e.cursorPoint[0],y:e.cursorPoint[1],tooltipOption:e.tooltipOption,axesInfo:[{axisDim:t.axis.dim,axisIndex:t.componentIndex}]})}},e.prototype._onHandleDragEnd=function(){if(this._dragging=!1,this._handle){var e=this._axisPointerModel.get(`value`);this._moveHandleToValue(e),this._api.dispatchAction({type:`hideTip`})}},e.prototype.clear=function(e){this._lastValue=null,this._lastStatus=null;var t=e.getZr(),n=this._group,r=this._handle;t&&n&&(this._lastGraphicKey=null,n&&t.remove(n),r&&t.remove(r),this._group=null,this._handle=null,this._payloadInfo=null),MP(this,`_doDispatchAxisPointer`)},e.prototype.doClear=function(){},e.prototype.buildLabel=function(e,t,n){return n||=0,{x:e[n],y:e[1-n],width:t[n],height:t[1-n]}},e}();function SG(e,t,n,r){CG(vG(n).lastProp,r)||(vG(n).lastProp=r,t?Yb(n,r,e):(n.stopAnimation(),n.attr(r)))}function CG(e,t){if(Nl(e)&&Nl(t)){var n=!0;return G(t,function(t,r){n&&=CG(e[r],t)}),!!n}return e===t}function wG(e,t){e[t.get([`label`,`show`])?`show`:`hide`]()}function TG(e){return{x:e.x||0,y:e.y||0,rotation:e.rotation||0}}function EG(e,t,n){var r=t.get(`z`),i=t.get(`zlevel`);e&&e.traverse(function(e){e.type!==`group`&&(r!=null&&(e.z=r),i!=null&&(e.zlevel=i),e.silent=n)})}function DG(e){var t=e.get(`type`),n=e.getModel(t+`Style`),r;return t===`line`?(r=n.getLineStyle(),r.fill=null):t===`shadow`&&(r=n.getAreaStyle(),r.stroke=null),r}function OG(e,t,n,r,i){var a=AG(n.get(`value`),t.axis,t.ecModel,n.get(`seriesDataIndices`),{precision:n.get([`label`,`precision`]),formatter:n.get([`label`,`formatter`])}),o=n.getModel(`label`),s=KC(o.get(`padding`)||0),c=o.getFont(),l=Mp(a,c),u=i.position,d=l.width+s[1]+s[3],f=l.height+s[0]+s[2],p=i.align;p===`right`&&(u[0]-=d),p===`center`&&(u[0]-=d/2);var m=i.verticalAlign;m===`bottom`&&(u[1]-=f),m===`middle`&&(u[1]-=f/2),kG(u,d,f,r);var h=o.get(`backgroundColor`);(!h||h===`auto`)&&(h=t.get([`axisLine`,`lineStyle`,`color`])),e.label={x:u[0],y:u[1],style:nS(o,{text:a,font:c,fill:o.getTextColor(),padding:s,backgroundColor:h}),z2:10}}function kG(e,t,n,r){var i=r.getWidth(),a=r.getHeight();e[0]=Math.min(e[0]+t,i)-t,e[1]=Math.min(e[1]+n,a)-n,e[0]=Math.max(e[0],0),e[1]=Math.max(e[1],0)}function AG(e,t,n,r,i){e=t.scale.parse(e);var a=t.scale.getLabel({value:e},{precision:i.precision}),o=i.formatter;if(o){var s={value:QO(t,{value:e}),axisDimension:t.dim,axisIndex:t.index,seriesData:[]};G(r,function(e){var t=n.getSeriesByIndex(e.seriesIndex),r=e.dataIndexInside,i=t&&t.getDataParams(r);i&&s.seriesData.push(i)}),Y(o)?a=o.replace(`{value}`,a):Al(o)&&(a=o(s))}return a}function jG(e,t,n){var r=Ef();return jf(r,r,n.rotation),Af(r,r,n.position),bx([e.dataToCoord(t),(n.labelOffset||0)+(n.labelDirection||1)*(n.labelMargin||0)],r)}function MG(e,t,n,r,i,a){var o=BA.innerTextLayout(n.rotation,0,n.labelDirection);n.labelMargin=i.get([`label`,`margin`]),OG(t,r,i,a,{position:jG(r.axis,e,n),align:o.textAlign,verticalAlign:o.textVerticalAlign})}function NG(e,t,n){return n||=0,{x1:e[n],y1:e[1-n],x2:t[n],y2:t[1-n]}}function PG(e,t,n){return n||=0,{x:e[n],y:e[1-n],width:t[n],height:t[1-n]}}function FG(e,t,n){return dA(e,{fromStat:{sers:K(t,function(e){return n.getSeriesByIndex(e.seriesIndex)})},min:1}).w}function IG(e,t,n){return[fu(du(t[0],t[1]),e-n/2),du(e+n/2,fu(t[0],t[1]))]}var LG=function(e){U(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}return t.prototype.makeElOption=function(e,t,n,r,i){var a=n.axis,o=a.grid,s=r.get(`type`),c=a.getGlobalExtent(),l=RG(o,a).getOtherAxis(a).getGlobalExtent(),u=a.toGlobalCoord(a.dataToCoord(t,!0));if(s&&s!==`none`){var d=DG(r),f=zG[s](a,u,c,l,r.get(`seriesDataIndices`),r.ecModel);f.style=d,e.graphicKey=f.type,e.pointer=f}MG(t,e,sj(o.getRect(),n),n,r,i)},t.prototype.getHandleTransform=function(e,t,n){var r=sj(t.axis.grid.getRect(),t,{labelInside:!1});r.labelMargin=n.get([`handle`,`margin`]);var i=jG(t.axis,e,r);return{x:i[0],y:i[1],rotation:r.rotation+(r.labelDirection<0?Math.PI:0)}},t.prototype.updateHandleTransform=function(e,t,n,r){var i=n.axis,a=i.grid,o=i.getGlobalExtent(!0),s=RG(a,i).getOtherAxis(i).getGlobalExtent(),c=i.dim===`x`?0:1,l=[e.x,e.y];l[c]+=t[c],l[c]=du(o[1],l[c]),l[c]=fu(o[0],l[c]);var u=(s[1]+s[0])/2,d=[u,u];return d[c]=l[c],{x:l[0],y:l[1],rotation:e.rotation,cursorPoint:d,tooltipOption:[{verticalAlign:`middle`},{align:`center`}][c]}},t}(xG);function RG(e,t){var n={};return n[t.dim+`AxisIndex`]=t.index,e.getCartesian(n)}var zG={line:function(e,t,n,r){return{type:`Line`,subPixelOptimize:!0,shape:NG([t,r[0]],[t,r[1]],BG(e))}},shadow:function(e,t,n,r,i,a){var o=FG(e,i,a),s=r[1]-r[0],c=IG(t,n,o),l=c[0],u=c[1];return{type:`Rect`,shape:PG([l,r[0]],[u-l,s],BG(e))}}};function BG(e){return e.dim===`x`?0:1}var VG=function(e){U(t,e);function t(){var n=e!==null&&e.apply(this,arguments)||this;return n.type=t.type,n}return t.type=`axisPointer`,t.defaultOption={show:`auto`,z:50,type:`line`,snap:!1,triggerTooltip:!0,triggerEmphasis:!0,value:null,status:null,link:[],animation:null,animationDurationUpdate:200,lineStyle:{color:Q.color.border,width:1,type:`dashed`},shadowStyle:{color:Q.color.shadowTint},label:{show:!0,formatter:null,precision:`auto`,margin:3,color:Q.color.neutral00,padding:[5,7,5,7],backgroundColor:Q.color.accent60,borderColor:null,borderWidth:0,borderRadius:3},handle:{show:!1,icon:`M10.7,11.9v-1.3H9.3v1.3c-4.9,0.3-8.8,4.4-8.8,9.4c0,5,3.9,9.1,8.8,9.4h1.3c4.9-0.3,8.8-4.4,8.8-9.4C19.5,16.3,15.6,12.2,10.7,11.9z M13.3,24.4H6.7v-1.2h6.6z M13.3,22H6.7v-1.2h6.6z M13.3,19.6H6.7v-1.2h6.6z`,size:45,margin:50,color:Q.color.accent40,throttle:40}},t}(Sw),HG=Td(),UG=G;function WG(e,t,n){if(!ou.node){var r=t.getZr();HG(r).records||(HG(r).records={}),GG(r,t);var i=HG(r).records[e]||(HG(r).records[e]={});i.handler=n}}function GG(e,t){if(HG(e).initialized)return;HG(e).initialized=!0,n(`click`,kl(JG,`click`)),n(`mousemove`,kl(JG,`mousemove`)),n(`mousewheel`,kl(JG,`mousewheel`)),n(`globalout`,qG);function n(n,r){e.on(n,function(n){var i=YG(t);UG(HG(e).records,function(e){e&&r(e,n,i.dispatchAction)}),KG(i.pendings,t)})}}function KG(e,t){var n=e.showTip.length,r=e.hideTip.length,i;n?i=e.showTip[n-1]:r&&(i=e.hideTip[r-1]),i&&(i.dispatchAction=null,t.dispatchAction(i))}function qG(e,t,n){e.handler(`leave`,null,n)}function JG(e,t,n,r){t.handler(e,n,r)}function YG(e){var t={showTip:[],hideTip:[]},n=function(r){var i=t[r.type];i?i.push(r):(r.dispatchAction=n,e.dispatchAction(r))};return{dispatchAction:n,pendings:t}}function XG(e,t){if(!ou.node){var n=t.getZr();(HG(n).records||{})[e]&&(HG(n).records[e]=null)}}var ZG=function(e){U(t,e);function t(){var n=e!==null&&e.apply(this,arguments)||this;return n.type=t.type,n}return t.prototype.render=function(e,t,n){var r=t.getComponent(`tooltip`),i=e.get(`triggerOn`)||r&&r.get(`triggerOn`)||`mousemove|click|mousewheel`;WG(`axisPointer`,n,function(e,t,n){i!==`none`&&(e===`leave`||i.indexOf(e)>=0)&&n({type:`updateAxisPointer`,currTrigger:e,x:t&&t.offsetX,y:t&&t.offsetY})})},t.prototype.remove=function(e,t){XG(`axisPointer`,t)},t.prototype.dispose=function(e,t){XG(`axisPointer`,t)},t.type=`axisPointer`,t}(_P);function QG(e,t){var n=[],r=e.seriesIndex,i;if(r==null||!(i=t.getSeriesByIndex(r)))return{point:[]};var a=i.getData(),o=wd(a,e);if(o==null||o<0||J(o))return{point:[]};var s=a.getItemGraphicEl(o),c=i.coordinateSystem;if(i.getTooltipPosition)n=i.getTooltipPosition(o)||[];else if(c&&c.dataToPoint){if(e.isStacked){var l=c.getBaseAxis(),u=c.getOtherAxis(l).dim,d=l.dim,f=+(u===`x`||u===`radius`),p=a.mapDimension(d),m=[];m[f]=a.get(p,o),m[1-f]=a.get(a.getCalculationInfo(`stackResultDimension`),o),n=c.dataToPoint(m)||[]}else n=c.dataToPoint(a.getValues(K(c.dimensions,function(e){return a.mapDimension(e)}),o))||[]}else if(s){var h=s.getBoundingRect().clone();h.applyTransform(s.transform),n=[h.x+h.width/2,h.y+h.height/2]}return{point:n,el:s}}var $G=Td();function eK(e,t,n){var r=e.currTrigger,i=[e.x,e.y],a=e,o=e.dispatchAction||q(n.dispatchAction,n),s=t.getComponent(`axisPointer`).coordSysAxesInfo;if(s){uK(i)&&(i=QG({seriesIndex:a.seriesIndex,dataIndex:a.dataIndex},t).point);var c=uK(i),l=a.axesInfo,u=s.axesInfo,d=r===`leave`||uK(i),f={},p={},m={list:[],map:{}},h={showPointer:kl(rK,p),showTooltip:kl(iK,m)};G(s.coordSysMap,function(e,t){var n=c||e.containPoint(i);G(s.coordSysAxesInfo[t],function(e,t){var r=e.axis,a=cK(l,e);if(!d&&n&&(!l||a)){var o=a&&a.value;o==null&&!c&&(o=r.pointToData(i)),o!=null&&tK(e,o,h,!1,f)}})});var g={};return G(u,function(e,t){var n=e.linkGroup;n&&!p[t]&&G(n.axesInfo,function(t,r){var i=p[r];if(t!==e&&i){var a=i.value;n.mapper&&(a=e.axis.scale.parse(n.mapper(a,lK(t),lK(e)))),g[e.key]=a}})}),G(g,function(e,t){tK(u[t],e,h,!0,f)}),aK(p,u,f),oK(m,i,e,o),sK(u,o,n),f}}function tK(e,t,n,r,i){var a=e.axis;if(!a.scale.isBlank()&&a.containData(t)){if(!e.involveSeries){n.showPointer(e,t);return}var o=nK(t,e),s=o.payloadBatch,c=o.snapToValue;s[0]&&i.seriesIndex==null&&W(i,s[0]),!r&&e.snap&&a.containData(c)&&c!=null&&(t=c),n.showPointer(e,t,s),n.showTooltip(e,o,c)}}function nK(e,t){var n=t.axis,r=n.dim,i=e,a=[],o=Number.MAX_VALUE,s=-1;return G(t.seriesModels,function(t,c){var l=t.getData().mapDimensionsAll(r),u,d;if(t.getAxisTooltipData){var f=t.getAxisTooltipData(l,e,n);d=f.dataIndices,u=f.nestestValue}else{if(d=t.indicesOfNearest(r,l[0],e,n.type===`category`?.5:null),!d.length)return;u=t.getData().get(l[0],d[0])}if(qu(u)){var p=e-u,m=Math.abs(p);m<=o&&((m=0&&s<0)&&(o=m,s=p,i=u,a.length=0),G(d,function(e){a.push({seriesIndex:t.seriesIndex,dataIndexInside:e,dataIndex:t.getData().getRawIndex(e)})}))}}),{payloadBatch:a,snapToValue:i}}function rK(e,t,n,r){e[t.key]={value:n,payloadBatch:r}}function iK(e,t,n,r){var i=n.payloadBatch,a=t.axis,o=a.model,s=t.axisPointerModel;if(t.triggerTooltip&&i.length){var c=t.coordSys.model,l=Oz(c),u=e.map[l];u||(u=e.map[l]={coordSysId:c.id,coordSysIndex:c.componentIndex,coordSysType:c.type,coordSysMainType:c.mainType,dataByAxis:[]},e.list.push(u)),u.dataByAxis.push({axisDim:a.dim,axisIndex:o.componentIndex,axisType:o.type,axisId:o.id,value:r,valueLabelOpt:{precision:s.get([`label`,`precision`]),formatter:s.get([`label`,`formatter`])},seriesDataIndices:i.slice()})}}function aK(e,t,n){var r=n.axesInfo=[];G(t,function(t,n){var i=t.axisPointerModel.option,a=e[n];a?(!t.useHandle&&(i.status=`show`),i.value=a.value,i.seriesDataIndices=(a.payloadBatch||[]).slice()):!t.useHandle&&(i.status=`hide`),i.status===`show`&&r.push({axisDim:t.axis.dim,axisIndex:t.axis.model.componentIndex,value:i.value})})}function oK(e,t,n,r){if(uK(t)||!e.list.length){r({type:`hideTip`});return}var i=((e.list[0].dataByAxis[0]||{}).seriesDataIndices||[])[0]||{};r({type:`showTip`,escapeConnect:!0,x:t[0],y:t[1],tooltipOption:n.tooltipOption,position:n.position,dataIndexInside:i.dataIndexInside,dataIndex:i.dataIndex,seriesIndex:i.seriesIndex,dataByCoordSys:e.list})}function sK(e,t,n){var r=n.getZr(),i=`axisPointerLastHighlights`,a=$G(r)[i]||{},o=$G(r)[i]={};G(e,function(e,t){var n=e.axisPointerModel.option;n.status===`show`&&e.triggerEmphasis&&G(n.seriesDataIndices,function(e){o[e.seriesIndex+`|`+e.dataIndex]=e})});var s=[],c=[];function l(e){return{seriesIndex:e.seriesIndex,dataIndex:e.dataIndex}}G(a,function(e,t){!o[t]&&c.push(l(e))}),G(o,function(e,t){!a[t]&&s.push(l(e))}),c.length&&n.dispatchAction({type:`downplay`,escapeConnect:!0,notBlur:!0,batch:c}),s.length&&n.dispatchAction({type:`highlight`,escapeConnect:!0,notBlur:!0,batch:s})}function cK(e,t){for(var n=0;n<(e||[]).length;n++){var r=e[n];if(t.axis.dim===r.axisDim&&t.axis.model.componentIndex===r.axisIndex)return r}}function lK(e){var t=e.axis.model,n={},r=n.axisDim=e.axis.dim;return n.axisIndex=n[r+`AxisIndex`]=t.componentIndex,n.axisName=n[r+`AxisName`]=t.name,n.axisId=n[r+`AxisId`]=t.id,n}function uK(e){return!e||e[0]==null||isNaN(e[0])||e[1]==null||isNaN(e[1])}function dK(e){Az.registerAxisPointerClass(`CartesianAxisPointer`,LG),e.registerComponentModel(VG),e.registerComponentView(ZG),e.registerPreprocessor(function(e){if(e){(!e.axisPointer||e.axisPointer.length===0)&&(e.axisPointer={});var t=e.axisPointer.link;t&&!J(t)&&(e.axisPointer.link=[t])}}),e.registerProcessor(e.PRIORITY.PROCESSOR.STATISTIC,{overallReset:function(e,t){e.getComponent(`axisPointer`).coordSysAxesInfo=vz(e,t)}}),e.registerAction({type:`updateAxisPointer`,event:`updateAxisPointer`,update:`:updateAxisPointer`},eK)}function fK(e){aR(Vz),aR(dK)}function pK(e,t){var n=e.existing;if(t.id=e.keyInfo.id,!t.type&&n&&(t.type=n.type),t.parentId==null){var r=t.parentOption;r?t.parentId=r.id:n&&(t.parentId=n.parentId)}t.parentOption=null}function mK(e,t){var n;return G(t,function(t){e[t]!=null&&e[t]!==`auto`&&(n=!0)}),n}function hK(e,t,n){var r=W({},n),i=e[t],a=n.$action||`merge`;a===`merge`?i?(gl(i,r,!0),vw(i,r,{ignoreSize:!0}),bw(n,i),vK(n,i),vK(n,i,`shape`),vK(n,i,`style`),vK(n,i,`extra`),n.clipPath=i.clipPath):e[t]=r:a===`replace`?e[t]=r:a===`remove`&&i&&(e[t]=null)}var gK=[`transition`,`enterFrom`,`leaveTo`],_K=gK.concat([`enterAnimation`,`updateAnimation`,`leaveAnimation`]);function vK(e,t,n){if(n&&(!e[n]&&t[n]&&(e[n]={}),e=e[n],t=t[n]),e&&t)for(var r=n?gK:_K,i=0;i=0;c--){var l=n[c],u=_d(l.id,null),d=u==null?null:i.get(u);if(d){var f=d.parent,h=SK(f),g=f===r?{width:a,height:o}:{width:h.width,height:h.height},_={},v=gw(d,l,g,null,{hv:l.hv,boundingMode:l.bounding},_);if(!SK(d).isNew&&v){for(var y=l.transition,b={},x=0;x=0)?b[S]=C:d[S]=C}Yb(d,b,e,0)}else d.attr(_)}}},t.prototype._clear=function(){var e=this,t=this._elMap;t.each(function(n){EK(n,SK(n).option,t,e._lastGraphicModel)}),this._elMap=$l()},t.prototype.dispose=function(){this._clear()},t.type=`graphic`,t}(_P);function wK(e){var t=new(Z(xK,e)?xK[e]:ux(e))({});return SK(t).type=e,t}function TK(e,t,n,r){var i=wK(n);return t.add(i),r.set(e,i),SK(i).id=e,SK(i).isNew=!0,i}function EK(e,t,n,r){e&&e.parent&&(e.type===`group`&&e.traverse(function(e){EK(e,t,n,r)}),hW(e,t,r),n.removeKey(SK(e).id))}function DK(e,t,n,r){e.isGroup||G([[`cursor`,vg.prototype.cursor],[`zlevel`,r||0],[`z`,n||0],[`z2`,0]],function(n){var r=n[0];Z(t,r)?e[r]=X(t[r],n[1]):e[r]??(e[r]=n[1])}),G(Dl(t),function(n){if(n.indexOf(`on`)===0){var r=t[n];e[n]=Al(r)?r:null}}),Z(t,`draggable`)&&(e.draggable=t.draggable),t.name!=null&&(e.name=t.name),t.id!=null&&(e.id=t.id)}function OK(e){return e=W({},e),G([`id`,`parentId`,`$action`,`hv`,`bounding`,`textContent`,`clipPath`].concat(cw),function(t){delete e[t]}),e}function kK(e,t,n){var r=iv(e).eventData;!e.silent&&!e.ignore&&!r&&(r=iv(e).eventData={componentType:`graphic`,componentIndex:t.componentIndex,name:e.name}),r&&(r.info=n.info)}function AK(e){e.registerComponentModel(bK),e.registerComponentView(CK),e.registerPreprocessor(function(e){var t=e.graphic;J(t)?e.graphic=!t[0]||!t[0].elements?[{elements:t}]:[e.graphic[0]]:t&&!t.elements&&(e.graphic=[{elements:[t]}])})}var jK=[`x`,`y`,`radius`,`angle`,`single`],MK=Td(),NK=[`cartesian2d`,`polar`,`singleAxis`];function PK(e){return bl(NK,e.get(`coordinateSystem`))>=0}function FK(e){return e+`Axis`}function IK(e,t){var n=$l(),r=[],i=$l();e.eachComponent({mainType:`dataZoom`,query:t},function(e){i.get(e.uid)||s(e)});var a;do a=!1,e.eachComponent(`dataZoom`,o);while(a);function o(e){!i.get(e.uid)&&c(e)&&(s(e),a=!0)}function s(e){i.set(e.uid,!0),r.push(e),l(e)}function c(e){var t=!1;return e.eachTargetAxis(function(e,r){var i=n.get(e);i&&i[r]&&(t=!0)}),t}function l(e){e.eachTargetAxis(function(e,t){(n.get(e)||n.set(e,[]))[t]=!0})}return r}function LK(e){var t=e.ecModel,n={infoList:[],infoMap:$l()};return e.eachTargetAxis(function(e,r){var i=t.getComponent(FK(e),r);if(i){var a=i.getCoordSysModel();if(a){var o=a.uid,s=n.infoMap.get(o);s||(s={model:a,axisModels:[]},n.infoList.push(s),n.infoMap.set(o,s)),s.axisModels.push(i)}}}),n}function RK(e){var t=MK(Hk(e));return t.axisProxyMap||=$l()}function zK(e){if(e)return RK(e.ecModel).get(e.uid)}function BK(e,t){RK(e.ecModel).set(e.uid,t)}function VK(e,t){var n=t.getAxisModel().axis.__alignTo;return n&&e.getAxisProxy(n.dim,n.model.componentIndex)?zK(n.model):null}var HK=function(){function e(){this.indexList=[],this.indexMap=[]}return e.prototype.add=function(e){this.indexMap[e]||(this.indexList.push(e),this.indexMap[e]=!0)},e}(),UK=function(e){U(t,e);function t(){var n=e!==null&&e.apply(this,arguments)||this;return n.type=t.type,n._autoThrottle=!0,n._noTarget=!0,n._rangePropMode=[`percent`,`percent`],n}return t.prototype.init=function(e,t,n){var r=WK(e);this.settledOption=r,this.mergeDefaultAndTheme(e,n),this._doInit(r)},t.prototype.mergeOption=function(e){var t=WK(e);gl(this.option,e,!0),gl(this.settledOption,t,!0),this._doInit(t)},t.prototype._doInit=function(e){var t=this.option;this._setDefaultThrottle(e),this._updateRangeUse(e);var n=this.settledOption;G([[`start`,`startValue`],[`end`,`endValue`]],function(e,r){this._rangePropMode[r]===`value`&&(t[e[0]]=n[e[0]]=null)},this),this._resetTarget()},t.prototype._resetTarget=function(){var e=this.get(`orient`,!0),t=this._targetAxisInfoMap=$l();this._fillSpecifiedTargetAxis(t)?this._orient=e||this._makeAutoOrientByTargetAxis():(this._orient=e||`horizontal`,this._fillAutoTargetAxisByOrient(t,this._orient)),this._noTarget=!0,t.each(function(e){e.indexList.length&&(this._noTarget=!1)},this)},t.prototype._fillSpecifiedTargetAxis=function(e){var t=!1;return G(jK,function(n){var r=this.getReferringComponents(FK(n),Ad);if(r.specified){t=!0;var i=new HK;G(r.models,function(e){i.add(e.componentIndex)}),e.set(n,i)}},this),t},t.prototype._fillAutoTargetAxisByOrient=function(e,t){var n=this.ecModel,r=!0;if(r){var i=t===`vertical`?`y`:`x`,a=n.findComponents({mainType:i+`Axis`});o(a,i)}if(r){var a=n.findComponents({mainType:`singleAxis`,filter:function(e){return e.get(`orient`,!0)===t}});o(a,`single`)}function o(t,n){var i=t[0];if(i){var a=new HK;if(a.add(i.componentIndex),e.set(n,a),r=!1,n===`x`||n===`y`){var o=i.getReferringComponents(`grid`,kd).models[0];o&&G(t,function(e){i.componentIndex!==e.componentIndex&&o===e.getReferringComponents(`grid`,kd).models[0]&&a.add(e.componentIndex)})}}}r&&G(jK,function(t){if(r){var i=n.findComponents({mainType:FK(t),filter:function(e){return e.get(`type`,!0)===`category`}});if(i[0]){var a=new HK;a.add(i[0].componentIndex),e.set(t,a),r=!1}}},this)},t.prototype._makeAutoOrientByTargetAxis=function(){var e;return this.eachTargetAxis(function(t){!e&&(e=t)},this),e===`y`?`vertical`:`horizontal`},t.prototype._setDefaultThrottle=function(e){if(e.hasOwnProperty(`throttle`)&&(this._autoThrottle=!1),this._autoThrottle){var t=this.ecModel.option;this.option.throttle=t.animation&&t.animationDurationUpdate>0?100:20}},t.prototype._updateRangeUse=function(e){var t=this._rangePropMode,n=this.get(`rangeMode`);G([[`start`,`startValue`],[`end`,`endValue`]],function(r,i){var a=e[r[0]]!=null,o=e[r[1]]!=null;a&&!o?t[i]=`percent`:!a&&o?t[i]=`value`:n?t[i]=n[i]:a&&(t[i]=`percent`)})},t.prototype.noTarget=function(){return this._noTarget},t.prototype.getFirstTargetAxisModel=function(){var e;return this.eachTargetAxis(function(t,n){e??=this.ecModel.getComponent(FK(t),n)},this),e},t.prototype.eachTargetAxis=function(e,t){this._targetAxisInfoMap.each(function(n,r){G(n.indexList,function(n){e.call(t,r,n)})})},t.prototype.getAxisProxy=function(e,t){return zK(this.getAxisModel(e,t))},t.prototype.getAxisModel=function(e,t){var n=this._targetAxisInfoMap.get(e);if(n&&n.indexMap[t])return this.ecModel.getComponent(FK(e),t)},t.prototype.setRawRange=function(e){var t=this.option,n=this.settledOption;G([[`start`,`startValue`],[`end`,`endValue`]],function(r){(e[r[0]]!=null||e[r[1]]!=null)&&(t[r[0]]=n[r[0]]=e[r[0]],t[r[1]]=n[r[1]]=e[r[1]])},this),this._updateRangeUse(e)},t.prototype.setCalculatedRange=function(e){var t=this.option;G([`start`,`startValue`,`end`,`endValue`],function(n){t[n]=e[n]})},t.prototype.getPercentRange=function(){var e=this.findRepresentativeAxisProxy();if(e)return e.getWindow().percent},t.prototype.getValueRange=function(e,t){if(e==null&&t==null){var n=this.findRepresentativeAxisProxy();if(n)return n.getWindow().value}else return this.getAxisProxy(e,t).getWindow().value},t.prototype.findRepresentativeAxisProxy=function(e){if(e)return zK(e);for(var t,n=this._targetAxisInfoMap.keys(),r=0;ra[1];if(u&&!d&&!f)return!0;u&&(i=!0),d&&(t=!0),f&&(n=!0)}return i&&t&&n})}else G(r,function(n){if(i===`empty`)e.setData(t=t.map(n,function(e){return o(e)?e:NaN}));else{var r={};r[n]=a,t.selectRange(r)}});G(r,function(e){t.setApproximateExtent(a,e)})}});function o(e){return e>=a[0]&&e<=a[1]}},e.prototype._updateMinMaxSpan=function(){var e=this._minMaxSpan={},t=this._dataZoomModel,n=this._extent;G([`min`,`max`],function(r){var i=t.get(r+`Span`),a=t.get(r+`ValueSpan`);a!=null&&(a=this.getAxisModel().axis.scale.parse(a)),a==null?i!=null&&(a=Su(i,[0,100],n,!0)-n[0]):i=Su(n[0]+a,n,[0,100],!0),e[r+`Span`]=i,e[r+`ValueSpan`]=a},this)},e}(),YK={dirtyOnOverallProgress:!0,getTargetSeries:function(e){function t(t){e.eachComponent(`dataZoom`,function(n){n.eachTargetAxis(function(r,i){t(r,i,e.getComponent(FK(r),i),n)})})}var n=[];t(function(t,r,i,a){if(!zK(i)){var o=new JK(t,r,a,e);n.push(o),BK(i,o)}});var r=$l();return G(n,function(e){G(e.getTargetSeriesModels(),function(e){r.set(e.uid,e)})}),r},overallReset:function(e,t){e.eachComponent(`dataZoom`,function(e){var n=[];e.eachTargetAxis(function(t,r){var i=e.getAxisProxy(t,r),a=VK(e,i);a?n.push([i,a]):i.reset(e,null)}),G(n,function(t){t[0].reset(e,t[1].getWindow().percentInverted)}),e.eachTargetAxis(function(n,r){e.getAxisProxy(n,r).filterData(e,t)})}),e.eachComponent(`dataZoom`,function(e){var t=e.findRepresentativeAxisProxy();if(t){var n=t.getWindow(),r=n.percent,i=n.value;e.setCalculatedRange({start:r[0],end:r[1],startValue:i[0],endValue:i[1]})}})}};function XK(e){e.registerAction(`dataZoom`,function(e,t){G(IK(t,e),function(t){t.setRawRange({start:e.start,end:e.end,startValue:e.startValue,endValue:e.endValue})})})}var ZK=Kd();function QK(e){ZK(e,function(){e.registerProcessor(e.PRIORITY.PROCESSOR.FILTER,YK),XK(e),e.registerSubTypeDefaulter(`dataZoom`,function(){return`slider`})})}function $K(e){e.registerComponentModel(GK),e.registerComponentView(qK),QK(e)}var eq=function(){function e(){}return e}(),tq={};function nq(e,t){tq[e]=t}function rq(e){return tq[e]}var iq=function(e){U(t,e);function t(){var n=e!==null&&e.apply(this,arguments)||this;return n.type=t.type,n}return t.prototype.init=function(t,n,r){var i=r.getTheme().get(`toolbox`),a=i?i.feature:null;a&&(this._themeFeatureOption=W({},a),i.feature={}),e.prototype.init.call(this,t,n,r),a&&(i.feature=a)},t.prototype.optionUpdated=function(){G(this.option.feature,function(e,t){var n=this._themeFeatureOption,r=rq(t);r&&(r.getDefaultOption&&(r.defaultOption=r.getDefaultOption(this.ecModel)),n&&n[t]&&(gl(e,n[t]),n[t]=null),gl(e,r.defaultOption))},this)},t.type=`toolbox`,t.layoutMode={type:`box`,ignoreSize:!0},t.defaultOption={show:!0,z:6,orient:`horizontal`,left:`right`,top:`top`,backgroundColor:`transparent`,borderColor:Q.color.border,borderRadius:0,borderWidth:0,padding:Q.size.m,itemSize:15,itemGap:Q.size.s,showTitle:!0,iconStyle:{borderColor:Q.color.accent50,color:`none`},emphasis:{iconStyle:{borderColor:Q.color.accent70}},tooltip:{show:!1,position:`bottom`}},t}(Sw);function aq(e,t){var n=KC(t.get(`padding`)),r=t.getItemStyle([`color`,`opacity`]);return r.fill=t.get(`backgroundColor`),new z_({shape:{x:e.x-n[3],y:e.y-n[0],width:e.width+n[1]+n[3],height:e.height+n[0]+n[2],r:t.get(`borderRadius`)},style:r,silent:!0,z2:-1})}var oq=function(e){U(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}return t.prototype.render=function(e,t,n,r){var i=this.group;if(i.removeAll(),!e.get(`show`))return;var a=+e.get(`itemSize`),o=e.get(`orient`)===`vertical`,s=e.get(`feature`)||{},c=this._features||=$l(),l=[];G(s,function(e,t){l.push(t)}),new FE(this._featureNames||[],l).add(u).update(u).remove(kl(u,null)).execute(),this._featureNames=Tl(l,function(e){return c.hasKey(e)});function u(i,a){var o=i!=null&&a==null,u=i!=null&&a!=null,f=i==null,p=o||u?l[i]:l[a],m=s[p],h=o||u?new TS(m,e,t):null,g=h&&h.get(`show`),_;if(o){if(!g)return;if(sq(p))_={onclick:h.option.onclick,featureName:p};else{var v=rq(p);if(!v)return;_=new v}c.set(p,_)}else _=c.get(p);if(f||!g){cq(_)&&_.dispose&&_.dispose(t,n),c.removeKey(p);return}r&&r.newTitle!=null&&r.featureName===p&&(m.title=r.newTitle),o&&(_.uid=DS(`toolbox-feature`)),_.model=h,_.ecModel=t,_.api=n,d(h,_,p),h.setIconStatus=function(e,t){var n=this.option,r=this.iconPaths;n.iconStatus=n.iconStatus||{},n.iconStatus[e]=t,r[e]&&(t===`emphasis`?Jv:Yv)(r[e])},cq(_)&&_.render&&_.render(h,t,n,r)}function d(r,s,c){var l=r.getModel(`iconStyle`),u=r.getModel([`emphasis`,`iconStyle`]),d=s instanceof eq&&s.getIcons?s.getIcons():r.get(`icon`),f=r.get(`title`)||{},p,m;Y(d)?(p={},p[c]=d):p=d,Y(f)?(m={},m[c]=f):m=f;var h=r.iconPaths={};G(p,function(c,d){var f=Ox(c,{},{x:-a/2,y:-a/2,width:a,height:a});f.setStyle(l.getItemStyle());var p=f.ensureState(`emphasis`);p.style=u.getItemStyle();var g=new W_({style:{text:m[d],align:u.get(`textAlign`),borderRadius:u.get(`textBorderRadius`),padding:u.get(`textPadding`),fill:null,font:uS({fontStyle:u.get(`textFontStyle`),fontFamily:u.get(`textFontFamily`),fontSize:u.get(`textFontSize`),fontWeight:u.get(`textFontWeight`)},t)},ignore:!0});f.setTextContent(g),Ix({el:f,componentModel:e,itemName:d,formatterParamsExtra:{title:m[d]}}),f.__title=m[d],f.on(`mouseover`,function(){var t=u.getItemStyle(),r=o?e.get(`right`)==null&&e.get(`left`)!==`right`?`right`:`left`:e.get(`bottom`)==null&&e.get(`top`)!==`bottom`?`bottom`:`top`;g.setStyle({fill:u.get(`textFill`)||t.fill||t.stroke||Q.color.neutral99,backgroundColor:u.get(`textBackgroundColor`)}),f.setTextConfig({position:u.get(`textPosition`)||r}),g.ignore=!e.get(`showTitle`),n.enterEmphasis(this)}).on(`mouseout`,function(){r.get([`iconStatus`,d])!==`emphasis`&&n.leaveEmphasis(this),g.hide()}),(r.get([`iconStatus`,d])===`emphasis`?Jv:Yv)(f),i.add(f),f.on(`click`,q(s.onclick,s,t,n,d)),h[d]=f})}var f=hw(e,n).refContainer,p=e.getBoxLayoutParams(),m=e.get(`padding`),h=pw(p,f,m);dw(e.get(`orient`),i,e.get(`itemGap`),h.width,h.height),gw(i,p,f,m),i.add(aq(i.getBoundingRect(),e)),o||i.eachChild(function(e){var t=e.__title,r=e.ensureState(`emphasis`),o=r.textConfig||={},s=e.getTextContent(),c=s&&s.ensureState(`emphasis`);if(c&&!Al(c)&&t){var l=c.style||={},u=Mp(t,W_.makeFont(l)),d=e.x+i.x,f=e.y+i.y+a,p=!1;f+u.height>n.getHeight()&&(o.position=`top`,p=!0);var m=p?-5-u.height:a+10;d+u.width/2>n.getWidth()?(o.position=[`100%`,m],l.align=`right`):d-u.width/2<0&&(o.position=[0,m],l.align=`left`)}})},t.prototype.updateView=function(e,t,n,r){G(this._features,function(e){e&&e instanceof eq&&e.updateView&&e.updateView(e.model,t,n,r)})},t.prototype.dispose=function(e,t){G(this._features,function(n){n&&n instanceof eq&&n.dispose&&n.dispose(e,t)})},t.type=`toolbox`,t}(_P);function sq(e){return e.indexOf(`my`)===0}function cq(e){return e instanceof eq}var lq=function(e){U(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}return t.prototype.onclick=function(e,t){var n=this.model,r=n.get(`name`)||e.get(`title.0.text`)||`echarts`,i=t.getZr().painter.getType()===`svg`,a=i?`svg`:n.get(`type`,!0)||`png`,o=t.getConnectedDataURL({type:a,backgroundColor:n.get(`backgroundColor`,!0)||e.get(`backgroundColor`)||Q.color.neutral00,connectedBackgroundColor:n.get(`connectedBackgroundColor`),excludeComponents:n.get(`excludeComponents`),pixelRatio:n.get(`pixelRatio`)}),s=ou.browser;if(typeof MouseEvent==`function`&&(s.newEdge||!s.ie&&!s.edge)){var c=document.createElement(`a`);c.download=r+`.`+a,c.target=`_blank`,c.href=o;var l=new MouseEvent(`click`,{view:document.defaultView,bubbles:!0,cancelable:!1});c.dispatchEvent(l)}else if(window.navigator.msSaveOrOpenBlob||i){var u=o.split(`,`),d=u[0].indexOf(`base64`)>-1,f=i?decodeURIComponent(u[1]):u[1];d&&(f=window.atob(f));var p=r+`.`+a;if(window.navigator.msSaveOrOpenBlob){for(var m=f.length,h=new Uint8Array(m);m--;)h[m]=f.charCodeAt(m);var g=new Blob([h]);window.navigator.msSaveOrOpenBlob(g,p)}else{var _=document.createElement(`iframe`);document.body.appendChild(_);var v=_.contentWindow,y=v.document;y.open(`image/svg+xml`,`replace`),y.write(f),y.close(),v.focus(),y.execCommand(`SaveAs`,!0,p),document.body.removeChild(_)}}else{var b=n.get(`lang`),x=``,S=window.open();S.document.write(x),S.document.title=r}},t.getDefaultOption=function(e){return{show:!0,icon:`M4.7,22.9L29.3,45.5L54.7,23.4M4.6,43.6L4.6,58L53.8,58L53.8,43.6M29.2,45.1L29.2,0`,title:e.getLocaleModel().get([`toolbox`,`saveAsImage`,`title`]),type:`png`,connectedBackgroundColor:Q.color.neutral00,name:``,excludeComponents:[`toolbox`],lang:e.getLocaleModel().get([`toolbox`,`saveAsImage`,`lang`])}},t}(eq),uq=`__ec_magicType_stack__`,dq=[[`line`,`bar`],[`stack`]],fq=function(e){U(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}return t.prototype.getIcons=function(){var e=this.model,t=e.get(`icon`),n={};return G(e.get(`type`),function(e){t[e]&&(n[e]=t[e])}),n},t.getDefaultOption=function(e){return{show:!0,type:[],icon:{line:`M4.1,28.9h7.1l9.3-22l7.4,38l9.7-19.7l3,12.8h14.9M4.1,58h51.4`,bar:`M6.7,22.9h10V48h-10V22.9zM24.9,13h10v35h-10V13zM43.2,2h10v46h-10V2zM3.1,58h53.7`,stack:`M8.2,38.4l-8.4,4.1l30.6,15.3L60,42.5l-8.1-4.1l-21.5,11L8.2,38.4z M51.9,30l-8.1,4.2l-13.4,6.9l-13.9-6.9L8.2,30l-8.4,4.2l8.4,4.2l22.2,11l21.5-11l8.1-4.2L51.9,30z M51.9,21.7l-8.1,4.2L35.7,30l-5.3,2.8L24.9,30l-8.4-4.1l-8.3-4.2l-8.4,4.2L8.2,30l8.3,4.2l13.9,6.9l13.4-6.9l8.1-4.2l8.1-4.1L51.9,21.7zM30.4,2.2L-0.2,17.5l8.4,4.1l8.3,4.2l8.4,4.2l5.5,2.7l5.3-2.7l8.1-4.2l8.1-4.2l8.1-4.1L30.4,2.2z`},title:e.getLocaleModel().get([`toolbox`,`magicType`,`title`]),option:{},seriesIndex:{}}},t.prototype.onclick=function(e,t,n){var r=this.model,i=r.get([`seriesIndex`,n]);if(pq[n]){var a={series:[]};G(dq,function(e){bl(e,n)>=0&&G(e,function(e){r.setIconStatus(e,`normal`)})}),r.setIconStatus(n,`emphasis`),e.eachComponent({mainType:`series`,query:i==null?null:{seriesIndex:i}},function(e){var t=e.subType,i=e.id,o=pq[n](t,i,e,r);o&&(yl(o,e.option),a.series.push(o));var s=e.coordinateSystem;if(s&&s.type===`cartesian2d`&&(n===`line`||n===`bar`)){var c=s.getAxesByScale(`ordinal`)[0];if(c){var l=c.dim+`Axis`,u=e.getReferringComponents(l,kd).models[0].componentIndex;a[l]=a[l]||[];for(var d=0;d<=u;d++)a[l][u]=a[l][u]||{};a[l][u].boundaryGap=n===`bar`}}});var o,s=n;n===`stack`&&(o=gl({stack:r.option.title.tiled,tiled:r.option.title.stack},r.option.title),r.get([`iconStatus`,n])!==`emphasis`&&(s=`tiled`)),t.dispatchAction({type:`changeMagicType`,currentType:s,newOption:a,newTitle:o,featureName:`magicType`})}},t}(eq),pq={line:function(e,t,n,r){if(e===`bar`)return gl({id:t,type:`line`,data:n.get(`data`),stack:n.get(`stack`),markPoint:n.get(`markPoint`),markLine:n.get(`markLine`)},r.get([`option`,`line`])||{},!0)},bar:function(e,t,n,r){if(e===`line`)return gl({id:t,type:`bar`,data:n.get(`data`),stack:n.get(`stack`),markPoint:n.get(`markPoint`),markLine:n.get(`markLine`)},r.get([`option`,`bar`])||{},!0)},stack:function(e,t,n,r){var i=n.get(`stack`)===uq;if(e===`line`||e===`bar`)return r.setIconStatus(`stack`,i?`normal`:`emphasis`),gl({id:t,stack:i?``:uq},r.get([`option`,`stack`])||{},!0)}};qL({type:`changeMagicType`,event:`magicTypeChanged`,update:`prepareAndUpdate`},function(e,t){t.mergeOption(e.newOption)});var mq=Array(60).join(`-`),hq=` `;function gq(e){var t={},n=[],r=[];return e.eachRawSeries(function(e){var i=e.coordinateSystem;if(i&&(i.type===`cartesian2d`||i.type===`polar`)){var a=i.getBaseAxis();if(a.type===`category`){var o=fj(a);t[o]||(t[o]={categoryAxis:a,valueAxis:i.getOtherAxis(a),series:[]},r.push({axisDim:a.dim,axisIndex:a.index})),t[o].series.push(e)}else n.push(e)}else n.push(e)}),{seriesGroupByCategoryAxis:t,other:n,meta:r}}function _q(e){var t=[];return G(e,function(e,n){var r=e.categoryAxis,i=e.valueAxis.dim,a=[` `].concat(K(e.series,function(e){return e.name})),o=[r.model.getCategories()];G(e.series,function(e){var t=e.getRawData();o.push(e.getRawData().mapArray(t.mapDimension(i),function(e){return e}))});for(var s=[a.join(hq)],c=0;c`,m=l.join(p);this._showOrMove(a,function(){this._updateContentNotChangedOnAxis(e,s)?this._updatePosition(a,d,i[0],i[1],this._tooltipContent,s):this._showTooltipContent(a,m,s,Math.random()+``,i[0],i[1],d,null,u)})},t.prototype._showSeriesItemTooltip=function(e,t,n){var r=this._ecModel,i=iv(t),a=i.seriesIndex,o=r.getSeriesByIndex(a),s=i.dataModel||o,c=i.dataIndex,l=i.dataType,u=s.getData(l),d=this._renderMode,f=e.positionDefault,p=OJ([u.getItemModel(c),s,o&&(o.coordinateSystem||{}).model],this._tooltipModel,f?{position:f}:null),m=p.get(`trigger`);if(m==null||m===`item`){var h=s.getDataParams(c,l),g=new yE;h.marker=g.makeTooltipMarker(`item`,QC(h.color),d);var _=_T(s.formatTooltip(c,!1,l)),v=p.get(`order`),y=p.get(`valueFormatter`),b=_.frag,x=b?uE(y?W({valueFormatter:y},b):b,g,d,v,r.get(`useUTC`),p.get(`textStyle`)):_.text,S=`item_`+s.name+`_`+c;this._showOrMove(p,function(){this._showTooltipContent(p,x,h,S,e.offsetX,e.offsetY,e.position,e.target,g)}),n({type:`showTip`,dataIndexInside:c,dataIndex:u.getRawIndex(c),seriesIndex:a,from:this.uid})}},t.prototype._showComponentItemTooltip=function(e,t,n){var r=this._renderMode===`html`,i=iv(t),a=i.tooltipConfig.option||{},o=a.encodeHTMLContent;if(Y(a)){var s=a;a={content:s,formatter:s},o=!0}o&&r&&a.content&&(a=hl(a),a.content=WS(a.content));var c=[a],l=this._ecModel.getComponent(i.componentMainType,i.componentIndex);l&&c.push(l),c.push({formatter:a.content});var u=e.positionDefault,d=OJ(c,this._tooltipModel,u?{position:u}:null),f=d.get(`content`),p=Math.random()+``,m=new yE;this._showOrMove(d,function(){var n=hl(d.get(`formatterParams`)||{});this._showTooltipContent(d,f,n,p,e.offsetX,e.offsetY,e.position,t,m)}),n({type:`showTip`,from:this.uid})},t.prototype._showTooltipContent=function(e,t,n,r,i,a,o,s,c){if(this._ticket=``,e.get(`showContent`)&&e.get(`show`)){var l=this._tooltipContent;l.setEnterable(e.get(`enterable`));var u=e.get(`formatter`);o||=e.get(`position`);var d=t,f=this._getNearestPoint([i,a],n,e.get(`trigger`),e.get(`borderColor`),e.get(`defaultBorderColor`,!0)).color;if(u){if(Y(u)){var p=e.ecModel.get(`useUTC`),m=J(n)?n[0]:n,h=m&&m.axisType&&m.axisType.indexOf(`time`)>=0;d=u,h&&(d=EC(m.axisValue,d,p)),d=XC(d,n,!0)}else if(Al(u)){var g=q(function(t,r){t===this._ticket&&(l.setContent(r,c,e,f,o),this._updatePosition(e,o,i,a,l,n,s))},this);this._ticket=r,d=u(n,r,g)}else d=u}l.setContent(d,c,e,f,o),l.show(e,f),this._updatePosition(e,o,i,a,l,n,s)}},t.prototype._getNearestPoint=function(e,t,n,r,i){if(n===`axis`||J(t))return{color:r||i};if(!J(t))return{color:r||t.color||t.borderColor}},t.prototype._updatePosition=function(e,t,n,r,i,a,o){var s=this._api.getWidth(),c=this._api.getHeight();t||=e.get(`position`);var l=i.getSize(),u=e.get(`align`),d=e.get(`verticalAlign`),f=o&&o.getBoundingRect().clone();if(o&&f.applyTransform(o.transform),Al(t)&&(t=t([n,r],a,i.el,f,{viewSize:[s,c],contentSize:l.slice()})),J(t))n=Cu(t[0],s),r=Cu(t[1],c);else if(Nl(t)){var p=t;p.width=l[0],p.height=l[1];var m=pw(p,{width:s,height:c});n=m.x,r=m.y,u=null,d=null}else if(Y(t)&&o){var h=MJ(t,f,l,e.get(`borderWidth`));n=h[0],r=h[1]}else{var h=AJ(n,r,i,s,c,u?null:20,d?null:20);n=h[0],r=h[1]}if(u&&(n-=NJ(u)?l[0]/2:u===`right`?l[0]:0),d&&(r-=NJ(d)?l[1]/2:d===`bottom`?l[1]:0),aJ(e)){var h=jJ(n,r,i,s,c);n=h[0],r=h[1]}i.moveTo(n,r)},t.prototype._updateContentNotChangedOnAxis=function(e,t){var n=this._lastDataByCoordSys,r=this._cbParamsList,i=!!n&&n.length===e.length;return i&&G(n,function(n,a){var o=n.dataByAxis||[],s=(e[a]||{}).dataByAxis||[];i&&=o.length===s.length,i&&G(o,function(e,n){var a=s[n]||{},o=e.seriesDataIndices||[],c=a.seriesDataIndices||[];i=i&&e.value===a.value&&e.axisType===a.axisType&&e.axisId===a.axisId&&o.length===c.length,i&&G(o,function(e,t){var n=c[t];i=i&&e.seriesIndex===n.seriesIndex&&e.dataIndex===n.dataIndex}),r&&G(e.seriesDataIndices,function(e){var n=e.seriesIndex,a=t[n],o=r[n];a&&o&&o.data!==a.data&&(i=!1)})})}),this._lastDataByCoordSys=e,this._cbParamsList=t,!!i},t.prototype._hide=function(e){this._lastDataByCoordSys=null,this._cbParamsList=null,e({type:`hideTip`,from:this.uid})},t.prototype.dispose=function(e,t){!ou.node&&t.getDom()&&(MP(this,`_updatePosition`),this._tooltipContent.dispose(),XG(`itemTooltip`,t),this._tooltipContent=null,this._tooltipModel=null,this._lastDataByCoordSys=null,this._cbParamsList=null)},t.type=`tooltip`,t}(_P);function OJ(e,t,n){var r=t.ecModel,i;n?(i=new TS(n,r,r),i=new TS(t.option,i,r)):i=t;for(var a=e.length-1;a>=0;a--){var o=e[a];o&&(o instanceof TS&&(o=o.get(`tooltip`,!0)),Y(o)&&(o={formatter:o}),o&&(i=new TS(o,i,r)))}return i}function kJ(e,t){return e.dispatchAction||q(t.dispatchAction,t)}function AJ(e,t,n,r,i,a,o){var s=n.getSize(),c=s[0],l=s[1];return a!=null&&(e+c+a+2>r?e-=c+a:e+=a),o!=null&&(t+l+o>i?t-=l+o:t+=o),[e,t]}function jJ(e,t,n,r,i){var a=n.getSize(),o=a[0],s=a[1];return e=Math.min(e+o,r)-o,t=Math.min(t+s,i)-s,e=Math.max(e,0),t=Math.max(t,0),[e,t]}function MJ(e,t,n,r){var i=n[0],a=n[1],o=Math.ceil(Math.SQRT2*r)+8,s=0,c=0,l=t.width,u=t.height;switch(e){case`inside`:s=t.x+l/2-i/2,c=t.y+u/2-a/2;break;case`top`:s=t.x+l/2-i/2,c=t.y-a-o;break;case`bottom`:s=t.x+l/2-i/2,c=t.y+u+o;break;case`left`:s=t.x-i-o,c=t.y+u/2-a/2;break;case`right`:s=t.x+l+o,c=t.y+u/2-a/2}return[s,c]}function NJ(e){return e===`center`||e===`middle`}function PJ(e,t,n){var r=Od(e).queryOptionMap,i=r.keys()[0];if(i&&i!==`series`){var a=jd(t,i,r.get(i),{useDefault:!1,enableAll:!1,enableNone:!1}).models[0];if(a){var o=n.getViewOfComponentModel(a),s;if(o.group.traverse(function(t){var n=iv(t).tooltipConfig;if(n&&n.name===e.name)return s=t,!0}),s)return{componentMainType:i,componentIndex:a.componentIndex,el:s}}}}function FJ(e){aR(dK),e.registerComponentModel(iJ),e.registerComponentView(DJ),e.registerAction({type:`showTip`,event:`showTip`,update:`tooltip:manuallyShowTip`},ru),e.registerAction({type:`hideTip`,event:`hideTip`,update:`tooltip:manuallyHideTip`},ru)}var IJ=[`rect`,`polygon`,`keep`,`clear`];function LJ(e,t){var n=rd(e?e.brush:[]);if(n.length){var r=[];G(n,function(e){var t=e.hasOwnProperty(`toolbox`)?e.toolbox:[];t instanceof Array&&(r=r.concat(t))});var i=e&&e.toolbox;J(i)&&(i=i[0]),i||(i={feature:{}},e.toolbox=[i]);var a=i.feature||(i.feature={}),o=a.brush||={},s=o.type||=[];s.push.apply(s,r),Jd(s,function(e){return e+``},null),t&&!s.length&&s.push.apply(s,IJ)}}var RJ=G;function zJ(e){if(e){for(var t in e)if(e.hasOwnProperty(t))return!0}}function BJ(e,t,n){var r={};return RJ(t,function(t){var a=r[t]=i();RJ(e[t],function(e,r){if(cH.isValidType(r)){var i={type:r,visual:e};n&&n(i,t),a[r]=new cH(i),r===`opacity`&&(i=hl(i),i.type=`colorAlpha`,a.__hidden.__alphaForOpacity=new cH(i))}})}),r;function i(){var e=function(){};return e.prototype.__hidden=e.prototype,new e}}function VJ(e,t,n){var r;G(n,function(e){t.hasOwnProperty(e)&&zJ(t[e])&&(r=!0)}),r&&G(n,function(n){t.hasOwnProperty(n)&&zJ(t[n])?e[n]=hl(t[n]):delete e[n]})}function HJ(e,t,n,r,i,a){var o={};G(e,function(e){o[e]=cH.prepareVisualTypes(t[e])});var s;function c(e){return mF(n,s,e)}function l(e,t){gF(n,s,e,t)}a==null?n.each(u):n.each([a],u);function u(e,u){s=a==null?e:u;var d=n.getRawDataItem(s);if(!(d&&d.visualMap===!1))for(var f=r.call(i,e),p=t[f],m=o[f],h=0,g=m.length;ht[0][1]&&(t[0][1]=a[0]),a[1]t[1][1]&&(t[1][1]=a[1])}return t&&aY(t)}};function aY(e){return new fp(e[0][0],e[1][0],e[0][1]-e[0][0],e[1][1]-e[1][0])}var oY=function(e){U(t,e);function t(){var n=e!==null&&e.apply(this,arguments)||this;return n.type=t.type,n}return t.prototype.init=function(e,t){this.ecModel=e,this.api=t,this.model,(this._brushController=new eU(t.getZr())).on(`brush`,q(this._onBrush,this)).mount()},t.prototype.render=function(e,t,n,r){this.model=e,this._updateController(e,t,n,r)},t.prototype.updateTransform=function(e,t,n,r){ZJ(t),this._updateController(e,t,n,r)},t.prototype.updateVisual=function(e,t,n,r){this.updateTransform(e,t,n,r)},t.prototype.updateView=function(e,t,n,r){this._updateController(e,t,n,r)},t.prototype._updateController=function(e,t,n,r){(!r||r.$from!==e.id)&&this._brushController.setPanels(e.brushTargetManager.makePanelOpts(n)).enableBrush(e.brushOption).updateCovers(e.areas.slice())},t.prototype.dispose=function(){this._brushController.dispose()},t.prototype._onBrush=function(e){var t=this.model.id,n=this.model.brushTargetManager.setOutputRanges(e.areas,this.ecModel);(!e.isEnd||e.removeOnClick)&&this.api.dispatchAction({type:`brush`,brushId:t,areas:hl(n),$from:t}),e.isEnd&&this.api.dispatchAction({type:`brushEnd`,brushId:t,areas:hl(n),$from:t})},t.type=`brush`,t}(_P),sY=function(e){U(t,e);function t(){var n=e!==null&&e.apply(this,arguments)||this;return n.type=t.type,n.areas=[],n.brushOption={},n}return t.prototype.optionUpdated=function(e,t){var n=this.option;!t&&VJ(n,e,[`inBrush`,`outOfBrush`]);var r=n.inBrush=n.inBrush||{};n.outOfBrush=n.outOfBrush||{color:this.option.defaultOutOfBrushColor},r.hasOwnProperty(`liftZ`)||(r.liftZ=5)},t.prototype.setAreas=function(e){e&&(this.areas=K(e,function(e){return cY(this.option,e)},this))},t.prototype.setBrushOption=function(e){this.brushOption=cY(this.option,e),this.brushType=this.brushOption.brushType},t.type=`brush`,t.dependencies=[`geo`,`grid`,`xAxis`,`yAxis`,`parallel`,`series`],t.defaultOption={seriesIndex:`all`,brushType:`rect`,brushMode:`single`,transformable:!0,brushStyle:{borderWidth:1,color:Q.color.backgroundTint,borderColor:Q.color.borderTint},throttleType:`fixRate`,throttleDelay:0,removeOnClick:!0,z:1e4,defaultOutOfBrushColor:Q.color.disabled},t}(Sw);function cY(e,t){return gl({brushType:e.brushType,brushMode:e.brushMode,transformable:e.transformable,brushStyle:new TS(e.brushStyle).getItemStyle(),removeOnClick:e.removeOnClick,z:e.z},t,!0)}var lY=[`rect`,`polygon`,`lineX`,`lineY`,`keep`,`clear`],uY=function(e){U(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}return t.prototype.render=function(e,t,n){var r,i,a;t.eachComponent({mainType:`brush`},function(e){r=e.brushType,i=e.brushOption.brushMode||`single`,a||=!!e.areas.length}),this._brushType=r,this._brushMode=i,G(e.get(`type`,!0),function(t){e.setIconStatus(t,(t===`keep`?i===`multiple`:t===`clear`?a:t===r)?`emphasis`:`normal`)})},t.prototype.updateView=function(e,t,n){this.render(e,t,n)},t.prototype.getIcons=function(){var e=this.model,t=e.get(`icon`,!0),n={};return G(e.get(`type`,!0),function(e){t[e]&&(n[e]=t[e])}),n},t.prototype.onclick=function(e,t,n){var r=this._brushType,i=this._brushMode;n===`clear`?(t.dispatchAction({type:`axisAreaSelect`,intervals:[]}),t.dispatchAction({type:`brush`,command:`clear`,areas:[]})):t.dispatchAction({type:`takeGlobalCursor`,key:`brush`,brushOption:{brushType:n===`keep`?r:r!==n&&n,brushMode:n===`keep`?i===`multiple`?`single`:`multiple`:i}})},t.getDefaultOption=function(e){return{show:!0,type:lY.slice(),icon:{rect:`M7.3,34.7 M0.4,10V-0.2h9.8 M89.6,10V-0.2h-9.8 M0.4,60v10.2h9.8 M89.6,60v10.2h-9.8 M12.3,22.4V10.5h13.1 M33.6,10.5h7.8 M49.1,10.5h7.8 M77.5,22.4V10.5h-13 M12.3,31.1v8.2 M77.7,31.1v8.2 M12.3,47.6v11.9h13.1 M33.6,59.5h7.6 M49.1,59.5 h7.7 M77.5,47.6v11.9h-13`,polygon:`M55.2,34.9c1.7,0,3.1,1.4,3.1,3.1s-1.4,3.1-3.1,3.1 s-3.1-1.4-3.1-3.1S53.5,34.9,55.2,34.9z M50.4,51c1.7,0,3.1,1.4,3.1,3.1c0,1.7-1.4,3.1-3.1,3.1c-1.7,0-3.1-1.4-3.1-3.1 C47.3,52.4,48.7,51,50.4,51z M55.6,37.1l1.5-7.8 M60.1,13.5l1.6-8.7l-7.8,4 M59,19l-1,5.3 M24,16.1l6.4,4.9l6.4-3.3 M48.5,11.6 l-5.9,3.1 M19.1,12.8L9.7,5.1l1.1,7.7 M13.4,29.8l1,7.3l6.6,1.6 M11.6,18.4l1,6.1 M32.8,41.9 M26.6,40.4 M27.3,40.2l6.1,1.6 M49.9,52.1l-5.6-7.6l-4.9-1.2`,lineX:`M15.2,30 M19.7,15.6V1.9H29 M34.8,1.9H40.4 M55.3,15.6V1.9H45.9 M19.7,44.4V58.1H29 M34.8,58.1H40.4 M55.3,44.4 V58.1H45.9 M12.5,20.3l-9.4,9.6l9.6,9.8 M3.1,29.9h16.5 M62.5,20.3l9.4,9.6L62.3,39.7 M71.9,29.9H55.4`,lineY:`M38.8,7.7 M52.7,12h13.2v9 M65.9,26.6V32 M52.7,46.3h13.2v-9 M24.9,12H11.8v9 M11.8,26.6V32 M24.9,46.3H11.8v-9 M48.2,5.1l-9.3-9l-9.4,9.2 M38.9-3.9V12 M48.2,53.3l-9.3,9l-9.4-9.2 M38.9,62.3V46.4`,keep:`M4,10.5V1h10.3 M20.7,1h6.1 M33,1h6.1 M55.4,10.5V1H45.2 M4,17.3v6.6 M55.6,17.3v6.6 M4,30.5V40h10.3 M20.7,40 h6.1 M33,40h6.1 M55.4,30.5V40H45.2 M21,18.9h62.9v48.6H21V18.9z`,clear:`M22,14.7l30.9,31 M52.9,14.7L22,45.7 M4.7,16.8V4.2h13.1 M26,4.2h7.8 M41.6,4.2h7.8 M70.3,16.8V4.2H57.2 M4.7,25.9v8.6 M70.3,25.9v8.6 M4.7,43.2v12.6h13.1 M26,55.8h7.8 M41.6,55.8h7.8 M70.3,43.2v12.6H57.2`},title:e.getLocaleModel().get([`toolbox`,`brush`,`title`])}},t}(eq);function dY(e){e.registerComponentView(oY),e.registerComponentModel(sY),e.registerPreprocessor(LJ),e.registerVisual(e.PRIORITY.VISUAL.BRUSH,QJ),e.registerAction({type:`brush`,event:`brush`,update:`updateVisual`},function(e,t){t.eachComponent({mainType:`brush`,query:e},function(t){t.setAreas(e.areas)})}),e.registerAction({type:`brushSelect`,event:`brushSelected`,update:`none`},ru),e.registerAction({type:`brushEnd`,event:`brushEnd`,update:`none`},ru),nq(`brush`,uY)}function fY(e,t){if(!e)return!1;for(var n=J(e)?e:[e],r=0;r=0&&(s[o]=+s[o].toFixed(f)),[s,d]}var yY={min:kl(vY,`min`),max:kl(vY,`max`),average:kl(vY,`average`),median:kl(vY,`median`)};function bY(e,t){if(t){var n=e.getData(),r=e.coordinateSystem,i=r&&r.dimensions;if(!_Y(t)&&!J(t.coord)&&J(i)){var a=xY(t,n,r,e);if(t=hl(t),t.type&&yY[t.type]&&a.baseAxis&&a.valueAxis){var o=bl(i,a.baseAxis.dim),s=bl(i,a.valueAxis.dim),c=yY[t.type](n,a.valueAxis.dim,a.baseDataDim,a.valueDataDim,o,s);t.coord=c[0],t.value=c[1]}else t.coord=[t.xAxis==null?t.radiusAxis:t.xAxis,t.yAxis==null?t.angleAxis:t.yAxis]}if(t.coord==null||!J(i)){t.coord=[];var l=e.getBaseAxis();if(l&&t.type&&yY[t.type]){var u=r.getOtherAxis(l);u&&(t.value=EY(n,n.mapDimension(u.dim),t.type))}}else for(var d=t.coord,f=0;f<2;f++)yY[d[f]]&&(d[f]=EY(n,n.mapDimension(i[f]),d[f]));return t}}function xY(e,t,n,r){var i={};return e.valueIndex!=null||e.valueDim!=null?(i.valueDataDim=e.valueIndex==null?e.valueDim:t.getDimension(e.valueIndex),i.valueAxis=n.getAxis(SY(r,i.valueDataDim)),i.baseAxis=n.getOtherAxis(i.valueAxis),i.baseDataDim=t.mapDimension(i.baseAxis.dim)):(i.baseAxis=r.getBaseAxis(),i.valueAxis=n.getOtherAxis(i.baseAxis),i.baseDataDim=t.mapDimension(i.baseAxis.dim),i.valueDataDim=t.mapDimension(i.valueAxis.dim)),i}function SY(e,t){var n=e.getData().getDimensionInfo(t);return n&&n.coordDim}function CY(e,t){return e&&e.containData&&t.coord&&!gY(t)?e.containData(t.coord):!0}function wY(e,t,n){return e&&e.containZone&&t.coord&&n.coord&&!gY(t)&&!gY(n)?e.containZone(t.coord,n.coord):!0}function TY(e,t){return e?function(e,n,r,i){return xT(i<2?e.coord&&e.coord[i]:e.value,t[i])}:function(e,n,r,i){return xT(e.value,t[i])}}function EY(e,t,n){if(n===`average`){var r=0,i=0;return e.each(t,function(e,t){isNaN(e)||(r+=e,i++)}),r/i}return n===`median`?e.getMedian(t):e.getDataExtent(t)[+(n===`max`)]}var DY=Td(),OY=function(e){U(t,e);function t(){var n=e!==null&&e.apply(this,arguments)||this;return n.type=t.type,n}return t.prototype.init=function(){this.markerGroupMap=$l()},t.prototype.render=function(e,t,n){var r=this,i=this.markerGroupMap;i.each(function(e){DY(e).keep=!1}),t.eachSeries(function(e){var i=hY.getMarkerModelFromSeries(e,r.type);i&&r.renderSeries(e,i,t,n)}),i.each(function(e){!DY(e).keep&&r.group.remove(e.group)}),kY(t,i,this.type)},t.prototype.markKeep=function(e){DY(e).keep=!0},t.prototype.toggleBlurSeries=function(e,t){var n=this;G(e,function(e){var r=hY.getMarkerModelFromSeries(e,n.type);r&&r.getData().eachItemGraphicEl(function(e){e&&(t?Xv(e):Zv(e))})})},t.type=`marker`,t}(_P);function kY(e,t,n){e.eachSeries(function(e){var r=hY.getMarkerModelFromSeries(e,n),i=t.get(e.id);if(r&&i&&i.group){var a=Ux(r),o=a.z,s=a.zlevel;Gx(i.group,o,s)}})}var AY=function(e){U(t,e);function t(){var n=e!==null&&e.apply(this,arguments)||this;return n.type=t.type,n}return t.prototype.createMarkerModelFromSeries=function(e,n,r){return new t(e,n,r)},t.type=`markLine`,t.defaultOption={z:5,symbol:[`circle`,`arrow`],symbolSize:[8,16],symbolOffset:0,precision:2,tooltip:{trigger:`item`},label:{show:!0,position:`end`,distance:5},lineStyle:{type:`dashed`},emphasis:{label:{show:!0},lineStyle:{width:3}},animationEasing:`linear`},t}(hY),jY=Td(),MY=function(e,t,n,r){var i=e.getData(),a;if(J(r))a=r;else{var o=r.type;if(o===`min`||o===`max`||o===`average`||o===`median`||r.xAxis!=null||r.yAxis!=null){var s=void 0,c=void 0;if(r.yAxis!=null||r.xAxis!=null)s=t.getAxis(r.yAxis==null?`x`:`y`),c=Bl(r.yAxis,r.xAxis);else{var l=xY(r,i,t,e);s=l.valueAxis,c=EY(i,WO(i,l.valueDataDim),o)}var u=s.dim===`x`?0:1,d=1-u,f=hl(r),p={coord:[]};f.type=null,f.coord=[],f.coord[d]=-1/0,p.coord[d]=1/0;var m=n.get(`precision`);m>=0&&Ml(c)&&(c=+c.toFixed(Math.min(m,20))),f.coord[u]=p.coord[u]=c,a=[f,p,{type:o,valueIndex:r.valueIndex,value:c}]}else a=[]}var h=[bY(e,a[0]),bY(e,a[1]),W({},a[2])];return h[2].type=h[2].type||null,gl(h[2],h[0]),gl(h[2],h[1]),h};function NY(e){return!isNaN(e)&&!isFinite(e)}function PY(e,t,n,r){var i=1-e,a=r.dimensions[e];return NY(t[i])&&NY(n[i])&&t[e]===n[e]&&r.getAxis(a).containData(t[e])}function FY(e,t){if(e.type===`cartesian2d`){var n=t[0].coord,r=t[1].coord;if(n&&r&&(PY(1,n,r,e)||PY(0,n,r,e)))return!0}return CY(e,t[0])&&CY(e,t[1])}function IY(e,t,n,r,i){var a=r.coordinateSystem,o=e.getItemModel(t),s,c=Cu(o.get(`x`),i.getWidth()),l=Cu(o.get(`y`),i.getHeight());if(!isNaN(c)&&!isNaN(l))s=[c,l];else{if(r.getMarkerPosition)s=r.getMarkerPosition(e.getValues(e.dimensions,t));else{var u=a.dimensions,d=e.get(u[0],t),f=e.get(u[1],t);s=a.dataToPoint([d,f])}if(rB(a,`cartesian2d`)){var p=a.getAxis(`x`),m=a.getAxis(`y`),u=a.dimensions;NY(e.get(u[0],t))?s[0]=p.toGlobalCoord(p.getExtent()[+!n]):NY(e.get(u[1],t))&&(s[1]=m.toGlobalCoord(m.getExtent()[+!n]))}isNaN(c)||(s[0]=c),isNaN(l)||(s[1]=l)}e.setItemLayout(t,s)}var LY=function(e){U(t,e);function t(){var n=e!==null&&e.apply(this,arguments)||this;return n.type=t.type,n}return t.prototype.updateTransform=function(e,t,n){t.eachSeries(function(e){var t=hY.getMarkerModelFromSeries(e,`markLine`);if(t){var r=t.getData(),i=jY(t).from,a=jY(t).to;i.each(function(t){IY(i,t,!0,e,n),IY(a,t,!1,e,n)}),r.each(function(e){r.setItemLayout(e,[i.getItemLayout(e),a.getItemLayout(e)])}),this.markerGroupMap.get(e.id).updateLayout()}},this)},t.prototype.renderSeries=function(e,t,n,r){var i=e.coordinateSystem,a=e.id,o=e.getData(),s=this.markerGroupMap,c=s.get(a)||s.set(a,new PH);this.group.add(c.group);var l=RY(i,e,t),u=l.from,d=l.to,f=l.line;jY(t).from=u,jY(t).to=d,t.setData(f);var p=t.get(`symbol`),m=t.get(`symbolSize`),h=t.get(`symbolRotate`),g=t.get(`symbolOffset`);J(p)||(p=[p,p]),J(m)||(m=[m,m]),J(h)||(h=[h,h]),J(g)||(g=[g,g]),l.from.each(function(e){_(u,e,!0),_(d,e,!1)}),f.each(function(e){var t=f.getItemModel(e),n=t.getModel(`lineStyle`).getLineStyle();f.setItemLayout(e,[u.getItemLayout(e),d.getItemLayout(e)]);var r=t.get(`z2`);n.stroke??=u.getItemVisual(e,`style`).fill,f.setItemVisual(e,{z2:X(r,0),fromSymbolKeepAspect:u.getItemVisual(e,`symbolKeepAspect`),fromSymbolOffset:u.getItemVisual(e,`symbolOffset`),fromSymbolRotate:u.getItemVisual(e,`symbolRotate`),fromSymbolSize:u.getItemVisual(e,`symbolSize`),fromSymbol:u.getItemVisual(e,`symbol`),toSymbolKeepAspect:d.getItemVisual(e,`symbolKeepAspect`),toSymbolOffset:d.getItemVisual(e,`symbolOffset`),toSymbolRotate:d.getItemVisual(e,`symbolRotate`),toSymbolSize:d.getItemVisual(e,`symbolSize`),toSymbol:d.getItemVisual(e,`symbol`),style:n})}),c.updateData(f),l.line.eachItemGraphicEl(function(e){iv(e).dataModel=t,e.traverse(function(e){iv(e).dataModel=t})});function _(t,n,i){var a=t.getItemModel(n);IY(t,n,i,e,r);var s=a.getModel(`itemStyle`).getItemStyle();s.fill??=hF(o,`color`),t.setItemVisual(n,{symbolKeepAspect:a.get(`symbolKeepAspect`),symbolOffset:X(a.get(`symbolOffset`,!0),g[+!i]),symbolRotate:X(a.get(`symbolRotate`,!0),h[+!i]),symbolSize:X(a.get(`symbolSize`),m[+!i]),symbol:X(a.get(`symbol`,!0),p[+!i]),style:s})}this.markKeep(c),c.group.silent=t.get(`silent`)||e.get(`silent`)},t.type=`markLine`,t}(OY);function RY(e,t,n){var r=e?K(e&&e.dimensions,function(e){var n=t.getData();return W(W({},n.getDimensionInfo(n.mapDimension(e))||{}),{name:e,ordinalMeta:null})}):[{name:`value`,type:`float`}],i=new ER(r,n),a=new ER(r,n),o=new ER([],n),s=K(n.get(`data`),kl(MY,t,e,n));e&&(s=Tl(s,kl(FY,e)));var c=TY(!!e,r);return i.initData(K(s,function(e){return e[0]}),null,c),a.initData(K(s,function(e){return e[1]}),null,c),o.initData(K(s,function(e){return e[2]})),o.hasItemOption=!0,{from:i,to:a,line:o}}function zY(e){e.registerComponentModel(AY),e.registerComponentView(LY),e.registerPreprocessor(function(e){fY(e.series,`markLine`)&&(e.markLine=e.markLine||{})})}var BY=function(e){U(t,e);function t(){var n=e!==null&&e.apply(this,arguments)||this;return n.type=t.type,n}return t.prototype.createMarkerModelFromSeries=function(e,n,r){return new t(e,n,r)},t.type=`markArea`,t.defaultOption={z:1,tooltip:{trigger:`item`},animation:!1,label:{show:!0,position:`top`},itemStyle:{borderWidth:0},emphasis:{label:{show:!0,position:`top`}}},t}(hY),VY=Td(),HY=function(e,t,n,r){var i=r[0],a=r[1];if(i&&a){var o=bY(e,i),s=bY(e,a),c=o.coord,l=s.coord;c[0]=Bl(c[0],-1/0),c[1]=Bl(c[1],-1/0),l[0]=Bl(l[0],1/0),l[1]=Bl(l[1],1/0);var u=_l([{},o,s]);return u.coord=[o.coord,s.coord],u.x0=o.x,u.y0=o.y,u.x1=s.x,u.y1=s.y,u}};function UY(e){return!isNaN(e)&&!isFinite(e)}function WY(e,t,n,r){var i=1-e;return UY(t[i])&&UY(n[i])}function GY(e,t){var n=t.coord[0],r=t.coord[1],i={coord:n,x:t.x0,y:t.y0},a={coord:r,x:t.x1,y:t.y1};return rB(e,`cartesian2d`)?n&&r&&(WY(1,n,r,e)||WY(0,n,r,e))?!0:wY(e,i,a):CY(e,i)||CY(e,a)}function KY(e,t,n,r,i){var a=r.coordinateSystem,o=e.getItemModel(t),s,c=Cu(o.get(n[0]),i.getWidth()),l=Cu(o.get(n[1]),i.getHeight());if(!isNaN(c)&&!isNaN(l))s=[c,l];else{if(r.getMarkerPosition){var u=e.getValues([`x0`,`y0`],t),d=e.getValues([`x1`,`y1`],t),f=a.clampData(u),p=a.clampData(d),m=[];m[0]=n[0]===`x0`?f[0]>p[0]?d[0]:u[0]:f[0]>p[0]?u[0]:d[0],m[1]=n[1]===`y0`?f[1]>p[1]?d[1]:u[1]:f[1]>p[1]?u[1]:d[1],s=r.getMarkerPosition(m,n,!0)}else{var h=e.get(n[0],t),g=e.get(n[1],t),_=[h,g];a.clampData&&a.clampData(_,_),s=a.dataToPoint(_,!0)}if(rB(a,`cartesian2d`)){var v=a.getAxis(`x`),y=a.getAxis(`y`),h=e.get(n[0],t),g=e.get(n[1],t);UY(h)?s[0]=v.toGlobalCoord(v.getExtent()[n[0]===`x0`?0:1]):UY(g)&&(s[1]=y.toGlobalCoord(y.getExtent()[n[1]===`y0`?0:1]))}isNaN(c)||(s[0]=c),isNaN(l)||(s[1]=l)}return s}var qY=[[`x0`,`y0`],[`x1`,`y0`],[`x1`,`y1`],[`x0`,`y1`]],JY=function(e){U(t,e);function t(){var n=e!==null&&e.apply(this,arguments)||this;return n.type=t.type,n}return t.prototype.updateTransform=function(e,t,n){t.eachSeries(function(e){var t=hY.getMarkerModelFromSeries(e,`markArea`);if(t){var r=t.getData();r.each(function(t){var i=K(qY,function(i){return KY(r,t,i,e,n)});r.setItemLayout(t,i),r.getItemGraphicEl(t).setShape(`points`,i)})}},this)},t.prototype.renderSeries=function(e,t,n,r){var i=e.coordinateSystem,a=e.id,o=e.getData(),s=this.markerGroupMap,c=s.get(a)||s.set(a,{group:new Ky});this.group.add(c.group),this.markKeep(c);var l=YY(i,e,t);t.setData(l),l.each(function(t){var n=K(qY,function(n){return KY(l,t,n,e,r)}),a=i.getAxis(`x`).scale,s=i.getAxis(`y`).scale,c=a.getExtent(),u=s.getExtent(),d=[a.parse(l.get(`x0`,t)),a.parse(l.get(`x1`,t))],f=[s.parse(l.get(`y0`,t)),s.parse(l.get(`y1`,t))];Ou(d),Ou(f);var p=c[0]>d[1]||c[1]f[1]||u[1]=0},t.prototype.getOrient=function(){return this.get(`orient`)===`vertical`?{index:1,name:`vertical`}:{index:0,name:`horizontal`}},t.type=`legend.plain`,t.dependencies=[`series`],t.defaultOption={z:4,show:!0,orient:`horizontal`,left:`center`,bottom:Q.size.m,align:`auto`,backgroundColor:Q.color.transparent,borderColor:Q.color.border,borderRadius:0,borderWidth:0,padding:5,itemGap:8,itemWidth:25,itemHeight:14,symbolRotate:`inherit`,symbolKeepAspect:!0,inactiveColor:Q.color.disabled,inactiveBorderColor:Q.color.disabled,inactiveBorderWidth:`auto`,itemStyle:{color:`inherit`,opacity:`inherit`,borderColor:`inherit`,borderWidth:`auto`,borderCap:`inherit`,borderJoin:`inherit`,borderDashOffset:`inherit`,borderMiterLimit:`inherit`},lineStyle:{width:`auto`,color:`inherit`,inactiveColor:Q.color.disabled,inactiveWidth:2,opacity:`inherit`,type:`inherit`,cap:`inherit`,join:`inherit`,dashOffset:`inherit`,miterLimit:`inherit`},textStyle:{color:Q.color.secondary},selectedMode:!0,selector:!1,selectorLabel:{show:!0,borderRadius:10,padding:[3,5,3,5],fontSize:12,fontFamily:`sans-serif`,color:Q.color.tertiary,borderWidth:1,borderColor:Q.color.border},emphasis:{selectorLabel:{show:!0,color:Q.color.quaternary}},selectorPosition:`auto`,selectorItemGap:7,selectorButtonGap:10,tooltip:{show:!1},triggerEvent:!1},t}(Sw),$Y=kl,eX=G,tX=Ky,nX=function(e){U(t,e);function t(){var n=e!==null&&e.apply(this,arguments)||this;return n.type=t.type,n.newlineDisabled=!1,n}return t.prototype.init=function(){this.group.add(this._contentGroup=new tX),this.group.add(this._selectorGroup=new tX),this._isFirstRender=!0},t.prototype.getContentGroup=function(){return this._contentGroup},t.prototype.getSelectorGroup=function(){return this._selectorGroup},t.prototype.render=function(e,t,n){var r=this._isFirstRender;if(this._isFirstRender=!1,this.resetInner(),e.get(`show`,!0)){var i=e.get(`align`),a=e.get(`orient`);(!i||i===`auto`)&&(i=e.get(`left`)===`right`&&a===`vertical`?`right`:`left`);var o=e.get(`selector`,!0),s=e.get(`selectorPosition`,!0);o&&(!s||s===`auto`)&&(s=a===`horizontal`?`end`:`start`),this.renderInner(i,e,t,n,o,a,s);var c=hw(e,n).refContainer,l=e.getBoxLayoutParams(),u=e.get(`padding`),d=pw(l,c,u),f=this.layoutInner(e,i,d,r,o,s),p=pw(yl({width:f.width,height:f.height},l),c,u);this.group.x=p.x-f.x,this.group.y=p.y-f.y,this.group.markRedraw(),this.group.add(this._backgroundEl=aq(f,e))}},t.prototype.resetInner=function(){this.getContentGroup().removeAll(),this._backgroundEl&&this.group.remove(this._backgroundEl),this.getSelectorGroup().removeAll()},t.prototype.renderInner=function(e,t,n,r,i,a,o){var s=this.getContentGroup(),c=$l(),l=t.get(`selectedMode`),u=t.get(`triggerEvent`),d=[];n.eachRawSeries(function(e){!e.get(`legendHoverLink`)&&d.push(e.id)}),eX(t.getData(),function(i,a){var o=this,f=i.get(`name`);if(!this.newlineDisabled&&(f===``||f===` `)){var p=new tX;p.newline=!0,s.add(p);return}var m=n.getSeriesByName(f)[0];if(!c.get(f)){if(m){var h=m.getData(),g=h.getVisual(`legendLineStyle`)||{},_=h.getVisual(`legendIcon`),v=h.getVisual(`style`),y=this._createItem(m,f,a,i,t,e,g,v,_,l,r);y.on(`click`,$Y(aX,f,null,r,d)).on(`mouseover`,$Y(oX,m.name,null,r,d)).on(`mouseout`,$Y(sX,m.name,null,r,d)),n.ssr&&y.eachChild(function(e){var t=iv(e);t.seriesIndex=m.seriesIndex,t.dataIndex=a,t.ssrType=`legend`}),u&&y.eachChild(function(e){o.packEventData(e,t,m,a,f)}),c.set(f,!0)}else n.eachRawSeries(function(o){var s=this;if(!c.get(f)&&o.legendVisualProvider){var p=o.legendVisualProvider;if(!p.containName(f))return;var m=p.indexOfName(f),h=p.getItemVisual(m,`style`),g=p.getItemVisual(m,`legendIcon`),_=oh(h.fill);_&&_[3]===0&&(_[3]=.2,h=W(W({},h),{fill:mh(_,`rgba`)}));var v=this._createItem(o,f,a,i,t,e,{},h,g,l,r);v.on(`click`,$Y(aX,null,f,r,d)).on(`mouseover`,$Y(oX,null,f,r,d)).on(`mouseout`,$Y(sX,null,f,r,d)),n.ssr&&v.eachChild(function(e){var t=iv(e);t.seriesIndex=o.seriesIndex,t.dataIndex=a,t.ssrType=`legend`}),u&&v.eachChild(function(e){s.packEventData(e,t,o,a,f)}),c.set(f,!0)}},this)}},this),i&&this._createSelector(i,t,r,a,o)},t.prototype.packEventData=function(e,t,n,r,i){var a={componentType:`legend`,componentIndex:t.componentIndex,dataIndex:r,value:i,seriesIndex:n.seriesIndex};iv(e).eventData=a},t.prototype._createSelector=function(e,t,n,r,i){var a=this.getSelectorGroup();eX(e,function(e){var r=e.type,i=new W_({style:{x:0,y:0,align:`center`,verticalAlign:`middle`},onclick:function(){n.dispatchAction({type:r===`all`?`legendAllSelect`:`legendInverseSelect`,legendId:t.id})}});a.add(i),eS(i,{normal:t.getModel(`selectorLabel`),emphasis:t.getModel([`emphasis`,`selectorLabel`])},{defaultText:e.title}),dy(i)})},t.prototype._createItem=function(e,t,n,r,i,a,o,s,c,l,u){var d=e.visualDrawType,f=i.get(`itemWidth`),p=i.get(`itemHeight`),m=i.isSelected(t),h=r.get(`symbolRotate`),g=r.get(`symbolKeepAspect`),_=r.get(`icon`);c=_||c||`roundRect`;var v=rX(c,r,o,s,d,m,u),y=new tX,b=r.getModel(`textStyle`);if(Al(e.getLegendIcon)&&(!_||_===`inherit`))y.add(e.getLegendIcon({itemWidth:f,itemHeight:p,icon:c,iconRotate:h,itemStyle:v.itemStyle,lineStyle:v.lineStyle,symbolKeepAspect:g}));else{var x=_===`inherit`&&e.getData().getVisual(`symbol`)?h===`inherit`?e.getData().getVisual(`symbolRotate`):h:0;y.add(iX({itemWidth:f,itemHeight:p,icon:c,iconRotate:x,itemStyle:v.itemStyle,lineStyle:v.lineStyle,symbolKeepAspect:g}))}var S=a===`left`?f+5:-5,C=a,w=i.get(`formatter`),T=t;Y(w)&&w?T=w.replace(`{name}`,t??``):Al(w)&&(T=w(t));var E=m?b.getTextColor():r.get(`inactiveColor`);y.add(new W_({style:nS(b,{text:T,x:S,y:p/2,fill:E,align:C,verticalAlign:`middle`},{inheritColor:E})}));var D=new z_({shape:y.getBoundingRect(),style:{fill:`transparent`}}),O=r.getModel(`tooltip`);return O.get(`show`)&&Ix({el:D,componentModel:i,itemName:t,itemTooltipOption:O.option}),y.add(D),y.eachChild(function(e){e.silent=!0}),D.silent=!l,this.getContentGroup().add(y),dy(y),y.__legendDataIndex=n,y},t.prototype.layoutInner=function(e,t,n,r,i,a){var o=this.getContentGroup(),s=this.getSelectorGroup();dw(e.get(`orient`),o,e.get(`itemGap`),n.width,n.height);var c=o.getBoundingRect(),l=[-c.x,-c.y];if(s.markRedraw(),o.markRedraw(),i){dw(`horizontal`,s,e.get(`selectorItemGap`,!0));var u=s.getBoundingRect(),d=[-u.x,-u.y],f=e.get(`selectorButtonGap`,!0),p=e.getOrient().index,m=p===0?`width`:`height`,h=p===0?`height`:`width`,g=p===0?`y`:`x`;a===`end`?d[p]+=c[m]+f:l[p]+=u[m]+f,d[1-p]+=c[h]/2-u[h]/2,s.x=d[0],s.y=d[1],o.x=l[0],o.y=l[1];var _={x:0,y:0};return _[m]=c[m]+f+u[m],_[h]=Math.max(c[h],u[h]),_[g]=Math.min(0,u[g]+d[1-p]),_}return o.x=l[0],o.y=l[1],this.group.getBoundingRect()},t.prototype.remove=function(){this.getContentGroup().removeAll(),this._isFirstRender=!0},t.type=`legend.plain`,t}(_P);function rX(e,t,n,r,i,a,o){function s(e,t){e.lineWidth===`auto`&&(e.lineWidth=t.lineWidth>0?2:0),eX(e,function(n,r){e[r]===`inherit`&&(e[r]=t[r])})}var c=t.getModel(`itemStyle`),l=c.getItemStyle(),u=e.lastIndexOf(`empty`,0)===0?`fill`:`stroke`,d=c.getShallow(`decal`);l.decal=!d||d===`inherit`?r.decal:gI(d,o),l.fill===`inherit`&&(l.fill=r[i]),l.stroke===`inherit`&&(l.stroke=r[u]),l.opacity===`inherit`&&(l.opacity=(i===`fill`?r:n).opacity),s(l,r);var f=t.getModel(`lineStyle`),p=f.getLineStyle();if(s(p,n),l.fill===`auto`&&(l.fill=r.fill),l.stroke===`auto`&&(l.stroke=r.fill),p.stroke===`auto`&&(p.stroke=r.fill),!a){var m=t.get(`inactiveBorderWidth`),h=l[u];l.lineWidth=m===`auto`?r.lineWidth>0&&h?2:0:l.lineWidth,l.fill=t.get(`inactiveColor`),l.stroke=t.get(`inactiveBorderColor`),p.stroke=f.get(`inactiveColor`),p.lineWidth=f.get(`inactiveWidth`)}return{itemStyle:l,lineStyle:p}}function iX(e){var t=e.icon||`roundRect`,n=TA(t,0,0,e.itemWidth,e.itemHeight,e.itemStyle.fill,e.symbolKeepAspect);return n.setStyle(e.itemStyle),n.rotation=(e.iconRotate||0)*Math.PI/180,n.setOrigin([e.itemWidth/2,e.itemHeight/2]),t.indexOf(`empty`)>-1&&(n.style.stroke=n.style.fill,n.style.fill=Q.color.neutral00,n.style.lineWidth=2),n}function aX(e,t,n,r){sX(e,t,n,r),n.dispatchAction({type:`legendToggleSelect`,name:e??t}),oX(e,t,n,r)}function oX(e,t,n,r){n.usingTHL()||n.dispatchAction({type:`highlight`,seriesName:e,name:t,excludeSeriesId:r})}function sX(e,t,n,r){n.usingTHL()||n.dispatchAction({type:`downplay`,seriesName:e,name:t,excludeSeriesId:r})}function cX(e,t,n){var r=e===`allSelect`||e===`inverseSelect`,i={},a=[];n.eachComponent({mainType:`legend`,query:t},function(n){r?n[e]():n[e](t.name),lX(n,i),a.push(n.componentIndex)});var o={};return n.eachComponent(`legend`,function(e){G(i,function(t,n){e[t?`select`:`unSelect`](n)}),lX(e,o)}),r?{selected:o,legendIndex:a}:{name:t.name,selected:o}}function lX(e,t){var n=t||{};return G(e.getData(),function(t){var r=t.get(`name`);if(r!==` -`&&r!==``){var i=e.isSelected(r);n[r]=Z(n,r)?n[r]&&i:i}}),n}function uX(e){e.registerAction(`legendToggleSelect`,`legendselectchanged`,kl(cX,`toggleSelected`)),e.registerAction(`legendAllSelect`,`legendselectall`,kl(cX,`allSelect`)),e.registerAction(`legendInverseSelect`,`legendinverseselect`,kl(cX,`inverseSelect`)),e.registerAction(`legendSelect`,`legendselected`,kl(cX,`select`)),e.registerAction(`legendUnSelect`,`legendunselected`,kl(cX,`unSelect`))}var dX=$d(fX);function fX(e){var t=e.findComponents({mainType:`legend`});t&&t.length&&e.filterSeries(function(e){for(var n=0;nn[i],m=[-d.x,-d.y];t||(m[r]=c[s]);var h=[0,0],g=[-f.x,-f.y],_=X(e.get(`pageButtonGap`,!0),e.get(`itemGap`,!0));p&&(e.get(`pageButtonPosition`,!0)===`end`?g[r]+=n[i]-f[i]:h[r]+=f[i]+_),g[1-r]+=d[a]/2-f[a]/2,c.setPosition(m),l.setPosition(h),u.setPosition(g);var v={x:0,y:0};if(v[i]=p?n[i]:d[i],v[a]=Math.max(d[a],f[a]),v[o]=Math.min(0,f[o]+g[1-r]),l.__rectSize=n[i],p){var y={x:0,y:0};y[i]=Math.max(n[i]-f[i]-_,0),y[a]=v[a],l.setClipPath(new z_({shape:y})),l.__rectSize=y[i]}else u.eachChild(function(e){e.attr({invisible:!0,silent:!0})});var b=this._getPageInfo(e);return b.pageIndex!=null&&Yb(c,{x:b.contentPosition[0],y:b.contentPosition[1]},p?e:null),this._updatePageInfoView(e,b),v},t.prototype._pageGo=function(e,t,n){var r=this._getPageInfo(t)[e];r!=null&&n.dispatchAction({type:`legendScroll`,scrollDataIndex:r,legendId:t.id})},t.prototype._updatePageInfoView=function(e,t){var n=this._controllerGroup;G([`pagePrev`,`pageNext`],function(r){var i=t[r+`DataIndex`]!=null,a=n.childOfName(r);a&&(a.setStyle(`fill`,i?e.get(`pageIconColor`,!0):e.get(`pageIconInactiveColor`,!0)),a.cursor=i?`pointer`:`default`)});var r=n.childOfName(`pageText`),i=e.get(`pageFormatter`),a=t.pageIndex,o=a==null?0:a+1,s=t.pageCount;r&&i&&r.setStyle(`text`,Y(i)?i.replace(`{current}`,o==null?``:o+``).replace(`{total}`,s==null?``:s+``):i({current:o,total:s}))},t.prototype._getPageInfo=function(e){var t=e.get(`scrollDataIndex`,!0),n=this.getContentGroup(),r=this._containerGroup.__rectSize,i=e.getOrient().index,a=_X[i],o=vX[i],s=this._findTargetItemIndex(t),c=n.children(),l=c[s],u=c.length,d=+!!u,f={contentPosition:[n.x,n.y],pageCount:d,pageIndex:d-1,pagePrevDataIndex:null,pageNextDataIndex:null};if(!l)return f;var p=v(l);f.contentPosition[i]=-p.s;for(var m=s+1,h=p,g=p,_=null;m<=u;++m)_=v(c[m]),(!_&&g.e>h.s+r||_&&!y(_,h.s))&&(h=g.i>h.i?g:_,h&&(f.pageNextDataIndex??=h.i,++f.pageCount)),g=_;for(var m=s-1,h=p,g=p,_=null;m>=-1;--m)_=v(c[m]),(!_||!y(g,_.s))&&h.i=t&&e.s<=t+r}},t.prototype._findTargetItemIndex=function(e){if(!this._showController)return 0;var t,n=this.getContentGroup(),r;return n.eachChild(function(n,i){var a=n.__legendDataIndex;r==null&&a!=null&&(r=i),a===e&&(t=i)}),t??r},t.type=`legend.scroll`,t}(nX);function bX(e){e.registerAction(`legendScroll`,`legendscroll`,function(e,t){var n=e.scrollDataIndex;n!=null&&t.eachComponent({mainType:`legend`,subType:`scroll`,query:e},function(e){e.setScrollDataIndex(n)})})}function xX(e){aR(pX),e.registerComponentModel(mX),e.registerComponentView(yX),bX(e)}function SX(e){aR(pX),aR(xX)}var CX=function(e){U(t,e);function t(){var n=e!==null&&e.apply(this,arguments)||this;return n.type=t.type,n}return t.type=`dataZoom.inside`,t.defaultOption=AS(UK.defaultOption,{disabled:!1,zoomLock:!1,zoomOnMouseWheel:!0,moveOnMouseMove:!0,moveOnMouseWheel:!1,preventDefaultMouseMove:!0}),t}(UK),wX=Td();function TX(e,t,n){wX(e).coordSysRecordMap.each(function(e){var r=e.dataZoomInfoMap.get(t.uid);r&&(r.getRange=n)})}function EX(e,t){for(var n=wX(e).coordSysRecordMap,r=n.keys(),i=0;ia[i+r]&&(r=n),o&&=t.get(`preventDefaultMouseMove`,!0),s=X(t.get(`cursorGrab`,!0),s),c=X(t.get(`cursorGrabbing`,!0),c)}),{controlType:r,opt:{zoomOnMouseWheel:!0,moveOnMouseMove:!0,moveOnMouseWheel:!0,preventDefaultMouseMove:!!o,api:n,zInfo:{component:t.model},triggerInfo:{roamTrigger:null,isInSelf:t.containsPoint},cursorGrab:s,cursorGrabbing:c}}}function MX(e){e.registerUpdateLifecycle(`coordsys:aftercreate`,function(e,t){var n=wX(t),r=n.coordSysRecordMap||=$l();r.each(function(e){e.dataZoomInfoMap=null}),e.eachComponent({mainType:`dataZoom`,subType:`inside`},function(e){G(LK(e).infoList,function(n){var i=n.model.uid,a=r.get(i)||r.set(i,OX(t,n.model));(a.dataZoomInfoMap||=$l()).set(e.uid,{dzReferCoordSysInfo:n,model:e,getRange:null})})}),r.each(function(e){var n=e.controller,i,a=e.dataZoomInfoMap;if(a){var o=a.keys()[0];o!=null&&(i=a.get(o))}if(!i){DX(r,e);return}var s=jX(a,e,t);n.enable(s.controlType,s.opt),jP(e,`dispatchAction`,i.model.get(`throttle`,!0),`fixRate`)})})}var NX=function(e){U(t,e);function t(){var t=e!==null&&e.apply(this,arguments)||this;return t.type=`dataZoom.inside`,t}return t.prototype.render=function(t,n,r){if(e.prototype.render.apply(this,arguments),t.noTarget()){this._clear();return}this.range=t.getPercentRange(),TX(r,t,{pan:q(PX.pan,this),zoom:q(PX.zoom,this),scrollMove:q(PX.scrollMove,this)})},t.prototype.dispose=function(){this._clear(),e.prototype.dispose.apply(this,arguments)},t.prototype._clear=function(){EX(this.api,this.dataZoomModel),this.range=null},t.type=`dataZoom.inside`,t}(KK),PX={zoom:function(e,t,n,r){var i=this.range,a=i.slice(),o=e.axisModels[0];if(o){var s=IX[t](null,[r.originX,r.originY],o,n,e),c=(s.signal>0?s.pixelStart+s.pixelLength-s.pixel:s.pixel-s.pixelStart)/s.pixelLength*(a[1]-a[0])+a[0],l=Math.max(1/r.scale,0);a[0]=(a[0]-c)*l+c,a[1]=(a[1]-c)*l+c;var u=this.dataZoomModel.findRepresentativeAxisProxy().getMinMaxSpan();if(zH(0,a,[0,100],0,u.minSpan,u.maxSpan),this.range=a,i[0]!==a[0]||i[1]!==a[1])return a}},pan:FX(function(e,t,n,r,i,a){var o=IX[r]([a.oldX,a.oldY],[a.newX,a.newY],t,i,n);return o.signal*(e[1]-e[0])*o.pixel/o.pixelLength}),scrollMove:FX(function(e,t,n,r,i,a){return IX[r]([0,0],[a.scrollDelta,a.scrollDelta],t,i,n).signal*(e[1]-e[0])*a.scrollDelta})};function FX(e){return function(t,n,r,i){var a=this.range,o=a.slice(),s=t.axisModels[0];if(s&&(zH(e(o,s,t,n,r,i),o,[0,100],`all`),this.range=o,a[0]!==o[0]||a[1]!==o[1]))return o}}var IX={grid:function(e,t,n,r,i){var a=n.axis,o={},s=i.model.coordinateSystem.getRect();return e||=[0,0],a.dim===`x`?(o.pixel=t[0]-e[0],o.pixelLength=s.width,o.pixelStart=s.x,o.signal=a.inverse?1:-1):(o.pixel=t[1]-e[1],o.pixelLength=s.height,o.pixelStart=s.y,o.signal=a.inverse?-1:1),o},polar:function(e,t,n,r,i){var a=n.axis,o={},s=i.model.coordinateSystem,c=s.getRadiusAxis().getExtent(),l=s.getAngleAxis().getExtent();return e=e?s.pointToCoord(e):[0,0],t=s.pointToCoord(t),n.mainType===`radiusAxis`?(o.pixel=t[0]-e[0],o.pixelLength=c[1]-c[0],o.pixelStart=c[0],o.signal=a.inverse?1:-1):(o.pixel=t[1]-e[1],o.pixelLength=l[1]-l[0],o.pixelStart=l[0],o.signal=a.inverse?-1:1),o},singleAxis:function(e,t,n,r,i){var a=n.axis,o=i.model.coordinateSystem.getRect(),s={};return e||=[0,0],a.orient===`horizontal`?(s.pixel=t[0]-e[0],s.pixelLength=o.width,s.pixelStart=o.x,s.signal=a.inverse?1:-1):(s.pixel=t[1]-e[1],s.pixelLength=o.height,s.pixelStart=o.y,s.signal=a.inverse?-1:1),s}};function LX(e){QK(e),e.registerComponentModel(CX),e.registerComponentView(NX),MX(e)}var RX=function(e){U(t,e);function t(){var n=e!==null&&e.apply(this,arguments)||this;return n.type=t.type,n}return t.type=`dataZoom.slider`,t.layoutMode=`box`,t.defaultOption=AS(UK.defaultOption,{show:!0,right:`ph`,top:`ph`,width:`ph`,height:`ph`,left:null,bottom:null,borderColor:Q.color.accent10,borderRadius:0,backgroundColor:Q.color.transparent,dataBackground:{lineStyle:{color:Q.color.accent30,width:.5},areaStyle:{color:Q.color.accent20,opacity:.2}},selectedDataBackground:{lineStyle:{color:Q.color.accent40,width:.5},areaStyle:{color:Q.color.accent20,opacity:.3}},fillerColor:`rgba(135,175,274,0.2)`,handleIcon:`path://M-9.35,34.56V42m0-40V9.5m-2,0h4a2,2,0,0,1,2,2v21a2,2,0,0,1-2,2h-4a2,2,0,0,1-2-2v-21A2,2,0,0,1-11.35,9.5Z`,handleSize:`100%`,handleStyle:{color:Q.color.neutral00,borderColor:Q.color.accent20},moveHandleSize:7,moveHandleIcon:`path://M-320.9-50L-320.9-50c18.1,0,27.1,9,27.1,27.1V85.7c0,18.1-9,27.1-27.1,27.1l0,0c-18.1,0-27.1-9-27.1-27.1V-22.9C-348-41-339-50-320.9-50z M-212.3-50L-212.3-50c18.1,0,27.1,9,27.1,27.1V85.7c0,18.1-9,27.1-27.1,27.1l0,0c-18.1,0-27.1-9-27.1-27.1V-22.9C-239.4-41-230.4-50-212.3-50z M-103.7-50L-103.7-50c18.1,0,27.1,9,27.1,27.1V85.7c0,18.1-9,27.1-27.1,27.1l0,0c-18.1,0-27.1-9-27.1-27.1V-22.9C-130.9-41-121.8-50-103.7-50z`,moveHandleStyle:{color:Q.color.accent40,opacity:.5},showDetail:!0,showDataShadow:`auto`,realtime:!0,zoomLock:!1,textStyle:{color:Q.color.tertiary},brushSelect:!0,brushStyle:{color:Q.color.accent30,opacity:.3},emphasis:{handleLabel:{show:!0},handleStyle:{borderColor:Q.color.accent40},moveHandleStyle:{opacity:.8}},defaultLocationEdgeGap:15}),t}(UK),zX=z_,BX=1,VX=30,HX=7,UX=`horizontal`,WX=`vertical`,GX=5,KX=[`line`,`bar`,`candlestick`,`scatter`],qX={easing:`cubicOut`,duration:100,delay:0},JX=function(e){U(t,e);function t(){var n=e!==null&&e.apply(this,arguments)||this;return n.type=t.type,n._displayables={},n}return t.prototype.init=function(e,t){this.api=t,this._onBrush=q(this._onBrush,this),this._onBrushEnd=q(this._onBrushEnd,this)},t.prototype.render=function(t,n,r,i){if(e.prototype.render.apply(this,arguments),jP(this,`_dispatchZoomAction`,t.get(`throttle`),`fixRate`),this._orient=t.getOrient(),t.get(`show`)===!1){this.group.removeAll();return}if(t.noTarget()){this._clear(),this.group.removeAll();return}(!i||i.type!==`dataZoom`||i.from!==this.uid)&&this._buildView(),this._updateView()},t.prototype.dispose=function(){this._clear(),e.prototype.dispose.apply(this,arguments)},t.prototype._clear=function(){MP(this,`_dispatchZoomAction`);var e=this.api.getZr();e.off(`mousemove`,this._onBrush),e.off(`mouseup`,this._onBrushEnd)},t.prototype._buildView=function(){var e=this.group;e.removeAll(),this._brushing=!1,this._displayables.brushRect=null,this._resetLocation(),this._resetInterval();var t=this._displayables.sliderGroup=new Ky;this._renderBackground(),this._renderHandle(),this._renderDataShadow(),e.add(t),this._positionGroup()},t.prototype._resetLocation=function(){var e=this.dataZoomModel,t=this.api,n=e.get(`brushSelect`)?HX:0,r=hw(e,t).refContainer,i=this._findCoordRect(),a=e.get(`defaultLocationEdgeGap`,!0)||0,o=this._orient===UX?{right:r.width-i.x-i.width,top:r.height-VX-a-n,width:i.width,height:VX}:{right:a,top:i.y,width:VX,height:i.height},s=yw(e.option);G([`right`,`top`,`width`,`height`],function(e){s[e]===`ph`&&(s[e]=o[e])});var c=pw(s,r);this._location={x:c.x,y:c.y},this._size=[c.width,c.height],this._orient===WX&&this._size.reverse()},t.prototype._positionGroup=function(){var e=this.group,t=this._location,n=this._orient,r=this.dataZoomModel.getFirstTargetAxisModel(),i=r&&r.get(`inverse`),a=this._displayables.sliderGroup,o=(this._dataShadowInfo||{}).otherAxisInverse;a.attr(n===UX&&!i?{scaleY:o?1:-1,scaleX:1}:n===UX&&i?{scaleY:o?1:-1,scaleX:-1}:n===WX&&!i?{scaleY:o?-1:1,scaleX:1,rotation:Math.PI/2}:{scaleY:o?-1:1,scaleX:-1,rotation:Math.PI/2});var s=e.getBoundingRect([a]),c=isNaN(s.x)?0:s.x,l=isNaN(s.y)?0:s.y;e.x=t.x-c,e.y=t.y-l,e.markRedraw()},t.prototype._getViewExtent=function(){return[0,this._size[0]]},t.prototype._renderBackground=function(){var e=this.dataZoomModel,t=this._size,n=this._displayables.sliderGroup,r=e.get(`brushSelect`);n.add(new zX({silent:!0,shape:{x:0,y:0,width:t[0],height:t[1]},style:{fill:e.get(`backgroundColor`)},z2:-40}));var i=new zX({shape:{x:0,y:0,width:t[0],height:t[1]},style:{fill:`transparent`},z2:0,onclick:q(this._onClickPanel,this)}),a=this.api.getZr();r?(i.on(`mousedown`,this._onBrushStart,this),i.cursor=`crosshair`,a.on(`mousemove`,this._onBrush),a.on(`mouseup`,this._onBrushEnd)):(a.off(`mousemove`,this._onBrush),a.off(`mouseup`,this._onBrushEnd)),n.add(i)},t.prototype._renderDataShadow=function(){var e=this._dataShadowInfo=this._prepareDataShadowInfo();if(this._displayables.dataShadowSegs=[],!e)return;var t=this._size,n=this._shadowSize||[],r=e.series,i=r.getRawData(),a=r.getShadowDim&&r.getShadowDim(),o=a&&i.getDimensionInfo(a)?r.getShadowDim():e.otherDim;if(o==null)return;var s=this._shadowPolygonPts,c=this._shadowPolylinePts;if(i!==this._shadowData||o!==this._shadowDim||t[0]!==n[0]||t[1]!==n[1]){var l=i.getDataExtent(e.thisDim),u=i.getDataExtent(o),d=(u[1]-u[0])*.3;u=[u[0]-d,u[1]+d];var f=[0,t[1]],p=[0,t[0]],m=[[t[0],0],[0,0]],h=[],g=p[1]/Math.max(1,i.count()-1),_=t[0]/(l[1]-l[0]),v=e.thisAxis.type===`time`,y=-g,b=Math.round(i.count()/t[0]),x;i.each([e.thisDim,o],function(e,t,n){if(b>0&&n%b){v||(y+=g);return}y=v?(+e-l[0])*_:y+g;var r=t==null||isNaN(t)||t===``,i=r?0:Su(t,u,f,!0);r&&!x&&n?(m.push([m[m.length-1][0],0]),h.push([h[h.length-1][0],0])):!r&&x&&(m.push([y,0]),h.push([y,0])),r||(m.push([y,i]),h.push([y,i])),x=r}),s=this._shadowPolygonPts=m,c=this._shadowPolylinePts=h}this._shadowData=i,this._shadowDim=o,this._shadowSize=[t[0],t[1]];var S=this.dataZoomModel;function C(e){var t=S.getModel(e?`selectedDataBackground`:`dataBackground`),n=new Ky,r=new yb({shape:{points:s},segmentIgnoreThreshold:1,style:t.getModel(`areaStyle`).getAreaStyle(),silent:!0,z2:-20}),i=new xb({shape:{points:c},segmentIgnoreThreshold:1,style:t.getModel(`lineStyle`).getLineStyle(),silent:!0,z2:-19});return n.add(r),n.add(i),n}for(var w=0;w<3;w++){var T=C(w===1);this._displayables.sliderGroup.add(T),this._displayables.dataShadowSegs.push(T)}},t.prototype._prepareDataShadowInfo=function(){var e=this.dataZoomModel,t=e.get(`showDataShadow`);if(t!==!1){var n,r=this.ecModel;return e.eachTargetAxis(function(i,a){G(e.getAxisProxy(i,a).getTargetSeriesModels(),function(e){if(!n&&!(t!==!0&&bl(KX,e.get(`type`))<0)){var o=r.getComponent(FK(i),a).axis,s=XX(i),c,l=e.coordinateSystem;s!=null&&l.getOtherAxis&&(c=l.getOtherAxis(o).inverse),s=e.getData().mapDimension(s),n={thisAxis:o,series:e,thisDim:e.getData().mapDimension(i),otherDim:s,otherAxisInverse:c}}},this)},this),n}},t.prototype._renderHandle=function(){var e=this.group,t=this._displayables,n=t.handles=[null,null],r=t.handleLabels=[null,null],i=this._displayables.sliderGroup,a=this._size,o=this.dataZoomModel,s=this.api,c=o.get(`borderRadius`)||0,l=o.get(`brushSelect`),u=t.filler=new zX({silent:l,style:{fill:o.get(`fillerColor`)},textConfig:{position:`inside`}});i.add(u),i.add(new zX({silent:!0,subPixelOptimize:!0,shape:{x:0,y:0,width:a[0],height:a[1],r:c},style:{stroke:o.get(`dataBackgroundColor`)||o.get(`borderColor`),lineWidth:BX,fill:Q.color.transparent}})),G([0,1],function(t){var a=o.get(`handleIcon`);!SA[a]&&a.indexOf(`path://`)<0&&a.indexOf(`image://`)<0&&(a=`path://`+a);var s=TA(a,-1,0,2,2,null,!0);s.attr({cursor:ZX(this._orient),draggable:!0,drift:q(this._onDragMove,this,t),ondragend:q(this._onDragEnd,this),onmouseover:q(this._onOverDataInfoTriggerArea,this,!0),onmouseout:q(this._onOverDataInfoTriggerArea,this,!1),z2:5});var c=s.getBoundingRect(),l=o.get(`handleSize`);this._handleHeight=Cu(l,this._size[1]),this._handleWidth=c.width/c.height*this._handleHeight,s.setStyle(o.getModel(`handleStyle`).getItemStyle()),s.style.strokeNoScale=!0,s.rectHover=!0,s.ensureState(`emphasis`).style=o.getModel([`emphasis`,`handleStyle`]).getItemStyle(),dy(s);var u=o.get(`handleColor`);u!=null&&(s.style.fill=u),i.add(n[t]=s);var d=o.getModel(`textStyle`),f=(o.get(`handleLabel`)||{}).show||!1;e.add(r[t]=new W_({silent:!0,invisible:!f,style:nS(d,{x:0,y:0,text:``,verticalAlign:`middle`,align:`center`,fill:d.getTextColor(),font:d.getFont()}),z2:10}))},this);var d=u;if(l){var f=Cu(o.get(`moveHandleSize`),a[1]),p=t.moveHandle=new z_({style:o.getModel(`moveHandleStyle`).getItemStyle(),silent:!0,shape:{r:[0,0,2,2],y:a[1]-.5,height:f}}),m=f*.8,h=t.moveHandleIcon=TA(o.get(`moveHandleIcon`),-m/2,-m/2,m,m,Q.color.neutral00,!0);h.silent=!0,h.y=a[1]+f/2-.5,p.ensureState(`emphasis`).style=o.getModel([`emphasis`,`moveHandleStyle`]).getItemStyle();var g=Math.min(a[1]/2,Math.max(f,10));d=t.moveZone=new z_({invisible:!0,shape:{y:a[1]-g,height:f+g}}),d.on(`mouseover`,function(){s.enterEmphasis(p)}).on(`mouseout`,function(){s.leaveEmphasis(p)}),i.add(p),i.add(h),i.add(d)}d.attr({draggable:!0,cursor:`grab`,drift:q(this._onActualMoveZoneDrift,this),ondragstart:q(this._onActualMoveZoneDragStart,this),ondragend:q(this._onActualMoveZoneDragEnd,this),onmouseover:q(this._onOverDataInfoTriggerArea,this,!0),onmouseout:q(this._onOverDataInfoTriggerArea,this,!1)})},t.prototype._resetInterval=function(){var e=this._range=this.dataZoomModel.getPercentRange(),t=this._getViewExtent();this._handleEnds=[Su(e[0],[0,100],t,!0),Su(e[1],[0,100],t,!0)]},t.prototype._updateInterval=function(e,t){var n=this.dataZoomModel,r=this._handleEnds,i=this._getViewExtent(),a=n.findRepresentativeAxisProxy().getMinMaxSpan(),o=[0,100];zH(t,r,i,n.get(`zoomLock`)?`all`:e,a.minSpan==null?null:Su(a.minSpan,o,i,!0),a.maxSpan==null?null:Su(a.maxSpan,o,i,!0));var s=this._range,c=this._range=Ou([Su(r[0],i,o,!0),Su(r[1],i,o,!0)]);return!s||s[0]!==c[0]||s[1]!==c[1]},t.prototype._updateView=function(e){var t=this._displayables,n=this._handleEnds,r=Ou(n.slice()),i=this._size;G([0,1],function(e){var r=t.handles[e],a=this._handleHeight;r.attr({scaleX:a/2,scaleY:a/2,x:n[e]+(e?-1:1),y:i[1]/2-a/2})},this),t.filler.setShape({x:r[0],y:0,width:r[1]-r[0],height:i[1]});var a={x:r[0],width:r[1]-r[0]};t.moveHandle&&(t.moveHandle.setShape(a),t.moveZone.setShape(a),t.moveZone.getBoundingRect(),t.moveHandleIcon&&t.moveHandleIcon.attr(`x`,a.x+a.width/2));for(var o=t.dataShadowSegs,s=[0,r[0],r[1],i[0]],c=0;ct[0]||n[1]<0||n[1]>t[1])){var r=this._handleEnds,i=(r[0]+r[1])/2,a=this._updateInterval(`all`,n[0]-i);this._updateView(),a&&this._dispatchZoomAction(!1)}},t.prototype._onBrushStart=function(e){var t=e.offsetX,n=e.offsetY;this._brushStart=new Qf(t,n),this._brushing=!0,this._brushStartTime=+new Date},t.prototype._onBrushEnd=function(e){if(this._brushing){var t=this._displayables.brushRect;if(this._brushing=!1,t){t.attr(`ignore`,!0);var n=t.shape;if(!(+new Date-this._brushStartTime<200&&Math.abs(n.width)<5)){var r=this._getViewExtent(),i=[0,100],a=this._handleEnds=[n.x,n.x+n.width],o=this.dataZoomModel.findRepresentativeAxisProxy().getMinMaxSpan();zH(0,a,r,0,o.minSpan==null?null:Su(o.minSpan,i,r,!0),o.maxSpan==null?null:Su(o.maxSpan,i,r,!0)),this._range=Ou([Su(a[0],r,i,!0),Su(a[1],r,i,!0)]),this._updateView(),this._dispatchZoomAction(!1)}}}},t.prototype._onBrush=function(e){this._brushing&&(pM(e.event),this._updateBrushRect(e.offsetX,e.offsetY))},t.prototype._updateBrushRect=function(e,t){var n=this._displayables,r=this.dataZoomModel,i=n.brushRect;i||(i=n.brushRect=new zX({silent:!0,style:r.getModel(`brushStyle`).getItemStyle()}),n.sliderGroup.add(i)),i.attr(`ignore`,!1);var a=this._brushStart,o=this._displayables.sliderGroup,s=o.transformCoordToLocal(e,t),c=o.transformCoordToLocal(a.x,a.y),l=this._size;s[0]=Math.max(Math.min(l[0],s[0]),0),i.setShape({x:c[0],y:0,width:s[0]-c[0],height:l[1]})},t.prototype._dispatchZoomAction=function(e){var t=this._range;this.api.dispatchAction({type:`dataZoom`,from:this.uid,dataZoomId:this.dataZoomModel.id,animation:e?qX:null,start:t[0],end:t[1]})},t.prototype._findCoordRect=function(){var e,t=LK(this.dataZoomModel).infoList;if(!e&&t.length){var n=t[0].model.coordinateSystem;e=n.getRect&&n.getRect()}if(!e){var r=this.api.getWidth(),i=this.api.getHeight();e={x:r*.2,y:i*.2,width:r*.6,height:i*.6}}return e},t.type=`dataZoom.slider`,t}(KK);function YX(e,t,n,r){var i=e.get(`labelFormatter`),a=e.get(`labelPrecision`);(a==null||a===`auto`)&&(a=n.valuePrecision);var o=n.value[t],s=o==null||isNaN(o)?``:tO(r)||$D(r)?r.getLabel({value:Math.round(o)}):isFinite(a)?Du(o,a,!0):o+``;return Al(i)?i(o,s):Y(i)?i.replace(`{value}`,s):s}function XX(e){return{x:`y`,y:`x`,radius:`angle`,angle:`radius`}[e]}function ZX(e){return e===`vertical`?`ns-resize`:`ew-resize`}function QX(e){e.registerComponentModel(RX),e.registerComponentView(JX),QK(e)}function $X(e){aR(LX),aR(QX)}var eZ={get:function(e,t,n){var r=hl((tZ[e]||{})[t]);return n&&J(r)?r[r.length-1]:r}},tZ={color:{active:[`#006edd`,`#e0ffff`],inactive:[Q.color.transparent]},colorHue:{active:[0,360],inactive:[0,0]},colorSaturation:{active:[.3,1],inactive:[0,0]},colorLightness:{active:[.9,.5],inactive:[0,0]},colorAlpha:{active:[.3,1],inactive:[0,0]},opacity:{active:[.3,1],inactive:[0,0]},symbol:{active:[`circle`,`roundRect`,`diamond`],inactive:[`none`]},symbolSize:{active:[10,50],inactive:[0,0]}},nZ=cH.mapVisual,rZ=cH.eachVisual,iZ=J,aZ=G,oZ=Ou,sZ=Su,cZ=function(e){U(t,e);function t(){var n=e!==null&&e.apply(this,arguments)||this;return n.type=t.type,n.stateList=[`inRange`,`outOfRange`],n.replacableOptionKeys=[`inRange`,`outOfRange`,`target`,`controller`,`color`],n.layoutMode={type:`box`,ignoreSize:!0},n.dataBound=[-1/0,1/0],n.targetVisuals={},n.controllerVisuals={},n}return t.prototype.init=function(e,t,n){this.mergeDefaultAndTheme(e,n)},t.prototype.optionUpdated=function(e,t){var n=this.option;!t&&VJ(n,e,this.replacableOptionKeys),this.textStyleModel=this.getModel(`textStyle`),this.resetItemSize(),this.completeVisualOption()},t.prototype.resetVisual=function(e){var t=this.stateList;e=q(e,this),this.controllerVisuals=BJ(this.option.controller,t,e),this.targetVisuals=BJ(this.option.target,t,e)},t.prototype.getItemSymbol=function(){return null},t.prototype.getTargetSeriesIndices=function(){var e=this,t=this.option.seriesTargets;if(t){var n=[];return aZ(t,function(t){if(t.seriesIndex!=null)n.push(t.seriesIndex);else if(t.seriesId!=null){var r;e.ecModel.eachSeries(function(e){e.id===t.seriesId&&(r=e)}),r&&n.push(r.componentIndex)}}),n}var r=this.option.seriesId,i=this.option.seriesIndex;i==null&&r==null&&(i=`all`);var a=jd(this.ecModel,`series`,{index:i,id:r},{useDefault:!1,enableAll:!0,enableNone:!1}).models;return K(a,function(e){return e.componentIndex})},t.prototype.eachTargetSeries=function(e,t){G(this.getTargetSeriesIndices(),function(n){var r=this.ecModel.getSeriesByIndex(n);r&&e.call(t,r)},this)},t.prototype.isTargetSeries=function(e){var t=!1;return this.eachTargetSeries(function(n){n===e&&(t=!0)}),t},t.prototype.formatValueText=function(e,t,n){var r=this.option,i=r.precision,a=this.dataBound,o=r.formatter,s;n||=[`<`,`>`],J(e)&&(e=e.slice(),s=!0);var c=t?e:s?[l(e[0]),l(e[1])]:l(e);return Y(o)?o.replace(`{value}`,s?c[0]:c).replace(`{value2}`,s?c[1]:c):Al(o)?s?o(e[0],e[1]):o(e):s?e[0]===a[0]?n[0]+` `+c[1]:e[1]===a[1]?n[1]+` `+c[0]:c[0]+` - `+c[1]:c;function l(e){return e===a[0]?`min`:e===a[1]?`max`:(+e).toFixed(Math.min(i,20))}},t.prototype.resetExtent=function(){var e=this.option,t=oZ([e.min,e.max]);this._dataExtent=t},t.prototype.getDimension=function(e){var t=this,n=this.option.seriesTargets;if(n){var r=El(n,function(n){return n.seriesIndex!=null&&n.seriesIndex===e||n.seriesId!=null&&n.seriesId===t.ecModel.getSeriesByIndex(e).id});if(r)return r.dimension}return this.option.dimension},t.prototype.getDataDimensionIndex=function(e){var t=e.hostModel.seriesIndex,n=this.getDimension(t);if(n!=null)return e.getDimensionIndex(n);for(var r=e.dimensions,i=r.length-1;i>=0;i--){var a=r[i],o=e.getDimensionInfo(a);if(!o.isCalculationCoord)return o.storeDimIndex}},t.prototype.getExtent=function(){return this._dataExtent.slice()},t.prototype.completeVisualOption=function(){var e=this.ecModel,t=this.option,n={inRange:t.inRange,outOfRange:t.outOfRange},r=t.target||={},i=t.controller||={};gl(r,n),gl(i,n);var a=this.isCategory();o.call(this,r),o.call(this,i),s.call(this,r,`inRange`,`outOfRange`),c.call(this,i);function o(n){iZ(t.color)&&!n.inRange&&(n.inRange={color:t.color.slice().reverse()}),n.inRange=n.inRange||{color:e.get(`gradientColor`)}}function s(e,t,n){var r=e[t],i=e[n];r&&!i&&(i=e[n]={},aZ(r,function(e,t){if(cH.isValidType(t)){var n=eZ.get(t,`inactive`,a);n!=null&&(i[t]=n,t===`color`&&!i.hasOwnProperty(`opacity`)&&!i.hasOwnProperty(`colorAlpha`)&&(i.opacity=[0,0]))}}))}function c(e){var t=(e.inRange||{}).symbol||(e.outOfRange||{}).symbol,n=(e.inRange||{}).symbolSize||(e.outOfRange||{}).symbolSize,r=this.get(`inactiveColor`),i=this.getItemSymbol()||`roundRect`;aZ(this.stateList,function(o){var s=this.itemSize,c=e[o];c||=e[o]={color:a?r:[r]},c.symbol??(c.symbol=t&&hl(t)||(a?i:[i])),c.symbolSize??(c.symbolSize=n&&hl(n)||(a?s[0]:[s[0],s[0]])),c.symbol=nZ(c.symbol,function(e){return e===`none`?i:e});var l=c.symbolSize;if(l!=null){var u=-1/0;rZ(l,function(e){e>u&&(u=e)}),c.symbolSize=nZ(l,function(e){return sZ(e,[0,u],[0,s[0]],!0)})}},this)}},t.prototype.resetItemSize=function(){this.itemSize=[parseFloat(this.get(`itemWidth`)),parseFloat(this.get(`itemHeight`))]},t.prototype.isCategory=function(){return!!this.option.categories},t.prototype.setSelected=function(e){},t.prototype.getSelected=function(){return null},t.prototype.getValueState=function(e){return null},t.prototype.getVisualMeta=function(e){return null},t.type=`visualMap`,t.dependencies=[`series`],t.defaultOption={show:!0,z:4,min:0,max:200,left:0,right:null,top:null,bottom:0,itemWidth:null,itemHeight:null,inverse:!1,orient:`vertical`,backgroundColor:Q.color.transparent,borderColor:Q.color.borderTint,contentColor:Q.color.theme[0],inactiveColor:Q.color.disabled,borderWidth:0,padding:Q.size.m,textGap:10,precision:0,textStyle:{color:Q.color.secondary}},t}(Sw),lZ=[20,140],uZ=function(e){U(t,e);function t(){var n=e!==null&&e.apply(this,arguments)||this;return n.type=t.type,n}return t.prototype.optionUpdated=function(t,n){e.prototype.optionUpdated.apply(this,arguments),this.resetExtent(),this.resetVisual(function(e){e.mappingMethod=`linear`,e.dataExtent=this.getExtent()}),this._resetRange()},t.prototype.resetItemSize=function(){e.prototype.resetItemSize.apply(this,arguments);var t=this.itemSize;(t[0]==null||isNaN(t[0]))&&(t[0]=lZ[0]),(t[1]==null||isNaN(t[1]))&&(t[1]=lZ[1])},t.prototype._resetRange=function(){var e=this.getExtent(),t=this.option.range;!t||t.auto?(e.auto=1,this.option.range=e):J(t)&&(t[0]>t[1]&&t.reverse(),t[0]=Math.max(t[0],e[0]),t[1]=Math.min(t[1],e[1]))},t.prototype.completeVisualOption=function(){e.prototype.completeVisualOption.apply(this,arguments),G(this.stateList,function(e){var t=this.option.controller[e].symbolSize;t&&t[0]!==t[1]&&(t[0]=t[1]/3)},this)},t.prototype.setSelected=function(e){this.option.range=e.slice(),this._resetRange()},t.prototype.getSelected=function(){var e=this.getExtent(),t=Ou((this.get(`range`)||[]).slice());return t[0]>e[1]&&(t[0]=e[1]),t[1]>e[1]&&(t[1]=e[1]),t[0]=n[1]||e<=t[1])?`inRange`:`outOfRange`},t.prototype.findTargetDataIndices=function(e){var t=[];return this.eachTargetSeries(function(n){var r=[],i=n.getData();i.each(this.getDataDimensionIndex(i),function(t,n){e[0]<=t&&t<=e[1]&&r.push(n)},this),t.push({seriesId:n.id,dataIndex:r})},this),t},t.prototype.getVisualMeta=function(e){var t=dZ(this,`outOfRange`,this.getExtent()),n=dZ(this,`inRange`,this.option.range.slice()),r=[];function i(t,n){r.push({value:t,color:e(t,n)})}for(var a=0,o=0,s=n.length,c=t.length;oe[1])break;r.push({color:this.getControllerVisual(o,`color`,t),offset:a/n})}return r.push({color:this.getControllerVisual(e[1],`color`,t),offset:1}),r},t.prototype._createBarPoints=function(e,t){var n=this.visualMapModel.itemSize;return[[n[0]-t[0],e[0]],[n[0],e[0]],[n[0],e[1]],[n[0]-t[1],e[1]]]},t.prototype._createBarGroup=function(e){var t=this._orient,n=this.visualMapModel.get(`inverse`);return new Ky(t===`horizontal`&&!n?{scaleX:e===`bottom`?1:-1,rotation:Math.PI/2}:t===`horizontal`&&n?{scaleX:e===`bottom`?-1:1,rotation:-Math.PI/2}:t===`vertical`&&!n?{scaleX:e===`left`?1:-1,scaleY:-1}:{scaleX:e===`left`?1:-1})},t.prototype._updateHandle=function(e,t){if(this._useHandle){var n=this._shapes,r=this.visualMapModel,i=n.handleThumbs,a=n.handleLabels,o=r.itemSize,s=r.getExtent(),c=this._applyTransform(`left`,n.mainGroup);_Z([0,1],function(l){var u=i[l];u.setStyle(`fill`,t.handlesColor[l]),u.y=e[l];var d=gZ(e[l],[0,o[1]],s,!0),f=this.getControllerVisual(d,`symbolSize`);u.scaleX=u.scaleY=f/o[0],u.x=o[0]-f/2;var p=bx(n.handleLabelPoints[l],yx(u,this.group));if(this._orient===`horizontal`){var m=c===`left`||c===`top`?(o[0]-f)/2:(o[0]-f)/-2;p[1]+=m}a[l].setStyle({x:p[0],y:p[1],text:r.formatValueText(this._dataInterval[l]),verticalAlign:`middle`,align:this._orient===`vertical`?this._applyTransform(`left`,n.mainGroup):`center`})},this)}},t.prototype._showIndicator=function(e,t,n,r){var i=this.visualMapModel,a=i.getExtent(),o=i.itemSize,s=[0,o[1]],c=this._shapes,l=c.indicator;if(l){l.attr(`invisible`,!1);var u=this.getControllerVisual(e,`color`,{convertOpacityToAlpha:!0}),d=this.getControllerVisual(e,`symbolSize`),f=gZ(e,a,s,!0),p=o[0]-d/2,m={x:l.x,y:l.y};l.y=f,l.x=p;var h=bx(c.indicatorLabelPoint,yx(l,this.group)),g=c.indicatorLabel;g.attr(`invisible`,!1);var _=this._applyTransform(`left`,c.mainGroup),v=this._orient===`horizontal`;g.setStyle({text:(n||``)+i.formatValueText(t),verticalAlign:v?_:`middle`,align:v?`center`:_});var y={x:p,y:f,style:{fill:u}},b={style:{x:h[0],y:h[1]}};if(i.ecModel.isAnimationEnabled()&&!this._firstShowIndicator){var x={duration:100,easing:`cubicInOut`,additive:!0};l.x=m.x,l.y=m.y,l.animateTo(y,x),g.animateTo(b,x)}else l.attr(y),g.attr(b);this._firstShowIndicator=!1;var S=this._shapes.handleLabels;if(S)for(var C=0;Ci[1]&&(l[1]=1/0),t&&(l[0]===-1/0?this._showIndicator(c,l[1],`< `,o):l[1]===1/0?this._showIndicator(c,l[0],`> `,o):this._showIndicator(c,c,`≈ `,o));var u=this._hoverLinkDataIndices,d=[];(t||TZ(n))&&(d=this._hoverLinkDataIndices=n.findTargetDataIndices(l));var f=Cd(u,d);this._dispatchHighDown(`downplay`,hZ(f[0],n)),this._dispatchHighDown(`highlight`,hZ(f[1],n))}},t.prototype._hoverLinkFromSeriesMouseOver=function(e){var t;if(yF(e.target,function(e){var n=iv(e);if(n.dataIndex!=null)return t=n,!0},!0),t){var n=this.ecModel.getSeriesByIndex(t.seriesIndex),r=this.visualMapModel;if(r.isTargetSeries(n)){var i=n.getData(t.dataType),a=i.getStore().get(r.getDataDimensionIndex(i),t.dataIndex);isNaN(a)||this._showIndicator(a,a)}}},t.prototype._hideIndicator=function(){var e=this._shapes;e.indicator&&e.indicator.attr(`invisible`,!0),e.indicatorLabel&&e.indicatorLabel.attr(`invisible`,!0);var t=this._shapes.handleLabels;if(t)for(var n=0;n=0&&(i.dimension=a,r.push(i))}}),e.getData().setVisual(`visualMeta`,r)}}];function AZ(e,t,n,r){for(var i=t.targetVisuals[r],a=cH.prepareVisualTypes(i),o={color:hF(e.getData(),`color`)},s=0,c=a.length;s0:e.splitNumber>0)||e.calculable)?`continuous`:`piecewise`}),e.registerAction(DZ,OZ),G(kZ,function(t){e.registerVisual(e.PRIORITY.VISUAL.COMPONENT,t)}),e.registerPreprocessor(MZ))}function IZ(e){e.registerComponentModel(uZ),e.registerComponentView(SZ),FZ(e)}var LZ=function(e){U(t,e);function t(){var n=e!==null&&e.apply(this,arguments)||this;return n.type=t.type,n._pieceList=[],n}return t.prototype.optionUpdated=function(t,n){e.prototype.optionUpdated.apply(this,arguments),this.resetExtent();var r=this._mode=this._determineMode();this._pieceList=[],RZ[this._mode].call(this,this._pieceList),this._resetSelected(t,n);var i=this.option.categories;this.resetVisual(function(e,t){r===`categories`?(e.mappingMethod=`category`,e.categories=hl(i)):(e.dataExtent=this.getExtent(),e.mappingMethod=`piecewise`,e.pieceList=K(this._pieceList,function(e){return e=hl(e),t!==`inRange`&&(e.visual=null),e}))})},t.prototype.completeVisualOption=function(){var t=this.option,n={},r=cH.listVisualTypes(),i=this.isCategory();G(t.pieces,function(e){G(r,function(t){e.hasOwnProperty(t)&&(n[t]=1)})}),G(n,function(e,n){var r=!1;G(this.stateList,function(e){r=r||a(t,e,n)||a(t.target,e,n)},this),!r&&G(this.stateList,function(e){(t[e]||(t[e]={}))[n]=eZ.get(n,e===`inRange`?`active`:`inactive`,i)})},this);function a(e,t,n){return e&&e[t]&&e[t].hasOwnProperty(n)}e.prototype.completeVisualOption.apply(this,arguments)},t.prototype._resetSelected=function(e,t){var n=this.option,r=this._pieceList,i=(t?n:e).selected||{};if(n.selected=i,G(r,function(e,t){var n=this.getSelectedMapKey(e);i.hasOwnProperty(n)||(i[n]=!0)},this),n.selectedMode===`single`){var a=!1;G(r,function(e,t){var n=this.getSelectedMapKey(e);i[n]&&(a?i[n]=!1:a=!0)},this)}},t.prototype.getItemSymbol=function(){return this.get(`itemSymbol`)},t.prototype.getSelectedMapKey=function(e){return this._mode===`categories`?e.value+``:e.index+``},t.prototype.getPieceList=function(){return this._pieceList},t.prototype._determineMode=function(){var e=this.option;return e.pieces&&e.pieces.length>0?`pieces`:this.option.categories?`categories`:`splitNumber`},t.prototype.setSelected=function(e){this.option.selected=hl(e)},t.prototype.getValueState=function(e){var t=cH.findPieceIndex(e,this._pieceList);return t==null?`outOfRange`:this.option.selected[this.getSelectedMapKey(this._pieceList[t])]?`inRange`:`outOfRange`},t.prototype.findTargetDataIndices=function(e){var t=[],n=this._pieceList;return this.eachTargetSeries(function(r){var i=[],a=r.getData();a.each(this.getDataDimensionIndex(a),function(t,r){cH.findPieceIndex(t,n)===e&&i.push(r)},this),t.push({seriesId:r.id,dataIndex:i})},this),t},t.prototype.getRepresentValue=function(e){var t;if(this.isCategory())t=e.value;else if(e.value!=null)t=e.value;else{var n=e.interval||[];t=n[0]===-1/0&&n[1]===1/0?0:(n[0]+n[1])/2}return t},t.prototype.getVisualMeta=function(e){if(this.isCategory())return;var t=[],n=[``,``],r=this;function i(i,a){var o=r.getRepresentValue({interval:i});a||=r.getValueState(o);var s=e(o,a);i[0]===-1/0?n[0]=s:i[1]===1/0?n[1]=s:t.push({value:i[0],color:s},{value:i[1],color:s})}var a=this._pieceList.slice();if(!a.length)a.push({interval:[-1/0,1/0]});else{var o=a[0].interval[0];o!==-1/0&&a.unshift({interval:[-1/0,o]}),o=a[a.length-1].interval[1],o!==1/0&&a.push({interval:[o,1/0]})}var s=-1/0;return G(a,function(e){var t=e.interval;t&&(t[0]>s&&i([s,t[0]],`outOfRange`),i(t.slice()),s=t[1])},this),{stops:t,outerColors:n}},t.type=`visualMap.piecewise`,t.defaultOption=AS(cZ.defaultOption,{selected:null,minOpen:!1,maxOpen:!1,align:`auto`,itemWidth:20,itemHeight:14,itemSymbol:`roundRect`,pieces:null,categories:null,splitNumber:5,selectedMode:`multiple`,itemGap:10,hoverLink:!0}),t}(cZ),RZ={splitNumber:function(e){var t=this.option,n=Math.min(t.precision,20),r=this.getExtent(),i=t.splitNumber;i=Math.max(parseInt(i,10),1),t.splitNumber=i;for(var a=(r[1]-r[0])/i;+a.toFixed(n)!==a&&n<5;)n++;t.precision=n,a=+a.toFixed(n),t.minOpen&&e.push({interval:[-1/0,r[0]],close:[0,0]});for(var o=0,s=r[0];o`,`≥`][t[0]]];e.text=e.text||this.formatValueText(e.value==null?e.interval:e.value,!1,n)},this)}};function zZ(e,t){var n=e.inverse;(e.orient===`vertical`?!n:n)&&t.reverse()}var BZ=function(e){U(t,e);function t(){var n=e!==null&&e.apply(this,arguments)||this;return n.type=t.type,n}return t.prototype.doRender=function(){var e=this.group;e.removeAll();var t=this.visualMapModel,n=t.get(`textGap`),r=t.textStyleModel,i=this._getItemAlign(),a=t.itemSize,o=this._getViewData(),s=o.endsText,c=Bl(t.get(`showLabel`,!0),!s),l=!t.get(`selectedMode`);s&&this._renderEndsText(e,s[0],a,c,i),G(o.viewPieceList,function(o){var s=o.piece,u=new Ky;u.onclick=q(this._onItemClick,this,s),this._enableHoverLink(u,o.indexInModelPieceList);var d=t.getRepresentValue(s);if(this._createItemSymbol(u,d,[0,0,a[0],a[1]],l),c){var f=this.visualMapModel.getValueState(d),p=r.get(`align`)||i;u.add(new W_({style:nS(r,{x:p===`right`?-n:a[0]+n,y:a[1]/2,text:s.text,verticalAlign:r.get(`verticalAlign`)||`middle`,align:p,opacity:X(r.get(`opacity`),f===`outOfRange`?.5:1)}),silent:l}))}e.add(u)},this),s&&this._renderEndsText(e,s[1],a,c,i),dw(t.get(`orient`),e,t.get(`itemGap`)),this.renderBackground(e),this.positionGroup(e)},t.prototype._enableHoverLink=function(e,t){var n=this;e.on(`mouseover`,function(){return r(`highlight`)}).on(`mouseout`,function(){return r(`downplay`)});var r=function(e){var r=n.visualMapModel;r.option.hoverLink&&n.api.dispatchAction({type:e,batch:hZ(r.findTargetDataIndices(t),r)})}},t.prototype._getItemAlign=function(){var e=this.visualMapModel,t=e.option;if(t.orient===`vertical`)return mZ(e,this.api,e.itemSize);var n=t.align;return(!n||n===`auto`)&&(n=`left`),n},t.prototype._renderEndsText=function(e,t,n,r,i){if(t){var a=new Ky,o=this.visualMapModel.textStyleModel;a.add(new W_({style:nS(o,{x:r?i===`right`?n[0]:0:n[0]/2,y:n[1]/2,verticalAlign:`middle`,align:r?i:`center`,text:t})})),e.add(a)}},t.prototype._getViewData=function(){var e=this.visualMapModel,t=K(e.getPieceList(),function(e,t){return{piece:e,indexInModelPieceList:t}}),n=e.get(`text`),r=e.get(`orient`),i=e.get(`inverse`);return(r===`horizontal`?i:!i)?t.reverse():n&&=n.slice().reverse(),{viewPieceList:t,endsText:n}},t.prototype._createItemSymbol=function(e,t,n,r){var i=TA(this.getControllerVisual(t,`symbol`),n[0],n[1],n[2],n[3],this.getControllerVisual(t,`color`));i.silent=r,e.add(i)},t.prototype._onItemClick=function(e){var t=this.visualMapModel,n=t.option,r=n.selectedMode;if(r){var i=hl(n.selected),a=t.getSelectedMapKey(e);r===`single`||r===!0?(i[a]=!0,G(i,function(e,t){i[t]=t===a})):i[a]=!i[a],this.api.dispatchAction({type:`selectDataRange`,from:this.uid,visualMapId:this.visualMapModel.id,selected:i})}},t.type=`visualMap.piecewise`,t}(fZ);function VZ(e){e.registerComponentModel(LZ),e.registerComponentView(BZ),FZ(e)}function HZ(e){aR(IZ),aR(VZ)}var UZ={label:{enabled:!0},decal:{show:!1}},WZ=Td(),GZ=Td(),KZ=$d(qZ);function qZ(e,t){var n=e.getModel(`aria`);if(!n.get(`enabled`))return;var r=GZ(e).scope||(GZ(e).scope={}),i=hl(UZ);gl(i.label,e.getLocaleModel().get(`aria`),!1),gl(n.option,i,!1),a(),o();function a(){if(n.getModel(`decal`).get(`show`)){var t=$l();e.eachSeries(function(e){e.isColorBySeries()||(WZ(e).scope=t.get(e.type)||t.set(e.type,{}))}),e.eachSeries(function(t){if(Al(t.enableAriaDecal)){t.enableAriaDecal();return}var n=t.getData();if(t.isColorBySeries()){var i=Dw(t.ecModel,t.name,r,e.getSeriesCount()),a=n.getVisual(`decal`);n.setVisual(`decal`,u(a,i))}else{var o=t.getRawData(),s={},c=WZ(t).scope;n.each(function(e){var t=n.getRawIndex(e);s[t]=e});var l=o.count();o.each(function(e){var r=s[e],i=o.getName(e)||e+``,a=Dw(t.ecModel,i,c,l),d=n.getItemVisual(r,`decal`);n.setItemVisual(r,`decal`,u(d,a))})}function u(e,t){var n=e?W(W({},t),e):t;return n.dirty=!0,n}})}}function o(){var r=t.getZr().dom;if(r){var i=e.getLocaleModel().get(`aria`),a=n.getModel(`label`);if(a.option=yl(a.option,i),a.get(`enabled`)){if(r.setAttribute(`role`,`img`),a.get(`description`)){r.setAttribute(`aria-label`,a.get(`description`));return}var o=e.getSeriesCount(),u=a.get([`data`,`maxCount`])||10,d=a.get([`series`,`maxCount`])||10,f=Math.min(o,d),p;if(!(o<1)){var m=c();p=m?s(a.get([`general`,`withTitle`]),{title:m}):a.get([`general`,`withoutTitle`]);var h=[],g=o>1?a.get([`series`,`multiple`,`prefix`]):a.get([`series`,`single`,`prefix`]);p+=s(g,{seriesCount:o}),e.eachSeries(function(e,t){if(t1?a.get([`series`,`multiple`,r]):a.get([`series`,`single`,r]),n=s(n,{seriesId:e.seriesIndex,seriesName:e.get(`name`),seriesType:l(e.subType)});var i=e.getData();if(i.count()>u){var c=a.get([`data`,`partialData`]);n+=s(c,{displayCnt:u})}else n+=a.get([`data`,`allData`]);for(var d=a.get([`data`,`separator`,`middle`]),p=a.get([`data`,`separator`,`end`]),m=a.get([`data`,`excludeDimensionId`]),g=[],_=0;_=a}}}for(var l=QZ(this),u=l.startIdx;u=0)&&(a=!0)}),a||i.__dirty){var o=n._opts.useDirtyRect&&!ZZ(i)?i.createRepaintRects(e,t,n._width,n._height):null,s=n._i.layerStack[0],c=!0;if(i.__dirty){c=!1,i.__dirty=!1;var l=i.zlevel===s.zl&&i.zlevel2===s.zl2?n._backgroundColor:null;i.clear(!1,l,o)}dQ(i,function(t){var a=n._paintPerCursor(i,t,e,o,c);r&&=a})}},_Q),ou.wxa&&pQ(this._i,function(e){e&&e.ctx&&e.ctx.draw&&e.ctx.draw()}),r},e.prototype._paintPerCursor=function(e,t,n,r,i){var a=e.ctx;if(r){if(!r.length)t.drawIdx=t.endIdx;else for(var o=this.dpr,s=0;s=t.endIdx},e.prototype._paintPerCursorInRect=function(e,t,n,r,i){for(var a={inHover:!1,allClipped:!1,prevEl:null,viewWidth:this._width,viewHeight:this._height,beforeBrushParam:{contentRetained:i}},o=e.ctx,s=ZZ(e),c=s&&$c.getTime(),l=t.drawIdx,u=t.notClearIdx,d=u>=0?Math.min(u,l):l;d15){d++;break}}}dI(o,a),t.drawIdx=Math.max(d,l)},e.prototype.getLayer=function(e,t){return this._ensureLayer(e,0,t)},e.prototype._ensureLayer=function(e,t,n){t||=0;var r=this._singleCanvas;r&&!this._needsManuallyCompositing&&(e=tQ,t=0);var i=fQ(this._i,e)[t];return i||(i=sQ(`zr_`+e+`.`+t,this,e,t),this._layerConfig[e]&&gl(i,this._layerConfig[e],!0),(n||r&&e!==tQ)&&(i.virtual=!0),this._insertLayer(i,e,t,!1),i.initContext()),i},e.prototype.insertLayer=function(e,t){this._insertLayer(t,e,0,!1)},e.prototype._insertLayer=function(e,t,n,r){var i=this._i,a=i.layers,o=i.layerStack,s=this._domRoot,c=null;if(!(a[t]&&a[t][n])&&aQ(e)){for(var l=o.length,u=0;u0&&(c=fQ(i,o[u-1].zl)[o[u-1].zl2]),o.splice(u,0,{zl:t,zl2:n}),fQ(i,t)[n]=e,!r&&!e.virtual){if(c){var d=c.dom;d.nextSibling?s.insertBefore(e.dom,d.nextSibling):s.appendChild(e.dom)}else s.firstChild?s.insertBefore(e.dom,s.firstChild):s.appendChild(e.dom)}e.painter||=this}},e.prototype.eachLayer=function(e,t){return pQ(this._i,function(n,r){e.call(t,n,r)})},e.prototype.eachBuiltinLayer=function(e,t){return pQ(this._i,function(n,r){e.call(t,n,r)},mQ)},e.prototype.eachOtherLayer=function(e,t){return pQ(this._i,function(n,r){e.call(t,n,r)},hQ)},e.prototype.getLayers=function(){var e={};return pQ(this._i,function(t,n,r){e[t.id]=t}),e},e.prototype._updateLayerStatus=function(e,t){var n=this;if(n._singleCanvas)for(var r=1;r=0;a--){var o=i.get(r[a]);if(!o.used)t.__dirty=!0,i.removeKey(r[a]),r.splice(a,1);else{var s=o.endIdxNew;(ZZ(t)?s=0;r--){var i=t[r];if(i.zl===e){var a=n[e][i.zl2];if(a.__builtin__)continue;if(t.splice(r,1),n[e][i.zl2]=void 0,!a.virtual){var o=a.dom.parentNode;o&&o.removeChild(a.dom)}}}},e.prototype.resize=function(e,t){if(this._domRoot.style){var n=this._domRoot;n.style.display=`none`;var r=this._opts,i=this.root;e!=null&&(r.width=e),t!=null&&(r.height=t),e=IF(i,0,r),t=IF(i,1,r),n.style.display=``,(this._width!==e||t!==this._height)&&(n.style.width=e+`px`,n.style.height=t+`px`,pQ(this._i,function(n){n.resize(e,t)}),this.refresh({paintAll:!0})),this._width=e,this._height=t}else{if(e==null||t==null)return;this._width=e,this._height=t,this._ensureLayer(tQ).resize(e,t)}return this},e.prototype.clearLayer=function(e){G(this._i.layers[e],function(e){e&&!e.__builtin__&&e.clear()})},e.prototype.dispose=function(){this.root.innerHTML=``,this.root=this.storage=this._domRoot=this._i=null},e.prototype.getRenderedCanvas=function(e){if(e||={},this._singleCanvas&&!this._compositeManually)return this._i.layers[tQ][0].dom;var t=new $Z(`image`,this,e.pixelRatio||this.dpr);t.initContext(),t.clear(!1,e.backgroundColor||this._backgroundColor);var n=t.ctx;if(e.pixelRatio<=this.dpr){this.refresh();var r=t.dom.width,i=t.dom.height;pQ(this._i,function(e){e.__builtin__?n.drawImage(e.dom,0,0,r,i):e.renderToCanvas&&(n.save(),e.renderToCanvas(n),n.restore())})}else{for(var a={inHover:!1,viewWidth:this._width,viewHeight:this._height,beforeBrushParam:{}},o=this.storage.getDisplayList(!0),s=0,c=o.length;s{e.data&&e.interactive!==!1&&e.data.forEach((r,i)=>{let a=typeof r==`object`&&r&&!Array.isArray(r)?r:void 0,o=a?.value??r;o!=null&&t.push({series_index:n,data_index:i,label:`${e.name??`Series`} · point ${i+1}`,event:{seriesName:e.name,name:a?.name,value:o,data:r,interactive:e.interactive}})})}),t}aR([MD,yQ,AB,jV,_G,qU,Hz,fK,AK,SX,FJ,XY,zY,HZ,YZ,dY,$X,rJ]);var xQ=new Map;function SQ({option:e,optionForSize:t,height:n,label:r,onClick:i,onZoom:a,group:o,keyboard:s}){let c=(0,V.useRef)(null),l=(0,V.useRef)(null),[u,d]=(0,V.useState)(e),[f,p]=(0,V.useState)(!1),m=(0,V.useRef)(!1),h=(0,V.useRef)(e),g=(0,V.useRef)(s);g.current=s;let _=(0,V.useRef)(void 0),v=(0,V.useCallback)(e=>{_.current&&l.current?.dispatchAction({type:`downplay`,seriesIndex:_.current.series_index,dataIndex:_.current.data_index}),l.current?.dispatchAction({type:`hideTip`}),_.current=e,e&&(l.current?.dispatchAction({type:`highlight`,seriesIndex:e.series_index,dataIndex:e.data_index}),l.current?.dispatchAction({type:`showTip`,seriesIndex:e.series_index,dataIndex:e.data_index}))},[]),y=Array.isArray(u.series)?u.series:u.series?[u.series]:[],b=Array.isArray(u.xAxis)?u.xAxis[0]:u.xAxis,x=Array.isArray(u.yAxis)?u.yAxis[0]:u.yAxis,S=(0,V.useMemo)(()=>{if(!s||!f)return[];let e=Array.isArray(u.series)?u.series:u.series?[u.series]:[],t=x?.type===`category`&&e[0]?.type!==`custom`?x:b?.type===`category`?b:void 0;return bQ(e.map(e=>({...e,interactive:void 0}))).map(n=>{let r=Array.isArray(n.event.value)?n.event.value:[];return{...n,event:{...n.event,interactive:e[n.series_index]?.interactive,name:n.event.name??(e[n.series_index]?.type===`custom`?x?.data?.[Number(r[1])]:t?.data?.[n.data_index])}}}).filter(e=>e.event.value!=null&&(!Array.isArray(e.event.value)||e.event.value.at(-1)!=null))},[u,f]),C=e=>{let t=e.event.data?.selection,n=Array.isArray(e.event.value)?e.event.value:[],r=t?.from?Date.parse(t.from):t?.time??(b?.type===`time`?Number(n[0]):NaN),i=/^(\d+)(ms|s|m|h|d)$/.exec(s?.interval??``),a=i?Number(i[1])*{ms:1,s:1e3,m:6e4,h:36e5,d:864e5}[i[2]]:void 0,o=y[e.series_index]?.data?.[e.data_index+1],c=Array.isArray(o)?o:o?.value,l=typeof c?.[0]==`number`&&c[0]>r?c[0]:void 0,u=a?r+a:l??s?.bounds?.to??r,d=t?.to?Date.parse(t.to):y[e.series_index]?.type===`custom`?Number(n[3]):Math.min(u,s?.bounds?.to??u);return Number.isFinite(r)&&Number.isFinite(d)?{from:r,to:d}:void 0},w=e=>{let t=y[e.series_index],n=Array.isArray(e.event.value)?e.event.value:[e.event.value],r=t?.type===`custom`,i=C(e),a=r?x?.data?.[Number(n[1])]:e.event.name,o=r?n[2]:n.at(-1),s=typeof o==`number`?t?.tooltip?.valueFormatter?.(o)??Xs(t?.keyboard_unit,o):String(o??`No value`),c=t?.type===`scatter`?`x: ${Xs(t.keyboard_x_unit,Number(n[0]))} · y: `:``;return[e.event.seriesName??`Series`,a,i?new Date(i.from).toISOString()+(i.to===i.from?``:` – ${new Date(i.to).toISOString()}`):void 0,c+s].filter(Boolean).join(` · `)},T=(0,V.useRef)({}),E=(0,V.useRef)(i);E.current=i;let D=(0,V.useRef)(a);D.current=a;let O=!!a,k=(0,V.useRef)(void 0),A=(0,V.useRef)(0),[j,M]=(0,V.useState)(0),N=(0,V.useCallback)(()=>{let e=k.current;l.current?.dispatchAction({type:`brush`,areas:e?[{brushType:`lineX`,xAxisIndex:0,coordRange:[e.from,e.to]}]:[]},{silent:!0})},[]),P=(0,V.useCallback)(e=>{(k.current?.from!==e?.from||k.current?.to!==e?.to)&&(k.current=e,N())},[N]),F=O?`${r} Brush across the chart to zoom to that range.`:r,I=(0,V.useRef)(()=>void 0),L=(0,V.useCallback)(e=>{e!==A.current&&(A.current=e,I.current())},[]);(0,V.useRef)(null);let ee=(0,V.useRef)(void 0),R=(0,V.useRef)(!1);R.current=!!t,I.current=()=>{ee.current===void 0&&(ee.current=document.createElement(`canvas`).getContext(`2d`));let n=ee.current,r={measureText:n?(e,t)=>(n.font=t,n.measureText(e).width):void 0,width:c.current?.clientWidth??0,height:c.current?.clientHeight??0},i=t&&r.width>0&&r.height>0?t(r):e;if(A.current&&i.grid&&!Array.isArray(i.grid)){let e=i.grid;i={...i,grid:{...e,bottom:(typeof e.bottom==`number`?e.bottom:8)+A.current}}}let a=i.series??[],o=new Set(a.map(e=>e.name)),s=Object.fromEntries(Object.entries(T.current).filter(([e])=>o.has(e)));T.current=s;let u=i.legend;l.current?.setOption({...i,...u?{legend:{...u,selected:{...u.selected,...s}}}:{},...D.current?{toolbox:{show:!1},brush:{xAxisIndex:0,brushMode:`single`,removeOnClick:!0}}:{},aria:{...i.aria,enabled:!0,description:F}},{notMerge:!0});let f=l.current?.getModel?.().getComponent(`grid`)?.coordinateSystem?.getRect(),p=f?.height;if(p&&i.yAxis){let e=Array.isArray(i.yAxis)?i.yAxis:[i.yAxis],t=e.map(e=>nc(e,p));t.some((t,n)=>t.splitNumber!==e[n].splitNumber||t.interval!==e[n].interval)&&(i={...i,yAxis:Array.isArray(i.yAxis)?t:t[0]},l.current?.setOption({yAxis:i.yAxis}))}f&&i.series?.some(e=>e.endLabel?.show)&&(i=Ic(i,f,(e,t)=>{let n=l.current?.convertToPixel({seriesIndex:e},t);return Array.isArray(n)?n[1]:NaN}),l.current?.setOption({series:i.series})),_.current&&v(_.current),D.current&&l.current?.dispatchAction({type:`takeGlobalCursor`,key:`brush`,brushOption:{brushType:`lineX`,brushMode:`single`}}),D.current&&k.current&&N(),h.current=i,g.current&&m.current&&d(i)},(0,V.useEffect)(()=>{if(!c.current)return;let e=LL(c.current,void 0,{renderer:`canvas`});l.current=e,e.on(`click`,e=>{let t=e,n=h.current.series??[],r=t.seriesIndex===void 0?t.interactive:t.componentType&&t.componentType!==`series`?!1:n[t.seriesIndex]?.interactive;E.current?.({...t,...r===void 0?{}:{interactive:r}})}),e.on(`brushEnd`,t=>{let n=t.areas?.[0]?.coordRange;n?.length===2&&Number.isFinite(n[0])&&Number.isFinite(n[1])&&n[0]e+1)),e.dispatchAction({type:`brush`,areas:[]},{silent:!0}),D.current&&e.dispatchAction({type:`takeGlobalCursor`,key:`brush`,brushOption:{brushType:`lineX`,brushMode:`single`}}))}),e.on(`legendselectchanged`,e=>{T.current={...e.selected}});let t=new ResizeObserver(()=>{e.resize(),R.current&&I.current()});return t.observe(c.current),()=>{t.disconnect(),_.current&&v(void 0),e.dispose(),l.current=null}},[]),(0,V.useEffect)(()=>{I.current()},[e,t,F,O]),(0,V.useEffect)(()=>{let e=l.current;if(e&&o)return e.group=o,xQ.set(o,(xQ.get(o)??0)+1),RL(o),()=>{e.group=``;let t=(xQ.get(o)??1)-1;if(t>0){xQ.set(o,t);return}xQ.delete(o),zL(o)}},[o]);let te=(0,H.jsx)(`div`,{ref:c,role:`img`,"aria-label":F,"aria-hidden":s?!0:void 0,style:{height:s?`100%`:n,position:s?`absolute`:void 0,inset:s?0:void 0,zIndex:s?0:void 0,flex:`1 1 auto`,minHeight:0,width:`100%`,minWidth:0,cursor:i?`pointer`:void 0}}),ne=Array.isArray(e.series)?e.series:e.series?[e.series]:[],re=r+`: `+ne.length+` series`+(s?.bounds?`; `+new Date(s.bounds.from).toISOString()+` – `+new Date(s.bounds.to).toISOString():``);return s?(0,H.jsx)(pc,{height:n,rangeReset:j,onRangeChange:P,onRangeBarHeight:L,points:S,label:re,summary:w,onClick:i,canSelect:s.canSelect,onHighlight:v,onZoom:a,bounds:s.bounds,pointWindow:C,onRangePending:s.onRangePending,onActiveChange:e=>{m.current=e,p(e),e&&d(h.current)},children:te}):te}function CQ({panel:e,title:t=e.title,result:n,dark:r,height:i,onSelect:a,onPoint:o}){let s=(0,V.useMemo)(()=>t=>Uc(e,n.frame,Fc(r),t),[e,n.frame,r]),c=(0,V.useMemo)(()=>s({width:500,height:i}),[s,i]),l=(0,V.useCallback)(t=>!!Bs(e,n,t),[e,n]);return(0,H.jsx)(SQ,{keyboard:{canSelect:l},option:c,optionForSize:s,height:i,label:`${t}: bar chart`,onClick:o||a?t=>{let r=Bs(e,n,t);if(!r)return;o?.(r);let i=Object.values(r.dimensions)[0];i!==void 0&&a?.(i)}:void 0})}function wQ({panel:e,title:t=e.title,result:n,dark:r,height:i}){let a=Tc(e,n.frame),o=n.frame.columns.find(e=>e.role===`measure`)?.unit??e.unit,s=e.better??n.better,c=(0,V.useMemo)(()=>t=>Wc({...e,better:s},a,Fc(r),o,t),[e,s,a,r,o]),l=(0,V.useMemo)(()=>c({width:270,height:i}),[c,i]);return(0,H.jsx)(SQ,{option:l,optionForSize:c,height:i,label:`${t}: gauge`})}function TQ(e,t){return!t.previous||(e.reduce??`window`)===`window`&&!t.previous.totals?null:Tc(e,t.previous)}function EQ({panel:e,result:t,dark:n=!1,compare:r=!0,range:i}){let a=t.frame,s=Tc(e,a),c=a.columns.find(e=>e.role===`measure`)?.unit??e.unit,l=e.better??t.better??Oc(e.thresholds),u=kc(s,e.thresholds,l)??(a.health?.health===`healthy`?`ok`:a.health?.health===`degraded`?`warn`:a.health?.health===`unhealthy`?`bad`:null),d=TQ(e,t),f=Ec(a),p=e.thresholds?.find(e=>e.status===u&&s!==null&&(l===`higher`?s<=e.value:s>=e.value))?.label,m=Fc(n);return(0,H.jsxs)(o,{h:`100%`,style:{display:`flex`,flexDirection:`column`,justifyContent:`space-between`,gap:4},children:[(0,H.jsxs)(y,{justify:`space-between`,align:`flex-start`,wrap:`nowrap`,gap:`xs`,children:[(0,H.jsx)(T,{"data-stat-value":!0,fz:32,fw:700,lh:1.1,lts:`-0.02em`,ff:`var(--mantine-font-family-monospace)`,children:Xs(c,s)}),u&&(0,H.jsxs)(T,{"data-stat-status":!0,fz:12,fw:500,style:{borderRadius:999,padding:`1px 8px`,whiteSpace:`nowrap`,background:`${m.status[u]}22`,color:m.text},children:[(0,H.jsx)(`span`,{style:{color:m.status[u]},children:u===`bad`?`◆`:u===`warn`?`■`:`●`}),` `,p??(u===`bad`?`Unhealthy`:u===`warn`?`Degraded`:`Healthy`)]})]}),r&&d!==null&&s!==null&&(0,H.jsx)(DQ,{dark:n,value:s,previous:d,better:l,unit:c,period:OQ(i,t)}),(0,H.jsx)(kQ,{points:f,area:!0,dark:n,height:40})]})}function DQ({value:e,previous:t,better:n,unit:r,period:i,dark:a}){let o=r===`percent`,s=o?e-t:t===0?e===0?0:1/0:(e-t)/Math.abs(t)*100,c=s>=0,l=s===0||!n?null:c?n===`higher`:n===`lower`,u=Number.isFinite(s)?o?`${c?`+`:`−`}${Math.abs(s).toFixed(1)} pts`:`${c?`+`:`−`}${Math.abs(s).toFixed(0)}%`:`new`;return(0,H.jsxs)(y,{gap:6,children:[(0,H.jsxs)(T,{"data-stat-delta":!0,fz:12,fw:600,style:{color:l===null?`var(--mantine-color-dimmed)`:Pc(l?`ok`:`bad`,a)},children:[c?`▲`:`▼`,` `,u]}),(0,H.jsxs)(T,{fz:12,c:`dimmed`,children:[`vs previous `,i]})]})}function OQ(e,t){let n=t.from_ms!==void 0&&t.to_ms!==void 0?t.to_ms-t.from_ms:t.shift_ms,r=/^(\d+)(s|m|h|d|w)$/.exec(e??``),i=r?Number(r[1])*{s:1e3,m:6e4,h:36e5,d:864e5,w:6048e5}[r[2]]:n;if(!i)return`period`;let a=i>=6048e5?`week`:i>=864e5?`day`:i>=36e5?`hour`:i>=6e4?`minute`:`second`,o=i/{week:6048e5,day:864e5,hour:36e5,minute:6e4,second:1e3}[a];return o===1?a:`${Number(o.toFixed(2))} ${a}s`}function kQ({points:e,area:t=!1,dark:n=!1,height:r=32}){let i=e.filter(e=>e!==null&&Number.isFinite(e));if(i.length<2)return null;let a=Math.min(...i),o=Math.max(...i),s=r,c=t=>t/(e.length-1)*200,l=e=>s-2-(e-a)/(o-a||1)*(s-4),u=e.map((t,n)=>t===null||!Number.isFinite(t)?``:`${n===0||e[n-1]===null||!Number.isFinite(e[n-1])?`M`:`L`}${c(n).toFixed(1)},${l(t).toFixed(1)}`).join(``),d=[];return e.forEach((t,n)=>{if(t!==null&&Number.isFinite(t)){if(!n||e[n-1]===null||!Number.isFinite(e[n-1]))d.push({start:n,end:n,path:`M${c(n).toFixed(1)},${l(t).toFixed(1)}`});else{let e=d.at(-1);e.end=n,e.path+=`L${c(n).toFixed(1)},${l(t).toFixed(1)}`}}}),(0,H.jsxs)(`svg`,{viewBox:`0 0 200 ${s}`,preserveAspectRatio:`none`,width:`100%`,height:s,role:`img`,"aria-label":`Value over this panel's time range`,children:[t&&d.filter(e=>e.end>e.start).map(e=>(0,H.jsx)(`path`,{"data-sparkline-area":!0,d:`${e.path}L${c(e.end)},${s}L${c(e.start)},${s}Z`,fill:_c(0,n),opacity:.18},e.start)),(0,H.jsx)(`path`,{"data-sparkline-line":!0,d:u,fill:`none`,stroke:t?_c(0,n):`var(--mantine-primary-color-filled)`,strokeWidth:1.5,vectorEffect:`non-scaling-stroke`})]})}function AQ(e){return jQ(e)||typeof e==`function`||MQ(e)}function jQ(e){return typeof e==`function`&&(()=>{let t=Object.getPrototypeOf(e);return t.prototype&&t.prototype.isReactComponent})()}function MQ(e){return typeof e==`object`&&typeof e.$$typeof==`symbol`&&[`react.memo`,`react.forward_ref`].includes(e.$$typeof.description)}function NQ(e,t){return e==null?null:AQ(e)?V.createElement(e,t):e}function PQ(e){if(`cell`in e&&e.cell){let t=e.cell,n=t.column.columnDef,r=t,i=n;return r.getIsAggregated?.()?NQ(i.aggregatedCell??n.cell,t.getContext()):r.getIsPlaceholder?.()?null:NQ(n.cell,t.getContext())}return`header`in e&&e.header?NQ(e.header.column.columnDef.header,e.header.getContext()):`footer`in e&&e.footer?NQ(e.footer.column.columnDef.footer,e.footer.getContext()):null}function FQ(e){let t=se(e.source,e.selector,{compare:Nt});return typeof e.children==`function`?e.children(t):e.children}function IQ(e){let t=e;return Object.defineProperty(e,"state",{get(){return e.get()}}),`set`in e&&(t.setState=e.set.bind(e)),t}function LQ(e){let{createAtom:t,batch:n}=e,r=t(0);return{createOptionsStore:!1,wrapExternalAtoms:!1,addSubscription:()=>{throw Error(`Feature not supported in current reactivity implementation`)},unmount:()=>{throw Error(`Feature not supported in current reactivity implementation`)},schedule:e.schedule??(e=>queueMicrotask(e)),batch:n,untrack:e=>e(),createReadonlyAtom:(e,n)=>{let i=n?.compare??Object.is,a=!1,o,s=()=>{let t=e();return(!a||!i(o,t))&&(o=t,a=!0),o},c=t(()=>(r.get(),s()),{compare:i});return{get:s,subscribe:c.subscribe.bind(c)}},createWritableAtom:(e,n)=>t(e,{compare:n?.compare}),commit:()=>{r.set(e=>e+1)}}}function RQ(e,t=Object.is){let n=!1,r;return{get:e.get,markCommitted:e=>{r=e,n=!0},subscribe:i=>e.subscribe(e=>{(!n||!t(r,e))&&i(e)})}}function zQ(){return LQ({createAtom:Ze,batch:Ke})}function BQ(e,t){return typeof e==`function`?e(t):e}function VQ(e){if(Array.isArray(e))return e.map(VQ);if(e&&typeof e==`object`){let t=Object.getPrototypeOf(e);if(t!==Object.prototype&&t!==null)return e;let n=t===null?UQ():{},r=Object.keys(e);for(let t=0;t{(t.options.atoms?.[e]??t.baseAtoms[e]).set(e=>BQ(n,e))}}function KQ(e){if(typeof e!=`object`||!e)return!1;if(Array.isArray(e))return!0;let t=Object.getPrototypeOf(e);return t===Object.prototype||t===null}function qQ(e){return Reflect.ownKeys(e).filter(t=>Object.prototype.propertyIsEnumerable.call(e,t))}var JQ=3;function YQ(e,t){return XQ(e,t,JQ)}function XQ(e,t,n){if(Object.is(e,t))return!0;if(n<=0||!KQ(e)||!KQ(t)||(Array.isArray(e)||Array.isArray(t))&&(!Array.isArray(e)||!Array.isArray(t)||e.length!==t.length))return!1;let r=qQ(e),i=qQ(t);if(r.length!==i.length)return!1;let a=e,o=t;for(let e=0;e{let t=BQ(n,e);return r(e,t)?e:t})}function QQ(e){return e instanceof Function}function $Q(e,t){let n=[],r=e=>{e.forEach(e=>{n.push(e);let i=t(e);i.length&&r(i)})};return r(e),n}var e$=({fn:e,memoDeps:t,onAfterCompare:n,onAfterUpdate:r,onBeforeCompare:i,onBeforeUpdate:a})=>{let o=[],s;return c=>{i?.();let l=t?.(c),u=!l||l.length!==o?.length;if(!u&&l){for(let e=0;e{if(!t){t=!0;return}e()}}function n$({feature:e,fnName:t,objectId:n,onAfterUpdate:r,table:i,...a}){let o=()=>{if(!r)return;let{schedule:e,untrack:t}=i._reactivity;e(()=>t(()=>r()))},s={onAfterUpdate:()=>{o()}};return e$({...a,...s})}function r$(e,t=`_`){let[n,r]=e.split(t);return{fnKey:r,fnName:`${n}.${r}`,parentName:n}}function i$(e,t,n){for(let[r,{fn:i,memoDeps:a}]of Object.entries(n)){let{fnKey:n,fnName:o}=r$(r);t[n]=a?n$({memoDeps:a,fn:i,fnName:o,table:t,feature:e}):i}}function a$(e,t,n,r){for(let[i,{fn:a,memoDeps:o}]of Object.entries(r)){let{fnKey:r,fnName:s}=r$(i);if(o){let i=`_memo_${r}`;t[r]=function(...t){if(!this[i]){let t=this;this[i]=n$({memoDeps:e=>o(t,e),fn:(...e)=>a(t,...e),fnName:s,objectId:t.id,table:n,feature:e})}return this[i](...t)}}else t[r]=function(...e){return a(this,...e)}}}function o$(e,t,n,...r){return e[t]?.(...r)??n(e,...r)}function s$(e){return e.row.getValue(e.column.id)}function c$(e){return e.getValue()??e.table.options.renderFallbackValue}function l$(e){return{table:e.table,column:e.column,row:e.row,cell:e,getValue:()=>e.getValue(),renderValue:()=>e.renderValue()}}var u$={assignCellPrototype:(e,t)=>{a$(`coreCellsFeature`,e,t,{cell_getValue:{fn:e=>s$(e)},cell_renderValue:{fn:e=>c$(e)},cell_getContext:{fn:e=>l$(e),memoDeps:e=>[e]}})}};function d$(e){if(!e._headerPrototype){e._headerPrototype={table:e};let t=Object.values(e._features);for(let n=0;no$(e,`getIsVisible`,m$)):(WQ(t,e.id)?t[e.id]:void 0)??!0}function h$(e){return e.getAllLeafColumns().filter(e=>o$(e,`getIsVisible`,m$))}function g$(e,t=1){let n=t;for(let r=0;r0&&b$(s,t-1,n,r,i,a)}function x$(e){for(let t=0;t{let n=t;for(let t=0;te[i.accessorKey]}if(!s)throw Error();let l=C$(e),u=Object.create(l);u.accessorFn=c,u.columnDef=i,u.columns=[],u.depth=n,u.id=`${String(s)}`,u.parent=r;let d=e._columnInstanceInitFns;for(let e=0;e{let r=[];if(!t?.length)r=n;else{let e=new Map;for(let t=0;t!n.includes(e.id));if(r===`remove`)return i;let a=new Map;for(let e=0;ee.getFlatColumns())]}function O$(e){if(e.columns.length){let t=e.columns.flatMap(e=>e.getLeafColumns());return o$(e.table,`getOrderColumns`,T$)(t)}return[e]}function k$(e){return{header:e=>{let t=e.header.column.columnDef;return t.accessorKey?t.accessorKey:t.accessorFn?t.id:null},cell:e=>e.renderValue()?.toString?.()??null,...Object.values(e._features).reduce((e,t)=>Object.assign(e,t.getDefaultColumnDef?.()),{}),...e.options.defaultColumn}}function A$(e,t,n,r=0){let i=Array(t.length);for(let a=0;ae.getFlatColumns())}function N$(e){let t=UQ(),n=e.getAllFlatColumns();for(let e=0;ee.getLeafColumns());return o$(e,`getOrderColumns`,T$)(t)}function F$(e){let t=UQ(),n=e.getAllLeafColumns();for(let e=0;e{a$(`coreColumnsFeature`,e,t,{column_getFlatColumns:{fn:e=>D$(e),memoDeps:e=>[e.table.options.columns]},column_getLeafColumns:{fn:e=>O$(e),memoDeps:e=>[e.table.atoms.columnOrder?.get(),e.table.atoms.grouping?.get(),e.table.options.columns,e.table.options.groupedColumnMode]}})},constructTableAPIs:e=>{i$(`coreColumnsFeature`,e,{table_getDefaultColumnDef:{fn:()=>k$(e),memoDeps:()=>[e.options.defaultColumn]},table_getAllColumns:{fn:()=>j$(e),memoDeps:()=>[e.options.columns]},table_getAllFlatColumns:{fn:()=>M$(e),memoDeps:()=>[e.options.columns]},table_getAllFlatColumnsById:{fn:()=>N$(e),memoDeps:()=>[e.options.columns]},table_getAllLeafColumns:{fn:()=>P$(e),memoDeps:()=>[e.atoms.columnOrder?.get(),e.atoms.grouping?.get(),e.options.columns,e.options.groupedColumnMode]},table_getAllLeafColumnsById:{fn:()=>F$(e),memoDeps:()=>[e.getAllLeafColumns()]},table_getColumn:{fn:t=>I$(e,t)}})}};function R$(e,t){for(let n=0;n!t.includes(e.id)&&!n.includes(e.id));return S$(r,[...o,...c,...s],e)}function H$(e){return[...e.getHeaderGroups()].reverse()}function U$(e){let t=e.getHeaderGroups(),n=[];for(let e=0;e{a$(`coreHeadersFeature`,e,t,{header_getLeafHeaders:{fn:e=>z$(e),memoDeps:e=>[e.column.table.options.columns]},header_getContext:{fn:e=>B$(e),memoDeps:e=>[e.column.table.options.columns]}})},constructTableAPIs:e=>{i$(`coreHeadersFeature`,e,{table_getHeaderGroups:{fn:()=>V$(e),memoDeps:()=>[e.options.columns,e.atoms.columnOrder?.get(),e.atoms.grouping?.get(),e.atoms.columnPinning?.get(),e.atoms.columnVisibility?.get(),e.options.groupedColumnMode]},table_getFooterGroups:{fn:()=>H$(e),memoDeps:()=>[e.getHeaderGroups()]},table_getFlatHeaders:{fn:()=>U$(e),memoDeps:()=>[e.getHeaderGroups()]},table_getLeafHeaders:{fn:()=>W$(e),memoDeps:()=>[e.getHeaderGroups()]}})}};function K$(e){if(!e._rowPrototype){e._rowPrototype={table:e};let t=Object.values(e._features);for(let n=0;n{let s=K$(e),c=Object.create(s);c._displayIndexCache=-1,c._uniqueValuesCache=UQ(),c._valuesCache=UQ(),c.depth=i,c.id=t,c.index=r,c.original=n,c.parentId=o,c.subRows=a??[];let l=e._rowInstanceInitFns;for(let e=0;e{let i=e.getValue(r),a=n.getValue(r),o=t.resolveDataValue;return o&&(i=o(i),a=o(a)),t.sort(i,a,e,n,r)},e);return t}var X$=Y$({resolveDataValue:e=>e1(e).toLowerCase(),sort:(e,t)=>t1(e,t)});Y$({resolveDataValue:e=>e1(e),sort:(e,t)=>t1(e,t)}),Y$({resolveDataValue:e=>e1(e).toLowerCase(),sort:(e,t)=>Q$(e,t)}),Y$({resolveDataValue:e=>e1(e),sort:(e,t)=>Q$(e,t)}),Y$({resolveDataValue:e=>$$(e),sort:(e,t)=>e>t?1:eQ$(e,t)});function Q$(e,t){return e===t?0:e>t?1:-1}function $$(e){return e instanceof Date?e.getTime():e}function e1(e){return typeof e==`number`?isNaN(e)||e===1/0||e===-1/0?``:String(e):typeof e==`string`?e:``}function t1(e,t){let n=0,r=0,i=e.length,a=t.length;for(;n=48&&e<=57}function r1(e,t,n){let r=t+1;for(;ro)return 1;if(o>a)return-1}return o>s?1:s>o?-1:0}function a1(e,t,n,r,i,a){let o=t;for(;oi?1:i>t?-1:0}let u=parseInt(e.slice(t,n),10),d=parseInt(r.slice(i,a),10);return u>d?1:d>u?-1:0}function o1(e,t,n){let r=0;for(let i=t;il1(e))}function d1(e){e.atoms.expanded&&(e.options.autoResetAll??e.options.autoResetExpanded??!e.options.manualExpanding)&&e._reactivity.schedule(()=>f1(e))}function f1(e,t){let n=e.initialState.expanded;ZQ(e,`expanded`,t?UQ():n===!0||Object.assign(UQ(),VQ(n??{})))}var p1=0;function m1(e){if(e.options.autoResetAll??e.options.autoResetPageIndex??!e.options.manualPagination){if((e.atoms.pagination?.get()?.pageIndex??p1)===p1)return;_1(e,!0)}}function h1(e,t){ZQ(e,`pagination`,t)}function g1(e,t){h1(e,n=>{let r=BQ(t,n.pageIndex),i=e.options.pageCount===void 0||e.options.pageCount===-1?2**53-1:e.options.pageCount-1;return r=Math.max(0,Math.min(r,i)),{...n,pageIndex:r}})}function _1(e,t){g1(e,t?p1:e.initialState.pagination?.pageIndex??p1)}function v1(){return[]}function y1(e,t){ZQ(e,`sorting`,t)}function b1(e,t){y1(e,t?[]:VQ(e.initialState.sorting??[]))}function x1(e){e.atoms.sorting&&(e.options.autoResetAll??e.options.autoResetSorting??!1)&&b1(e)}function S1(e){let t=e.table._rowModelFns.sortFns,n=e.table.getFilteredRowModel().flatRows.slice(0,10),r,i=!1;for(let t=0;t1)){r=`alphanumeric`;break}}if(!r&&i&&(r=`text`),r){let e=t?.[r];if(e||r===`alphanumeric`&&(e=t?.text),e)return e}return Z$}function C1(e){let t=e.table.getFilteredRowModel().flatRows.slice(0,10);for(let n=0;n{let o=a.findIndex(t=>t.id===e.id),s=o===-1?void 0:a[o],c=[],l,u=i?t:r===`desc`,d=!!(a.length&&k1(e)&&n);return l=d?s?`toggle`:`add`:s?`toggle`:`replace`,l===`toggle`&&(i||r||(l=`remove`)),l===`add`?(c=[...a,{id:e.id,desc:u}],c.splice(0,c.length-(e.table.options.maxMultiSortColCount??2**53-1))):c=l===`toggle`?d?a.map(t=>t.id===e.id?{...t,desc:u}:t):[{id:e.id,desc:u}]:l===`remove`?d?a.filter(t=>t.id!==e.id):[]:[{id:e.id,desc:u}],c})}function E1(e){return e.columnDef.sortDescFirst??e.table.options.sortDescFirst??C1(e)===`desc`?`desc`:`asc`}function D1(e,t){let n=E1(e),r=A1(e);return r?r!==n&&(e.table.options.enableSortingRemoval??!0)&&(!t||(e.table.options.enableMultiRemove??!0))?!1:r===`desc`?`asc`:`desc`:n}function O1(e){return(e.columnDef.enableSorting??!0)&&(e.table.options.enableSorting??!0)&&!!e.accessorFn}function k1(e){return e.columnDef.enableMultiSort??e.table.options.enableMultiSort??!!e.accessorFn}function A1(e){let t=e.table.atoms.sorting?.get()?.find(t=>t.id===e.id);return t?t.desc?`desc`:`asc`:!1}function j1(e){return e.table.atoms.sorting?.get()?.findIndex(t=>t.id===e.id)??-1}function M1(e){y1(e.table,t=>t.length?t.filter(t=>t.id!==e.id):[])}function N1(e){let t=O1(e);return n=>{t&&T1(e,void 0,k1(e)?e.table.options.isMultiSortEvent?.(n):!1)}}function P1(){return e=>n$({feature:`coreRowModelsFeature`,table:e,fnName:`table.getCoreRowModel`,memoDeps:()=>[e.options.data],fn:()=>I1(e,e.options.data),onAfterUpdate:t$(()=>{d1(e),m1(e),x1(e),u1(e)})})}function F1(e,t,n,r=0,i){let a=[];for(let o=0;o{i$(`coreRowModelsFeature`,e,{table_getCoreRowModel:{fn:()=>L1(e)},table_getPreFilteredRowModel:{fn:()=>R1(e)},table_getFilteredRowModel:{fn:()=>z1(e)},table_getPreGroupedRowModel:{fn:()=>B1(e)},table_getGroupedRowModel:{fn:()=>V1(e)},table_getPreSortedRowModel:{fn:()=>H1(e)},table_getSortedRowModel:{fn:()=>U1(e)},table_getPreExpandedRowModel:{fn:()=>W1(e)},table_getExpandedRowModel:{fn:()=>G1(e)},table_getPrePaginatedRowModel:{fn:()=>K1(e)},table_getPaginatedRowModel:{fn:()=>q1(e)},table_getRowModel:{fn:()=>J1(e)}})}};function X1(e){if(!e._cellPrototype){e._cellPrototype={table:e};let t=Object.values(e._features);for(let n=0;n{t._displayIndexCache=e.length,e.push(t),t.subRows.length&&t.getIsExpanded?.()&&t.subRows.forEach(n)};return t.forEach(n),e}for(let e=0;ee.subRows)}function i0(e){let t=e.getCoreRowModel().flatRows,n=0;for(let e=0;e{a$(`coreRowsFeature`,e,t,{row_getDisplayIndex:{fn:e=>Q1(e)},row_getAllCellsByColumnId:{fn:e=>c0(e),memoDeps:e=>[e.getAllCells()]},row_getAllCells:{fn:e=>s0(e),memoDeps:e=>[e.table.getAllLeafColumns()]},row_getLeafRows:{fn:e=>r0(e),memoDeps:e=>[e.subRows]},row_getParentRow:{fn:e=>a0(e)},row_getParentRows:{fn:e=>o0(e)},row_getUniqueValues:{fn:(e,t)=>t0(e,t)},row_getValue:{fn:(e,t)=>e0(e,t)},row_renderValue:{fn:(e,t)=>n0(e,t)}})},constructTableAPIs:e=>{i$(`coreRowsFeature`,e,{table_getRowsInDisplayOrder:{fn:()=>$1(e),memoDeps:()=>[e.getPrePaginatedRowModel().rows,e.options.paginateExpandedRows,e.options.paginateExpandedRows===!1?e.atoms.expanded?.get():void 0]},table_getRowId:{fn:(t,n,r)=>l0(t,e,n,r)},table_getRow:{fn:(t,n)=>u0(e,t,n)},table_getMaxSubRowDepth:{fn:()=>i0(e),memoDeps:()=>[e.getCoreRowModel()]}})}};function f0(e,t,n=(e,t)=>e===t){let r=t===void 0?e.options.state:t;e._reactivity.batch(()=>{if(r)for(let t in r){let i=e.baseAtoms[t];if(!i)continue;let a=r[t],o=a===void 0?e.initialState[t]:a;n(e._reactivity.untrack(()=>i.get()),o)||i.set(()=>o)}})}function p0(e,t,n=(e,t)=>e===t){e._reactivity.batch(()=>{f0(e,t,n),e._reactivity.commit?.()})}function m0(e){let t=VQ(e.initialState);e._reactivity.batch(()=>{let n=Object.keys(t);for(let r=0;rr):e.options=r,n?.syncExternalState!==!1&&p0(e,r.state??null)}var _0={coreCellsFeature:u$,coreColumnsFeature:L$,coreHeadersFeature:G$,coreRowModelsFeature:Y1,coreRowsFeature:d0,coreTablesFeature:{constructTableAPIs:e=>{i$(`coreTablesFeature`,e,{table_reset:{fn:()=>m0(e)},table_setOptions:{fn:t=>g0(e,t)}})}}};function v0(e){return e}function y0(e,t={}){return Object.values(e).forEach(e=>{t=e.getInitialState?.(t)??t}),VQ(t)}function b0(e){let t=e.features.coreReactivityFeature,{aggregationFns:n,columnMeta:r,coreRowModel:i,expandedRowModel:a,facetedMinMaxValues:o,facetedRowModel:s,facetedUniqueValues:c,filterFns:l,filterMeta:u,filteredRowModel:d,groupedRowModel:f,paginatedRowModel:p,sortFns:m,sortedRowModel:h,tableMeta:g,..._}=e.features,v={_cellInstanceInitFns:[],_columnInstanceInitFns:[],_features:{..._0,..._},_headerGroupInstanceInitFns:[],_headerInstanceInitFns:[],_reactivity:t,_rowInstanceInitFns:[],_rowModelFns:{aggregationFns:n,filterFns:l,sortFns:m},_rowModels:{},atoms:{},baseAtoms:{}},y=Object.values(v._features),b={...y.reduce((e,t)=>Object.assign(e,t.getDefaultTableOptions?.(v)),{}),...e};if(t.wrapExternalAtoms&&b.atoms)for(let[e,n]of Object.entries(b.atoms)){let r=n,i=t.createWritableAtom(r.get(),{debugName:`externalAtom/${e}`});b.atoms[e]=i;let a=!1,o=r.subscribe(e=>{a||i.set(e)}),s=i.subscribe(e=>{a=!0,r.set(e),a=!1});t.addSubscription(o),t.addSubscription(s)}t.createOptionsStore?(v.optionsStore=t.createWritableAtom(b,{debugName:`table/optionsStore`}),Object.defineProperty(v,"options",{configurable:!0,enumerable:!0,get(){return v.optionsStore.get()},set(e){v.optionsStore.set(()=>e)}})):v.options=b,v.initialState=y0(v._features,v.options.initialState);let x=Object.keys(v.initialState);for(let e=0;e{let e=v.options,t=e.atoms?.[n],r=t?t.get():v.baseAtoms[n].get();if(t)return r;let i=e.state;if(i&&WQ(i,n)){let e=i[n];return e===void 0?v.initialState[n]:e}return r},{debugName:`table/atoms/${n}`})}f0(v),v.store=IQ(t.createReadonlyAtom(()=>{let e={};for(let t=0;te.shiftKey}},assignColumnPrototype(e,t){a$(`rowSortingFeature`,e,t,{column_getAutoSortFn:{fn:e=>S1(e)},column_getAutoSortDir:{fn:e=>C1(e)},column_getSortFn:{fn:e=>w1(e)},column_toggleSorting:{fn:(e,t,n)=>T1(e,t,n)},column_getFirstSortDir:{fn:e=>E1(e)},column_getNextSortingOrder:{fn:(e,t)=>D1(e,t)},column_getCanSort:{fn:e=>O1(e)},column_getCanMultiSort:{fn:e=>k1(e)},column_getIsSorted:{fn:e=>A1(e)},column_getSortIndex:{fn:e=>j1(e)},column_clearSorting:{fn:e=>M1(e)},column_getToggleSortingHandler:{fn:e=>N1(e)}})},constructTableAPIs(e){i$(`rowSortingFeature`,e,{table_setSorting:{fn:t=>y1(e,t)},table_resetSorting:{fn:t=>b1(e,t)}})}};function S0(){return e=>{let t=e;return n$({feature:`rowSortingFeature`,table:t,fnName:`table.getSortedRowModel`,memoDeps:()=>[t.atoms.sorting?.get(),t.getPreSortedRowModel()],fn:()=>C0(t),onAfterUpdate:t$(()=>m1(t))})}}function C0(e){let t=e.getPreSortedRowModel(),n=e.atoms.sorting?.get();if(!t.rows.length||!n?.length)return t;let r=[],i=n.filter(t=>{let n=e.getColumn(t.id);return n?O1(n):!1});if(!i.length)return t;let a=[];for(let t=0;t{for(let n=0;n{let t=e.slice();t.sort(o);let n=!1;for(let i=0;i`u`?V.useEffect:V.useLayoutEffect;function T0(e,t){let[{table:n,rootSource:r}]=(0,V.useState)(()=>{let t=b0({...e,features:{coreReactivityFeature:zQ(),...e.features}});return t.Subscribe=(e=>FQ({...e,source:e.source??t.store})),t.FlexRender=PQ,{table:t,rootSource:RQ(t.store,Nt)}}),i=n;g0(i,t=>({...t,...e}),{syncExternalState:!1});let a=i.options.state,o=r.get(),s=se(r,t,{compare:Nt});return w0(()=>{r.markCommitted(o),p0(i,a??null,Nt)}),(0,V.useMemo)(()=>({...n,options:e,state:s}),[n,e,s])}function E0(e,t,n,r,i,a){e.format===`status`&&e.unit&&typeof t==`string`&&t.trim()!==``&&Number.isFinite(Number(t))&&(t=Number(t));let o=t===null?`—`:String(t),s={kind:e.format,text:o};if([`unit`,`bar`,`status`,`sparkline`].includes(e.format)&&(s.text=typeof t==`number`?Xs(e.unit,t):o),e.format===`bar`&&(s.fraction=typeof t==`number`&&n>0?Math.max(0,Math.min(1,t/n)):0),e.format===`status`&&typeof t==`number`&&(s.status=kc(Number.isFinite(t)?t:null,r?.thresholds,r?.better??i)),e.format===`service_link`&&(s.variable=e.variable),e.format===`sparkline`&&a)return s.points=a.slice(0,240),s;if(e.format===`sparkline`)try{let e=JSON.parse(o);Array.isArray(e)?s.points=e.slice(0,240).map(e=>typeof e==`number`&&Number.isFinite(e)?e:null):s.unsupported=`Sparkline requires an array column`}catch{s.unsupported=`Sparkline requires an array column`}return s}function D0({text:e,template:t=!1,highlight:n=``}){let r=lt(`light`)===`dark`,i=Xe[r?5:7],a=[1,3,5].map(e=>parseInt(i.slice(e,e+2),16)).join(`, `),o=[];if(n){let t=e.toLowerCase(),r=n.toLowerCase();for(let e=t.indexOf(r);e!==-1;e=t.indexOf(r,e+r.length))o.push(e)}let s=(t,i)=>{let s=[],c=t;for(let l of o){let o=Math.max(t,l),u=Math.min(i,l+n.length);o>=u||(s.push(e.slice(c,o),(0,H.jsx)(`mark`,{"data-highlight-match":!0,style:{background:`rgba(${a}, ${r?.22:.3})`,color:`inherit`,borderRadius:3,padding:`0 2px`},children:e.slice(o,u)},o)),c=u)}return s.push(e.slice(c,i)),s},c=[],l=0;if(t)for(let t of e.matchAll(/<\*>||||