diff --git a/.firecrawl/develop.sentry.dev-sdk-data-model-envelopes.md b/.firecrawl/develop.sentry.dev-sdk-data-model-envelopes.md new file mode 100644 index 00000000..975591d9 --- /dev/null +++ b/.firecrawl/develop.sentry.dev-sdk-data-model-envelopes.md @@ -0,0 +1,503 @@ +[Skip to content](https://develop.sentry.dev/sdk/data-model/envelopes/#main) + +[![Sentry's logo](https://develop.sentry.dev/_next/static/media/sentry-logo-dark.fc8e1eeb.svg)\ +\ +Docs](https://develop.sentry.dev/ "Sentry error monitoring") + +[Changelog](https://sentry.io/changelog/) +[Sandbox](https://sandbox.sentry.io/) +[Go to Sentry](https://sentry.io/) +[Get Started](https://sentry.io/signup/) + +Menu + +* [Getting Started](https://develop.sentry.dev/getting-started/) + +* [Engineering Practices](https://develop.sentry.dev/engineering-practices/) + +* [Application Architecture](https://develop.sentry.dev/application-architecture/) + +* [Development Infrastructure](https://develop.sentry.dev/development-infrastructure/) + +* [Backend](https://develop.sentry.dev/backend/) + +* [Frontend](https://develop.sentry.dev/frontend/) + +* [Services](https://develop.sentry.dev/services/) + +* [Integrations](https://develop.sentry.dev/integrations/) + +* [Ingestion](https://develop.sentry.dev/ingestion/) + +* [SDKs](https://develop.sentry.dev/sdk/) + * [Getting Started](https://develop.sentry.dev/sdk/getting-started/) + + * [Foundations](https://develop.sentry.dev/sdk/foundations/) + * [Client](https://develop.sentry.dev/sdk/foundations/client/) + + * [State Management](https://develop.sentry.dev/sdk/foundations/state-management/) + + * [Trace Propagation](https://develop.sentry.dev/sdk/foundations/trace-propagation/) + + * [Data Scrubbing](https://develop.sentry.dev/sdk/foundations/data-scrubbing/) + + * [Processing](https://develop.sentry.dev/sdk/foundations/processing/) + + * [Transport](https://develop.sentry.dev/sdk/foundations/transport/) + + * [Envelopes](https://develop.sentry.dev/sdk/foundations/envelopes/) + * [Envelope Items](https://develop.sentry.dev/sdk/foundations/envelopes/envelope-items/) + + * [Event Payloads](https://develop.sentry.dev/sdk/foundations/envelopes/event-payloads/) + + * [Telemetry](https://develop.sentry.dev/sdk/telemetry/) + + * [Platform Specifics](https://develop.sentry.dev/sdk/platform-specifics/) + +* [SDK Setup Wizards](https://develop.sentry.dev/sdk-setup-wizards/) + +* [Self-Hosted Sentry](https://develop.sentry.dev/self-hosted/) + + +* * * + +[Code of Conduct](https://open.sentry.io/code-of-conduct/) +[User Documentation](https://docs.sentry.io/) + +* [Home](https://develop.sentry.dev/) + +* [SDK Development](https://develop.sentry.dev/sdk/) + +* [Foundations](https://develop.sentry.dev/sdk/foundations/) + +* [Envelopes](https://develop.sentry.dev/sdk/foundations/envelopes/) + + +Copy page + +Envelopes +========= + +This document defines the Envelope and Item formats used by Sentry for data ingestion, forwarding, and offline storage. The target audience of this document is Sentry SDK developers and maintainers of the ingestion pipeline. + +##### Backward Compatibility + +Envelopes require Relay, which has been introduced in **Sentry v20.6.0**. Earlier versions of Sentry do not support Envelopes and respond with HTTP error _404 Not Found_ to envelope uploads. Likewise, Relay requires support for Envelopes on the upstream and cannot be used with older versions of Sentry. + +_Envelopes_ are a data format similar to HTTP form data, comprising common _Headers_ and a set of _Items_ with their own headers and payloads. Envelopes are optimized for fast parsing and human readability. They support a combination of multiple Items in a single payload, such as: + +* Submit events with large binary attachments. +* Enable communication between hops, for instance, between different SDKs (Native and Mobile, ReactNative and Android) and between Relays. +* Allow batching of certain Items into a single submission. +* Offline storage for deferred sending after connection issues. + +Sentry specifies a dedicated endpoint at for ingesting Envelopes: + +Bash + +Copied + + POST /api//envelope/ + + + POST /api//envelope/ + + +[Terminology](https://develop.sentry.dev/sdk/data-model/envelopes/#terminology) + +-------------------------------------------------------------------------------- + +* _required_: The implementation may emit an error if this field is missing. +* _recommended_: This field should be emitted when writing, but can be missing during a read. +* _optional_: Can be omitted freely during writing and can be missing during a read. + +[Serialization Format](https://develop.sentry.dev/sdk/data-model/envelopes/#serialization-format) + +-------------------------------------------------------------------------------------------------- + +This section defines the Envelope data format and serialization. For details on data integrity and a list of valid Item types refer to [Envelope Items](https://develop.sentry.dev/sdk/foundations/envelopes/envelope-items/) +. + +### [Prerequisites](https://develop.sentry.dev/sdk/data-model/envelopes/#prerequisites) + +These definitions apply to all parts of the Envelope data format: + +1. Newlines are defined as UNIX newlines, represented by `\n` and ASCII code 10. If newlines are preceded with `\r`, this character is considered part of the previous line or payload and may emit an error. +2. UUIDs are declared as either 32 character hexadecimal strings without dashes (`"12c2d058d58442709aa2eca08bf20986"`), or 36 character strings with dashes (`"12c2d058-d584-4270-9aa2-eca08bf20986"`). It is recommended to omit dashes and use UUID v4 in all cases. +3. Envelopes do not offer a mechanism for compression. However, an entire Envelope may be compressed or decompressed in an implementation defined way by any component handling Envelopes. For example, [Ingestion](https://develop.sentry.dev/sdk/data-model/envelopes/#ingestion) + allows compression via content encoding. + +### [Headers](https://develop.sentry.dev/sdk/data-model/envelopes/#headers) + +Envelopes contain Headers in several places. Headers are JSON-encoded objects (key-value mappings) that follow these rules: + +* Always encoded in UTF-8 +* Must be valid JSON +* Must be declared in a single line; no newlines +* Always followed by a newline (`\n`) or the end of the file +* Must not be padded by leading or trailing whitespace +* Should be serialized in their most compact form without additional white space. Whitespace within the JSON headers is permitted, though discouraged. +* Unknown attributes are allowed and should be retained by all implementations; however, attributes not covered in this spec must not be actively emitted by any implementation. +* All known headers and their data types can be validated by an implementation; if validation fails, the Envelope may be rejected as malformed. +* Empty headers `{}` are technically valid + +Header-only Example: + +JSON + +Copied + + { "event_id": "12c2d058d58442709aa2eca08bf20986" } + + + { "event_id": "12c2d058d58442709aa2eca08bf20986" } + + +### [Envelopes](https://develop.sentry.dev/sdk/data-model/envelopes/#envelopes) + +The full grammar for an Envelope is: + +Bash + +Copied + + Envelope = Headers { "\n" Item } [ "\n" ] ; + Item = Headers "\n" Payload ; + Payload = { * } ; + + + Envelope = Headers { "\n" Item } [ "\n" ] ; + Item = Headers "\n" Payload ; + Payload = { * } ; + + +* **Headers** are a single line containing a JSON object, as defined in the [Headers](https://develop.sentry.dev/sdk/data-model/envelopes/#headers) + section. Attributes defined in the Envelope header scope the contents of the Envelope and can be thought of as applying to all Items. +* Based on the contents of the Envelope, certain header attributes may be required. See [Envelope Items](https://develop.sentry.dev/sdk/foundations/envelopes/envelope-items/) + for a specification of required attributes. +* **Items** comprise their own headers and a payload. There can be an arbitrary number of **Items** in an Envelope separated by a newline. An implementation should consume Items until the file ends. +* Envelopes should be terminated with a trailing newline. This newline is optional. After the final newline, no whitespace is allowed. +* Envelopes may be empty, terminating immediately after the headers. +* The end of file (EOF) does not implicitly terminate an Envelope if more data is expected, such as a Payload. + +### [Envelope Headers](https://develop.sentry.dev/sdk/data-model/envelopes/#envelope-headers) + +Envelopes can have a number of headers which are valid in all situations: + +`dsn` + +_String, recommended._ An envelope can be self authenticated. This means that + +the envelope has all the information necessary to be sent to sentry. In this + +case the full DSN must be stored in this key. + +`sdk` + +_Object, recommended._ This can carry the same payload as the [`sdk` interface](https://develop.sentry.dev/sdk/foundations/transport/event-payloads/sdk/) + +in the event payload but can be carried for all events. This means that SDK + +information can be carried for minidumps, session data and other submissions. + +`sent_at` + +_String, recommended._ The timestamp when the event was sent from the SDK as string in + +[RFC 3339](https://tools.ietf.org/html/rfc3339) + format. Used for clock drift + +correction of the event timestamp. The time zone must be UTC. + +##### Implementation Guidance for the sent\_at Header + +It is recommend to _always_ send the `sent_at` envelope header. Do not try to determine whether it should be sent or not, as that determination can be made on the receiving side. + +The timestamp should be generated as close as possible to the transmission of the event, so that the delay between sending the envelope and receiving it on the server-side is minimized. This is usually accomplished in serialization of the envelope header. + +However, care must be taken that the header is only applied _once_. If more than one `sent_at` header is written, Sentry will reject the entire envelope. For example, SDKs that implement caching features should avoid writing the `sent_at` header when caching to disk. Only write it when actually sending the event to Sentry. + +The timestamp can be generated by any of the following (for example): + +JavaScript + +: `new Date().toISOString()` + +Python + +: `datetime.now(timezone.utc).isoformat()` +_Don't use `datetime.utcnow()`, as it will omit the time zone._ + +.NET + +: `DateTime.UtcNow.ToString("o", CultureInfo.InvariantCulture)` or `DateTimeOffset.UtcNow.ToString("o", CultureInfo.InvariantCulture)` + +Java + +: `Instant.now().toString()` + +_Also note that the `sent_at` header replaces the `sentry_timestamp` key previously set in authorization headers, which has now been fully deprecated. You should only send `sent_at`, and not `sentry_timestamp`._ + +### [Items](https://develop.sentry.dev/sdk/data-model/envelopes/#items) + +Items supply the data of an Envelope. Without Items, an Envelope is considered _empty_ and can safely be discarded. + +There are two generic headers for every Item: + +`type` + +**String, required.** Specifies the type of this Item and its contents. Based + +on the Item type, more headers may be required. See [Envelope Items](https://develop.sentry.dev/sdk/foundations/envelopes/envelope-items/) + for a list + +of all Item types. + +`length` + +_int, recommended._ The length of the payload in bytes. If no `length` is + +specified, the payload implicitly goes to the next newline. For payloads + +containing newline characters, the `length` must be specified. + +##### On omitting \`length\` + +By default, always declare the payload length to enable faster parsing of an Envelope. + +If the Envelope contains a large number of very small Items, omitting the length can be beneficial for compression. This is the case for sessions. + +The implementor should assess this on a per-case basis and explicitly argue about the decision. + +Notes for implementors: + +* Envelope header is **required**, but it can be empty. +* Implementations **must gracefully skip and retain** Items of unknown type, along with their payload. +* Unknown attributes must be forwarded to the upstream. +* Length-prefixed payloads must terminate with `\n` or EOF. The newline is not considered part of the payload. Any other character, including whitespace, means the Envelope is malformed. +* If `length` cannot be consumed, that is, the Envelope is EOF before the number of bytes has been consumed, then the Envelope is malformed. +* If an Item with implicit length is terminated by `\r\n`, then `\r` is considered an arbitrary character not part of the newline, and thus part of the payload. + +### [Full Examples](https://develop.sentry.dev/sdk/data-model/envelopes/#full-examples) + +These examples contain full Envelope payloads. Newlines are explicitly marked with `\n`, unprintable characters are escaped with `\x<><>`. all other characters are literal. + +**Envelope with 2 Items:** + +Note that the attachment contains a Windows newline at the end of its payload which is included in `length`: + +Bash + +Copied + + {"event_id":"9ec79c33ec9942ab8353589fcb2e04dc","dsn":"https://e12d836b15bb49d7bbf99e64295d995b:@sentry.io/42"}\n + {"type":"attachment","length":10,"content_type":"text/plain","filename":"hello.txt"}\n + \xef\xbb\xbfHello\r\n\n + {"type":"event","length":41,"content_type":"application/json","filename":"application.log"}\n + {"message":"hello world","level":"error"}\n + + + {"event_id":"9ec79c33ec9942ab8353589fcb2e04dc","dsn":"https://e12d836b15bb49d7bbf99e64295d995b:@sentry.io/42"}\n + {"type":"attachment","length":10,"content_type":"text/plain","filename":"hello.txt"}\n + \xef\xbb\xbfHello\r\n\n + {"type":"event","length":41,"content_type":"application/json","filename":"application.log"}\n + {"message":"hello world","level":"error"}\n + + +**Envelope with 2 Items, last newline omitted:** + +Note that the attachment contains a Windows newline at the end of its payload which is included in `length`: + +Bash + +Copied + + {"event_id":"9ec79c33ec9942ab8353589fcb2e04dc","dsn":"https://e12d836b15bb49d7bbf99e64295d995b:@sentry.io/42"}\n + {"type":"attachment","length":10,"content_type":"text/plain","filename":"hello.txt"}\n + \xef\xbb\xbfHello\r\n\n + {"type":"event","length":41,"content_type":"application/json","filename":"application.log"}\n + {"message":"hello world","level":"error"} + + + {"event_id":"9ec79c33ec9942ab8353589fcb2e04dc","dsn":"https://e12d836b15bb49d7bbf99e64295d995b:@sentry.io/42"}\n + {"type":"attachment","length":10,"content_type":"text/plain","filename":"hello.txt"}\n + \xef\xbb\xbfHello\r\n\n + {"type":"event","length":41,"content_type":"application/json","filename":"application.log"}\n + {"message":"hello world","level":"error"} + + +**Envelope with 2 empty attachments:** + +Bash + +Copied + + {"event_id":"9ec79c33ec9942ab8353589fcb2e04dc"}\n + {"type":"attachment","length":0}\n + \n + {"type":"attachment","length":0}\n + \n + + + {"event_id":"9ec79c33ec9942ab8353589fcb2e04dc"}\n + {"type":"attachment","length":0}\n + \n + {"type":"attachment","length":0}\n + \n + + +**Envelope with 2 empty attachments, last newline omitted:** + +Bash + +Copied + + {"event_id":"9ec79c33ec9942ab8353589fcb2e04dc"}\n + {"type":"attachment","length":0}\n + \n + {"type":"attachment","length":0}\n + + + {"event_id":"9ec79c33ec9942ab8353589fcb2e04dc"}\n + {"type":"attachment","length":0}\n + \n + {"type":"attachment","length":0}\n + + +**Item with implicit length, terminated by newline:** + +Bash + +Copied + + {"event_id":"9ec79c33ec9942ab8353589fcb2e04dc"}\n + {"type":"attachment"}\n + helloworld\n + + + {"event_id":"9ec79c33ec9942ab8353589fcb2e04dc"}\n + {"type":"attachment"}\n + helloworld\n + + +**Item with implicit length, last newline omitted, terminated by EOF:** + +Bash + +Copied + + {"event_id":"9ec79c33ec9942ab8353589fcb2e04dc"}\n + {"type":"attachment"}\n + helloworld + + + {"event_id":"9ec79c33ec9942ab8353589fcb2e04dc"}\n + {"type":"attachment"}\n + helloworld + + +**Envelope without headers, implicit length, last newline omitted, terminated by EOF:** + +Bash + +Copied + + {}\n + {"type":"session"}\n + {"started": "2020-02-07T14:16:00Z","attrs":{"release":"sentry-test@1.0.0"}} + + + {}\n + {"type":"session"}\n + {"started": "2020-02-07T14:16:00Z","attrs":{"release":"sentry-test@1.0.0"}} + + +[Data Model](https://develop.sentry.dev/sdk/data-model/envelopes/#data-model) + +------------------------------------------------------------------------------ + +This section has been moved to [Envelope Items](https://develop.sentry.dev/sdk/foundations/envelopes/envelope-items/) +. + +[Ingestion](https://develop.sentry.dev/sdk/data-model/envelopes/#ingestion) + +---------------------------------------------------------------------------- + +This section describes how to ingest Envelopes into Relay or Sentry. The main ingestion endpoint for Envelopes is: + +Bash + +Copied + + POST /api//envelope/ + + + POST /api//envelope/ + + +### [HTTP Headers](https://develop.sentry.dev/sdk/data-model/envelopes/#http-headers) + +Envelope requests may contain all headers as regular store requests. The only accepted `content-type` is `application/x-sentry-envelope`, which is implied if it is missing. To minimize the necessity for `CORS` preflights it's acceptable to send `text/plain`, `multipart/form-data` and `application/x-www-form-urlencoded` as well. In either of those cases the behavior however is the same as using `application/x-sentry-envelope`. + +### [Authentication](https://develop.sentry.dev/sdk/data-model/envelopes/#authentication) + +In addition to regular HTTP header- and querystring authentication, the Envelope endpoint allows to authenticate via an Envelope header. To choose this authentication method, set the `"dsn"` Envelope header to the full DSN string. + +If multiple forms of authentication are given, the endpoint validates that the information matches and otherwise rejects the request. If both are missing, the Envelope is rejected with status code `403 Forbidden`. + +##### Backward Compatibility + +Envelope header authentication requires **Relay v21.6.0**. Earlier versions of Relay do not support Envelope header authentication and respond with HTTP error _401 Unauthorized ("missing authorization information")_ to envelope uploads. + +SDKs should not rely on Envelope header authentication to retain backward compatibility with older versions of Sentry on-premise unless absolutely required. Instead, stick to HTTP headers or query parameters wherever possible. + +### [Size Limits](https://develop.sentry.dev/sdk/data-model/envelopes/#size-limits) + +Event ingestion imposes limits on the size and number of Items in Envelopes. These limits are subject to future change and defined currently as (see [Relay config source](https://github.com/getsentry/relay/blob/master/relay-config/src/config.rs) +): + +* _200 MiB_ for an envelope after decompression including all envelope items. +* _1 MiB_ for event (errors and transactions), span, log, and metric (statsd, buckets, meta) envelope items. +* _2 KiB_ for each metric within an envelope. Relay discards the entire envelope if the one of the metrics exceeds 2 KiB. +* _100 KiB_ for monitor check-in items +* _4 KiB_ for client report items +* _50 MiB_ for profile items +* _10 MiB_ for compressed replay items +* _100 MiB_ for replay items after decompression +* _100 sessions_ per envelope +* _100 pre-aggregated session buckets_ per each `"sessions"` item + +[External References](https://develop.sentry.dev/sdk/data-model/envelopes/#external-references) + +------------------------------------------------------------------------------------------------ + +* [Multi Part Form Data](https://tools.ietf.org/html/rfc7578) + +* [Chunked Transfer Encoding](https://en.wikipedia.org/wiki/Chunked_transfer_encoding) + + +[Previous\ +\ +Transport](https://develop.sentry.dev/sdk/foundations/transport/) + +[Next\ +\ +Envelope Items](https://develop.sentry.dev/sdk/foundations/envelopes/envelope-items/) + +Was this helpful? + +Yes 👍No 👎 + +How can we improve this page? + +Email (optional) + +Submit feedback + +**Help improve this content** +Our documentation is open source and available on GitHub. Your contributions are welcome, whether fixing a typo (drat!) or suggesting an update ("yeah, this would be better"). + +[How to contribute](https://docs.sentry.io/contributing/) +   |  [Edit this page](https://github.com/getsentry/sentry-docs/edit/master/develop-docs/sdk/foundations/envelopes/index.mdx) +   |  [Create a docs issue](https://github.com/getsentry/sentry-docs/issues/new/choose) +   |  [Get support](https://www.sentry.help/en/) \ No newline at end of file diff --git a/.firecrawl/develop.sentry.dev-sdk-expected-features.md b/.firecrawl/develop.sentry.dev-sdk-expected-features.md new file mode 100644 index 00000000..ca47b77c --- /dev/null +++ b/.firecrawl/develop.sentry.dev-sdk-expected-features.md @@ -0,0 +1,105 @@ +[Skip to content](https://develop.sentry.dev/sdk/expected-features/#main) + +[![Sentry's logo](https://develop.sentry.dev/_next/static/media/sentry-logo-dark.fc8e1eeb.svg)\ +\ +Docs](https://develop.sentry.dev/ "Sentry error monitoring") + +[Changelog](https://sentry.io/changelog/) +[Sandbox](https://sandbox.sentry.io/) +[Go to Sentry](https://sentry.io/) +[Get Started](https://sentry.io/signup/) + +Menu + +* [Getting Started](https://develop.sentry.dev/getting-started/) + +* [Engineering Practices](https://develop.sentry.dev/engineering-practices/) + +* [Application Architecture](https://develop.sentry.dev/application-architecture/) + +* [Development Infrastructure](https://develop.sentry.dev/development-infrastructure/) + +* [Backend](https://develop.sentry.dev/backend/) + +* [Frontend](https://develop.sentry.dev/frontend/) + +* [Services](https://develop.sentry.dev/services/) + +* [Integrations](https://develop.sentry.dev/integrations/) + +* [Ingestion](https://develop.sentry.dev/ingestion/) + +* [SDKs](https://develop.sentry.dev/sdk/) + * [Getting Started](https://develop.sentry.dev/sdk/getting-started/) + + * [Foundations](https://develop.sentry.dev/sdk/foundations/) + + * [Telemetry](https://develop.sentry.dev/sdk/telemetry/) + + * [Platform Specifics](https://develop.sentry.dev/sdk/platform-specifics/) + +* [SDK Setup Wizards](https://develop.sentry.dev/sdk-setup-wizards/) + +* [Self-Hosted Sentry](https://develop.sentry.dev/self-hosted/) + + +* * * + +[Code of Conduct](https://open.sentry.io/code-of-conduct/) +[User Documentation](https://docs.sentry.io/) + +* [Home](https://develop.sentry.dev/) + +* [SDK Development](https://develop.sentry.dev/sdk/) + + +Copy page + +SDK Development +=============== + +Sentry SDKs are the client libraries that run inside users' applications, capturing errors and other event data before sending it to Sentry for processing. +----------------------------------------------------------------------------------------------------------------------------------------------------------- + +* #### [Getting Started](https://develop.sentry.dev/sdk/getting-started/) + + The following content provides guidance for SDK development at Sentry, helping both internal and external developers understand the motivations behind our design decisions. + +* #### [Foundations](https://develop.sentry.dev/sdk/foundations/) + + Core concepts and infrastructure that every SDK builds on - transport protocol, data model, contexts, scopes, and attributes. + +* #### [Telemetry](https://develop.sentry.dev/sdk/telemetry/) + + Learn about the different telemetry data, that our SDKs can collect. + +* #### [Platform Specifics](https://develop.sentry.dev/sdk/platform-specifics/) + + Read more about the specifics when it comes to certain SDKs. + + +[Previous\ +\ +Ingestion](https://develop.sentry.dev/ingestion/) + +[Next\ +\ +Getting Started](https://develop.sentry.dev/sdk/getting-started/) + +Was this helpful? + +Yes 👍No 👎 + +How can we improve this page? + +Email (optional) + +Submit feedback + +**Help improve this content** +Our documentation is open source and available on GitHub. Your contributions are welcome, whether fixing a typo (drat!) or suggesting an update ("yeah, this would be better"). + +[How to contribute](https://docs.sentry.io/contributing/) +   |  [Edit this page](https://github.com/getsentry/sentry-docs/edit/master/develop-docs/sdk/index.mdx) +   |  [Create a docs issue](https://github.com/getsentry/sentry-docs/issues/new/choose) +   |  [Get support](https://www.sentry.help/en/) \ No newline at end of file diff --git a/.firecrawl/github.com-open-telemetry-opentelemetry-android.md b/.firecrawl/github.com-open-telemetry-opentelemetry-android.md new file mode 100644 index 00000000..efa108ac --- /dev/null +++ b/.firecrawl/github.com-open-telemetry-opentelemetry-android.md @@ -0,0 +1,684 @@ +[Skip to content](https://github.com/open-telemetry/opentelemetry-android#start-of-content) + + +Navigation Menu +--------------- + +[](https://github.com/) + +[Sign in](https://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fopen-telemetry%2Fopentelemetry-android) + +Appearance settings + +* Platform + + * AI CODE CREATION + + * [GitHub CopilotWrite better code with AI](https://github.com/features/copilot) + + * [GitHub Copilot appDirect agents from issue to merge](https://github.com/features/ai/github-app) + + * [MCP RegistryIntegrate external tools](https://github.com/mcp) + + + * DEVELOPER WORKFLOWS + + * [ActionsAutomate any workflow](https://github.com/features/actions) + + * [CodespacesInstant dev environments](https://github.com/features/codespaces) + + * [IssuesPlan and track work](https://github.com/features/issues) + + * [Code ReviewManage code changes](https://github.com/features/code-review) + + * [Code QualityEnforce quality at merge](https://github.com/features/code-quality) + + + * APPLICATION SECURITY + + * [GitHub Advanced SecurityFind and fix vulnerabilities](https://github.com/security/advanced-security) + + * [Code securitySecure your code as you build](https://github.com/security/advanced-security/code-security) + + * [Secret protectionStop leaks before they start](https://github.com/security/advanced-security/secret-protection) + + + * EXPLORE + + * [Why GitHub](https://github.com/why-github) + + * [Documentation](https://docs.github.com/) + + * [Blog](https://github.blog/) + + * [Changelog](https://github.blog/changelog) + + * [Marketplace](https://github.com/marketplace) + + + + [View all features](https://github.com/features) + +* Solutions + + * BY COMPANY SIZE + + * [Enterprises](https://github.com/enterprise) + + * [Small and medium teams](https://github.com/team) + + * [Startups](https://github.com/enterprise/startups) + + * [Nonprofits](https://github.com/solutions/industry/nonprofits) + + + * BY USE CASE + + * [App Modernization](https://github.com/solutions/use-case/app-modernization) + + * [DevSecOps](https://github.com/solutions/use-case/devsecops) + + * [DevOps](https://github.com/solutions/use-case/devops) + + * [CI/CD](https://github.com/solutions/use-case/ci-cd) + + * [View all use cases](https://github.com/solutions/use-case) + + + * BY INDUSTRY + + * [Healthcare](https://github.com/solutions/industry/healthcare) + + * [Financial services](https://github.com/solutions/industry/financial-services) + + * [Manufacturing](https://github.com/solutions/industry/manufacturing) + + * [Government](https://github.com/solutions/industry/government) + + * [View all industries](https://github.com/solutions/industry) + + + + [View all solutions](https://github.com/solutions) + +* Resources + + * EXPLORE BY TOPIC + + * [AI](https://github.com/resources/articles?topic=ai) + + * [Software Development](https://github.com/resources/articles?topic=software-development) + + * [DevOps](https://github.com/resources/articles?topic=devops) + + * [Security](https://github.com/resources/articles?topic=security) + + * [View all topics](https://github.com/resources/articles) + + + * EXPLORE BY TYPE + + * [Customer stories](https://github.com/customer-stories) + + * [Events & webinars](https://github.com/resources/events) + + * [Ebooks & reports](https://github.com/resources/whitepapers) + + * [Business insights](https://github.com/solutions/executive-insights) + + * [GitHub Skills](https://skills.github.com/) + + + * SUPPORT & SERVICES + + * [Documentation](https://docs.github.com/) + + * [Customer support](https://support.github.com/) + + * [Community forum](https://github.com/orgs/community/discussions) + + * [Trust center](https://github.com/trust-center) + + * [Partners](https://github.com/partners) + + + + [View all resources](https://github.com/resources) + +* Open Source + + * COMMUNITY + + * [GitHub SponsorsFund open source developers](https://github.com/open-source/sponsors) + + + * PROGRAMS + + * [Security Lab](https://securitylab.github.com/) + + * [Maintainer Community](https://maintainers.github.com/) + + * [GitHub Stars](https://stars.github.com/) + + * [Archive Program](https://archiveprogram.github.com/) + + + * REPOSITORIES + + * [Topics](https://github.com/topics) + + * [Trending](https://github.com/trending) + + * [Collections](https://github.com/collections) + + + +* Enterprise + + * ENTERPRISE SOLUTIONS + + * [Enterprise platformAI-powered developer platform](https://github.com/enterprise) + + + * AVAILABLE ADD-ONS + + * [GitHub Advanced SecurityEnterprise-grade security features](https://github.com/security/advanced-security) + + * [Copilot for BusinessEnterprise-grade AI features](https://github.com/features/copilot/copilot-business) + + * [Premium SupportEnterprise-grade 24/7 support](https://github.com/enterprise/premium-support) + + + +* [Pricing](https://github.com/pricing) + + +Search/ + +[Sign in](https://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fopen-telemetry%2Fopentelemetry-android) + +[Sign up](https://github.com/signup?ref_cta=Sign+up&ref_loc=header+logged+out&ref_page=%2F%3Cuser-name%3E%2F%3Crepo-name%3E&source=header-repo&source_repo=open-telemetry%2Fopentelemetry-android) + +Appearance settings + +You signed in with another tab or window. [Reload](https://github.com/open-telemetry/opentelemetry-android) + to refresh your session. You signed out in another tab or window. [Reload](https://github.com/open-telemetry/opentelemetry-android) + to refresh your session. You switched accounts on another tab or window. [Reload](https://github.com/open-telemetry/opentelemetry-android) + to refresh your session. Dismiss alert + +### Uh oh! + +There was an error while loading. [Please reload this page](https://github.com/open-telemetry/opentelemetry-android) +. + +[open-telemetry](https://github.com/open-telemetry) / **[opentelemetry-android](https://github.com/open-telemetry/opentelemetry-android)** Public + +* [Notifications](https://github.com/login?return_to=%2Fopen-telemetry%2Fopentelemetry-android) + You must be signed in to change notification settings +* [Fork 113](https://github.com/login?return_to=%2Fopen-telemetry%2Fopentelemetry-android) + +* [Star 296](https://github.com/login?return_to=%2Fopen-telemetry%2Fopentelemetry-android) + + +* [Code](https://github.com/open-telemetry/opentelemetry-android) + +* [Issues 92](https://github.com/open-telemetry/opentelemetry-android/issues) + +* [Pull requests 17](https://github.com/open-telemetry/opentelemetry-android/pulls) + +* [Actions](https://github.com/open-telemetry/opentelemetry-android/actions) + +* [Projects](https://github.com/open-telemetry/opentelemetry-android/projects) + +* [Security and quality 0](https://github.com/open-telemetry/opentelemetry-android/security) + +* [Insights](https://github.com/open-telemetry/opentelemetry-android/pulse) + + +Additional navigation options + +* [Code](https://github.com/open-telemetry/opentelemetry-android) + +* [Issues](https://github.com/open-telemetry/opentelemetry-android/issues) + +* [Pull requests](https://github.com/open-telemetry/opentelemetry-android/pulls) + +* [Actions](https://github.com/open-telemetry/opentelemetry-android/actions) + +* [Projects](https://github.com/open-telemetry/opentelemetry-android/projects) + +* [Security and quality](https://github.com/open-telemetry/opentelemetry-android/security) + +* [Insights](https://github.com/open-telemetry/opentelemetry-android/pulse) + + +[](https://github.com/open-telemetry/opentelemetry-android) + +main + +[Branches](https://github.com/open-telemetry/opentelemetry-android/branches) +[Tags](https://github.com/open-telemetry/opentelemetry-android/tags) + +[](https://github.com/open-telemetry/opentelemetry-android/branches) +[](https://github.com/open-telemetry/opentelemetry-android/tags) + +Go to file + +Code + +Open more actions menu + +Latest commit +------------- + +History +------- + +[2,317 Commits](https://github.com/open-telemetry/opentelemetry-android/commits/main/) + +[](https://github.com/open-telemetry/opentelemetry-android/commits/main/) +2,317 Commits + +Folders and files +----------------- + +| Name | | Name | Last commit message | Last commit date | +| --- | --- | --- | --- | +| [.github](https://github.com/open-telemetry/opentelemetry-android/tree/main/.github ".github") | | [.github](https://github.com/open-telemetry/opentelemetry-android/tree/main/.github ".github") | | | +| [agent-api](https://github.com/open-telemetry/opentelemetry-android/tree/main/agent-api "agent-api") | | [agent-api](https://github.com/open-telemetry/opentelemetry-android/tree/main/agent-api "agent-api") | | | +| [android-agent](https://github.com/open-telemetry/opentelemetry-android/tree/main/android-agent "android-agent") | | [android-agent](https://github.com/open-telemetry/opentelemetry-android/tree/main/android-agent "android-agent") | | | +| [animal-sniffer-signature](https://github.com/open-telemetry/opentelemetry-android/tree/main/animal-sniffer-signature "animal-sniffer-signature") | | [animal-sniffer-signature](https://github.com/open-telemetry/opentelemetry-android/tree/main/animal-sniffer-signature "animal-sniffer-signature") | | | +| [buildSrc](https://github.com/open-telemetry/opentelemetry-android/tree/main/buildSrc "buildSrc") | | [buildSrc](https://github.com/open-telemetry/opentelemetry-android/tree/main/buildSrc "buildSrc") | | | +| [common](https://github.com/open-telemetry/opentelemetry-android/tree/main/common "common") | | [common](https://github.com/open-telemetry/opentelemetry-android/tree/main/common "common") | | | +| [config/detekt](https://github.com/open-telemetry/opentelemetry-android/tree/main/config/detekt "This path skips through empty directories") | | [config/detekt](https://github.com/open-telemetry/opentelemetry-android/tree/main/config/detekt "This path skips through empty directories") | | | +| [core](https://github.com/open-telemetry/opentelemetry-android/tree/main/core "core") | | [core](https://github.com/open-telemetry/opentelemetry-android/tree/main/core "core") | | | +| [demo-app](https://github.com/open-telemetry/opentelemetry-android/tree/main/demo-app "demo-app") | | [demo-app](https://github.com/open-telemetry/opentelemetry-android/tree/main/demo-app "demo-app") | | | +| [docs](https://github.com/open-telemetry/opentelemetry-android/tree/main/docs "docs") | | [docs](https://github.com/open-telemetry/opentelemetry-android/tree/main/docs "docs") | | | +| [gradle](https://github.com/open-telemetry/opentelemetry-android/tree/main/gradle "gradle") | | [gradle](https://github.com/open-telemetry/opentelemetry-android/tree/main/gradle "gradle") | | | +| [instrumentation](https://github.com/open-telemetry/opentelemetry-android/tree/main/instrumentation "instrumentation") | | [instrumentation](https://github.com/open-telemetry/opentelemetry-android/tree/main/instrumentation "instrumentation") | | | +| [opentelemetry-android-bom](https://github.com/open-telemetry/opentelemetry-android/tree/main/opentelemetry-android-bom "opentelemetry-android-bom") | | [opentelemetry-android-bom](https://github.com/open-telemetry/opentelemetry-android/tree/main/opentelemetry-android-bom "opentelemetry-android-bom") | | | +| [semconv](https://github.com/open-telemetry/opentelemetry-android/tree/main/semconv "semconv") | | [semconv](https://github.com/open-telemetry/opentelemetry-android/tree/main/semconv "semconv") | | | +| [services](https://github.com/open-telemetry/opentelemetry-android/tree/main/services "services") | | [services](https://github.com/open-telemetry/opentelemetry-android/tree/main/services "services") | | | +| [session](https://github.com/open-telemetry/opentelemetry-android/tree/main/session "session") | | [session](https://github.com/open-telemetry/opentelemetry-android/tree/main/session "session") | | | +| [smoke-test-app](https://github.com/open-telemetry/opentelemetry-android/tree/main/smoke-test-app "smoke-test-app") | | [smoke-test-app](https://github.com/open-telemetry/opentelemetry-android/tree/main/smoke-test-app "smoke-test-app") | | | +| [smoke-test](https://github.com/open-telemetry/opentelemetry-android/tree/main/smoke-test "smoke-test") | | [smoke-test](https://github.com/open-telemetry/opentelemetry-android/tree/main/smoke-test "smoke-test") | | | +| [test-common](https://github.com/open-telemetry/opentelemetry-android/tree/main/test-common "test-common") | | [test-common](https://github.com/open-telemetry/opentelemetry-android/tree/main/test-common "test-common") | | | +| [.clomonitor.yml](https://github.com/open-telemetry/opentelemetry-android/blob/main/.clomonitor.yml ".clomonitor.yml") | | [.clomonitor.yml](https://github.com/open-telemetry/opentelemetry-android/blob/main/.clomonitor.yml ".clomonitor.yml") | | | +| [.editorconfig](https://github.com/open-telemetry/opentelemetry-android/blob/main/.editorconfig ".editorconfig") | | [.editorconfig](https://github.com/open-telemetry/opentelemetry-android/blob/main/.editorconfig ".editorconfig") | | | +| [.fossa.yml](https://github.com/open-telemetry/opentelemetry-android/blob/main/.fossa.yml ".fossa.yml") | | [.fossa.yml](https://github.com/open-telemetry/opentelemetry-android/blob/main/.fossa.yml ".fossa.yml") | | | +| [.gitignore](https://github.com/open-telemetry/opentelemetry-android/blob/main/.gitignore ".gitignore") | | [.gitignore](https://github.com/open-telemetry/opentelemetry-android/blob/main/.gitignore ".gitignore") | | | +| [.lychee.toml](https://github.com/open-telemetry/opentelemetry-android/blob/main/.lychee.toml ".lychee.toml") | | [.lychee.toml](https://github.com/open-telemetry/opentelemetry-android/blob/main/.lychee.toml ".lychee.toml") | | | +| [AGENTS.md](https://github.com/open-telemetry/opentelemetry-android/blob/main/AGENTS.md "AGENTS.md") | | [AGENTS.md](https://github.com/open-telemetry/opentelemetry-android/blob/main/AGENTS.md "AGENTS.md") | | | +| [CHANGELOG.md](https://github.com/open-telemetry/opentelemetry-android/blob/main/CHANGELOG.md "CHANGELOG.md") | | [CHANGELOG.md](https://github.com/open-telemetry/opentelemetry-android/blob/main/CHANGELOG.md "CHANGELOG.md") | | | +| [CONTRIBUTING.md](https://github.com/open-telemetry/opentelemetry-android/blob/main/CONTRIBUTING.md "CONTRIBUTING.md") | | [CONTRIBUTING.md](https://github.com/open-telemetry/opentelemetry-android/blob/main/CONTRIBUTING.md "CONTRIBUTING.md") | | | +| [LICENSE](https://github.com/open-telemetry/opentelemetry-android/blob/main/LICENSE "LICENSE") | | [LICENSE](https://github.com/open-telemetry/opentelemetry-android/blob/main/LICENSE "LICENSE") | | | +| [README.md](https://github.com/open-telemetry/opentelemetry-android/blob/main/README.md "README.md") | | [README.md](https://github.com/open-telemetry/opentelemetry-android/blob/main/README.md "README.md") | | | +| [RELEASING.md](https://github.com/open-telemetry/opentelemetry-android/blob/main/RELEASING.md "RELEASING.md") | | [RELEASING.md](https://github.com/open-telemetry/opentelemetry-android/blob/main/RELEASING.md "RELEASING.md") | | | +| [VERSIONING.md](https://github.com/open-telemetry/opentelemetry-android/blob/main/VERSIONING.md "VERSIONING.md") | | [VERSIONING.md](https://github.com/open-telemetry/opentelemetry-android/blob/main/VERSIONING.md "VERSIONING.md") | | | +| [build.gradle.kts](https://github.com/open-telemetry/opentelemetry-android/blob/main/build.gradle.kts "build.gradle.kts") | | [build.gradle.kts](https://github.com/open-telemetry/opentelemetry-android/blob/main/build.gradle.kts "build.gradle.kts") | | | +| [code-of-conduct.md](https://github.com/open-telemetry/opentelemetry-android/blob/main/code-of-conduct.md "code-of-conduct.md") | | [code-of-conduct.md](https://github.com/open-telemetry/opentelemetry-android/blob/main/code-of-conduct.md "code-of-conduct.md") | | | +| [codecov.yml](https://github.com/open-telemetry/opentelemetry-android/blob/main/codecov.yml "codecov.yml") | | [codecov.yml](https://github.com/open-telemetry/opentelemetry-android/blob/main/codecov.yml "codecov.yml") | | | +| [gradle.properties](https://github.com/open-telemetry/opentelemetry-android/blob/main/gradle.properties "gradle.properties") | | [gradle.properties](https://github.com/open-telemetry/opentelemetry-android/blob/main/gradle.properties "gradle.properties") | | | +| [gradlew](https://github.com/open-telemetry/opentelemetry-android/blob/main/gradlew "gradlew") | | [gradlew](https://github.com/open-telemetry/opentelemetry-android/blob/main/gradlew "gradlew") | | | +| [gradlew.bat](https://github.com/open-telemetry/opentelemetry-android/blob/main/gradlew.bat "gradlew.bat") | | [gradlew.bat](https://github.com/open-telemetry/opentelemetry-android/blob/main/gradlew.bat "gradlew.bat") | | | +| [reusable-link-check.yml](https://github.com/open-telemetry/opentelemetry-android/blob/main/reusable-link-check.yml "reusable-link-check.yml") | | [reusable-link-check.yml](https://github.com/open-telemetry/opentelemetry-android/blob/main/reusable-link-check.yml "reusable-link-check.yml") | | | +| [settings.gradle.kts](https://github.com/open-telemetry/opentelemetry-android/blob/main/settings.gradle.kts "settings.gradle.kts") | | [settings.gradle.kts](https://github.com/open-telemetry/opentelemetry-android/blob/main/settings.gradle.kts "settings.gradle.kts") | | | +| View all files | | | + +Repository files navigation +--------------------------- + +* [README](https://github.com/open-telemetry/opentelemetry-android#) + +* [Code of conduct](https://github.com/open-telemetry/opentelemetry-android#) + +* [Contributing](https://github.com/open-telemetry/opentelemetry-android#) + +* [Apache-2.0 license](https://github.com/open-telemetry/opentelemetry-android#) + +* [Security](https://github.com/open-telemetry/opentelemetry-android#) + + +More items + +[![OpenTelemetry Icon](https://camo.githubusercontent.com/4dda6bcbcc0cb08fefcea1676ed7698e961bb95b3a9ab728a2a517ccb558172d/68747470733a2f2f6f70656e74656c656d657472792e696f2f696d672f6c6f676f732f6f70656e74656c656d657472792d6c6f676f2d6e61762e706e67)](https://camo.githubusercontent.com/4dda6bcbcc0cb08fefcea1676ed7698e961bb95b3a9ab728a2a517ccb558172d/68747470733a2f2f6f70656e74656c656d657472792e696f2f696d672f6c6f676f732f6f70656e74656c656d657472792d6c6f676f2d6e61762e706e67) + OpenTelemetry Android +============================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================== + +[](https://github.com/open-telemetry/opentelemetry-android#-opentelemetry-android) + +[![Continuous Build](https://github.com/open-telemetry/opentelemetry-android/actions/workflows/build.yaml/badge.svg)](https://github.com/open-telemetry/opentelemetry-android/actions?query=workflow%3Abuild+branch%3Amain) + [![Maven Central](https://camo.githubusercontent.com/140aa1e8256e40b4fe4938aa5198fb9355ab87590e16f9d33e0f143c5dd4ec25/68747470733a2f2f696d672e736869656c64732e696f2f6d6176656e2d63656e7472616c2f762f696f2e6f70656e74656c656d657472792e616e64726f69642f616e64726f69642d6167656e742e737667)](https://central.sonatype.com/artifact/io.opentelemetry.android/android-agent) + [![OpenSSF Scorecard](https://camo.githubusercontent.com/59732b39a9f11c3789a4b2c4f3ba0d008c6423b963017223efb909269c6f4d1e/68747470733a2f2f6170692e73636f7265636172642e6465762f70726f6a656374732f6769746875622e636f6d2f6f70656e2d74656c656d657472792f6f70656e74656c656d657472792d616e64726f69642f6261646765)](https://scorecard.dev/viewer/?uri=github.com/open-telemetry/opentelemetry-android) + [![android api](https://camo.githubusercontent.com/dcd8315d84a7be5fa90c0ec9d96d272ee3e70940cbce05821d6e0b39f180f7e0/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f416e64726f69645f4150492d32332d677265656e2e737667 "Android min API 23")](https://github.com/open-telemetry/opentelemetry-android/blob/main/VERSIONING.md) + +* [About](https://github.com/open-telemetry/opentelemetry-android#about) + +* [Getting Started](https://github.com/open-telemetry/opentelemetry-android#getting-started) + * [Snapshot Builds](https://github.com/open-telemetry/opentelemetry-android#snapshot-builds) + +* [Features](https://github.com/open-telemetry/opentelemetry-android#features) + +* [Contributing](https://github.com/open-telemetry/opentelemetry-android#contributing) + + +About +===== + +[](https://github.com/open-telemetry/opentelemetry-android#about) + +The repository contains the `OpenTelemetry Android Agent`, which initializes the [OpenTelemetry Java SDK](https://github.com/open-telemetry/opentelemetry-java) + and provides auto-instrumentation of Android apps for real user monitoring (RUM). + +While this project isn't 100% Kotlin, it has a "Kotlin-First" policy where usage in Kotlin-based Android apps will be prioritized in terms of API and idioms. More details about this policy can be found [here](https://github.com/open-telemetry/opentelemetry-android/blob/main/docs/KOTLIN_FIRST.md) +. + +Important + +We are currently seeking additional contributors! See [Contributing](https://github.com/open-telemetry/opentelemetry-android#contributing) + for details. + +Getting Started +=============== + +[](https://github.com/open-telemetry/opentelemetry-android#getting-started) + +> If your project's minSdk is lower than 26, then you must enable [corelib desugaring](https://developer.android.com/studio/write/java8-support#library-desugaring) +> . See [#73](https://github.com/open-telemetry/opentelemetry-android/issues/73) +> for more information. Further, you must use AGP 8.3.0+ and set the `android.useFullClasspathForDexingTransform` property in `gradle.properties` to `true` to ensure desugaring runs properly. For the full context for this workaround, please see [this issue](https://issuetracker.google.com/issues/230454566) +> (comment 18). + +Gradle Setup +------------ + +[](https://github.com/open-telemetry/opentelemetry-android#gradle-setup) + +To use the Android Agent in your application, you will first need to add a dependency in your application's `build.gradle.kts`. We publish a bill of materials (BOM) that helps to coordinate versions of the this project's components and the upstream `opentelemetry-java-instrumentation` and `opentelemetry-java` dependencies. We recommend using the BOM as a platform dependency, and then omitting explicit version information from all other opentelemetry dependencies: + +```kotlin +dependencies { + //... + api(platform("io.opentelemetry.android:opentelemetry-android-bom:1.6.0-alpha")) + implementation("io.opentelemetry.android:android-agent") // Version is resolved through the BOM + //... +} +``` + +Snapshot Builds +--------------- + +[](https://github.com/open-telemetry/opentelemetry-android#snapshot-builds) + +A snapshot is published for every commit to the `main` branch. Snapshots are intended for testing upcoming changes and should not be used in production. You can find the available versions in the [Sonatype snapshot repository](https://central.sonatype.com/service/rest/repository/browse/maven-snapshots/io/opentelemetry/android/) +. + +To use a snapshot, add the Sonatype snapshot repository to `settings.gradle.kts`: + +```kotlin +dependencyResolutionManagement { + repositories { + google() + mavenCentral() + maven(url = "https://central.sonatype.com/repository/maven-snapshots/") // Add this line + } +} +``` + +Then use the latest snapshot version with the BOM in your app's `build.gradle.kts`: + +```kotlin +dependencies { + implementation(platform("io.opentelemetry.android:opentelemetry-android-bom:1.7.0-alpha-SNAPSHOT")) + implementation("io.opentelemetry.android:android-agent") +} +``` + +Gradle caches snapshot dependencies; run `./gradlew --refresh-dependencies` to retrieve a newly published snapshot. + +Agent Initialization +-------------------- + +[](https://github.com/open-telemetry/opentelemetry-android#agent-initialization) + +To initialize the Agent, call `OpenTelemetryRumInitializer.initialize()` in the `onCreate()` function in your app's `Application` object, ideally as early as possible after calling `super.onCreate()`. + +```kotlin +class MainApplication: Application() { + var otelRum: OpenTelemetryRum? = null + + override fun onCreate() { + super.onCreate() + otelRum = initOTel(this) + } +} + +private fun initOTel(context: Context): OpenTelemetryRum? = + runCatching { + OpenTelemetryRumInitializer.initialize( + context = context, + configuration = { + httpExport { + baseUrl = "http://10.0.2.2:4318" + baseHeaders = mapOf("foo" to "bar") + } + instrumentations { + activity { + enabled(true) + } + fragment { + enabled(false) + } + } + session { + backgroundInactivityTimeout = 5.minutes + maxLifetime = 1.days + } + globalAttributes { + Attributes.of(stringKey("demo-version"), "test") + } + disableMetrics() + } + ) + }.onFailure { + Log.e("OpenTelemetryRumInitializer", "Initialization failed", it) + }.getOrNull() +``` + +This call will return an `OpenTelemetryRum` instance with which you can use the Agent and OTel APIs. + +Features +======== + +[](https://github.com/open-telemetry/opentelemetry-android#features) + +In addition to exposing the OTel Java API for manual instrumentation, agent also offers the following features: + +* Streamlined initialization and configuration of the Java SDK instance +* Installation and management of bundled instrumentation +* Offline buffering of telemetry via disk persistence +* Redact and change span attributes before export + +Instrumentation +--------------- + +[](https://github.com/open-telemetry/opentelemetry-android#instrumentation) + +The following instrumentation modules are bundled with the Android Agent: + +* [Activity lifecycle](https://github.com/open-telemetry/opentelemetry-android/blob/main/instrumentation/activity) + +* [ANR detection](https://github.com/open-telemetry/opentelemetry-android/blob/main/instrumentation/anr) + +* [Crash reporting](https://github.com/open-telemetry/opentelemetry-android/blob/main/instrumentation/crash) + +* [Fragment lifecycle](https://github.com/open-telemetry/opentelemetry-android/blob/main/instrumentation/fragment) + +* [Network change detection](https://github.com/open-telemetry/opentelemetry-android/blob/main/instrumentation/network) + +* [Slow/frozen frame render detection](https://github.com/open-telemetry/opentelemetry-android/blob/main/instrumentation/slowrendering) + +* [Startup](https://github.com/open-telemetry/opentelemetry-android/blob/main/instrumentation/startup) + +* [Sessions](https://github.com/open-telemetry/opentelemetry-android/blob/main/instrumentation/sessions) + +* [Screen orientation](https://github.com/open-telemetry/opentelemetry-android/blob/main/instrumentation/screen-orientation) + +* [View click](https://github.com/open-telemetry/opentelemetry-android/blob/main/instrumentation/view-click) + + +There are also other [additional instrumentation modules](https://github.com/open-telemetry/opentelemetry-android/tree/main/instrumentation) + that application developers can include through a gradle dependency. Instrumentations are detected at runtime via the classpath, and are installed automatically. + +Additional Documentation +------------------------ + +[](https://github.com/open-telemetry/opentelemetry-android#additional-documentation) + +See the following pages for details about the related topics: + +* [Kotlin-First Policy](https://github.com/open-telemetry/opentelemetry-android/blob/main/docs/KOTLIN_FIRST.md) + +* [StrictMode Guidance](https://github.com/open-telemetry/opentelemetry-android/blob/main/docs/STRICTMODE.md) + +* [Exporter Management](https://github.com/open-telemetry/opentelemetry-android/blob/main/docs/EXPORTER_CHAIN.md) + + +Contributing +============ + +[](https://github.com/open-telemetry/opentelemetry-android#contributing) + +We are currently resource constrained and are actively seeking new contributors interested in working towards [approver](https://github.com/open-telemetry/community/blob/main/guides/contributor/membership.md#approver) + / [maintainer](https://github.com/open-telemetry/community/blob/main/guides/contributor/membership.md#maintainer) + roles. In addition to the documentation for approver / maintainer roles and the [contributing](https://github.com/open-telemetry/opentelemetry-android/blob/main/CONTRIBUTING.md) + guide, here are some additional notes on engaging: + +* [Pull request](https://github.com/open-telemetry/opentelemetry-android/pulls) + reviews are equally or more helpful than code contributions. Comments and approvals are valuable with or without a formal project role. They're also a great forcing function to explore a fairly complex codebase. +* Attending the [Android: SDK + Automatic Instrumentation](https://github.com/open-telemetry/community?tab=readme-ov-file#implementation-sigs) + Special Interest Group (SIG) is a great way to get to know community members and learn about project priorities. +* Issues labeled [help wanted](https://github.com/open-telemetry/opentelemetry-android/issues?q=is%3Aopen+is%3Aissue+label%3A%22help+wanted%22) + are project priorities. Code contributions (or pull request reviews when a PR is linked) for these issues are particularly important. +* Triaging / responding to new issues and discussions is a great way to engage with the project. +* We are available in the [#otel-android](https://cloud-native.slack.com/archives/C05J0T9K27Q) + channel in the [CNCF Slack](https://slack.cncf.io/) + . Please join us there for further discussions. + +### Thanks to all of our contributors! + +[](https://github.com/open-telemetry/opentelemetry-android#thanks-to-all-of-our-contributors) + +[![Repo contributors](https://camo.githubusercontent.com/6a812e17d80cc17e5f7f7cde9b297a427083e3aa5bb7a67d03a9ff8a6b2bad0a/68747470733a2f2f636f6e747269622e726f636b732f696d6167653f7265706f3d6f70656e2d74656c656d657472792f6f70656e74656c656d657472792d616e64726f6964)](https://github.com/open-telemetry/opentelemetry-android/graphs/contributors) + +Maintainers +----------- + +[](https://github.com/open-telemetry/opentelemetry-android#maintainers) + +* [Cesar Munoz](https://github.com/likethesalad) + , Elastic +* [Jamie Lynch](https://github.com/fractalwrench) + , Embrace +* [Jason Plumb](https://github.com/breedx-splk) + , Splunk + +For more information about the maintainer role, see the [community repository](https://github.com/open-telemetry/community/blob/main/guides/contributor/membership.md#maintainer) +. + +Approvers +--------- + +[](https://github.com/open-telemetry/opentelemetry-android#approvers) + +* [DavidGrath](https://github.com/DavidGrath) + +* [Hanson Ho](https://github.com/bidetofevil) + , Embrace +* [Manoel Aranda Neto](https://github.com/marandaneto) + , PostHog + +For more information about the Approver role, see the [community repository](https://github.com/open-telemetry/community/blob/main/guides/contributor/membership.md#approver) +. + +About +----- + +OpenTelemetry Tooling for Android + +### Resources + +[Readme](https://github.com/open-telemetry/opentelemetry-android#readme-ov-file) + +[Apache-2.0 license](https://github.com/open-telemetry/opentelemetry-android#Apache-2.0-1-ov-file) + +### Code of conduct + +[Code of conduct](https://github.com/open-telemetry/opentelemetry-android#coc-ov-file) + +### Contributing + +[Contributing](https://github.com/open-telemetry/opentelemetry-android#contributing-ov-file) + +### Security policy + +[Security policy](https://github.com/open-telemetry/opentelemetry-android#security-ov-file) + +[Activity](https://github.com/open-telemetry/opentelemetry-android/activity) + +[Custom properties](https://github.com/open-telemetry/opentelemetry-android/custom-properties) + +### Stars + +**296** stars + +### Watchers + +**23** watching + +### Forks + +[**113** forks](https://github.com/open-telemetry/opentelemetry-android/forks) + +[Report repository](https://github.com/contact/report-content?content_url=https%3A%2F%2Fgithub.com%2Fopen-telemetry%2Fopentelemetry-android&report=open-telemetry+%28user%29) + +Releases +-------- + +Packages +-------- + +Used by +------- + +Contributors +------------ + +Languages +--------- + +Footer +------ + +[](https://github.com/) +© 2026 GitHub, Inc. + +### Footer navigation + +* [Terms](https://docs.github.com/site-policy/github-terms/github-terms-of-service) + +* [Privacy](https://docs.github.com/site-policy/privacy-policies/github-privacy-statement) + +* [Security](https://github.com/security) + +* [Status](https://www.githubstatus.com/) + +* [Community](https://github.community/) + +* [Docs](https://docs.github.com/) + +* [Contact](https://support.github.com/?tags=dotcom-footer) + +* Manage cookies +* Do not share my personal information + +You can’t perform that action at this time. \ No newline at end of file diff --git a/.firecrawl/opentelemetry.io-docs-specs-semconv-general-session.md b/.firecrawl/opentelemetry.io-docs-specs-semconv-general-session.md new file mode 100644 index 00000000..aa859008 --- /dev/null +++ b/.firecrawl/opentelemetry.io-docs-specs-semconv-general-session.md @@ -0,0 +1,750 @@ +For AI agents: a documentation index is available at /llms.txt. This page has a Markdown version at /docs/specs/semconv/general/session/index.md. + +[The OpenTelemetry LogoOpenTelemetry](https://opentelemetry.io/) + +* [Docs](https://opentelemetry.io/docs/) + +* [Ecosystem](https://opentelemetry.io/ecosystem/) + +* [Status](https://opentelemetry.io/status/) + +* [Community](https://opentelemetry.io/community/) + +* [Training](https://opentelemetry.io/training/) + +* [Blog](https://opentelemetry.io/blog/) + +* [English EN](https://opentelemetry.io/docs/specs/semconv/general/session/#) + + * বাংলা + * English + * Español + * Français + * 日本語 + * 한국어 + * Polski + * Português + * Română + * Українська + * 中文 + +* Toggle theme + + * Light + * Dark + * Auto + + +* [Semantic conventions 1.44.0](https://opentelemetry.io/docs/specs/ "OpenTelemetry semantic conventions 1.44.0") + * [ ] [Registry](https://opentelemetry.io/docs/specs/semconv/registry/) + * [ ] [Attributes](https://opentelemetry.io/docs/specs/semconv/registry/attributes/ "Attribute registry") + * [ ] [Android](https://opentelemetry.io/docs/specs/semconv/registry/attributes/android/) + + * [ ] [App](https://opentelemetry.io/docs/specs/semconv/registry/attributes/app/) + + * [ ] [Artifact](https://opentelemetry.io/docs/specs/semconv/registry/attributes/artifact/) + + * [ ] [Aspnetcore](https://opentelemetry.io/docs/specs/semconv/registry/attributes/aspnetcore/) + + * [ ] [AWS](https://opentelemetry.io/docs/specs/semconv/registry/attributes/aws/) + + * [ ] [Azure](https://opentelemetry.io/docs/specs/semconv/registry/attributes/azure/) + + * [ ] [Browser](https://opentelemetry.io/docs/specs/semconv/registry/attributes/browser/) + + * [ ] [Cassandra](https://opentelemetry.io/docs/specs/semconv/registry/attributes/cassandra/) + + * [ ] [CI/CD](https://opentelemetry.io/docs/specs/semconv/registry/attributes/cicd/) + + * [ ] [Client](https://opentelemetry.io/docs/specs/semconv/registry/attributes/client/) + + * [ ] [Cloud](https://opentelemetry.io/docs/specs/semconv/registry/attributes/cloud/) + + * [ ] [CloudEvents](https://opentelemetry.io/docs/specs/semconv/registry/attributes/cloudevents/) + + * [ ] [CloudFoundry](https://opentelemetry.io/docs/specs/semconv/registry/attributes/cloudfoundry/) + + * [ ] [Code](https://opentelemetry.io/docs/specs/semconv/registry/attributes/code/) + + * [ ] [Container](https://opentelemetry.io/docs/specs/semconv/registry/attributes/container/) + + * [ ] [CPU](https://opentelemetry.io/docs/specs/semconv/registry/attributes/cpu/) + + * [ ] [CPython](https://opentelemetry.io/docs/specs/semconv/registry/attributes/cpython/) + + * [ ] [DB](https://opentelemetry.io/docs/specs/semconv/registry/attributes/db/) + + * [ ] [Deployment](https://opentelemetry.io/docs/specs/semconv/registry/attributes/deployment/) + + * [ ] [Destination](https://opentelemetry.io/docs/specs/semconv/registry/attributes/destination/) + + * [ ] [Device](https://opentelemetry.io/docs/specs/semconv/registry/attributes/device/) + + * [ ] [Disk](https://opentelemetry.io/docs/specs/semconv/registry/attributes/disk/) + + * [ ] [DNS](https://opentelemetry.io/docs/specs/semconv/registry/attributes/dns/) + + * [ ] [Dotnet](https://opentelemetry.io/docs/specs/semconv/registry/attributes/dotnet/) + + * [ ] [Elasticsearch](https://opentelemetry.io/docs/specs/semconv/registry/attributes/elasticsearch/) + + * [ ] [Enduser](https://opentelemetry.io/docs/specs/semconv/registry/attributes/enduser/) + + * [ ] [Error](https://opentelemetry.io/docs/specs/semconv/registry/attributes/error/) + + * [ ] [Event](https://opentelemetry.io/docs/specs/semconv/registry/attributes/event/) + + * [ ] [Exception](https://opentelemetry.io/docs/specs/semconv/registry/attributes/exception/) + + * [ ] [Faas](https://opentelemetry.io/docs/specs/semconv/registry/attributes/faas/) + + * [ ] [Feature flag](https://opentelemetry.io/docs/specs/semconv/registry/attributes/feature-flag/) + + * [ ] [File](https://opentelemetry.io/docs/specs/semconv/registry/attributes/file/) + + * [ ] [GCP](https://opentelemetry.io/docs/specs/semconv/registry/attributes/gcp/) + + * [ ] [Gen AI](https://opentelemetry.io/docs/specs/semconv/registry/attributes/gen-ai/) + + * [ ] [Geo](https://opentelemetry.io/docs/specs/semconv/registry/attributes/geo/) + + * [ ] [Go](https://opentelemetry.io/docs/specs/semconv/registry/attributes/go/) + + * [ ] [GraphQL](https://opentelemetry.io/docs/specs/semconv/registry/attributes/graphql/) + + * [ ] [Hardware](https://opentelemetry.io/docs/specs/semconv/registry/attributes/hardware/) + + * [ ] [Heroku](https://opentelemetry.io/docs/specs/semconv/registry/attributes/heroku/) + + * [ ] [Host](https://opentelemetry.io/docs/specs/semconv/registry/attributes/host/) + + * [ ] [HTTP](https://opentelemetry.io/docs/specs/semconv/registry/attributes/http/) + + * [ ] [iOS](https://opentelemetry.io/docs/specs/semconv/registry/attributes/ios/) + + * [ ] [JSONRPC](https://opentelemetry.io/docs/specs/semconv/registry/attributes/jsonrpc/) + + * [ ] [JVM](https://opentelemetry.io/docs/specs/semconv/registry/attributes/jvm/) + + * [ ] [K8s](https://opentelemetry.io/docs/specs/semconv/registry/attributes/k8s/) + + * [ ] [Linux](https://opentelemetry.io/docs/specs/semconv/registry/attributes/linux/) + + * [ ] [Log](https://opentelemetry.io/docs/specs/semconv/registry/attributes/log/) + + * [ ] [Mainframe](https://opentelemetry.io/docs/specs/semconv/registry/attributes/mainframe/) + + * [ ] [MCP](https://opentelemetry.io/docs/specs/semconv/registry/attributes/mcp/) + + * [ ] [Messaging](https://opentelemetry.io/docs/specs/semconv/registry/attributes/messaging/) + + * [ ] [Network](https://opentelemetry.io/docs/specs/semconv/registry/attributes/network/) + + * [ ] [NFS](https://opentelemetry.io/docs/specs/semconv/registry/attributes/nfs/) + + * [ ] [NodeJS](https://opentelemetry.io/docs/specs/semconv/registry/attributes/nodejs/) + + * [ ] [OCI](https://opentelemetry.io/docs/specs/semconv/registry/attributes/oci/) + + * [ ] [ONC RPC](https://opentelemetry.io/docs/specs/semconv/registry/attributes/onc-rpc/) + + * [ ] [OpenAI](https://opentelemetry.io/docs/specs/semconv/registry/attributes/openai/) + + * [ ] [Openshift](https://opentelemetry.io/docs/specs/semconv/registry/attributes/openshift/) + + * [ ] [OpenTracing](https://opentelemetry.io/docs/specs/semconv/registry/attributes/opentracing/) + + * [ ] [Oracle cloud](https://opentelemetry.io/docs/specs/semconv/registry/attributes/oracle-cloud/) + + * [ ] [OracleDB](https://opentelemetry.io/docs/specs/semconv/registry/attributes/oracledb/) + + * [ ] [OS](https://opentelemetry.io/docs/specs/semconv/registry/attributes/os/) + + * [ ] [OTel](https://opentelemetry.io/docs/specs/semconv/registry/attributes/otel/) + + * [ ] [Peer](https://opentelemetry.io/docs/specs/semconv/registry/attributes/peer/) + + * [ ] [Pprof](https://opentelemetry.io/docs/specs/semconv/registry/attributes/pprof/) + + * [ ] [Process](https://opentelemetry.io/docs/specs/semconv/registry/attributes/process/) + + * [ ] [Profile](https://opentelemetry.io/docs/specs/semconv/registry/attributes/profile/) + + * [ ] [RPC](https://opentelemetry.io/docs/specs/semconv/registry/attributes/rpc/) + + * [ ] [Security rule](https://opentelemetry.io/docs/specs/semconv/registry/attributes/security-rule/) + + * [ ] [Server](https://opentelemetry.io/docs/specs/semconv/registry/attributes/server/) + + * [ ] [Service](https://opentelemetry.io/docs/specs/semconv/registry/attributes/service/) + + * [ ] [Session](https://opentelemetry.io/docs/specs/semconv/registry/attributes/session/) + + * [ ] [SignalR](https://opentelemetry.io/docs/specs/semconv/registry/attributes/signalr/) + + * [ ] [Source](https://opentelemetry.io/docs/specs/semconv/registry/attributes/source/) + + * [ ] [System](https://opentelemetry.io/docs/specs/semconv/registry/attributes/system/) + + * [ ] [Telemetry](https://opentelemetry.io/docs/specs/semconv/registry/attributes/telemetry/) + + * [ ] [Test](https://opentelemetry.io/docs/specs/semconv/registry/attributes/test/) + + * [ ] [Thread](https://opentelemetry.io/docs/specs/semconv/registry/attributes/thread/) + + * [ ] [TLS](https://opentelemetry.io/docs/specs/semconv/registry/attributes/tls/) + + * [ ] [URL](https://opentelemetry.io/docs/specs/semconv/registry/attributes/url/) + + * [ ] [User](https://opentelemetry.io/docs/specs/semconv/registry/attributes/user/) + + * [ ] [User agent](https://opentelemetry.io/docs/specs/semconv/registry/attributes/user-agent/) + + * [ ] [V8js](https://opentelemetry.io/docs/specs/semconv/registry/attributes/v8js/) + + * [ ] [VCS](https://opentelemetry.io/docs/specs/semconv/registry/attributes/vcs/) + + * [ ] [Webengine](https://opentelemetry.io/docs/specs/semconv/registry/attributes/webengine/) + + * [ ] [zOS](https://opentelemetry.io/docs/specs/semconv/registry/attributes/zos/) + + * [ ] [Entities](https://opentelemetry.io/docs/specs/semconv/registry/entities/ "Entity registry") + * [ ] [Android](https://opentelemetry.io/docs/specs/semconv/registry/entities/android/) + + * [ ] [App](https://opentelemetry.io/docs/specs/semconv/registry/entities/app/) + + * [ ] [AWS](https://opentelemetry.io/docs/specs/semconv/registry/entities/aws/) + + * [ ] [Browser](https://opentelemetry.io/docs/specs/semconv/registry/entities/browser/) + + * [ ] [CI/CD](https://opentelemetry.io/docs/specs/semconv/registry/entities/cicd/) + + * [ ] [Cloud](https://opentelemetry.io/docs/specs/semconv/registry/entities/cloud/) + + * [ ] [CloudFoundry](https://opentelemetry.io/docs/specs/semconv/registry/entities/cloudfoundry/) + + * [ ] [Container](https://opentelemetry.io/docs/specs/semconv/registry/entities/container/) + + * [ ] [Deployment](https://opentelemetry.io/docs/specs/semconv/registry/entities/deployment/) + + * [ ] [Device](https://opentelemetry.io/docs/specs/semconv/registry/entities/device/) + + * [ ] [Faas](https://opentelemetry.io/docs/specs/semconv/registry/entities/faas/) + + * [ ] [GCP](https://opentelemetry.io/docs/specs/semconv/registry/entities/gcp/) + + * [ ] [Heroku](https://opentelemetry.io/docs/specs/semconv/registry/entities/heroku/) + + * [ ] [Host](https://opentelemetry.io/docs/specs/semconv/registry/entities/host/) + + * [ ] [K8s](https://opentelemetry.io/docs/specs/semconv/registry/entities/k8s/) + + * [ ] [Openshift](https://opentelemetry.io/docs/specs/semconv/registry/entities/openshift/) + + * [ ] [OS](https://opentelemetry.io/docs/specs/semconv/registry/entities/os/) + + * [ ] [OTel](https://opentelemetry.io/docs/specs/semconv/registry/entities/otel/) + + * [ ] [Process](https://opentelemetry.io/docs/specs/semconv/registry/entities/process/) + + * [ ] [Service](https://opentelemetry.io/docs/specs/semconv/registry/entities/service/) + + * [ ] [Telemetry](https://opentelemetry.io/docs/specs/semconv/registry/entities/telemetry/) + + * [ ] [VCS](https://opentelemetry.io/docs/specs/semconv/registry/entities/vcs/) + + * [ ] [Webengine](https://opentelemetry.io/docs/specs/semconv/registry/entities/webengine/) + + * [ ] [zOS](https://opentelemetry.io/docs/specs/semconv/registry/entities/zos/) + + * [x] [General](https://opentelemetry.io/docs/specs/semconv/general/ "General semantic conventions") + * [ ] [Attribute requirement levels](https://opentelemetry.io/docs/specs/semconv/general/attribute-requirement-level/) + + * [ ] [Attributes](https://opentelemetry.io/docs/specs/semconv/general/attributes/ "General attributes") + + * [ ] [Events](https://opentelemetry.io/docs/specs/semconv/general/events/ "Semantic conventions for events") + + * [ ] [Logs](https://opentelemetry.io/docs/specs/semconv/general/logs/ "General logs attributes") + + * [ ] [Metric requirement levels](https://opentelemetry.io/docs/specs/semconv/general/metric-requirement-level/) + + * [ ] [Metrics](https://opentelemetry.io/docs/specs/semconv/general/metrics/ "Metrics semantic conventions") + + * [ ] [Naming](https://opentelemetry.io/docs/specs/semconv/general/naming/) + + * [ ] [Profiles](https://opentelemetry.io/docs/specs/semconv/general/profiles/ "Profiles attributes") + + * [ ] [Recording errors](https://opentelemetry.io/docs/specs/semconv/general/recording-errors/) + + * [ ] [Requirement levels on signals and entities](https://opentelemetry.io/docs/specs/semconv/general/signal-requirement-level/) + + * [ ] [Semantic convention groups](https://opentelemetry.io/docs/specs/semconv/general/semantic-convention-groups/) + + * [x] [Session](https://opentelemetry.io/docs/specs/semconv/general/session/ "Semantic conventions for session") + + * [ ] [Trace](https://opentelemetry.io/docs/specs/semconv/general/trace/ "Trace semantic conventions") + + * [ ] [Tracing compatibility](https://opentelemetry.io/docs/specs/semconv/general/trace-compatibility/ "Semantic conventions for tracing compatibility components") + + * [ ] [.NET](https://opentelemetry.io/docs/specs/semconv/dotnet/ "Semantic conventions for .NET") + * [ ] [ASP.NET Core](https://opentelemetry.io/docs/specs/semconv/dotnet/dotnet-aspnetcore-metrics/ "Semantic conventions for ASP.NET Core metrics") + + * [ ] [DNS](https://opentelemetry.io/docs/specs/semconv/dotnet/dotnet-dns-metrics/ "Semantic conventions for DNS metrics emitted by .NET") + + * [ ] [HTTP](https://opentelemetry.io/docs/specs/semconv/dotnet/dotnet-http-metrics/ "Semantic conventions for HTTP client and server metrics emitted by .NET") + + * [ ] [HTTP request and connection spans](https://opentelemetry.io/docs/specs/semconv/dotnet/dotnet-network-traces/ "Semantic Conventions for network spans emitted by .NET") + + * [ ] [Kestrel](https://opentelemetry.io/docs/specs/semconv/dotnet/dotnet-kestrel-metrics/ "Semantic conventions for Kestrel web server metrics") + + * [ ] [SignalR](https://opentelemetry.io/docs/specs/semconv/dotnet/dotnet-signalr-metrics/ "Semantic conventions for SignalR server metrics") + + * [ ] [App](https://opentelemetry.io/docs/specs/semconv/app/ "Semantic conventions for Apps") + * [ ] [Events](https://opentelemetry.io/docs/specs/semconv/app/app-events/ "App Events") + + * [ ] [Azure](https://opentelemetry.io/docs/specs/semconv/azure/ "Semantic conventions for Azure resource logs") + * [ ] [Events](https://opentelemetry.io/docs/specs/semconv/azure/azure-events/ "Semantic conventions for Azure resource log events") + + * [ ] [Browser](https://opentelemetry.io/docs/specs/semconv/browser/ "Semantic conventions for Browser") + * [ ] [Events](https://opentelemetry.io/docs/specs/semconv/browser/browser-events/ "Semantic conventions for browser events") + + * [ ] [CI/CD](https://opentelemetry.io/docs/specs/semconv/cicd/ "Semantic conventions for CI/CD") + * [ ] [Logs](https://opentelemetry.io/docs/specs/semconv/cicd/cicd-logs/ "Semantic conventions for CI/CD logs") + + * [ ] [Metrics](https://opentelemetry.io/docs/specs/semconv/cicd/cicd-metrics/ "Semantic conventions for CI/CD metrics") + + * [ ] [Spans](https://opentelemetry.io/docs/specs/semconv/cicd/cicd-spans/ "Semantic conventions for CI/CD spans") + + * [ ] [CLI programs](https://opentelemetry.io/docs/specs/semconv/cli/ "Semantic conventions for CLI programs") + * [ ] [Spans](https://opentelemetry.io/docs/specs/semconv/cli/cli-spans/ "Semantic conventions for CLI (command line interface) programs") + + * [ ] [Cloud providers](https://opentelemetry.io/docs/specs/semconv/cloud-providers/ "Semantic conventions for cloud providers") + * [ ] [AWS SDK](https://opentelemetry.io/docs/specs/semconv/cloud-providers/aws-sdk/ "Semantic conventions for AWS SDK client spans") + + * [ ] [CloudEvents](https://opentelemetry.io/docs/specs/semconv/cloudevents/ "Semantic conventions for CloudEvents") + * [ ] [Spans](https://opentelemetry.io/docs/specs/semconv/cloudevents/cloudevents-spans/ "Semantic conventions for CloudEvents spans") + + * [ ] [Configuration](https://opentelemetry.io/docs/specs/semconv/configuration/) + * [ ] [Version selection](https://opentelemetry.io/docs/specs/semconv/configuration/version-selection/ "Semantic convention version selection") + + * [ ] [Database](https://opentelemetry.io/docs/specs/semconv/db/ "Semantic conventions for database calls and systems") + * [ ] [Cassandra](https://opentelemetry.io/docs/specs/semconv/db/cassandra/ "Semantic conventions for Cassandra client operations") + + * [ ] [Cosmos DB](https://opentelemetry.io/docs/specs/semconv/db/cosmosdb/ "Semantic conventions for Microsoft Azure Cosmos DB client operations") + + * [ ] [CouchDB](https://opentelemetry.io/docs/specs/semconv/db/couchdb/ "Semantic conventions for CouchDB client operations") + + * [ ] [DynamoDB](https://opentelemetry.io/docs/specs/semconv/db/dynamodb/ "Semantic conventions for AWS DynamoDB client operations") + + * [ ] [Elasticsearch](https://opentelemetry.io/docs/specs/semconv/db/elasticsearch/ "Semantic conventions for Elasticsearch client operations") + + * [ ] [Exceptions](https://opentelemetry.io/docs/specs/semconv/db/database-exceptions/ "Semantic conventions for database exceptions") + + * [ ] [HBase](https://opentelemetry.io/docs/specs/semconv/db/hbase/ "Semantic conventions for HBase client operations") + + * [ ] [MariaDB](https://opentelemetry.io/docs/specs/semconv/db/mariadb/ "Semantic conventions for MariaDB client operations") + + * [ ] [Metrics](https://opentelemetry.io/docs/specs/semconv/db/database-metrics/ "Semantic conventions for database client metrics") + + * [ ] [MongoDB](https://opentelemetry.io/docs/specs/semconv/db/mongodb/ "Semantic conventions for MongoDB client operations") + + * [ ] [MySQL](https://opentelemetry.io/docs/specs/semconv/db/mysql/ "Semantic conventions for MySQL client operations") + + * [ ] [Oracle Database](https://opentelemetry.io/docs/specs/semconv/db/oracledb/ "Semantic conventions for Oracle Database") + + * [ ] [PostgreSQL](https://opentelemetry.io/docs/specs/semconv/db/postgresql/ "Semantic conventions for PostgreSQL client operations") + + * [ ] [Redis](https://opentelemetry.io/docs/specs/semconv/db/redis/ "Semantic conventions for Redis client operations") + + * [ ] [Spans](https://opentelemetry.io/docs/specs/semconv/db/database-spans/ "Semantic conventions for database client spans") + + * [ ] [SQL](https://opentelemetry.io/docs/specs/semconv/db/sql/ "Semantic conventions for SQL databases client operations") + + * [ ] [SQL Server](https://opentelemetry.io/docs/specs/semconv/db/sql-server/ "Semantic conventions for Microsoft SQL Server client operations") + + * [ ] [DNS](https://opentelemetry.io/docs/specs/semconv/dns/ "Semantic conventions for DNS") + * [ ] [Metrics](https://opentelemetry.io/docs/specs/semconv/dns/dns-metrics/ "Semantic conventions for DNS queries") + + * [ ] [Exceptions](https://opentelemetry.io/docs/specs/semconv/exceptions/ "Semantic conventions for exceptions") + * [ ] [Logs](https://opentelemetry.io/docs/specs/semconv/exceptions/exceptions-logs/ "Semantic conventions for exceptions in logs") + + * [ ] [Spans](https://opentelemetry.io/docs/specs/semconv/exceptions/exceptions-spans/ "Semantic conventions for exceptions on spans") + + * [ ] [FaaS](https://opentelemetry.io/docs/specs/semconv/faas/ "Semantic conventions for Function-as-a-Service") + * [ ] [AWS Lambda](https://opentelemetry.io/docs/specs/semconv/faas/aws-lambda/ "Instrumenting AWS Lambda") + + * [ ] [Exceptions](https://opentelemetry.io/docs/specs/semconv/faas/faas-exceptions/ "Semantic conventions for FaaS exceptions") + + * [ ] [Metrics](https://opentelemetry.io/docs/specs/semconv/faas/faas-metrics/ "Semantic conventions for FaaS metrics") + + * [ ] [Spans](https://opentelemetry.io/docs/specs/semconv/faas/faas-spans/ "Semantic conventions for FaaS spans") + + * [ ] [Feature flags](https://opentelemetry.io/docs/specs/semconv/feature-flags/ "Semantic conventions for feature flags") + * [ ] [Events](https://opentelemetry.io/docs/specs/semconv/feature-flags/feature-flags-events/ "Semantic conventions for feature flags in events") + + * [ ] [Generative AI](https://opentelemetry.io/docs/specs/semconv/gen-ai/ "Moved: Generative AI semantic conventions") + * [ ] [Agent spans](https://opentelemetry.io/docs/specs/semconv/gen-ai/gen-ai-agent-spans/ "Moved: Generative AI semantic conventions") + + * [ ] [Anthropic](https://opentelemetry.io/docs/specs/semconv/gen-ai/anthropic/ "Moved: Generative AI semantic conventions") + + * [ ] [AWS Bedrock](https://opentelemetry.io/docs/specs/semconv/gen-ai/aws-bedrock/ "Moved: Generative AI semantic conventions") + + * [ ] [Azure AI Inference](https://opentelemetry.io/docs/specs/semconv/gen-ai/azure-ai-inference/ "Moved: Generative AI semantic conventions") + + * [ ] [Events](https://opentelemetry.io/docs/specs/semconv/gen-ai/gen-ai-events/ "Moved: Generative AI semantic conventions") + + * [ ] [Exceptions](https://opentelemetry.io/docs/specs/semconv/gen-ai/gen-ai-exceptions/ "Moved: Generative AI semantic conventions") + + * [ ] [Metrics](https://opentelemetry.io/docs/specs/semconv/gen-ai/gen-ai-metrics/ "Moved: Generative AI semantic conventions") + + * [ ] [Model Context Protocol](https://opentelemetry.io/docs/specs/semconv/gen-ai/mcp/ "Moved: Generative AI semantic conventions") + + * [ ] [Moved: Generative AI semantic conventions](https://opentelemetry.io/docs/specs/semconv/gen-ai/non-normative/examples-llm-calls/) + + * [ ] [OpenAI](https://opentelemetry.io/docs/specs/semconv/gen-ai/openai/ "Moved: Generative AI semantic conventions") + + * [ ] [Spans](https://opentelemetry.io/docs/specs/semconv/gen-ai/gen-ai-spans/ "Moved: Generative AI semantic conventions") + + * [ ] [GraphQL](https://opentelemetry.io/docs/specs/semconv/graphql/ "Semantic conventions for GraphQL") + * [ ] [GraphQL server](https://opentelemetry.io/docs/specs/semconv/graphql/graphql-spans/ "Semantic conventions for GraphQL server spans") + + * [ ] [Hardware](https://opentelemetry.io/docs/specs/semconv/hardware/ "Semantic conventions for hardware") + * [ ] [Battery](https://opentelemetry.io/docs/specs/semconv/hardware/battery/ "Semantic conventions for battery metrics") + + * [ ] [CPU](https://opentelemetry.io/docs/specs/semconv/hardware/cpu/ "Semantic conventions for CPU metrics") + + * [ ] [Disk Controller](https://opentelemetry.io/docs/specs/semconv/hardware/disk-controller/ "Semantic conventions for disk controller metrics") + + * [ ] [Enclosure](https://opentelemetry.io/docs/specs/semconv/hardware/enclosure/ "Semantic conventions for enclosure metrics") + + * [ ] [Fan](https://opentelemetry.io/docs/specs/semconv/hardware/fan/ "Semantic conventions for fan metrics") + + * [ ] [GPU](https://opentelemetry.io/docs/specs/semconv/hardware/gpu/ "Semantic conventions for GPU metrics") + + * [ ] [Logical Disk](https://opentelemetry.io/docs/specs/semconv/hardware/logical-disk/ "Semantic conventions for logical disk metrics") + + * [ ] [Memory](https://opentelemetry.io/docs/specs/semconv/hardware/memory/ "Semantic conventions for memory metrics") + + * [ ] [Metrics](https://opentelemetry.io/docs/specs/semconv/hardware/common/ "Semantic conventions for common hardware metrics") + + * [ ] [Network](https://opentelemetry.io/docs/specs/semconv/hardware/network/ "Semantic conventions for network metrics") + + * [ ] [Physical Disk](https://opentelemetry.io/docs/specs/semconv/hardware/physical-disk/ "Semantic conventions for physical disk metrics") + + * [ ] [Physical host](https://opentelemetry.io/docs/specs/semconv/hardware/host/ "Semantic conventions for physical host metrics") + + * [ ] [Power Supply](https://opentelemetry.io/docs/specs/semconv/hardware/power-supply/ "Semantic conventions for power supply metrics") + + * [ ] [Tape Drive](https://opentelemetry.io/docs/specs/semconv/hardware/tape-drive/ "Semantic conventions for tape drive metrics") + + * [ ] [Temperature](https://opentelemetry.io/docs/specs/semconv/hardware/temperature/ "Semantic conventions for temperature metrics") + + * [ ] [Voltage](https://opentelemetry.io/docs/specs/semconv/hardware/voltage/ "Semantic conventions for voltage metrics") + + * [ ] [How to write conventions](https://opentelemetry.io/docs/specs/semconv/how-to-write-conventions/ "How to write semantic conventions") + * [ ] [Resource and Entities](https://opentelemetry.io/docs/specs/semconv/how-to-write-conventions/resource-and-entities/) + + * [ ] [Status Metrics](https://opentelemetry.io/docs/specs/semconv/how-to-write-conventions/status-metrics/ "State Metrics") + + * [ ] [T-shaped Signals](https://opentelemetry.io/docs/specs/semconv/how-to-write-conventions/t-shaped-signals/) + + * [ ] [HTTP](https://opentelemetry.io/docs/specs/semconv/http/ "Semantic conventions for HTTP") + * [ ] [Exceptions](https://opentelemetry.io/docs/specs/semconv/http/http-exceptions/ "Semantic conventions for HTTP exceptions") + + * [ ] [Metrics](https://opentelemetry.io/docs/specs/semconv/http/http-metrics/ "Semantic conventions for HTTP metrics") + + * [ ] [Spans](https://opentelemetry.io/docs/specs/semconv/http/http-spans/ "Semantic conventions for HTTP spans") + + * [ ] [Messaging](https://opentelemetry.io/docs/specs/semconv/messaging/ "Semantic conventions for messaging systems") + * [ ] [AWS SNS](https://opentelemetry.io/docs/specs/semconv/messaging/sns/ "Semantic conventions for AWS SNS") + + * [ ] [AWS SQS](https://opentelemetry.io/docs/specs/semconv/messaging/sqs/ "Semantic conventions for AWS SQS") + + * [ ] [Azure](https://opentelemetry.io/docs/specs/semconv/messaging/azure-messaging/ "Semantic conventions for Azure messaging systems") + + * [ ] [Exceptions](https://opentelemetry.io/docs/specs/semconv/messaging/messaging-exceptions/ "Semantic conventions for messaging exceptions") + + * [ ] [Google Cloud Pub/Sub](https://opentelemetry.io/docs/specs/semconv/messaging/gcp-pubsub/ "Semantic conventions for Google Cloud Pub/Sub") + + * [ ] [Kafka](https://opentelemetry.io/docs/specs/semconv/messaging/kafka/ "Semantic conventions for Kafka") + + * [ ] [Metrics](https://opentelemetry.io/docs/specs/semconv/messaging/messaging-metrics/ "Semantic conventions for messaging client metrics") + + * [ ] [RabbitMQ](https://opentelemetry.io/docs/specs/semconv/messaging/rabbitmq/ "Semantic conventions for RabbitMQ") + + * [ ] [RocketMQ](https://opentelemetry.io/docs/specs/semconv/messaging/rocketmq/ "Semantic conventions for RocketMQ") + + * [ ] [Spans](https://opentelemetry.io/docs/specs/semconv/messaging/messaging-spans/ "Semantic conventions for messaging spans") + + * [ ] [Mobile](https://opentelemetry.io/docs/specs/semconv/mobile/ "Semantic conventions for mobile platform") + * [ ] [Events](https://opentelemetry.io/docs/specs/semconv/mobile/mobile-events/ "Semantic conventions for mobile events") + + * [ ] [NFS](https://opentelemetry.io/docs/specs/semconv/nfs/ "Semantic conventions for NFS") + * [ ] [NFS](https://opentelemetry.io/docs/specs/semconv/nfs/nfs-metrics/ "Semantic conventions for NFS metrics") + + * [ ] [Non-normative](https://opentelemetry.io/docs/specs/semconv/non-normative/ "Non-normative supplementary information") + * [ ] [Code attributes migration](https://opentelemetry.io/docs/specs/semconv/non-normative/code-attrs-migration/ "Code attributes semantic convention stability migration guide") + + * [ ] [Compatibility](https://opentelemetry.io/docs/specs/semconv/non-normative/compatibility/) + * [ ] [AWS](https://opentelemetry.io/docs/specs/semconv/non-normative/compatibility/aws/ "Compatibility considerations for AWS") + + * [ ] [gRPC](https://opentelemetry.io/docs/specs/semconv/non-normative/compatibility/grpc/ "Compatibility between OpenTelemetry and gRPC semantic conventions") + + * [ ] [Database migration](https://opentelemetry.io/docs/specs/semconv/non-normative/db-migration/ "Database semantic convention stability migration guide") + + * [ ] [Generating semantic convention libraries](https://opentelemetry.io/docs/specs/semconv/non-normative/code-generation/) + + * [ ] [HTTP migration](https://opentelemetry.io/docs/specs/semconv/non-normative/http-migration/ "HTTP semantic convention stability migration") + + * [ ] [K8s attributes](https://opentelemetry.io/docs/specs/semconv/non-normative/k8s-attributes/ "Specify resource attributes using Kubernetes annotations") + + * [ ] [K8s migration](https://opentelemetry.io/docs/specs/semconv/non-normative/k8s-migration/ "K8s semantic convention stability migration") + + * [ ] [Naming known exceptions](https://opentelemetry.io/docs/specs/semconv/non-normative/naming-known-exceptions/ "Kubernetes naming exceptions") + + * [ ] [Recommended vs Opt-In CPU Metrics](https://opentelemetry.io/docs/specs/semconv/non-normative/groups/system/cpu-metrics-guidelines/) + + * [ ] [RPC migration](https://opentelemetry.io/docs/specs/semconv/non-normative/rpc-migration/ "RPC semantic convention stability migration guide") + + * [ ] [System semantic conventions: instrumentation design philosophy](https://opentelemetry.io/docs/specs/semconv/non-normative/groups/system/design-philosophy/) + + * [ ] [System use cases](https://opentelemetry.io/docs/specs/semconv/non-normative/groups/system/use-cases/ "System semantic conventions: general use cases") + + * [ ] [Object stores](https://opentelemetry.io/docs/specs/semconv/object-stores/ "Semantic conventions for object stores") + * [ ] [S3](https://opentelemetry.io/docs/specs/semconv/object-stores/s3/ "Semantic conventions for AWS S3 client spans") + + * [ ] [OpenTelemetry SDK](https://opentelemetry.io/docs/specs/semconv/otel/ "Semantic conventions for OpenTelemetry SDK") + * [ ] [SDK Metrics](https://opentelemetry.io/docs/specs/semconv/otel/sdk-metrics/ "Semantic conventions for OpenTelemetry SDK metrics") + + * [ ] [Resource](https://opentelemetry.io/docs/specs/semconv/resource/ "Resource semantic conventions") + * [ ] [Android](https://opentelemetry.io/docs/specs/semconv/resource/android/) + + * [ ] [Browser](https://opentelemetry.io/docs/specs/semconv/resource/browser/) + + * [ ] [CI/CD](https://opentelemetry.io/docs/specs/semconv/resource/cicd/) + + * [ ] [Cloud](https://opentelemetry.io/docs/specs/semconv/resource/cloud/) + + * [ ] [Cloud provider](https://opentelemetry.io/docs/specs/semconv/resource/cloud-provider/) + * [ ] [AWS](https://opentelemetry.io/docs/specs/semconv/resource/cloud-provider/aws/ "AWS semantic conventions") + * [ ] [ECS](https://opentelemetry.io/docs/specs/semconv/resource/cloud-provider/aws/ecs/ "AWS ECS") + + * [ ] [EKS](https://opentelemetry.io/docs/specs/semconv/resource/cloud-provider/aws/eks/ "AWS EKS") + + * [ ] [Logs](https://opentelemetry.io/docs/specs/semconv/resource/cloud-provider/aws/logs/ "AWS logs") + + * [ ] [GCP](https://opentelemetry.io/docs/specs/semconv/resource/cloud-provider/gcp/ "GCP semantic conventions") + * [ ] [Google Cloud AppHub](https://opentelemetry.io/docs/specs/semconv/resource/cloud-provider/gcp/apphub/) + + * [ ] [Google Cloud Run](https://opentelemetry.io/docs/specs/semconv/resource/cloud-provider/gcp/cloud-run/) + + * [ ] [Google Compute Engine](https://opentelemetry.io/docs/specs/semconv/resource/cloud-provider/gcp/gce/) + + * [ ] [Heroku](https://opentelemetry.io/docs/specs/semconv/resource/cloud-provider/heroku/) + + * [ ] [CloudFoundry](https://opentelemetry.io/docs/specs/semconv/resource/cloudfoundry/) + + * [ ] [Container](https://opentelemetry.io/docs/specs/semconv/resource/container/) + + * [ ] [Deployment](https://opentelemetry.io/docs/specs/semconv/resource/deployment-environment/) + + * [ ] [Device](https://opentelemetry.io/docs/specs/semconv/resource/device/) + + * [ ] [FaaS](https://opentelemetry.io/docs/specs/semconv/resource/faas/ "Function as a Service") + + * [ ] [Host](https://opentelemetry.io/docs/specs/semconv/resource/host/) + + * [ ] [Kubernetes](https://opentelemetry.io/docs/specs/semconv/resource/k8s/) + * [ ] [Openshift](https://opentelemetry.io/docs/specs/semconv/resource/k8s/openshift/) + + * [ ] [Operating system](https://opentelemetry.io/docs/specs/semconv/resource/os/) + + * [ ] [Process](https://opentelemetry.io/docs/specs/semconv/resource/process/ "Process and process runtime resources") + + * [ ] [Service](https://opentelemetry.io/docs/specs/semconv/resource/service/ "Service semantic conventions") + + * [ ] [Webengine](https://opentelemetry.io/docs/specs/semconv/resource/webengine/) + + * [ ] [z/OS software](https://opentelemetry.io/docs/specs/semconv/resource/zos/) + + * [ ] [RPC](https://opentelemetry.io/docs/specs/semconv/rpc/ "Semantic conventions for RPC") + * [ ] [Connect](https://opentelemetry.io/docs/specs/semconv/rpc/connect-rpc/ "Semantic conventions for Connect RPC") + + * [ ] [Dubbo](https://opentelemetry.io/docs/specs/semconv/rpc/dubbo/ "Semantic conventions for Apache Dubbo") + + * [ ] [Exceptions](https://opentelemetry.io/docs/specs/semconv/rpc/rpc-exceptions/ "Semantic conventions for RPC exceptions") + + * [ ] [gRPC](https://opentelemetry.io/docs/specs/semconv/rpc/grpc/ "Semantic conventions for gRPC") + + * [ ] [JSON-RPC](https://opentelemetry.io/docs/specs/semconv/rpc/json-rpc/ "Semantic conventions for JSON-RPC") + + * [ ] [Metrics](https://opentelemetry.io/docs/specs/semconv/rpc/rpc-metrics/ "Semantic conventions for RPC metrics") + + * [ ] [Spans](https://opentelemetry.io/docs/specs/semconv/rpc/rpc-spans/ "Semantic conventions for RPC spans") + + * [ ] [Runtime environment](https://opentelemetry.io/docs/specs/semconv/runtime/ "Semantic conventions for runtime environment") + * [ ] [.NET](https://opentelemetry.io/docs/specs/semconv/runtime/dotnet-metrics/ "Semantic conventions for .NET Common Language Runtime (CLR) metrics") + + * [ ] [CPython](https://opentelemetry.io/docs/specs/semconv/runtime/cpython-metrics/ "Semantic conventions for CPython runtime metrics") + + * [ ] [Go](https://opentelemetry.io/docs/specs/semconv/runtime/go-metrics/ "Semantic conventions for Go runtime metrics") + + * [ ] [JVM](https://opentelemetry.io/docs/specs/semconv/runtime/jvm-metrics/ "Semantic conventions for JVM metrics") + + * [ ] [Node.js](https://opentelemetry.io/docs/specs/semconv/runtime/nodejs-metrics/ "Semantic conventions for Node.js runtime metrics") + + * [ ] [V8 JS engine](https://opentelemetry.io/docs/specs/semconv/runtime/v8js-metrics/ "Semantic conventions for V8 JS engine runtime metrics") + + * [ ] [System](https://opentelemetry.io/docs/specs/semconv/system/ "System semantic conventions") + * [ ] [Container](https://opentelemetry.io/docs/specs/semconv/system/container-metrics/ "Semantic conventions for container metrics") + + * [ ] [Kubernetes](https://opentelemetry.io/docs/specs/semconv/system/k8s-metrics/ "Semantic conventions for Kubernetes metrics") + + * [ ] [OpenShift](https://opentelemetry.io/docs/specs/semconv/system/openshift-metrics/ "Semantic conventions for OpenShift metrics") + + * [ ] [OS process](https://opentelemetry.io/docs/specs/semconv/system/process-metrics/ "Semantic conventions for OS process metrics") + + * [ ] [System](https://opentelemetry.io/docs/specs/semconv/system/system-metrics/ "Semantic conventions for system metrics") + + * [ ] [URL](https://opentelemetry.io/docs/specs/semconv/url/ "Semantic conventions for URL") + + +[View Markdown](https://opentelemetry.io/docs/specs/semconv/general/session/index.md) + [View page source](https://github.com/open-telemetry/semantic-conventions/tree/main/docs/general/session.md) + [Edit this page](https://github.com/open-telemetry/semantic-conventions/edit/main/docs/general/session.md) + [Create child page](https://github.com/open-telemetry/semantic-conventions/new/main/docs/general?filename=change-me.md&value=---%0Atitle%3A+%22Long+Page+Title%22%0AlinkTitle%3A+%22Short+Nav+Title%22%0Aweight%3A+100%0Adescription%3A+%3E-%0A+++++Page+description+for+heading+and+indexes.%0A---%0A%0A%23%23+Heading%0A%0AEdit+this+template+to+create+your+new+page.%0A%0A%2A+Give+it+a+good+name%2C+ending+in+%60.md%60+-+e.g.+%60get-started.md%60%0A%2A+Edit+the+%22front+matter%22+section+at+the+top+of+the+page+%28weight+controls+how+its+ordered+amongst+other+pages+in+the+same+directory%3B+lowest+number+first%29.%0A%2A+Add+a+good+commit+message+at+the+bottom+of+the+page+%28%3C80+characters%3B+use+the+extended+description+field+for+more+detail%29.%0A%2A+Create+a+new+branch+so+you+can+preview+your+new+file+and+request+a+review+via+Pull+Request.%0A) + [Create documentation issue](https://github.com/open-telemetry/semantic-conventions/issues/new?title=Semantic%20conventions%20for%20session) + [Create project issue](https://github.com/open-telemetry/semantic-conventions/issues/new) + +On this page[](https://opentelemetry.io/docs/specs/semconv/general/session/# "Top of page") + +* [Attributes](https://opentelemetry.io/docs/specs/semconv/general/session/#attributes) + +* [Session Events](https://opentelemetry.io/docs/specs/semconv/general/session/#session-events) + * [Event: `session.start`](https://opentelemetry.io/docs/specs/semconv/general/session/#event-sessionstart) + + * [Event: `session.end`](https://opentelemetry.io/docs/specs/semconv/general/session/#event-sessionend) + + +1. [Docs](https://opentelemetry.io/docs/) + +2. [Specs](https://opentelemetry.io/docs/specs/) + +3. [Semantic conventions 1.44.0](https://opentelemetry.io/docs/specs/semconv/) + +4. [General](https://opentelemetry.io/docs/specs/semconv/general/) + +5. Session + +Semantic conventions for session +================================ + +**Status**: [Development](https://opentelemetry.io/docs/specs/otel/document-status/) + +This document defines semantic conventions to apply to client-side applications when tracking sessions. + +Session is defined as the period of time encompassing all activities performed by the application and the actions executed by the end user. + +Consequently, a Session is represented as a collection of Logs, Events, and Spans emitted by the Client Application throughout the Session’s duration. Each Session is assigned a unique identifier, which is included as an attribute in the Logs, Events, and Spans generated during the Session’s lifecycle. + +When a session reaches end of life, typically due to user inactivity or session timeout, a new session identifier will be assigned. The previous session identifier may be provided by the instrumentation so that telemetry backends can link the two sessions (see [Session Start Event](https://opentelemetry.io/docs/specs/semconv/general/session/#event-sessionstart) + below). + +Attributes[](https://opentelemetry.io/docs/specs/semconv/general/session/#attributes) + +-------------------------------------------------------------------------------------- + +**Attributes:** + +| Key | Stability | [Requirement Level](https://opentelemetry.io/docs/specs/semconv/general/attribute-requirement-level/) | Value Type | Description | Example Values | +| --- | --- | --- | --- | --- | --- | +| [`session.id`](https://opentelemetry.io/docs/specs/semconv/registry/attributes/session/) | ![Development](https://img.shields.io/badge/-development-blue) | `Opt-In` | string | A unique ID to identify a session. | `00112233-4455-6677-8899-aabbccddeeff` | +| [`session.previous_id`](https://opentelemetry.io/docs/specs/semconv/registry/attributes/session/) | ![Development](https://img.shields.io/badge/-development-blue) | `Opt-In` | string | The previous `session.id` for this user, when known. | `00112233-4455-6677-8899-aabbccddeeff` | + +Session Events[](https://opentelemetry.io/docs/specs/semconv/general/session/#session-events) + +---------------------------------------------------------------------------------------------- + +### Event: `session.start`[](https://opentelemetry.io/docs/specs/semconv/general/session/#event-sessionstart) + +**Status:** ![Development](https://img.shields.io/badge/-development-blue) + +The event name MUST be `session.start`. + +Indicates that a new session has been started, optionally linking to the prior session. + +For instrumentation that tracks user behavior during user sessions, a `session.start` event MUST be emitted every time a session is created. When a new session is created as a continuation of a prior session, the `session.previous_id` SHOULD be included in the event. The values of `session.id` and `session.previous_id` MUST be different. When the `session.start` event contains both `session.id` and `session.previous_id` fields, the event indicates that the previous session has ended. If the session ID in `session.previous_id` has not yet ended via explicit `session.end` event, then the consumer SHOULD treat this continuation event as semantically equivalent to `session.end(session.previous_id)` and `session.start(session.id)`. + +**Attributes:** + +| Key | Stability | [Requirement Level](https://opentelemetry.io/docs/specs/semconv/general/attribute-requirement-level/) | Value Type | Description | Example Values | +| --- | --- | --- | --- | --- | --- | +| [`session.id`](https://opentelemetry.io/docs/specs/semconv/registry/attributes/session/) | ![Development](https://img.shields.io/badge/-development-blue) | `Required` | string | The ID of the new session being started. | `00112233-4455-6677-8899-aabbccddeeff` | +| [`session.previous_id`](https://opentelemetry.io/docs/specs/semconv/registry/attributes/session/) | ![Development](https://img.shields.io/badge/-development-blue) | `Conditionally Required` \[1\] | string | The previous `session.id` for this user, when known. | `00112233-4455-6677-8899-aabbccddeeff` | + +**\[1\] `session.previous_id`:** If the new session is being created as a continuation of a previous session, the `session.previous_id` SHOULD be included in the event. The `session.id` and `session.previous_id` attributes MUST have different values. + +### Event: `session.end`[](https://opentelemetry.io/docs/specs/semconv/general/session/#event-sessionend) + +**Status:** ![Development](https://img.shields.io/badge/-development-blue) + +The event name MUST be `session.end`. + +Indicates that a session has ended. + +For instrumentation that tracks user behavior during user sessions, a `session.end` event SHOULD be emitted every time a session ends. When a session ends and continues as a new session, this event SHOULD be emitted prior to the `session.start` event. + +**Attributes:** + +| Key | Stability | [Requirement Level](https://opentelemetry.io/docs/specs/semconv/general/attribute-requirement-level/) | Value Type | Description | Example Values | +| --- | --- | --- | --- | --- | --- | +| [`session.id`](https://opentelemetry.io/docs/specs/semconv/registry/attributes/session/) | ![Development](https://img.shields.io/badge/-development-blue) | `Required` | string | The ID of the session being ended. | `00112233-4455-6677-8899-aabbccddeeff` | + +Feedback +-------- + +Was this page helpful? + +Yes No + +Thank you. Your feedback is appreciated! + +Please let us know [how we can improve this page](https://github.com/open-telemetry/opentelemetry.io/issues/new?template=PAGE_FEEDBACK.yml&title=[Page+feedback]%3A+ADD+A+SUMMARY+OF+YOUR+FEEDBACK+HERE) +. Your feedback is appreciated! + + + +* [](https://github.com/open-telemetry/community#mailing-lists) + +* [](https://bsky.app/profile/opentelemetry.io) + +* [](https://fosstodon.org/@opentelemetry) + +* [](https://stackoverflow.com/questions/tagged/open-telemetry) + +* [](https://github.com/cncf/artwork/tree/master/projects/opentelemetry) + +* [](https://docs.google.com/spreadsheets/d/1SYKfjYhZdm2Wh2Cl6KVQalKg_m4NhTPZqq-8SzEVO6s) + +* [](https://lookerstudio.google.com/s/tSTKxK1ECeU) + + +* [](https://github.com/open-telemetry) + +* [](https://cloud-native.slack.com/archives/C09H3MNMBQV) + +* [](https://cloud-native.slack.com/archives/CJFCJHG4Q) + +* [](https://opentelemetry.devstats.cncf.io/d/8/dashboards?orgId=1&refresh=15m) + +* [](https://www.linuxfoundation.org/legal/privacy-policy) + +* [](https://www.linuxfoundation.org/legal/trademark-usage) + +* [](https://opentelemetry.io/community/marketing-guidelines/) + +* [](https://opentelemetry.io/site/) + + +© 2019–present OpenTelemetry Authors | Docs [CC BY 4.0](https://creativecommons.org/licenses/by/4.0) +All Rights Reserved \ No newline at end of file diff --git a/THIRD_PARTY_NOTICES b/THIRD_PARTY_NOTICES index be80c728..f6bb04a4 100644 --- a/THIRD_PARTY_NOTICES +++ b/THIRD_PARTY_NOTICES @@ -97,7 +97,7 @@ COMPONENT INVENTORY - npm: @ag-ui/core 0.0.58 (declared license: MIT) - npm: @ag-ui/encoder 0.0.58 (declared license: MIT) - npm: @ag-ui/proto 0.0.58 (declared license: MIT) -- npm: @bufbuild/protobuf 2.12.1 (declared license: (Apache-2.0 AND BSD-3-Clause)) +- npm: @bufbuild/protobuf 2.14.1 (declared license: (Apache-2.0 AND BSD-3-Clause)); no license file was present in the installed package - npm: @floating-ui/core 1.8.0 (declared license: MIT) - npm: @floating-ui/dom 1.8.0 (declared license: MIT) - npm: @floating-ui/react 0.27.20 (declared license: MIT) @@ -130,7 +130,7 @@ COMPONENT INVENTORY - npm: @types/unist 2.0.11 (declared license: MIT) - npm: @types/unist 3.0.3 (declared license: MIT) - npm: @types/uuid 10.0.0 (declared license: MIT) -- npm: @ungap/structured-clone 1.3.3 (declared license: ISC) +- npm: @ungap/structured-clone 1.4.0 (declared license: ISC) - npm: accepts 2.0.0 (declared license: MIT) - npm: ajv 8.20.0 (declared license: MIT) - npm: ajv-formats 3.0.1 (declared license: MIT) @@ -149,7 +149,7 @@ COMPONENT INVENTORY - npm: compare-versions 6.1.1 (declared license: MIT) - npm: content-disposition 1.1.0 (declared license: MIT) - npm: content-type 1.0.5 (declared license: MIT) -- npm: content-type 2.0.0 (declared license: MIT) +- npm: content-type 2.1.0 (declared license: MIT) - npm: cookie 0.7.2 (declared license: MIT) - npm: cookie-es 3.1.1 (declared license: MIT) - npm: cookie-signature 1.2.2 (declared license: MIT) @@ -174,14 +174,14 @@ COMPONENT INVENTORY - npm: estree-util-is-identifier-name 3.0.0 (declared license: MIT) - npm: etag 1.8.1 (declared license: MIT) - npm: eventsource 3.0.7 (declared license: MIT) -- npm: eventsource-parser 3.1.0 (declared license: MIT) +- npm: eventsource-parser 3.1.1 (declared license: MIT) - npm: express 5.2.1 (declared license: MIT) -- npm: express-rate-limit 8.6.0 (declared license: MIT) +- npm: express-rate-limit 8.7.0 (declared license: MIT) - npm: extend 3.0.2 (declared license: MIT) - npm: fast-deep-equal 3.1.3 (declared license: MIT) - npm: fast-equals 4.0.3 (declared license: MIT) - npm: fast-json-patch 3.1.1 (declared license: MIT) -- npm: fast-uri 3.1.5 (declared license: BSD-3-Clause) +- npm: fast-uri 3.1.7 (declared license: BSD-3-Clause) - npm: finalhandler 2.1.1 (declared license: MIT) - npm: forwarded 0.2.0 (declared license: MIT) - npm: fresh 2.0.0 (declared license: MIT) @@ -208,9 +208,9 @@ COMPONENT INVENTORY - npm: is-hexadecimal 2.0.1 (declared license: MIT) - npm: is-plain-obj 4.1.0 (declared license: MIT) - npm: is-promise 4.0.0 (declared license: MIT) -- npm: isbot 5.2.1 (declared license: Unlicense) +- npm: isbot 5.2.2 (declared license: Unlicense) - npm: isexe 2.0.0 (declared license: ISC) -- npm: jose 6.2.3 (declared license: MIT) +- npm: jose 6.2.10 (declared license: MIT) - npm: js-tokens 4.0.0 (declared license: MIT) - npm: json-schema-traverse 1.0.0 (declared license: MIT) - npm: json-schema-typed 8.0.2 (declared license: BSD-2-Clause) @@ -233,7 +233,7 @@ COMPONENT INVENTORY - npm: mdast-util-to-hast 13.2.1 (declared license: MIT) - npm: mdast-util-to-markdown 2.1.2 (declared license: MIT) - npm: mdast-util-to-string 4.0.0 (declared license: MIT) -- npm: media-typer 1.1.0 (declared license: MIT) +- npm: media-typer 1.1.1 (declared license: MIT) - npm: merge-descriptors 2.0.0 (declared license: MIT) - npm: micromark 4.0.2 (declared license: MIT) - npm: micromark-core-commonmark 2.0.3 (declared license: MIT) @@ -266,7 +266,7 @@ COMPONENT INVENTORY - npm: mime-db 1.54.0 (declared license: MIT) - npm: mime-types 3.0.2 (declared license: MIT) - npm: ms 2.1.3 (declared license: MIT) -- npm: negotiator 1.0.0 (declared license: MIT) +- npm: negotiator 1.1.0 (declared license: MIT) - npm: object-assign 4.1.1 (declared license: MIT) - npm: object-inspect 1.13.4 (declared license: MIT) - npm: on-finished 2.4.1 (declared license: MIT) @@ -279,12 +279,12 @@ COMPONENT INVENTORY - npm: prop-types 15.8.1 (declared license: MIT) - npm: property-information 7.2.0 (declared license: MIT) - npm: proxy-addr 2.0.7 (declared license: MIT) -- npm: qs 6.15.3 (declared license: BSD-3-Clause) +- npm: qs 6.16.0 (declared license: BSD-3-Clause) - npm: range-parser 1.3.0 (declared license: MIT) - npm: raw-body 3.0.2 (declared license: MIT) - npm: react 19.2.8 (declared license: MIT) - npm: react-dom 19.2.8 (declared license: MIT) -- npm: react-draggable 4.7.0 (declared license: MIT) +- npm: react-draggable 4.7.1 (declared license: MIT) - npm: react-grid-layout 2.2.4 (declared license: MIT) - npm: react-is 16.13.1 (declared license: MIT) - npm: react-markdown 10.1.0 (declared license: MIT) @@ -304,8 +304,8 @@ COMPONENT INVENTORY - npm: safer-buffer 2.1.2 (declared license: MIT) - npm: scheduler 0.27.0 (declared license: MIT) - npm: send 1.2.1 (declared license: MIT) -- npm: seroval 1.6.3 (declared license: MIT) -- npm: seroval-plugins 1.6.3 (declared license: MIT) +- npm: seroval 1.6.4 (declared license: MIT) +- npm: seroval-plugins 1.6.4 (declared license: MIT) - npm: serve-static 2.2.1 (declared license: MIT) - npm: setprototypeof 1.2.0 (declared license: ISC) - npm: shebang-command 2.0.0 (declared license: MIT) @@ -326,7 +326,7 @@ COMPONENT INVENTORY - npm: trough 2.2.0 (declared license: MIT) - npm: tslib 2.3.0 (declared license: 0BSD) - npm: tslib 2.8.1 (declared license: 0BSD) -- npm: type-fest 5.8.0 (declared license: (MIT OR CC0-1.0)) +- npm: type-fest 5.9.0 (declared license: (MIT OR CC0-1.0)) - npm: type-is 2.1.0 (declared license: MIT) - npm: unified 11.0.5 (declared license: MIT) - npm: unist-util-is 6.0.1 (declared license: MIT) @@ -347,7 +347,7 @@ COMPONENT INVENTORY - npm: which 2.0.2 (declared license: ISC) - npm: wrappy 1.0.2 (declared license: ISC) - npm: zod 3.25.76 (declared license: MIT) -- npm: zod 4.4.3 (declared license: MIT) +- npm: zod 4.5.4 (declared license: MIT) - npm: zod-to-json-schema 3.25.2 (declared license: ISC) - npm: zrender 6.1.0 (declared license: BSD-3-Clause) - npm: zwitch 2.0.4 (declared license: MIT) @@ -369,7 +369,6 @@ LICENSE AND NOTICE TEXTS - Go: google.golang.org/genproto/googleapis/api v0.0.0-20260825221802-da73d73af1c5 / LICENSE - Go: google.golang.org/genproto/googleapis/rpc v0.0.0-20260825221802-da73d73af1c5 / LICENSE - Go: google.golang.org/grpc v1.83.2 / LICENSE -- npm: @bufbuild/protobuf 2.12.1 / supplemental/LICENSE - npm: @protobuf-ts/protoc 2.11.1 / supplemental/LICENSE ---------------------------------------------------------------------------- @@ -4266,46 +4265,6 @@ 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: @bufbuild/protobuf 2.12.1 / supplemental/bufbuild-protobuf-BSD.txt ----------------------------------------------------------------------------- - -Copyright 2008 Google Inc. All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are met: - -* Redistributions of source code must retain the above copyright notice, - this list of conditions and the following disclaimer. -* Redistributions in binary form must reproduce the above copyright notice, - this list of conditions and the following disclaimer in the documentation - and/or other materials provided with the distribution. -* Neither the name of Google Inc. nor the names of its contributors may be - used to endorse or promote products derived from this software without - specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" -AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR -ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON -ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -Code generated by the Protocol Buffer compiler is owned by the owner of the -input file used when generating it. This code is not standalone and requires a -support library to be linked with it. This support library is itself covered -by the above license. - ---- Applies to ------------------------------------------------------------- -- npm: @bufbuild/protobuf 2.12.1 / supplemental/bufbuild-protobuf-NOTICE.txt ----------------------------------------------------------------------------- - -Copyright 2021-2026 Buf Technologies, Inc. - --- Applies to ------------------------------------------------------------- - npm: @floating-ui/core 1.8.0 / LICENSE - npm: @floating-ui/dom 1.8.0 / LICENSE @@ -4976,7 +4935,7 @@ MIT License SOFTWARE --- Applies to ------------------------------------------------------------- -- npm: @ungap/structured-clone 1.3.3 / LICENSE +- npm: @ungap/structured-clone 1.4.0 / LICENSE ---------------------------------------------------------------------------- ISC License @@ -5280,7 +5239,7 @@ SOFTWARE. --- Applies to ------------------------------------------------------------- - npm: content-disposition 1.1.0 / LICENSE - npm: forwarded 0.2.0 / LICENSE -- npm: media-typer 1.1.0 / LICENSE +- npm: media-typer 1.1.1 / LICENSE - npm: vary 1.1.2 / LICENSE ---------------------------------------------------------------------------- @@ -5309,7 +5268,7 @@ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. --- Applies to ------------------------------------------------------------- - npm: content-type 1.0.5 / LICENSE -- npm: content-type 2.0.0 / LICENSE +- npm: content-type 2.1.0 / LICENSE ---------------------------------------------------------------------------- (The MIT License) @@ -6038,7 +5997,7 @@ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - npm: escape-string-regexp 5.0.0 / license - npm: is-plain-obj 4.1.0 / license - npm: tagged-tag 1.0.0 / license -- npm: type-fest 5.8.0 / license-mit +- npm: type-fest 5.9.0 / license-mit ---------------------------------------------------------------------------- MIT License @@ -6146,7 +6105,7 @@ 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: eventsource-parser 3.1.0 / LICENSE +- npm: eventsource-parser 3.1.1 / LICENSE ---------------------------------------------------------------------------- MIT License @@ -6201,10 +6160,10 @@ 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: express-rate-limit 8.6.0 / license.md +- npm: express-rate-limit 8.7.0 / license ---------------------------------------------------------------------------- -# MIT License +MIT License Copyright 2023 Nathan Friedly, Vedant K @@ -6219,11 +6178,12 @@ The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. 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. +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: extend 3.0.2 / LICENSE @@ -6333,7 +6293,7 @@ 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: fast-uri 3.1.5 / LICENSE +- npm: fast-uri 3.1.7 / LICENSE ---------------------------------------------------------------------------- Copyright (c) 2011-2021, Gary Court until https://github.com/garycourt/uri-js/commit/a1acf730b4bba3f1097c9f52e7d9d3aba8cdcaae @@ -6813,7 +6773,7 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. --- Applies to ------------------------------------------------------------- -- npm: isbot 5.2.1 / LICENSE +- npm: isbot 5.2.2 / LICENSE ---------------------------------------------------------------------------- # Unlicense @@ -6867,7 +6827,7 @@ ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. --- Applies to ------------------------------------------------------------- -- npm: jose 6.2.3 / LICENSE.md +- npm: jose 6.2.10 / LICENSE.md ---------------------------------------------------------------------------- The MIT License (MIT) @@ -7161,7 +7121,7 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. --- Applies to ------------------------------------------------------------- -- npm: negotiator 1.0.0 / LICENSE +- npm: negotiator 1.1.0 / LICENSE ---------------------------------------------------------------------------- (The MIT License) @@ -7419,7 +7379,7 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. --- Applies to ------------------------------------------------------------- -- npm: qs 6.15.3 / LICENSE.md +- npm: qs 6.16.0 / LICENSE.md ---------------------------------------------------------------------------- BSD 3-Clause License @@ -7537,7 +7497,7 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. --- Applies to ------------------------------------------------------------- -- npm: react-draggable 4.7.0 / LICENSE +- npm: react-draggable 4.7.1 / LICENSE ---------------------------------------------------------------------------- (MIT License) @@ -8115,8 +8075,8 @@ 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: seroval 1.6.3 / LICENSE -- npm: seroval-plugins 1.6.3 / LICENSE +- npm: seroval 1.6.4 / LICENSE +- npm: seroval-plugins 1.6.4 / LICENSE ---------------------------------------------------------------------------- MIT License Copyright (c) 2025 Alexis Munsayac @@ -8394,7 +8354,7 @@ OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. --- Applies to ------------------------------------------------------------- -- npm: type-fest 5.8.0 / license-cc0 +- npm: type-fest 5.9.0 / license-cc0 ---------------------------------------------------------------------------- Creative Commons Legal Code @@ -8643,7 +8603,7 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI --- Applies to ------------------------------------------------------------- - npm: zod 3.25.76 / LICENSE -- npm: zod 4.4.3 / LICENSE +- npm: zod 4.5.4 / LICENSE ---------------------------------------------------------------------------- MIT License diff --git a/internal/mcp/apps/logs.html b/internal/mcp/apps/logs.html index 7b9bdaf6..2e1c3300 100644 --- a/internal/mcp/apps/logs.html +++ b/internal/mcp/apps/logs.html @@ -1,101 +1,88 @@ -Fanout log explorer +- "app": Tool callable by the app from this server only`),csp:J6().optional(),permissions:J6().optional()}),Z({mimeTypes:Z6(X()).optional().describe('Array of supported MIME types for UI resources.\nMust include `"text/html;profile=mcp-app"` for MCP Apps support.')}),Z({method:Q(`ui/download-file`),params:Z({contents:Z6(t8([k9,A9])).describe(`Resource contents to download — embedded (inline data) or linked (host fetches). Uses standard MCP resource types.`)})}),Z({method:Q(`ui/message`),params:Z({role:Q(`user`).describe(`Message role, currently only "user" is supported.`),content:Z6(j9).describe(`Message content blocks (text, image, etc.).`)})}),Z({method:Q(`ui/notifications/sandbox-resource-ready`),params:Z({html:X().describe(`HTML content to load into the inner iframe.`),sandbox:X().optional().describe(`Optional override for the inner iframe's sandbox attribute.`),csp:J9.optional().describe(`CSP configuration from resource metadata.`),permissions:Y9.optional().describe(`Sandbox permissions from resource metadata.`)})});var Aoe=Z({method:Q(`ui/notifications/tool-result`),params:P9.describe(`Standard MCP tool execution result.`)}),Z9=Z({toolInfo:Z({id:W7.optional().describe(`JSON-RPC id of the tools/call request.`),tool:M9.describe(`Tool definition including name, inputSchema, etc.`)}).optional().describe(`Metadata of the tool call that instantiated this App.`),theme:hoe.optional().describe(`Current color theme preference.`),styles:woe.optional().describe(`Style configuration for theming the app.`),displayMode:q9.optional().describe(`How the UI is currently displayed.`),availableDisplayModes:Z6(q9).optional().describe(`Display modes the host supports.`),containerDimensions:t8([Z({height:N6().describe(`Fixed container height in pixels.`)}),Z({maxHeight:t8([N6(),W6()]).optional().describe(`Maximum container height in pixels.`)})]).and(t8([Z({width:N6().describe(`Fixed container width in pixels.`)}),Z({maxWidth:t8([N6(),W6()]).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:X().optional().describe(`User's language and region preference in BCP 47 format.`),timeZone:X().optional().describe(`User's timezone in IANA format.`),userAgent:X().optional().describe(`Host application identifier.`),platform:t8([Q(`web`),Q(`desktop`),Q(`mobile`)]).optional().describe(`Platform type for responsive design decisions.`),deviceCapabilities:Z({touch:z6().optional().describe(`Whether the device supports touch input.`),hover:z6().optional().describe(`Whether the device supports hover interactions.`)}).optional().describe(`Device input capabilities.`),safeAreaInsets:Z({top:N6().describe(`Top safe area inset in pixels.`),right:N6().describe(`Right safe area inset in pixels.`),bottom:N6().describe(`Bottom safe area inset in pixels.`),left:N6().describe(`Left safe area inset in pixels.`)}).optional().describe(`Mobile safe area boundaries in pixels.`)}).passthrough(),joe=Z({method:Q(`ui/notifications/host-context-changed`),params:Z9.describe(`Partial context update containing only changed fields.`)});Z({method:Q(`ui/update-model-context`),params:Z({content:Z6(j9).optional().describe(`Context content blocks (text, image, etc.).`),structuredContent:o8(X(),q6().describe(`Structured content for machine-readable context data.`)).optional().describe(`Structured content for machine-readable context data.`)})}),Z({method:Q(`ui/initialize`),params:Z({appInfo:n9.describe(`App identification (name and version).`),appCapabilities:Doe.describe(`Features and capabilities this app provides.`),protocolVersion:X().describe(`Protocol version this app supports.`)})});var Moe=Z({protocolVersion:X().describe(`Negotiated protocol version string (e.g., "2025-11-21").`),hostInfo:n9.describe(`Host application identification and version.`),hostCapabilities:Eoe.describe(`Features and capabilities provided by the host.`),hostContext:Z9.describe(`Rich context about the host environment.`)}).passthrough(),Noe={target:`draft-2020-12`};async function Q9(e,t){let n=e[`~standard`];if(n.jsonSchema)return n.jsonSchema[t](Noe);if(n.vendor===`zod`){let{z:n}=await foe(async()=>{let{z:e}=await Promise.resolve().then(()=>(M7(),Nie));return{z:e}},void 0,import.meta.url);return n.toJSONSchema(e,{io:t})}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}var Poe=class e extends poe{_appInfo;_capabilities;options;_hostCapabilities;_hostInfo;_hostContext;_registeredTools={};_initializedSent=!1;_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:boe,toolinputpartial:xoe,toolresult:Aoe,toolcancelled:Soe,hostcontextchanged:joe};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),super.setEventHandler(e,t)}addEventListener(e,t){this._assertHandlerTiming(e),super.addEventListener(e,t)}onEventDispatch(e,t){e===`hostcontextchanged`&&(this._hostContext={...this._hostContext,...t})}constructor(e,t={},n={autoResize:!0}){super(n),this._appInfo=e,this._capabilities=t,this.options=n,n.allowUnsafeEval||NW({jitless:!0}),this.setRequestHandler(r9,e=>(console.log(`Received ping:`,e.params),{})),this.setEventHandler(`hostcontextchanged`,void 0)}registerCapabilities(e){if(this.transport)throw Error(`Cannot register capabilities after transport is established`);this._capabilities=loe(this._capabilities,e)}registerTool(e,t,n){if(this._registeredTools[e])throw Error(`Tool ${e} is already registered`);let r=this,i=()=>{r._initializedSent&&r._capabilities.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._capabilities.tools&&!this.transport&&this.registerCapabilities({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(Toe,(e,t)=>{if(!this._onteardown)throw Error(`No onteardown handler set`);return this._onteardown(e.params,t)})}_oncalltool;get oncalltool(){return this._oncalltool}set oncalltool(e){this.warnIfRequestHandlerReplaced(`oncalltool`,this._oncalltool,e),this._oncalltool=e,this.replaceRequestHandler(F9,(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(N9,(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._capabilities.tools)throw Error(`Client does not support tool capability (required for ${e})`);return;case`ping`:case`ui/resource-teardown`:return;default:throw Error(`No handler for method ${e} registered`)}}assertNotificationCapability(e){}assertTaskCapability(e){throw Error(`Tasks are not supported in MCP Apps`)}assertTaskHandlerCapability(e){throw Error(`Task handlers are not supported in MCP Apps`)}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},P9,{onprogress:()=>{},resetTimeoutOnProgress:!0,...t})}async readServerResource(e,t){return this._assertInitialized(`readServerResource`),await this.request({method:`resources/read`,params:e},T9,t)}async listServerResources(e,t){return this._assertInitialized(`listServerResources`),await this.request({method:`resources/list`,params:e},C9,t)}async createSamplingMessage(e,t){this._assertInitialized(`createSamplingMessage`);let n=e.tools?z9:R9;return await this.request({method:`sampling/createMessage`,params:e},n,t)}sendMessage(e,t){return this._assertInitialized(`sendMessage`),this.request({method:`ui/message`,params:e},yoe,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},Q7,t)}openLink(e,t){return this._assertInitialized(`openLink`),this.request({method:`ui/open-link`,params:e},_oe,t)}sendOpenLink=this.openLink;downloadFile(e,t){return this._assertInitialized(`downloadFile`),this.request({method:`ui/download-file`,params:e},voe,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},Ooe,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 K9(window.parent,window.parent),t){if(this.transport)throw Error(`App is already connected. Call close() before connecting again.`);this._initializedSent=!1,await super.connect(e);try{let e=await this.request({method:`ui/initialize`,params:{appCapabilities:this._capabilities,appInfo:this._appInfo,protocolVersion:moe}},Moe,t);if(e===void 0)throw Error(`Server sent invalid initialize result: ${e}`);this._hostCapabilities=e.hostCapabilities,this._hostInfo=e.hostInfo,this._hostContext=e.hostContext,await this.notification({method:`ui/notifications/initialized`}),this._initializedSent=!0,this.options?.autoResize&&this.setupSizeChangedNotifications()}catch(e){throw this.close(),e}}};function Foe({appInfo:e,capabilities:t,onAppCreated:n,autoResize:r=!0,strict:i}){let[a,o]=(0,W.useState)(null),[s,c]=(0,W.useState)(!1),[l,u]=(0,W.useState)(null);return(0,W.useEffect)(()=>{let a=!0,s;async function l(){try{let l=new K9(window.parent,window.parent);if(s=new Poe(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 Ioe(e){let[t,n]=(0,W.useState)(null),[r,i]=(0,W.useState)({}),[a,o]=(0,W.useState)(),[s,c]=(0,W.useState)(null);function l(e){if(e.isError){c(`This view could not be refreshed. Please try again.`);return}c(null),n(e.structuredContent)}let u=Foe({appInfo:{name:e,version:`1.0.0`},capabilities:{},onAppCreated:e=>{e.ontoolinput=e=>{i(e.arguments??{})},e.ontoolresult=l,e.onhostcontextchanged=e=>o(t=>({...t,...e})),e.onerror=e=>{console.error(`MCP app error`,e),c(`This view could not be refreshed. Please try again.`)}}});(0,W.useEffect)(()=>{u.app&&o(u.app.getHostContext())},[u.app]);async function d(e){if(u.app)try{l(await u.app.callServerTool({name:e,arguments:r}))}catch(t){console.error(`Tool call ${e} failed`,t),c(`This view could not be refreshed. Please try again.`)}}return{...u,result:t,toolInput:r,host:a,toolError:s,callTool:d}}async function Loe(e,t){e&&await e.sendMessage({role:`user`,content:[{type:`text`,text:t}]})}aD([Jx]);function Roe(){let{app:e,callTool:t,error:n,host:r,result:i,toolError:a}=Ioe(`Fanout log explorer`),[o,s]=(0,W.useState)(`ALL`),[c,l]=(0,W.useState)(``),u=r?.theme===`dark`,d=(0,W.useMemo)(()=>(i?.data.entries??[]).filter(e=>(o===`ALL`||e.severity.toUpperCase()===o)&&(!c||e.body.toLowerCase().includes(c.toLowerCase())||e.service.toLowerCase().includes(c.toLowerCase()))),[i,c,o]);return(0,G.jsxs)(HR,{dark:u,children:[(0,G.jsx)(UR,{eyebrow:`Application activity`,title:`Logs`,summary:i?`${i.data.entries.length} entries in this time range`:void 0,onRefresh:()=>t(`search_logs`),disabled:!e}),(0,G.jsx)(WR,{error:a??(n?`This view could not be loaded. Please try again.`:null),loading:!i&&!n&&!a?`Searching logs…`:void 0}),i&&i.data.entries.length===0&&(0,G.jsxs)(G.Fragment,{children:[(0,G.jsx)(GR,{tall:!0,icon:(0,G.jsx)(wR,{size:20,weight:`duotone`}),title:`No logs matched`,children:`Try a wider time window, a different service, or a less restrictive search.`}),(0,G.jsx)(KR,{left:TU(i.provenance.window),right:`No entries found`})]}),i&&i.data.entries.length>0&&(0,G.jsxs)(G.Fragment,{children:[(0,G.jsx)(zoe,{data:i.data,dark:u,window:i.provenance.window}),(0,G.jsxs)(sI,{px:{base:`md`,sm:`lg`},py:`sm`,justify:`space-between`,align:`center`,children:[(0,G.jsx)(IL,{size:`xs`,value:o,onChange:s,data:[`ALL`,`ERROR`,`WARN`,`INFO`]}),(0,G.jsx)(nR,{"aria-label":`Filter visible logs`,type:`search`,value:c,onChange:e=>l(e.currentTarget.value),placeholder:`Filter visible logs…`,leftSection:(0,G.jsx)(ER,{size:15}),w:{base:`100%`,xs:250}})]}),(0,G.jsx)(Boe,{entries:d,window:i.provenance.window,onTrace:t=>Loe(e,`Investigate trace ${t.trace_id} related to this ${t.severity} log from ${t.service}.`)}),(0,G.jsx)(KR,{left:TU(i.provenance.window),right:`${d.length} matching`})]})]})}function zoe({data:e,dark:t,window:n}){let r=(0,W.useMemo)(()=>{let r=YR(t),i=[...new Set(e.buckets.map(e=>e.time))],a=[...new Set(e.buckets.map(e=>e.severity))],o=new Map(e.buckets.map(e=>[`${e.time}\u0000${e.severity}`,e.count]));return{color:a.map(e=>Hoe(e,t)),grid:{left:42,right:18,top:30,bottom:28},tooltip:{trigger:`axis`,axisPointer:{type:`shadow`},backgroundColor:r.surface,borderColor:r.border,textStyle:{color:r.text,fontSize:10}},legend:{top:0,right:0,textStyle:{color:r.muted,fontSize:9},itemWidth:7,itemHeight:7,icon:`circle`},xAxis:{type:`category`,data:i.map(e=>EU(e,n)),axisLabel:{color:r.muted,fontSize:8,hideOverlap:!0},axisLine:{lineStyle:{color:r.border}}},yAxis:{type:`value`,minInterval:1,splitLine:{lineStyle:{color:r.grid}},axisLabel:{color:r.muted,fontSize:8}},series:a.map(e=>({name:e,type:`bar`,stack:`logs`,barMaxWidth:22,data:i.map(t=>o.get(`${t}\u0000${e}`)??0),itemStyle:{borderRadius:[2,2,0,0]}}))}},[t,e.buckets,n]);return(0,G.jsx)(mF,{withBorder:!0,radius:`md`,mx:{base:`md`,sm:`lg`},p:`xs`,children:(0,G.jsx)(Ure,{option:r,height:190,label:`Log volume by severity over time`})})}function Boe({entries:e,onTrace:t,window:n}){let r=qR(e,6);return e.length===0?(0,G.jsx)(GR,{icon:(0,G.jsx)(ER,{size:20,weight:`duotone`}),title:`No visible matches`,children:`Adjust the local severity or text filter.`}):(0,G.jsxs)(G.Fragment,{children:[(0,G.jsx)(tR.ScrollContainer,{minWidth:680,children:(0,G.jsxs)(tR,{striped:!0,highlightOnHover:!0,verticalSpacing:`xs`,children:[(0,G.jsx)(tR.Thead,{children:(0,G.jsxs)(tR.Tr,{children:[(0,G.jsx)(tR.Th,{children:`Time`}),(0,G.jsx)(tR.Th,{children:`Level`}),(0,G.jsx)(tR.Th,{children:`Service`}),(0,G.jsx)(tR.Th,{children:`Message`}),(0,G.jsx)(tR.Th,{})]})}),(0,G.jsx)(tR.Tbody,{children:r.pageItems.map((e,i)=>(0,G.jsxs)(tR.Tr,{children:[(0,G.jsx)(tR.Td,{children:(0,G.jsx)(BI,{size:`xs`,ff:`monospace`,children:EU(e.time,n,!0)})}),(0,G.jsx)(tR.Td,{children:(0,G.jsx)(UI,{size:`sm`,color:Voe(e.severity),variant:`light`,children:e.severity||`LOG`})}),(0,G.jsx)(tR.Td,{children:(0,G.jsx)(BI,{size:`sm`,fw:600,children:e.service})}),(0,G.jsx)(tR.Td,{children:(0,G.jsx)(BI,{size:`sm`,lineClamp:2,title:e.body,children:e.body})}),(0,G.jsx)(tR.Td,{children:e.trace_id&&(0,G.jsx)(ML,{label:`Investigate trace`,children:(0,G.jsx)(ZF,{variant:`subtle`,"aria-label":`Investigate trace ${e.trace_id}`,onClick:()=>t(e),children:(0,G.jsx)(SR,{size:15,weight:`bold`})})})})]},`${e.time}-${r.from+i}`))})]})}),(0,G.jsx)(JR,{...r,onChange:r.setPage})]})}function Voe(e){let t=e.toUpperCase();return t===`ERROR`||t===`FATAL`?`bad`:t===`WARN`||t===`WARNING`?`warn`:t===`INFO`?`info`:`gray`}function Hoe(e,t){let n=XR(t),r=e.toUpperCase();return r===`ERROR`||r===`FATAL`?n.bad:r===`WARN`||r===`WARNING`?n.warn:r===`INFO`?n.info:YR(t).muted}(0,AR.createRoot)(document.getElementById(`root`)).render((0,G.jsx)(W.StrictMode,{children:(0,G.jsx)(Roe,{})}));
diff --git a/internal/mcp/apps/overview.html b/internal/mcp/apps/overview.html index 0e19c483..56a6434a 100644 --- a/internal/mcp/apps/overview.html +++ b/internal/mcp/apps/overview.html @@ -1,84 +1,71 @@ - System health +- "app": Tool callable by the app from this server only`),csp:yC().optional(),permissions:yC().optional()}),J({mimeTypes:q(G()).optional().describe('Array of supported MIME types for UI resources.\nMust include `"text/html;profile=mcp-app"` for MCP Apps support.')}),J({method:Z(`ui/download-file`),params:J({contents:q(Y([aO,oO])).describe(`Resource contents to download — embedded (inline data) or linked (host fetches). Uses standard MCP resource types.`)})}),J({method:Z(`ui/message`),params:J({role:Z(`user`).describe(`Message role, currently only "user" is supported.`),content:q(sO).describe(`Message content blocks (text, image, etc.).`)})}),J({method:Z(`ui/notifications/sandbox-resource-ready`),params:J({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:Sk.optional().describe(`CSP configuration from resource metadata.`),permissions:Ck.optional().describe(`Sandbox permissions from resource metadata.`)})});var Fk=J({method:Z(`ui/notifications/tool-result`),params:gO.describe(`Standard MCP tool execution result.`)}),Ik=J({toolInfo:J({id:FE.optional().describe(`JSON-RPC id of the tools/call request.`),tool:pO.describe(`Tool definition including name, inputSchema, etc.`)}).optional().describe(`Metadata of the tool call that instantiated this App.`),theme:gk.optional().describe(`Current color theme preference.`),styles:Ok.optional().describe(`Style configuration for theming the app.`),displayMode:_k.optional().describe(`How the UI is currently displayed.`),availableDisplayModes:q(_k).optional().describe(`Display modes the host supports.`),containerDimensions:Y([J({height:K().describe(`Fixed container height in pixels.`)}),J({maxHeight:Y([K(),hC()]).optional().describe(`Maximum container height in pixels.`)})]).and(Y([J({width:K().describe(`Fixed container width in pixels.`)}),J({maxWidth:Y([K(),hC()]).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:Y([Z(`web`),Z(`desktop`),Z(`mobile`)]).optional().describe(`Platform type for responsive design decisions.`),deviceCapabilities:J({touch:uC().optional().describe(`Whether the device supports touch input.`),hover:uC().optional().describe(`Whether the device supports hover interactions.`)}).optional().describe(`Device input capabilities.`),safeAreaInsets:J({top:K().describe(`Top safe area inset in pixels.`),right:K().describe(`Right safe area inset in pixels.`),bottom:K().describe(`Bottom safe area inset in pixels.`),left:K().describe(`Left safe area inset in pixels.`)}).optional().describe(`Mobile safe area boundaries in pixels.`)}).passthrough(),Lk=J({method:Z(`ui/notifications/host-context-changed`),params:Ik.describe(`Partial context update containing only changed fields.`)});J({method:Z(`ui/update-model-context`),params:J({content:q(sO).optional().describe(`Context content blocks (text, image, etc.).`),structuredContent:X(G(),vC().describe(`Structured content for machine-readable context data.`)).optional().describe(`Structured content for machine-readable context data.`)})}),J({method:Z(`ui/initialize`),params:J({appInfo:ZE.describe(`App identification (name and version).`),appCapabilities:Mk.describe(`Features and capabilities this app provides.`),protocolVersion:G().describe(`Protocol version this app supports.`)})});var Rk=J({protocolVersion:G().describe(`Negotiated protocol version string (e.g., "2025-11-21").`),hostInfo:ZE.describe(`Host application identification and version.`),hostCapabilities:jk.describe(`Features and capabilities provided by the host.`),hostContext:Ik.describe(`Rich context about the host environment.`)}).passthrough(),zk={target:`draft-2020-12`};async function Bk(e,t){let n=e[`~standard`];if(n.jsonSchema)return n.jsonSchema[t](zk);if(n.vendor===`zod`){let{z:n}=await fk(async()=>{let{z:e}=await Promise.resolve().then(()=>(bE(),yE));return{z:e}},void 0,import.meta.url);return n.toJSONSchema(e,{io:t})}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 Vk(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}var Hk=class e extends pk{_appInfo;_capabilities;options;_hostCapabilities;_hostInfo;_hostContext;_registeredTools={};_initializedSent=!1;_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:wk,toolinputpartial:Tk,toolresult:Fk,toolcancelled:Ek,hostcontextchanged:Lk};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),super.setEventHandler(e,t)}addEventListener(e,t){this._assertHandlerTiming(e),super.addEventListener(e,t)}onEventDispatch(e,t){e===`hostcontextchanged`&&(this._hostContext={...this._hostContext,...t})}constructor(e,t={},n={autoResize:!0}){super(n),this._appInfo=e,this._capabilities=t,this.options=n,n.allowUnsafeEval||sc({jitless:!0}),this.setRequestHandler(sD,e=>(console.log(`Received ping:`,e.params),{})),this.setEventHandler(`hostcontextchanged`,void 0)}registerCapabilities(e){if(this.transport)throw Error(`Cannot register capabilities after transport is established`);this._capabilities=ck(this._capabilities,e)}registerTool(e,t,n){if(this._registeredTools[e])throw Error(`Tool ${e} is already registered`);let r=this,i=()=>{r._initializedSent&&r._capabilities.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 Vk(a,t??{},`Invalid input for tool ${e}: `):t??{},r)}else i=await n(r);return o.outputSchema&&!i.isError&&(i.structuredContent=await Vk(o.outputSchema,i.structuredContent,`Invalid output for tool ${e}: `)),i}};return this._registeredTools[e]=o,!this._capabilities.tools&&!this.transport&&this.registerCapabilities({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 Bk(t.inputSchema,`input`):{type:`object`,properties:{}}};return t.outputSchema&&(n.outputSchema=await Bk(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(kk,(e,t)=>{if(!this._onteardown)throw Error(`No onteardown handler set`);return this._onteardown(e.params,t)})}_oncalltool;get oncalltool(){return this._oncalltool}set oncalltool(e){this.warnIfRequestHandlerReplaced(`oncalltool`,this._oncalltool,e),this._oncalltool=e,this.replaceRequestHandler(vO,(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(mO,(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._capabilities.tools)throw Error(`Client does not support tool capability (required for ${e})`);return;case`ping`:case`ui/resource-teardown`:return;default:throw Error(`No handler for method ${e} registered`)}}assertNotificationCapability(e){}assertTaskCapability(e){throw Error(`Tasks are not supported in MCP Apps`)}assertTaskHandlerCapability(e){throw Error(`Task handlers are not supported in MCP Apps`)}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},gO,{onprogress:()=>{},resetTimeoutOnProgress:!0,...t})}async readServerResource(e,t){return this._assertInitialized(`readServerResource`),await this.request({method:`resources/read`,params:e},VD,t)}async listServerResources(e,t){return this._assertInitialized(`listServerResources`),await this.request({method:`resources/list`,params:e},FD,t)}async createSamplingMessage(e,t){this._assertInitialized(`createSamplingMessage`);let n=e.tools?PO:NO;return await this.request({method:`sampling/createMessage`,params:e},n,t)}sendMessage(e,t){return this._assertInitialized(`sendMessage`),this.request({method:`ui/message`,params:e},xk,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},KE,t)}openLink(e,t){return this._assertInitialized(`openLink`),this.request({method:`ui/open-link`,params:e},yk,t)}sendOpenLink=this.openLink;downloadFile(e,t){return this._assertInitialized(`downloadFile`),this.request({method:`ui/download-file`,params:e},bk,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},Nk,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 hk(window.parent,window.parent),t){if(this.transport)throw Error(`App is already connected. Call close() before connecting again.`);this._initializedSent=!1,await super.connect(e);try{let e=await this.request({method:`ui/initialize`,params:{appCapabilities:this._capabilities,appInfo:this._appInfo,protocolVersion:mk}},Rk,t);if(e===void 0)throw Error(`Server sent invalid initialize result: ${e}`);this._hostCapabilities=e.hostCapabilities,this._hostInfo=e.hostInfo,this._hostContext=e.hostContext,await this.notification({method:`ui/notifications/initialized`}),this._initializedSent=!0,this.options?.autoResize&&this.setupSizeChangedNotifications()}catch(e){throw this.close(),e}}};function Uk({appInfo:e,capabilities:t,onAppCreated:n,autoResize:r=!0,strict:i}){let[a,o]=(0,w.useState)(null),[s,c]=(0,w.useState)(!1),[l,u]=(0,w.useState)(null);return(0,w.useEffect)(()=>{let a=!0,s;async function l(){try{let l=new hk(window.parent,window.parent);if(s=new Hk(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 Wk(e){let[t,n]=(0,w.useState)(null),[r,i]=(0,w.useState)({}),[a,o]=(0,w.useState)(),[s,c]=(0,w.useState)(null);function l(e){if(e.isError){c(`This view could not be refreshed. Please try again.`);return}c(null),n(e.structuredContent)}let u=Uk({appInfo:{name:e,version:`1.0.0`},capabilities:{},onAppCreated:e=>{e.ontoolinput=e=>{i(e.arguments??{})},e.ontoolresult=l,e.onhostcontextchanged=e=>o(t=>({...t,...e})),e.onerror=e=>{console.error(`MCP app error`,e),c(`This view could not be refreshed. Please try again.`)}}});(0,w.useEffect)(()=>{u.app&&o(u.app.getHostContext())},[u.app]);async function d(e){if(u.app)try{l(await u.app.callServerTool({name:e,arguments:r}))}catch(t){console.error(`Tool call ${e} failed`,t),c(`This view could not be refreshed. Please try again.`)}}return{...u,result:t,toolInput:r,host:a,toolError:s,callTool:d}}async function Gk(e,t){e&&await e.sendMessage({role:`user`,content:[{type:`text`,text:t}]})}function Kk(){let{app:e,callTool:t,error:n,host:r,result:i,toolError:a}=Wk(`Fanout system health`);return(0,O.jsxs)(To,{dark:r?.theme===`dark`,children:[(0,O.jsx)(Eo,{eyebrow:`Live system view`,title:`System health`,summary:i?.summary,onRefresh:()=>t(`observability_overview`),disabled:!e}),(0,O.jsx)(Do,{error:a??(n?`This view could not be loaded. Please try again.`:null),loading:!i&&!n&&!a?`Loading system health…`:void 0}),i&&(0,O.jsx)(qk,{result:i,onService:t=>Gk(e,`Investigate the ${t} service. Explain its errors and latency.`)})]})}function qk({result:e,onService:t}){let{data:n}=e,r=Math.max(n.service_count,1),i=jo(n.services,6);return(0,O.jsxs)(O.Fragment,{children:[(0,O.jsxs)(Da,{cols:{base:1,xs:3},spacing:`sm`,px:{base:`md`,sm:`lg`},pb:`md`,children:[(0,O.jsx)(Ao,{label:`Services`,value:Po.format(n.service_count)}),(0,O.jsx)(Ao,{label:`Operations`,value:Po.format(n.total_spans)}),(0,O.jsx)(Ao,{label:`Error rate`,value:Fo(n.error_rate),color:No(n.health)})]}),(0,O.jsxs)(k,{px:{base:`md`,sm:`lg`},pb:`md`,children:[(0,O.jsxs)(va.Root,{size:`lg`,"aria-label":`Service health distribution`,children:[(0,O.jsx)(va.Section,{value:n.counts.healthy/r*100,color:`ok`,children:(0,O.jsx)(va.Label,{children:n.counts.healthy})}),(0,O.jsx)(va.Section,{value:n.counts.degraded/r*100,color:`warn`,children:(0,O.jsx)(va.Label,{children:n.counts.degraded})}),(0,O.jsx)(va.Section,{value:n.counts.unhealthy/r*100,color:`bad`,children:(0,O.jsx)(va.Label,{children:n.counts.unhealthy})})]}),(0,O.jsxs)(gi,{mt:`xs`,gap:`lg`,children:[(0,O.jsx)(Jk,{color:`ok`,text:`${n.counts.healthy} healthy`}),(0,O.jsx)(Jk,{color:`warn`,text:`${n.counts.degraded} degraded`}),(0,O.jsx)(Jk,{color:`bad`,text:`${n.counts.unhealthy} unhealthy`})]})]}),n.services.length===0?(0,O.jsx)(Oo,{icon:(0,O.jsx)(uo,{size:20,weight:`duotone`}),title:`No activity in this window`,children:`Services will appear as data begins to arrive.`}):(0,O.jsxs)(O.Fragment,{children:[(0,O.jsx)(Ka.ScrollContainer,{minWidth:560,children:(0,O.jsxs)(Ka,{striped:!0,highlightOnHover:!0,verticalSpacing:`sm`,children:[(0,O.jsx)(Ka.Thead,{children:(0,O.jsxs)(Ka.Tr,{children:[(0,O.jsx)(Ka.Th,{children:`Service`}),(0,O.jsx)(Ka.Th,{children:`Traffic`}),(0,O.jsx)(Ka.Th,{children:`P95`}),(0,O.jsx)(Ka.Th,{children:`Errors`})]})}),(0,O.jsx)(Ka.Tbody,{children:i.pageItems.map(e=>(0,O.jsx)(Yk,{service:e,onClick:()=>t(e.service)},e.service))})]})}),(0,O.jsx)(Mo,{...i,onChange:i.setPage})]}),(0,O.jsx)(ko,{left:Lo(e.provenance.window),right:`Updated ${new Date(e.provenance.generated_at).toLocaleTimeString([],{hour:`numeric`,minute:`2-digit`})}`})]})}function Jk({color:e,text:t}){return(0,O.jsxs)(gi,{gap:6,children:[(0,O.jsx)(k,{w:8,h:8,bg:e,style:{borderRadius:`50%`}}),(0,O.jsx)(wi,{c:`dimmed`,size:`xs`,children:t})]})}function Yk({service:e,onClick:t}){return(0,O.jsxs)(Ka.Tr,{onClick:t,onKeyDown:e=>{(e.key===`Enter`||e.key===` `)&&t()},tabIndex:0,style:{cursor:`pointer`},children:[(0,O.jsx)(Ka.Td,{children:(0,O.jsx)(Di,{color:No(e.health),variant:`light`,tt:`none`,children:e.service})}),(0,O.jsx)(Ka.Td,{children:Po.format(e.spans)}),(0,O.jsx)(Ka.Td,{children:Io(e.p95_ms)}),(0,O.jsx)(Ka.Td,{children:Fo(e.error_rate)})]})}(0,ho.createRoot)(document.getElementById(`root`)).render((0,O.jsx)(w.StrictMode,{children:(0,O.jsx)(Kk,{})})); diff --git a/internal/mcp/apps/performance.html b/internal/mcp/apps/performance.html index 5313ea2a..cf4f138f 100644 --- a/internal/mcp/apps/performance.html +++ b/internal/mcp/apps/performance.html @@ -1,101 +1,88 @@ -Fanout service performance +- "app": Tool callable by the app from this server only`),csp:r6().optional(),permissions:r6().optional()}),Z({mimeTypes:o6(X()).optional().describe('Array of supported MIME types for UI resources.\nMust include `"text/html;profile=mcp-app"` for MCP Apps support.')}),Z({method:Q(`ui/download-file`),params:Z({contents:o6(u6([D9,O9])).describe(`Resource contents to download — embedded (inline data) or linked (host fetches). Uses standard MCP resource types.`)})}),Z({method:Q(`ui/message`),params:Z({role:Q(`user`).describe(`Message role, currently only "user" is supported.`),content:o6(k9).describe(`Message content blocks (text, image, etc.).`)})}),Z({method:Q(`ui/notifications/sandbox-resource-ready`),params:Z({html:X().describe(`HTML content to load into the inner iframe.`),sandbox:X().optional().describe(`Optional override for the inner iframe's sandbox attribute.`),csp:K9.optional().describe(`CSP configuration from resource metadata.`),permissions:q9.optional().describe(`Sandbox permissions from resource metadata.`)})});var lne=Z({method:Q(`ui/notifications/tool-result`),params:M9.describe(`Standard MCP tool execution result.`)}),Y9=Z({toolInfo:Z({id:C7.optional().describe(`JSON-RPC id of the tools/call request.`),tool:A9.describe(`Tool definition including name, inputSchema, etc.`)}).optional().describe(`Metadata of the tool call that instantiated this App.`),theme:Jte.optional().describe(`Current color theme preference.`),styles:rne.optional().describe(`Style configuration for theming the app.`),displayMode:G9.optional().describe(`How the UI is currently displayed.`),availableDisplayModes:o6(G9).optional().describe(`Display modes the host supports.`),containerDimensions:u6([Z({height:H3().describe(`Fixed container height in pixels.`)}),Z({maxHeight:u6([H3(),$3()]).optional().describe(`Maximum container height in pixels.`)})]).and(u6([Z({width:H3().describe(`Fixed container width in pixels.`)}),Z({maxWidth:u6([H3(),$3()]).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:X().optional().describe(`User's language and region preference in BCP 47 format.`),timeZone:X().optional().describe(`User's timezone in IANA format.`),userAgent:X().optional().describe(`Host application identifier.`),platform:u6([Q(`web`),Q(`desktop`),Q(`mobile`)]).optional().describe(`Platform type for responsive design decisions.`),deviceCapabilities:Z({touch:J3().optional().describe(`Whether the device supports touch input.`),hover:J3().optional().describe(`Whether the device supports hover interactions.`)}).optional().describe(`Device input capabilities.`),safeAreaInsets:Z({top:H3().describe(`Top safe area inset in pixels.`),right:H3().describe(`Right safe area inset in pixels.`),bottom:H3().describe(`Bottom safe area inset in pixels.`),left:H3().describe(`Left safe area inset in pixels.`)}).optional().describe(`Mobile safe area boundaries in pixels.`)}).passthrough(),une=Z({method:Q(`ui/notifications/host-context-changed`),params:Y9.describe(`Partial context update containing only changed fields.`)});Z({method:Q(`ui/update-model-context`),params:Z({content:o6(k9).optional().describe(`Context content blocks (text, image, etc.).`),structuredContent:h6(X(),n6().describe(`Structured content for machine-readable context data.`)).optional().describe(`Structured content for machine-readable context data.`)})}),Z({method:Q(`ui/initialize`),params:Z({appInfo:z7.describe(`App identification (name and version).`),appCapabilities:one.describe(`Features and capabilities this app provides.`),protocolVersion:X().describe(`Protocol version this app supports.`)})});var dne=Z({protocolVersion:X().describe(`Negotiated protocol version string (e.g., "2025-11-21").`),hostInfo:z7.describe(`Host application identification and version.`),hostCapabilities:ane.describe(`Features and capabilities provided by the host.`),hostContext:Y9.describe(`Rich context about the host environment.`)}).passthrough(),fne={target:`draft-2020-12`};async function X9(e,t){let n=e[`~standard`];if(n.jsonSchema)return n.jsonSchema[t](fne);if(n.vendor===`zod`){let{z:n}=await Gte(async()=>{let{z:e}=await Promise.resolve().then(()=>(c7(),s7));return{z:e}},void 0,import.meta.url);return n.toJSONSchema(e,{io:t})}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 Z9(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}var pne=class e extends Kte{_appInfo;_capabilities;options;_hostCapabilities;_hostInfo;_hostContext;_registeredTools={};_initializedSent=!1;_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:$te,toolinputpartial:ene,toolresult:lne,toolcancelled:tne,hostcontextchanged:une};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),super.setEventHandler(e,t)}addEventListener(e,t){this._assertHandlerTiming(e),super.addEventListener(e,t)}onEventDispatch(e,t){e===`hostcontextchanged`&&(this._hostContext={...this._hostContext,...t})}constructor(e,t={},n={autoResize:!0}){super(n),this._appInfo=e,this._capabilities=t,this.options=n,n.allowUnsafeEval||zU({jitless:!0}),this.setRequestHandler(Y7,e=>(console.log(`Received ping:`,e.params),{})),this.setEventHandler(`hostcontextchanged`,void 0)}registerCapabilities(e){if(this.transport)throw Error(`Cannot register capabilities after transport is established`);this._capabilities=Hte(this._capabilities,e)}registerTool(e,t,n){if(this._registeredTools[e])throw Error(`Tool ${e} is already registered`);let r=this,i=()=>{r._initializedSent&&r._capabilities.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 Z9(a,t??{},`Invalid input for tool ${e}: `):t??{},r)}else i=await n(r);return o.outputSchema&&!i.isError&&(i.structuredContent=await Z9(o.outputSchema,i.structuredContent,`Invalid output for tool ${e}: `)),i}};return this._registeredTools[e]=o,!this._capabilities.tools&&!this.transport&&this.registerCapabilities({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 X9(t.inputSchema,`input`):{type:`object`,properties:{}}};return t.outputSchema&&(n.outputSchema=await X9(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(ine,(e,t)=>{if(!this._onteardown)throw Error(`No onteardown handler set`);return this._onteardown(e.params,t)})}_oncalltool;get oncalltool(){return this._oncalltool}set oncalltool(e){this.warnIfRequestHandlerReplaced(`oncalltool`,this._oncalltool,e),this._oncalltool=e,this.replaceRequestHandler(N9,(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(j9,(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._capabilities.tools)throw Error(`Client does not support tool capability (required for ${e})`);return;case`ping`:case`ui/resource-teardown`:return;default:throw Error(`No handler for method ${e} registered`)}}assertNotificationCapability(e){}assertTaskCapability(e){throw Error(`Tasks are not supported in MCP Apps`)}assertTaskHandlerCapability(e){throw Error(`Task handlers are not supported in MCP Apps`)}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},M9,{onprogress:()=>{},resetTimeoutOnProgress:!0,...t})}async readServerResource(e,t){return this._assertInitialized(`readServerResource`),await this.request({method:`resources/read`,params:e},C9,t)}async listServerResources(e,t){return this._assertInitialized(`listServerResources`),await this.request({method:`resources/list`,params:e},x9,t)}async createSamplingMessage(e,t){this._assertInitialized(`createSamplingMessage`);let n=e.tools?L9:I9;return await this.request({method:`sampling/createMessage`,params:e},n,t)}sendMessage(e,t){return this._assertInitialized(`sendMessage`),this.request({method:`ui/message`,params:e},Qte,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},P7,t)}openLink(e,t){return this._assertInitialized(`openLink`),this.request({method:`ui/open-link`,params:e},Xte,t)}sendOpenLink=this.openLink;downloadFile(e,t){return this._assertInitialized(`downloadFile`),this.request({method:`ui/download-file`,params:e},Zte,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},sne,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 W9(window.parent,window.parent),t){if(this.transport)throw Error(`App is already connected. Call close() before connecting again.`);this._initializedSent=!1,await super.connect(e);try{let e=await this.request({method:`ui/initialize`,params:{appCapabilities:this._capabilities,appInfo:this._appInfo,protocolVersion:qte}},dne,t);if(e===void 0)throw Error(`Server sent invalid initialize result: ${e}`);this._hostCapabilities=e.hostCapabilities,this._hostInfo=e.hostInfo,this._hostContext=e.hostContext,await this.notification({method:`ui/notifications/initialized`}),this._initializedSent=!0,this.options?.autoResize&&this.setupSizeChangedNotifications()}catch(e){throw this.close(),e}}};function mne({appInfo:e,capabilities:t,onAppCreated:n,autoResize:r=!0,strict:i}){let[a,o]=(0,U.useState)(null),[s,c]=(0,U.useState)(!1),[l,u]=(0,U.useState)(null);return(0,U.useEffect)(()=>{let a=!0,s;async function l(){try{let l=new W9(window.parent,window.parent);if(s=new pne(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 hne(e){let[t,n]=(0,U.useState)(null),[r,i]=(0,U.useState)({}),[a,o]=(0,U.useState)(),[s,c]=(0,U.useState)(null);function l(e){if(e.isError){c(`This view could not be refreshed. Please try again.`);return}c(null),n(e.structuredContent)}let u=mne({appInfo:{name:e,version:`1.0.0`},capabilities:{},onAppCreated:e=>{e.ontoolinput=e=>{i(e.arguments??{})},e.ontoolresult=l,e.onhostcontextchanged=e=>o(t=>({...t,...e})),e.onerror=e=>{console.error(`MCP app error`,e),c(`This view could not be refreshed. Please try again.`)}}});(0,U.useEffect)(()=>{u.app&&o(u.app.getHostContext())},[u.app]);async function d(e){if(u.app)try{l(await u.app.callServerTool({name:e,arguments:r}))}catch(t){console.error(`Tool call ${e} failed`,t),c(`This view could not be refreshed. Please try again.`)}}return{...u,result:t,toolInput:r,host:a,toolError:s,callTool:d}}async function gne(e,t){e&&await e.sendMessage({role:`user`,content:[{type:`text`,text:t}]})}YO([Gb,OA]);function _ne(){let{app:e,callTool:t,error:n,host:r,result:i,toolError:a}=hne(`Fanout service performance`),[o,s]=(0,U.useState)(`activity`),c=r?.theme===`dark`;return(0,W.jsxs)(wL,{dark:c,children:[(0,W.jsx)(TL,{eyebrow:`Trends and latency`,title:i?.data.service||`System performance`,summary:i?`Traffic, latency, and errors ${i.data.service?`for ${i.data.service}`:`across all services`}`:void 0,onRefresh:()=>t(`service_performance`),disabled:!e}),(0,W.jsx)(EL,{error:a??(n?`This view could not be loaded. Please try again.`:null),loading:!i&&!n&&!a?`Loading performance signals…`:void 0}),i&&(0,W.jsxs)(W.Fragment,{children:[(0,W.jsx)(DL,{active:o,onChange:s,items:[{id:`activity`,label:`Activity`},{id:`latency`,label:`Latency map`},{id:`endpoints`,label:`Endpoints`,count:i.data.endpoints.length},{id:`compare`,label:`Compare`}]}),o===`activity`&&(0,W.jsx)(vne,{data:i.data,dark:c,window:i.provenance.window}),o===`latency`&&(0,W.jsx)(yne,{data:i.data,dark:c,window:i.provenance.window}),o===`endpoints`&&(0,W.jsx)(bne,{endpoints:i.data.endpoints,onEndpoint:t=>gne(e,`Investigate ${t.method} ${t.path}. Explain its latency and errors.`)}),o===`compare`&&(0,W.jsx)(xne,{data:i.data}),(0,W.jsx)(kL,{left:fH(i.provenance.window),right:`Updated ${new Date(i.provenance.generated_at).toLocaleTimeString([],{hour:`numeric`,minute:`2-digit`})}`})]})]})}function vne({data:e,dark:t,window:n}){let r=e.points.at(-1);if(!r)return(0,W.jsx)(OL,{tall:!0,icon:(0,W.jsx)(sL,{size:20,weight:`duotone`}),title:`No activity in this window`,children:`Trends will appear as activity is recorded.`});let i=e.points.map(e=>e.time);return(0,W.jsxs)(aI,{px:{base:`md`,sm:`lg`},pb:`md`,children:[(0,W.jsxs)(tI,{cols:{base:1,xs:3},spacing:`sm`,children:[(0,W.jsx)(AL,{label:`Operations`,value:lH.format(r.spans)}),(0,W.jsx)(AL,{label:`P95 latency`,value:dH(r.p95_ms),color:r.p95_ms>=750?`warn`:`ok`}),(0,W.jsx)(AL,{label:`Error rate`,value:uH(r.error_rate),color:r.error_rate>=.01?`bad`:`ok`})]}),(0,W.jsx)(Q9,{dark:t,labels:i,title:`Traffic and logs`,window:n,series:[{name:`Operations`,data:e.points.map(e=>e.spans),color:IL(`operations`,t)},{name:`Logs`,data:e.points.map(e=>e.log_count),color:IL(`logs`,t)}]}),(0,W.jsx)(Q9,{dark:t,labels:i,title:`Latency and error correlation`,window:n,series:[{name:`P95 latency`,data:e.points.map(e=>e.p95_ms),color:FL(t).warn},{name:`Error rate × 1000`,data:e.points.map(e=>e.error_rate*1e3),color:FL(t).bad}]})]})}function Q9({labels:e,title:t,series:n,dark:r,window:i}){let a=(0,U.useMemo)(()=>{let t=PL(r);return{color:n.map(e=>e.color),grid:{left:42,right:18,top:42,bottom:30},legend:{top:5,left:0,textStyle:{color:t.muted,fontSize:10},icon:`circle`,itemWidth:7,itemHeight:7},tooltip:{trigger:`axis`,backgroundColor:t.surface,borderColor:t.border,textStyle:{color:t.text,fontSize:10}},xAxis:{type:`category`,data:e.map(e=>pH(e,i)),boundaryGap:!1,axisLine:{lineStyle:{color:t.border}},axisTick:{show:!1},axisLabel:{color:t.muted,fontSize:9,hideOverlap:!0}},yAxis:{type:`value`,splitLine:{lineStyle:{color:t.grid}},axisLabel:{color:t.muted,fontSize:9}},series:n.map(e=>({name:e.name,type:`line`,data:e.data,smooth:.22,showSymbol:!1,lineStyle:{width:2},areaStyle:{opacity:.045}}))}},[r,e,n,i]);return(0,W.jsxs)(OP,{withBorder:!0,radius:`md`,p:`sm`,children:[(0,W.jsx)(oF,{fw:650,size:`sm`,mb:`xs`,children:t}),(0,W.jsx)(cH,{option:a,height:210,label:t})]})}function yne({data:e,dark:t,window:n}){let r=(0,U.useMemo)(()=>({services:[...new Set(e.heatmap.map(e=>e.service))],times:[...new Set(e.heatmap.map(e=>e.time))],values:new Map(e.heatmap.map(e=>[`${e.service}\u0000${e.time}`,e.p95_ms])),max:Math.max(...e.heatmap.map(e=>e.p95_ms),1)}),[e.heatmap]);if(r.services.length===0)return(0,W.jsx)(OL,{tall:!0,icon:(0,W.jsx)(aL,{size:20,weight:`duotone`}),title:`No latency samples yet`,children:`The heatmap will compare service latency across time buckets.`});let i=PL(t),a={grid:{left:105,right:20,top:20,bottom:45},tooltip:{position:`top`,backgroundColor:i.surface,borderColor:i.border,textStyle:{color:i.text,fontSize:10},formatter:e=>`${r.services[e.data[1]]}
${dH(e.data[2])}`},xAxis:{type:`category`,data:r.times.map(e=>pH(e,n)),splitArea:{show:!0},axisLabel:{color:i.muted,fontSize:9,hideOverlap:!0},axisLine:{lineStyle:{color:i.border}}},yAxis:{type:`category`,data:r.services,splitArea:{show:!0},axisLabel:{color:i.text,fontSize:9},axisLine:{lineStyle:{color:i.border}}},visualMap:{min:0,max:r.max,calculable:!0,orient:`horizontal`,left:`center`,bottom:0,textStyle:{color:i.muted,fontSize:8},inRange:{color:[i.grid,FL(t).warn,FL(t).bad]}},series:[{type:`heatmap`,data:r.services.flatMap((e,t)=>r.times.map((n,i)=>[i,t,r.values.get(`${e}\u0000${n}`)??0]))}]};return(0,W.jsx)(OP,{withBorder:!0,radius:`md`,mx:{base:`md`,sm:`lg`},mb:`md`,p:`xs`,children:(0,W.jsx)(cH,{option:a,height:Math.max(280,r.services.length*32+110),label:`Service P95 latency heatmap`})})}function bne({endpoints:e,onEndpoint:t}){let n=jL(e,8);return e.length===0?(0,W.jsx)(OL,{tall:!0,icon:(0,W.jsx)(tL,{size:20,weight:`duotone`}),title:`No endpoints detected`,children:`HTTP routes and span operations will appear here as traffic arrives.`}):(0,W.jsxs)(W.Fragment,{children:[(0,W.jsx)(wI.ScrollContainer,{minWidth:700,children:(0,W.jsxs)(wI,{striped:!0,highlightOnHover:!0,verticalSpacing:`sm`,children:[(0,W.jsx)(wI.Thead,{children:(0,W.jsxs)(wI.Tr,{children:[(0,W.jsx)(wI.Th,{children:`Endpoint`}),(0,W.jsx)(wI.Th,{children:`Calls`}),(0,W.jsx)(wI.Th,{children:`P50`}),(0,W.jsx)(wI.Th,{children:`P95`}),(0,W.jsx)(wI.Th,{children:`P99`}),(0,W.jsx)(wI.Th,{children:`Errors`})]})}),(0,W.jsx)(wI.Tbody,{children:n.pageItems.map(e=>(0,W.jsxs)(wI.Tr,{tabIndex:0,onClick:()=>t(e),onKeyDown:n=>{(n.key===`Enter`||n.key===` `)&&t(e)},style:{cursor:`pointer`},children:[(0,W.jsxs)(wI.Td,{children:[(0,W.jsx)(lF,{variant:`light`,mr:`xs`,children:e.method}),(0,W.jsx)(oF,{component:`code`,size:`sm`,children:e.path})]}),(0,W.jsx)(wI.Td,{children:lH.format(e.calls)}),(0,W.jsx)(wI.Td,{children:dH(e.p50_ms)}),(0,W.jsx)(wI.Td,{children:dH(e.p95_ms)}),(0,W.jsx)(wI.Td,{children:dH(e.p99_ms)}),(0,W.jsx)(wI.Td,{children:(0,W.jsx)(oF,{c:NL(e.health),children:uH(e.error_rate)})})]},`${e.method}-${e.path}`))})]})}),(0,W.jsx)(ML,{...n,onChange:n.setPage})]})}function xne({data:e}){return e.comparison.length===0?(0,W.jsx)(OL,{tall:!0,icon:(0,W.jsx)(rL,{size:20,weight:`duotone`}),title:`Nothing to compare yet`,children:`Fanout compares the first and second half of the selected window.`}):(0,W.jsx)(wI.ScrollContainer,{minWidth:620,children:(0,W.jsxs)(wI,{striped:!0,verticalSpacing:`sm`,children:[(0,W.jsx)(wI.Thead,{children:(0,W.jsxs)(wI.Tr,{children:[(0,W.jsx)(wI.Th,{children:`Signal`}),(0,W.jsx)(wI.Th,{children:`Earlier`}),(0,W.jsx)(wI.Th,{children:`Change`}),(0,W.jsx)(wI.Th,{children:`Recent`})]})}),(0,W.jsx)(wI.Tbody,{children:e.comparison.map(e=>(0,W.jsxs)(wI.Tr,{children:[(0,W.jsxs)(wI.Td,{children:[(0,W.jsx)(oF,{fw:650,children:e.label}),(0,W.jsx)(oF,{c:`dimmed`,size:`xs`,children:e.unit})]}),(0,W.jsx)(wI.Td,{children:$9(e.before,e.unit)}),(0,W.jsxs)(wI.Td,{children:[(0,W.jsxs)(lF,{color:e.direction===`improvement`?`ok`:e.direction===`regression`?`bad`:`gray`,variant:`light`,children:[e.change_pct>0?`↑`:e.change_pct<0?`↓`:`→`,` `,Math.abs(e.change_pct).toFixed(1),`%`]}),e.significant&&(0,W.jsx)(oF,{c:`dimmed`,size:`xs`,mt:3,children:`notable`})]}),(0,W.jsx)(wI.Td,{children:$9(e.after,e.unit)})]},e.label))})]})})}function $9(e,t){return t===`ms`?dH(e):t===`%`?`${e.toFixed(2)}%`:lH.format(e)}(0,dL.createRoot)(document.getElementById(`root`)).render((0,W.jsx)(U.StrictMode,{children:(0,W.jsx)(_ne,{})}));
diff --git a/internal/mcp/apps/topology.html b/internal/mcp/apps/topology.html index 3bfd78d2..2b6ec455 100644 --- a/internal/mcp/apps/topology.html +++ b/internal/mcp/apps/topology.html @@ -1,103 +1,90 @@ - Service topology +- "app": Tool callable by the app from this server only`),csp:q6().optional(),permissions:q6().optional()}),Z({mimeTypes:X6(X()).optional().describe('Array of supported MIME types for UI resources.\nMust include `"text/html;profile=mcp-app"` for MCP Apps support.')}),Z({method:Q(`ui/download-file`),params:Z({contents:X6(e8([O9,k9])).describe(`Resource contents to download — embedded (inline data) or linked (host fetches). Uses standard MCP resource types.`)})}),Z({method:Q(`ui/message`),params:Z({role:Q(`user`).describe(`Message role, currently only "user" is supported.`),content:X6(A9).describe(`Message content blocks (text, image, etc.).`)})}),Z({method:Q(`ui/notifications/sandbox-resource-ready`),params:Z({html:X().describe(`HTML content to load into the inner iframe.`),sandbox:X().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 Pie=Z({method:Q(`ui/notifications/tool-result`),params:N9.describe(`Standard MCP tool execution result.`)}),X9=Z({toolInfo:Z({id:U7.optional().describe(`JSON-RPC id of the tools/call request.`),tool:j9.describe(`Tool definition including name, inputSchema, etc.`)}).optional().describe(`Metadata of the tool call that instantiated this App.`),theme:yie.optional().describe(`Current color theme preference.`),styles:Oie.optional().describe(`Style configuration for theming the app.`),displayMode:K9.optional().describe(`How the UI is currently displayed.`),availableDisplayModes:X6(K9).optional().describe(`Display modes the host supports.`),containerDimensions:e8([Z({height:M6().describe(`Fixed container height in pixels.`)}),Z({maxHeight:e8([M6(),U6()]).optional().describe(`Maximum container height in pixels.`)})]).and(e8([Z({width:M6().describe(`Fixed container width in pixels.`)}),Z({maxWidth:e8([M6(),U6()]).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:X().optional().describe(`User's language and region preference in BCP 47 format.`),timeZone:X().optional().describe(`User's timezone in IANA format.`),userAgent:X().optional().describe(`Host application identifier.`),platform:e8([Q(`web`),Q(`desktop`),Q(`mobile`)]).optional().describe(`Platform type for responsive design decisions.`),deviceCapabilities:Z({touch:R6().optional().describe(`Whether the device supports touch input.`),hover:R6().optional().describe(`Whether the device supports hover interactions.`)}).optional().describe(`Device input capabilities.`),safeAreaInsets:Z({top:M6().describe(`Top safe area inset in pixels.`),right:M6().describe(`Right safe area inset in pixels.`),bottom:M6().describe(`Bottom safe area inset in pixels.`),left:M6().describe(`Left safe area inset in pixels.`)}).optional().describe(`Mobile safe area boundaries in pixels.`)}).passthrough(),Fie=Z({method:Q(`ui/notifications/host-context-changed`),params:X9.describe(`Partial context update containing only changed fields.`)});Z({method:Q(`ui/update-model-context`),params:Z({content:X6(A9).optional().describe(`Context content blocks (text, image, etc.).`),structuredContent:a8(X(),K6().describe(`Structured content for machine-readable context data.`)).optional().describe(`Structured content for machine-readable context data.`)})}),Z({method:Q(`ui/initialize`),params:Z({appInfo:t9.describe(`App identification (name and version).`),appCapabilities:jie.describe(`Features and capabilities this app provides.`),protocolVersion:X().describe(`Protocol version this app supports.`)})});var Iie=Z({protocolVersion:X().describe(`Negotiated protocol version string (e.g., "2025-11-21").`),hostInfo:t9.describe(`Host application identification and version.`),hostCapabilities:Aie.describe(`Features and capabilities provided by the host.`),hostContext:X9.describe(`Rich context about the host environment.`)}).passthrough(),Lie={target:`draft-2020-12`};async function Z9(e,t){let n=e[`~standard`];if(n.jsonSchema)return n.jsonSchema[t](Lie);if(n.vendor===`zod`){let{z:n}=await gie(async()=>{let{z:e}=await Promise.resolve().then(()=>(j7(),Lne));return{z:e}},void 0,import.meta.url);return n.toJSONSchema(e,{io:t})}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 Q9(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}var Rie=class e extends _ie{_appInfo;_capabilities;options;_hostCapabilities;_hostInfo;_hostContext;_registeredTools={};_initializedSent=!1;_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:wie,toolinputpartial:Tie,toolresult:Pie,toolcancelled:Eie,hostcontextchanged:Fie};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),super.setEventHandler(e,t)}addEventListener(e,t){this._assertHandlerTiming(e),super.addEventListener(e,t)}onEventDispatch(e,t){e===`hostcontextchanged`&&(this._hostContext={...this._hostContext,...t})}constructor(e,t={},n={autoResize:!0}){super(n),this._appInfo=e,this._capabilities=t,this.options=n,n.allowUnsafeEval||jW({jitless:!0}),this.setRequestHandler(n9,e=>(console.log(`Received ping:`,e.params),{})),this.setEventHandler(`hostcontextchanged`,void 0)}registerCapabilities(e){if(this.transport)throw Error(`Cannot register capabilities after transport is established`);this._capabilities=pie(this._capabilities,e)}registerTool(e,t,n){if(this._registeredTools[e])throw Error(`Tool ${e} is already registered`);let r=this,i=()=>{r._initializedSent&&r._capabilities.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 Q9(a,t??{},`Invalid input for tool ${e}: `):t??{},r)}else i=await n(r);return o.outputSchema&&!i.isError&&(i.structuredContent=await Q9(o.outputSchema,i.structuredContent,`Invalid output for tool ${e}: `)),i}};return this._registeredTools[e]=o,!this._capabilities.tools&&!this.transport&&this.registerCapabilities({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 Z9(t.inputSchema,`input`):{type:`object`,properties:{}}};return t.outputSchema&&(n.outputSchema=await Z9(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(kie,(e,t)=>{if(!this._onteardown)throw Error(`No onteardown handler set`);return this._onteardown(e.params,t)})}_oncalltool;get oncalltool(){return this._oncalltool}set oncalltool(e){this.warnIfRequestHandlerReplaced(`oncalltool`,this._oncalltool,e),this._oncalltool=e,this.replaceRequestHandler(P9,(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(M9,(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._capabilities.tools)throw Error(`Client does not support tool capability (required for ${e})`);return;case`ping`:case`ui/resource-teardown`:return;default:throw Error(`No handler for method ${e} registered`)}}assertNotificationCapability(e){}assertTaskCapability(e){throw Error(`Tasks are not supported in MCP Apps`)}assertTaskHandlerCapability(e){throw Error(`Task handlers are not supported in MCP Apps`)}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},N9,{onprogress:()=>{},resetTimeoutOnProgress:!0,...t})}async readServerResource(e,t){return this._assertInitialized(`readServerResource`),await this.request({method:`resources/read`,params:e},w9,t)}async listServerResources(e,t){return this._assertInitialized(`listServerResources`),await this.request({method:`resources/list`,params:e},S9,t)}async createSamplingMessage(e,t){this._assertInitialized(`createSamplingMessage`);let n=e.tools?R9:L9;return await this.request({method:`sampling/createMessage`,params:e},n,t)}sendMessage(e,t){return this._assertInitialized(`sendMessage`),this.request({method:`ui/message`,params:e},Cie,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},Z7,t)}openLink(e,t){return this._assertInitialized(`openLink`),this.request({method:`ui/open-link`,params:e},xie,t)}sendOpenLink=this.openLink;downloadFile(e,t){return this._assertInitialized(`downloadFile`),this.request({method:`ui/download-file`,params:e},Sie,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},Mie,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,await super.connect(e);try{let e=await this.request({method:`ui/initialize`,params:{appCapabilities:this._capabilities,appInfo:this._appInfo,protocolVersion:vie}},Iie,t);if(e===void 0)throw Error(`Server sent invalid initialize result: ${e}`);this._hostCapabilities=e.hostCapabilities,this._hostInfo=e.hostInfo,this._hostContext=e.hostContext,await this.notification({method:`ui/notifications/initialized`}),this._initializedSent=!0,this.options?.autoResize&&this.setupSizeChangedNotifications()}catch(e){throw this.close(),e}}};function zie({appInfo:e,capabilities:t,onAppCreated:n,autoResize:r=!0,strict:i}){let[a,o]=(0,U.useState)(null),[s,c]=(0,U.useState)(!1),[l,u]=(0,U.useState)(null);return(0,U.useEffect)(()=>{let a=!0,s;async function l(){try{let l=new G9(window.parent,window.parent);if(s=new Rie(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 Bie(e){let[t,n]=(0,U.useState)(null),[r,i]=(0,U.useState)({}),[a,o]=(0,U.useState)(),[s,c]=(0,U.useState)(null);function l(e){if(e.isError){c(`This view could not be refreshed. Please try again.`);return}c(null),n(e.structuredContent)}let u=zie({appInfo:{name:e,version:`1.0.0`},capabilities:{},onAppCreated:e=>{e.ontoolinput=e=>{i(e.arguments??{})},e.ontoolresult=l,e.onhostcontextchanged=e=>o(t=>({...t,...e})),e.onerror=e=>{console.error(`MCP app error`,e),c(`This view could not be refreshed. Please try again.`)}}});(0,U.useEffect)(()=>{u.app&&o(u.app.getHostContext())},[u.app]);async function d(e){if(u.app)try{l(await u.app.callServerTool({name:e,arguments:r}))}catch(t){console.error(`Tool call ${e} failed`,t),c(`This view could not be refreshed. Please try again.`)}}return{...u,result:t,toolInput:r,host:a,toolError:s,callTool:d}}async function Vie(e,t){e&&await e.sendMessage({role:`user`,content:[{type:`text`,text:t}]})}ID([Yj,pte,bte]);function Hie(){let{app:e,callTool:t,error:n,host:r,result:i,toolError:a}=Bie(`Fanout service topology`),[o,s]=(0,U.useState)(null),[c,l]=(0,U.useState)(`graph`),u=r?.theme===`dark`;return(0,W.jsxs)(fR,{dark:u,children:[(0,W.jsx)(pR,{eyebrow:`Service map`,title:`Dependencies`,summary:i?`${i.data.nodes.length} services connected by ${i.data.edges.length} routes`:void 0,onRefresh:()=>t(`service_topology`),disabled:!e}),(0,W.jsx)(mR,{error:a??(n?`This view could not be loaded. Please try again.`:null),loading:!i&&!n&&!a?`Loading service relationships…`:void 0}),i&&i.data.nodes.length===0&&(0,W.jsxs)(W.Fragment,{children:[(0,W.jsx)(gR,{tall:!0,icon:(0,W.jsx)(cne,{size:20,weight:`duotone`}),title:`No service relationships yet`,children:`Connections will appear as services communicate.`}),(0,W.jsx)(_R,{left:aU(i.provenance.window),right:`No routes found`})]}),i&&i.data.nodes.length>0&&(0,W.jsxs)(W.Fragment,{children:[(0,W.jsx)(hR,{active:c,onChange:l,items:[{id:`graph`,label:`Graph`},{id:`flow`,label:`Traffic flow`},{id:`matrix`,label:`Matrix`}]}),(0,W.jsx)(Uie,{data:i.data,view:c,selected:o,dark:u,onSelect:s,onInvestigate:t=>Vie(e,`Investigate dependencies and failures around ${t}.`)}),(0,W.jsx)(_R,{left:aU(i.provenance.window),right:`${i.data.nodes.length} services · ${i.data.edges.length} routes`})]})]})}function Uie({data:e,view:t,selected:n,dark:r,onSelect:i,onInvestigate:a}){let o=n?e.edges.filter(e=>e.caller===n||e.callee===n):e.edges;return(0,W.jsxs)(_L,{px:{base:`md`,sm:`lg`},pb:`md`,children:[(0,W.jsxs)(YF,{withBorder:!0,radius:`md`,p:`xs`,pos:`relative`,children:[t===`graph`&&(0,W.jsx)(Wie,{data:e,selected:n,dark:r,onSelect:i}),t===`flow`&&(0,W.jsx)(Gie,{data:e,dark:r,onSelect:i}),t===`matrix`&&(0,W.jsx)(Kie,{data:e,dark:r}),n&&(0,W.jsxs)(zI,{pos:`absolute`,top:`sm`,right:`sm`,size:`xs`,variant:`default`,leftSection:(0,W.jsx)(sne,{size:14,weight:`bold`}),onClick:()=>a(n),children:[`Investigate `,n]})]}),(0,W.jsx)(qie,{edges:o,onSelect:i})]})}function Wie({data:e,selected:t,dark:n,onSelect:r}){let i=(0,U.useMemo)(()=>{let r=bR(n),i=xR(n);return{tooltip:{backgroundColor:r.surface,borderColor:r.border,textStyle:{color:r.text,fontSize:10}},series:[{type:`graph`,layout:`force`,roam:!0,draggable:!0,force:{repulsion:220,edgeLength:[80,150],gravity:.08},label:{show:!0,position:`bottom`,color:r.text,fontSize:10},edgeSymbol:[`none`,`arrow`],edgeSymbolSize:6,data:e.nodes.map(e=>({id:e.service,name:e.service,value:e.spans,symbolSize:Math.min(46,24+Math.log10(Math.max(e.spans,1))*5),itemStyle:{color:r.surface,borderColor:$9(e.health,n),borderWidth:t===e.service?5:3,opacity:t&&t!==e.service?.45:1}})),links:e.edges.map(e=>({source:e.caller,target:e.callee,value:e.calls,lineStyle:{width:Math.min(5,1+Math.log10(Math.max(e.calls,1))),color:e.error_rate>=.05?i.bad:r.muted,opacity:t&&e.caller!==t&&e.callee!==t?.1:.42,curveness:.08}})),emphasis:{focus:`adjacency`,lineStyle:{opacity:.85}}}]}},[n,e,t]);return(0,W.jsx)(tU,{option:i,height:350,label:`Interactive service dependency graph`,onClick:e=>{let t=e;t.dataType===`node`&&t.data?.id&&r(t.data.id)}})}function Gie({data:e,dark:t,onSelect:n}){let r=(0,U.useMemo)(()=>Jie(e.edges),[e.edges]),i=(0,U.useMemo)(()=>{let n=bR(t);return{tooltip:{trigger:`item`,backgroundColor:n.surface,borderColor:n.border,textStyle:{color:n.text,fontSize:10}},series:[{type:`sankey`,left:20,right:30,top:20,bottom:20,nodeWidth:14,nodeGap:12,draggable:!0,emphasis:{focus:`adjacency`},label:{color:n.text,fontSize:10},lineStyle:{color:`gradient`,opacity:.28,curveness:.55},data:e.nodes.map(e=>({name:e.service,itemStyle:{color:$9(e.health,t),borderColor:n.surface,borderWidth:2}})),links:r.map(e=>({source:e.caller,target:e.callee,value:Math.max(e.calls,1)}))}]}},[t,e.nodes,r]);return r.length===0?(0,W.jsx)(gR,{tall:!0,icon:(0,W.jsx)(one,{size:20,weight:`duotone`}),title:`No traffic routes observed`,children:`Services are visible, but this window contains no direct service-to-service calls.`}):(0,W.jsxs)(W.Fragment,{children:[(0,W.jsx)(tU,{option:i,height:350,label:`Primary service traffic flow`,onClick:e=>{let t=e;t.dataType===`node`&&t.name&&n(t.name)}}),(0,W.jsxs)(DI,{c:`dimmed`,size:`xs`,ta:`center`,children:[`Showing `,r.length,` primary routes from `,e.edges.length,` observed connections`]})]})}function Kie({data:e,dark:t}){let n=e.nodes.map(e=>e.service),r=Math.max(...e.edges.map(e=>e.error_rate),.01),i=(0,U.useMemo)(()=>{let i=bR(t),a=xR(t);return{grid:{left:100,right:25,top:15,bottom:80},tooltip:{backgroundColor:i.surface,borderColor:i.border,textStyle:{color:i.text,fontSize:10},formatter:e=>`${n[e.data[1]]} → ${n[e.data[0]]}
${nU.format(e.data[3])} calls · ${iU(e.data[4])}
${rU(e.data[2])} errors`},xAxis:{type:`category`,data:n,splitArea:{show:!0},axisLabel:{color:i.muted,rotate:35,fontSize:9},axisLine:{lineStyle:{color:i.border}}},yAxis:{type:`category`,data:n,splitArea:{show:!0},axisLabel:{color:i.text,fontSize:9},axisLine:{lineStyle:{color:i.border}}},visualMap:{min:0,max:r,calculable:!0,orient:`horizontal`,left:`center`,bottom:8,textStyle:{color:i.muted,fontSize:8},inRange:{color:[i.grid,a.warn,a.bad]}},series:[{type:`heatmap`,data:e.edges.map(e=>[n.indexOf(e.callee),n.indexOf(e.caller),e.error_rate,e.calls,e.average_ms])}]}},[t,e,r,n]);return(0,W.jsx)(tU,{option:i,height:380,label:`Service dependency error matrix`})}function qie({edges:e,onSelect:t}){let n=vR(e,4);return e.length===0?null:(0,W.jsxs)(YF,{withBorder:!0,radius:`md`,style:{overflow:`hidden`},children:[(0,W.jsx)(IL.ScrollContainer,{minWidth:520,children:(0,W.jsxs)(IL,{striped:!0,highlightOnHover:!0,verticalSpacing:`sm`,children:[(0,W.jsx)(IL.Thead,{children:(0,W.jsxs)(IL.Tr,{children:[(0,W.jsx)(IL.Th,{children:`Route`}),(0,W.jsx)(IL.Th,{children:`Calls`}),(0,W.jsx)(IL.Th,{children:`Latency`}),(0,W.jsx)(IL.Th,{children:`Errors`})]})}),(0,W.jsx)(IL.Tbody,{children:n.pageItems.map(e=>(0,W.jsxs)(IL.Tr,{tabIndex:0,onClick:()=>t(e.caller),onKeyDown:n=>{(n.key===`Enter`||n.key===` `)&&t(e.caller)},style:{cursor:`pointer`},children:[(0,W.jsx)(IL.Td,{children:(0,W.jsxs)(DI,{fw:600,size:`sm`,children:[e.caller,` → `,e.callee]})}),(0,W.jsx)(IL.Td,{children:nU.format(e.calls)}),(0,W.jsx)(IL.Td,{children:iU(e.average_ms)}),(0,W.jsx)(IL.Td,{children:rU(e.error_rate)})]},`${e.caller}-${e.callee}-${e.type}`))})]})}),(0,W.jsx)(yR,{...n,onChange:n.setPage})]})}function $9(e,t){let n=xR(t);return e===`unhealthy`?n.bad:e===`degraded`?n.warn:n.ok}function Jie(e){let t=[],n=new Map,r=(e,t,i=new Set)=>{if(e===t)return!0;if(i.has(e))return!1;i.add(e);for(let a of n.get(e)??[])if(r(a,t,i))return!0;return!1};for(let i of[...e].sort((e,t)=>t.calls-e.calls||e.caller.localeCompare(t.caller)||e.callee.localeCompare(t.callee))){if(i.caller===i.callee||r(i.callee,i.caller))continue;let e=n.get(i.caller)??new Set;e.add(i.callee),n.set(i.caller,e),t.push(i)}return t}(0,fne.createRoot)(document.getElementById(`root`)).render((0,W.jsx)(U.StrictMode,{children:(0,W.jsx)(Hie,{})})); diff --git a/internal/mcp/apps/trace.html b/internal/mcp/apps/trace.html index c1a67ce0..f878bb5e 100644 --- a/internal/mcp/apps/trace.html +++ b/internal/mcp/apps/trace.html @@ -1,82 +1,69 @@ -Fanout trace detail +- "app": Tool callable by the app from this server only`),csp:jD().optional(),permissions:jD().optional()}),X({mimeTypes:Y(q()).optional().describe('Array of supported MIME types for UI resources.\nMust include `"text/html;profile=mcp-app"` for MCP Apps support.')}),X({method:Z(`ui/download-file`),params:X({contents:Y(LD([yM,bM])).describe(`Resource contents to download — embedded (inline data) or linked (host fetches). Uses standard MCP resource types.`)})}),X({method:Z(`ui/message`),params:X({role:Z(`user`).describe(`Message role, currently only "user" is supported.`),content:Y(xM).describe(`Message content blocks (text, image, etc.).`)})}),X({method:Z(`ui/notifications/sandbox-resource-ready`),params:X({html:q().describe(`HTML content to load into the inner iframe.`),sandbox:q().optional().describe(`Optional override for the inner iframe's sandbox attribute.`),csp:IN.optional().describe(`CSP configuration from resource metadata.`),permissions:LN.optional().describe(`Sandbox permissions from resource metadata.`)})});var YN=X({method:Z(`ui/notifications/tool-result`),params:AM.describe(`Standard MCP tool execution result.`)}),XN=X({toolInfo:X({id:YA.optional().describe(`JSON-RPC id of the tools/call request.`),tool:DM.describe(`Tool definition including name, inputSchema, etc.`)}).optional().describe(`Metadata of the tool call that instantiated this App.`),theme:AN.optional().describe(`Current color theme preference.`),styles:HN.optional().describe(`Style configuration for theming the app.`),displayMode:jN.optional().describe(`How the UI is currently displayed.`),availableDisplayModes:Y(jN).optional().describe(`Display modes the host supports.`),containerDimensions:LD([X({height:J().describe(`Fixed container height in pixels.`)}),X({maxHeight:LD([J(),DD()]).optional().describe(`Maximum container height in pixels.`)})]).and(LD([X({width:J().describe(`Fixed container width in pixels.`)}),X({maxWidth:LD([J(),DD()]).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:q().optional().describe(`User's language and region preference in BCP 47 format.`),timeZone:q().optional().describe(`User's timezone in IANA format.`),userAgent:q().optional().describe(`Host application identifier.`),platform:LD([Z(`web`),Z(`desktop`),Z(`mobile`)]).optional().describe(`Platform type for responsive design decisions.`),deviceCapabilities:X({touch:SD().optional().describe(`Whether the device supports touch input.`),hover:SD().optional().describe(`Whether the device supports hover interactions.`)}).optional().describe(`Device input capabilities.`),safeAreaInsets:X({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(),ZN=X({method:Z(`ui/notifications/host-context-changed`),params:XN.describe(`Partial context update containing only changed fields.`)});X({method:Z(`ui/update-model-context`),params:X({content:Y(xM).optional().describe(`Context content blocks (text, image, etc.).`),structuredContent:HD(q(),AD().describe(`Structured content for machine-readable context data.`)).optional().describe(`Structured content for machine-readable context data.`)})}),X({method:Z(`ui/initialize`),params:X({appInfo:dj.describe(`App identification (name and version).`),appCapabilities:KN.describe(`Features and capabilities this app provides.`),protocolVersion:q().describe(`Protocol version this app supports.`)})});var QN=X({protocolVersion:q().describe(`Negotiated protocol version string (e.g., "2025-11-21").`),hostInfo:dj.describe(`Host application identification and version.`),hostCapabilities:GN.describe(`Features and capabilities provided by the host.`),hostContext:XN.describe(`Rich context about the host environment.`)}).passthrough(),$N={target:`draft-2020-12`};async function eP(e,t){let n=e[`~standard`];if(n.jsonSchema)return n.jsonSchema[t]($N);if(n.vendor===`zod`){let{z:n}=await EN(async()=>{let{z:e}=await Promise.resolve().then(()=>(PA(),NA));return{z:e}},void 0,import.meta.url);return n.toJSONSchema(e,{io:t})}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 tP(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}var nP=class e extends DN{_appInfo;_capabilities;options;_hostCapabilities;_hostInfo;_hostContext;_registeredTools={};_initializedSent=!1;_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:RN,toolinputpartial:zN,toolresult:YN,toolcancelled:BN,hostcontextchanged:ZN};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),super.setEventHandler(e,t)}addEventListener(e,t){this._assertHandlerTiming(e),super.addEventListener(e,t)}onEventDispatch(e,t){e===`hostcontextchanged`&&(this._hostContext={...this._hostContext,...t})}constructor(e,t={},n={autoResize:!0}){super(n),this._appInfo=e,this._capabilities=t,this.options=n,n.allowUnsafeEval||_f({jitless:!0}),this.setRequestHandler(xj,e=>(console.log(`Received ping:`,e.params),{})),this.setEventHandler(`hostcontextchanged`,void 0)}registerCapabilities(e){if(this.transport)throw Error(`Cannot register capabilities after transport is established`);this._capabilities=SN(this._capabilities,e)}registerTool(e,t,n){if(this._registeredTools[e])throw Error(`Tool ${e} is already registered`);let r=this,i=()=>{r._initializedSent&&r._capabilities.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 tP(a,t??{},`Invalid input for tool ${e}: `):t??{},r)}else i=await n(r);return o.outputSchema&&!i.isError&&(i.structuredContent=await tP(o.outputSchema,i.structuredContent,`Invalid output for tool ${e}: `)),i}};return this._registeredTools[e]=o,!this._capabilities.tools&&!this.transport&&this.registerCapabilities({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 eP(t.inputSchema,`input`):{type:`object`,properties:{}}};return t.outputSchema&&(n.outputSchema=await eP(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(UN,(e,t)=>{if(!this._onteardown)throw Error(`No onteardown handler set`);return this._onteardown(e.params,t)})}_oncalltool;get oncalltool(){return this._oncalltool}set oncalltool(e){this.warnIfRequestHandlerReplaced(`oncalltool`,this._oncalltool,e),this._oncalltool=e,this.replaceRequestHandler(MM,(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(OM,(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._capabilities.tools)throw Error(`Client does not support tool capability (required for ${e})`);return;case`ping`:case`ui/resource-teardown`:return;default:throw Error(`No handler for method ${e} registered`)}}assertNotificationCapability(e){}assertTaskCapability(e){throw Error(`Tasks are not supported in MCP Apps`)}assertTaskHandlerCapability(e){throw Error(`Task handlers are not supported in MCP Apps`)}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},AM,{onprogress:()=>{},resetTimeoutOnProgress:!0,...t})}async readServerResource(e,t){return this._assertInitialized(`readServerResource`),await this.request({method:`resources/read`,params:e},tM,t)}async listServerResources(e,t){return this._assertInitialized(`listServerResources`),await this.request({method:`resources/list`,params:e},Yj,t)}async createSamplingMessage(e,t){this._assertInitialized(`createSamplingMessage`);let n=e.tools?JM:qM;return await this.request({method:`sampling/createMessage`,params:e},n,t)}sendMessage(e,t){return this._assertInitialized(`sendMessage`),this.request({method:`ui/message`,params:e},FN,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},oj,t)}openLink(e,t){return this._assertInitialized(`openLink`),this.request({method:`ui/open-link`,params:e},NN,t)}sendOpenLink=this.openLink;downloadFile(e,t){return this._assertInitialized(`downloadFile`),this.request({method:`ui/download-file`,params:e},PN,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},qN,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 kN(window.parent,window.parent),t){if(this.transport)throw Error(`App is already connected. Call close() before connecting again.`);this._initializedSent=!1,await super.connect(e);try{let e=await this.request({method:`ui/initialize`,params:{appCapabilities:this._capabilities,appInfo:this._appInfo,protocolVersion:ON}},QN,t);if(e===void 0)throw Error(`Server sent invalid initialize result: ${e}`);this._hostCapabilities=e.hostCapabilities,this._hostInfo=e.hostInfo,this._hostContext=e.hostContext,await this.notification({method:`ui/notifications/initialized`}),this._initializedSent=!0,this.options?.autoResize&&this.setupSizeChangedNotifications()}catch(e){throw this.close(),e}}};function rP({appInfo:e,capabilities:t,onAppCreated:n,autoResize:r=!0,strict:i}){let[a,o]=(0,E.useState)(null),[s,c]=(0,E.useState)(!1),[l,u]=(0,E.useState)(null);return(0,E.useEffect)(()=>{let a=!0,s;async function l(){try{let l=new kN(window.parent,window.parent);if(s=new nP(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 iP(e){let[t,n]=(0,E.useState)(null),[r,i]=(0,E.useState)({}),[a,o]=(0,E.useState)(),[s,c]=(0,E.useState)(null);function l(e){if(e.isError){c(`This view could not be refreshed. Please try again.`);return}c(null),n(e.structuredContent)}let u=rP({appInfo:{name:e,version:`1.0.0`},capabilities:{},onAppCreated:e=>{e.ontoolinput=e=>{i(e.arguments??{})},e.ontoolresult=l,e.onhostcontextchanged=e=>o(t=>({...t,...e})),e.onerror=e=>{console.error(`MCP app error`,e),c(`This view could not be refreshed. Please try again.`)}}});(0,E.useEffect)(()=>{u.app&&o(u.app.getHostContext())},[u.app]);async function d(e){if(u.app)try{l(await u.app.callServerTool({name:e,arguments:r}))}catch(t){console.error(`Tool call ${e} failed`,t),c(`This view could not be refreshed. Please try again.`)}}return{...u,result:t,toolInput:r,host:a,toolError:s,callTool:d}}async function aP(e,t){e&&await e.sendMessage({role:`user`,content:[{type:`text`,text:t}]})}function oP(){let{app:e,callTool:t,error:n,host:r,result:i,toolError:a}=iP(`Fanout trace detail`),[o,s]=(0,E.useState)(`waterfall`),c=r?.theme===`dark`;return(0,M.jsxs)(Pu,{dark:c,children:[(0,M.jsx)(Fu,{eyebrow:`Request journey`,title:i?.data.trace_id?`Trace ${dP(i.data.trace_id)}`:`Trace analysis`,summary:i?`${i.data.spans.length} spans across ${i.data.services.length} services`:void 0,onRefresh:()=>t(`trace_detail`),disabled:!e}),(0,M.jsx)(Iu,{error:a??(n?`This view could not be loaded. Please try again.`:null),loading:!i&&!n&&!a?`Finding a representative trace…`:void 0}),i&&i.data.spans.length===0&&(0,M.jsxs)(M.Fragment,{children:[(0,M.jsx)(Ru,{tall:!0,icon:(0,M.jsx)(vu,{size:20,weight:`duotone`}),title:`No traces in this window`,children:`Try a wider time window.`}),(0,M.jsx)(zu,{left:Ku(i.provenance.window),right:`No traces found`})]}),i&&i.data.spans.length>0&&(0,M.jsxs)(M.Fragment,{children:[(0,M.jsxs)(yl,{cols:{base:2,sm:4},spacing:`sm`,px:{base:`md`,sm:`lg`},pb:`md`,children:[(0,M.jsx)(Bu,{label:`Duration`,value:Gu(i.data.duration_ms)}),(0,M.jsx)(Bu,{label:`Spans`,value:Wu.format(i.data.spans.length)}),(0,M.jsx)(Bu,{label:`Services`,value:Wu.format(i.data.services.length)}),(0,M.jsx)(Bu,{label:`Status`,value:i.data.has_error?`Error`:`OK`,color:i.data.has_error?`bad`:`ok`})]}),(0,M.jsx)(Lu,{active:o,onChange:s,items:[{id:`waterfall`,label:`Waterfall`,count:i.data.spans.length},{id:`flame`,label:`Flame graph`},{id:`logs`,label:`Correlated logs`,count:i.data.logs.length}]}),o===`waterfall`&&(0,M.jsx)(sP,{spans:i.data.spans,dark:c,onSpan:t=>aP(e,`Investigate span ${t.span_id} (${t.service} ${t.operation}) in trace ${i.data.trace_id}.`)}),o===`flame`&&(0,M.jsx)(cP,{spans:i.data.spans,dark:c,onSpan:t=>aP(e,`Investigate span ${t.span_id} (${t.service} ${t.operation}) in trace ${i.data.trace_id}.`)}),o===`logs`&&(0,M.jsx)(uP,{entries:i.data.logs}),(0,M.jsx)(zu,{left:Ku(i.provenance.window),right:`Trace ${dP(i.data.trace_id)}`})]})]})}function sP({spans:e,dark:t,onSpan:n}){let r=Math.min(...e.map(e=>new Date(e.start).valueOf())),i=Math.max(...e.map(e=>new Date(e.start).valueOf()+e.duration_ms)),a=Math.max(i-r,1),o=Vu(e,8);return(0,M.jsxs)(M.Fragment,{children:[(0,M.jsx)(I.ScrollContainer,{minWidth:680,children:(0,M.jsxs)(I,{highlightOnHover:!0,verticalSpacing:`sm`,children:[(0,M.jsx)(I.Thead,{children:(0,M.jsxs)(I.Tr,{children:[(0,M.jsx)(I.Th,{w:230,children:`Operation`}),(0,M.jsx)(I.Th,{children:`Timeline`}),(0,M.jsx)(I.Th,{w:90,children:`Duration`})]})}),(0,M.jsx)(I.Tbody,{children:o.pageItems.map(e=>{let i=(new Date(e.start).valueOf()-r)/a*100,o=Math.max(e.duration_ms/a*100,.6),s=e.status.toUpperCase().includes(`ERROR`);return(0,M.jsxs)(I.Tr,{tabIndex:0,onClick:()=>n(e),onKeyDown:t=>{(t.key===`Enter`||t.key===` `)&&n(e)},style:{cursor:`pointer`},children:[(0,M.jsx)(I.Td,{children:(0,M.jsxs)(rc,{gap:`xs`,wrap:`nowrap`,children:[(0,M.jsx)(N,{w:8,h:8,bg:Uu(e.service,t),style:{borderRadius:`50%`,flex:`0 0 auto`}}),(0,M.jsxs)(N,{miw:0,children:[(0,M.jsx)(F,{fw:600,size:`sm`,truncate:!0,children:e.operation}),(0,M.jsx)(F,{c:`dimmed`,size:`xs`,truncate:!0,children:e.service})]})]})}),(0,M.jsx)(I.Td,{children:(0,M.jsx)(ul,{label:`${e.service} · ${e.operation} · ${Gu(e.duration_ms)}`,withArrow:!0,children:(0,M.jsx)(N,{pos:`relative`,h:14,bg:`var(--mantine-color-default-hover)`,style:{borderRadius:`var(--mantine-radius-sm)`},children:(0,M.jsx)(N,{pos:`absolute`,left:`${i}%`,w:`${Math.min(o,100-i)}%`,h:`100%`,bg:s?`bad`:Uu(e.service,t),style:{borderRadius:`var(--mantine-radius-sm)`,minWidth:3}})})})}),(0,M.jsx)(I.Td,{children:(0,M.jsx)(F,{size:`sm`,ff:`monospace`,children:Gu(e.duration_ms)})})]},e.span_id)})})]})}),(0,M.jsx)(Hu,{...o,onChange:o.setPage})]})}function cP({spans:e,dark:t,onSpan:n}){let r=(0,E.useMemo)(()=>lP(e),[e]),i=[...new Set(e.map(e=>e.service))];return(0,M.jsxs)(Cl,{px:{base:`md`,sm:`lg`},pb:`md`,gap:`xs`,children:[(0,M.jsxs)(rc,{justify:`space-between`,children:[(0,M.jsx)(rc,{gap:`md`,children:i.map(e=>(0,M.jsxs)(rc,{gap:5,children:[(0,M.jsx)(N,{w:8,h:8,bg:Uu(e,t),style:{borderRadius:`50%`}}),(0,M.jsx)(F,{c:`dimmed`,size:`xs`,children:e})]},e))}),(0,M.jsx)(pc,{variant:`light`,children:Gu(r.total)})]}),(0,M.jsx)(vs,{withBorder:!0,radius:`md`,p:`sm`,children:(0,M.jsx)(ds,{type:`auto`,offsetScrollbars:!0,children:(0,M.jsxs)(N,{miw:760,children:[(0,M.jsx)(N,{pos:`relative`,h:22,mb:4,children:[0,25,50,75,100].map(e=>(0,M.jsx)(F,{pos:`absolute`,left:`${e}%`,c:`dimmed`,size:`xs`,style:{transform:e===100?`translateX(-100%)`:e?`translateX(-50%)`:void 0},children:Gu(r.total*e/100)},e))}),(0,M.jsxs)(N,{pos:`relative`,h:Math.max(150,r.laneCount*36+12),bg:`var(--mantine-color-default-hover)`,style:{overflow:`hidden`,borderRadius:`var(--mantine-radius-md)`},children:[[0,25,50,75,100].map(e=>(0,M.jsx)(N,{pos:`absolute`,left:`${e}%`,top:0,bottom:0,style:{borderLeft:`1px solid var(--mantine-color-default-border)`}},e)),r.frames.map(({span:e,lane:r,left:i,width:a})=>{let o=e.status.toUpperCase().includes(`ERROR`),s=a<7;return(0,M.jsx)(ul,{label:`${e.service} · ${e.operation} · ${Gu(e.duration_ms)}`,withArrow:!0,children:(0,M.jsx)(Sc,{variant:`filled`,color:o?`bad`:Uu(e.service,t),pos:`absolute`,left:`${i}%`,top:r*36+6,w:`${Math.max(a,.35)}%`,h:30,px:s?2:`xs`,size:`compact-xs`,onClick:()=>n(e),style:{overflow:`hidden`,minWidth:3},children:(0,M.jsxs)(F,{component:`span`,size:`xs`,fw:700,truncate:!0,children:[s?``:e.operation,a>=12?` · ${Gu(e.duration_ms)}`:``]})})},e.span_id)})]})]})})}),(0,M.jsx)(F,{c:`dimmed`,size:`xs`,children:`Width represents wall-clock duration; lanes preserve span hierarchy without overlap.`})]})}function lP(e){let t=Math.min(...e.map(e=>new Date(e.start).valueOf())),n=Math.max(...e.map(e=>new Date(e.start).valueOf()+e.duration_ms)),r=Math.max(n-t,1),i=new Map(e.map(e=>[e.span_id,e])),a=(e,t=new Set)=>{if(!e.parent_span_id||t.has(e.span_id))return 0;let n=i.get(e.parent_span_id);return n?(t.add(e.span_id),1+a(n,t)):0},o=e.map(e=>{let n=new Date(e.start).valueOf();return{span:e,depth:a(e),start:n,end:n+e.duration_ms,left:(n-t)/r*100,width:e.duration_ms/r*100}}).sort((e,t)=>e.depth-t.depth||e.start-t.start||t.span.duration_ms-e.span.duration_ms),s=[],c=0;for(let e of[...new Set(o.map(e=>e.depth))].sort((e,t)=>e-t)){let t=[];for(let n of o.filter(t=>t.depth===e)){let e=t.findIndex(e=>e<=n.start);e===-1&&(e=t.length),t[e]=n.end,s.push({...n,lane:c+e})}c+=Math.max(t.length,1)}return{frames:s,laneCount:c,total:r}}function uP({entries:e}){let t=Vu(e,6);return e.length===0?(0,M.jsx)(Ru,{tall:!0,icon:(0,M.jsx)(gu,{size:20,weight:`duotone`}),title:`No correlated logs`,children:`No logs in this window carry the selected trace ID.`}):(0,M.jsxs)(M.Fragment,{children:[(0,M.jsx)(I.ScrollContainer,{minWidth:620,children:(0,M.jsxs)(I,{striped:!0,verticalSpacing:`xs`,children:[(0,M.jsx)(I.Thead,{children:(0,M.jsxs)(I.Tr,{children:[(0,M.jsx)(I.Th,{children:`Time`}),(0,M.jsx)(I.Th,{children:`Level`}),(0,M.jsx)(I.Th,{children:`Service`}),(0,M.jsx)(I.Th,{children:`Message`})]})}),(0,M.jsx)(I.Tbody,{children:t.pageItems.map((e,n)=>(0,M.jsxs)(I.Tr,{children:[(0,M.jsx)(I.Td,{children:(0,M.jsx)(F,{size:`xs`,ff:`monospace`,children:new Date(e.time).toLocaleTimeString([],{hour:`numeric`,minute:`2-digit`,second:`2-digit`})})}),(0,M.jsx)(I.Td,{children:(0,M.jsx)(pc,{size:`sm`,color:fP(e.severity),variant:`light`,children:e.severity||`LOG`})}),(0,M.jsx)(I.Td,{children:(0,M.jsx)(F,{fw:600,size:`sm`,children:e.service})}),(0,M.jsx)(I.Td,{children:(0,M.jsx)(F,{size:`sm`,lineClamp:2,title:e.body,children:e.body})})]},`${e.time}-${t.from+n}`))})]})}),(0,M.jsx)(Hu,{...t,onChange:t.setPage})]})}function dP(e){return e.length>12?`${e.slice(0,8)}…${e.slice(-4)}`:e}function fP(e){let t=e.toUpperCase();return t===`ERROR`||t===`FATAL`?`bad`:t===`WARN`||t===`WARNING`?`warn`:t===`INFO`?`info`:`gray`}(0,Su.createRoot)(document.getElementById(`root`)).render((0,M.jsx)(E.StrictMode,{children:(0,M.jsx)(oP,{})}));
diff --git a/internal/ui/dist/assets/auth-TmbGk91l.js b/internal/ui/dist/assets/auth-DhIxmh_D.js similarity index 92% rename from internal/ui/dist/assets/auth-TmbGk91l.js rename to internal/ui/dist/assets/auth-DhIxmh_D.js index a89fed73..254a4c15 100644 --- a/internal/ui/dist/assets/auth-TmbGk91l.js +++ b/internal/ui/dist/assets/auth-DhIxmh_D.js @@ -1 +1 @@ -import{a as e,d as t,g as n,n as r,u as i}from"./useNavigate-BEpS2iE5.js";var a=t((e=>{var t=i();function n(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=a()})),s=n(i(),1),c=e();function l(e){return Object.keys(e)}function u(e){return e&&typeof e==`object`&&!Array.isArray(e)}function d(e,t){let n={...e},r=t;return u(e)&&u(t)&&Object.keys(t).forEach(t=>{u(r[t])&&t in e?n[t]=d(n[t],r[t]):n[t]=r[t]}),n}function f(e){return e.replace(/[A-Z]/g,e=>`-${e.toLowerCase()}`)}function p(e){return e===`0rem`?`0rem`:`calc(${e} * var(--mantine-scale))`}function m(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?p(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?p(n):n}}return r}return n}var h=m(`rem`,{shouldScale:!0}),g=m(`em`);function _(e){return Object.keys(e).reduce((t,n)=>(e[n]!==void 0&&(t[n]=e[n]),t),{})}function v(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 y(e,t=`size`,n=!0){if(e!==void 0)return v(e)?n?h(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){return typeof t==`boolean`?t:typeof window<`u`&&`matchMedia`in window&&window.matchMedia(e).matches}function D(e,t,{getInitialValueInEffect:n}={getInitialValueInEffect:!0}){let[r,i]=(0,s.useState)(n?t:E(e));return(0,s.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 O=typeof document<`u`?s.useLayoutEffect:s.useEffect;function k(e,t){let n=(0,s.useRef)(!1);(0,s.useEffect)(()=>()=>{n.current=!1},[]),(0,s.useEffect)(()=>{if(n.current)return e();n.current=!0},t)}function ee(e){let[t,n]=(0,s.useState)(`mantine-${(0,s.useId)().replace(/:/g,``)}`),r=(0,s.useRef)(!1);return O(()=>{r.current||(r.current=!0,n(T()))},[]),typeof e==`string`?e:t}function te(e,t){return D(`(prefers-reduced-motion: reduce)`,e,t)}function A(e){return e}function j(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 ne((Array.isArray(t)?t:[t]).map(t=>typeof t==`function`?t(e,n,r):t||N))}function re({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 ie(e,t){return typeof e.primaryShade==`number`?e.primaryShade:t===`dark`?e.primaryShade.dark:e.primaryShade.light}function ae(e){return/^#?([0-9A-F]{3}){1,2}([0-9A-F]{2})?$/i.test(e)}function oe(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 F(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 I(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 ae(e)?oe(e):e.startsWith(`rgb`)?F(e):e.startsWith(`hsl`)?I(e):{r:0,g:0,b:0,a:1}}function se(e){return e<=.03928?e/12.92:((e+.055)/1.055)**2.4}function ce(e){let t=e.match(/oklch\((.*?)%\s/);return t?parseFloat(t[1]):null}function le(e){if(e.startsWith(`oklch(`))return(ce(e)||0)/100;let{r:t,g:n,b:r}=L(e),i=t/255,a=n/255,o=r/255,s=se(i),c=se(a),l=se(o);return .2126*s+.7152*c+.0722*l}function ue(e,t=.179){return!e.startsWith(`var(`)&&le(e)>t}function R({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:ue(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:ue(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:ue(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][ie(t,n||`light`)]:t.colors[r][a];return{color:r,value:e,shade:a,isThemeColor:o,isLight:ue(e,t.luminanceThreshold),variable:i?`--mantine-color-${r}-${a}`:`--mantine-color-${r}-filled`}}return{color:e,value:e,isThemeColor:o,isLight:ue(e,t.luminanceThreshold),shade:a,variable:void 0}}function z(e,t){let n=R({color:e||t.primaryColor,theme:t});return n.variable?`var(${n.variable})`:e}function de(e){return!!e&&typeof e==`object`&&`mantine-virtual-color`in e}function B(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 fe(e,t){let n={from:e?.from||t.defaultGradient.from,to:e?.to||t.defaultGradient.to,deg:e?.deg??t.defaultGradient.deg??0},r=z(n.from,t),i=z(n.to,t);return`linear-gradient(${n.deg}deg, ${r} 0%, ${i} 100%)`}function V(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 pe=V,me=({color:e,theme:t,variant:n,gradient:r,autoContrast:i})=>{let a=R({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&&de(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:`${h(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:`${h(1)} solid transparent`}:{background:e,hover:B(e,.1),color:r,border:`${h(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:`${h(1)} solid transparent`};let n=t.colors[a.color][a.shade];return{background:n,hover:B(n,.1),color:`var(--mantine-color-${a.color}-light-color)`,border:`${h(1)} solid transparent`}}return{background:V(e,.1),hover:V(e,.12),color:e,border:`${h(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:`${h(1)} solid var(--mantine-color-${e}-outline)`}:{background:`transparent`,hover:V(t.colors[a.color][a.shade],.05),color:`var(--mantine-color-${a.color}-${a.shade})`,border:`${h(1)} solid var(--mantine-color-${a.color}-${a.shade})`}:{background:`transparent`,hover:V(e,.05),color:e,border:`${h(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:`${h(1)} solid transparent`};let n=t.colors[a.color][a.shade];return{background:`transparent`,hover:V(n,.12),color:`var(--mantine-color-${a.color}-${Math.min(a.shade,6)})`,border:`${h(1)} solid transparent`}}return{background:`transparent`,hover:V(e,.12),color:e,border:`${h(1)} solid transparent`}}return n===`transparent`?a.isThemeColor?a.shade===void 0?{background:`transparent`,hover:`transparent`,color:`var(--mantine-color-${e}-light-color)`,border:`${h(1)} solid transparent`}:{background:`transparent`,hover:`transparent`,color:`var(--mantine-color-${a.color}-${Math.min(a.shade,6)})`,border:`${h(1)} solid transparent`}:{background:`transparent`,hover:`transparent`,color:e,border:`${h(1)} solid transparent`}:n===`white`?a.isThemeColor?a.shade===void 0?{background:`var(--mantine-color-white)`,hover:B(t.white,.01),color:`var(--mantine-color-${e}-filled)`,border:`${h(1)} solid transparent`}:{background:`var(--mantine-color-white)`,hover:B(t.white,.01),color:`var(--mantine-color-${a.color}-${a.shade})`,border:`${h(1)} solid transparent`}:{background:`var(--mantine-color-white)`,hover:B(t.white,.01),color:e,border:`${h(1)} solid transparent`}:n===`gradient`?{background:fe(r,t),hover:fe(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:`${h(1)} solid var(--mantine-color-default-border)`}:{}},he=(0,s.createContext)(null);function H(){let e=(0,s.use)(he);if(!e)throw Error(`[@mantine/core] MantineProvider was not found in tree`);return e}function ge(){return H().cssVariablesResolver}function _e(){return H().classNamesPrefix}function ve(){return H().getStyleNonce}function ye(){return H().withStaticClasses}function be(){return H().headless}function xe(){return H().stylesTransform?.sx}function Se(){return H().stylesTransform?.styles}function Ce(){return H().env||`default`}function we(){return H().deduplicateInlineStyles}var Te={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`]},Ee=`-apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Helvetica, Arial, sans-serif, Apple Color Emoji, Segoe UI Emoji`,De={scale:1,fontSmoothing:!0,focusRing:`auto`,white:`#fff`,black:`#000`,colors:Te,primaryShade:{light:6,dark:8},primaryColor:`blue`,variantColorResolver:me,autoContrast:!1,luminanceThreshold:.3,fontFamily:Ee,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:Ee,fontWeight:`700`,textWrap:`wrap`,sizes:{h1:{fontSize:h(34),lineHeight:`1.3`},h2:{fontSize:h(26),lineHeight:`1.35`},h3:{fontSize:h(22),lineHeight:`1.4`},h4:{fontSize:h(18),lineHeight:`1.45`},h5:{fontSize:h(16),lineHeight:`1.5`},h6:{fontSize:h(14),lineHeight:`1.5`}}},fontSizes:{xs:h(12),sm:h(14),md:h(16),lg:h(18),xl:h(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:h(2),sm:h(4),md:h(8),lg:h(16),xl:h(32)},spacing:{xs:h(10),sm:h(12),md:h(16),lg:h(20),xl:h(32)},breakpoints:{xs:`36em`,sm:`48em`,md:`62em`,lg:`75em`,xl:`88em`},shadows:{xs:`0 ${h(1)} ${h(3)} rgba(0, 0, 0, 0.05), 0 ${h(1)} ${h(2)} rgba(0, 0, 0, 0.1)`,sm:`0 ${h(1)} ${h(3)} rgba(0, 0, 0, 0.05), rgba(0, 0, 0, 0.05) 0 ${h(10)} ${h(15)} ${h(-5)}, rgba(0, 0, 0, 0.04) 0 ${h(7)} ${h(7)} ${h(-5)}`,md:`0 ${h(1)} ${h(3)} rgba(0, 0, 0, 0.05), rgba(0, 0, 0, 0.05) 0 ${h(20)} ${h(25)} ${h(-5)}, rgba(0, 0, 0, 0.04) 0 ${h(10)} ${h(10)} ${h(-5)}`,lg:`0 ${h(1)} ${h(3)} rgba(0, 0, 0, 0.05), rgba(0, 0, 0, 0.05) 0 ${h(28)} ${h(23)} ${h(-7)}, rgba(0, 0, 0, 0.04) 0 ${h(12)} ${h(12)} ${h(-7)}`,xl:`0 ${h(1)} ${h(3)} rgba(0, 0, 0, 0.05), rgba(0, 0, 0, 0.05) 0 ${h(36)} ${h(28)} ${h(-7)}, rgba(0, 0, 0, 0.04) 0 ${h(17)} ${h(17)} ${h(-7)}`},other:{},components:{}},Oe=`[@mantine/core] MantineProvider: Invalid theme.primaryColor, it accepts only key of theme.colors, learn more – https://mantine.dev/theming/colors/#primary-color`,ke=`[@mantine/core] MantineProvider: Invalid theme.primaryShade, it accepts only 0-9 integers or an object { light: 0-9, dark: 0-9 }`;function Ae(e){return e<0||e>9?!1:parseInt(e.toString(),10)===e}function je(e){if(!(e.primaryColor in e.colors))throw Error(Oe);if(typeof e.primaryShade==`object`&&(!Ae(e.primaryShade.dark)||!Ae(e.primaryShade.light))||typeof e.primaryShade==`number`&&!Ae(e.primaryShade))throw Error(ke)}function Me(e,t){if(!t)return je(e),e;let n=d(e,t);return t.fontFamily&&!t.headings?.fontFamily&&(n.headings={...n.headings,fontFamily:t.fontFamily}),je(n),n}var Ne=(0,s.createContext)(null),Pe=()=>(0,s.use)(Ne)||De;function Fe(){let e=(0,s.use)(Ne);if(!e)throw Error(`@mantine/core: MantineProvider was not found in component tree, make sure you have it in your app`);return e}function Ie({theme:e,children:t,inherit:n=!0}){let r=Pe(),i=(0,s.useMemo)(()=>Me(n?r:De,e),[e,r,n]);return(0,c.jsx)(Ne,{value:i,children:t})}Ie.displayName=`@mantine/core/MantineThemeProvider`;function U(e,t,n){let r=Fe(),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,..._(n)}}var Le=n(o(),1);function Re({classNames:e,styles:t,props:n,stylesCtx:r}){let i=Fe();return{resolvedClassNames:e===void 0?void 0:P({theme:i,classNames:e,props:n,stylesCtx:r||void 0}),resolvedStyles:t===void 0?void 0:re({theme:i,styles:t,props:n,stylesCtx:r||void 0})}}var ze={always:`mantine-focus-always`,auto:`mantine-focus-auto`,never:`mantine-focus-never`};function Be({theme:e,options:t,unstyled:n}){return M(t?.focusable&&!n&&(e.focusClassName||ze[e.focusRing]),t?.active&&!n&&e.activeClassName)}function Ve({selector:e,stylesCtx:t,options:n,props:r,theme:i}){return P({theme:i,classNames:n?.classNames,props:n?.props||r,stylesCtx:t})[e]}function He({selector:e,stylesCtx:t,theme:n,classNames:r,props:i}){return P({theme:n,classNames:r,props:i,stylesCtx:t})[e]}function Ue({rootSelector:e,selector:t,className:n}){return e===t?n:void 0}function We({selector:e,classes:t,unstyled:n}){return n?void 0:t[e]}function Ge({themeName:e,classNamesPrefix:t,selector:n,withStaticClass:r}){return r===!1?[]:e.map(e=>`${t}-${e}-${n}`)}function Ke({options:e,classes:t,selector:n,unstyled:r}){return e?.variant&&!r?t[`${n}--${e.variant}`]:void 0}function qe({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(Be({theme:e,options:t,unstyled:c||m}),o.map(e=>e[r]),Ke({options:t,classes:s,selector:r,unstyled:c||m}),a[r],He({selector:r,stylesCtx:f,theme:e,classNames:h,props:d}),Ve({selector:r,stylesCtx:f,options:t,props:d,theme:e}),Ue({rootSelector:u,selector:r,className:l}),We({selector:r,classes:s,unstyled:c||m}),p&&!m&&Ge({themeName:n,classNamesPrefix:i,selector:r,withStaticClass:t?.withStaticClass}),t?.className)}function Je({style:e,theme:t}){return Array.isArray(e)?e.reduce((e,n)=>({...e,...Je({style:n,theme:t})}),{}):typeof e==`function`?e(t):e??{}}function Ye({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&&re({theme:e,styles:n?.styles,props:n?.props||r,stylesCtx:i})[t],...l[t],...a===t?u:null,...Je({style:n?.style,theme:e})}}function Xe(e){return e.reduce((e,t)=>(t&&Object.keys(t).forEach(n=>{e[n]={...e[n],..._(t[n])}}),e),{})}function Ze({props:e,stylesCtx:t,themeName:n,theme:r}){let i=Se()?.();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 W({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}){let p=Fe(),m=_e(),h=ye(),g=be(),_=(Array.isArray(e)?e:[e]).filter(e=>e),{withStylesTransform:v,getTransformedStyles:y}=Ze({props:n,stylesCtx:r,themeName:_,theme:p}),b=P({theme:p,classNames:c,props:n,stylesCtx:r}),x=_.map(e=>P({theme:p,classNames:p.components[e]?.classNames,props:n,stylesCtx:r})),S=v?{}:re({theme:p,styles:l,props:n,stylesCtx:r}),C={};if(!v)for(let e of _){let t=re({theme:p,styles:p.components[e]?.styles,props:n,stylesCtx:r});for(let e of Object.keys(t))C[e]={...C[e],...t[e]}}let w=Xe([g?{}:d?.(p,n,r),..._.map(e=>p.components?.[e]?.vars?.(p,n,r)),u?.(p,n,r)]),T=Je({style:a,theme:p});return(e,a)=>({...f?.[e],className:qe({theme:p,options:a,themeName:_,selector:e,classNamesPrefix:m,resolvedClassNames:b,resolvedThemeClassNames:x,classes:t,unstyled:s,className:i,rootSelector:o,props:n,stylesCtx:r,withStaticClasses:h,headless:g,transformedStyles:y([a?.styles,l])}),style:Ye({theme:p,selector:e,options:a,props:n,stylesCtx:r,rootSelector:o,withStylesTransform:v,resolvedStyles:S,resolvedThemeStyles:C,resolvedVars:w,resolvedRootStyle:T})})}function Qe(e){return l(e).reduce((t,n)=>e[n]===void 0?t:`${t}${f(n)}:${e[n]};`,``).trim()}function $e({selector:e,styles:t,media:n,container:r}){let i=t?Qe(t):``,a=Array.isArray(n)?n.map(t=>`@media${t.query}{${e}{${Qe(t.styles)}}}`):[],o=Array.isArray(r)?r.map(t=>`@container ${t.query}{${e}{${Qe(t.styles)}}}`):[];return`${i?`${e}{${i}}`:``}${a.join(``)}${o.join(``)}`.trim()}function et(e){let t=5381;for(let n=0;n>>0).toString(36)}function tt({deduplicate:e,...t}){let n=ve(),r=$e(t);return e?(0,c.jsx)(`style`,{href:`mantine-${et(r)}`,precedence:`mantine`,nonce:n?.(),children:r}):(0,c.jsx)(`style`,{"data-mantine-styles":`inline`,nonce:n?.(),dangerouslySetInnerHTML:{__html:r}})}function nt(e){let t=5381;for(let n=0;n>>0).toString(36)}function rt(e,t){return`__mdi__-${nt(`${e?Qe(e):``}|${Array.isArray(t)?t.map(e=>`${e.query}:${Qe(e.styles)}`).join(`|`):``}`)}`}function it(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:g,pl:v,pr:y,pe:b,ps:x,pis:S,pie:C,bd:w,bdrs:T,bg:E,c:D,opacity:O,ff:k,fz:ee,fw:te,lts:A,ta:j,lh:M,fs:N,tt:ne,td:P,w:re,miw:ie,maw:ae,h:oe,mih:F,mah:I,bgsz:L,bgp:se,bgr:ce,bga:le,pos:ue,top:R,left:z,bottom:de,right:B,inset:fe,display:V,flex:pe,hiddenFrom:me,visibleFrom:he,lightHidden:H,darkHidden:ge,sx:_e,...ve}=e;return{styleProps:_({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:g,pl:v,pr:y,pis:S,pie:C,pe:b,ps:x,bd:w,bg:E,c:D,opacity:O,ff:k,fz:ee,fw:te,lts:A,ta:j,lh:M,fs:N,tt:ne,td:P,w:re,miw:ie,maw:ae,h:oe,mih:F,mah:I,bgsz:L,bgp:se,bgr:ce,bga:le,pos:ue,top:R,left:z,bottom:de,right:B,inset:fe,display:V,flex:pe,bdrs:T,hiddenFrom:me,visibleFrom:he,lightHidden:H,darkHidden:ge,sx:_e}),rest:ve}}var at={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 ot(e,t){let n=R({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 st(e,t){let n=R({color:e,theme:t});return n.isThemeColor&&n.shade===void 0?`var(--mantine-color-${n.color}-text)`:ot(e,t)}function ct(e,t){if(typeof e==`number`)return h(e);if(typeof e==`string`){let[n,r,...i]=e.split(` `).filter(e=>e.trim()!==``),a=`${h(n)}`;return r&&(a+=` ${r}`),i.length>0&&(a+=` ${ot(i.join(` `),t)}`),a.trim()}return e}var lt={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 ut(e){return typeof e==`string`&&e in lt?lt[e]:e}var dt=[`h1`,`h2`,`h3`,`h4`,`h5`,`h6`];function ft(e,t){return typeof e==`string`&&e in t.fontSizes?`var(--mantine-font-size-${e})`:typeof e==`string`&&dt.includes(e)?`var(--mantine-${e}-font-size)`:typeof e==`number`||typeof e==`string`?h(e):e}function pt(e){return e}var mt=[`h1`,`h2`,`h3`,`h4`,`h5`,`h6`];function ht(e,t){return typeof e==`string`&&e in t.lineHeights?`var(--mantine-line-height-${e})`:typeof e==`string`&&mt.includes(e)?`var(--mantine-${e}-line-height)`:e}function gt(e,t){return typeof e==`string`&&e in t.radius?`var(--mantine-radius-${e})`:typeof e==`number`||typeof e==`string`?h(e):e}function _t(e){return typeof e==`number`?h(e):e}function vt(e,t){if(typeof e==`number`)return h(e);if(typeof e==`string`){let n=e.replace(`-`,``);if(!(n in t.spacing))return h(e);let r=`--mantine-spacing-${n}`;return e.startsWith(`-`)?`calc(var(${r}) * -1)`:`var(${r})`}return e}var yt={color:ot,textColor:st,fontSize:ft,spacing:vt,radius:gt,identity:pt,size:_t,lineHeight:ht,fontFamily:ut,border:ct};function bt(e){return e.replace(`(min-width: `,``).replace(`em)`,``)}function xt({media:e,...t}){let n=Object.keys(e).sort((e,t)=>Number(bt(e))-Number(bt(t))).map(t=>({query:t,styles:e[t]}));return{...t,media:n}}function St(e){if(typeof e!=`object`||!e)return!1;let t=Object.keys(e);return t.length!==1||t[0]!==`base`}function Ct(e){return typeof e==`object`&&e?`base`in e?e.base:void 0:e}function wt(e){return typeof e==`object`&&e?l(e).filter(e=>e!==`base`):[]}function Tt(e,t){return typeof e==`object`&&e&&t in e?e[t]:e}function Et({styleProps:e,data:t,theme:n}){return xt(l(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=Ct(e[i]);if(!St(e[i]))return o.forEach(e=>{r.inlineStyles[e]=yt[a.type](s,n)}),r;r.hasResponsiveStyles=!0;let c=wt(e[i]);return o.forEach(t=>{s!=null&&(r.styles[t]=yt[a.type](s,n)),c.forEach(o=>{let s=`(min-width: ${n.breakpoints[o]})`;r.media[s]={...r.media[s],[t]:yt[a.type](Tt(e[i],o),n)}})}),r},{hasResponsiveStyles:!1,styles:{},inlineStyles:{},media:{}}))}function Dt(){return`__m__-${(0,s.useId)().replace(/[:«»]/g,``)}`}function Ot(e){return e}var kt=Ot;function At(e){return e}function G(e){let t=e;return t.extend=At,t.withProps=e=>{let n=n=>(0,c.jsx)(t,{...e,...n});return n.extend=t.extend,n.displayName=`WithProps(${t.displayName})`,n},t}function jt(e){return G(e)}function K(e){let t=e;return t.withProps=e=>{let n=n=>(0,c.jsx)(t,{...e,...n});return n.extend=t.extend,n.displayName=`WithProps(${t.displayName})`,n},t.extend=At,t}function Mt(e){return`data-${(e.startsWith(`data-`)?e.slice(5):e).replace(/([a-z])([A-Z])/g,`$1-$2`).toLowerCase()}`}function Nt(e){return Object.keys(e).reduce((t,n)=>{let r=e[n];return r===void 0||r===``||r===!1||r===null||(t[Mt(n)]=e[n]),t},{})}function Pt(e){return e?typeof e==`string`?{[Mt(e)]:!0}:Array.isArray(e)?[...e].reduce((e,t)=>({...e,...Pt(t)}),{}):Nt(e):null}function Ft(e,t){return Array.isArray(e)?[...e].reduce((e,n)=>({...e,...Ft(n,t)}),{}):typeof e==`function`?e(t):e??{}}function It({theme:e,style:t,vars:n,styleProps:r}){let i=Ft(t,e),a=Ft(n,e);return{...i,...a,...r}}function Lt({component:e,style:t,__vars:n,className:r,variant:i,mod:a,size:o,hiddenFrom:s,visibleFrom:l,lightHidden:u,darkHidden:d,renderRoot:f,__size:p,ref:m,...h}){let g=Fe(),_=e||`div`,{styleProps:y,rest:b}=it(h),x=xe()?.()?.(y.sx),S=Dt(),C=Et({styleProps:y,theme:g,data:at}),w=we(),T=w&&C.hasResponsiveStyles?rt(C.styles,C.media):S,E={ref:m,style:It({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-${s}`]:s,[`mantine-visible-from-${l}`]:l}),"data-variant":i,"data-size":v(o)?void 0:o||void 0,size:p,...Pt(a),...b};return(0,c.jsxs)(c.Fragment,{children:[C.hasResponsiveStyles&&(0,c.jsx)(tt,{selector:`.${T}`,styles:C.styles,media:C.media,deduplicate:w}),typeof f==`function`?f(E):(0,c.jsx)(_,{...E})]})}Lt.displayName=`@mantine/core/Box`;var q=kt(Lt),Rt={root:`m_87cf2631`},zt={__staticSelector:`UnstyledButton`},Bt=K(e=>{let t=U(`UnstyledButton`,zt,e),{className:n,component:r=`button`,__staticSelector:i,unstyled:a,classNames:o,styles:s,style:l,attributes:u,...d}=t;return(0,c.jsx)(q,{...W({name:i,props:t,classes:Rt,className:n,style:l,classNames:o,styles:s,unstyled:a,attributes:u})(`root`,{focusable:!0}),component:r,type:r===`button`?`button`:void 0,...d})});Bt.classes=Rt,Bt.displayName=`@mantine/core/UnstyledButton`;var Vt={root:`m_1b7284a3`},Ht=A((e,{radius:t,shadow:n})=>({root:{"--paper-radius":t===void 0?void 0:x(t),"--paper-shadow":w(n)}})),Ut=K(e=>{let t=U(`Paper`,null,e),{classNames:n,className:r,style:i,styles:a,unstyled:o,withBorder:s,vars:l,radius:u,shadow:d,variant:f,mod:p,attributes:m,...h}=t,g=W({name:`Paper`,props:t,classes:Vt,className:r,style:i,classNames:n,styles:a,unstyled:o,attributes:m,vars:l,varsResolver:Ht});return(0,c.jsx)(q,{mod:[{"data-with-border":s},p],...g(`root`),variant:f,...h})});Ut.classes=Vt,Ut.varsResolver=Ht,Ut.displayName=`@mantine/core/Paper`;var Wt=e=>({in:{opacity:1,transform:`scale(1)`},out:{opacity:0,transform:`scale(.9) translateY(${e===`bottom`?10:-10}px)`},transitionProperty:`transform, opacity`}),Gt={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:{...Wt(`bottom`),common:{transformOrigin:`center center`}},"pop-bottom-left":{...Wt(`bottom`),common:{transformOrigin:`bottom left`}},"pop-bottom-right":{...Wt(`bottom`),common:{transformOrigin:`bottom right`}},"pop-top-left":{...Wt(`top`),common:{transformOrigin:`top left`}},"pop-top-right":{...Wt(`top`),common:{transformOrigin:`top right`}}},Kt={entering:`in`,entered:`in`,exiting:`out`,exited:`out`,"pre-exiting":`out`,"pre-entering":`out`};function qt({transition:e,state:t,duration:n,timingFunction:r}){let i={WebkitBackfaceVisibility:`hidden`,transitionDuration:`${n}ms`,transitionTimingFunction:r};return typeof e==`string`?e in Gt?{transitionProperty:Gt[e].transitionProperty,...i,...Gt[e].common,...Gt[e][Kt[t]]}:{}:{transitionProperty:e.transitionProperty,...i,...e.common,...e[Kt[t]]}}function Jt({duration:e,exitDuration:t,timingFunction:n,mounted:r,onEnter:i,onExit:a,onEntered:o,onExited:c,enterDelay:l,exitDelay:u}){let d=Fe(),f=te(),p=d.respectReducedMotion?f:!1,[m,h]=(0,s.useState)(p?0:e),[g,_]=(0,s.useState)(r?`entered`:`exited`),v=(0,s.useRef)(-1),y=(0,s.useRef)(-1),b=(0,s.useRef)(-1);function x(){window.clearTimeout(v.current),window.clearTimeout(y.current),cancelAnimationFrame(b.current)}let S=n=>{x();let r=n?i:a,s=n?o:c,l=p?0:n?e:t;h(l),l===0?(typeof r==`function`&&r(),typeof s==`function`&&s(),_(n?`entered`:`exited`)):b.current=requestAnimationFrame(()=>{Le.flushSync(()=>{_(n?`pre-entering`:`pre-exiting`)}),b.current=requestAnimationFrame(()=>{typeof r==`function`&&r(),_(n?`entering`:`exiting`),v.current=window.setTimeout(()=>{typeof s==`function`&&s(),_(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 k(()=>{C(r)},[r]),(0,s.useEffect)(()=>()=>{x()},[]),{transitionDuration:m,transitionStatus:g,transitionTimingFunction:n||`ease`}}function Yt({keepMounted:e,keepMountedMode:t=`activity`,transition:n=`fade`,duration:r=250,exitDuration:i=r,mounted:a,children:o,timingFunction:l=`ease`,onExit:u,onEntered:d,onEnter:f,onExited:p,enterDelay:m,exitDelay:h}){let g=Ce(),{transitionDuration:_,transitionStatus:v,transitionTimingFunction:y}=Jt({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,c.jsx)(c.Fragment,{children:o({})}):e?o({display:`none`}):null;if(_===0)return e?t===`display-none`?a?(0,c.jsx)(c.Fragment,{children:o({})}):o({display:`none`}):(0,c.jsx)(s.Activity,{mode:a?`visible`:`hidden`,children:o({})}):a?(0,c.jsx)(c.Fragment,{children:o({})}):null;let b=v===`exited`;if(e){let e=o(b?t===`display-none`?{display:`none`}:{}:qt({transition:n,duration:_,state:v,timingFunction:y}));return t===`display-none`?e:(0,c.jsx)(s.Activity,{mode:b?`hidden`:`visible`,children:e})}return b?null:(0,c.jsx)(c.Fragment,{children:o(qt({transition:n,duration:_,state:v,timingFunction:y}))})}Yt.displayName=`@mantine/core/Transition`;var J={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`},Xt=({className:e,...t})=>(0,c.jsxs)(q,{component:`span`,className:M(J.barsLoader,e),...t,children:[(0,c.jsx)(`span`,{className:J.bar}),(0,c.jsx)(`span`,{className:J.bar}),(0,c.jsx)(`span`,{className:J.bar})]});Xt.displayName=`@mantine/core/Bars`;var Zt=({className:e,...t})=>(0,c.jsxs)(q,{component:`span`,className:M(J.dotsLoader,e),...t,children:[(0,c.jsx)(`span`,{className:J.dot}),(0,c.jsx)(`span`,{className:J.dot}),(0,c.jsx)(`span`,{className:J.dot})]});Zt.displayName=`@mantine/core/Dots`;var Qt=({className:e,...t})=>(0,c.jsx)(q,{component:`span`,className:M(J.ovalLoader,e),...t});Qt.displayName=`@mantine/core/Oval`;var $t={bars:Xt,oval:Qt,dots:Zt},en={loaders:$t,type:`oval`},tn=A((e,{size:t,color:n})=>({root:{"--loader-size":y(t,`loader-size`),"--loader-color":n?z(n,e):void 0}})),nn=G(e=>{let t=U(`Loader`,en,e),{size:n,color:r,type:i,vars:a,className:o,style:s,classNames:l,styles:u,unstyled:d,loaders:f,variant:p,children:m,attributes:h,...g}=t,_=W({name:`Loader`,props:t,classes:J,className:o,style:s,classNames:l,styles:u,unstyled:d,attributes:h,vars:a,varsResolver:tn});return m?(0,c.jsx)(q,{..._(`root`),...g,children:m}):(0,c.jsx)(q,{..._(`root`),component:f[i],variant:p,size:n,...g})});nn.defaultLoaders=$t,nn.classes=J,nn.varsResolver=tn,nn.displayName=`@mantine/core/Loader`;function rn({size:e=`var(--cb-icon-size, 70%)`,style:t,...n}){return(0,c.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,c.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`})})}rn.displayName=`@mantine/core/CloseIcon`;var an={root:`m_86a44da5`,"root--subtle":`m_220c80f2`},on={variant:`subtle`},sn=A((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":h(r)}})),cn=K(e=>{let t=U(`CloseButton`,on,e),{iconSize:n,children:r,vars:i,radius:a,className:o,classNames:s,style:l,styles:u,unstyled:d,"data-disabled":f,disabled:p,variant:m,icon:h,mod:g,attributes:_,__staticSelector:v,...y}=t,b=W({name:v||`CloseButton`,props:t,className:o,style:l,classes:an,classNames:s,styles:u,unstyled:d,attributes:_,vars:i,varsResolver:sn});return(0,c.jsxs)(Bt,{...y,unstyled:d,variant:m,disabled:p,mod:[{disabled:p||f},g],...b(`root`,{variant:m,active:!p&&!f}),children:[h||(0,c.jsx)(rn,{}),r]})});cn.classes=an,cn.varsResolver=sn,cn.displayName=`@mantine/core/CloseButton`;function ln(e){return s.Children.toArray(e).filter(Boolean)}var un={root:`m_4081bf90`},dn={preventGrowOverflow:!0,gap:`md`,align:`center`,justify:`flex-start`,wrap:`wrap`},fn=A((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}})),pn=G(e=>{let t=U(`Group`,dn,e),{classNames:n,className:r,style:i,styles:a,unstyled:o,children:s,gap:l,align:u,justify:d,wrap:f,grow:p,preventGrowOverflow:m,vars:h,variant:g,__size:_,mod:v,attributes:y,...x}=t,S=ln(s),C=S.length,w=b(l??`md`);return(0,c.jsx)(q,{...W({name:`Group`,props:t,stylesCtx:{childWidth:`calc(${100/C}% - (${w} - ${w} / ${C}))`},className:r,style:i,classes:un,classNames:n,styles:a,unstyled:o,attributes:y,vars:h,varsResolver:fn})(`root`),variant:g,mod:[{grow:p},v],size:_,...x,children:S})});pn.classes=un,pn.varsResolver=fn,pn.displayName=`@mantine/core/Group`;var mn=(0,s.createContext)({size:`sm`}),hn=G(e=>{let t=U(`InputClearButton`,null,e),{size:n,variant:r,vars:i,classNames:a,styles:o,...l}=t,u=(0,s.use)(mn),{resolvedClassNames:d,resolvedStyles:f}=Re({classNames:a,styles:o,props:t});return(0,c.jsx)(cn,{variant:r||`transparent`,size:n||u?.size||`sm`,classNames:d,styles:f,__staticSelector:`InputClearButton`,style:{pointerEvents:`all`,background:`var(--input-bg)`,...l.style},...l})});hn.displayName=`@mantine/core/InputClearButton`;var gn={xs:7,sm:8,md:10,lg:12,xl:15};function _n({__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,c.jsxs)(`div`,{"data-combined-clear-section":!0,style:{display:`flex`,gap:2,alignItems:`center`,paddingInlineEnd:gn[i]},children:[o,n||r]}):n===null?null:n||o||r}var vn=(0,s.createContext)({offsetBottom:!1,offsetTop:!1,describedBy:void 0,getStyles:null,inputId:void 0,labelId:void 0}),Y={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`},yn=A((e,{size:t})=>({description:{"--input-description-size":t===void 0?void 0:`calc(${S(t)} - ${h(2)})`}})),bn=G(e=>{let t=U(`InputDescription`,null,e),{classNames:n,className:r,style:i,styles:a,unstyled:o,vars:l,__staticSelector:u,__inheritStyles:d=!0,attributes:f,...p}=U(`InputDescription`,null,t),m=(0,s.use)(vn),h=W({name:[`InputWrapper`,u],props:t,classes:Y,className:r,style:i,classNames:n,styles:a,unstyled:o,attributes:f,rootSelector:`description`,vars:l,varsResolver:yn});return(0,c.jsx)(q,{component:`p`,...(d&&m?.getStyles||h)(`description`,m?.getStyles?{className:r,style:i}:void 0),...p})});bn.classes=Y,bn.varsResolver=yn,bn.displayName=`@mantine/core/InputDescription`;var xn=A((e,{size:t})=>({error:{"--input-error-size":t===void 0?void 0:`calc(${S(t)} - ${h(2)})`}})),Sn=G(e=>{let t=U(`InputError`,null,e),{classNames:n,className:r,style:i,styles:a,unstyled:o,vars:l,attributes:u,__staticSelector:d,__inheritStyles:f=!0,...p}=t,m=W({name:[`InputWrapper`,d],props:t,classes:Y,className:r,style:i,classNames:n,styles:a,unstyled:o,attributes:u,rootSelector:`error`,vars:l,varsResolver:xn}),h=(0,s.use)(vn);return(0,c.jsx)(q,{component:`p`,...(f&&h?.getStyles||m)(`error`,h?.getStyles?{className:r,style:i}:void 0),...p})});Sn.classes=Y,Sn.varsResolver=xn,Sn.displayName=`@mantine/core/InputError`;var Cn={labelElement:`label`},wn=A((e,{size:t})=>({label:{"--input-label-size":S(t),"--input-asterisk-color":void 0}})),Tn=G(e=>{let t=U(`InputLabel`,Cn,e),{classNames:n,className:r,style:i,styles:a,unstyled:o,vars:l,labelElement:u,required:d,htmlFor:f,onMouseDown:p,children:m,__staticSelector:h,mod:g,attributes:_,...v}=t,y=W({name:[`InputWrapper`,h],props:t,classes:Y,className:r,style:i,classNames:n,styles:a,unstyled:o,attributes:_,rootSelector:`label`,vars:l,varsResolver:wn}),b=(0,s.use)(vn),x=b?.getStyles||y,S=v.component||u,C=typeof S!=`string`||S===`label`;return(0,c.jsxs)(q,{...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,c.jsx)(`span`,{...x(`required`),"aria-hidden":!0,children:` *`})]})});Tn.classes=Y,Tn.varsResolver=wn,Tn.displayName=`@mantine/core/InputLabel`;var En=G(e=>{let t=U(`InputPlaceholder`,null,e),{classNames:n,className:r,style:i,styles:a,unstyled:o,vars:s,__staticSelector:l,error:u,mod:d,attributes:f,...p}=t;return(0,c.jsx)(q,{...W({name:[`InputPlaceholder`,l],props:t,classes:Y,className:r,style:i,classNames:n,styles:a,unstyled:o,attributes:f,rootSelector:`placeholder`})(`placeholder`),mod:[{error:!!u},d],component:`span`,...p})});En.classes=Y,En.displayName=`@mantine/core/InputPlaceholder`;var Dn=A((e,{size:t})=>({success:{"--input-success-size":t===void 0?void 0:`calc(${S(t)} - ${h(2)})`}})),On=G(e=>{let t=U(`InputSuccess`,null,e),{classNames:n,className:r,style:i,styles:a,unstyled:o,vars:l,attributes:u,__staticSelector:d,__inheritStyles:f=!0,...p}=t,m=W({name:[`InputWrapper`,d],props:t,classes:Y,className:r,style:i,classNames:n,styles:a,unstyled:o,attributes:u,rootSelector:`success`,vars:l,varsResolver:Dn}),h=(0,s.use)(vn);return(0,c.jsx)(q,{component:`p`,...(f&&h?.getStyles||m)(`success`,h?.getStyles?{className:r,style:i}:void 0),...p})});On.classes=Y,On.varsResolver=Dn,On.displayName=`@mantine/core/InputSuccess`;function kn(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 An={labelElement:`label`,inputContainer:e=>e,inputWrapperOrder:[`label`,`description`,`input`,`error`]},jn=A((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)} - ${h(2)})`},success:{"--input-success-size":t===void 0?void 0:`calc(${S(t)} - ${h(2)})`},description:{"--input-description-size":t===void 0?void 0:`calc(${S(t)} - ${h(2)})`}})),Mn=G(e=>{let t=U(`InputWrapper`,An,e),{classNames:n,className:r,style:i,styles:a,unstyled:o,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:D,__stylesApiProps:O,mod:k,attributes:te,...A}=t,j=W({name:[`InputWrapper`,f],props:O||t,classes:Y,className:r,style:i,classNames:n,styles:a,unstyled:o,attributes:te,vars:l,varsResolver:jn}),M={size:u,variant:d,__staticSelector:f},N=ee(E),ne=typeof T==`boolean`?T:D,P=x?.id||`${N}-error`,re=S?.id||`${N}-success`,ie=b?.id||`${N}-description`,ae=N,oe=!!g&&typeof g!=`boolean`,F=!!_&&typeof _!=`boolean`&&!g,I=!!v,L=oe&&m.includes(`error`),se=F&&m.includes(`error`),ce=I&&m.includes(`description`),le=`${L?P:``} ${se?re:``} ${ce?ie:``}`,ue=le.trim().length>0?le.trim():void 0,R=y?.id||`${N}-label`,z=h&&(0,c.jsx)(Tn,{labelElement:C,id:R,htmlFor:ae,required:ne,...M,...y,children:h},`label`),de=I&&(0,c.jsx)(bn,{...b,...M,size:b?.size||M.size,id:b?.id||ie,children:v},`description`),B=(0,c.jsx)(s.Fragment,{children:p(w)},`input`),fe=oe&&(0,s.createElement)(Sn,{...x,...M,size:x?.size||M.size,key:`error`,id:x?.id||P},g),V=F&&(0,s.createElement)(On,{...S,...M,size:S?.size||M.size,key:`success`,id:S?.id||re},_),pe=m.map(e=>{switch(e){case`label`:return z;case`input`:return B;case`description`:return de;case`error`:return fe||V;default:return null}});return(0,c.jsx)(vn,{value:{getStyles:j,describedBy:ue,inputId:ae,labelId:R,...kn(m,{hasDescription:I,hasError:oe||F})},children:(0,c.jsx)(q,{variant:d,size:u,mod:[{error:!!g,success:!!_&&!g},k],id:C===`label`?void 0:E,...j(`root`),...A,children:pe})})});Mn.classes=Y,Mn.varsResolver=jn,Mn.displayName=`@mantine/core/InputWrapper`;var Nn={variant:`default`,leftSectionPointerEvents:`none`,rightSectionPointerEvents:`none`,withAria:!0,withErrorStyles:!0,withSuccessStyles:!0,size:`sm`,loading:!1,loadingPosition:`right`},Pn=A((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:h(t.leftSectionWidth),"--input-right-section-width":t.rightSectionWidth===void 0?void 0:h(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}})),X=K(e=>{let t=U(`Input`,Nn,e),{classNames:n,className:r,style:i,styles:a,unstyled:o,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:D,multiline:O,radius:k,id:ee,withAria:te,withErrorStyles:A,withSuccessStyles:j,mod:M,inputSize:N,attributes:ne,__clearSection:P,__clearable:re,__clearSectionMode:ie,__defaultRightSection:ae,loading:oe,loadingPosition:F,__bottomSection:I,__bottomSectionProps:L,rootRef:se,dir:ce,...le}=t,{styleProps:ue,rest:R}=it(le),z=(0,s.use)(vn),de={offsetBottom:z?.offsetBottom,offsetTop:z?.offsetTop},B=W({name:[`Input`,u],props:d||t,classes:Y,className:r,style:i,classNames:n,styles:a,unstyled:o,attributes:ne,stylesCtx:de,rootSelector:`wrapper`,vars:E,varsResolver:Pn}),fe=te?{required:l,disabled:g,"aria-invalid":m?!0:void 0,"aria-describedby":z?.describedBy,id:z?.inputId||ee}:{},V=oe?(0,c.jsx)(nn,{size:F===`left`?`calc(var(--input-left-section-size) / 2)`:`calc(var(--input-right-section-size) / 2)`}):null,pe=oe&&F===`left`?V:_,me=_n({__clearable:re,__clearSection:P,rightSection:oe&&F===`right`?V:b,__defaultRightSection:ae,size:f,__clearSectionMode:ie});return(0,c.jsx)(mn,{value:{size:f||`sm`},children:(0,c.jsxs)(q,{ref:se,dir:ce,...B(`wrapper`),...ue,...p,mod:[{error:!!m&&A,success:!!h&&!m&&j,pointer:D,disabled:g,multiline:O,"data-with-right-section":!!me,"data-with-left-section":!!pe,"data-with-bottom-section":!!I},M],variant:T,size:f,children:[pe&&(0,c.jsx)(`div`,{...v,"data-position":`left`,...B(`section`,{className:v?.className,style:v?.style}),children:pe}),(0,c.jsx)(q,{component:`input`,...R,...fe,required:l,mod:{disabled:g,error:!!m&&A,success:!!h&&!m&&j},variant:T,__size:N,...B(`input`)}),I&&(0,c.jsx)(`div`,{...L,...B(`bottomSection`,{className:L?.className,style:L?.style}),children:I}),me&&(0,c.jsx)(`div`,{...x,"data-position":`right`,...B(`section`,{className:x?.className,style:x?.style}),children:me})]})})});X.classes=Y,X.varsResolver=Pn,X.Wrapper=Mn,X.Label=Tn,X.Error=Sn,X.Success=On,X.Description=bn,X.Placeholder=En,X.ClearButton=hn,X.displayName=`@mantine/core/Input`;function Fn(e,t,n){let r=U([`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:D,mod:O,attributes:k,...ee}=r,{styleProps:te,rest:A}=it(ee),j={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:O,attributes:k,...y};return{...A,classNames:l,styles:u,unstyled:f,wrapperProps:{...j,...te},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:k}}}var In={__staticSelector:`InputBase`,withAria:!0,size:`sm`},Ln=K(e=>{let{inputProps:t,wrapperProps:n,...r}=Fn(`InputBase`,In,e);return(0,c.jsx)(X.Wrapper,{...n,children:(0,c.jsx)(X,{...t,...r})})});Ln.classes={...X.classes,...X.Wrapper.classes},Ln.displayName=`@mantine/core/InputBase`;var Rn={root:`m_66836ed3`,wrapper:`m_a5d60502`,body:`m_667c2793`,title:`m_6a03f287`,label:`m_698f4f23`,icon:`m_667f2a6a`,message:`m_7fa78076`,closeButton:`m_87f54839`},zn=A((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}}}),Bn=G(e=>{let t=U(`Alert`,null,e),{classNames:n,className:r,style:i,styles:a,unstyled:o,vars:s,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=W({name:`Alert`,classes:Rn,props:t,className:r,style:i,classNames:n,styles:a,unstyled:o,attributes:x,vars:s,varsResolver:zn}),w=ee(p),T=d&&`${w}-title`||void 0,E=`${w}-body`;return(0,c.jsx)(q,{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,c.jsxs)(`div`,{...C(`wrapper`),children:[m&&(0,c.jsx)(`div`,{...C(`icon`),children:m}),(0,c.jsxs)(`div`,{...C(`body`),children:[d&&(0,c.jsx)(`div`,{...C(`title`),"data-with-close-button":h||void 0,children:(0,c.jsx)(`span`,{id:T,...C(`label`),children:d})}),f&&(0,c.jsx)(`div`,{id:E,...C(`message`),"data-variant":v,children:f})]}),h&&(0,c.jsx)(cn,{...C(`closeButton`),onClick:g,variant:`transparent`,size:16,iconSize:16,"aria-label":_,unstyled:o})]})})});Bn.classes=Rn,Bn.varsResolver=zn,Bn.displayName=`@mantine/core/Alert`;var Vn={root:`m_b6d8b162`};function Hn(e){if(e===`start`)return`start`;if(e===`end`||e)return`end`}var Un={inherit:!1},Wn=A((e,{variant:t,lineClamp:n,gradient:r,size:i,textWrap:a})=>({root:{"--text-fz":S(i),"--text-lh":C(i),"--text-gradient":t===`gradient`?fe(r,e):void 0,"--text-line-clamp":typeof n==`number`?n.toString():void 0,"--text-text-wrap":a}})),Z=K(e=>{let t=U(`Text`,Un,e),{lineClamp:n,truncate:r,inline:i,inherit:a,gradient:o,span:s,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;return(0,c.jsx)(q,{...W({name:[`Text`,u],props:t,classes:Vn,className:f,style:p,classNames:m,styles:h,unstyled:g,attributes:b,vars:d,varsResolver:Wn})(`root`,{focusable:!0}),component:s?`span`:`p`,variant:_,mod:[{"data-truncate":Hn(r),"data-line-clamp":typeof n==`number`,"data-inline":i,"data-inherit":a},v],size:y,...x})});Z.classes=Vn,Z.varsResolver=Wn,Z.displayName=`@mantine/core/Text`;var Gn={root:`m_77c9d27d`,inner:`m_80f1301b`,label:`m_811560b9`,section:`m_a74036a`,loader:`m_a25b86ee`,group:`m_80d6d844`,groupSection:`m_70be2a01`},Kn={orientation:`horizontal`},qn=A((e,{borderWidth:t})=>({group:{"--button-border-width":h(t)}})),Jn=G(e=>{let t=U(`ButtonGroup`,Kn,e),{className:n,style:r,classNames:i,styles:a,unstyled:o,orientation:s,vars:l,borderWidth:u,mod:d,attributes:f,...p}=U(`ButtonGroup`,Kn,e);return(0,c.jsx)(q,{...W({name:`ButtonGroup`,props:t,classes:Gn,className:n,style:r,classNames:i,styles:a,unstyled:o,attributes:f,vars:l,varsResolver:qn,rootSelector:`group`})(`group`),mod:[{"data-orientation":s},d],role:`group`,...p})});Jn.classes=Gn,Jn.varsResolver=qn,Jn.displayName=`@mantine/core/ButtonGroup`;var Yn=A((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}}}),Xn=G(e=>{let t=U(`ButtonGroupSection`,null,e),{className:n,style:r,classNames:i,styles:a,unstyled:o,vars:s,gradient:l,radius:u,autoContrast:d,attributes:f,...p}=t;return(0,c.jsx)(q,{...W({name:`ButtonGroupSection`,props:t,classes:Gn,className:n,style:r,classNames:i,styles:a,unstyled:o,attributes:f,vars:s,varsResolver:Yn,rootSelector:`groupSection`})(`groupSection`),...p})});Xn.classes=Gn,Xn.varsResolver=Yn,Xn.displayName=`@mantine/core/ButtonGroupSection`;var Zn={in:{opacity:1,transform:`translate(-50%, calc(-50% + ${h(1)}))`},out:{opacity:0,transform:`translate(-50%, -200%)`},common:{transformOrigin:`center`},transitionProperty:`transform, opacity`},Qn=A((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}}}),Q=K(e=>{let t=U(`Button`,null,e),{style:n,vars:r,className:i,color:a,disabled:o,children:s,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=W({name:`Button`,props:t,classes:Gn,className:i,style:n,classNames:_,styles:v,unstyled:y,attributes:C,vars:r,varsResolver:Qn}),E=!!l,D=!!u;return(0,c.jsxs)(Bt,{...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":D},S],...w,children:[typeof m==`boolean`&&(0,c.jsx)(Yt,{mounted:m,transition:Zn,duration:150,children:e=>(0,c.jsx)(q,{component:`span`,...T(`loader`,{style:e}),"aria-hidden":!0,children:(0,c.jsx)(nn,{color:`var(--button-color)`,size:`calc(var(--button-height) / 1.8)`,...h})})}),(0,c.jsxs)(`span`,{...T(`inner`),children:[l&&(0,c.jsx)(q,{component:`span`,...T(`section`),mod:{position:`left`},children:l}),(0,c.jsx)(q,{component:`span`,mod:{loading:m},...T(`label`),children:s}),u&&(0,c.jsx)(q,{component:`span`,...T(`section`),mod:{position:`right`},children:u})]})]})});Q.classes=Gn,Q.varsResolver=Qn,Q.displayName=`@mantine/core/Button`,Q.Group=Jn,Q.GroupSection=Xn;var $n={root:`m_4451eb3a`},er=K(e=>{let t=U(`Center`,null,e),{classNames:n,className:r,style:i,styles:a,unstyled:o,vars:s,inline:l,mod:u,attributes:d,...f}=t,p=W({name:`Center`,props:t,classes:$n,className:r,style:i,classNames:n,styles:a,unstyled:o,attributes:d,vars:s});return(0,c.jsx)(q,{mod:[{inline:l},u],...p(`root`),...f})});er.classes=$n,er.displayName=`@mantine/core/Center`;var tr={root:`m_b183c0a2`},nr=A((e,{color:t})=>({root:{"--code-bg":t?z(t,e):void 0}})),rr=G(e=>{let t=U(`Code`,null,e),{classNames:n,className:r,style:i,styles:a,unstyled:o,vars:s,color:l,block:u,mod:d,attributes:f,...p}=t,m=W({name:`Code`,props:t,classes:tr,className:r,style:i,classNames:n,styles:a,unstyled:o,attributes:f,vars:s,varsResolver:nr});return(0,c.jsx)(q,{component:u?`pre`:`code`,mod:[{block:u},d],...m(`root`),...p,dir:`ltr`})});rr.classes=tr,rr.varsResolver=nr,rr.displayName=`@mantine/core/Code`;var ir={root:`m_7485cace`},ar={strategy:`block`},or=A((e,{size:t,fluid:n})=>({root:{"--container-size":n?void 0:y(t,`container-size`)}})),sr=G(e=>{let t=U(`Container`,ar,e),{classNames:n,className:r,style:i,styles:a,unstyled:o,vars:s,fluid:l,mod:u,attributes:d,strategy:f,...p}=t,m=W({name:`Container`,classes:ir,props:t,className:r,style:i,classNames:n,styles:a,unstyled:o,attributes:d,vars:s,varsResolver:or});return(0,c.jsx)(q,{mod:[{fluid:l,strategy:f},u],...m(`root`),...p})});sr.classes=ir,sr.varsResolver=or,sr.displayName=`@mantine/core/Container`;var cr={root:`m_6d731127`},lr={gap:`md`,align:`stretch`,justify:`flex-start`},ur=A((e,{gap:t,align:n,justify:r})=>({root:{"--stack-gap":b(t),"--stack-align":n,"--stack-justify":r}})),$=G(e=>{let t=U(`Stack`,lr,e),{classNames:n,className:r,style:i,styles:a,unstyled:o,vars:s,align:l,justify:u,gap:d,variant:f,attributes:p,...m}=t;return(0,c.jsx)(q,{...W({name:`Stack`,props:t,classes:cr,className:r,style:i,classNames:n,styles:a,unstyled:o,attributes:p,vars:s,varsResolver:ur})(`root`),variant:f,...m})});$.classes=cr,$.varsResolver=ur,$.displayName=`@mantine/core/Stack`;var dr=G(e=>(0,c.jsx)(Ln,{component:`input`,...U([`Input`,`InputWrapper`,`TextInput`],null,e),__staticSelector:`TextInput`}));dr.classes=Ln.classes,dr.displayName=`@mantine/core/TextInput`;var fr={root:`m_7341320d`},pr=A((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}}}),mr=G(e=>{let t=U(`ThemeIcon`,null,e),{classNames:n,className:r,style:i,styles:a,unstyled:o,vars:s,autoContrast:l,attributes:u,...d}=t;return(0,c.jsx)(q,{...W({name:`ThemeIcon`,classes:fr,props:t,className:r,style:i,classNames:n,styles:a,unstyled:o,attributes:u,vars:s,varsResolver:pr})(`root`),...d})});mr.classes=fr,mr.varsResolver=pr,mr.displayName=`@mantine/core/ThemeIcon`;var hr=[`h1`,`h2`,`h3`,`h4`,`h5`,`h6`],gr=[`xs`,`sm`,`md`,`lg`,`xl`];function _r(e,t){let n=t===void 0?`h${e}`:t;return hr.includes(n)?{fontSize:`var(--mantine-${n}-font-size)`,fontWeight:`var(--mantine-${n}-font-weight)`,lineHeight:`var(--mantine-${n}-line-height)`}:gr.includes(n)?{fontSize:`var(--mantine-font-size-${n})`,fontWeight:`var(--mantine-h${e}-font-weight)`,lineHeight:`var(--mantine-h${e}-line-height)`}:{fontSize:h(n),fontWeight:`var(--mantine-h${e}-font-weight)`,lineHeight:`var(--mantine-h${e}-line-height)`}}var vr={root:`m_8a5d1357`},yr={order:1},br=A((e,{order:t,size:n,lineClamp:r,textWrap:i})=>{let a=_r(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}}}),xr=G(e=>{let t=U(`Title`,yr,e),{classNames:n,className:r,style:i,styles:a,unstyled:o,order:s,vars:l,size:u,variant:d,lineClamp:f,textWrap:p,mod:m,attributes:h,...g}=t,_=W({name:`Title`,props:t,classes:vr,className:r,style:i,classNames:n,styles:a,unstyled:o,attributes:h,vars:l,varsResolver:br});return[1,2,3,4,5,6].includes(s)?(0,c.jsx)(q,{..._(`root`),component:`h${s}`,variant:d,mod:[{order:s,"data-line-clamp":typeof f==`number`},m],size:u,...g}):null});xr.classes=vr,xr.varsResolver=br,xr.displayName=`@mantine/core/Title`;var Sr=new Map([[`bold`,s.createElement(s.Fragment,null,s.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`,s.createElement(s.Fragment,null,s.createElement(`path`,{d:`M216,128l-72,72V56Z`,opacity:`0.2`}),s.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`,s.createElement(s.Fragment,null,s.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`,s.createElement(s.Fragment,null,s.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`,s.createElement(s.Fragment,null,s.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`,s.createElement(s.Fragment,null,s.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`}))]]),Cr=new Map([[`bold`,s.createElement(s.Fragment,null,s.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`,s.createElement(s.Fragment,null,s.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`}),s.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`,s.createElement(s.Fragment,null,s.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`,s.createElement(s.Fragment,null,s.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`,s.createElement(s.Fragment,null,s.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`,s.createElement(s.Fragment,null,s.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`}))]]),wr=new Map([[`bold`,s.createElement(s.Fragment,null,s.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`,s.createElement(s.Fragment,null,s.createElement(`path`,{d:`M216,40V168H168V88H88V40Z`,opacity:`0.2`}),s.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`,s.createElement(s.Fragment,null,s.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`,s.createElement(s.Fragment,null,s.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`,s.createElement(s.Fragment,null,s.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`,s.createElement(s.Fragment,null,s.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`}))]]),Tr=new Map([[`bold`,s.createElement(s.Fragment,null,s.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`,s.createElement(s.Fragment,null,s.createElement(`path`,{d:`M168,100a60,60,0,1,1-60-60A60,60,0,0,1,168,100Z`,opacity:`0.2`}),s.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`,s.createElement(s.Fragment,null,s.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`,s.createElement(s.Fragment,null,s.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`,s.createElement(s.Fragment,null,s.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`,s.createElement(s.Fragment,null,s.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`}))]]),Er=(0,s.createContext)({color:`currentColor`,size:`1em`,weight:`regular`,mirrored:!1}),Dr=s.forwardRef((e,t)=>{let{alt:n,color:r,size:i,weight:a,mirrored:o,children:c,weights:l,...u}=e,{color:d=`currentColor`,size:f,weight:p=`regular`,mirrored:m=!1,...h}=s.useContext(Er);return s.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:o||m?`scale(-1, 1)`:void 0,...h,...u},!!n&&s.createElement(`title`,null,n),c,l.get(a??p))});Dr.displayName=`IconBase`;var Or=s.forwardRef((e,t)=>s.createElement(Dr,{ref:t,...e,weights:Sr}));Or.displayName=`ArrowRightIcon`;var kr=Or,Ar=s.forwardRef((e,t)=>s.createElement(Dr,{ref:t,...e,weights:Cr}));Ar.displayName=`CheckIcon`;var jr=Ar,Mr=s.forwardRef((e,t)=>s.createElement(Dr,{ref:t,...e,weights:wr}));Mr.displayName=`CopyIcon`;var Nr=Mr,Pr=s.forwardRef((e,t)=>s.createElement(Dr,{ref:t,...e,weights:Tr}));Pr.displayName=`UserPlusIcon`;var Fr=Pr,Ir=`fanout.access-token`,Lr=`fanout:unauthorized`;function Rr(){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 zr(e){return!e||typeof e!=`object`||!(`id`in e)||typeof e.id!=`string`||e.id===``?`none`:`user`}function Br(){localStorage.removeItem(Ir)}function Vr(){Br(),window.dispatchEvent(new Event(Lr))}async function Hr(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&&Vr(),r.status===403){let e=await r.clone().json().catch(()=>({}));throw Error(e.message??e.error??`You do not have permission to perform this action.`)}return r}async function Ur(){let e=await Hr(`/api/auth/logout`,{method:`POST`});if(!e.ok&&e.status!==401)throw Error(`Sign-out failed — your session is still active.`);e.status!==401&&Vr(),window.location.assign(`/`)}var Wr={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 Gr({size:e=`regular`}){let t=Wr[e];return(0,c.jsxs)(pn,{component:`span`,gap:t.gap,wrap:`nowrap`,"aria-label":`Fanout`,children:[(0,c.jsx)(Kr,{size:e}),(0,c.jsx)(Z,{component:`span`,fz:t.fontSize,fw:800,lh:1,lts:t.tracking,tt:`uppercase`,children:`Fanout`})]})}function Kr({size:e=`regular`}){let t={small:32,regular:46,large:50}[e];return(0,c.jsx)(mr,{size:t,variant:`transparent`,"aria-hidden":`true`,children:(0,c.jsx)(qr,{})})}function qr(){let e=(0,s.useId)().replace(/[^a-zA-Z0-9-]/g,``),t=`fo-top-${e}`,n=`fo-mid-${e}`,r=`fo-bot-${e}`;return(0,c.jsxs)(`svg`,{viewBox:`35 44 200 200`,width:`100%`,height:`100%`,"aria-hidden":`true`,children:[(0,c.jsxs)(`defs`,{children:[(0,c.jsxs)(`linearGradient`,{id:t,x1:`54`,y1:`52`,x2:`210`,y2:`104`,gradientUnits:`userSpaceOnUse`,children:[(0,c.jsx)(`stop`,{offset:`0`,stopColor:`#5FE8CE`}),(0,c.jsx)(`stop`,{offset:`0.55`,stopColor:`#81E4B9`}),(0,c.jsx)(`stop`,{offset:`1`,stopColor:`#D9F276`})]}),(0,c.jsxs)(`linearGradient`,{id:n,x1:`58`,y1:`112`,x2:`176`,y2:`154`,gradientUnits:`userSpaceOnUse`,children:[(0,c.jsx)(`stop`,{offset:`0`,stopColor:`#536FFF`}),(0,c.jsx)(`stop`,{offset:`0.52`,stopColor:`#41B6F8`}),(0,c.jsx)(`stop`,{offset:`1`,stopColor:`#66D0EE`})]}),(0,c.jsxs)(`linearGradient`,{id:r,x1:`58`,y1:`166`,x2:`145`,y2:`220`,gradientUnits:`userSpaceOnUse`,children:[(0,c.jsx)(`stop`,{offset:`0`,stopColor:`#725BFF`}),(0,c.jsx)(`stop`,{offset:`0.52`,stopColor:`#9A50F4`}),(0,c.jsx)(`stop`,{offset:`1`,stopColor:`#CB55E8`})]})]}),(0,c.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,c.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,c.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})`})]})}var Jr=(0,s.createContext)(null);function Yr(){let e=(0,s.useContext)(Jr);if(!e)throw Error(`Fanout runtime status is unavailable`);return e}async function Xr(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??r.error??`Request failed (${n.status})`);return r}function Zr({children:e,wide:t=!1}){return(0,c.jsx)(q,{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,c.jsx)(er,{mih:`100dvh`,px:`md`,py:48,children:(0,c.jsx)(sr,{size:t?680:480,w:`100%`,children:(0,c.jsx)(Ut,{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 Qr(){return typeof window>`u`?``:new URLSearchParams(window.location.search).get(`setup_token`)??``}function $r(){return typeof window>`u`?``:new URLSearchParams(window.location.search).get(`login_token`)??``}function ei({children:e}){let t=r(),[n,i]=(0,s.useState)(null),[a,o]=(0,s.useState)(!1),[l,u]=(0,s.useState)(`none`),[d,f]=(0,s.useState)(!1),[p,m]=(0,s.useState)(``),[h,g]=(0,s.useState)(``),[_,v]=(0,s.useState)(Qr),[y,b]=(0,s.useState)($r),[x,S]=(0,s.useState)(``),[C,w]=(0,s.useState)(!1),[T,E]=(0,s.useState)(!1),[D,O]=(0,s.useState)(``),[k,ee]=(0,s.useState)(null),[te,A]=(0,s.useState)(!1),j=Rr(),M=l===`user`;(0,s.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,s.useEffect)(()=>{Br(),Xr(`/api/auth/status`).then(i).catch(e=>O(String(e))).finally(()=>o(!0)),fetch(`/api/auth/me`,{credentials:`same-origin`}).then(async e=>{if(!e.ok){u(`none`);return}let t=await e.json().catch(()=>null);u(zr(t))}).catch(()=>u(`none`)).finally(()=>f(!0));let e=()=>u(`none`);return window.addEventListener(Lr,e),()=>window.removeEventListener(Lr,e)},[]),(0,s.useEffect)(()=>{!d||l!==`none`||!y||(E(!0),O(``),Xr(`/api/auth/login-link`,{token:y}).then(()=>u(`user`)).catch(e=>O(e instanceof Error?e.message:String(e))).finally(()=>{b(``),E(!1)}))},[y,d,l]),(0,s.useEffect)(()=>{M&&d&&j&&window.location.replace(j)},[M,j,d]);async function N(){try{await navigator.clipboard.writeText(k?.ingest_token??``),A(!0)}catch{O(`Clipboard access failed. Select and copy the token manually.`)}}if(k?.ingest_token)return(0,c.jsx)(Zr,{wide:!0,children:(0,c.jsxs)($,{gap:`lg`,children:[(0,c.jsx)(Gr,{}),(0,c.jsxs)(`div`,{children:[(0,c.jsx)(Z,{c:`brand`,fw:700,size:`xs`,tt:`uppercase`,lts:`0.12em`,children:`Setup complete`}),(0,c.jsx)(xr,{order:1,mt:`xs`,fz:{base:30,sm:36},fw:650,lh:1.08,children:`Save your ingest token`})]}),(0,c.jsx)(Z,{c:`dimmed`,children:`Fanout shows this token once. Store it with your collector secrets before continuing.`}),(0,c.jsxs)($,{gap:`xs`,children:[(0,c.jsx)(Z,{size:`sm`,fw:600,children:`OTLP endpoint`}),(0,c.jsx)(rr,{block:!0,children:k.suggested_endpoint??`${window.location.hostname}:4317`})]}),(0,c.jsxs)($,{gap:`xs`,children:[(0,c.jsx)(Z,{size:`sm`,fw:600,children:`Header`}),(0,c.jsxs)(rr,{block:!0,children:[k.ingest_header_name??`Authorization`,`: Bearer `,k.ingest_token]})]}),D&&(0,c.jsx)(Bn,{color:`bad`,radius:`md`,children:D}),(0,c.jsxs)(pn,{grow:!0,align:`stretch`,children:[(0,c.jsx)(Q,{variant:`light`,radius:`md`,leftSection:te?(0,c.jsx)(jr,{size:16,weight:`bold`}):(0,c.jsx)(Nr,{size:16}),onClick:()=>void N(),children:te?`Copied`:`Copy token`}),(0,c.jsx)(Q,{radius:`md`,rightSection:(0,c.jsx)(kr,{size:16,weight:`bold`}),onClick:()=>{u(`user`),ee(null)},children:`Continue to Fanout`})]})]})});if(!d||!a||y)return(0,c.jsx)(er,{mih:`100dvh`,children:(0,c.jsx)(nn,{size:`sm`})});if(!n)return(0,c.jsx)(Zr,{children:(0,c.jsxs)($,{gap:`lg`,children:[(0,c.jsx)(Gr,{}),(0,c.jsx)(xr,{order:1,children:`Fanout is unavailable`}),(0,c.jsx)(Bn,{color:`bad`,radius:`md`,children:D||`Authentication status could not be loaded.`})]})});if(M&&j)return null;if(M)return(0,c.jsx)(Jr.Provider,{value:n,children:e});if(n&&!n.setup_required&&n.auth_mode===`oidc`){let e=j?`/api/auth/oidc/start?return_to=${encodeURIComponent(j)}`:`/api/auth/oidc/start`;return(0,c.jsx)(Zr,{children:(0,c.jsxs)($,{gap:28,children:[(0,c.jsx)(Gr,{}),(0,c.jsxs)($,{gap:10,children:[(0,c.jsx)(Z,{c:`brand`,fw:700,size:`xs`,tt:`uppercase`,lts:`0.12em`,children:`Secure workspace`}),(0,c.jsx)(xr,{order:1,fz:{base:30,sm:36},fw:650,lh:1.08,children:`Sign in to investigate`}),(0,c.jsx)(Z,{c:`dimmed`,size:`md`,lh:1.6,children:`Use your organization's identity provider to continue.`})]}),D&&(0,c.jsx)(Bn,{color:`bad`,radius:`md`,children:D}),(0,c.jsx)(Q,{component:`a`,href:e,size:`md`,radius:`md`,rightSection:(0,c.jsx)(kr,{size:17,weight:`bold`}),children:`Continue with SSO`})]})})}async function ne(e){e.preventDefault(),E(!0),O(``);try{if(n?.setup_required){let e=await Xr(`/api/auth/setup`,{email:p,name:h,setup_token:_});e.ingest_token?ee(e):u(`user`)}else C?(await Xr(`/api/auth/verify`,{email:p,code:x}),u(`user`)):(await Xr(`/api/auth/start`,{email:p}),w(!0))}catch(e){O(e instanceof Error?e.message:String(e))}finally{E(!1)}}return(0,c.jsx)(Zr,{children:(0,c.jsxs)($,{gap:28,children:[(0,c.jsx)(Gr,{}),(0,c.jsxs)($,{gap:10,children:[(0,c.jsx)(Z,{c:`brand`,fw:700,size:`xs`,tt:`uppercase`,lts:`0.12em`,children:n?.setup_required?`One-time setup`:`Secure workspace`}),(0,c.jsx)(xr,{order:1,fz:{base:30,sm:36},fw:650,lh:1.08,children:n?.setup_required?`Create the first admin`:n?.self_signup?`Sign in or create an account`:`Sign in to investigate`}),(0,c.jsx)(Z,{c:`dimmed`,size:`md`,lh:1.6,maw:390,children:n?.setup_required?`Use the one-time token printed by the Fanout process.`:n?.smtp_configured?C?`Enter the verification code sent 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.`})]}),(0,c.jsx)(`form`,{onSubmit:ne,children:(0,c.jsxs)($,{gap:`md`,children:[(0,c.jsx)(dr,{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,c.jsx)(dr,{label:`Name`,placeholder:`Your name`,value:h,onChange:e=>g(e.currentTarget.value),variant:`filled`,radius:`md`,size:`md`}),n?.setup_required&&(0,c.jsx)(dr,{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`}),!n?.setup_required&&C&&(0,c.jsx)(dr,{label:`Verification code`,placeholder:`000000`,required:!0,value:x,onChange:e=>S(e.currentTarget.value),autoComplete:`one-time-code`,variant:`filled`,radius:`md`,size:`md`,styles:{input:{letterSpacing:`0.2em`,fontVariantNumeric:`tabular-nums`}},autoFocus:!0}),D&&(0,c.jsx)(Bn,{color:`bad`,radius:`md`,children:D}),(0,c.jsx)(Q,{type:`submit`,size:`md`,radius:`md`,mt:4,loading:T,disabled:!n||!n.setup_required&&!n.smtp_configured,leftSection:n?.setup_required?(0,c.jsx)(Fr,{size:17,weight:`bold`}):void 0,rightSection:n?.setup_required?void 0:(0,c.jsx)(kr,{size:17,weight:`bold`}),children:n?.setup_required?`Create admin`:C?`Verify code`:`Send code`})]})})]})})}export{te as $,rt as A,ge as B,Bt as C,jt as D,G as E,Ie as F,V as G,Ce as H,Fe as I,z as J,B as K,De as L,W as M,Re as N,Dt as O,U as P,A as Q,he as R,Ut as S,K as T,ve as U,we as V,pe as W,ie as X,R as Y,M as Z,X as _,Ur as a,x as at,nn as b,xr as c,b as ct,sr as d,h as dt,ee as et,er as f,d as ft,Ln as g,Bn as h,Hr as i,S as it,tt as j,Et as k,dr as l,_ as lt,Z as m,o as mt,Yr as n,O as nt,jr as o,w as ot,Q as p,l as pt,de as q,Gr as r,D as rt,Dr as s,y as st,ei as t,k as tt,$ as u,g as ut,pn as v,q as w,Yt as x,cn as y,H as z}; \ No newline at end of file +import{a as e,d as t,g as n,n as r,u as i}from"./useNavigate-BEpS2iE5.js";var a=t((e=>{var t=i();function n(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=a()})),s=n(i(),1),c=e();function l(e){return Object.keys(e)}function u(e){return e&&typeof e==`object`&&!Array.isArray(e)}function d(e,t){let n={...e},r=t;return u(e)&&u(t)&&Object.keys(t).forEach(t=>{u(r[t])&&t in e?n[t]=d(n[t],r[t]):n[t]=r[t]}),n}function f(e){return e.replace(/[A-Z]/g,e=>`-${e.toLowerCase()}`)}function p(e){return e===`0rem`?`0rem`:`calc(${e} * var(--mantine-scale))`}function m(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?p(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?p(n):n}}return r}return n}var h=m(`rem`,{shouldScale:!0}),g=m(`em`);function _(e){return Object.keys(e).reduce((t,n)=>(e[n]!==void 0&&(t[n]=e[n]),t),{})}function v(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 y(e,t=`size`,n=!0){if(e!==void 0)return v(e)?n?h(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){return typeof t==`boolean`?t:typeof window<`u`&&`matchMedia`in window&&window.matchMedia(e).matches}function D(e,t,{getInitialValueInEffect:n}={getInitialValueInEffect:!0}){let[r,i]=(0,s.useState)(n?t:E(e));return(0,s.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 O=typeof document<`u`?s.useLayoutEffect:s.useEffect;function k(e,t){let n=(0,s.useRef)(!1);(0,s.useEffect)(()=>()=>{n.current=!1},[]),(0,s.useEffect)(()=>{if(n.current)return e();n.current=!0},t)}function ee(e){let[t,n]=(0,s.useState)(`mantine-${(0,s.useId)().replace(/:/g,``)}`),r=(0,s.useRef)(!1);return O(()=>{r.current||(r.current=!0,n(T()))},[]),typeof e==`string`?e:t}function te(e,t){return D(`(prefers-reduced-motion: reduce)`,e,t)}function A(e){return e}function j(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 ne((Array.isArray(t)?t:[t]).map(t=>typeof t==`function`?t(e,n,r):t||N))}function re({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 ie(e,t){return typeof e.primaryShade==`number`?e.primaryShade:t===`dark`?e.primaryShade.dark:e.primaryShade.light}function ae(e){return/^#?([0-9A-F]{3}){1,2}([0-9A-F]{2})?$/i.test(e)}function oe(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 F(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 I(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 ae(e)?oe(e):e.startsWith(`rgb`)?F(e):e.startsWith(`hsl`)?I(e):{r:0,g:0,b:0,a:1}}function se(e){return e<=.03928?e/12.92:((e+.055)/1.055)**2.4}function ce(e){let t=e.match(/oklch\((.*?)%\s/);return t?parseFloat(t[1]):null}function le(e){if(e.startsWith(`oklch(`))return(ce(e)||0)/100;let{r:t,g:n,b:r}=L(e),i=t/255,a=n/255,o=r/255,s=se(i),c=se(a),l=se(o);return .2126*s+.7152*c+.0722*l}function ue(e,t=.179){return!e.startsWith(`var(`)&&le(e)>t}function R({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:ue(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:ue(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:ue(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][ie(t,n||`light`)]:t.colors[r][a];return{color:r,value:e,shade:a,isThemeColor:o,isLight:ue(e,t.luminanceThreshold),variable:i?`--mantine-color-${r}-${a}`:`--mantine-color-${r}-filled`}}return{color:e,value:e,isThemeColor:o,isLight:ue(e,t.luminanceThreshold),shade:a,variable:void 0}}function z(e,t){let n=R({color:e||t.primaryColor,theme:t});return n.variable?`var(${n.variable})`:e}function de(e){return!!e&&typeof e==`object`&&`mantine-virtual-color`in e}function B(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 fe(e,t){let n={from:e?.from||t.defaultGradient.from,to:e?.to||t.defaultGradient.to,deg:e?.deg??t.defaultGradient.deg??0},r=z(n.from,t),i=z(n.to,t);return`linear-gradient(${n.deg}deg, ${r} 0%, ${i} 100%)`}function V(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 pe=V,me=({color:e,theme:t,variant:n,gradient:r,autoContrast:i})=>{let a=R({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&&de(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:`${h(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:`${h(1)} solid transparent`}:{background:e,hover:B(e,.1),color:r,border:`${h(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:`${h(1)} solid transparent`};let n=t.colors[a.color][a.shade];return{background:n,hover:B(n,.1),color:`var(--mantine-color-${a.color}-light-color)`,border:`${h(1)} solid transparent`}}return{background:V(e,.1),hover:V(e,.12),color:e,border:`${h(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:`${h(1)} solid var(--mantine-color-${e}-outline)`}:{background:`transparent`,hover:V(t.colors[a.color][a.shade],.05),color:`var(--mantine-color-${a.color}-${a.shade})`,border:`${h(1)} solid var(--mantine-color-${a.color}-${a.shade})`}:{background:`transparent`,hover:V(e,.05),color:e,border:`${h(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:`${h(1)} solid transparent`};let n=t.colors[a.color][a.shade];return{background:`transparent`,hover:V(n,.12),color:`var(--mantine-color-${a.color}-${Math.min(a.shade,6)})`,border:`${h(1)} solid transparent`}}return{background:`transparent`,hover:V(e,.12),color:e,border:`${h(1)} solid transparent`}}return n===`transparent`?a.isThemeColor?a.shade===void 0?{background:`transparent`,hover:`transparent`,color:`var(--mantine-color-${e}-light-color)`,border:`${h(1)} solid transparent`}:{background:`transparent`,hover:`transparent`,color:`var(--mantine-color-${a.color}-${Math.min(a.shade,6)})`,border:`${h(1)} solid transparent`}:{background:`transparent`,hover:`transparent`,color:e,border:`${h(1)} solid transparent`}:n===`white`?a.isThemeColor?a.shade===void 0?{background:`var(--mantine-color-white)`,hover:B(t.white,.01),color:`var(--mantine-color-${e}-filled)`,border:`${h(1)} solid transparent`}:{background:`var(--mantine-color-white)`,hover:B(t.white,.01),color:`var(--mantine-color-${a.color}-${a.shade})`,border:`${h(1)} solid transparent`}:{background:`var(--mantine-color-white)`,hover:B(t.white,.01),color:e,border:`${h(1)} solid transparent`}:n===`gradient`?{background:fe(r,t),hover:fe(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:`${h(1)} solid var(--mantine-color-default-border)`}:{}},he=(0,s.createContext)(null);function H(){let e=(0,s.use)(he);if(!e)throw Error(`[@mantine/core] MantineProvider was not found in tree`);return e}function ge(){return H().cssVariablesResolver}function _e(){return H().classNamesPrefix}function ve(){return H().getStyleNonce}function ye(){return H().withStaticClasses}function be(){return H().headless}function xe(){return H().stylesTransform?.sx}function Se(){return H().stylesTransform?.styles}function Ce(){return H().env||`default`}function we(){return H().deduplicateInlineStyles}var Te={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`]},Ee=`-apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Helvetica, Arial, sans-serif, Apple Color Emoji, Segoe UI Emoji`,De={scale:1,fontSmoothing:!0,focusRing:`auto`,white:`#fff`,black:`#000`,colors:Te,primaryShade:{light:6,dark:8},primaryColor:`blue`,variantColorResolver:me,autoContrast:!1,luminanceThreshold:.3,fontFamily:Ee,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:Ee,fontWeight:`700`,textWrap:`wrap`,sizes:{h1:{fontSize:h(34),lineHeight:`1.3`},h2:{fontSize:h(26),lineHeight:`1.35`},h3:{fontSize:h(22),lineHeight:`1.4`},h4:{fontSize:h(18),lineHeight:`1.45`},h5:{fontSize:h(16),lineHeight:`1.5`},h6:{fontSize:h(14),lineHeight:`1.5`}}},fontSizes:{xs:h(12),sm:h(14),md:h(16),lg:h(18),xl:h(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:h(2),sm:h(4),md:h(8),lg:h(16),xl:h(32)},spacing:{xs:h(10),sm:h(12),md:h(16),lg:h(20),xl:h(32)},breakpoints:{xs:`36em`,sm:`48em`,md:`62em`,lg:`75em`,xl:`88em`},shadows:{xs:`0 ${h(1)} ${h(3)} rgba(0, 0, 0, 0.05), 0 ${h(1)} ${h(2)} rgba(0, 0, 0, 0.1)`,sm:`0 ${h(1)} ${h(3)} rgba(0, 0, 0, 0.05), rgba(0, 0, 0, 0.05) 0 ${h(10)} ${h(15)} ${h(-5)}, rgba(0, 0, 0, 0.04) 0 ${h(7)} ${h(7)} ${h(-5)}`,md:`0 ${h(1)} ${h(3)} rgba(0, 0, 0, 0.05), rgba(0, 0, 0, 0.05) 0 ${h(20)} ${h(25)} ${h(-5)}, rgba(0, 0, 0, 0.04) 0 ${h(10)} ${h(10)} ${h(-5)}`,lg:`0 ${h(1)} ${h(3)} rgba(0, 0, 0, 0.05), rgba(0, 0, 0, 0.05) 0 ${h(28)} ${h(23)} ${h(-7)}, rgba(0, 0, 0, 0.04) 0 ${h(12)} ${h(12)} ${h(-7)}`,xl:`0 ${h(1)} ${h(3)} rgba(0, 0, 0, 0.05), rgba(0, 0, 0, 0.05) 0 ${h(36)} ${h(28)} ${h(-7)}, rgba(0, 0, 0, 0.04) 0 ${h(17)} ${h(17)} ${h(-7)}`},other:{},components:{}},Oe=`[@mantine/core] MantineProvider: Invalid theme.primaryColor, it accepts only key of theme.colors, learn more – https://mantine.dev/theming/colors/#primary-color`,ke=`[@mantine/core] MantineProvider: Invalid theme.primaryShade, it accepts only 0-9 integers or an object { light: 0-9, dark: 0-9 }`;function Ae(e){return e<0||e>9?!1:parseInt(e.toString(),10)===e}function je(e){if(!(e.primaryColor in e.colors))throw Error(Oe);if(typeof e.primaryShade==`object`&&(!Ae(e.primaryShade.dark)||!Ae(e.primaryShade.light))||typeof e.primaryShade==`number`&&!Ae(e.primaryShade))throw Error(ke)}function Me(e,t){if(!t)return je(e),e;let n=d(e,t);return t.fontFamily&&!t.headings?.fontFamily&&(n.headings={...n.headings,fontFamily:t.fontFamily}),je(n),n}var Ne=(0,s.createContext)(null),Pe=()=>(0,s.use)(Ne)||De;function Fe(){let e=(0,s.use)(Ne);if(!e)throw Error(`@mantine/core: MantineProvider was not found in component tree, make sure you have it in your app`);return e}function Ie({theme:e,children:t,inherit:n=!0}){let r=Pe(),i=(0,s.useMemo)(()=>Me(n?r:De,e),[e,r,n]);return(0,c.jsx)(Ne,{value:i,children:t})}Ie.displayName=`@mantine/core/MantineThemeProvider`;function U(e,t,n){let r=Fe(),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,..._(n)}}var Le=n(o(),1);function Re({classNames:e,styles:t,props:n,stylesCtx:r}){let i=Fe();return{resolvedClassNames:e===void 0?void 0:P({theme:i,classNames:e,props:n,stylesCtx:r||void 0}),resolvedStyles:t===void 0?void 0:re({theme:i,styles:t,props:n,stylesCtx:r||void 0})}}var ze={always:`mantine-focus-always`,auto:`mantine-focus-auto`,never:`mantine-focus-never`};function Be({theme:e,options:t,unstyled:n}){return M(t?.focusable&&!n&&(e.focusClassName||ze[e.focusRing]),t?.active&&!n&&e.activeClassName)}function Ve({selector:e,stylesCtx:t,options:n,props:r,theme:i}){return P({theme:i,classNames:n?.classNames,props:n?.props||r,stylesCtx:t})[e]}function He({selector:e,stylesCtx:t,theme:n,classNames:r,props:i}){return P({theme:n,classNames:r,props:i,stylesCtx:t})[e]}function Ue({rootSelector:e,selector:t,className:n}){return e===t?n:void 0}function We({selector:e,classes:t,unstyled:n}){return n?void 0:t[e]}function Ge({themeName:e,classNamesPrefix:t,selector:n,withStaticClass:r}){return r===!1?[]:e.map(e=>`${t}-${e}-${n}`)}function Ke({options:e,classes:t,selector:n,unstyled:r}){return e?.variant&&!r?t[`${n}--${e.variant}`]:void 0}function qe({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(Be({theme:e,options:t,unstyled:c||m}),o.map(e=>e[r]),Ke({options:t,classes:s,selector:r,unstyled:c||m}),a[r],He({selector:r,stylesCtx:f,theme:e,classNames:h,props:d}),Ve({selector:r,stylesCtx:f,options:t,props:d,theme:e}),Ue({rootSelector:u,selector:r,className:l}),We({selector:r,classes:s,unstyled:c||m}),p&&!m&&Ge({themeName:n,classNamesPrefix:i,selector:r,withStaticClass:t?.withStaticClass}),t?.className)}function Je({style:e,theme:t}){return Array.isArray(e)?e.reduce((e,n)=>({...e,...Je({style:n,theme:t})}),{}):typeof e==`function`?e(t):e??{}}function Ye({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&&re({theme:e,styles:n?.styles,props:n?.props||r,stylesCtx:i})[t],...l[t],...a===t?u:null,...Je({style:n?.style,theme:e})}}function Xe(e){return e.reduce((e,t)=>(t&&Object.keys(t).forEach(n=>{e[n]={...e[n],..._(t[n])}}),e),{})}function Ze({props:e,stylesCtx:t,themeName:n,theme:r}){let i=Se()?.();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 W({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}){let p=Fe(),m=_e(),h=ye(),g=be(),_=(Array.isArray(e)?e:[e]).filter(e=>e),{withStylesTransform:v,getTransformedStyles:y}=Ze({props:n,stylesCtx:r,themeName:_,theme:p}),b=P({theme:p,classNames:c,props:n,stylesCtx:r}),x=_.map(e=>P({theme:p,classNames:p.components[e]?.classNames,props:n,stylesCtx:r})),S=v?{}:re({theme:p,styles:l,props:n,stylesCtx:r}),C={};if(!v)for(let e of _){let t=re({theme:p,styles:p.components[e]?.styles,props:n,stylesCtx:r});for(let e of Object.keys(t))C[e]={...C[e],...t[e]}}let w=Xe([g?{}:d?.(p,n,r),..._.map(e=>p.components?.[e]?.vars?.(p,n,r)),u?.(p,n,r)]),T=Je({style:a,theme:p});return(e,a)=>({...f?.[e],className:qe({theme:p,options:a,themeName:_,selector:e,classNamesPrefix:m,resolvedClassNames:b,resolvedThemeClassNames:x,classes:t,unstyled:s,className:i,rootSelector:o,props:n,stylesCtx:r,withStaticClasses:h,headless:g,transformedStyles:y([a?.styles,l])}),style:Ye({theme:p,selector:e,options:a,props:n,stylesCtx:r,rootSelector:o,withStylesTransform:v,resolvedStyles:S,resolvedThemeStyles:C,resolvedVars:w,resolvedRootStyle:T})})}function Qe(e){return l(e).reduce((t,n)=>e[n]===void 0?t:`${t}${f(n)}:${e[n]};`,``).trim()}function $e({selector:e,styles:t,media:n,container:r}){let i=t?Qe(t):``,a=Array.isArray(n)?n.map(t=>`@media${t.query}{${e}{${Qe(t.styles)}}}`):[],o=Array.isArray(r)?r.map(t=>`@container ${t.query}{${e}{${Qe(t.styles)}}}`):[];return`${i?`${e}{${i}}`:``}${a.join(``)}${o.join(``)}`.trim()}function et(e){let t=5381;for(let n=0;n>>0).toString(36)}function tt({deduplicate:e,...t}){let n=ve(),r=$e(t);return e?(0,c.jsx)(`style`,{href:`mantine-${et(r)}`,precedence:`mantine`,nonce:n?.(),children:r}):(0,c.jsx)(`style`,{"data-mantine-styles":`inline`,nonce:n?.(),dangerouslySetInnerHTML:{__html:r}})}function nt(e){let t=5381;for(let n=0;n>>0).toString(36)}function rt(e,t){return`__mdi__-${nt(`${e?Qe(e):``}|${Array.isArray(t)?t.map(e=>`${e.query}:${Qe(e.styles)}`).join(`|`):``}`)}`}function it(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:g,pl:v,pr:y,pe:b,ps:x,pis:S,pie:C,bd:w,bdrs:T,bg:E,c:D,opacity:O,ff:k,fz:ee,fw:te,lts:A,ta:j,lh:M,fs:N,tt:ne,td:P,w:re,miw:ie,maw:ae,h:oe,mih:F,mah:I,bgsz:L,bgp:se,bgr:ce,bga:le,pos:ue,top:R,left:z,bottom:de,right:B,inset:fe,display:V,flex:pe,hiddenFrom:me,visibleFrom:he,lightHidden:H,darkHidden:ge,sx:_e,...ve}=e;return{styleProps:_({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:g,pl:v,pr:y,pis:S,pie:C,pe:b,ps:x,bd:w,bg:E,c:D,opacity:O,ff:k,fz:ee,fw:te,lts:A,ta:j,lh:M,fs:N,tt:ne,td:P,w:re,miw:ie,maw:ae,h:oe,mih:F,mah:I,bgsz:L,bgp:se,bgr:ce,bga:le,pos:ue,top:R,left:z,bottom:de,right:B,inset:fe,display:V,flex:pe,bdrs:T,hiddenFrom:me,visibleFrom:he,lightHidden:H,darkHidden:ge,sx:_e}),rest:ve}}var at={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 ot(e,t){let n=R({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 st(e,t){let n=R({color:e,theme:t});return n.isThemeColor&&n.shade===void 0?`var(--mantine-color-${n.color}-text)`:ot(e,t)}function ct(e,t){if(typeof e==`number`)return h(e);if(typeof e==`string`){let[n,r,...i]=e.split(` `).filter(e=>e.trim()!==``),a=`${h(n)}`;return r&&(a+=` ${r}`),i.length>0&&(a+=` ${ot(i.join(` `),t)}`),a.trim()}return e}var lt={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 ut(e){return typeof e==`string`&&e in lt?lt[e]:e}var dt=[`h1`,`h2`,`h3`,`h4`,`h5`,`h6`];function ft(e,t){return typeof e==`string`&&e in t.fontSizes?`var(--mantine-font-size-${e})`:typeof e==`string`&&dt.includes(e)?`var(--mantine-${e}-font-size)`:typeof e==`number`||typeof e==`string`?h(e):e}function pt(e){return e}var mt=[`h1`,`h2`,`h3`,`h4`,`h5`,`h6`];function ht(e,t){return typeof e==`string`&&e in t.lineHeights?`var(--mantine-line-height-${e})`:typeof e==`string`&&mt.includes(e)?`var(--mantine-${e}-line-height)`:e}function gt(e,t){return typeof e==`string`&&e in t.radius?`var(--mantine-radius-${e})`:typeof e==`number`||typeof e==`string`?h(e):e}function _t(e){return typeof e==`number`?h(e):e}function vt(e,t){if(typeof e==`number`)return h(e);if(typeof e==`string`){let n=e.replace(`-`,``);if(!(n in t.spacing))return h(e);let r=`--mantine-spacing-${n}`;return e.startsWith(`-`)?`calc(var(${r}) * -1)`:`var(${r})`}return e}var yt={color:ot,textColor:st,fontSize:ft,spacing:vt,radius:gt,identity:pt,size:_t,lineHeight:ht,fontFamily:ut,border:ct};function bt(e){return e.replace(`(min-width: `,``).replace(`em)`,``)}function xt({media:e,...t}){let n=Object.keys(e).sort((e,t)=>Number(bt(e))-Number(bt(t))).map(t=>({query:t,styles:e[t]}));return{...t,media:n}}function St(e){if(typeof e!=`object`||!e)return!1;let t=Object.keys(e);return t.length!==1||t[0]!==`base`}function Ct(e){return typeof e==`object`&&e?`base`in e?e.base:void 0:e}function wt(e){return typeof e==`object`&&e?l(e).filter(e=>e!==`base`):[]}function Tt(e,t){return typeof e==`object`&&e&&t in e?e[t]:e}function Et({styleProps:e,data:t,theme:n}){return xt(l(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=Ct(e[i]);if(!St(e[i]))return o.forEach(e=>{r.inlineStyles[e]=yt[a.type](s,n)}),r;r.hasResponsiveStyles=!0;let c=wt(e[i]);return o.forEach(t=>{s!=null&&(r.styles[t]=yt[a.type](s,n)),c.forEach(o=>{let s=`(min-width: ${n.breakpoints[o]})`;r.media[s]={...r.media[s],[t]:yt[a.type](Tt(e[i],o),n)}})}),r},{hasResponsiveStyles:!1,styles:{},inlineStyles:{},media:{}}))}function Dt(){return`__m__-${(0,s.useId)().replace(/[:«»]/g,``)}`}function Ot(e){return e}var kt=Ot;function At(e){return e}function G(e){let t=e;return t.extend=At,t.withProps=e=>{let n=n=>(0,c.jsx)(t,{...e,...n});return n.extend=t.extend,n.displayName=`WithProps(${t.displayName})`,n},t}function jt(e){return G(e)}function K(e){let t=e;return t.withProps=e=>{let n=n=>(0,c.jsx)(t,{...e,...n});return n.extend=t.extend,n.displayName=`WithProps(${t.displayName})`,n},t.extend=At,t}function Mt(e){return`data-${(e.startsWith(`data-`)?e.slice(5):e).replace(/([a-z])([A-Z])/g,`$1-$2`).toLowerCase()}`}function Nt(e){return Object.keys(e).reduce((t,n)=>{let r=e[n];return r===void 0||r===``||r===!1||r===null||(t[Mt(n)]=e[n]),t},{})}function Pt(e){return e?typeof e==`string`?{[Mt(e)]:!0}:Array.isArray(e)?[...e].reduce((e,t)=>({...e,...Pt(t)}),{}):Nt(e):null}function Ft(e,t){return Array.isArray(e)?[...e].reduce((e,n)=>({...e,...Ft(n,t)}),{}):typeof e==`function`?e(t):e??{}}function It({theme:e,style:t,vars:n,styleProps:r}){let i=Ft(t,e),a=Ft(n,e);return{...i,...a,...r}}function Lt({component:e,style:t,__vars:n,className:r,variant:i,mod:a,size:o,hiddenFrom:s,visibleFrom:l,lightHidden:u,darkHidden:d,renderRoot:f,__size:p,ref:m,...h}){let g=Fe(),_=e||`div`,{styleProps:y,rest:b}=it(h),x=xe()?.()?.(y.sx),S=Dt(),C=Et({styleProps:y,theme:g,data:at}),w=we(),T=w&&C.hasResponsiveStyles?rt(C.styles,C.media):S,E={ref:m,style:It({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-${s}`]:s,[`mantine-visible-from-${l}`]:l}),"data-variant":i,"data-size":v(o)?void 0:o||void 0,size:p,...Pt(a),...b};return(0,c.jsxs)(c.Fragment,{children:[C.hasResponsiveStyles&&(0,c.jsx)(tt,{selector:`.${T}`,styles:C.styles,media:C.media,deduplicate:w}),typeof f==`function`?f(E):(0,c.jsx)(_,{...E})]})}Lt.displayName=`@mantine/core/Box`;var q=kt(Lt),Rt={root:`m_87cf2631`},zt={__staticSelector:`UnstyledButton`},Bt=K(e=>{let t=U(`UnstyledButton`,zt,e),{className:n,component:r=`button`,__staticSelector:i,unstyled:a,classNames:o,styles:s,style:l,attributes:u,...d}=t;return(0,c.jsx)(q,{...W({name:i,props:t,classes:Rt,className:n,style:l,classNames:o,styles:s,unstyled:a,attributes:u})(`root`,{focusable:!0}),component:r,type:r===`button`?`button`:void 0,...d})});Bt.classes=Rt,Bt.displayName=`@mantine/core/UnstyledButton`;var Vt={root:`m_1b7284a3`},Ht=A((e,{radius:t,shadow:n})=>({root:{"--paper-radius":t===void 0?void 0:x(t),"--paper-shadow":w(n)}})),Ut=K(e=>{let t=U(`Paper`,null,e),{classNames:n,className:r,style:i,styles:a,unstyled:o,withBorder:s,vars:l,radius:u,shadow:d,variant:f,mod:p,attributes:m,...h}=t,g=W({name:`Paper`,props:t,classes:Vt,className:r,style:i,classNames:n,styles:a,unstyled:o,attributes:m,vars:l,varsResolver:Ht});return(0,c.jsx)(q,{mod:[{"data-with-border":s},p],...g(`root`),variant:f,...h})});Ut.classes=Vt,Ut.varsResolver=Ht,Ut.displayName=`@mantine/core/Paper`;var Wt=e=>({in:{opacity:1,transform:`scale(1)`},out:{opacity:0,transform:`scale(.9) translateY(${e===`bottom`?10:-10}px)`},transitionProperty:`transform, opacity`}),Gt={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:{...Wt(`bottom`),common:{transformOrigin:`center center`}},"pop-bottom-left":{...Wt(`bottom`),common:{transformOrigin:`bottom left`}},"pop-bottom-right":{...Wt(`bottom`),common:{transformOrigin:`bottom right`}},"pop-top-left":{...Wt(`top`),common:{transformOrigin:`top left`}},"pop-top-right":{...Wt(`top`),common:{transformOrigin:`top right`}}},Kt={entering:`in`,entered:`in`,exiting:`out`,exited:`out`,"pre-exiting":`out`,"pre-entering":`out`};function qt({transition:e,state:t,duration:n,timingFunction:r}){let i={WebkitBackfaceVisibility:`hidden`,transitionDuration:`${n}ms`,transitionTimingFunction:r};return typeof e==`string`?e in Gt?{transitionProperty:Gt[e].transitionProperty,...i,...Gt[e].common,...Gt[e][Kt[t]]}:{}:{transitionProperty:e.transitionProperty,...i,...e.common,...e[Kt[t]]}}function Jt({duration:e,exitDuration:t,timingFunction:n,mounted:r,onEnter:i,onExit:a,onEntered:o,onExited:c,enterDelay:l,exitDelay:u}){let d=Fe(),f=te(),p=d.respectReducedMotion?f:!1,[m,h]=(0,s.useState)(p?0:e),[g,_]=(0,s.useState)(r?`entered`:`exited`),v=(0,s.useRef)(-1),y=(0,s.useRef)(-1),b=(0,s.useRef)(-1);function x(){window.clearTimeout(v.current),window.clearTimeout(y.current),cancelAnimationFrame(b.current)}let S=n=>{x();let r=n?i:a,s=n?o:c,l=p?0:n?e:t;h(l),l===0?(typeof r==`function`&&r(),typeof s==`function`&&s(),_(n?`entered`:`exited`)):b.current=requestAnimationFrame(()=>{Le.flushSync(()=>{_(n?`pre-entering`:`pre-exiting`)}),b.current=requestAnimationFrame(()=>{typeof r==`function`&&r(),_(n?`entering`:`exiting`),v.current=window.setTimeout(()=>{typeof s==`function`&&s(),_(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 k(()=>{C(r)},[r]),(0,s.useEffect)(()=>()=>{x()},[]),{transitionDuration:m,transitionStatus:g,transitionTimingFunction:n||`ease`}}function Yt({keepMounted:e,keepMountedMode:t=`activity`,transition:n=`fade`,duration:r=250,exitDuration:i=r,mounted:a,children:o,timingFunction:l=`ease`,onExit:u,onEntered:d,onEnter:f,onExited:p,enterDelay:m,exitDelay:h}){let g=Ce(),{transitionDuration:_,transitionStatus:v,transitionTimingFunction:y}=Jt({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,c.jsx)(c.Fragment,{children:o({})}):e?o({display:`none`}):null;if(_===0)return e?t===`display-none`?a?(0,c.jsx)(c.Fragment,{children:o({})}):o({display:`none`}):(0,c.jsx)(s.Activity,{mode:a?`visible`:`hidden`,children:o({})}):a?(0,c.jsx)(c.Fragment,{children:o({})}):null;let b=v===`exited`;if(e){let e=o(b?t===`display-none`?{display:`none`}:{}:qt({transition:n,duration:_,state:v,timingFunction:y}));return t===`display-none`?e:(0,c.jsx)(s.Activity,{mode:b?`hidden`:`visible`,children:e})}return b?null:(0,c.jsx)(c.Fragment,{children:o(qt({transition:n,duration:_,state:v,timingFunction:y}))})}Yt.displayName=`@mantine/core/Transition`;var J={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`},Xt=({className:e,...t})=>(0,c.jsxs)(q,{component:`span`,className:M(J.barsLoader,e),...t,children:[(0,c.jsx)(`span`,{className:J.bar}),(0,c.jsx)(`span`,{className:J.bar}),(0,c.jsx)(`span`,{className:J.bar})]});Xt.displayName=`@mantine/core/Bars`;var Zt=({className:e,...t})=>(0,c.jsxs)(q,{component:`span`,className:M(J.dotsLoader,e),...t,children:[(0,c.jsx)(`span`,{className:J.dot}),(0,c.jsx)(`span`,{className:J.dot}),(0,c.jsx)(`span`,{className:J.dot})]});Zt.displayName=`@mantine/core/Dots`;var Qt=({className:e,...t})=>(0,c.jsx)(q,{component:`span`,className:M(J.ovalLoader,e),...t});Qt.displayName=`@mantine/core/Oval`;var $t={bars:Xt,oval:Qt,dots:Zt},en={loaders:$t,type:`oval`},tn=A((e,{size:t,color:n})=>({root:{"--loader-size":y(t,`loader-size`),"--loader-color":n?z(n,e):void 0}})),nn=G(e=>{let t=U(`Loader`,en,e),{size:n,color:r,type:i,vars:a,className:o,style:s,classNames:l,styles:u,unstyled:d,loaders:f,variant:p,children:m,attributes:h,...g}=t,_=W({name:`Loader`,props:t,classes:J,className:o,style:s,classNames:l,styles:u,unstyled:d,attributes:h,vars:a,varsResolver:tn});return m?(0,c.jsx)(q,{..._(`root`),...g,children:m}):(0,c.jsx)(q,{..._(`root`),component:f[i],variant:p,size:n,...g})});nn.defaultLoaders=$t,nn.classes=J,nn.varsResolver=tn,nn.displayName=`@mantine/core/Loader`;function rn({size:e=`var(--cb-icon-size, 70%)`,style:t,...n}){return(0,c.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,c.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`})})}rn.displayName=`@mantine/core/CloseIcon`;var an={root:`m_86a44da5`,"root--subtle":`m_220c80f2`},on={variant:`subtle`},sn=A((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":h(r)}})),cn=K(e=>{let t=U(`CloseButton`,on,e),{iconSize:n,children:r,vars:i,radius:a,className:o,classNames:s,style:l,styles:u,unstyled:d,"data-disabled":f,disabled:p,variant:m,icon:h,mod:g,attributes:_,__staticSelector:v,...y}=t,b=W({name:v||`CloseButton`,props:t,className:o,style:l,classes:an,classNames:s,styles:u,unstyled:d,attributes:_,vars:i,varsResolver:sn});return(0,c.jsxs)(Bt,{...y,unstyled:d,variant:m,disabled:p,mod:[{disabled:p||f},g],...b(`root`,{variant:m,active:!p&&!f}),children:[h||(0,c.jsx)(rn,{}),r]})});cn.classes=an,cn.varsResolver=sn,cn.displayName=`@mantine/core/CloseButton`;function ln(e){return s.Children.toArray(e).filter(Boolean)}var un={root:`m_4081bf90`},dn={preventGrowOverflow:!0,gap:`md`,align:`center`,justify:`flex-start`,wrap:`wrap`},fn=A((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}})),pn=G(e=>{let t=U(`Group`,dn,e),{classNames:n,className:r,style:i,styles:a,unstyled:o,children:s,gap:l,align:u,justify:d,wrap:f,grow:p,preventGrowOverflow:m,vars:h,variant:g,__size:_,mod:v,attributes:y,...x}=t,S=ln(s),C=S.length,w=b(l??`md`);return(0,c.jsx)(q,{...W({name:`Group`,props:t,stylesCtx:{childWidth:`calc(${100/C}% - (${w} - ${w} / ${C}))`},className:r,style:i,classes:un,classNames:n,styles:a,unstyled:o,attributes:y,vars:h,varsResolver:fn})(`root`),variant:g,mod:[{grow:p},v],size:_,...x,children:S})});pn.classes=un,pn.varsResolver=fn,pn.displayName=`@mantine/core/Group`;var mn=(0,s.createContext)({size:`sm`}),hn=G(e=>{let t=U(`InputClearButton`,null,e),{size:n,variant:r,vars:i,classNames:a,styles:o,...l}=t,u=(0,s.use)(mn),{resolvedClassNames:d,resolvedStyles:f}=Re({classNames:a,styles:o,props:t});return(0,c.jsx)(cn,{variant:r||`transparent`,size:n||u?.size||`sm`,classNames:d,styles:f,__staticSelector:`InputClearButton`,style:{pointerEvents:`all`,background:`var(--input-bg)`,...l.style},...l})});hn.displayName=`@mantine/core/InputClearButton`;var gn={xs:7,sm:8,md:10,lg:12,xl:15};function _n({__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,c.jsxs)(`div`,{"data-combined-clear-section":!0,style:{display:`flex`,gap:2,alignItems:`center`,paddingInlineEnd:gn[i]},children:[o,n||r]}):n===null?null:n||o||r}var vn=(0,s.createContext)({offsetBottom:!1,offsetTop:!1,describedBy:void 0,getStyles:null,inputId:void 0,labelId:void 0}),Y={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`},yn=A((e,{size:t})=>({description:{"--input-description-size":t===void 0?void 0:`calc(${S(t)} - ${h(2)})`}})),bn=G(e=>{let t=U(`InputDescription`,null,e),{classNames:n,className:r,style:i,styles:a,unstyled:o,vars:l,__staticSelector:u,__inheritStyles:d=!0,attributes:f,...p}=U(`InputDescription`,null,t),m=(0,s.use)(vn),h=W({name:[`InputWrapper`,u],props:t,classes:Y,className:r,style:i,classNames:n,styles:a,unstyled:o,attributes:f,rootSelector:`description`,vars:l,varsResolver:yn});return(0,c.jsx)(q,{component:`p`,...(d&&m?.getStyles||h)(`description`,m?.getStyles?{className:r,style:i}:void 0),...p})});bn.classes=Y,bn.varsResolver=yn,bn.displayName=`@mantine/core/InputDescription`;var xn=A((e,{size:t})=>({error:{"--input-error-size":t===void 0?void 0:`calc(${S(t)} - ${h(2)})`}})),Sn=G(e=>{let t=U(`InputError`,null,e),{classNames:n,className:r,style:i,styles:a,unstyled:o,vars:l,attributes:u,__staticSelector:d,__inheritStyles:f=!0,...p}=t,m=W({name:[`InputWrapper`,d],props:t,classes:Y,className:r,style:i,classNames:n,styles:a,unstyled:o,attributes:u,rootSelector:`error`,vars:l,varsResolver:xn}),h=(0,s.use)(vn);return(0,c.jsx)(q,{component:`p`,...(f&&h?.getStyles||m)(`error`,h?.getStyles?{className:r,style:i}:void 0),...p})});Sn.classes=Y,Sn.varsResolver=xn,Sn.displayName=`@mantine/core/InputError`;var Cn={labelElement:`label`},wn=A((e,{size:t})=>({label:{"--input-label-size":S(t),"--input-asterisk-color":void 0}})),Tn=G(e=>{let t=U(`InputLabel`,Cn,e),{classNames:n,className:r,style:i,styles:a,unstyled:o,vars:l,labelElement:u,required:d,htmlFor:f,onMouseDown:p,children:m,__staticSelector:h,mod:g,attributes:_,...v}=t,y=W({name:[`InputWrapper`,h],props:t,classes:Y,className:r,style:i,classNames:n,styles:a,unstyled:o,attributes:_,rootSelector:`label`,vars:l,varsResolver:wn}),b=(0,s.use)(vn),x=b?.getStyles||y,S=v.component||u,C=typeof S!=`string`||S===`label`;return(0,c.jsxs)(q,{...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,c.jsx)(`span`,{...x(`required`),"aria-hidden":!0,children:` *`})]})});Tn.classes=Y,Tn.varsResolver=wn,Tn.displayName=`@mantine/core/InputLabel`;var En=G(e=>{let t=U(`InputPlaceholder`,null,e),{classNames:n,className:r,style:i,styles:a,unstyled:o,vars:s,__staticSelector:l,error:u,mod:d,attributes:f,...p}=t;return(0,c.jsx)(q,{...W({name:[`InputPlaceholder`,l],props:t,classes:Y,className:r,style:i,classNames:n,styles:a,unstyled:o,attributes:f,rootSelector:`placeholder`})(`placeholder`),mod:[{error:!!u},d],component:`span`,...p})});En.classes=Y,En.displayName=`@mantine/core/InputPlaceholder`;var Dn=A((e,{size:t})=>({success:{"--input-success-size":t===void 0?void 0:`calc(${S(t)} - ${h(2)})`}})),On=G(e=>{let t=U(`InputSuccess`,null,e),{classNames:n,className:r,style:i,styles:a,unstyled:o,vars:l,attributes:u,__staticSelector:d,__inheritStyles:f=!0,...p}=t,m=W({name:[`InputWrapper`,d],props:t,classes:Y,className:r,style:i,classNames:n,styles:a,unstyled:o,attributes:u,rootSelector:`success`,vars:l,varsResolver:Dn}),h=(0,s.use)(vn);return(0,c.jsx)(q,{component:`p`,...(f&&h?.getStyles||m)(`success`,h?.getStyles?{className:r,style:i}:void 0),...p})});On.classes=Y,On.varsResolver=Dn,On.displayName=`@mantine/core/InputSuccess`;function kn(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 An={labelElement:`label`,inputContainer:e=>e,inputWrapperOrder:[`label`,`description`,`input`,`error`]},jn=A((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)} - ${h(2)})`},success:{"--input-success-size":t===void 0?void 0:`calc(${S(t)} - ${h(2)})`},description:{"--input-description-size":t===void 0?void 0:`calc(${S(t)} - ${h(2)})`}})),Mn=G(e=>{let t=U(`InputWrapper`,An,e),{classNames:n,className:r,style:i,styles:a,unstyled:o,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:D,__stylesApiProps:O,mod:k,attributes:te,...A}=t,j=W({name:[`InputWrapper`,f],props:O||t,classes:Y,className:r,style:i,classNames:n,styles:a,unstyled:o,attributes:te,vars:l,varsResolver:jn}),M={size:u,variant:d,__staticSelector:f},N=ee(E),ne=typeof T==`boolean`?T:D,P=x?.id||`${N}-error`,re=S?.id||`${N}-success`,ie=b?.id||`${N}-description`,ae=N,oe=!!g&&typeof g!=`boolean`,F=!!_&&typeof _!=`boolean`&&!g,I=!!v,L=oe&&m.includes(`error`),se=F&&m.includes(`error`),ce=I&&m.includes(`description`),le=`${L?P:``} ${se?re:``} ${ce?ie:``}`,ue=le.trim().length>0?le.trim():void 0,R=y?.id||`${N}-label`,z=h&&(0,c.jsx)(Tn,{labelElement:C,id:R,htmlFor:ae,required:ne,...M,...y,children:h},`label`),de=I&&(0,c.jsx)(bn,{...b,...M,size:b?.size||M.size,id:b?.id||ie,children:v},`description`),B=(0,c.jsx)(s.Fragment,{children:p(w)},`input`),fe=oe&&(0,s.createElement)(Sn,{...x,...M,size:x?.size||M.size,key:`error`,id:x?.id||P},g),V=F&&(0,s.createElement)(On,{...S,...M,size:S?.size||M.size,key:`success`,id:S?.id||re},_),pe=m.map(e=>{switch(e){case`label`:return z;case`input`:return B;case`description`:return de;case`error`:return fe||V;default:return null}});return(0,c.jsx)(vn,{value:{getStyles:j,describedBy:ue,inputId:ae,labelId:R,...kn(m,{hasDescription:I,hasError:oe||F})},children:(0,c.jsx)(q,{variant:d,size:u,mod:[{error:!!g,success:!!_&&!g},k],id:C===`label`?void 0:E,...j(`root`),...A,children:pe})})});Mn.classes=Y,Mn.varsResolver=jn,Mn.displayName=`@mantine/core/InputWrapper`;var Nn={variant:`default`,leftSectionPointerEvents:`none`,rightSectionPointerEvents:`none`,withAria:!0,withErrorStyles:!0,withSuccessStyles:!0,size:`sm`,loading:!1,loadingPosition:`right`},Pn=A((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:h(t.leftSectionWidth),"--input-right-section-width":t.rightSectionWidth===void 0?void 0:h(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}})),X=K(e=>{let t=U(`Input`,Nn,e),{classNames:n,className:r,style:i,styles:a,unstyled:o,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:D,multiline:O,radius:k,id:ee,withAria:te,withErrorStyles:A,withSuccessStyles:j,mod:M,inputSize:N,attributes:ne,__clearSection:P,__clearable:re,__clearSectionMode:ie,__defaultRightSection:ae,loading:oe,loadingPosition:F,__bottomSection:I,__bottomSectionProps:L,rootRef:se,dir:ce,...le}=t,{styleProps:ue,rest:R}=it(le),z=(0,s.use)(vn),de={offsetBottom:z?.offsetBottom,offsetTop:z?.offsetTop},B=W({name:[`Input`,u],props:d||t,classes:Y,className:r,style:i,classNames:n,styles:a,unstyled:o,attributes:ne,stylesCtx:de,rootSelector:`wrapper`,vars:E,varsResolver:Pn}),fe=te?{required:l,disabled:g,"aria-invalid":m?!0:void 0,"aria-describedby":z?.describedBy,id:z?.inputId||ee}:{},V=oe?(0,c.jsx)(nn,{size:F===`left`?`calc(var(--input-left-section-size) / 2)`:`calc(var(--input-right-section-size) / 2)`}):null,pe=oe&&F===`left`?V:_,me=_n({__clearable:re,__clearSection:P,rightSection:oe&&F===`right`?V:b,__defaultRightSection:ae,size:f,__clearSectionMode:ie});return(0,c.jsx)(mn,{value:{size:f||`sm`},children:(0,c.jsxs)(q,{ref:se,dir:ce,...B(`wrapper`),...ue,...p,mod:[{error:!!m&&A,success:!!h&&!m&&j,pointer:D,disabled:g,multiline:O,"data-with-right-section":!!me,"data-with-left-section":!!pe,"data-with-bottom-section":!!I},M],variant:T,size:f,children:[pe&&(0,c.jsx)(`div`,{...v,"data-position":`left`,...B(`section`,{className:v?.className,style:v?.style}),children:pe}),(0,c.jsx)(q,{component:`input`,...R,...fe,required:l,mod:{disabled:g,error:!!m&&A,success:!!h&&!m&&j},variant:T,__size:N,...B(`input`)}),I&&(0,c.jsx)(`div`,{...L,...B(`bottomSection`,{className:L?.className,style:L?.style}),children:I}),me&&(0,c.jsx)(`div`,{...x,"data-position":`right`,...B(`section`,{className:x?.className,style:x?.style}),children:me})]})})});X.classes=Y,X.varsResolver=Pn,X.Wrapper=Mn,X.Label=Tn,X.Error=Sn,X.Success=On,X.Description=bn,X.Placeholder=En,X.ClearButton=hn,X.displayName=`@mantine/core/Input`;function Fn(e,t,n){let r=U([`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:D,mod:O,attributes:k,...ee}=r,{styleProps:te,rest:A}=it(ee),j={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:O,attributes:k,...y};return{...A,classNames:l,styles:u,unstyled:f,wrapperProps:{...j,...te},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:k}}}var In={__staticSelector:`InputBase`,withAria:!0,size:`sm`},Ln=K(e=>{let{inputProps:t,wrapperProps:n,...r}=Fn(`InputBase`,In,e);return(0,c.jsx)(X.Wrapper,{...n,children:(0,c.jsx)(X,{...t,...r})})});Ln.classes={...X.classes,...X.Wrapper.classes},Ln.displayName=`@mantine/core/InputBase`;var Rn={root:`m_66836ed3`,wrapper:`m_a5d60502`,body:`m_667c2793`,title:`m_6a03f287`,label:`m_698f4f23`,icon:`m_667f2a6a`,message:`m_7fa78076`,closeButton:`m_87f54839`},zn=A((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}}}),Bn=G(e=>{let t=U(`Alert`,null,e),{classNames:n,className:r,style:i,styles:a,unstyled:o,vars:s,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=W({name:`Alert`,classes:Rn,props:t,className:r,style:i,classNames:n,styles:a,unstyled:o,attributes:x,vars:s,varsResolver:zn}),w=ee(p),T=d&&`${w}-title`||void 0,E=`${w}-body`;return(0,c.jsx)(q,{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,c.jsxs)(`div`,{...C(`wrapper`),children:[m&&(0,c.jsx)(`div`,{...C(`icon`),children:m}),(0,c.jsxs)(`div`,{...C(`body`),children:[d&&(0,c.jsx)(`div`,{...C(`title`),"data-with-close-button":h||void 0,children:(0,c.jsx)(`span`,{id:T,...C(`label`),children:d})}),f&&(0,c.jsx)(`div`,{id:E,...C(`message`),"data-variant":v,children:f})]}),h&&(0,c.jsx)(cn,{...C(`closeButton`),onClick:g,variant:`transparent`,size:16,iconSize:16,"aria-label":_,unstyled:o})]})})});Bn.classes=Rn,Bn.varsResolver=zn,Bn.displayName=`@mantine/core/Alert`;var Vn={root:`m_b6d8b162`};function Hn(e){if(e===`start`)return`start`;if(e===`end`||e)return`end`}var Un={inherit:!1},Wn=A((e,{variant:t,lineClamp:n,gradient:r,size:i,textWrap:a})=>({root:{"--text-fz":S(i),"--text-lh":C(i),"--text-gradient":t===`gradient`?fe(r,e):void 0,"--text-line-clamp":typeof n==`number`?n.toString():void 0,"--text-text-wrap":a}})),Z=K(e=>{let t=U(`Text`,Un,e),{lineClamp:n,truncate:r,inline:i,inherit:a,gradient:o,span:s,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;return(0,c.jsx)(q,{...W({name:[`Text`,u],props:t,classes:Vn,className:f,style:p,classNames:m,styles:h,unstyled:g,attributes:b,vars:d,varsResolver:Wn})(`root`,{focusable:!0}),component:s?`span`:`p`,variant:_,mod:[{"data-truncate":Hn(r),"data-line-clamp":typeof n==`number`,"data-inline":i,"data-inherit":a},v],size:y,...x})});Z.classes=Vn,Z.varsResolver=Wn,Z.displayName=`@mantine/core/Text`;var Gn={root:`m_77c9d27d`,inner:`m_80f1301b`,label:`m_811560b9`,section:`m_a74036a`,loader:`m_a25b86ee`,group:`m_80d6d844`,groupSection:`m_70be2a01`},Kn={orientation:`horizontal`},qn=A((e,{borderWidth:t})=>({group:{"--button-border-width":h(t)}})),Jn=G(e=>{let t=U(`ButtonGroup`,Kn,e),{className:n,style:r,classNames:i,styles:a,unstyled:o,orientation:s,vars:l,borderWidth:u,mod:d,attributes:f,...p}=U(`ButtonGroup`,Kn,e);return(0,c.jsx)(q,{...W({name:`ButtonGroup`,props:t,classes:Gn,className:n,style:r,classNames:i,styles:a,unstyled:o,attributes:f,vars:l,varsResolver:qn,rootSelector:`group`})(`group`),mod:[{"data-orientation":s},d],role:`group`,...p})});Jn.classes=Gn,Jn.varsResolver=qn,Jn.displayName=`@mantine/core/ButtonGroup`;var Yn=A((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}}}),Xn=G(e=>{let t=U(`ButtonGroupSection`,null,e),{className:n,style:r,classNames:i,styles:a,unstyled:o,vars:s,gradient:l,radius:u,autoContrast:d,attributes:f,...p}=t;return(0,c.jsx)(q,{...W({name:`ButtonGroupSection`,props:t,classes:Gn,className:n,style:r,classNames:i,styles:a,unstyled:o,attributes:f,vars:s,varsResolver:Yn,rootSelector:`groupSection`})(`groupSection`),...p})});Xn.classes=Gn,Xn.varsResolver=Yn,Xn.displayName=`@mantine/core/ButtonGroupSection`;var Zn={in:{opacity:1,transform:`translate(-50%, calc(-50% + ${h(1)}))`},out:{opacity:0,transform:`translate(-50%, -200%)`},common:{transformOrigin:`center`},transitionProperty:`transform, opacity`},Qn=A((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}}}),Q=K(e=>{let t=U(`Button`,null,e),{style:n,vars:r,className:i,color:a,disabled:o,children:s,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=W({name:`Button`,props:t,classes:Gn,className:i,style:n,classNames:_,styles:v,unstyled:y,attributes:C,vars:r,varsResolver:Qn}),E=!!l,D=!!u;return(0,c.jsxs)(Bt,{...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":D},S],...w,children:[typeof m==`boolean`&&(0,c.jsx)(Yt,{mounted:m,transition:Zn,duration:150,children:e=>(0,c.jsx)(q,{component:`span`,...T(`loader`,{style:e}),"aria-hidden":!0,children:(0,c.jsx)(nn,{color:`var(--button-color)`,size:`calc(var(--button-height) / 1.8)`,...h})})}),(0,c.jsxs)(`span`,{...T(`inner`),children:[l&&(0,c.jsx)(q,{component:`span`,...T(`section`),mod:{position:`left`},children:l}),(0,c.jsx)(q,{component:`span`,mod:{loading:m},...T(`label`),children:s}),u&&(0,c.jsx)(q,{component:`span`,...T(`section`),mod:{position:`right`},children:u})]})]})});Q.classes=Gn,Q.varsResolver=Qn,Q.displayName=`@mantine/core/Button`,Q.Group=Jn,Q.GroupSection=Xn;var $n={root:`m_4451eb3a`},er=K(e=>{let t=U(`Center`,null,e),{classNames:n,className:r,style:i,styles:a,unstyled:o,vars:s,inline:l,mod:u,attributes:d,...f}=t,p=W({name:`Center`,props:t,classes:$n,className:r,style:i,classNames:n,styles:a,unstyled:o,attributes:d,vars:s});return(0,c.jsx)(q,{mod:[{inline:l},u],...p(`root`),...f})});er.classes=$n,er.displayName=`@mantine/core/Center`;var tr={root:`m_b183c0a2`},nr=A((e,{color:t})=>({root:{"--code-bg":t?z(t,e):void 0}})),rr=G(e=>{let t=U(`Code`,null,e),{classNames:n,className:r,style:i,styles:a,unstyled:o,vars:s,color:l,block:u,mod:d,attributes:f,...p}=t,m=W({name:`Code`,props:t,classes:tr,className:r,style:i,classNames:n,styles:a,unstyled:o,attributes:f,vars:s,varsResolver:nr});return(0,c.jsx)(q,{component:u?`pre`:`code`,mod:[{block:u},d],...m(`root`),...p,dir:`ltr`})});rr.classes=tr,rr.varsResolver=nr,rr.displayName=`@mantine/core/Code`;var ir={root:`m_7485cace`},ar={strategy:`block`},or=A((e,{size:t,fluid:n})=>({root:{"--container-size":n?void 0:y(t,`container-size`)}})),sr=G(e=>{let t=U(`Container`,ar,e),{classNames:n,className:r,style:i,styles:a,unstyled:o,vars:s,fluid:l,mod:u,attributes:d,strategy:f,...p}=t,m=W({name:`Container`,classes:ir,props:t,className:r,style:i,classNames:n,styles:a,unstyled:o,attributes:d,vars:s,varsResolver:or});return(0,c.jsx)(q,{mod:[{fluid:l,strategy:f},u],...m(`root`),...p})});sr.classes=ir,sr.varsResolver=or,sr.displayName=`@mantine/core/Container`;var cr={root:`m_6d731127`},lr={gap:`md`,align:`stretch`,justify:`flex-start`},ur=A((e,{gap:t,align:n,justify:r})=>({root:{"--stack-gap":b(t),"--stack-align":n,"--stack-justify":r}})),$=G(e=>{let t=U(`Stack`,lr,e),{classNames:n,className:r,style:i,styles:a,unstyled:o,vars:s,align:l,justify:u,gap:d,variant:f,attributes:p,...m}=t;return(0,c.jsx)(q,{...W({name:`Stack`,props:t,classes:cr,className:r,style:i,classNames:n,styles:a,unstyled:o,attributes:p,vars:s,varsResolver:ur})(`root`),variant:f,...m})});$.classes=cr,$.varsResolver=ur,$.displayName=`@mantine/core/Stack`;var dr=G(e=>(0,c.jsx)(Ln,{component:`input`,...U([`Input`,`InputWrapper`,`TextInput`],null,e),__staticSelector:`TextInput`}));dr.classes=Ln.classes,dr.displayName=`@mantine/core/TextInput`;var fr={root:`m_7341320d`},pr=A((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}}}),mr=G(e=>{let t=U(`ThemeIcon`,null,e),{classNames:n,className:r,style:i,styles:a,unstyled:o,vars:s,autoContrast:l,attributes:u,...d}=t;return(0,c.jsx)(q,{...W({name:`ThemeIcon`,classes:fr,props:t,className:r,style:i,classNames:n,styles:a,unstyled:o,attributes:u,vars:s,varsResolver:pr})(`root`),...d})});mr.classes=fr,mr.varsResolver=pr,mr.displayName=`@mantine/core/ThemeIcon`;var hr=[`h1`,`h2`,`h3`,`h4`,`h5`,`h6`],gr=[`xs`,`sm`,`md`,`lg`,`xl`];function _r(e,t){let n=t===void 0?`h${e}`:t;return hr.includes(n)?{fontSize:`var(--mantine-${n}-font-size)`,fontWeight:`var(--mantine-${n}-font-weight)`,lineHeight:`var(--mantine-${n}-line-height)`}:gr.includes(n)?{fontSize:`var(--mantine-font-size-${n})`,fontWeight:`var(--mantine-h${e}-font-weight)`,lineHeight:`var(--mantine-h${e}-line-height)`}:{fontSize:h(n),fontWeight:`var(--mantine-h${e}-font-weight)`,lineHeight:`var(--mantine-h${e}-line-height)`}}var vr={root:`m_8a5d1357`},yr={order:1},br=A((e,{order:t,size:n,lineClamp:r,textWrap:i})=>{let a=_r(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}}}),xr=G(e=>{let t=U(`Title`,yr,e),{classNames:n,className:r,style:i,styles:a,unstyled:o,order:s,vars:l,size:u,variant:d,lineClamp:f,textWrap:p,mod:m,attributes:h,...g}=t,_=W({name:`Title`,props:t,classes:vr,className:r,style:i,classNames:n,styles:a,unstyled:o,attributes:h,vars:l,varsResolver:br});return[1,2,3,4,5,6].includes(s)?(0,c.jsx)(q,{..._(`root`),component:`h${s}`,variant:d,mod:[{order:s,"data-line-clamp":typeof f==`number`},m],size:u,...g}):null});xr.classes=vr,xr.varsResolver=br,xr.displayName=`@mantine/core/Title`;var Sr=new Map([[`bold`,s.createElement(s.Fragment,null,s.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`,s.createElement(s.Fragment,null,s.createElement(`path`,{d:`M216,128l-72,72V56Z`,opacity:`0.2`}),s.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`,s.createElement(s.Fragment,null,s.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`,s.createElement(s.Fragment,null,s.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`,s.createElement(s.Fragment,null,s.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`,s.createElement(s.Fragment,null,s.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`}))]]),Cr=new Map([[`bold`,s.createElement(s.Fragment,null,s.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`,s.createElement(s.Fragment,null,s.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`}),s.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`,s.createElement(s.Fragment,null,s.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`,s.createElement(s.Fragment,null,s.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`,s.createElement(s.Fragment,null,s.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`,s.createElement(s.Fragment,null,s.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`}))]]),wr=new Map([[`bold`,s.createElement(s.Fragment,null,s.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`,s.createElement(s.Fragment,null,s.createElement(`path`,{d:`M216,40V168H168V88H88V40Z`,opacity:`0.2`}),s.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`,s.createElement(s.Fragment,null,s.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`,s.createElement(s.Fragment,null,s.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`,s.createElement(s.Fragment,null,s.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`,s.createElement(s.Fragment,null,s.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`}))]]),Tr=new Map([[`bold`,s.createElement(s.Fragment,null,s.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`,s.createElement(s.Fragment,null,s.createElement(`path`,{d:`M168,100a60,60,0,1,1-60-60A60,60,0,0,1,168,100Z`,opacity:`0.2`}),s.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`,s.createElement(s.Fragment,null,s.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`,s.createElement(s.Fragment,null,s.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`,s.createElement(s.Fragment,null,s.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`,s.createElement(s.Fragment,null,s.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`}))]]),Er=(0,s.createContext)({color:`currentColor`,size:`1em`,weight:`regular`,mirrored:!1}),Dr=s.forwardRef((e,t)=>{let{alt:n,color:r,size:i,weight:a,mirrored:o,children:c,weights:l,...u}=e,{color:d=`currentColor`,size:f,weight:p=`regular`,mirrored:m=!1,...h}=s.useContext(Er);return s.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:o||m?`scale(-1, 1)`:void 0,...h,...u},!!n&&s.createElement(`title`,null,n),c,l.get(a??p))});Dr.displayName=`IconBase`;var Or=s.forwardRef((e,t)=>s.createElement(Dr,{ref:t,...e,weights:Sr}));Or.displayName=`ArrowRightIcon`;var kr=Or,Ar=s.forwardRef((e,t)=>s.createElement(Dr,{ref:t,...e,weights:Cr}));Ar.displayName=`CheckIcon`;var jr=Ar,Mr=s.forwardRef((e,t)=>s.createElement(Dr,{ref:t,...e,weights:wr}));Mr.displayName=`CopyIcon`;var Nr=Mr,Pr=s.forwardRef((e,t)=>s.createElement(Dr,{ref:t,...e,weights:Tr}));Pr.displayName=`UserPlusIcon`;var Fr=Pr,Ir=`fanout.access-token`,Lr=`fanout:unauthorized`;function Rr(){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 zr(e){return!e||typeof e!=`object`||!(`id`in e)||typeof e.id!=`string`||e.id===``?`none`:`user`}function Br(){localStorage.removeItem(Ir)}function Vr(){Br(),window.dispatchEvent(new Event(Lr))}async function Hr(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&&Vr(),r.status===403){let e=await r.clone().json().catch(()=>({}));throw Error(e.message??e.error??`You do not have permission to perform this action.`)}return r}async function Ur(){let e=await Hr(`/api/auth/logout`,{method:`POST`});if(!e.ok&&e.status!==401)throw Error(`Sign-out failed — your session is still active.`);e.status!==401&&Vr(),window.location.assign(`/`)}var Wr={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 Gr({size:e=`regular`}){let t=Wr[e];return(0,c.jsxs)(pn,{component:`span`,gap:t.gap,wrap:`nowrap`,"aria-label":`Fanout`,children:[(0,c.jsx)(Kr,{size:e}),(0,c.jsx)(Z,{component:`span`,fz:t.fontSize,fw:800,lh:1,lts:t.tracking,tt:`uppercase`,children:`Fanout`})]})}function Kr({size:e=`regular`}){let t={small:32,regular:46,large:50}[e];return(0,c.jsx)(mr,{size:t,variant:`transparent`,"aria-hidden":`true`,children:(0,c.jsx)(qr,{})})}function qr(){let e=(0,s.useId)().replace(/[^a-zA-Z0-9-]/g,``),t=`fo-top-${e}`,n=`fo-mid-${e}`,r=`fo-bot-${e}`;return(0,c.jsxs)(`svg`,{viewBox:`35 44 200 200`,width:`100%`,height:`100%`,"aria-hidden":`true`,children:[(0,c.jsxs)(`defs`,{children:[(0,c.jsxs)(`linearGradient`,{id:t,x1:`54`,y1:`52`,x2:`210`,y2:`104`,gradientUnits:`userSpaceOnUse`,children:[(0,c.jsx)(`stop`,{offset:`0`,stopColor:`#5FE8CE`}),(0,c.jsx)(`stop`,{offset:`0.55`,stopColor:`#81E4B9`}),(0,c.jsx)(`stop`,{offset:`1`,stopColor:`#D9F276`})]}),(0,c.jsxs)(`linearGradient`,{id:n,x1:`58`,y1:`112`,x2:`176`,y2:`154`,gradientUnits:`userSpaceOnUse`,children:[(0,c.jsx)(`stop`,{offset:`0`,stopColor:`#536FFF`}),(0,c.jsx)(`stop`,{offset:`0.52`,stopColor:`#41B6F8`}),(0,c.jsx)(`stop`,{offset:`1`,stopColor:`#66D0EE`})]}),(0,c.jsxs)(`linearGradient`,{id:r,x1:`58`,y1:`166`,x2:`145`,y2:`220`,gradientUnits:`userSpaceOnUse`,children:[(0,c.jsx)(`stop`,{offset:`0`,stopColor:`#725BFF`}),(0,c.jsx)(`stop`,{offset:`0.52`,stopColor:`#9A50F4`}),(0,c.jsx)(`stop`,{offset:`1`,stopColor:`#CB55E8`})]})]}),(0,c.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,c.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,c.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})`})]})}var Jr=(0,s.createContext)(null);function Yr(){let e=(0,s.useContext)(Jr);if(!e)throw Error(`Fanout runtime status is unavailable`);return e}async function Xr(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??r.error??`Request failed (${n.status})`);return r}function Zr({children:e,wide:t=!1}){return(0,c.jsx)(q,{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,c.jsx)(er,{mih:`100dvh`,px:`md`,py:48,children:(0,c.jsx)(sr,{size:t?680:480,w:`100%`,children:(0,c.jsx)(Ut,{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 Qr(){return typeof window>`u`?``:new URLSearchParams(window.location.search).get(`setup_token`)??``}function $r(){return typeof window>`u`?``:new URLSearchParams(window.location.search).get(`login_token`)??``}function ei({children:e}){let t=r(),[n,i]=(0,s.useState)(null),[a,o]=(0,s.useState)(!1),[l,u]=(0,s.useState)(`none`),[d,f]=(0,s.useState)(!1),[p,m]=(0,s.useState)(``),[h,g]=(0,s.useState)(``),[_,v]=(0,s.useState)(Qr),[y,b]=(0,s.useState)($r),[x,S]=(0,s.useState)(``),[C,w]=(0,s.useState)(!1),[T,E]=(0,s.useState)(!1),[D,O]=(0,s.useState)(``),[k,ee]=(0,s.useState)(null),[te,A]=(0,s.useState)(!1),j=Rr(),M=l===`user`;(0,s.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,s.useEffect)(()=>{Br(),Xr(`/api/auth/status`).then(i).catch(e=>O(String(e))).finally(()=>o(!0)),fetch(`/api/auth/me`,{credentials:`same-origin`}).then(async e=>{if(!e.ok){u(`none`);return}let t=await e.json().catch(()=>null);u(zr(t))}).catch(()=>u(`none`)).finally(()=>f(!0));let e=()=>u(`none`);return window.addEventListener(Lr,e),()=>window.removeEventListener(Lr,e)},[]),(0,s.useEffect)(()=>{d&&l===`none`&&y&&(E(!0),O(``),Xr(`/api/auth/login-link`,{token:y}).then(()=>u(`user`)).catch(e=>O(e instanceof Error?e.message:String(e))).finally(()=>{b(``),E(!1)}))},[y,d,l]),(0,s.useEffect)(()=>{M&&d&&j&&window.location.replace(j)},[M,j,d]);async function N(){try{await navigator.clipboard.writeText(k?.ingest_token??``),A(!0)}catch{O(`Clipboard access failed. Select and copy the token manually.`)}}if(k?.ingest_token)return(0,c.jsx)(Zr,{wide:!0,children:(0,c.jsxs)($,{gap:`lg`,children:[(0,c.jsx)(Gr,{}),(0,c.jsxs)(`div`,{children:[(0,c.jsx)(Z,{c:`brand`,fw:700,size:`xs`,tt:`uppercase`,lts:`0.12em`,children:`Setup complete`}),(0,c.jsx)(xr,{order:1,mt:`xs`,fz:{base:30,sm:36},fw:650,lh:1.08,children:`Save your ingest token`})]}),(0,c.jsx)(Z,{c:`dimmed`,children:`Fanout shows this token once. Store it with your collector secrets before continuing.`}),(0,c.jsxs)($,{gap:`xs`,children:[(0,c.jsx)(Z,{size:`sm`,fw:600,children:`OTLP endpoint`}),(0,c.jsx)(rr,{block:!0,children:k.suggested_endpoint??`${window.location.hostname}:4317`})]}),(0,c.jsxs)($,{gap:`xs`,children:[(0,c.jsx)(Z,{size:`sm`,fw:600,children:`Header`}),(0,c.jsxs)(rr,{block:!0,children:[k.ingest_header_name??`Authorization`,`: Bearer `,k.ingest_token]})]}),D&&(0,c.jsx)(Bn,{color:`bad`,radius:`md`,children:D}),(0,c.jsxs)(pn,{grow:!0,align:`stretch`,children:[(0,c.jsx)(Q,{variant:`light`,radius:`md`,leftSection:te?(0,c.jsx)(jr,{size:16,weight:`bold`}):(0,c.jsx)(Nr,{size:16}),onClick:()=>void N(),children:te?`Copied`:`Copy token`}),(0,c.jsx)(Q,{radius:`md`,rightSection:(0,c.jsx)(kr,{size:16,weight:`bold`}),onClick:()=>{u(`user`),ee(null)},children:`Continue to Fanout`})]})]})});if(!d||!a||y)return(0,c.jsx)(er,{mih:`100dvh`,children:(0,c.jsx)(nn,{size:`sm`})});if(!n)return(0,c.jsx)(Zr,{children:(0,c.jsxs)($,{gap:`lg`,children:[(0,c.jsx)(Gr,{}),(0,c.jsx)(xr,{order:1,children:`Fanout is unavailable`}),(0,c.jsx)(Bn,{color:`bad`,radius:`md`,children:D||`Authentication status could not be loaded.`})]})});if(M&&j)return null;if(M)return(0,c.jsx)(Jr.Provider,{value:n,children:e});if(n&&!n.setup_required&&n.auth_mode===`oidc`){let e=j?`/api/auth/oidc/start?return_to=${encodeURIComponent(j)}`:`/api/auth/oidc/start`;return(0,c.jsx)(Zr,{children:(0,c.jsxs)($,{gap:28,children:[(0,c.jsx)(Gr,{}),(0,c.jsxs)($,{gap:10,children:[(0,c.jsx)(Z,{c:`brand`,fw:700,size:`xs`,tt:`uppercase`,lts:`0.12em`,children:`Secure workspace`}),(0,c.jsx)(xr,{order:1,fz:{base:30,sm:36},fw:650,lh:1.08,children:`Sign in to investigate`}),(0,c.jsx)(Z,{c:`dimmed`,size:`md`,lh:1.6,children:`Use your organization's identity provider to continue.`})]}),D&&(0,c.jsx)(Bn,{color:`bad`,radius:`md`,children:D}),(0,c.jsx)(Q,{component:`a`,href:e,size:`md`,radius:`md`,rightSection:(0,c.jsx)(kr,{size:17,weight:`bold`}),children:`Continue with SSO`})]})})}async function ne(e){e.preventDefault(),E(!0),O(``);try{if(n?.setup_required){let e=await Xr(`/api/auth/setup`,{email:p,name:h,setup_token:_});e.ingest_token?ee(e):u(`user`)}else C?(await Xr(`/api/auth/verify`,{email:p,code:x}),u(`user`)):(await Xr(`/api/auth/start`,{email:p}),w(!0))}catch(e){O(e instanceof Error?e.message:String(e))}finally{E(!1)}}return(0,c.jsx)(Zr,{children:(0,c.jsxs)($,{gap:28,children:[(0,c.jsx)(Gr,{}),(0,c.jsxs)($,{gap:10,children:[(0,c.jsx)(Z,{c:`brand`,fw:700,size:`xs`,tt:`uppercase`,lts:`0.12em`,children:n?.setup_required?`One-time setup`:`Secure workspace`}),(0,c.jsx)(xr,{order:1,fz:{base:30,sm:36},fw:650,lh:1.08,children:n?.setup_required?`Create the first admin`:n?.self_signup?`Sign in or create an account`:`Sign in to investigate`}),(0,c.jsx)(Z,{c:`dimmed`,size:`md`,lh:1.6,maw:390,children:n?.setup_required?`Use the one-time token printed by the Fanout process.`:n?.smtp_configured?C?`Enter the verification code sent 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.`})]}),(0,c.jsx)(`form`,{onSubmit:ne,children:(0,c.jsxs)($,{gap:`md`,children:[(0,c.jsx)(dr,{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,c.jsx)(dr,{label:`Name`,placeholder:`Your name`,value:h,onChange:e=>g(e.currentTarget.value),variant:`filled`,radius:`md`,size:`md`}),n?.setup_required&&(0,c.jsx)(dr,{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`}),!n?.setup_required&&C&&(0,c.jsx)(dr,{label:`Verification code`,placeholder:`000000`,required:!0,value:x,onChange:e=>S(e.currentTarget.value),autoComplete:`one-time-code`,variant:`filled`,radius:`md`,size:`md`,styles:{input:{letterSpacing:`0.2em`,fontVariantNumeric:`tabular-nums`}},autoFocus:!0}),D&&(0,c.jsx)(Bn,{color:`bad`,radius:`md`,children:D}),(0,c.jsx)(Q,{type:`submit`,size:`md`,radius:`md`,mt:4,loading:T,disabled:!n||!n.setup_required&&!n.smtp_configured,leftSection:n?.setup_required?(0,c.jsx)(Fr,{size:17,weight:`bold`}):void 0,rightSection:n?.setup_required?void 0:(0,c.jsx)(kr,{size:17,weight:`bold`}),children:n?.setup_required?`Create admin`:C?`Verify code`:`Send code`})]})})]})})}export{te as $,rt as A,ge as B,Bt as C,jt as D,G as E,Ie as F,V as G,Ce as H,Fe as I,z as J,B as K,De as L,W as M,Re as N,Dt as O,U as P,A as Q,he as R,Ut as S,K as T,ve as U,we as V,pe as W,ie as X,R as Y,M as Z,X as _,Ur as a,x as at,nn as b,xr as c,b as ct,sr as d,h as dt,ee as et,er as f,d as ft,Ln as g,Bn as h,Hr as i,S as it,tt as j,Et as k,dr as l,_ as lt,Z as m,o as mt,Yr as n,O as nt,jr as o,w as ot,Q as p,l as pt,de as q,Gr as r,D as rt,Dr as s,y as st,ei as t,k as tt,$ as u,g as ut,pn as v,q as w,Yt as x,cn as y,H as z}; \ No newline at end of file diff --git a/internal/ui/dist/assets/chat._threadId-Bn3zmcjJ.js b/internal/ui/dist/assets/chat._threadId-Bn3zmcjJ.js new file mode 100644 index 00000000..82cec604 --- /dev/null +++ b/internal/ui/dist/assets/chat._threadId-Bn3zmcjJ.js @@ -0,0 +1 @@ +import{n as e}from"./index-Ckl_dWuh.js";var t=e;export{t as component}; \ No newline at end of file diff --git a/internal/ui/dist/assets/chat._threadId-DuBrYsq9.js b/internal/ui/dist/assets/chat._threadId-DuBrYsq9.js deleted file mode 100644 index 8a387084..00000000 --- a/internal/ui/dist/assets/chat._threadId-DuBrYsq9.js +++ /dev/null @@ -1 +0,0 @@ -import{n as e}from"./index-Cnw6TNqL.js";var t=e;export{t as component}; \ No newline at end of file diff --git a/internal/ui/dist/assets/chat.index-9CJIOrfA.js b/internal/ui/dist/assets/chat.index-B-B4AZ2m.js similarity index 75% rename from internal/ui/dist/assets/chat.index-9CJIOrfA.js rename to internal/ui/dist/assets/chat.index-B-B4AZ2m.js index 518348d0..4484600b 100644 --- a/internal/ui/dist/assets/chat.index-9CJIOrfA.js +++ b/internal/ui/dist/assets/chat.index-B-B4AZ2m.js @@ -1 +1 @@ -import{a as e,g as t,t as n,u as r}from"./useNavigate-BEpS2iE5.js";import{i}from"./index-Cnw6TNqL.js";var a=t(r()),o=e();function s(){let e=(0,a.useMemo)(()=>i(),[]);return(0,o.jsx)(n,{to:`/chat/$threadId`,params:{threadId:e},replace:!0})}export{s as component}; \ No newline at end of file +import{a as e,g as t,t as n,u as r}from"./useNavigate-BEpS2iE5.js";import{i}from"./index-Ckl_dWuh.js";var a=t(r()),o=e();function s(){let e=(0,a.useMemo)(()=>i(),[]);return(0,o.jsx)(n,{to:`/chat/$threadId`,params:{threadId:e},replace:!0})}export{s as component}; \ No newline at end of file diff --git a/internal/ui/dist/assets/dashboard-Bf0GrxUB.js b/internal/ui/dist/assets/dashboard-EEbwGLTY.js similarity index 51% rename from internal/ui/dist/assets/dashboard-Bf0GrxUB.js rename to internal/ui/dist/assets/dashboard-EEbwGLTY.js index 5e0146db..8ac6ac98 100644 --- a/internal/ui/dist/assets/dashboard-Bf0GrxUB.js +++ b/internal/ui/dist/assets/dashboard-EEbwGLTY.js @@ -1,5 +1,5 @@ -import{a as e,d as t,g as n,u as r}from"./useNavigate-BEpS2iE5.js";import{A as i,D as a,E as o,I as s,J as c,M as l,N as u,O as d,P as f,Q as p,S as m,T as h,V as g,Z as _,_ as v,at as y,b,c as x,ct as S,dt as C,et as w,f as T,g as E,h as ee,i as D,it as te,j as O,k,l as A,lt as j,m as M,mt as ne,o as re,p as N,s as ie,st as ae,u as oe,v as se,w as P}from"./auth-TmbGk91l.js";import{A as F,C as ce,D as le,E as I,M as ue,O as L,S as de,_ as fe,a as pe,b as me,c as he,d as ge,f as _e,g as R,h as z,i as ve,j as B,k as V,l as ye,m as H,o as be,p as U,s as W,u as xe,v as Se,w as Ce,x as G,y as we}from"./index-Cnw6TNqL.js";var K=n(r(),1);function Te(e){let t=(0,K.useRef)(void 0);return(0,K.useEffect)(()=>{t.current=e},[e]),t.current}var q=e();function Ee(e,t=document){let n=t.querySelector(e);if(n)return n;let r=t.querySelectorAll(`*`);for(let t=0;t{let t=f(`Flex`,null,e),{classNames:n,className:r,style:a,styles:o,unstyled:c,vars:u,gap:p,rowGap:m,columnGap:h,align:_,justify:v,wrap:y,direction:b,attributes:x,...S}=t,C=l({name:`Flex`,classes:ke,props:t,className:r,style:a,classNames:n,styles:o,unstyled:c,attributes:x,vars:u}),w=s(),T=d(),E=k({styleProps:{gap:p,rowGap:m,columnGap:h,align:_,justify:v,wrap:y,direction:b},theme:w,data:Oe}),ee=g(),D=ee&&E.hasResponsiveStyles?i(E.styles,E.media):T;return(0,q.jsxs)(q.Fragment,{children:[E.hasResponsiveStyles&&(0,q.jsx)(O,{selector:`.${D}`,styles:E.styles,media:E.media,deduplicate:ee}),(0,q.jsx)(P,{...C(`root`,{className:D,style:j(E.inlineStyles)}),...S})]})});X.classes=ke,X.displayName=`@mantine/core/Flex`;function Ae(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=>Ae(e))}:typeof e==`number`||typeof e==`bigint`||typeof e==`boolean`?{value:e,label:`${e}`}:e}function je(e){return e?e.map(e=>Ae(e)):[]}function Me(e){return e.reduce((e,t)=>`group`in t?{...e,...Me(t.items)}:(e[`${t.value}`]=t,e),{})}var Z={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`},Ne={error:null},Pe=p((e,{size:t,color:n})=>({chevron:{"--combobox-chevron-size":ae(t,`combobox-chevron-size`),"--combobox-chevron-color":n?c(n,e):void 0}})),Fe=o(e=>{let t=f(`ComboboxChevron`,Ne,e),{size:n,error:r,style:i,className:a,classNames:o,styles:s,unstyled:c,vars:u,attributes:d,mod:p,...m}=t,h=l({name:`ComboboxChevron`,classes:Z,props:t,style:i,className:a,classNames:o,styles:s,unstyled:c,vars:u,varsResolver:Pe,attributes:d,rootSelector:`chevron`});return(0,q.jsx)(P,{component:`svg`,...m,...h(`chevron`),size:n,viewBox:`0 0 15 15`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`,mod:[`combobox-chevron`,{error:r},p],children:(0,q.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`})})});Fe.classes=Z,Fe.varsResolver=Pe,Fe.displayName=`@mantine/core/ComboboxChevron`;var[Ie,Le]=B(`Combobox component was not found in tree`);function Re({onMouseDown:e,onClick:t,onClear:n,...r}){return(0,q.jsx)(v.ClearButton,{tabIndex:-1,"aria-hidden":!0,...r,onMouseDown:t=>{t.preventDefault(),e?.(t)},onClick:e=>{n(),t?.(e)}})}Re.displayName=`@mantine/core/ComboboxClearButton`;var ze=o(e=>{let{classNames:t,styles:n,className:r,style:i,hidden:a,...o}=f(`ComboboxDropdown`,null,e),s=Le();return(0,q.jsx)(ce.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})})});ze.classes=Z,ze.displayName=`@mantine/core/ComboboxDropdown`;var Be={refProp:`ref`},Ve=o(e=>{let{children:t,refProp:n,ref:r}=f(`ComboboxDropdownTarget`,Be,e);if(Le(),!ue(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,q.jsx)(ce.Target,{ref:r,refProp:n,children:t})});Ve.displayName=`@mantine/core/ComboboxDropdownTarget`;var He=o(e=>{let{classNames:t,className:n,style:r,styles:i,vars:a,...o}=f(`ComboboxEmpty`,null,e);return(0,q.jsx)(P,{...Le().getStyles(`empty`,{className:n,classNames:t,styles:i,style:r}),...o})});He.classes=Z,He.displayName=`@mantine/core/ComboboxEmpty`;function Ue({onKeyDown:e,onClick:t,withKeyboardNavigation:n,withAriaAttributes:r,withExpandedAttribute:i,targetType:a,autoComplete:o}){let s=Le(),[c,l]=(0,K.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 We={refProp:`ref`,targetType:`input`,withKeyboardNavigation:!0,withAriaAttributes:!0,withExpandedAttribute:!1,autoComplete:`off`},Ge=o(e=>{let{children:t,refProp:n,withKeyboardNavigation:r,withAriaAttributes:i,withExpandedAttribute:a,targetType:o,autoComplete:s,ref:c,...l}=f(`ComboboxEventsTarget`,We,e),u=le(t);if(!u)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 d=Le();return(0,K.cloneElement)(u,{...Ue({targetType:o,withAriaAttributes:i,withKeyboardNavigation:r,withExpandedAttribute:a,onKeyDown:u.props.onKeyDown,onClick:u.props.onClick,autoComplete:s}),...l,[n]:F(c,d.store.targetRef,L(u))})});Ge.displayName=`@mantine/core/ComboboxEventsTarget`;var Ke=o(e=>{let{classNames:t,className:n,style:r,styles:i,vars:a,...o}=f(`ComboboxFooter`,null,e);return(0,q.jsx)(P,{...Le().getStyles(`footer`,{className:n,classNames:t,style:r,styles:i}),...o,onMouseDown:e=>{e.preventDefault()}})});Ke.classes=Z,Ke.displayName=`@mantine/core/ComboboxFooter`;var qe=o(e=>{let{classNames:t,className:n,style:r,styles:i,vars:a,children:o,label:s,id:c,...l}=f(`ComboboxGroup`,null,e),u=Le(),d=w(c),p=s!=null&&s!==!1&&s!==``;return(0,q.jsxs)(P,{role:`group`,"aria-labelledby":p?d:void 0,...u.getStyles(`group`,{className:n,classNames:t,style:r,styles:i}),...l,children:[p&&(0,q.jsx)(`div`,{id:d,...u.getStyles(`groupLabel`,{classNames:t,styles:i}),children:s}),o]})});qe.classes=Z,qe.displayName=`@mantine/core/ComboboxGroup`;var Je=o(e=>{let{classNames:t,className:n,style:r,styles:i,vars:a,...o}=f(`ComboboxHeader`,null,e);return(0,q.jsx)(P,{...Le().getStyles(`header`,{className:n,classNames:t,style:r,styles:i}),...o,onMouseDown:e=>{e.preventDefault()}})});Je.classes=Z,Je.displayName=`@mantine/core/ComboboxHeader`;function Ye({value:e,valuesDivider:t=`,`,...n}){return(0,q.jsx)(`input`,{type:`hidden`,value:Array.isArray(e)?e.join(t):e?`${e}`:``,...n})}Ye.displayName=`@mantine/core/ComboboxHiddenInput`;var Xe=o(e=>{let t=f(`ComboboxOption`,null,e),{classNames:n,className:r,style:i,styles:a,vars:o,onClick:s,id:c,active:l,onMouseDown:u,onMouseOver:d,disabled:p,selected:m,mod:h,...g}=t,_=Le(),v=(0,K.useId)(),y=c||v;return(0,q.jsx)(P,{..._.getStyles(`option`,{className:r,classNames:n,styles:a,style:i}),...g,id:y,mod:[`combobox-option`,{"combobox-active":l,"combobox-disabled":p,"combobox-selected":m},h],role:`option`,onClick:e=>{p?e.preventDefault():(_.onOptionSubmit?.(t.value,t),s?.(e))},onMouseDown:e=>{e.preventDefault(),u?.(e)},onMouseOver:e=>{_.resetSelectionOnOptionHover&&_.store.resetSelectedOption(),d?.(e)}})});Xe.classes=Z,Xe.displayName=`@mantine/core/ComboboxOption`;var Ze=o(e=>{let{classNames:t,className:n,style:r,styles:i,id:a,onMouseDown:o,labelledBy:s,...c}=f(`ComboboxOptions`,null,e),l=Le(),u=w(a);return(0,K.useEffect)(()=>{l.store.setListId(u)},[u]),(0,q.jsx)(P,{...l.getStyles(`options`,{className:n,style:r,classNames:t,styles:i}),...c,id:u,role:`listbox`,"aria-labelledby":s,onMouseDown:e=>{e.preventDefault(),o?.(e)}})});Ze.classes=Z,Ze.displayName=`@mantine/core/ComboboxOptions`;var Qe={withAriaAttributes:!0,withKeyboardNavigation:!0},$e=o(e=>{let{classNames:t,styles:n,unstyled:r,vars:i,withAriaAttributes:a,onKeyDown:o,onClick:s,withKeyboardNavigation:c,size:l,ref:u,...d}=f(`ComboboxSearch`,Qe,e),p=Le(),m=p.getStyles(`search`),h=Ue({targetType:`input`,withAriaAttributes:a,withKeyboardNavigation:c,withExpandedAttribute:!1,onKeyDown:o,onClick:s,autoComplete:`off`});return(0,q.jsx)(v,{ref:F(u,p.store.searchRef),classNames:[{input:m.className},t],styles:[{input:m.style},n],size:l||p.size,...h,...d,__staticSelector:`Combobox`})});$e.classes=Z,$e.displayName=`@mantine/core/ComboboxSearch`;var et={refProp:`ref`,targetType:`input`,withKeyboardNavigation:!0,withAriaAttributes:!0,withExpandedAttribute:!1,autoComplete:`off`},tt=o(e=>{let{children:t,refProp:n,withKeyboardNavigation:r,withAriaAttributes:i,withExpandedAttribute:a,targetType:o,autoComplete:s,ref:c,...l}=f(`ComboboxTarget`,et,e),u=le(t);if(!u)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 d=Le(),p=(0,K.cloneElement)(u,{...Ue({targetType:o,withAriaAttributes:i,withKeyboardNavigation:r,withExpandedAttribute:a,onKeyDown:u.props.onKeyDown,onClick:u.props.onClick,autoComplete:s}),...l});return(0,q.jsx)(ce.Target,{refProp:n,ref:F(c,d.store.targetRef),children:p})});tt.displayName=`@mantine/core/ComboboxTarget`;function nt(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 rt(e,t,n){for(let n=e+1;n{s||(c(!0),i?.(e))},[c,i,s]),_=(0,K.useCallback)((e=`unknown`)=>{s&&(c(!1),r?.(e))},[c,r,s]),v=(0,K.useCallback)((e=`unknown`)=>{s?_(e):g(e)},[_,g,s]),y=(0,K.useCallback)(()=>{let e=Y(f.current),t=Ee(`#${l.current} [data-combobox-selected]`,e);t?.removeAttribute(`data-combobox-selected`),t?.removeAttribute(`aria-selected`)},[]),b=(0,K.useCallback)(e=>{let t=Y(f.current),n=Ee(`#${l.current}`,t),r=n?J(`[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].setAttribute(`aria-selected`,`true`),r[i].scrollIntoView({block:`nearest`,behavior:o}),r[i].id):null},[o,y]),x=(0,K.useCallback)(()=>{let e=Y(f.current),t=Ee(`#${l.current} [data-combobox-active]`,e);if(t){let n=J(`#${l.current} [data-combobox-option]`,e).findIndex(e=>e===t);return b(n)}return b(0)},[b]),S=(0,K.useCallback)(()=>{let e=Y(f.current),t=J(`#${l.current} [data-combobox-option]`,e);return b(rt(u.current,t,a))},[b,a]),C=(0,K.useCallback)(()=>{let e=Y(f.current),t=J(`#${l.current} [data-combobox-option]`,e);return b(nt(u.current,t,a))},[b,a]),w=(0,K.useCallback)(()=>{let e=Y(f.current),t=J(`#${l.current} [data-combobox-option]`,e);return b(it(t))},[b]),T=(0,K.useCallback)((e=`selected`,t)=>{if(typeof e==`number`){u.current=e;let n=Y(f.current),r=J(`#${l.current} [data-combobox-option]`,n);t?.scrollIntoView&&r[e]?.scrollIntoView({block:`nearest`,behavior:o});return}h.current=window.setTimeout(()=>{let n=Y(f.current),r=J(`#${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,K.useCallback)(()=>{u.current=-1,y()},[y]),ee=(0,K.useCallback)(()=>{let e=Y(f.current);(J(`#${l.current} [data-combobox-option]`,e)?.[u.current])?.click()},[]),D=(0,K.useCallback)(e=>{l.current=e},[]),te=(0,K.useCallback)(()=>{p.current=window.setTimeout(()=>d.current?.focus(),0)},[]),O=(0,K.useCallback)(()=>{m.current=window.setTimeout(()=>f.current?.focus(),0)},[]),k=(0,K.useCallback)(()=>u.current,[]);return(0,K.useEffect)(()=>()=>{window.clearTimeout(p.current),window.clearTimeout(m.current),window.clearTimeout(h.current)},[]),{dropdownOpened:s,openDropdown:g,closeDropdown:_,toggleDropdown:v,selectedOptionIndex:u.current,getSelectedOptionIndex:k,selectOption:b,selectFirstOption:w,selectActiveOption:x,selectNextOption:S,selectPreviousOption:C,resetSelectedOption:E,updateSelectedOptionIndex:T,listId:l.current,setListId:D,clickSelectedOption:ee,searchRef:d,focusSearchInput:te,targetRef:f,focusTarget:O}}var ot={keepMounted:!0,keepMountedMode:`display-none`,withinPortal:!0,resetSelectionOnOptionHover:!1,width:`target`,transitionProps:{transition:`fade`,duration:0},size:`sm`},st=p((e,{size:t,dropdownPadding:n})=>({options:{"--combobox-option-fz":te(t),"--combobox-option-padding":ae(t,`combobox-option-padding`)},dropdown:{"--combobox-padding":n===void 0?void 0:C(n),"--combobox-option-fz":te(t),"--combobox-option-padding":ae(t,`combobox-option-padding`)}})),Q=e=>{let t=f(`Combobox`,ot,e),{classNames:n,styles:r,unstyled:i,children:a,store:o,vars:s,onOptionSubmit:c,onClose:u,size:d,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=at(),C=o||S,w=l({name:h||`Combobox`,classes:Z,props:t,classNames:n,styles:r,unstyled:i,attributes:_,vars:s,varsResolver:st}),T=()=>{u?.(),C.closeDropdown()};return(0,q.jsx)(Ie,{value:{getStyles:w,store:C,onOptionSubmit:c,size:d,resetSelectionOnOptionHover:m,readOnly:g,floatingHeight:v},children:(0,q.jsx)(ce,{opened:C.dropdownOpened,...b,middlewares:x,onChange:e=>!e&&T(),withRoles:!1,unstyled:i,children:a})})};Q.extend=e=>e,Q.classes=Z,Q.varsResolver=st,Q.displayName=`@mantine/core/Combobox`,Q.Target=tt,Q.Dropdown=ze,Q.Options=Ze,Q.Option=Xe,Q.Search=$e,Q.Empty=He,Q.Chevron=Fe,Q.Footer=Ke,Q.Header=Je,Q.EventsTarget=Ge,Q.DropdownTarget=Ve,Q.Group=qe,Q.ClearButton=Re,Q.HiddenInput=Ye;function ct(e){return`group`in e}function lt({options:e,search:t,limit:n}){let r=t.trim().toLowerCase(),i=[];for(let a=0;a0)return!1;return!0}function dt(e,t=new Set){if(Array.isArray(e))for(let n of e)if(ct(n))dt(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 ft(e,t){return Array.isArray(e)?e.includes(t):e===t}function pt({data:e,withCheckIcon:t,withAlignedLabels:n,value:r,checkIconPosition:i,unstyled:a,renderOption:o}){if(!ct(e)){let s=ft(r,e.value),c=t&&(s?(0,q.jsx)(G,{className:Z.optionsDropdownCheckIcon}):n?(0,q.jsx)(`div`,{className:Z.optionsDropdownCheckPlaceholder}):null),l=(0,q.jsxs)(q.Fragment,{children:[i===`left`&&c,(0,q.jsx)(`span`,{children:e.label}),i===`right`&&c]});return(0,q.jsx)(Q.Option,{value:e.value,disabled:e.disabled,className:_({[Z.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,q.jsx)(pt,{data:e,value:r,unstyled:a,withCheckIcon:t,withAlignedLabels:n,checkIconPosition:i,renderOption:o},`${e.value}`));return(0,q.jsx)(Q.Group,{label:e.group,children:s})}function mt({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=Le();dt(e);let x=typeof i==`string`?(r||lt)({options:e,search:l?i:``,limit:a??1/0}):e,S=ut(x),C=x.map((e,t)=>(0,q.jsx)(pt,{data:e,withCheckIcon:u,withAlignedLabels:d,value:f,checkIconPosition:p,unstyled:h,renderOption:_},ct(e)?`group-${typeof e.group==`string`?e.group:t}`:`${e.value}`));return(0,q.jsx)(Q.Dropdown,{hidden:t||n&&S,"data-composed":!0,children:(0,q.jsxs)(Q.Options,{labelledBy:g,"aria-label":y,children:[c?(0,q.jsx)(Ce.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,q.jsx)(Q.Empty,{children:m})]})})}var ht={root:`m_347db0ec`,"root--dot":`m_fbd81e3d`,label:`m_5add502a`,section:`m_91fdda9b`},gt=p((e,{radius:t,color:n,gradient:r,variant:i,size:a,autoContrast:o,circle:s})=>{let l=e.variantColorResolver({color:n||e.primaryColor,theme:e,gradient:r,variant:i||`filled`,autoContrast:o});return{root:{"--badge-height":ae(a,`badge-height`),"--badge-padding-x":ae(a,`badge-padding-x`),"--badge-fz":ae(a,`badge-fz`),"--badge-radius":s||t===void 0?void 0:y(t),"--badge-bg":n||i?l.background:void 0,"--badge-color":n||i?l.color:void 0,"--badge-bd":n||i?l.border:void 0,"--badge-dot-color":i===`dot`?c(n,e):void 0}}}),_t=h(e=>{let t=f(`Badge`,null,e),{classNames:n,className:r,style:i,styles:a,unstyled:o,vars:s,radius:c,color:u,gradient:d,leftSection:p,rightSection:m,children:h,variant:g,fullWidth:_,autoContrast:v,circle:y,mod:b,attributes:x,...S}=t,C=l({name:`Badge`,props:t,classes:ht,className:r,style:i,classNames:n,styles:a,unstyled:o,attributes:x,vars:s,varsResolver:gt});return(0,q.jsxs)(P,{variant:g,mod:[{block:_,circle:y,"with-right-section":!!m,"with-left-section":!!p},b],...C(`root`,{variant:g}),...S,children:[p&&(0,q.jsx)(`span`,{...C(`section`),"data-position":`left`,children:p}),(0,q.jsx)(`span`,{...C(`label`),children:h}),m&&(0,q.jsx)(`span`,{...C(`section`),"data-position":`right`,children:m})]})});_t.classes=ht,_t.varsResolver=gt,_t.displayName=`@mantine/core/Badge`;function vt(e){let t=e.currentTarget;return Y(t).activeElement!==t}function yt(e=`top-end`,t=0){let n={"--indicator-top":void 0,"--indicator-bottom":void 0,"--indicator-left":void 0,"--indicator-right":void 0,"--indicator-translate-x":void 0,"--indicator-translate-y":void 0},r=typeof t==`number`?t:t.x,i=typeof t==`number`?t:t.y,a=C(r),o=C(i),[s,c]=e.split(`-`);return s===`top`&&(n[`--indicator-top`]=o,n[`--indicator-translate-y`]=`-50%`),s===`middle`&&(n[`--indicator-top`]=`50%`,n[`--indicator-translate-y`]=`-50%`),s===`bottom`&&(n[`--indicator-bottom`]=o,n[`--indicator-translate-y`]=`50%`),c===`start`&&(n[`--indicator-left`]=a,n[`--indicator-translate-x`]=`-50%`),c===`center`&&(n[`--indicator-left`]=`50%`,n[`--indicator-translate-x`]=`-50%`),c===`end`&&(n[`--indicator-right`]=a,n[`--indicator-translate-x`]=`50%`),n}var bt={root:`m_e5262200`,indicator:`m_760d1fb1`,processing:`m_885901b1`},xt={position:`top-end`,offset:0,showZero:!0},St=p((e,{color:t,position:n,offset:r,size:i,radius:a,zIndex:o,autoContrast:s})=>({root:{"--indicator-color":t?c(t,e):void 0,"--indicator-text-color":De(s,e)?I({color:t,theme:e,autoContrast:s}):void 0,"--indicator-size":C(i),"--indicator-radius":a===void 0?void 0:y(a),"--indicator-z-index":o?.toString(),...yt(n,r)}})),Ct=o(e=>{let t=f(`Indicator`,xt,e),{classNames:n,className:r,style:i,styles:a,unstyled:o,vars:s,children:c,position:u,offset:d,inline:p,label:m,radius:h,color:g,withBorder:_,disabled:v,processing:y,zIndex:b,autoContrast:x,maxValue:S,showZero:C,mod:w,attributes:T,...E}=t,ee=l({name:`Indicator`,classes:bt,props:t,className:r,style:i,classNames:n,styles:a,unstyled:o,attributes:T,vars:s,varsResolver:St}),D=!C&&(m===0||m===`0`),te=S!==void 0&&typeof m==`number`&&m>S?`${S}+`:m;return(0,q.jsxs)(P,{...ee(`root`),mod:[{inline:p},w],...E,children:[!v&&!D&&(0,q.jsx)(P,{mod:{"with-label":!!m,"with-border":_,processing:y},...ee(`indicator`),children:te}),c]})});Ct.classes=bt,Ct.varsResolver=St,Ct.displayName=`@mantine/core/Indicator`;function wt(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}var Tt={size:`sm`,withCheckIcon:!0,allowDeselect:!0,checkIconPosition:`left`,openOnFocus:!0},Et=a(e=>{let t=f([`Input`,`InputWrapper`,`Select`],Tt,e),{classNames:n,styles:r,unstyled:i,vars:a,dropdownOpened:o,defaultDropdownOpened:s,onDropdownClose:c,onDropdownOpen:l,onFocus:d,onBlur:p,onClick:m,onChange:h,data:g,value:_,defaultValue:v,selectFirstOptionOnChange:y,selectFirstOptionOnDropdownOpen:b,onOptionSubmit:x,comboboxProps:S,readOnly:C,disabled:T,filter:ee,limit:D,withScrollArea:te,maxDropdownHeight:O,floatingHeight:k,size:A,searchable:j,rightSection:M,checkIconPosition:ne,withCheckIcon:re,withAlignedLabels:N,nothingFoundMessage:ie,name:ae,form:oe,searchValue:se,defaultSearchValue:P,onSearchChange:F,allowDeselect:ce,error:le,rightSectionPointerEvents:I,id:ue,clearable:L,clearSectionMode:de,clearButtonProps:fe,hiddenInputProps:pe,renderOption:me,onClear:he,autoComplete:ge,scrollAreaProps:_e,__defaultRightSection:R,__clearSection:z,__clearable:ve,chevronColor:B,autoSelectOnBlur:ye,openOnFocus:H,attributes:be,...U}=t,W=(0,K.useMemo)(()=>je(g),[g]),xe=(0,K.useRef)({}),Se=(0,K.useMemo)(()=>Me(W),[W]),Ce=w(ue),[G,we,Ee]=V({value:_,defaultValue:v,finalValue:null,onChange:h}),J=G==null?void 0:`${G}`in Se?Se[`${G}`]:xe.current[`${G}`],Y=Te(J),[De,Oe,ke]=V({value:se,defaultValue:P,finalValue:J?J.label:``,onChange:F}),X=at({opened:o,defaultOpened:s,onDropdownOpen:()=>{l?.(),b?X.selectFirstOption():X.updateSelectedOptionIndex(`active`,{scrollIntoView:!0})},onDropdownClose:()=>{c?.(),setTimeout(X.resetSelectedOption,0)}}),Ae=e=>{Oe(e),X.resetSelectedOption()},{resolvedClassNames:Z,resolvedStyles:Ne}=u({props:t,styles:r,classNames:n});(0,K.useEffect)(()=>{y&&X.selectFirstOption()},[y,De]),(0,K.useEffect)(()=>{_===null&&Ae(``),_!=null&&J&&(Y?.value!==J.value||Y?.label!==J.label)&&Ae(J.label)},[_,J]),(0,K.useEffect)(()=>{!Ee&&!ke&&Ae(G==null?``:`${G}`in Se?Se[`${G}`]?.label:xe.current[`${G}`]?.label||``)},[Se,G]),(0,K.useEffect)(()=>{G&&`${G}`in Se&&(xe.current[`${G}`]=Se[`${G}`])},[Se,G]);let Pe=(0,q.jsx)(Q.ClearButton,{...fe,onClear:()=>{we(null,null),Ae(``),he?.()}}),Fe=L&&G!=null&&!T&&!C;return(0,q.jsxs)(q.Fragment,{children:[(0,q.jsxs)(Q,{store:X,__staticSelector:`Select`,classNames:Z,styles:Ne,unstyled:i,readOnly:C,size:A,attributes:be,floatingHeight:k,keepMounted:ye,onOptionSubmit:e=>{x?.(e);let t=ce&&`${Se[e].value}`==`${G}`?null:Se[e],n=t?t.value:null;n!==G&&we(n,t),!Ee&&Ae(n==null?``:t?.label||``),X.closeDropdown()},...S,children:[(0,q.jsx)(Q.Target,{targetType:j?`input`:`button`,autoComplete:ge,withExpandedAttribute:!0,children:(0,q.jsx)(E,{id:Ce,__defaultRightSection:(0,q.jsx)(Q.Chevron,{size:A,error:le,unstyled:i,color:B}),__clearSection:Pe,__clearable:Fe,__clearSectionMode:de,rightSection:M,rightSectionPointerEvents:I||`none`,...U,size:A,__staticSelector:`Select`,disabled:T,readOnly:C||!j,value:De,onChange:e=>{if(vt(e)){if(!C){let t=wt(Se,e.currentTarget.value);t&&`${t.value}`!=`${G}`&&(we(t.value,t),!Ee&&Ae(t.label))}return}Ae(e.currentTarget.value),X.openDropdown(),y&&X.selectFirstOption()},onFocus:e=>{H&&j&&X.openDropdown(),d?.(e)},onBlur:e=>{ye&&X.clickSelectedOption(),j&&X.closeDropdown();let t=G!=null&&(`${G}`in Se?Se[`${G}`]:xe.current[`${G}`]);Ae(t&&t.label||``),p?.(e)},onClick:e=>{j?X.openDropdown():X.toggleDropdown(),m?.(e)},classNames:Z,styles:Ne,unstyled:i,pointer:!j,error:le,attributes:be})}),(0,q.jsx)(mt,{data:W,hidden:C||T,filter:ee,search:De,limit:D,hiddenWhenEmpty:!ie,withScrollArea:te,maxDropdownHeight:O,filterOptions:!!j&&J?.label!==De,value:G,checkIconPosition:ne,withCheckIcon:re,withAlignedLabels:N,nothingFoundMessage:ie,unstyled:i,labelId:U.label?`${Ce}-label`:void 0,"aria-label":U.label?void 0:U[`aria-label`],renderOption:me,scrollAreaProps:_e})]}),(0,q.jsx)(Q.HiddenInput,{value:G,name:ae,form:oe,disabled:T,...pe})]})});Et.classes={...E.classes,...Q.classes},Et.displayName=`@mantine/core/Select`;var[Dt,Ot]=B(`Table component was not found in the tree`),kt={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 At(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 jt(e,t){let n=`Table${e.charAt(0).toUpperCase()}${e.slice(1)}`,r=o(r=>{let i=f(n,{},r),{classNames:a,className:o,style:s,styles:c,...l}=i,u=Ot();return(0,q.jsx)(P,{component:e,...At(u,t),...u.getStyles(e,{className:o,classNames:a,style:s,styles:c,props:i}),...l})});return r.displayName=`@mantine/core/${n}`,r.classes=kt,r}var Mt=jt(`th`,{columnBorder:!0}),Nt=jt(`td`,{columnBorder:!0}),Pt=jt(`tr`,{rowBorder:!0,striped:!0,highlightOnHover:!0}),Ft=jt(`thead`,{stickyHeader:!0}),It=jt(`tbody`),Lt=jt(`tfoot`),Rt=jt(`caption`,{captionSide:!0}),zt={type:`scrollarea`},Bt=p((e,{minWidth:t,maxHeight:n,type:r})=>({scrollContainer:{"--table-min-width":C(t),"--table-max-height":C(n),"--table-overflow":r===`native`?`auto`:void 0}})),Vt=o(e=>{let t=f(`TableScrollContainer`,zt,e),{classNames:n,className:r,style:i,styles:a,unstyled:o,vars:s,children:c,minWidth:u,maxHeight:d,type:p,scrollAreaProps:m,attributes:h,...g}=t,_=l({name:`TableScrollContainer`,classes:kt,props:t,className:r,style:i,classNames:n,styles:a,unstyled:o,attributes:h,vars:s,varsResolver:Bt,rootSelector:`scrollContainer`});return(0,q.jsx)(P,{component:p===`scrollarea`?Ce:`div`,...p===`scrollarea`?d?{offsetScrollbars:`xy`,...m}:{offsetScrollbars:`x`,...m}:{},..._(`scrollContainer`),...g,children:(0,q.jsx)(`div`,{..._(`scrollContainerInner`),children:c})})});Vt.classes=kt,Vt.varsResolver=Bt,Vt.displayName=`@mantine/core/TableScrollContainer`;function Ht({data:e}){return(0,q.jsxs)(q.Fragment,{children:[e.caption&&(0,q.jsx)(Rt,{children:e.caption}),e.head&&(0,q.jsx)(Ft,{children:(0,q.jsx)(Pt,{children:e.head.map((e,t)=>(0,q.jsx)(Mt,{children:e},t))})}),e.body&&(0,q.jsx)(It,{children:e.body.map((e,t)=>(0,q.jsx)(Pt,{children:e.map((e,t)=>(0,q.jsx)(Nt,{children:e},t))},t))}),e.foot&&(0,q.jsx)(Lt,{children:(0,q.jsx)(Pt,{children:e.foot.map((e,t)=>(0,q.jsx)(Mt,{children:e},t))})})]})}Ht.displayName=`@mantine/core/TableDataRenderer`;var Ut={withRowBorders:!0,verticalSpacing:7},Wt=p((e,{layout:t,captionSide:n,horizontalSpacing:r,verticalSpacing:i,borderColor:a,stripedColor:o,highlightOnHoverColor:s,striped:l,highlightOnHover:u,stickyHeaderOffset:d,stickyHeader:f})=>({table:{"--table-layout":t,"--table-caption-side":n,"--table-horizontal-spacing":S(r),"--table-vertical-spacing":S(i),"--table-border-color":a?c(a,e):void 0,"--table-striped-color":l&&o?c(o,e):void 0,"--table-highlight-on-hover-color":u&&s?c(s,e):void 0,"--table-sticky-header-offset":f?C(d):void 0}})),Gt=o(e=>{let t=f(`Table`,Ut,e),{classNames:n,className:r,style:i,styles:a,unstyled:o,vars:s,horizontalSpacing:c,verticalSpacing:u,captionSide:d,stripedColor:p,highlightOnHoverColor:m,striped:h,highlightOnHover:g,withColumnBorders:_,withRowBorders:v,withTableBorder:y,borderColor:b,layout:x,data:S,children:C,stickyHeader:w,stickyHeaderOffset:T,mod:E,tabularNums:ee,attributes:D,...te}=t,O=l({name:`Table`,props:t,className:r,style:i,classes:kt,classNames:n,styles:a,unstyled:o,attributes:D,rootSelector:`table`,vars:s,varsResolver:Wt});return(0,q.jsx)(Dt,{value:{getStyles:O,stickyHeader:w,striped:h===!0?`odd`:h||void 0,highlightOnHover:g,withColumnBorders:_,withRowBorders:v,captionSide:d||`bottom`},children:(0,q.jsx)(P,{component:`table`,mod:[{"data-with-table-border":y,"data-tabular-nums":ee},E],...O(`table`),...te,children:C||!!S&&(0,q.jsx)(Ht,{data:S})})})});Gt.classes=kt,Gt.varsResolver=Wt,Gt.displayName=`@mantine/core/Table`,Gt.Td=Nt,Gt.Th=Mt,Gt.Tr=Pt,Gt.Thead=Ft,Gt.Tbody=It,Gt.Tfoot=Lt,Gt.Caption=Rt,Gt.ScrollContainer=Vt,Gt.DataRenderer=Ht;var Kt=new Map([[`bold`,K.createElement(K.Fragment,null,K.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`,K.createElement(K.Fragment,null,K.createElement(`path`,{d:`M216,128a88,88,0,1,1-88-88A88,88,0,0,1,216,128Z`,opacity:`0.2`}),K.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`,K.createElement(K.Fragment,null,K.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`,K.createElement(K.Fragment,null,K.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`,K.createElement(K.Fragment,null,K.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`,K.createElement(K.Fragment,null,K.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`}))]]),qt=new Map([[`bold`,K.createElement(K.Fragment,null,K.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`,K.createElement(K.Fragment,null,K.createElement(`path`,{d:`M208,96l-80,80L48,96Z`,opacity:`0.2`}),K.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`,K.createElement(K.Fragment,null,K.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`,K.createElement(K.Fragment,null,K.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`,K.createElement(K.Fragment,null,K.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`,K.createElement(K.Fragment,null,K.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`}))]]),Jt=new Map([[`bold`,K.createElement(K.Fragment,null,K.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`,K.createElement(K.Fragment,null,K.createElement(`path`,{d:`M216,144a32,32,0,1,1-32-32A32,32,0,0,1,216,144Z`,opacity:`0.2`}),K.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`,K.createElement(K.Fragment,null,K.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`,K.createElement(K.Fragment,null,K.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`,K.createElement(K.Fragment,null,K.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`,K.createElement(K.Fragment,null,K.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`}))]]),Yt=new Map([[`bold`,K.createElement(K.Fragment,null,K.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`,K.createElement(K.Fragment,null,K.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`}),K.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`,K.createElement(K.Fragment,null,K.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`,K.createElement(K.Fragment,null,K.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`,K.createElement(K.Fragment,null,K.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`,K.createElement(K.Fragment,null,K.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`}))]]),Xt=new Map([[`bold`,K.createElement(K.Fragment,null,K.createElement(`path`,{d:`M100,36H56A20,20,0,0,0,36,56v44a20,20,0,0,0,20,20h44a20,20,0,0,0,20-20V56A20,20,0,0,0,100,36ZM96,96H60V60H96ZM200,36H156a20,20,0,0,0-20,20v44a20,20,0,0,0,20,20h44a20,20,0,0,0,20-20V56A20,20,0,0,0,200,36Zm-4,60H160V60h36Zm-96,40H56a20,20,0,0,0-20,20v44a20,20,0,0,0,20,20h44a20,20,0,0,0,20-20V156A20,20,0,0,0,100,136Zm-4,60H60V160H96Zm104-60H156a20,20,0,0,0-20,20v44a20,20,0,0,0,20,20h44a20,20,0,0,0,20-20V156A20,20,0,0,0,200,136Zm-4,60H160V160h36Z`}))],[`duotone`,K.createElement(K.Fragment,null,K.createElement(`path`,{d:`M112,56v48a8,8,0,0,1-8,8H56a8,8,0,0,1-8-8V56a8,8,0,0,1,8-8h48A8,8,0,0,1,112,56Zm88-8H152a8,8,0,0,0-8,8v48a8,8,0,0,0,8,8h48a8,8,0,0,0,8-8V56A8,8,0,0,0,200,48Zm-96,96H56a8,8,0,0,0-8,8v48a8,8,0,0,0,8,8h48a8,8,0,0,0,8-8V152A8,8,0,0,0,104,144Zm96,0H152a8,8,0,0,0-8,8v48a8,8,0,0,0,8,8h48a8,8,0,0,0,8-8V152A8,8,0,0,0,200,144Z`,opacity:`0.2`}),K.createElement(`path`,{d:`M200,136H152a16,16,0,0,0-16,16v48a16,16,0,0,0,16,16h48a16,16,0,0,0,16-16V152A16,16,0,0,0,200,136Zm0,64H152V152h48v48ZM104,40H56A16,16,0,0,0,40,56v48a16,16,0,0,0,16,16h48a16,16,0,0,0,16-16V56A16,16,0,0,0,104,40Zm0,64H56V56h48v48Zm96-64H152a16,16,0,0,0-16,16v48a16,16,0,0,0,16,16h48a16,16,0,0,0,16-16V56A16,16,0,0,0,200,40Zm0,64H152V56h48v48Zm-96,32H56a16,16,0,0,0-16,16v48a16,16,0,0,0,16,16h48a16,16,0,0,0,16-16V152A16,16,0,0,0,104,136Zm0,64H56V152h48v48Z`}))],[`fill`,K.createElement(K.Fragment,null,K.createElement(`path`,{d:`M120,56v48a16,16,0,0,1-16,16H56a16,16,0,0,1-16-16V56A16,16,0,0,1,56,40h48A16,16,0,0,1,120,56Zm80-16H152a16,16,0,0,0-16,16v48a16,16,0,0,0,16,16h48a16,16,0,0,0,16-16V56A16,16,0,0,0,200,40Zm-96,96H56a16,16,0,0,0-16,16v48a16,16,0,0,0,16,16h48a16,16,0,0,0,16-16V152A16,16,0,0,0,104,136Zm96,0H152a16,16,0,0,0-16,16v48a16,16,0,0,0,16,16h48a16,16,0,0,0,16-16V152A16,16,0,0,0,200,136Z`}))],[`light`,K.createElement(K.Fragment,null,K.createElement(`path`,{d:`M104,42H56A14,14,0,0,0,42,56v48a14,14,0,0,0,14,14h48a14,14,0,0,0,14-14V56A14,14,0,0,0,104,42Zm2,62a2,2,0,0,1-2,2H56a2,2,0,0,1-2-2V56a2,2,0,0,1,2-2h48a2,2,0,0,1,2,2Zm94-62H152a14,14,0,0,0-14,14v48a14,14,0,0,0,14,14h48a14,14,0,0,0,14-14V56A14,14,0,0,0,200,42Zm2,62a2,2,0,0,1-2,2H152a2,2,0,0,1-2-2V56a2,2,0,0,1,2-2h48a2,2,0,0,1,2,2Zm-98,34H56a14,14,0,0,0-14,14v48a14,14,0,0,0,14,14h48a14,14,0,0,0,14-14V152A14,14,0,0,0,104,138Zm2,62a2,2,0,0,1-2,2H56a2,2,0,0,1-2-2V152a2,2,0,0,1,2-2h48a2,2,0,0,1,2,2Zm94-62H152a14,14,0,0,0-14,14v48a14,14,0,0,0,14,14h48a14,14,0,0,0,14-14V152A14,14,0,0,0,200,138Zm2,62a2,2,0,0,1-2,2H152a2,2,0,0,1-2-2V152a2,2,0,0,1,2-2h48a2,2,0,0,1,2,2Z`}))],[`regular`,K.createElement(K.Fragment,null,K.createElement(`path`,{d:`M104,40H56A16,16,0,0,0,40,56v48a16,16,0,0,0,16,16h48a16,16,0,0,0,16-16V56A16,16,0,0,0,104,40Zm0,64H56V56h48v48Zm96-64H152a16,16,0,0,0-16,16v48a16,16,0,0,0,16,16h48a16,16,0,0,0,16-16V56A16,16,0,0,0,200,40Zm0,64H152V56h48v48Zm-96,32H56a16,16,0,0,0-16,16v48a16,16,0,0,0,16,16h48a16,16,0,0,0,16-16V152A16,16,0,0,0,104,136Zm0,64H56V152h48v48Zm96-64H152a16,16,0,0,0-16,16v48a16,16,0,0,0,16,16h48a16,16,0,0,0,16-16V152A16,16,0,0,0,200,136Zm0,64H152V152h48v48Z`}))],[`thin`,K.createElement(K.Fragment,null,K.createElement(`path`,{d:`M104,44H56A12,12,0,0,0,44,56v48a12,12,0,0,0,12,12h48a12,12,0,0,0,12-12V56A12,12,0,0,0,104,44Zm4,60a4,4,0,0,1-4,4H56a4,4,0,0,1-4-4V56a4,4,0,0,1,4-4h48a4,4,0,0,1,4,4Zm92-60H152a12,12,0,0,0-12,12v48a12,12,0,0,0,12,12h48a12,12,0,0,0,12-12V56A12,12,0,0,0,200,44Zm4,60a4,4,0,0,1-4,4H152a4,4,0,0,1-4-4V56a4,4,0,0,1,4-4h48a4,4,0,0,1,4,4ZM104,140H56a12,12,0,0,0-12,12v48a12,12,0,0,0,12,12h48a12,12,0,0,0,12-12V152A12,12,0,0,0,104,140Zm4,60a4,4,0,0,1-4,4H56a4,4,0,0,1-4-4V152a4,4,0,0,1,4-4h48a4,4,0,0,1,4,4Zm92-60H152a12,12,0,0,0-12,12v48a12,12,0,0,0,12,12h48a12,12,0,0,0,12-12V152A12,12,0,0,0,200,140Zm4,60a4,4,0,0,1-4,4H152a4,4,0,0,1-4-4V152a4,4,0,0,1,4-4h48a4,4,0,0,1,4,4Z`}))]]),Zt=new Map([[`bold`,K.createElement(K.Fragment,null,K.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`,K.createElement(K.Fragment,null,K.createElement(`path`,{d:`M224,128a96,96,0,1,1-96-96A96,96,0,0,1,224,128Z`,opacity:`0.2`}),K.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`,K.createElement(K.Fragment,null,K.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`,K.createElement(K.Fragment,null,K.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`,K.createElement(K.Fragment,null,K.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`,K.createElement(K.Fragment,null,K.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`}))]]),Qt=new Map([[`bold`,K.createElement(K.Fragment,null,K.createElement(`path`,{d:`M208.49,191.51a12,12,0,0,1-17,17L128,145,64.49,208.49a12,12,0,0,1-17-17L111,128,47.51,64.49a12,12,0,0,1,17-17L128,111l63.51-63.52a12,12,0,0,1,17,17L145,128Z`}))],[`duotone`,K.createElement(K.Fragment,null,K.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`}),K.createElement(`path`,{d:`M205.66,194.34a8,8,0,0,1-11.32,11.32L128,139.31,61.66,205.66a8,8,0,0,1-11.32-11.32L116.69,128,50.34,61.66A8,8,0,0,1,61.66,50.34L128,116.69l66.34-66.35a8,8,0,0,1,11.32,11.32L139.31,128Z`}))],[`fill`,K.createElement(K.Fragment,null,K.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,32ZM181.66,170.34a8,8,0,0,1-11.32,11.32L128,139.31,85.66,181.66a8,8,0,0,1-11.32-11.32L116.69,128,74.34,85.66A8,8,0,0,1,85.66,74.34L128,116.69l42.34-42.35a8,8,0,0,1,11.32,11.32L139.31,128Z`}))],[`light`,K.createElement(K.Fragment,null,K.createElement(`path`,{d:`M204.24,195.76a6,6,0,1,1-8.48,8.48L128,136.49,60.24,204.24a6,6,0,0,1-8.48-8.48L119.51,128,51.76,60.24a6,6,0,0,1,8.48-8.48L128,119.51l67.76-67.75a6,6,0,0,1,8.48,8.48L136.49,128Z`}))],[`regular`,K.createElement(K.Fragment,null,K.createElement(`path`,{d:`M205.66,194.34a8,8,0,0,1-11.32,11.32L128,139.31,61.66,205.66a8,8,0,0,1-11.32-11.32L116.69,128,50.34,61.66A8,8,0,0,1,61.66,50.34L128,116.69l66.34-66.35a8,8,0,0,1,11.32,11.32L139.31,128Z`}))],[`thin`,K.createElement(K.Fragment,null,K.createElement(`path`,{d:`M202.83,197.17a4,4,0,0,1-5.66,5.66L128,133.66,58.83,202.83a4,4,0,0,1-5.66-5.66L122.34,128,53.17,58.83a4,4,0,0,1,5.66-5.66L128,122.34l69.17-69.17a4,4,0,1,1,5.66,5.66L133.66,128Z`}))]]),$t=K.forwardRef((e,t)=>K.createElement(ie,{ref:t,...e,weights:Kt}));$t.displayName=`ArrowClockwiseIcon`;var en=$t,tn=K.forwardRef((e,t)=>K.createElement(ie,{ref:t,...e,weights:qt}));tn.displayName=`CaretDownIcon`;var nn=tn,rn=K.forwardRef((e,t)=>K.createElement(ie,{ref:t,...e,weights:Jt}));rn.displayName=`ListMagnifyingGlassIcon`;var an=rn,on=K.forwardRef((e,t)=>K.createElement(ie,{ref:t,...e,weights:Yt}));on.displayName=`SparkleIcon`;var sn=on,cn=K.forwardRef((e,t)=>K.createElement(ie,{ref:t,...e,weights:Xt}));cn.displayName=`SquaresFourIcon`;var ln=cn,un=K.forwardRef((e,t)=>K.createElement(ie,{ref:t,...e,weights:Zt}));un.displayName=`WarningCircleIcon`;var dn=un,fn=K.forwardRef((e,t)=>K.createElement(ie,{ref:t,...e,weights:Qt}));fn.displayName=`XIcon`;var pn=fn,mn=class extends ye{#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),_e(this.options,t)||this.#e.getMutationCache().notify({type:`observerOptionsUpdated`,mutation:this.#n,observer:this}),t?.mutationKey&&this.options.mutationKey&&xe(t.mutationKey)!==xe(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??be();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){he.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)})})}};function hn(e,t){return pe(e,W,t)}function gn(e,t){let n=H(t),[r]=K.useState(()=>new mn(n,e));K.useEffect(()=>{r.setOptions(e)},[r,e]);let i=K.useSyncExternalStore(K.useCallback(e=>r.subscribe(he.batchCalls(e)),[r]),()=>r.getCurrentResult(),()=>r.getCurrentResult()),a=K.useCallback((...e)=>{r.mutate(e[0],e[1]).catch(ge)},[r]);if(i.error&&U(r.options.throwOnError,[i.error]))throw i.error;return{...i,mutate:a,mutateAsync:i.mutate}}function _n(e){let{margin:t,containerPadding:n,containerWidth:r,cols:i}=e;return(r-t[0]*(i-1)-n[0]*2)/i}function vn(e,t,n){return Number.isFinite(e)?Math.round(t*e+Math.max(0,e-1)*n):e}function yn(e,t,n,r,i,a,o){let{margin:s,containerPadding:c,rowHeight:l}=e,u=_n(e),d,f,p,m;if(o?(d=Math.round(o.width),f=Math.round(o.height)):(d=vn(r,u,s[0]),f=vn(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 bn(e,t,n,r,i){let{margin:a,containerPadding:o,cols:s,rowHeight:c,maxRows:l}=e,u=_n(e),d=Math.round((n-o[0])/(u+a[0])),f=Math.round((t-o[1])/(c+a[1]));return d=Cn(d,0,s-r),f=Cn(f,0,l-i),{x:d,y:f}}function xn(e,t,n){let{margin:r,containerPadding:i,rowHeight:a}=e,o=_n(e);return{x:Math.round((n-i[0])/(o+r[0])),y:Math.round((t-i[1])/(a+r[1]))}}function Sn(e,t,n){let{margin:r,rowHeight:i}=e,a=_n(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 Cn(e,t,n){return Math.max(Math.min(e,n),t)}function wn(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 Tn(e,t){for(let n=0;nwn(e,t))}function Dn(e,t){return t===`horizontal`?kn(e):t===`vertical`||t===`wrap`?On(e):[...e]}function On(e){return[...e].sort((e,t)=>e.y===t.y?e.x-t.x:e.y-t.y)}function kn(e){return[...e].sort((e,t)=>e.x===t.x?e.y-t.y:e.x-t.x)}function An(e){let t=0;for(let n=0;nt&&(t=e)}}return t}function jn(e,t){for(let n=0;ne.static===!0)}function Nn(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 Pn(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.static)n.push(i);else for(;Tn(n,i);)i.y++}}return e}function Rn(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=Dn(e,o);(o===`vertical`&&typeof r==`number`?u>=r:o===`horizontal`&&typeof n==`number`&&l>=n)&&(d=d.reverse());let f=En(d,t),p=f.length>0;if(p&&c)return Pn(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 Rn(e,n,o?a.x:void 0,s?a.y:void 0,r,c,i);if(u&&s)return Rn(e,n,void 0,n.y+1,r,c,i);if(u&&i===null)return t.y=n.y,n.y+=n.h,[...e];if(d&&o)return Rn(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]:Rn(e,n,l,u,r,c,i)}function Bn(e,t,n){return Math.max(t,Math.min(n,e))}var Vn=[{name:`gridBounds`,constrainPosition(e,t,n,{cols:r,maxRows:i}){return{x:Bn(t,0,Math.max(0,r-e.w)),y:Bn(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:Bn(t,1,Math.max(1,o)),h:Bn(n,1,Math.max(1,s))}}},{name:`minMaxSize`,constrainSize(e,t,n){return{w:Bn(t,e.minW??1,e.maxW??1/0),h:Bn(n,e.minH??1,e.maxH??1/0)}}}];function Hn(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 Un(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 Wn({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 Gn({top:e,left:t,width:n,height:r}){return{top:`${e}px`,left:`${t}px`,width:`${n}px`,height:`${r}px`,position:`absolute`}}function Kn(e){return e*100+`%`}function qn(e,t,n,r){return e+n>r?t:n}function Jn(e,t,n){return e<0?t:n}function Yn(e){return Math.max(0,e)}function Xn(e){return Math.max(0,e)}var Zn=(e,t,n)=>{let{left:r,height:i,width:a}=t,o=e.top-(i-e.height);return{left:r,width:a,height:Jn(o,e.height,i),top:Xn(o)}},Qn=(e,t,n)=>{let{top:r,left:i,height:a,width:o}=t;return{top:r,height:a,width:qn(e.left,e.width,o,n),left:Yn(i)}},$n=(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:Xn(r),left:0}:{height:i,width:a,top:Xn(r),left:o}},er=(e,t,n)=>{let{top:r,left:i,height:a,width:o}=t;return{width:o,left:i,height:Jn(r,e.height,a),top:Xn(r)}},tr={n:Zn,ne:(e,t,n)=>Zn(e,Qn(e,t,n)),e:Qn,se:(e,t,n)=>er(e,Qn(e,t,n)),s:er,sw:(e,t,n)=>er(e,$n(e,t)),w:$n,nw:(e,t,n)=>Zn(e,$n(e,t))};function nr(e,t,n,r){let i=tr[e];return i?i(t,{...t,...n},r):n}var rr={type:`transform`,scale:1,calcStyle(e){return Wn(e)}},ir={type:`absolute`,scale:1,calcStyle(e){return Gn(e)}};function ar(e){return{type:`transform`,scale:e,calcStyle(e){return Wn(e)},calcDragPosition(t,n,r,i){return{left:(t-r)/e,top:(n-i)/e}}}}var or=rr,sr={cols:12,rowHeight:150,margin:[10,10],containerPadding:null,maxRows:1/0},cr={enabled:!0,bounded:!1,threshold:3},lr={enabled:!0,handles:[`se`]},ur={enabled:!1,defaultItem:{w:1,h:1}};function dr(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??Mn(e).length>0;for(let i=o+1;it.y+t.h)break;wn(t,o)&&dr(e,o,n+t[a],r,s)}}t[r]=n}function fr(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&&!Tn(e,t);)t.y--;let i;for(;(i=Tn(e,t))!==void 0;)dr(n,t,i.y+i.h,`y`);return t.y=Math.max(t.y,0),t}function pr(e,t,n,r){for(t.x=Math.max(t.x,0),t.y=Math.max(t.y,0);t.x>0&&!Tn(e,t);)t.x--;let i;for(;(i=Tn(e,t))!==void 0;)if(dr(r,t,i.x+i.w,`x`),t.x+t.w>n)for(t.x=n-t.w,t.y++;t.x>0&&!Tn(e,t);)t.x--;return t.x=Math.max(t.x,0),t}var mr={type:`vertical`,allowOverlap:!1,compact(e,t){let n=Mn(e),r=An(n),i=On(e),a=Array(e.length);for(let t=0;te[t]-e[n])}function Sr(e,t){let n=xr(e),r=n[0];if(r===void 0)throw Error(`No breakpoints defined`);for(let i=1;ie[a]&&(r=a)}return r}function Cr(e,t){let n=t[e];if(n===void 0)throw Error(`ResponsiveReactGridLayout: \`cols\` entry for breakpoint ${String(e)} is missing!`);return n}function wr(e,t,n,r,i,a){let o=e[n];if(o)return Pn(o);let s=e[r],c=xr(t),l=c.slice(c.indexOf(n));for(let t=0;t{t.exports=`SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED`})),Dr=t(((e,t)=>{var n=Er();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}})),Or=t(((e,t)=>{t.exports=Dr()()})),$=n(Or(),1),kr=n(ne(),1);function Ar(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&&Ar(e.changedTouches,e=>t===e.identifier)}function ei(e){if(e.targetTouches&&e.targetTouches[0])return e.targetTouches[0].identifier;if(e.changedTouches&&e.changedTouches[0])return e.changedTouches[0].identifier}function ti(){return typeof __webpack_nonce__<`u`?__webpack_nonce__:void 0}function ni(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??ti();r&&n.setAttribute(`nonce`,r),n.innerHTML=`.react-draggable-transparent-selection *::-moz-selection {all: inherit;} +import{a as e,d as t,g as n,u as r}from"./useNavigate-BEpS2iE5.js";import{A as i,D as a,E as o,I as s,J as c,M as l,N as u,O as d,P as f,Q as p,S as m,T as h,V as g,Z as _,_ as v,at as y,b,c as x,ct as S,dt as C,et as w,f as T,g as E,h as ee,i as D,it as te,j as O,k,l as A,lt as j,m as M,mt as ne,o as re,p as N,s as ie,st as ae,u as oe,v as se,w as P}from"./auth-DhIxmh_D.js";import{A as F,C as ce,D as le,E as I,M as ue,O as L,S as de,_ as fe,a as pe,b as me,c as he,d as ge,f as _e,g as R,h as z,i as ve,j as B,k as V,l as ye,m as H,o as be,p as U,s as W,u as xe,v as Se,w as Ce,x as G,y as we}from"./index-Ckl_dWuh.js";var K=n(r(),1);function Te(e){let t=(0,K.useRef)(void 0);return(0,K.useEffect)(()=>{t.current=e},[e]),t.current}var q=e();function Ee(e,t=document){let n=t.querySelector(e);if(n)return n;let r=t.querySelectorAll(`*`);for(let t=0;t{let t=f(`Flex`,null,e),{classNames:n,className:r,style:a,styles:o,unstyled:c,vars:u,gap:p,rowGap:m,columnGap:h,align:_,justify:v,wrap:y,direction:b,attributes:x,...S}=t,C=l({name:`Flex`,classes:ke,props:t,className:r,style:a,classNames:n,styles:o,unstyled:c,attributes:x,vars:u}),w=s(),T=d(),E=k({styleProps:{gap:p,rowGap:m,columnGap:h,align:_,justify:v,wrap:y,direction:b},theme:w,data:Oe}),ee=g(),D=ee&&E.hasResponsiveStyles?i(E.styles,E.media):T;return(0,q.jsxs)(q.Fragment,{children:[E.hasResponsiveStyles&&(0,q.jsx)(O,{selector:`.${D}`,styles:E.styles,media:E.media,deduplicate:ee}),(0,q.jsx)(P,{...C(`root`,{className:D,style:j(E.inlineStyles)}),...S})]})});X.classes=ke,X.displayName=`@mantine/core/Flex`;function Ae(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=>Ae(e))}:typeof e==`number`||typeof e==`bigint`||typeof e==`boolean`?{value:e,label:`${e}`}:e}function je(e){return e?e.map(e=>Ae(e)):[]}function Me(e){return e.reduce((e,t)=>`group`in t?{...e,...Me(t.items)}:(e[`${t.value}`]=t,e),{})}var Z={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`},Ne={error:null},Pe=p((e,{size:t,color:n})=>({chevron:{"--combobox-chevron-size":ae(t,`combobox-chevron-size`),"--combobox-chevron-color":n?c(n,e):void 0}})),Fe=o(e=>{let t=f(`ComboboxChevron`,Ne,e),{size:n,error:r,style:i,className:a,classNames:o,styles:s,unstyled:c,vars:u,attributes:d,mod:p,...m}=t,h=l({name:`ComboboxChevron`,classes:Z,props:t,style:i,className:a,classNames:o,styles:s,unstyled:c,vars:u,varsResolver:Pe,attributes:d,rootSelector:`chevron`});return(0,q.jsx)(P,{component:`svg`,...m,...h(`chevron`),size:n,viewBox:`0 0 15 15`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`,mod:[`combobox-chevron`,{error:r},p],children:(0,q.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`})})});Fe.classes=Z,Fe.varsResolver=Pe,Fe.displayName=`@mantine/core/ComboboxChevron`;var[Ie,Le]=B(`Combobox component was not found in tree`);function Re({onMouseDown:e,onClick:t,onClear:n,...r}){return(0,q.jsx)(v.ClearButton,{tabIndex:-1,"aria-hidden":!0,...r,onMouseDown:t=>{t.preventDefault(),e?.(t)},onClick:e=>{n(),t?.(e)}})}Re.displayName=`@mantine/core/ComboboxClearButton`;var ze=o(e=>{let{classNames:t,styles:n,className:r,style:i,hidden:a,...o}=f(`ComboboxDropdown`,null,e),s=Le();return(0,q.jsx)(ce.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})})});ze.classes=Z,ze.displayName=`@mantine/core/ComboboxDropdown`;var Be={refProp:`ref`},Ve=o(e=>{let{children:t,refProp:n,ref:r}=f(`ComboboxDropdownTarget`,Be,e);if(Le(),!ue(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,q.jsx)(ce.Target,{ref:r,refProp:n,children:t})});Ve.displayName=`@mantine/core/ComboboxDropdownTarget`;var He=o(e=>{let{classNames:t,className:n,style:r,styles:i,vars:a,...o}=f(`ComboboxEmpty`,null,e);return(0,q.jsx)(P,{...Le().getStyles(`empty`,{className:n,classNames:t,styles:i,style:r}),...o})});He.classes=Z,He.displayName=`@mantine/core/ComboboxEmpty`;function Ue({onKeyDown:e,onClick:t,withKeyboardNavigation:n,withAriaAttributes:r,withExpandedAttribute:i,targetType:a,autoComplete:o}){let s=Le(),[c,l]=(0,K.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 We={refProp:`ref`,targetType:`input`,withKeyboardNavigation:!0,withAriaAttributes:!0,withExpandedAttribute:!1,autoComplete:`off`},Ge=o(e=>{let{children:t,refProp:n,withKeyboardNavigation:r,withAriaAttributes:i,withExpandedAttribute:a,targetType:o,autoComplete:s,ref:c,...l}=f(`ComboboxEventsTarget`,We,e),u=le(t);if(!u)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 d=Le();return(0,K.cloneElement)(u,{...Ue({targetType:o,withAriaAttributes:i,withKeyboardNavigation:r,withExpandedAttribute:a,onKeyDown:u.props.onKeyDown,onClick:u.props.onClick,autoComplete:s}),...l,[n]:F(c,d.store.targetRef,L(u))})});Ge.displayName=`@mantine/core/ComboboxEventsTarget`;var Ke=o(e=>{let{classNames:t,className:n,style:r,styles:i,vars:a,...o}=f(`ComboboxFooter`,null,e);return(0,q.jsx)(P,{...Le().getStyles(`footer`,{className:n,classNames:t,style:r,styles:i}),...o,onMouseDown:e=>{e.preventDefault()}})});Ke.classes=Z,Ke.displayName=`@mantine/core/ComboboxFooter`;var qe=o(e=>{let{classNames:t,className:n,style:r,styles:i,vars:a,children:o,label:s,id:c,...l}=f(`ComboboxGroup`,null,e),u=Le(),d=w(c),p=s!=null&&s!==!1&&s!==``;return(0,q.jsxs)(P,{role:`group`,"aria-labelledby":p?d:void 0,...u.getStyles(`group`,{className:n,classNames:t,style:r,styles:i}),...l,children:[p&&(0,q.jsx)(`div`,{id:d,...u.getStyles(`groupLabel`,{classNames:t,styles:i}),children:s}),o]})});qe.classes=Z,qe.displayName=`@mantine/core/ComboboxGroup`;var Je=o(e=>{let{classNames:t,className:n,style:r,styles:i,vars:a,...o}=f(`ComboboxHeader`,null,e);return(0,q.jsx)(P,{...Le().getStyles(`header`,{className:n,classNames:t,style:r,styles:i}),...o,onMouseDown:e=>{e.preventDefault()}})});Je.classes=Z,Je.displayName=`@mantine/core/ComboboxHeader`;function Ye({value:e,valuesDivider:t=`,`,...n}){return(0,q.jsx)(`input`,{type:`hidden`,value:Array.isArray(e)?e.join(t):e?`${e}`:``,...n})}Ye.displayName=`@mantine/core/ComboboxHiddenInput`;var Xe=o(e=>{let t=f(`ComboboxOption`,null,e),{classNames:n,className:r,style:i,styles:a,vars:o,onClick:s,id:c,active:l,onMouseDown:u,onMouseOver:d,disabled:p,selected:m,mod:h,...g}=t,_=Le(),v=(0,K.useId)(),y=c||v;return(0,q.jsx)(P,{..._.getStyles(`option`,{className:r,classNames:n,styles:a,style:i}),...g,id:y,mod:[`combobox-option`,{"combobox-active":l,"combobox-disabled":p,"combobox-selected":m},h],role:`option`,onClick:e=>{p?e.preventDefault():(_.onOptionSubmit?.(t.value,t),s?.(e))},onMouseDown:e=>{e.preventDefault(),u?.(e)},onMouseOver:e=>{_.resetSelectionOnOptionHover&&_.store.resetSelectedOption(),d?.(e)}})});Xe.classes=Z,Xe.displayName=`@mantine/core/ComboboxOption`;var Ze=o(e=>{let{classNames:t,className:n,style:r,styles:i,id:a,onMouseDown:o,labelledBy:s,...c}=f(`ComboboxOptions`,null,e),l=Le(),u=w(a);return(0,K.useEffect)(()=>{l.store.setListId(u)},[u]),(0,q.jsx)(P,{...l.getStyles(`options`,{className:n,style:r,classNames:t,styles:i}),...c,id:u,role:`listbox`,"aria-labelledby":s,onMouseDown:e=>{e.preventDefault(),o?.(e)}})});Ze.classes=Z,Ze.displayName=`@mantine/core/ComboboxOptions`;var Qe={withAriaAttributes:!0,withKeyboardNavigation:!0},$e=o(e=>{let{classNames:t,styles:n,unstyled:r,vars:i,withAriaAttributes:a,onKeyDown:o,onClick:s,withKeyboardNavigation:c,size:l,ref:u,...d}=f(`ComboboxSearch`,Qe,e),p=Le(),m=p.getStyles(`search`),h=Ue({targetType:`input`,withAriaAttributes:a,withKeyboardNavigation:c,withExpandedAttribute:!1,onKeyDown:o,onClick:s,autoComplete:`off`});return(0,q.jsx)(v,{ref:F(u,p.store.searchRef),classNames:[{input:m.className},t],styles:[{input:m.style},n],size:l||p.size,...h,...d,__staticSelector:`Combobox`})});$e.classes=Z,$e.displayName=`@mantine/core/ComboboxSearch`;var et={refProp:`ref`,targetType:`input`,withKeyboardNavigation:!0,withAriaAttributes:!0,withExpandedAttribute:!1,autoComplete:`off`},tt=o(e=>{let{children:t,refProp:n,withKeyboardNavigation:r,withAriaAttributes:i,withExpandedAttribute:a,targetType:o,autoComplete:s,ref:c,...l}=f(`ComboboxTarget`,et,e),u=le(t);if(!u)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 d=Le(),p=(0,K.cloneElement)(u,{...Ue({targetType:o,withAriaAttributes:i,withKeyboardNavigation:r,withExpandedAttribute:a,onKeyDown:u.props.onKeyDown,onClick:u.props.onClick,autoComplete:s}),...l});return(0,q.jsx)(ce.Target,{refProp:n,ref:F(c,d.store.targetRef),children:p})});tt.displayName=`@mantine/core/ComboboxTarget`;function nt(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 rt(e,t,n){for(let n=e+1;n{s||(c(!0),i?.(e))},[c,i,s]),_=(0,K.useCallback)((e=`unknown`)=>{s&&(c(!1),r?.(e))},[c,r,s]),v=(0,K.useCallback)((e=`unknown`)=>{s?_(e):g(e)},[_,g,s]),y=(0,K.useCallback)(()=>{let e=Y(f.current),t=Ee(`#${l.current} [data-combobox-selected]`,e);t?.removeAttribute(`data-combobox-selected`),t?.removeAttribute(`aria-selected`)},[]),b=(0,K.useCallback)(e=>{let t=Y(f.current),n=Ee(`#${l.current}`,t),r=n?J(`[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].setAttribute(`aria-selected`,`true`),r[i].scrollIntoView({block:`nearest`,behavior:o}),r[i].id):null},[o,y]),x=(0,K.useCallback)(()=>{let e=Y(f.current),t=Ee(`#${l.current} [data-combobox-active]`,e);if(t){let n=J(`#${l.current} [data-combobox-option]`,e).findIndex(e=>e===t);return b(n)}return b(0)},[b]),S=(0,K.useCallback)(()=>{let e=Y(f.current),t=J(`#${l.current} [data-combobox-option]`,e);return b(rt(u.current,t,a))},[b,a]),C=(0,K.useCallback)(()=>{let e=Y(f.current),t=J(`#${l.current} [data-combobox-option]`,e);return b(nt(u.current,t,a))},[b,a]),w=(0,K.useCallback)(()=>{let e=Y(f.current),t=J(`#${l.current} [data-combobox-option]`,e);return b(it(t))},[b]),T=(0,K.useCallback)((e=`selected`,t)=>{if(typeof e==`number`){u.current=e;let n=Y(f.current),r=J(`#${l.current} [data-combobox-option]`,n);t?.scrollIntoView&&r[e]?.scrollIntoView({block:`nearest`,behavior:o});return}h.current=window.setTimeout(()=>{let n=Y(f.current),r=J(`#${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,K.useCallback)(()=>{u.current=-1,y()},[y]),ee=(0,K.useCallback)(()=>{let e=Y(f.current);(J(`#${l.current} [data-combobox-option]`,e)?.[u.current])?.click()},[]),D=(0,K.useCallback)(e=>{l.current=e},[]),te=(0,K.useCallback)(()=>{p.current=window.setTimeout(()=>d.current?.focus(),0)},[]),O=(0,K.useCallback)(()=>{m.current=window.setTimeout(()=>f.current?.focus(),0)},[]),k=(0,K.useCallback)(()=>u.current,[]);return(0,K.useEffect)(()=>()=>{window.clearTimeout(p.current),window.clearTimeout(m.current),window.clearTimeout(h.current)},[]),{dropdownOpened:s,openDropdown:g,closeDropdown:_,toggleDropdown:v,selectedOptionIndex:u.current,getSelectedOptionIndex:k,selectOption:b,selectFirstOption:w,selectActiveOption:x,selectNextOption:S,selectPreviousOption:C,resetSelectedOption:E,updateSelectedOptionIndex:T,listId:l.current,setListId:D,clickSelectedOption:ee,searchRef:d,focusSearchInput:te,targetRef:f,focusTarget:O}}var ot={keepMounted:!0,keepMountedMode:`display-none`,withinPortal:!0,resetSelectionOnOptionHover:!1,width:`target`,transitionProps:{transition:`fade`,duration:0},size:`sm`},st=p((e,{size:t,dropdownPadding:n})=>({options:{"--combobox-option-fz":te(t),"--combobox-option-padding":ae(t,`combobox-option-padding`)},dropdown:{"--combobox-padding":n===void 0?void 0:C(n),"--combobox-option-fz":te(t),"--combobox-option-padding":ae(t,`combobox-option-padding`)}})),Q=e=>{let t=f(`Combobox`,ot,e),{classNames:n,styles:r,unstyled:i,children:a,store:o,vars:s,onOptionSubmit:c,onClose:u,size:d,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=at(),C=o||S,w=l({name:h||`Combobox`,classes:Z,props:t,classNames:n,styles:r,unstyled:i,attributes:_,vars:s,varsResolver:st}),T=()=>{u?.(),C.closeDropdown()};return(0,q.jsx)(Ie,{value:{getStyles:w,store:C,onOptionSubmit:c,size:d,resetSelectionOnOptionHover:m,readOnly:g,floatingHeight:v},children:(0,q.jsx)(ce,{opened:C.dropdownOpened,...b,middlewares:x,onChange:e=>!e&&T(),withRoles:!1,unstyled:i,children:a})})};Q.extend=e=>e,Q.classes=Z,Q.varsResolver=st,Q.displayName=`@mantine/core/Combobox`,Q.Target=tt,Q.Dropdown=ze,Q.Options=Ze,Q.Option=Xe,Q.Search=$e,Q.Empty=He,Q.Chevron=Fe,Q.Footer=Ke,Q.Header=Je,Q.EventsTarget=Ge,Q.DropdownTarget=Ve,Q.Group=qe,Q.ClearButton=Re,Q.HiddenInput=Ye;function ct(e){return`group`in e}function lt({options:e,search:t,limit:n}){let r=t.trim().toLowerCase(),i=[];for(let a=0;a0)return!1;return!0}function dt(e,t=new Set){if(Array.isArray(e))for(let n of e)if(ct(n))dt(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 ft(e,t){return Array.isArray(e)?e.includes(t):e===t}function pt({data:e,withCheckIcon:t,withAlignedLabels:n,value:r,checkIconPosition:i,unstyled:a,renderOption:o}){if(!ct(e)){let s=ft(r,e.value),c=t&&(s?(0,q.jsx)(G,{className:Z.optionsDropdownCheckIcon}):n?(0,q.jsx)(`div`,{className:Z.optionsDropdownCheckPlaceholder}):null),l=(0,q.jsxs)(q.Fragment,{children:[i===`left`&&c,(0,q.jsx)(`span`,{children:e.label}),i===`right`&&c]});return(0,q.jsx)(Q.Option,{value:e.value,disabled:e.disabled,className:_({[Z.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,q.jsx)(pt,{data:e,value:r,unstyled:a,withCheckIcon:t,withAlignedLabels:n,checkIconPosition:i,renderOption:o},`${e.value}`));return(0,q.jsx)(Q.Group,{label:e.group,children:s})}function mt({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=Le();dt(e);let x=typeof i==`string`?(r||lt)({options:e,search:l?i:``,limit:a??1/0}):e,S=ut(x),C=x.map((e,t)=>(0,q.jsx)(pt,{data:e,withCheckIcon:u,withAlignedLabels:d,value:f,checkIconPosition:p,unstyled:h,renderOption:_},ct(e)?`group-${typeof e.group==`string`?e.group:t}`:`${e.value}`));return(0,q.jsx)(Q.Dropdown,{hidden:t||n&&S,"data-composed":!0,children:(0,q.jsxs)(Q.Options,{labelledBy:g,"aria-label":y,children:[c?(0,q.jsx)(Ce.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,q.jsx)(Q.Empty,{children:m})]})})}var ht={root:`m_347db0ec`,"root--dot":`m_fbd81e3d`,label:`m_5add502a`,section:`m_91fdda9b`},gt=p((e,{radius:t,color:n,gradient:r,variant:i,size:a,autoContrast:o,circle:s})=>{let l=e.variantColorResolver({color:n||e.primaryColor,theme:e,gradient:r,variant:i||`filled`,autoContrast:o});return{root:{"--badge-height":ae(a,`badge-height`),"--badge-padding-x":ae(a,`badge-padding-x`),"--badge-fz":ae(a,`badge-fz`),"--badge-radius":s||t===void 0?void 0:y(t),"--badge-bg":n||i?l.background:void 0,"--badge-color":n||i?l.color:void 0,"--badge-bd":n||i?l.border:void 0,"--badge-dot-color":i===`dot`?c(n,e):void 0}}}),_t=h(e=>{let t=f(`Badge`,null,e),{classNames:n,className:r,style:i,styles:a,unstyled:o,vars:s,radius:c,color:u,gradient:d,leftSection:p,rightSection:m,children:h,variant:g,fullWidth:_,autoContrast:v,circle:y,mod:b,attributes:x,...S}=t,C=l({name:`Badge`,props:t,classes:ht,className:r,style:i,classNames:n,styles:a,unstyled:o,attributes:x,vars:s,varsResolver:gt});return(0,q.jsxs)(P,{variant:g,mod:[{block:_,circle:y,"with-right-section":!!m,"with-left-section":!!p},b],...C(`root`,{variant:g}),...S,children:[p&&(0,q.jsx)(`span`,{...C(`section`),"data-position":`left`,children:p}),(0,q.jsx)(`span`,{...C(`label`),children:h}),m&&(0,q.jsx)(`span`,{...C(`section`),"data-position":`right`,children:m})]})});_t.classes=ht,_t.varsResolver=gt,_t.displayName=`@mantine/core/Badge`;function vt(e){let t=e.currentTarget;return Y(t).activeElement!==t}function yt(e=`top-end`,t=0){let n={"--indicator-top":void 0,"--indicator-bottom":void 0,"--indicator-left":void 0,"--indicator-right":void 0,"--indicator-translate-x":void 0,"--indicator-translate-y":void 0},r=typeof t==`number`?t:t.x,i=typeof t==`number`?t:t.y,a=C(r),o=C(i),[s,c]=e.split(`-`);return s===`top`&&(n[`--indicator-top`]=o,n[`--indicator-translate-y`]=`-50%`),s===`middle`&&(n[`--indicator-top`]=`50%`,n[`--indicator-translate-y`]=`-50%`),s===`bottom`&&(n[`--indicator-bottom`]=o,n[`--indicator-translate-y`]=`50%`),c===`start`&&(n[`--indicator-left`]=a,n[`--indicator-translate-x`]=`-50%`),c===`center`&&(n[`--indicator-left`]=`50%`,n[`--indicator-translate-x`]=`-50%`),c===`end`&&(n[`--indicator-right`]=a,n[`--indicator-translate-x`]=`50%`),n}var bt={root:`m_e5262200`,indicator:`m_760d1fb1`,processing:`m_885901b1`},xt={position:`top-end`,offset:0,showZero:!0},St=p((e,{color:t,position:n,offset:r,size:i,radius:a,zIndex:o,autoContrast:s})=>({root:{"--indicator-color":t?c(t,e):void 0,"--indicator-text-color":De(s,e)?I({color:t,theme:e,autoContrast:s}):void 0,"--indicator-size":C(i),"--indicator-radius":a===void 0?void 0:y(a),"--indicator-z-index":o?.toString(),...yt(n,r)}})),Ct=o(e=>{let t=f(`Indicator`,xt,e),{classNames:n,className:r,style:i,styles:a,unstyled:o,vars:s,children:c,position:u,offset:d,inline:p,label:m,radius:h,color:g,withBorder:_,disabled:v,processing:y,zIndex:b,autoContrast:x,maxValue:S,showZero:C,mod:w,attributes:T,...E}=t,ee=l({name:`Indicator`,classes:bt,props:t,className:r,style:i,classNames:n,styles:a,unstyled:o,attributes:T,vars:s,varsResolver:St}),D=!C&&(m===0||m===`0`),te=S!==void 0&&typeof m==`number`&&m>S?`${S}+`:m;return(0,q.jsxs)(P,{...ee(`root`),mod:[{inline:p},w],...E,children:[!v&&!D&&(0,q.jsx)(P,{mod:{"with-label":!!m,"with-border":_,processing:y},...ee(`indicator`),children:te}),c]})});Ct.classes=bt,Ct.varsResolver=St,Ct.displayName=`@mantine/core/Indicator`;function wt(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}var Tt={size:`sm`,withCheckIcon:!0,allowDeselect:!0,checkIconPosition:`left`,openOnFocus:!0},Et=a(e=>{let t=f([`Input`,`InputWrapper`,`Select`],Tt,e),{classNames:n,styles:r,unstyled:i,vars:a,dropdownOpened:o,defaultDropdownOpened:s,onDropdownClose:c,onDropdownOpen:l,onFocus:d,onBlur:p,onClick:m,onChange:h,data:g,value:_,defaultValue:v,selectFirstOptionOnChange:y,selectFirstOptionOnDropdownOpen:b,onOptionSubmit:x,comboboxProps:S,readOnly:C,disabled:T,filter:ee,limit:D,withScrollArea:te,maxDropdownHeight:O,floatingHeight:k,size:A,searchable:j,rightSection:M,checkIconPosition:ne,withCheckIcon:re,withAlignedLabels:N,nothingFoundMessage:ie,name:ae,form:oe,searchValue:se,defaultSearchValue:P,onSearchChange:F,allowDeselect:ce,error:le,rightSectionPointerEvents:I,id:ue,clearable:L,clearSectionMode:de,clearButtonProps:fe,hiddenInputProps:pe,renderOption:me,onClear:he,autoComplete:ge,scrollAreaProps:_e,__defaultRightSection:R,__clearSection:z,__clearable:ve,chevronColor:B,autoSelectOnBlur:ye,openOnFocus:H,attributes:be,...U}=t,W=(0,K.useMemo)(()=>je(g),[g]),xe=(0,K.useRef)({}),Se=(0,K.useMemo)(()=>Me(W),[W]),Ce=w(ue),[G,we,Ee]=V({value:_,defaultValue:v,finalValue:null,onChange:h}),J=G==null?void 0:`${G}`in Se?Se[`${G}`]:xe.current[`${G}`],Y=Te(J),[De,Oe,ke]=V({value:se,defaultValue:P,finalValue:J?J.label:``,onChange:F}),X=at({opened:o,defaultOpened:s,onDropdownOpen:()=>{l?.(),b?X.selectFirstOption():X.updateSelectedOptionIndex(`active`,{scrollIntoView:!0})},onDropdownClose:()=>{c?.(),setTimeout(X.resetSelectedOption,0)}}),Ae=e=>{Oe(e),X.resetSelectedOption()},{resolvedClassNames:Z,resolvedStyles:Ne}=u({props:t,styles:r,classNames:n});(0,K.useEffect)(()=>{y&&X.selectFirstOption()},[y,De]),(0,K.useEffect)(()=>{_===null&&Ae(``),_!=null&&J&&(Y?.value!==J.value||Y?.label!==J.label)&&Ae(J.label)},[_,J]),(0,K.useEffect)(()=>{!Ee&&!ke&&Ae(G==null?``:`${G}`in Se?Se[`${G}`]?.label:xe.current[`${G}`]?.label||``)},[Se,G]),(0,K.useEffect)(()=>{G&&`${G}`in Se&&(xe.current[`${G}`]=Se[`${G}`])},[Se,G]);let Pe=(0,q.jsx)(Q.ClearButton,{...fe,onClear:()=>{we(null,null),Ae(``),he?.()}}),Fe=L&&G!=null&&!T&&!C;return(0,q.jsxs)(q.Fragment,{children:[(0,q.jsxs)(Q,{store:X,__staticSelector:`Select`,classNames:Z,styles:Ne,unstyled:i,readOnly:C,size:A,attributes:be,floatingHeight:k,keepMounted:ye,onOptionSubmit:e=>{x?.(e);let t=ce&&`${Se[e].value}`==`${G}`?null:Se[e],n=t?t.value:null;n!==G&&we(n,t),!Ee&&Ae(n==null?``:t?.label||``),X.closeDropdown()},...S,children:[(0,q.jsx)(Q.Target,{targetType:j?`input`:`button`,autoComplete:ge,withExpandedAttribute:!0,children:(0,q.jsx)(E,{id:Ce,__defaultRightSection:(0,q.jsx)(Q.Chevron,{size:A,error:le,unstyled:i,color:B}),__clearSection:Pe,__clearable:Fe,__clearSectionMode:de,rightSection:M,rightSectionPointerEvents:I||`none`,...U,size:A,__staticSelector:`Select`,disabled:T,readOnly:C||!j,value:De,onChange:e=>{if(vt(e)){if(!C){let t=wt(Se,e.currentTarget.value);t&&`${t.value}`!=`${G}`&&(we(t.value,t),!Ee&&Ae(t.label))}return}Ae(e.currentTarget.value),X.openDropdown(),y&&X.selectFirstOption()},onFocus:e=>{H&&j&&X.openDropdown(),d?.(e)},onBlur:e=>{ye&&X.clickSelectedOption(),j&&X.closeDropdown();let t=G!=null&&(`${G}`in Se?Se[`${G}`]:xe.current[`${G}`]);Ae(t&&t.label||``),p?.(e)},onClick:e=>{j?X.openDropdown():X.toggleDropdown(),m?.(e)},classNames:Z,styles:Ne,unstyled:i,pointer:!j,error:le,attributes:be})}),(0,q.jsx)(mt,{data:W,hidden:C||T,filter:ee,search:De,limit:D,hiddenWhenEmpty:!ie,withScrollArea:te,maxDropdownHeight:O,filterOptions:!!j&&J?.label!==De,value:G,checkIconPosition:ne,withCheckIcon:re,withAlignedLabels:N,nothingFoundMessage:ie,unstyled:i,labelId:U.label?`${Ce}-label`:void 0,"aria-label":U.label?void 0:U[`aria-label`],renderOption:me,scrollAreaProps:_e})]}),(0,q.jsx)(Q.HiddenInput,{value:G,name:ae,form:oe,disabled:T,...pe})]})});Et.classes={...E.classes,...Q.classes},Et.displayName=`@mantine/core/Select`;var[Dt,Ot]=B(`Table component was not found in the tree`),kt={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 At(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 jt(e,t){let n=`Table${e.charAt(0).toUpperCase()}${e.slice(1)}`,r=o(r=>{let i=f(n,{},r),{classNames:a,className:o,style:s,styles:c,...l}=i,u=Ot();return(0,q.jsx)(P,{component:e,...At(u,t),...u.getStyles(e,{className:o,classNames:a,style:s,styles:c,props:i}),...l})});return r.displayName=`@mantine/core/${n}`,r.classes=kt,r}var Mt=jt(`th`,{columnBorder:!0}),Nt=jt(`td`,{columnBorder:!0}),Pt=jt(`tr`,{rowBorder:!0,striped:!0,highlightOnHover:!0}),Ft=jt(`thead`,{stickyHeader:!0}),It=jt(`tbody`),Lt=jt(`tfoot`),Rt=jt(`caption`,{captionSide:!0}),zt={type:`scrollarea`},Bt=p((e,{minWidth:t,maxHeight:n,type:r})=>({scrollContainer:{"--table-min-width":C(t),"--table-max-height":C(n),"--table-overflow":r===`native`?`auto`:void 0}})),Vt=o(e=>{let t=f(`TableScrollContainer`,zt,e),{classNames:n,className:r,style:i,styles:a,unstyled:o,vars:s,children:c,minWidth:u,maxHeight:d,type:p,scrollAreaProps:m,attributes:h,...g}=t,_=l({name:`TableScrollContainer`,classes:kt,props:t,className:r,style:i,classNames:n,styles:a,unstyled:o,attributes:h,vars:s,varsResolver:Bt,rootSelector:`scrollContainer`});return(0,q.jsx)(P,{component:p===`scrollarea`?Ce:`div`,...p===`scrollarea`?d?{offsetScrollbars:`xy`,...m}:{offsetScrollbars:`x`,...m}:{},..._(`scrollContainer`),...g,children:(0,q.jsx)(`div`,{..._(`scrollContainerInner`),children:c})})});Vt.classes=kt,Vt.varsResolver=Bt,Vt.displayName=`@mantine/core/TableScrollContainer`;function Ht({data:e}){return(0,q.jsxs)(q.Fragment,{children:[e.caption&&(0,q.jsx)(Rt,{children:e.caption}),e.head&&(0,q.jsx)(Ft,{children:(0,q.jsx)(Pt,{children:e.head.map((e,t)=>(0,q.jsx)(Mt,{children:e},t))})}),e.body&&(0,q.jsx)(It,{children:e.body.map((e,t)=>(0,q.jsx)(Pt,{children:e.map((e,t)=>(0,q.jsx)(Nt,{children:e},t))},t))}),e.foot&&(0,q.jsx)(Lt,{children:(0,q.jsx)(Pt,{children:e.foot.map((e,t)=>(0,q.jsx)(Mt,{children:e},t))})})]})}Ht.displayName=`@mantine/core/TableDataRenderer`;var Ut={withRowBorders:!0,verticalSpacing:7},Wt=p((e,{layout:t,captionSide:n,horizontalSpacing:r,verticalSpacing:i,borderColor:a,stripedColor:o,highlightOnHoverColor:s,striped:l,highlightOnHover:u,stickyHeaderOffset:d,stickyHeader:f})=>({table:{"--table-layout":t,"--table-caption-side":n,"--table-horizontal-spacing":S(r),"--table-vertical-spacing":S(i),"--table-border-color":a?c(a,e):void 0,"--table-striped-color":l&&o?c(o,e):void 0,"--table-highlight-on-hover-color":u&&s?c(s,e):void 0,"--table-sticky-header-offset":f?C(d):void 0}})),Gt=o(e=>{let t=f(`Table`,Ut,e),{classNames:n,className:r,style:i,styles:a,unstyled:o,vars:s,horizontalSpacing:c,verticalSpacing:u,captionSide:d,stripedColor:p,highlightOnHoverColor:m,striped:h,highlightOnHover:g,withColumnBorders:_,withRowBorders:v,withTableBorder:y,borderColor:b,layout:x,data:S,children:C,stickyHeader:w,stickyHeaderOffset:T,mod:E,tabularNums:ee,attributes:D,...te}=t,O=l({name:`Table`,props:t,className:r,style:i,classes:kt,classNames:n,styles:a,unstyled:o,attributes:D,rootSelector:`table`,vars:s,varsResolver:Wt});return(0,q.jsx)(Dt,{value:{getStyles:O,stickyHeader:w,striped:h===!0?`odd`:h||void 0,highlightOnHover:g,withColumnBorders:_,withRowBorders:v,captionSide:d||`bottom`},children:(0,q.jsx)(P,{component:`table`,mod:[{"data-with-table-border":y,"data-tabular-nums":ee},E],...O(`table`),...te,children:C||!!S&&(0,q.jsx)(Ht,{data:S})})})});Gt.classes=kt,Gt.varsResolver=Wt,Gt.displayName=`@mantine/core/Table`,Gt.Td=Nt,Gt.Th=Mt,Gt.Tr=Pt,Gt.Thead=Ft,Gt.Tbody=It,Gt.Tfoot=Lt,Gt.Caption=Rt,Gt.ScrollContainer=Vt,Gt.DataRenderer=Ht;var Kt=new Map([[`bold`,K.createElement(K.Fragment,null,K.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`,K.createElement(K.Fragment,null,K.createElement(`path`,{d:`M216,128a88,88,0,1,1-88-88A88,88,0,0,1,216,128Z`,opacity:`0.2`}),K.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`,K.createElement(K.Fragment,null,K.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`,K.createElement(K.Fragment,null,K.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`,K.createElement(K.Fragment,null,K.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`,K.createElement(K.Fragment,null,K.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`}))]]),qt=new Map([[`bold`,K.createElement(K.Fragment,null,K.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`,K.createElement(K.Fragment,null,K.createElement(`path`,{d:`M208,96l-80,80L48,96Z`,opacity:`0.2`}),K.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`,K.createElement(K.Fragment,null,K.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`,K.createElement(K.Fragment,null,K.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`,K.createElement(K.Fragment,null,K.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`,K.createElement(K.Fragment,null,K.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`}))]]),Jt=new Map([[`bold`,K.createElement(K.Fragment,null,K.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`,K.createElement(K.Fragment,null,K.createElement(`path`,{d:`M216,144a32,32,0,1,1-32-32A32,32,0,0,1,216,144Z`,opacity:`0.2`}),K.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`,K.createElement(K.Fragment,null,K.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`,K.createElement(K.Fragment,null,K.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`,K.createElement(K.Fragment,null,K.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`,K.createElement(K.Fragment,null,K.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`}))]]),Yt=new Map([[`bold`,K.createElement(K.Fragment,null,K.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`,K.createElement(K.Fragment,null,K.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`}),K.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`,K.createElement(K.Fragment,null,K.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`,K.createElement(K.Fragment,null,K.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`,K.createElement(K.Fragment,null,K.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`,K.createElement(K.Fragment,null,K.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`}))]]),Xt=new Map([[`bold`,K.createElement(K.Fragment,null,K.createElement(`path`,{d:`M100,36H56A20,20,0,0,0,36,56v44a20,20,0,0,0,20,20h44a20,20,0,0,0,20-20V56A20,20,0,0,0,100,36ZM96,96H60V60H96ZM200,36H156a20,20,0,0,0-20,20v44a20,20,0,0,0,20,20h44a20,20,0,0,0,20-20V56A20,20,0,0,0,200,36Zm-4,60H160V60h36Zm-96,40H56a20,20,0,0,0-20,20v44a20,20,0,0,0,20,20h44a20,20,0,0,0,20-20V156A20,20,0,0,0,100,136Zm-4,60H60V160H96Zm104-60H156a20,20,0,0,0-20,20v44a20,20,0,0,0,20,20h44a20,20,0,0,0,20-20V156A20,20,0,0,0,200,136Zm-4,60H160V160h36Z`}))],[`duotone`,K.createElement(K.Fragment,null,K.createElement(`path`,{d:`M112,56v48a8,8,0,0,1-8,8H56a8,8,0,0,1-8-8V56a8,8,0,0,1,8-8h48A8,8,0,0,1,112,56Zm88-8H152a8,8,0,0,0-8,8v48a8,8,0,0,0,8,8h48a8,8,0,0,0,8-8V56A8,8,0,0,0,200,48Zm-96,96H56a8,8,0,0,0-8,8v48a8,8,0,0,0,8,8h48a8,8,0,0,0,8-8V152A8,8,0,0,0,104,144Zm96,0H152a8,8,0,0,0-8,8v48a8,8,0,0,0,8,8h48a8,8,0,0,0,8-8V152A8,8,0,0,0,200,144Z`,opacity:`0.2`}),K.createElement(`path`,{d:`M200,136H152a16,16,0,0,0-16,16v48a16,16,0,0,0,16,16h48a16,16,0,0,0,16-16V152A16,16,0,0,0,200,136Zm0,64H152V152h48v48ZM104,40H56A16,16,0,0,0,40,56v48a16,16,0,0,0,16,16h48a16,16,0,0,0,16-16V56A16,16,0,0,0,104,40Zm0,64H56V56h48v48Zm96-64H152a16,16,0,0,0-16,16v48a16,16,0,0,0,16,16h48a16,16,0,0,0,16-16V56A16,16,0,0,0,200,40Zm0,64H152V56h48v48Zm-96,32H56a16,16,0,0,0-16,16v48a16,16,0,0,0,16,16h48a16,16,0,0,0,16-16V152A16,16,0,0,0,104,136Zm0,64H56V152h48v48Z`}))],[`fill`,K.createElement(K.Fragment,null,K.createElement(`path`,{d:`M120,56v48a16,16,0,0,1-16,16H56a16,16,0,0,1-16-16V56A16,16,0,0,1,56,40h48A16,16,0,0,1,120,56Zm80-16H152a16,16,0,0,0-16,16v48a16,16,0,0,0,16,16h48a16,16,0,0,0,16-16V56A16,16,0,0,0,200,40Zm-96,96H56a16,16,0,0,0-16,16v48a16,16,0,0,0,16,16h48a16,16,0,0,0,16-16V152A16,16,0,0,0,104,136Zm96,0H152a16,16,0,0,0-16,16v48a16,16,0,0,0,16,16h48a16,16,0,0,0,16-16V152A16,16,0,0,0,200,136Z`}))],[`light`,K.createElement(K.Fragment,null,K.createElement(`path`,{d:`M104,42H56A14,14,0,0,0,42,56v48a14,14,0,0,0,14,14h48a14,14,0,0,0,14-14V56A14,14,0,0,0,104,42Zm2,62a2,2,0,0,1-2,2H56a2,2,0,0,1-2-2V56a2,2,0,0,1,2-2h48a2,2,0,0,1,2,2Zm94-62H152a14,14,0,0,0-14,14v48a14,14,0,0,0,14,14h48a14,14,0,0,0,14-14V56A14,14,0,0,0,200,42Zm2,62a2,2,0,0,1-2,2H152a2,2,0,0,1-2-2V56a2,2,0,0,1,2-2h48a2,2,0,0,1,2,2Zm-98,34H56a14,14,0,0,0-14,14v48a14,14,0,0,0,14,14h48a14,14,0,0,0,14-14V152A14,14,0,0,0,104,138Zm2,62a2,2,0,0,1-2,2H56a2,2,0,0,1-2-2V152a2,2,0,0,1,2-2h48a2,2,0,0,1,2,2Zm94-62H152a14,14,0,0,0-14,14v48a14,14,0,0,0,14,14h48a14,14,0,0,0,14-14V152A14,14,0,0,0,200,138Zm2,62a2,2,0,0,1-2,2H152a2,2,0,0,1-2-2V152a2,2,0,0,1,2-2h48a2,2,0,0,1,2,2Z`}))],[`regular`,K.createElement(K.Fragment,null,K.createElement(`path`,{d:`M104,40H56A16,16,0,0,0,40,56v48a16,16,0,0,0,16,16h48a16,16,0,0,0,16-16V56A16,16,0,0,0,104,40Zm0,64H56V56h48v48Zm96-64H152a16,16,0,0,0-16,16v48a16,16,0,0,0,16,16h48a16,16,0,0,0,16-16V56A16,16,0,0,0,200,40Zm0,64H152V56h48v48Zm-96,32H56a16,16,0,0,0-16,16v48a16,16,0,0,0,16,16h48a16,16,0,0,0,16-16V152A16,16,0,0,0,104,136Zm0,64H56V152h48v48Zm96-64H152a16,16,0,0,0-16,16v48a16,16,0,0,0,16,16h48a16,16,0,0,0,16-16V152A16,16,0,0,0,200,136Zm0,64H152V152h48v48Z`}))],[`thin`,K.createElement(K.Fragment,null,K.createElement(`path`,{d:`M104,44H56A12,12,0,0,0,44,56v48a12,12,0,0,0,12,12h48a12,12,0,0,0,12-12V56A12,12,0,0,0,104,44Zm4,60a4,4,0,0,1-4,4H56a4,4,0,0,1-4-4V56a4,4,0,0,1,4-4h48a4,4,0,0,1,4,4Zm92-60H152a12,12,0,0,0-12,12v48a12,12,0,0,0,12,12h48a12,12,0,0,0,12-12V56A12,12,0,0,0,200,44Zm4,60a4,4,0,0,1-4,4H152a4,4,0,0,1-4-4V56a4,4,0,0,1,4-4h48a4,4,0,0,1,4,4ZM104,140H56a12,12,0,0,0-12,12v48a12,12,0,0,0,12,12h48a12,12,0,0,0,12-12V152A12,12,0,0,0,104,140Zm4,60a4,4,0,0,1-4,4H56a4,4,0,0,1-4-4V152a4,4,0,0,1,4-4h48a4,4,0,0,1,4,4Zm92-60H152a12,12,0,0,0-12,12v48a12,12,0,0,0,12,12h48a12,12,0,0,0,12-12V152A12,12,0,0,0,200,140Zm4,60a4,4,0,0,1-4,4H152a4,4,0,0,1-4-4V152a4,4,0,0,1,4-4h48a4,4,0,0,1,4,4Z`}))]]),Zt=new Map([[`bold`,K.createElement(K.Fragment,null,K.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`,K.createElement(K.Fragment,null,K.createElement(`path`,{d:`M224,128a96,96,0,1,1-96-96A96,96,0,0,1,224,128Z`,opacity:`0.2`}),K.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`,K.createElement(K.Fragment,null,K.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`,K.createElement(K.Fragment,null,K.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`,K.createElement(K.Fragment,null,K.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`,K.createElement(K.Fragment,null,K.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`}))]]),Qt=new Map([[`bold`,K.createElement(K.Fragment,null,K.createElement(`path`,{d:`M208.49,191.51a12,12,0,0,1-17,17L128,145,64.49,208.49a12,12,0,0,1-17-17L111,128,47.51,64.49a12,12,0,0,1,17-17L128,111l63.51-63.52a12,12,0,0,1,17,17L145,128Z`}))],[`duotone`,K.createElement(K.Fragment,null,K.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`}),K.createElement(`path`,{d:`M205.66,194.34a8,8,0,0,1-11.32,11.32L128,139.31,61.66,205.66a8,8,0,0,1-11.32-11.32L116.69,128,50.34,61.66A8,8,0,0,1,61.66,50.34L128,116.69l66.34-66.35a8,8,0,0,1,11.32,11.32L139.31,128Z`}))],[`fill`,K.createElement(K.Fragment,null,K.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,32ZM181.66,170.34a8,8,0,0,1-11.32,11.32L128,139.31,85.66,181.66a8,8,0,0,1-11.32-11.32L116.69,128,74.34,85.66A8,8,0,0,1,85.66,74.34L128,116.69l42.34-42.35a8,8,0,0,1,11.32,11.32L139.31,128Z`}))],[`light`,K.createElement(K.Fragment,null,K.createElement(`path`,{d:`M204.24,195.76a6,6,0,1,1-8.48,8.48L128,136.49,60.24,204.24a6,6,0,0,1-8.48-8.48L119.51,128,51.76,60.24a6,6,0,0,1,8.48-8.48L128,119.51l67.76-67.75a6,6,0,0,1,8.48,8.48L136.49,128Z`}))],[`regular`,K.createElement(K.Fragment,null,K.createElement(`path`,{d:`M205.66,194.34a8,8,0,0,1-11.32,11.32L128,139.31,61.66,205.66a8,8,0,0,1-11.32-11.32L116.69,128,50.34,61.66A8,8,0,0,1,61.66,50.34L128,116.69l66.34-66.35a8,8,0,0,1,11.32,11.32L139.31,128Z`}))],[`thin`,K.createElement(K.Fragment,null,K.createElement(`path`,{d:`M202.83,197.17a4,4,0,0,1-5.66,5.66L128,133.66,58.83,202.83a4,4,0,0,1-5.66-5.66L122.34,128,53.17,58.83a4,4,0,0,1,5.66-5.66L128,122.34l69.17-69.17a4,4,0,1,1,5.66,5.66L133.66,128Z`}))]]),$t=K.forwardRef((e,t)=>K.createElement(ie,{ref:t,...e,weights:Kt}));$t.displayName=`ArrowClockwiseIcon`;var en=$t,tn=K.forwardRef((e,t)=>K.createElement(ie,{ref:t,...e,weights:qt}));tn.displayName=`CaretDownIcon`;var nn=tn,rn=K.forwardRef((e,t)=>K.createElement(ie,{ref:t,...e,weights:Jt}));rn.displayName=`ListMagnifyingGlassIcon`;var an=rn,on=K.forwardRef((e,t)=>K.createElement(ie,{ref:t,...e,weights:Yt}));on.displayName=`SparkleIcon`;var sn=on,cn=K.forwardRef((e,t)=>K.createElement(ie,{ref:t,...e,weights:Xt}));cn.displayName=`SquaresFourIcon`;var ln=cn,un=K.forwardRef((e,t)=>K.createElement(ie,{ref:t,...e,weights:Zt}));un.displayName=`WarningCircleIcon`;var dn=un,fn=K.forwardRef((e,t)=>K.createElement(ie,{ref:t,...e,weights:Qt}));fn.displayName=`XIcon`;var pn=fn,mn=class extends ye{#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),_e(this.options,t)||this.#e.getMutationCache().notify({type:`observerOptionsUpdated`,mutation:this.#n,observer:this}),t?.mutationKey&&this.options.mutationKey&&xe(t.mutationKey)!==xe(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??be();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){he.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)})})}};function hn(e,t){return pe(e,W,t)}function gn(e,t){let n=H(t),[r]=K.useState(()=>new mn(n,e));K.useEffect(()=>{r.setOptions(e)},[r,e]);let i=K.useSyncExternalStore(K.useCallback(e=>r.subscribe(he.batchCalls(e)),[r]),()=>r.getCurrentResult(),()=>r.getCurrentResult()),a=K.useCallback((...e)=>{r.mutate(e[0],e[1]).catch(ge)},[r]);if(i.error&&U(r.options.throwOnError,[i.error]))throw i.error;return{...i,mutate:a,mutateAsync:i.mutate}}function _n(e){let{margin:t,containerPadding:n,containerWidth:r,cols:i}=e;return(r-t[0]*(i-1)-n[0]*2)/i}function vn(e,t,n){return Number.isFinite(e)?Math.round(t*e+Math.max(0,e-1)*n):e}function yn(e,t,n,r,i,a,o){let{margin:s,containerPadding:c,rowHeight:l}=e,u=_n(e),d,f,p,m;if(o?(d=Math.round(o.width),f=Math.round(o.height)):(d=vn(r,u,s[0]),f=vn(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 bn(e,t,n,r,i){let{margin:a,containerPadding:o,cols:s,rowHeight:c,maxRows:l}=e,u=_n(e),d=Math.round((n-o[0])/(u+a[0])),f=Math.round((t-o[1])/(c+a[1]));return d=Cn(d,0,s-r),f=Cn(f,0,l-i),{x:d,y:f}}function xn(e,t,n){let{margin:r,containerPadding:i,rowHeight:a}=e,o=_n(e);return{x:Math.round((n-i[0])/(o+r[0])),y:Math.round((t-i[1])/(a+r[1]))}}function Sn(e,t,n){let{margin:r,rowHeight:i}=e,a=_n(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 Cn(e,t,n){return Math.max(Math.min(e,n),t)}function wn(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 Tn(e,t){for(let n=0;nwn(e,t))}function Dn(e,t){return t===`horizontal`?kn(e):t===`vertical`||t===`wrap`?On(e):[...e]}function On(e){return[...e].sort((e,t)=>e.y===t.y?e.x-t.x:e.y-t.y)}function kn(e){return[...e].sort((e,t)=>e.x===t.x?e.y-t.y:e.x-t.x)}function An(e){let t=0;for(let n=0;nt&&(t=e)}}return t}function jn(e,t){for(let n=0;ne.static===!0)}function Nn(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 Pn(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.static)n.push(i);else for(;Tn(n,i);)i.y++}}return e}function Rn(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=Dn(e,o);(o===`vertical`&&typeof r==`number`?u>=r:o===`horizontal`&&typeof n==`number`&&l>=n)&&(d=d.reverse());let f=En(d,t),p=f.length>0;if(p&&c)return Pn(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 Rn(e,n,o?a.x:void 0,s?a.y:void 0,r,c,i);if(u&&s)return Rn(e,n,void 0,n.y+1,r,c,i);if(u&&i===null)return t.y=n.y,n.y+=n.h,[...e];if(d&&o)return Rn(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]:Rn(e,n,l,u,r,c,i)}function Bn(e,t,n){return Math.max(t,Math.min(n,e))}var Vn=[{name:`gridBounds`,constrainPosition(e,t,n,{cols:r,maxRows:i}){return{x:Bn(t,0,Math.max(0,r-e.w)),y:Bn(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:Bn(t,1,Math.max(1,o)),h:Bn(n,1,Math.max(1,s))}}},{name:`minMaxSize`,constrainSize(e,t,n){return{w:Bn(t,e.minW??1,e.maxW??1/0),h:Bn(n,e.minH??1,e.maxH??1/0)}}}];function Hn(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 Un(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 Wn({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 Gn({top:e,left:t,width:n,height:r}){return{top:`${e}px`,left:`${t}px`,width:`${n}px`,height:`${r}px`,position:`absolute`}}function Kn(e){return e*100+`%`}function qn(e,t,n,r){return e+n>r?t:n}function Jn(e,t,n){return e<0?t:n}function Yn(e){return Math.max(0,e)}function Xn(e){return Math.max(0,e)}var Zn=(e,t,n)=>{let{left:r,height:i,width:a}=t,o=e.top-(i-e.height);return{left:r,width:a,height:Jn(o,e.height,i),top:Xn(o)}},Qn=(e,t,n)=>{let{top:r,left:i,height:a,width:o}=t;return{top:r,height:a,width:qn(e.left,e.width,o,n),left:Yn(i)}},$n=(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:Xn(r),left:0}:{height:i,width:a,top:Xn(r),left:o}},er=(e,t,n)=>{let{top:r,left:i,height:a,width:o}=t;return{width:o,left:i,height:Jn(r,e.height,a),top:Xn(r)}},tr={n:Zn,ne:(e,t,n)=>Zn(e,Qn(e,t,n)),e:Qn,se:(e,t,n)=>er(e,Qn(e,t,n)),s:er,sw:(e,t,n)=>er(e,$n(e,t)),w:$n,nw:(e,t,n)=>Zn(e,$n(e,t))};function nr(e,t,n,r){let i=tr[e];return i?i(t,{...t,...n},r):n}var rr={type:`transform`,scale:1,calcStyle(e){return Wn(e)}},ir={type:`absolute`,scale:1,calcStyle(e){return Gn(e)}};function ar(e){return{type:`transform`,scale:e,calcStyle(e){return Wn(e)},calcDragPosition(t,n,r,i){return{left:(t-r)/e,top:(n-i)/e}}}}var or=rr,sr={cols:12,rowHeight:150,margin:[10,10],containerPadding:null,maxRows:1/0},cr={enabled:!0,bounded:!1,threshold:3},lr={enabled:!0,handles:[`se`]},ur={enabled:!1,defaultItem:{w:1,h:1}};function dr(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??Mn(e).length>0;for(let i=o+1;it.y+t.h)break;wn(t,o)&&dr(e,o,n+t[a],r,s)}}t[r]=n}function fr(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&&!Tn(e,t);)t.y--;let i;for(;(i=Tn(e,t))!==void 0;)dr(n,t,i.y+i.h,`y`);return t.y=Math.max(t.y,0),t}function pr(e,t,n,r){for(t.x=Math.max(t.x,0),t.y=Math.max(t.y,0);t.x>0&&!Tn(e,t);)t.x--;let i;for(;(i=Tn(e,t))!==void 0;)if(dr(r,t,i.x+i.w,`x`),t.x+t.w>n)for(t.x=n-t.w,t.y++;t.x>0&&!Tn(e,t);)t.x--;return t.x=Math.max(t.x,0),t}var mr={type:`vertical`,allowOverlap:!1,compact(e,t){let n=Mn(e),r=An(n),i=On(e),a=Array(e.length);for(let t=0;te[t]-e[n])}function Sr(e,t){let n=xr(e),r=n[0];if(r===void 0)throw Error(`No breakpoints defined`);for(let i=1;ie[a]&&(r=a)}return r}function Cr(e,t){let n=t[e];if(n===void 0)throw Error(`ResponsiveReactGridLayout: \`cols\` entry for breakpoint ${String(e)} is missing!`);return n}function wr(e,t,n,r,i,a){let o=e[n];if(o)return Pn(o);let s=e[r],c=xr(t),l=c.slice(c.indexOf(n));for(let t=0;t{t.exports=`SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED`})),Dr=t(((e,t)=>{var n=Er();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}})),Or=t(((e,t)=>{t.exports=Dr()()})),$=n(Or(),1),kr=n(ne(),1);function Ar(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&&Ar(e.changedTouches,e=>t===e.identifier)}function ei(e){if(e.targetTouches&&e.targetTouches[0])return e.targetTouches[0].identifier;if(e.changedTouches&&e.changedTouches[0])return e.changedTouches[0].identifier}function ti(){return typeof __webpack_nonce__<`u`?__webpack_nonce__:void 0}function ni(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??ti();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&&ai(e.body,`react-draggable-transparent-selection`)}function ri(e){window.requestAnimationFrame?window.requestAnimationFrame(()=>{ii(e)}):ii(e)}function ii(e){if(e)try{e.body&&oi(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 ai(e,t){e.classList?e.classList.add(t):e.className.match(RegExp(`(?:^|\\s)${t}(?!\\S)`))||(e.className+=` ${t}`)}function oi(e,t){e.classList?e.classList.remove(t):e.className=e.className.replace(RegExp(`(?:^|\\s)${t}(?!\\S)`,`g`),``)}function si(e,t,n){if(!e.props.bounds)return[t,n];let{bounds:r}=e.props;r=typeof r==`string`?r:mi(r);let i=hi(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+Nr(s.paddingLeft)+Nr(o.marginLeft),top:-i.offsetTop+Nr(s.paddingTop)+Nr(o.marginTop),right:Jr(a)-Kr(i)-i.offsetLeft+Nr(s.paddingRight)-Nr(o.marginRight),bottom:qr(a)-Gr(i)-i.offsetTop+Nr(s.paddingBottom)-Nr(o.marginBottom)}}return Mr(r.right)&&(t=Math.min(t,r.right)),Mr(r.bottom)&&(n=Math.min(n,r.bottom)),Mr(r.left)&&(t=Math.max(t,r.left)),Mr(r.top)&&(n=Math.max(n,r.top)),[t,n]}function ci(e,t,n){return[Math.round(t/e[0])*e[0],Math.round(n/e[1])*e[1]]}function li(e){return e.props.axis===`both`||e.props.axis===`x`}function ui(e){return e.props.axis===`both`||e.props.axis===`y`}function di(e,t,n){let r=typeof t==`number`?$r(e,t):null;if(typeof t==`number`&&!r)return null;let i=hi(n),a=n.props.offsetParent||i.offsetParent||i.ownerDocument.body;return Yr(r||e,a,n.props.scale)}function fi(e,t,n){let r=!Mr(e.lastX),i=hi(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 pi(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 mi(e){return{left:e.left,top:e.top,right:e.right,bottom:e.bottom}}function hi(e){let t=e.findDOMNode();if(!t)throw Error(`: Unmounted during event!`);return t}function gi(...e){({}).DRAGGABLE_DEBUG&&console.log(...e)}var _i={touch:{start:`touchstart`,move:`touchmove`,stop:`touchend`},mouse:{start:`mousedown`,move:`mousemove`,stop:`mouseup`}},vi=_i.mouse,yi=class extends K.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&&!Hr(e.target,this.props.handle,t)||this.props.cancel&&Hr(e.target,this.props.cancel,t))return;e.type===`touchstart`&&!this.props.allowMobileScroll&&e.preventDefault();let r=ei(e);this.touchIdentifier=r;let i=di(e,r,this);if(i==null)return;let{x:a,y:o}=i,s=fi(this,a,o);gi(`DraggableCore: handleDragStart: %j`,s),gi(`calling`,this.props.onStart),this.props.onStart(e,s)!==!1&&this.mounted!==!1&&(this.props.enableUserSelectHack&&ni(n,this.props.nonce),this.dragging=!0,this.lastX=a,this.lastY=o,Ur(n,vi.move,this.handleDrag),Ur(n,vi.stop,this.handleDragStop))},this.handleDrag=e=>{let t=di(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]=ci(this.props.grid,e,t),!e&&!t)return;n=this.lastX+e,r=this.lastY+t}let i=fi(this,n,r);if(gi(`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=di(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]=ci(this.props.grid,e,t),n=this.lastX+e,r=this.lastY+t}let i=fi(this,n,r);if(this.props.onStop(e,i)===!1||this.mounted===!1)return!1;let a=this.findDOMNode();a&&this.props.enableUserSelectHack&&ri(a.ownerDocument),gi(`DraggableCore: handleDragStop: %j`,i),this.dragging=!1,this.lastX=NaN,this.lastY=NaN,a&&(gi(`DraggableCore: Removing handlers`),Wr(a.ownerDocument,vi.move,this.handleDrag),Wr(a.ownerDocument,vi.stop,this.handleDragStop))},this.onMouseDown=e=>(vi=_i.mouse,this.handleDragStart(e)),this.onMouseUp=e=>(vi=_i.mouse,this.handleDragStop(e)),this.onTouchStart=e=>(vi=_i.touch,this.handleDragStart(e)),this.onTouchEnd=e=>(vi=_i.touch,this.handleDragStop(e))}componentDidMount(){this.mounted=!0;let e=this.findDOMNode();e&&Ur(e,_i.touch.start,this.onTouchStart,{passive:!1})}componentWillUnmount(){this.mounted=!1;let e=this.findDOMNode();if(e){let{ownerDocument:t}=e;Wr(t,_i.mouse.move,this.handleDrag),Wr(t,_i.touch.move,this.handleDrag),Wr(t,_i.mouse.stop,this.handleDragStop),Wr(t,_i.touch.stop,this.handleDragStop),Wr(e,_i.touch.start,this.onTouchStart,{passive:!1}),this.props.enableUserSelectHack&&ri(t)}}findDOMNode(){if(this.props?.nodeRef)return this.props.nodeRef.current;let e=kr.default;return typeof e.findDOMNode==`function`?e.findDOMNode(this):(gi(`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 K.cloneElement(K.Children.only(this.props.children),{onMouseDown:this.onMouseDown,onMouseUp:this.onMouseUp,onTouchEnd:this.onTouchEnd})}};yi.displayName=`DraggableCore`,yi.propTypes={allowAnyClick:$.default.bool,allowMobileScroll:$.default.bool,children:$.default.node.isRequired,disabled:$.default.bool,enableUserSelectHack:$.default.bool,offsetParent:function(e,t){if(e[t]&&e[t].nodeType!==1)throw Error(`Draggable's offsetParent must be a DOM Node.`)},grid:$.default.arrayOf($.default.number),handle:$.default.string,cancel:$.default.string,nodeRef:$.default.object,nonce:$.default.string,onStart:$.default.func,onDrag:$.default.func,onStop:$.default.func,onMouseDown:$.default.func,scale:$.default.number,className:Pr,style:Pr,transform:Pr},yi.defaultProps={allowAnyClick:!1,allowMobileScroll:!1,disabled:!1,enableUserSelectHack:!0,onStart:function(){},onDrag:function(){},onStop:function(){},onMouseDown:function(){},scale:1};var bi=class extends K.Component{constructor(e){super(e),this.onDragStart=(e,t)=>{if(gi(`Draggable: onDragStart: %j`,t),this.props.onStart(e,pi(this,t))===!1)return!1;this.setState({dragging:!0,dragged:!0})},this.onDrag=(e,t)=>{if(!this.state.dragging)return!1;gi(`Draggable: onDrag: %j`,t);let n=pi(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]=si(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,pi(this,t))===!1)return!1;gi(`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)?(gi(`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=kr.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:li(this)&&p?this.state.x:m.x,y:ui(this)&&p?this.state.y:m.y};this.state.isElementSVG?f=Zr(h,c):d=Xr(h,c);let g=K.Children.only(n),v=_(g.props.className||``,i,{[a]:this.state.dragging,[o]:this.state.dragged});return K.createElement(yi,{...u,onStart:this.onDragStart,onDrag:this.onDrag,onStop:this.onDragStop},K.cloneElement(g,{className:v,style:{...g.props.style,...d},transform:f}))}};bi.displayName=`Draggable`,bi.propTypes={...yi.propTypes,axis:$.default.oneOf([`both`,`x`,`y`,`none`]),bounds:$.default.oneOfType([$.default.shape({left:$.default.number,right:$.default.number,top:$.default.number,bottom:$.default.number}),$.default.string,$.default.oneOf([!1])]),defaultClassName:$.default.string,defaultClassNameDragging:$.default.string,defaultClassNameDragged:$.default.string,defaultPosition:$.default.shape({x:$.default.number,y:$.default.number}),positionOffset:$.default.shape({x:$.default.oneOfType([$.default.number,$.default.string]),y:$.default.oneOfType([$.default.number,$.default.string])}),position:$.default.shape({x:$.default.number,y:$.default.number}),className:Pr,style:Pr,transform:Pr},bi.defaultProps={...yi.defaultProps,axis:`both`,bounds:!1,defaultClassName:`react-draggable`,defaultClassNameDragging:`react-draggable-dragging`,defaultClassNameDragged:`react-draggable-dragged`,defaultPosition:{x:0,y:0},scale:1};var xi=t(((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 n=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,r)=>(r=e==null?{}:n(s(e)),u(t||!e||!e.__esModule?i(r,`default`,{value:e,enumerable:!0}):r,e)),f=e=>u(i({},`__esModule`,{value:!0}),e),p={};l(p,{DraggableCore:()=>W,default:()=>xe}),t.exports=f(p);var m=d(r()),h=d(Or()),g=d(ne()),_=xi();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 F(e){if(e.targetTouches&&e.targetTouches[0])return e.targetTouches[0].identifier;if(e.changedTouches&&e.changedTouches[0])return e.changedTouches[0].identifier}function ce(){return typeof __webpack_nonce__<`u`?__webpack_nonce__:void 0}function le(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??ce();r&&n.setAttribute(`nonce`,r),n.innerHTML=`.react-draggable-transparent-selection *::-moz-selection {all: inherit;} +`,e.getElementsByTagName(`head`)[0].appendChild(n)}e.body&&ai(e.body,`react-draggable-transparent-selection`)}function ri(e){window.requestAnimationFrame?window.requestAnimationFrame(()=>{ii(e)}):ii(e)}function ii(e){if(e)try{e.body&&oi(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 ai(e,t){e.classList?e.classList.add(t):e.className.match(RegExp(`(?:^|\\s)${t}(?!\\S)`))||(e.className+=` ${t}`)}function oi(e,t){e.classList?e.classList.remove(t):e.className=e.className.replace(RegExp(`(?:^|\\s)${t}(?!\\S)`,`g`),``)}function si(e,t,n){if(!e.props.bounds)return[t,n];let{bounds:r}=e.props;r=typeof r==`string`?r:mi(r);let i=hi(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+Nr(s.paddingLeft)+Nr(o.marginLeft),top:-i.offsetTop+Nr(s.paddingTop)+Nr(o.marginTop),right:Jr(a)-Kr(i)-i.offsetLeft+Nr(s.paddingRight)-Nr(o.marginRight),bottom:qr(a)-Gr(i)-i.offsetTop+Nr(s.paddingBottom)-Nr(o.marginBottom)}}return Mr(r.right)&&(t=Math.min(t,r.right)),Mr(r.bottom)&&(n=Math.min(n,r.bottom)),Mr(r.left)&&(t=Math.max(t,r.left)),Mr(r.top)&&(n=Math.max(n,r.top)),[t,n]}function ci(e,t,n){return[Math.round(t/e[0])*e[0],Math.round(n/e[1])*e[1]]}function li(e){return e.props.axis===`both`||e.props.axis===`x`}function ui(e){return e.props.axis===`both`||e.props.axis===`y`}function di(e,t,n){let r=typeof t==`number`?$r(e,t):null;if(typeof t==`number`&&!r)return null;let i=hi(n),a=n.props.offsetParent||i.offsetParent||i.ownerDocument.body;return Yr(r||e,a,n.props.scale)}function fi(e,t,n){let r=!Mr(e.lastX),i=hi(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 pi(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 mi(e){return{left:e.left,top:e.top,right:e.right,bottom:e.bottom}}function hi(e){let t=e.findDOMNode();if(!t)throw Error(`: Unmounted during event!`);return t}var gi=typeof process<`u`&&{}.DRAGGABLE_DEBUG?console.log.bind(console):function(){},_i={touch:{start:`touchstart`,move:`touchmove`,stop:`touchend`},mouse:{start:`mousedown`,move:`mousemove`,stop:`mouseup`}},vi=_i.mouse,yi=class extends K.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&&!Hr(e.target,this.props.handle,t)||this.props.cancel&&Hr(e.target,this.props.cancel,t))return;e.type===`touchstart`&&!this.props.allowMobileScroll&&e.preventDefault();let r=ei(e);this.touchIdentifier=r;let i=di(e,r,this);if(i==null)return;let{x:a,y:o}=i,s=fi(this,a,o);gi(`DraggableCore: handleDragStart: %j`,s),gi(`calling`,this.props.onStart),this.props.onStart(e,s)!==!1&&this.mounted!==!1&&(this.props.enableUserSelectHack&&ni(n,this.props.nonce),this.dragging=!0,this.lastX=a,this.lastY=o,Ur(n,vi.move,this.handleDrag),Ur(n,vi.stop,this.handleDragStop))},this.handleDrag=e=>{let t=di(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]=ci(this.props.grid,e,t),!e&&!t)return;n=this.lastX+e,r=this.lastY+t}let i=fi(this,n,r);if(gi(`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=di(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]=ci(this.props.grid,e,t),n=this.lastX+e,r=this.lastY+t}let i=fi(this,n,r);if(this.props.onStop(e,i)===!1||this.mounted===!1)return!1;let a=this.findDOMNode();a&&this.props.enableUserSelectHack&&ri(a.ownerDocument),gi(`DraggableCore: handleDragStop: %j`,i),this.dragging=!1,this.lastX=NaN,this.lastY=NaN,a&&(gi(`DraggableCore: Removing handlers`),Wr(a.ownerDocument,vi.move,this.handleDrag),Wr(a.ownerDocument,vi.stop,this.handleDragStop))},this.onMouseDown=e=>(vi=_i.mouse,this.handleDragStart(e)),this.onMouseUp=e=>(vi=_i.mouse,this.handleDragStop(e)),this.onTouchStart=e=>(vi=_i.touch,this.handleDragStart(e)),this.onTouchEnd=e=>(vi=_i.touch,this.handleDragStop(e))}componentDidMount(){this.mounted=!0;let e=this.findDOMNode();e&&Ur(e,_i.touch.start,this.onTouchStart,{passive:!1})}componentWillUnmount(){this.mounted=!1;let e=this.findDOMNode();if(e){let{ownerDocument:t}=e;Wr(t,_i.mouse.move,this.handleDrag),Wr(t,_i.touch.move,this.handleDrag),Wr(t,_i.mouse.stop,this.handleDragStop),Wr(t,_i.touch.stop,this.handleDragStop),Wr(e,_i.touch.start,this.onTouchStart,{passive:!1}),this.props.enableUserSelectHack&&ri(t)}}findDOMNode(){if(this.props?.nodeRef)return this.props.nodeRef.current;let e=kr.default;return typeof e.findDOMNode==`function`?e.findDOMNode(this):(gi(`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 K.cloneElement(K.Children.only(this.props.children),{onMouseDown:this.onMouseDown,onMouseUp:this.onMouseUp,onTouchEnd:this.onTouchEnd})}};yi.displayName=`DraggableCore`,yi.propTypes={allowAnyClick:$.default.bool,allowMobileScroll:$.default.bool,children:$.default.node.isRequired,disabled:$.default.bool,enableUserSelectHack:$.default.bool,offsetParent:function(e,t){if(e[t]&&e[t].nodeType!==1)throw Error(`Draggable's offsetParent must be a DOM Node.`)},grid:$.default.arrayOf($.default.number),handle:$.default.string,cancel:$.default.string,nodeRef:$.default.object,nonce:$.default.string,onStart:$.default.func,onDrag:$.default.func,onStop:$.default.func,onMouseDown:$.default.func,scale:$.default.number,className:Pr,style:Pr,transform:Pr},yi.defaultProps={allowAnyClick:!1,allowMobileScroll:!1,disabled:!1,enableUserSelectHack:!0,onStart:function(){},onDrag:function(){},onStop:function(){},onMouseDown:function(){},scale:1};var bi=class extends K.Component{constructor(e){super(e),this.onDragStart=(e,t)=>{if(gi(`Draggable: onDragStart: %j`,t),this.props.onStart(e,pi(this,t))===!1)return!1;this.setState({dragging:!0,dragged:!0})},this.onDrag=(e,t)=>{if(!this.state.dragging)return!1;gi(`Draggable: onDrag: %j`,t);let n=pi(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]=si(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,pi(this,t))===!1)return!1;gi(`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)?(gi(`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=kr.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:li(this)&&p?this.state.x:m.x,y:ui(this)&&p?this.state.y:m.y};this.state.isElementSVG?f=Zr(h,c):d=Xr(h,c);let g=K.Children.only(n),v=_(g.props.className||``,i,{[a]:this.state.dragging,[o]:this.state.dragged});return K.createElement(yi,{...u,onStart:this.onDragStart,onDrag:this.onDrag,onStop:this.onDragStop},K.cloneElement(g,{className:v,style:{...g.props.style,...d},transform:f}))}};bi.displayName=`Draggable`,bi.propTypes={...yi.propTypes,axis:$.default.oneOf([`both`,`x`,`y`,`none`]),bounds:$.default.oneOfType([$.default.shape({left:$.default.number,right:$.default.number,top:$.default.number,bottom:$.default.number}),$.default.string,$.default.oneOf([!1])]),defaultClassName:$.default.string,defaultClassNameDragging:$.default.string,defaultClassNameDragged:$.default.string,defaultPosition:$.default.shape({x:$.default.number,y:$.default.number}),positionOffset:$.default.shape({x:$.default.oneOfType([$.default.number,$.default.string]),y:$.default.oneOfType([$.default.number,$.default.string])}),position:$.default.shape({x:$.default.number,y:$.default.number}),className:Pr,style:Pr,transform:Pr},bi.defaultProps={...yi.defaultProps,axis:`both`,bounds:!1,defaultClassName:`react-draggable`,defaultClassNameDragging:`react-draggable-dragging`,defaultClassNameDragged:`react-draggable-dragged`,defaultPosition:{x:0,y:0},scale:1};var xi=t(((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 n=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,r)=>(r=e==null?{}:n(s(e)),u(t||!e||!e.__esModule?i(r,`default`,{value:e,enumerable:!0}):r,e)),f=e=>u(i({},`__esModule`,{value:!0}),e),p={};l(p,{DraggableCore:()=>W,default:()=>xe}),t.exports=f(p);var m=d(r()),h=d(Or()),g=d(ne()),_=xi();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 F(e){if(e.targetTouches&&e.targetTouches[0])return e.targetTouches[0].identifier;if(e.changedTouches&&e.changedTouches[0])return e.changedTouches[0].identifier}function ce(){return typeof __webpack_nonce__<`u`?__webpack_nonce__:void 0}function le(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??ce();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&&L(e.body,`react-draggable-transparent-selection`)}function I(e){window.requestAnimationFrame?window.requestAnimationFrame(()=>{ue(e)}):ue(e)}function ue(e){if(e)try{e.body&&de(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 L(e,t){e.classList?e.classList.add(t):e.className.match(RegExp(`(?:^|\\s)${t}(?!\\S)`))||(e.className+=` ${t}`)}function de(e,t){e.classList?e.classList.remove(t):e.className=e.className.replace(RegExp(`(?:^|\\s)${t}(?!\\S)`,`g`),``)}function fe(e,t,n){if(!e.props.bounds)return[t,n];let{bounds:r}=e.props;r=typeof r==`string`?r:z(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+x(s.paddingLeft)+x(o.marginLeft),top:-i.offsetTop+x(s.paddingTop)+x(o.marginTop),right:N(a)-M(i)-i.offsetLeft+x(s.paddingRight)-x(o.marginRight),bottom:re(a)-j(i)-i.offsetTop+x(s.paddingBottom)-x(o.marginBottom)}}return b(r.right)&&(t=Math.min(t,r.right)),b(r.bottom)&&(n=Math.min(n,r.bottom)),b(r.left)&&(t=Math.max(t,r.left)),b(r.top)&&(n=Math.max(n,r.top)),[t,n]}function pe(e,t,n){return[Math.round(t/e[0])*e[0],Math.round(n/e[1])*e[1]]}function me(e){return e.props.axis===`both`||e.props.axis===`x`}function he(e){return e.props.axis===`both`||e.props.axis===`y`}function ge(e,t,n){let r=typeof t==`number`?P(e,t):null;if(typeof t==`number`&&!r)return null;let i=ve(n),a=n.props.offsetParent||i.offsetParent||i.ownerDocument.body;return ie(r||e,a,n.props.scale)}function _e(e,t,n){let r=!b(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 R(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 z(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 B=d(r()),V=d(Or()),ye=d(ne());function H(...e){({}).DRAGGABLE_DEBUG&&console.log(...e)}var be={touch:{start:`touchstart`,move:`touchmove`,stop:`touchend`},mouse:{start:`mousedown`,move:`mousemove`,stop:`mouseup`}},U=be.mouse,W=class extends B.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=F(e);this.touchIdentifier=r;let i=ge(e,r,this);if(i==null)return;let{x:a,y:o}=i,s=_e(this,a,o);H(`DraggableCore: handleDragStart: %j`,s),H(`calling`,this.props.onStart),this.props.onStart(e,s)!==!1&&this.mounted!==!1&&(this.props.enableUserSelectHack&&le(n,this.props.nonce),this.dragging=!0,this.lastX=a,this.lastY=o,k(n,U.move,this.handleDrag),k(n,U.stop,this.handleDragStop))},this.handleDrag=e=>{let t=ge(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]=pe(this.props.grid,e,t),!e&&!t)return;n=this.lastX+e,r=this.lastY+t}let i=_e(this,n,r);if(H(`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=ge(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]=pe(this.props.grid,e,t),n=this.lastX+e,r=this.lastY+t}let i=_e(this,n,r);if(this.props.onStop(e,i)===!1||this.mounted===!1)return!1;let a=this.findDOMNode();a&&this.props.enableUserSelectHack&&I(a.ownerDocument),H(`DraggableCore: handleDragStop: %j`,i),this.dragging=!1,this.lastX=NaN,this.lastY=NaN,a&&(H(`DraggableCore: Removing handlers`),A(a.ownerDocument,U.move,this.handleDrag),A(a.ownerDocument,U.stop,this.handleDragStop))},this.onMouseDown=e=>(U=be.mouse,this.handleDragStart(e)),this.onMouseUp=e=>(U=be.mouse,this.handleDragStop(e)),this.onTouchStart=e=>(U=be.touch,this.handleDragStart(e)),this.onTouchEnd=e=>(U=be.touch,this.handleDragStop(e))}componentDidMount(){this.mounted=!0;let e=this.findDOMNode();e&&k(e,be.touch.start,this.onTouchStart,{passive:!1})}componentWillUnmount(){this.mounted=!1;let e=this.findDOMNode();if(e){let{ownerDocument:t}=e;A(t,be.mouse.move,this.handleDrag),A(t,be.touch.move,this.handleDrag),A(t,be.mouse.stop,this.handleDragStop),A(t,be.touch.stop,this.handleDragStop),A(e,be.touch.start,this.onTouchStart,{passive:!1}),this.props.enableUserSelectHack&&I(t)}}findDOMNode(){if(this.props?.nodeRef)return this.props.nodeRef.current;let e=ye.default;return typeof e.findDOMNode==`function`?e.findDOMNode(this):(H(`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 B.cloneElement(B.Children.only(this.props.children),{onMouseDown:this.onMouseDown,onMouseUp:this.onMouseUp,onTouchEnd:this.onTouchEnd})}};W.displayName=`DraggableCore`,W.propTypes={allowAnyClick:V.default.bool,allowMobileScroll:V.default.bool,children:V.default.node.isRequired,disabled:V.default.bool,enableUserSelectHack:V.default.bool,offsetParent:function(e,t){if(e[t]&&e[t].nodeType!==1)throw Error(`Draggable's offsetParent must be a DOM Node.`)},grid:V.default.arrayOf(V.default.number),handle:V.default.string,cancel:V.default.string,nodeRef:V.default.object,nonce:V.default.string,onStart:V.default.func,onDrag:V.default.func,onStop:V.default.func,onMouseDown:V.default.func,scale:V.default.number,className:S,style:S,transform:S},W.defaultProps={allowAnyClick:!1,allowMobileScroll:!1,disabled:!1,enableUserSelectHack:!0,onStart:function(){},onDrag:function(){},onStop:function(){},onMouseDown:function(){},scale:1};var xe=class extends m.Component{constructor(e){super(e),this.onDragStart=(e,t)=>{if(H(`Draggable: onDragStart: %j`,t),this.props.onStart(e,R(this,t))===!1)return!1;this.setState({dragging:!0,dragged:!0})},this.onDrag=(e,t)=>{if(!this.state.dragging)return!1;H(`Draggable: onDrag: %j`,t);let n=R(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]=fe(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,R(this,t))===!1)return!1;H(`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)?(H(`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:me(this)&&p?this.state.x:h.x,y:he(this)&&p?this.state.y:h.y};this.state.isElementSVG?f=oe(g,c):d=ae(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(W,{...u,onStart:this.onDragStart,onDrag:this.onDrag,onStop:this.onDragStop},m.cloneElement(v,{className:y,style:{...v.props.style,...d},transform:f}))}};xe.displayName=`Draggable`,xe.propTypes={...W.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:S,style:S,transform:S},xe.defaultProps={...W.defaultProps,axis:`both`,bounds:!1,defaultClassName:`react-draggable`,defaultClassNameDragging:`react-draggable-dragging`,defaultClassNameDragged:`react-draggable-dragged`,defaultPosition:{x:0,y:0},scale:1},0&&(t.exports={DraggableCore:W})})),Ci=t(((e,t)=>{var n=Si(),r=n.DraggableCore,i=n.default||n;t.exports=i,t.exports.default=i,t.exports.DraggableCore=r})),wi=t((e=>{e.__esModule=!0,e.cloneElement=l;var t=n(r());function n(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(Or());Ci();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)}}})),Ei=t((e=>{e.__esModule=!0,e.default=void 0;var t=s(r()),n=Ci(),i=wi(),a=Ti(),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,n){let r=this.props.handle;if(!r)return t.createElement(`span`,{className:`react-resizable-handle react-resizable-handle-`+e,ref:n});if(typeof r==`function`)return r(e,n);let i=typeof r.type==`string`,a=d({ref:n},i?{}:{handleAxis:e});return t.cloneElement(r,a)}render(){let e=this.props,r=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)(r,d(d({},f),{},{className:(a?a+` `:``)+`react-resizable`,children:[...t.Children.toArray(r.props.children),...u.map(e=>{let r=this.handleRefs[e]??(this.handleRefs[e]=t.createRef());return t.createElement(n.DraggableCore,c({},s,{nodeRef:r,key:`resizableHandle-`+e,onStop:this.resizeHandler(`onResizeStop`,e),onStart:this.resizeHandler(`onResizeStart`,e),onDrag:this.resizeHandler(`onResize`,e)}),this.renderResizeHandle(e,r))})]}))}};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}})),Di=t((e=>{e.__esModule=!0,e.default=void 0;var t=c(r()),n=s(Or()),i=s(Ei()),a=Ti(),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,n=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 t.createElement(i.default,{axis:m,draggableOpts:c,handle:n,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},t.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:n.default.element})})),Oi=t(((e,t)=>{t.exports=function(){throw Error(`Don't instantiate Resizable directly! Use require('react-resizable').Resizable`)},t.exports.Resizable=Ei().default,t.exports.ResizableBox=Di().default})),ki=t(((e,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 ee=c(S);function D(e,t){return ee(e,t,new WeakMap)}var te=c(r(S,{createIsNestedEqual:function(){return o}}));function O(e,t){return te(e,t,new WeakMap)}function k(e){return c(r(x,e(x)))}function A(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=D,e.circularShallowEqual=O,e.createCustomCircularEqual=A,e.createCustomEqual=k,e.deepEqual=w,e.sameValueZeroEqual=o,e.shallowEqual=E,Object.defineProperty(e,"__esModule",{value:!0})}))})),Ai=Oi(),ji=ki();function Mi(e){let{children:t,cols:n,containerWidth:r,margin:i,containerPadding:a,rowHeight:o,maxRows:s,isDraggable:c,isResizable:l,isBounded:u,static:d,useCSSTransforms:f=!0,usePercentages:p=!1,transformScale:m=1,positionStrategy:h,dragThreshold:g=0,droppingPosition:v,className:y=``,style:b,handle:x=``,cancel:S=``,x:C,y:w,w:T,h:E,minW:ee=1,maxW:D=1/0,minH:te=1,maxH:O=1/0,i:k,resizeHandles:A,resizeHandle:j,constraints:M=Vn,layoutItem:ne,layout:re=[],onDragStart:N,onDrag:ie,onDragStop:ae,onResizeStart:oe,onResize:se,onResizeStop:P}=e,[F,ce]=(0,K.useState)(!1),[le,I]=(0,K.useState)(!1),ue=(0,K.useRef)(null),L=(0,K.useRef)({left:0,top:0}),de=(0,K.useRef)({top:0,left:0,width:0,height:0}),fe=(0,K.useRef)(void 0),pe=(0,K.useRef)(re);pe.current=re;let me=(0,K.useRef)(null),he=(0,K.useRef)(null),ge=(0,K.useRef)(!1),_e=(0,K.useRef)({x:0,y:0}),R=(0,K.useRef)(!1),z=(0,K.useMemo)(()=>({cols:n,containerPadding:a,containerWidth:r,margin:i,maxRows:s,rowHeight:o}),[n,a,r,i,s,o]),ve=(0,K.useMemo)(()=>({cols:n,maxRows:s,containerWidth:r,containerHeight:0,rowHeight:o,margin:i,layout:[]}),[n,s,r,o,i]),B=(0,K.useCallback)(()=>({...ve,layout:pe.current}),[ve]),V=(0,K.useMemo)(()=>ne??{i:k,x:C,y:w,w:T,h:E,minW:ee,maxW:D,minH:te,maxH:O},[ne,k,C,w,T,E,ee,D,te,O]),ye=(0,K.useCallback)(e=>{if(h?.calcStyle)return h.calcStyle(e);if(f)return Wn(e);let t=Gn(e);return p?{...t,left:Kn(e.left/r),width:Kn(e.width/r)}:t},[h,f,p,r]),H=(0,K.useCallback)((e,{node:t})=>{if(!N)return;let{offsetParent:n}=t;if(!n)return;let r=n.getBoundingClientRect(),i=t.getBoundingClientRect(),a=i.left/m,o=r.left/m,s=i.top/m,c=r.top/m,l;if(h?.calcDragPosition){let t=e;l=h.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(L.current=l,g>0){let t=e;_e.current={x:t.clientX,y:t.clientY},ge.current=!0,R.current=!1,ce(!0);return}ce(!0);let u=xn(z,l.top,l.left),{x:d,y:f}=Hn(M,V,u.x,u.y,B());N(k,d,f,{e,node:t,newPosition:l})},[N,m,z,h,g,M,V,B,k]),be=(0,K.useCallback)((e,{node:t,deltaX:n,deltaY:a})=>{if(!ie||!F)return;let s=e;if(ge.current&&!R.current){let n=s.clientX-_e.current.x,r=s.clientY-_e.current.y;if(Math.hypot(n,r){if(!ae||!F)return;let n=ge.current;if(ge.current=!1,R.current=!1,_e.current={x:0,y:0},n){ce(!1),L.current={left:0,top:0};return}let{left:r,top:i}=L.current,a={top:i,left:r};ce(!1),L.current={left:0,top:0};let o=xn(z,i,r),{x:s,y:c}=Hn(M,V,o.x,o.y,B());ae(k,s,c,{e,node:t,newPosition:a})},[ae,F,z,M,V,B,k]);me.current=H,he.current=be;let W=(0,K.useCallback)((e,{node:t,size:n,handle:i},a,o)=>{let s=o===`onResizeStart`?oe:o===`onResize`?se:P;if(!s)return;let c;c=t?nr(i,a,n,r):{...n,top:a.top,left:a.left},de.current=c;let l=Sn(z,c.width,c.height),{w:u,h:d}=Un(M,V,l.w,l.h,i,B());s(k,u,d,{e:e.nativeEvent??e,node:t,size:c,handle:i})},[oe,se,P,r,z,k,M,V,B]),xe=(0,K.useCallback)((e,t)=>{I(!0);let n=yn(z,C,w,T,E),r={...t,handle:t.handle};W(e,r,n,`onResizeStart`)},[W,z,C,w,T,E]),Se=(0,K.useCallback)((e,t)=>{let n=yn(z,C,w,T,E),r={...t,handle:t.handle};W(e,r,n,`onResize`)},[W,z,C,w,T,E]),Ce=(0,K.useCallback)((e,t)=>{I(!1),de.current={top:0,left:0,width:0,height:0};let n=yn(z,C,w,T,E),r={...t,handle:t.handle};W(e,r,n,`onResizeStop`)},[W,z,C,w,T,E]);(0,K.useEffect)(()=>{if(!v)return;let e=ue.current;if(!e)return;let t=fe.current||{left:0,top:0},n=F&&(v.left!==t.left||v.top!==t.top);if(!F){let t={node:e,deltaX:v.left,deltaY:v.top,lastX:0,lastY:0,x:v.left,y:v.top};me.current?.(v.e,t)}else if(n){let t={node:e,deltaX:v.left-L.current.left,deltaY:v.top-L.current.top,lastX:L.current.left,lastY:L.current.top,x:v.left,y:v.top};he.current?.(v.e,t)}fe.current=v},[v,F,k]);let G=yn(z,C,w,T,E,F?L.current:null,le?de.current:null),we=K.Children.only(t),Te=_n(z),Ee=[vn(ee,Te,i[0]),vn(te,o,i[1])],J=[vn(D,Te,i[0]),vn(O,o,i[1])],Y=we.props,De=Y.className,Oe=Y.style,ke=K.cloneElement(we,{ref:ue,className:_(`react-grid-item`,De,y,{static:d,resizing:le,"react-draggable":c,"react-draggable-dragging":F,dropping:!!v,cssTransforms:f}),style:{...b,...Oe,...ye(G)}}),X=j;return ke=(0,q.jsx)(Ai.Resizable,{draggableOpts:{disabled:!l},className:l?void 0:`react-resizable-hide`,width:G.width,height:G.height,minConstraints:Ee,maxConstraints:J,onResizeStart:xe,onResize:Se,onResizeStop:Ce,transformScale:m,resizeHandles:A,handle:X,children:ke}),ke=(0,q.jsx)(yi,{disabled:!c,onStart:H,onDrag:be,onStop:U,handle:x,cancel:`.react-resizable-handle`+(S?`,`+S:``),scale:m,nodeRef:ue,children:ke}),ke}var Ni=()=>{},Pi=`react-grid-layout`,Fi=!1;try{Fi=/firefox/i.test(navigator.userAgent)}catch{}function Ii(e,t){let n=K.Children.toArray(e),r=K.Children.toArray(t);if(n.length!==r.length)return!1;for(let e=0;e{if(!K.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(Nn(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:An(i),w:1,h:1})}});let o=Ln(i,{cols:n});return r.compact(o,n)}function Ri(e){let{children:t,width:n,gridConfig:r,dragConfig:i,resizeConfig:a,dropConfig:o,positionStrategy:s=or,compactor:c,constraints:l=Vn,layout:u=[],droppingItem:d,autoSize:f=!0,className:p=``,style:m={},innerRef:h,onLayoutChange:g=Ni,onDragStart:v=Ni,onDrag:y=Ni,onDragStop:b=Ni,onResizeStart:x=Ni,onResize:S=Ni,onResizeStop:C=Ni,onDrop:w=Ni,onDropDragOver:T=Ni}=e,E=(0,K.useMemo)(()=>({...sr,...r}),[r]),ee=(0,K.useMemo)(()=>({...cr,...i}),[i]),D=(0,K.useMemo)(()=>({...lr,...a}),[a]),te=(0,K.useMemo)(()=>({...ur,...o}),[o]),{cols:O,rowHeight:k,maxRows:A,margin:j,containerPadding:M}=E,{enabled:ne,bounded:re,handle:N,cancel:ie,threshold:ae}=ee,{enabled:oe,handles:se,handleComponent:P}=D,{enabled:F,defaultItem:ce,onDragOver:le}=te,I=c??br(`vertical`),ue=I.type,L=I.allowOverlap,de=I.preventCollision??!1,fe=(0,K.useMemo)(()=>d??{i:`__dropping-elem__`,...ce},[d,ce]),pe=s.type===`transform`,me=s.scale,he=M??j,[ge,_e]=(0,K.useState)(!1),[R,z]=(0,K.useState)(()=>Li(u,t,O,I)),[ve,B]=(0,K.useState)(null),[V,ye]=(0,K.useState)(!1),[H,be]=(0,K.useState)(null),[U,W]=(0,K.useState)(),xe=(0,K.useRef)(null),Se=(0,K.useRef)(null),Ce=(0,K.useRef)(null),G=(0,K.useRef)(0),we=(0,K.useRef)(R),Te=(0,K.useRef)(u),Ee=(0,K.useRef)(t),J=(0,K.useRef)(ue),Y=(0,K.useRef)(R);Y.current=R,(0,K.useEffect)(()=>{_e(!0),(0,ji.deepEqual)(R,u)||g(R)},[]),(0,K.useEffect)(()=>{if(ve||H)return;let e=!(0,ji.deepEqual)(u,Te.current),n=!Ii(t,Ee.current),r=ue!==J.current;if(e||n||r){let n=Li(e?u:R,t,O,I);(0,ji.deepEqual)(n,R)||z(n)}Te.current=u,Ee.current=t,J.current=ue},[u,t,O,ue,I,ve,H,R]),(0,K.useEffect)(()=>{if(!ve&&!(0,ji.deepEqual)(R,we.current)){we.current=R;let e=R.filter(e=>e.i!==fe.i);g(e)}},[R,ve,g,fe.i]);let De=(0,K.useMemo)(()=>{if(!f)return;let e=An(R),t=he[1];return e*k+(e-1)*j[1]+t*2+`px`},[f,R,k,j,he]),Oe=(0,K.useCallback)((e,t,n,r)=>{let i=Y.current,a=jn(i,e);if(!a)return;let o={w:a.w,h:a.h,x:a.x,y:a.y,i:e};xe.current=Nn(a),Ce.current=i,B(o),v(i,a,a,null,r.e,r.node)},[v]),ke=(0,K.useCallback)((e,t,n,r)=>{let i=Y.current,a=xe.current,o=jn(i,e);if(!o)return;let s={w:o.w,h:o.h,x:o.x,y:o.y,i:e},c=Rn(i,o,t,n,!0,de,ue,O,L);y(c,a,o,s,r.e,r.node),z(I.compact(c,O)),B(s)},[de,ue,O,L,I,y]),X=(0,K.useCallback)((e,t,n,r)=>{if(!ve)return;let i=Y.current,a=xe.current,o=jn(i,e);if(!o)return;let s=Rn(i,o,t,n,!0,de,ue,O,L),c=I.compact(s,O);b(c,a,o,null,r.e,r.node);let l=Ce.current;xe.current=null,Ce.current=null,B(null),z(c),l&&!(0,ji.deepEqual)(l,c)&&g(c)},[ve,de,ue,O,L,I,b,g]),Ae=(0,K.useCallback)((e,t,n,r)=>{let i=Y.current,a=jn(i,e);a&&(Se.current=Nn(a),Ce.current=i,ye(!0),x(i,a,a,null,r.e,r.node))},[x]),je=(0,K.useCallback)((e,t,n,r)=>{let i=Y.current,a=Se.current,{handle:o}=r,s=!1,c,l,[u,d]=In(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&&!L&&En(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,e));if(!d)return;let f=u;s&&c!==void 0&&l!==void 0&&(f=Rn(u,d,c,l,!0,de,ue,O,L));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),z(I.compact(f,O)),B(p)},[de,ue,O,L,I,S]),Me=(0,K.useCallback)((e,t,n,r)=>{let i=Y.current,a=Se.current,o=jn(i,e),s=I.compact(i,O);C(s,a,o??null,null,r.e,r.node);let c=Ce.current;Se.current=null,Ce.current=null,B(null),ye(!1),z(s),c&&!(0,ji.deepEqual)(c,s)&&g(s)},[O,I,C,g]),Z=(0,K.useCallback)(()=>{let e=Y.current;if(!e.some(e=>e.i===fe.i)){be(null),B(null),W(void 0);return}let t=I.compact(e.filter(e=>e.i!==fe.i),O);z(t),be(null),B(null),W(void 0)},[fe.i,O,I]),Ne=(0,K.useCallback)(e=>{if(e.preventDefault(),e.stopPropagation(),Fi&&!e.nativeEvent.target?.classList.contains(Pi))return!1;let t=le?le(e.nativeEvent):T(e);if(t===!1)return H&&Z(),!1;let{dragOffsetX:r=0,dragOffsetY:i=0,...a}=t??{},o={...fe,...a},s=e.currentTarget.getBoundingClientRect(),c={cols:O,margin:j,maxRows:A,rowHeight:k,containerWidth:n,containerPadding:he},l=_n(c),u=vn(o.w,l,j[0]),d=vn(o.h,k,j[1]),f=u/2,p=d/2,m=e.clientX-s.left+r-f,h=e.clientY-s.top+i-p,g=Math.max(0,m),_=Math.max(0,h),v={left:g/me,top:_/me,e:e.nativeEvent};if(H)U&&(U.left!==v.left||U.top!==v.top)&&W(v);else{let e=bn(c,_,g,o.w,o.h);be((0,q.jsx)(`div`,{},o.i)),W(v);let t=Y.current.filter(e=>e.i!==o.i);z([...t,{...o,x:e.x,y:e.y,static:!1,isDraggable:!0}])}},[H,U,fe,le,T,Z,me,O,j,A,k,n,he]),Pe=(0,K.useCallback)(e=>{e.preventDefault(),e.stopPropagation(),G.current--,G.current<0&&(G.current=0),G.current===0&&Z()},[Z]),Fe=(0,K.useCallback)(e=>{e.preventDefault(),e.stopPropagation(),G.current++},[]),Ie=(0,K.useCallback)(e=>{e.preventDefault(),e.stopPropagation();let t=Y.current,n=t.find(e=>e.i===fe.i);G.current=0,Z(),w(t,n,e.nativeEvent)},[fe.i,Z,w]),Le=(0,K.useCallback)((e,t)=>{if(!e||!e.key)return null;let r=jn(R,String(e.key));if(!r)return null;let i=typeof r.isDraggable==`boolean`?r.isDraggable:!r.static&&ne,a=typeof r.isResizable==`boolean`?r.isResizable:!r.static&&oe,o=r.resizeHandles||[...se],c=i&&re&&r.isBounded!==!1,u=P;return(0,q.jsx)(Mi,{containerWidth:n,cols:O,margin:j,containerPadding:he,maxRows:A,rowHeight:k,cancel:ie,handle:N,onDragStart:Oe,onDrag:ke,onDragStop:X,onResizeStart:Ae,onResize:je,onResizeStop:Me,isDraggable:i,isResizable:a,isBounded:c,useCSSTransforms:pe&&ge,usePercentages:!ge,transformScale:me,positionStrategy:s,dragThreshold:ae,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?U:void 0,resizeHandles:o,resizeHandle:u,constraints:l,layoutItem:r,layout:R,children:e},r.i)},[R,n,O,j,he,A,k,ie,N,Oe,ke,X,Ae,je,Me,ne,oe,re,pe,ge,me,s,ae,U,se,P,l]),Re=()=>ve?(0,q.jsx)(Mi,{w:ve.w,h:ve.h,x:ve.x,y:ve.y,i:ve.i,className:`react-grid-placeholder ${V?`placeholder-resizing`:``}`,containerWidth:n,cols:O,margin:j,containerPadding:he,maxRows:A,rowHeight:k,isDraggable:!1,isResizable:!1,isBounded:!1,useCSSTransforms:pe,transformScale:me,constraints:l,layout:R,children:(0,q.jsx)(`div`,{})}):null,ze=_(Pi,p),Be={height:De,...m};return(0,q.jsxs)(`div`,{ref:h,className:ze,style:Be,onDrop:F?Ie:void 0,onDragLeave:F?Pe:void 0,onDragEnter:F?Fe:void 0,onDragOver:F?Ne:void 0,children:[K.Children.map(t,e=>K.isValidElement(e)?Le(e):null),F&&H&&Le(H,!0),Re()]})}var zi={lg:1200,md:996,sm:768,xs:480,xxs:0},Bi={lg:12,md:10,sm:6,xs:4,xxs:2},Vi=()=>{};function Hi(e,t,n,r){let i=[];K.Children.forEach(t,t=>{if(!K.isValidElement(t)||t.key===null)return;let n=String(t.key),r=e.find(e=>e.i===n);if(r)i.push({...r,i:n});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:An(i),w:1,h:1})}});let a=Ln(i,{cols:n});return r.compact(a,n)}function Ui(e){let{children:t,width:n,breakpoint:r,breakpoints:i=zi,cols:a=Bi,layouts:o={},rowHeight:s=150,maxRows:c=1/0,margin:l=[10,10],containerPadding:u=null,compactor:d,onBreakpointChange:f=Vi,onLayoutChange:p=Vi,onWidthChange:m=Vi,...h}=e,g=d??br(`vertical`),_=g.type,v=g.allowOverlap,y=(0,K.useMemo)(()=>r??Sr(i,n),[]),b=(0,K.useMemo)(()=>Cr(y,a),[y,a]),x=(0,K.useMemo)(()=>wr(o,i,y,y,b,_),[]),[S,C]=(0,K.useState)(y),[w,T]=(0,K.useState)(b),[E,ee]=(0,K.useState)(x),[D,te]=(0,K.useState)(o),O=(0,K.useRef)(n),k=(0,K.useRef)(r),A=(0,K.useRef)(i),j=(0,K.useRef)(a),M=(0,K.useRef)(o),ne=(0,K.useRef)(_),re=(0,K.useRef)(D);(0,K.useEffect)(()=>{re.current=D},[D]);let N=(0,K.useMemo)(()=>(0,ji.deepEqual)(o,M.current)?null:wr(o,i,S,S,w,g),[o,i,S,w,g]),ie=N??E;(0,K.useEffect)(()=>{N!==null&&(ee(N),te(o),re.current=o,M.current=o)},[N,o]),(0,K.useEffect)(()=>{if(_!==ne.current){let e=g.compact(Pn(ie),w),t={...re.current,[S]:e};ee(e),te(t),re.current=t,p(e,t),ne.current=_}},[_,g,ie,w,v,S,p]),(0,K.useEffect)(()=>{let e=n!==O.current,o=r!==k.current,s=!(0,ji.deepEqual)(i,A.current),c=!(0,ji.deepEqual)(a,j.current);if(e||o||s||c){let e=r??Sr(i,n),o=Cr(e,a),d=S;if(d!==e||s||c){let n={...re.current};n[d]||(n[d]=Pn(E));let r=wr(n,i,e,d,o,g);r=Hi(r,t,o,g),n[e]=r,C(e),T(o),ee(r),te(n),re.current=n,f(e,o),p(r,n)}let h=Tr(l,e),_=u?Tr(u,e):null;m(n,h,o,_),O.current=n,k.current=r,A.current=i,j.current=a}},[n,r,i,a,S,w,E,t,g,_,v,l,u,f,p,m]);let ae=(0,K.useCallback)(e=>{let t={...re.current,[S]:e};ee(e),te(t),re.current=t,p(e,t)},[S,p]),oe=(0,K.useMemo)(()=>Tr(l,S),[l,S]),se=(0,K.useMemo)(()=>u===null?null:Tr(u,S),[u,S]),P=(0,K.useMemo)(()=>({cols:w,rowHeight:s,maxRows:c,margin:oe,containerPadding:se}),[w,s,c,oe,se]);return(0,q.jsx)(Ri,{...h,width:n,gridConfig:P,compactor:g,onLayoutChange:ae,layout:ie,children:t})}function Wi(e){let{children:t,width:n,breakpoint:r,breakpoints:i,cols:a,layouts:o,onBreakpointChange:s,onLayoutChange:c,onWidthChange:l,rowHeight:u,maxRows:d,margin:f,containerPadding:p,droppingItem:m,compactType:h,preventCollision:g=!1,allowOverlap:_=!1,verticalCompact:v,isDraggable:y=!0,isBounded:b=!1,draggableHandle:x,draggableCancel:S,isResizable:C=!0,resizeHandles:w=[`se`],resizeHandle:T,isDroppable:E=!1,useCSSTransforms:ee=!0,transformScale:D=1,autoSize:te,className:O,style:k,innerRef:A,onDragStart:j,onDrag:M,onDragStop:ne,onResizeStart:re,onResize:N,onResizeStop:ie,onDrop:ae,onDropDragOver:oe}=e,se=h===void 0?`vertical`:h;v===!1&&(se=null);let P={enabled:y,bounded:b,handle:x,cancel:S},F={enabled:C,handles:w,handleComponent:T},ce={enabled:E},le;le=ee?D===1?rr:ar(D):ir;let I=br(se,_,g);return(0,q.jsx)(Ui,{width:n,breakpoint:r,breakpoints:i,cols:a,layouts:o,rowHeight:u,maxRows:d,margin:f,containerPadding:p,compactor:I,dragConfig:P,resizeConfig:F,dropConfig:ce,positionStrategy:le,droppingItem:m,autoSize:te,className:O,style:k,innerRef:A,onBreakpointChange:s,onLayoutChange:c,onWidthChange:l,onDragStart:j,onDrag:M,onDragStop:ne,onResizeStart:re,onResize:N,onResizeStop:ie,onDrop:ae,onDropDragOver:oe,children:t})}Wi.displayName=`ResponsiveReactGridLayout`;var Gi=Wi,Ki=`react-grid-layout`;function qi(e){function t(t){let{measureBeforeMount:n=!1,className:r,style:i,...a}=t,[o,s]=(0,K.useState)(1280),[c,l]=(0,K.useState)(!1),u=(0,K.useRef)(null),d=(0,K.useRef)(null);return(0,K.useEffect)(()=>{l(!0)},[]),(0,K.useEffect)(()=>{let e=u.current;if(!(e instanceof HTMLElement))return;let t=null,n=new ResizeObserver(e=>{if(e[0]){let n=Math.round(e[0].contentRect.width);t!==null&&cancelAnimationFrame(t),t=requestAnimationFrame(()=>{s(e=>e===n?e:n),t=null})}});return n.observe(e),d.current=n,()=>{t!==null&&cancelAnimationFrame(t),n.unobserve(e),n.disconnect()}},[c]),n&&!c?(0,q.jsx)(`div`,{className:_(r,Ki),style:i,ref:u}):(0,q.jsx)(e,{innerRef:u,className:r,style:i,...a,width:o})}return t.displayName=`WidthProvider(${e.displayName||e.name||`Component`})`,t}function Ji(e){return e.reduce((e,t)=>Math.max(e,t.y+t.h),0)}function Yi(e,t){return e.map(e=>({...e,x:0,w:t,minW:Math.min(e.minW??1,t)}))}var Xi=qi(Gi),Zi=`fanout.dashboard-id`;async function Qi(e){let t=await D(e);if(!t.ok)throw Error(`Request failed (${t.status})`);return t.json()}var $i=e=>e.state.status===`error`&&15e3,ea={layout:[],widgets:[],filters:{window:`1h`,namespace:``}},ta={overview:`System health`,topology:`Service map`,activity:`Recent activity`,assistant:`Ask Fanout`,performance:`Performance`,trace:`Trace focus`,logs:`Logs`},na={overview:4,topology:4,activity:4,assistant:3,performance:4,trace:4,logs:4};function ra({dashboardID:e=``,agentAvailable:t,onOpenChat:n,onDashboardChange:r}){let i=H(),a=hn({queryKey:[`dashboards`],queryFn:()=>Qi(`/api/dashboards`),refetchInterval:3e3}),[o,s]=(0,K.useState)(()=>e||localStorage.getItem(Zi)||``),c=gn({mutationFn:async e=>{if(!l.data)throw Error(`No dashboard selected`);let t=await D(`/api/dashboards/${encodeURIComponent(l.data.id)}`,{method:`PUT`,headers:{"content-type":`application/json`},body:JSON.stringify({name:l.data.name,description:l.data.description,state:e})});if(!t.ok)throw Error(`Unable to save dashboard`);return t.json()},scope:{id:`dashboard-${o}`},onSuccess:e=>{i.setQueryData([`dashboard`,e.id],e),i.invalidateQueries({queryKey:[`dashboards`]})},onError:e=>console.error(`Dashboard save failed`,e)}),l=hn({queryKey:[`dashboard`,o],queryFn:()=>Qi(`/api/dashboards/${encodeURIComponent(o)}`),enabled:!!o,refetchInterval:c.isPending||c.isError?!1:3e3}),[u,d]=(0,K.useState)(ea),[f,p]=(0,K.useState)(`lg`);(0,K.useEffect)(()=>{!e||e===o||(s(e),localStorage.setItem(Zi,e))},[e,o]),(0,K.useEffect)(()=>{let t=a.data?.dashboards;if(t?.length&&!(e&&t.some(t=>t.id===e))){if(!e&&o&&t.some(e=>e.id===o)){r?.(o,!0);return}g((t.find(e=>e.is_default)??t[0]).id,!0)}},[e,a.data,o]),(0,K.useEffect)(()=>{c.isPending||c.isError||l.data?.state&&d(l.data.state)},[l.data?.updated_at,c.isPending,c.isError]),(0,K.useEffect)(()=>{c.reset()},[o]);let h=(0,K.useMemo)(()=>{let e=new Map(u.widgets.map(e=>[e.id,e.type])),t=u.layout.map(t=>{let n=na[e.get(t.i)??`overview`];return{...t,h:Math.max(t.h,n),minH:Math.max(t.minH??0,n)}});return{lg:t,md:t,sm:Yi(t,6),xs:Yi(t,2),xxs:Yi(t,1)}},[u.layout,u.widgets]);function g(e,t=!1){s(e),localStorage.setItem(Zi,e),r?.(e,t)}function _(e){d(e),c.mutate(e)}function v(e){let t=ve(),n=[`topology`,`performance`,`trace`,`logs`].includes(e),r=na[e];_({...u,widgets:[...u.widgets,{id:t,type:e,title:ta[e],enabled:!0}],layout:[...u.layout,{i:t,x:0,y:Ji(u.layout),w:n?8:4,h:r,minW:3,minH:r}]})}function y(e){_({...u,widgets:u.widgets.filter(t=>t.id!==e),layout:u.layout.filter(t=>t.i!==e)})}if(a.isLoading||o&&l.isLoading)return(0,q.jsx)(ia,{label:`Loading your workspace…`});if(a.isError||l.isError)return(0,q.jsx)(ia,{label:`Your workspace is unavailable. Try refreshing.`});let S=l.data;return S?(0,q.jsxs)(P,{component:`main`,maw:1440,mx:`auto`,px:{base:`md`,sm:`xl`,lg:72},pt:{base:`xl`,sm:52},pb:100,children:[(0,q.jsxs)(X,{justify:`space-between`,align:{base:`flex-start`,md:`flex-end`},direction:{base:`column`,md:`row`},gap:`lg`,mb:`xl`,children:[(0,q.jsxs)(P,{miw:0,children:[(0,q.jsxs)(we,{shadow:`md`,position:`bottom-start`,withinPortal:!0,children:[(0,q.jsx)(we.Target,{children:(0,q.jsx)(N,{variant:`subtle`,color:`gray`,size:`compact-sm`,leftSection:(0,q.jsx)(ln,{size:16,weight:`fill`}),rightSection:(0,q.jsx)(nn,{size:13,weight:`bold`}),children:`Dashboards`})}),(0,q.jsxs)(we.Dropdown,{children:[(0,q.jsx)(we.Label,{children:`Switch dashboard`}),(a.data?.dashboards??[]).map(e=>(0,q.jsx)(we.Item,{leftSection:e.id===o?(0,q.jsx)(re,{size:14,weight:`bold`}):(0,q.jsx)(P,{w:14}),onClick:()=>g(e.id),children:e.name},e.id))]})]}),(0,q.jsx)(x,{order:1,fz:{base:36,sm:52},lts:`-0.045em`,mt:4,children:S.name}),(0,q.jsx)(M,{c:`dimmed`,mt:4,children:S.description||`A focused view of the signals that matter now.`})]}),(0,q.jsxs)(se,{wrap:`nowrap`,w:{base:`100%`,md:`auto`},children:[t&&(0,q.jsx)(N,{variant:`default`,leftSection:(0,q.jsx)(sn,{size:16,weight:`fill`}),flex:{base:1,md:`initial`},onClick:()=>n(`Create a new dashboard for me. First ask what I want to monitor, then design it when you have enough context.`),children:`Create with AI`}),(0,q.jsx)(N,{leftSection:l.isFetching?(0,q.jsx)(b,{size:15,color:`var(--mantine-primary-color-contrast)`}):(0,q.jsx)(en,{size:16,weight:`bold`}),onClick:()=>void i.invalidateQueries(),children:l.isFetching?`Refreshing`:`Refresh`})]})]}),c.isError&&(0,q.jsx)(ee,{color:`bad`,radius:`lg`,mb:`lg`,icon:(0,q.jsx)(dn,{size:18,weight:`fill`}),title:`Dashboard changes not saved`,children:(0,q.jsxs)(se,{justify:`space-between`,gap:`sm`,children:[(0,q.jsx)(M,{size:`sm`,children:`Your latest edits are kept on this screen but Fanout could not store them.`}),(0,q.jsx)(N,{size:`compact-sm`,color:`bad`,variant:`light`,onClick:()=>c.mutate(u),children:`Retry save`})]})}),(0,q.jsx)(m,{withBorder:!0,radius:`lg`,p:{base:`md`,sm:`lg`},mb:`lg`,role:`group`,"aria-label":`Dashboard controls`,children:(0,q.jsxs)(X,{align:{base:`stretch`,md:`flex-end`},justify:`space-between`,direction:{base:`column`,md:`row`},gap:`md`,children:[(0,q.jsxs)(se,{align:`flex-end`,gap:`md`,grow:!0,wrap:`wrap`,w:{base:`100%`,md:`auto`},children:[(0,q.jsx)(Et,{label:`Window`,value:u.filters.window,onChange:e=>e&&_({...u,filters:{...u.filters,window:e}}),data:[{value:`15m`,label:`15 minutes`},{value:`1h`,label:`1 hour`},{value:`6h`,label:`6 hours`},{value:`24h`,label:`24 hours`},{value:`168h`,label:`7 days`},{value:`720h`,label:`30 days`}],w:{base:`100%`,xs:150}}),(0,q.jsx)(A,{label:`Namespace`,value:u.filters.namespace,onChange:e=>d({...u,filters:{...u.filters,namespace:e.currentTarget.value}}),onBlur:e=>_({...u,filters:{...u.filters,namespace:e.currentTarget.value}}),placeholder:`All namespaces`,w:{base:`100%`,xs:220}})]}),(0,q.jsxs)(X,{wrap:{base:`wrap`,sm:`nowrap`},justify:{base:`flex-start`,md:`flex-end`},align:`center`,gap:{base:`sm`,sm:`md`},w:{base:`100%`,md:`auto`},children:[(0,q.jsxs)(se,{gap:`xs`,wrap:`nowrap`,children:[(0,q.jsx)(Ct,{color:c.isError?`bad`:c.isPending?`warn`:`ok`,processing:c.isPending,size:8}),(0,q.jsx)(M,{c:`dimmed`,size:`sm`,miw:48,children:c.isPending?`Saving`:c.isError?`Failed`:`Saved`})]}),(0,q.jsx)(me,{orientation:`vertical`,h:28}),(0,q.jsxs)(we,{shadow:`md`,position:`bottom-end`,withinPortal:!0,children:[(0,q.jsx)(we.Target,{children:(0,q.jsx)(N,{variant:`default`,leftSection:(0,q.jsx)(z,{size:16,weight:`bold`}),rightSection:(0,q.jsx)(nn,{size:14,weight:`bold`}),children:`Add view`})}),(0,q.jsxs)(we.Dropdown,{children:[(0,q.jsx)(we.Label,{children:`Dashboard views`}),Object.entries(ta).filter(([e])=>t||e!==`assistant`).map(([e,t])=>(0,q.jsx)(we.Item,{onClick:()=>v(e),children:t},e))]})]}),t&&(0,q.jsx)(N,{variant:`subtle`,color:`gray`,rightSection:(0,q.jsx)(R,{size:16,weight:`bold`}),onClick:()=>n(),children:`Ask Fanout`})]})]})}),(0,q.jsx)(Xi,{className:`dashboard-grid`,layouts:h,breakpoints:{lg:1100,md:800,sm:600,xs:420,xxs:0},cols:{lg:12,md:10,sm:6,xs:2,xxs:1},rowHeight:76,margin:[16,16],containerPadding:[0,0],compactType:`vertical`,draggableCancel:`button,input,select,textarea,a,label,[role=menu]`,onBreakpointChange:p,onDragStop:e=>{f===`lg`&&_({...u,layout:[...e]})},onResizeStop:e=>{f===`lg`&&_({...u,layout:[...e]})},children:u.widgets.map(e=>(0,q.jsx)(`div`,{children:(0,q.jsx)(aa,{widget:e,filters:u.filters,agentAvailable:t,onRemove:()=>y(e.id),onOpenChat:n})},e.id))})]}):(0,q.jsx)(ia,{label:`Preparing your workspace…`})}function ia({label:e}){return(0,q.jsxs)(T,{mih:`50vh`,children:[(0,q.jsx)(b,{size:`sm`}),(0,q.jsx)(M,{c:`dimmed`,size:`sm`,ml:`sm`,children:e})]})}function aa({widget:e,filters:t,agentAvailable:n,onRemove:r,onOpenChat:i}){let a=new URLSearchParams({window:t.window,limit:`40`});t.namespace&&a.set(`namespace`,t.namespace);let o=typeof e.config?.service==`string`?e.config.service:``;o&&a.set(`service`,o);let s=hn({queryKey:[`overview`,a.toString()],queryFn:()=>Qi(`/api/observability/overview?${a}`),enabled:e.type===`overview`||e.type===`activity`,refetchInterval:$i}),c=hn({queryKey:[`topology`,a.toString()],queryFn:()=>Qi(`/api/observability/topology?${a}`),enabled:e.type===`topology`,refetchInterval:$i}),l=hn({queryKey:[`performance`,a.toString()],queryFn:()=>Qi(`/api/observability/performance?${a}`),enabled:e.type===`performance`,refetchInterval:$i}),u=new URLSearchParams(a);typeof e.config?.severity==`string`&&u.set(`severity`,e.config.severity),typeof e.config?.search==`string`&&u.set(`search`,e.config.search);let d=hn({queryKey:[`logs`,u.toString()],queryFn:()=>Qi(`/api/observability/logs?${u}`),enabled:e.type===`logs`,refetchInterval:$i}),f=new URLSearchParams(a);typeof e.config?.trace_id==`string`&&f.set(`trace_id`,e.config.trace_id);let p=hn({queryKey:[`trace`,f.toString()],queryFn:()=>Qi(`/api/observability/trace?${f}`),enabled:e.type===`trace`,refetchInterval:$i}),h=s.data?.data,g={overview:s,activity:s,topology:c,performance:l,logs:d,trace:p}[e.type]?.isError??!1;return(0,q.jsx)(m,{withBorder:!0,shadow:`xs`,radius:`lg`,p:`lg`,h:`100%`,style:{overflow:`hidden`},children:(0,q.jsxs)(oe,{h:`100%`,gap:`sm`,children:[(0,q.jsxs)(se,{justify:`space-between`,align:`flex-start`,wrap:`nowrap`,children:[(0,q.jsxs)(P,{children:[(0,q.jsx)(M,{c:`dimmed`,size:`xs`,fw:700,tt:`uppercase`,lts:`0.1em`,children:e.type===`assistant`?`Guidance`:e.type}),(0,q.jsx)(x,{order:2,fz:`lg`,mt:2,children:e.title})]}),(0,q.jsx)(Se,{label:`Remove ${e.title}`,children:(0,q.jsx)(de,{variant:`subtle`,color:`bad`,"aria-label":`Remove ${e.title}`,onClick:r,children:(0,q.jsx)(pn,{size:16,weight:`bold`})})})]}),(0,q.jsxs)(Ce,{type:`auto`,offsetScrollbars:!0,flex:1,children:[g&&(0,q.jsx)(da,{}),!g&&e.type===`overview`&&(0,q.jsxs)(fe,{cols:2,spacing:`sm`,children:[(0,q.jsx)(la,{label:`Health`,value:h?.health??`—`}),(0,q.jsx)(la,{label:`Services`,value:h?.service_count??`—`}),(0,q.jsx)(la,{label:`Spans`,value:h?.total_spans?.toLocaleString?.()??`—`}),(0,q.jsx)(la,{label:`Error rate`,value:h?`${(h.error_rate*100).toFixed(2)}%`:`—`})]}),!g&&e.type===`topology`&&(0,q.jsx)(oa,{rows:(c.data?.data?.nodes??[]).slice(0,6).map(e=>[(0,q.jsx)(sa,{health:e.health,label:e.service},`health`),`${e.spans?.toLocaleString?.()??0} spans`,`${e.p95_ms?.toFixed?.(1)??`—`} ms p95`]),empty:`No service relationships in this window`}),!g&&e.type===`activity`&&(0,q.jsx)(oa,{rows:(h?.services??[]).slice(0,5).map(e=>[(0,q.jsx)(sa,{health:e.health,label:e.service},`health`),e.error_rate?`${(e.error_rate*100).toFixed(2)}% errors`:`Operating normally`]),empty:`No recent activity`}),!g&&e.type===`performance`&&(0,q.jsx)(oa,{rows:(l.data?.data?.endpoints??[]).slice(0,5).map(e=>[(0,q.jsxs)(M,{fw:600,size:`sm`,truncate:!0,children:[e.method,` `,e.path]},`path`),`${e.calls?.toLocaleString?.()} calls`,`${e.p95_ms?.toFixed?.(1)} ms p95`]),empty:`No endpoint activity in this window`}),!g&&e.type===`logs`&&(0,q.jsx)(oa,{rows:(d.data?.data?.entries??[]).slice(0,5).map(e=>[(0,q.jsx)(_t,{color:ca(e.severity),variant:`light`,children:e.severity},`severity`),e.service,e.body]),empty:`No matching logs in this window`}),!g&&e.type===`trace`&&(0,q.jsxs)(oe,{children:[(0,q.jsxs)(fe,{cols:2,spacing:`sm`,children:[(0,q.jsx)(la,{label:`Duration`,value:p.data?.data?`${p.data.data.duration_ms.toFixed?.(1)} ms`:`—`}),(0,q.jsx)(la,{label:`Spans`,value:p.data?.data?.spans?.length??`—`}),(0,q.jsx)(la,{label:`Services`,value:p.data?.data?.services?.length??`—`}),(0,q.jsx)(la,{label:`Status`,value:p.data?.data?p.data.data.has_error?`Error`:`Healthy`:`—`})]}),(0,q.jsx)(M,{c:`dimmed`,size:`xs`,ff:`monospace`,truncate:!0,children:p.data?.data?.trace_id?`Trace ${p.data.data.trace_id}`:`Most relevant recent trace`})]}),!g&&e.type===`assistant`&&(n?(0,q.jsxs)(oe,{align:`flex-start`,children:[(0,q.jsx)(M,{c:`dimmed`,children:`Ask a focused question about health, latency, errors, or dependencies.`}),(0,q.jsx)(N,{leftSection:(0,q.jsx)(sn,{size:16,weight:`fill`}),onClick:()=>i(`Summarize the most important system changes in the selected window`),children:`Start a conversation`})]}):(0,q.jsx)(M,{c:`dimmed`,children:`Configure an AI provider to enable this view. The rest of this dashboard remains available.`}))]})]})})}function oa({rows:e,empty:t}){return e.length?(0,q.jsx)(Gt.ScrollContainer,{minWidth:420,children:(0,q.jsx)(Gt,{verticalSpacing:`sm`,highlightOnHover:!0,children:(0,q.jsx)(Gt.Tbody,{children:e.map((e,t)=>(0,q.jsx)(Gt.Tr,{children:e.map((e,t)=>(0,q.jsx)(Gt.Td,{children:(0,q.jsx)(M,{component:`span`,size:`sm`,c:t?`dimmed`:void 0,lineClamp:1,children:e})},t))},t))})})}):(0,q.jsx)(ua,{text:t})}function sa({health:e,label:t}){return(0,q.jsx)(_t,{color:e===`healthy`?`ok`:e===`degraded`?`warn`:`bad`,variant:`light`,tt:`none`,children:t})}function ca(e){let t=String(e).toUpperCase();return t===`ERROR`||t===`FATAL`?`bad`:t===`WARN`||t===`WARNING`?`warn`:t===`INFO`?`info`:`gray`}function la({label:e,value:t}){return(0,q.jsxs)(m,{withBorder:!0,radius:`md`,p:`sm`,bg:`var(--mantine-color-default)`,children:[(0,q.jsx)(M,{c:`dimmed`,size:`xs`,children:e}),(0,q.jsx)(M,{fw:700,fz:`xl`,mt:4,tt:`capitalize`,children:t})]})}function ua({text:e}){return(0,q.jsxs)(T,{py:`xl`,children:[(0,q.jsx)(an,{size:20}),(0,q.jsx)(M,{c:`dimmed`,size:`sm`,ml:`xs`,children:e})]})}function da(){return(0,q.jsxs)(T,{py:`xl`,children:[(0,q.jsx)(dn,{size:20,weight:`fill`,color:`var(--mantine-color-bad-filled)`}),(0,q.jsx)(M,{c:`bad`,fw:500,size:`sm`,ml:`xs`,children:`Couldn't load this view — retrying automatically`})]})}export{ra as t}; \ No newline at end of file +`,e.getElementsByTagName(`head`)[0].appendChild(n)}e.body&&L(e.body,`react-draggable-transparent-selection`)}function I(e){window.requestAnimationFrame?window.requestAnimationFrame(()=>{ue(e)}):ue(e)}function ue(e){if(e)try{e.body&&de(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 L(e,t){e.classList?e.classList.add(t):e.className.match(RegExp(`(?:^|\\s)${t}(?!\\S)`))||(e.className+=` ${t}`)}function de(e,t){e.classList?e.classList.remove(t):e.className=e.className.replace(RegExp(`(?:^|\\s)${t}(?!\\S)`,`g`),``)}function fe(e,t,n){if(!e.props.bounds)return[t,n];let{bounds:r}=e.props;r=typeof r==`string`?r:z(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+x(s.paddingLeft)+x(o.marginLeft),top:-i.offsetTop+x(s.paddingTop)+x(o.marginTop),right:N(a)-M(i)-i.offsetLeft+x(s.paddingRight)-x(o.marginRight),bottom:re(a)-j(i)-i.offsetTop+x(s.paddingBottom)-x(o.marginBottom)}}return b(r.right)&&(t=Math.min(t,r.right)),b(r.bottom)&&(n=Math.min(n,r.bottom)),b(r.left)&&(t=Math.max(t,r.left)),b(r.top)&&(n=Math.max(n,r.top)),[t,n]}function pe(e,t,n){return[Math.round(t/e[0])*e[0],Math.round(n/e[1])*e[1]]}function me(e){return e.props.axis===`both`||e.props.axis===`x`}function he(e){return e.props.axis===`both`||e.props.axis===`y`}function ge(e,t,n){let r=typeof t==`number`?P(e,t):null;if(typeof t==`number`&&!r)return null;let i=ve(n),a=n.props.offsetParent||i.offsetParent||i.ownerDocument.body;return ie(r||e,a,n.props.scale)}function _e(e,t,n){let r=!b(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 R(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 z(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 B=d(r()),V=d(Or()),ye=d(ne()),H=typeof process<`u`&&{}.DRAGGABLE_DEBUG?console.log.bind(console):function(){},be={touch:{start:`touchstart`,move:`touchmove`,stop:`touchend`},mouse:{start:`mousedown`,move:`mousemove`,stop:`mouseup`}},U=be.mouse,W=class extends B.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=F(e);this.touchIdentifier=r;let i=ge(e,r,this);if(i==null)return;let{x:a,y:o}=i,s=_e(this,a,o);H(`DraggableCore: handleDragStart: %j`,s),H(`calling`,this.props.onStart),this.props.onStart(e,s)!==!1&&this.mounted!==!1&&(this.props.enableUserSelectHack&&le(n,this.props.nonce),this.dragging=!0,this.lastX=a,this.lastY=o,k(n,U.move,this.handleDrag),k(n,U.stop,this.handleDragStop))},this.handleDrag=e=>{let t=ge(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]=pe(this.props.grid,e,t),!e&&!t)return;n=this.lastX+e,r=this.lastY+t}let i=_e(this,n,r);if(H(`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=ge(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]=pe(this.props.grid,e,t),n=this.lastX+e,r=this.lastY+t}let i=_e(this,n,r);if(this.props.onStop(e,i)===!1||this.mounted===!1)return!1;let a=this.findDOMNode();a&&this.props.enableUserSelectHack&&I(a.ownerDocument),H(`DraggableCore: handleDragStop: %j`,i),this.dragging=!1,this.lastX=NaN,this.lastY=NaN,a&&(H(`DraggableCore: Removing handlers`),A(a.ownerDocument,U.move,this.handleDrag),A(a.ownerDocument,U.stop,this.handleDragStop))},this.onMouseDown=e=>(U=be.mouse,this.handleDragStart(e)),this.onMouseUp=e=>(U=be.mouse,this.handleDragStop(e)),this.onTouchStart=e=>(U=be.touch,this.handleDragStart(e)),this.onTouchEnd=e=>(U=be.touch,this.handleDragStop(e))}componentDidMount(){this.mounted=!0;let e=this.findDOMNode();e&&k(e,be.touch.start,this.onTouchStart,{passive:!1})}componentWillUnmount(){this.mounted=!1;let e=this.findDOMNode();if(e){let{ownerDocument:t}=e;A(t,be.mouse.move,this.handleDrag),A(t,be.touch.move,this.handleDrag),A(t,be.mouse.stop,this.handleDragStop),A(t,be.touch.stop,this.handleDragStop),A(e,be.touch.start,this.onTouchStart,{passive:!1}),this.props.enableUserSelectHack&&I(t)}}findDOMNode(){if(this.props?.nodeRef)return this.props.nodeRef.current;let e=ye.default;return typeof e.findDOMNode==`function`?e.findDOMNode(this):(H(`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 B.cloneElement(B.Children.only(this.props.children),{onMouseDown:this.onMouseDown,onMouseUp:this.onMouseUp,onTouchEnd:this.onTouchEnd})}};W.displayName=`DraggableCore`,W.propTypes={allowAnyClick:V.default.bool,allowMobileScroll:V.default.bool,children:V.default.node.isRequired,disabled:V.default.bool,enableUserSelectHack:V.default.bool,offsetParent:function(e,t){if(e[t]&&e[t].nodeType!==1)throw Error(`Draggable's offsetParent must be a DOM Node.`)},grid:V.default.arrayOf(V.default.number),handle:V.default.string,cancel:V.default.string,nodeRef:V.default.object,nonce:V.default.string,onStart:V.default.func,onDrag:V.default.func,onStop:V.default.func,onMouseDown:V.default.func,scale:V.default.number,className:S,style:S,transform:S},W.defaultProps={allowAnyClick:!1,allowMobileScroll:!1,disabled:!1,enableUserSelectHack:!0,onStart:function(){},onDrag:function(){},onStop:function(){},onMouseDown:function(){},scale:1};var xe=class extends m.Component{constructor(e){super(e),this.onDragStart=(e,t)=>{if(H(`Draggable: onDragStart: %j`,t),this.props.onStart(e,R(this,t))===!1)return!1;this.setState({dragging:!0,dragged:!0})},this.onDrag=(e,t)=>{if(!this.state.dragging)return!1;H(`Draggable: onDrag: %j`,t);let n=R(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]=fe(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,R(this,t))===!1)return!1;H(`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)?(H(`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:me(this)&&p?this.state.x:h.x,y:he(this)&&p?this.state.y:h.y};this.state.isElementSVG?f=oe(g,c):d=ae(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(W,{...u,onStart:this.onDragStart,onDrag:this.onDrag,onStop:this.onDragStop},m.cloneElement(v,{className:y,style:{...v.props.style,...d},transform:f}))}};xe.displayName=`Draggable`,xe.propTypes={...W.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:S,style:S,transform:S},xe.defaultProps={...W.defaultProps,axis:`both`,bounds:!1,defaultClassName:`react-draggable`,defaultClassNameDragging:`react-draggable-dragging`,defaultClassNameDragged:`react-draggable-dragged`,defaultPosition:{x:0,y:0},scale:1},0&&(t.exports={DraggableCore:W})})),Ci=t(((e,t)=>{var n=Si(),r=n.DraggableCore,i=n.default||n;t.exports=i,t.exports.default=i,t.exports.DraggableCore=r})),wi=t((e=>{e.__esModule=!0,e.cloneElement=l;var t=n(r());function n(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(Or());Ci();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)}}})),Ei=t((e=>{e.__esModule=!0,e.default=void 0;var t=s(r()),n=Ci(),i=wi(),a=Ti(),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,n){let r=this.props.handle;if(!r)return t.createElement(`span`,{className:`react-resizable-handle react-resizable-handle-`+e,ref:n});if(typeof r==`function`)return r(e,n);let i=typeof r.type==`string`,a=d({ref:n},i?{}:{handleAxis:e});return t.cloneElement(r,a)}render(){let e=this.props,r=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)(r,d(d({},f),{},{className:(a?a+` `:``)+`react-resizable`,children:[...t.Children.toArray(r.props.children),...u.map(e=>{let r=this.handleRefs[e]??(this.handleRefs[e]=t.createRef());return t.createElement(n.DraggableCore,c({},s,{nodeRef:r,key:`resizableHandle-`+e,onStop:this.resizeHandler(`onResizeStop`,e),onStart:this.resizeHandler(`onResizeStart`,e),onDrag:this.resizeHandler(`onResize`,e)}),this.renderResizeHandle(e,r))})]}))}};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}})),Di=t((e=>{e.__esModule=!0,e.default=void 0;var t=c(r()),n=s(Or()),i=s(Ei()),a=Ti(),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,n=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 t.createElement(i.default,{axis:m,draggableOpts:c,handle:n,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},t.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:n.default.element})})),Oi=t(((e,t)=>{t.exports=function(){throw Error(`Don't instantiate Resizable directly! Use require('react-resizable').Resizable`)},t.exports.Resizable=Ei().default,t.exports.ResizableBox=Di().default})),ki=t(((e,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 ee=c(S);function D(e,t){return ee(e,t,new WeakMap)}var te=c(r(S,{createIsNestedEqual:function(){return o}}));function O(e,t){return te(e,t,new WeakMap)}function k(e){return c(r(x,e(x)))}function A(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=D,e.circularShallowEqual=O,e.createCustomCircularEqual=A,e.createCustomEqual=k,e.deepEqual=w,e.sameValueZeroEqual=o,e.shallowEqual=E,Object.defineProperty(e,"__esModule",{value:!0})}))})),Ai=Oi(),ji=ki();function Mi(e){let{children:t,cols:n,containerWidth:r,margin:i,containerPadding:a,rowHeight:o,maxRows:s,isDraggable:c,isResizable:l,isBounded:u,static:d,useCSSTransforms:f=!0,usePercentages:p=!1,transformScale:m=1,positionStrategy:h,dragThreshold:g=0,droppingPosition:v,className:y=``,style:b,handle:x=``,cancel:S=``,x:C,y:w,w:T,h:E,minW:ee=1,maxW:D=1/0,minH:te=1,maxH:O=1/0,i:k,resizeHandles:A,resizeHandle:j,constraints:M=Vn,layoutItem:ne,layout:re=[],onDragStart:N,onDrag:ie,onDragStop:ae,onResizeStart:oe,onResize:se,onResizeStop:P}=e,[F,ce]=(0,K.useState)(!1),[le,I]=(0,K.useState)(!1),ue=(0,K.useRef)(null),L=(0,K.useRef)({left:0,top:0}),de=(0,K.useRef)({top:0,left:0,width:0,height:0}),fe=(0,K.useRef)(void 0),pe=(0,K.useRef)(re);pe.current=re;let me=(0,K.useRef)(null),he=(0,K.useRef)(null),ge=(0,K.useRef)(!1),_e=(0,K.useRef)({x:0,y:0}),R=(0,K.useRef)(!1),z=(0,K.useMemo)(()=>({cols:n,containerPadding:a,containerWidth:r,margin:i,maxRows:s,rowHeight:o}),[n,a,r,i,s,o]),ve=(0,K.useMemo)(()=>({cols:n,maxRows:s,containerWidth:r,containerHeight:0,rowHeight:o,margin:i,layout:[]}),[n,s,r,o,i]),B=(0,K.useCallback)(()=>({...ve,layout:pe.current}),[ve]),V=(0,K.useMemo)(()=>ne??{i:k,x:C,y:w,w:T,h:E,minW:ee,maxW:D,minH:te,maxH:O},[ne,k,C,w,T,E,ee,D,te,O]),ye=(0,K.useCallback)(e=>{if(h?.calcStyle)return h.calcStyle(e);if(f)return Wn(e);let t=Gn(e);return p?{...t,left:Kn(e.left/r),width:Kn(e.width/r)}:t},[h,f,p,r]),H=(0,K.useCallback)((e,{node:t})=>{if(!N)return;let{offsetParent:n}=t;if(!n)return;let r=n.getBoundingClientRect(),i=t.getBoundingClientRect(),a=i.left/m,o=r.left/m,s=i.top/m,c=r.top/m,l;if(h?.calcDragPosition){let t=e;l=h.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(L.current=l,g>0){let t=e;_e.current={x:t.clientX,y:t.clientY},ge.current=!0,R.current=!1,ce(!0);return}ce(!0);let u=xn(z,l.top,l.left),{x:d,y:f}=Hn(M,V,u.x,u.y,B());N(k,d,f,{e,node:t,newPosition:l})},[N,m,z,h,g,M,V,B,k]),be=(0,K.useCallback)((e,{node:t,deltaX:n,deltaY:a})=>{if(!ie||!F)return;let s=e;if(ge.current&&!R.current){let n=s.clientX-_e.current.x,r=s.clientY-_e.current.y;if(Math.hypot(n,r){if(!ae||!F)return;let n=ge.current;if(ge.current=!1,R.current=!1,_e.current={x:0,y:0},n){ce(!1),L.current={left:0,top:0};return}let{left:r,top:i}=L.current,a={top:i,left:r};ce(!1),L.current={left:0,top:0};let o=xn(z,i,r),{x:s,y:c}=Hn(M,V,o.x,o.y,B());ae(k,s,c,{e,node:t,newPosition:a})},[ae,F,z,M,V,B,k]);me.current=H,he.current=be;let W=(0,K.useCallback)((e,{node:t,size:n,handle:i},a,o)=>{let s=o===`onResizeStart`?oe:o===`onResize`?se:P;if(!s)return;let c;c=t?nr(i,a,n,r):{...n,top:a.top,left:a.left},de.current=c;let l=Sn(z,c.width,c.height),{w:u,h:d}=Un(M,V,l.w,l.h,i,B());s(k,u,d,{e:e.nativeEvent??e,node:t,size:c,handle:i})},[oe,se,P,r,z,k,M,V,B]),xe=(0,K.useCallback)((e,t)=>{I(!0);let n=yn(z,C,w,T,E),r={...t,handle:t.handle};W(e,r,n,`onResizeStart`)},[W,z,C,w,T,E]),Se=(0,K.useCallback)((e,t)=>{let n=yn(z,C,w,T,E),r={...t,handle:t.handle};W(e,r,n,`onResize`)},[W,z,C,w,T,E]),Ce=(0,K.useCallback)((e,t)=>{I(!1),de.current={top:0,left:0,width:0,height:0};let n=yn(z,C,w,T,E),r={...t,handle:t.handle};W(e,r,n,`onResizeStop`)},[W,z,C,w,T,E]);(0,K.useEffect)(()=>{if(!v)return;let e=ue.current;if(!e)return;let t=fe.current||{left:0,top:0},n=F&&(v.left!==t.left||v.top!==t.top);if(!F){let t={node:e,deltaX:v.left,deltaY:v.top,lastX:0,lastY:0,x:v.left,y:v.top};me.current?.(v.e,t)}else if(n){let t={node:e,deltaX:v.left-L.current.left,deltaY:v.top-L.current.top,lastX:L.current.left,lastY:L.current.top,x:v.left,y:v.top};he.current?.(v.e,t)}fe.current=v},[v,F,k]);let G=yn(z,C,w,T,E,F?L.current:null,le?de.current:null),we=K.Children.only(t),Te=_n(z),Ee=[vn(ee,Te,i[0]),vn(te,o,i[1])],J=[vn(D,Te,i[0]),vn(O,o,i[1])],Y=we.props,De=Y.className,Oe=Y.style,ke=K.cloneElement(we,{ref:ue,className:_(`react-grid-item`,De,y,{static:d,resizing:le,"react-draggable":c,"react-draggable-dragging":F,dropping:!!v,cssTransforms:f}),style:{...b,...Oe,...ye(G)}}),X=j;return ke=(0,q.jsx)(Ai.Resizable,{draggableOpts:{disabled:!l},className:l?void 0:`react-resizable-hide`,width:G.width,height:G.height,minConstraints:Ee,maxConstraints:J,onResizeStart:xe,onResize:Se,onResizeStop:Ce,transformScale:m,resizeHandles:A,handle:X,children:ke}),ke=(0,q.jsx)(yi,{disabled:!c,onStart:H,onDrag:be,onStop:U,handle:x,cancel:`.react-resizable-handle`+(S?`,`+S:``),scale:m,nodeRef:ue,children:ke}),ke}var Ni=()=>{},Pi=`react-grid-layout`,Fi=!1;try{Fi=/firefox/i.test(navigator.userAgent)}catch{}function Ii(e,t){let n=K.Children.toArray(e),r=K.Children.toArray(t);if(n.length!==r.length)return!1;for(let e=0;e{if(!K.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(Nn(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:An(i),w:1,h:1})}});let o=Ln(i,{cols:n});return r.compact(o,n)}function Ri(e){let{children:t,width:n,gridConfig:r,dragConfig:i,resizeConfig:a,dropConfig:o,positionStrategy:s=or,compactor:c,constraints:l=Vn,layout:u=[],droppingItem:d,autoSize:f=!0,className:p=``,style:m={},innerRef:h,onLayoutChange:g=Ni,onDragStart:v=Ni,onDrag:y=Ni,onDragStop:b=Ni,onResizeStart:x=Ni,onResize:S=Ni,onResizeStop:C=Ni,onDrop:w=Ni,onDropDragOver:T=Ni}=e,E=(0,K.useMemo)(()=>({...sr,...r}),[r]),ee=(0,K.useMemo)(()=>({...cr,...i}),[i]),D=(0,K.useMemo)(()=>({...lr,...a}),[a]),te=(0,K.useMemo)(()=>({...ur,...o}),[o]),{cols:O,rowHeight:k,maxRows:A,margin:j,containerPadding:M}=E,{enabled:ne,bounded:re,handle:N,cancel:ie,threshold:ae}=ee,{enabled:oe,handles:se,handleComponent:P}=D,{enabled:F,defaultItem:ce,onDragOver:le}=te,I=c??br(`vertical`),ue=I.type,L=I.allowOverlap,de=I.preventCollision??!1,fe=(0,K.useMemo)(()=>d??{i:`__dropping-elem__`,...ce},[d,ce]),pe=s.type===`transform`,me=s.scale,he=M??j,[ge,_e]=(0,K.useState)(!1),[R,z]=(0,K.useState)(()=>Li(u,t,O,I)),[ve,B]=(0,K.useState)(null),[V,ye]=(0,K.useState)(!1),[H,be]=(0,K.useState)(null),[U,W]=(0,K.useState)(),xe=(0,K.useRef)(null),Se=(0,K.useRef)(null),Ce=(0,K.useRef)(null),G=(0,K.useRef)(0),we=(0,K.useRef)(R),Te=(0,K.useRef)(u),Ee=(0,K.useRef)(t),J=(0,K.useRef)(ue),Y=(0,K.useRef)(R);Y.current=R,(0,K.useEffect)(()=>{_e(!0),(0,ji.deepEqual)(R,u)||g(R)},[]),(0,K.useEffect)(()=>{if(ve||H)return;let e=!(0,ji.deepEqual)(u,Te.current),n=!Ii(t,Ee.current),r=ue!==J.current;if(e||n||r){let n=Li(e?u:R,t,O,I);(0,ji.deepEqual)(n,R)||z(n)}Te.current=u,Ee.current=t,J.current=ue},[u,t,O,ue,I,ve,H,R]),(0,K.useEffect)(()=>{if(!ve&&!(0,ji.deepEqual)(R,we.current)){we.current=R;let e=R.filter(e=>e.i!==fe.i);g(e)}},[R,ve,g,fe.i]);let De=(0,K.useMemo)(()=>{if(!f)return;let e=An(R),t=he[1];return e*k+(e-1)*j[1]+t*2+`px`},[f,R,k,j,he]),Oe=(0,K.useCallback)((e,t,n,r)=>{let i=Y.current,a=jn(i,e);if(!a)return;let o={w:a.w,h:a.h,x:a.x,y:a.y,i:e};xe.current=Nn(a),Ce.current=i,B(o),v(i,a,a,null,r.e,r.node)},[v]),ke=(0,K.useCallback)((e,t,n,r)=>{let i=Y.current,a=xe.current,o=jn(i,e);if(!o)return;let s={w:o.w,h:o.h,x:o.x,y:o.y,i:e},c=Rn(i,o,t,n,!0,de,ue,O,L);y(c,a,o,s,r.e,r.node),z(I.compact(c,O)),B(s)},[de,ue,O,L,I,y]),X=(0,K.useCallback)((e,t,n,r)=>{if(!ve)return;let i=Y.current,a=xe.current,o=jn(i,e);if(!o)return;let s=Rn(i,o,t,n,!0,de,ue,O,L),c=I.compact(s,O);b(c,a,o,null,r.e,r.node);let l=Ce.current;xe.current=null,Ce.current=null,B(null),z(c),l&&!(0,ji.deepEqual)(l,c)&&g(c)},[ve,de,ue,O,L,I,b,g]),Ae=(0,K.useCallback)((e,t,n,r)=>{let i=Y.current,a=jn(i,e);a&&(Se.current=Nn(a),Ce.current=i,ye(!0),x(i,a,a,null,r.e,r.node))},[x]),je=(0,K.useCallback)((e,t,n,r)=>{let i=Y.current,a=Se.current,{handle:o}=r,s=!1,c,l,[u,d]=In(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&&!L&&En(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,e));if(!d)return;let f=u;s&&c!==void 0&&l!==void 0&&(f=Rn(u,d,c,l,!0,de,ue,O,L));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),z(I.compact(f,O)),B(p)},[de,ue,O,L,I,S]),Me=(0,K.useCallback)((e,t,n,r)=>{let i=Y.current,a=Se.current,o=jn(i,e),s=I.compact(i,O);C(s,a,o??null,null,r.e,r.node);let c=Ce.current;Se.current=null,Ce.current=null,B(null),ye(!1),z(s),c&&!(0,ji.deepEqual)(c,s)&&g(s)},[O,I,C,g]),Z=(0,K.useCallback)(()=>{let e=Y.current;if(!e.some(e=>e.i===fe.i)){be(null),B(null),W(void 0);return}let t=I.compact(e.filter(e=>e.i!==fe.i),O);z(t),be(null),B(null),W(void 0)},[fe.i,O,I]),Ne=(0,K.useCallback)(e=>{if(e.preventDefault(),e.stopPropagation(),Fi&&!e.nativeEvent.target?.classList.contains(Pi))return!1;let t=le?le(e.nativeEvent):T(e);if(t===!1)return H&&Z(),!1;let{dragOffsetX:r=0,dragOffsetY:i=0,...a}=t??{},o={...fe,...a},s=e.currentTarget.getBoundingClientRect(),c={cols:O,margin:j,maxRows:A,rowHeight:k,containerWidth:n,containerPadding:he},l=_n(c),u=vn(o.w,l,j[0]),d=vn(o.h,k,j[1]),f=u/2,p=d/2,m=e.clientX-s.left+r-f,h=e.clientY-s.top+i-p,g=Math.max(0,m),_=Math.max(0,h),v={left:g/me,top:_/me,e:e.nativeEvent};if(H)U&&(U.left!==v.left||U.top!==v.top)&&W(v);else{let e=bn(c,_,g,o.w,o.h);be((0,q.jsx)(`div`,{},o.i)),W(v);let t=Y.current.filter(e=>e.i!==o.i);z([...t,{...o,x:e.x,y:e.y,static:!1,isDraggable:!0}])}},[H,U,fe,le,T,Z,me,O,j,A,k,n,he]),Pe=(0,K.useCallback)(e=>{e.preventDefault(),e.stopPropagation(),G.current--,G.current<0&&(G.current=0),G.current===0&&Z()},[Z]),Fe=(0,K.useCallback)(e=>{e.preventDefault(),e.stopPropagation(),G.current++},[]),Ie=(0,K.useCallback)(e=>{e.preventDefault(),e.stopPropagation();let t=Y.current,n=t.find(e=>e.i===fe.i);G.current=0,Z(),w(t,n,e.nativeEvent)},[fe.i,Z,w]),Le=(0,K.useCallback)((e,t)=>{if(!e||!e.key)return null;let r=jn(R,String(e.key));if(!r)return null;let i=typeof r.isDraggable==`boolean`?r.isDraggable:!r.static&&ne,a=typeof r.isResizable==`boolean`?r.isResizable:!r.static&&oe,o=r.resizeHandles||[...se],c=i&&re&&r.isBounded!==!1,u=P;return(0,q.jsx)(Mi,{containerWidth:n,cols:O,margin:j,containerPadding:he,maxRows:A,rowHeight:k,cancel:ie,handle:N,onDragStart:Oe,onDrag:ke,onDragStop:X,onResizeStart:Ae,onResize:je,onResizeStop:Me,isDraggable:i,isResizable:a,isBounded:c,useCSSTransforms:pe&&ge,usePercentages:!ge,transformScale:me,positionStrategy:s,dragThreshold:ae,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?U:void 0,resizeHandles:o,resizeHandle:u,constraints:l,layoutItem:r,layout:R,children:e},r.i)},[R,n,O,j,he,A,k,ie,N,Oe,ke,X,Ae,je,Me,ne,oe,re,pe,ge,me,s,ae,U,se,P,l]),Re=()=>ve?(0,q.jsx)(Mi,{w:ve.w,h:ve.h,x:ve.x,y:ve.y,i:ve.i,className:`react-grid-placeholder ${V?`placeholder-resizing`:``}`,containerWidth:n,cols:O,margin:j,containerPadding:he,maxRows:A,rowHeight:k,isDraggable:!1,isResizable:!1,isBounded:!1,useCSSTransforms:pe,transformScale:me,constraints:l,layout:R,children:(0,q.jsx)(`div`,{})}):null,ze=_(Pi,p),Be={height:De,...m};return(0,q.jsxs)(`div`,{ref:h,className:ze,style:Be,onDrop:F?Ie:void 0,onDragLeave:F?Pe:void 0,onDragEnter:F?Fe:void 0,onDragOver:F?Ne:void 0,children:[K.Children.map(t,e=>K.isValidElement(e)?Le(e):null),F&&H&&Le(H,!0),Re()]})}var zi={lg:1200,md:996,sm:768,xs:480,xxs:0},Bi={lg:12,md:10,sm:6,xs:4,xxs:2},Vi=()=>{};function Hi(e,t,n,r){let i=[];K.Children.forEach(t,t=>{if(!K.isValidElement(t)||t.key===null)return;let n=String(t.key),r=e.find(e=>e.i===n);if(r)i.push({...r,i:n});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:An(i),w:1,h:1})}});let a=Ln(i,{cols:n});return r.compact(a,n)}function Ui(e){let{children:t,width:n,breakpoint:r,breakpoints:i=zi,cols:a=Bi,layouts:o={},rowHeight:s=150,maxRows:c=1/0,margin:l=[10,10],containerPadding:u=null,compactor:d,onBreakpointChange:f=Vi,onLayoutChange:p=Vi,onWidthChange:m=Vi,...h}=e,g=d??br(`vertical`),_=g.type,v=g.allowOverlap,y=(0,K.useMemo)(()=>r??Sr(i,n),[]),b=(0,K.useMemo)(()=>Cr(y,a),[y,a]),x=(0,K.useMemo)(()=>wr(o,i,y,y,b,_),[]),[S,C]=(0,K.useState)(y),[w,T]=(0,K.useState)(b),[E,ee]=(0,K.useState)(x),[D,te]=(0,K.useState)(o),O=(0,K.useRef)(n),k=(0,K.useRef)(r),A=(0,K.useRef)(i),j=(0,K.useRef)(a),M=(0,K.useRef)(o),ne=(0,K.useRef)(_),re=(0,K.useRef)(D);(0,K.useEffect)(()=>{re.current=D},[D]);let N=(0,K.useMemo)(()=>(0,ji.deepEqual)(o,M.current)?null:wr(o,i,S,S,w,g),[o,i,S,w,g]),ie=N??E;(0,K.useEffect)(()=>{N!==null&&(ee(N),te(o),re.current=o,M.current=o)},[N,o]),(0,K.useEffect)(()=>{if(_!==ne.current){let e=g.compact(Pn(ie),w),t={...re.current,[S]:e};ee(e),te(t),re.current=t,p(e,t),ne.current=_}},[_,g,ie,w,v,S,p]),(0,K.useEffect)(()=>{let e=n!==O.current,o=r!==k.current,s=!(0,ji.deepEqual)(i,A.current),c=!(0,ji.deepEqual)(a,j.current);if(e||o||s||c){let e=r??Sr(i,n),o=Cr(e,a),d=S;if(d!==e||s||c){let n={...re.current};n[d]||(n[d]=Pn(E));let r=wr(n,i,e,d,o,g);r=Hi(r,t,o,g),n[e]=r,C(e),T(o),ee(r),te(n),re.current=n,f(e,o),p(r,n)}let h=Tr(l,e),_=u?Tr(u,e):null;m(n,h,o,_),O.current=n,k.current=r,A.current=i,j.current=a}},[n,r,i,a,S,w,E,t,g,_,v,l,u,f,p,m]);let ae=(0,K.useCallback)(e=>{let t={...re.current,[S]:e};ee(e),te(t),re.current=t,p(e,t)},[S,p]),oe=(0,K.useMemo)(()=>Tr(l,S),[l,S]),se=(0,K.useMemo)(()=>u===null?null:Tr(u,S),[u,S]),P=(0,K.useMemo)(()=>({cols:w,rowHeight:s,maxRows:c,margin:oe,containerPadding:se}),[w,s,c,oe,se]);return(0,q.jsx)(Ri,{...h,width:n,gridConfig:P,compactor:g,onLayoutChange:ae,layout:ie,children:t})}function Wi(e){let{children:t,width:n,breakpoint:r,breakpoints:i,cols:a,layouts:o,onBreakpointChange:s,onLayoutChange:c,onWidthChange:l,rowHeight:u,maxRows:d,margin:f,containerPadding:p,droppingItem:m,compactType:h,preventCollision:g=!1,allowOverlap:_=!1,verticalCompact:v,isDraggable:y=!0,isBounded:b=!1,draggableHandle:x,draggableCancel:S,isResizable:C=!0,resizeHandles:w=[`se`],resizeHandle:T,isDroppable:E=!1,useCSSTransforms:ee=!0,transformScale:D=1,autoSize:te,className:O,style:k,innerRef:A,onDragStart:j,onDrag:M,onDragStop:ne,onResizeStart:re,onResize:N,onResizeStop:ie,onDrop:ae,onDropDragOver:oe}=e,se=h===void 0?`vertical`:h;v===!1&&(se=null);let P={enabled:y,bounded:b,handle:x,cancel:S},F={enabled:C,handles:w,handleComponent:T},ce={enabled:E},le;le=ee?D===1?rr:ar(D):ir;let I=br(se,_,g);return(0,q.jsx)(Ui,{width:n,breakpoint:r,breakpoints:i,cols:a,layouts:o,rowHeight:u,maxRows:d,margin:f,containerPadding:p,compactor:I,dragConfig:P,resizeConfig:F,dropConfig:ce,positionStrategy:le,droppingItem:m,autoSize:te,className:O,style:k,innerRef:A,onBreakpointChange:s,onLayoutChange:c,onWidthChange:l,onDragStart:j,onDrag:M,onDragStop:ne,onResizeStart:re,onResize:N,onResizeStop:ie,onDrop:ae,onDropDragOver:oe,children:t})}Wi.displayName=`ResponsiveReactGridLayout`;var Gi=Wi,Ki=`react-grid-layout`;function qi(e){function t(t){let{measureBeforeMount:n=!1,className:r,style:i,...a}=t,[o,s]=(0,K.useState)(1280),[c,l]=(0,K.useState)(!1),u=(0,K.useRef)(null),d=(0,K.useRef)(null);return(0,K.useEffect)(()=>{l(!0)},[]),(0,K.useEffect)(()=>{let e=u.current;if(!(e instanceof HTMLElement))return;let t=null,n=new ResizeObserver(e=>{if(e[0]){let n=Math.round(e[0].contentRect.width);t!==null&&cancelAnimationFrame(t),t=requestAnimationFrame(()=>{s(e=>e===n?e:n),t=null})}});return n.observe(e),d.current=n,()=>{t!==null&&cancelAnimationFrame(t),n.unobserve(e),n.disconnect()}},[c]),n&&!c?(0,q.jsx)(`div`,{className:_(r,Ki),style:i,ref:u}):(0,q.jsx)(e,{innerRef:u,className:r,style:i,...a,width:o})}return t.displayName=`WidthProvider(${e.displayName||e.name||`Component`})`,t}function Ji(e){return e.reduce((e,t)=>Math.max(e,t.y+t.h),0)}function Yi(e,t){return e.map(e=>({...e,x:0,w:t,minW:Math.min(e.minW??1,t)}))}var Xi=qi(Gi),Zi=`fanout.dashboard-id`;async function Qi(e){let t=await D(e);if(!t.ok)throw Error(`Request failed (${t.status})`);return t.json()}var $i=e=>e.state.status===`error`&&15e3,ea={layout:[],widgets:[],filters:{window:`1h`,namespace:``}},ta={overview:`System health`,topology:`Service map`,activity:`Recent activity`,assistant:`Ask Fanout`,performance:`Performance`,trace:`Trace focus`,logs:`Logs`},na={overview:4,topology:4,activity:4,assistant:3,performance:4,trace:4,logs:4};function ra({dashboardID:e=``,agentAvailable:t,onOpenChat:n,onDashboardChange:r}){let i=H(),a=hn({queryKey:[`dashboards`],queryFn:()=>Qi(`/api/dashboards`),refetchInterval:3e3}),[o,s]=(0,K.useState)(()=>e||localStorage.getItem(Zi)||``),c=gn({mutationFn:async e=>{if(!l.data)throw Error(`No dashboard selected`);let t=await D(`/api/dashboards/${encodeURIComponent(l.data.id)}`,{method:`PUT`,headers:{"content-type":`application/json`},body:JSON.stringify({name:l.data.name,description:l.data.description,state:e})});if(!t.ok)throw Error(`Unable to save dashboard`);return t.json()},scope:{id:`dashboard-${o}`},onSuccess:e=>{i.setQueryData([`dashboard`,e.id],e),i.invalidateQueries({queryKey:[`dashboards`]})},onError:e=>console.error(`Dashboard save failed`,e)}),l=hn({queryKey:[`dashboard`,o],queryFn:()=>Qi(`/api/dashboards/${encodeURIComponent(o)}`),enabled:!!o,refetchInterval:c.isPending||c.isError?!1:3e3}),[u,d]=(0,K.useState)(ea),[f,p]=(0,K.useState)(`lg`);(0,K.useEffect)(()=>{e&&e!==o&&(s(e),localStorage.setItem(Zi,e))},[e,o]),(0,K.useEffect)(()=>{let t=a.data?.dashboards;if(t?.length&&!(e&&t.some(t=>t.id===e))){if(!e&&o&&t.some(e=>e.id===o)){r?.(o,!0);return}g((t.find(e=>e.is_default)??t[0]).id,!0)}},[e,a.data,o]),(0,K.useEffect)(()=>{c.isPending||c.isError||l.data?.state&&d(l.data.state)},[l.data?.updated_at,c.isPending,c.isError]),(0,K.useEffect)(()=>{c.reset()},[o]);let h=(0,K.useMemo)(()=>{let e=new Map(u.widgets.map(e=>[e.id,e.type])),t=u.layout.map(t=>{let n=na[e.get(t.i)??`overview`];return{...t,h:Math.max(t.h,n),minH:Math.max(t.minH??0,n)}});return{lg:t,md:t,sm:Yi(t,6),xs:Yi(t,2),xxs:Yi(t,1)}},[u.layout,u.widgets]);function g(e,t=!1){s(e),localStorage.setItem(Zi,e),r?.(e,t)}function _(e){d(e),c.mutate(e)}function v(e){let t=ve(),n=[`topology`,`performance`,`trace`,`logs`].includes(e),r=na[e];_({...u,widgets:[...u.widgets,{id:t,type:e,title:ta[e],enabled:!0}],layout:[...u.layout,{i:t,x:0,y:Ji(u.layout),w:n?8:4,h:r,minW:3,minH:r}]})}function y(e){_({...u,widgets:u.widgets.filter(t=>t.id!==e),layout:u.layout.filter(t=>t.i!==e)})}if(a.isLoading||o&&l.isLoading)return(0,q.jsx)(ia,{label:`Loading your workspace…`});if(a.isError||l.isError)return(0,q.jsx)(ia,{label:`Your workspace is unavailable. Try refreshing.`});let S=l.data;return S?(0,q.jsxs)(P,{component:`main`,maw:1440,mx:`auto`,px:{base:`md`,sm:`xl`,lg:72},pt:{base:`xl`,sm:52},pb:100,children:[(0,q.jsxs)(X,{justify:`space-between`,align:{base:`flex-start`,md:`flex-end`},direction:{base:`column`,md:`row`},gap:`lg`,mb:`xl`,children:[(0,q.jsxs)(P,{miw:0,children:[(0,q.jsxs)(we,{shadow:`md`,position:`bottom-start`,withinPortal:!0,children:[(0,q.jsx)(we.Target,{children:(0,q.jsx)(N,{variant:`subtle`,color:`gray`,size:`compact-sm`,leftSection:(0,q.jsx)(ln,{size:16,weight:`fill`}),rightSection:(0,q.jsx)(nn,{size:13,weight:`bold`}),children:`Dashboards`})}),(0,q.jsxs)(we.Dropdown,{children:[(0,q.jsx)(we.Label,{children:`Switch dashboard`}),(a.data?.dashboards??[]).map(e=>(0,q.jsx)(we.Item,{leftSection:e.id===o?(0,q.jsx)(re,{size:14,weight:`bold`}):(0,q.jsx)(P,{w:14}),onClick:()=>g(e.id),children:e.name},e.id))]})]}),(0,q.jsx)(x,{order:1,fz:{base:36,sm:52},lts:`-0.045em`,mt:4,children:S.name}),(0,q.jsx)(M,{c:`dimmed`,mt:4,children:S.description||`A focused view of the signals that matter now.`})]}),(0,q.jsxs)(se,{wrap:`nowrap`,w:{base:`100%`,md:`auto`},children:[t&&(0,q.jsx)(N,{variant:`default`,leftSection:(0,q.jsx)(sn,{size:16,weight:`fill`}),flex:{base:1,md:`initial`},onClick:()=>n(`Create a new dashboard for me. First ask what I want to monitor, then design it when you have enough context.`),children:`Create with AI`}),(0,q.jsx)(N,{leftSection:l.isFetching?(0,q.jsx)(b,{size:15,color:`var(--mantine-primary-color-contrast)`}):(0,q.jsx)(en,{size:16,weight:`bold`}),onClick:()=>void i.invalidateQueries(),children:l.isFetching?`Refreshing`:`Refresh`})]})]}),c.isError&&(0,q.jsx)(ee,{color:`bad`,radius:`lg`,mb:`lg`,icon:(0,q.jsx)(dn,{size:18,weight:`fill`}),title:`Dashboard changes not saved`,children:(0,q.jsxs)(se,{justify:`space-between`,gap:`sm`,children:[(0,q.jsx)(M,{size:`sm`,children:`Your latest edits are kept on this screen but Fanout could not store them.`}),(0,q.jsx)(N,{size:`compact-sm`,color:`bad`,variant:`light`,onClick:()=>c.mutate(u),children:`Retry save`})]})}),(0,q.jsx)(m,{withBorder:!0,radius:`lg`,p:{base:`md`,sm:`lg`},mb:`lg`,role:`group`,"aria-label":`Dashboard controls`,children:(0,q.jsxs)(X,{align:{base:`stretch`,md:`flex-end`},justify:`space-between`,direction:{base:`column`,md:`row`},gap:`md`,children:[(0,q.jsxs)(se,{align:`flex-end`,gap:`md`,grow:!0,wrap:`wrap`,w:{base:`100%`,md:`auto`},children:[(0,q.jsx)(Et,{label:`Window`,value:u.filters.window,onChange:e=>e&&_({...u,filters:{...u.filters,window:e}}),data:[{value:`15m`,label:`15 minutes`},{value:`1h`,label:`1 hour`},{value:`6h`,label:`6 hours`},{value:`24h`,label:`24 hours`},{value:`168h`,label:`7 days`},{value:`720h`,label:`30 days`}],w:{base:`100%`,xs:150}}),(0,q.jsx)(A,{label:`Namespace`,value:u.filters.namespace,onChange:e=>d({...u,filters:{...u.filters,namespace:e.currentTarget.value}}),onBlur:e=>_({...u,filters:{...u.filters,namespace:e.currentTarget.value}}),placeholder:`All namespaces`,w:{base:`100%`,xs:220}})]}),(0,q.jsxs)(X,{wrap:{base:`wrap`,sm:`nowrap`},justify:{base:`flex-start`,md:`flex-end`},align:`center`,gap:{base:`sm`,sm:`md`},w:{base:`100%`,md:`auto`},children:[(0,q.jsxs)(se,{gap:`xs`,wrap:`nowrap`,children:[(0,q.jsx)(Ct,{color:c.isError?`bad`:c.isPending?`warn`:`ok`,processing:c.isPending,size:8}),(0,q.jsx)(M,{c:`dimmed`,size:`sm`,miw:48,children:c.isPending?`Saving`:c.isError?`Failed`:`Saved`})]}),(0,q.jsx)(me,{orientation:`vertical`,h:28}),(0,q.jsxs)(we,{shadow:`md`,position:`bottom-end`,withinPortal:!0,children:[(0,q.jsx)(we.Target,{children:(0,q.jsx)(N,{variant:`default`,leftSection:(0,q.jsx)(z,{size:16,weight:`bold`}),rightSection:(0,q.jsx)(nn,{size:14,weight:`bold`}),children:`Add view`})}),(0,q.jsxs)(we.Dropdown,{children:[(0,q.jsx)(we.Label,{children:`Dashboard views`}),Object.entries(ta).filter(([e])=>t||e!==`assistant`).map(([e,t])=>(0,q.jsx)(we.Item,{onClick:()=>v(e),children:t},e))]})]}),t&&(0,q.jsx)(N,{variant:`subtle`,color:`gray`,rightSection:(0,q.jsx)(R,{size:16,weight:`bold`}),onClick:()=>n(),children:`Ask Fanout`})]})]})}),(0,q.jsx)(Xi,{className:`dashboard-grid`,layouts:h,breakpoints:{lg:1100,md:800,sm:600,xs:420,xxs:0},cols:{lg:12,md:10,sm:6,xs:2,xxs:1},rowHeight:76,margin:[16,16],containerPadding:[0,0],compactType:`vertical`,draggableCancel:`button,input,select,textarea,a,label,[role=menu]`,onBreakpointChange:p,onDragStop:e=>{f===`lg`&&_({...u,layout:[...e]})},onResizeStop:e=>{f===`lg`&&_({...u,layout:[...e]})},children:u.widgets.map(e=>(0,q.jsx)(`div`,{children:(0,q.jsx)(aa,{widget:e,filters:u.filters,agentAvailable:t,onRemove:()=>y(e.id),onOpenChat:n})},e.id))})]}):(0,q.jsx)(ia,{label:`Preparing your workspace…`})}function ia({label:e}){return(0,q.jsxs)(T,{mih:`50vh`,children:[(0,q.jsx)(b,{size:`sm`}),(0,q.jsx)(M,{c:`dimmed`,size:`sm`,ml:`sm`,children:e})]})}function aa({widget:e,filters:t,agentAvailable:n,onRemove:r,onOpenChat:i}){let a=new URLSearchParams({window:t.window,limit:`40`});t.namespace&&a.set(`namespace`,t.namespace);let o=typeof e.config?.service==`string`?e.config.service:``;o&&a.set(`service`,o);let s=hn({queryKey:[`overview`,a.toString()],queryFn:()=>Qi(`/api/observability/overview?${a}`),enabled:e.type===`overview`||e.type===`activity`,refetchInterval:$i}),c=hn({queryKey:[`topology`,a.toString()],queryFn:()=>Qi(`/api/observability/topology?${a}`),enabled:e.type===`topology`,refetchInterval:$i}),l=hn({queryKey:[`performance`,a.toString()],queryFn:()=>Qi(`/api/observability/performance?${a}`),enabled:e.type===`performance`,refetchInterval:$i}),u=new URLSearchParams(a);typeof e.config?.severity==`string`&&u.set(`severity`,e.config.severity),typeof e.config?.search==`string`&&u.set(`search`,e.config.search);let d=hn({queryKey:[`logs`,u.toString()],queryFn:()=>Qi(`/api/observability/logs?${u}`),enabled:e.type===`logs`,refetchInterval:$i}),f=new URLSearchParams(a);typeof e.config?.trace_id==`string`&&f.set(`trace_id`,e.config.trace_id);let p=hn({queryKey:[`trace`,f.toString()],queryFn:()=>Qi(`/api/observability/trace?${f}`),enabled:e.type===`trace`,refetchInterval:$i}),h=s.data?.data,g={overview:s,activity:s,topology:c,performance:l,logs:d,trace:p}[e.type]?.isError??!1;return(0,q.jsx)(m,{withBorder:!0,shadow:`xs`,radius:`lg`,p:`lg`,h:`100%`,style:{overflow:`hidden`},children:(0,q.jsxs)(oe,{h:`100%`,gap:`sm`,children:[(0,q.jsxs)(se,{justify:`space-between`,align:`flex-start`,wrap:`nowrap`,children:[(0,q.jsxs)(P,{children:[(0,q.jsx)(M,{c:`dimmed`,size:`xs`,fw:700,tt:`uppercase`,lts:`0.1em`,children:e.type===`assistant`?`Guidance`:e.type}),(0,q.jsx)(x,{order:2,fz:`lg`,mt:2,children:e.title})]}),(0,q.jsx)(Se,{label:`Remove ${e.title}`,children:(0,q.jsx)(de,{variant:`subtle`,color:`bad`,"aria-label":`Remove ${e.title}`,onClick:r,children:(0,q.jsx)(pn,{size:16,weight:`bold`})})})]}),(0,q.jsxs)(Ce,{type:`auto`,offsetScrollbars:!0,flex:1,children:[g&&(0,q.jsx)(da,{}),!g&&e.type===`overview`&&(0,q.jsxs)(fe,{cols:2,spacing:`sm`,children:[(0,q.jsx)(la,{label:`Health`,value:h?.health??`—`}),(0,q.jsx)(la,{label:`Services`,value:h?.service_count??`—`}),(0,q.jsx)(la,{label:`Spans`,value:h?.total_spans?.toLocaleString?.()??`—`}),(0,q.jsx)(la,{label:`Error rate`,value:h?`${(h.error_rate*100).toFixed(2)}%`:`—`})]}),!g&&e.type===`topology`&&(0,q.jsx)(oa,{rows:(c.data?.data?.nodes??[]).slice(0,6).map(e=>[(0,q.jsx)(sa,{health:e.health,label:e.service},`health`),`${e.spans?.toLocaleString?.()??0} spans`,`${e.p95_ms?.toFixed?.(1)??`—`} ms p95`]),empty:`No service relationships in this window`}),!g&&e.type===`activity`&&(0,q.jsx)(oa,{rows:(h?.services??[]).slice(0,5).map(e=>[(0,q.jsx)(sa,{health:e.health,label:e.service},`health`),e.error_rate?`${(e.error_rate*100).toFixed(2)}% errors`:`Operating normally`]),empty:`No recent activity`}),!g&&e.type===`performance`&&(0,q.jsx)(oa,{rows:(l.data?.data?.endpoints??[]).slice(0,5).map(e=>[(0,q.jsxs)(M,{fw:600,size:`sm`,truncate:!0,children:[e.method,` `,e.path]},`path`),`${e.calls?.toLocaleString?.()} calls`,`${e.p95_ms?.toFixed?.(1)} ms p95`]),empty:`No endpoint activity in this window`}),!g&&e.type===`logs`&&(0,q.jsx)(oa,{rows:(d.data?.data?.entries??[]).slice(0,5).map(e=>[(0,q.jsx)(_t,{color:ca(e.severity),variant:`light`,children:e.severity},`severity`),e.service,e.body]),empty:`No matching logs in this window`}),!g&&e.type===`trace`&&(0,q.jsxs)(oe,{children:[(0,q.jsxs)(fe,{cols:2,spacing:`sm`,children:[(0,q.jsx)(la,{label:`Duration`,value:p.data?.data?`${p.data.data.duration_ms.toFixed?.(1)} ms`:`—`}),(0,q.jsx)(la,{label:`Spans`,value:p.data?.data?.spans?.length??`—`}),(0,q.jsx)(la,{label:`Services`,value:p.data?.data?.services?.length??`—`}),(0,q.jsx)(la,{label:`Status`,value:p.data?.data?p.data.data.has_error?`Error`:`Healthy`:`—`})]}),(0,q.jsx)(M,{c:`dimmed`,size:`xs`,ff:`monospace`,truncate:!0,children:p.data?.data?.trace_id?`Trace ${p.data.data.trace_id}`:`Most relevant recent trace`})]}),!g&&e.type===`assistant`&&(n?(0,q.jsxs)(oe,{align:`flex-start`,children:[(0,q.jsx)(M,{c:`dimmed`,children:`Ask a focused question about health, latency, errors, or dependencies.`}),(0,q.jsx)(N,{leftSection:(0,q.jsx)(sn,{size:16,weight:`fill`}),onClick:()=>i(`Summarize the most important system changes in the selected window`),children:`Start a conversation`})]}):(0,q.jsx)(M,{c:`dimmed`,children:`Configure an AI provider to enable this view. The rest of this dashboard remains available.`}))]})]})})}function oa({rows:e,empty:t}){return e.length?(0,q.jsx)(Gt.ScrollContainer,{minWidth:420,children:(0,q.jsx)(Gt,{verticalSpacing:`sm`,highlightOnHover:!0,children:(0,q.jsx)(Gt.Tbody,{children:e.map((e,t)=>(0,q.jsx)(Gt.Tr,{children:e.map((e,t)=>(0,q.jsx)(Gt.Td,{children:(0,q.jsx)(M,{component:`span`,size:`sm`,c:t?`dimmed`:void 0,lineClamp:1,children:e})},t))},t))})})}):(0,q.jsx)(ua,{text:t})}function sa({health:e,label:t}){return(0,q.jsx)(_t,{color:e===`healthy`?`ok`:e===`degraded`?`warn`:`bad`,variant:`light`,tt:`none`,children:t})}function ca(e){let t=String(e).toUpperCase();return t===`ERROR`||t===`FATAL`?`bad`:t===`WARN`||t===`WARNING`?`warn`:t===`INFO`?`info`:`gray`}function la({label:e,value:t}){return(0,q.jsxs)(m,{withBorder:!0,radius:`md`,p:`sm`,bg:`var(--mantine-color-default)`,children:[(0,q.jsx)(M,{c:`dimmed`,size:`xs`,children:e}),(0,q.jsx)(M,{fw:700,fz:`xl`,mt:4,tt:`capitalize`,children:t})]})}function ua({text:e}){return(0,q.jsxs)(T,{py:`xl`,children:[(0,q.jsx)(an,{size:20}),(0,q.jsx)(M,{c:`dimmed`,size:`sm`,ml:`xs`,children:e})]})}function da(){return(0,q.jsxs)(T,{py:`xl`,children:[(0,q.jsx)(dn,{size:20,weight:`fill`,color:`var(--mantine-color-bad-filled)`}),(0,q.jsx)(M,{c:`bad`,fw:500,size:`sm`,ml:`xs`,children:`Couldn't load this view — retrying automatically`})]})}export{ra as t}; \ No newline at end of file diff --git a/internal/ui/dist/assets/dashboards._dashboardId-BKkqXjF1.js b/internal/ui/dist/assets/dashboards._dashboardId-BUndKTeA.js similarity index 69% rename from internal/ui/dist/assets/dashboards._dashboardId-BKkqXjF1.js rename to internal/ui/dist/assets/dashboards._dashboardId-BUndKTeA.js index 9de2a1bc..16b7fb18 100644 --- a/internal/ui/dist/assets/dashboards._dashboardId-BKkqXjF1.js +++ b/internal/ui/dist/assets/dashboards._dashboardId-BUndKTeA.js @@ -1 +1 @@ -import{a as e,n as t}from"./useNavigate-BEpS2iE5.js";import{t as n}from"./dashboard-Bf0GrxUB.js";import{r,t as i}from"./index-Cnw6TNqL.js";var a=e();function o(){let{dashboardId:e}=i.useParams(),o=t(),{agentAvailable:s,openChat:c}=r();return(0,a.jsx)(n,{dashboardID:e,agentAvailable:s,onOpenChat:c,onDashboardChange:(e,t)=>void o({to:`/dashboards/$dashboardId`,params:{dashboardId:e},replace:t})})}export{o as component}; \ No newline at end of file +import{a as e,n as t}from"./useNavigate-BEpS2iE5.js";import{t as n}from"./dashboard-EEbwGLTY.js";import{r,t as i}from"./index-Ckl_dWuh.js";var a=e();function o(){let{dashboardId:e}=i.useParams(),o=t(),{agentAvailable:s,openChat:c}=r();return(0,a.jsx)(n,{dashboardID:e,agentAvailable:s,onOpenChat:c,onDashboardChange:(e,t)=>void o({to:`/dashboards/$dashboardId`,params:{dashboardId:e},replace:t})})}export{o as component}; \ No newline at end of file diff --git a/internal/ui/dist/assets/dashboards.index-Dxwz9Ppx.js b/internal/ui/dist/assets/dashboards.index-BoPfccdT.js similarity index 82% rename from internal/ui/dist/assets/dashboards.index-Dxwz9Ppx.js rename to internal/ui/dist/assets/dashboards.index-BoPfccdT.js index 292bfb34..642c16d8 100644 --- a/internal/ui/dist/assets/dashboards.index-Dxwz9Ppx.js +++ b/internal/ui/dist/assets/dashboards.index-BoPfccdT.js @@ -1 +1 @@ -import{a as e,n as t}from"./useNavigate-BEpS2iE5.js";import{t as n}from"./dashboard-Bf0GrxUB.js";import{r}from"./index-Cnw6TNqL.js";var i=e();function a(){let e=t(),{agentAvailable:a,openChat:o}=r();return(0,i.jsx)(n,{agentAvailable:a,onOpenChat:o,onDashboardChange:t=>void e({to:`/dashboards/$dashboardId`,params:{dashboardId:t},replace:!0})})}export{a as component}; \ No newline at end of file +import{a as e,n as t}from"./useNavigate-BEpS2iE5.js";import{t as n}from"./dashboard-EEbwGLTY.js";import{r}from"./index-Ckl_dWuh.js";var i=e();function a(){let e=t(),{agentAvailable:a,openChat:o}=r();return(0,i.jsx)(n,{agentAvailable:a,onOpenChat:o,onDashboardChange:t=>void e({to:`/dashboards/$dashboardId`,params:{dashboardId:t},replace:!0})})}export{a as component}; \ No newline at end of file diff --git a/internal/ui/dist/assets/index-Ckl_dWuh.js b/internal/ui/dist/assets/index-Ckl_dWuh.js new file mode 100644 index 00000000..397d137f --- /dev/null +++ b/internal/ui/dist/assets/index-Ckl_dWuh.js @@ -0,0 +1,85 @@ +const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/mcp-app-frame-C0HSbiNW.js","assets/useNavigate-BEpS2iE5.js","assets/auth-DhIxmh_D.js","assets/routes-UYU1YEPx.js","assets/chat.index-B-B4AZ2m.js","assets/dashboards.index-BoPfccdT.js","assets/dashboard-EEbwGLTY.js","assets/dashboards._dashboardId-BUndKTeA.js"])))=>i.map(i=>d[i]); +import{a as e,c as t,d as n,g as r,i,l as a,n as o,o as s,p as c,r as l,s as u,t as d,u as f}from"./useNavigate-BEpS2iE5.js";import{$ as p,B as m,C as h,E as g,F as _,G as v,H as y,I as b,J as x,K as S,L as C,M as w,N as T,O as E,P as D,Q as O,R as k,S as ee,T as te,U as ne,W as re,X as A,Y as ie,Z as ae,_ as oe,a as se,at as ce,b as le,c as ue,ct as de,d as fe,dt as j,et as pe,f as me,ft as he,g as ge,h as _e,i as ve,it as ye,j as be,l as xe,lt as Se,m as Ce,mt as we,n as Te,nt as Ee,ot as De,p as Oe,pt as ke,q as Ae,r as je,rt as Me,s as Ne,st as Pe,t as Fe,tt as Ie,u as Le,ut as Re,v as ze,w as Be,x as Ve,y as He,z as Ue}from"./auth-DhIxmh_D.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 We=n((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,O());else{var t=n(l);t!==null&&te(x,t.startTime-e)}}}var S=!1,C=-1,w=5,T=-1;function E(){return g?!0:!(e.unstable_now()-Tt&&E());){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&&te(x,u.startTime-t),i=!1}}break a}finally{d=null,f=a,p=!1}i=void 0}}finally{i?O():S=!1}}}var O;if(typeof y==`function`)O=function(){y(D)};else if(typeof MessageChannel<`u`){var k=new MessageChannel,ee=k.port2;k.port1.onmessage=D,O=function(){ee.postMessage(null)}}else O=function(){_(D,0)};function te(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,te(x,a-o))):(r.sortIndex=s,t(c,r),m||p||(m=!0,S||(S=!0,O()))),r},e.unstable_shouldYield=E,e.unstable_wrapCallback=function(e){var t=f;return function(){var n=f;f=t;try{return e.apply(this,arguments)}finally{f=n}}}})),Ge=n(((e,t)=>{t.exports=We()})),Ke=n((e=>{var t=Ge(),n=f(),r=we();function i(e){var t=`https://react.dev/errors/`+e;if(1se||(e.current=oe[se],oe[se]=null,se--)}function ue(e,t){se++,oe[se]=e.current,e.current=t}var de=ce(null),fe=ce(null),j=ce(null),pe=ce(null);function me(e,t){switch(ue(j,t),ue(fe,e),ue(de,null),t.nodeType){case 9:case 11:e=(e=t.documentElement)&&(e=e.namespaceURI)?cf(e):0;break;default:if(e=t.tagName,t=t.namespaceURI)t=cf(t),e=lf(t,e);else switch(e){case`svg`:e=1;break;case`math`:e=2;break;default:e=0}}le(de),ue(de,e)}function he(){le(de),le(fe),le(j)}function ge(e){e.memoizedState!==null&&ue(pe,e);var t=de.current,n=lf(t,e.type);t!==n&&(ue(fe,e),ue(de,n))}function _e(e){fe.current===e&&(le(de),le(fe)),pe.current===e&&(le(pe),vp._currentValue=ae)}var ve,ye;function be(e){if(ve===void 0)try{throw Error()}catch(e){var t=e.stack.trim().match(/\n( *(at )?)/);ve=t&&t[1]||``,ye=-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{xe=!1,Error.prepareStackTrace=n}return(n=e?e.displayName||e.name:``)?be(n):``}function Ce(e,t){switch(e.tag){case 26:case 27:case 5:return be(e.type);case 16:return be(`Lazy`);case 13:return e.child!==t&&t!==null?be(`Suspense Fallback`):be(`Suspense`);case 19:return be(`SuspenseList`);case 0:case 15:return Se(e.type,!1);case 11:return Se(e.type.render,!1);case 1:return Se(e.type,!0);case 31:return be(`Activity`);default:return``}}function Te(e){try{var t=``,n=null;do t+=Ce(e,n),n=e,e=e.return;while(e);return t}catch(e){return` +Error generating stack: `+e.message+` +`+e.stack}}var Ee=Object.prototype.hasOwnProperty,De=t.unstable_scheduleCallback,Oe=t.unstable_cancelCallback,ke=t.unstable_shouldYield,Ae=t.unstable_requestPaint,je=t.unstable_now,Me=t.unstable_getCurrentPriorityLevel,Ne=t.unstable_ImmediatePriority,Pe=t.unstable_UserBlockingPriority,Fe=t.unstable_NormalPriority,Ie=t.unstable_LowPriority,Le=t.unstable_IdlePriority,Re=t.log,ze=t.unstable_setDisableYieldValue,Be=null,Ve=null;function He(e){if(typeof Re==`function`&&ze(e),Ve&&typeof Ve.setStrictMode==`function`)try{Ve.setStrictMode(Be,e)}catch{}}var Ue=Math.clz32?Math.clz32:qe,We=Math.log,Ke=Math.LN2;function qe(e){return e>>>=0,e===0?32:31-(We(e)/Ke|0)|0}var Je=256,Ye=262144,Xe=4194304;function Ze(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&261888;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 Qe(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=Ze(n))):i=Ze(o):i=Ze(s)):(r=s&~a,r===0?(o&=s,o===0?n||(n=s&~e,n!==0&&(i=Ze(n))):i=Ze(o)):i=Ze(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 $e(e,t){return(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&t)===0}function et(e,t){switch(e){case 1:case 2:case 4:case 8:case 64:return t+250;case 16:case 32:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return t+5e3;case 4194304:case 8388608:case 16777216:case 33554432:return-1;case 67108864:case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function tt(){var e=Xe;return Xe<<=1,!(Xe&62914560)&&(Xe=4194304),e}function nt(e){for(var t=[],n=0;31>n;n++)t.push(e);return t}function rt(e,t){e.pendingLanes|=t,t!==268435456&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function it(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`u`||window.document===void 0||window.document.createElement===void 0),_n=!1;if(gn)try{var vn={};Object.defineProperty(vn,"passive",{get:function(){_n=!0}}),window.addEventListener(`test`,vn,vn),window.removeEventListener(`test`,vn,vn)}catch{_n=!1}var yn=null,bn=null,xn=null;function Sn(){if(xn)return xn;var e,t=bn,n=t.length,r,i=`value`in yn?yn.value:yn.textContent,a=i.length;for(e=0;e=er),rr=` `,ir=!1;function ar(e,t){switch(e){case`keyup`:return Qn.indexOf(t.keyCode)!==-1;case`keydown`:return t.keyCode!==229;case`keypress`:case`mousedown`:case`focusout`:return!0;default:return!1}}function or(e){return e=e.detail,typeof e==`object`&&`data`in e?e.data:null}var sr=!1;function cr(e,t){switch(e){case`compositionend`:return or(t);case`keypress`:return t.which===32?(ir=!0,rr):null;case`textInput`:return e=t.data,e===rr&&ir?null:e;default:return null}}function lr(e,t){if(sr)return e===`compositionend`||!$n&&ar(e,t)?(e=Sn(),xn=bn=yn=null,sr=!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=jr(n)}}function Nr(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?Nr(e,t.parentNode):`contains`in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function Pr(e){e=e!=null&&e.ownerDocument!=null&&e.ownerDocument.defaultView!=null?e.ownerDocument.defaultView:window;for(var t=Ut(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=Ut(e.document)}return t}function Fr(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 Ir=gn&&`documentMode`in document&&11>=document.documentMode,Lr=null,Rr=null,zr=null,Br=!1;function Vr(e,t,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;Br||Lr==null||Lr!==Ut(r)||(r=Lr,`selectionStart`in r&&Fr(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}),zr&&Ar(zr,r)||(zr=r,r=Gd(Rr,`onSelect`),0>=o,i-=o,ji=1<<32-Ue(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),Bi&&Ni(i,h),l;if(d===null){for(;hg?(_=h,h=null):_=h.sibling;var y=p(a,h,v.value,l);if(y===null){h===null&&(h=_);break}e&&h&&y.alternate===null&&t(a,h),s=o(y,s,g),d===null?u=y:d.sibling=y,d=y,h=_}if(v.done)return n(a,h),Bi&&Ni(a,g),u;if(h===null){for(;!v.done;g++,v=c.next())v=f(a,v.value,l),v!==null&&(s=o(v,s,g),d===null?u=v:d.sibling=v,d=v);return Bi&&Ni(a,g),u}for(h=r(h);!v.done;g++,v=c.next())v=m(h,a,g,v.value,l),v!==null&&(e&&v.alternate!==null&&h.delete(v.key===null?g:v.key),s=o(v,s,g),d===null?u=v:d.sibling=v,d=v);return e&&h.forEach(function(e){return t(a,e)}),Bi&&Ni(a,g),u}function b(e,r,o,c){if(typeof o==`object`&&o&&o.type===_&&o.key===null&&(o=o.props.children),typeof o==`object`&&o){switch(o.$$typeof){case h:a:{for(var l=o.key;r!==null;){if(r.key===l){if(l=o.type,l===_){if(r.tag===7){n(e,r.sibling),c=a(r,o.props.children),c.return=e,e=c;break a}}else if(r.elementType===l||typeof l==`object`&&l&&l.$$typeof===E&&Pa(l)===r.type){n(e,r.sibling),c=a(r,o.props),Va(c,o),c.return=e,e=c;break a}n(e,r);break}t(e,r),r=r.sibling}o.type===_?(c=vi(o.props.children,e.mode,c,o.key),c.return=e,e=c):(c=_i(o.type,o.key,o.props,null,e.mode,c),Va(c,o),c.return=e,e=c)}return s(e);case g: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=a(r,o.children||[]),c.return=e,e=c;break a}n(e,r);break}t(e,r),r=r.sibling}c=xi(o,e.mode,c),c.return=e,e=c}return s(e);case E:return o=Pa(o),b(e,r,o,c)}if(re(o))return v(e,r,o,c);if(ee(o)){if(l=ee(o),typeof l!=`function`)throw Error(i(150));return o=l.call(o),y(e,r,o,c)}if(typeof o.then==`function`)return b(e,r,Ba(o),c);if(o.$$typeof===x)return b(e,r,ca(e,o),c);Ha(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=a(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{za=0;var i=b(e,t,n,r);return Ra=null,i}catch(t){if(t===Oa||t===Aa)throw t;var a=pi(29,t,null,e.mode);return a.lanes=r,a.return=e,a}}}var Wa=Ua(!0),Ga=Ua(!1),Ka=!1;function qa(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function Ja(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 Ya(e){return{lane:e,tag:0,payload:null,callback:null,next:null}}function Xa(e,t,n){var r=e.updateQueue;if(r===null)return null;if(r=r.shared,Zl&2){var i=r.pending;return i===null?t.next=t:(t.next=i.next,i.next=t),r.pending=t,t=ui(e),li(e,null,n),t}return oi(e,r,t,n),ui(e)}function Za(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,ot(e,n)}}function Qa(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 $a=!1;function eo(){if($a){var e=ya;if(e!==null)throw e}}function to(e,t,n,r){$a=!1;var i=e.updateQueue;Ka=!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,m=f!==s.lane;if(m?(eu&f)===f:(r&f)===f){f!==0&&f===va&&($a=!0),u!==null&&(u=u.next={lane:0,tag:s.tag,payload:s.payload,callback:null,next:null});a:{var h=e,g=s;f=t;var _=n;switch(g.tag){case 1:if(h=g.payload,typeof h==`function`){d=h.call(_,d,f);break a}d=h;break a;case 3:h.flags=h.flags&-65537|128;case 0:if(h=g.payload,f=typeof h==`function`?h.call(_,d,f):h,f==null)break a;d=p({},d,f);break a;case 2:Ka=!0}}f=s.callback,f!==null&&(e.flags|=64,m&&(e.flags|=8192),m=i.callbacks,m===null?i.callbacks=[f]:m.push(f))}else m={lane:f,tag:s.tag,payload:s.payload,callback:s.callback,next:null},u===null?(l=u=m,c=d):u=u.next=m,o|=f;if(s=s.next,s===null){if(s=i.shared.pending,s===null)break;m=s,s=m.next,m.next=null,i.lastBaseUpdate=m,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),cu|=o,e.lanes=o,e.memoizedState=d}}function no(e,t){if(typeof e!=`function`)throw Error(i(191,e));e.call(t)}function ro(e,t){var n=e.callbacks;if(n!==null)for(e.callbacks=null,e=0;ea?a:8;var o=A.T,s={};A.T=s,Ws(e,!1,t,n);try{var c=i(),l=A.S;l!==null&&l(s,c),typeof c==`object`&&c&&typeof c.then==`function`?Us(e,t,Sa(c,r),Au(e)):Us(e,t,r,Au(e))}catch(n){Us(e,t,{then:function(){},status:`rejected`,reason:n},Au())}finally{ie.p=a,o!==null&&s.types!==null&&(o.types=s.types),A.T=o}}function Ns(){}function Ps(e,t,n,r){if(e.tag!==5)throw Error(i(476));var a=Fs(e).queue;Ms(e,a,t,ae,n===null?Ns:function(){return Is(e),n(r)})}function Fs(e){var t=e.memoizedState;if(t!==null)return t;t={memoizedState:ae,baseState:ae,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Go,lastRenderedState:ae},next:null};var n={};return t.next={memoizedState:n,baseState:n,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Go,lastRenderedState:n},next:null},e.memoizedState=t,e=e.alternate,e!==null&&(e.memoizedState=t),t}function Is(e){var t=Fs(e);t.next===null&&(t=e.alternate.memoizedState),Us(e,t.next.queue,{},Au())}function Ls(){return sa(vp)}function Rs(){return Bo().memoizedState}function zs(){return Bo().memoizedState}function Bs(e){for(var t=e.return;t!==null;){switch(t.tag){case 24:case 3:var n=Au();e=Ya(n);var r=Xa(t,e,n);r!==null&&(Mu(r,t,n),Za(r,t,n)),t={cache:ma()},e.payload=t;return}t=t.return}}function Vs(e,t,n){var r=Au();n={lane:r,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null},Gs(e)?Ks(t,n):(n=si(e,t,n,r),n!==null&&(Mu(n,e,r),qs(n,t,r)))}function Hs(e,t,n){Us(e,t,n,Au())}function Us(e,t,n,r){var i={lane:r,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null};if(Gs(e))Ks(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 oi(e,t,i,0),Ql===null&&ai(),!1}catch{}if(n=si(e,t,i,r),n!==null)return Mu(n,e,r),qs(n,t,r),!0}return!1}function Ws(e,t,n,r){if(r={lane:2,revertLane:kd(),gesture:null,action:r,hasEagerState:!1,eagerState:null,next:null},Gs(e)){if(t)throw Error(i(479))}else t=si(e,n,r,2),t!==null&&Mu(t,e,2)}function Gs(e){var t=e.alternate;return e===bo||t!==null&&t===bo}function Ks(e,t){wo=Co=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function qs(e,t,n){if(n&4194048){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,ot(e,n)}}var Js={readContext:sa,use:Uo,useCallback:Ao,useContext:Ao,useEffect:Ao,useImperativeHandle:Ao,useLayoutEffect:Ao,useInsertionEffect:Ao,useMemo:Ao,useReducer:Ao,useRef:Ao,useState:Ao,useDebugValue:Ao,useDeferredValue:Ao,useTransition:Ao,useSyncExternalStore:Ao,useId:Ao,useHostTransitionStatus:Ao,useFormState:Ao,useActionState:Ao,useOptimistic:Ao,useMemoCache:Ao,useCacheRefresh:Ao};Js.useEffectEvent=Ao;var Ys={readContext:sa,use:Uo,useCallback:function(e,t){return zo().memoizedState=[e,t===void 0?null:t],e},useContext:sa,useEffect:ys,useImperativeHandle:function(e,t,n){n=n==null?null:n.concat([e]),_s(4194308,4,Ts.bind(null,t,e),n)},useLayoutEffect:function(e,t){return _s(4194308,4,e,t)},useInsertionEffect:function(e,t){_s(4,2,e,t)},useMemo:function(e,t){var n=zo();t=t===void 0?null:t;var r=e();if(To){He(!0);try{e()}finally{He(!1)}}return n.memoizedState=[r,t],r},useReducer:function(e,t,n){var r=zo();if(n!==void 0){var i=n(t);if(To){He(!0);try{n(t)}finally{He(!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=Vs.bind(null,bo,e),[r.memoizedState,e]},useRef:function(e){var t=zo();return e={current:e},t.memoizedState=e},useState:function(e){e=ts(e);var t=e.queue,n=Hs.bind(null,bo,t);return t.dispatch=n,[e.memoizedState,n]},useDebugValue:Ds,useDeferredValue:function(e,t){return As(zo(),e,t)},useTransition:function(){var e=ts(!1);return e=Ms.bind(null,bo,e.queue,!0,!1),zo().memoizedState=e,[!1,e]},useSyncExternalStore:function(e,t,n){var r=bo,a=zo();if(Bi){if(n===void 0)throw Error(i(407));n=n()}else{if(n=t(),Ql===null)throw Error(i(349));eu&127||Xo(r,t,n)}a.memoizedState=n;var o={value:n,getSnapshot:t};return a.queue=o,ys(Qo.bind(null,r,o,e),[e]),r.flags|=2048,hs(9,{destroy:void 0},Zo.bind(null,r,o,n,t),null),n},useId:function(){var e=zo(),t=Ql.identifierPrefix;if(Bi){var n=Mi,r=ji;n=(r&~(1<<32-Ue(r)-1)).toString(32)+n,t=`_`+t+`R_`+n,n=Eo++,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(a,{is:r.is}):s.createElement(a)}}o[pt]=t,o[mt]=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(ef(o,a,r),a){case`button`:case`input`:case`select`:case`textarea`:r=!!r.autoFocus;break a;case`img`:r=!0;break a;default:r=!1}r&&Uc(t)}}return Jc(t),Wc(t,t.type,e===null?null:e.memoizedProps,t.pendingProps,n),null;case 6:if(e&&t.stateNode!=null)e.memoizedProps!==r&&Uc(t);else{if(typeof r!=`string`&&t.stateNode===null)throw Error(i(166));if(e=j.current,qi(t)){if(e=t.stateNode,n=t.memoizedProps,r=null,a=Ri,a!==null)switch(a.tag){case 27:case 5:r=a.memoizedProps}e[pt]=t,e=!!(e.nodeValue===n||r!==null&&!0===r.suppressHydrationWarning||Zd(e.nodeValue,n)),e||Wi(t,!0)}else e=sf(e).createTextNode(r),e[pt]=t,t.stateNode=e}return Jc(t),null;case 31:if(n=t.memoizedState,e===null||e.memoizedState!==null){if(r=qi(t),n!==null){if(e===null){if(!r)throw Error(i(318));if(e=t.memoizedState,e=e===null?null:e.dehydrated,!e)throw Error(i(557));e[pt]=t}else Ji(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;Jc(t),e=!1}else n=Yi(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=n),e=!0;if(!e)return t.flags&256?(go(t),t):(go(t),null);if(t.flags&128)throw Error(i(558))}return Jc(t),null;case 13:if(r=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(a=qi(t),r!==null&&r.dehydrated!==null){if(e===null){if(!a)throw Error(i(318));if(a=t.memoizedState,a=a===null?null:a.dehydrated,!a)throw Error(i(317));a[pt]=t}else Ji(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;Jc(t),a=!1}else a=Yi(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=a),a=!0;if(!a)return t.flags&256?(go(t),t):(go(t),null)}return go(t),t.flags&128?(t.lanes=n,t):(n=r!==null,e=e!==null&&e.memoizedState!==null,n&&(r=t.child,a=null,r.alternate!==null&&r.alternate.memoizedState!==null&&r.alternate.memoizedState.cachePool!==null&&(a=r.alternate.memoizedState.cachePool.pool),o=null,r.memoizedState!==null&&r.memoizedState.cachePool!==null&&(o=r.memoizedState.cachePool.pool),o!==a&&(r.flags|=2048)),n!==e&&n&&(t.child.flags|=8192),Kc(t,t.updateQueue),Jc(t),null);case 4:return he(),e===null&&Vd(t.stateNode.containerInfo),Jc(t),null;case 10:return ta(t.type),Jc(t),null;case 19:if(le(_o),r=t.memoizedState,r===null)return Jc(t),null;if(a=!!(t.flags&128),o=r.rendering,o===null){if(a)qc(r,!1);else{if(su!==0||e!==null&&e.flags&128)for(e=t.child;e!==null;){if(o=vo(e),o!==null){for(t.flags|=128,qc(r,!1),e=o.updateQueue,t.updateQueue=e,Kc(t,e),t.subtreeFlags=0,e=n,n=t.child;n!==null;)gi(n,e),n=n.sibling;return ue(_o,_o.current&1|2),Bi&&Ni(t,r.treeForkCount),t.child}e=e.sibling}r.tail!==null&&je()>vu&&(t.flags|=128,a=!0,qc(r,!1),t.lanes=4194304)}}else{if(!a){if(e=vo(o),e!==null){if(t.flags|=128,a=!0,e=e.updateQueue,t.updateQueue=e,Kc(t,e),qc(r,!0),r.tail===null&&r.tailMode===`hidden`&&!o.alternate&&!Bi)return Jc(t),null}else 2*je()-r.renderingStartTime>vu&&n!==536870912&&(t.flags|=128,a=!0,qc(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)}return r.tail===null?(Jc(t),null):(e=r.tail,r.rendering=e,r.tail=e.sibling,r.renderingStartTime=je(),e.sibling=null,n=_o.current,ue(_o,a?n&1|2:n&1),Bi&&Ni(t,r.treeForkCount),e);case 22:case 23:return go(t),co(),r=t.memoizedState!==null,e===null?r&&(t.flags|=8192):e.memoizedState!==null!==r&&(t.flags|=8192),r?n&536870912&&!(t.flags&128)&&(Jc(t),t.subtreeFlags&6&&(t.flags|=8192)):Jc(t),n=t.updateQueue,n!==null&&Kc(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&&le(wa),null;case 24:return n=null,e!==null&&(n=e.memoizedState.cache),t.memoizedState.cache!==n&&(t.flags|=2048),ta(pa),Jc(t),null;case 25:return null;case 30:return null}throw Error(i(156,t.tag))}function Xc(e,t){switch(Ii(t),t.tag){case 1:return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return ta(pa),he(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 26:case 27:case 5:return _e(t),null;case 31:if(t.memoizedState!==null){if(go(t),t.alternate===null)throw Error(i(340));Ji()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 13:if(go(t),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(i(340));Ji()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return le(_o),null;case 4:return he(),null;case 10:return ta(t.type),null;case 22:case 23:return go(t),co(),e!==null&&le(wa),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 24:return ta(pa),null;case 25:return null;default:return null}}function Zc(e,t){switch(Ii(t),t.tag){case 3:ta(pa),he();break;case 26:case 27:case 5:_e(t);break;case 4:he();break;case 31:t.memoizedState!==null&&go(t);break;case 13:go(t);break;case 19:le(_o);break;case 10:ta(t.type);break;case 22:case 23:go(t),co(),e!==null&&le(wa);break;case 24:ta(pa)}}function Qc(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){cd(t,t.return,e)}}function $c(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){cd(i,c,e)}}}r=r.next}while(r!==a)}}catch(e){cd(t,t.return,e)}}function el(e){var t=e.updateQueue;if(t!==null){var n=e.stateNode;try{ro(t,n)}catch(t){cd(e,e.return,t)}}}function tl(e,t,n){n.props=nc(e.type,e.memoizedProps),n.state=e.memoizedState;try{n.componentWillUnmount()}catch(n){cd(e,t,n)}}function nl(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:r=e.stateNode;break;default:r=e.stateNode}typeof n==`function`?e.refCleanup=n(r):n.current=r}}catch(n){cd(e,t,n)}}function rl(e,t){var n=e.ref,r=e.refCleanup;if(n!==null){if(typeof r==`function`)try{r()}catch(n){cd(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){cd(e,t,n)}else n.current=null}}function il(e){var t=e.type,n=e.memoizedProps,r=e.stateNode;try{a:switch(t){case`button`:case`input`:case`select`:case`textarea`:n.autoFocus&&r.focus();break a;case`img`:n.src?r.src=n.src:n.srcSet&&(r.srcset=n.srcSet)}}catch(t){cd(e,e.return,t)}}function al(e,t,n){try{var r=e.stateNode;tf(r,e.type,n,t),r[mt]=t}catch(t){cd(e,e.return,t)}}function ol(e){return e.tag===5||e.tag===3||e.tag===26||e.tag===27&&vf(e.type)||e.tag===4}function sl(e){a:for(;;){for(;e.sibling===null;){if(e.return===null||ol(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;e.tag!==5&&e.tag!==6&&e.tag!==18;){if(e.tag===27&&vf(e.type)||e.flags&2||e.child===null||e.tag===4)continue a;e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function cl(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?(n.nodeType===9?n.body:n.nodeName===`HTML`?n.ownerDocument.body:n).insertBefore(e,t):(t=n.nodeType===9?n.body:n.nodeName===`HTML`?n.ownerDocument.body:n,t.appendChild(e),n=n._reactRootContainer,n!=null||t.onclick!==null||(t.onclick=sn));else if(r!==4&&(r===27&&vf(e.type)&&(n=e.stateNode,t=null),e=e.child,e!==null))for(cl(e,t,n),e=e.sibling;e!==null;)cl(e,t,n),e=e.sibling}function ll(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?n.insertBefore(e,t):n.appendChild(e);else if(r!==4&&(r===27&&vf(e.type)&&(n=e.stateNode),e=e.child,e!==null))for(ll(e,t,n),e=e.sibling;e!==null;)ll(e,t,n),e=e.sibling}function ul(e){var t=e.stateNode,n=e.memoizedProps;try{for(var r=e.type,i=t.attributes;i.length;)t.removeAttributeNode(i[0]);ef(t,r,n),t[pt]=e,t[mt]=n}catch(t){cd(e,e.return,t)}}var dl=!1,fl=!1,pl=!1,ml=typeof WeakSet==`function`?WeakSet:Set,hl=null;function gl(e,t){if(e=e.containerInfo,af=Dp,e=Pr(e),Fr(e)){if(`selectionStart`in e)var n={start:e.selectionStart,end:e.selectionEnd};else a:{n=(n=e.ownerDocument)&&n.defaultView||window;var r=n.getSelection&&n.getSelection();if(r&&r.rangeCount!==0){n=r.anchorNode;var a=r.anchorOffset,o=r.focusNode;r=r.focusOffset;try{n.nodeType,o.nodeType}catch{n=null;break a}var s=0,c=-1,l=-1,u=0,d=0,f=e,p=null;b:for(;;){for(var m;f!==n||a!==0&&f.nodeType!==3||(c=s+a),f!==o||r!==0&&f.nodeType!==3||(l=s+r),f.nodeType===3&&(s+=f.nodeValue.length),(m=f.firstChild)!==null;)p=f,f=m;for(;;){if(f===e)break b;if(p===n&&++u===a&&(c=s),p===o&&++d===r&&(l=s),(m=f.nextSibling)!==null)break;f=p,p=f.parentNode}f=m}n=c===-1||l===-1?null:{start:c,end:l}}else n=null}n||={start:0,end:0}}else n=null;for(of={focusedElem:e,selectionRange:n},Dp=!1,hl=t;hl!==null;)if(t=hl,e=t.child,t.subtreeFlags&1028&&e!==null)e.return=t,hl=e;else for(;hl!==null;){switch(t=hl,o=t.alternate,e=t.flags,t.tag){case 0:if(e&4&&(e=t.updateQueue,e=e===null?null:e.events,e!==null))for(n=0;n title`))),ef(o,r,n),o[pt]=e,Et(o),r=o;break a;case`link`:var s=sp(`link`,`href`,a).get(r+(n.href||``));if(s){for(var c=0;cg&&(o=g,g=h,h=o);var _=Mr(s,h),v=Mr(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,A.T=null,n=Eu,Eu=null;var o=Su,s=wu;if(xu=0,Cu=Su=null,wu=0,Zl&6)throw Error(i(331));var c=Zl;if(Zl|=4,Kl(o.current),Rl(o,o.current,s,n),Zl=c,Sd(0,!1),Ve&&typeof Ve.onPostCommitFiberRoot==`function`)try{Ve.onPostCommitFiberRoot(Be,o)}catch{}return!0}finally{ie.p=a,A.T=r,id(e,t)}}function sd(e,t,n){t=Ci(n,t),t=cc(e.stateNode,t,2),e=Xa(e,t,2),e!==null&&(rt(e,2),xd(e))}function cd(e,t,n){if(e.tag===3)sd(e,e,n);else for(;t!==null;){if(t.tag===3){sd(t,e,n);break}if(t.tag===1){var r=t.stateNode;if(typeof t.type.getDerivedStateFromError==`function`||typeof r.componentDidCatch==`function`&&(bu===null||!bu.has(r))){e=Ci(n,e),n=lc(2),r=Xa(t,n,2),r!==null&&(uc(n,r,t,e),rt(r,2),xd(r));break}}t=t.return}}function ld(e,t,n){var r=e.pingCache;if(r===null){r=e.pingCache=new Xl;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)||(au=!0,i.add(n),e=ud.bind(null,e,t,n),t.then(e,e))}function ud(e,t,n){var r=e.pingCache;r!==null&&r.delete(t),e.pingedLanes|=e.suspendedLanes&n,e.warmLanes&=~n,Ql===e&&(eu&n)===n&&(su===4||su===3&&(eu&62914560)===eu&&300>je()-gu?!(Zl&2)&&zu(e,0):uu|=n,fu===eu&&(fu=0)),xd(e)}function dd(e,t){t===0&&(t=tt()),e=ci(e,t),e!==null&&(rt(e,t),xd(e))}function fd(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),dd(e,n)}function pd(e,t){var n=0;switch(e.tag){case 31:case 13:var r=e.stateNode,a=e.memoizedState;a!==null&&(n=a.retryLane);break;case 19:r=e.stateNode;break;case 22:r=e.stateNode._retryCache;break;default:throw Error(i(314))}r!==null&&r.delete(t),dd(e,n)}function md(e,t){return De(e,t)}var hd=null,gd=null,_d=!1,vd=!1,yd=!1,bd=0;function xd(e){e!==gd&&e.next===null&&(gd===null?hd=gd=e:gd=gd.next=e),vd=!0,_d||(_d=!0,Od())}function Sd(e,t){if(!yd&&vd){yd=!0;do for(var n=!1,r=hd;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-Ue(42|e)+1)-1,a&=i&~(o&~s),a=a&201326741?a&201326741|1:a?a|2:0}a!==0&&(n=!0,Dd(r,a))}else a=eu,a=Qe(r,r===Ql?a:0,r.cancelPendingCommit!==null||r.timeoutHandle!==-1),!(a&3)||$e(r,a)||(n=!0,Dd(r,a))}r=r.next}while(n);yd=!1}}function Cd(){wd()}function wd(){vd=_d=!1;var e=0;bd!==0&&ff()&&(e=bd);for(var t=je(),n=null,r=hd;r!==null;){var i=r.next,a=Td(r,t);a===0?(r.next=null,n===null?hd=i:n.next=i,i===null&&(gd=n)):(n=r,(e!==0||a&3)&&(vd=!0)),r=i}xu!==0&&xu!==5||Sd(e,!1),bd!==0&&(bd=0)}function Td(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&&nf(d)&&(c=c.responseEnd,o+=u*(c`u`?null:document;function Vf(e,t,n){var r=Bf;if(r&&typeof t==`string`&&t){var i=Gt(t);i=`link[rel="`+e+`"][href="`+i+`"]`,typeof n==`string`&&(i+=`[crossorigin="`+n+`"]`),Ff.has(i)||(Ff.add(i),e={rel:e,crossOrigin:n,href:t},r.querySelector(i)===null&&(t=r.createElement(`link`),ef(t,`link`,e),Et(t),r.head.appendChild(t)))}}function Hf(e){Lf.D(e),Vf(`dns-prefetch`,e,null)}function Uf(e,t){Lf.C(e,t),Vf(`preconnect`,e,t)}function Wf(e,t,n){Lf.L(e,t,n);var r=Bf;if(r&&e&&t){var i=`link[rel="preload"][as="`+Gt(t)+`"]`;t===`image`&&n&&n.imageSrcSet?(i+=`[imagesrcset="`+Gt(n.imageSrcSet)+`"]`,typeof n.imageSizes==`string`&&(i+=`[imagesizes="`+Gt(n.imageSizes)+`"]`)):i+=`[href="`+Gt(e)+`"]`;var a=i;switch(t){case`style`:a=Xf(e);break;case`script`:a=ep(e)}Pf.has(a)||(e=p({rel:`preload`,href:t===`image`&&n&&n.imageSrcSet?void 0:e,as:t},n),Pf.set(a,e),r.querySelector(i)!==null||t===`style`&&r.querySelector(Zf(a))||t===`script`&&r.querySelector(tp(a))||(t=r.createElement(`link`),ef(t,`link`,e),Et(t),r.head.appendChild(t)))}}function Gf(e,t){Lf.m(e,t);var n=Bf;if(n&&e){var r=t&&typeof t.as==`string`?t.as:`script`,i=`link[rel="modulepreload"][as="`+Gt(r)+`"][href="`+Gt(e)+`"]`,a=i;switch(r){case`audioworklet`:case`paintworklet`:case`serviceworker`:case`sharedworker`:case`worker`:case`script`:a=ep(e)}if(!Pf.has(a)&&(e=p({rel:`modulepreload`,href:e},t),Pf.set(a,e),n.querySelector(i)===null)){switch(r){case`audioworklet`:case`paintworklet`:case`serviceworker`:case`sharedworker`:case`worker`:case`script`:if(n.querySelector(tp(a)))return}r=n.createElement(`link`),ef(r,`link`,e),Et(r),n.head.appendChild(r)}}}function Kf(e,t,n){Lf.S(e,t,n);var r=Bf;if(r&&e){var i=Tt(r).hoistableStyles,a=Xf(e);t||=`default`;var o=i.get(a);if(!o){var s={loading:0,preload:null};if(o=r.querySelector(Zf(a)))s.loading=5;else{e=p({rel:`stylesheet`,href:e,"data-precedence":t},n),(n=Pf.get(a))&&ip(e,n);var c=o=r.createElement(`link`);Et(c),ef(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,rp(o,t,r)}o={type:`stylesheet`,instance:o,count:1,state:s},i.set(a,o)}}}function qf(e,t){Lf.X(e,t);var n=Bf;if(n&&e){var r=Tt(n).hoistableScripts,i=ep(e),a=r.get(i);a||(a=n.querySelector(tp(i)),a||(e=p({src:e,async:!0},t),(t=Pf.get(i))&&ap(e,t),a=n.createElement(`script`),Et(a),ef(a,`link`,e),n.head.appendChild(a)),a={type:`script`,instance:a,count:1,state:null},r.set(i,a))}}function Jf(e,t){Lf.M(e,t);var n=Bf;if(n&&e){var r=Tt(n).hoistableScripts,i=ep(e),a=r.get(i);a||(a=n.querySelector(tp(i)),a||(e=p({src:e,async:!0,type:`module`},t),(t=Pf.get(i))&&ap(e,t),a=n.createElement(`script`),Et(a),ef(a,`link`,e),n.head.appendChild(a)),a={type:`script`,instance:a,count:1,state:null},r.set(i,a))}}function Yf(e,t,n,r){var a=(a=j.current)?If(a):null;if(!a)throw Error(i(446));switch(e){case`meta`:case`title`:return null;case`style`:return typeof n.precedence==`string`&&typeof n.href==`string`?(t=Xf(n.href),n=Tt(a).hoistableStyles,r=n.get(t),r||(r={type:`style`,instance:null,count:0,state:null},n.set(t,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=Xf(n.href);var o=Tt(a).hoistableStyles,s=o.get(e);if(s||(a=a.ownerDocument||a,s={type:`stylesheet`,instance:null,count:0,state:{loading:0,preload:null}},o.set(e,s),(o=a.querySelector(Zf(e)))&&!o._p&&(s.instance=o,s.state.loading=5),Pf.has(e)||(n={rel:`preload`,as:`style`,href:n.href,crossOrigin:n.crossOrigin,integrity:n.integrity,media:n.media,hrefLang:n.hrefLang,referrerPolicy:n.referrerPolicy},Pf.set(e,n),o||$f(a,e,n,s.state))),t&&r===null)throw Error(i(528,``));return s}if(t&&r!==null)throw Error(i(529,``));return null;case`script`:return t=n.async,n=n.src,typeof n==`string`&&t&&typeof t!=`function`&&typeof t!=`symbol`?(t=ep(n),n=Tt(a).hoistableScripts,r=n.get(t),r||(r={type:`script`,instance:null,count:0,state:null},n.set(t,r)),r):{type:`void`,instance:null,count:0,state:null};default:throw Error(i(444,e))}}function Xf(e){return`href="`+Gt(e)+`"`}function Zf(e){return`link[rel="stylesheet"][`+e+`]`}function Qf(e){return p({},e,{"data-precedence":e.precedence,precedence:null})}function $f(e,t,n,r){e.querySelector(`link[rel="preload"][as="style"][`+t+`]`)?r.loading=1:(t=e.createElement(`link`),r.preload=t,t.addEventListener(`load`,function(){return r.loading|=1}),t.addEventListener(`error`,function(){return r.loading|=2}),ef(t,`link`,n),Et(t),e.head.appendChild(t))}function ep(e){return`[src="`+Gt(e)+`"]`}function tp(e){return`script[async]`+e}function np(e,t,n){if(t.count++,t.instance===null)switch(t.type){case`style`:var r=e.querySelector(`style[data-href~="`+Gt(n.href)+`"]`);if(r)return t.instance=r,Et(r),r;var a=p({},n,{"data-href":n.href,"data-precedence":n.precedence,href:null,precedence:null});return r=(e.ownerDocument||e).createElement(`style`),Et(r),ef(r,`style`,a),rp(r,n.precedence,e),t.instance=r;case`stylesheet`:a=Xf(n.href);var o=e.querySelector(Zf(a));if(o)return t.state.loading|=4,t.instance=o,Et(o),o;r=Qf(n),(a=Pf.get(a))&&ip(r,a),o=(e.ownerDocument||e).createElement(`link`),Et(o);var s=o;return s._p=new Promise(function(e,t){s.onload=e,s.onerror=t}),ef(o,`link`,r),t.state.loading|=4,rp(o,n.precedence,e),t.instance=o;case`script`:return o=ep(n.src),(a=e.querySelector(tp(o)))?(t.instance=a,Et(a),a):(r=n,(a=Pf.get(o))&&(r=p({},n),ap(r,a)),e=e.ownerDocument||e,a=e.createElement(`script`),Et(a),ef(a,`link`,r),e.head.appendChild(a),t.instance=a);case`void`:return null;default:throw Error(i(443,t.type))}else t.type===`stylesheet`&&!(t.state.loading&4)&&(r=t.instance,t.state.loading|=4,rp(r,n.precedence,e));return t.instance}function rp(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 lp(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 up(e){return!(e.type===`stylesheet`&&!(e.state.loading&3))}function dp(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=Xf(r.href),a=t.querySelector(Zf(i));if(a){t=a._p,typeof t==`object`&&t&&typeof t.then==`function`&&(e.count++,e=mp.bind(e),t.then(e,e)),n.state.loading|=4,n.instance=a,Et(a);return}a=t.ownerDocument||t,r=Qf(r),(i=Pf.get(i))&&ip(r,i),a=a.createElement(`link`),Et(a);var o=a;o._p=new Promise(function(e,t){o.onload=e,o.onerror=t}),ef(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=mp.bind(e),t.addEventListener(`load`,n),t.addEventListener(`error`,n))}}var fp=0;function pp(e,t){return e.stylesheets&&e.count===0&&gp(e,e.stylesheets),0fp?50:800)+t);return e.unsuspend=n,function(){e.unsuspend=null,clearTimeout(r),clearTimeout(i)}}:null}function mp(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)gp(this,this.stylesheets);else if(this.unsuspend){var e=this.unsuspend;this.unsuspend=null,e()}}}var hp=null;function gp(e,t){e.stylesheets=null,e.unsuspend!==null&&(e.count++,hp=new Map,t.forEach(_p,e),hp=null,mp.call(e))}function _p(e,t){if(!(t.state.loading&4)){var n=hp.get(e);if(n)var r=n.get(null);else{n=new Map,hp.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=Ke()}));function Je(e){return e[e.length-1]}function Ye(e,t){return typeof e==`function`?e(t):e}var Xe=Object.prototype.hasOwnProperty,Ze=Object.prototype.propertyIsEnumerable;function Qe(e){for(let t in e)if(Xe.call(e,t))return!0;return!1}var $e=()=>Object.create(null),et=(e,t)=>tt(e,t,$e);function tt(e,t,n=()=>({}),r=0){if(e===t)return e;if(r>500)return t;let i=t,a=at(e)&&at(i);if(!a&&!(rt(e)&&rt(i)))return i;let o=a?e:nt(e);if(!o)return i;let s=a?i:nt(i);if(!s)return i;let c=o.length,l=s.length,u=a?Array(l):n(),d=0;for(let t=0;ti||!ot(e[o],t[o],n)))return!1;return i===a}return!1}function st(e){return typeof e?.message==`string`?e.message.startsWith(`Failed to fetch dynamically imported module`)||e.message.startsWith(`error loading dynamically imported module`)||e.message.startsWith(`Importing a module script failed`):!1}var ct=/[\x00-\x1f\x7f"<>`{}]/g;function lt(e){return e.replace(ct,e=>`%`+e.charCodeAt(0).toString(16).toUpperCase().padStart(2,`0`))}function ut(e){let t;try{t=decodeURI(e)}catch{t=e.replaceAll(/%[0-9A-F]{2}/gi,e=>{try{return decodeURI(e)}catch{return e}})}return lt(t)}var dt=[`http:`,`https:`,`mailto:`,`tel:`];function ft(e,t){if(!e)return!1;try{let n=new URL(e);return!t.has(n.protocol)}catch{return!1}}function pt(e){if(!e||!/[%\\\x00-\x1f\x7f]/.test(e)&&!e.startsWith(`//`))return{path:e,handledProtocolRelativeURL:!1};let t=/%25|%5C/gi,n=0,r=``,i;for(;(i=t.exec(e))!==null;)r+=ut(e.slice(n,i.index))+i[0],n=t.lastIndex;r+=ut(n?e.slice(n):e);let a=!1;return r.startsWith(`//`)&&(a=!0,r=`/`+r.replace(/^\/+/,``)),{path:r,handledProtocolRelativeURL:a}}function mt(e){return/\s|[^\u0000-\u007F]/.test(e)?e.replace(/\s|[^\u0000-\u007F]/gu,encodeURIComponent):e}function ht(e,t){if(e===t)return!0;if(e.length!==t.length)return!1;for(let n=0;n{e.next&&(e.prev?(e.prev.next=e.next,e.next.prev=e.prev,e.next=void 0,r&&(r.next=e,e.prev=r)):(e.next.prev=void 0,n=e.next,e.next=void 0,r&&(e.prev=r,r.next=e)),r=e)};return{get(e){let n=t.get(e);if(n)return i(n),n.value},set(a,o){if(t.size>=e&&n){let e=n;t.delete(e.key),e.next&&(n=e.next,e.next.prev=void 0),e===r&&(r=void 0)}let s=t.get(a);if(s)s.value=o,i(s);else{let e={key:a,value:o,prev:r};r&&(r.next=e),r=e,n||=e,t.set(a,e)}},clear(){t.clear(),n=void 0,r=void 0}}}var vt=4,yt=5;function bt(e,t,n=new Uint16Array(6)){let r=e.indexOf(`/`,t),i=r===-1?e.length:r,a=e.substring(t,i);if(!a||!a.includes(`$`))return n[0]=0,n[1]=t,n[2]=t,n[3]=i,n[4]=i,n[5]=i,n;if(a===`$`){let r=e.length;return n[0]=2,n[1]=t,n[2]=t,n[3]=r,n[4]=r,n[5]=r,n}if(a.charCodeAt(0)===36)return n[0]=1,n[1]=t,n[2]=t+1,n[3]=i,n[4]=i,n[5]=i,n;let o=a.indexOf(`{`),s;if(o!==-1&&o+1!e.parse&&e.caseSensitive===p&&e.prefix===t&&e.suffix===c);if(h)n=h;else{let e=wt(f,r,p,t,c);n=e,e.parent=i,e.depth=a;let s;s=f===1?i.dynamic??=[]:f===3?i.optional??=[]:i.wildcard??=[],s.push(e),s.length===2&&o?.push(s)}break}}i=n}if(d&&n.children&&!n.isRoot&&n.id&&n.id.charCodeAt(n.id.lastIndexOf(`/`)+1)===95){let e=Ct(r);e.kind=yt,e.parent=i,a++,e.depth=a,i.pathless??=[],i.pathless.push(e),i=e}let f=(n.path||!n.children)&&!n.isRoot;if(f&&r.endsWith(`/`)){let e=Ct(r);e.kind=vt,e.parent=i,a++,e.depth=a,i.index=e,i=e}i.parse=d??null,i.priority=s?.params?.priority??0,f&&!i.route&&(i.route=n,i.fullPath=r)}if(n.children)for(let r of n.children)xt(e,t,r,c,i,a,o,s)}function St(e,t){if(e.parse&&!t.parse)return-1;if(!e.parse&&t.parse)return 1;if(e.parse&&t.parse&&(e.priority||t.priority))return t.priority-e.priority;if(e.prefix&&t.prefix&&e.prefix!==t.prefix){if(e.prefix.startsWith(t.prefix))return-1;if(t.prefix.startsWith(e.prefix))return 1}if(e.suffix&&t.suffix&&e.suffix!==t.suffix){if(e.suffix.endsWith(t.suffix))return-1;if(t.suffix.endsWith(e.suffix))return 1}return e.prefix&&!t.prefix?-1:!e.prefix&&t.prefix?1:e.suffix&&!t.suffix?-1:!e.suffix&&t.suffix?1:e.caseSensitive&&!t.caseSensitive?-1:!e.caseSensitive&&t.caseSensitive?1:0}function Ct(e){return{kind:0,depth:0,pathless:null,index:null,static:null,staticInsensitive:null,dynamic:null,optional:null,wildcard:null,route:null,fullPath:e,parent:null,parse:null,priority:0}}function wt(e,t,n,r,i){return{kind:e,depth:0,pathless:null,index:null,static:null,staticInsensitive:null,dynamic:null,optional:null,wildcard:null,route:null,fullPath:t,parent:null,parse:null,priority:0,caseSensitive:n,prefix:r,suffix:i}}function Tt(e,t){let n=Ct(`/`),r=new Uint16Array(6),i=[];for(let t of e)xt(!1,r,t,1,n,0,i);for(let e of i)e.sort(St);t.masksTree=n,t.flatCache=_t(1e3)}function Et(e,t){e||=`/`;let n=t.flatCache.get(e);if(n!==void 0)return n;let r=jt(e,t.masksTree);return t.flatCache.set(e,r),r}function Dt(e,t,n,r,i){e||=`/`,r||=`/`;let a=t?`case\0${e}`:e,o=i.singleCache.get(a);return o||(o=Ct(`/`),xt(t,new Uint16Array(6),{from:e},1,o,0),i.singleCache.set(a,o)),jt(r,o,n)}function Ot(e,t,n=!1){let r=n?e:`nofuzz\0${e}`,i=t.matchCache.get(r);if(i!==void 0)return i;e||=`/`;let a;try{a=jt(e,t.segmentTree,n)}catch(e){if(e instanceof URIError)a=null;else throw e}return a&&(a.branch=Nt(a.route)),t.matchCache.set(r,a),a}function kt(e){return e===`/`?e:e.replace(/\/{1,}$/,``)}function At(e,t=!1,n){let r=Ct(e.fullPath),i=new Uint16Array(6),a=[],o={},s={},c=0;xt(t,i,e,1,r,0,a,e=>{if(n?.(e,c),e.id in o&>(),o[e.id]=e,c!==0&&e.path){let t=kt(e.fullPath);(!s[t]||e.fullPath.endsWith(`/`))&&(s[t]=e)}c++});for(let e of a)e.sort(St);return{processedTree:{segmentTree:r,singleCache:_t(1e3),matchCache:_t(1e3),flatCache:null,masksTree:null},routesById:o,routesByPath:s}}function jt(e,t,n=!1){let r=e.split(`/`),i=Ft(e,r,t,n);if(!i)return null;let[a]=Mt(e,r,i);return{route:i.node.route,rawParams:a}}function Mt(e,t,n){let r=Pt(n.node),i=null,a=Object.create(null),o=n.extract?.part??0,s=n.extract?.node??0,c=n.extract?.path??0,l=n.extract?.segment??0;for(;s=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===vt)>(e.node.kind===vt)||t.node.kind===vt==(e.node.kind===vt)&&t.node.depth>e.node.depth)))}function Bt(e){return Vt(e.filter(e=>e!==void 0).join(`/`))}function Vt(e){return e.replace(/\/{2,}/g,`/`)}function Ht(e){return e===`/`?e:e.replace(/^\/{1,}/,``)}function Ut(e){let t=e.length;return t>1&&e[t-1]===`/`?e.replace(/\/{1,}$/,``):e}function Wt(e){return Ut(Ht(e))}function Gt(e,t){return e?.endsWith(`/`)&&e!==`/`&&e!==`${t}/`?e.slice(0,-1):e}function Kt(e,t,n){return Gt(e,n)===Gt(t,n)}function qt({base:e,to:t,trailingSlash:n=`never`,cache:r}){if(t.includes(`//`)&&(t=Vt(t)),t.startsWith(`/`))return t.length===1||n===`preserve`?t:n===`always`?t.endsWith(`/`)?t:`${t}/`:t.endsWith(`/`)?t.slice(0,-1):t;let i=t===`.`,a;if(r){a=i?e:e+`\0`+t;let n=r.get(a);if(n)return n}let o;if(i)o=e.split(`/`);else{for(e.includes(`//`)&&(e=Vt(e)),o=e.split(`/`);o.length>1&&Je(o)===``;)o.pop();let n=t.split(`/`);for(let e=0,t=n.length;e1?o.pop():o=[``]:r===`.`||o.push(r)}}o.length>1&&(Je(o)===``?n===`never`&&o.pop():n===`always`&&o.push(``));let s=o.join(`/`),c=(i?Vt(s):s)||`/`;return a&&r&&r.set(a,c),c}function Jt(e){let t=new Map(e.map(e=>[encodeURIComponent(e),e])),n=Array.from(t.keys()).map(e=>e.replace(/[.*+?^${}()|[\]\\]/g,`\\$&`)).join(`|`),r=new RegExp(n,`g`);return e=>e.replace(r,e=>t.get(e)??e)}function Yt(e,t,n){let r=t[e];return typeof r==`string`?e===`_splat`?/^[a-zA-Z0-9\-._~!/]*$/.test(r)?r:r.split(`/`).map(e=>Zt(e,n)).join(`/`):Zt(r,n):r}function Xt({path:e,params:t,decoder:n,...r}){let i=!1,a=Object.create(null);if(!e||e===`/`)return{interpolatedPath:`/`,usedParams:a,isMissingParams:i};if(!e.includes(`$`))return{interpolatedPath:e,usedParams:a,isMissingParams:i};let o=e.length,s=0,c,l=``;for(;se.state.__TSR_key||e.href;function cn(e){let t=e.getAttribute(on);if(t)return`[${on}="${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 ln=!1,un=`window`;function dn(e){try{return typeof e==`function`?e():document.querySelector(e)}catch{}}function fn(e){let t=new Set;for(let n of e){if(n===un)continue;let e=dn(n);e&&t.add(e)}return t}function pn(e,t){let n=t??e.options.scrollRestoration,r=e._scroll;n&&(r.restoring=!0);let i=e.options.getScrollRestorationKey||sn,a=new Set,o=e=>{let t=an[e]||={};for(let e of a)e===document?t[un]={scrollX,scrollY}:e.isConnected&&(t[cn(e)]={scrollX:e.scrollLeft,scrollY:e.scrollTop})};n&&!r.restoration&&(r.restoration=!0,ln=!1,history.scrollRestoration=`manual`,document.addEventListener(`scroll`,e=>{ln||a.add(e.target)},!0),e.subscribe(`onBeforeLoad`,e=>{e.fromLocation&&o(i(e.fromLocation)),a.clear()}),addEventListener(`pagehide`,()=>{o(i(e.stores.resolvedLocation.get()??e.stores.location.get())),rn()})),!r.reset&&(r.reset=!0,e.subscribe(`onRendered`,t=>{let n=e.options.scrollRestorationBehavior,o=e.options.scrollToTopSelectors,s=r.next,c=r.hash,l;if(a.clear(),r.next=!0,r.hash=!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.restoring&&d&&d!==u){let e=an[d];if(e){let t=an[u];for(let n in e){if(n===un){if(s)continue}else{let e=dn(n);if(!e||s&&o&&(l??=fn(o),l.has(e)))continue}t||=an[u]={},t[n]??=e[n]}}}ln=!0;try{let e=t.toLocation.hash,i=t.toLocation.state.__hashScrollIntoViewOptions??!0,a=!1;if(s){!e&&o&&(l??=fn(o));let t=e&&i&&c,s=r.restoring?an[u]:void 0;if(s)for(let e in s){let{scrollX:r,scrollY:i}=s[e];if(e===un){if(t)continue;scrollTo({top:i,left:r,behavior:n}),a=!0}else{let t=dn(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{ln=!1}}))}function mn(e,t=String){let n=new URLSearchParams;for(let r in e){let i=e[r];i!==void 0&&n.set(r,t(i))}return n.toString()}function hn(e){return e?e===`false`?!1:e===`true`?!0:e*0==0&&+e+``===e?+e:e:``}function gn(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]=hn(r):Array.isArray(t)?t.push(hn(r)):n[e]=[t,hn(r)]}return n}var _n=/^(?:\s|["[{\d-]|fa|nu|tr)/,vn=bn(JSON.parse),yn=xn(JSON.stringify,JSON.parse);function bn(e){return t=>{t[0]===`?`&&(t=t.substring(1));let n=gn(t);for(let t in n){let r=n[t];if(typeof r==`string`)try{n[t]=e(r)}catch{}}return n}}function xn(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&&!_n.test(r))return r;try{return t(r),e(r)}catch{}}return r}return e=>{let t=mn(e,r);return t?`?${t}`:``}}var Sn=`__root__`;function Cn(e){if(e.statusCode=e.statusCode||e.code||307,!e.reloadDocument&&typeof e.href==`string`)try{new URL(e.href),e.reloadDocument=!0}catch{}let t=new Headers(e.headers);e.href&&t.get(`Location`)===null&&t.set(`Location`,e.href);let n=new Response(null,{status:e.statusCode,headers:t});if(n.options=e,e.throw)throw n;return n}function wn(e){return e instanceof Response&&!!e.options}function Tn(e){return{input:({url:t})=>{for(let n of e)t=Dn(n,t);return t},output:({url:t})=>{for(let n=e.length-1;n>=0;n--)t=On(e[n],t);return t}}}function En(e){let t=Wt(e.basepath),n=`/${t}`,r=e.caseSensitive?n:n.toLowerCase(),i=`${r}/`;return{input:({url:t})=>{let a=e.caseSensitive?t.pathname:t.pathname.toLowerCase();return a===r?t.pathname=`/`:a.startsWith(i)&&(t.pathname=t.pathname.slice(n.length)),t},output:({url:e})=>(e.pathname=Bt([`/`,t,e.pathname]),e)}}function Dn(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 On(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 kn(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(()=>{ht(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 An=`__TSR_index`,jn=`popstate`,Mn=`beforeunload`;function Nn(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=Ln(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[An];i=Pn(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[An];i=Pn(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),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[An]!==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}}function Pn(e,t){t||={};let n=Rn();return{...t,key:n,__TSR_key:n,[An]:e}}function Fn(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=e?.createHref??(e=>e),c=e?.parseLocation??(()=>Ln(`${t.location.pathname}${t.location.search}${t.location.hash}`,t.history.state));if(!t.history.state?.__TSR_key&&!t.history.state?.key){let e=Rn();t.history.replaceState({[An]:0,key:e,__TSR_key:e},``)}let l=c(),u,d=!1,f=!1,p=!1,m=!1,h=()=>l,g,_=()=>{g&&(S._ignoreSubscribers=!0,(g[2]?t.history.pushState:t.history.replaceState)(g[1],``,g[0]),S._ignoreSubscribers=!1,g=void 0,u=void 0)},v=(e,t,n)=>{let r=s(t),i=!!g;i||(u=l),l=Ln(t,n),g=[r,n,g?.[2]||e],i||queueMicrotask(()=>_())},y=e=>{l=c(),S.notify({type:e})},b=async()=>{if(f){f=!1;return}let e=c(),n=e.state[An]-l.state[An],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 n=a();if(typeof document<`u`&&n.length){for(let r of n)if(await r.blockerFn({currentLocation:l,nextLocation:e,action:s})){f=!0,t.history.go(1),S.notify(u);return}}}l=c(),S.notify(u)},x=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=``},S=Nn({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=>{d=!0,t.history.go(e)},createHref:e=>s(e),flush:_,destroy:()=>{t.history.pushState=n,t.history.replaceState=r,t.removeEventListener(Mn,x,{capture:!0}),t.removeEventListener(jn,b)},onBlocked:()=>{u&&l!==u&&(l=u)},getBlockers:a,setBlockers:o,notifyOnIndexChange:!1});return t.addEventListener(Mn,x,{capture:!0}),t.addEventListener(jn,b),t.history.pushState=function(...e){let r=n.apply(t.history,e);return S._ignoreSubscribers||y(`PUSH`),r},t.history.replaceState=function(...e){let n=r.apply(t.history,e);return S._ignoreSubscribers||y(`REPLACE`),n},S}function In(e){let t=e.replace(/[\x00-\x1f\x7f]/g,``);return t.startsWith(`//`)&&(t=`/`+t.replace(/^\/+/,``)),t}function Ln(e,t){let n=In(e),r=n.indexOf(`#`),i=n.indexOf(`?`),a=Rn();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||{[An]:0,key:a,__TSR_key:a}}}function Rn(){return(Math.random()+1).toString(36).substring(7)}function zn(e){return e.options.loader||e.options.beforeLoad||e.lazyFn||e.options.component?.preload||e.options.pendingComponent?.preload}function Bn(e,t){return{fromLocation:t,toLocation:e,pathChanged:t?.pathname!==e.pathname,hrefChanged:t?.href!==e.href,hashChanged:t?.hash!==e.hash}}function Vn({key:e,__TSR_key:t,__TSR_index:n,__hashScrollIntoViewOptions:r,...i}){return i}function Hn(e,t,n,r){for(let i of t){if(r&&e._tx!==r)return;n.some(e=>e.routeId===i.routeId)||e.routesById[i.routeId].options.onLeave?.(i)}for(let i of n){if(r&&e._tx!==r)return;e.routesById[i.routeId].options[t.some(e=>e.routeId===i.routeId)?`onStay`:`onEnter`]?.(i)}}var Un=class{constructor(e,t){this.tempLocationKey=`${Math.round(Math.random()*1e7)}`,this._scroll={next:!0},this.subscribers=new Set,this._cache=new Map,this._committed=[],this.routeBranchCache=new WeakMap,this.lightweightCache=new WeakMap,this.startTransition=async e=>(e(),!1),this.update=e=>{let t=this.options,n=this.basepath??t?.basepath??`/`,r=this.basepath===void 0,i=t?.rewrite;if(this.options={...t,...e},this.isServer=this.options.isServer??!1??typeof document>`u`,this.protocolAllowlist=new Set(this.options.protocolAllowlist),this.options.pathParamsAllowedCharacters&&(this.pathParamsDecoder=Jt(this.options.pathParamsAllowedCharacters)),(!this.history||this.options.history&&this.options.history!==this.history)&&(this.history=this.options.history?this.options.history:Fn()),this.origin=this.options.origin,this.origin||=window?.origin&&window.origin!==`null`?window.origin:`http://localhost`,this.history&&this.updateLatestLocation(),this.options.routeTree!==this.routeTree){this.routeTree=this.options.routeTree;let e;this.resolvePathCache=_t(1e3),e=this.buildRouteTree(),this.setRoutes(e)}if(!this.stores&&this.latestLocation){let e=this.getStoreConfig(this);this.batch=e.batch,this.stores=kn(this.latestLocation,e),pn(this)}let a=this.options.basepath??`/`,o=this.options.rewrite;if(r||n!==a||i!==o){this.basepath=a;let e=[],t=Wt(a);t&&t!==`/`&&e.push(En({basepath:a})),o&&e.push(o),this.rewrite=e.length===0?void 0:e.length===1?e[0]:Tn(e),this.history&&this.updateLatestLocation(),this.stores&&this.stores.location.set(this.latestLocation)}},this.updateLatestLocation=()=>{this.latestLocation=this.parseLocation(this.history.location,this.latestLocation)},this.buildRouteTree=()=>{let e=At(this.routeTree,this.options.caseSensitive,(e,t)=>{e.init({originalIndex:t})});return this.options.routeMasks&&Tt(this.options.routeMasks,e.processedTree),e},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,state: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:pt(e).path,external:!1,searchStr:o,search:et(t?.search,i),hash:pt(r.slice(1)).path,state:tt(t?.state,a)}}let o=new URL(i,this.origin),s=Dn(this.rewrite,o),c=this.options.parseSearch(s.search),l=this.options.stringifySearch(c);return s.search=l,{href:s.href.replace(s.origin,``),publicHref:i,pathname:pt(s.pathname).path,external:!!this.rewrite&&s.origin!==this.origin,searchStr:l,search:et(t?.search,c),hash:pt(s.hash.slice(1)).path,state:tt(t?.state,a)}},r=n(e),{__tempLocation:i,__tempKey:a}=r.state;if(i&&(!a||a===this.tempLocationKey)){let e=n(i);return e.state.key=r.state.key,e.state.__TSR_key=r.state.__TSR_key,delete e.state.__tempLocation,{...e,maskedLocation:r}}return r},this.resolvePathWithBase=(e,t)=>qt({base:e,to:t,trailingSlash:this.options.trailingSlash,cache:this.resolvePathCache}),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=Ot(Ut(e),this.processedTree,!0);return n&&Object.assign(t,n.rawParams),[n?.branch||[this.routesById.__root__],t,n?.route]},this.buildLocation=e=>{let t=(t={})=>{if(t.href){let e=Ln(t.href,{});t={...t,to:Dn(this.rewrite,new URL(e.pathname,this.origin)).pathname,search:this.options.parseSearch(e.search),hash:e.hash.slice(1)}}let n=t._fromLocation||this._pendingLocation||this.latestLocation,r=this.matchRoutesLightweight(n);t.from;let i=t.unsafeRelative===`path`?n.pathname:t.from??r[1],a=r[2],o=r[3],s=this.resolvePathWithBase(i,t.to?`${t.to}`:`.`),c=Yn(t.params,o),l=this.routesByPath[Ut(s)],u;if(l)u=this.getRouteBranch(l);else if(s.includes(`$`))u=[];else{let[e,t,n]=this.getMatchedRoutes(s);u=e,this.options.notFoundRoute&&(!n||n.path!==`/`&&t[`**`])&&(u=[...u,this.options.notFoundRoute])}if(u.length&&Qe(c))for(let e of u){let t=e.options.params?.stringify??e.options.stringifyParams;if(t){c===o&&(c=Object.assign(Object.create(null),c));try{Object.assign(c,t(c))}catch{}}}let d=e.leaveParams?s:pt(Xt({path:s,params:c,decoder:this.pathParamsDecoder,server:this.isServer}).interpolatedPath).path,f=a;if(e._includeValidateSearch&&this.options.search?.strict){let e={};u.forEach(t=>{if(t.options.validateSearch)try{Object.assign(e,Kn(t.options.validateSearch,{...e,...f}))}catch{}}),f=e}f=qn(f,t,u,e._includeValidateSearch),f=et(a,f);let p=this.options.stringifySearch(f),m=t.hash===!0?n.hash:t.hash?Ye(t.hash,n.hash):void 0,h=m?`#${m}`:``,g=t.state===!0?n.state:t.state?Ye(t.state,n.state):{};t.state&&(g=tt(n.state,g));let _=`${d}${p}${h}`,v,y,b=!1;if(this.rewrite){let e=new URL(_,this.origin),t=On(this.rewrite,e);v=e.href.replace(e.origin,``),t.origin===this.origin?y=t.pathname+t.search+t.hash:(y=t.href,b=!0)}else v=mt(_),y=v;return{publicHref:y,href:v,pathname:d,search:f,searchStr:p,state:g,hash:m??``,external:b,unmaskOnReload:t.unmaskOnReload}},n=t(e);if(e.mask)n.maskedLocation=t({from:e.from,...e.mask});else if(this.options.routeMasks){let r=Et(n.pathname,this.processedTree);if(r){let i=Object.assign(Object.create(null),r.rawParams),{from:a,params:o,...s}=r.route,c=Yn(o,i);n.maskedLocation=t({from:e.from,...s,params:c})}}return n},this.commitLocation=async({viewTransition:e,ignoreBlocker:t,...n})=>{let r,i=Ut(this.latestLocation.href)===Ut(n.href)&&ot(Vn(n.state),Vn(this.latestLocation.state)),a=this._commitPromise,o,s=new Promise(e=>{o=e});if(s.resolve=()=>{o(),a?.resolve()},this._commitPromise=s,i)this.load();else{let{maskedLocation:i,hashScrollIntoView:a,...o}=n;i&&(o={...i,state:{...i.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.__hashScrollIntoViewOptions=a??this.options.defaultHashScrollIntoView??!0,this.shouldViewTransition=e,r=n.replace?`REPLACE`:`PUSH`,this.history[r===`REPLACE`?`replace`:`push`](o.publicHref,o.state,{ignoreBlocker:t}),this.history.subscribers.size||this.load({action:{type:r}})}return this._scroll.next=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=!1;if(n)try{new URL(`${n}`),a=!0}catch{}if(a&&!t&&(t=!0),t){if(e!==void 0||!n){let t=this.buildLocation({to:e,...i});n??=t.publicHref,r??=t.publicHref}let t=!a&&r?r:n;if(ft(t,this.protocolAllowlist))return;if(!i.ignoreBlocker){let e=this.history.getBlockers?.()??[];for(let t of e)if(t?.blockerFn&&await t.blockerFn({currentLocation:this.latestLocation,nextLocation:this.latestLocation,action:`PUSH`}))return}i.replace?window.location.replace(t):window.location.href=t;return}return this.buildAndCommitLocation({...i,href:n,to:e,_isNavigate:!0})},this.load=async e=>{this.updateLatestLocation(),e?.action&&(this._scroll.hash=e.action.type===`PUSH`||e.action.type===`REPLACE`),await Br(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(Bn(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([...t,...this._cache.values(),...[...r?.values()??[]].flat(),...this._tx?.[3]??[]].filter(e=>!n||n(e)).map(e=>e.id)),a=[];for(let[e,t]of r??[])t.some(e=>i.has(e.id))&&(r.delete(e),a.push(e));let o=t=>{if(i.has(t.id)){let n=this.routesById[t.routeId],r={...t,invalid:!0,...(e?.forcePending||t.status===`error`||t.status===`notFound`)&&zn(n)?{status:`pending`,error:void 0}:void 0};return t._flight=void 0,r}return t};this._committed=t.map(o);for(let[t,n]of this._cache)i.has(t)&&(n.invalid=!0,e?.forcePending&&(n.status=`pending`));for(let e of i)this._flights?.delete(e);for(let e of a)e.abort();return this.shouldViewTransition=!1,this.load({sync:e?.sync})},this.resolveRedirect=e=>{let t=e.headers.get(`Location`);if(!e.options.href){let t=this.buildLocation(e.options).publicHref||`/`;e.options.href=t,e.headers.set(`Location`,t)}else if(t)try{let n=new URL(t);if(this.origin&&n.origin===this.origin){let t=n.pathname+n.search+n.hash;e.options.href=t,e.headers.set(`Location`,t)}}catch{}if(e.options.href&&ft(e.options.href,this.protocolAllowlist))throw Error(`Redirect blocked: unsafe protocol`);return e.headers.get(`Location`)||e.headers.set(`Location`,e.options.href),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=$n,this.preloadRoute=e=>Vr(this,e),this.matchRoute=(e,t)=>{let n={...e,to:e.to?this.resolvePathWithBase(e.from||``,e.to):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=Dt(r.pathname,t?.caseSensitive??!1,t?.fuzzy??!1,a.pathname,this.processedTree);return!o||e.params&&!ot(o.rawParams,e.params,{partial:!0})?!1:t?.includeSearch??!0?ot(a.search,r.search,{partial:!0})?o.rawParams:!1:o.rawParams},this.getStoreConfig=t,this.update({defaultPreloadDelay:50,defaultPendingMs:1e3,defaultPendingMinMs:500,context:void 0,...e,caseSensitive:e.caseSensitive??!1,notFoundMode:e.notFoundMode??`fuzzy`,stringifySearch:e.stringifySearch??yn,parseSearch:e.parseSearch??vn,protocolAllowlist:e.protocolAllowlist??dt}),self.__TSR_ROUTER__=this}isShell(){return!!this.options.isShell}get state(){return this.stores.__store.get()}setRoutes({routesById:e,routesByPath:t,processedTree:n}){this.routesById=e,this.routesByPath=t,this.processedTree=n;let r=this.options.notFoundRoute;r&&(r.init({originalIndex:99999999999}),this.routesById[r.id]=r)}getRouteBranch(e){let t=this.routeBranchCache.get(e);return t||(t=Nt(e),this.routeBranchCache.set(e,t)),t}matchRoutesInternal(e,t){let[n,r,i]=this.getMatchedRoutes(e.pathname),a=n,o=!1;(i?i.path!==`/`&&r[`**`]:Ut(e.pathname))&&(this.options.notFoundRoute?a=[...a,this.options.notFoundRoute]:o=!0);let s=o?Jn(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;n{let r=n(t.preSearchFilters?t.preSearchFilters.reduce((e,t)=>t(e),e):e);return t.postSearchFilters?t.postSearchFilters.reduce((e,t)=>t(e),r):r});let n=t.validateSearch;r&&n&&i.push(({search:e,next:t,meta:r})=>{let i=t(e);try{let e=Kn(n,i);if(r&&e)for(let t in e)t in i||(r.defaulted||=new Map).set(t,e[t]);return{...i,...e}}catch{}return i})}let a=(e,n,r)=>{if(e>=i.length){if(!t.search)return{};if(t.search===!0)return n;let e=Ye(t.search,n);return r&&(r.explicit=e),e}return i[e]({search:n,next:(t,n)=>{if(n){let n=r||{};return{search:a(e+1,t,n),meta:n}}return a(e+1,t,r)},meta:r})};return a(0,e)}function Jn(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 Sn}function Yn(e,t){if(e===!1||e===null)return Object.create(null);if((e??!0)===!0)return t;let n=Object.assign(Object.create(null),t);return Object.assign(n,Ye(e,n))}function Xn(e,t){let n=e.options.params?.parse??e.options.parseParams;n&&Object.assign(t,n(t))}function Zn(e,t){return e.options[t]?.preload?.()}function Qn(e,t){let n=Zn(e,`component`),r=Zn(e,`pendingComponent`);return t&&(r?r=r.then(t):t()),n&&r?Promise.all([n,r]).then(()=>{}):n??r}function $n(e,t,n){let r=()=>t===!1?void 0:t?Zn(e,t):Qn(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 er(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).finally(()=>t.removeEventListener(`abort`,i))})}function cr(e,t){return e.routesById[t.routeId]}function lr(e,t,n){return wn(e)?[ir,e]:Qt(e)?(e.routeId||=n,[rr,e]):t?(typeof e?.then==`function`&&(e=Error(`A Promise was thrown`,{cause:e})),[nr,e]):[tr,e]}function ur(e,t){let n=lr(t,!0,e.id);if(n[0]!==nr)return n;try{e.options.onError?.(n[1])}catch(t){n=lr(t,!0,e.id)}return n}function dr(e,t,n,r,i){return i[0].signal.aborted?ar:Dr(e,t,n,ur(n,r),i)}async function fr(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 mr(e,r),[i,dr(e,t,u,a,n)]}if(c.aborted)return[i,ar];let p=r.paramsError??r.searchError;if(p!==void 0)return mr(e,r),[i,dr(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{_r(e,r,`beforeLoad`,n[0]);let a=await sr(m({...f,search:r.search,context:r.context,...e.options.additionalContext}),c);if(c.aborted)return[i,ar];let o=Dr(e,t,u,lr(a,!1,u.id),n);if(o[0]!==tr)return mr(e,r),[i,o];r.context={...r.context,...a}}catch(a){return mr(e,r),[i,dr(e,t,u,a,n)]}finally{r.status=h,_r(e,r,!1,n[0])}}i()}function pr(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 mr(e,t){let n=t._flight;t._flight=void 0,pr(e,t,n)?.abort()}function hr(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=pr(e,a,t);n&&i.push(n)}}for(let e of i)e.abort()}function gr(e){for(let t of e){let e=t._flight;e&&e[2]++}}function _r(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 vr(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 yr(e,t,n,r,i,a,o){let s=o[0],c=s.signal;if(c.aborted)return ar;if(!i)return[tr,void 0];let l=n._flight;_r(e,n,`loader`,s);try{if(!l){let s=new AbortController;l=[Promise.resolve().then(()=>i(vr(e,t,n,r,s,a,!!o[3]))).then(e=>lr(e,!1,r.id),e=>lr(e,!0,r.id)).then(t=>(t[0]!==tr&&e._flights?.get(n.id)===l&&(e._flights.delete(n.id),l[2]||s.abort()),t[0]===nr&&l[2]?ur(r,t[1]):t)),s,1],(e._flights??=new Map).set(n.id,l)}return n._flight=l,n.abortController=l[1],Dr(e,t,r,await sr(l[0],c),o)}catch(t){if(t!==c||!c.aborted)throw t;return mr(e,n),ar}finally{_r(e,n,!1,s)}}function br(e,t,n){t[0]!==ir&&(e.status=`success`,e.error=void 0,t[0]===tr?(e.loaderData=t[1],e.invalid=!1,e.updatedAt=Date.now(),e.preload=n):e.invalid=!0)}function xr(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&&mr(e,r)}function Sr(e,t){return t[0]===nr||t[0]===rr?{...e,status:t[0]===nr?`error`:`notFound`,error:t[1],_flight:void 0}:e}function Cr(e,t,n,r,i,a,o){let s=t[1][n],c=cr(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(vr(e,t,s,c,a[0],i,l))),a[0].signal.aborted&&(p=ar)),!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,mr(e,s),p=dr(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&&_,x=b&&!y&&(s.status!==`success`||!!m),S=n>=o?a[7]:void 0,C=c.lazyFn&&c._lazy!==!0?S:void 0;if(b&&!m&&(s.invalid=!1,s.updatedAt=Date.now()),v&&v[2]++,x){let t=s._flight;s._flight=v,pr(e,s,t)?.abort(),n>=o&&(s.status=`pending`),S?.()}b||(s.isFetching=!1);let w=(p?Promise.resolve(p):x?yr(e,t,s,c,g,i,a):Promise.resolve([tr,s.loaderData])).then(t=>(x&&(br(s,t,l),t[0]===tr&&(m&&!a[0].signal.aborted&&xr(e,s,u),n>=o&&(s.status=`pending`))),t)),T=sr(Promise.resolve().then(()=>$n(c,void 0,C)),a[0].signal).then(()=>void 0,r=>t[1].some((e,t)=>t<=n&&(e.status===`error`||e.status===`notFound`||e._notFound))?void 0:[n,dr(e,t,c,r,a)]).then(e=>w.then(t=>(x&&!e&&t[0]===tr&&s.status===`pending`&&!a[0].signal.aborted&&(s.status=`success`,S?.()),e)));if(r.push([n,w,T]),!y)return w.then(e=>Sr(s,e));let E={...s,status:`pending`,preload:!1,_flight:v};s.invalid=!1,s.isFetching=`loader`;let D=yr(e,t,E,c,g,i,a).then(e=>(s.isFetching=!1,br(E,e,!1),e));return(t[2]??=[]).push([n,D,T,E]),D.then(e=>Sr(E,e))}async function wr(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=cr(e,t[n]);try{let e=$n(i,!1);e&&await sr(e,r)}catch(e){if(e===r&&r.aborted)throw e}if(i.options.notFoundComponent)return n}return a?.routeId?o:i}function Tr(e,t){t[2]&&=(hr(e,t[2].map(e=>e[3])),void 0)}async function Er(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]>=ir)throw[a,t];!i&&t[0]!==tr&&(i=[a,t],await Promise.all((n??[]).map(e=>{if(!(e[0]<=a))return e[1].then(t=>{if(t[0]===ir)throw[e[0],t]})})))}})))}catch(e){return e}return t??i}function Dr(e,t,n,r,i,a){for(;r[0]===ir;){let o=r[1],s=o.options;if(s.reloadDocument?i[3]:i[1]>=20)return r;try{return s.href&&s.reloadDocument?(e.resolveRedirect(o),r):[ir,o,e.buildLocation({...s,_fromLocation:t[0],_includeValidateSearch:!0})]}catch(e){r=a?[nr,e]:ur(n,e),a=!0}}return r}async function Or(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]===rr?wr(e,o,t,r.signal):t[0],d=l<0?o.length:l;if((s?.[1][0]??0)>=ir)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]!==tr&&t[0]=d)break;let t=await e[2];if(t){s=t;break}}if((s?.[1][0]??0)>=ir){let n=s[1];if(n[0]!==ir||n[1].options.reloadDocument||n[2])return Tr(e,t),n;c=!0,s=[0,[nr,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===nr?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=cr(e,u);try{await sr(i?Promise.resolve().then(()=>$n(m,l===nr?`errorComponent`:`notFoundComponent`)):Promise.all([$n(m),$n(m,`notFoundComponent`)]),r.signal)}catch(n){if(n===r.signal&&r.signal.aborted)return Tr(e,t),ar}i?c&&(r.abort(),await Promise.all([...n.map(e=>e[1]),...n.map(e=>e[2]),...(t[2]??[]).map(e=>e[1])]),Tr(e,t),hr(e,o),p()):u.status=`success`}return t}async function kr(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 wr(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=ir&&(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=Or(e,i,u,r[0],Er(u,m,i[2]),r[7]);i[2]?.length&&(i[3]=Er(i[2],void 0,void 0,h.then(e=>or(e)?0:er(n).length,()=>0))),o=await h}catch(t){if(Tr(e,i),t===a&&a.aborted)return ar;throw t}return or(o)?o:kr(e,o,a,r[6]===n.length?r[6]:0)}function jr(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(()=>jr(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 Mr(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 Nr(e,t){let n=e._pending;if(!n)return;clearTimeout(n[3]);let r=n[2]-Date.now();if(!n[4]||r<=0||!er(t[3]).some(e=>e.id===n[1]))return;let i;try{await sr(new Promise(e=>{i=setTimeout(e,r)}),t[0].signal)}catch{}clearTimeout(i)}function Pr(e,t){e._committed=t,e.stores.setMatches(t)}function Fr(e,t,n,r){let i=e._committed,a=e._cache;for(let e of n)e.preload=!1,r&&(e._assetEnd=void 0);let o=er(n).length,s=new Map;{let t=Date.now();for(let r of[...i,...a.values()]){if(r.status!==`success`||n.some((e,t)=>e.id===r.id&&(t=(r.preload?i.options.preloadGcTime??e.options.defaultPreloadGcTime??3e5:i.options.gcTime??e.options.defaultGcTime??3e5)||s.set(r.id,a.get(r.id)===r?r:{...r,_flight:void 0,isFetching:!1,context:{}})}}t[3]=[],e._cache=s,Pr(e,n),hr(e,[...a.values(),...i],[...n,...s.values()]),Hn(e,i,n,t)}async function Ir(e,t){let n=e._tx;for(;n&&n!==t;){if(await n[5],e._tx===n)return;n=e._tx}}function Lr(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.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 Rr(e,t,n,r,i){let a=n.map(e=>({...e}));gr(a);for(let t of r)mr(e,a[t[0]]),a[t[0]]=t[3];let o=[t[2],a],s;try{s=await Or(e,o,r,t[0],i)}catch(t){throw hr(e,a),t}if(or(s)){hr(e,a),s[0]===ir&&e._tx===t&&e._committed===n&&await Lr(e,t,s);return}if(await kr(e,s,t[0].signal),e._tx!==t||e._committed!==n){hr(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),mr(e,n))}Pr(e,a),hr(e,n,a)}async function zr(e,t,n,r,i,a){let o=await Ar(e,t[2],t[3],[t[0],t[1],e._committed,void 0,i,n,a,r]);if(or(o)){let n=o[0]===ir&&e._tx===t;if((!n||o[1].options.reloadDocument)&&Mr(e,t),hr(e,t[3]),t[3]=[],!n)return;if(e._tx!==t){Mr(e,t);return}await Lr(e,t,o);return}let s=o[1];if(e._tx===t&&await Nr(e,t),e._tx!==t){Mr(e,t),hr(e,s),Tr(e,o);return}let c=t[2],l=Bn(c,e.stores.resolvedLocation.get()),u=o[2];await e.startViewTransition(async()=>{if(e._tx===t&&await Nr(e,t),e._tx!==t){Mr(e,t),hr(e,s),Tr(e,o);return}let n=await e.startTransition(()=>{Mr(e,t),Fr(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){Tr(e,o);return}u?.length&&Rr(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 Br(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=Bn(a,r);e.emit({type:`onBeforeNavigate`,...t}),u.signal.aborted||e.emit({type:`onBeforeLoad`,...t})}if(u.signal.aborted){await Ir(e,n);return}let f=i.href===a.href,p=u,m=e.matchRoutes(a,{_controller:u});gr(m);let h=l?c[1](m):void 0;if(h?p=l:l?.abort(),u.signal.aborted){hr(e,m),await Ir(e,n);return}e._preflight=void 0;let g,_=()=>zr(e,y,f,()=>jr(e,y),t?.sync,h),v=t?.sync?new Promise(e=>g=e):Promise.resolve().then(_).then(),y=[p,s,a,m,Date.now(),v];if(e._tx=y,n){for(let t of e.stores.matches.get()){if(e._tx!==y)break;t.isFetching&&_r(e,t,!1)}n[0].abort(),hr(e,n[3],y[3],!0)}if(e._tx!==y){hr(e,y[3]),y[3]=[],g?.(),await Ir(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))&&jr(e,y),g?.(_()),await v,await Ir(e,y)}async function Vr(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}),gr(a),o=(e._preloads??=new Map).set(i,a),s=await Ar(e,n,a,[i,t,r,!0])}finally{o&&(o=o.delete(i),hr(e,a)),i.abort()}if(!or(s))return s[1];if(!o||s.length<3)return;n=s[2]}catch(e){Qt(e)||console.error(e);return}}}var Hr=`Error preloading route! ☝️`,Ur=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.originalIndex;let t=this.options,n=!t?.path&&!t?.id;this.parentRoute=this.options.getParentRoute?.(),n?this._path=Sn:this.parentRoute||gt();let r=n?Sn:t?.path;r&&r!==`/`&&(r=Ht(r));let i=t?.id||r,a=n?Sn:Bt([this.parentRoute.id===`__root__`?``:this.parentRoute.id,i]);r===`__root__`&&(r=`/`),a!==`__root__`&&(a=Bt([`/`,a]));let o=a===`__root__`?`/`:Bt([this.parentRoute.fullPath,r]);this._path=r,this._id=a,this._fullPath=o,this._to=Ut(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=>Cn({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.`)}},Wr=class extends Ur{constructor(e){super(e)}},M=r(f(),1),N=e(),Gr=class extends M.Component{constructor(...e){super(...e),this.state={error:null},this.reset=()=>{this.setState({error:null})}}static getDerivedStateFromProps(e,t){let n=e.getResetKey();return t.error&&t.resetKey!==n?{resetKey:n,error:null}:{resetKey:n}}static getDerivedStateFromError(e){return{error:e}}componentDidCatch(e,t){this.props.onCatch?.(e,t)}render(){let e=this.state.error;return e?M.createElement(this.props.errorComponent??Kr,{error:e,reset:this.reset}):this.props.children}};function Kr({error:e}){let[t,n]=M.useState(!1);return(0,N.jsxs)(`div`,{style:{padding:`.5rem`,maxWidth:`100%`},children:[(0,N.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:`.5rem`},children:[(0,N.jsx)(`strong`,{style:{fontSize:`1rem`},children:`Something went wrong!`}),(0,N.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,N.jsx)(`div`,{style:{height:`.25rem`}}),t?(0,N.jsx)(`div`,{children:(0,N.jsx)(`pre`,{style:{fontSize:`.7em`,border:`1px solid red`,borderRadius:`.25rem`,padding:`.3rem`,color:`red`,overflow:`auto`},children:e.message?(0,N.jsx)(`code`,{children:e.message}):null})}):null]})}function qr({children:e,fallback:t=null}){return(0,N.jsx)(M.Fragment,{children:Jr()?e:t})}function Jr(){return M.useSyncExternalStore(Yr,()=>!0,()=>!1)}function Yr(){return()=>{}}var Xr=M.createContext(void 0),Zr=M.createContext(void 0),Qr=(e=>(e[e.None=0]=`None`,e[e.Mutable=1]=`Mutable`,e[e.Watching=2]=`Watching`,e[e.RecursedCheck=4]=`RecursedCheck`,e[e.Recursed=8]=`Recursed`,e[e.Dirty=16]=`Dirty`,e[e.Pending=32]=`Pending`,e))(Qr||{});function $r({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 ei(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 ti=[],ni=0,{link:ri,unlink:ii,propagate:ai,checkDirty:oi,shallowPropagate:si}=$r({update(e){return e._update()},notify(e){ti[li++]=e,e.flags&=~Qr.Watching},unwatched(e){e.depsTail!==void 0&&(e.depsTail=void 0,e.flags=Qr.Mutable|Qr.Dirty,pi(e))}}),ci=0,li=0,ui,di=0;function fi(e){try{++di,e()}finally{--di||mi()}}function pi(e){let t=e.depsTail,n=t===void 0?e.deps:t.nextDep;for(;n!==void 0;)n=ii(n,e)}function mi(){if(!(di>0)){for(;ci{i.get(),n.current?t.next?.(i._snapshot):n.current=!0});return{unsubscribe:()=>{r.stop()}}},_update(e){let a=ui,o=t?.compare??Object.is;if(n)ui=i,++ni,i.depsTail=void 0;else if(e===void 0)return!1;n&&(i.flags=Qr.Mutable|Qr.RecursedCheck);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{ui=a,n&&(i.flags&=~Qr.RecursedCheck),pi(i)}}};return n?(i.flags=Qr.Mutable|Qr.Dirty,i.get=function(){let e=i.flags;if(e&Qr.Dirty||e&Qr.Pending&&oi(i.deps,i)){if(i._update()){let e=i.subs;e!==void 0&&si(e)}}else e&Qr.Pending&&(i.flags=e&~Qr.Pending);return ui!==void 0&&ri(i,ui,ni),i._snapshot}):i.set=function(e){if(i._update(e)){let e=i.subs;e!==void 0&&(ai(e),si(e),mi())}},i}function gi(e){let t=()=>{let t=ui;ui=n,++ni,n.depsTail=void 0,n.flags=Qr.Watching|Qr.RecursedCheck;try{return e()}finally{ui=t,n.flags&=~Qr.RecursedCheck,pi(n)}},n={deps:void 0,depsTail:void 0,subs:void 0,subsTail:void 0,flags:Qr.Watching|Qr.RecursedCheck,notify(){let e=this.flags;e&Qr.Dirty||e&Qr.Pending&&oi(this.deps,this)?t():this.flags=Qr.Watching},stop(){this.flags=Qr.None,this.depsTail=void 0,pi(this)}};return t(),n}var _i=n((e=>{var t=f();function n(e,t){return e===t&&(e!==0||1/e==1/t)||e!==e&&t!==t}var r=typeof Object.is==`function`?Object.is:n,i=t.useState,a=t.useEffect,o=t.useLayoutEffect,s=t.useDebugValue;function c(e,t){var n=t(),r=i({inst:{value:n,getSnapshot:t}}),c=r[0].inst,u=r[1];return o(function(){c.value=n,c.getSnapshot=t,l(c)&&u({inst:c})},[e,n,t]),a(function(){return l(c)&&u({inst:c}),e(function(){l(c)&&u({inst:c})})},[e]),s(n),n}function l(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!r(e,n)}catch{return!0}}function u(e,t){return t()}var d=typeof window>`u`||window.document===void 0||window.document.createElement===void 0?u:c;e.useSyncExternalStore=t.useSyncExternalStore===void 0?d:t.useSyncExternalStore})),vi=n(((e,t)=>{t.exports=_i()})),yi=n((e=>{var t=f(),n=vi();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.useSyncExternalStore,o=t.useRef,s=t.useEffect,c=t.useMemo,l=t.useDebugValue;e.useSyncExternalStoreWithSelector=function(e,t,n,r,u){var d=o(null);if(d.current===null){var f={hasValue:!1,value:null};d.current=f}else f=d.current;d=c(function(){function e(e){if(!a){if(a=!0,o=e,e=r(e),u!==void 0&&f.hasValue){var t=f.value;if(u(t,e))return s=t}return s=e}if(t=s,i(o,e))return t;var n=r(e);return u!==void 0&&u(t,n)?(o=e,t):(o=e,s=n)}var a=!1,o,s,c=n===void 0?null:n;return[function(){return e(t())},c===null?void 0:function(){return e(c())}]},[t,n,r,u]);var p=a(e,d[0],d[1]);return s(function(){f.hasValue=!0,f.value=p},[p]),l(p),p}})),bi=n(((e,t)=>{t.exports=yi()}))();function xi(e,t){return e===t}function Si(e,t,n=xi){let r=(0,M.useCallback)(t=>{if(!e)return()=>{};let{unsubscribe:n}=e.subscribe(t);return n},[e]),i=(0,M.useCallback)(()=>e?.get(),[e]);return(0,bi.useSyncExternalStoreWithSelector)(r,i,i,t,n)}var Ci={};function wi(e,t){let n=M.useRef();return r=>{let i=e?.select?e.select(r):r;return e?.structuralSharing??t.options.defaultStructuralSharing?n.current=tt(n.current,i):i}}function Ti(e){let t=l(),n=M.useContext(e.from?Zr:Xr),r=e.from??n,i=t.stores.getMatchStore(r),a=wi(e,t),o=Si(i,e=>e?a(e):Ci);if(o!==Ci)return o;(e.shouldThrow??!0)&>()}function Ei(e){return Ti({from:e.from,strict:e.strict,structuralSharing:e.structuralSharing,select:t=>e.select?e.select(t.loaderData):t.loaderData})}function Di(e){let{select:t,...n}=e;return Ti({...n,select:e=>t?t(e.loaderDeps):e.loaderDeps})}function Oi(e){return Ti({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 ki(e){return Ti({from:e.from,strict:e.strict,shouldThrow:e.shouldThrow,structuralSharing:e.structuralSharing,select:t=>e.select?e.select(t.search):t.search})}function Ai(e){return Ti({...e,select:t=>e.select?e.select(t.context):t.context})}function ji(e){let t=M.useRef(e);return ot(t.current,e,{ignoreUndefined:!1})||(t.current=e),t.current}function Mi(e,t){return e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2]}function Ni(e,t,n){if(e?.external)return ft(e.href,n)?void 0:e.href;if(!Wi(t)&&typeof t==`string`&&t.indexOf(`:`)!==-1)try{return new URL(t),ft(t,n)?void 0:t}catch{}}function Pi(e,t,n,r,i,a){if(a)return!1;if(n?.exact){if(!Kt(e.pathname,t.pathname,r))return!1}else{let n=Gt(e.pathname,r),i=Gt(t.pathname,r);if(!n.startsWith(i)||n.length!==i.length&&n[i.length]!==`/`)return!1}return(n?.includeSearch??!0)&&!ot(e.search,t.search,{partial:!n?.exact,ignoreUndefined:!n?.explicitUndefined})?!1:!n?.includeHash||i&&e.hash===t.hash}function Fi(e,n){let r=l(),i=u(n),{activeProps:a,inactiveProps:o,activeOptions:s,to:c,preload:d,preloadDelay:f,preloadIntentProximity:p,hashScrollIntoView:m,replace:h,startTransition:g,resetScroll:_,viewTransition:v,children:y,target:b,disabled:x,style:S,className:C,onClick:w,onBlur:T,onFocus:E,onMouseEnter:D,onMouseLeave:O,onTouchStart:k,ignoreBlocker:ee,params:te,search:ne,hash:re,state:A,mask:ie,reloadDocument:ae,unsafeRelative:oe,from:se,_fromLocation:ce,...le}=e,ue=Jr(),de=ji(e.search),fe=ji(e.params),j=ji(s),pe=M.useMemo(()=>e,[r,e.from,e._fromLocation,e.hash,e.to,de,fe,e.state,e.mask,e.unsafeRelative]),me=M.useCallback(e=>{let t=r.buildLocation({_fromLocation:e,...pe}),n=Ui(t.maskedLocation?t.maskedLocation.publicHref:t.publicHref,t.maskedLocation?t.maskedLocation.external:t.external,r.history,x),i=Ni(n,c,r.protocolAllowlist);return[n?.href,i,Pi(e,t,j,r.basepath,ue,i!==void 0)]},[j,x,ue,pe,r,c]),[he,ge,_e]=Si(r.stores.location,me,Mi),ve=_e?Ye(a,{})??Li:Ii,ye=_e?Ii:Ye(o,{})??Ii,be=[C,ve.className,ye.className].filter(Boolean).join(` `),xe=(S||ve.style||ye.style)&&{...S,...ve.style,...ye.style},Se=M.useRef(!1),Ce=e.reloadDocument||ge||x?!1:d??r.options.defaultPreload,we=f??r.options.defaultPreloadDelay??0,Te=M.useCallback(()=>{r.preloadRoute(pe).catch(e=>{console.warn(e),console.warn(Hr)})},[r,pe]),Ee=M.useCallback(e=>{if(!e){Vi(i);return}if(!(e.isIntersecting??Ce===`intent`)){e.isIntersecting===!1&&Vi(i);return}if(!we){Te();return}Bi.has(i)||Bi.set(i,setTimeout(()=>{Bi.delete(i),Te()},we))},[Te,i,Ce,we]);t(i,Ee,Ce!==`viewport`),M.useEffect(()=>{Se.current||Ce===`render`&&(Te(),Se.current=!0)},[Te,Ce]);let De=e=>{let t=e.currentTarget.getAttribute(`target`),n=b===void 0?t:b;!x&&!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)&&!e.defaultPrevented&&(!n||n===`_self`)&&e.button===0&&(e.preventDefault(),r.navigate({...pe,replace:h,resetScroll:_,hashScrollIntoView:m,startTransition:g,viewTransition:v,ignoreBlocker:ee}))};if(ge)return{...le,ref:i,href:ge,...y&&{children:y},...b&&{target:b},...x&&{disabled:x},...S&&{style:S},...C&&{className:C},...w&&{onClick:w},...T&&{onBlur:T},...E&&{onFocus:E},...D&&{onMouseEnter:D},...O&&{onMouseLeave:O},...k&&{onTouchStart:k}};let Oe=()=>{Ce===`intent`&&Te()},ke=()=>{Ce===`intent`&&Vi(i)};return{...le,...ve,...ye,href:he,ref:i,onClick:Hi([w,De]),onBlur:Hi([T,ke]),onFocus:Hi([E,Ee]),onMouseEnter:Hi([D,Ee]),onMouseLeave:Hi([O,ke]),onTouchStart:Hi([k,Oe]),disabled:!!x,target:b,...xe&&{style:xe},...be&&{className:be},...x&&Ri,..._e&&zi}}var Ii={},Li={className:`active`},Ri={role:`link`,"aria-disabled":!0},zi={"data-status":`active`,"aria-current":`page`},Bi=new WeakMap,Vi=e=>{clearTimeout(Bi.get(e)),Bi.delete(e)},Hi=e=>t=>{for(let n of e)if(n){if(t.defaultPrevented)return;n(t)}};function Ui(e,t,n,r){if(!r)return t?{href:e,external:!0}:{href:n.createHref(e)||`/`,external:!1}}function Wi(e){if(typeof e!=`string`)return!1;let t=e.charCodeAt(0);return t===47?e.charCodeAt(1)!==47:t===46}var Gi=M.forwardRef((e,t)=>{let{_asChild:n,...r}=e,{type:i,...a}=Fi(r,t),o=typeof r.children==`function`?r.children({isActive:a[`data-status`]===`active`}):r.children;if(!n){let{disabled:e,...t}=a;return M.createElement(`a`,t,o)}return M.createElement(n,a,o)}),Ki=class extends Ur{constructor(e){super(e),this.useMatch=e=>Ti({select:e?.select,from:this.id,structuralSharing:e?.structuralSharing}),this.useRouteContext=e=>Ai({...e,from:this.id}),this.useSearch=e=>ki({select:e?.select,structuralSharing:e?.structuralSharing,from:this.id}),this.useParams=e=>Oi({select:e?.select,structuralSharing:e?.structuralSharing,from:this.id}),this.useLoaderDeps=e=>Di({...e,from:this.id}),this.useLoaderData=e=>Ei({...e,from:this.id}),this.useNavigate=()=>o({from:this.fullPath}),this.Link=M.forwardRef((e,t)=>(0,N.jsx)(Gi,{ref:t,from:this.fullPath,...e}))}};function qi(e){return new Ki(e)}var Ji=class extends Wr{constructor(e){super(e),this.useMatch=e=>Ti({select:e?.select,from:this.id,structuralSharing:e?.structuralSharing}),this.useRouteContext=e=>Ai({...e,from:this.id}),this.useSearch=e=>ki({select:e?.select,structuralSharing:e?.structuralSharing,from:this.id}),this.useParams=e=>Oi({select:e?.select,structuralSharing:e?.structuralSharing,from:this.id}),this.useLoaderDeps=e=>Di({...e,from:this.id}),this.useLoaderData=e=>Ei({...e,from:this.id}),this.useNavigate=()=>o({from:this.fullPath}),this.Link=M.forwardRef((e,t)=>(0,N.jsx)(Gi,{ref:t,from:this.fullPath,...e}))}};function Yi(e){return new Ji(e)}function Xi(e){return e=>{let t=qi(e);return t.isRoot=!1,t}}function Zi(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(st(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(s)s(a());else throw a()}return M.createElement(r,e)};return o.preload=a,o}function Qi(e){let t=l(),n=`not-found-${Si(t.stores.location,e=>e.pathname)}-${Si(t.stores.status,e=>e)}`;return(0,N.jsx)(Gr,{getResetKey:()=>n,onCatch:(t,n)=>{if(Qt(t))e.onCatch?.(t,n);else throw t},errorComponent:({error:t})=>{if(Qt(t))return e.fallback?.(t);throw t},children:e.children})}function $i(){return(0,N.jsx)(`p`,{children:`Not Found`})}function ea(e){return(0,N.jsx)(N.Fragment,{children:e.children})}function ta(e,t,n){return t.options.notFoundComponent?(0,N.jsx)(t.options.notFoundComponent,{...n}):e.options.defaultNotFoundComponent?(0,N.jsx)(e.options.defaultNotFoundComponent,{...n}):(0,N.jsx)($i,{})}function na(e,t){let n=t?.options.pendingComponent??e.options.defaultPendingComponent;return n?(0,N.jsx)(n,{}):null}var ra=(e,t)=>e[0]===t[0]&&e[1]===t[1],ia=(e,t,n)=>!t.isRoot||t.options.shellComponent||t.options.wrapInSuspense||n===!1||n===`data-only`||!e.ssr,aa=M.memo(function({routeId:e}){let t=l();return(0,N.jsx)(oa,{router:t,match:Si(t.stores.getMatchStore(e),e=>e)})});function oa({router:e,match:t}){let n=e.routesById[t.routeId],r=na(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=ia(e,n,t.ssr)&&(n.options.wrapInSuspense??r??(n.options.errorComponent?.preload||s))?M.Suspense:ea,l=i?Gr:ea,u=o?Qi:ea;return(0,N.jsxs)(n.isRoot?n.options.shellComponent??ea:ea,{children:[(0,N.jsx)(Xr.Provider,{value:t.routeId,children:(0,N.jsx)(c,{fallback:r,children:(0,N.jsx)(l,{getResetKey:()=>t,errorComponent:i,onCatch:(e,n)=>{if(Qt(e))throw e.routeId??=t.routeId,e;a?.(e,n)},children:(0,N.jsx)(u,{fallback:e=>{if(e.routeId??=t.routeId,e.routeId!==t.routeId)throw e;return M.createElement(o,e)},children:s?(0,N.jsx)(qr,{fallback:r,children:(0,N.jsx)(sa,{match:t})}):(0,N.jsx)(sa,{match:t})})})})}),null]})}var sa=M.memo(function({match:e}){let t=l(),n=e.routeId,r=t.routesById[n],i=M.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=M.useMemo(()=>{let e=r.options.component??t.options.defaultComponent;return e?(0,N.jsx)(e,{},i):(0,N.jsx)(ca,{})},[i,r.options.component,t.options.defaultComponent]);if(e.status===`pending`){if(t.ssr&&!ia(t,r,e.ssr))return a;if(t._tx)throw t._tx[5];return na(t,r)}if(e.status===`notFound`)return ta(t,r,e.error);if(e.status===`error`)throw e.error;return a}),ca=M.memo(function(){let e=l(),t=M.useContext(Xr),n,r,i;{let a=e.stores.getMatchStore(t);[n,r]=Si(a,e=>[!!e._notFound,e.error],ra),i=Si(e.stores.ids,e=>e[e.indexOf(t)+1])}if(n)return ta(e,e.routesById[t],r);if(!i)return null;let a=(0,N.jsx)(aa,{routeId:i});return t===`__root__`?(0,N.jsx)(M.Suspense,{fallback:na(e),children:a}):a});function la(e,t){let n=e[1];e.length=0,n?.(t)}function ua({t:e}){let t=l(),n=t._rendered??=[];return t.startTransition=(r,i)=>new Promise(a=>{la(n,!1),n.push(i,a),e(t),M.startTransition(r)}),a(()=>{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(Ut(r.publicHref)!==Ut(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`,...Bn(a,a)})}):t._tx||t.load({sync:!0}).catch(console.error),e},[t,t.history]),null}function da(){let e=l(),t=e.routesById[Sn],n=na(e,t),r=e.ssr?ea:M.Suspense,i=(0,N.jsxs)(N.Fragment,{children:[(0,N.jsx)(ua,{t:M.useState()[1]}),(0,N.jsx)(r,{fallback:n,children:(0,N.jsx)(fa,{})})]});return e.options.InnerWrap?(0,N.jsx)(e.options.InnerWrap,{children:i}):i}function fa(){let e=l(),t=e._rendered,n=Si(e.stores.matches,e=>t[0]??e),r=n[0],i=r?.routeId;a(()=>{t[0]===n&&la(t,!0)},[t,n]);let o=i?(0,N.jsx)(aa,{routeId:i}):null;return(0,N.jsx)(Xr.Provider,{value:i,children:e.options.disableGlobalCatchBoundary?o:(0,N.jsx)(Gr,{getResetKey:()=>r,onCatch:void 0,children:o})})}var pa=e=>({createMutableStore:hi,createReadonlyStore:hi,batch:fi}),ma=e=>new ha(e),ha=class extends Un{constructor(e){super(e,pa)}};function ga({router:e,children:t,...n}){Qe(n)&&e.update({...e.options,...n,context:{...e.options.context,...n.context}});let r=(0,N.jsx)(i.Provider,{value:e,children:t});return e.options.Wrap?(0,N.jsx)(e.options.Wrap,{children:r}):r}function _a({router:e,...t}){return(0,N.jsx)(ga,{router:e,...t,children:(0,N.jsx)(da,{})})}function va(e){let t=l({warn:e?.router===void 0}),n=e?.router||t;return Si(n.stores.__store,wi(e,n))}function ya(e){return typeof e!=`string`||!e.includes(`var(--mantine-scale)`)?e:e.match(/^calc\((.*?)\)$/)?.[1].split(`*`)[0].trim()}function ba(e){let t=ya(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 xa(e){return Array.isArray(e)||e===null?!1:typeof e==`object`&&e.type!==M.Fragment}function Sa(e){let t=(0,M.createContext)(null);return[t,()=>{let n=(0,M.use)(t);if(n===null)throw Error(e);return n}]}function Ca(e,t){let n=e;for(;(n=n.parentElement)&&!n.matches(t););return n}function wa(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 Ta(e,t,n){for(let n=e+1;n{n?.(s);let c=Array.from(Ca(s.currentTarget,e)?.querySelectorAll(t)||[]).filter(t=>Ea(s.currentTarget,t,e)),l=c.findIndex(e=>s.currentTarget===e),u=Ta(l,c,r),d=wa(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[Ta(-1,c,!1)]?.focus();break;case`End`:s.stopPropagation(),s.preventDefault(),c[wa(c.length,c,!1)]?.focus()}}}var Oa={app:100,modal:200,popover:300,overlay:400,max:9999};function ka(e){return Oa[e]}var Aa=()=>{};function ja(e,t={active:!0}){return typeof e!=`function`||!t.active?t.onKeyDown||Aa:n=>{n.key===`Escape`&&(e(n),t.onTrigger?.())}}function Ma(e,t){return n=>{e?.(n),t?.(n)}}function Na(e,t){return e in t?ba(t[e]):ba(e)}function Pa(e,t){let n=e.map(e=>({value:e,px:Na(e,t)}));return n.sort((e,t)=>e.px-t.px),n}function Fa(e){return typeof e==`object`&&e?`base`in e?e.base:void 0:e}function Ia(e,t,n){return n?Array.from(Ca(n,t)?.querySelectorAll(e)||[]).findIndex(e=>e===n):null}function La(e){let t=(0,M.useRef)(e);return(0,M.useEffect)(()=>{t.current=e}),(0,M.useMemo)(()=>((...e)=>t.current?.(...e)),[])}function Ra(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=La(e),s=(0,M.useRef)(0),c=(0,M.useRef)(0),l=(0,M.useRef)(null),u=(0,M.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,M.useEffect)(()=>()=>{r?u.flush():u.cancel()},[u,r]),u}var za=[`mousedown`,`touchstart`];function Ba(e,t,n,r=!0){let i=(0,M.useRef)(null),a=t||za,o=(0,M.useEffectEvent)(t=>{let{target:r}=t??{};if(!document.body.contains(r)&&r?.tagName!==`HTML`)return;let a=t.composedPath();Array.isArray(n)?n.every(e=>!!e&&!a.includes(e))&&e(t):i.current&&!a.includes(i.current)&&e(t)}),s=a.join(`,`);return(0,M.useEffect)(()=>{if(!r)return;let e=s.split(`,`);return e.forEach(e=>document.addEventListener(e,o)),()=>{e.forEach(e=>document.removeEventListener(e,o))}},[s,r]),i}function Va(e,t){return Me(`(prefers-color-scheme: dark)`,e===`dark`,t)?`dark`:`light`}function Ha(e,t,n={leading:!1}){let[r,i]=(0,M.useState)(e),a=(0,M.useRef)(!1),o=(0,M.useRef)(null),s=(0,M.useRef)(!1),c=(0,M.useRef)(e);c.current=e;let l=(0,M.useCallback)(()=>{window.clearTimeout(o.current),o.current=null},[]),u=(0,M.useCallback)(()=>{l(),s.current=!1},[]),d=(0,M.useCallback)(()=>{o.current&&(u(),s.current=!1,i(c.current))},[]);return(0,M.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,M.useEffect)(()=>(a.current=!0,u),[]),[r,u,{cancel:u,flush:d}]}function Ua({opened:e,shouldReturnFocus:t=!0}){let n=(0,M.useRef)(null),r=()=>{n.current&&`focus`in n.current&&typeof n.current.focus==`function`&&n.current?.focus({preventScroll:!0})};return Ie(()=>{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 Wa=/input|select|textarea|button|object/,Ga=`a, input, select, textarea, button, object, [tabindex]`;function Ka(e){return e.style.display===`none`}function qa(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(Ka(t))return!1;t=t.parentNode}return!0}function Ja(e){let t=e.getAttribute(`tabindex`);return t===null&&(t=void 0),parseInt(t,10)}function Ya(e){let t=e.nodeName.toLowerCase(),n=!Number.isNaN(Ja(e));return(Wa.test(t)&&!e.disabled||e instanceof HTMLAnchorElement&&e.href||n)&&qa(e)}function Xa(e){let t=Ja(e);return(Number.isNaN(t)||t>=0)&&Ya(e)}function Za(e){return Array.from(e.querySelectorAll(Ga)).filter(Xa)}function Qa(e,t){let n=Za(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 $a(e=!0){let t=(0,M.useRef)(null),n=e=>{let t=e.querySelector(`[data-autofocus]`);if(!t){let n=Array.from(e.querySelectorAll(Ga));t=n.find(Xa)||n.find(Ya)||null,!t&&Ya(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,M.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,M.useEffect)(()=>{if(!e)return;t.current&&setTimeout(()=>{t.current&&n(t.current)});let r=e=>{e.key===`Tab`&&t.current&&Qa(t.current,e)};return document.addEventListener(`keydown`,r),()=>document.removeEventListener(`keydown`,r)},[e]),r}function eo(e,t,n){let r=(0,M.useEffectEvent)(t);(0,M.useEffect)(()=>(window.addEventListener(e,r,n),()=>window.removeEventListener(e,r,n)),[e])}function to(e,t){if(typeof e==`function`)return e(t);typeof e==`object`&&e&&`current`in e&&(e.current=t)}function no(...e){let t=new Map;return n=>{if(e.forEach(e=>{let r=to(e,n);r&&t.set(e,r)}),t.size>0)return()=>{e.forEach(e=>{let n=t.get(e);n&&typeof n==`function`?n():to(e,null)}),t.clear()}}}function ro(...e){return(0,M.useCallback)(no(...e),e)}function io({value:e,defaultValue:t,finalValue:n,onChange:r=()=>{}}){let[i,a]=(0,M.useState)(t===void 0?n:t);return e===void 0?[i,(e,...t)=>{a(e),r?.(e,...t)},!1]:[e,r,!0]}var ao=[`mouse`,`touch`],oo=10;function so(e,t={}){let{threshold:n=400,events:r=ao,cancelOnMove:i=!1,onStart:a,onFinish:o,onCancel:s}=t,c=(0,M.useRef)(!1),l=(0,M.useRef)(!1),u=(0,M.useRef)(-1),d=(0,M.useRef)(null);return(0,M.useEffect)(()=>()=>window.clearTimeout(u.current),[]),(0,M.useMemo)(()=>{if(typeof e!=`function`)return{};let t=i!==!1,f=i===!0?oo:i===!1?0:i,p=t=>{(uo(t)||lo(t))&&(a&&a(t),d.current=co(t),l.current=!0,u.current=window.setTimeout(()=>{e(t),c.current=!0},n))},m=e=>{(uo(e)||lo(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=co(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,r.join(`,`)])}function co(e){if(lo(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 lo(e){return window.TouchEvent?e.nativeEvent instanceof TouchEvent:`touches`in e.nativeEvent}function uo(e){return e.nativeEvent instanceof MouseEvent}function fo(){return`development`}function po(e){return e?.props?.ref}function mo(e){let t=M.Children.toArray(e);return t.length!==1||!xa(t[0])?null:t[0]}function ho(e){return e===`auto`||e===`dark`||e===`light`}function go({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 ho(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&&ho(t.newValue)&&n(t.newValue)},window.addEventListener(`storage`,t)},unsubscribe:()=>{window.removeEventListener(`storage`,t)},clear:()=>{window.localStorage.removeItem(e)}}}function _o({color:e,theme:t,autoContrast:n,colorScheme:r}){return(typeof n==`boolean`?n:t.autoContrast)&&ie({color:e||t.primaryColor,theme:t,colorScheme:r}).isLight?`var(--mantine-color-black)`:`var(--mantine-color-white)`}function vo(e,t,n){return _o({color:n===`dark`?e.dark:e.light,theme:t,colorScheme:n,autoContrast:!0})}function yo(e,t){let n=e.colors[e.primaryColor];return Ae(n)?e.autoContrast?vo(n,e,t):`var(--mantine-color-white)`:_o({color:n[A(e,t)],theme:e,autoContrast:null})}function bo(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 xo({keepTransitions:e}={}){let t=(0,M.useRef)(Aa),n=(0,M.useRef)(-1),r=(0,M.use)(k),i=(0,M.useRef)(ne()?.());if(!r)throw Error(`[@mantine/core] MantineProvider was not found in tree`);let a=a=>{r.setColorScheme(a),t.current=e?()=>{}:bo(i.current),window.clearTimeout(n.current),n.current=window.setTimeout(()=>{t.current?.()},10)},o=()=>{r.clearColorScheme(),t.current=e?()=>{}:bo(i.current),window.clearTimeout(n.current),n.current=window.setTimeout(()=>{t.current?.()},10)},s=Va(`light`,{getInitialValueInEffect:!1}),c=r.colorScheme===`auto`?s:r.colorScheme,l=(0,M.useCallback)(()=>a(c===`light`?`dark`:`light`),[a,c]);return(0,M.useEffect)(()=>()=>{t.current?.(),window.clearTimeout(n.current)},[]),{colorScheme:r.colorScheme,setColorScheme:a,clearColorScheme:o,toggleColorScheme:l}}function So(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 Co({manager:e,defaultColorScheme:t,getRootElement:n,forceColorScheme:r}){let i=(0,M.useRef)(null),[a,o]=(0,M.useState)(()=>e.get(t)),s=r||a,c=(0,M.useCallback)(t=>{r||(So(t,n),o(t),e.set(t))},[e.set,s,r]),l=(0,M.useCallback)(()=>{o(t),So(t,n),e.clear()},[e.clear,t]);return(0,M.useEffect)(()=>(e.subscribe(c),e.unsubscribe),[e.subscribe,e.unsubscribe]),Ee(()=>{So(e.get(t),n)},[]),(0,M.useEffect)(()=>{if(r)return So(r,n),()=>{};r===void 0&&So(a,n),typeof window<`u`&&`matchMedia`in window&&(i.current=window.matchMedia(`(prefers-color-scheme: dark)`));let e=e=>{a===`auto`&&So(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 wo(e,t={getInitialValueInEffect:!0}){let n=Va(e,t),{colorScheme:r}=xo();return r===`auto`?n:r}function To(e){return Object.entries(e).map(([e,t])=>`${e}: ${t};`).join(``)}function Eo(e,t){let n=t?[t]:[`:root`,`:host`],r=To(e.variables),i=r?`${n.join(`, `)}{${r}}`:``,a=To(e.dark),o=To(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 Do({theme:e,color:t,colorScheme:n,name:r=t,withColorValues:i=!0}){if(!e.colors[t])return{};if(n===`light`){let n=A(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`]:re(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=A(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`]:S(e.colors[t][9],.5),[`--mantine-color-${r}-light-hover`]:S(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`]:re(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 Oo(e,t,n){ke(t).forEach(r=>Object.assign(e,{[`--mantine-${n}-${r}`]:t[r]}))}var ko=e=>{let t=A(e,`light`),n=e.defaultRadius in e.radius?e.radius[e.defaultRadius]:j(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":yo(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":yo(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)`}};Oo(r.variables,e.breakpoints,`breakpoint`),Oo(r.variables,e.spacing,`spacing`),Oo(r.variables,e.fontSizes,`font-size`),Oo(r.variables,e.lineHeights,`line-height`),Oo(r.variables,e.shadows,`shadow`),Oo(r.variables,e.radius,`radius`),Oo(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})`}),ke(e.colors).forEach(t=>{let n=e.colors[t];if(Ae(n)){Object.assign(r.light,Do({theme:e,name:n.name,color:n.light,colorScheme:`light`,withColorValues:!0})),Object.assign(r.dark,Do({theme:e,name:n.name,color:n.dark,colorScheme:`dark`,withColorValues:!0})),r.light[`--mantine-color-${n.name}-contrast`]=vo(n,e,`light`),r.dark[`--mantine-color-${n.name}-contrast`]=vo(n,e,`dark`);return}n.forEach((e,n)=>{r.variables[`--mantine-color-${t}-${n}`]=e}),Object.assign(r.light,Do({theme:e,color:t,colorScheme:`light`,withColorValues:!1})),Object.assign(r.dark,Do({theme:e,color:t,colorScheme:`dark`,withColorValues:!1}))});let i=e.headings.sizes;return ke(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 Ao(){let e=b(),t=ne(),n=ke(e.breakpoints).reduce((t,n)=>{let r=e.breakpoints[n].includes(`px`),i=ba(e.breakpoints[n]);return`${t}@media (max-width: ${r?`${i-.1}px`:Re(i-.1)}) {.mantine-visible-from-${n} {display: none !important;}}@media (min-width: ${r?`${i}px`:Re(i)}) {.mantine-hidden-from-${n} {display: none !important;}}`},``);return(0,N.jsx)(`style`,{"data-mantine-styles":`classes`,nonce:t?.(),dangerouslySetInnerHTML:{__html:n}})}function jo({theme:e,generator:t}){let n=ko(e),r=t?.(e);return r?he(n,r):n}var Mo=ko(C);function No(e){let t={variables:{},light:{},dark:{}};return ke(e.variables).forEach(n=>{Mo.variables[n]!==e.variables[n]&&(t.variables[n]=e.variables[n])}),ke(e.light).forEach(n=>{Mo.light[n]!==e.light[n]&&(t.light[n]=e.light[n])}),ke(e.dark).forEach(n=>{Mo.dark[n]!==e.dark[n]&&(t.dark[n]=e.dark[n])}),t}function Po(e){return Eo({variables:{},dark:{"--mantine-color-scheme":`dark`},light:{"--mantine-color-scheme":`light`}},e)}function Fo({cssVariablesSelector:e,deduplicateCssVariables:t}){let n=b(),r=ne(),i=jo({theme:n,generator:m()}),a=(e===void 0||e===`:root`||e===`:host`)&&t,o=Eo(a?No(i):i,e);return o?(0,N.jsx)(`style`,{"data-mantine-styles":!0,nonce:r?.(),dangerouslySetInnerHTML:{__html:`${o}${a?``:Po(e)}`}}):null}Fo.displayName=`@mantine/CssVariables`;function Io({respectReducedMotion:e,getRootElement:t}){Ee(()=>{e&&t()?.setAttribute(`data-respect-reduced-motion`,`true`)},[e])}function Lo({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=go(),defaultColorScheme:u=`light`,getRootElement:d=()=>document.documentElement,cssVariablesResolver:f,forceColorScheme:p,stylesTransform:m,env:h,deduplicateInlineStyles:g=!1}){let{colorScheme:v,setColorScheme:y,clearColorScheme:b}=Co({defaultColorScheme:u,forceColorScheme:p,manager:l,getRootElement:d});return Io({respectReducedMotion:e?.respectReducedMotion||!1,getRootElement:d}),(0,N.jsx)(k,{value:{colorScheme:v,setColorScheme:y,clearColorScheme:b,getRootElement:d,classNamesPrefix:c,getStyleNonce:n,cssVariablesResolver:f,cssVariablesSelector:s??`:root`,withStaticClasses:r,stylesTransform:m,env:h,deduplicateInlineStyles:g},children:(0,N.jsxs)(_,{theme:e,children:[o&&(0,N.jsx)(Fo,{cssVariablesSelector:s,deduplicateCssVariables:a}),i&&(0,N.jsx)(Ao,{}),t]})})}Lo.displayName=`@mantine/core/MantineProvider`;function Ro(e){return e}function zo(e,t){return Array.isArray(e)?[...e].reduce((e,n)=>({...e,...zo(n,t)}),{}):typeof e==`function`?e(t):e??{}}var Bo=(0,M.createContext)({dir:`ltr`,toggleDirection:()=>{},setDirection:()=>{}});function Vo(){return(0,M.use)(Bo)}var[Ho,Uo]=Sa(`ScrollArea.Root component was not found in tree`);function Wo(e,t){let n=(0,M.useEffectEvent)(t);Ee(()=>{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 Go(e){let{style:t,...n}=e,r=Uo(),[i,a]=(0,M.useState)(0),[o,s]=(0,M.useState)(0),c=!!(i&&o);return Wo(r.scrollbarX,()=>{let e=r.scrollbarX?.offsetHeight||0;r.onCornerHeightChange(e),s(e)}),Wo(r.scrollbarY,()=>{let e=r.scrollbarY?.offsetWidth||0;r.onCornerWidthChange(e),a(e)}),c?(0,N.jsx)(`div`,{...n,style:{...t,width:i,height:o}}):null}function Ko(e){let t=Uo(),n=!!(t.scrollbarX&&t.scrollbarY);return t.type!==`scroll`&&n?(0,N.jsx)(Go,{...e}):null}var qo={scrollHideDelay:1e3,type:`hover`};function Jo(e){let{type:t,scrollHideDelay:n,scrollbars:r,getStyles:i,ref:a,...o}=D(`ScrollAreaRoot`,qo,e),[s,c]=(0,M.useState)(null),[l,u]=(0,M.useState)(null),[d,f]=(0,M.useState)(null),[p,m]=(0,M.useState)(null),[h,g]=(0,M.useState)(null),[_,v]=(0,M.useState)(0),[y,b]=(0,M.useState)(0),[x,S]=(0,M.useState)(!1),[C,w]=(0,M.useState)(!1),T=ro(a,c);return(0,N.jsx)(Ho,{value:{type:t,scrollHideDelay:n,scrollArea:s,viewport:l,onViewportChange:u,content:d,onContentChange:f,scrollbarX:p,onScrollbarXChange:m,scrollbarXEnabled:x,onScrollbarXEnabledChange:S,scrollbarY:h,onScrollbarYChange:g,scrollbarYEnabled:C,onScrollbarYEnabledChange:w,onCornerWidthChange:v,onCornerHeightChange:b,getStyles:i},children:(0,N.jsx)(Be,{...o,ref:T,__vars:{"--sa-corner-width":r===`xy`?`${_}px`:`0px`,"--sa-corner-height":r===`xy`?`${y}px`:`0px`}})})}Jo.displayName=`@mantine/core/ScrollAreaRoot`;function Yo(e,t){let n=e/t;return Number.isNaN(n)?0:n}function Xo(e){let t=Yo(e.viewport,e.content),n=e.scrollbar.paddingStart+e.scrollbar.paddingEnd,r=(e.scrollbar.size-n)*t;return Math.max(r,18)}function Zo(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 Qo(e,[t,n]){return Math.min(n,Math.max(t,e))}function $o(e,t,n=`ltr`){let r=Xo(t),i=t.scrollbar.paddingStart+t.scrollbar.paddingEnd,a=t.scrollbar.size-i,o=t.content-t.viewport,s=a-r,c=Qo(e,n===`ltr`?[0,o]:[o*-1,0]);return Zo([0,o],[0,s])(c)}function es(e,t,n,r=`ltr`){let i=Xo(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 Zo([c,l],d)(e)}function ts(e,t){return e>0&&e{e?.(r),(n===!1||!r.defaultPrevented)&&t?.(r)}}var[is,as]=Sa(`ScrollAreaScrollbar was not found in tree`);function os(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=Uo(),[p,m]=(0,M.useState)(null),h=ro(u,m),g=(0,M.useRef)(null),_=(0,M.useRef)(``),{viewport:v}=f,y=t.content-t.viewport,b=(0,M.useEffectEvent)(c),x=La(o),S=Ra(l,10),C=e=>{if(g.current){let t=e.clientX-g.current.left,n=e.clientY-g.current.top;s({x:t,y:n})}};return(0,M.useEffect)(()=>{let e=e=>{let t=e.target;p?.contains(t)&&b(e,y)};return document.addEventListener(`wheel`,e,{passive:!1}),()=>document.removeEventListener(`wheel`,e,{passive:!1})},[v,p,y]),(0,M.useEffect)(x,[t,x]),Wo(p,S),Wo(f.content,S),(0,N.jsx)(is,{value:{scrollbar:p,hasThumb:n,onThumbChange:La(r),onThumbPointerUp:La(i),onThumbPositionChange:x,onThumbPointerDown:La(a)},children:(0,N.jsx)(`div`,{...d,ref:h,"data-mantine-scrollbar":!0,style:{position:`absolute`,...d.style},onPointerDown:rs(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`,C(e))}),onPointerMove:rs(e.onPointerMove,C),onPointerUp:rs(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 ss=e=>{let{sizes:t,onSizesChange:n,style:r,ref:i,...a}=e,o=Uo(),[s,c]=(0,M.useState)(),l=(0,M.useRef)(null),u=ro(i,l,o.onScrollbarXChange);return(0,M.useEffect)(()=>{l.current&&c(getComputedStyle(l.current))},[l]),(0,N.jsx)(os,{"data-orientation":`horizontal`,...a,ref:u,sizes:t,style:{...r,"--sa-thumb-width":`${Xo(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),ts(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:ns(s.paddingLeft),paddingEnd:ns(s.paddingRight)}})}})};ss.displayName=`@mantine/core/ScrollAreaScrollbarX`;function cs(e){let{sizes:t,onSizesChange:n,style:r,ref:i,...a}=e,o=Uo(),[s,c]=(0,M.useState)(),l=(0,M.useRef)(null),u=ro(i,l,o.onScrollbarYChange);return(0,M.useEffect)(()=>{l.current&&c(window.getComputedStyle(l.current))},[]),(0,N.jsx)(os,{...a,"data-orientation":`vertical`,ref:u,sizes:t,style:{"--sa-thumb-height":`${Xo(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),ts(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:ns(s.paddingTop),paddingEnd:ns(s.paddingBottom)}})}})}cs.displayName=`@mantine/core/ScrollAreaScrollbarY`;function ls(e){let{orientation:t=`vertical`,...n}=e,{dir:r}=Vo(),i=Uo(),a=(0,M.useRef)(null),o=(0,M.useRef)(0),[s,c]=(0,M.useState)({content:0,viewport:0,scrollbar:{size:0,paddingStart:0,paddingEnd:0}}),l=Yo(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)=>es(e,o.current,s,t);return t===`horizontal`?(0,N.jsx)(ss,{...u,onThumbPositionChange:()=>{if(i.viewport&&a.current){let e=i.viewport.scrollLeft,t=$o(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,N.jsx)(cs,{...u,onThumbPositionChange:()=>{if(i.viewport&&a.current){let e=i.viewport.scrollTop,t=$o(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}ls.displayName=`@mantine/core/ScrollAreaScrollbarVisible`;function us(e){let t=Uo(),{forceMount:n,...r}=e,[i,a]=(0,M.useState)(!1),o=e.orientation===`horizontal`,s=Ra(()=>{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,N.jsx)(us,{"data-state":i?`visible`:`hidden`,...n}):null}ds.displayName=`@mantine/core/ScrollAreaScrollbarHover`;function fs(e){let{forceMount:t,...n}=e,r=Uo(),i=e.orientation===`horizontal`,[a,o]=(0,M.useState)(`hidden`),s=Ra(()=>o(`idle`),100);return(0,M.useEffect)(()=>{if(a===`idle`){let e=window.setTimeout(()=>o(`hidden`),r.scrollHideDelay);return()=>window.clearTimeout(e)}},[a,r.scrollHideDelay]),(0,M.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,N.jsx)(ls,{"data-state":a===`hidden`?`hidden`:`visible`,...n,onPointerEnter:rs(e.onPointerEnter,()=>o(`interacting`)),onPointerLeave:rs(e.onPointerLeave,()=>o(`idle`))}):null}function ps(e){let{forceMount:t,...n}=e,r=Uo(),{onScrollbarXEnabledChange:i,onScrollbarYEnabledChange:a}=r,o=e.orientation===`horizontal`;return(0,M.useEffect)(()=>(o?i(!0):a(!0),()=>{o?i(!1):a(!1)}),[o,i,a]),r.type===`hover`?(0,N.jsx)(ds,{...n,forceMount:t}):r.type===`scroll`?(0,N.jsx)(fs,{...n,forceMount:t}):r.type===`auto`?(0,N.jsx)(us,{...n,forceMount:t}):r.type===`always`?(0,N.jsx)(ls,{...n}):null}ps.displayName=`@mantine/core/ScrollAreaScrollbar`;function ms(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 hs(e){let{style:t,ref:n,...r}=e,i=Uo(),a=as(),{onThumbPositionChange:o}=a,s=ro(n,a.onThumbChange),c=(0,M.useRef)(void 0),l=Ra(()=>{c.current&&=(c.current(),void 0)},100);return(0,M.useEffect)(()=>{let{viewport:e}=i;if(e){let t=()=>{if(l(),!c.current){let t=ms(e,o);c.current=t,o()}};return o(),e.addEventListener(`scroll`,t),()=>e.removeEventListener(`scroll`,t)}},[i.viewport,l,o]),(0,N.jsx)(`div`,{"data-state":a.hasThumb?`visible`:`hidden`,...r,ref:s,style:{width:`var(--sa-thumb-width)`,height:`var(--sa-thumb-height)`,...t},onPointerDownCapture:rs(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:rs(e.onPointerUp,a.onThumbPointerUp)})}hs.displayName=`@mantine/core/ScrollAreaThumb`;function gs(e){let{forceMount:t,...n}=e,r=as();return t||r.hasThumb?(0,N.jsx)(hs,{...n}):null}gs.displayName=`@mantine/core/ScrollAreaThumb`;function _s({children:e,style:t,ref:n,onWheel:r,...i}){let a=Uo(),o=ro(n,a.onViewportChange),s=e=>{if(r?.(e),a.scrollbarXEnabled&&a.viewport&&e.shiftKey){let{scrollTop:t,scrollHeight:n,clientHeight:r,scrollWidth:i,clientWidth:o}=a.viewport,s=t<1,c=t>=n-r-1;i>o&&(s||c)&&e.stopPropagation()}};return(0,N.jsx)(Be,{...i,ref:o,onWheel:s,"data-scrollarea-viewport":!0,style:{overflowX:a.scrollbarXEnabled?`scroll`:`hidden`,overflowY:a.scrollbarYEnabled?`scroll`:`hidden`,...t},children:(0,N.jsx)(`div`,{...a.getStyles(`content`),ref:a.onContentChange,children:e})})}_s.displayName=`@mantine/core/ScrollAreaViewport`;var vs={root:`m_d57069b5`,content:`m_b1336c6`,viewport:`m_c0783ff9`,viewportInner:`m_f8f631dd`,scrollbar:`m_c44ba933`,thumb:`m_d8b5e363`,corner:`m_21657268`};function ys(){return typeof window<`u`}function bs(e){return Cs(e)?(e.nodeName||``).toLowerCase():`#document`}function xs(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function Ss(e){return((Cs(e)?e.ownerDocument:e.document)||window.document)?.documentElement}function Cs(e){return ys()?e instanceof Node||e instanceof xs(e).Node:!1}function ws(e){return ys()?e instanceof Element||e instanceof xs(e).Element:!1}function Ts(e){return ys()?e instanceof HTMLElement||e instanceof xs(e).HTMLElement:!1}function Es(e){return!ys()||typeof ShadowRoot>`u`?!1:e instanceof ShadowRoot||e instanceof xs(e).ShadowRoot}function Ds(e){let{overflow:t,overflowX:n,overflowY:r,display:i}=Rs(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&i!==`inline`&&i!==`contents`}function Os(e){return/^(table|td|th)$/.test(bs(e))}function ks(e){try{if(e.matches(`:popover-open`))return!0}catch{}try{return e.matches(`:modal`)}catch{return!1}}var As=/transform|translate|scale|rotate|perspective|filter/,js=/paint|layout|strict|content/,Ms=e=>!!e&&e!==`none`,Ns;function Ps(e){let t=ws(e)?Rs(e):e;return Ms(t.transform)||Ms(t.translate)||Ms(t.scale)||Ms(t.rotate)||Ms(t.perspective)||!Is()&&(Ms(t.backdropFilter)||Ms(t.filter))||As.test(t.willChange||``)||js.test(t.contain||``)}function Fs(e){let t=Bs(e);for(;Ts(t)&&!Ls(t);){if(Ps(t))return t;if(ks(t))return null;t=Bs(t)}return null}function Is(){return Ns??=typeof CSS<`u`&&CSS.supports&&CSS.supports(`-webkit-backdrop-filter`,`none`),Ns}function Ls(e){return/^(html|body|#document)$/.test(bs(e))}function Rs(e){return xs(e).getComputedStyle(e)}function zs(e){return ws(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function Bs(e){if(bs(e)===`html`)return e;let t=e.assignedSlot||e.parentNode||Es(e)&&e.host||Ss(e);return Es(t)?t.host:t}function Vs(e){let t=Bs(e);return Ls(t)?(e.ownerDocument||e).body:Ts(t)&&Ds(t)?t:Vs(t)}function Hs(e,t,n){t===void 0&&(t=[]),n===void 0&&(n=!0);let r=Vs(e),i=r===e.ownerDocument?.body,a=xs(r);if(i){let e=Us(a);return t.concat(a,a.visualViewport||[],Ds(r)?r:[],e&&n?Hs(e):[])}return t.concat(r,Hs(r,[],n))}function Us(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}var Ws=[`top`,`right`,`bottom`,`left`],Gs=Math.min,Ks=Math.max,qs=Math.round,Js=Math.floor,Ys=e=>({x:e,y:e}),Xs={left:`right`,right:`left`,bottom:`top`,top:`bottom`};function Zs(e,t,n){return Ks(e,Gs(t,n))}function Qs(e,t){return typeof e==`function`?e(t):e}function $s(e){return e.split(`-`)[0]}function ec(e){return e.split(`-`)[1]}function tc(e){return e===`x`?`y`:`x`}function nc(e){return e===`y`?`height`:`width`}function rc(e){let t=e[0];return t===`t`||t===`b`?`y`:`x`}function ic(e){return tc(rc(e))}function ac(e,t,n){n===void 0&&(n=!1);let r=ec(e),i=ic(e),a=nc(i),o=i===`x`?r===(n?`end`:`start`)?`right`:`left`:r===`start`?`bottom`:`top`;return t.reference[a]>t.floating[a]&&(o=mc(o)),[o,mc(o)]}function oc(e){let t=mc(e);return[sc(e),t,sc(t)]}function sc(e){return e.includes(`start`)?e.replace(`start`,`end`):e.replace(`end`,`start`)}var cc=[`left`,`right`],lc=[`right`,`left`],uc=[`top`,`bottom`],dc=[`bottom`,`top`];function fc(e,t,n){switch(e){case`top`:case`bottom`:return n?t?lc:cc:t?cc:lc;case`left`:case`right`:return t?uc:dc;default:return[]}}function pc(e,t,n,r){let i=ec(e),a=fc($s(e),n===`start`,r);return i&&(a=a.map(e=>e+`-`+i),t&&(a=a.concat(a.map(sc)))),a}function mc(e){let t=$s(e);return Xs[t]+e.slice(t.length)}function hc(e){return{top:e.top??0,right:e.right??0,bottom:e.bottom??0,left:e.left??0}}function gc(e){return typeof e==`number`?{top:e,right:e,bottom:e,left:e}:hc(e)}function _c(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 vc(){let e=navigator.userAgentData;return e!=null&&e.platform?e.platform:navigator.platform}function yc(){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 bc(){return/apple/i.test(navigator.vendor)}function xc(){return vc().toLowerCase().startsWith(`mac`)&&!navigator.maxTouchPoints}function Sc(){return yc().includes(`jsdom/`)}var Cc=`data-floating-ui-focusable`,wc=`input:not([type='hidden']):not([disabled]),[contenteditable]:not([contenteditable='false']),textarea:not([disabled])`;function Tc(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 Ec(e,t){if(!e||!t)return!1;let n=t.getRootNode==null?void 0:t.getRootNode();if(e.contains(t))return!0;if(n&&Es(n)){let n=t;for(;n;){if(e===n)return!0;n=n.parentNode||n.host}}return!1}function Dc(e){return`composedPath`in e?e.composedPath()[0]:e.target}function Oc(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 kc(e){return e.matches(`html,body`)}function Ac(e){return e?.ownerDocument||document}function jc(e){return Ts(e)&&e.matches(wc)}function Mc(e){if(!e||Sc())return!0;try{return e.matches(`:focus-visible`)}catch{return!0}}function Nc(e){return e?e.hasAttribute(Cc)?e:e.querySelector(`[`+Cc+`]`)||e:null}function Pc(e,t,n){return n===void 0&&(n=!0),e.filter(e=>e.parentId===t&&(!n||e.context?.open)).flatMap(t=>[t,...Pc(e,t.id,n)])}function Fc(e){return`nativeEvent`in e}function Ic(e,t){let n=[`mouse`,`pen`];return t||n.push(``,void 0),n.includes(e)}var Lc=typeof document<`u`?M.useLayoutEffect:function(){},Rc={...M};function zc(e){let t=M.useRef(e);return Lc(()=>{t.current=e}),t}var Bc=Rc.useInsertionEffect||(e=>e());function Vc(e){let t=M.useRef(()=>{});return Bc(()=>{t.current=e}),M.useCallback(function(){var e=[...arguments];return t.current==null?void 0:t.current(...e)},[])}function Hc(e,t,n){let{reference:r,floating:i}=e,a=rc(t),o=ic(t),s=nc(o),c=$s(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=ec(t);return m&&(p[o]+=f*(m===`end`?1:-1)*(n&&l?-1:1)),p}async function Uc(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}=Qs(t,e),p=gc(f),m=o[d?u===`floating`?`reference`:`floating`:u],h=_c(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=_c(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 Wc=50,Gc=async(e,t,n)=>{let{placement:r=`bottom`,strategy:i=`absolute`,middleware:a=[],platform:o}=n,s=o.detectOverflow?o:{...o,detectOverflow:Uc},c=await(o.isRTL==null?void 0:o.isRTL(t)),l=await o.getElementRects({reference:e,floating:t,strategy:i}),{x:u,y:d}=Hc(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}=Qs(e,t)||{};if(l==null)return{};let d=gc(u),f={x:n,y:r},p=ic(i),m=nc(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=Gs(d[_],T),D=Gs(d[v],T),O=C-h[m]-D,k=C/2-h[m]/2+w,ee=Zs(E,k,O),te=!c.arrow&&ec(i)!=null&&k!==ee&&a.reference[m]/2-(ke<=0)){let e=(i.flip?.index||0)+1,t=S[e];if(t&&(u!==`alignment`||_===rc(t)||T.every(e=>rc(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=rc(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 Jc(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function Yc(e){return Ws.some(t=>e[t]>=0)}var Xc=function(e){return e===void 0&&(e={}),{name:`hide`,options:e,async fn(t){let{rects:n,platform:r}=t,{strategy:i=`referenceHidden`,...a}=Qs(e,t);switch(i){case`referenceHidden`:{let e=Jc(await r.detectOverflow(t,{...a,elementContext:`reference`}),n.reference);return{data:{referenceHiddenOffsets:e,referenceHidden:Yc(e)}}}case`escaped`:{let e=Jc(await r.detectOverflow(t,{...a,altBoundary:!0}),n.floating);return{data:{escapedOffsets:e,escaped:Yc(e)}}}default:return{}}}}};function Zc(e){let t=Gs(...e.map(e=>e.left)),n=Gs(...e.map(e=>e.top)),r=Ks(...e.map(e=>e.right)),i=Ks(...e.map(e=>e.bottom));return{x:t,y:n,width:r-t,height:i-n}}function Qc(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=>_c(Zc(e)))}var $c=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}=Qs(e,t),u=Array.from(await(a.getClientRects==null?void 0:a.getClientRects(r.reference))||[]);if(!u.length)return{};let d=Qc(u),f=_c(Zc(u)),p=gc(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(rc(n)===`y`){let e=d[0],t=d[d.length-1],r=$s(n)===`top`,i=e.top,a=t.bottom,o=r?e.left:t.left;return _c({x:o,y:i,width:(r?e.right:t.right)-o,height:a-i})}let e=$s(n)===`left`,t=Ks(...d.map(e=>e.right)),r=Gs(...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 _c({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}}:{}}}},el=new Set([`left`,`top`]);async function tl(e,t){let{placement:n,platform:r,elements:i}=e,a=await(r.isRTL==null?void 0:r.isRTL(i.floating)),o=$s(n),s=ec(n),c=rc(n)===`y`,l=el.has(o)?-1:1,u=a&&c?-1:1,d=Qs(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 nl=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 tl(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}}}}},rl=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}=Qs(e,t),u={x:n,y:r},d=await a.detectOverflow(t,l),f=rc(i),p=tc(f),m=u[p],h=u[f],g=(e,t)=>Zs(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}}}}}},il=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}=Qs(e,t),u={x:n,y:r},d=rc(i),f=tc(d),p=u[f],m=u[d],h=Qs(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=el.has($s(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}}}},al=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}=Qs(e,t),c=await i.detectOverflow(t,s),l=$s(n),u=ec(n),d=rc(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=Gs(p-c[m],g),y=Gs(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*Ks(c.left,c.right):S=p-2*Ks(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 ol(e){let t=Rs(e),n=parseFloat(t.width)||0,r=parseFloat(t.height)||0,i=Ts(e),a=i?e.offsetWidth:n,o=i?e.offsetHeight:r,s=qs(n)!==a||qs(r)!==o;return s&&(n=a,r=o),{width:n,height:r,$:s}}function sl(e){return ws(e)?e:e.contextElement}function cl(e){let t=sl(e);if(!Ts(t))return Ys(1);let n=t.getBoundingClientRect(),{width:r,height:i,$:a}=ol(t),o=(a?qs(n.width):n.width)/r,s=(a?qs(n.height):n.height)/i;return(!o||!Number.isFinite(o))&&(o=1),(!s||!Number.isFinite(s))&&(s=1),{x:o,y:s}}var ll=Ys(0);function ul(e){let t=xs(e);return!Is()||!t.visualViewport?ll:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function dl(e,t,n){return t===void 0&&(t=!1),!!n&&t&&n===xs(e)}function fl(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);let i=e.getBoundingClientRect(),a=sl(e),o=Ys(1);t&&(r?ws(r)&&(o=cl(r)):o=cl(e));let s=dl(a,n,r)?ul(a):Ys(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=xs(a),t=ws(r)?xs(r):r,n=e,i=Us(n);for(;i&&t!==n;){let e=cl(i),t=i.getBoundingClientRect(),r=Rs(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=xs(i),i=Us(n)}}return _c({width:u,height:d,x:c,y:l})}function pl(e,t){let n=zs(e).scrollLeft;return t?t.left+n:fl(Ss(e)).left+n}function ml(e,t){let n=e.getBoundingClientRect();return{x:n.left+t.scrollLeft-pl(e,n),y:n.top+t.scrollTop}}function hl(e){let{elements:t,rect:n,offsetParent:r,strategy:i}=e,a=i===`fixed`,o=Ss(r),s=t?ks(t.floating):!1;if(r===o||s&&a)return n;let c={scrollLeft:0,scrollTop:0},l=Ys(1),u=Ys(0),d=Ts(r);if((d||!a)&&((bs(r)!==`body`||Ds(o))&&(c=zs(r)),d)){let e=fl(r);l=cl(r),u.x=e.x+r.clientLeft,u.y=e.y+r.clientTop}let f=o&&!d&&!a?ml(o,c):Ys(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 gl(e){return e.getClientRects?Array.from(e.getClientRects()):[]}function _l(e){let t=zs(e),n=e.ownerDocument.body,r=Ks(e.scrollWidth,e.clientWidth,n.scrollWidth,n.clientWidth),i=Ks(e.scrollHeight,e.clientHeight,n.scrollHeight,n.clientHeight),a=-t.scrollLeft+pl(e),o=-t.scrollTop;return Rs(n).direction===`rtl`&&(a+=Ks(e.clientWidth,n.clientWidth)-r),{width:r,height:i,x:a,y:o}}var vl=25;function yl(e,t,n){n===void 0&&(n=`viewport`);let r=n===`layoutViewport`,i=xs(e),a=Ss(e),o=i.visualViewport,s=a.clientWidth,c=a.clientHeight,l=0,u=0;if(o){let e=!Is()||t===`fixed`;r?e||(l=-o.offsetLeft,u=-o.offsetTop):(s=o.width,c=o.height,e&&(l=o.offsetLeft,u=o.offsetTop))}if(pl(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<=vl&&(s-=o)}return{width:s,height:c,x:l,y:u}}function bl(e,t){let n=fl(e,!0,t===`fixed`),r=n.top+e.clientTop,i=n.left+e.clientLeft,a=cl(e);return{width:e.clientWidth*a.x,height:e.clientHeight*a.y,x:i*a.x,y:r*a.y}}function xl(e,t,n){let r;if(t===`viewport`||t===`layoutViewport`)r=yl(e,n,t);else if(t===`document`)r=_l(Ss(e));else if(ws(t))r=bl(t,n);else{let n=ul(e);r={x:t.x-n.x,y:t.y-n.y,width:t.width,height:t.height}}return _c(r)}function Sl(e,t){let n=t.get(e);if(n)return n;let r=Hs(e,[],!1).filter(e=>ws(e)&&bs(e)!==`body`),i=null,a=Rs(e).position===`fixed`,o=a?Bs(e):e;for(;ws(o)&&!Ls(o);){let e=Rs(o),t=Ps(o),n=i?i.position:a?`fixed`:``;!t&&(n===`fixed`||n===`absolute`&&e.position===`static`)?r=r.filter(e=>e!==o):i=e,o=Bs(o)}return t.set(e,r),r}function Cl(e){let{element:t,boundary:n,rootBoundary:r,strategy:i}=e,a=[...n===`clippingAncestors`?ks(t)?[]:Sl(t,this._c):[].concat(n),r],o=xl(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=xs(e),l=()=>s(n);return c.addEventListener(`resize`,l),s(!0),()=>{c.removeEventListener(`resize`,l),o()}}function Pl(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=sl(e),u=i||a?[...l?Hs(l):[],...t?Hs(t):[]]:[];u.forEach(e=>{i&&e.addEventListener(`scroll`,n),a&&e.addEventListener(`resize`,n)});let d=l&&s?Nl(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?fl(e):null;c&&g();function g(){let t=fl(e);h&&!Ml(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 Fl=nl,Il=rl,Ll=qc,Rl=al,zl=Xc,Bl=Kc,Vl=$c,Hl=il,Ul=(e,t,n)=>{let r=new Map,i=n??{},a={...jl,...i.platform,_c:r};return Gc(e,t,{...i,platform:a})},Wl=r(we(),1),Gl=typeof document<`u`?M.useLayoutEffect:function(){};function Kl(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(!Kl(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)&&!Kl(e[n],t[n]))return!1}return!0}return e!==e&&t!==t}function ql(e){return typeof window>`u`?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function Jl(e,t){let n=ql(e);return Math.round(t*n)/n}function Yl(e){let t=M.useRef(e);return Gl(()=>{t.current=e}),t}function Xl(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]=M.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[f,p]=M.useState(r);Kl(f,r)||p(r);let[m,h]=M.useState(null),[g,_]=M.useState(null),v=M.useCallback(e=>{e!==S.current&&(S.current=e,h(e))},[]),y=M.useCallback(e=>{e!==C.current&&(C.current=e,_(e))},[]),b=a||m,x=o||g,S=M.useRef(null),C=M.useRef(null),w=M.useRef(u),T=c!=null,E=Yl(c),D=Yl(i),O=Yl(l),k=M.useCallback(()=>{if(!S.current||!C.current)return;let e={placement:t,strategy:n,middleware:f};D.current&&(e.platform=D.current),Ul(S.current,C.current,e).then(e=>{let t={...e,isPositioned:O.current!==!1};ee.current&&!Kl(w.current,t)&&(w.current=t,Wl.flushSync(()=>{d(t)}))})},[f,t,n,D,O]);Gl(()=>{l===!1&&w.current.isPositioned&&(w.current.isPositioned=!1,d(e=>({...e,isPositioned:!1})))},[l]);let ee=M.useRef(!1);Gl(()=>(ee.current=!0,()=>{ee.current=!1}),[]),Gl(()=>{if(b&&(S.current=b),x&&(C.current=x),b&&x){if(E.current)return E.current(b,x,k);k()}},[b,x,k,E,T]);let te=M.useMemo(()=>({reference:S,floating:C,setReference:v,setFloating:y}),[v,y]),ne=M.useMemo(()=>({reference:b,floating:x}),[b,x]),re=M.useMemo(()=>{let e={position:n,left:0,top:0};if(!ne.floating)return e;let t=Jl(ne.floating,u.x),r=Jl(ne.floating,u.y);return s?{...e,transform:`translate(`+t+`px, `+r+`px)`,...ql(ne.floating)>=1.5&&{willChange:`transform`}}:{position:n,left:t,top:r}},[n,s,ne.floating,u.x,u.y]);return M.useMemo(()=>({...u,update:k,refs:te,elements:ne,floatingStyles:re}),[u,k,te,ne,re])}var Zl=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?{}:Bl({element:r.current,padding:i}).fn(n):r?Bl({element:r,padding:i}).fn(n):{}}}},Ql=(e,t)=>{let n=Fl(e);return{name:n.name,fn:n.fn,options:[e,t]}},$l=(e,t)=>{let n=Il(e);return{name:n.name,fn:n.fn,options:[e,t]}},eu=(e,t)=>({fn:Hl(e).fn,options:[e,t]}),tu=(e,t)=>{let n=Ll(e);return{name:n.name,fn:n.fn,options:[e,t]}},nu=(e,t)=>{let n=Rl(e);return{name:n.name,fn:n.fn,options:[e,t]}},ru=(e,t)=>{let n=zl(e);return{name:n.name,fn:n.fn,options:[e,t]}},iu=(e,t)=>{let n=Vl(e);return{name:n.name,fn:n.fn,options:[e,t]}},au=(e,t)=>{let n=Zl(e);return{name:n.name,fn:n.fn,options:[e,t]}};function ou(e){let t=M.useRef(void 0),n=M.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 M.useMemo(()=>e.every(e=>e==null)?null:e=>{t.current&&=(t.current(),void 0),e!=null&&(t.current=n(e))},e)}var su=`data-floating-ui-focusable`,cu=`active`,lu=`selected`,uu=`ArrowLeft`,du=`ArrowRight`,fu=`ArrowUp`,pu=`ArrowDown`,mu=[uu,du],hu=[fu,pu];[...mu,...hu];var gu={...M},_u=!1,vu=0,yu=()=>`floating-ui-`+Math.random().toString(36).slice(2,6)+vu++;function bu(){let[e,t]=M.useState(()=>_u?yu():void 0);return Lc(()=>{e??t(yu())},[]),M.useEffect(()=>{_u=!0},[]),e}var xu=gu.useId||bu;function Su(){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 Cu=M.createContext(null),wu=M.createContext(null),Tu=()=>M.useContext(Cu)?.id||null,Eu=()=>M.useContext(wu);function Du(e){return`data-floating-ui-`+e}function Ou(e){e.current!==-1&&(clearTimeout(e.current),e.current=-1)}var ku=Du(`safe-polygon`);function Au(e,t,n){if(n&&!Ic(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 ju(e){return typeof e==`function`?e():e}function Mu(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=Eu(),m=Tu(),h=zc(l),g=zc(c),_=zc(n),v=zc(d),y=M.useRef(),b=M.useRef(-1),x=M.useRef(),S=M.useRef(-1),C=M.useRef(!0),w=M.useRef(!1),T=M.useRef(()=>{}),E=M.useRef(!1),D=Vc(()=>{let e=i.current.openEvent?.type;return e?.includes(`mouse`)&&e!==`mousedown`});M.useEffect(()=>{if(!s)return;function e(e){let{open:t}=e;t||(Ou(b),Ou(S),C.current=!0,E.current=!1)}return a.on(`openchange`,e),()=>{a.off(`openchange`,e)}},[s,a]),M.useEffect(()=>{if(!s||!h.current||!n)return;function e(e){D()&&r(!1,e,`hover`)}let t=Ac(o.floating).documentElement;return t.addEventListener(`mouseleave`,e),()=>{t.removeEventListener(`mouseleave`,e)}},[o.floating,n,r,s,h,D]);let O=M.useCallback(function(e,t,n){t===void 0&&(t=!0),n===void 0&&(n=`hover`);let i=Au(g.current,`close`,y.current);i&&!x.current?(Ou(b),b.current=window.setTimeout(()=>r(!1,e,n),i)):t&&(Ou(b),r(!1,e,n))},[g,r]),k=Vc(()=>{T.current(),x.current=void 0}),ee=Vc(()=>{if(w.current){let e=Ac(o.floating).body;e.style.pointerEvents=``,e.removeAttribute(ku),w.current=!1}}),te=Vc(()=>i.current.openEvent?[`click`,`mousedown`].includes(i.current.openEvent.type):!1);M.useEffect(()=>{if(!s)return;function e(e){if(Ou(b),C.current=!1,u&&!Ic(y.current)||ju(v.current)>0&&!Au(g.current,`open`))return;let t=Au(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(te()){ee();return}T.current();let t=Ac(o.floating);if(Ou(S),E.current=!1,h.current&&i.current.floatingContext){n||Ou(b),x.current=h.current({...i.current.floatingContext,tree:p,x:e.clientX,y:e.clientY,onClose(){ee(),k(),te()||O(e,!0,`safe-polygon`)}});let r=x.current;t.addEventListener(`mousemove`,r),T.current=()=>{t.removeEventListener(`mousemove`,r)};return}(y.current!==`touch`||!Ec(o.floating,e.relatedTarget))&&O(e)}function a(e){te()||i.current.floatingContext&&(h.current==null||h.current({...i.current.floatingContext,tree:p,x:e.clientX,y:e.clientY,onClose(){ee(),k(),te()||O(e)}})(e))}function c(){Ou(b)}function l(e){te()||O(e,!1)}if(ws(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,O,k,ee,r,n,_,p,g,h,i,te,v]),Lc(()=>{var e;if(s&&n&&(e=h.current)!=null&&(e=e.__options)!=null&&e.blockPointerEvents&&D()){w.current=!0;let e=o.floating;if(ws(o.domReference)&&e){var t;let n=Ac(o.floating).body;n.setAttribute(ku,``);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,D]),Lc(()=>{n||(y.current=void 0,E.current=!1,k(),ee())},[n,k,ee]),M.useEffect(()=>()=>{k(),Ou(b),Ou(S),ee()},[s,o.domReference,k,ee]);let ne=M.useMemo(()=>{function e(e){y.current=e.pointerType}return{onPointerDown:e,onPointerEnter:e,onMouseMove(e){let{nativeEvent:t}=e;function i(){!C.current&&!_.current&&r(!0,t,`hover`)}(!u||Ic(y.current))&&(n||ju(v.current)===0||E.current&&e.movementX**2+e.movementY**2<2||(Ou(S),y.current===`touch`?i():(E.current=!0,S.current=window.setTimeout(i,ju(v.current)))))}}},[u,r,n,_,v]);return M.useMemo(()=>s?{reference:ne}:{},[s,ne])}var Nu=()=>{},Pu=M.createContext({delay:0,initialDelay:0,timeoutMs:0,currentId:null,setCurrentId:Nu,setState:Nu,isInstantPhase:!1}),Fu=()=>M.useContext(Pu);function Iu(e){let{children:t,delay:n,timeoutMs:r=0}=e,[i,a]=M.useReducer((e,t)=>({...e,...t}),{delay:n,timeoutMs:r,initialDelay:n,currentId:null,isInstantPhase:!1}),o=M.useRef(null),s=M.useCallback(e=>{a({currentId:e})},[]);return Lc(()=>{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,N.jsx)(Pu.Provider,{value:M.useMemo(()=>({...i,setState:a,setCurrentId:s}),[i,s]),children:t})}function Lu(e,t){t===void 0&&(t={});let{open:n,onOpenChange:r,floatingId:i}=e,{id:a,enabled:o=!0}=t,s=a??i,c=Fu(),{currentId:l,setCurrentId:u,initialDelay:d,setState:f,timeoutMs:p}=c;return Lc(()=>{o&&l&&(f({delay:{open:1,close:Au(d,`close`)}}),l!==s&&r(!1))},[o,s,r,f,l,d]),Lc(()=>{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]),Lc(()=>{o&&u!==Nu&&n&&u(s)},[o,n,u,s]),c}function Ru(e,t){if(!e||!t)return!1;let n=t.getRootNode==null?void 0:t.getRootNode();if(e.contains(t))return!0;if(n&&Es(n)){let n=t;for(;n;){if(e===n)return!0;n=n.parentNode||n.host}}return!1}function zu(e){return`composedPath`in e?e.composedPath()[0]:e.target}var Bu={pointerdown:`onPointerDown`,mousedown:`onMouseDown`,click:`onClick`},Vu={pointerdown:`onPointerDownCapture`,mousedown:`onMouseDownCapture`,click:`onClickCapture`},Hu=e=>({escapeKey:typeof e==`boolean`?e:e?.escapeKey??!1,outsidePress:typeof e==`boolean`?e:e?.outsidePress??!0});function Uu(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=Eu(),g=Vc(typeof c==`function`?c:()=>!1),_=typeof c==`function`?g:c,v=M.useRef(!1),{escapeKey:y,outsidePress:b}=Hu(p),{escapeKey:x,outsidePress:S}=Hu(m),C=M.useRef(!1),w=Vc(e=>{if(!n||!o||!s||e.key!==`Escape`||C.current)return;let t=a.current.floatingContext?.nodeId,i=h?Pc(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,Fc(e)?e.nativeEvent:e,`escape-key`)}),T=Vc(e=>{var t;let n=()=>{var t;w(e),(t=Dc(e))==null||t.removeEventListener(`keydown`,n)};(t=Dc(e))==null||t.addEventListener(`keydown`,n)}),E=Vc(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=Dc(e),s=`[`+Du(`inert`)+`]`,c=Ac(i.floating).querySelectorAll(s),u=ws(o)?o:null;for(;u&&!Ls(u);){let e=Bs(u);if(Ls(e)||!ws(e))break;u=e}if(c.length&&ws(o)&&!kc(o)&&!Ec(o,i.floating)&&Array.from(c).every(e=>!Ec(u,e)))return;if(Ts(o)&&k){let t=Ls(o),n=Rs(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&&Pc(h.nodesRef.current,d).some(t=>Oc(e,t.context?.elements.floating));if(Oc(e,i.floating)||Oc(e,i.domReference)||f)return;let p=h?Pc(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`)}),D=Vc(e=>{var t;let n=()=>{var t;E(e),(t=Dc(e))==null||t.removeEventListener(l,n)};(t=Dc(e))==null||t.addEventListener(l,n)});M.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),C.current=!0}function u(){e=window.setTimeout(()=>{C.current=!1},Is()?5:0)}let d=Ac(i.floating);s&&(d.addEventListener(`keydown`,x?T:w,x),d.addEventListener(`compositionstart`,c),d.addEventListener(`compositionend`,u)),_&&d.addEventListener(l,S?D:E,S);let p=[];return f&&(ws(i.domReference)&&(p=Hs(i.domReference)),ws(i.floating)&&(p=p.concat(Hs(i.floating))),!ws(i.reference)&&i.reference&&i.reference.contextElement&&(p=p.concat(Hs(i.reference.contextElement)))),p=p.filter(e=>e!==d.defaultView?.visualViewport),p.forEach(e=>{e.addEventListener(`scroll`,t)}),()=>{s&&(d.removeEventListener(`keydown`,x?T:w,x),d.removeEventListener(`compositionstart`,c),d.removeEventListener(`compositionend`,u)),_&&d.removeEventListener(l,S?D:E,S),p.forEach(e=>{e.removeEventListener(`scroll`,t)}),window.clearTimeout(e)}},[a,i,s,_,l,n,r,f,o,y,b,w,x,T,E,S,D]),M.useEffect(()=>{a.current.insideReactTree=!1},[a,_,l]);let O=M.useMemo(()=>({onKeyDown:w,...u&&{[Bu[d]]:e=>{r(!1,e.nativeEvent,`reference-press`)},...d!==`click`&&{onClick(e){r(!1,e.nativeEvent,`reference-press`)}}}}),[w,r,u,d]),k=M.useMemo(()=>{function e(e){e.button===0&&(v.current=!0)}return{onKeyDown:w,onMouseDown:e,onMouseUp:e,[Vu[l]]:()=>{a.current.insideReactTree=!0}}},[w,l,a]);return M.useMemo(()=>o?{reference:O,floating:k}:{},[o,O,k])}function Wu(e){let{open:t=!1,onOpenChange:n,elements:r}=e,i=xu(),a=M.useRef({}),[o]=M.useState(()=>Su()),s=Tu()!=null,[c,l]=M.useState(r.reference),u=Vc((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=M.useMemo(()=>({setPositionReference:l}),[]),f=M.useMemo(()=>({reference:c||r.reference||null,floating:r.floating||null,domReference:r.reference}),[c,r.reference,r.floating]);return M.useMemo(()=>({dataRef:a,open:t,onOpenChange:u,elements:f,events:o,floatingId:i,refs:d}),[t,u,f,o,i,d])}function Gu(e){let{elements:t,...n}=e===void 0?{}:e,{nodeId:r}=n,i=Wu({...n,elements:{reference:t?.reference??null,floating:t?.floating??null}}),a=n.rootContext||i,o=a.elements,[s,c]=M.useState(null),[l,u]=M.useState(null),d=o?.domReference||s,f=M.useRef(null),p=Eu();Lc(()=>{d&&(f.current=d)},[d]);let m=Xl({...n,elements:{...o,...l&&{reference:l}}}),h=M.useCallback(e=>{let t=ws(e)?{getBoundingClientRect:()=>e.getBoundingClientRect(),getClientRects:()=>e.getClientRects(),contextElement:e}:e;u(t),m.refs.setReference(t)},[m.refs]),g=M.useCallback(e=>{(ws(e)||e===null)&&(f.current=e,c(e)),(ws(m.refs.reference.current)||m.refs.reference.current===null||e!==null&&!ws(e))&&m.refs.setReference(e)},[m.refs]),_=M.useMemo(()=>({...m.refs,setReference:g,setPositionReference:h,domReference:f}),[m.refs,g,h]),v=M.useMemo(()=>({...m.elements,domReference:d}),[m.elements,d]),y=M.useMemo(()=>({...m,...a,refs:_,elements:v,nodeId:r}),[m,_,v,r,a]);return Lc(()=>{a.dataRef.current.floatingContext=y;let e=p?.nodesRef.current.find(e=>e.id===r);e&&(e.context=y)}),M.useMemo(()=>({...m,context:y,refs:_,elements:v}),[m,_,v,y])}function Ku(){return xc()&&bc()}function qu(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=M.useRef(!1),u=M.useRef(-1),d=M.useRef(!0);M.useEffect(()=>{if(!s)return;let e=xs(o.domReference);function t(){!n&&Ts(o.domReference)&&o.domReference===Tc(Ac(o.domReference))&&(l.current=!0)}function r(){d.current=!0}function i(){d.current=!1}return e.addEventListener(`blur`,t),Ku()&&(e.addEventListener(`keydown`,r,!0),e.addEventListener(`pointerdown`,i,!0)),()=>{e.removeEventListener(`blur`,t),Ku()&&(e.removeEventListener(`keydown`,r,!0),e.removeEventListener(`pointerdown`,i,!0))}},[o.domReference,n,s]),M.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]),M.useEffect(()=>()=>{Ou(u)},[]);let f=M.useMemo(()=>({onMouseLeave(){l.current=!1},onFocus(e){if(l.current)return;let t=Dc(e.nativeEvent);if(c&&ws(t)){if(Ku()&&!e.relatedTarget){if(!d.current&&!jc(t))return}else if(!Mc(t))return}r(!0,e.nativeEvent,`focus`)},onBlur(e){l.current=!1;let t=e.relatedTarget,n=e.nativeEvent,i=ws(t)&&t.hasAttribute(Du(`focus-guard`))&&t.getAttribute(`data-type`)===`outside`;u.current=window.setTimeout(()=>{let e=Tc(o.domReference?o.domReference.ownerDocument:document);(t||e!==o.domReference)&&(Ec(a.current.floatingContext?.refs.floating.current,e)||Ec(o.domReference,e)||i||r(!1,n,`focus`))})}}),[a,o.domReference,r,c]);return M.useMemo(()=>s?{reference:f}:{},[s,f])}function Ju(e,t,n){let r=new Map,i=n===`item`,a=e;if(i&&e){let{[cu]:t,[lu]:n,...r}=e;a=r}return{...n===`floating`&&{tabIndex:-1,[su]:``},...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&&[cu,lu].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 Yu(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=M.useCallback(t=>Ju(t,e,`reference`),t),a=M.useCallback(t=>Ju(t,e,`floating`),n),o=M.useCallback(t=>Ju(t,e,`item`),r);return M.useMemo(()=>({getReferenceProps:i,getFloatingProps:a,getItemProps:o}),[i,a,o])}var Xu=new Map([[`select`,`listbox`],[`combobox`,`listbox`],[`label`,!1]]);function Zu(e,t){t===void 0&&(t={});let{open:n,elements:r,floatingId:i}=e,{enabled:a=!0,role:o=`dialog`}=t,s=xu(),c=r.domReference?.id||s,l=M.useMemo(()=>Nc(r.floating)?.id||i,[r.floating,i]),u=Xu.get(o)??o,d=Tu()!=null,f=M.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=M.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=M.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 M.useMemo(()=>a?{reference:f,floating:p,item:m}:{},[a,f,p,m])}function Qu(e,t,n){return n===void 0&&(n=!0),e.filter(e=>e.parentId===t&&(!n||e.context?.open)).flatMap(t=>[t,...Qu(e,t.id,n)])}function $u(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 ed(e,t){return e[0]>=t.x&&e[0]<=t.x+t.width&&e[1]>=t.y&&e[1]<=t.y+t.height}function td(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(){Ou(i),u()}if(Ou(i),!c.domReference||!c.floating||s==null||n==null||o==null)return;let{clientX:m,clientY:h}=e,g=[m,h],_=zu(e),v=e.type===`mouseleave`,y=Ru(c.floating,_),b=Ru(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=ed(g,x),D=S.width>x.width,O=S.height>x.height,k=(D?x:S).left,ee=(D?x:S).right,te=(O?x:S).top,ne=(O?x:S).bottom;if(y&&(a=!0,!v))return;if(b&&(a=!1),b&&!v){a=!0;return}if(v&&ws(e.relatedTarget)&&Ru(c.floating,e.relatedTarget)||f&&Qu(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 re=[];switch(C){case`top`:re=[[k,x.top+1],[k,S.bottom-1],[ee,S.bottom-1],[ee,x.top+1]];break;case`bottom`:re=[[k,S.top+1],[k,x.bottom-1],[ee,x.bottom-1],[ee,S.top+1]];break;case`left`:re=[[S.right-1,ne],[S.right-1,te],[x.left+1,te],[x.left+1,ne]];break;case`right`:re=[[x.right-1,ne],[x.right-1,te],[S.left+1,te],[S.left+1,ne]]}function A(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(!$u([m,h],re)){if(a&&!E)return p();if(!v&&r){let t=l(e.clientX,e.clientY);if(t!==null&&t<.1)return p()}$u([m,h],A([n,o]))?!a&&r&&(i.current=window.setTimeout(p,40)):p()}}};return u.__options={blockPointerEvents:n},u}var nd={scrollHideDelay:1e3,type:`hover`,scrollbars:`xy`},rd=O((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":j(t),"--scrollarea-over-scroll-behavior":i}}}),id=g(e=>{let t=D(`ScrollArea`,nd,e),{classNames:n,className:r,style:i,styles:a,unstyled:o,scrollbarSize:s,vars:c,type:l,scrollHideDelay:u,viewportProps:d,viewportRef:f,onScrollPositionChange:p,children:m,offsetScrollbars:h,scrollbars:g,onBottomReached:_,onTopReached:v,onLeftReached:y,onRightReached:b,overscrollBehavior:x,startScrollPosition:S,verticalScrollbarPosition:C,attributes:T,...E}=t,[O,k]=(0,M.useState)(!1),[ee,te]=(0,M.useState)(!1),[ne,re]=(0,M.useState)(!1),A=(0,M.useRef)(!0),ie=(0,M.useRef)(!1),ae=(0,M.useRef)(!0),oe=(0,M.useRef)(!1),se=w({name:`ScrollArea`,props:t,classes:vs,className:r,style:i,classNames:n,styles:a,unstyled:o,attributes:T,vars:c,varsResolver:rd}),ce=(0,M.useRef)(null),[le,ue]=(0,M.useState)(null),de=ou([f,ce,(0,M.useCallback)(e=>{ue(t=>t===e?t:e)},[])]);return Wo(h===`present`?le:null,()=>{let e=ce.current;e&&(te(e.scrollHeight>e.clientHeight),re(e.scrollWidth>e.clientWidth))}),Ee(()=>{S&&ce.current&&ce.current.scrollTo({left:S.x??0,top:S.y??0})},[]),(0,N.jsxs)(Jo,{getStyles:se,type:l===`never`?`always`:l,scrollHideDelay:u,scrollbars:g,...se(`root`),...E,children:[(0,N.jsx)(_s,{...d,...se(`viewport`,{style:d?.style}),ref:de,"data-offset-scrollbars":h===!0?`xy`:h||void 0,"data-scrollbars":g||void 0,"data-vertical-scrollbar-position":C||void 0,"data-horizontal-hidden":h===`present`&&!ne?`true`:void 0,"data-vertical-hidden":h===`present`&&!ee?`true`:void 0,onScroll:e=>{d?.onScroll?.(e),p?.({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&&!ie.current&&_?.(),c&&!A.current&&v?.(),ie.current=s,A.current=c;let l=i-(a-o)>=-.8,u=i===0;l&&!oe.current&&b?.(),u&&!ae.current&&y?.(),oe.current=l,ae.current=u},children:m}),(g===`xy`||g===`x`)&&(0,N.jsx)(ps,{...se(`scrollbar`),orientation:`horizontal`,"data-vertical-scrollbar-position":C||void 0,"data-hidden":l===`never`||h===`present`&&!ne||void 0,forceMount:!0,onMouseEnter:()=>k(!0),onMouseLeave:()=>k(!1),children:(0,N.jsx)(gs,{...se(`thumb`)})}),(g===`xy`||g===`y`)&&(0,N.jsx)(ps,{...se(`scrollbar`),orientation:`vertical`,"data-vertical-scrollbar-position":C||void 0,"data-hidden":l===`never`||h===`present`&&!ee||void 0,forceMount:!0,onMouseEnter:()=>k(!0),onMouseLeave:()=>k(!1),children:(0,N.jsx)(gs,{...se(`thumb`)})}),(0,N.jsx)(Ko,{...se(`corner`),"data-vertical-scrollbar-position":C||void 0,"data-hovered":O||void 0,"data-hidden":l===`never`||void 0})]})});id.displayName=`@mantine/core/ScrollArea`;var ad=g(e=>{let{children:t,classNames:n,styles:r,scrollbarSize:i,scrollHideDelay:a,type:o,dir:s,offsetScrollbars:c,overscrollBehavior:l,viewportRef:u,onScrollPositionChange:d,unstyled:f,variant:p,viewportProps:m,scrollbars:h,style:g,vars:_,onBottomReached:v,onTopReached:y,startScrollPosition:b,verticalScrollbarPosition:x,onOverflowChange:S,...C}=D(`ScrollAreaAutosize`,nd,e),w=(0,M.useRef)(null),[T,E]=(0,M.useState)(null),O=ou([u,w,(0,M.useCallback)(e=>{E(t=>t===e?t:e)},[])]),k=(0,M.useRef)(!1),ee=(0,M.useRef)(!1),te=(0,M.useEffectEvent)(()=>{let e=w.current;if(!e||!S)return;let t=e.scrollHeight>e.clientHeight;t!==k.current&&(ee.current?S(t):(ee.current=!0,t&&S(!0)),k.current=t)});return Wo(S?T:null,te),(0,N.jsx)(Be,{...C,variant:p,style:[{display:`flex`,overflow:`hidden`},g],children:(0,N.jsx)(Be,{style:{display:`flex`,flexDirection:`column`,flex:1,overflow:`hidden`,...h===`y`&&{minWidth:0},...h===`x`&&{minHeight:0},...h===`xy`&&{minWidth:0,minHeight:0},...h===!1&&{minWidth:0,minHeight:0}},children:(0,N.jsx)(id,{classNames:n,styles:r,scrollHideDelay:a,scrollbarSize:i,type:o,dir:s,offsetScrollbars:c,overscrollBehavior:l,viewportRef:O,onScrollPositionChange:d,unstyled:f,variant:p,viewportProps:m,vars:_,scrollbars:h,onBottomReached:v,onTopReached:y,startScrollPosition:b,verticalScrollbarPosition:x,"data-autosize":`true`,children:t})})})});id.classes=vs,id.varsResolver=rd,ad.displayName=`@mantine/core/ScrollAreaAutosize`,ad.classes=vs,id.Autosize=ad;var od={root:`m_515a97f8`},sd=g(e=>{let t=D(`VisuallyHidden`,null,e),{classNames:n,className:r,style:i,styles:a,unstyled:o,vars:s,attributes:c,...l}=t;return(0,N.jsx)(Be,{component:`span`,...w({name:`VisuallyHidden`,classes:od,props:t,className:r,style:i,classNames:n,styles:a,unstyled:o,attributes:c})(`root`),...l})});sd.classes=od,sd.displayName=`@mantine/core/VisuallyHidden`;function cd(e,t,n,r){return e===`center`||r===`center`?{top:t}:e===`end`?{bottom:n}:e===`start`?{top:n}:{}}function ld(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 ud={bottom:`borderTopLeftRadius`,left:`borderTopRightRadius`,right:`borderBottomLeftRadius`,top:`borderBottomRightRadius`};function dd({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 fd({position:e,arrowSize:t,arrowOffset:n,arrowRadius:r,arrowPosition:i,arrowX:a,arrowY:o,dir:s}){if(i===`merge`){let n=dd({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`,[ud[c]]:r},d=-t/2;return c===`left`?{...u,...cd(l,o,n,i),right:d,borderLeftColor:`transparent`,borderBottomColor:`transparent`,clipPath:`polygon(100% 0, 0 0, 100% 100%)`}:c===`right`?{...u,...cd(l,o,n,i),left:d,borderRightColor:`transparent`,borderTopColor:`transparent`,clipPath:`polygon(0 100%, 0 0, 100% 100%)`}:c===`top`?{...u,...ld(l,a,n,i,s),bottom:d,borderTopColor:`transparent`,borderLeftColor:`transparent`,clipPath:`polygon(0 100%, 100% 100%, 100% 0)`}:c===`bottom`?{...u,...ld(l,a,n,i,s),top:d,borderBottomColor:`transparent`,borderRightColor:`transparent`,clipPath:`polygon(0 100%, 0 0, 100% 0)`}:{}}function pd({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 md({position:e,arrowSize:t,arrowOffset:n,arrowRadius:r,arrowPosition:i,visible:a,arrowX:o,arrowY:s,style:c,...l}){let{dir:u}=Vo();return a?(0,N.jsx)(`div`,{role:`presentation`,...l,style:{...c,...fd({position:e,arrowSize:t,arrowOffset:n,arrowRadius:r,arrowPosition:i,dir:u,arrowX:o,arrowY:s})}}):null}md.displayName=`@mantine/core/FloatingArrow`;function hd(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 gd({open:e,close:t,openDelay:n,closeDelay:r}){let i=(0,M.useRef)(-1),a=(0,M.useRef)(-1),o=()=>{window.clearTimeout(i.current),window.clearTimeout(a.current)};return(0,M.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 _d={root:`m_9814e45f`},vd={zIndex:ka(`modal`)},yd=O((e,{gradient:t,color:n,backgroundOpacity:r,blur:i,radius:a,zIndex:o})=>({root:{"--overlay-bg":t||(n!==void 0||r!==void 0)&&v(n||`#000`,r??.6)||void 0,"--overlay-filter":i?`blur(${j(i)})`:void 0,"--overlay-radius":a===void 0?void 0:ce(a),"--overlay-z-index":o?.toString()}})),bd=te(e=>{let t=D(`Overlay`,vd,e),{classNames:n,className:r,style:i,styles:a,unstyled:o,vars:s,fixed:c,center:l,children:u,radius:d,zIndex:f,gradient:p,blur:m,color:h,backgroundOpacity:g,mod:_,attributes:v,...y}=t;return(0,N.jsx)(Be,{...w({name:`Overlay`,props:t,classes:_d,className:r,style:i,classNames:n,styles:a,unstyled:o,attributes:v,vars:s,varsResolver:yd})(`root`),mod:[{center:l,fixed:c},_],...y,children:u})});bd.classes=_d,bd.varsResolver=yd,bd.displayName=`@mantine/core/Overlay`;function xd(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}function Sd({target:e,reuseTargetNode:t,...n}){if(e)return typeof e==`string`?document.querySelector(e)||xd(n):e;if(t){let e=document.querySelector(`[data-mantine-shared-portal-node]`);if(e)return e;let t=xd(n);return t.setAttribute(`data-mantine-shared-portal-node`,`true`),document.body.appendChild(t),t}return xd(n)}var Cd={reuseTargetNode:!0},wd=g(e=>{let{children:t,target:n,reuseTargetNode:r,ref:i,...a}=D(`Portal`,Cd,e),[o,s]=(0,M.useState)(!1),c=(0,M.useRef)(null);return Ee(()=>(s(!0),c.current=Sd({target:n,reuseTargetNode:r,...a}),to(i,c.current),!n&&!r&&c.current&&document.body.appendChild(c.current),()=>{!n&&!r&&c.current&&document.body.removeChild(c.current)}),[n]),!o||!c.current?null:(0,Wl.createPortal)((0,N.jsx)(N.Fragment,{children:t}),c.current)});wd.displayName=`@mantine/core/Portal`;var Td=g(({withinPortal:e=!0,children:t,...n})=>y()===`test`||!e?(0,N.jsx)(N.Fragment,{children:t}):(0,N.jsx)(wd,{...n,children:t}));Td.displayName=`@mantine/core/OptionalPortal`;var Ed={duration:100,transition:`fade`};function Dd(e,t){return{...Ed,...t,...e}}var[Od,kd]=Sa(`Popover component was not found in the tree`);function Ad({childProps:e,disabled:t,opened:n,longPressDelay:r=500,setReference:i,open:a}){let o=(0,M.useRef)(!1),s=(0,M.useRef)(!1),c=(0,M.useRef)(null),l=(0,M.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=Ma(e.onMouseDown,e=>{t||e.button===2&&e.stopPropagation()}),f=Ma(e.onContextMenu,e=>{t||e.defaultPrevented||(e.preventDefault(),!s.current&&(u(e.clientX,e.clientY,e.currentTarget),o.current&&(s.current=!0)))}),p=so(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:Ma(e.onTouchStart,p.onTouchStart),onTouchEnd:Ma(e.onTouchEnd,p.onTouchEnd),onTouchCancel:Ma(e.onTouchCancel,p.onTouchCancel),onTouchMove:Ma(e.onTouchMove,p.onTouchMove),style:t?e.style:{...e.style,WebkitTouchCallout:`none`,WebkitUserSelect:`none`,userSelect:`none`},"data-expanded":n?!0:void 0}}function jd(e){let{children:t,disabled:n,longPressDelay:r}=D(`PopoverContextMenu`,null,e),i=mo(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=kd();return(0,M.cloneElement)(i,Ad({childProps:i.props,disabled:n||a.disabled,opened:a.opened,longPressDelay:r,setReference:a.reference,open:()=>{a.opened||a.onToggle()}}))}jd.displayName=`@mantine/core/PopoverContextMenu`;function Md({children:e,active:t=!0,refProp:n=`ref`,innerRef:r}){let i=ro($a(t),r),a=mo(e);return a?(0,M.cloneElement)(a,{[n]:i}):e}function Nd(e){return(0,N.jsx)(sd,{tabIndex:-1,"data-autofocus":!0,...e})}Md.displayName=`@mantine/core/FocusTrap`,Nd.displayName=`@mantine/core/FocusTrapInitialFocus`,Md.InitialFocus=Nd;var Pd={dropdown:`m_38a85659`,arrow:`m_a31dc6c1`,overlay:`m_3d7bc908`},Fd=g(e=>{let t=D(`PopoverDropdown`,null,e),{className:n,style:r,vars:i,children:a,onKeyDownCapture:o,variant:s,classNames:c,styles:l,ref:u,...d}=t,f=kd(),{dir:p}=Vo(),m=f.arrowPosition===`merge`&&f.withArrow?pd({position:f.placement,dir:p}):void 0,h=Ua({opened:f.opened,shouldReturnFocus:f.returnFocus}),g=f.withRoles?{"aria-labelledby":f.getTargetId(),id:f.getDropdownId(),role:`dialog`,tabIndex:-1}:{},_=ro(u,f.floating);return f.disabled?null:(0,N.jsx)(Td,{...f.portalProps,withinPortal:f.withinPortal,children:(0,N.jsx)(Ve,{mounted:f.opened,...f.transitionProps,transition:f.transitionProps?.transition||`fade`,duration:f.transitionProps?.duration??150,keepMounted:f.keepMounted,keepMountedMode:f.keepMountedMode,exitDuration:typeof f.transitionProps?.exitDuration==`number`?f.transitionProps.exitDuration:f.transitionProps?.duration,children:e=>(0,N.jsx)(Md,{active:f.trapFocus&&f.opened,innerRef:_,children:(0,N.jsxs)(Be,{...g,...d,variant:s,onKeyDownCapture:ja(()=>{f.onClose?.(),f.onDismiss?.()},{active:f.closeOnEscape,onTrigger:h,onKeyDown:o}),"data-position":f.placement,"data-fixed":f.floatingStrategy===`fixed`||void 0,...f.getStyles(`dropdown`,{className:n,props:t,classNames:c,styles:l,style:[{...e,...m,zIndex:f.zIndex,top:f.y??0,left:f.x??0,width:f.width===`target`?void 0:j(f.width),...f.referenceHidden?{display:`none`}:null},f.resolvedStyles?.dropdown,l?.dropdown,r]}),children:[a,(0,N.jsx)(md,{ref:f.arrowRef,arrowX:f.arrowX,arrowY:f.arrowY,visible:f.withArrow,position:f.placement,arrowSize:f.arrowSize,arrowRadius:f.arrowRadius,arrowOffset:f.arrowOffset,arrowPosition:f.arrowPosition,...f.getStyles(`arrow`,{props:t,classNames:c,styles:l})})]})})})})});Fd.classes=Pd,Fd.displayName=`@mantine/core/PopoverDropdown`;var Id={refProp:`ref`,popupType:`dialog`},Ld=g(e=>{let{children:t,refProp:n,popupType:r,ref:i,...a}=D(`PopoverTarget`,Id,e),o=mo(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=kd(),l=ro(c.reference,po(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,M.cloneElement)(o,{...s,...u,...c.targetProps,className:ae(c.targetProps.className,s.className,d.className),[n]:l,...c.controlled?null:{onClick:e=>{c.onToggle(),d.onClick?.(e)}}})});Ld.displayName=`@mantine/core/PopoverTarget`;function Rd(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 zd(e,t,n,r){let i=Rd(e.middlewares),a=[Ql(e.offset),ru()];if(i.flip&&!n){let e=typeof i.flip==`boolean`?{}:i.flip,t=r?{fallbackStrategy:`initialPlacement`,...e}:e;a.push(tu(t))}if(i.shift){let t=typeof i.shift==`boolean`?{}:i.shift;a.push($l(n=>{let r=n.placement.startsWith(`top`)||n.placement.startsWith(`bottom`);return{limiter:eu(),padding:5,...e.width===`target`&&r?{mainAxis:!1}:null,...t}}))}return i.inline&&a.push(typeof i.inline==`boolean`?iu():iu(i.inline)),a.push(au({element:e.arrowRef,padding:e.arrowOffset})),(i.size||e.width===`target`)&&a.push(nu({...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 Bd(e){let[t,n]=io({value:e.opened,defaultValue:e.defaultOpened,finalValue:!1,onChange:e.onChange}),r=(0,M.useRef)(t),[i,a]=(0,M.useState)(null),o=e.preventPositionChangeWhenVisible!==!1,s=(0,M.useRef)(t);t!==s.current&&(s.current=t,t&&i!==null&&a(null));let c=(0,M.useCallback)(()=>a(null),[]),l=()=>{t&&!e.disabled&&n(!1)},u=()=>{e.disabled||n(!t)},d=Gu({open:t,strategy:e.strategy,placement:o?i??e.position:e.position,middleware:zd(e,()=>d,o&&i!==null,o),whileElementsMounted:e.keepMounted?void 0:Pl});(0,M.useEffect)(()=>{if(!e.keepMounted)return;let n=d.refs.reference.current,r=d.refs.floating.current;if(t&&n&&r)return Pl(n,r,d.update)},[e.keepMounted,t,d.update,d.elements.reference,d.elements.floating]);let f=(0,M.useRef)(!1);Ee(()=>{if(!t){f.current=!1;return}if(!o||i!==null)return;let e=d.refs.floating.current;if(e&&e.offsetHeight!==0&&e.offsetWidth!==0){if(!f.current){f.current=!0,d.update();return}d.isPositioned&&a(d.placement)}},[o,t,d.isPositioned,d.placement,i,d.update]);let p=(0,M.useRef)(d.placement);return Ee(()=>{p.current!==d.placement&&(p.current=d.placement,e.onPositionChange?.(d.placement))},[d.placement]),Ie(()=>{t!==r.current&&(t?e.onOpen?.():e.onClose?.()),r.current=t},[t,e.onClose,e.onOpen]),{floating:d,controlled:typeof e.opened==`boolean`,opened:t,onClose:l,onToggle:u,resetLockedPlacement:c}}var Vd={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`],zIndex:ka(`popover`),__staticSelector:`Popover`,width:`max-content`},Hd=O((e,{radius:t,shadow:n})=>({dropdown:{"--popover-radius":t===void 0?void 0:ce(t),"--popover-shadow":De(n)}}));function Ud(e){let t=D(`Popover`,Vd,e),{children:n,position:r,offset:i,onPositionChange:a,opened:o,transitionProps:s,onExitTransitionEnd:c,onEnterTransitionEnd:l,width:u,middlewares:d,withArrow:f,arrowSize:p,arrowOffset:m,arrowRadius:h,arrowPosition:g,unstyled:_,classNames:v,styles:b,closeOnClickOutside:x,withinPortal:S,portalProps:C,closeOnEscape:E,clickOutsideEvents:O,trapFocus:k,onClose:ee,onDismiss:te,onOpen:ne,onChange:re,zIndex:A,radius:ie,shadow:ae,id:oe,defaultOpened:se,__staticSelector:ce,withRoles:le,disabled:ue,returnFocus:de,variant:fe,keepMounted:j,keepMountedMode:me,vars:he,floatingStrategy:ge,withOverlay:_e,overlayProps:ve,hideDetached:ye,attributes:be,preventPositionChangeWhenVisible:xe,...Se}=t,Ce=w({name:ce,props:t,classes:Pd,classNames:v,styles:b,unstyled:_,attributes:be,rootSelector:`dropdown`,vars:he,varsResolver:Hd}),{resolvedStyles:we}=T({classNames:v,styles:b,props:t}),Te=(0,M.useRef)(null),[Ee,De]=(0,M.useState)(null),[Oe,ke]=(0,M.useState)(null),{dir:Ae}=Vo(),je=y(),Me=pe(oe),Ne=Bd({middlewares:d,width:u,position:hd(Ae,r),offset:typeof i==`number`?i+(f?p/2:0):i,arrowRef:Te,arrowOffset:m,onPositionChange:a,opened:o,defaultOpened:se,onChange:re,onOpen:ne,onClose:ee,onDismiss:te,strategy:ge,disabled:ue,preventPositionChangeWhenVisible:xe,keepMounted:j});Ba(()=>{x&&(Ne.onClose(),te?.())},O,[Ee,Oe]);let Pe=(0,M.useCallback)(e=>{De(e),Ne.floating.refs.setReference(e)},[Ne.floating.refs.setReference]),Fe=(0,M.useCallback)(e=>{ke(e),Ne.floating.refs.setFloating(e)},[Ne.floating.refs.setFloating]),Ie=(0,M.useCallback)(()=>{s?.onExited?.(),c?.(),Ne.resetLockedPlacement()},[s?.onExited,c,Ne.resetLockedPlacement]),Le=(0,M.useCallback)(()=>{s?.onEntered?.(),l?.()},[s?.onEntered,l]);return(0,N.jsxs)(Od,{value:{returnFocus:de,disabled:ue,controlled:Ne.controlled,reference:Pe,floating:Fe,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:Ie,onEntered:Le},width:u,withArrow:f,arrowSize:p,arrowOffset:m,arrowRadius:h,arrowPosition:g,placement:Ne.floating.placement,trapFocus:k,withinPortal:S,portalProps:C,zIndex:A,radius:ie,shadow:ae,closeOnEscape:E,onDismiss:te,onClose:Ne.onClose,onToggle:Ne.onToggle,getTargetId:()=>Me,getDropdownId:()=>`${Me}-dropdown`,withRoles:le,targetProps:Se,__staticSelector:ce,classNames:v,styles:b,unstyled:_,variant:fe,keepMounted:j,keepMountedMode:me,getStyles:Ce,resolvedStyles:we,floatingStrategy:ge,referenceHidden:ye&&je!==`test`?Ne.floating.middlewareData.hide?.referenceHidden:!1},children:[n,_e&&(0,N.jsx)(Ve,{transition:`fade`,mounted:Ne.opened,duration:s?.duration||250,exitDuration:s?.exitDuration||250,children:e=>(0,N.jsx)(Td,{withinPortal:S,children:(0,N.jsx)(bd,{...ve,...Ce(`overlay`,{className:ve?.className,style:[e,ve?.style]})})})})]})}Ud.Target=Ld,Ud.Dropdown=Fd,Ud.ContextMenu=jd,Ud.varsResolver=Hd,Ud.displayName=`@mantine/core/Popover`,Ud.extend=e=>e,Ud.withProps=e=>{let t=t=>(0,N.jsx)(Ud,{...e,...t});return t.extend=Ud.extend,t.displayName=`WithProps(${Ud.displayName})`,t};var Wd={root:`m_8d3f4000`,icon:`m_8d3afb97`,loader:`m_302b9fb1`,group:`m_1a0f1b21`,groupSection:`m_437b6484`},Gd={orientation:`horizontal`},Kd=O((e,{borderWidth:t})=>({group:{"--ai-border-width":j(t)}})),qd=g(e=>{let t=D(`ActionIconGroup`,Gd,e),{className:n,style:r,classNames:i,styles:a,unstyled:o,orientation:s,vars:c,borderWidth:l,variant:u,mod:d,attributes:f,...p}=t;return(0,N.jsx)(Be,{...w({name:`ActionIconGroup`,props:t,classes:Wd,className:n,style:r,classNames:i,styles:a,unstyled:o,attributes:f,vars:c,varsResolver:Kd,rootSelector:`group`})(`group`),variant:u,mod:[{"data-orientation":s},d],role:`group`,...p})});qd.classes=Wd,qd.varsResolver=Kd,qd.displayName=`@mantine/core/ActionIconGroup`;var Jd=O((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":Pe(o,`section-height`),"--section-padding-x":Pe(o,`section-padding-x`),"--section-fz":ye(o),"--section-radius":t===void 0?void 0:ce(t),"--section-bg":n||i?s.background:void 0,"--section-color":s.color,"--section-bd":n||i?s.border:void 0}}}),Yd=g(e=>{let t=D(`ActionIconGroupSection`,null,e),{className:n,style:r,classNames:i,styles:a,unstyled:o,vars:s,variant:c,gradient:l,radius:u,autoContrast:d,attributes:f,...p}=t;return(0,N.jsx)(Be,{...w({name:`ActionIconGroupSection`,props:t,classes:Wd,className:n,style:r,classNames:i,styles:a,unstyled:o,attributes:f,vars:s,varsResolver:Jd,rootSelector:`groupSection`})(`groupSection`),variant:c,...p})});Yd.classes=Wd,Yd.varsResolver=Jd,Yd.displayName=`@mantine/core/ActionIconGroupSection`;var Xd=O((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:{"--ai-size":Pe(t,`ai-size`),"--ai-radius":n===void 0?void 0:ce(n),"--ai-bg":a||r?s.background:void 0,"--ai-hover":a||r?s.hover:void 0,"--ai-hover-color":a||r?s.hoverColor:void 0,"--ai-color":s.color,"--ai-bd":a||r?s.border:void 0}}}),Zd=te(e=>{let t=D(`ActionIcon`,null,e),{className:n,unstyled:r,variant:i,classNames:a,styles:o,style:s,loading:c,loaderProps:l,size:u,color:d,radius:f,__staticSelector:p,gradient:m,vars:g,children:_,disabled:v,"data-disabled":y,autoContrast:b,mod:x,attributes:S,...C}=t,T=w({name:[`ActionIcon`,p],props:t,className:n,style:s,classes:Wd,classNames:a,styles:o,unstyled:r,attributes:S,vars:g,varsResolver:Xd});return(0,N.jsxs)(h,{...T(`root`,{active:!v&&!c&&!y}),"aria-busy":c||void 0,...C,unstyled:r,variant:i,size:u,disabled:v||c,mod:[{loading:c,disabled:v||y},x],children:[typeof c==`boolean`&&(0,N.jsx)(Ve,{mounted:c,transition:`slide-down`,duration:150,children:e=>(0,N.jsx)(Be,{component:`span`,...T(`loader`,{style:e}),"aria-hidden":!0,children:(0,N.jsx)(le,{color:`var(--ai-color)`,size:`calc(var(--ai-size) * 0.55)`,...l})})}),(0,N.jsx)(Be,{component:`span`,mod:{loading:c},...T(`icon`),children:_})]})});Zd.classes=Wd,Zd.varsResolver=Xd,Zd.displayName=`@mantine/core/ActionIcon`,Zd.Group=qd,Zd.GroupSection=Yd;var[Qd,$d]=Sa(`ModalBase component was not found in tree`);function ef({opened:e,transitionDuration:t}){let[n,r]=(0,M.useState)(e),i=(0,M.useRef)(-1),a=p()?0:t;return(0,M.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 tf({id:e,transitionProps:t,opened:n,trapFocus:r,closeOnEscape:i,onClose:a,returnFocus:o}){let s=pe(e),[c,l]=(0,M.useState)(!1),[u,d]=(0,M.useState)(!1),f=ef({opened:n,transitionDuration:typeof t?.duration==`number`?t?.duration:200});return eo(`keydown`,e=>{e.key===`Escape`&&i&&!e.isComposing&&n&&e.target?.getAttribute(`data-mantine-stop-propagation`)!==`true`&&a()},{capture:!0}),Ua({opened:n,shouldReturnFocus:r&&o}),{_id:s,titleMounted:c,bodyMounted:u,shouldLockScroll:f,setTitleMounted:l,setBodyMounted:d}}var nf=function(e,t){return nf=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])},nf(e,t)};function rf(e,t){if(typeof t!=`function`&&t!==null)throw TypeError(`Class extends value `+String(t)+` is not a constructor or null`);nf(e,t);function n(){this.constructor=e}e.prototype=t===null?Object.create(t):(n.prototype=t.prototype,new n)}var af=function(){return af=Object.assign||function(e){for(var t,n=1,r=arguments.length;n0&&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 uf(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 df(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 ff?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 mf(e){if(!Symbol.asyncIterator)throw TypeError(`Symbol.asyncIterator is not defined.`);var t=e[Symbol.asyncIterator],n;return t?t.call(e):(e=typeof lf==`function`?lf(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)}}var hf=`right-scroll-bar-position`,gf=`width-before-scroll-bar`,_f=`with-scroll-bars-hidden`,vf=`--removed-body-scroll-bar-size`;function yf(e,t){return typeof e==`function`?e(t):e&&(e.current=t),e}function bf(e,t){var n=(0,M.useState)(function(){return{value:e,callback:t,facade:{get current(){return n.value},set current(e){var t=n.value;t!==e&&(n.value=e,n.callback(e,t))}}}})[0];return n.callback=t,n.facade}var xf=typeof window<`u`?M.useLayoutEffect:M.useEffect,Sf=new WeakMap;function Cf(e,t){var n=bf(t||null,function(t){return e.forEach(function(e){return yf(e,t)})});return xf(function(){var t=Sf.get(n);if(t){var r=new Set(t),i=new Set(e),a=n.current;r.forEach(function(e){i.has(e)||yf(e,null)}),i.forEach(function(e){r.has(e)||yf(e,a)})}Sf.set(n,e)},[e]),n}function wf(e){return e}function Tf(e,t){t===void 0&&(t=wf);var n=[],r=!1;return{read:function(){if(r)throw Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return n.length?n[n.length-1]:e},useMedium:function(e){var i=t(e,r);return n.push(i),function(){n=n.filter(function(e){return e!==i})}},assignSyncMedium:function(e){for(r=!0;n.length;){var t=n;n=[],t.forEach(e)}n={push:function(t){return e(t)},filter:function(){return n}}},assignMedium:function(e){r=!0;var t=[];if(n.length){var i=n;n=[],i.forEach(e),t=n}var a=function(){var n=t;t=[],n.forEach(e)},o=function(){return Promise.resolve().then(a)};o(),n={push:function(e){t.push(e),o()},filter:function(e){return t=t.filter(e),n}}}}}function Ef(e){e===void 0&&(e={});var t=Tf(null);return t.options=af({async:!0,ssr:!1},e),t}var Df=function(e){var t=e.sideCar,n=of(e,[`sideCar`]);if(!t)throw Error("Sidecar: please provide `sideCar` property to import the right car");var r=t.read();if(!r)throw Error(`Sidecar medium not found`);return M.createElement(r,af({},n))};Df.isSideCarExport=!0;function Of(e,t){return e.useMedium(t),Df}var kf=Ef(),Af=function(){},jf=M.forwardRef(function(e,t){var n=M.useRef(null),r=M.useState({onScrollCapture:Af,onWheelCapture:Af,onTouchMoveCapture:Af}),i=r[0],a=r[1],o=e.forwardProps,s=e.children,c=e.className,l=e.removeScrollBar,u=e.enabled,d=e.shards,f=e.sideCar,p=e.noRelative,m=e.noIsolation,h=e.inert,g=e.allowPinchZoom,_=e.as,v=_===void 0?`div`:_,y=e.gapMode,b=of(e,[`forwardProps`,`children`,`className`,`removeScrollBar`,`enabled`,`shards`,`sideCar`,`noRelative`,`noIsolation`,`inert`,`allowPinchZoom`,`as`,`gapMode`]),x=f,S=Cf([n,t]),C=af(af({},b),i);return M.createElement(M.Fragment,null,u&&M.createElement(x,{sideCar:kf,removeScrollBar:l,shards:d,noRelative:p,noIsolation:m,inert:h,setCallbacks:a,allowPinchZoom:!!g,lockRef:n,gapMode:y}),o?M.cloneElement(M.Children.only(s),af(af({},C),{ref:S})):M.createElement(v,af({},C,{className:c,ref:S}),s))});jf.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1},jf.classNames={fullWidth:gf,zeroRight:hf};var Mf=function(){if(typeof __webpack_nonce__<`u`)return __webpack_nonce__};function Nf(){if(!document)return null;var e=document.createElement(`style`);e.type=`text/css`;var t=Mf();return t&&e.setAttribute(`nonce`,t),e}function Pf(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function Ff(e){(document.head||document.getElementsByTagName(`head`)[0]).appendChild(e)}var If=function(){var e=0,t=null;return{add:function(n){e==0&&(t=Nf())&&(Pf(t,n),Ff(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},Lf=function(){var e=If();return function(t,n){M.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&n])}},Rf=function(){var e=Lf();return function(t){var n=t.styles,r=t.dynamic;return e(n,r),null}},zf={left:0,top:0,right:0,gap:0},Bf=function(e){return parseInt(e||``,10)||0},Vf=function(e){var t=window.getComputedStyle(document.body),n=t[e===`padding`?`paddingLeft`:`marginLeft`],r=t[e===`padding`?`paddingTop`:`marginTop`],i=t[e===`padding`?`paddingRight`:`marginRight`];return[Bf(n),Bf(r),Bf(i)]},Hf=function(e){if(e===void 0&&(e=`margin`),typeof window>`u`)return zf;var t=Vf(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])}},Uf=Rf(),Wf=`data-scroll-locked`,Gf=function(e,t,n,r){var i=e.left,a=e.top,o=e.right,s=e.gap;return n===void 0&&(n=`margin`),` + .${_f} { + overflow: hidden ${r}; + padding-right: ${s}px ${r}; + } + body[${Wf}] { + 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(``)} + } + + .${hf} { + right: ${s}px ${r}; + } + + .${gf} { + margin-right: ${s}px ${r}; + } + + .${hf} .${hf} { + right: 0 ${r}; + } + + .${gf} .${gf} { + margin-right: 0 ${r}; + } + + body[${Wf}] { + ${vf}: ${s}px; + } +`},Kf=function(){var e=parseInt(document.body.getAttribute(`data-scroll-locked`)||`0`,10);return isFinite(e)?e:0},qf=function(){M.useEffect(function(){return document.body.setAttribute(Wf,(Kf()+1).toString()),function(){var e=Kf()-1;e<=0?document.body.removeAttribute(Wf):document.body.setAttribute(Wf,e.toString())}},[])},Jf=function(e){var t=e.noRelative,n=e.noImportant,r=e.gapMode,i=r===void 0?`margin`:r;qf();var a=M.useMemo(function(){return Hf(i)},[i]);return M.createElement(Uf,{styles:Gf(a,!t,i,n?``:`!important`)})},Yf=!1;if(typeof window<`u`)try{var Xf=Object.defineProperty({},"passive",{get:function(){return Yf=!0,!0}});window.addEventListener(`test`,Xf,Xf),window.removeEventListener(`test`,Xf,Xf)}catch{Yf=!1}var Zf=Yf?{passive:!1}:!1,Qf=function(e){return e.tagName===`TEXTAREA`},$f=function(e,t){if(!(e instanceof Element))return!1;var n=window.getComputedStyle(e);return n[t]!==`hidden`&&!(n.overflowY===n.overflowX&&!Qf(e)&&n[t]===`visible`)},ep=function(e){return $f(e,`overflowY`)},tp=function(e){return $f(e,`overflowX`)},np=function(e,t){var n=t.ownerDocument,r=t;do{if(typeof ShadowRoot<`u`&&r instanceof ShadowRoot&&(r=r.host),ap(e,r)){var i=op(e,r);if(i[1]>i[2])return!0}r=r.parentNode}while(r&&r!==n.body);return!1},rp=function(e){return[e.scrollTop,e.scrollHeight,e.clientHeight]},ip=function(e){return[e.scrollLeft,e.scrollWidth,e.clientWidth]},ap=function(e,t){return e===`v`?ep(t):tp(t)},op=function(e,t){return e===`v`?rp(t):ip(t)},sp=function(e,t){return e===`h`&&t===`rtl`?-1:1},cp=function(e,t,n,r,i){var a=sp(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=op(e,s),m=p[0],h=p[1]-p[2]-a*m;(m||h)&&ap(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},lp=function(e){return`changedTouches`in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},up=function(e){return[e.deltaX,e.deltaY]},dp=function(e){return e&&`current`in e?e.current:e},fp=function(e,t){return e[0]===t[0]&&e[1]===t[1]},pp=function(e){return` + .block-interactivity-${e} {pointer-events: none;} + .allow-interactivity-${e} {pointer-events: all;} +`},mp=0,hp=[];function gp(e){var t=M.useRef([]),n=M.useRef([0,0]),r=M.useRef(),i=M.useState(mp++)[0],a=M.useState(Rf)[0],o=M.useRef(e);M.useEffect(function(){o.current=e},[e]),M.useEffect(function(){if(e.inert){document.body.classList.add(`block-interactivity-${i}`);var t=df([e.lockRef.current],(e.shards||[]).map(dp),!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=M.useCallback(function(e,t){if(`touches`in e&&e.touches.length===2||e.type===`wheel`&&e.ctrlKey)return!o.current.allowPinchZoom;var i=lp(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=np(d,u);if(!m)return!0;if(m?l=d:(l=d===`v`?`h`:`v`,m=np(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 cp(h,t,e,h===`h`?s:c,!0)},[]),c=M.useCallback(function(e){var n=e;if(hp.length&&hp[hp.length-1]===a){var r=`deltaY`in n?up(n):lp(n),i=t.current.filter(function(e){return e.name===n.type&&(e.target===n.target||n.target===e.shadowParent)&&fp(e.delta,r)})[0];if(i&&i.should){n.cancelable&&n.preventDefault();return}if(!i){var c=(o.current.shards||[]).map(dp).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=M.useCallback(function(e,n,r,i){var a={name:e,delta:n,target:r,should:i,shadowParent:_p(r)};t.current.push(a),setTimeout(function(){t.current=t.current.filter(function(e){return e!==a})},1)},[]),u=M.useCallback(function(e){n.current=lp(e),r.current=void 0},[]),d=M.useCallback(function(t){l(t.type,up(t),t.target,s(t,e.lockRef.current))},[]),f=M.useCallback(function(t){l(t.type,lp(t),t.target,s(t,e.lockRef.current))},[]);M.useEffect(function(){return hp.push(a),e.setCallbacks({onScrollCapture:d,onWheelCapture:d,onTouchMoveCapture:f}),document.addEventListener(`wheel`,c,Zf),document.addEventListener(`touchmove`,c,Zf),document.addEventListener(`touchstart`,u,Zf),function(){hp=hp.filter(function(e){return e!==a}),document.removeEventListener(`wheel`,c,Zf),document.removeEventListener(`touchmove`,c,Zf),document.removeEventListener(`touchstart`,u,Zf)}},[]);var p=e.removeScrollBar,m=e.inert;return M.createElement(M.Fragment,null,m?M.createElement(a,{styles:pp(i)}):null,p?M.createElement(Jf,{noRelative:e.noRelative,gapMode:e.gapMode}):null)}function _p(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}var vp=Of(kf,gp),yp=M.forwardRef(function(e,t){return M.createElement(jf,af({},e,{ref:t,sideCar:vp}))});yp.classNames=jf.classNames;function bp({keepMounted:e,keepMountedMode:t=`activity`,opened:n,onClose:r,id:i,transitionProps:a,onExitTransitionEnd:o,onEnterTransitionEnd:s,trapFocus:c,closeOnEscape:l,returnFocus:u,closeOnClickOutside:d,withinPortal:f,portalProps:p,lockScroll:m,children:h,zIndex:g,shadow:_,padding:v,__vars:y,unstyled:b,removeScrollProps:x,...S}){let{_id:C,titleMounted:w,bodyMounted:T,shouldLockScroll:E,setTitleMounted:D,setBodyMounted:O}=tf({id:i,transitionProps:a,opened:n,trapFocus:c,closeOnEscape:l,onClose:r,returnFocus:u}),{key:k,...ee}=x||{};return(0,N.jsx)(Td,{...p,withinPortal:f,children:(0,N.jsx)(Qd,{value:{opened:n,onClose:r,closeOnClickOutside:d,onExitTransitionEnd:o,onEnterTransitionEnd:s,transitionProps:{...a,keepMounted:e,keepMountedMode:t},getTitleId:()=>`${C}-title`,getBodyId:()=>`${C}-body`,titleMounted:w,bodyMounted:T,setTitleMounted:D,setBodyMounted:O,trapFocus:c,closeOnEscape:l,zIndex:g,unstyled:b},children:(0,N.jsx)(yp,{enabled:E&&m,...ee,children:(0,N.jsx)(Be,{...S,id:C,__vars:{...y,"--mb-z-index":(g||ka(`modal`)).toString(),"--mb-shadow":De(_),"--mb-padding":de(v)},children:h})},k)})})}bp.displayName=`@mantine/core/ModalBase`;function xp(){let e=$d();return(0,M.useEffect)(()=>(e.setBodyMounted(!0),()=>e.setBodyMounted(!1)),[]),e.getBodyId()}var Sp={title:`m_615af6c9`,header:`m_b5489c3c`,inner:`m_60c222c7`,content:`m_fd1ab0aa`,close:`m_606cb269`,body:`m_5df29311`};function Cp({className:e,...t}){let n=xp(),r=$d();return(0,N.jsx)(Be,{id:n,className:ae({[Sp.body]:!r.unstyled},e),...t})}Cp.displayName=`@mantine/core/ModalBaseBody`;function wp({className:e,onClick:t,...n}){let r=$d();return(0,N.jsx)(He,{...n,onClick:e=>{r.onClose(),t?.(e)},className:ae({[Sp.close]:!r.unstyled},e),unstyled:r.unstyled})}wp.displayName=`@mantine/core/ModalBaseCloseButton`;function Tp({transitionProps:e,className:t,innerProps:n,onKeyDown:r,style:i,ref:a,...o}){let s=$d();return(0,N.jsx)(Ve,{mounted:s.opened,transition:`pop`,...s.transitionProps,onExited:()=>{s.onExitTransitionEnd?.(),s.transitionProps?.onExited?.()},onEntered:()=>{s.onEnterTransitionEnd?.(),s.transitionProps?.onEntered?.()},...e,children:e=>(0,N.jsx)(`div`,{...n,className:ae({[Sp.inner]:!s.unstyled},n.className),children:(0,N.jsx)(Md,{active:s.opened&&s.trapFocus,innerRef:a,children:(0,N.jsx)(ee,{...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:ae({[Sp.content]:!s.unstyled},t),unstyled:s.unstyled,children:o.children})})})})}Tp.displayName=`@mantine/core/ModalBaseContent`;function Ep({className:e,...t}){let n=$d();return(0,N.jsx)(Be,{component:`header`,className:ae({[Sp.header]:!n.unstyled},e),...t})}Ep.displayName=`@mantine/core/ModalBaseHeader`;var Dp={duration:200,timingFunction:`ease`,transition:`fade`};function Op(e){let t=$d();return{...Dp,...t.transitionProps,...e}}function kp({onClick:e,transitionProps:t,style:n,visible:r,...i}){let a=$d(),o=Op(t);return(0,N.jsx)(Ve,{mounted:r===void 0?a.opened:r,...o,transition:`fade`,children:t=>(0,N.jsx)(bd,{fixed:!0,style:[n,t],zIndex:a.zIndex,unstyled:a.unstyled,onClick:t=>{e?.(t),a.closeOnClickOutside&&a.onClose()},...i})})}kp.displayName=`@mantine/core/ModalBaseOverlay`;function Ap(){let e=$d();return(0,M.useEffect)(()=>(e.setTitleMounted(!0),()=>e.setTitleMounted(!1)),[]),e.getTitleId()}function jp({className:e,...t}){let n=Ap(),r=$d();return(0,N.jsx)(Be,{component:`h2`,className:ae({[Sp.title]:!r.unstyled},e),id:n,...t})}jp.displayName=`@mantine/core/ModalBaseTitle`;function Mp({children:e}){return(0,N.jsx)(N.Fragment,{children:e})}function Np({style:e,size:t=16,...n}){return(0,N.jsx)(`svg`,{viewBox:`0 0 15 15`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`,style:{...e,width:j(t),height:j(t),display:`block`},...n,children:(0,N.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`})})}Np.displayName=`@mantine/core/AccordionChevron`;var[Pp,Fp]=Sa(`AppShell was not found in tree`),Ip={root:`m_89ab340`,navbar:`m_45252eee`,aside:`m_9cdde9a`,header:`m_3b16f56b`,main:`m_8983817`,footer:`m_3840c879`,section:`m_6dcfc7c7`},Lp=g(e=>{let{classNames:t,className:n,style:r,styles:i,unstyled:a,vars:o,withBorder:s,zIndex:c,mod:l,...u}=D(`AppShellAside`,null,e),d=Fp();return d.disabled?null:(0,N.jsx)(Be,{component:`aside`,mod:[{"with-border":s??d.withBorder},l],...d.getStyles(`aside`,{className:ae({[yp.classNames.zeroRight]:d.offsetScrollbars},n),classNames:t,styles:i,style:r}),...u,__vars:{"--app-shell-aside-z-index":`calc(${c??d.zIndex} + 1)`}})});Lp.classes=Ip,Lp.displayName=`@mantine/core/AppShellAside`;var Rp=g(e=>{let{classNames:t,className:n,style:r,styles:i,unstyled:a,vars:o,withBorder:s,zIndex:c,mod:l,...u}=D(`AppShellFooter`,null,e),d=Fp();return d.disabled?null:(0,N.jsx)(Be,{component:`footer`,mod:[{"with-border":s??d.withBorder},l],...d.getStyles(`footer`,{className:ae({[yp.classNames.zeroRight]:d.offsetScrollbars},n),classNames:t,styles:i,style:r}),...u,__vars:{"--app-shell-footer-z-index":(c??d.zIndex)?.toString()}})});Rp.classes=Ip,Rp.displayName=`@mantine/core/AppShellFooter`;var zp=g(e=>{let{classNames:t,className:n,style:r,styles:i,unstyled:a,vars:o,withBorder:s,zIndex:c,mod:l,...u}=D(`AppShellHeader`,null,e),d=Fp();return d.disabled?null:(0,N.jsx)(Be,{component:`header`,mod:[{"with-border":s??d.withBorder},l],...d.getStyles(`header`,{className:ae({[yp.classNames.zeroRight]:d.offsetScrollbars},n),classNames:t,styles:i,style:r}),...u,__vars:{"--app-shell-header-z-index":(c??d.zIndex)?.toString()}})});zp.classes=Ip,zp.displayName=`@mantine/core/AppShellHeader`;var Bp=g(e=>{let{classNames:t,className:n,style:r,styles:i,vars:a,...o}=D(`AppShellMain`,null,e);return(0,N.jsx)(Be,{component:`main`,...Fp().getStyles(`main`,{className:n,style:r,classNames:t,styles:i}),...o})});Bp.classes=Ip,Bp.displayName=`@mantine/core/AppShellMain`;var Vp=g(e=>{let{classNames:t,className:n,style:r,styles:i,unstyled:a,vars:o,withBorder:s,zIndex:c,mod:l,...u}=D(`AppShellNavbar`,null,e),d=Fp();return d.disabled?null:(0,N.jsx)(Be,{component:`nav`,mod:[{"with-border":s??d.withBorder},l],...d.getStyles(`navbar`,{className:n,classNames:t,styles:i,style:r}),...u,__vars:{"--app-shell-navbar-z-index":`calc(${c??d.zIndex} + 1)`}})});Vp.classes=Ip,Vp.displayName=`@mantine/core/AppShellNavbar`;var Hp=te(e=>{let{classNames:t,className:n,style:r,styles:i,vars:a,grow:o,mod:s,...c}=D(`AppShellSection`,null,e),l=Fp();return(0,N.jsx)(Be,{mod:[{grow:o},s],...l.getStyles(`section`,{className:n,style:r,classNames:t,styles:i}),...c})});Hp.classes=Ip,Hp.displayName=`@mantine/core/AppShellSection`;function Up(e){return typeof e==`object`?e.base:e}function Wp(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 Gp(e){return!(typeof e!=`object`||!e||Object.keys(e).length===1&&`base`in e)}function Kp({baseStyles:e,minMediaStyles:t,maxMediaStyles:n,aside:r,theme:i,mode:a}){let o=r?.width,s=`translateX(var(--app-shell-aside-width))`,c=`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`)),Wp(o)){let t=j(Up(o));e[`--app-shell-aside-width`]=t,e[`--app-shell-aside-offset`]=t}if(Gp(o)&&(o.base!==void 0&&(e[`--app-shell-aside-width`]=j(o.base),e[`--app-shell-aside-offset`]=j(o.base)),ke(o).forEach(e=>{e!==`base`&&(t[e]=t[e]||{},t[e][`--app-shell-aside-width`]=j(o[e]),t[e][`--app-shell-aside-offset`]=j(o[e]))})),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`]=s,t[e][`--app-shell-aside-transform-rtl`]=c,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`}if(r?.collapsed?.mobile){let e=Na(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`]=s,n[e][`--app-shell-aside-transform-rtl`]=c,n[e][`--app-shell-aside-scroll-locked-visibility`]=`hidden`}}function qp({baseStyles:e,minMediaStyles:t,footer:n,mode:r}){let i=n?.height,a=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`),Wp(i)){let t=j(Up(i));e[`--app-shell-footer-height`]=t,a&&(e[`--app-shell-footer-offset`]=t)}Gp(i)&&(i.base!==void 0&&(e[`--app-shell-footer-height`]=j(i.base),a&&(e[`--app-shell-footer-offset`]=j(i.base))),ke(i).forEach(e=>{e!==`base`&&(t[e]=t[e]||{},t[e][`--app-shell-footer-height`]=j(i[e]),a&&(t[e][`--app-shell-footer-offset`]=j(i[e])))})),n?.collapsed&&(e[`--app-shell-footer-transform`]=`translateY(var(--app-shell-footer-height))`,r===`fixed`&&(e[`--app-shell-footer-offset`]=`0px !important`))}function Jp({baseStyles:e,minMediaStyles:t,header:n,mode:r}){let i=n?.height,a=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`),Wp(i)){let t=j(Up(i));e[`--app-shell-header-height`]=t,a&&(e[`--app-shell-header-offset`]=t)}Gp(i)&&(i.base!==void 0&&(e[`--app-shell-header-height`]=j(i.base),a&&(e[`--app-shell-header-offset`]=j(i.base))),ke(i).forEach(e=>{e!==`base`&&(t[e]=t[e]||{},t[e][`--app-shell-header-height`]=j(i[e]),a&&(t[e][`--app-shell-header-offset`]=j(i[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`))}function Yp({baseStyles:e,minMediaStyles:t,maxMediaStyles:n,navbar:r,theme:i,mode:a}){let o=r?.width,s=`translateX(calc(var(--app-shell-navbar-width) * -1))`,c=`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`)),Wp(o)){let t=j(Up(o));e[`--app-shell-navbar-width`]=t,e[`--app-shell-navbar-offset`]=t,a===`static`&&(e[`--app-shell-navbar-grid-width`]=t)}if(Gp(o)&&(o.base!==void 0&&(e[`--app-shell-navbar-width`]=j(o.base),e[`--app-shell-navbar-offset`]=j(o.base),a===`static`&&(e[`--app-shell-navbar-grid-width`]=j(o.base))),ke(o).forEach(e=>{e!==`base`&&(t[e]=t[e]||{},t[e][`--app-shell-navbar-width`]=j(o[e]),t[e][`--app-shell-navbar-offset`]=j(o[e]),a===`static`&&(t[e][`--app-shell-navbar-grid-width`]=j(o[e])))})),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`]=s,t[e][`--app-shell-navbar-transform-rtl`]=c,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`)}if(r?.collapsed?.mobile){let e=Na(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`]=s,n[e][`--app-shell-navbar-transform-rtl`]=c}}function Xp(e){return Number(e)===0?`0px`:de(e)}function Zp({padding:e,baseStyles:t,minMediaStyles:n}){Wp(e)&&(t[`--app-shell-padding`]=Xp(Up(e))),Gp(e)&&(e.base&&(t[`--app-shell-padding`]=Xp(e.base)),ke(e).forEach(t=>{t!==`base`&&(n[t]=n[t]||{},n[t][`--app-shell-padding`]=Xp(e[t]))}))}function Qp({navbar:e,header:t,footer:n,aside:r,padding:i,theme:a,mode:o}){let s={},c={},l={};o===`static`&&(l[`--app-shell-main-grid-column`]=`1 / -1`,l[`--app-shell-main-grid-row`]=`2`),Yp({baseStyles:l,minMediaStyles:s,maxMediaStyles:c,navbar:e,theme:a,mode:o}),Kp({baseStyles:l,minMediaStyles:s,maxMediaStyles:c,aside:r,theme:a,mode:o}),Jp({baseStyles:l,minMediaStyles:s,header:t,mode:o}),qp({baseStyles:l,minMediaStyles:s,footer:n,mode:o}),Zp({baseStyles:l,minMediaStyles:s,padding:i});let u=Pa(ke(s),a.breakpoints).map(e=>({query:`(min-width: ${Re(e.px)})`,styles:s[e.value]})),d=Pa(ke(c),a.breakpoints).map(e=>({query:`(max-width: ${Re(e.px)})`,styles:c[e.value]}));return{baseStyles:l,media:[...u,...d]}}function $p({navbar:e,header:t,aside:n,footer:r,padding:i,mode:a,selector:o}){let s=b(),c=Ue(),{media:l,baseStyles:u}=Qp({navbar:e,header:t,footer:r,aside:n,padding:i,theme:s,mode:a});return(0,N.jsx)(be,{media:l,styles:u,selector:o||c.cssVariablesSelector})}function em({transitionDuration:e,disabled:t}){let[n,r]=(0,M.useState)(!0),i=(0,M.useRef)(-1),a=(0,M.useRef)(-1);return eo(`resize`,()=>{r(!0),clearTimeout(i.current),i.current=window.setTimeout(()=>(0,M.startTransition)(()=>{r(!1)}),200)}),Ee(()=>{r(!0),clearTimeout(a.current),a.current=window.setTimeout(()=>(0,M.startTransition)(()=>{r(!1)}),e||0)},[t,e]),n}var tm={withBorder:!0,padding:0,transitionDuration:200,transitionTimingFunction:`ease`,zIndex:ka(`app`),mode:`fixed`},nm=O((e,{transitionDuration:t,transitionTimingFunction:n})=>({root:{"--app-shell-transition-duration":`${t}ms`,"--app-shell-transition-timing-function":n}})),rm=g(e=>{let t=D(`AppShell`,tm,e),{classNames:n,className:r,style:i,styles:a,unstyled:o,vars:s,navbar:c,withBorder:l,padding:u,transitionDuration:d,transitionTimingFunction:f,header:p,zIndex:m,layout:h,disabled:g,aside:_,footer:v,offsetScrollbars:y=!0,mode:b,mod:x,attributes:S,id:C,...T}=t,E=w({name:`AppShell`,classes:Ip,props:t,className:r,style:i,classNames:n,styles:a,unstyled:o,attributes:S,vars:s,varsResolver:nm}),O=em({disabled:g,transitionDuration:d}),k=pe(C);return(0,N.jsxs)(Pp,{value:{getStyles:E,withBorder:l,zIndex:m,disabled:g,offsetScrollbars:y,mode:b},children:[(0,N.jsx)($p,{navbar:c,header:p,aside:_,footer:v,padding:u,mode:b,selector:b===`static`?`#${k}`:void 0}),(0,N.jsx)(Be,{...E(`root`),id:k,mod:[{resizing:O,layout:h,disabled:g,mode:b},x],...T})]})});rm.classes=Ip,rm.varsResolver=nm,rm.displayName=`@mantine/core/AppShell`,rm.Navbar=Vp,rm.Header=zp,rm.Main=Bp,rm.Aside=Lp,rm.Footer=Rp,rm.Section=Hp;function im({size:e,style:t,...n}){return(0,N.jsx)(`svg`,{viewBox:`0 0 10 7`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`,style:e===void 0?t:{width:j(e),height:j(e),...t},"aria-hidden":!0,...n,children:(0,N.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 am={group:`m_11def92b`,root:`m_f85678b6`,image:`m_11f8ac07`,placeholder:`m_104cd71f`},om=(0,M.createContext)({withinGroup:!1}),sm=O((e,{spacing:t})=>({group:{"--ag-spacing":de(t)}})),cm=g(e=>{let t=D(`AvatarGroup`,null,e),{classNames:n,className:r,style:i,styles:a,unstyled:o,vars:s,spacing:c,attributes:l,...u}=t,d=w({name:`AvatarGroup`,classes:am,props:t,className:r,style:i,classNames:n,styles:a,unstyled:o,attributes:l,vars:s,varsResolver:sm,rootSelector:`group`});return(0,N.jsx)(om,{value:{withinGroup:!0},children:(0,N.jsx)(Be,{...d(`group`),...u})})});cm.classes=am,cm.varsResolver=sm,cm.displayName=`@mantine/core/AvatarGroup`;function lm(e){return(0,N.jsx)(`svg`,{...e,"data-avatar-placeholder-icon":!0,viewBox:`0 0 15 15`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`,children:(0,N.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 um(e){let t=0;for(let n=0;ne[0]).slice(0,t).join(``).toUpperCase()}var mm=O((e,{size:t,radius:n,variant:r,gradient:i,color:a,autoContrast:o,name:s,allowedInitialsColors:c})=>{let l=a===`initials`&&typeof s==`string`?fm(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:ce(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}}}),hm=te(e=>{let t=D(`Avatar`,null,e),{classNames:n,className:r,style:i,styles:a,unstyled:o,vars:s,src:c,alt:l,radius:u,color:d,gradient:f,imageProps:p,children:m,autoContrast:h,mod:g,name:_,allowedInitialsColors:v,attributes:y,...b}=t,x=(0,M.use)(om),[S,C]=(0,M.useState)(!c),T=w({name:`Avatar`,props:t,classes:am,className:r,style:i,classNames:n,styles:a,unstyled:o,attributes:y,vars:s,varsResolver:mm});return(0,M.useEffect)(()=>C(!c),[c]),(0,N.jsx)(Be,{...T(`root`),mod:[{"within-group":x.withinGroup},g],...b,children:S||!c?(0,N.jsx)(`span`,{...T(`placeholder`),title:l,children:m||typeof _==`string`&&pm(_)||(0,N.jsx)(lm,{})}):(0,N.jsx)(`img`,{...p,...T(`image`),src:c,alt:l,onError:e=>{C(!0),p?.onError?.(e)}})})});hm.classes=am,hm.varsResolver=mm,hm.displayName=`@mantine/core/Avatar`,hm.Group=cm;var gm={root:`m_3eebeb36`,label:`m_9e365f20`},_m={orientation:`horizontal`},vm=O((e,{color:t,variant:n,size:r})=>({root:{"--divider-color":t?x(t,e):void 0,"--divider-border-style":n,"--divider-size":Pe(r,`divider-size`)}})),ym=g(e=>{let t=D(`Divider`,_m,e),{classNames:n,className:r,style:i,styles:a,unstyled:o,vars:s,color:c,orientation:l,label:u,labelPosition:d,mod:f,attributes:p,...m}=t,h=w({name:`Divider`,classes:gm,props:t,className:r,style:i,classNames:n,styles:a,unstyled:o,attributes:p,vars:s,varsResolver:vm});return(0,N.jsx)(Be,{mod:[{orientation:l,withLabel:!!u},f],role:`separator`,...h(`root`),...m,children:u&&(0,N.jsx)(Be,{component:`span`,mod:{position:d},...h(`label`),children:u})})});ym.classes=gm,ym.varsResolver=vm,ym.displayName=`@mantine/core/Divider`;var[bm,xm]=Sa(`Drawer component was not found in tree`),Sm={root:`m_f11b401e`,header:`m_5a7c2c9`,content:`m_b8a05bbd`,inner:`m_31cd769a`},Cm=g(e=>{let{classNames:t,className:n,style:r,styles:i,vars:a,...o}=D(`DrawerBody`,null,e);return(0,N.jsx)(Cp,{...xm().getStyles(`body`,{classNames:t,style:r,styles:i,className:n}),...o})});Cm.classes=Sm,Cm.displayName=`@mantine/core/DrawerBody`;var wm=g(e=>{let{classNames:t,className:n,style:r,styles:i,vars:a,...o}=D(`DrawerCloseButton`,null,e);return(0,N.jsx)(wp,{...xm().getStyles(`close`,{classNames:t,style:r,styles:i,className:n}),...o})});wm.classes=Sm,wm.displayName=`@mantine/core/DrawerCloseButton`;var Tm=g(e=>{let{classNames:t,className:n,style:r,styles:i,vars:a,children:o,radius:s,__hidden:c,...l}=D(`DrawerContent`,null,e),u=xm(),d=u.scrollAreaComponent||Mp;return(0,N.jsx)(Tp,{...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,N.jsx)(d,{style:{height:`calc(100vh - var(--drawer-offset) * 2)`},children:o})})});Tm.classes=Sm,Tm.displayName=`@mantine/core/DrawerContent`;var Em=g(e=>{let{classNames:t,className:n,style:r,styles:i,vars:a,...o}=D(`DrawerHeader`,null,e);return(0,N.jsx)(Ep,{...xm().getStyles(`header`,{classNames:t,style:r,styles:i,className:n}),...o})});Em.classes=Sm,Em.displayName=`@mantine/core/DrawerHeader`;var Dm=g(e=>{let{classNames:t,className:n,style:r,styles:i,vars:a,...o}=D(`DrawerOverlay`,null,e);return(0,N.jsx)(kp,{...xm().getStyles(`overlay`,{classNames:t,style:r,styles:i,className:n}),...o})});Dm.classes=Sm,Dm.displayName=`@mantine/core/DrawerOverlay`;function Om(e){switch(e){case`top`:return`flex-start`;case`bottom`:return`flex-end`;default:return}}function km(e){if(e===`top`||e===`bottom`)return`0 0 calc(100% - var(--drawer-offset, 0rem) * 2)`}var Am={top:`slide-down`,bottom:`slide-up`,left:`slide-right`,right:`slide-left`},jm={top:`slide-down`,bottom:`slide-up`,right:`slide-right`,left:`slide-left`},Mm={closeOnClickOutside:!0,withinPortal:!0,lockScroll:!0,trapFocus:!0,returnFocus:!0,closeOnEscape:!0,keepMounted:!1,zIndex:ka(`modal`),position:`left`},Nm=O((e,{position:t,size:n,offset:r})=>({root:{"--drawer-size":Pe(n,`drawer-size`),"--drawer-flex":km(t),"--drawer-height":t===`left`||t===`right`?void 0:`var(--drawer-size)`,"--drawer-align":Om(t),"--drawer-justify":t===`right`?`flex-end`:void 0,"--drawer-offset":j(r)}})),Pm=g(e=>{let t=D(`DrawerRoot`,Mm,e),{classNames:n,className:r,style:i,styles:a,unstyled:o,vars:s,scrollAreaComponent:c,position:l,transitionProps:u,radius:d,attributes:f,...p}=t,{dir:m}=Vo(),h=w({name:`Drawer`,classes:Sm,props:t,className:r,style:i,classNames:n,styles:a,unstyled:o,attributes:f,vars:s,varsResolver:Nm}),g=(m===`rtl`?jm:Am)[l];return(0,N.jsx)(bm,{value:{scrollAreaComponent:c,getStyles:h,radius:d},children:(0,N.jsx)(bp,{...h(`root`),transitionProps:{transition:g,...u},"data-offset-scrollbars":c===id.Autosize||void 0,unstyled:o,...p})})});Pm.classes=Sm,Pm.varsResolver=Nm,Pm.displayName=`@mantine/core/DrawerRoot`;var Fm=(0,M.createContext)(null);function Im({children:e}){let[t,n]=(0,M.useState)([]),[r,i]=(0,M.useState)(ka(`modal`));return(0,N.jsx)(Fm,{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},children:e})}Im.displayName=`@mantine/core/DrawerStack`;var Lm=g(e=>{let{classNames:t,className:n,style:r,styles:i,vars:a,...o}=D(`DrawerTitle`,null,e);return(0,N.jsx)(jp,{...xm().getStyles(`title`,{classNames:t,style:r,styles:i,className:n}),...o})});Lm.classes=Sm,Lm.displayName=`@mantine/core/DrawerTitle`;var Rm={closeOnClickOutside:!0,withinPortal:!0,lockScroll:!0,trapFocus:!0,returnFocus:!0,closeOnEscape:!0,keepMounted:!1,zIndex:ka(`modal`),withOverlay:!0,withCloseButton:!0},zm=g(e=>{let{title:t,withOverlay:n,overlayProps:r,withCloseButton:i,closeButtonProps:a,children:o,opened:s,stackId:c,zIndex:l,...u}=D(`Drawer`,Rm,e),d=(0,M.use)(Fm),f=!!t||i,p=d&&c?{closeOnEscape:d.currentId===c,trapFocus:d.currentId===c,zIndex:d.getZIndex(c)}:{},m=n===!1?!1:c&&d?d.currentId===c:s;return(0,M.useEffect)(()=>{d&&c&&(s?d.addModal(c,l||ka(`modal`)):d.removeModal(c))},[s,c,l]),(0,N.jsxs)(Pm,{opened:s,zIndex:d&&c?d.getZIndex(c):l,...u,...p,children:[n&&(0,N.jsx)(Dm,{visible:m,transitionProps:d&&c?{duration:0}:void 0,...r}),(0,N.jsxs)(Tm,{__hidden:d&&c&&s?c!==d.currentId:!1,children:[f&&(0,N.jsxs)(Em,{children:[t&&(0,N.jsx)(Lm,{children:t}),i&&(0,N.jsx)(wm,{...a})]}),(0,N.jsx)(Cm,{children:o})]})]})});zm.classes=Sm,zm.displayName=`@mantine/core/Drawer`,zm.Root=Pm,zm.Overlay=Dm,zm.Content=Tm,zm.Body=Cm,zm.Header=Em,zm.Title=Lm,zm.CloseButton=wm,zm.Stack=Im;var Bm=[`borderBottomWidth`,`borderLeftWidth`,`borderRightWidth`,`borderTopWidth`,`boxSizing`,`fontFamily`,`fontSize`,`fontStyle`,`fontWeight`,`letterSpacing`,`lineHeight`,`paddingBottom`,`paddingLeft`,`paddingRight`,`paddingTop`,`tabSize`,`textIndent`,`textRendering`,`textTransform`,`width`,`wordBreak`,`wordSpacing`,`scrollbarGutter`],Vm={"min-height":`0`,"max-height":`none`,height:`0`,visibility:`hidden`,overflow:`hidden`,position:`absolute`,"z-index":`-1000`,top:`0`,right:`0`,display:`block`};function Hm(e){Object.keys(Vm).forEach(t=>{e.style.setProperty(t,Vm[t],`important`)})}function Um(e){let t=window.getComputedStyle(e);if(t===null)return null;let n={};for(let e of Bm)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 Wm=null;function Gm(e,t,n=1,r=1/0){Wm||(Wm=document.createElement(`textarea`),Wm.setAttribute(`tabindex`,`-1`),Wm.setAttribute(`aria-hidden`,`true`),Wm.setAttribute(`aria-label`,`autosize measurement`),Hm(Wm)),Wm.parentNode===null&&document.body.appendChild(Wm);let{paddingSize:i,borderSize:a,sizingStyle:o}=e,{boxSizing:s}=o;Object.keys(o).forEach(e=>{Wm.style[e]=o[e]}),Hm(Wm),Wm.value=t;let c=s===`border-box`?Wm.scrollHeight+a:Wm.scrollHeight-i;Wm.value=t,c=s===`border-box`?Wm.scrollHeight+a:Wm.scrollHeight-i,Wm.value=`x`;let l=Wm.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 Km({maxRows:e,minRows:t,onChange:n,ref:r,...i}){let a=i.value!==void 0,o=(0,M.useRef)(null),s=ro(o,r),c=(0,M.useRef)(0),l=(0,M.useRef)(0),u=()=>{let n=o.current;if(!n)return;let r=Um(n);if(!r)return;let[i]=Gm(r,n.value||n.placeholder||`x`,t,e);c.current!==i&&(c.current=i,n.style.setProperty(`height`,`${i}px`,`important`))},d=e=>{a||u(),n?.(e)};return(0,M.useLayoutEffect)(u),(0,M.useEffect)(()=>{let e=()=>u();return window.addEventListener(`resize`,e),()=>window.removeEventListener(`resize`,e)},[]),(0,M.useEffect)(()=>{let e=o.current;if(!e||typeof ResizeObserver>`u`)return;l.current=e.offsetWidth;let t=new ResizeObserver(()=>{o.current&&o.current.offsetWidth!==l.current&&(l.current=o.current.offsetWidth,u())});return t.observe(e),()=>t.disconnect()},[]),(0,M.useEffect)(()=>{let e=()=>u();return document.fonts.addEventListener(`loadingdone`,e),()=>document.fonts.removeEventListener(`loadingdone`,e)},[]),(0,M.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,N.jsx)(`textarea`,{rows:t,...i,onChange:d,ref:s})}var qm=g(e=>{let{autosize:t,maxRows:n,minRows:r,__staticSelector:i,resize:a,bottomSection:o,bottomSectionProps:s,...c}=D([`Input`,`InputWrapper`,`Textarea`],null,e),l=t&&fo()!==`test`,u=l?{maxRows:n,minRows:r}:{};return(0,N.jsx)(ge,{component:l?Km:`textarea`,...c,__staticSelector:i||`Textarea`,__bottomSection:o,__bottomSectionProps:s,multiline:!0,"data-no-overflow":t&&n===void 0||void 0,__vars:{"--input-resize":a},...u})});qm.classes=ge.classes,qm.displayName=`@mantine/core/Textarea`;var[Jm,Ym]=Sa(`Menu component was not found in the tree`),Xm=(0,M.createContext)(null);function Zm(e){let{value:t,defaultValue:n,onChange:r,children:i}=D(`MenuCheckboxGroup`,null,e),[a,o]=io({value:t,defaultValue:n,finalValue:[],onChange:r});return(0,N.jsx)(Xm,{value:{values:a,onChange:(0,M.useCallback)(e=>{o(a.includes(e)?a.filter(t=>t!==e):[...a,e])},[a,o])},children:i})}Zm.displayName=`@mantine/core/MenuCheckboxGroup`;var Qm=(0,M.createContext)(null);function $m({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:g}){let _=Ym(),v=(0,M.use)(Qm),y=b(),{dir:x}=Vo(),S=(0,M.useRef)(null),C=Ma(g.onClick,()=>{l||(r(),a&&_.closeDropdownImmediately())}),w=Ma(g.onMouseMove,()=>{if(!_.hasSearch)return;let e=S.current?.closest(`[data-menu-dropdown]`);e&&e.querySelectorAll(`[data-menu-active]`).forEach(t=>{t!==S.current&&t.closest(`[data-menu-dropdown]`)===e&&t.removeAttribute(`data-menu-active`)})}),T=Ma(g.onKeyDown,e=>{e.key===`ArrowLeft`&&v&&(v.close(),v.focusParentItem())}),E=i?y.variantColorResolver({color:i,theme:y,variant:`light`}):void 0,D=i?ie({color:i,theme:y}):null,O=_.alignItemsLabels!==`none`||t;return(0,N.jsxs)(h,{onMouseDown:e=>e.preventDefault(),...g,unstyled:_.unstyled,tabIndex:_.menuItemTabIndex,..._.getStyles(`item`,{className:u,style:d,styles:f,classNames:p}),ref:ro(S,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:C,onMouseMove:w,onKeyDown:Da({siblingSelector:`[data-menu-item]:not([data-disabled])`,parentSelector:`[data-menu-dropdown]`,activateOnFocus:!1,loop:_.loop,dir:x,orientation:`vertical`,onKeyDown:T}),__vars:{"--menu-item-color":D?.isThemeColor&&D?.shade===void 0?`var(--mantine-color-${D.color}-6)`:E?.color,"--menu-item-hover":E?.hover},children:[O&&(0,N.jsx)(`div`,{..._.getStyles(`itemIndicator`,{styles:f,classNames:p}),"data-checked":t||void 0,children:t?n:null}),s&&(0,N.jsx)(`div`,{..._.getStyles(`itemLabel`,{styles:f,classNames:p}),"data-menu-item-label":!0,children:s}),o&&(0,N.jsx)(`div`,{..._.getStyles(`itemSection`,{styles:f,classNames:p}),"data-position":`right`,children:o})]})}var eh={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`},th=g(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:_,...v}=D(`MenuCheckboxItem`,null,e),y=Ym(),b=(0,M.use)(Xm),x=b&&f!==void 0?b.values.includes(f):void 0,[S,C]=io({value:p??x,defaultValue:m,finalValue:!1,onChange:h});return(0,N.jsx)($m,{role:`menuitemcheckbox`,checked:S,indicator:g??y.checkIcon??(0,N.jsx)(im,{size:10}),onSelect:()=>{h?C(!S):b&&f!==void 0?b.onChange(f):C(!S)},color:o,closeMenuOnClick:s,rightSection:c,disabled:u,dataDisabled:d,className:n,style:r,styles:i,classNames:t,buttonRef:_,others:v,children:l})});th.classes=eh,th.displayName=`@mantine/core/MenuCheckboxItem`;function nh(e){let{children:t,disabled:n,longPressDelay:r}=D(`MenuContextMenu`,null,e),i=mo(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=Ym(),o=kd();return(0,M.cloneElement)(i,Ad({childProps:i.props,disabled:n||o.disabled,opened:a.opened,longPressDelay:r,setReference:o.reference,open:()=>a.openDropdown()}))}nh.displayName=`@mantine/core/MenuContextMenu`;var rh=g(e=>{let{classNames:t,className:n,style:r,styles:i,vars:a,...o}=D(`MenuDivider`,null,e);return(0,N.jsx)(Be,{...Ym().getStyles(`divider`,{className:n,style:r,styles:i,classNames:t}),...o})});rh.classes=eh,rh.displayName=`@mantine/core/MenuDivider`;var ih=500;function ah(e){return((e.querySelector(`[data-menu-item-label]`)??e).textContent??``).trim().toLowerCase()}function oh(e){return e.length>1&&e.split(``).every(t=>t===e[0])}function sh({enabled:e,opened:t,getDropdown:n}){let r=(0,M.useRef)({buffer:``,timeoutId:null});return(0,M.useEffect)(()=>{if(t&&e)return;let n=r.current;n.timeoutId!==null&&(window.clearTimeout(n.timeoutId),n.timeoutId=null),n.buffer=``},[t,e]),(0,M.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},ih);let c=document.activeElement,l=c?o.indexOf(c):-1,u=null;if(s.buffer.length===1||oh(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}=D(`MenuDropdown`,null,e),f=(0,M.useRef)(null),p=Ym(),m=sh({enabled:!p.hasSearch,opened:p.opened,getDropdown:()=>f.current}),h=Ma(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=Ma(o,()=>(p.trigger===`hover`||p.trigger===`click-hover`)&&p.openDropdown()),_=Ma(s,()=>(p.trigger===`hover`||p.trigger===`click-hover`)&&p.closeDropdown());return(0,N.jsxs)(Ud.Dropdown,{...d,onMouseEnter:g,onMouseLeave:_,role:`menu`,"aria-orientation":`vertical`,ref:ro(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,N.jsx)(`div`,{role:`presentation`,tabIndex:-1,"data-autofocus":!0,"data-mantine-stop-propagation":!0,style:{outline:0}}),l]})});ch.classes=eh,ch.displayName=`@mantine/core/MenuDropdown`;var lh=te(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}=D(`MenuItem`,null,e),g=Ym(),_=(0,M.use)(Qm),v=b(),{dir:y}=Vo(),x=(0,M.useRef)(null),S=m,C=Ma(S.onClick,()=>{f||(typeof s==`boolean`?s&&g.closeDropdownImmediately():g.closeOnItemClick&&g.closeDropdownImmediately())}),w=Ma(S.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=o?v.variantColorResolver({color:o,theme:v,variant:`light`}):void 0,E=o?ie({color:o,theme:v}):null,O=Ma(S.onKeyDown,e=>{e.key===`ArrowLeft`&&_&&(_.close(),_.focusParentItem())});return(0,N.jsxs)(h,{onMouseDown:e=>e.preventDefault(),...m,unstyled:g.unstyled,tabIndex:g.menuItemTabIndex,...g.getStyles(`item`,{className:n,style:r,styles:i,classNames:t}),ref:ro(x,p),role:`menuitem`,disabled:d,"data-menu-item":!0,"data-disabled":d||f||void 0,"data-mantine-stop-propagation":!0,onClick:C,onMouseMove:w,onKeyDown:Da({siblingSelector:`[data-menu-item]:not([data-disabled])`,parentSelector:`[data-menu-dropdown]`,activateOnFocus:!1,loop:g.loop,dir:y,orientation:`vertical`,onKeyDown:O}),__vars:{"--menu-item-color":E?.isThemeColor&&E?.shade===void 0?`var(--mantine-color-${E.color}-6)`:T?.color,"--menu-item-hover":T?.hover},children:[g.alignItemsLabels===`all`&&(0,N.jsx)(`div`,{...g.getStyles(`itemIndicator`,{styles:i,classNames:t}),"data-placeholder":!0}),c&&(0,N.jsx)(`div`,{...g.getStyles(`itemSection`,{styles:i,classNames:t}),"data-position":`left`,children:c}),u&&(0,N.jsx)(`div`,{...g.getStyles(`itemLabel`,{styles:i,classNames:t}),"data-menu-item-label":!0,children:u}),l&&(0,N.jsx)(`div`,{...g.getStyles(`itemSection`,{styles:i,classNames:t}),"data-position":`right`,children:l})]})});lh.classes=eh,lh.displayName=`@mantine/core/MenuItem`;var uh=g(e=>{let{classNames:t,className:n,style:r,styles:i,vars:a,...o}=D(`MenuLabel`,null,e);return(0,N.jsx)(Be,{...Ym().getStyles(`label`,{className:n,style:r,styles:i,classNames:t}),...o})});uh.classes=eh,uh.displayName=`@mantine/core/MenuLabel`;var dh=(0,M.createContext)(null);function fh(e){let{value:t,defaultValue:n,onChange:r,children:i}=D(`MenuRadioGroup`,null,e),[a,o]=io({value:t,defaultValue:n,finalValue:null,onChange:r});return(0,N.jsx)(dh,{value:{value:a,onChange:e=>o(e)},children:i})}fh.displayName=`@mantine/core/MenuRadioGroup`;function ph({size:e,style:t,...n}){return(0,N.jsx)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,fill:`none`,viewBox:`0 0 5 5`,style:{width:j(e),height:j(e),...t},"aria-hidden":!0,...n,children:(0,N.jsx)(`circle`,{cx:`2.5`,cy:`2.5`,r:`2.5`,fill:`currentColor`})})}var mh=g(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,..._}=D(`MenuRadioItem`,null,e),v=Ym(),y=(0,M.use)(dh),b=p??(y?y.value===f:!1);return(0,N.jsx)($m,{role:`menuitemradio`,checked:b,indicator:h??v.checkIcon??(0,N.jsx)(ph,{size:5}),onSelect:()=>{b||(m?m(f):y&&y.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})});mh.classes=eh,mh.displayName=`@mantine/core/MenuRadioItem`;var hh=`[data-menu-item]:not([data-disabled])`,gh=`[data-menu-active]`;function _h(e){return e?.closest(`[data-menu-dropdown]`)}function vh(e){return e?Array.from(e.querySelectorAll(hh)).filter(t=>t.closest(`[data-menu-dropdown]`)===e):[]}function yh(e){e&&e.querySelectorAll(gh).forEach(t=>{t.closest(`[data-menu-dropdown]`)===e&&t.removeAttribute(`data-menu-active`)})}function bh(e,t){yh(t),e&&(e.setAttribute(`data-menu-active`,`true`),e.scrollIntoView({block:`nearest`}))}function xh(e){return e.findIndex(e=>e.hasAttribute(`data-menu-active`))}var Sh={clearSearchOnClose:!0},Ch=g(e=>{let{classNames:t,styles:n,onKeyDown:r,onChange:i,size:a,clearSearchOnClose:o,ref:s,...c}=D(`MenuSearch`,Sh,e),l=Ym(),u=(0,M.useRef)(null),d=ro(s,u),f=(0,M.useRef)(i);f.current=i,(0,M.useEffect)(()=>l.registerSearch(),[l.registerSearch]),(0,M.useEffect)(()=>{o?l.searchExitClearRef.current=()=>{f.current?.({currentTarget:{value:``}})}:l.searchExitClearRef.current=null},[o,l.searchExitClearRef]),(0,M.useEffect)(()=>{l.opened||yh(_h(u.current))},[l.opened]);let p=Ma(i,e=>{yh(_h(e.currentTarget))}),m=Ma(r,e=>{if(e.defaultPrevented)return;let t=_h(e.currentTarget),n=vh(t);if(e.key===`ArrowDown`){if(e.preventDefault(),n.length===0)return;let r=xh(n);bh(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=xh(n);bh(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&&bh(n[0],t);else if(e.key===`End`)e.preventDefault(),n.length>0&&bh(n[n.length-1],t);else if(e.key===`Enter`){if(e.nativeEvent.isComposing||e.nativeEvent.keyCode===229)return;let t=n[xh(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,N.jsx)(oe,{"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`})});Ch.classes=eh,Ch.displayName=`@mantine/core/MenuSearch`;var wh=g(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}=D(`MenuSubDropdown`,null,e),m=(0,M.useRef)(null),h=Ym(),g=(0,M.use)(Qm),_=sh({enabled:!h.hasSearch,opened:g?.opened??!1,getDropdown:()=>m.current}),v=Ma(u,e=>{_(e),!e.ctrlKey&&!e.metaKey&&!e.altKey&&e.key.length===1&&e.key!==` `&&e.stopPropagation()}),y=g?.getFloatingProps({onMouseEnter:o,onMouseLeave:s,onPointerEnter:c,onPointerLeave:l});return(0,N.jsx)(Ud.Dropdown,{...p,...y,role:`menu`,"aria-orientation":`vertical`,ref:ro(f,m,g?.setFloating),...h.getStyles(`dropdown`,{className:n,style:r,styles:i,classNames:t,withStaticClass:!1}),tabIndex:-1,"data-menu-dropdown":!0,onKeyDown:v,children:d})});wh.classes=eh,wh.displayName=`@mantine/core/MenuSubDropdown`;var Th=te(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}=D(`MenuSubItem`,null,e),g=Ym(),_=(0,M.use)(Qm),v=b(),{dir:y}=Vo(),x=(0,M.useRef)(null),S=m,C=o?v.variantColorResolver({color:o,theme:v,variant:`light`}):void 0,w=o?ie({color:o,theme:v}):null,T=Ma(S.onKeyDown,e=>{e.key===`ArrowRight`&&(_?.open(),_?.focusFirstItem()),e.key===`ArrowLeft`&&_?.parentContext&&(_.parentContext.close(),_.parentContext.focusParentItem())}),E=Ma(S.onClick,()=>{!d&&f&&g.closeDropdownImmediately()}),O=Ma(S.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`)})}),k=_?.getReferenceProps({onMouseEnter:S.onMouseEnter,onMouseLeave:S.onMouseLeave,onPointerEnter:S.onPointerEnter,onPointerLeave:S.onPointerLeave});return(0,N.jsxs)(h,{onMouseDown:e=>e.preventDefault(),...m,...k,unstyled:g.unstyled,tabIndex:g.menuItemTabIndex,...g.getStyles(`item`,{className:n,style:r,styles:i,classNames:t}),ref:ro(x,p,_?.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:O,onKeyDown:Da({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":w?.isThemeColor&&w?.shade===void 0?`var(--mantine-color-${w.color}-6)`:C?.color,"--menu-item-hover":C?.hover},children:[g.alignItemsLabels===`all`&&(0,N.jsx)(`div`,{...g.getStyles(`itemIndicator`,{styles:i,classNames:t}),"data-placeholder":!0}),s&&(0,N.jsx)(`div`,{...g.getStyles(`itemSection`,{styles:i,classNames:t}),"data-position":`left`,children:s}),l&&(0,N.jsx)(`div`,{...g.getStyles(`itemLabel`,{styles:i,classNames:t}),"data-menu-item-label":!0,children:l}),(0,N.jsx)(`div`,{...g.getStyles(`itemSection`,{styles:i,classNames:t}),"data-position":`right`,children:c||(0,N.jsx)(Np,{...g.getStyles(`chevron`),size:14})})]})});Th.classes=eh,Th.displayName=`@mantine/core/MenuSubItem`;function Eh({children:e,refProp:t}){if(!xa(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 Ym(),(0,N.jsx)(Ud.Target,{refProp:t,popupType:`menu`,children:e})}Eh.displayName=`@mantine/core/MenuSubTarget`;var Dh={offset:0,position:`right-start`,safeAreaPolygon:!0,transitionProps:{duration:0},openDelay:0,middlewares:{shift:{crossAxis:!0}}};function Oh(e){let{children:t,closeDelay:n,openDelay:r,position:i,safeAreaPolygon:a,opened:o,onChange:s,...c}=D(`MenuSub`,Dh,e),l=pe(),[u,d]=io({value:o,finalValue:!1,onChange:s}),f=(0,M.use)(Qm),p=Ym(),{dir:m}=Vo(),h=hd(m,i),g=f?.registerOpenSub??p.registerOpenSub,_=(0,M.useRef)(null),v=(0,M.useCallback)(e=>{let t=_.current;return t&&t!==e&&t(),_.current=e,()=>{_.current===e&&(_.current=null)}},[]),y=(0,M.useRef)(d);y.current=d;let b=(0,M.useCallback)(()=>y.current(!0),[]),x=(0,M.useCallback)(()=>y.current(!1),[]);(0,M.useEffect)(()=>{if(u)return g(x)},[u,g,x]);let{context:S,refs:C}=Gu({placement:h,open:u,onOpenChange:e=>{e?b():x()}}),{getReferenceProps:w,getFloatingProps:T}=Yu([Mu(S,{handleClose:a?td(typeof a==`object`?a:void 0):void 0,delay:{open:r,close:n}})]);return(0,N.jsx)(Qm,{value:{opened:u,close:x,open:b,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:C.setReference,setFloating:C.setFloating,getReferenceProps:w,getFloatingProps:T,registerOpenSub:v},children:(0,N.jsx)(Ud,{opened:u,onChange:e=>e?b():x(),withinPortal:!1,withArrow:!1,id:l,position:i,...c,children:t})})}Oh.extend=e=>e,Oh.displayName=`@mantine/core/MenuSub`,Oh.Target=Eh,Oh.Dropdown=wh,Oh.Item=Th;var kh={refProp:`ref`};function Ah(e){let{children:t,refProp:n,...r}=D(`MenuTarget`,kh,e),i=mo(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=Ym(),o=i.props,s=Ma(o.onClick,()=>{a.trigger===`click`?a.toggleDropdown():a.trigger===`click-hover`&&(a.setOpenedViaClick(!0),a.opened||a.openDropdown())}),c=Ma(o.onMouseEnter,()=>(a.trigger===`hover`||a.trigger===`click-hover`)&&a.openDropdown()),l=Ma(o.onMouseLeave,()=>{(a.trigger===`hover`||a.trigger===`click-hover`&&!a.openedViaClick)&&a.closeDropdown()});return(0,N.jsx)(Ud.Target,{refProp:n,popupType:`menu`,...r,children:(0,M.cloneElement)(i,{onClick:s,onMouseEnter:c,onMouseLeave:l,"data-expanded":a.opened?!0:void 0})})}Ah.displayName=`@mantine/core/MenuTarget`;var jh={trapFocus:!0,closeOnItemClick:!0,withInitialFocusPlaceholder:!0,clickOutsideEvents:[`mousedown`,`touchstart`,`keydown`],loop:!0,trigger:`click`,openDelay:0,closeDelay:100,menuItemTabIndex:-1,alignItemsLabels:`with-indicators`},Mh=g(e=>{let t=D(`Menu`,jh,e),{children:n,onOpen:r,onClose:i,opened:a,defaultOpened:o,trapFocus:s,onChange:c,closeOnItemClick:l,loop:u,closeOnEscape:d,trigger:f,openDelay:p,closeDelay:m,classNames:h,styles:g,unstyled:_,variant:v,vars:y,menuItemTabIndex:b,keepMounted:x,withInitialFocusPlaceholder:S,attributes:C,onExitTransitionEnd:E,alignItemsLabels:O,checkIcon:k,...ee}=t,te=w({name:`Menu`,classes:eh,props:t,classNames:h,styles:g,unstyled:_,attributes:C}),[ne,re]=io({value:a,defaultValue:o,finalValue:!1,onChange:c}),[A,ie]=(0,M.useState)(!1),ae=()=>{re(!1),ie(!1),ne&&i?.()},oe=()=>{re(!0),!ne&&r?.()},se=()=>{ne?ae():oe()},{openDropdown:ce,closeDropdown:le}=gd({open:oe,close:ae,closeDelay:m,openDelay:p}),ue=(0,M.useRef)(null),de=(0,M.useCallback)(e=>{let t=ue.current;return t&&t!==e&&t(),ue.current=e,()=>{ue.current===e&&(ue.current=null)}},[]),fe=(0,M.useRef)(0),[j,pe]=(0,M.useState)(!1),me=(0,M.useCallback)(()=>(fe.current+=1,fe.current===1&&pe(!0),()=>{--fe.current,fe.current===0&&pe(!1)}),[]),he=(0,M.useRef)(null),ge=()=>{he.current?.(),E?.()},_e=e=>Ia(`[data-menu-item]`,`[data-menu-dropdown]`,e),{resolvedClassNames:ve,resolvedStyles:ye}=T({classNames:h,styles:g,props:t});return(0,N.jsx)(Jm,{value:{getStyles:te,opened:ne,toggleDropdown:se,getItemIndex:_e,openedViaClick:A,setOpenedViaClick:ie,closeOnItemClick:l,closeDropdown:f===`click`?ae:le,openDropdown:f===`click`?oe:ce,closeDropdownImmediately:ae,loop:u,trigger:f,unstyled:_,menuItemTabIndex:b,withInitialFocusPlaceholder:S,registerOpenSub:de,hasSearch:j,registerSearch:me,searchExitClearRef:he,alignItemsLabels:O,checkIcon:k},children:(0,N.jsx)(Ud,{returnFocus:!0,...ee,opened:ne,onChange:se,defaultOpened:o,trapFocus:!x&&s,closeOnEscape:d,__staticSelector:`Menu`,classNames:ve,styles:ye,unstyled:_,variant:v,keepMounted:x,onExitTransitionEnd:ge,children:n})})});Mh.displayName=`@mantine/core/Menu`,Mh.classes=eh,Mh.Item=lh,Mh.Label=uh,Mh.Dropdown=ch,Mh.Target=Ah,Mh.Divider=rh,Mh.Search=Ch,Mh.Sub=Oh,Mh.CheckboxItem=th,Mh.CheckboxGroup=Zm,Mh.RadioItem=mh,Mh.RadioGroup=fh,Mh.ContextMenu=nh;var[Nh,Ph]=Sa(`Modal component was not found in tree`),Fh={root:`m_9df02822`,content:`m_54c44539`,inner:`m_1f958f16`,header:`m_d0e2b9cd`},Ih=g(e=>{let{classNames:t,className:n,style:r,styles:i,vars:a,...o}=D(`ModalBody`,null,e);return(0,N.jsx)(Cp,{...Ph().getStyles(`body`,{classNames:t,style:r,styles:i,className:n}),...o})});Ih.classes=Fh,Ih.displayName=`@mantine/core/ModalBody`;var Lh=g(e=>{let{classNames:t,className:n,style:r,styles:i,vars:a,...o}=D(`ModalCloseButton`,null,e);return(0,N.jsx)(wp,{...Ph().getStyles(`close`,{classNames:t,style:r,styles:i,className:n}),...o})});Lh.classes=Fh,Lh.displayName=`@mantine/core/ModalCloseButton`;var Rh=g(e=>{let{classNames:t,className:n,style:r,styles:i,vars:a,children:o,__hidden:s,...c}=D(`ModalContent`,null,e),l=Ph(),u=l.scrollAreaComponent||Mp;return(0,N.jsx)(Tp,{...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,N.jsx)(u,{style:{maxHeight:l.fullScreen?`100dvh`:`calc(100dvh - (${j(l.yOffset)} * 2))`},children:o})})});Rh.classes=Fh,Rh.displayName=`@mantine/core/ModalContent`;var zh=g(e=>{let{classNames:t,className:n,style:r,styles:i,vars:a,...o}=D(`ModalHeader`,null,e);return(0,N.jsx)(Ep,{...Ph().getStyles(`header`,{classNames:t,style:r,styles:i,className:n}),...o})});zh.classes=Fh,zh.displayName=`@mantine/core/ModalHeader`;var Bh=g(e=>{let{classNames:t,className:n,style:r,styles:i,vars:a,...o}=D(`ModalOverlay`,null,e);return(0,N.jsx)(kp,{...Ph().getStyles(`overlay`,{classNames:t,style:r,styles:i,className:n}),...o})});Bh.classes=Fh,Bh.displayName=`@mantine/core/ModalOverlay`;var Vh={__staticSelector:`Modal`,closeOnClickOutside:!0,withinPortal:!0,lockScroll:!0,trapFocus:!0,returnFocus:!0,closeOnEscape:!0,keepMounted:!1,zIndex:ka(`modal`),transitionProps:{duration:200,transition:`fade-down`},yOffset:`5dvh`},Hh=O((e,{radius:t,size:n,yOffset:r,xOffset:i})=>({root:{"--modal-radius":t===void 0?void 0:ce(t),"--modal-size":Pe(n,`modal-size`),"--modal-y-offset":j(r),"--modal-x-offset":j(i)}})),Uh=g(e=>{let t=D(`ModalRoot`,Vh,e),{classNames:n,className:r,style:i,styles:a,unstyled:o,vars:s,yOffset:c,scrollAreaComponent:l,radius:u,fullScreen:d,centered:f,xOffset:p,__staticSelector:m,attributes:h,...g}=t,_=w({name:m,classes:Fh,props:t,className:r,style:i,classNames:n,styles:a,unstyled:o,attributes:h,vars:s,varsResolver:Hh});return(0,N.jsx)(Nh,{value:{yOffset:c,scrollAreaComponent:l,getStyles:_,fullScreen:d},children:(0,N.jsx)(bp,{..._(`root`),"data-full-screen":d||void 0,"data-centered":f||void 0,"data-offset-scrollbars":l===id.Autosize||void 0,unstyled:o,...g})})});Uh.classes=Fh,Uh.varsResolver=Hh,Uh.displayName=`@mantine/core/ModalRoot`;var Wh=(0,M.createContext)(null);function Gh({children:e}){let[t,n]=(0,M.useState)([]),[r,i]=(0,M.useState)(ka(`modal`));return(0,N.jsx)(Wh,{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},children:e})}Gh.displayName=`@mantine/core/ModalStack`;var Kh=g(e=>{let{classNames:t,className:n,style:r,styles:i,vars:a,...o}=D(`ModalTitle`,null,e);return(0,N.jsx)(jp,{...Ph().getStyles(`title`,{classNames:t,style:r,styles:i,className:n}),...o})});Kh.classes=Fh,Kh.displayName=`@mantine/core/ModalTitle`;var qh={closeOnClickOutside:!0,withinPortal:!0,lockScroll:!0,trapFocus:!0,returnFocus:!0,closeOnEscape:!0,keepMounted:!1,zIndex:ka(`modal`),transitionProps:{duration:200,transition:`fade-down`},withOverlay:!0,withCloseButton:!0},Jh=g(e=>{let{title:t,withOverlay:n,overlayProps:r,withCloseButton:i,closeButtonProps:a,children:o,radius:s,opened:c,stackId:l,zIndex:u,...d}=D(`Modal`,qh,e),f=(0,M.use)(Wh),p=!!t||i,m=f&&l?{closeOnEscape:f.currentId===l,trapFocus:f.currentId===l,zIndex:f.getZIndex(l)}:{},h=n===!1?!1:l&&f?f.currentId===l:c;return(0,M.useEffect)(()=>{f&&l&&(c?f.addModal(l,u||ka(`modal`)):f.removeModal(l))},[c,l,u]),(0,N.jsxs)(Uh,{radius:s,opened:c,zIndex:f&&l?f.getZIndex(l):u,...d,...m,children:[n&&(0,N.jsx)(Bh,{visible:h,transitionProps:f&&l?{duration:0}:void 0,...r}),(0,N.jsxs)(Rh,{radius:s,__hidden:f&&l&&c?l!==f.currentId:!1,children:[p&&(0,N.jsxs)(zh,{children:[t&&(0,N.jsx)(Kh,{children:t}),i&&(0,N.jsx)(Lh,{...a})]}),(0,N.jsx)(Ih,{children:o})]})]})});Jh.classes=Fh,Jh.displayName=`@mantine/core/Modal`,Jh.Root=Uh,Jh.Overlay=Bh,Jh.Content=Rh,Jh.Body=Ih,Jh.Header=zh,Jh.Title=Kh,Jh.CloseButton=Lh,Jh.Stack=Gh;function Yh({offset:e,position:t,defaultOpened:n}){let[r,i]=(0,M.useState)(n),a=(0,M.useRef)(null),{x:o,y:s,elements:c,refs:l,update:u,placement:d}=Gu({placement:t,middleware:[$l({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,M.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,M.useEffect)(()=>{if(l.floating.current){let e=a.current;e.addEventListener(`mousemove`,m);let t=Hs(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 Xh={tooltip:`m_1b3c8819`,arrow:`m_f898399f`},Zh={refProp:`ref`,withinPortal:!0,offset:10,position:`right`,zIndex:ka(`popover`)},Qh=O((e,{radius:t,color:n})=>({tooltip:{"--tooltip-radius":t===void 0?void 0:ce(t),"--tooltip-bg":n?x(n,e):void 0,"--tooltip-color":n?`var(--mantine-color-white)`:void 0}})),$h=g(e=>{let t=D(`TooltipFloating`,Zh,e),{children:n,refProp:r,withinPortal:i,style:a,className:o,classNames:s,styles:c,unstyled:l,radius:u,color:d,label:f,offset:p,position:m,multiline:h,zIndex:g,disabled:_,defaultOpened:v,variant:y,vars:x,portalProps:S,attributes:C,ref:T,...E}=t,O=b(),k=w({name:`TooltipFloating`,props:t,classes:Xh,className:o,style:a,classNames:s,styles:c,unstyled:l,attributes:C,rootSelector:`tooltip`,vars:x,varsResolver:Qh}),{handleMouseMove:ee,x:te,y:ne,opened:re,boundaryRef:A,floating:ie,setOpened:ae}=Yh({offset:p,position:m,defaultOpened:v}),oe=mo(n);if(!oe)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=ro(A,po(oe),T),ce=oe.props,le=e=>{ce.onMouseEnter?.(e),ee(e),ae(!0)},ue=e=>{ce.onMouseLeave?.(e),ae(!1)};return(0,N.jsxs)(N.Fragment,{children:[(0,N.jsx)(Td,{...S,withinPortal:i,children:(0,N.jsx)(Be,{...E,...k(`tooltip`,{style:{...zo(a,O),zIndex:g,display:!_&&re?`block`:`none`,top:Number.isFinite(ne)?Math.round(ne):``,left:Number.isFinite(te)?Math.round(te):``}}),variant:y,ref:ie,mod:{multiline:h},children:f})}),(0,M.cloneElement)(oe,{...ce,[r]:se,onMouseEnter:le,onMouseLeave:ue})]})});$h.classes=Xh,$h.varsResolver=Qh,$h.displayName=`@mantine/core/TooltipFloating`;var eg=(0,M.createContext)({withinGroup:!1}),tg={openDelay:0,closeDelay:0};function ng(e){let{openDelay:t,closeDelay:n,children:r}=D(`TooltipGroup`,tg,e);return(0,N.jsx)(eg,{value:{withinGroup:!0},children:(0,N.jsx)(Iu,{delay:{open:t,close:n},children:r})})}ng.displayName=`@mantine/core/TooltipGroup`,ng.extend=e=>e;function rg(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 ig(e){let t=rg(e.middlewares),n=[Ql(e.offset)];return t.shift&&n.push($l(typeof t.shift==`boolean`?{padding:8}:{padding:8,...t.shift})),t.flip&&n.push(typeof t.flip==`boolean`?tu():tu(t.flip)),n.push(au({element:e.arrowRef,padding:e.arrowOffset})),t.inline?n.push(typeof t.inline==`boolean`?iu():iu(t.inline)):e.inline&&n.push(iu()),n}function ag(e){let[t,n]=(0,M.useState)(e.defaultOpened),r=typeof e.opened==`boolean`?e.opened:t,i=(0,M.use)(eg).withinGroup,a=pe(),o=(0,M.useCallback)(e=>{n(e),e&&g(a)},[a]),{x:s,y:c,context:l,refs:u,placement:d,middlewareData:{arrow:{x:f,y:p}={}}}=Gu({strategy:e.strategy,placement:e.position,open:r,onOpenChange:o,middleware:ig(e),whileElementsMounted:Pl}),{delay:m,currentId:h,setCurrentId:g}=Lu(l,{id:a}),{getReferenceProps:_,getFloatingProps:v}=Yu([Mu(l,{enabled:e.events?.hover,delay:i?m:{open:e.openDelay,close:e.closeDelay},mouseOnly:!e.events?.touch,handleClose:e.interactive?td():null}),qu(l,{enabled:e.events?.focus,visibleOnly:!0}),Zu(l,{role:`tooltip`}),Uu(l,{enabled:e.opened===void 0})]),y=(0,M.useRef)(d);Ee(()=>{y.current!==d&&(y.current=d,e.onPositionChange?.(d))},[d]);let b=r&&h&&h!==a;return{x:s,y:c,arrowX:f,arrowY:p,reference:u.setReference,floating:u.setFloating,getFloatingProps:v,getReferenceProps:_,isGroupPhase:b,opened:r,placement:d}}var og={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:ka(`popover`),middlewares:{flip:!0,shift:!0,inline:!1}},sg=O((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:ce(t),"--tooltip-bg":n?a.background:void 0,"--tooltip-color":n?a.color:void 0}}}),cg=g(e=>{let t=D(`Tooltip`,og,e),{children:n,position:r,refProp:i,label:a,openDelay:o,closeDelay:s,onPositionChange:c,opened:l,defaultOpened:u,withinPortal:d,radius:f,color:p,classNames:m,styles:h,unstyled:g,style:_,className:v,withArrow:y,arrowSize:b,arrowOffset:x,arrowRadius:S,arrowPosition:C,offset:T,transitionProps:E,multiline:O,events:k,interactive:ee,zIndex:te,disabled:ne,onClick:re,onMouseEnter:A,onMouseLeave:ie,inline:oe,variant:se,keepMounted:ce,vars:le,portalProps:ue,mod:de,floatingStrategy:fe,middlewares:j,autoContrast:pe,attributes:me,target:he,ref:ge,..._e}=t,{dir:ve}=Vo(),ye=(0,M.useRef)(null),be=ag({position:hd(ve,r),closeDelay:s,openDelay:o,onPositionChange:c,opened:l,defaultOpened:u,events:k,interactive:ee,arrowRef:ye,arrowOffset:x,offset:typeof T==`number`?T+(y?b/2:0):T,inline:oe,strategy:fe,middlewares:j});(0,M.useEffect)(()=>{let e=he instanceof HTMLElement?he:typeof he==`string`?document.querySelector(he):he?.current||null;e&&be.reference(e)},[he,be]);let xe=w({name:`Tooltip`,props:t,classes:Xh,className:v,style:_,classNames:m,styles:h,unstyled:g,attributes:me,rootSelector:`tooltip`,vars:le,varsResolver:sg}),Se=mo(n);if(!he&&!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=ee&&!ne&&!!be.opened,Te=C===`merge`&&y?pd({position:be.placement,dir:ve}):void 0;if(he){let e=Dd(E,{duration:100,transition:`fade`});return(0,N.jsx)(N.Fragment,{children:(0,N.jsx)(Td,{...ue,withinPortal:d,children:(0,N.jsx)(Ve,{...e,keepMounted:ce,mounted:!ne&&!!be.opened,duration:be.isGroupPhase?10:e.duration,children:e=>(0,N.jsxs)(Be,{..._e,"data-fixed":fe===`fixed`||void 0,variant:se,mod:[{multiline:O,interactive:we},de],...Ce,...be.getFloatingProps({ref:be.floating,className:Ce.className,style:{...Ce.style,...e,...Te,zIndex:te,top:be.y??0,left:be.x??0}}),children:[a,(0,N.jsx)(md,{ref:ye,arrowX:be.arrowX,arrowY:be.arrowY,visible:y,position:be.placement,arrowSize:b,arrowOffset:x,arrowRadius:S,arrowPosition:C,...xe(`arrow`)})]})})})})}let Ee=Se.props,De=ro(be.reference,po(Se),ge),Oe=Dd(E,{duration:100,transition:`fade`});return(0,N.jsxs)(N.Fragment,{children:[(0,N.jsx)(Td,{...ue,withinPortal:d,children:(0,N.jsx)(Ve,{...Oe,keepMounted:ce,mounted:!ne&&!!be.opened,duration:be.isGroupPhase?10:Oe.duration,children:e=>(0,N.jsxs)(Be,{..._e,"data-fixed":fe===`fixed`||void 0,variant:se,mod:[{multiline:O,interactive:we},de],...be.getFloatingProps({ref:be.floating,className:xe(`tooltip`).className,style:{...xe(`tooltip`).style,...e,...Te,zIndex:te,top:be.y??0,left:be.x??0}}),children:[a,(0,N.jsx)(md,{ref:ye,arrowX:be.arrowX,arrowY:be.arrowY,visible:y,position:be.placement,arrowSize:b,arrowOffset:x,arrowRadius:S,arrowPosition:C,...xe(`arrow`)})]})})}),(0,M.cloneElement)(Se,be.getReferenceProps({onClick:re,onMouseEnter:A,onMouseLeave:ie,onMouseMove:t.onMouseMove,onPointerDown:t.onPointerDown,onPointerEnter:t.onPointerEnter,...Ee,className:ae(v,Ee.className),[i]:De}))]})});cg.classes=Xh,cg.varsResolver=sg,cg.displayName=`@mantine/core/Tooltip`,cg.Floating=$h,cg.Group=ng;function lg(e){if(e!==void 0)return typeof e==`number`?j(e):e}function ug({spacing:e,verticalSpacing:t,cols:n,minColWidth:r,autoRows:i,selector:a}){let o=b(),s=t===void 0?e:t,c=r!==void 0,l=Se({"--sg-spacing-x":de(Fa(e)),"--sg-spacing-y":de(Fa(s)),"--sg-auto-rows":i,...c?{"--sg-min-col-width":lg(r)}:{"--sg-cols":Fa(n)?.toString()}}),u=ke(o.breakpoints).reduce((t,r)=>(t[r]||(t[r]={}),typeof e==`object`&&e[r]!==void 0&&(t[r][`--sg-spacing-x`]=de(e[r])),typeof s==`object`&&s[r]!==void 0&&(t[r][`--sg-spacing-y`]=de(s[r])),!c&&typeof n==`object`&&n[r]!==void 0&&(t[r][`--sg-cols`]=n[r]),t),{});return(0,N.jsx)(be,{styles:l,media:Pa(ke(u),o.breakpoints).filter(e=>ke(u[e.value]).length>0).map(e=>({query:`(min-width: ${o.breakpoints[e.value]})`,styles:u[e.value]})),selector:a})}function dg(e){return typeof e==`object`&&e?ke(e):[]}function fg(e){return e.sort((e,t)=>ba(e)-ba(t))}function pg({spacing:e,verticalSpacing:t,cols:n,minColWidth:r}){return fg(Array.from(new Set([...dg(e),...dg(t),...r===void 0?dg(n):[]])))}function mg({spacing:e,verticalSpacing:t,cols:n,minColWidth:r,autoRows:i,selector:a}){let o=t===void 0?e:t,s=r!==void 0,c=Se({"--sg-spacing-x":de(Fa(e)),"--sg-spacing-y":de(Fa(o)),"--sg-auto-rows":i,...s?{"--sg-min-col-width":lg(r)}:{"--sg-cols":Fa(n)?.toString()}}),l=pg({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`]=de(e[r])),typeof o==`object`&&o[r]!==void 0&&(t[r][`--sg-spacing-y`]=de(o[r])),!s&&typeof n==`object`&&n[r]!==void 0&&(t[r][`--sg-cols`]=n[r]),t),{});return(0,N.jsx)(be,{styles:c,container:l.map(e=>({query:`simple-grid (min-width: ${e})`,styles:u[e]})),selector:a})}var hg={container:`m_925c2d2c`,root:`m_2415a157`},gg={cols:1,spacing:`md`,type:`media`},_g=g(e=>{let t=D(`SimpleGrid`,gg,e),{classNames:n,className:r,style:i,styles:a,unstyled:o,vars:s,cols:c,verticalSpacing:l,spacing:u,type:d,minColWidth:f,autoFlow:p,autoRows:m,attributes:h,...g}=t,_=w({name:`SimpleGrid`,classes:hg,props:t,className:r,style:i,classNames:n,styles:a,unstyled:o,attributes:h,vars:s}),v=E(),y=f===void 0?void 0:p||`auto-fill`;return d===`container`?(0,N.jsxs)(N.Fragment,{children:[(0,N.jsx)(mg,{...t,selector:`.${v}`}),(0,N.jsx)(`div`,{..._(`container`),children:(0,N.jsx)(Be,{..._(`root`,{className:v}),...g,"data-auto-cols":y})})]}):(0,N.jsxs)(N.Fragment,{children:[(0,N.jsx)(ug,{...t,selector:`.${v}`}),(0,N.jsx)(Be,{..._(`root`,{className:v}),...g,"data-auto-cols":y})]})});_g.classes=hg,_g.displayName=`@mantine/core/SimpleGrid`;var vg={root:`m_d08caa0`},yg=g(e=>{let t=D(`Typography`,null,e),{classNames:n,className:r,style:i,styles:a,unstyled:o,attributes:s,...c}=t;return(0,N.jsx)(Be,{...w({name:`Typography`,classes:vg,props:t,className:r,style:i,classNames:n,styles:a,unstyled:o,attributes:s})(`root`),...c})});yg.classes=vg,yg.displayName=`@mantine/core/Typography`;var bg=[];for(let e=0;e<256;++e)bg.push((e+256).toString(16).slice(1));function xg(e,t=0){return(bg[e[t+0]]+bg[e[t+1]]+bg[e[t+2]]+bg[e[t+3]]+`-`+bg[e[t+4]]+bg[e[t+5]]+`-`+bg[e[t+6]]+bg[e[t+7]]+`-`+bg[e[t+8]]+bg[e[t+9]]+`-`+bg[e[t+10]]+bg[e[t+11]]+bg[e[t+12]]+bg[e[t+13]]+bg[e[t+14]]+bg[e[t+15]]).toLowerCase()}var Sg,Cg=new Uint8Array(16);function wg(){if(!Sg){if(typeof crypto>`u`||!crypto.getRandomValues)throw Error(`crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported`);Sg=crypto.getRandomValues.bind(crypto)}return Sg(Cg)}var Tg={randomUUID:typeof crypto<`u`&&crypto.randomUUID&&crypto.randomUUID.bind(crypto)};function Eg(e,t,n){if(Tg.randomUUID&&!t&&!e)return Tg.randomUUID();e||={};let r=e.random??e.rng?.()??wg();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 xg(r)}var Dg;(function(e){e.assertEqual=e=>{};function t(e){}e.assertIs=t;function n(e){throw Error()}e.assertNever=n,e.arrayToEnum=e=>{let t={};for(let n of e)t[n]=n;return t},e.getValidEnumValues=t=>{let n=e.objectKeys(t).filter(e=>typeof t[t[e]]!=`number`),r={};for(let e of n)r[e]=t[e];return e.objectValues(r)},e.objectValues=t=>e.objectKeys(t).map(function(e){return t[e]}),e.objectKeys=typeof Object.keys==`function`?e=>Object.keys(e):e=>{let t=[];for(let n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.push(n);return t},e.find=(e,t)=>{for(let n of e)if(t(n))return n},e.isInteger=typeof Number.isInteger==`function`?e=>Number.isInteger(e):e=>typeof e==`number`&&Number.isFinite(e)&&Math.floor(e)===e;function r(e,t=` | `){return e.map(e=>typeof e==`string`?`'${e}'`:e).join(t)}e.joinValues=r,e.jsonStringifyReplacer=(e,t)=>typeof t==`bigint`?t.toString():t})(Dg||={});var Og;(function(e){e.mergeShapes=(e,t)=>({...e,...t})})(Og||={});var P=Dg.arrayToEnum([`string`,`nan`,`number`,`integer`,`float`,`boolean`,`date`,`bigint`,`symbol`,`function`,`undefined`,`null`,`array`,`object`,`unknown`,`promise`,`void`,`never`,`map`,`set`]),kg=e=>{switch(typeof e){case`undefined`:return P.undefined;case`string`:return P.string;case`number`:return Number.isNaN(e)?P.nan:P.number;case`boolean`:return P.boolean;case`function`:return P.function;case`bigint`:return P.bigint;case`symbol`:return P.symbol;case`object`:return Array.isArray(e)?P.array:e===null?P.null:e.then&&typeof e.then==`function`&&e.catch&&typeof e.catch==`function`?P.promise:typeof Map<`u`&&e instanceof Map?P.map:typeof Set<`u`&&e instanceof Set?P.set:typeof Date<`u`&&e instanceof Date?P.date:P.object;default:return P.unknown}},F=Dg.arrayToEnum([`invalid_type`,`invalid_literal`,`custom`,`invalid_union`,`invalid_union_discriminator`,`invalid_enum_value`,`unrecognized_keys`,`invalid_arguments`,`invalid_return_type`,`invalid_date`,`invalid_string`,`too_small`,`too_big`,`invalid_intersection_types`,`not_multiple_of`,`not_finite`]),Ag=class e extends Error{get errors(){return this.issues}constructor(e){super(),this.issues=[],this.addIssue=e=>{this.issues=[...this.issues,e]},this.addIssues=(e=[])=>{this.issues=[...this.issues,...e]};let t=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,t):this.__proto__=t,this.name=`ZodError`,this.issues=e}format(e){let t=e||function(e){return e.message},n={_errors:[]},r=e=>{for(let i of e.issues)if(i.code===`invalid_union`)i.unionErrors.map(r);else if(i.code===`invalid_return_type`)r(i.returnTypeError);else if(i.code===`invalid_arguments`)r(i.argumentsError);else if(i.path.length===0)n._errors.push(t(i));else{let e=n,r=0;for(;re.message){let t={},n=[];for(let r of this.issues)if(r.path.length>0){let n=r.path[0];t[n]=t[n]||[],t[n].push(e(r))}else n.push(e(r));return{formErrors:n,fieldErrors:t}}get formErrors(){return this.flatten()}};Ag.create=e=>new Ag(e);var jg=(e,t)=>{let n;switch(e.code){case F.invalid_type:n=e.received===P.undefined?`Required`:`Expected ${e.expected}, received ${e.received}`;break;case F.invalid_literal:n=`Invalid literal value, expected ${JSON.stringify(e.expected,Dg.jsonStringifyReplacer)}`;break;case F.unrecognized_keys:n=`Unrecognized key(s) in object: ${Dg.joinValues(e.keys,`, `)}`;break;case F.invalid_union:n=`Invalid input`;break;case F.invalid_union_discriminator:n=`Invalid discriminator value. Expected ${Dg.joinValues(e.options)}`;break;case F.invalid_enum_value:n=`Invalid enum value. Expected ${Dg.joinValues(e.options)}, received '${e.received}'`;break;case F.invalid_arguments:n=`Invalid function arguments`;break;case F.invalid_return_type:n=`Invalid function return type`;break;case F.invalid_date:n=`Invalid date`;break;case F.invalid_string:typeof e.validation==`object`?`includes`in e.validation?(n=`Invalid input: must include "${e.validation.includes}"`,typeof e.validation.position==`number`&&(n=`${n} at one or more positions greater than or equal to ${e.validation.position}`)):`startsWith`in e.validation?n=`Invalid input: must start with "${e.validation.startsWith}"`:`endsWith`in e.validation?n=`Invalid input: must end with "${e.validation.endsWith}"`:Dg.assertNever(e.validation):n=e.validation===`regex`?`Invalid`:`Invalid ${e.validation}`;break;case F.too_small:n=e.type===`array`?`Array must contain ${e.exact?`exactly`:e.inclusive?`at least`:`more than`} ${e.minimum} element(s)`:e.type===`string`?`String must contain ${e.exact?`exactly`:e.inclusive?`at least`:`over`} ${e.minimum} character(s)`:e.type===`number`||e.type===`bigint`?`Number must be ${e.exact?`exactly equal to `:e.inclusive?`greater than or equal to `:`greater than `}${e.minimum}`:e.type===`date`?`Date must be ${e.exact?`exactly equal to `:e.inclusive?`greater than or equal to `:`greater than `}${new Date(Number(e.minimum))}`:`Invalid input`;break;case F.too_big:n=e.type===`array`?`Array must contain ${e.exact?`exactly`:e.inclusive?`at most`:`less than`} ${e.maximum} element(s)`:e.type===`string`?`String must contain ${e.exact?`exactly`:e.inclusive?`at most`:`under`} ${e.maximum} character(s)`:e.type===`number`?`Number must be ${e.exact?`exactly`:e.inclusive?`less than or equal to`:`less than`} ${e.maximum}`:e.type===`bigint`?`BigInt must be ${e.exact?`exactly`:e.inclusive?`less than or equal to`:`less than`} ${e.maximum}`:e.type===`date`?`Date must be ${e.exact?`exactly`:e.inclusive?`smaller than or equal to`:`smaller than`} ${new Date(Number(e.maximum))}`:`Invalid input`;break;case F.custom:n=`Invalid input`;break;case F.invalid_intersection_types:n=`Intersection results could not be merged`;break;case F.not_multiple_of:n=`Number must be a multiple of ${e.multipleOf}`;break;case F.not_finite:n=`Number must be finite`;break;default:n=t.defaultError,Dg.assertNever(e)}return{message:n}},Mg=jg;function Ng(){return Mg}var Pg=e=>{let{data:t,path:n,errorMaps:r,issueData:i}=e,a=[...n,...i.path||[]],o={...i,path:a};if(i.message!==void 0)return{...i,path:a,message:i.message};let s=``,c=r.filter(e=>!!e).slice().reverse();for(let e of c)s=e(o,{data:t,defaultError:s}).message;return{...i,path:a,message:s}};function I(e,t){let n=Ng(),r=Pg({issueData:t,data:e.data,path:e.path,errorMaps:[e.common.contextualErrorMap,e.schemaErrorMap,n,n===jg?void 0:jg].filter(e=>!!e)});e.common.issues.push(r)}var Fg=class e{constructor(){this.value=`valid`}dirty(){this.value===`valid`&&(this.value=`dirty`)}abort(){this.value!==`aborted`&&(this.value=`aborted`)}static mergeArray(e,t){let n=[];for(let r of t){if(r.status===`aborted`)return L;r.status===`dirty`&&e.dirty(),n.push(r.value)}return{status:e.value,value:n}}static async mergeObjectAsync(t,n){let r=[];for(let e of n){let t=await e.key,n=await e.value;r.push({key:t,value:n})}return e.mergeObjectSync(t,r)}static mergeObjectSync(e,t){let n={};for(let r of t){let{key:t,value:i}=r;if(t.status===`aborted`||i.status===`aborted`)return L;t.status===`dirty`&&e.dirty(),i.status===`dirty`&&e.dirty(),t.value!==`__proto__`&&(i.value!==void 0||r.alwaysSet)&&(n[t.value]=i.value)}return{status:e.value,value:n}}},L=Object.freeze({status:`aborted`}),Ig=e=>({status:`dirty`,value:e}),Lg=e=>({status:`valid`,value:e}),Rg=e=>e.status===`aborted`,zg=e=>e.status===`dirty`,Bg=e=>e.status===`valid`,Vg=e=>typeof Promise<`u`&&e instanceof Promise,R;(function(e){e.errToObj=e=>typeof e==`string`?{message:e}:e||{},e.toString=e=>typeof e==`string`?e:e?.message})(R||={});var Hg=class{constructor(e,t,n,r){this._cachedPath=[],this.parent=e,this.data=t,this._path=n,this._key=r}get path(){return this._cachedPath.length||(Array.isArray(this._key)?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}},Ug=(e,t)=>{if(Bg(t))return{success:!0,data:t.value};if(!e.common.issues.length)throw Error(`Validation failed but no issues detected.`);return{success:!1,get error(){if(this._error)return this._error;let t=new Ag(e.common.issues);return this._error=t,this._error}}};function Wg(e){if(!e)return{};let{errorMap:t,invalid_type_error:n,required_error:r,description:i}=e;if(t&&(n||r))throw Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return t?{errorMap:t,description:i}:{errorMap:(t,i)=>{let{message:a}=e;return t.code===`invalid_enum_value`?{message:a??i.defaultError}:i.data===void 0?{message:a??r??i.defaultError}:t.code===`invalid_type`?{message:a??n??i.defaultError}:{message:i.defaultError}},description:i}}var Gg=class{get description(){return this._def.description}_getType(e){return kg(e.data)}_getOrReturnCtx(e,t){return t||{common:e.parent.common,data:e.data,parsedType:kg(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}_processInputParams(e){return{status:new Fg,ctx:{common:e.parent.common,data:e.data,parsedType:kg(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}}_parseSync(e){let t=this._parse(e);if(Vg(t))throw Error(`Synchronous parse encountered promise.`);return t}_parseAsync(e){let t=this._parse(e);return Promise.resolve(t)}parse(e,t){let n=this.safeParse(e,t);if(n.success)return n.data;throw n.error}safeParse(e,t){let n={common:{issues:[],async:t?.async??!1,contextualErrorMap:t?.errorMap},path:t?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:kg(e)};return Ug(n,this._parseSync({data:e,path:n.path,parent:n}))}"~validate"(e){let t={common:{issues:[],async:!!this[`~standard`].async},path:[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:kg(e)};if(!this[`~standard`].async)try{let n=this._parseSync({data:e,path:[],parent:t});return Bg(n)?{value:n.value}:{issues:t.common.issues}}catch(e){e?.message?.toLowerCase()?.includes(`encountered`)&&(this[`~standard`].async=!0),t.common={issues:[],async:!0}}return this._parseAsync({data:e,path:[],parent:t}).then(e=>Bg(e)?{value:e.value}:{issues:t.common.issues})}async parseAsync(e,t){let n=await this.safeParseAsync(e,t);if(n.success)return n.data;throw n.error}async safeParseAsync(e,t){let n={common:{issues:[],contextualErrorMap:t?.errorMap,async:!0},path:t?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:kg(e)},r=this._parse({data:e,path:n.path,parent:n});return Ug(n,await(Vg(r)?r:Promise.resolve(r)))}refine(e,t){let n=e=>typeof t==`string`||t===void 0?{message:t}:typeof t==`function`?t(e):t;return this._refinement((t,r)=>{let i=e(t),a=()=>r.addIssue({code:F.custom,...n(t)});return typeof Promise<`u`&&i instanceof Promise?i.then(e=>e?!0:(a(),!1)):i?!0:(a(),!1)})}refinement(e,t){return this._refinement((n,r)=>e(n)?!0:(r.addIssue(typeof t==`function`?t(n,r):t),!1))}_refinement(e){return new J_({schema:this,typeName:z.ZodEffects,effect:{type:`refinement`,refinement:e}})}superRefine(e){return this._refinement(e)}constructor(e){this.spa=this.safeParseAsync,this._def=e,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this),this[`~standard`]={version:1,vendor:`zod`,validate:e=>this[`~validate`](e)}}optional(){return Y_.create(this,this._def)}nullable(){return X_.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return k_.create(this)}promise(){return q_.create(this,this._def)}or(e){return M_.create([this,e],this._def)}and(e){return I_.create(this,e,this._def)}transform(e){return new J_({...Wg(this._def),schema:this,typeName:z.ZodEffects,effect:{type:`transform`,transform:e}})}default(e){let t=typeof e==`function`?e:()=>e;return new Z_({...Wg(this._def),innerType:this,defaultValue:t,typeName:z.ZodDefault})}brand(){return new ev({typeName:z.ZodBranded,type:this,...Wg(this._def)})}catch(e){let t=typeof e==`function`?e:()=>e;return new Q_({...Wg(this._def),innerType:this,catchValue:t,typeName:z.ZodCatch})}describe(e){let t=this.constructor;return new t({...this._def,description:e})}pipe(e){return tv.create(this,e)}readonly(){return nv.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}},Kg=/^c[^\s-]{8,}$/i,qg=/^[0-9a-z]+$/,Jg=/^[0-9A-HJKMNP-TV-Z]{26}$/i,Yg=/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i,Xg=/^[a-z0-9_-]{21}$/i,Zg=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,Qg=/^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/,$g=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,e_=`^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$`,t_,n_=/^(?:(?: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])$/,r_=/^(?:(?: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])\/(3[0-2]|[12]?[0-9])$/,i_=/^(([0-9a-fA-F]{1,4}:){7,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}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))$/,a_=/^(([0-9a-fA-F]{1,4}:){7,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}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,o_=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,s_=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,c_=`((\\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])))`,l_=RegExp(`^${c_}$`);function u_(e){let t=`[0-5]\\d`;e.precision?t=`${t}\\.\\d{${e.precision}}`:e.precision??(t=`${t}(\\.\\d+)?`);let n=e.precision?`+`:`?`;return`([01]\\d|2[0-3]):[0-5]\\d(:${t})${n}`}function d_(e){return RegExp(`^${u_(e)}$`)}function f_(e){let t=`${c_}T${u_(e)}`,n=[];return n.push(e.local?`Z?`:`Z`),e.offset&&n.push(`([+-]\\d{2}:?\\d{2})`),t=`${t}(${n.join(`|`)})`,RegExp(`^${t}$`)}function p_(e,t){return!((t!==`v4`&&t||!n_.test(e))&&(t!==`v6`&&t||!i_.test(e)))}function m_(e,t){if(!Zg.test(e))return!1;try{let[n]=e.split(`.`);if(!n)return!1;let r=n.replace(/-/g,`+`).replace(/_/g,`/`).padEnd(n.length+(4-n.length%4)%4,`=`),i=JSON.parse(atob(r));return!(typeof i!=`object`||!i||`typ`in i&&i?.typ!==`JWT`||!i.alg||t&&i.alg!==t)}catch{return!1}}function h_(e,t){return!((t!==`v4`&&t||!r_.test(e))&&(t!==`v6`&&t||!a_.test(e)))}var g_=class e extends Gg{_parse(e){if(this._def.coerce&&(e.data=String(e.data)),this._getType(e)!==P.string){let t=this._getOrReturnCtx(e);return I(t,{code:F.invalid_type,expected:P.string,received:t.parsedType}),L}let t=new Fg,n;for(let r of this._def.checks)if(r.kind===`min`)e.data.lengthr.value&&(n=this._getOrReturnCtx(e,n),I(n,{code:F.too_big,maximum:r.value,type:`string`,inclusive:!0,exact:!1,message:r.message}),t.dirty());else if(r.kind===`length`){let i=e.data.length>r.value,a=e.data.lengthe.test(t),{validation:t,code:F.invalid_string,...R.errToObj(n)})}_addCheck(t){return new e({...this._def,checks:[...this._def.checks,t]})}email(e){return this._addCheck({kind:`email`,...R.errToObj(e)})}url(e){return this._addCheck({kind:`url`,...R.errToObj(e)})}emoji(e){return this._addCheck({kind:`emoji`,...R.errToObj(e)})}uuid(e){return this._addCheck({kind:`uuid`,...R.errToObj(e)})}nanoid(e){return this._addCheck({kind:`nanoid`,...R.errToObj(e)})}cuid(e){return this._addCheck({kind:`cuid`,...R.errToObj(e)})}cuid2(e){return this._addCheck({kind:`cuid2`,...R.errToObj(e)})}ulid(e){return this._addCheck({kind:`ulid`,...R.errToObj(e)})}base64(e){return this._addCheck({kind:`base64`,...R.errToObj(e)})}base64url(e){return this._addCheck({kind:`base64url`,...R.errToObj(e)})}jwt(e){return this._addCheck({kind:`jwt`,...R.errToObj(e)})}ip(e){return this._addCheck({kind:`ip`,...R.errToObj(e)})}cidr(e){return this._addCheck({kind:`cidr`,...R.errToObj(e)})}datetime(e){return typeof e==`string`?this._addCheck({kind:`datetime`,precision:null,offset:!1,local:!1,message:e}):this._addCheck({kind:`datetime`,precision:e?.precision===void 0?null:e?.precision,offset:e?.offset??!1,local:e?.local??!1,...R.errToObj(e?.message)})}date(e){return this._addCheck({kind:`date`,message:e})}time(e){return typeof e==`string`?this._addCheck({kind:`time`,precision:null,message:e}):this._addCheck({kind:`time`,precision:e?.precision===void 0?null:e?.precision,...R.errToObj(e?.message)})}duration(e){return this._addCheck({kind:`duration`,...R.errToObj(e)})}regex(e,t){return this._addCheck({kind:`regex`,regex:e,...R.errToObj(t)})}includes(e,t){return this._addCheck({kind:`includes`,value:e,position:t?.position,...R.errToObj(t?.message)})}startsWith(e,t){return this._addCheck({kind:`startsWith`,value:e,...R.errToObj(t)})}endsWith(e,t){return this._addCheck({kind:`endsWith`,value:e,...R.errToObj(t)})}min(e,t){return this._addCheck({kind:`min`,value:e,...R.errToObj(t)})}max(e,t){return this._addCheck({kind:`max`,value:e,...R.errToObj(t)})}length(e,t){return this._addCheck({kind:`length`,value:e,...R.errToObj(t)})}nonempty(e){return this.min(1,R.errToObj(e))}trim(){return new e({...this._def,checks:[...this._def.checks,{kind:`trim`}]})}toLowerCase(){return new e({...this._def,checks:[...this._def.checks,{kind:`toLowerCase`}]})}toUpperCase(){return new e({...this._def,checks:[...this._def.checks,{kind:`toUpperCase`}]})}get isDatetime(){return!!this._def.checks.find(e=>e.kind===`datetime`)}get isDate(){return!!this._def.checks.find(e=>e.kind===`date`)}get isTime(){return!!this._def.checks.find(e=>e.kind===`time`)}get isDuration(){return!!this._def.checks.find(e=>e.kind===`duration`)}get isEmail(){return!!this._def.checks.find(e=>e.kind===`email`)}get isURL(){return!!this._def.checks.find(e=>e.kind===`url`)}get isEmoji(){return!!this._def.checks.find(e=>e.kind===`emoji`)}get isUUID(){return!!this._def.checks.find(e=>e.kind===`uuid`)}get isNANOID(){return!!this._def.checks.find(e=>e.kind===`nanoid`)}get isCUID(){return!!this._def.checks.find(e=>e.kind===`cuid`)}get isCUID2(){return!!this._def.checks.find(e=>e.kind===`cuid2`)}get isULID(){return!!this._def.checks.find(e=>e.kind===`ulid`)}get isIP(){return!!this._def.checks.find(e=>e.kind===`ip`)}get isCIDR(){return!!this._def.checks.find(e=>e.kind===`cidr`)}get isBase64(){return!!this._def.checks.find(e=>e.kind===`base64`)}get isBase64url(){return!!this._def.checks.find(e=>e.kind===`base64url`)}get minLength(){let e=null;for(let t of this._def.checks)t.kind===`min`&&(e===null||t.value>e)&&(e=t.value);return e}get maxLength(){let e=null;for(let t of this._def.checks)t.kind===`max`&&(e===null||t.valuenew g_({checks:[],typeName:z.ZodString,coerce:e?.coerce??!1,...Wg(e)});function __(e,t){let n=(e.toString().split(`.`)[1]||``).length,r=(t.toString().split(`.`)[1]||``).length,i=n>r?n:r;return Number.parseInt(e.toFixed(i).replace(`.`,``))%Number.parseInt(t.toFixed(i).replace(`.`,``))/10**i}var v_=class e extends Gg{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(e){if(this._def.coerce&&(e.data=Number(e.data)),this._getType(e)!==P.number){let t=this._getOrReturnCtx(e);return I(t,{code:F.invalid_type,expected:P.number,received:t.parsedType}),L}let t,n=new Fg;for(let r of this._def.checks)r.kind===`int`?Dg.isInteger(e.data)||(t=this._getOrReturnCtx(e,t),I(t,{code:F.invalid_type,expected:`integer`,received:`float`,message:r.message}),n.dirty()):r.kind===`min`?(r.inclusive?e.datar.value:e.data>=r.value)&&(t=this._getOrReturnCtx(e,t),I(t,{code:F.too_big,maximum:r.value,type:`number`,inclusive:r.inclusive,exact:!1,message:r.message}),n.dirty()):r.kind===`multipleOf`?__(e.data,r.value)!==0&&(t=this._getOrReturnCtx(e,t),I(t,{code:F.not_multiple_of,multipleOf:r.value,message:r.message}),n.dirty()):r.kind===`finite`?Number.isFinite(e.data)||(t=this._getOrReturnCtx(e,t),I(t,{code:F.not_finite,message:r.message}),n.dirty()):Dg.assertNever(r);return{status:n.value,value:e.data}}gte(e,t){return this.setLimit(`min`,e,!0,R.toString(t))}gt(e,t){return this.setLimit(`min`,e,!1,R.toString(t))}lte(e,t){return this.setLimit(`max`,e,!0,R.toString(t))}lt(e,t){return this.setLimit(`max`,e,!1,R.toString(t))}setLimit(t,n,r,i){return new e({...this._def,checks:[...this._def.checks,{kind:t,value:n,inclusive:r,message:R.toString(i)}]})}_addCheck(t){return new e({...this._def,checks:[...this._def.checks,t]})}int(e){return this._addCheck({kind:`int`,message:R.toString(e)})}positive(e){return this._addCheck({kind:`min`,value:0,inclusive:!1,message:R.toString(e)})}negative(e){return this._addCheck({kind:`max`,value:0,inclusive:!1,message:R.toString(e)})}nonpositive(e){return this._addCheck({kind:`max`,value:0,inclusive:!0,message:R.toString(e)})}nonnegative(e){return this._addCheck({kind:`min`,value:0,inclusive:!0,message:R.toString(e)})}multipleOf(e,t){return this._addCheck({kind:`multipleOf`,value:e,message:R.toString(t)})}finite(e){return this._addCheck({kind:`finite`,message:R.toString(e)})}safe(e){return this._addCheck({kind:`min`,inclusive:!0,value:-(2**53-1),message:R.toString(e)})._addCheck({kind:`max`,inclusive:!0,value:2**53-1,message:R.toString(e)})}get minValue(){let e=null;for(let t of this._def.checks)t.kind===`min`&&(e===null||t.value>e)&&(e=t.value);return e}get maxValue(){let e=null;for(let t of this._def.checks)t.kind===`max`&&(e===null||t.valuee.kind===`int`||e.kind===`multipleOf`&&Dg.isInteger(e.value))}get isFinite(){let e=null,t=null;for(let n of this._def.checks)if(n.kind===`finite`||n.kind===`int`||n.kind===`multipleOf`)return!0;else n.kind===`min`?(t===null||n.value>t)&&(t=n.value):n.kind===`max`&&(e===null||n.valuenew v_({checks:[],typeName:z.ZodNumber,coerce:e?.coerce||!1,...Wg(e)});var y_=class e extends Gg{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(e){if(this._def.coerce)try{e.data=BigInt(e.data)}catch{return this._getInvalidInput(e)}if(this._getType(e)!==P.bigint)return this._getInvalidInput(e);let t,n=new Fg;for(let r of this._def.checks)r.kind===`min`?(r.inclusive?e.datar.value:e.data>=r.value)&&(t=this._getOrReturnCtx(e,t),I(t,{code:F.too_big,type:`bigint`,maximum:r.value,inclusive:r.inclusive,message:r.message}),n.dirty()):r.kind===`multipleOf`?e.data%r.value!==BigInt(0)&&(t=this._getOrReturnCtx(e,t),I(t,{code:F.not_multiple_of,multipleOf:r.value,message:r.message}),n.dirty()):Dg.assertNever(r);return{status:n.value,value:e.data}}_getInvalidInput(e){let t=this._getOrReturnCtx(e);return I(t,{code:F.invalid_type,expected:P.bigint,received:t.parsedType}),L}gte(e,t){return this.setLimit(`min`,e,!0,R.toString(t))}gt(e,t){return this.setLimit(`min`,e,!1,R.toString(t))}lte(e,t){return this.setLimit(`max`,e,!0,R.toString(t))}lt(e,t){return this.setLimit(`max`,e,!1,R.toString(t))}setLimit(t,n,r,i){return new e({...this._def,checks:[...this._def.checks,{kind:t,value:n,inclusive:r,message:R.toString(i)}]})}_addCheck(t){return new e({...this._def,checks:[...this._def.checks,t]})}positive(e){return this._addCheck({kind:`min`,value:BigInt(0),inclusive:!1,message:R.toString(e)})}negative(e){return this._addCheck({kind:`max`,value:BigInt(0),inclusive:!1,message:R.toString(e)})}nonpositive(e){return this._addCheck({kind:`max`,value:BigInt(0),inclusive:!0,message:R.toString(e)})}nonnegative(e){return this._addCheck({kind:`min`,value:BigInt(0),inclusive:!0,message:R.toString(e)})}multipleOf(e,t){return this._addCheck({kind:`multipleOf`,value:e,message:R.toString(t)})}get minValue(){let e=null;for(let t of this._def.checks)t.kind===`min`&&(e===null||t.value>e)&&(e=t.value);return e}get maxValue(){let e=null;for(let t of this._def.checks)t.kind===`max`&&(e===null||t.valuenew y_({checks:[],typeName:z.ZodBigInt,coerce:e?.coerce??!1,...Wg(e)});var b_=class extends Gg{_parse(e){if(this._def.coerce&&(e.data=!!e.data),this._getType(e)!==P.boolean){let t=this._getOrReturnCtx(e);return I(t,{code:F.invalid_type,expected:P.boolean,received:t.parsedType}),L}return Lg(e.data)}};b_.create=e=>new b_({typeName:z.ZodBoolean,coerce:e?.coerce||!1,...Wg(e)});var x_=class e extends Gg{_parse(e){if(this._def.coerce&&(e.data=new Date(e.data)),this._getType(e)!==P.date){let t=this._getOrReturnCtx(e);return I(t,{code:F.invalid_type,expected:P.date,received:t.parsedType}),L}if(Number.isNaN(e.data.getTime()))return I(this._getOrReturnCtx(e),{code:F.invalid_date}),L;let t=new Fg,n;for(let r of this._def.checks)r.kind===`min`?e.data.getTime()r.value&&(n=this._getOrReturnCtx(e,n),I(n,{code:F.too_big,message:r.message,inclusive:!0,exact:!1,maximum:r.value,type:`date`}),t.dirty()):Dg.assertNever(r);return{status:t.value,value:new Date(e.data.getTime())}}_addCheck(t){return new e({...this._def,checks:[...this._def.checks,t]})}min(e,t){return this._addCheck({kind:`min`,value:e.getTime(),message:R.toString(t)})}max(e,t){return this._addCheck({kind:`max`,value:e.getTime(),message:R.toString(t)})}get minDate(){let e=null;for(let t of this._def.checks)t.kind===`min`&&(e===null||t.value>e)&&(e=t.value);return e==null?null:new Date(e)}get maxDate(){let e=null;for(let t of this._def.checks)t.kind===`max`&&(e===null||t.valuenew x_({checks:[],coerce:e?.coerce||!1,typeName:z.ZodDate,...Wg(e)});var S_=class extends Gg{_parse(e){if(this._getType(e)!==P.symbol){let t=this._getOrReturnCtx(e);return I(t,{code:F.invalid_type,expected:P.symbol,received:t.parsedType}),L}return Lg(e.data)}};S_.create=e=>new S_({typeName:z.ZodSymbol,...Wg(e)});var C_=class extends Gg{_parse(e){if(this._getType(e)!==P.undefined){let t=this._getOrReturnCtx(e);return I(t,{code:F.invalid_type,expected:P.undefined,received:t.parsedType}),L}return Lg(e.data)}};C_.create=e=>new C_({typeName:z.ZodUndefined,...Wg(e)});var w_=class extends Gg{_parse(e){if(this._getType(e)!==P.null){let t=this._getOrReturnCtx(e);return I(t,{code:F.invalid_type,expected:P.null,received:t.parsedType}),L}return Lg(e.data)}};w_.create=e=>new w_({typeName:z.ZodNull,...Wg(e)});var T_=class extends Gg{constructor(){super(...arguments),this._any=!0}_parse(e){return Lg(e.data)}};T_.create=e=>new T_({typeName:z.ZodAny,...Wg(e)});var E_=class extends Gg{constructor(){super(...arguments),this._unknown=!0}_parse(e){return Lg(e.data)}};E_.create=e=>new E_({typeName:z.ZodUnknown,...Wg(e)});var D_=class extends Gg{_parse(e){let t=this._getOrReturnCtx(e);return I(t,{code:F.invalid_type,expected:P.never,received:t.parsedType}),L}};D_.create=e=>new D_({typeName:z.ZodNever,...Wg(e)});var O_=class extends Gg{_parse(e){if(this._getType(e)!==P.undefined){let t=this._getOrReturnCtx(e);return I(t,{code:F.invalid_type,expected:P.void,received:t.parsedType}),L}return Lg(e.data)}};O_.create=e=>new O_({typeName:z.ZodVoid,...Wg(e)});var k_=class e extends Gg{_parse(e){let{ctx:t,status:n}=this._processInputParams(e),r=this._def;if(t.parsedType!==P.array)return I(t,{code:F.invalid_type,expected:P.array,received:t.parsedType}),L;if(r.exactLength!==null){let e=t.data.length>r.exactLength.value,i=t.data.lengthr.maxLength.value&&(I(t,{code:F.too_big,maximum:r.maxLength.value,type:`array`,inclusive:!0,exact:!1,message:r.maxLength.message}),n.dirty()),t.common.async)return Promise.all([...t.data].map((e,n)=>r.type._parseAsync(new Hg(t,e,t.path,n)))).then(e=>Fg.mergeArray(n,e));let i=[...t.data].map((e,n)=>r.type._parseSync(new Hg(t,e,t.path,n)));return Fg.mergeArray(n,i)}get element(){return this._def.type}min(t,n){return new e({...this._def,minLength:{value:t,message:R.toString(n)}})}max(t,n){return new e({...this._def,maxLength:{value:t,message:R.toString(n)}})}length(t,n){return new e({...this._def,exactLength:{value:t,message:R.toString(n)}})}nonempty(e){return this.min(1,e)}};k_.create=(e,t)=>new k_({type:e,minLength:null,maxLength:null,exactLength:null,typeName:z.ZodArray,...Wg(t)});function A_(e){if(e instanceof j_){let t={};for(let n in e.shape){let r=e.shape[n];t[n]=Y_.create(A_(r))}return new j_({...e._def,shape:()=>t})}return e instanceof k_?new k_({...e._def,type:A_(e.element)}):e instanceof Y_?Y_.create(A_(e.unwrap())):e instanceof X_?X_.create(A_(e.unwrap())):e instanceof L_?L_.create(e.items.map(e=>A_(e))):e}var j_=class e extends Gg{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;let e=this._def.shape(),t=Dg.objectKeys(e);return this._cached={shape:e,keys:t},this._cached}_parse(e){if(this._getType(e)!==P.object){let t=this._getOrReturnCtx(e);return I(t,{code:F.invalid_type,expected:P.object,received:t.parsedType}),L}let{status:t,ctx:n}=this._processInputParams(e),{shape:r,keys:i}=this._getCached(),a=[];if(!(this._def.catchall instanceof D_&&this._def.unknownKeys===`strip`))for(let e in n.data)i.includes(e)||a.push(e);let o=[];for(let e of i){let t=r[e],i=n.data[e];o.push({key:{status:`valid`,value:e},value:t._parse(new Hg(n,i,n.path,e)),alwaysSet:e in n.data})}if(this._def.catchall instanceof D_){let e=this._def.unknownKeys;if(e===`passthrough`)for(let e of a)o.push({key:{status:`valid`,value:e},value:{status:`valid`,value:n.data[e]}});else if(e===`strict`)a.length>0&&(I(n,{code:F.unrecognized_keys,keys:a}),t.dirty());else if(e!==`strip`)throw Error(`Internal ZodObject error: invalid unknownKeys value.`)}else{let e=this._def.catchall;for(let t of a){let r=n.data[t];o.push({key:{status:`valid`,value:t},value:e._parse(new Hg(n,r,n.path,t)),alwaysSet:t in n.data})}}return n.common.async?Promise.resolve().then(async()=>{let e=[];for(let t of o){let n=await t.key,r=await t.value;e.push({key:n,value:r,alwaysSet:t.alwaysSet})}return e}).then(e=>Fg.mergeObjectSync(t,e)):Fg.mergeObjectSync(t,o)}get shape(){return this._def.shape()}strict(t){return R.errToObj,new e({...this._def,unknownKeys:`strict`,...t===void 0?{}:{errorMap:(e,n)=>{let r=this._def.errorMap?.(e,n).message??n.defaultError;return e.code===`unrecognized_keys`?{message:R.errToObj(t).message??r}:{message:r}}}})}strip(){return new e({...this._def,unknownKeys:`strip`})}passthrough(){return new e({...this._def,unknownKeys:`passthrough`})}extend(t){return new e({...this._def,shape:()=>({...this._def.shape(),...t})})}merge(t){return new e({unknownKeys:t._def.unknownKeys,catchall:t._def.catchall,shape:()=>({...this._def.shape(),...t._def.shape()}),typeName:z.ZodObject})}setKey(e,t){return this.augment({[e]:t})}catchall(t){return new e({...this._def,catchall:t})}pick(t){let n={};for(let e of Dg.objectKeys(t))t[e]&&this.shape[e]&&(n[e]=this.shape[e]);return new e({...this._def,shape:()=>n})}omit(t){let n={};for(let e of Dg.objectKeys(this.shape))t[e]||(n[e]=this.shape[e]);return new e({...this._def,shape:()=>n})}deepPartial(){return A_(this)}partial(t){let n={};for(let e of Dg.objectKeys(this.shape)){let r=this.shape[e];n[e]=t&&!t[e]?r:r.optional()}return new e({...this._def,shape:()=>n})}required(t){let n={};for(let e of Dg.objectKeys(this.shape))if(t&&!t[e])n[e]=this.shape[e];else{let t=this.shape[e];for(;t instanceof Y_;)t=t._def.innerType;n[e]=t}return new e({...this._def,shape:()=>n})}keyof(){return W_(Dg.objectKeys(this.shape))}};j_.create=(e,t)=>new j_({shape:()=>e,unknownKeys:`strip`,catchall:D_.create(),typeName:z.ZodObject,...Wg(t)}),j_.strictCreate=(e,t)=>new j_({shape:()=>e,unknownKeys:`strict`,catchall:D_.create(),typeName:z.ZodObject,...Wg(t)}),j_.lazycreate=(e,t)=>new j_({shape:e,unknownKeys:`strip`,catchall:D_.create(),typeName:z.ZodObject,...Wg(t)});var M_=class extends Gg{_parse(e){let{ctx:t}=this._processInputParams(e),n=this._def.options;function r(e){for(let t of e)if(t.result.status===`valid`)return t.result;for(let n of e)if(n.result.status===`dirty`)return t.common.issues.push(...n.ctx.common.issues),n.result;let n=e.map(e=>new Ag(e.ctx.common.issues));return I(t,{code:F.invalid_union,unionErrors:n}),L}if(t.common.async)return Promise.all(n.map(async e=>{let n={...t,common:{...t.common,issues:[]},parent:null};return{result:await e._parseAsync({data:t.data,path:t.path,parent:n}),ctx:n}})).then(r);{let e,r=[];for(let i of n){let n={...t,common:{...t.common,issues:[]},parent:null},a=i._parseSync({data:t.data,path:t.path,parent:n});if(a.status===`valid`)return a;a.status===`dirty`&&!e&&(e={result:a,ctx:n}),n.common.issues.length&&r.push(n.common.issues)}if(e)return t.common.issues.push(...e.ctx.common.issues),e.result;let i=r.map(e=>new Ag(e));return I(t,{code:F.invalid_union,unionErrors:i}),L}}get options(){return this._def.options}};M_.create=(e,t)=>new M_({options:e,typeName:z.ZodUnion,...Wg(t)});var N_=e=>e instanceof H_?N_(e.schema):e instanceof J_?N_(e.innerType()):e instanceof U_?[e.value]:e instanceof G_?e.options:e instanceof K_?Dg.objectValues(e.enum):e instanceof Z_?N_(e._def.innerType):e instanceof C_?[void 0]:e instanceof w_?[null]:e instanceof Y_?[void 0,...N_(e.unwrap())]:e instanceof X_?[null,...N_(e.unwrap())]:e instanceof ev||e instanceof nv?N_(e.unwrap()):e instanceof Q_?N_(e._def.innerType):[],P_=class e extends Gg{_parse(e){let{ctx:t}=this._processInputParams(e);if(t.parsedType!==P.object)return I(t,{code:F.invalid_type,expected:P.object,received:t.parsedType}),L;let n=this.discriminator,r=t.data[n],i=this.optionsMap.get(r);return i?t.common.async?i._parseAsync({data:t.data,path:t.path,parent:t}):i._parseSync({data:t.data,path:t.path,parent:t}):(I(t,{code:F.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[n]}),L)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(t,n,r){let i=new Map;for(let e of n){let n=N_(e.shape[t]);if(!n.length)throw Error(`A discriminator value for key \`${t}\` could not be extracted from all schema options`);for(let r of n){if(i.has(r))throw Error(`Discriminator property ${String(t)} has duplicate value ${String(r)}`);i.set(r,e)}}return new e({typeName:z.ZodDiscriminatedUnion,discriminator:t,options:n,optionsMap:i,...Wg(r)})}};function F_(e,t){let n=kg(e),r=kg(t);if(e===t)return{valid:!0,data:e};if(n===P.object&&r===P.object){let n=Dg.objectKeys(t),r=Dg.objectKeys(e).filter(e=>n.indexOf(e)!==-1),i={...e,...t};for(let n of r){let r=F_(e[n],t[n]);if(!r.valid)return{valid:!1};i[n]=r.data}return{valid:!0,data:i}}if(n===P.array&&r===P.array){if(e.length!==t.length)return{valid:!1};let n=[];for(let r=0;r{if(Rg(e)||Rg(r))return L;let i=F_(e.value,r.value);return i.valid?((zg(e)||zg(r))&&t.dirty(),{status:t.value,value:i.data}):(I(n,{code:F.invalid_intersection_types}),L)};return n.common.async?Promise.all([this._def.left._parseAsync({data:n.data,path:n.path,parent:n}),this._def.right._parseAsync({data:n.data,path:n.path,parent:n})]).then(([e,t])=>r(e,t)):r(this._def.left._parseSync({data:n.data,path:n.path,parent:n}),this._def.right._parseSync({data:n.data,path:n.path,parent:n}))}};I_.create=(e,t,n)=>new I_({left:e,right:t,typeName:z.ZodIntersection,...Wg(n)});var L_=class e extends Gg{_parse(e){let{status:t,ctx:n}=this._processInputParams(e);if(n.parsedType!==P.array)return I(n,{code:F.invalid_type,expected:P.array,received:n.parsedType}),L;if(n.data.lengththis._def.items.length&&(I(n,{code:F.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:`array`}),t.dirty());let r=[...n.data].map((e,t)=>{let r=this._def.items[t]||this._def.rest;return r?r._parse(new Hg(n,e,n.path,t)):null}).filter(e=>!!e);return n.common.async?Promise.all(r).then(e=>Fg.mergeArray(t,e)):Fg.mergeArray(t,r)}get items(){return this._def.items}rest(t){return new e({...this._def,rest:t})}};L_.create=(e,t)=>{if(!Array.isArray(e))throw Error(`You must pass an array of schemas to z.tuple([ ... ])`);return new L_({items:e,typeName:z.ZodTuple,rest:null,...Wg(t)})};var R_=class e extends Gg{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){let{status:t,ctx:n}=this._processInputParams(e);if(n.parsedType!==P.object)return I(n,{code:F.invalid_type,expected:P.object,received:n.parsedType}),L;let r=[],i=this._def.keyType,a=this._def.valueType;for(let e in n.data)r.push({key:i._parse(new Hg(n,e,n.path,e)),value:a._parse(new Hg(n,n.data[e],n.path,e)),alwaysSet:e in n.data});return n.common.async?Fg.mergeObjectAsync(t,r):Fg.mergeObjectSync(t,r)}get element(){return this._def.valueType}static create(t,n,r){return n instanceof Gg?new e({keyType:t,valueType:n,typeName:z.ZodRecord,...Wg(r)}):new e({keyType:g_.create(),valueType:t,typeName:z.ZodRecord,...Wg(n)})}},z_=class extends Gg{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){let{status:t,ctx:n}=this._processInputParams(e);if(n.parsedType!==P.map)return I(n,{code:F.invalid_type,expected:P.map,received:n.parsedType}),L;let r=this._def.keyType,i=this._def.valueType,a=[...n.data.entries()].map(([e,t],a)=>({key:r._parse(new Hg(n,e,n.path,[a,`key`])),value:i._parse(new Hg(n,t,n.path,[a,`value`]))}));if(n.common.async){let e=new Map;return Promise.resolve().then(async()=>{for(let n of a){let r=await n.key,i=await n.value;if(r.status===`aborted`||i.status===`aborted`)return L;(r.status===`dirty`||i.status===`dirty`)&&t.dirty(),e.set(r.value,i.value)}return{status:t.value,value:e}})}{let e=new Map;for(let n of a){let r=n.key,i=n.value;if(r.status===`aborted`||i.status===`aborted`)return L;(r.status===`dirty`||i.status===`dirty`)&&t.dirty(),e.set(r.value,i.value)}return{status:t.value,value:e}}}};z_.create=(e,t,n)=>new z_({valueType:t,keyType:e,typeName:z.ZodMap,...Wg(n)});var B_=class e extends Gg{_parse(e){let{status:t,ctx:n}=this._processInputParams(e);if(n.parsedType!==P.set)return I(n,{code:F.invalid_type,expected:P.set,received:n.parsedType}),L;let r=this._def;r.minSize!==null&&n.data.sizer.maxSize.value&&(I(n,{code:F.too_big,maximum:r.maxSize.value,type:`set`,inclusive:!0,exact:!1,message:r.maxSize.message}),t.dirty());let i=this._def.valueType;function a(e){let n=new Set;for(let r of e){if(r.status===`aborted`)return L;r.status===`dirty`&&t.dirty(),n.add(r.value)}return{status:t.value,value:n}}let o=[...n.data.values()].map((e,t)=>i._parse(new Hg(n,e,n.path,t)));return n.common.async?Promise.all(o).then(e=>a(e)):a(o)}min(t,n){return new e({...this._def,minSize:{value:t,message:R.toString(n)}})}max(t,n){return new e({...this._def,maxSize:{value:t,message:R.toString(n)}})}size(e,t){return this.min(e,t).max(e,t)}nonempty(e){return this.min(1,e)}};B_.create=(e,t)=>new B_({valueType:e,minSize:null,maxSize:null,typeName:z.ZodSet,...Wg(t)});var V_=class e extends Gg{constructor(){super(...arguments),this.validate=this.implement}_parse(e){let{ctx:t}=this._processInputParams(e);if(t.parsedType!==P.function)return I(t,{code:F.invalid_type,expected:P.function,received:t.parsedType}),L;function n(e,n){return Pg({data:e,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,Ng(),jg].filter(e=>!!e),issueData:{code:F.invalid_arguments,argumentsError:n}})}function r(e,n){return Pg({data:e,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,Ng(),jg].filter(e=>!!e),issueData:{code:F.invalid_return_type,returnTypeError:n}})}let i={errorMap:t.common.contextualErrorMap},a=t.data;if(this._def.returns instanceof q_){let e=this;return Lg(async function(...t){let o=new Ag([]),s=await e._def.args.parseAsync(t,i).catch(e=>{throw o.addIssue(n(t,e)),o}),c=await Reflect.apply(a,this,s);return await e._def.returns._def.type.parseAsync(c,i).catch(e=>{throw o.addIssue(r(c,e)),o})})}{let e=this;return Lg(function(...t){let o=e._def.args.safeParse(t,i);if(!o.success)throw new Ag([n(t,o.error)]);let s=Reflect.apply(a,this,o.data),c=e._def.returns.safeParse(s,i);if(!c.success)throw new Ag([r(s,c.error)]);return c.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...t){return new e({...this._def,args:L_.create(t).rest(E_.create())})}returns(t){return new e({...this._def,returns:t})}implement(e){return this.parse(e)}strictImplement(e){return this.parse(e)}static create(t,n,r){return new e({args:t||L_.create([]).rest(E_.create()),returns:n||E_.create(),typeName:z.ZodFunction,...Wg(r)})}},H_=class extends Gg{get schema(){return this._def.getter()}_parse(e){let{ctx:t}=this._processInputParams(e);return this._def.getter()._parse({data:t.data,path:t.path,parent:t})}};H_.create=(e,t)=>new H_({getter:e,typeName:z.ZodLazy,...Wg(t)});var U_=class extends Gg{_parse(e){if(e.data!==this._def.value){let t=this._getOrReturnCtx(e);return I(t,{received:t.data,code:F.invalid_literal,expected:this._def.value}),L}return{status:`valid`,value:e.data}}get value(){return this._def.value}};U_.create=(e,t)=>new U_({value:e,typeName:z.ZodLiteral,...Wg(t)});function W_(e,t){return new G_({values:e,typeName:z.ZodEnum,...Wg(t)})}var G_=class e extends Gg{_parse(e){if(typeof e.data!=`string`){let t=this._getOrReturnCtx(e),n=this._def.values;return I(t,{expected:Dg.joinValues(n),received:t.parsedType,code:F.invalid_type}),L}if(this._cache||=new Set(this._def.values),!this._cache.has(e.data)){let t=this._getOrReturnCtx(e),n=this._def.values;return I(t,{received:t.data,code:F.invalid_enum_value,options:n}),L}return Lg(e.data)}get options(){return this._def.values}get enum(){let e={};for(let t of this._def.values)e[t]=t;return e}get Values(){let e={};for(let t of this._def.values)e[t]=t;return e}get Enum(){let e={};for(let t of this._def.values)e[t]=t;return e}extract(t,n=this._def){return e.create(t,{...this._def,...n})}exclude(t,n=this._def){return e.create(this.options.filter(e=>!t.includes(e)),{...this._def,...n})}};G_.create=W_;var K_=class extends Gg{_parse(e){let t=Dg.getValidEnumValues(this._def.values),n=this._getOrReturnCtx(e);if(n.parsedType!==P.string&&n.parsedType!==P.number){let e=Dg.objectValues(t);return I(n,{expected:Dg.joinValues(e),received:n.parsedType,code:F.invalid_type}),L}if(this._cache||=new Set(Dg.getValidEnumValues(this._def.values)),!this._cache.has(e.data)){let e=Dg.objectValues(t);return I(n,{received:n.data,code:F.invalid_enum_value,options:e}),L}return Lg(e.data)}get enum(){return this._def.values}};K_.create=(e,t)=>new K_({values:e,typeName:z.ZodNativeEnum,...Wg(t)});var q_=class extends Gg{unwrap(){return this._def.type}_parse(e){let{ctx:t}=this._processInputParams(e);return t.parsedType!==P.promise&&t.common.async===!1?(I(t,{code:F.invalid_type,expected:P.promise,received:t.parsedType}),L):Lg((t.parsedType===P.promise?t.data:Promise.resolve(t.data)).then(e=>this._def.type.parseAsync(e,{path:t.path,errorMap:t.common.contextualErrorMap})))}};q_.create=(e,t)=>new q_({type:e,typeName:z.ZodPromise,...Wg(t)});var J_=class extends Gg{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===z.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(e){let{status:t,ctx:n}=this._processInputParams(e),r=this._def.effect||null,i={addIssue:e=>{I(n,e),e.fatal?t.abort():t.dirty()},get path(){return n.path}};if(i.addIssue=i.addIssue.bind(i),r.type===`preprocess`){let e=r.transform(n.data,i);if(n.common.async)return Promise.resolve(e).then(async e=>{if(t.value===`aborted`)return L;let r=await this._def.schema._parseAsync({data:e,path:n.path,parent:n});return r.status===`aborted`?L:r.status===`dirty`||t.value===`dirty`?Ig(r.value):r});{if(t.value===`aborted`)return L;let r=this._def.schema._parseSync({data:e,path:n.path,parent:n});return r.status===`aborted`?L:r.status===`dirty`||t.value===`dirty`?Ig(r.value):r}}if(r.type===`refinement`){let e=e=>{let t=r.refinement(e,i);if(n.common.async)return Promise.resolve(t);if(t instanceof Promise)throw Error(`Async refinement encountered during synchronous parse operation. Use .parseAsync instead.`);return e};if(n.common.async===!1){let r=this._def.schema._parseSync({data:n.data,path:n.path,parent:n});return r.status===`aborted`?L:(r.status===`dirty`&&t.dirty(),e(r.value),{status:t.value,value:r.value})}return this._def.schema._parseAsync({data:n.data,path:n.path,parent:n}).then(n=>n.status===`aborted`?L:(n.status===`dirty`&&t.dirty(),e(n.value).then(()=>({status:t.value,value:n.value}))))}if(r.type===`transform`){if(n.common.async===!1){let e=this._def.schema._parseSync({data:n.data,path:n.path,parent:n});if(!Bg(e))return L;let a=r.transform(e.value,i);if(a instanceof Promise)throw Error(`Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.`);return{status:t.value,value:a}}return this._def.schema._parseAsync({data:n.data,path:n.path,parent:n}).then(e=>Bg(e)?Promise.resolve(r.transform(e.value,i)).then(e=>({status:t.value,value:e})):L)}Dg.assertNever(r)}};J_.create=(e,t,n)=>new J_({schema:e,typeName:z.ZodEffects,effect:t,...Wg(n)}),J_.createWithPreprocess=(e,t,n)=>new J_({schema:t,effect:{type:`preprocess`,transform:e},typeName:z.ZodEffects,...Wg(n)});var Y_=class extends Gg{_parse(e){return this._getType(e)===P.undefined?Lg(void 0):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}};Y_.create=(e,t)=>new Y_({innerType:e,typeName:z.ZodOptional,...Wg(t)});var X_=class extends Gg{_parse(e){return this._getType(e)===P.null?Lg(null):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}};X_.create=(e,t)=>new X_({innerType:e,typeName:z.ZodNullable,...Wg(t)});var Z_=class extends Gg{_parse(e){let{ctx:t}=this._processInputParams(e),n=t.data;return t.parsedType===P.undefined&&(n=this._def.defaultValue()),this._def.innerType._parse({data:n,path:t.path,parent:t})}removeDefault(){return this._def.innerType}};Z_.create=(e,t)=>new Z_({innerType:e,typeName:z.ZodDefault,defaultValue:typeof t.default==`function`?t.default:()=>t.default,...Wg(t)});var Q_=class extends Gg{_parse(e){let{ctx:t}=this._processInputParams(e),n={...t,common:{...t.common,issues:[]}},r=this._def.innerType._parse({data:n.data,path:n.path,parent:{...n}});return Vg(r)?r.then(e=>({status:`valid`,value:e.status===`valid`?e.value:this._def.catchValue({get error(){return new Ag(n.common.issues)},input:n.data})})):{status:`valid`,value:r.status===`valid`?r.value:this._def.catchValue({get error(){return new Ag(n.common.issues)},input:n.data})}}removeCatch(){return this._def.innerType}};Q_.create=(e,t)=>new Q_({innerType:e,typeName:z.ZodCatch,catchValue:typeof t.catch==`function`?t.catch:()=>t.catch,...Wg(t)});var $_=class extends Gg{_parse(e){if(this._getType(e)!==P.nan){let t=this._getOrReturnCtx(e);return I(t,{code:F.invalid_type,expected:P.nan,received:t.parsedType}),L}return{status:`valid`,value:e.data}}};$_.create=e=>new $_({typeName:z.ZodNaN,...Wg(e)});var ev=class extends Gg{_parse(e){let{ctx:t}=this._processInputParams(e),n=t.data;return this._def.type._parse({data:n,path:t.path,parent:t})}unwrap(){return this._def.type}},tv=class e extends Gg{_parse(e){let{status:t,ctx:n}=this._processInputParams(e);if(n.common.async)return(async()=>{let e=await this._def.in._parseAsync({data:n.data,path:n.path,parent:n});return e.status===`aborted`?L:e.status===`dirty`?(t.dirty(),Ig(e.value)):this._def.out._parseAsync({data:e.value,path:n.path,parent:n})})();{let e=this._def.in._parseSync({data:n.data,path:n.path,parent:n});return e.status===`aborted`?L:e.status===`dirty`?(t.dirty(),{status:`dirty`,value:e.value}):this._def.out._parseSync({data:e.value,path:n.path,parent:n})}}static create(t,n){return new e({in:t,out:n,typeName:z.ZodPipeline})}},nv=class extends Gg{_parse(e){let t=this._def.innerType._parse(e),n=e=>(Bg(e)&&(e.value=Object.freeze(e.value)),e);return Vg(t)?t.then(e=>n(e)):n(t)}unwrap(){return this._def.innerType}};nv.create=(e,t)=>new nv({innerType:e,typeName:z.ZodReadonly,...Wg(t)}),j_.lazycreate;var z;(function(e){e.ZodString=`ZodString`,e.ZodNumber=`ZodNumber`,e.ZodNaN=`ZodNaN`,e.ZodBigInt=`ZodBigInt`,e.ZodBoolean=`ZodBoolean`,e.ZodDate=`ZodDate`,e.ZodSymbol=`ZodSymbol`,e.ZodUndefined=`ZodUndefined`,e.ZodNull=`ZodNull`,e.ZodAny=`ZodAny`,e.ZodUnknown=`ZodUnknown`,e.ZodNever=`ZodNever`,e.ZodVoid=`ZodVoid`,e.ZodArray=`ZodArray`,e.ZodObject=`ZodObject`,e.ZodUnion=`ZodUnion`,e.ZodDiscriminatedUnion=`ZodDiscriminatedUnion`,e.ZodIntersection=`ZodIntersection`,e.ZodTuple=`ZodTuple`,e.ZodRecord=`ZodRecord`,e.ZodMap=`ZodMap`,e.ZodSet=`ZodSet`,e.ZodFunction=`ZodFunction`,e.ZodLazy=`ZodLazy`,e.ZodLiteral=`ZodLiteral`,e.ZodEnum=`ZodEnum`,e.ZodEffects=`ZodEffects`,e.ZodNativeEnum=`ZodNativeEnum`,e.ZodOptional=`ZodOptional`,e.ZodNullable=`ZodNullable`,e.ZodDefault=`ZodDefault`,e.ZodCatch=`ZodCatch`,e.ZodPromise=`ZodPromise`,e.ZodBranded=`ZodBranded`,e.ZodPipeline=`ZodPipeline`,e.ZodReadonly=`ZodReadonly`})(z||={});var B=g_.create,rv=v_.create;$_.create,y_.create;var iv=b_.create;x_.create,S_.create,C_.create,w_.create;var av=T_.create,ov=E_.create;D_.create,O_.create;var sv=k_.create,cv=j_.create;j_.strictCreate;var lv=M_.create,uv=P_.create;I_.create,L_.create;var dv=R_.create;z_.create,B_.create,V_.create,H_.create;var V=U_.create,fv=G_.create,pv=K_.create;q_.create,J_.create,Y_.create,X_.create,J_.createWithPreprocess,tv.create;var mv=qe(),hv=cv({name:B(),arguments:B()}),gv=cv({id:B(),type:V(`function`),function:hv,encryptedValue:B().optional()}),_v=cv({id:B(),role:B(),content:B().optional(),name:B().optional(),encryptedValue:B().optional()}),vv=cv({type:V(`text`),text:B()}),yv=uv(`type`,[cv({type:V(`data`),value:B(),mimeType:B()}),cv({type:V(`url`),value:B(),mimeType:B().optional()})]),bv=cv({type:V(`image`),source:yv,metadata:ov().optional()}),xv=cv({type:V(`audio`),source:yv,metadata:ov().optional()}),Sv=cv({type:V(`video`),source:yv,metadata:ov().optional()}),Cv=cv({type:V(`document`),source:yv,metadata:ov().optional()}),wv=cv({type:V(`binary`),mimeType:B(),id:B().optional(),url:B().optional(),data:B().optional(),filename:B().optional()}),Tv=(e,t)=>{!e.id&&!e.url&&!e.data&&t.addIssue({code:F.custom,message:`BinaryInputContent requires at least one of id, url, or data.`,path:[`id`]})};wv.superRefine((e,t)=>{Tv(e,t)});var Ev=uv(`type`,[vv,bv,xv,Sv,Cv,wv]).superRefine((e,t)=>{e.type===`binary`&&Tv(e,t)}),Dv=uv(`role`,[_v.extend({role:V(`developer`),content:B()}),_v.extend({role:V(`system`),content:B()}),_v.extend({role:V(`assistant`),content:B().optional(),toolCalls:sv(gv).optional()}),_v.extend({role:V(`user`),content:lv([B(),sv(Ev)])}),cv({id:B(),content:B(),role:V(`tool`),toolCallId:B(),error:B().optional(),encryptedValue:B().optional()}),cv({id:B(),role:V(`activity`),activityType:B(),content:dv(av())}),cv({id:B(),role:V(`reasoning`),content:B(),encryptedValue:B().optional()})]);lv([V(`developer`),V(`system`),V(`assistant`),V(`user`),V(`tool`),V(`activity`),V(`reasoning`)]);var Ov=cv({description:B(),value:B()}),kv=cv({name:B(),description:B(),parameters:av(),metadata:dv(av()).optional()}),Av=cv({id:B(),reason:B(),message:B().optional(),toolCallId:B().optional(),responseSchema:dv(av()).optional(),expiresAt:B().optional(),metadata:dv(av()).optional()}),jv=cv({interruptId:B(),status:fv([`resolved`,`cancelled`]),payload:av().optional()}),Mv=cv({threadId:B(),runId:B(),parentRunId:B().optional(),state:av(),messages:sv(Dv),tools:sv(kv),context:sv(Ov),forwardedProps:av(),resume:sv(jv).optional()}),Nv=av(),Pv=class extends Error{constructor(e){super(e)}},Fv=class extends Pv{constructor(){super(`Connect not implemented. This method is not supported by the current agent.`)}},Iv=cv({name:B(),description:B().optional()}),Lv=cv({name:B().optional(),type:B().optional(),description:B().optional(),version:B().optional(),provider:B().optional(),documentationUrl:B().optional(),metadata:dv(ov()).optional()}),Rv=cv({streaming:iv().optional(),websocket:iv().optional(),httpBinary:iv().optional(),pushNotifications:iv().optional(),resumable:iv().optional()}),zv=cv({supported:iv().optional(),items:sv(kv).optional(),parallelCalls:iv().optional(),clientProvided:iv().optional()}),Bv=cv({structuredOutput:iv().optional(),supportedMimeTypes:sv(B()).optional()}),Vv=cv({snapshots:iv().optional(),deltas:iv().optional(),memory:iv().optional(),persistentState:iv().optional()}),Hv=cv({supported:iv().optional(),delegation:iv().optional(),handoffs:iv().optional(),subAgents:sv(Iv).optional()}),Uv=cv({supported:iv().optional(),streaming:iv().optional(),encrypted:iv().optional()}),Wv=cv({image:iv().optional(),audio:iv().optional(),video:iv().optional(),pdf:iv().optional(),file:iv().optional()}),Gv=cv({image:iv().optional(),audio:iv().optional()}),Kv=cv({input:Wv.optional(),output:Gv.optional()}),qv=cv({codeExecution:iv().optional(),sandboxed:iv().optional(),maxIterations:rv().optional(),maxExecutionTime:rv().optional()}),Jv=cv({supported:iv().optional(),approvals:iv().optional(),interventions:iv().optional(),feedback:iv().optional(),interrupts:iv().optional(),approveWithEdits:iv().optional()});cv({identity:Lv.optional(),transport:Rv.optional(),tools:zv.optional(),output:Bv.optional(),state:Vv.optional(),multiAgent:Hv.optional(),reasoning:Uv.optional(),multimodal:Kv.optional(),execution:qv.optional(),humanInTheLoop:Jv.optional(),custom:dv(ov()).optional()});var Yv=lv([V(`developer`),V(`system`),V(`assistant`),V(`user`)]),H=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.THINKING_START=`THINKING_START`,e.THINKING_END=`THINKING_END`,e.THINKING_TEXT_MESSAGE_START=`THINKING_TEXT_MESSAGE_START`,e.THINKING_TEXT_MESSAGE_CONTENT=`THINKING_TEXT_MESSAGE_CONTENT`,e.THINKING_TEXT_MESSAGE_END=`THINKING_TEXT_MESSAGE_END`,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}({}),Xv=cv({type:pv(H),timestamp:rv().optional(),rawEvent:av().optional()}).passthrough(),Zv=Xv.extend({type:V(H.TEXT_MESSAGE_START),messageId:B(),role:Yv.default(`assistant`),name:B().optional()}),Qv=Xv.extend({type:V(H.TEXT_MESSAGE_CONTENT),messageId:B(),delta:B()}),$v=Xv.extend({type:V(H.TEXT_MESSAGE_END),messageId:B()}),ey=Xv.extend({type:V(H.TEXT_MESSAGE_CHUNK),messageId:B().optional(),role:Yv.optional(),delta:B().optional(),name:B().optional()}),ty=Xv.extend({type:V(H.THINKING_TEXT_MESSAGE_START)}),ny=Qv.omit({messageId:!0,type:!0}).extend({type:V(H.THINKING_TEXT_MESSAGE_CONTENT)}),ry=Xv.extend({type:V(H.THINKING_TEXT_MESSAGE_END)}),iy=Xv.extend({type:V(H.TOOL_CALL_START),toolCallId:B(),toolCallName:B(),parentMessageId:B().nullable().optional().transform(e=>e??void 0)}),ay=Xv.extend({type:V(H.TOOL_CALL_ARGS),toolCallId:B(),delta:B()}),oy=Xv.extend({type:V(H.TOOL_CALL_END),toolCallId:B()}),sy=Xv.extend({messageId:B(),type:V(H.TOOL_CALL_RESULT),toolCallId:B(),content:B(),role:V(`tool`).optional()}),cy=Xv.extend({type:V(H.TOOL_CALL_CHUNK),toolCallId:B().optional(),toolCallName:B().optional(),parentMessageId:B().nullable().optional().transform(e=>e??void 0),delta:B().optional()}),ly=Xv.extend({type:V(H.THINKING_START),title:B().optional()}),uy=Xv.extend({type:V(H.THINKING_END)}),dy=Xv.extend({type:V(H.STATE_SNAPSHOT),snapshot:Nv}),fy=Xv.extend({type:V(H.STATE_DELTA),delta:sv(av())}),py=Xv.extend({type:V(H.MESSAGES_SNAPSHOT),messages:sv(Dv)}),my=Xv.extend({type:V(H.ACTIVITY_SNAPSHOT),messageId:B(),activityType:B(),content:dv(av()),replace:iv().optional().default(!0)}),hy=Xv.extend({type:V(H.ACTIVITY_DELTA),messageId:B(),activityType:B(),patch:sv(av())}),gy=Xv.extend({type:V(H.RAW),event:av(),source:B().optional()}),_y=Xv.extend({type:V(H.CUSTOM),name:B(),value:av()}),vy=Xv.extend({type:V(H.RUN_STARTED),threadId:B(),runId:B(),parentRunId:B().optional(),input:Mv.optional()}),yy=uv(`type`,[cv({type:V(`success`)}).strict(),cv({type:V(`interrupt`),interrupts:sv(Av).min(1)}).strict()]),by=cv({provider:B().optional(),model:B().optional(),inputTokens:rv().int().nonnegative().optional(),outputTokens:rv().int().nonnegative().optional(),totalTokens:rv().int().nonnegative().optional(),reasoningTokens:rv().int().nonnegative().optional(),cachedInputTokens:rv().int().nonnegative().optional()}),xy=Xv.extend({type:V(H.RUN_FINISHED),threadId:B(),runId:B(),result:av().optional(),outcome:yy.nullable().optional().transform(e=>e??void 0),usage:sv(by).optional()}),Sy=Xv.extend({type:V(H.RUN_ERROR),message:B(),code:B().optional(),usage:sv(by).optional()}),Cy=Xv.extend({type:V(H.STEP_STARTED),stepName:B()}),wy=Xv.extend({type:V(H.STEP_FINISHED),stepName:B()}),Ty=lv([V(`tool-call`),V(`message`)]),Ey=uv(`type`,[Zv,Qv,$v,ey,ly,uy,ty,ny,ry,iy,ay,oy,cy,sy,dy,fy,py,my,hy,gy,_y,vy,xy,Sy,Cy,wy,Xv.extend({type:V(H.REASONING_START),messageId:B()}),Xv.extend({type:V(H.REASONING_MESSAGE_START),messageId:B(),role:V(`reasoning`)}),Xv.extend({type:V(H.REASONING_MESSAGE_CONTENT),messageId:B(),delta:B()}),Xv.extend({type:V(H.REASONING_MESSAGE_END),messageId:B()}),Xv.extend({type:V(H.REASONING_MESSAGE_CHUNK),messageId:B().optional(),delta:B().optional()}),Xv.extend({type:V(H.REASONING_END),messageId:B()}),Xv.extend({type:V(H.REASONING_ENCRYPTED_VALUE),subtype:Ty,entityId:B(),encryptedValue:B()})]),Dy=(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)}})(),Oy=Object.prototype.hasOwnProperty;function ky(e,t){return Oy.call(e,t)}function Ay(e){if(Array.isArray(e)){for(var t=Array(e.length),n=0;n=48&&r<=57){t++;continue}return!1}return!0}function Ny(e){return e.indexOf(`/`)===-1&&e.indexOf(`~`)===-1?e:e.replace(/~/g,`~0`).replace(/\//g,`~1`)}function Py(e){return e.replace(/~1/g,`/`).replace(/~0/g,`~`)}function Fy(e){if(e===void 0)return!0;if(e){if(Array.isArray(e)){for(var t=0,n=e.length;tzy,_areEquals:()=>Yy,applyOperation:()=>Wy,applyPatch:()=>Gy,applyReducer:()=>Ky,deepClone:()=>By,getValueByPointer:()=>Uy,validate:()=>Jy,validator:()=>qy}),zy=Ly,By=jy,Vy={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=Uy(n,this.path);r&&=jy(r);var i=Wy(n,{op:`remove`,path:this.from}).removed;return Wy(n,{op:`add`,path:this.path,value:i}),{newDocument:n,removed:r}},copy:function(e,t,n){var r=Uy(n,this.from);return Wy(n,{op:`add`,path:this.path,value:jy(r)}),{newDocument:n}},test:function(e,t,n){return{newDocument:n,test:Yy(e[t],this.value)}},_get:function(e,t,n){return this.value=e[t],{newDocument:n}}},Hy={add:function(e,t,n){return My(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:Vy.move,copy:Vy.copy,test:Vy.test,_get:Vy._get};function Uy(e,t){if(t==``)return e;var n={op:`_get`,path:t};return Wy(e,n),n.value}function Wy(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):qy(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=Uy(e,t.from),t.op===`move`&&(o.removed=e),o;if(t.op===`test`){if(o.test=Yy(e,t.value),o.test===!1)throw new zy(`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 zy("Operation `op` property is not one of operations defined in RFC-6902",`OPERATION_OP_INVALID`,a,t,e);return o}r||(e=jy(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:qy;;){if(f=s[l],f&&f.indexOf(`~`)!=-1&&(f=Py(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&&!My(f))throw new zy(`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 My(f)&&(f=~~f);if(l>=u){if(n&&t.op===`add`&&f>c.length)throw new zy(`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=Hy[t.op].call(t,c,f,e);if(o.test===!1)throw new zy(`Test operation failed`,`TEST_OPERATION_FAILED`,a,t,e);return o}}else if(l>=u){var o=Vy[t.op].call(t,c,f,e);if(o.test===!1)throw new zy(`Test operation failed`,`TEST_OPERATION_FAILED`,a,t,e);return o}if(c=c[f],n&&l0)throw new zy('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 zy("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 zy("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`)&&Fy(e.value))throw new zy("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 zy("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 zy(`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=Jy([{op:`_get`,path:e.from,value:void 0}],n);if(o&&o.name===`OPERATION_PATH_UNRESOLVABLE`)throw new zy(`Cannot perform the operation from a path that does not exist`,`OPERATION_FROM_UNRESOLVABLE`,t,e,n)}}}function Jy(e,t,n){try{if(!Array.isArray(e))throw new zy(`Patch sequence must be an array`,`SEQUENCE_NOT_AN_ARRAY`);if(t)Gy(jy(t),jy(e),n||!0);else{n||=qy;for(var r=0;rsb,generate:()=>ab,observe:()=>ib,unobserve:()=>rb}),Zy=new WeakMap,Qy=function(){function e(e){this.observers=new Map,this.obj=e}return e}(),$y=function(){function e(e,t){this.callback=e,this.observer=t}return e}();function eb(e){return Zy.get(e)}function tb(e,t){return e.observers.get(t)}function nb(e,t){e.observers.delete(t.callback)}function rb(e,t){t.unobserve()}function ib(e,t){var n=[],r,i=eb(e);if(!i)i=new Qy(e),Zy.set(e,i);else{var a=tb(i,t);r=a&&a.observer}if(r)return r;if(r={},i.value=jy(e),t){r.callback=t,r.next=null;var o=function(){ab(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(){ab(r),clearTimeout(r.next),nb(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 $y(t,r)),r}function ab(e,t){t===void 0&&(t=!1);var n=Zy.get(e.object);ob(n.value,e.object,e.patches,``,t),e.patches.length&&Gy(n.value,e.patches);var r=e.patches;return r.length>0&&(e.patches=[],e.callback&&e.callback(r)),r}function ob(e,t,n,r,i){if(t!==e){typeof t.toJSON==`function`&&(t=t.toJSON());for(var a=Ay(t),o=Ay(e),s=!1,c=o.length-1;c>=0;c--){var l=o[c],u=e[l];if(ky(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)?ob(u,d,n,r+`/`+Ny(l),i):u!==d&&(i&&n.push({op:`test`,path:r+`/`+Ny(l),value:jy(u)}),n.push({op:`replace`,path:r+`/`+Ny(l),value:jy(d)}))}else Array.isArray(e)===Array.isArray(t)?(i&&n.push({op:`test`,path:r+`/`+Ny(l),value:jy(u)}),n.push({op:`remove`,path:r+`/`+Ny(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},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?mb:(this.currentObservers=null,a.push(e),new pb(function(){t.currentObservers=null,fb(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 Vb;return e.source=this,e},t.create=function(e,t){return new Zb(e,t)},t}(Vb),Zb=function(e){rf(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)??mb},t}(Xb),Qb={now:function(){return(Qb.delegate||Date).now()},delegate:void 0},$b=function(e){rf(t,e);function t(t,n,r){t===void 0&&(t=1/0),n===void 0&&(n=1/0),r===void 0&&(r=Qb);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 Xx(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():Yx(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`:Yx(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 Zx(){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)<=Qx&&(i+=r/Qx|0,r%=Qx)}return a(-24,-18),a(-18,-12),a(-12,-6),a(-6),t?iS(r,i):rS(r,i)}function eS(e,t){let n=rS(e,t),r=n.hi&2147483648;r&&(n=iS(n.lo,n.hi));let i=tS(n.lo,n.hi);return r?`-`+i:i}function tS(e,t){if({lo:e,hi:t}=nS(e,t),t<=2097151)return String(Qx*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()+aS(o)+aS(a)}function nS(e,t){return{lo:e>>>0,hi:t>>>0}}function rS(e,t){return{lo:e|0,hi:t|0}}function iS(e,t){return t=~t,e?e=~e+1:t+=1,rS(e,t)}var aS=e=>{let t=String(e);return`0000000`.slice(t.length)+t};function oS(){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 sS=cS();function cS(){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 dS}function mS(e){return(t,n)=>{let r=e(t);return n.set(r),{written:r.byteLength}}}var hS;(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`})(hS||={});var gS=class{constructor(e){this.stackPos=[],this.encodeUtf8Into=e?mS(e):pS().encodeUtf8Into,this.buffer=yS,this.viewCache=bS,this.pos=0}ensureCapacity(e){let t=this.pos+e;if(t>this.buffer.length){let e=this.buffer.length||_S;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(vS),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-vS,n=SS(t);return n>vS&&(this.ensureCapacity(n-vS),this.buffer.copyWithin(e+n,e+vS,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(wS(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(CS(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<=xS){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=SS(t),r=this.buffer,i=this.pos,{written:a}=this.encodeUtf8Into(e,r.subarray(i+n)),o=SS(a);return o!=n&&r.copyWithin(i+o,i+n,i+n+a),this.uint32(a),this.pos+=a,this}float(e){return TS(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 wS(e),this.ensureCapacity(4),this.view().setUint32(this.pos,e,!0),this.pos+=4,this}sfixed32(e){return CS(e),this.ensureCapacity(4),this.view().setInt32(this.pos,e,!0),this.pos+=4,this}sint32(e){return CS(e),this.uint32((e<<1^e>>31)>>>0)}sfixed64(e){let t=sS.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=sS.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=sS.enc(e);return this.writeVarint64(t.lo,t.hi)}sint64(e){let t=sS.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=sS.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}},_S=128,vS=1,yS=new Uint8Array,bS=new DataView(yS.buffer),xS=32;function SS(e){return e<128?1:e<16384?2:e<2097152?3:e<268435456?4:5}var U=class{constructor(e,t=pS().decodeUtf8){this.decodeUtf8=t,this.varint64Lo=0,this.varint64Hi=0,this.varint64=Zx,this.uint32=oS,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 hS.Varint:for(;this.buf[this.pos++]&128;);break;case hS.Bit64:this.pos+=4;case hS.Bit32:this.pos+=4;break;case hS.LengthDelimited:let r=this.uint32();this.pos+=r;break;case hS.StartGroup:if(n<=0)throw Error(`maximum recursion depth reached`);for(;;){let[e,r]=this.tag();if(r===hS.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(),sS.dec(this.varint64Lo,this.varint64Hi)}uint64(){return this.varint64(),sS.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,sS.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 sS.uDec(this.sfixed32(),this.sfixed32())}sfixed64(){return sS.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<=xS){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 CS(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 wS(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 TS(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(e)&&(e>34028234663852886e22||e<-34028234663852886e22))throw Error(`invalid float32: `+e)}var ES=function(e){return e[e.NULL_VALUE=0]=`NULL_VALUE`,e[e.UNRECOGNIZED=-1]=`UNRECOGNIZED`,e}({});function DS(){return{fields:{}}}var OS={encode(e,t=new gS){return Object.entries(e.fields).forEach(([e,n])=>{n!==void 0&&AS.encode({key:e,value:n},t.uint32(10).fork()).join()}),t},decode(e,t){let n=e instanceof U?e:new U(e),r=t===void 0?n.len:n.pos+t,i=DS();for(;n.pos>>3){case 1:{if(e!==10)break;let t=AS.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 OS.fromPartial(e??{})},fromPartial(e){let t=DS();return t.fields=Object.entries(e.fields??{}).reduce((e,[t,n])=>(n!==void 0&&(e[t]=n),e),{}),t},wrap(e){let t=DS();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 kS(){return{key:``,value:void 0}}var AS={encode(e,t=new gS){return e.key!==``&&t.uint32(10).string(e.key),e.value!==void 0&&W.encode(W.wrap(e.value),t.uint32(18).fork()).join(),t},decode(e,t){let n=e instanceof U?e:new U(e),r=t===void 0?n.len:n.pos+t,i=kS();for(;n.pos>>3){case 1:if(e!==10)break;i.key=n.string();continue;case 2:if(e!==18)break;i.value=W.unwrap(W.decode(n,n.uint32()));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.key=e.key??``,t.value=e.value??void 0,t}};function jS(){return{nullValue:void 0,numberValue:void 0,stringValue:void 0,boolValue:void 0,structValue:void 0,listValue:void 0}}var W={encode(e,t=new gS){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&&OS.encode(OS.wrap(e.structValue),t.uint32(42).fork()).join(),e.listValue!==void 0&&NS.encode(NS.wrap(e.listValue),t.uint32(50).fork()).join(),t},decode(e,t){let n=e instanceof U?e:new U(e),r=t===void 0?n.len:n.pos+t,i=jS();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=OS.unwrap(OS.decode(n,n.uint32()));continue;case 6:if(e!==50)break;i.listValue=NS.unwrap(NS.decode(n,n.uint32()));continue}if((e&7)==4||e===0)break;n.skip(e&7)}return i},create(e){return W.fromPartial(e??{})},fromPartial(e){let t=jS();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=jS();if(e===null)t.nullValue=ES.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 MS(){return{values:[]}}var NS={encode(e,t=new gS){for(let n of e.values)W.encode(W.wrap(n),t.uint32(10).fork()).join();return t},decode(e,t){let n=e instanceof U?e:new U(e),r=t===void 0?n.len:n.pos+t,i=MS();for(;n.pos>>3){case 1:if(e!==10)break;i.values.push(W.unwrap(W.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=MS();return t.values=e.values?.map(e=>e)||[],t},wrap(e){let t=MS();return t.values=e??[],t},unwrap(e){return e?.hasOwnProperty(`values`)&&globalThis.Array.isArray(e.values)?e.values:e}},PS=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 FS(){return{op:0,path:``,from:void 0,value:void 0}}var IS={encode(e,t=new gS){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&&W.encode(W.wrap(e.value),t.uint32(34).fork()).join(),t},decode(e,t){let n=e instanceof U?e:new U(e),r=t===void 0?n.len:n.pos+t,i=FS();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=W.unwrap(W.decode(n,n.uint32()));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.op=e.op??0,t.path=e.path??``,t.from=e.from??void 0,t.value=e.value??void 0,t}};function LS(){return{id:``,type:``,function:void 0}}var RS={encode(e,t=new gS){return e.id!==``&&t.uint32(10).string(e.id),e.type!==``&&t.uint32(18).string(e.type),e.function!==void 0&&BS.encode(e.function,t.uint32(26).fork()).join(),t},decode(e,t){let n=e instanceof U?e:new U(e),r=t===void 0?n.len:n.pos+t,i=LS();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=BS.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.id=e.id??``,t.type=e.type??``,t.function=e.function!==void 0&&e.function!==null?BS.fromPartial(e.function):void 0,t}};function zS(){return{name:``,arguments:``}}var BS={encode(e,t=new gS){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 U?e:new U(e),r=t===void 0?n.len:n.pos+t,i=zS();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 BS.fromPartial(e??{})},fromPartial(e){let t=zS();return t.name=e.name??``,t.arguments=e.arguments??``,t}};function VS(){return{value:``,mimeType:``}}var HS={encode(e,t=new gS){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 U?e:new U(e),r=t===void 0?n.len:n.pos+t,i=VS();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 HS.fromPartial(e??{})},fromPartial(e){let t=VS();return t.value=e.value??``,t.mimeType=e.mimeType??``,t}};function US(){return{value:``,mimeType:void 0}}var WS={encode(e,t=new gS){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 U?e:new U(e),r=t===void 0?n.len:n.pos+t,i=US();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 WS.fromPartial(e??{})},fromPartial(e){let t=US();return t.value=e.value??``,t.mimeType=e.mimeType??void 0,t}};function GS(){return{data:void 0,url:void 0}}var KS={encode(e,t=new gS){return e.data!==void 0&&HS.encode(e.data,t.uint32(10).fork()).join(),e.url!==void 0&&WS.encode(e.url,t.uint32(18).fork()).join(),t},decode(e,t){let n=e instanceof U?e:new U(e),r=t===void 0?n.len:n.pos+t,i=GS();for(;n.pos>>3){case 1:if(e!==10)break;i.data=HS.decode(n,n.uint32());continue;case 2:if(e!==18)break;i.url=WS.decode(n,n.uint32());continue}if((e&7)==4||e===0)break;n.skip(e&7)}return i},create(e){return KS.fromPartial(e??{})},fromPartial(e){let t=GS();return t.data=e.data!==void 0&&e.data!==null?HS.fromPartial(e.data):void 0,t.url=e.url!==void 0&&e.url!==null?WS.fromPartial(e.url):void 0,t}};function qS(){return{text:``}}var JS={encode(e,t=new gS){return e.text!==``&&t.uint32(10).string(e.text),t},decode(e,t){let n=e instanceof U?e:new U(e),r=t===void 0?n.len:n.pos+t,i=qS();for(;n.pos>>3){case 1:if(e!==10)break;i.text=n.string();continue}if((e&7)==4||e===0)break;n.skip(e&7)}return i},create(e){return JS.fromPartial(e??{})},fromPartial(e){let t=qS();return t.text=e.text??``,t}};function YS(){return{source:void 0,metadata:void 0}}var XS={encode(e,t=new gS){return e.source!==void 0&&KS.encode(e.source,t.uint32(10).fork()).join(),e.metadata!==void 0&&W.encode(W.wrap(e.metadata),t.uint32(18).fork()).join(),t},decode(e,t){let n=e instanceof U?e:new U(e),r=t===void 0?n.len:n.pos+t,i=YS();for(;n.pos>>3){case 1:if(e!==10)break;i.source=KS.decode(n,n.uint32());continue;case 2:if(e!==18)break;i.metadata=W.unwrap(W.decode(n,n.uint32()));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.source=e.source!==void 0&&e.source!==null?KS.fromPartial(e.source):void 0,t.metadata=e.metadata??void 0,t}};function ZS(){return{source:void 0,metadata:void 0}}var QS={encode(e,t=new gS){return e.source!==void 0&&KS.encode(e.source,t.uint32(10).fork()).join(),e.metadata!==void 0&&W.encode(W.wrap(e.metadata),t.uint32(18).fork()).join(),t},decode(e,t){let n=e instanceof U?e:new U(e),r=t===void 0?n.len:n.pos+t,i=ZS();for(;n.pos>>3){case 1:if(e!==10)break;i.source=KS.decode(n,n.uint32());continue;case 2:if(e!==18)break;i.metadata=W.unwrap(W.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.source=e.source!==void 0&&e.source!==null?KS.fromPartial(e.source):void 0,t.metadata=e.metadata??void 0,t}};function $S(){return{source:void 0,metadata:void 0}}var eC={encode(e,t=new gS){return e.source!==void 0&&KS.encode(e.source,t.uint32(10).fork()).join(),e.metadata!==void 0&&W.encode(W.wrap(e.metadata),t.uint32(18).fork()).join(),t},decode(e,t){let n=e instanceof U?e:new U(e),r=t===void 0?n.len:n.pos+t,i=$S();for(;n.pos>>3){case 1:if(e!==10)break;i.source=KS.decode(n,n.uint32());continue;case 2:if(e!==18)break;i.metadata=W.unwrap(W.decode(n,n.uint32()));continue}if((e&7)==4||e===0)break;n.skip(e&7)}return i},create(e){return eC.fromPartial(e??{})},fromPartial(e){let t=$S();return t.source=e.source!==void 0&&e.source!==null?KS.fromPartial(e.source):void 0,t.metadata=e.metadata??void 0,t}};function tC(){return{source:void 0,metadata:void 0}}var nC={encode(e,t=new gS){return e.source!==void 0&&KS.encode(e.source,t.uint32(10).fork()).join(),e.metadata!==void 0&&W.encode(W.wrap(e.metadata),t.uint32(18).fork()).join(),t},decode(e,t){let n=e instanceof U?e:new U(e),r=t===void 0?n.len:n.pos+t,i=tC();for(;n.pos>>3){case 1:if(e!==10)break;i.source=KS.decode(n,n.uint32());continue;case 2:if(e!==18)break;i.metadata=W.unwrap(W.decode(n,n.uint32()));continue}if((e&7)==4||e===0)break;n.skip(e&7)}return i},create(e){return nC.fromPartial(e??{})},fromPartial(e){let t=tC();return t.source=e.source!==void 0&&e.source!==null?KS.fromPartial(e.source):void 0,t.metadata=e.metadata??void 0,t}};function rC(){return{text:void 0,image:void 0,audio:void 0,video:void 0,document:void 0}}var iC={encode(e,t=new gS){return e.text!==void 0&&JS.encode(e.text,t.uint32(10).fork()).join(),e.image!==void 0&&XS.encode(e.image,t.uint32(18).fork()).join(),e.audio!==void 0&&QS.encode(e.audio,t.uint32(26).fork()).join(),e.video!==void 0&&eC.encode(e.video,t.uint32(34).fork()).join(),e.document!==void 0&&nC.encode(e.document,t.uint32(42).fork()).join(),t},decode(e,t){let n=e instanceof U?e:new U(e),r=t===void 0?n.len:n.pos+t,i=rC();for(;n.pos>>3){case 1:if(e!==10)break;i.text=JS.decode(n,n.uint32());continue;case 2:if(e!==18)break;i.image=XS.decode(n,n.uint32());continue;case 3:if(e!==26)break;i.audio=QS.decode(n,n.uint32());continue;case 4:if(e!==34)break;i.video=eC.decode(n,n.uint32());continue;case 5:if(e!==42)break;i.document=nC.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.text=e.text!==void 0&&e.text!==null?JS.fromPartial(e.text):void 0,t.image=e.image!==void 0&&e.image!==null?XS.fromPartial(e.image):void 0,t.audio=e.audio!==void 0&&e.audio!==null?QS.fromPartial(e.audio):void 0,t.video=e.video!==void 0&&e.video!==null?eC.fromPartial(e.video):void 0,t.document=e.document!==void 0&&e.document!==null?nC.fromPartial(e.document):void 0,t}};function aC(){return{id:``,role:``,content:void 0,name:void 0,toolCalls:[],toolCallId:void 0,error:void 0,contentParts:[]}}var oC={encode(e,t=new gS){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)RS.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)iC.encode(n,t.uint32(66).fork()).join();return t},decode(e,t){let n=e instanceof U?e:new U(e),r=t===void 0?n.len:n.pos+t,i=aC();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(RS.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(iC.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.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=>RS.fromPartial(e))||[],t.toolCallId=e.toolCallId??void 0,t.error=e.error??void 0,t.contentParts=e.contentParts?.map(e=>iC.fromPartial(e))||[],t}};function sC(){return{id:``,reason:``,message:void 0,toolCallId:void 0,responseSchema:void 0,expiresAt:void 0,metadata:void 0}}var cC={encode(e,t=new gS){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&&W.encode(W.wrap(e.responseSchema),t.uint32(42).fork()).join(),e.expiresAt!==void 0&&t.uint32(50).string(e.expiresAt),e.metadata!==void 0&&W.encode(W.wrap(e.metadata),t.uint32(58).fork()).join(),t},decode(e,t){let n=e instanceof U?e:new U(e),r=t===void 0?n.len:n.pos+t,i=sC();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=W.unwrap(W.decode(n,n.uint32()));continue;case 6:if(e!==50)break;i.expiresAt=n.string();continue;case 7:if(e!==58)break;i.metadata=W.unwrap(W.decode(n,n.uint32()));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.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}},lC=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.UNRECOGNIZED=-1]=`UNRECOGNIZED`,e}({});function uC(){return{type:0,timestamp:void 0,rawEvent:void 0}}var G={encode(e,t=new gS){return e.type!==0&&t.uint32(8).int32(e.type),e.timestamp!==void 0&&t.uint32(16).int64(e.timestamp),e.rawEvent!==void 0&&W.encode(W.wrap(e.rawEvent),t.uint32(26).fork()).join(),t},decode(e,t){let n=e instanceof U?e:new U(e),r=t===void 0?n.len:n.pos+t,i=uC();for(;n.pos>>3){case 1:if(e!==8)break;i.type=n.int32();continue;case 2:if(e!==16)break;i.timestamp=ZC(n.int64());continue;case 3:if(e!==26)break;i.rawEvent=W.unwrap(W.decode(n,n.uint32()));continue}if((e&7)==4||e===0)break;n.skip(e&7)}return i},create(e){return G.fromPartial(e??{})},fromPartial(e){let t=uC();return t.type=e.type??0,t.timestamp=e.timestamp??void 0,t.rawEvent=e.rawEvent??void 0,t}};function dC(){return{baseEvent:void 0,messageId:``,role:void 0,name:void 0}}var fC={encode(e,t=new gS){return e.baseEvent!==void 0&&G.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),t},decode(e,t){let n=e instanceof U?e:new U(e),r=t===void 0?n.len:n.pos+t,i=dC();for(;n.pos>>3){case 1:if(e!==10)break;i.baseEvent=G.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}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.baseEvent=e.baseEvent!==void 0&&e.baseEvent!==null?G.fromPartial(e.baseEvent):void 0,t.messageId=e.messageId??``,t.role=e.role??void 0,t.name=e.name??void 0,t}};function pC(){return{baseEvent:void 0,messageId:``,delta:``}}var mC={encode(e,t=new gS){return e.baseEvent!==void 0&&G.encode(e.baseEvent,t.uint32(10).fork()).join(),e.messageId!==``&&t.uint32(18).string(e.messageId),e.delta!==``&&t.uint32(26).string(e.delta),t},decode(e,t){let n=e instanceof U?e:new U(e),r=t===void 0?n.len:n.pos+t,i=pC();for(;n.pos>>3){case 1:if(e!==10)break;i.baseEvent=G.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}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.baseEvent=e.baseEvent!==void 0&&e.baseEvent!==null?G.fromPartial(e.baseEvent):void 0,t.messageId=e.messageId??``,t.delta=e.delta??``,t}};function hC(){return{baseEvent:void 0,messageId:``}}var gC={encode(e,t=new gS){return e.baseEvent!==void 0&&G.encode(e.baseEvent,t.uint32(10).fork()).join(),e.messageId!==``&&t.uint32(18).string(e.messageId),t},decode(e,t){let n=e instanceof U?e:new U(e),r=t===void 0?n.len:n.pos+t,i=hC();for(;n.pos>>3){case 1:if(e!==10)break;i.baseEvent=G.decode(n,n.uint32());continue;case 2:if(e!==18)break;i.messageId=n.string();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.baseEvent=e.baseEvent!==void 0&&e.baseEvent!==null?G.fromPartial(e.baseEvent):void 0,t.messageId=e.messageId??``,t}};function _C(){return{baseEvent:void 0,toolCallId:``,toolCallName:``,parentMessageId:void 0}}var vC={encode(e,t=new gS){return e.baseEvent!==void 0&&G.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),t},decode(e,t){let n=e instanceof U?e:new U(e),r=t===void 0?n.len:n.pos+t,i=_C();for(;n.pos>>3){case 1:if(e!==10)break;i.baseEvent=G.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}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.baseEvent=e.baseEvent!==void 0&&e.baseEvent!==null?G.fromPartial(e.baseEvent):void 0,t.toolCallId=e.toolCallId??``,t.toolCallName=e.toolCallName??``,t.parentMessageId=e.parentMessageId??void 0,t}};function yC(){return{baseEvent:void 0,toolCallId:``,delta:``}}var bC={encode(e,t=new gS){return e.baseEvent!==void 0&&G.encode(e.baseEvent,t.uint32(10).fork()).join(),e.toolCallId!==``&&t.uint32(18).string(e.toolCallId),e.delta!==``&&t.uint32(26).string(e.delta),t},decode(e,t){let n=e instanceof U?e:new U(e),r=t===void 0?n.len:n.pos+t,i=yC();for(;n.pos>>3){case 1:if(e!==10)break;i.baseEvent=G.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}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.baseEvent=e.baseEvent!==void 0&&e.baseEvent!==null?G.fromPartial(e.baseEvent):void 0,t.toolCallId=e.toolCallId??``,t.delta=e.delta??``,t}};function xC(){return{baseEvent:void 0,toolCallId:``}}var SC={encode(e,t=new gS){return e.baseEvent!==void 0&&G.encode(e.baseEvent,t.uint32(10).fork()).join(),e.toolCallId!==``&&t.uint32(18).string(e.toolCallId),t},decode(e,t){let n=e instanceof U?e:new U(e),r=t===void 0?n.len:n.pos+t,i=xC();for(;n.pos>>3){case 1:if(e!==10)break;i.baseEvent=G.decode(n,n.uint32());continue;case 2:if(e!==18)break;i.toolCallId=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.baseEvent=e.baseEvent!==void 0&&e.baseEvent!==null?G.fromPartial(e.baseEvent):void 0,t.toolCallId=e.toolCallId??``,t}};function CC(){return{baseEvent:void 0,snapshot:void 0}}var wC={encode(e,t=new gS){return e.baseEvent!==void 0&&G.encode(e.baseEvent,t.uint32(10).fork()).join(),e.snapshot!==void 0&&W.encode(W.wrap(e.snapshot),t.uint32(18).fork()).join(),t},decode(e,t){let n=e instanceof U?e:new U(e),r=t===void 0?n.len:n.pos+t,i=CC();for(;n.pos>>3){case 1:if(e!==10)break;i.baseEvent=G.decode(n,n.uint32());continue;case 2:if(e!==18)break;i.snapshot=W.unwrap(W.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.baseEvent=e.baseEvent!==void 0&&e.baseEvent!==null?G.fromPartial(e.baseEvent):void 0,t.snapshot=e.snapshot??void 0,t}};function TC(){return{baseEvent:void 0,delta:[]}}var EC={encode(e,t=new gS){e.baseEvent!==void 0&&G.encode(e.baseEvent,t.uint32(10).fork()).join();for(let n of e.delta)IS.encode(n,t.uint32(18).fork()).join();return t},decode(e,t){let n=e instanceof U?e:new U(e),r=t===void 0?n.len:n.pos+t,i=TC();for(;n.pos>>3){case 1:if(e!==10)break;i.baseEvent=G.decode(n,n.uint32());continue;case 2:if(e!==18)break;i.delta.push(IS.decode(n,n.uint32()));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.baseEvent=e.baseEvent!==void 0&&e.baseEvent!==null?G.fromPartial(e.baseEvent):void 0,t.delta=e.delta?.map(e=>IS.fromPartial(e))||[],t}};function DC(){return{baseEvent:void 0,messages:[]}}var OC={encode(e,t=new gS){e.baseEvent!==void 0&&G.encode(e.baseEvent,t.uint32(10).fork()).join();for(let n of e.messages)oC.encode(n,t.uint32(18).fork()).join();return t},decode(e,t){let n=e instanceof U?e:new U(e),r=t===void 0?n.len:n.pos+t,i=DC();for(;n.pos>>3){case 1:if(e!==10)break;i.baseEvent=G.decode(n,n.uint32());continue;case 2:if(e!==18)break;i.messages.push(oC.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=DC();return t.baseEvent=e.baseEvent!==void 0&&e.baseEvent!==null?G.fromPartial(e.baseEvent):void 0,t.messages=e.messages?.map(e=>oC.fromPartial(e))||[],t}};function kC(){return{baseEvent:void 0,event:void 0,source:void 0}}var AC={encode(e,t=new gS){return e.baseEvent!==void 0&&G.encode(e.baseEvent,t.uint32(10).fork()).join(),e.event!==void 0&&W.encode(W.wrap(e.event),t.uint32(18).fork()).join(),e.source!==void 0&&t.uint32(26).string(e.source),t},decode(e,t){let n=e instanceof U?e:new U(e),r=t===void 0?n.len:n.pos+t,i=kC();for(;n.pos>>3){case 1:if(e!==10)break;i.baseEvent=G.decode(n,n.uint32());continue;case 2:if(e!==18)break;i.event=W.unwrap(W.decode(n,n.uint32()));continue;case 3:if(e!==26)break;i.source=n.string();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.baseEvent=e.baseEvent!==void 0&&e.baseEvent!==null?G.fromPartial(e.baseEvent):void 0,t.event=e.event??void 0,t.source=e.source??void 0,t}};function jC(){return{baseEvent:void 0,name:``,value:void 0}}var MC={encode(e,t=new gS){return e.baseEvent!==void 0&&G.encode(e.baseEvent,t.uint32(10).fork()).join(),e.name!==``&&t.uint32(18).string(e.name),e.value!==void 0&&W.encode(W.wrap(e.value),t.uint32(26).fork()).join(),t},decode(e,t){let n=e instanceof U?e:new U(e),r=t===void 0?n.len:n.pos+t,i=jC();for(;n.pos>>3){case 1:if(e!==10)break;i.baseEvent=G.decode(n,n.uint32());continue;case 2:if(e!==18)break;i.name=n.string();continue;case 3:if(e!==26)break;i.value=W.unwrap(W.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.baseEvent=e.baseEvent!==void 0&&e.baseEvent!==null?G.fromPartial(e.baseEvent):void 0,t.name=e.name??``,t.value=e.value??void 0,t}};function NC(){return{baseEvent:void 0,threadId:``,runId:``}}var PC={encode(e,t=new gS){return e.baseEvent!==void 0&&G.encode(e.baseEvent,t.uint32(10).fork()).join(),e.threadId!==``&&t.uint32(18).string(e.threadId),e.runId!==``&&t.uint32(26).string(e.runId),t},decode(e,t){let n=e instanceof U?e:new U(e),r=t===void 0?n.len:n.pos+t,i=NC();for(;n.pos>>3){case 1:if(e!==10)break;i.baseEvent=G.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}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.baseEvent=e.baseEvent!==void 0&&e.baseEvent!==null?G.fromPartial(e.baseEvent):void 0,t.threadId=e.threadId??``,t.runId=e.runId??``,t}};function FC(){return{provider:void 0,model:void 0,inputTokens:void 0,outputTokens:void 0,totalTokens:void 0,reasoningTokens:void 0,cachedInputTokens:void 0}}var IC={encode(e,t=new gS){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),t},decode(e,t){let n=e instanceof U?e:new U(e),r=t===void 0?n.len:n.pos+t,i=FC();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=ZC(n.int64());continue;case 4:if(e!==32)break;i.outputTokens=ZC(n.int64());continue;case 5:if(e!==40)break;i.totalTokens=ZC(n.int64());continue;case 6:if(e!==48)break;i.reasoningTokens=ZC(n.int64());continue;case 7:if(e!==56)break;i.cachedInputTokens=ZC(n.int64());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.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}};function LC(){return{baseEvent:void 0,threadId:``,runId:``,result:void 0,outcome:``,interrupts:[],usage:[]}}var RC={encode(e,t=new gS){e.baseEvent!==void 0&&G.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&&W.encode(W.wrap(e.result),t.uint32(34).fork()).join(),e.outcome!==``&&t.uint32(42).string(e.outcome);for(let n of e.interrupts)cC.encode(n,t.uint32(50).fork()).join();for(let n of e.usage)IC.encode(n,t.uint32(58).fork()).join();return t},decode(e,t){let n=e instanceof U?e:new U(e),r=t===void 0?n.len:n.pos+t,i=LC();for(;n.pos>>3){case 1:if(e!==10)break;i.baseEvent=G.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=W.unwrap(W.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(cC.decode(n,n.uint32()));continue;case 7:if(e!==58)break;i.usage.push(IC.decode(n,n.uint32()));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.baseEvent=e.baseEvent!==void 0&&e.baseEvent!==null?G.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=>cC.fromPartial(e))||[],t.usage=e.usage?.map(e=>IC.fromPartial(e))||[],t}};function zC(){return{baseEvent:void 0,code:void 0,message:``,usage:[]}}var BC={encode(e,t=new gS){e.baseEvent!==void 0&&G.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)IC.encode(n,t.uint32(34).fork()).join();return t},decode(e,t){let n=e instanceof U?e:new U(e),r=t===void 0?n.len:n.pos+t,i=zC();for(;n.pos>>3){case 1:if(e!==10)break;i.baseEvent=G.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(IC.decode(n,n.uint32()));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.baseEvent=e.baseEvent!==void 0&&e.baseEvent!==null?G.fromPartial(e.baseEvent):void 0,t.code=e.code??void 0,t.message=e.message??``,t.usage=e.usage?.map(e=>IC.fromPartial(e))||[],t}};function VC(){return{baseEvent:void 0,stepName:``}}var HC={encode(e,t=new gS){return e.baseEvent!==void 0&&G.encode(e.baseEvent,t.uint32(10).fork()).join(),e.stepName!==``&&t.uint32(18).string(e.stepName),t},decode(e,t){let n=e instanceof U?e:new U(e),r=t===void 0?n.len:n.pos+t,i=VC();for(;n.pos>>3){case 1:if(e!==10)break;i.baseEvent=G.decode(n,n.uint32());continue;case 2:if(e!==18)break;i.stepName=n.string();continue}if((e&7)==4||e===0)break;n.skip(e&7)}return i},create(e){return HC.fromPartial(e??{})},fromPartial(e){let t=VC();return t.baseEvent=e.baseEvent!==void 0&&e.baseEvent!==null?G.fromPartial(e.baseEvent):void 0,t.stepName=e.stepName??``,t}};function UC(){return{baseEvent:void 0,stepName:``}}var WC={encode(e,t=new gS){return e.baseEvent!==void 0&&G.encode(e.baseEvent,t.uint32(10).fork()).join(),e.stepName!==``&&t.uint32(18).string(e.stepName),t},decode(e,t){let n=e instanceof U?e:new U(e),r=t===void 0?n.len:n.pos+t,i=UC();for(;n.pos>>3){case 1:if(e!==10)break;i.baseEvent=G.decode(n,n.uint32());continue;case 2:if(e!==18)break;i.stepName=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?G.fromPartial(e.baseEvent):void 0,t.stepName=e.stepName??``,t}};function GC(){return{baseEvent:void 0,messageId:void 0,role:void 0,delta:void 0,name:void 0}}var KC={encode(e,t=new gS){return e.baseEvent!==void 0&&G.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),t},decode(e,t){let n=e instanceof U?e:new U(e),r=t===void 0?n.len:n.pos+t,i=GC();for(;n.pos>>3){case 1:if(e!==10)break;i.baseEvent=G.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}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?G.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}};function qC(){return{baseEvent:void 0,toolCallId:void 0,toolCallName:void 0,parentMessageId:void 0,delta:void 0}}var JC={encode(e,t=new gS){return e.baseEvent!==void 0&&G.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),t},decode(e,t){let n=e instanceof U?e:new U(e),r=t===void 0?n.len:n.pos+t,i=qC();for(;n.pos>>3){case 1:if(e!==10)break;i.baseEvent=G.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}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?G.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}};function YC(){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}}var XC={encode(e,t=new gS){return e.textMessageStart!==void 0&&fC.encode(e.textMessageStart,t.uint32(10).fork()).join(),e.textMessageContent!==void 0&&mC.encode(e.textMessageContent,t.uint32(18).fork()).join(),e.textMessageEnd!==void 0&&gC.encode(e.textMessageEnd,t.uint32(26).fork()).join(),e.toolCallStart!==void 0&&vC.encode(e.toolCallStart,t.uint32(34).fork()).join(),e.toolCallArgs!==void 0&&bC.encode(e.toolCallArgs,t.uint32(42).fork()).join(),e.toolCallEnd!==void 0&&SC.encode(e.toolCallEnd,t.uint32(50).fork()).join(),e.stateSnapshot!==void 0&&wC.encode(e.stateSnapshot,t.uint32(58).fork()).join(),e.stateDelta!==void 0&&EC.encode(e.stateDelta,t.uint32(66).fork()).join(),e.messagesSnapshot!==void 0&&OC.encode(e.messagesSnapshot,t.uint32(74).fork()).join(),e.raw!==void 0&&AC.encode(e.raw,t.uint32(82).fork()).join(),e.custom!==void 0&&MC.encode(e.custom,t.uint32(90).fork()).join(),e.runStarted!==void 0&&PC.encode(e.runStarted,t.uint32(98).fork()).join(),e.runFinished!==void 0&&RC.encode(e.runFinished,t.uint32(106).fork()).join(),e.runError!==void 0&&BC.encode(e.runError,t.uint32(114).fork()).join(),e.stepStarted!==void 0&&HC.encode(e.stepStarted,t.uint32(122).fork()).join(),e.stepFinished!==void 0&&WC.encode(e.stepFinished,t.uint32(130).fork()).join(),e.textMessageChunk!==void 0&&KC.encode(e.textMessageChunk,t.uint32(138).fork()).join(),e.toolCallChunk!==void 0&&JC.encode(e.toolCallChunk,t.uint32(146).fork()).join(),t},decode(e,t){let n=e instanceof U?e:new U(e),r=t===void 0?n.len:n.pos+t,i=YC();for(;n.pos>>3){case 1:if(e!==10)break;i.textMessageStart=fC.decode(n,n.uint32());continue;case 2:if(e!==18)break;i.textMessageContent=mC.decode(n,n.uint32());continue;case 3:if(e!==26)break;i.textMessageEnd=gC.decode(n,n.uint32());continue;case 4:if(e!==34)break;i.toolCallStart=vC.decode(n,n.uint32());continue;case 5:if(e!==42)break;i.toolCallArgs=bC.decode(n,n.uint32());continue;case 6:if(e!==50)break;i.toolCallEnd=SC.decode(n,n.uint32());continue;case 7:if(e!==58)break;i.stateSnapshot=wC.decode(n,n.uint32());continue;case 8:if(e!==66)break;i.stateDelta=EC.decode(n,n.uint32());continue;case 9:if(e!==74)break;i.messagesSnapshot=OC.decode(n,n.uint32());continue;case 10:if(e!==82)break;i.raw=AC.decode(n,n.uint32());continue;case 11:if(e!==90)break;i.custom=MC.decode(n,n.uint32());continue;case 12:if(e!==98)break;i.runStarted=PC.decode(n,n.uint32());continue;case 13:if(e!==106)break;i.runFinished=RC.decode(n,n.uint32());continue;case 14:if(e!==114)break;i.runError=BC.decode(n,n.uint32());continue;case 15:if(e!==122)break;i.stepStarted=HC.decode(n,n.uint32());continue;case 16:if(e!==130)break;i.stepFinished=WC.decode(n,n.uint32());continue;case 17:if(e!==138)break;i.textMessageChunk=KC.decode(n,n.uint32());continue;case 18:if(e!==146)break;i.toolCallChunk=JC.decode(n,n.uint32());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.textMessageStart=e.textMessageStart!==void 0&&e.textMessageStart!==null?fC.fromPartial(e.textMessageStart):void 0,t.textMessageContent=e.textMessageContent!==void 0&&e.textMessageContent!==null?mC.fromPartial(e.textMessageContent):void 0,t.textMessageEnd=e.textMessageEnd!==void 0&&e.textMessageEnd!==null?gC.fromPartial(e.textMessageEnd):void 0,t.toolCallStart=e.toolCallStart!==void 0&&e.toolCallStart!==null?vC.fromPartial(e.toolCallStart):void 0,t.toolCallArgs=e.toolCallArgs!==void 0&&e.toolCallArgs!==null?bC.fromPartial(e.toolCallArgs):void 0,t.toolCallEnd=e.toolCallEnd!==void 0&&e.toolCallEnd!==null?SC.fromPartial(e.toolCallEnd):void 0,t.stateSnapshot=e.stateSnapshot!==void 0&&e.stateSnapshot!==null?wC.fromPartial(e.stateSnapshot):void 0,t.stateDelta=e.stateDelta!==void 0&&e.stateDelta!==null?EC.fromPartial(e.stateDelta):void 0,t.messagesSnapshot=e.messagesSnapshot!==void 0&&e.messagesSnapshot!==null?OC.fromPartial(e.messagesSnapshot):void 0,t.raw=e.raw!==void 0&&e.raw!==null?AC.fromPartial(e.raw):void 0,t.custom=e.custom!==void 0&&e.custom!==null?MC.fromPartial(e.custom):void 0,t.runStarted=e.runStarted!==void 0&&e.runStarted!==null?PC.fromPartial(e.runStarted):void 0,t.runFinished=e.runFinished!==void 0&&e.runFinished!==null?RC.fromPartial(e.runFinished):void 0,t.runError=e.runError!==void 0&&e.runError!==null?BC.fromPartial(e.runError):void 0,t.stepStarted=e.stepStarted!==void 0&&e.stepStarted!==null?HC.fromPartial(e.stepStarted):void 0,t.stepFinished=e.stepFinished!==void 0&&e.stepFinished!==null?WC.fromPartial(e.stepFinished):void 0,t.textMessageChunk=e.textMessageChunk!==void 0&&e.textMessageChunk!==null?KC.fromPartial(e.textMessageChunk):void 0,t.toolCallChunk=e.toolCallChunk!==void 0&&e.toolCallChunk!==null?JC.fromPartial(e.toolCallChunk):void 0,t}};function ZC(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,$C=e=>{let t=QC(e);if(t){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}}}},ew=e=>{let t=QC(e);if(t){if(t.text)return{type:`text`,text:t.text.text};if(t.image){let e=t.image;return{type:`image`,source:$C(e.source),metadata:e.metadata}}if(t.audio){let e=t.audio;return{type:`audio`,source:$C(e.source),metadata:e.metadata}}if(t.video){let e=t.video;return{type:`video`,source:$C(e.source),metadata:e.metadata}}if(t.document){let e=t.document;return{type:`document`,source:$C(e.source),metadata:e.metadata}}}};function tw(e){let t=XC.decode(e),n=Object.values(t).find(e=>e!==void 0);if(!n)throw Error(`Invalid event`);if(n.type=lC[n.baseEvent.type],n.timestamp=n.baseEvent.timestamp,n.rawEvent=n.baseEvent.rawEvent,delete n.baseEvent,n.type===H.MESSAGES_SNAPSHOT)for(let e of n.messages){let t=e;if(t.role===`user`&&Array.isArray(t.contentParts)){let e=t.contentParts.map(e=>ew(e)).filter(e=>e!==void 0);e.length>0&&(t.content=e)}Array.isArray(t.contentParts)&&t.contentParts.length===0&&(t.contentParts=void 0),t.toolCalls?.length===0&&(t.toolCalls=void 0)}if(n.type===H.RUN_FINISHED){let e=n,t=typeof e.outcome==`string`&&e.outcome!==``?e.outcome:void 0,r=Array.isArray(e.interrupts)?e.interrupts:[];delete e.interrupts,t===`interrupt`?e.outcome={type:`interrupt`,interrupts:r}:t===`success`?e.outcome={type:`success`}:delete e.outcome}if((n.type===H.RUN_FINISHED||n.type===H.RUN_ERROR)&&Array.isArray(n.usage)&&n.usage.length===0&&delete n.usage,n.type===H.STATE_DELTA)for(let e of n.delta)e.op=PS[e.op].toLowerCase(),Object.keys(e).forEach(t=>{e[t]===void 0&&delete e[t]});return Object.keys(n).forEach(e=>{n[e]===void 0&&delete n[e]}),Ey.parse(n)}var nw;(function(e){e.assertEqual=e=>{};function t(e){}e.assertIs=t;function n(e){throw Error()}e.assertNever=n,e.arrayToEnum=e=>{let t={};for(let n of e)t[n]=n;return t},e.getValidEnumValues=t=>{let n=e.objectKeys(t).filter(e=>typeof t[t[e]]!=`number`),r={};for(let e of n)r[e]=t[e];return e.objectValues(r)},e.objectValues=t=>e.objectKeys(t).map(function(e){return t[e]}),e.objectKeys=typeof Object.keys==`function`?e=>Object.keys(e):e=>{let t=[];for(let n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.push(n);return t},e.find=(e,t)=>{for(let n of e)if(t(n))return n},e.isInteger=typeof Number.isInteger==`function`?e=>Number.isInteger(e):e=>typeof e==`number`&&Number.isFinite(e)&&Math.floor(e)===e;function r(e,t=` | `){return e.map(e=>typeof e==`string`?`'${e}'`:e).join(t)}e.joinValues=r,e.jsonStringifyReplacer=(e,t)=>typeof t==`bigint`?t.toString():t})(nw||={});var rw;(function(e){e.mergeShapes=(e,t)=>({...e,...t})})(rw||={});var K=nw.arrayToEnum([`string`,`nan`,`number`,`integer`,`float`,`boolean`,`date`,`bigint`,`symbol`,`function`,`undefined`,`null`,`array`,`object`,`unknown`,`promise`,`void`,`never`,`map`,`set`]),iw=e=>{switch(typeof e){case`undefined`:return K.undefined;case`string`:return K.string;case`number`:return Number.isNaN(e)?K.nan:K.number;case`boolean`:return K.boolean;case`function`:return K.function;case`bigint`:return K.bigint;case`symbol`:return K.symbol;case`object`:return Array.isArray(e)?K.array:e===null?K.null:e.then&&typeof e.then==`function`&&e.catch&&typeof e.catch==`function`?K.promise:typeof Map<`u`&&e instanceof Map?K.map:typeof Set<`u`&&e instanceof Set?K.set:typeof Date<`u`&&e instanceof Date?K.date:K.object;default:return K.unknown}},q=nw.arrayToEnum([`invalid_type`,`invalid_literal`,`custom`,`invalid_union`,`invalid_union_discriminator`,`invalid_enum_value`,`unrecognized_keys`,`invalid_arguments`,`invalid_return_type`,`invalid_date`,`invalid_string`,`too_small`,`too_big`,`invalid_intersection_types`,`not_multiple_of`,`not_finite`]),aw=class e extends Error{get errors(){return this.issues}constructor(e){super(),this.issues=[],this.addIssue=e=>{this.issues=[...this.issues,e]},this.addIssues=(e=[])=>{this.issues=[...this.issues,...e]};let t=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,t):this.__proto__=t,this.name=`ZodError`,this.issues=e}format(e){let t=e||function(e){return e.message},n={_errors:[]},r=e=>{for(let i of e.issues)if(i.code===`invalid_union`)i.unionErrors.map(r);else if(i.code===`invalid_return_type`)r(i.returnTypeError);else if(i.code===`invalid_arguments`)r(i.argumentsError);else if(i.path.length===0)n._errors.push(t(i));else{let e=n,r=0;for(;re.message){let t={},n=[];for(let r of this.issues)if(r.path.length>0){let n=r.path[0];t[n]=t[n]||[],t[n].push(e(r))}else n.push(e(r));return{formErrors:n,fieldErrors:t}}get formErrors(){return this.flatten()}};aw.create=e=>new aw(e);var ow=(e,t)=>{let n;switch(e.code){case q.invalid_type:n=e.received===K.undefined?`Required`:`Expected ${e.expected}, received ${e.received}`;break;case q.invalid_literal:n=`Invalid literal value, expected ${JSON.stringify(e.expected,nw.jsonStringifyReplacer)}`;break;case q.unrecognized_keys:n=`Unrecognized key(s) in object: ${nw.joinValues(e.keys,`, `)}`;break;case q.invalid_union:n=`Invalid input`;break;case q.invalid_union_discriminator:n=`Invalid discriminator value. Expected ${nw.joinValues(e.options)}`;break;case q.invalid_enum_value:n=`Invalid enum value. Expected ${nw.joinValues(e.options)}, received '${e.received}'`;break;case q.invalid_arguments:n=`Invalid function arguments`;break;case q.invalid_return_type:n=`Invalid function return type`;break;case q.invalid_date:n=`Invalid date`;break;case q.invalid_string:typeof e.validation==`object`?`includes`in e.validation?(n=`Invalid input: must include "${e.validation.includes}"`,typeof e.validation.position==`number`&&(n=`${n} at one or more positions greater than or equal to ${e.validation.position}`)):`startsWith`in e.validation?n=`Invalid input: must start with "${e.validation.startsWith}"`:`endsWith`in e.validation?n=`Invalid input: must end with "${e.validation.endsWith}"`:nw.assertNever(e.validation):n=e.validation===`regex`?`Invalid`:`Invalid ${e.validation}`;break;case q.too_small:n=e.type===`array`?`Array must contain ${e.exact?`exactly`:e.inclusive?`at least`:`more than`} ${e.minimum} element(s)`:e.type===`string`?`String must contain ${e.exact?`exactly`:e.inclusive?`at least`:`over`} ${e.minimum} character(s)`:e.type===`number`||e.type===`bigint`?`Number must be ${e.exact?`exactly equal to `:e.inclusive?`greater than or equal to `:`greater than `}${e.minimum}`:e.type===`date`?`Date must be ${e.exact?`exactly equal to `:e.inclusive?`greater than or equal to `:`greater than `}${new Date(Number(e.minimum))}`:`Invalid input`;break;case q.too_big:n=e.type===`array`?`Array must contain ${e.exact?`exactly`:e.inclusive?`at most`:`less than`} ${e.maximum} element(s)`:e.type===`string`?`String must contain ${e.exact?`exactly`:e.inclusive?`at most`:`under`} ${e.maximum} character(s)`:e.type===`number`?`Number must be ${e.exact?`exactly`:e.inclusive?`less than or equal to`:`less than`} ${e.maximum}`:e.type===`bigint`?`BigInt must be ${e.exact?`exactly`:e.inclusive?`less than or equal to`:`less than`} ${e.maximum}`:e.type===`date`?`Date must be ${e.exact?`exactly`:e.inclusive?`smaller than or equal to`:`smaller than`} ${new Date(Number(e.maximum))}`:`Invalid input`;break;case q.custom:n=`Invalid input`;break;case q.invalid_intersection_types:n=`Intersection results could not be merged`;break;case q.not_multiple_of:n=`Number must be a multiple of ${e.multipleOf}`;break;case q.not_finite:n=`Number must be finite`;break;default:n=t.defaultError,nw.assertNever(e)}return{message:n}},sw=ow;function cw(){return sw}var lw=e=>{let{data:t,path:n,errorMaps:r,issueData:i}=e,a=[...n,...i.path||[]],o={...i,path:a};if(i.message!==void 0)return{...i,path:a,message:i.message};let s=``,c=r.filter(e=>!!e).slice().reverse();for(let e of c)s=e(o,{data:t,defaultError:s}).message;return{...i,path:a,message:s}};function J(e,t){let n=cw(),r=lw({issueData:t,data:e.data,path:e.path,errorMaps:[e.common.contextualErrorMap,e.schemaErrorMap,n,n===ow?void 0:ow].filter(e=>!!e)});e.common.issues.push(r)}var uw=class e{constructor(){this.value=`valid`}dirty(){this.value===`valid`&&(this.value=`dirty`)}abort(){this.value!==`aborted`&&(this.value=`aborted`)}static mergeArray(e,t){let n=[];for(let r of t){if(r.status===`aborted`)return Y;r.status===`dirty`&&e.dirty(),n.push(r.value)}return{status:e.value,value:n}}static async mergeObjectAsync(t,n){let r=[];for(let e of n){let t=await e.key,n=await e.value;r.push({key:t,value:n})}return e.mergeObjectSync(t,r)}static mergeObjectSync(e,t){let n={};for(let r of t){let{key:t,value:i}=r;if(t.status===`aborted`||i.status===`aborted`)return Y;t.status===`dirty`&&e.dirty(),i.status===`dirty`&&e.dirty(),t.value!==`__proto__`&&(i.value!==void 0||r.alwaysSet)&&(n[t.value]=i.value)}return{status:e.value,value:n}}},Y=Object.freeze({status:`aborted`}),dw=e=>({status:`dirty`,value:e}),fw=e=>({status:`valid`,value:e}),pw=e=>e.status===`aborted`,mw=e=>e.status===`dirty`,hw=e=>e.status===`valid`,gw=e=>typeof Promise<`u`&&e instanceof Promise,X;(function(e){e.errToObj=e=>typeof e==`string`?{message:e}:e||{},e.toString=e=>typeof e==`string`?e:e?.message})(X||={});var _w=class{constructor(e,t,n,r){this._cachedPath=[],this.parent=e,this.data=t,this._path=n,this._key=r}get path(){return this._cachedPath.length||(Array.isArray(this._key)?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}},vw=(e,t)=>{if(hw(t))return{success:!0,data:t.value};if(!e.common.issues.length)throw Error(`Validation failed but no issues detected.`);return{success:!1,get error(){if(this._error)return this._error;let t=new aw(e.common.issues);return this._error=t,this._error}}};function yw(e){if(!e)return{};let{errorMap:t,invalid_type_error:n,required_error:r,description:i}=e;if(t&&(n||r))throw Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return t?{errorMap:t,description:i}:{errorMap:(t,i)=>{let{message:a}=e;return t.code===`invalid_enum_value`?{message:a??i.defaultError}:i.data===void 0?{message:a??r??i.defaultError}:t.code===`invalid_type`?{message:a??n??i.defaultError}:{message:i.defaultError}},description:i}}var bw=class{get description(){return this._def.description}_getType(e){return iw(e.data)}_getOrReturnCtx(e,t){return t||{common:e.parent.common,data:e.data,parsedType:iw(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}_processInputParams(e){return{status:new uw,ctx:{common:e.parent.common,data:e.data,parsedType:iw(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}}_parseSync(e){let t=this._parse(e);if(gw(t))throw Error(`Synchronous parse encountered promise.`);return t}_parseAsync(e){let t=this._parse(e);return Promise.resolve(t)}parse(e,t){let n=this.safeParse(e,t);if(n.success)return n.data;throw n.error}safeParse(e,t){let n={common:{issues:[],async:t?.async??!1,contextualErrorMap:t?.errorMap},path:t?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:iw(e)};return vw(n,this._parseSync({data:e,path:n.path,parent:n}))}"~validate"(e){let t={common:{issues:[],async:!!this[`~standard`].async},path:[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:iw(e)};if(!this[`~standard`].async)try{let n=this._parseSync({data:e,path:[],parent:t});return hw(n)?{value:n.value}:{issues:t.common.issues}}catch(e){e?.message?.toLowerCase()?.includes(`encountered`)&&(this[`~standard`].async=!0),t.common={issues:[],async:!0}}return this._parseAsync({data:e,path:[],parent:t}).then(e=>hw(e)?{value:e.value}:{issues:t.common.issues})}async parseAsync(e,t){let n=await this.safeParseAsync(e,t);if(n.success)return n.data;throw n.error}async safeParseAsync(e,t){let n={common:{issues:[],contextualErrorMap:t?.errorMap,async:!0},path:t?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:iw(e)},r=this._parse({data:e,path:n.path,parent:n});return vw(n,await(gw(r)?r:Promise.resolve(r)))}refine(e,t){let n=e=>typeof t==`string`||t===void 0?{message:t}:typeof t==`function`?t(e):t;return this._refinement((t,r)=>{let i=e(t),a=()=>r.addIssue({code:q.custom,...n(t)});return typeof Promise<`u`&&i instanceof Promise?i.then(e=>e?!0:(a(),!1)):i?!0:(a(),!1)})}refinement(e,t){return this._refinement((n,r)=>e(n)?!0:(r.addIssue(typeof t==`function`?t(n,r):t),!1))}_refinement(e){return new CT({schema:this,typeName:Z.ZodEffects,effect:{type:`refinement`,refinement:e}})}superRefine(e){return this._refinement(e)}constructor(e){this.spa=this.safeParseAsync,this._def=e,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this),this[`~standard`]={version:1,vendor:`zod`,validate:e=>this[`~validate`](e)}}optional(){return wT.create(this,this._def)}nullable(){return TT.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return iT.create(this)}promise(){return ST.create(this,this._def)}or(e){return sT.create([this,e],this._def)}and(e){return dT.create(this,e,this._def)}transform(e){return new CT({...yw(this._def),schema:this,typeName:Z.ZodEffects,effect:{type:`transform`,transform:e}})}default(e){let t=typeof e==`function`?e:()=>e;return new ET({...yw(this._def),innerType:this,defaultValue:t,typeName:Z.ZodDefault})}brand(){return new kT({typeName:Z.ZodBranded,type:this,...yw(this._def)})}catch(e){let t=typeof e==`function`?e:()=>e;return new DT({...yw(this._def),innerType:this,catchValue:t,typeName:Z.ZodCatch})}describe(e){let t=this.constructor;return new t({...this._def,description:e})}pipe(e){return AT.create(this,e)}readonly(){return jT.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}},xw=/^c[^\s-]{8,}$/i,Sw=/^[0-9a-z]+$/,Cw=/^[0-9A-HJKMNP-TV-Z]{26}$/i,ww=/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i,Tw=/^[a-z0-9_-]{21}$/i,Ew=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,Dw=/^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/,Ow=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,kw=`^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$`,Aw,jw=/^(?:(?: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])$/,Mw=/^(?:(?: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])\/(3[0-2]|[12]?[0-9])$/,Nw=/^(([0-9a-fA-F]{1,4}:){7,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}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))$/,Pw=/^(([0-9a-fA-F]{1,4}:){7,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}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,Fw=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,Iw=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,Lw=`((\\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])))`,Rw=RegExp(`^${Lw}$`);function zw(e){let t=`[0-5]\\d`;e.precision?t=`${t}\\.\\d{${e.precision}}`:e.precision??(t=`${t}(\\.\\d+)?`);let n=e.precision?`+`:`?`;return`([01]\\d|2[0-3]):[0-5]\\d(:${t})${n}`}function Bw(e){return RegExp(`^${zw(e)}$`)}function Vw(e){let t=`${Lw}T${zw(e)}`,n=[];return n.push(e.local?`Z?`:`Z`),e.offset&&n.push(`([+-]\\d{2}:?\\d{2})`),t=`${t}(${n.join(`|`)})`,RegExp(`^${t}$`)}function Hw(e,t){return!((t!==`v4`&&t||!jw.test(e))&&(t!==`v6`&&t||!Nw.test(e)))}function Uw(e,t){if(!Ew.test(e))return!1;try{let[n]=e.split(`.`);if(!n)return!1;let r=n.replace(/-/g,`+`).replace(/_/g,`/`).padEnd(n.length+(4-n.length%4)%4,`=`),i=JSON.parse(atob(r));return!(typeof i!=`object`||!i||`typ`in i&&i?.typ!==`JWT`||!i.alg||t&&i.alg!==t)}catch{return!1}}function Ww(e,t){return!((t!==`v4`&&t||!Mw.test(e))&&(t!==`v6`&&t||!Pw.test(e)))}var Gw=class e extends bw{_parse(e){if(this._def.coerce&&(e.data=String(e.data)),this._getType(e)!==K.string){let t=this._getOrReturnCtx(e);return J(t,{code:q.invalid_type,expected:K.string,received:t.parsedType}),Y}let t=new uw,n;for(let r of this._def.checks)if(r.kind===`min`)e.data.lengthr.value&&(n=this._getOrReturnCtx(e,n),J(n,{code:q.too_big,maximum:r.value,type:`string`,inclusive:!0,exact:!1,message:r.message}),t.dirty());else if(r.kind===`length`){let i=e.data.length>r.value,a=e.data.lengthe.test(t),{validation:t,code:q.invalid_string,...X.errToObj(n)})}_addCheck(t){return new e({...this._def,checks:[...this._def.checks,t]})}email(e){return this._addCheck({kind:`email`,...X.errToObj(e)})}url(e){return this._addCheck({kind:`url`,...X.errToObj(e)})}emoji(e){return this._addCheck({kind:`emoji`,...X.errToObj(e)})}uuid(e){return this._addCheck({kind:`uuid`,...X.errToObj(e)})}nanoid(e){return this._addCheck({kind:`nanoid`,...X.errToObj(e)})}cuid(e){return this._addCheck({kind:`cuid`,...X.errToObj(e)})}cuid2(e){return this._addCheck({kind:`cuid2`,...X.errToObj(e)})}ulid(e){return this._addCheck({kind:`ulid`,...X.errToObj(e)})}base64(e){return this._addCheck({kind:`base64`,...X.errToObj(e)})}base64url(e){return this._addCheck({kind:`base64url`,...X.errToObj(e)})}jwt(e){return this._addCheck({kind:`jwt`,...X.errToObj(e)})}ip(e){return this._addCheck({kind:`ip`,...X.errToObj(e)})}cidr(e){return this._addCheck({kind:`cidr`,...X.errToObj(e)})}datetime(e){return typeof e==`string`?this._addCheck({kind:`datetime`,precision:null,offset:!1,local:!1,message:e}):this._addCheck({kind:`datetime`,precision:e?.precision===void 0?null:e?.precision,offset:e?.offset??!1,local:e?.local??!1,...X.errToObj(e?.message)})}date(e){return this._addCheck({kind:`date`,message:e})}time(e){return typeof e==`string`?this._addCheck({kind:`time`,precision:null,message:e}):this._addCheck({kind:`time`,precision:e?.precision===void 0?null:e?.precision,...X.errToObj(e?.message)})}duration(e){return this._addCheck({kind:`duration`,...X.errToObj(e)})}regex(e,t){return this._addCheck({kind:`regex`,regex:e,...X.errToObj(t)})}includes(e,t){return this._addCheck({kind:`includes`,value:e,position:t?.position,...X.errToObj(t?.message)})}startsWith(e,t){return this._addCheck({kind:`startsWith`,value:e,...X.errToObj(t)})}endsWith(e,t){return this._addCheck({kind:`endsWith`,value:e,...X.errToObj(t)})}min(e,t){return this._addCheck({kind:`min`,value:e,...X.errToObj(t)})}max(e,t){return this._addCheck({kind:`max`,value:e,...X.errToObj(t)})}length(e,t){return this._addCheck({kind:`length`,value:e,...X.errToObj(t)})}nonempty(e){return this.min(1,X.errToObj(e))}trim(){return new e({...this._def,checks:[...this._def.checks,{kind:`trim`}]})}toLowerCase(){return new e({...this._def,checks:[...this._def.checks,{kind:`toLowerCase`}]})}toUpperCase(){return new e({...this._def,checks:[...this._def.checks,{kind:`toUpperCase`}]})}get isDatetime(){return!!this._def.checks.find(e=>e.kind===`datetime`)}get isDate(){return!!this._def.checks.find(e=>e.kind===`date`)}get isTime(){return!!this._def.checks.find(e=>e.kind===`time`)}get isDuration(){return!!this._def.checks.find(e=>e.kind===`duration`)}get isEmail(){return!!this._def.checks.find(e=>e.kind===`email`)}get isURL(){return!!this._def.checks.find(e=>e.kind===`url`)}get isEmoji(){return!!this._def.checks.find(e=>e.kind===`emoji`)}get isUUID(){return!!this._def.checks.find(e=>e.kind===`uuid`)}get isNANOID(){return!!this._def.checks.find(e=>e.kind===`nanoid`)}get isCUID(){return!!this._def.checks.find(e=>e.kind===`cuid`)}get isCUID2(){return!!this._def.checks.find(e=>e.kind===`cuid2`)}get isULID(){return!!this._def.checks.find(e=>e.kind===`ulid`)}get isIP(){return!!this._def.checks.find(e=>e.kind===`ip`)}get isCIDR(){return!!this._def.checks.find(e=>e.kind===`cidr`)}get isBase64(){return!!this._def.checks.find(e=>e.kind===`base64`)}get isBase64url(){return!!this._def.checks.find(e=>e.kind===`base64url`)}get minLength(){let e=null;for(let t of this._def.checks)t.kind===`min`&&(e===null||t.value>e)&&(e=t.value);return e}get maxLength(){let e=null;for(let t of this._def.checks)t.kind===`max`&&(e===null||t.valuenew Gw({checks:[],typeName:Z.ZodString,coerce:e?.coerce??!1,...yw(e)});function Kw(e,t){let n=(e.toString().split(`.`)[1]||``).length,r=(t.toString().split(`.`)[1]||``).length,i=n>r?n:r;return Number.parseInt(e.toFixed(i).replace(`.`,``))%Number.parseInt(t.toFixed(i).replace(`.`,``))/10**i}var qw=class e extends bw{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(e){if(this._def.coerce&&(e.data=Number(e.data)),this._getType(e)!==K.number){let t=this._getOrReturnCtx(e);return J(t,{code:q.invalid_type,expected:K.number,received:t.parsedType}),Y}let t,n=new uw;for(let r of this._def.checks)r.kind===`int`?nw.isInteger(e.data)||(t=this._getOrReturnCtx(e,t),J(t,{code:q.invalid_type,expected:`integer`,received:`float`,message:r.message}),n.dirty()):r.kind===`min`?(r.inclusive?e.datar.value:e.data>=r.value)&&(t=this._getOrReturnCtx(e,t),J(t,{code:q.too_big,maximum:r.value,type:`number`,inclusive:r.inclusive,exact:!1,message:r.message}),n.dirty()):r.kind===`multipleOf`?Kw(e.data,r.value)!==0&&(t=this._getOrReturnCtx(e,t),J(t,{code:q.not_multiple_of,multipleOf:r.value,message:r.message}),n.dirty()):r.kind===`finite`?Number.isFinite(e.data)||(t=this._getOrReturnCtx(e,t),J(t,{code:q.not_finite,message:r.message}),n.dirty()):nw.assertNever(r);return{status:n.value,value:e.data}}gte(e,t){return this.setLimit(`min`,e,!0,X.toString(t))}gt(e,t){return this.setLimit(`min`,e,!1,X.toString(t))}lte(e,t){return this.setLimit(`max`,e,!0,X.toString(t))}lt(e,t){return this.setLimit(`max`,e,!1,X.toString(t))}setLimit(t,n,r,i){return new e({...this._def,checks:[...this._def.checks,{kind:t,value:n,inclusive:r,message:X.toString(i)}]})}_addCheck(t){return new e({...this._def,checks:[...this._def.checks,t]})}int(e){return this._addCheck({kind:`int`,message:X.toString(e)})}positive(e){return this._addCheck({kind:`min`,value:0,inclusive:!1,message:X.toString(e)})}negative(e){return this._addCheck({kind:`max`,value:0,inclusive:!1,message:X.toString(e)})}nonpositive(e){return this._addCheck({kind:`max`,value:0,inclusive:!0,message:X.toString(e)})}nonnegative(e){return this._addCheck({kind:`min`,value:0,inclusive:!0,message:X.toString(e)})}multipleOf(e,t){return this._addCheck({kind:`multipleOf`,value:e,message:X.toString(t)})}finite(e){return this._addCheck({kind:`finite`,message:X.toString(e)})}safe(e){return this._addCheck({kind:`min`,inclusive:!0,value:-(2**53-1),message:X.toString(e)})._addCheck({kind:`max`,inclusive:!0,value:2**53-1,message:X.toString(e)})}get minValue(){let e=null;for(let t of this._def.checks)t.kind===`min`&&(e===null||t.value>e)&&(e=t.value);return e}get maxValue(){let e=null;for(let t of this._def.checks)t.kind===`max`&&(e===null||t.valuee.kind===`int`||e.kind===`multipleOf`&&nw.isInteger(e.value))}get isFinite(){let e=null,t=null;for(let n of this._def.checks)if(n.kind===`finite`||n.kind===`int`||n.kind===`multipleOf`)return!0;else n.kind===`min`?(t===null||n.value>t)&&(t=n.value):n.kind===`max`&&(e===null||n.valuenew qw({checks:[],typeName:Z.ZodNumber,coerce:e?.coerce||!1,...yw(e)});var Jw=class e extends bw{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(e){if(this._def.coerce)try{e.data=BigInt(e.data)}catch{return this._getInvalidInput(e)}if(this._getType(e)!==K.bigint)return this._getInvalidInput(e);let t,n=new uw;for(let r of this._def.checks)r.kind===`min`?(r.inclusive?e.datar.value:e.data>=r.value)&&(t=this._getOrReturnCtx(e,t),J(t,{code:q.too_big,type:`bigint`,maximum:r.value,inclusive:r.inclusive,message:r.message}),n.dirty()):r.kind===`multipleOf`?e.data%r.value!==BigInt(0)&&(t=this._getOrReturnCtx(e,t),J(t,{code:q.not_multiple_of,multipleOf:r.value,message:r.message}),n.dirty()):nw.assertNever(r);return{status:n.value,value:e.data}}_getInvalidInput(e){let t=this._getOrReturnCtx(e);return J(t,{code:q.invalid_type,expected:K.bigint,received:t.parsedType}),Y}gte(e,t){return this.setLimit(`min`,e,!0,X.toString(t))}gt(e,t){return this.setLimit(`min`,e,!1,X.toString(t))}lte(e,t){return this.setLimit(`max`,e,!0,X.toString(t))}lt(e,t){return this.setLimit(`max`,e,!1,X.toString(t))}setLimit(t,n,r,i){return new e({...this._def,checks:[...this._def.checks,{kind:t,value:n,inclusive:r,message:X.toString(i)}]})}_addCheck(t){return new e({...this._def,checks:[...this._def.checks,t]})}positive(e){return this._addCheck({kind:`min`,value:BigInt(0),inclusive:!1,message:X.toString(e)})}negative(e){return this._addCheck({kind:`max`,value:BigInt(0),inclusive:!1,message:X.toString(e)})}nonpositive(e){return this._addCheck({kind:`max`,value:BigInt(0),inclusive:!0,message:X.toString(e)})}nonnegative(e){return this._addCheck({kind:`min`,value:BigInt(0),inclusive:!0,message:X.toString(e)})}multipleOf(e,t){return this._addCheck({kind:`multipleOf`,value:e,message:X.toString(t)})}get minValue(){let e=null;for(let t of this._def.checks)t.kind===`min`&&(e===null||t.value>e)&&(e=t.value);return e}get maxValue(){let e=null;for(let t of this._def.checks)t.kind===`max`&&(e===null||t.valuenew Jw({checks:[],typeName:Z.ZodBigInt,coerce:e?.coerce??!1,...yw(e)});var Yw=class extends bw{_parse(e){if(this._def.coerce&&(e.data=!!e.data),this._getType(e)!==K.boolean){let t=this._getOrReturnCtx(e);return J(t,{code:q.invalid_type,expected:K.boolean,received:t.parsedType}),Y}return fw(e.data)}};Yw.create=e=>new Yw({typeName:Z.ZodBoolean,coerce:e?.coerce||!1,...yw(e)});var Xw=class e extends bw{_parse(e){if(this._def.coerce&&(e.data=new Date(e.data)),this._getType(e)!==K.date){let t=this._getOrReturnCtx(e);return J(t,{code:q.invalid_type,expected:K.date,received:t.parsedType}),Y}if(Number.isNaN(e.data.getTime()))return J(this._getOrReturnCtx(e),{code:q.invalid_date}),Y;let t=new uw,n;for(let r of this._def.checks)r.kind===`min`?e.data.getTime()r.value&&(n=this._getOrReturnCtx(e,n),J(n,{code:q.too_big,message:r.message,inclusive:!0,exact:!1,maximum:r.value,type:`date`}),t.dirty()):nw.assertNever(r);return{status:t.value,value:new Date(e.data.getTime())}}_addCheck(t){return new e({...this._def,checks:[...this._def.checks,t]})}min(e,t){return this._addCheck({kind:`min`,value:e.getTime(),message:X.toString(t)})}max(e,t){return this._addCheck({kind:`max`,value:e.getTime(),message:X.toString(t)})}get minDate(){let e=null;for(let t of this._def.checks)t.kind===`min`&&(e===null||t.value>e)&&(e=t.value);return e==null?null:new Date(e)}get maxDate(){let e=null;for(let t of this._def.checks)t.kind===`max`&&(e===null||t.valuenew Xw({checks:[],coerce:e?.coerce||!1,typeName:Z.ZodDate,...yw(e)});var Zw=class extends bw{_parse(e){if(this._getType(e)!==K.symbol){let t=this._getOrReturnCtx(e);return J(t,{code:q.invalid_type,expected:K.symbol,received:t.parsedType}),Y}return fw(e.data)}};Zw.create=e=>new Zw({typeName:Z.ZodSymbol,...yw(e)});var Qw=class extends bw{_parse(e){if(this._getType(e)!==K.undefined){let t=this._getOrReturnCtx(e);return J(t,{code:q.invalid_type,expected:K.undefined,received:t.parsedType}),Y}return fw(e.data)}};Qw.create=e=>new Qw({typeName:Z.ZodUndefined,...yw(e)});var $w=class extends bw{_parse(e){if(this._getType(e)!==K.null){let t=this._getOrReturnCtx(e);return J(t,{code:q.invalid_type,expected:K.null,received:t.parsedType}),Y}return fw(e.data)}};$w.create=e=>new $w({typeName:Z.ZodNull,...yw(e)});var eT=class extends bw{constructor(){super(...arguments),this._any=!0}_parse(e){return fw(e.data)}};eT.create=e=>new eT({typeName:Z.ZodAny,...yw(e)});var tT=class extends bw{constructor(){super(...arguments),this._unknown=!0}_parse(e){return fw(e.data)}};tT.create=e=>new tT({typeName:Z.ZodUnknown,...yw(e)});var nT=class extends bw{_parse(e){let t=this._getOrReturnCtx(e);return J(t,{code:q.invalid_type,expected:K.never,received:t.parsedType}),Y}};nT.create=e=>new nT({typeName:Z.ZodNever,...yw(e)});var rT=class extends bw{_parse(e){if(this._getType(e)!==K.undefined){let t=this._getOrReturnCtx(e);return J(t,{code:q.invalid_type,expected:K.void,received:t.parsedType}),Y}return fw(e.data)}};rT.create=e=>new rT({typeName:Z.ZodVoid,...yw(e)});var iT=class e extends bw{_parse(e){let{ctx:t,status:n}=this._processInputParams(e),r=this._def;if(t.parsedType!==K.array)return J(t,{code:q.invalid_type,expected:K.array,received:t.parsedType}),Y;if(r.exactLength!==null){let e=t.data.length>r.exactLength.value,i=t.data.lengthr.maxLength.value&&(J(t,{code:q.too_big,maximum:r.maxLength.value,type:`array`,inclusive:!0,exact:!1,message:r.maxLength.message}),n.dirty()),t.common.async)return Promise.all([...t.data].map((e,n)=>r.type._parseAsync(new _w(t,e,t.path,n)))).then(e=>uw.mergeArray(n,e));let i=[...t.data].map((e,n)=>r.type._parseSync(new _w(t,e,t.path,n)));return uw.mergeArray(n,i)}get element(){return this._def.type}min(t,n){return new e({...this._def,minLength:{value:t,message:X.toString(n)}})}max(t,n){return new e({...this._def,maxLength:{value:t,message:X.toString(n)}})}length(t,n){return new e({...this._def,exactLength:{value:t,message:X.toString(n)}})}nonempty(e){return this.min(1,e)}};iT.create=(e,t)=>new iT({type:e,minLength:null,maxLength:null,exactLength:null,typeName:Z.ZodArray,...yw(t)});function aT(e){if(e instanceof oT){let t={};for(let n in e.shape){let r=e.shape[n];t[n]=wT.create(aT(r))}return new oT({...e._def,shape:()=>t})}return e instanceof iT?new iT({...e._def,type:aT(e.element)}):e instanceof wT?wT.create(aT(e.unwrap())):e instanceof TT?TT.create(aT(e.unwrap())):e instanceof fT?fT.create(e.items.map(e=>aT(e))):e}var oT=class e extends bw{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;let e=this._def.shape(),t=nw.objectKeys(e);return this._cached={shape:e,keys:t},this._cached}_parse(e){if(this._getType(e)!==K.object){let t=this._getOrReturnCtx(e);return J(t,{code:q.invalid_type,expected:K.object,received:t.parsedType}),Y}let{status:t,ctx:n}=this._processInputParams(e),{shape:r,keys:i}=this._getCached(),a=[];if(!(this._def.catchall instanceof nT&&this._def.unknownKeys===`strip`))for(let e in n.data)i.includes(e)||a.push(e);let o=[];for(let e of i){let t=r[e],i=n.data[e];o.push({key:{status:`valid`,value:e},value:t._parse(new _w(n,i,n.path,e)),alwaysSet:e in n.data})}if(this._def.catchall instanceof nT){let e=this._def.unknownKeys;if(e===`passthrough`)for(let e of a)o.push({key:{status:`valid`,value:e},value:{status:`valid`,value:n.data[e]}});else if(e===`strict`)a.length>0&&(J(n,{code:q.unrecognized_keys,keys:a}),t.dirty());else if(e!==`strip`)throw Error(`Internal ZodObject error: invalid unknownKeys value.`)}else{let e=this._def.catchall;for(let t of a){let r=n.data[t];o.push({key:{status:`valid`,value:t},value:e._parse(new _w(n,r,n.path,t)),alwaysSet:t in n.data})}}return n.common.async?Promise.resolve().then(async()=>{let e=[];for(let t of o){let n=await t.key,r=await t.value;e.push({key:n,value:r,alwaysSet:t.alwaysSet})}return e}).then(e=>uw.mergeObjectSync(t,e)):uw.mergeObjectSync(t,o)}get shape(){return this._def.shape()}strict(t){return X.errToObj,new e({...this._def,unknownKeys:`strict`,...t===void 0?{}:{errorMap:(e,n)=>{let r=this._def.errorMap?.(e,n).message??n.defaultError;return e.code===`unrecognized_keys`?{message:X.errToObj(t).message??r}:{message:r}}}})}strip(){return new e({...this._def,unknownKeys:`strip`})}passthrough(){return new e({...this._def,unknownKeys:`passthrough`})}extend(t){return new e({...this._def,shape:()=>({...this._def.shape(),...t})})}merge(t){return new e({unknownKeys:t._def.unknownKeys,catchall:t._def.catchall,shape:()=>({...this._def.shape(),...t._def.shape()}),typeName:Z.ZodObject})}setKey(e,t){return this.augment({[e]:t})}catchall(t){return new e({...this._def,catchall:t})}pick(t){let n={};for(let e of nw.objectKeys(t))t[e]&&this.shape[e]&&(n[e]=this.shape[e]);return new e({...this._def,shape:()=>n})}omit(t){let n={};for(let e of nw.objectKeys(this.shape))t[e]||(n[e]=this.shape[e]);return new e({...this._def,shape:()=>n})}deepPartial(){return aT(this)}partial(t){let n={};for(let e of nw.objectKeys(this.shape)){let r=this.shape[e];n[e]=t&&!t[e]?r:r.optional()}return new e({...this._def,shape:()=>n})}required(t){let n={};for(let e of nw.objectKeys(this.shape))if(t&&!t[e])n[e]=this.shape[e];else{let t=this.shape[e];for(;t instanceof wT;)t=t._def.innerType;n[e]=t}return new e({...this._def,shape:()=>n})}keyof(){return yT(nw.objectKeys(this.shape))}};oT.create=(e,t)=>new oT({shape:()=>e,unknownKeys:`strip`,catchall:nT.create(),typeName:Z.ZodObject,...yw(t)}),oT.strictCreate=(e,t)=>new oT({shape:()=>e,unknownKeys:`strict`,catchall:nT.create(),typeName:Z.ZodObject,...yw(t)}),oT.lazycreate=(e,t)=>new oT({shape:e,unknownKeys:`strip`,catchall:nT.create(),typeName:Z.ZodObject,...yw(t)});var sT=class extends bw{_parse(e){let{ctx:t}=this._processInputParams(e),n=this._def.options;function r(e){for(let t of e)if(t.result.status===`valid`)return t.result;for(let n of e)if(n.result.status===`dirty`)return t.common.issues.push(...n.ctx.common.issues),n.result;let n=e.map(e=>new aw(e.ctx.common.issues));return J(t,{code:q.invalid_union,unionErrors:n}),Y}if(t.common.async)return Promise.all(n.map(async e=>{let n={...t,common:{...t.common,issues:[]},parent:null};return{result:await e._parseAsync({data:t.data,path:t.path,parent:n}),ctx:n}})).then(r);{let e,r=[];for(let i of n){let n={...t,common:{...t.common,issues:[]},parent:null},a=i._parseSync({data:t.data,path:t.path,parent:n});if(a.status===`valid`)return a;a.status===`dirty`&&!e&&(e={result:a,ctx:n}),n.common.issues.length&&r.push(n.common.issues)}if(e)return t.common.issues.push(...e.ctx.common.issues),e.result;let i=r.map(e=>new aw(e));return J(t,{code:q.invalid_union,unionErrors:i}),Y}}get options(){return this._def.options}};sT.create=(e,t)=>new sT({options:e,typeName:Z.ZodUnion,...yw(t)});var cT=e=>e instanceof _T?cT(e.schema):e instanceof CT?cT(e.innerType()):e instanceof vT?[e.value]:e instanceof bT?e.options:e instanceof xT?nw.objectValues(e.enum):e instanceof ET?cT(e._def.innerType):e instanceof Qw?[void 0]:e instanceof $w?[null]:e instanceof wT?[void 0,...cT(e.unwrap())]:e instanceof TT?[null,...cT(e.unwrap())]:e instanceof kT||e instanceof jT?cT(e.unwrap()):e instanceof DT?cT(e._def.innerType):[],lT=class e extends bw{_parse(e){let{ctx:t}=this._processInputParams(e);if(t.parsedType!==K.object)return J(t,{code:q.invalid_type,expected:K.object,received:t.parsedType}),Y;let n=this.discriminator,r=t.data[n],i=this.optionsMap.get(r);return i?t.common.async?i._parseAsync({data:t.data,path:t.path,parent:t}):i._parseSync({data:t.data,path:t.path,parent:t}):(J(t,{code:q.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[n]}),Y)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(t,n,r){let i=new Map;for(let e of n){let n=cT(e.shape[t]);if(!n.length)throw Error(`A discriminator value for key \`${t}\` could not be extracted from all schema options`);for(let r of n){if(i.has(r))throw Error(`Discriminator property ${String(t)} has duplicate value ${String(r)}`);i.set(r,e)}}return new e({typeName:Z.ZodDiscriminatedUnion,discriminator:t,options:n,optionsMap:i,...yw(r)})}};function uT(e,t){let n=iw(e),r=iw(t);if(e===t)return{valid:!0,data:e};if(n===K.object&&r===K.object){let n=nw.objectKeys(t),r=nw.objectKeys(e).filter(e=>n.indexOf(e)!==-1),i={...e,...t};for(let n of r){let r=uT(e[n],t[n]);if(!r.valid)return{valid:!1};i[n]=r.data}return{valid:!0,data:i}}if(n===K.array&&r===K.array){if(e.length!==t.length)return{valid:!1};let n=[];for(let r=0;r{if(pw(e)||pw(r))return Y;let i=uT(e.value,r.value);return i.valid?((mw(e)||mw(r))&&t.dirty(),{status:t.value,value:i.data}):(J(n,{code:q.invalid_intersection_types}),Y)};return n.common.async?Promise.all([this._def.left._parseAsync({data:n.data,path:n.path,parent:n}),this._def.right._parseAsync({data:n.data,path:n.path,parent:n})]).then(([e,t])=>r(e,t)):r(this._def.left._parseSync({data:n.data,path:n.path,parent:n}),this._def.right._parseSync({data:n.data,path:n.path,parent:n}))}};dT.create=(e,t,n)=>new dT({left:e,right:t,typeName:Z.ZodIntersection,...yw(n)});var fT=class e extends bw{_parse(e){let{status:t,ctx:n}=this._processInputParams(e);if(n.parsedType!==K.array)return J(n,{code:q.invalid_type,expected:K.array,received:n.parsedType}),Y;if(n.data.lengththis._def.items.length&&(J(n,{code:q.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:`array`}),t.dirty());let r=[...n.data].map((e,t)=>{let r=this._def.items[t]||this._def.rest;return r?r._parse(new _w(n,e,n.path,t)):null}).filter(e=>!!e);return n.common.async?Promise.all(r).then(e=>uw.mergeArray(t,e)):uw.mergeArray(t,r)}get items(){return this._def.items}rest(t){return new e({...this._def,rest:t})}};fT.create=(e,t)=>{if(!Array.isArray(e))throw Error(`You must pass an array of schemas to z.tuple([ ... ])`);return new fT({items:e,typeName:Z.ZodTuple,rest:null,...yw(t)})};var pT=class e extends bw{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){let{status:t,ctx:n}=this._processInputParams(e);if(n.parsedType!==K.object)return J(n,{code:q.invalid_type,expected:K.object,received:n.parsedType}),Y;let r=[],i=this._def.keyType,a=this._def.valueType;for(let e in n.data)r.push({key:i._parse(new _w(n,e,n.path,e)),value:a._parse(new _w(n,n.data[e],n.path,e)),alwaysSet:e in n.data});return n.common.async?uw.mergeObjectAsync(t,r):uw.mergeObjectSync(t,r)}get element(){return this._def.valueType}static create(t,n,r){return n instanceof bw?new e({keyType:t,valueType:n,typeName:Z.ZodRecord,...yw(r)}):new e({keyType:Gw.create(),valueType:t,typeName:Z.ZodRecord,...yw(n)})}},mT=class extends bw{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){let{status:t,ctx:n}=this._processInputParams(e);if(n.parsedType!==K.map)return J(n,{code:q.invalid_type,expected:K.map,received:n.parsedType}),Y;let r=this._def.keyType,i=this._def.valueType,a=[...n.data.entries()].map(([e,t],a)=>({key:r._parse(new _w(n,e,n.path,[a,`key`])),value:i._parse(new _w(n,t,n.path,[a,`value`]))}));if(n.common.async){let e=new Map;return Promise.resolve().then(async()=>{for(let n of a){let r=await n.key,i=await n.value;if(r.status===`aborted`||i.status===`aborted`)return Y;(r.status===`dirty`||i.status===`dirty`)&&t.dirty(),e.set(r.value,i.value)}return{status:t.value,value:e}})}{let e=new Map;for(let n of a){let r=n.key,i=n.value;if(r.status===`aborted`||i.status===`aborted`)return Y;(r.status===`dirty`||i.status===`dirty`)&&t.dirty(),e.set(r.value,i.value)}return{status:t.value,value:e}}}};mT.create=(e,t,n)=>new mT({valueType:t,keyType:e,typeName:Z.ZodMap,...yw(n)});var hT=class e extends bw{_parse(e){let{status:t,ctx:n}=this._processInputParams(e);if(n.parsedType!==K.set)return J(n,{code:q.invalid_type,expected:K.set,received:n.parsedType}),Y;let r=this._def;r.minSize!==null&&n.data.sizer.maxSize.value&&(J(n,{code:q.too_big,maximum:r.maxSize.value,type:`set`,inclusive:!0,exact:!1,message:r.maxSize.message}),t.dirty());let i=this._def.valueType;function a(e){let n=new Set;for(let r of e){if(r.status===`aborted`)return Y;r.status===`dirty`&&t.dirty(),n.add(r.value)}return{status:t.value,value:n}}let o=[...n.data.values()].map((e,t)=>i._parse(new _w(n,e,n.path,t)));return n.common.async?Promise.all(o).then(e=>a(e)):a(o)}min(t,n){return new e({...this._def,minSize:{value:t,message:X.toString(n)}})}max(t,n){return new e({...this._def,maxSize:{value:t,message:X.toString(n)}})}size(e,t){return this.min(e,t).max(e,t)}nonempty(e){return this.min(1,e)}};hT.create=(e,t)=>new hT({valueType:e,minSize:null,maxSize:null,typeName:Z.ZodSet,...yw(t)});var gT=class e extends bw{constructor(){super(...arguments),this.validate=this.implement}_parse(e){let{ctx:t}=this._processInputParams(e);if(t.parsedType!==K.function)return J(t,{code:q.invalid_type,expected:K.function,received:t.parsedType}),Y;function n(e,n){return lw({data:e,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,cw(),ow].filter(e=>!!e),issueData:{code:q.invalid_arguments,argumentsError:n}})}function r(e,n){return lw({data:e,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,cw(),ow].filter(e=>!!e),issueData:{code:q.invalid_return_type,returnTypeError:n}})}let i={errorMap:t.common.contextualErrorMap},a=t.data;if(this._def.returns instanceof ST){let e=this;return fw(async function(...t){let o=new aw([]),s=await e._def.args.parseAsync(t,i).catch(e=>{throw o.addIssue(n(t,e)),o}),c=await Reflect.apply(a,this,s);return await e._def.returns._def.type.parseAsync(c,i).catch(e=>{throw o.addIssue(r(c,e)),o})})}{let e=this;return fw(function(...t){let o=e._def.args.safeParse(t,i);if(!o.success)throw new aw([n(t,o.error)]);let s=Reflect.apply(a,this,o.data),c=e._def.returns.safeParse(s,i);if(!c.success)throw new aw([r(s,c.error)]);return c.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...t){return new e({...this._def,args:fT.create(t).rest(tT.create())})}returns(t){return new e({...this._def,returns:t})}implement(e){return this.parse(e)}strictImplement(e){return this.parse(e)}static create(t,n,r){return new e({args:t||fT.create([]).rest(tT.create()),returns:n||tT.create(),typeName:Z.ZodFunction,...yw(r)})}},_T=class extends bw{get schema(){return this._def.getter()}_parse(e){let{ctx:t}=this._processInputParams(e);return this._def.getter()._parse({data:t.data,path:t.path,parent:t})}};_T.create=(e,t)=>new _T({getter:e,typeName:Z.ZodLazy,...yw(t)});var vT=class extends bw{_parse(e){if(e.data!==this._def.value){let t=this._getOrReturnCtx(e);return J(t,{received:t.data,code:q.invalid_literal,expected:this._def.value}),Y}return{status:`valid`,value:e.data}}get value(){return this._def.value}};vT.create=(e,t)=>new vT({value:e,typeName:Z.ZodLiteral,...yw(t)});function yT(e,t){return new bT({values:e,typeName:Z.ZodEnum,...yw(t)})}var bT=class e extends bw{_parse(e){if(typeof e.data!=`string`){let t=this._getOrReturnCtx(e),n=this._def.values;return J(t,{expected:nw.joinValues(n),received:t.parsedType,code:q.invalid_type}),Y}if(this._cache||=new Set(this._def.values),!this._cache.has(e.data)){let t=this._getOrReturnCtx(e),n=this._def.values;return J(t,{received:t.data,code:q.invalid_enum_value,options:n}),Y}return fw(e.data)}get options(){return this._def.values}get enum(){let e={};for(let t of this._def.values)e[t]=t;return e}get Values(){let e={};for(let t of this._def.values)e[t]=t;return e}get Enum(){let e={};for(let t of this._def.values)e[t]=t;return e}extract(t,n=this._def){return e.create(t,{...this._def,...n})}exclude(t,n=this._def){return e.create(this.options.filter(e=>!t.includes(e)),{...this._def,...n})}};bT.create=yT;var xT=class extends bw{_parse(e){let t=nw.getValidEnumValues(this._def.values),n=this._getOrReturnCtx(e);if(n.parsedType!==K.string&&n.parsedType!==K.number){let e=nw.objectValues(t);return J(n,{expected:nw.joinValues(e),received:n.parsedType,code:q.invalid_type}),Y}if(this._cache||=new Set(nw.getValidEnumValues(this._def.values)),!this._cache.has(e.data)){let e=nw.objectValues(t);return J(n,{received:n.data,code:q.invalid_enum_value,options:e}),Y}return fw(e.data)}get enum(){return this._def.values}};xT.create=(e,t)=>new xT({values:e,typeName:Z.ZodNativeEnum,...yw(t)});var ST=class extends bw{unwrap(){return this._def.type}_parse(e){let{ctx:t}=this._processInputParams(e);return t.parsedType!==K.promise&&t.common.async===!1?(J(t,{code:q.invalid_type,expected:K.promise,received:t.parsedType}),Y):fw((t.parsedType===K.promise?t.data:Promise.resolve(t.data)).then(e=>this._def.type.parseAsync(e,{path:t.path,errorMap:t.common.contextualErrorMap})))}};ST.create=(e,t)=>new ST({type:e,typeName:Z.ZodPromise,...yw(t)});var CT=class extends bw{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===Z.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(e){let{status:t,ctx:n}=this._processInputParams(e),r=this._def.effect||null,i={addIssue:e=>{J(n,e),e.fatal?t.abort():t.dirty()},get path(){return n.path}};if(i.addIssue=i.addIssue.bind(i),r.type===`preprocess`){let e=r.transform(n.data,i);if(n.common.async)return Promise.resolve(e).then(async e=>{if(t.value===`aborted`)return Y;let r=await this._def.schema._parseAsync({data:e,path:n.path,parent:n});return r.status===`aborted`?Y:r.status===`dirty`||t.value===`dirty`?dw(r.value):r});{if(t.value===`aborted`)return Y;let r=this._def.schema._parseSync({data:e,path:n.path,parent:n});return r.status===`aborted`?Y:r.status===`dirty`||t.value===`dirty`?dw(r.value):r}}if(r.type===`refinement`){let e=e=>{let t=r.refinement(e,i);if(n.common.async)return Promise.resolve(t);if(t instanceof Promise)throw Error(`Async refinement encountered during synchronous parse operation. Use .parseAsync instead.`);return e};if(n.common.async===!1){let r=this._def.schema._parseSync({data:n.data,path:n.path,parent:n});return r.status===`aborted`?Y:(r.status===`dirty`&&t.dirty(),e(r.value),{status:t.value,value:r.value})}return this._def.schema._parseAsync({data:n.data,path:n.path,parent:n}).then(n=>n.status===`aborted`?Y:(n.status===`dirty`&&t.dirty(),e(n.value).then(()=>({status:t.value,value:n.value}))))}if(r.type===`transform`){if(n.common.async===!1){let e=this._def.schema._parseSync({data:n.data,path:n.path,parent:n});if(!hw(e))return Y;let a=r.transform(e.value,i);if(a instanceof Promise)throw Error(`Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.`);return{status:t.value,value:a}}return this._def.schema._parseAsync({data:n.data,path:n.path,parent:n}).then(e=>hw(e)?Promise.resolve(r.transform(e.value,i)).then(e=>({status:t.value,value:e})):Y)}nw.assertNever(r)}};CT.create=(e,t,n)=>new CT({schema:e,typeName:Z.ZodEffects,effect:t,...yw(n)}),CT.createWithPreprocess=(e,t,n)=>new CT({schema:t,effect:{type:`preprocess`,transform:e},typeName:Z.ZodEffects,...yw(n)});var wT=class extends bw{_parse(e){return this._getType(e)===K.undefined?fw(void 0):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}};wT.create=(e,t)=>new wT({innerType:e,typeName:Z.ZodOptional,...yw(t)});var TT=class extends bw{_parse(e){return this._getType(e)===K.null?fw(null):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}};TT.create=(e,t)=>new TT({innerType:e,typeName:Z.ZodNullable,...yw(t)});var ET=class extends bw{_parse(e){let{ctx:t}=this._processInputParams(e),n=t.data;return t.parsedType===K.undefined&&(n=this._def.defaultValue()),this._def.innerType._parse({data:n,path:t.path,parent:t})}removeDefault(){return this._def.innerType}};ET.create=(e,t)=>new ET({innerType:e,typeName:Z.ZodDefault,defaultValue:typeof t.default==`function`?t.default:()=>t.default,...yw(t)});var DT=class extends bw{_parse(e){let{ctx:t}=this._processInputParams(e),n={...t,common:{...t.common,issues:[]}},r=this._def.innerType._parse({data:n.data,path:n.path,parent:{...n}});return gw(r)?r.then(e=>({status:`valid`,value:e.status===`valid`?e.value:this._def.catchValue({get error(){return new aw(n.common.issues)},input:n.data})})):{status:`valid`,value:r.status===`valid`?r.value:this._def.catchValue({get error(){return new aw(n.common.issues)},input:n.data})}}removeCatch(){return this._def.innerType}};DT.create=(e,t)=>new DT({innerType:e,typeName:Z.ZodCatch,catchValue:typeof t.catch==`function`?t.catch:()=>t.catch,...yw(t)});var OT=class extends bw{_parse(e){if(this._getType(e)!==K.nan){let t=this._getOrReturnCtx(e);return J(t,{code:q.invalid_type,expected:K.nan,received:t.parsedType}),Y}return{status:`valid`,value:e.data}}};OT.create=e=>new OT({typeName:Z.ZodNaN,...yw(e)});var kT=class extends bw{_parse(e){let{ctx:t}=this._processInputParams(e),n=t.data;return this._def.type._parse({data:n,path:t.path,parent:t})}unwrap(){return this._def.type}},AT=class e extends bw{_parse(e){let{status:t,ctx:n}=this._processInputParams(e);if(n.common.async)return(async()=>{let e=await this._def.in._parseAsync({data:n.data,path:n.path,parent:n});return e.status===`aborted`?Y:e.status===`dirty`?(t.dirty(),dw(e.value)):this._def.out._parseAsync({data:e.value,path:n.path,parent:n})})();{let e=this._def.in._parseSync({data:n.data,path:n.path,parent:n});return e.status===`aborted`?Y:e.status===`dirty`?(t.dirty(),{status:`dirty`,value:e.value}):this._def.out._parseSync({data:e.value,path:n.path,parent:n})}}static create(t,n){return new e({in:t,out:n,typeName:Z.ZodPipeline})}},jT=class extends bw{_parse(e){let t=this._def.innerType._parse(e),n=e=>(hw(e)&&(e.value=Object.freeze(e.value)),e);return gw(t)?t.then(e=>n(e)):n(t)}unwrap(){return this._def.innerType}};jT.create=(e,t)=>new jT({innerType:e,typeName:Z.ZodReadonly,...yw(t)}),oT.lazycreate;var Z;(function(e){e.ZodString=`ZodString`,e.ZodNumber=`ZodNumber`,e.ZodNaN=`ZodNaN`,e.ZodBigInt=`ZodBigInt`,e.ZodBoolean=`ZodBoolean`,e.ZodDate=`ZodDate`,e.ZodSymbol=`ZodSymbol`,e.ZodUndefined=`ZodUndefined`,e.ZodNull=`ZodNull`,e.ZodAny=`ZodAny`,e.ZodUnknown=`ZodUnknown`,e.ZodNever=`ZodNever`,e.ZodVoid=`ZodVoid`,e.ZodArray=`ZodArray`,e.ZodObject=`ZodObject`,e.ZodUnion=`ZodUnion`,e.ZodDiscriminatedUnion=`ZodDiscriminatedUnion`,e.ZodIntersection=`ZodIntersection`,e.ZodTuple=`ZodTuple`,e.ZodRecord=`ZodRecord`,e.ZodMap=`ZodMap`,e.ZodSet=`ZodSet`,e.ZodFunction=`ZodFunction`,e.ZodLazy=`ZodLazy`,e.ZodLiteral=`ZodLiteral`,e.ZodEnum=`ZodEnum`,e.ZodEffects=`ZodEffects`,e.ZodNativeEnum=`ZodNativeEnum`,e.ZodOptional=`ZodOptional`,e.ZodNullable=`ZodNullable`,e.ZodDefault=`ZodDefault`,e.ZodCatch=`ZodCatch`,e.ZodPromise=`ZodPromise`,e.ZodBranded=`ZodBranded`,e.ZodPipeline=`ZodPipeline`,e.ZodReadonly=`ZodReadonly`})(Z||={});var MT=Gw.create;qw.create,OT.create,Jw.create;var NT=Yw.create;Xw.create,Zw.create,Qw.create,$w.create;var PT=eT.create;tT.create,nT.create,rT.create,iT.create;var FT=oT.create;oT.strictCreate,sT.create;var IT=lT.create;dT.create,fT.create,pT.create,mT.create,hT.create,gT.create,_T.create;var LT=vT.create,RT=bT.create;xT.create,ST.create,CT.create,wT.create,TT.create,CT.createWithPreprocess,AT.create;var zT=/^[v^~<>=]*?(\d+)(?:\.([x*]|\d+)(?:\.([x*]|\d+)(?:\.([x*]|\d+))?(?:-([\da-z\-]+(?:\.[\da-z\-]+)*))?(?:\+[\da-z\-]+(?:\.[\da-z\-]+)*)?)?)?$/i,BT=e=>{if(typeof e!=`string`)throw TypeError(`Invalid argument expected string`);let t=e.match(zT);if(!t)throw Error(`Invalid argument not valid semver ('${e}' received)`);return t.shift(),t},VT=e=>e===`*`||e===`x`||e===`X`,HT=e=>{let t=parseInt(e,10);return isNaN(t)?e:t},UT=(e,t)=>typeof e==typeof t?[e,t]:[String(e),String(t)],WT=(e,t)=>{if(VT(e)||VT(t))return 0;let[n,r]=UT(HT(e),HT(t));return n>r?1:n{for(let n=0;n{let n=BT(e),r=BT(t),i=n.pop(),a=r.pop(),o=GT(n,r);return o===0?i&&a?GT(i.split(`.`),a.split(`.`)):i||a?i?-1:1:0:o},qT=e=>{if(typeof structuredClone==`function`)return structuredClone(e);try{return JSON.parse(JSON.stringify(e))}catch{return Array.isArray(e)?[...e]:{...e}}};function JT(){return Eg()}function YT(e){if(Object.freeze(e),typeof e==`object`&&e)for(let t of Object.values(e))typeof t==`object`&&t&&!Object.isFrozen(t)&&YT(t);return e}var XT=524288;function ZT(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 QT(e,t,n,r){let i=typeof process<`u`&&!0,a=i&&!!{}.VITEST_WORKER_ID,o=i&&!!{}.VITEST_WORKER_ID,s=o&&!ZT(t,n,XT),c=s?qT(t):t,l=s?qT(n):n,u=!1,d=!1,f;for(let t of e)try{s&&(YT(c),YT(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=qT(e.messages),u=!0,n=!0),e.state!==void 0&&e.state!==l&&(l=qT(e.state),d=!0,n=!0),s&&n&&ZT(c,l,XT)&&(s=!1),f=e.stopPropagation,f===!0)break}catch(e){if(o&&e instanceof TypeError){if(a)throw e;console.error(`AG-UI: Subscriber attempted to mutate frozen inputs in-place. Return mutations via AgentStateMutation instead of mutating directly.`,e)}else a||console.error(`Subscriber error:`,e);continue}return{...u?{messages:Object.isFrozen(c)?qT(c):c}:{},...d?{state:Object.isFrozen(l)?qT(l):l}:{},...f===void 0?{}:{stopPropagation:f}}}function $T(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 eE(e){if(e instanceof tE)return e;if(e===!0)return new tE($T(!0))}var tE=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 nE(e){return e.enabled?new tE(e):void 0}function rE(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}var iE=(e,t,n,r,i)=>{let a=eE(i),o=qT(n.messages),s=qT(e.state),c={},l=e=>{e.messages!==void 0&&(o=e.messages,c.messages=e.messages),e.state!==void 0&&(s=e.state,c.state=e.state)},u=()=>{let e=qT(c);return c={},e.messages!==void 0||e.state!==void 0?Nx(e):ex};return t.pipe(Ux(async t=>{let i=await QT(r,o,s,(r,i,a)=>r.onEvent?.({event:t,agent:n,input:e,messages:i,state:a}));if(l(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 u();switch(t.type){case H.TEXT_MESSAGE_START:{let i=await QT(r,o,s,(r,i,a)=>r.onTextMessageStartEvent?.({event:t,messages:i,state:a,agent:n,input:e}));if(l(i),i.stopPropagation!==!0){let{messageId:e,role:n=`assistant`,name:r}=t;if(!o.find(t=>t.id===e)){let t={id:e,role:n,content:``,...r!==void 0&&{name:r}};o.push(t),l({messages:o})}}return u()}case H.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}'`),u();let d=await QT(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 l(d),d.stopPropagation!==!0&&(c.content=`${typeof c.content==`string`?c.content:``}${a}`,l({messages:o})),u()}case H.TEXT_MESSAGE_END:{let{messageId:i}=t,a=o.find(e=>e.id===i);return a?(l(await QT(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:``}))),await Promise.all(r.map(t=>{t.onNewMessage?.({message:a,messages:o,state:s,agent:n,input:e})})),u()):(console.warn(`TEXT_MESSAGE_END: No message found with ID '${i}'`),u())}case H.TOOL_CALL_START:{let i=await QT(r,o,s,(r,i,a)=>r.onToolCallStartEvent?.({event:t,messages:i,state:a,agent:n,input:e}));if(l(i),i.stopPropagation!==!0){let{toolCallId:e,toolCallName:n,parentMessageId:r}=t,i=o.find(t=>t.toolCalls?.some(t=>t.id===e))?.toolCalls?.find(t=>t.id===e);if(i)return i.function.name!==n&&(console.warn(`TOOL_CALL_START: tool call '${e}' already exists with name '${i.function.name}' — updating it to '${n}'`),i.function.name=n,l({messages:o})),u();let a=rE(o,r,e);a.toolCalls??=[],a.toolCalls.push({id:e,type:`function`,function:{name:n,arguments:``}}),l({messages:o})}return u()}case H.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}'`),u();let d=c.toolCalls?.find(e=>e.id===i);if(!d)return console.warn(`TOOL_CALL_ARGS: No tool call found with ID '${i}'`),u();let f=await QT(r,o,s,(r,i,a)=>{let o=d.function.arguments,s=d.function.name,c={};try{c=Xx(o)}catch{}return r.onToolCallArgsEvent?.({event:t,messages:i,state:a,agent:n,input:e,toolCallBuffer:o,toolCallName:s,partialToolCallArgs:c})});return l(f),f.stopPropagation!==!0&&(d.function.arguments+=a,l({messages:o})),u()}case H.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}'`),u();let c=a.toolCalls?.find(e=>e.id===i);return c?(l(await QT(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})})),await Promise.all(r.map(t=>{t.onNewToolCall?.({toolCall:c,messages:o,state:s,agent:n,input:e})})),u()):(console.warn(`TOOL_CALL_END: No tool call found with ID '${i}'`),u())}case H.TOOL_CALL_RESULT:{let i=await QT(r,o,s,(r,i,a)=>r.onToolCallResultEvent?.({event:t,messages:i,state:a,agent:n,input:e}));if(l(i),i.stopPropagation!==!0){let{messageId:i,toolCallId:a,content:c,role:u}=t,d={id:i,toolCallId:a,role:u||`tool`,content:c},f=o.findIndex(e=>e.role===`assistant`&&e.toolCalls?.some(e=>e.id===a));if(f===-1)o.push(d);else{let e=f+1;for(;e{t.onNewMessage?.({message:d,messages:o,state:s,agent:n,input:e})})),l({messages:o})}return u()}case H.STATE_SNAPSHOT:{let i=await QT(r,o,s,(r,i,a)=>r.onStateSnapshotEvent?.({event:t,messages:i,state:a,agent:n,input:e}));if(l(i),i.stopPropagation!==!0){let{snapshot:e}=t;s=e,l({state:s})}return u()}case H.STATE_DELTA:{let i=await QT(r,o,s,(r,i,a)=>r.onStateDeltaEvent?.({event:t,messages:i,state:a,agent:n,input:e}));if(l(i),i.stopPropagation!==!0){let{delta:e}=t;try{s=cb.applyPatch(s,e,!0,!1).newDocument,l({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 u()}case H.MESSAGES_SNAPSHOT:{let i=await QT(r,o,s,(r,i,a)=>r.onMessagesSnapshotEvent?.({event:t,messages:i,state:a,agent:n,input:e}));if(l(i),i.stopPropagation!==!0){let{messages:e}=t,n=new Map(e.map(e=>[e.id,e])),r=e.some(e=>e.role===`activity`),i=e.some(e=>e.role===`reasoning`),a=e=>e.role===`activity`&&!r||e.role===`reasoning`&&!i;o=o.filter(e=>a(e)||n.has(e.id)).map(e=>a(e)?e:n.get(e.id));let s=new Set(o.map(e=>e.id));for(let t of e)s.has(t.id)||o.push(t);l({messages:o})}return u()}case H.ACTIVITY_SNAPSHOT:{let i=t,a=o.findIndex(e=>e.id===i.messageId),c=a>=0?o[a]:void 0,d=c?.role===`activity`?c:void 0,f=i.replace??!0,p=await QT(r,o,s,(t,r,a)=>t.onActivitySnapshotEvent?.({event:i,messages:r,state:a,agent:n,input:e,activityMessage:d,existingMessage:c}));if(l(p),p.stopPropagation!==!0){let t={id:i.messageId,role:`activity`,activityType:i.activityType,content:qT(i.content)},c;a===-1?(o.push(t),c=t):d?f&&(o[a]={...d,activityType:i.activityType,content:qT(i.content)}):f&&(o[a]=t,c=t),l({messages:o}),c&&await Promise.all(r.map(t=>t.onNewMessage?.({message:c,messages:o,state:s,agent:n,input:e})))}return u()}case H.ACTIVITY_DELTA:{let i=t,a=o.findIndex(e=>e.id===i.messageId);if(a===-1)return u();let c=o[a];if(c.role!==`activity`)return console.warn(`ACTIVITY_DELTA: Message '${i.messageId}' is not an activity message`),u();let d=c,f=await QT(r,o,s,(t,r,a)=>t.onActivityDeltaEvent?.({event:i,messages:r,state:a,agent:n,input:e,activityMessage:d}));if(l(f),f.stopPropagation!==!0)try{let e=qT(d.content??{}),t=cb.applyPatch(e,i.patch??[],!0,!1).newDocument;o[a]={...d,content:qT(t),activityType:i.activityType},l({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 u()}case H.RAW:return l(await QT(r,o,s,(r,i,a)=>r.onRawEvent?.({event:t,messages:i,state:a,agent:n,input:e}))),u();case H.CUSTOM:return l(await QT(r,o,s,(r,i,a)=>r.onCustomEvent?.({event:t,messages:i,state:a,agent:n,input:e}))),u();case H.RUN_STARTED:{let i=await QT(r,o,s,(r,i,a)=>r.onRunStartedEvent?.({event:t,messages:i,state:a,agent:n,input:e}));if(l(i),i.stopPropagation!==!0){let e=t;if(e.input?.messages){for(let t of e.input.messages)o.find(e=>e.id===t.id)||o.push(t);l({messages:o})}}return u()}case H.RUN_FINISHED:{let i=t,a=i.outcome?.type===`interrupt`?{event:i,outcome:`interrupt`,interrupts:i.outcome.interrupts}:{event:i,outcome:`success`,result:i.result},c=await QT(r,o,s,(t,r,i)=>t.onRunFinishedEvent?.({...a,messages:r,state:i,agent:n,input:e}));return l(c),c.stopPropagation!==!0&&(n.pendingInterrupts=a.outcome===`interrupt`?[...a.interrupts]:[]),u()}case H.RUN_ERROR:return l(await QT(r,o,s,(r,i,a)=>r.onRunErrorEvent?.({event:t,messages:i,state:a,agent:n,input:e}))),u();case H.STEP_STARTED:return l(await QT(r,o,s,(r,i,a)=>r.onStepStartedEvent?.({event:t,messages:i,state:a,agent:n,input:e}))),u();case H.STEP_FINISHED:return l(await QT(r,o,s,(r,i,a)=>r.onStepFinishedEvent?.({event:t,messages:i,state:a,agent:n,input:e}))),u();case H.TEXT_MESSAGE_CHUNK:throw Error(`TEXT_MESSAGE_CHUNK must be tranformed before being applied`);case H.TOOL_CALL_CHUNK:throw Error(`TOOL_CALL_CHUNK must be tranformed before being applied`);case H.THINKING_START:return u();case H.THINKING_END:return u();case H.THINKING_TEXT_MESSAGE_START:return u();case H.THINKING_TEXT_MESSAGE_CONTENT:return u();case H.THINKING_TEXT_MESSAGE_END:return u();case H.REASONING_START:return l(await QT(r,o,s,(r,i,a)=>r.onReasoningStartEvent?.({event:t,messages:i,state:a,agent:n,input:e}))),u();case H.REASONING_MESSAGE_START:{let i=await QT(r,o,s,(r,i,a)=>r.onReasoningMessageStartEvent?.({event:t,messages:i,state:a,agent:n,input:e}));if(l(i),i.stopPropagation!==!0){let{messageId:e}=t;if(!o.find(t=>t.id===e)){let t={id:e,role:`reasoning`,content:``};o.push(t),l({messages:o})}}return u()}case H.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}'`),u();let d=await QT(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 l(d),d.stopPropagation!==!0&&(c.content=`${typeof c.content==`string`?c.content:``}${a}`,l({messages:o})),u()}case H.REASONING_MESSAGE_END:{let{messageId:i}=t,a=o.find(e=>e.id===i);return a?(l(await QT(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:``}))),await Promise.all(r.map(t=>{t.onNewMessage?.({message:a,messages:o,state:s,agent:n,input:e})})),u()):(console.warn(`REASONING_MESSAGE_END: No message found with ID '${i}'`),u())}case H.REASONING_MESSAGE_CHUNK:throw Error(`REASONING_MESSAGE_CHUNK must be transformed before being applied`);case H.REASONING_END:return l(await QT(r,o,s,(r,i,a)=>r.onReasoningEndEvent?.({event:t,messages:i,state:a,agent:n,input:e}))),u();case H.REASONING_ENCRYPTED_VALUE:{let{subtype:i,entityId:a,encryptedValue:d}=t,f=await QT(r,o,s,(r,i,a)=>r.onReasoningEncryptedValueEvent?.({event:t,messages:i,state:a,agent:n,input:e}));if(l(f),f.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=d,e=!0;break}}}else{let t=o.find(e=>e.id===a);t?.role!==`activity`&&t&&(t.encryptedValue=d,e=!0)}e&&(c.messages=o)}return u()}}return t.type,u()}),Bx(),r.length>0?Wx({}):e=>e)},aE=e=>t=>{let n=eE(e),r=new Map,i=new Map,a=!1,o=!1,s=!1,c=new Map,l=!1,u=!1,d=!1,f=()=>{r.clear(),i.clear(),c.clear(),l=!1,u=!1,a=!1,o=!1,d=!0};return t.pipe(zx(e=>{let t=e.type;if(n?.event(`VERIFY`,`Event:`,e,{type:e.type}),o)return Px(()=>new Pv(`Cannot send event type '${t}': The run has already errored with 'RUN_ERROR'. No further events can be sent.`));if(a&&t!==H.RUN_ERROR&&t!==H.RUN_STARTED)return Px(()=>new Pv(`Cannot send event type '${t}': The run has already finished with 'RUN_FINISHED'. Start a new run with 'RUN_STARTED'.`));if(!s){if(s=!0,t!==H.RUN_STARTED&&t!==H.RUN_ERROR)return Px(()=>new Pv(`First event must be 'RUN_STARTED'`))}else if(t===H.RUN_STARTED){if(d&&!a)return Px(()=>new Pv(`Cannot send 'RUN_STARTED' while a run is still active. The previous run must be finished with 'RUN_FINISHED' before starting a new run.`));a&&f()}switch(t){case H.TEXT_MESSAGE_START:{let t=e.messageId;return r.has(t)?Px(()=>new Pv(`Cannot send 'TEXT_MESSAGE_START' event: A text message with ID '${t}' is already in progress. Complete it with 'TEXT_MESSAGE_END' first.`)):(r.set(t,!0),Nx(e))}case H.TEXT_MESSAGE_CONTENT:{let t=e.messageId;return r.has(t)?Nx(e):Px(()=>new Pv(`Cannot send 'TEXT_MESSAGE_CONTENT' event: No active text message found with ID '${t}'. Start a text message with 'TEXT_MESSAGE_START' first.`))}case H.TEXT_MESSAGE_END:{let t=e.messageId;return r.has(t)?(r.delete(t),Nx(e)):Px(()=>new Pv(`Cannot send 'TEXT_MESSAGE_END' event: No active text message found with ID '${t}'. A 'TEXT_MESSAGE_START' event must be sent first.`))}case H.TOOL_CALL_START:{let t=e.toolCallId;return i.has(t)?Px(()=>new Pv(`Cannot send 'TOOL_CALL_START' event: A tool call with ID '${t}' is already in progress. Complete it with 'TOOL_CALL_END' first.`)):(i.set(t,!0),Nx(e))}case H.TOOL_CALL_ARGS:{let t=e.toolCallId;return i.has(t)?Nx(e):Px(()=>new Pv(`Cannot send 'TOOL_CALL_ARGS' event: No active tool call found with ID '${t}'. Start a tool call with 'TOOL_CALL_START' first.`))}case H.TOOL_CALL_END:{let t=e.toolCallId;return i.has(t)?(i.delete(t),Nx(e)):Px(()=>new Pv(`Cannot send 'TOOL_CALL_END' event: No active tool call found with ID '${t}'. A 'TOOL_CALL_START' event must be sent first.`))}case H.STEP_STARTED:{let t=e.stepName;return c.has(t)?Px(()=>new Pv(`Step "${t}" is already active for 'STEP_STARTED'`)):(c.set(t,!0),Nx(e))}case H.STEP_FINISHED:{let t=e.stepName;return c.has(t)?(c.delete(t),Nx(e)):Px(()=>new Pv(`Cannot send 'STEP_FINISHED' for step "${t}" that was not started`))}case H.RUN_STARTED:return d=!0,Nx(e);case H.RUN_FINISHED:if(c.size>0){let e=Array.from(c.keys()).join(`, `);return Px(()=>new Pv(`Cannot send 'RUN_FINISHED' while steps are still active: ${e}`))}if(r.size>0){let e=Array.from(r.keys()).join(`, `);return Px(()=>new Pv(`Cannot send 'RUN_FINISHED' while text messages are still active: ${e}`))}if(i.size>0){let e=Array.from(i.keys()).join(`, `);return Px(()=>new Pv(`Cannot send 'RUN_FINISHED' while tool calls are still active: ${e}`))}return a=!0,Nx(e);case H.RUN_ERROR:return o=!0,Nx(e);case H.CUSTOM:return Nx(e);case H.THINKING_TEXT_MESSAGE_START:return l?u?Px(()=>new Pv(`Cannot send 'THINKING_TEXT_MESSAGE_START' event: A thinking message is already in progress. Complete it with 'THINKING_TEXT_MESSAGE_END' first.`)):(u=!0,Nx(e)):Px(()=>new Pv(`Cannot send 'THINKING_TEXT_MESSAGE_START' event: A thinking step is not in progress. Create one with 'THINKING_START' first.`));case H.THINKING_TEXT_MESSAGE_CONTENT:return u?Nx(e):Px(()=>new Pv(`Cannot send 'THINKING_TEXT_MESSAGE_CONTENT' event: No active thinking message found. Start a message with 'THINKING_TEXT_MESSAGE_START' first.`));case H.THINKING_TEXT_MESSAGE_END:return u?(u=!1,Nx(e)):Px(()=>new Pv(`Cannot send 'THINKING_TEXT_MESSAGE_END' event: No active thinking message found. A 'THINKING_TEXT_MESSAGE_START' event must be sent first.`));case H.THINKING_START:return l?Px(()=>new Pv(`Cannot send 'THINKING_START' event: A thinking step is already in progress. End it with 'THINKING_END' first.`)):(l=!0,Nx(e));case H.THINKING_END:return l?(l=!1,Nx(e)):Px(()=>new Pv(`Cannot send 'THINKING_END' event: No active thinking step found. A 'THINKING_START' event must be sent first.`));default:return Nx(e)}}))},oE=function(e){return e.HEADERS=`headers`,e.DATA=`data`,e}({}),sE=e=>Vx(()=>Mx(e())).pipe(Kx(e=>{if(!e.ok){let t=e.headers.get(`content-type`)||``;return Mx(e.text()).pipe(zx(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,Px(()=>i)}))}let t={type:oE.HEADERS,status:e.status,headers:e.headers},n=e.body?.getReader();return n?new Vb(e=>(e.next(t),(async()=>{try{for(;;){let{done:t,value:r}=await n.read();if(t)break;let i={type:oE.DATA,data:r};e.next(i)}e.complete()}catch(t){e.error(t)}})(),()=>{n.cancel().catch(e=>{if(e?.name!==`AbortError`)throw e})})):Px(()=>Error(`Failed to getReader() from response`))})),cE=(e,t)=>{let n=eE(t),r=new Xb,i=new TextDecoder(`utf-8`,{fatal:!1}),a=``;e.subscribe({next:e=>{if(e.type!==oE.HEADERS&&e.type===oE.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)}},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()},lE=e=>{let t=new Xb,n=new Uint8Array;e.subscribe({next:e=>{if(e.type!==oE.HEADERS&&e.type===oE.DATA&&e.data){let t=new Uint8Array(n.length+e.data.length);t.set(n,0),t.set(e.data,n.length),n=t,r()}},error:e=>t.error(e),complete:()=>{if(n.length>0)try{r()}catch{console.warn(`Incomplete or invalid protocol buffer data at stream end`)}t.complete()}});function r(){for(;n.length>=4;){let e=4+new DataView(n.buffer,n.byteOffset,4).getUint32(0,!1);if(n.length{let n=eE(t),r=new Xb,i=new $b,a=!1;return e.subscribe({next:e=>{if(i.next(e),e.type===oE.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`?lE(i).subscribe({next:e=>r.next(e),error:e=>r.error(e),complete:()=>r.complete()}):cE(i,n).subscribe({next:e=>{try{let t=Ey.parse(e);n?.event(`HTTP`,`Event validated:`,t,{type:t.type,valid:!0}),r.next(t)}catch(t){n?.event(`HTTP`,`Event invalid:`,{json:e,error:String(t)}),r.error(t)}},error:e=>{if(e?.name===`AbortError`){r.next({type:H.RUN_ERROR,message:e.message||`Request aborted`,code:`abort`,rawEvent:e}),r.complete();return}return r.error(e)},complete:()=>r.complete()})}else a||r.error(Error(`No headers event received before data events`))},error:e=>{i.error(e),r.error(e)},complete:()=>{i.complete()}}),r.asObservable()},dE=RT([`TextMessageStart`,`TextMessageContent`,`TextMessageEnd`,`ActionExecutionStart`,`ActionExecutionArgs`,`ActionExecutionEnd`,`ActionExecutionResult`,`AgentStateMessage`,`MetaEvent`,`RunStarted`,`RunFinished`,`RunError`,`NodeStarted`,`NodeFinished`]),fE=RT([`LangGraphInterruptEvent`,`PredictState`,`Exit`]);IT(`type`,[FT({type:LT(dE.enum.TextMessageStart),messageId:MT(),parentMessageId:MT().optional(),role:MT().optional()}),FT({type:LT(dE.enum.TextMessageContent),messageId:MT(),content:MT()}),FT({type:LT(dE.enum.TextMessageEnd),messageId:MT()}),FT({type:LT(dE.enum.ActionExecutionStart),actionExecutionId:MT(),actionName:MT(),parentMessageId:MT().optional()}),FT({type:LT(dE.enum.ActionExecutionArgs),actionExecutionId:MT(),args:MT()}),FT({type:LT(dE.enum.ActionExecutionEnd),actionExecutionId:MT()}),FT({type:LT(dE.enum.ActionExecutionResult),actionName:MT(),actionExecutionId:MT(),result:MT()}),FT({type:LT(dE.enum.AgentStateMessage),threadId:MT(),agentName:MT(),nodeName:MT(),runId:MT(),active:NT(),role:MT(),state:MT(),running:NT()}),FT({type:LT(dE.enum.MetaEvent),name:fE,value:PT()}),FT({type:LT(dE.enum.RunError),message:MT(),code:MT().optional()})]),FT({id:MT(),role:MT(),content:MT(),parentMessageId:MT().optional()}),FT({id:MT(),name:MT(),arguments:PT(),parentMessageId:MT().optional()}),FT({id:MT(),result:PT(),actionExecutionId:MT(),actionName:MT()});var pE=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(` +`)},mE=(e,t,n)=>r=>{let i={},a=!0,o=!0,s=``,c=null,l=null,u=[],d={},f=e=>{typeof e==`object`&&e&&(`messages`in e&&delete e.messages,i=e)};return r.pipe(zx(r=>{switch(r.type){case H.TEXT_MESSAGE_START:{let e=r;return[{type:dE.enum.TextMessageStart,messageId:e.messageId,role:e.role}]}case H.TEXT_MESSAGE_CONTENT:{let e=r;return[{type:dE.enum.TextMessageContent,messageId:e.messageId,content:e.delta}]}case H.TEXT_MESSAGE_END:{let e=r;return[{type:dE.enum.TextMessageEnd,messageId:e.messageId}]}case H.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.enum.ActionExecutionStart,actionExecutionId:e.toolCallId,actionName:e.toolCallName,parentMessageId:e.parentMessageId}]}case H.TOOL_CALL_ARGS:{let c=r,d=u.find(e=>e.id===c.toolCallId);if(!d)return console.warn(`TOOL_CALL_ARGS: No tool call found with ID '${c.toolCallId}'`),[];d.function.arguments+=c.delta;let p=!1;if(l){let e=l.find(e=>e.tool==d.function.name);if(e)try{let t=JSON.parse(Xx(d.function.arguments));e.tool_argument&&e.tool_argument in t?(f({...i,[e.state_key]:t[e.tool_argument]}),p=!0):e.tool_argument||(f({...i,[e.state_key]:t}),p=!0)}catch{}}return[{type:dE.enum.ActionExecutionArgs,actionExecutionId:c.toolCallId,args:c.delta},...p?[{type:dE.enum.AgentStateMessage,threadId:e,agentName:n,nodeName:s,runId:t,running:a,role:`assistant`,state:JSON.stringify(i),active:o}]:[]]}case H.TOOL_CALL_END:{let e=r;return[{type:dE.enum.ActionExecutionEnd,actionExecutionId:e.toolCallId}]}case H.TOOL_CALL_RESULT:{let e=r;return[{type:dE.enum.ActionExecutionResult,actionExecutionId:e.toolCallId,result:e.content,actionName:d[e.toolCallId]||`unknown`}]}case H.RAW:return[];case H.CUSTOM:{let e=r;switch(e.name){case`Exit`:a=!1;break;case`PredictState`:l=e.value}return[{type:dE.enum.MetaEvent,name:e.name,value:e.value}]}case H.STATE_SNAPSHOT:return f(r.snapshot),[{type:dE.enum.AgentStateMessage,threadId:e,agentName:n,nodeName:s,runId:t,running:a,role:`assistant`,state:JSON.stringify(i),active:o}];case H.STATE_DELTA:{let c=r,l=cb.applyPatch(i,c.delta,!0,!1);return l?(f(l.newDocument),[{type:dE.enum.AgentStateMessage,threadId:e,agentName:n,nodeName:s,runId:t,running:a,role:`assistant`,state:JSON.stringify(i),active:o}]):[]}case H.MESSAGES_SNAPSHOT:return c=r.messages,[{type:dE.enum.AgentStateMessage,threadId:e,agentName:n,nodeName:s,runId:t,running:a,role:`assistant`,state:JSON.stringify({...i,...c?{messages:c}:{}}),active:!0}];case H.RUN_STARTED:return[];case H.RUN_FINISHED:return c&&(i.messages=c),Object.keys(i).length===0?[]:[{type:dE.enum.AgentStateMessage,threadId:e,agentName:n,nodeName:s,runId:t,running:a,role:`assistant`,state:JSON.stringify({...i,...c?{messages:hE(c)}:{}}),active:!1}];case H.RUN_ERROR:{let e=r;return[{type:dE.enum.RunError,message:e.message,code:e.code}]}case H.STEP_STARTED:return s=r.stepName,u=[],l=null,[{type:dE.enum.AgentStateMessage,threadId:e,agentName:n,nodeName:s,runId:t,running:a,role:`assistant`,state:JSON.stringify(i),active:!0}];case H.STEP_FINISHED:return u=[],l=null,[{type:dE.enum.AgentStateMessage,threadId:e,agentName:n,nodeName:s,runId:t,running:a,role:`assistant`,state:JSON.stringify(i),active:!1}];default:return[]}}))};function hE(e){let t=[];for(let n of e)if(n.role===`assistant`||n.role===`user`||n.role===`system`){let e=pE(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={id:e.id,name:e.function.name,arguments:JSON.parse(e.function.arguments),parentMessageId:n.id};t.push(r)}}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:n.content,actionExecutionId:n.toolCallId,actionName:r};t.push(i)}return t}var gE=e=>t=>{let n=eE(e),r,i,a,o,s=()=>{if(!r||o!==`text`)throw Error(`No text message to close`);let e={type:H.TEXT_MESSAGE_END,messageId:r.messageId};return o=void 0,r=void 0,n?.event(`TRANSFORM`,`TEXT_MESSAGE_END`,e,{messageId:e.messageId}),e},c=()=>{if(!i||o!==`tool`)throw Error(`No tool call to close`);let e={type:H.TOOL_CALL_END,toolCallId:i.toolCallId};return o=void 0,i=void 0,n?.event(`TRANSFORM`,`TOOL_CALL_END`,e,{toolCallId:e.toolCallId}),e},l=()=>{if(!a||o!==`reasoning`)throw Error(`No reasoning message to close`);let e={type:H.REASONING_MESSAGE_END,messageId:a.messageId};return o=void 0,a=void 0,n?.event(`TRANSFORM`,`REASONING_MESSAGE_END`,e,{messageId:e.messageId}),e},u=()=>o===`text`?[s()]:o===`tool`?[c()]:o===`reasoning`?[l()]:[];return t.pipe(zx(e=>{switch(e.type){case H.TEXT_MESSAGE_START:case H.TEXT_MESSAGE_CONTENT:case H.TEXT_MESSAGE_END:case H.TOOL_CALL_START:case H.TOOL_CALL_ARGS:case H.TOOL_CALL_END:case H.TOOL_CALL_RESULT:case H.STATE_SNAPSHOT:case H.STATE_DELTA:case H.MESSAGES_SNAPSHOT:case H.CUSTOM:case H.RUN_STARTED:case H.RUN_FINISHED:case H.RUN_ERROR:case H.STEP_STARTED:case H.STEP_FINISHED:case H.THINKING_START:case H.THINKING_END:case H.THINKING_TEXT_MESSAGE_START:case H.THINKING_TEXT_MESSAGE_CONTENT:case H.THINKING_TEXT_MESSAGE_END:case H.REASONING_START:case H.REASONING_MESSAGE_START:case H.REASONING_MESSAGE_CONTENT:case H.REASONING_MESSAGE_END:case H.REASONING_END:return[...u(),e];case H.RAW:case H.ACTIVITY_SNAPSHOT:case H.ACTIVITY_DELTA:case H.REASONING_ENCRYPTED_VALUE:return[e];case H.TEXT_MESSAGE_CHUNK:{let t=e,i=[];if((o!==`text`||t.messageId!==void 0&&t.messageId!==r?.messageId)&&i.push(...u()),o!==`text`){if(t.messageId===void 0)throw Error(`First TEXT_MESSAGE_CHUNK must have a messageId`);r={messageId:t.messageId,name:t.name},o=`text`;let e={type:H.TEXT_MESSAGE_START,messageId:t.messageId,role:t.role||`assistant`,...t.name!==void 0&&{name:t.name}};i.push(e),n?.event(`TRANSFORM`,`TEXT_MESSAGE_START`,e,{messageId:t.messageId})}if(t.delta!==void 0){let e={type:H.TEXT_MESSAGE_CONTENT,messageId:r.messageId,delta:t.delta};i.push(e),n?.event(`TRANSFORM`,`TEXT_MESSAGE_CONTENT`,e,{messageId:r.messageId})}return i}case H.TOOL_CALL_CHUNK:{let t=e,r=[];if((o!==`tool`||t.toolCallId!==void 0&&t.toolCallId!==i?.toolCallId)&&r.push(...u()),o!==`tool`){if(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`);i={toolCallId:t.toolCallId,toolCallName:t.toolCallName,parentMessageId:t.parentMessageId},o=`tool`;let e={type:H.TOOL_CALL_START,toolCallId:t.toolCallId,toolCallName:t.toolCallName,parentMessageId:t.parentMessageId};r.push(e),n?.event(`TRANSFORM`,`TOOL_CALL_START`,e,{toolCallId:t.toolCallId,toolCallName:t.toolCallName})}if(t.delta!==void 0){let e={type:H.TOOL_CALL_ARGS,toolCallId:i.toolCallId,delta:t.delta};r.push(e),n?.event(`TRANSFORM`,`TOOL_CALL_ARGS`,e,{toolCallId:i.toolCallId})}return r}case H.REASONING_MESSAGE_CHUNK:{let t=e,r=[];if((o!==`reasoning`||t.messageId&&t.messageId!==a?.messageId)&&r.push(...u()),o!==`reasoning`){if(t.messageId===void 0)throw Error(`First REASONING_MESSAGE_CHUNK must have a messageId`);a={messageId:t.messageId},o=`reasoning`;let e={type:H.REASONING_MESSAGE_START,messageId:t.messageId};r.push(e),n?.event(`TRANSFORM`,`REASONING_MESSAGE_START`,e,{messageId:t.messageId})}if(t.delta!==void 0){let e={type:H.REASONING_MESSAGE_CONTENT,messageId:a.messageId,delta:t.delta};r.push(e),n?.event(`TRANSFORM`,`REASONING_MESSAGE_CONTENT`,e,{messageId:a.messageId})}return r}}return e.type,[]}),Gx(()=>{u()}))};function _E(e,t=new Date){return e.expiresAt!==void 0&&new Date(e.expiresAt)<=t}var vE=class{runNext(e,t){return t.run(e).pipe(gE(!1))}runNextWithState(e,t){let n=qT(e.messages||[]),r=qT(e.state||{}),i=new $b;return iE(e,i,t,[]).subscribe(e=>{e.messages!==void 0&&(n=e.messages),e.state!==void 0&&(r=e.state)}),this.runNext(e,t).pipe(Ux(async e=>(i.next(e),await new Promise(e=>setTimeout(e,0)),{event:e,messages:qT(n),state:qT(r)})))}},yE=class extends vE{constructor(e){super(),this.fn=e}run(e,t){return this.fn(e,t)}};function bE(e){let t=e.content;if(Array.isArray(t)){let n=t.filter(e=>typeof e==`object`&&!!e&&`type`in e&&e.type===`text`&&typeof e.text==`string`).map(e=>e.text).join(``);return{...e,content:n}}return typeof t==`string`?e:{...e,content:``}}var xE=class extends vE{run(e,t){let{parentRunId:n,...r}=e,i={...r,messages:r.messages.map(bE)};return this.runNext(i,t)}},SE=`THINKING_START`,CE=`THINKING_END`,wE=`THINKING_TEXT_MESSAGE_START`,TE=`THINKING_TEXT_MESSAGE_CONTENT`,EE=`THINKING_TEXT_MESSAGE_END`,DE=class extends vE{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(Lx(e=>this.transformEvent(e)))}transformEvent(e){switch(e.type){case SE:{this.currentReasoningId=JT();let{title:t,...n}=e;return this.warnAboutTransformation(SE,H.REASONING_START),{...n,type:H.REASONING_START,messageId:this.currentReasoningId}}case wE:return this.currentMessageId=JT(),this.warnAboutTransformation(wE,H.REASONING_MESSAGE_START),{...e,type:H.REASONING_MESSAGE_START,messageId:this.currentMessageId,role:`assistant`};case TE:{let{delta:t,...n}=e;return this.warnAboutTransformation(TE,H.REASONING_MESSAGE_CONTENT),{...n,type:H.REASONING_MESSAGE_CONTENT,messageId:this.currentMessageId??JT(),delta:t}}case EE:{let t=this.currentMessageId??JT();return this.warnAboutTransformation(EE,H.REASONING_MESSAGE_END),{...e,type:H.REASONING_MESSAGE_END,messageId:t}}case CE:{let t=this.currentReasoningId??JT();return this.warnAboutTransformation(CE,H.REASONING_END),{...e,type:H.REASONING_END,messageId:t}}default:return e}}};function OE(e){return e.startsWith(`image/`)?`image`:e.startsWith(`audio/`)?`audio`:e.startsWith(`video/`)?`video`:`document`}function kE(e){return typeof e==`object`&&!!e&&`type`in e&&e.type===`binary`&&`mimeType`in e&&typeof e.mimeType==`string`}function AE(e){let t=OE(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}}:{}}:e}function jE(e){let t=e.content;if(!Array.isArray(t))return e;let n=t.map(e=>kE(e)?AE(e):e);return{...e,content:n}}var ME=class extends vE{run(e,t){let n={...e,messages:e.messages.map(jE)};return this.runNext(n,t)}},NE=`0.0.58`,PE=class{get maxVersion(){return NE}get debug(){return this._debug}set debug(e){this._debug=$T(e),this._debugLogger=nE(this._debug)}get debugLogger(){return this._debugLogger}set debugLogger(e){this._debugLogger=typeof e==`boolean`?e?nE($T(!0)):void 0:e}constructor({agentId:e,description:t,threadId:n,initialMessages:r,initialState:i,debug:a}={}){this.subscribers=[],this.isRunning=!1,this.pendingInterrupts=[],this.middlewares=[],this.agentId=e,this.description=t??``,this.threadId=n??Eg(),this.messages=qT(r??[]),this.state=qT(i??{}),this._debug=$T(a),this._debugLogger=nE(this._debug),KT(this.maxVersion,`0.0.39`)<=0&&this.middlewares.unshift(new xE),KT(this.maxVersion,`0.0.45`)<=0&&this.middlewares.unshift(new DE),KT(this.maxVersion,`0.0.47`)<=0&&this.middlewares.unshift(new ME)}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 yE(e):e);return this.middlewares.push(...t),this}async runAgent(e,t){try{this.isRunning=!0,this.agentId=this.agentId??Eg();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=[{onRunFinishedEvent:e=>{e.outcome===`success`&&(r=e.result)}},...this.subscribers,t??{}];await this.onInitialize(n,a),this.activeRunDetach$=new Xb;let o;this.activeRunCompletionPromise=new Promise(e=>{o=e}),await Ix(zb(()=>this.middlewares.length===0?this.run(n):this.middlewares.reduceRight((e,t)=>({run:n=>t.run(n,e),get messages(){return e.messages},get state(){return e.state}}),this).run(n),gE(this.debugLogger),aE(this.debugLogger),e=>e.pipe(qx(this.activeRunDetach$)),e=>this.apply(n,e,a),e=>this.processApplyEvents(n,e,a),Hx(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))),Gx(()=>{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}))(Nx(null)));let s=qT(this.messages).filter(e=>!i.has(e.id));return{result:r,newMessages:s}}finally{this.isRunning=!1}}connect(e){throw new Fv}async connectAgent(e,t){try{this.isRunning=!0,this.agentId=this.agentId??Eg();let n=this.prepareRunAgentInput(e),r,i=new Set(this.messages.map(e=>e.id)),a=[{onRunFinishedEvent:e=>{e.outcome===`success`&&(r=e.result)}},...this.subscribers,t??{}];await this.onInitialize(n,a),this.activeRunDetach$=new Xb;let o;this.activeRunCompletionPromise=new Promise(e=>{o=e}),await Ix(zb(()=>Vx(()=>this.connect(n)),gE(this.debugLogger),aE(this.debugLogger),e=>e.pipe(qx(this.activeRunDetach$)),e=>this.apply(n,e,a),e=>this.processApplyEvents(n,e,a),Hx(e=>(this.isRunning=!1,e instanceof Fv?ex:this.onError(n,e,a))),Gx(()=>{this.isRunning=!1,this.onFinalize(n,a),o?.(),o=void 0,this.activeRunCompletionPromise=void 0,this.activeRunDetach$=void 0}))(Nx(null)),{defaultValue:void 0});let s=qT(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}apply(e,t,n){return iE(e,t,this,n,this.debugLogger)}processApplyEvents(e,t,n){return t.pipe(Jx(t=>{t.messages&&(this.messages=t.messages,n.forEach(t=>{t.onMessagesChanged?.({messages:this.messages,state:this.state,agent:this,input:e})})),t.state&&(this.state=t.state,n.forEach(t=>{t.onStateChanged?.({state:this.state,messages:this.messages,agent:this,input:e})}))}))}prepareRunAgentInput(e){let t=qT(this.messages).filter(e=>e.role!==`activity`);return{threadId:this.threadId,runId:e?.runId||Eg(),tools:qT(e?.tools??[]),context:qT(e?.context??[]),forwardedProps:qT(e?.forwardedProps??{}),state:qT(this.state),messages:t,...e?.resume===void 0?{}:{resume:qT(e.resume)}}}async onInitialize(e,t){if(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 Pv(`Thread has ${n.length} pending interrupt(s) not addressed by resume: ${n.join(`, `)}`);for(let e of this.pendingInterrupts)if(_E(e))throw new Pv(`Interrupt ${e.id} expired at ${e.expiresAt}`)}let n=await QT(t,this.messages,this.state,(t,n,r)=>t.onRunInitialized?.({messages:n,state:r,agent:this,input:e}));(n.messages!==void 0||n.state!==void 0)&&(n.messages&&(this.messages=n.messages,e.messages=n.messages,t.forEach(t=>{t.onMessagesChanged?.({messages:this.messages,state:this.state,agent:this,input:e})})),n.state&&(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 Mx(QT(n,this.messages,this.state,(n,r,i)=>n.onRunFailed?.({error:t,messages:r,state:i,agent:this,input:e}))).pipe(Lx(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 QT(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=qT(this.messages),e.state=qT(this.state),e._debug=this._debug,e._debugLogger=this._debugLogger,e.isRunning=this.isRunning,e.subscribers=[...this.subscribers],e.middlewares=[...this.middlewares],e.pendingInterrupts=qT(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=qT(e),(async()=>{for(let e of this.subscribers)await e.onMessagesChanged?.({messages:this.messages,state:this.state,agent:this})})()}setState(e){this.state=qT(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??Eg();let t=this.prepareRunAgentInput(e);return(this.middlewares.length===0?this.run(t):this.middlewares.reduceRight((e,t)=>({run:n=>t.run(n,e),get messages(){return e.messages},get state(){return e.state}}),this).run(t)).pipe(gE(this.debugLogger),aE(this.debugLogger),mE(this.threadId,t.runId,this.agentId),e=>e.pipe(Lx(e=>(this.debugLogger?.event(`LEGACY`,`Event:`,e,{type:e.type}),e))))}},FE=class extends PE{requestInit(e){return{method:`POST`,headers:{...this.headers,"Content-Type":`application/json`,Accept:`text/event-stream`},body:JSON.stringify(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=qT(e.headers??{}),this.fetch=e.fetch??((e,t)=>fetch(e,t))}run(e){return uE(sE(()=>this.fetch(this.url,this.requestInit(e))),this.debugLogger)}clone(){let e=super.clone();e.url=this.url,e.headers=qT(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}},IE=new Map([[`bold`,M.createElement(M.Fragment,null,M.createElement(`path`,{d:`M204,64V168a12,12,0,0,1-24,0V93L72.49,200.49a12,12,0,0,1-17-17L163,76H88a12,12,0,0,1,0-24H192A12,12,0,0,1,204,64Z`}))],[`duotone`,M.createElement(M.Fragment,null,M.createElement(`path`,{d:`M192,64V168L88,64Z`,opacity:`0.2`}),M.createElement(`path`,{d:`M192,56H88a8,8,0,0,0-5.66,13.66L128.69,116,58.34,186.34a8,8,0,0,0,11.32,11.32L140,127.31l46.34,46.35A8,8,0,0,0,200,168V64A8,8,0,0,0,192,56Zm-8,92.69-38.34-38.34h0L107.31,72H184Z`}))],[`fill`,M.createElement(M.Fragment,null,M.createElement(`path`,{d:`M200,64V168a8,8,0,0,1-13.66,5.66L140,127.31,69.66,197.66a8,8,0,0,1-11.32-11.32L128.69,116,82.34,69.66A8,8,0,0,1,88,56H192A8,8,0,0,1,200,64Z`}))],[`light`,M.createElement(M.Fragment,null,M.createElement(`path`,{d:`M198,64V168a6,6,0,0,1-12,0V78.48L68.24,196.24a6,6,0,0,1-8.48-8.48L177.52,70H88a6,6,0,0,1,0-12H192A6,6,0,0,1,198,64Z`}))],[`regular`,M.createElement(M.Fragment,null,M.createElement(`path`,{d:`M200,64V168a8,8,0,0,1-16,0V83.31L69.66,197.66a8,8,0,0,1-11.32-11.32L172.69,72H88a8,8,0,0,1,0-16H192A8,8,0,0,1,200,64Z`}))],[`thin`,M.createElement(M.Fragment,null,M.createElement(`path`,{d:`M196,64V168a4,4,0,0,1-8,0V73.66L66.83,194.83a4,4,0,0,1-5.66-5.66L182.34,68H88a4,4,0,0,1,0-8H192A4,4,0,0,1,196,64Z`}))]]),LE=new Map([[`bold`,M.createElement(M.Fragment,null,M.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`,M.createElement(M.Fragment,null,M.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`}),M.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`,M.createElement(M.Fragment,null,M.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`,M.createElement(M.Fragment,null,M.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`,M.createElement(M.Fragment,null,M.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`,M.createElement(M.Fragment,null,M.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`}))]]),RE=new Map([[`bold`,M.createElement(M.Fragment,null,M.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`,M.createElement(M.Fragment,null,M.createElement(`path`,{d:`M216,128a88,88,0,1,1-88-88A88,88,0,0,1,216,128Z`,opacity:`0.2`}),M.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`,M.createElement(M.Fragment,null,M.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`,M.createElement(M.Fragment,null,M.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`,M.createElement(M.Fragment,null,M.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`,M.createElement(M.Fragment,null,M.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`}))]]),zE=new Map([[`bold`,M.createElement(M.Fragment,null,M.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`,M.createElement(M.Fragment,null,M.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`}),M.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`,M.createElement(M.Fragment,null,M.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`,M.createElement(M.Fragment,null,M.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`,M.createElement(M.Fragment,null,M.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`,M.createElement(M.Fragment,null,M.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`}))]]),BE=new Map([[`bold`,M.createElement(M.Fragment,null,M.createElement(`path`,{d:`M212.62,75.17A63.7,63.7,0,0,0,206.39,26,12,12,0,0,0,196,20a63.71,63.71,0,0,0-50,24H126A63.71,63.71,0,0,0,76,20a12,12,0,0,0-10.39,6,63.7,63.7,0,0,0-6.23,49.17A61.5,61.5,0,0,0,52,104v8a60.1,60.1,0,0,0,45.76,58.28A43.66,43.66,0,0,0,92,192v4H76a20,20,0,0,1-20-20,44.05,44.05,0,0,0-44-44,12,12,0,0,0,0,24,20,20,0,0,1,20,20,44.05,44.05,0,0,0,44,44H92v12a12,12,0,0,0,24,0V192a20,20,0,0,1,40,0v40a12,12,0,0,0,24,0V192a43.66,43.66,0,0,0-5.76-21.72A60.1,60.1,0,0,0,220,112v-8A61.5,61.5,0,0,0,212.62,75.17ZM196,112a36,36,0,0,1-36,36H112a36,36,0,0,1-36-36v-8a37.87,37.87,0,0,1,6.13-20.12,11.65,11.65,0,0,0,1.58-11.49,39.9,39.9,0,0,1-.4-27.72,39.87,39.87,0,0,1,26.41,17.8A12,12,0,0,0,119.82,68h32.35a12,12,0,0,0,10.11-5.53,39.84,39.84,0,0,1,26.41-17.8,39.9,39.9,0,0,1-.4,27.72,12,12,0,0,0,1.61,11.53A37.85,37.85,0,0,1,196,104Z`}))],[`duotone`,M.createElement(M.Fragment,null,M.createElement(`path`,{d:`M208,104v8a48,48,0,0,1-48,48H136a32,32,0,0,1,32,32v40H104V192a32,32,0,0,1,32-32H112a48,48,0,0,1-48-48v-8a49.28,49.28,0,0,1,8.51-27.3A51.92,51.92,0,0,1,76,32a52,52,0,0,1,43.83,24h32.34A52,52,0,0,1,196,32a51.92,51.92,0,0,1,3.49,44.7A49.28,49.28,0,0,1,208,104Z`,opacity:`0.2`}),M.createElement(`path`,{d:`M208.3,75.68A59.74,59.74,0,0,0,202.93,28,8,8,0,0,0,196,24a59.75,59.75,0,0,0-48,24H124A59.75,59.75,0,0,0,76,24a8,8,0,0,0-6.93,4,59.78,59.78,0,0,0-5.38,47.68A58.14,58.14,0,0,0,56,104v8a56.06,56.06,0,0,0,48.44,55.47A39.8,39.8,0,0,0,96,192v8H72a24,24,0,0,1-24-24A40,40,0,0,0,8,136a8,8,0,0,0,0,16,24,24,0,0,1,24,24,40,40,0,0,0,40,40H96v16a8,8,0,0,0,16,0V192a24,24,0,0,1,48,0v40a8,8,0,0,0,16,0V192a39.8,39.8,0,0,0-8.44-24.53A56.06,56.06,0,0,0,216,112v-8A58,58,0,0,0,208.3,75.68ZM200,112a40,40,0,0,1-40,40H112a40,40,0,0,1-40-40v-8a41.74,41.74,0,0,1,6.9-22.48A8,8,0,0,0,80,73.83a43.81,43.81,0,0,1,.79-33.58,43.88,43.88,0,0,1,32.32,20.06A8,8,0,0,0,119.82,64h32.35a8,8,0,0,0,6.74-3.69,43.87,43.87,0,0,1,32.32-20.06A43.81,43.81,0,0,1,192,73.83a8.09,8.09,0,0,0,1,7.65A41.76,41.76,0,0,1,200,104Z`}))],[`fill`,M.createElement(M.Fragment,null,M.createElement(`path`,{d:`M216,104v8a56.06,56.06,0,0,1-48.44,55.47A39.8,39.8,0,0,1,176,192v40a8,8,0,0,1-8,8H104a8,8,0,0,1-8-8V216H72a40,40,0,0,1-40-40A24,24,0,0,0,8,152a8,8,0,0,1,0-16,40,40,0,0,1,40,40,24,24,0,0,0,24,24H96v-8a39.8,39.8,0,0,1,8.44-24.53A56.06,56.06,0,0,1,56,112v-8a58.14,58.14,0,0,1,7.69-28.32A59.78,59.78,0,0,1,69.07,28,8,8,0,0,1,76,24a59.75,59.75,0,0,1,48,24h24a59.75,59.75,0,0,1,48-24,8,8,0,0,1,6.93,4,59.74,59.74,0,0,1,5.37,47.68A58,58,0,0,1,216,104Z`}))],[`light`,M.createElement(M.Fragment,null,M.createElement(`path`,{d:`M206.13,75.92A57.79,57.79,0,0,0,201.2,29a6,6,0,0,0-5.2-3,57.77,57.77,0,0,0-47,24H123A57.77,57.77,0,0,0,76,26a6,6,0,0,0-5.2,3,57.79,57.79,0,0,0-4.93,46.92A55.88,55.88,0,0,0,58,104v8a54.06,54.06,0,0,0,50.45,53.87A37.85,37.85,0,0,0,98,192v10H72a26,26,0,0,1-26-26A38,38,0,0,0,8,138a6,6,0,0,0,0,12,26,26,0,0,1,26,26,38,38,0,0,0,38,38H98v18a6,6,0,0,0,12,0V192a26,26,0,0,1,52,0v40a6,6,0,0,0,12,0V192a37.85,37.85,0,0,0-10.45-26.13A54.06,54.06,0,0,0,214,112v-8A55.88,55.88,0,0,0,206.13,75.92ZM202,112a42,42,0,0,1-42,42H112a42,42,0,0,1-42-42v-8a43.86,43.86,0,0,1,7.3-23.69,6,6,0,0,0,.81-5.76,45.85,45.85,0,0,1,1.43-36.42,45.85,45.85,0,0,1,35.23,21.1A6,6,0,0,0,119.83,62h32.34a6,6,0,0,0,5.06-2.76,45.83,45.83,0,0,1,35.23-21.11,45.85,45.85,0,0,1,1.43,36.42,6,6,0,0,0,.79,5.74A43.78,43.78,0,0,1,202,104Z`}))],[`regular`,M.createElement(M.Fragment,null,M.createElement(`path`,{d:`M208.31,75.68A59.78,59.78,0,0,0,202.93,28,8,8,0,0,0,196,24a59.75,59.75,0,0,0-48,24H124A59.75,59.75,0,0,0,76,24a8,8,0,0,0-6.93,4,59.78,59.78,0,0,0-5.38,47.68A58.14,58.14,0,0,0,56,104v8a56.06,56.06,0,0,0,48.44,55.47A39.8,39.8,0,0,0,96,192v8H72a24,24,0,0,1-24-24A40,40,0,0,0,8,136a8,8,0,0,0,0,16,24,24,0,0,1,24,24,40,40,0,0,0,40,40H96v16a8,8,0,0,0,16,0V192a24,24,0,0,1,48,0v40a8,8,0,0,0,16,0V192a39.8,39.8,0,0,0-8.44-24.53A56.06,56.06,0,0,0,216,112v-8A58.14,58.14,0,0,0,208.31,75.68ZM200,112a40,40,0,0,1-40,40H112a40,40,0,0,1-40-40v-8a41.74,41.74,0,0,1,6.9-22.48A8,8,0,0,0,80,73.83a43.81,43.81,0,0,1,.79-33.58,43.88,43.88,0,0,1,32.32,20.06A8,8,0,0,0,119.82,64h32.35a8,8,0,0,0,6.74-3.69,43.87,43.87,0,0,1,32.32-20.06A43.81,43.81,0,0,1,192,73.83a8.09,8.09,0,0,0,1,7.65A41.72,41.72,0,0,1,200,104Z`}))],[`thin`,M.createElement(M.Fragment,null,M.createElement(`path`,{d:`M203.94,76.16A55.73,55.73,0,0,0,199.46,30,4,4,0,0,0,196,28a55.78,55.78,0,0,0-46,24H122A55.78,55.78,0,0,0,76,28a4,4,0,0,0-3.46,2,55.73,55.73,0,0,0-4.48,46.16A53.78,53.78,0,0,0,60,104v8a52.06,52.06,0,0,0,52,52h1.41A36,36,0,0,0,100,192v12H72a28,28,0,0,1-28-28A36,36,0,0,0,8,140a4,4,0,0,0,0,8,28,28,0,0,1,28,28,36,36,0,0,0,36,36h28v20a4,4,0,0,0,8,0V192a28,28,0,0,1,56,0v40a4,4,0,0,0,8,0V192a36,36,0,0,0-13.41-28H160a52.06,52.06,0,0,0,52-52v-8A53.78,53.78,0,0,0,203.94,76.16ZM204,112a44.05,44.05,0,0,1-44,44H112a44.05,44.05,0,0,1-44-44v-8a45.76,45.76,0,0,1,7.71-24.89,4,4,0,0,0,.53-3.84,47.82,47.82,0,0,1,2.1-39.21,47.8,47.8,0,0,1,38.12,22.1A4,4,0,0,0,119.83,60h32.34a4,4,0,0,0,3.37-1.84,47.8,47.8,0,0,1,38.12-22.1,47.82,47.82,0,0,1,2.1,39.21,4,4,0,0,0,.53,3.83A45.85,45.85,0,0,1,204,104Z`}))]]),VE=new Map([[`bold`,M.createElement(M.Fragment,null,M.createElement(`path`,{d:`M128,20A108,108,0,1,0,236,128,108.12,108.12,0,0,0,128,20Zm84,108a83.64,83.64,0,0,1-4.47,27L167,130a19.65,19.65,0,0,0-7.8-2.78l-22.82-3.08A20.14,20.14,0,0,0,117.72,132h-4.07l-2.71-5.6a19.88,19.88,0,0,0-13.8-10.84L94.46,115l4-7h14.39a20,20,0,0,0,9.66-2.49l12.25-6.76a20.57,20.57,0,0,0,3.74-2.68l26.92-24.33A20,20,0,0,0,172,56.49,84,84,0,0,1,212,128ZM140.76,45l6.2,11.1L122.75,78l-10.93,6H96.14A20.05,20.05,0,0,0,78.78,94.06l-4.49,7.85L67.68,84.28l9.91-23.42A83.91,83.91,0,0,1,140.76,45ZM44,128a83.52,83.52,0,0,1,4.4-26.77l7.74,20.65a19.89,19.89,0,0,0,14.52,12.53l19.53,4.2,3,6.1a20.11,20.11,0,0,0,13.55,10.77l-5,11.12a20,20,0,0,0,3.58,21.71l.21.22,18.16,18.7-.89,4.59A84.09,84.09,0,0,1,44,128Zm103.65,81.66a20.11,20.11,0,0,0-5-17.3l-.21-.22-17.72-18.25,11.37-25.52,19,2.56,41.43,25.48A84.2,84.2,0,0,1,147.65,209.66Z`}))],[`duotone`,M.createElement(M.Fragment,null,M.createElement(`path`,{d:`M213.09,172.48a96,96,0,0,1-80.41,51.41l3.17-16.44a8,8,0,0,0-2-6.95l-19.74-20.33a8,8,0,0,1-1.44-8.69l13.7-30.74a8,8,0,0,1,8.38-4.67l22.82,3.08a8.11,8.11,0,0,1,3.12,1.11ZM116.71,95,129,88.24a7.46,7.46,0,0,0,1.5-1.07l26.91-24.33A8,8,0,0,0,159,53l-10.5-18.81A96.62,96.62,0,0,0,128,32,95.61,95.61,0,0,0,67.78,53.23L56,81.08A8,8,0,0,0,55.88,87l11.5,30.67a8,8,0,0,0,5.81,5l2.69.58L89.2,100a8,8,0,0,1,6.94-4h16.71A7.9,7.9,0,0,0,116.71,95Z`,opacity:`0.2`}),M.createElement(`path`,{d:`M128,24A104,104,0,1,0,232,128,104.11,104.11,0,0,0,128,24Zm88,104a87.62,87.62,0,0,1-6.4,32.94l-44.7-27.49a15.92,15.92,0,0,0-6.24-2.23l-22.82-3.08a16.11,16.11,0,0,0-16,7.86h-8.72l-3.8-7.86a15.91,15.91,0,0,0-11-8.67l-8-1.73L96.14,104h16.71a16.06,16.06,0,0,0,7.73-2l12.25-6.76a16.62,16.62,0,0,0,3-2.14l26.91-24.34A15.93,15.93,0,0,0,166,49.1l-.36-.65A88.11,88.11,0,0,1,216,128ZM143.31,41.34,152,56.9,125.09,81.24,112.85,88H96.14a16,16,0,0,0-13.88,8l-8.73,15.23L63.38,84.19,74.32,58.32a87.87,87.87,0,0,1,69-17ZM40,128a87.53,87.53,0,0,1,8.54-37.8l11.34,30.27a16,16,0,0,0,11.62,10l21.43,4.61L96.74,143a16.09,16.09,0,0,0,14.4,9h1.48l-7.23,16.23a16,16,0,0,0,2.86,17.37l.14.14L128,205.94l-1.94,10A88.11,88.11,0,0,1,40,128Zm102.58,86.78,1.13-5.81a16.09,16.09,0,0,0-4-13.9,1.85,1.85,0,0,1-.14-.14L120,174.74,133.7,144l22.82,3.08,45.72,28.12A88.18,88.18,0,0,1,142.58,214.78Z`}))],[`fill`,M.createElement(M.Fragment,null,M.createElement(`path`,{d:`M128,24A104,104,0,1,0,232,128,104.11,104.11,0,0,0,128,24Zm88,104a87.62,87.62,0,0,1-6.4,32.94l-44.7-27.49a15.92,15.92,0,0,0-6.24-2.23l-22.82-3.08a16.11,16.11,0,0,0-16,7.86h-8.72l-3.8-7.86a15.91,15.91,0,0,0-11-8.67l-8-1.73L96.14,104h16.71a16.06,16.06,0,0,0,7.73-2l12.25-6.76a16.62,16.62,0,0,0,3-2.14l26.91-24.34A15.93,15.93,0,0,0,166,49.1l-.36-.65A88.11,88.11,0,0,1,216,128ZM40,128a87.53,87.53,0,0,1,8.54-37.8l11.34,30.27a16,16,0,0,0,11.62,10l21.43,4.61L96.74,143a16.09,16.09,0,0,0,14.4,9h1.48l-7.23,16.23a16,16,0,0,0,2.86,17.37l.14.14L128,205.94l-1.94,10A88.11,88.11,0,0,1,40,128Z`}))],[`light`,M.createElement(M.Fragment,null,M.createElement(`path`,{d:`M128,26A102,102,0,1,0,230,128,102.12,102.12,0,0,0,128,26Zm90,102a89.55,89.55,0,0,1-7.46,35.86l-46.69-28.71a13.94,13.94,0,0,0-5.46-2l-22.82-3.07A14.06,14.06,0,0,0,121.06,138h-9.92a2,2,0,0,1-1.8-1.13l-3.8-7.86a13.94,13.94,0,0,0-9.66-7.59l-10.71-2.3L94.4,103a2,2,0,0,1,1.74-1h16.71a13.9,13.9,0,0,0,6.76-1.75l12.25-6.75a14.73,14.73,0,0,0,2.62-1.88l26.91-24.33a13.93,13.93,0,0,0,2.83-17.21L161,44.25A90.16,90.16,0,0,1,218,128ZM144.6,39.54l9.15,16.39a2,2,0,0,1-.41,2.46L126.43,82.72a1.84,1.84,0,0,1-.37.27l-12.25,6.76a2,2,0,0,1-1,.25H96.14A14,14,0,0,0,84,97L73.18,115.91a2,2,0,0,1-.19-.35L61.5,84.89a2,2,0,0,1,0-1.48L72.68,57.06A89.9,89.9,0,0,1,144.6,39.54ZM38,128A89.52,89.52,0,0,1,49.38,84.23a13.85,13.85,0,0,0,.89,4.87l11.49,30.67a13.94,13.94,0,0,0,10.16,8.78l21.44,4.6a2,2,0,0,1,1.38,1.09l3.8,7.86a14.07,14.07,0,0,0,12.6,7.9h4.56l-8.49,19a14,14,0,0,0,2.51,15.2l.1.11,19.68,20.26a2,2,0,0,1,.46,1.7L127.7,218A90.1,90.1,0,0,1,38,128Zm102.08,89.19,1.67-8.6a14.07,14.07,0,0,0-3.47-12.16l-.1-.11L118.5,176.06a2,2,0,0,1-.33-2.14l13.7-30.73A2,2,0,0,1,134,142l22.82,3.08a2,2,0,0,1,.78.27L205,174.55A90.18,90.18,0,0,1,140.08,217.19Z`}))],[`regular`,M.createElement(M.Fragment,null,M.createElement(`path`,{d:`M128,24A104,104,0,1,0,232,128,104.11,104.11,0,0,0,128,24Zm88,104a87.62,87.62,0,0,1-6.4,32.94l-44.7-27.49a15.92,15.92,0,0,0-6.24-2.23l-22.82-3.08a16.11,16.11,0,0,0-16,7.86h-8.72l-3.8-7.86a15.91,15.91,0,0,0-11-8.67l-8-1.73L96.14,104h16.71a16.06,16.06,0,0,0,7.73-2l12.25-6.76a16.62,16.62,0,0,0,3-2.14l26.91-24.34A15.93,15.93,0,0,0,166,49.1l-.36-.65A88.11,88.11,0,0,1,216,128ZM143.31,41.34,152,56.9,125.09,81.24,112.85,88H96.14a16,16,0,0,0-13.88,8l-8.73,15.23L63.38,84.19,74.32,58.32a87.87,87.87,0,0,1,69-17ZM40,128a87.53,87.53,0,0,1,8.54-37.8l11.34,30.27a16,16,0,0,0,11.62,10l21.43,4.61L96.74,143a16.09,16.09,0,0,0,14.4,9h1.48l-7.23,16.23a16,16,0,0,0,2.86,17.37l.14.14L128,205.94l-1.94,10A88.11,88.11,0,0,1,40,128Zm102.58,86.78,1.13-5.81a16.09,16.09,0,0,0-4-13.9,1.85,1.85,0,0,1-.14-.14L120,174.74,133.7,144l22.82,3.08,45.72,28.12A88.18,88.18,0,0,1,142.58,214.78Z`}))],[`thin`,M.createElement(M.Fragment,null,M.createElement(`path`,{d:`M128,28A100,100,0,1,0,228,128,100.11,100.11,0,0,0,128,28Zm92,100a91.44,91.44,0,0,1-8.58,38.76L162.8,136.85a12.07,12.07,0,0,0-4.68-1.67l-22.82-3.07a12,12,0,0,0-12.56,7l-.4.88h-11.2a4,4,0,0,1-3.6-2.26l-3.8-7.86a11.93,11.93,0,0,0-8.28-6.5L82.07,120.5,92.67,102a4,4,0,0,1,3.47-2h16.71a12,12,0,0,0,5.8-1.5l12.24-6.76a11.79,11.79,0,0,0,2.25-1.6L160.05,65.8a12,12,0,0,0,2.43-14.75l-5.86-10.49A92.17,92.17,0,0,1,220,128ZM145.89,37.75l9.6,17.2a4,4,0,0,1-.81,4.92L127.77,84.21a4.41,4.41,0,0,1-.75.53L114.78,91.5a4,4,0,0,1-1.93.5H96.14a12,12,0,0,0-10.41,6l-11.86,20.7a4,4,0,0,1-2.75-2.47L59.63,85.6a4,4,0,0,1,.06-3L71,55.81A91.51,91.51,0,0,1,128,36,92.53,92.53,0,0,1,145.89,37.75ZM36,128A91.52,91.52,0,0,1,56,70.77l-3.71,8.75a12,12,0,0,0-.18,8.88l11.49,30.67a11.93,11.93,0,0,0,8.72,7.52l21.43,4.61a4,4,0,0,1,2.76,2.17l3.8,7.86a12.07,12.07,0,0,0,10.8,6.77h7.64L109,169.85A12,12,0,0,0,111.26,183l19.68,20.26a4,4,0,0,1,1,3.47L129.36,220,128,220A92.1,92.1,0,0,1,36,128Zm101.6,91.5,2.18-11.29a12.08,12.08,0,0,0-3-10.49l-19.68-20.26a4,4,0,0,1-.71-4.35l13.7-30.74a4,4,0,0,1,4.18-2.33l22.82,3.07a4.12,4.12,0,0,1,1.56.56l49.11,30.2A92.12,92.12,0,0,1,137.6,219.5Z`}))]]),HE=new Map([[`bold`,M.createElement(M.Fragment,null,M.createElement(`path`,{d:`M216,36H40A20,20,0,0,0,20,56V200a20,20,0,0,0,20,20H216a20,20,0,0,0,20-20V56A20,20,0,0,0,216,36Zm-4,24V92H44V60ZM44,116H92v80H44Zm72,80V116h96v80Z`}))],[`duotone`,M.createElement(M.Fragment,null,M.createElement(`path`,{d:`M104,104V208H40a8,8,0,0,1-8-8V104Z`,opacity:`0.2`}),M.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,40Zm0,16V96H40V56ZM40,112H96v88H40Zm176,88H112V112H216v88Z`}))],[`fill`,M.createElement(M.Fragment,null,M.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,40ZM40,56H216V96H40ZM216,200H112V112H216v88Z`}))],[`light`,M.createElement(M.Fragment,null,M.createElement(`path`,{d:`M216,42H40A14,14,0,0,0,26,56V200a14,14,0,0,0,14,14H216a14,14,0,0,0,14-14V56A14,14,0,0,0,216,42ZM40,54H216a2,2,0,0,1,2,2V98H38V56A2,2,0,0,1,40,54ZM38,200V110H98v92H40A2,2,0,0,1,38,200Zm178,2H110V110H218v90A2,2,0,0,1,216,202Z`}))],[`regular`,M.createElement(M.Fragment,null,M.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,40Zm0,16V96H40V56ZM40,112H96v88H40Zm176,88H112V112H216v88Z`}))],[`thin`,M.createElement(M.Fragment,null,M.createElement(`path`,{d:`M216,44H40A12,12,0,0,0,28,56V200a12,12,0,0,0,12,12H216a12,12,0,0,0,12-12V56A12,12,0,0,0,216,44ZM40,52H216a4,4,0,0,1,4,4v44H36V56A4,4,0,0,1,40,52ZM36,200V108h64v96H40A4,4,0,0,1,36,200Zm180,4H108V108H220v92A4,4,0,0,1,216,204Z`}))]]),UE=new Map([[`bold`,M.createElement(M.Fragment,null,M.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`,M.createElement(M.Fragment,null,M.createElement(`path`,{d:`M192,112a80,80,0,1,1-80-80A80,80,0,0,1,192,112Z`,opacity:`0.2`}),M.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`,M.createElement(M.Fragment,null,M.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`,M.createElement(M.Fragment,null,M.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`,M.createElement(M.Fragment,null,M.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`,M.createElement(M.Fragment,null,M.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`}))]]),WE=new Map([[`bold`,M.createElement(M.Fragment,null,M.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`,M.createElement(M.Fragment,null,M.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`}),M.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`,M.createElement(M.Fragment,null,M.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`,M.createElement(M.Fragment,null,M.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`,M.createElement(M.Fragment,null,M.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`,M.createElement(M.Fragment,null,M.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`}))]]),GE=new Map([[`bold`,M.createElement(M.Fragment,null,M.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`,M.createElement(M.Fragment,null,M.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`}),M.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`,M.createElement(M.Fragment,null,M.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`,M.createElement(M.Fragment,null,M.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`,M.createElement(M.Fragment,null,M.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`,M.createElement(M.Fragment,null,M.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`}))]]),KE=new Map([[`bold`,M.createElement(M.Fragment,null,M.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`,M.createElement(M.Fragment,null,M.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`}),M.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`,M.createElement(M.Fragment,null,M.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`,M.createElement(M.Fragment,null,M.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`,M.createElement(M.Fragment,null,M.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`,M.createElement(M.Fragment,null,M.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`}))]]),qE=new Map([[`bold`,M.createElement(M.Fragment,null,M.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`,M.createElement(M.Fragment,null,M.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`}),M.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`,M.createElement(M.Fragment,null,M.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`,M.createElement(M.Fragment,null,M.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`,M.createElement(M.Fragment,null,M.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`,M.createElement(M.Fragment,null,M.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`}))]]),JE=new Map([[`bold`,M.createElement(M.Fragment,null,M.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`,M.createElement(M.Fragment,null,M.createElement(`path`,{d:`M224,56V200a16,16,0,0,1-16,16H48V40H208A16,16,0,0,1,224,56Z`,opacity:`0.2`}),M.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`,M.createElement(M.Fragment,null,M.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`,M.createElement(M.Fragment,null,M.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`,M.createElement(M.Fragment,null,M.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`,M.createElement(M.Fragment,null,M.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`}))]]),YE=new Map([[`bold`,M.createElement(M.Fragment,null,M.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`,M.createElement(M.Fragment,null,M.createElement(`path`,{d:`M184,128a56,56,0,1,1-56-56A56,56,0,0,1,184,128Z`,opacity:`0.2`}),M.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`,M.createElement(M.Fragment,null,M.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`,M.createElement(M.Fragment,null,M.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`,M.createElement(M.Fragment,null,M.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`,M.createElement(M.Fragment,null,M.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`}))]]),XE=new Map([[`bold`,M.createElement(M.Fragment,null,M.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`,M.createElement(M.Fragment,null,M.createElement(`path`,{d:`M200,56V208a8,8,0,0,1-8,8H64a8,8,0,0,1-8-8V56Z`,opacity:`0.2`}),M.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`,M.createElement(M.Fragment,null,M.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`,M.createElement(M.Fragment,null,M.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`,M.createElement(M.Fragment,null,M.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`,M.createElement(M.Fragment,null,M.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`}))]]),ZE=M.forwardRef((e,t)=>M.createElement(Ne,{ref:t,...e,weights:IE}));ZE.displayName=`ArrowUpRightIcon`;var QE=ZE,$E=M.forwardRef((e,t)=>M.createElement(Ne,{ref:t,...e,weights:LE}));$E.displayName=`ChatCircleTextIcon`;var eD=$E,tD=M.forwardRef((e,t)=>M.createElement(Ne,{ref:t,...e,weights:RE}));tD.displayName=`ClockCounterClockwiseIcon`;var nD=tD,rD=M.forwardRef((e,t)=>M.createElement(Ne,{ref:t,...e,weights:zE}));rD.displayName=`DotsThreeIcon`;var iD=rD,aD=M.forwardRef((e,t)=>M.createElement(Ne,{ref:t,...e,weights:BE}));aD.displayName=`GithubLogoIcon`;var oD=aD,sD=M.forwardRef((e,t)=>M.createElement(Ne,{ref:t,...e,weights:VE}));sD.displayName=`GlobeHemisphereWestIcon`;var cD=sD,lD=M.forwardRef((e,t)=>M.createElement(Ne,{ref:t,...e,weights:HE}));lD.displayName=`LayoutIcon`;var uD=lD,dD=M.forwardRef((e,t)=>M.createElement(Ne,{ref:t,...e,weights:UE}));dD.displayName=`MagnifyingGlassIcon`;var fD=dD,pD=M.forwardRef((e,t)=>M.createElement(Ne,{ref:t,...e,weights:WE}));pD.displayName=`MoonIcon`;var mD=pD,hD=M.forwardRef((e,t)=>M.createElement(Ne,{ref:t,...e,weights:GE}));hD.displayName=`PaperPlaneTiltIcon`;var gD=hD,_D=M.forwardRef((e,t)=>M.createElement(Ne,{ref:t,...e,weights:KE}));_D.displayName=`PencilSimpleIcon`;var vD=_D,yD=M.forwardRef((e,t)=>M.createElement(Ne,{ref:t,...e,weights:qE}));yD.displayName=`PlusIcon`;var bD=yD,xD=M.forwardRef((e,t)=>M.createElement(Ne,{ref:t,...e,weights:JE}));xD.displayName=`SignOutIcon`;var SD=xD,CD=M.forwardRef((e,t)=>M.createElement(Ne,{ref:t,...e,weights:YE}));CD.displayName=`SunIcon`;var wD=CD,TD=M.forwardRef((e,t)=>M.createElement(Ne,{ref:t,...e,weights:XE}));TD.displayName=`TrashIcon`;var ED=TD,DD=M.createContext(void 0),OD=e=>{let t=M.useContext(DD);if(e)return e;if(!t)throw Error(`No QueryClient set, use QueryClientProvider to set one`);return t},kD=({client:e,children:t})=>(M.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),(0,N.jsx)(DD.Provider,{value:e,children:t})),AD={setTimeout:(e,t)=>setTimeout(e,t),clearTimeout:e=>clearTimeout(e),setInterval:(e,t)=>setInterval(e,t),clearInterval:e=>clearInterval(e)},jD=new class{#e=AD;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 MD(e){setTimeout(e,0)}var ND=typeof window>`u`||`Deno`in globalThis;function PD(){}function FD(e,t){return typeof e==`function`?e(t):e}function ID(e){return typeof e==`number`&&e>=0&&e!==1/0}function LD(e,t){return Math.max(e+(t||0)-Date.now(),0)}function RD(e,t){return typeof e==`function`?e(t):e}function zD(e,t){let{type:n=`all`,exact:r,fetchStatus:i,predicate:a,queryKey:o,stale:s}=e;if(o){if(r){if(t.queryHash!==VD(o,t.options))return!1}else if(!UD(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 BD(e,t){let{exact:n,status:r,predicate:i,mutationKey:a}=e;if(a){if(!t.options.mutationKey)return!1;if(n){if(HD(t.options.mutationKey)!==HD(a))return!1}else if(!UD(t.options.mutationKey,a))return!1}return!(r&&t.state.status!==r||i&&!i(t))}function VD(e,t){return(t?.queryKeyHashFn||HD)(e)}function HD(e){return JSON.stringify(e,(e,t)=>JD(t)?Object.keys(t).sort().reduce((e,n)=>(e[n]=t[n],e),{}):t)}function UD(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)){for(let n=0;n500)return t;let r=qD(e)&&qD(t);if(!r&&!(JD(e)&&JD(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{jD.setTimeout(t,e)})}function ZD(e,t,n){return typeof n.structuralSharing==`function`?n.structuralSharing(e,t):n.structuralSharing===!1?t:GD(e,t)}function QD(e,t,n=0){let r=[...e,t];return n&&r.length>n?r.slice(1):r}function $D(e,t,n=0){let r=[t,...e];return n&&r.length>n?r.slice(0,-1):r}var eO=Symbol();function tO(e,t){return!e.queryFn&&t?.initialPromise?()=>t.initialPromise:!e.queryFn||e.queryFn===eO?()=>Promise.reject(Error(`Missing queryFn: '${e.queryHash}'`)):e.queryFn}function nO(e,t){return typeof e==`function`?e(...t):!!e}function rO(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 iO=()=>ND,aO=()=>iO(),oO=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(){}},sO=new class extends oO{#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`}},cO=MD;function lO(){let e=[],t=0,n=e=>{e()},r=e=>{e()},i=cO,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 uO=lO(),dO=new class extends oO{#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 fO(e){return Math.min(1e3*2**e,3e4)}function pO(e){return(e??`online`)!==`online`||dO.isOnline()}var mO=class extends Error{constructor(e){super(`CancelledError`),this.revert=e?.revert,this.silent=e?.silent}};function hO(e){let t=!1,n=0,r,i=`pending`,a,o,s=new Promise((e,t)=>{a=e,o=t});s.catch(PD);let c=()=>i!==`pending`,l=t=>{if(!c()){let n=new mO(t);h(n),e.onCancel?.(n)}},u=()=>{t=!0},d=()=>{t=!1},f=()=>sO.isFocused()&&(e.networkMode===`always`||dO.isOnline())&&e.canRun(),p=()=>pO(e.networkMode)&&e.canRun(),m=e=>{c()||(r?.(),i=`resolved`,a(e))},h=e=>{c()||(r?.(),i=`rejected`,o(e))},g=()=>new Promise(t=>{r=e=>{(c()||f())&&t(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??(aO()?0:3),a=e.retryDelay??fO,o=typeof a==`function`?a(n,r):a,s=i===!0||typeof i==`number`&&nf()?void 0:g()).then(()=>{t?h(r):_()})})};return{promise:s,status:()=>i,cancel:l,continue:()=>(r?.(),s),cancelRetry:u,continueRetry:d,canStart:p,start:()=>(p()?_():g().then(_),s)}}var gO=class{#e;destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),ID(this.gcTime)&&(this.#e=jD.setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(aO()?1/0:3e5))}clearGcTimeout(){this.#e!==void 0&&(jD.clearTimeout(this.#e),this.#e=void 0)}};function _O(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=>{rO(e,()=>t.signal,()=>n=!0)},u=tO(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?$D:QD;return{pages:c(e.pages,o,s),pageParams:c(e.pageParams,r,s)}};if(i&&a.length){let e=i===`backward`,t=e?yO:vO,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:vO(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 vO(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 yO(e,{pages:t,pageParams:n}){return t.length>0?e.getPreviousPageParam?.(t[0],t,n[0],n):void 0}function bO(e,t){return t?vO(e,t)!=null:!1}function xO(e,t){return!t||!e.getPreviousPageParam?!1:yO(e,t)!=null}var SO=class extends gO{#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=TO(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=TO(this.options);e.data!==void 0&&(this.setState(wO(e.data,e.dataUpdatedAt)),this.#t=e)}}optionalRemove(){!this.observers.length&&this.state.fetchStatus===`idle`&&this.#r.remove(this)}setData(e,t){let n=ZD(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(PD).catch(PD):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=>RD(e.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===eO||!this.isFetched()}isFetched(){return this.state.dataUpdateCount+this.state.errorUpdateCount>0}isStatic(){return this.getObserversCount()>0&&this.observers.some(e=>RD(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:!LD(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=tO(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`?_O(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=hO({initialPromise:t?.initialPromise,fn:a.fetchFn,onCancel:e=>{e instanceof mO&&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 mO){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,...CO(t.data,this.options),fetchMeta:e.meta??null};case`success`:let n={...t,...wO(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),uO.batch(()=>{this.observers.slice().forEach(e=>{e.onQueryUpdate()}),this.#r.notify({query:this,type:`updated`,action:e})})}};function CO(e,t){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:pO(t.networkMode)?`fetching`:`paused`,...e===void 0&&{error:null,status:`pending`}}}function wO(e,t){return{data:e,dataUpdatedAt:t??Date.now(),error:null,isInvalidated:!1,status:`success`}}function TO(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 EO=class extends oO{#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),OO(this.#t,this.options)?this.#m():this.updateResult(),this.#y())}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return kO(this.#t,this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return kO(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 RD(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&&!KD(this.options,t)&&this.#e.getQueryCache().notify({type:`observerOptionsUpdated`,query:this.#t,observer:this});let r=this.hasListeners();r&&AO(this.#t,n,this.options,t)&&this.#m(),this.updateResult(),r&&(this.#t!==n||RD(this.options.enabled,this.#t)!==RD(t.enabled,this.#t)||RD(this.options.staleTime,this.#t)!==RD(t.staleTime,this.#t))&&this.#g();let i=this.#_();r&&(this.#t!==n||RD(this.options.enabled,this.#t)!==RD(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 KD(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(PD)),t}#h(e){return!aO()&&RD(this.options.enabled,this.#t)!==!1&&ID(e)}#g(){this.#b();let e=RD(this.options.staleTime,this.#t);if(this.#r.isStale||!this.#h(e))return;let t=LD(this.#r.dataUpdatedAt,e)+1;this.#u=jD.setTimeout(()=>{this.#r.isStale||this.updateResult()},t)}#_(){return(typeof this.options.refetchInterval==`function`?this.options.refetchInterval(this.#t):this.options.refetchInterval)??!1}#v(e){this.#x(),this.#f=e,this.#f!==0&&this.#h(this.#f)&&(this.#d=jD.setInterval(()=>{(this.options.refetchIntervalInBackground||sO.isFocused())&&this.#m()},this.#f))}#y(){this.#g(),this.#v(this.#_())}#b(){this.#u!==void 0&&(jD.clearTimeout(this.#u),this.#u=void 0)}#x(){this.#d!==void 0&&(jD.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&&OO(e,t),o=i&&AO(e,n,t,r);(a||o)&&(l={...l,...CO(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=ZD(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=ZD(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:jO(e,t),refetch:this.refetch,isEnabled:RD(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),KD(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)})})();uO.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 DO(e,t){return RD(t.enabled,e)!==!1&&e.state.data===void 0&&(e.state.status!==`error`||RD(t.retryOnMount,e)!==!1)}function OO(e,t){return DO(e,t)||e.state.data!==void 0&&kO(e,t,t.refetchOnMount)}function kO(e,t,n){if(RD(t.enabled,e)!==!1&&RD(t.staleTime,e)!==`static`){let r=typeof n==`function`?n(e):n;return r===`always`||r!==!1&&jO(e,t)}return!1}function AO(e,t,n,r){return(e!==t||RD(r.enabled,e)===!1)&&(!n.suspense||e.state.status!==`error`)&&jO(e,n)}function jO(e,t){return RD(t.enabled,e)!==!1&&e.isStaleByTime(RD(t.staleTime,e))}var MO=class extends EO{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:bO(t,n.data),hasPreviousPage:xO(t,n.data),isFetchNextPageError:l,isFetchingNextPage:u,isFetchPreviousPageError:d,isFetchingPreviousPage:f,isRefetchError:s&&!l&&!d,isRefetching:a&&!u&&!f}}},NO=class extends gO{#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||PO(),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=hO({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),uO.batch(()=>{this.#t.forEach(t=>{t.onMutationUpdate(e)}),this.#n.notify({mutation:this,type:`updated`,action:e})})}};function PO(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:`idle`,variables:void 0,submittedAt:0}}var FO=class extends oO{#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 NO({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=IO(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=IO(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=IO(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=IO(e);return typeof t==`string`?(this.#t.get(t)?.find(t=>t!==e&&t.state.isPaused))?.continue()??Promise.resolve():Promise.resolve()}clear(){uO.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=>BD(t,e))}findAll(e={}){return this.getAll().filter(t=>BD(e,t))}notify(e){uO.batch(()=>{this.listeners.forEach(t=>{t(e)})})}resumePausedMutations(){let e=this.getAll().filter(e=>e.state.isPaused);return uO.batch(()=>Promise.all(e.map(e=>e.continue().catch(PD))))}};function IO(e){return e.options.scope?.id}var LO=class extends oO{#e;constructor(e={}){super(),this.config=e,this.#e=new Map}build(e,t,n){let r=t.queryKey,i=t.queryHash??VD(r,t),a=this.get(i);return a||(a=new SO({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){let t=this.#e.get(e.queryHash);t&&(e.destroy(),t===e&&this.#e.delete(e.queryHash),this.notify({type:`removed`,query:e}))}clear(){uO.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=>zD(t,e))}findAll(e={}){let t=this.getAll();return Object.keys(e).length>0?t.filter(t=>zD(e,t)):t}notify(e){uO.batch(()=>{this.listeners.forEach(t=>{t(e)})})}onFocus(){uO.batch(()=>{this.getAll().forEach(e=>{e.onFocus()})})}onOnline(){uO.batch(()=>{this.getAll().forEach(e=>{e.onOnline()})})}},RO=class{#e;#t;#n;#r;#i;#a;#o;#s;constructor(e={}){this.#e=e.queryCache||new LO,this.#t=e.mutationCache||new FO,this.#n=e.defaultOptions||{},this.#r=new Map,this.#i=new Map,this.#a=0}mount(){this.#a++,this.#a===1&&(this.#o=sO.subscribe(async e=>{e&&(await this.resumePausedMutations(),this.#e.onFocus())}),this.#s=dO.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(RD(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=FD(t,i);if(a!==void 0)return this.#e.build(this,r).setData(a,{...n,manual:!0})}setQueriesData(e,t,n){return uO.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;uO.batch(()=>{t.findAll(e).forEach(e=>{t.remove(e)})})}resetQueries(e,t){let n=this.#e;return uO.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=uO.batch(()=>this.#e.findAll(e).map(e=>e.cancel(n)));return Promise.all(r).then(PD).catch(PD)}invalidateQueries(e,t={}){return uO.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=uO.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(PD)),e.state.fetchStatus===`paused`?Promise.resolve():t}));return Promise.all(r).then(PD)}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(RD(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(RD(t.staleTime,n))?n.fetch(t):Promise.resolve(n.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(PD).catch(PD)}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(PD).catch(PD)}ensureInfiniteQueryData(e){return e._type=`infinite`,this.ensureQueryData(e)}resumePausedMutations(){return dO.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(HD(e),{queryKey:e,defaultOptions:t})}getQueryDefaults(e){let t=[...this.#r.values()],n={};return t.forEach(t=>{UD(e,t.queryKey)&&Object.assign(n,t.defaultOptions)}),n}setMutationDefaults(e,t){this.#i.set(HD(e),{mutationKey:e,defaultOptions:t})}getMutationDefaults(e){let t=[...this.#i.values()],n={};return t.forEach(t=>{UD(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||=VD(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===eO&&(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()}},zO=M.createContext(!1),BO=()=>M.useContext(zO);zO.Provider;function VO(){let e=!1;return{clearReset:()=>{e=!1},reset:()=>{e=!0},isReset:()=>e}}var HO=M.createContext(VO()),UO=()=>M.useContext(HO),WO=(e,t,n)=>{let r=n?.state.error&&typeof e.throwOnError==`function`?nO(e.throwOnError,[n.state.error,n]):e.throwOnError;(e.suspense||r)&&(t.isReset()||(e.retryOnMount=!1))},GO=e=>{M.useEffect(()=>{e.clearReset()},[e])},KO=({result:e,errorResetBoundary:t,throwOnError:n,query:r,suspense:i})=>e.isError&&!t.isReset()&&!e.isFetching&&r&&(i&&e.data===void 0||nO(n,[e.error,r])),qO=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))}},JO=(e,t)=>e?.suspense&&t.isPending,YO=(e,t,n)=>t.fetchOptimistic(e).catch(()=>{n.clearReset()});function XO(e,t,n){let r=BO(),i=UO(),a=OD(n),o=a.defaultQueryOptions(e),s=a.getQueryCache().get(o.queryHash),c=e.subscribed!==!1;o._optimisticResults=r?`isRestoring`:c?`optimistic`:void 0,qO(o),WO(o,i,s),GO(i);let[l]=M.useState(()=>new t(a,o)),u=l.getOptimisticResult(o),d=!r&&c;if(M.useSyncExternalStore(M.useCallback(e=>{let t=d?l.subscribe(uO.batchCalls(e)):PD;return l.updateResult(),t},[l,d]),()=>l.getCurrentResult(),()=>l.getCurrentResult()),M.useEffect(()=>{l.setOptions(o)},[o,l]),JO(o,u))throw YO(o,l,i);if(KO({result:u,errorResetBoundary:i,throwOnError:o.throwOnError,query:s,suspense:o.suspense}))throw u.error;return o.notifyOnChangeProps?u:l.trackResult(u)}function ZO(e,t){return XO(e,MO,t)}function QO(e,t){let n=t||{};return(e[e.length-1]===``?[...e,``]:e).join((n.padRight?` `:``)+`,`+(n.padLeft===!1?``:` `)).trim()}var $O=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,ek=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,tk={};function nk(e,t){return((t||tk).jsx?ek:$O).test(e)}var rk=/[ \t\n\f\r]/g;function ik(e){return typeof e==`object`?e.type===`text`&&ak(e.value):ak(e)}function ak(e){return e.replace(rk,``)===``}var ok=class{constructor(e,t,n){this.normal=t,this.property=e,n&&(this.space=n)}};ok.prototype.normal={},ok.prototype.property={},ok.prototype.space=void 0;function sk(e,t){let n={},r={};for(let t of e)Object.assign(n,t.property),Object.assign(r,t.normal);return new ok(n,r,t)}function ck(e){return e.toLowerCase()}var lk=class{constructor(e,t){this.attribute=t,this.property=e}};lk.prototype.attribute=``,lk.prototype.booleanish=!1,lk.prototype.boolean=!1,lk.prototype.commaOrSpaceSeparated=!1,lk.prototype.commaSeparated=!1,lk.prototype.defined=!1,lk.prototype.mustUseProperty=!1,lk.prototype.number=!1,lk.prototype.overloadedBoolean=!1,lk.prototype.property=``,lk.prototype.spaceSeparated=!1,lk.prototype.space=void 0;var uk=c({boolean:()=>fk,booleanish:()=>pk,commaOrSpaceSeparated:()=>_k,commaSeparated:()=>gk,number:()=>Q,overloadedBoolean:()=>mk,spaceSeparated:()=>hk}),dk=0,fk=vk(),pk=vk(),mk=vk(),Q=vk(),hk=vk(),gk=vk(),_k=vk();function vk(){return 2**++dk}var yk=Object.keys(uk),bk=class extends lk{constructor(e,t,n,r){let i=-1;if(super(e,t),xk(this,`space`,r),typeof n==`number`)for(;++i4&&n.slice(0,4)===`data`&&Pk.test(t)){if(t.charAt(4)===`-`){let e=t.slice(5).replace(Nk,Lk);r=`data`+e.charAt(0).toUpperCase()+e.slice(1)}else{let e=t.slice(4);if(!Nk.test(e)){let n=e.replace(Mk,Ik);n.charAt(0)!==`-`&&(n=`-`+n),t=`data`+n}}i=bk}return new i(r,t)}function Ik(e){return`-`+e.toLowerCase()}function Lk(e){return e.charAt(1).toUpperCase()}var Rk=sk([Ck,Ek,Ok,kk,Ak],`html`),zk=sk([Ck,Dk,Ok,kk,Ak],`svg`);function Bk(e){return e.join(` `).trim()}var Vk=n(((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})),Hk=n((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(Vk());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}})),Uk=n((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))}})),Wk=n(((e,t)=>{var n=(e&&e.__importDefault||function(e){return e&&e.__esModule?e:{default:e}})(Hk()),r=Uk();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})),Gk=qk(`end`),Kk=qk(`start`);function qk(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 Jk(e){let t=Kk(e),n=Gk(e);if(t&&n)return{start:t,end:n}}function Yk(e){return!e||typeof e!=`object`?``:`position`in e||`type`in e?Zk(e.position):`start`in e||`end`in e?Zk(e):`line`in e||`column`in e?Xk(e):``}function Xk(e){return Qk(e&&e.line)+`:`+Qk(e&&e.column)}function Zk(e){return Xk(e&&e.start)+`-`+Xk(e&&e.end)}function Qk(e){return e&&typeof e==`number`?e:1}var $k=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=Yk(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}};$k.prototype.file=``,$k.prototype.name=``,$k.prototype.reason=``,$k.prototype.message=``,$k.prototype.stack=``,$k.prototype.column=void 0,$k.prototype.line=void 0,$k.prototype.ancestors=void 0,$k.prototype.cause=void 0,$k.prototype.fatal=void 0,$k.prototype.place=void 0,$k.prototype.ruleId=void 0,$k.prototype.source=void 0;var eA=r(Wk(),1),tA={}.hasOwnProperty,nA=new Map,rA=/[A-Z]/g,iA=new Set([`table`,`tbody`,`thead`,`tfoot`,`tr`]),aA=new Set([`td`,`th`]),oA=`https://github.com/syntax-tree/hast-util-to-jsx-runtime`;function sA(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=vA(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=_A(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`?zk:Rk,stylePropertyNameCase:t.stylePropertyNameCase||`dom`,tableCellAlignToStyle:t.tableCellAlignToStyle!==!1},a=cA(i,e,void 0);return a&&typeof a!=`string`?a:i.create(e,i.Fragment,{children:a||void 0},void 0)}function cA(e,t,n){if(t.type===`element`)return lA(e,t,n);if(t.type===`mdxFlowExpression`||t.type===`mdxTextExpression`)return uA(e,t);if(t.type===`mdxJsxFlowElement`||t.type===`mdxJsxTextElement`)return fA(e,t,n);if(t.type===`mdxjsEsm`)return dA(e,t);if(t.type===`root`)return pA(e,t,n);if(t.type===`text`)return mA(e,t)}function lA(e,t,n){let r=e.schema,i=r;t.tagName.toLowerCase()===`svg`&&r.space===`html`&&(i=zk,e.schema=i),e.ancestors.push(t);let a=wA(e,t.tagName,!1),o=yA(e,t),s=xA(e,t);return iA.has(t.tagName)&&(s=s.filter(function(e){return typeof e!=`string`||!ik(e)})),hA(e,o,a,t),gA(o,s),e.ancestors.pop(),e.schema=r,e.create(t,a,o,n)}function uA(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)}TA(e,t.position)}function dA(e,t){if(t.data&&t.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(t.data.estree);TA(e,t.position)}function fA(e,t,n){let r=e.schema,i=r;t.name===`svg`&&r.space===`html`&&(i=zk,e.schema=i),e.ancestors.push(t);let a=t.name===null?e.Fragment:wA(e,t.name,!0),o=bA(e,t),s=xA(e,t);return hA(e,o,a,t),gA(o,s),e.ancestors.pop(),e.schema=r,e.create(t,a,o,n)}function pA(e,t,n){let r={};return gA(r,xA(e,t)),e.create(t,e.Fragment,r,n)}function mA(e,t){return t.value}function hA(e,t,n,r){typeof n!=`string`&&n!==e.Fragment&&e.passNode&&(t.node=r)}function gA(e,t){if(t.length>0){let n=t.length>1?t:t[0];n&&(e.children=n)}}function _A(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 vA(e,t){return n;function n(n,r,i,a){let o=Array.isArray(i.children),s=Kk(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 yA(e,t){let n={},r,i;for(i in t.properties)if(i!==`children`&&tA.call(t.properties,i)){let a=SA(e,i,t.properties[i]);if(a){let[i,o]=a;e.tableCellAlignToStyle&&i===`align`&&typeof o==`string`&&aA.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 bA(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 TA(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 TA(e,t.position)}else a=r.value===null||r.value;n[i]=a}return n}function xA(e,t){let n=[],r=-1,i=e.passKeys?new Map:nA;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?(LA(e,e.length,0,t),e):t}var zA={}.hasOwnProperty;function BA(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 WA(e){return e.replace(/[\t\n\r ]+/g,` `).replace(/^ | $/g,``).toLowerCase().toUpperCase()}var GA=nj(/[A-Za-z]/),KA=nj(/[\dA-Za-z]/),qA=nj(/[#-'*+\--9=?A-Z^-~]/);function JA(e){return e!==null&&(e<32||e===127)}var YA=nj(/\d/),XA=nj(/[\dA-Fa-f]/),ZA=nj(/[!-/:-@[-`{-~]/);function $(e){return e!==null&&e<-2}function QA(e){return e!==null&&(e<0||e===32)}function $A(e){return e===-2||e===-1||e===32}var ej=nj(/\p{P}|\p{S}/u),tj=nj(/\s/);function nj(e){return t;function t(t){return t!==null&&t>-1&&e.test(String.fromCharCode(t))}}function rj(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 ij(e,t,n,r){let i=r?r-1:1/0,a=0;return o;function o(r){return $A(r)?(e.enter(n),s(r)):t(r)}function s(r){return $A(r)&&a++o))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 uj(e,t,n){return ij(e,e.attempt(this.parser.constructs.document,t,n),`linePrefix`,this.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4)}function dj(e){if(e===null||QA(e)||tj(e))return 1;if(ej(e))return 2}function fj(e,t,n){let r=[],i=-1;for(;++i1&&e[n][1].end.offset-e[n][1].start.offset>1?2:1;let d={...e[r][1].end},f={...e[n][1].start};gj(d,-c),gj(f,c),o={type:c>1?`strongSequence`:`emphasisSequence`,start:d,end:{...e[r][1].end}},s={type:c>1?`strongSequence`:`emphasisSequence`,start:{...e[n][1].start},end:f},a={type:c>1?`strongText`:`emphasisText`,start:{...e[r][1].end},end:{...e[n][1].start}},i={type:c>1?`strong`:`emphasis`,start:{...o.start},end:{...s.end}},e[r][1].end={...o.start},e[n][1].start={...s.end},l=[],e[r][1].end.offset-e[r][1].start.offset&&(l=RA(l,[[`enter`,e[r][1],t],[`exit`,e[r][1],t]])),l=RA(l,[[`enter`,i,t],[`enter`,o,t],[`exit`,o,t],[`enter`,a,t]]),l=RA(l,fj(t.parser.constructs.insideSpan.null,e.slice(r+1,n),t)),l=RA(l,[[`exit`,a,t],[`enter`,s,t],[`exit`,s,t],[`exit`,i,t]]),e[n][1].end.offset-e[n][1].start.offset?(u=2,l=RA(l,[[`enter`,e[n][1],t],[`exit`,e[n][1],t]])):u=0,LA(e,r-1,n-r+3,l),n=r+l.length-u-2;break}}for(n=-1;++n0&&$A(t)?ij(e,v,`linePrefix`,a+1)(t):v(t)}function v(t){return t===null||$(t)?e.check(kj,h,b)(t):(e.enter(`codeFlowValue`),y(t))}function y(t){return t===null||$(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`),$A(t)?ij(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`),$A(t)?ij(e,d,`whitespace`)(t):d(t)):n(t)}function d(r){return r===null||$(r)?(e.exit(`codeFencedFence`),t(r)):n(r)}}}function Mj(e,t,n){let r=this;return i;function i(t){return t===null?n(t):(e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),a)}function a(e){return r.parser.lazy[r.now().line]?n(e):t(e)}}var Nj={name:`codeIndented`,tokenize:Fj},Pj={partial:!0,tokenize:Ij};function Fj(e,t,n){let r=this;return i;function i(t){return e.enter(`codeIndented`),ij(e,a,`linePrefix`,5)(t)}function a(e){let t=r.events[r.events.length-1];return t&&t[1].type===`linePrefix`&&t[2].sliceSerialize(t[1],!0).length>=4?o(e):n(e)}function o(t){return t===null?c(t):$(t)?e.attempt(Pj,o,c)(t):(e.enter(`codeFlowValue`),s(t))}function s(t){return t===null||$(t)?(e.exit(`codeFlowValue`),o(t)):(e.consume(t),s)}function c(n){return e.exit(`codeIndented`),t(n)}}function Ij(e,t,n){let r=this;return i;function i(t){return r.parser.lazy[r.now().line]?n(t):$(t)?(e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),i):ij(e,a,`linePrefix`,5)(t)}function a(e){let a=r.events[r.events.length-1];return a&&a[1].type===`linePrefix`&&a[2].sliceSerialize(a[1],!0).length>=4?t(e):$(e)?i(e):n(e)}}var Lj={name:`codeText`,previous:zj,resolve:Rj,tokenize:Bj};function Rj(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&&Hj(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),Hj(this.left,e)}unshift(e){this.setCursor(0),this.right.push(e)}unshiftMany(e){this.setCursor(0),Hj(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 Xj(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||JA(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||$(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||QA(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):$(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||$(t)||s++>999?(e.exit(`chunkString`),u(t)):(e.consume(t),c||=!$A(t),t===92?f:d)}function f(t){return t===91||t===92||t===93?(e.consume(t),s++,d):d(t)}}function Qj(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):$(t)?(e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),ij(e,l,`linePrefix`)):(e.enter(`chunkString`,{contentType:`string`}),u(t))}function u(t){return t===o||t===null||$(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 $j(e,t){let n;return r;function r(i){return $(i)?(e.enter(`lineEnding`),e.consume(i),e.exit(`lineEnding`),n=!0,r):$A(i)?ij(e,r,n?`linePrefix`:`lineSuffix`)(i):t(i)}}var eM={name:`definition`,tokenize:nM},tM={partial:!0,tokenize:rM};function nM(e,t,n){let r=this,i;return a;function a(t){return e.enter(`definition`),o(t)}function o(t){return Zj.call(r,e,s,n,`definitionLabel`,`definitionLabelMarker`,`definitionLabelString`)(t)}function s(t){return i=WA(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 QA(t)?$j(e,l)(t):l(t)}function l(t){return Xj(e,u,n,`definitionDestination`,`definitionDestinationLiteral`,`definitionDestinationLiteralMarker`,`definitionDestinationRaw`,`definitionDestinationString`)(t)}function u(t){return e.attempt(tM,d,d)(t)}function d(t){return $A(t)?ij(e,f,`whitespace`)(t):f(t)}function f(a){return a===null||$(a)?(e.exit(`definition`),r.parser.defined.push(i),t(a)):n(a)}}function rM(e,t,n){return r;function r(t){return QA(t)?$j(e,i)(t):n(t)}function i(t){return Qj(e,a,n,`definitionTitle`,`definitionTitleMarker`,`definitionTitleString`)(t)}function a(t){return $A(t)?ij(e,o,`whitespace`)(t):o(t)}function o(e){return e===null||$(e)?t(e):n(e)}}var iM={name:`hardBreakEscape`,tokenize:aM};function aM(e,t,n){return r;function r(t){return e.enter(`hardBreakEscape`),e.consume(t),i}function i(r){return $(r)?(e.exit(`hardBreakEscape`),t(r)):n(r)}}var oM={name:`headingAtx`,resolve:sM,tokenize:cM};function sM(e,t){let n=e.length-2,r=3,i,a;return 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&&(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`},LA(e,r,n-r+1,[[`enter`,i,t],[`enter`,a,t],[`exit`,a,t],[`exit`,i,t]])),e}function cM(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||QA(t)?(e.exit(`atxHeadingSequence`),s(t)):n(t)}function s(n){return n===35?(e.enter(`atxHeadingSequence`),c(n)):n===null||$(n)?(e.exit(`atxHeading`),t(n)):$A(n)?ij(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||QA(t)?(e.exit(`atxHeadingText`),s(t)):(e.consume(t),l)}}var lM=`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(`.`),uM=[`pre`,`script`,`style`,`textarea`],dM={concrete:!0,name:`htmlFlow`,resolveTo:mM,tokenize:hM},fM={partial:!0,tokenize:_M},pM={partial:!0,tokenize:gM};function mM(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 hM(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:ae):GA(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):GA(a)?(e.consume(a),i=4,r.interrupt?t:ae):n(a)}function p(i){return i===45?(e.consume(i),r.interrupt?t:ae):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 GA(t)?(e.consume(t),o=String.fromCharCode(t),g):n(t)}function g(s){if(s===null||s===47||s===62||QA(s)){let c=s===47,l=o.toLowerCase();return!c&&!a&&uM.includes(l)?(i=1,r.interrupt?t(s):O(s)):lM.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||KA(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 $A(t)?(e.consume(t),v):E(t)}function y(t){return t===47?(e.consume(t),E):t===58||t===95||GA(t)?(e.consume(t),b):$A(t)?(e.consume(t),y):E(t)}function b(t){return t===45||t===46||t===58||t===95||KA(t)?(e.consume(t),b):x(t)}function x(t){return t===61?(e.consume(t),S):$A(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):$A(t)?(e.consume(t),S):w(t)}function C(t){return t===c?(e.consume(t),c=null,T):t===null||$(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||QA(t)?x(t):(e.consume(t),w)}function T(e){return e===47||e===62||$A(e)?y(e):n(e)}function E(t){return t===62?(e.consume(t),D):n(t)}function D(t){return t===null||$(t)?O(t):$A(t)?(e.consume(t),D):n(t)}function O(t){return t===45&&i===2?(e.consume(t),ne):t===60&&i===1?(e.consume(t),re):t===62&&i===4?(e.consume(t),oe):t===63&&i===3?(e.consume(t),ae):t===93&&i===5?(e.consume(t),ie):$(t)&&(i===6||i===7)?(e.exit(`htmlFlowData`),e.check(fM,se,k)(t)):t===null||$(t)?(e.exit(`htmlFlowData`),k(t)):(e.consume(t),O)}function k(t){return e.check(pM,ee,se)(t)}function ee(t){return e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),te}function te(t){return t===null||$(t)?k(t):(e.enter(`htmlFlowData`),O(t))}function ne(t){return t===45?(e.consume(t),ae):O(t)}function re(t){return t===47?(e.consume(t),o=``,A):O(t)}function A(t){if(t===62){let n=o.toLowerCase();return uM.includes(n)?(e.consume(t),oe):O(t)}return GA(t)&&o.length<8?(e.consume(t),o+=String.fromCharCode(t),A):O(t)}function ie(t){return t===93?(e.consume(t),ae):O(t)}function ae(t){return t===62?(e.consume(t),oe):t===45&&i===2?(e.consume(t),ae):O(t)}function oe(t){return t===null||$(t)?(e.exit(`htmlFlowData`),se(t)):(e.consume(t),oe)}function se(n){return e.exit(`htmlFlow`),t(n)}}function gM(e,t,n){let r=this;return i;function i(t){return $(t)?(e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),a):n(t)}function a(e){return r.parser.lazy[r.now().line]?n(e):t(e)}}function _M(e,t,n){return r;function r(r){return e.enter(`lineEnding`),e.consume(r),e.exit(`lineEnding`),e.attempt(yj,t,n)}}var vM={name:`htmlText`,tokenize:yM};function yM(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):GA(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):GA(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):$(t)?(o=d,re(t)):(e.consume(t),d)}function f(t){return t===45?(e.consume(t),p):d(t)}function p(e){return e===62?ne(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):$(t)?(o=h,re(t)):(e.consume(t),h)}function g(t){return t===93?(e.consume(t),_):h(t)}function _(t){return t===62?ne(t):t===93?(e.consume(t),_):h(t)}function v(t){return t===null||t===62?ne(t):$(t)?(o=v,re(t)):(e.consume(t),v)}function y(t){return t===null?n(t):t===63?(e.consume(t),b):$(t)?(o=y,re(t)):(e.consume(t),y)}function b(e){return e===62?ne(e):y(e)}function x(t){return GA(t)?(e.consume(t),S):n(t)}function S(t){return t===45||KA(t)?(e.consume(t),S):C(t)}function C(t){return $(t)?(o=C,re(t)):$A(t)?(e.consume(t),C):ne(t)}function w(t){return t===45||KA(t)?(e.consume(t),w):t===47||t===62||QA(t)?T(t):n(t)}function T(t){return t===47?(e.consume(t),ne):t===58||t===95||GA(t)?(e.consume(t),E):$(t)?(o=T,re(t)):$A(t)?(e.consume(t),T):ne(t)}function E(t){return t===45||t===46||t===58||t===95||KA(t)?(e.consume(t),E):D(t)}function D(t){return t===61?(e.consume(t),O):$(t)?(o=D,re(t)):$A(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):$(t)?(o=O,re(t)):$A(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):$(t)?(o=k,re(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||QA(t)?T(t):(e.consume(t),ee)}function te(e){return e===47||e===62||QA(e)?T(e):n(e)}function ne(r){return r===62?(e.consume(r),e.exit(`htmlTextData`),e.exit(`htmlText`),t):n(r)}function re(t){return e.exit(`htmlTextData`),e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),A}function A(t){return $A(t)?ij(e,ie,`linePrefix`,r.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4)(t):ie(t)}function ie(t){return e.enter(`htmlTextData`),o(t)}}var bM={name:`labelEnd`,resolveAll:wM,resolveTo:TM,tokenize:EM},xM={tokenize:DM},SM={tokenize:OM},CM={tokenize:kM};function wM(e){let t=-1,n=[];for(;++t=3&&(a===null||$(a))?(e.exit(`thematicBreak`),t(a)):n(a)}function c(t){return t===i?(e.consume(t),r++,c):(e.exit(`thematicBreakSequence`),$A(t)?ij(e,s,`whitespace`)(t):s(t))}}var RM={continuation:{tokenize:HM},exit:WM,name:`list`,tokenize:VM},zM={partial:!0,tokenize:GM},BM={partial:!0,tokenize:UM};function VM(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:YA(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(IM,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 YA(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(yj,r.interrupt?n:u,e.attempt(zM,f,d))}function u(e){return r.containerState.initialBlankLine=!0,a++,f(e)}function d(t){return $A(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 HM(e,t,n){let r=this;return r.containerState._closeFlow=void 0,e.check(yj,i,a);function i(n){return r.containerState.furtherBlankLines=r.containerState.furtherBlankLines||r.containerState.initialBlankLine,ij(e,t,`listItemIndent`,r.containerState.size+1)(n)}function a(n){return r.containerState.furtherBlankLines||!$A(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(BM,t,o)(n))}function o(i){return r.containerState._closeFlow=!0,r.interrupt=void 0,ij(e,e.attempt(RM,t,n),`linePrefix`,r.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4)(i)}}function UM(e,t,n){let r=this;return ij(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 WM(e){e.exit(this.containerState.type)}function GM(e,t,n){let r=this;return ij(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!$A(e)&&i&&i[1].type===`listItemPrefixWhitespace`?t(e):n(e)}}var KM={name:`setextUnderline`,resolveTo:qM,tokenize:JM};function qM(e,t){let n=e.length,r,i,a;for(;n--;)if(e[n][0]===`enter`){if(e[n][1].type===`content`){r=n;break}e[n][1].type===`paragraph`&&(i=n)}else e[n][1].type===`content`&&e.splice(n,1),!a&&e[n][1].type===`definition`&&(a=n);let o={type:`setextHeading`,start:{...e[r][1].start},end:{...e[e.length-1][1].end}};return e[i][1].type=`setextHeadingText`,a?(e.splice(i,0,[`enter`,o,t]),e.splice(a+1,0,[`exit`,e[r][1],t]),e[r][1].end={...e[a][1].end}):e[r][1]=o,e.push([`exit`,o,t]),e}function JM(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`),$A(t)?ij(e,c,`lineSuffix`)(t):c(t))}function c(r){return r===null||$(r)?(e.exit(`setextHeadingLine`),t(r)):n(r)}}var YM={tokenize:XM};function XM(e){let t=this,n=e.attempt(yj,r,e.attempt(this.parser.constructs.flowInitial,i,ij(e,e.attempt(this.parser.constructs.flow,i,e.attempt(Gj,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 ZM={resolveAll:tN()},QM=eN(`string`),$M=eN(`text`);function eN(e){return{resolveAll:tN(e===`text`?nN: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(;++idN,contentInitial:()=>aN,disable:()=>fN,document:()=>iN,flow:()=>sN,flowInitial:()=>oN,insideSpan:()=>uN,string:()=>cN,text:()=>lN}),iN={42:RM,43:RM,45:RM,48:RM,49:RM,50:RM,51:RM,52:RM,53:RM,54:RM,55:RM,56:RM,57:RM,62:xj},aN={91:eM},oN={[-2]:Nj,[-1]:Nj,32:Nj},sN={35:oM,42:IM,45:[KM,IM],60:dM,61:KM,95:IM,96:Aj,126:Aj},cN={38:Dj,92:Tj},lN={[-5]:PM,[-4]:PM,[-3]:PM,33:AM,38:Dj,42:pj,60:[_j,vM],91:MM,92:[iM,Tj],93:bM,95:pj,96:Lj},uN={null:[pj,ZM]},dN={null:[42,95]},fN={null:[]};function pN(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=RA(o,e),g(),o[o.length-1]===null?(w(t,0),l.events=fj(a,l.events,l),l.events):[]}function f(e,t){return hN(p(e),t)}function p(e){return mN(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(){let e;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 hN(e,t){let n=-1,r=[],i;for(;++n0){let e=a.tokenStack[a.tokenStack.length-1];(e[1]||kN).call(a,void 0,e[0])}for(r.position={start:EN(e.length>0?e[0][1].start:{line:1,column:1,offset:0}),end:EN(e.length>0?e[e.length-2][1].end:{line:1,column:1,offset:0})},d=-1;++d0&&(r.className=[`language-`+i[0]]);let a={type:`element`,tagName:`code`,properties:r,children:[{type:`text`,value:n}]};return t.meta&&(a.data={meta:t.meta}),e.patch(t,a),a=e.applyData(t,a),a={type:`element`,tagName:`pre`,properties:{},children:[a]},e.patch(t,a),a}function PN(e,t){let n={type:`element`,tagName:`del`,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function FN(e,t){let n={type:`element`,tagName:`em`,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function IN(e,t){let n=typeof e.options.clobberPrefix==`string`?e.options.clobberPrefix:`user-content-`,r=String(t.identifier).toUpperCase(),i=rj(r.toLowerCase()),a=e.footnoteOrder.indexOf(r),o,s=e.footnoteCounts.get(r);s===void 0?(s=0,e.footnoteOrder.push(r),o=e.footnoteOrder.length):o=a+1,s+=1,e.footnoteCounts.set(r,s);let c={type:`element`,tagName:`a`,properties:{href:`#`+n+`fn-`+i,id:n+`fnref-`+i+(s>1?`-`+s:``),dataFootnoteRef:!0,ariaDescribedBy:[`footnote-label`]},children:[{type:`text`,value:String(o)}]};e.patch(t,c);let l={type:`element`,tagName:`sup`,properties:{},children:[c]};return e.patch(t,l),e.applyData(t,l)}function LN(e,t){let n={type:`element`,tagName:`h`+t.depth,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function RN(e,t){if(e.options.allowDangerousHtml){let n={type:`raw`,value:t.value};return e.patch(t,n),e.applyData(t,n)}}function zN(e,t){let n=t.referenceType,r=`]`;if(n===`collapsed`?r+=`[]`:n===`full`&&(r+=`[`+(t.label||t.identifier)+`]`),t.type===`imageReference`)return[{type:`text`,value:`![`+t.alt+r}];let i=e.all(t),a=i[0];a&&a.type===`text`?a.value=`[`+a.value:i.unshift({type:`text`,value:`[`});let o=i[i.length-1];return o&&o.type===`text`?o.value+=r:i.push({type:`text`,value:r}),i}function BN(e,t){let n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return zN(e,t);let i={src:rj(r.url||``),alt:t.alt};r.title!==null&&r.title!==void 0&&(i.title=r.title);let a={type:`element`,tagName:`img`,properties:i,children:[]};return e.patch(t,a),e.applyData(t,a)}function VN(e,t){let n={src:rj(t.url)};t.alt!==null&&t.alt!==void 0&&(n.alt=t.alt),t.title!==null&&t.title!==void 0&&(n.title=t.title);let r={type:`element`,tagName:`img`,properties:n,children:[]};return e.patch(t,r),e.applyData(t,r)}function HN(e,t){let n={type:`text`,value:t.value.replace(/\r?\n|\r/g,` `)};e.patch(t,n);let r={type:`element`,tagName:`code`,properties:{},children:[n]};return e.patch(t,r),e.applyData(t,r)}function UN(e,t){let n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return zN(e,t);let i={href:rj(r.url||``)};r.title!==null&&r.title!==void 0&&(i.title=r.title);let a={type:`element`,tagName:`a`,properties:i,children:e.all(t)};return e.patch(t,a),e.applyData(t,a)}function WN(e,t){let n={href:rj(t.url)};t.title!==null&&t.title!==void 0&&(n.title=t.title);let r={type:`element`,tagName:`a`,properties:n,children:e.all(t)};return e.patch(t,r),e.applyData(t,r)}function GN(e,t,n){let r=e.all(t),i=n?KN(n):qN(t),a={},o=[];if(typeof t.checked==`boolean`){let e=r[0],n;e&&e.type===`element`&&e.tagName===`p`?n=e:(n={type:`element`,tagName:`p`,properties:{},children:[]},r.unshift(n)),n.children.length>0&&n.children.unshift({type:`text`,value:` `}),n.children.unshift({type:`element`,tagName:`input`,properties:{type:`checkbox`,checked:t.checked,disabled:!0},children:[]}),a.className=[`task-list-item`]}let s=-1;for(;++s1}function JN(e,t){let n={},r=e.all(t),i=-1;for(typeof t.start==`number`&&t.start!==1&&(n.start=t.start);++i0){let r={type:`element`,tagName:`tbody`,properties:{},children:e.wrap(n,!0)},a=Kk(t.children[1]),o=Gk(t.children[t.children.length-1]);a&&o&&(r.position={start:a,end:o}),i.push(r)}let a={type:`element`,tagName:`table`,properties:{},children:e.wrap(i,!0)};return e.patch(t,a),e.applyData(t,a)}function $N(e,t,n){let r=n?n.children:void 0,i=(r?r.indexOf(t):1)===0?`th`:`td`,a=n&&n.type===`table`?n.align:void 0,o=a?a.length:t.children.length,s=-1,c=[];for(;++s0,!0),r[0]),i=r.index+r[0].length,r=n.exec(t);return a.push(iP(t.slice(i),i>0,!1)),a.join(``)}function iP(e,t,n){let r=0,i=e.length;if(t){let t=e.codePointAt(r);for(;t===tP||t===nP;)r++,t=e.codePointAt(r)}if(n){let t=e.codePointAt(i-1);for(;t===tP||t===nP;)i--,t=e.codePointAt(i-1)}return i>r?e.slice(r,i):``}function aP(e,t){let n={type:`text`,value:rP(String(t.value))};return e.patch(t,n),e.applyData(t,n)}function oP(e,t){let n={type:`element`,tagName:`hr`,properties:{},children:[]};return e.patch(t,n),e.applyData(t,n)}var sP={blockquote:jN,break:MN,code:NN,delete:PN,emphasis:FN,footnoteReference:IN,heading:LN,html:RN,imageReference:BN,image:VN,inlineCode:HN,linkReference:UN,link:WN,listItem:GN,list:JN,paragraph:YN,root:XN,strong:ZN,table:QN,tableCell:eP,tableRow:$N,text:aP,thematicBreak:oP,toml:cP,yaml:cP,definition:cP,footnoteDefinition:cP};function cP(){}var{defineProperty:lP}=Object,uP=typeof self==`object`?self:globalThis,dP=(e,t)=>{switch(e){case`Function`:case`SharedWorker`:case`Worker`:case`eval`:case`setInterval`:case`setTimeout`:throw TypeError(`unable to deserialize `+e)}return new uP[e](t)},fP=(e,t)=>{let n=(t,n)=>(e.set(n,t),t),r=i=>{if(e.has(i))return e.get(i);let[a,o]=t[i];switch(a){case 0:case-1:return n(o,i);case 1:{let e=n([],i);for(let t of o)e.push(r(t));return e}case 2:{let e=n({},i);for(let[t,n]of o){let i=r(t),a=r(n);i===`__proto__`?lP(e,i,{value:a,configurable:!0,enumerable:!0,writable:!0}):e[i]=a}return e}case 3:return n(new Date(o),i);case 4:{let{source:e,flags:t}=o;return n(new RegExp(e,t),i)}case 5:{let e=n(new Map,i);for(let[t,n]of o)e.set(r(t),r(n));return e}case 6:{let e=n(new Set,i);for(let t of o)e.add(r(t));return e}case 7:{let{name:e,message:t}=o;return n(typeof uP[e]==`function`?dP(e,t):Error(t),i)}case 8:return n(BigInt(o),i);case`BigInt`:return n(Object(BigInt(o)),i);case`ArrayBuffer`:return n(new Uint8Array(o).buffer,o);case`DataView`:{let{buffer:e}=new Uint8Array(o);return n(new DataView(e),o)}case`-0`:return-0}return n(dP(a,o),i)};return r},pP=e=>fP(new Map,e)(0),mP=``,{toString:hP}={},{keys:gP,is:_P}=Object,vP=e=>{let t=typeof e;if(t!==`object`||!e)return[0,t];let n=hP.call(e).slice(8,-1);switch(n){case`Array`:return[1,mP];case`Object`:return[2,mP];case`Date`:return[3,mP];case`RegExp`:return[4,mP];case`Map`:return[5,mP];case`Set`:return[6,mP];case`DataView`:return[1,n]}return n.includes(`Array`)?[1,n]:e instanceof Error?[7,e.name||`Error`]:[2,n]},yP=([e,t])=>e===0&&(t===`function`||t===`symbol`),bP=(e,t,n,r)=>{let i=(e,t)=>{let i=r.push(e)-1;return n.set(t,i),i},a=o=>{if(n.has(o))return n.get(o);let[s,c]=vP(o);switch(s){case 0:{let t=o;switch(c){case`bigint`:s=8,t=o.toString();break;case`number`:if(!o&&_P(o,-0))return r.push([`-0`])-1;break;case`function`:case`symbol`:if(e)throw TypeError(`unable to serialize `+c);t=null;break;case`undefined`:return i([-1],o)}return i([s,t],o)}case 1:{if(c){let e=o;return c===`DataView`?e=new Uint8Array(o.buffer):c===`ArrayBuffer`&&(e=new Uint8Array(o)),i([c,[...e]],o)}let e=[],t=i([s,e],o);for(let t of o)e.push(a(t));return t}case 2:{if(c)switch(c){case`BigInt`:return i([c,o.toString()],o);case`Boolean`:case`Number`:case`String`:return i([c,o.valueOf()],o)}if(t&&`toJSON`in o)return a(o.toJSON());let n=[],r=i([s,n],o);for(let t of gP(o))(e||!yP(vP(o[t])))&&n.push([a(t),a(o[t])]);return r}case 3:return i([s,isNaN(o.getTime())?mP:o.toISOString()],o);case 4:{let{source:e,flags:t}=o;return i([s,{source:e,flags:t}],o)}case 5:{let t=[],n=i([s,t],o);for(let[n,r]of o)(e||!(yP(vP(n))||yP(vP(r))))&&t.push([a(n),a(r)]);return n}case 6:{let t=[],n=i([s,t],o);for(let n of o)(e||!yP(vP(n)))&&t.push(a(n));return n}}let{message:l}=o;return i([s,{name:c,message:l}],o)};return a},xP=(e,{json:t,lossy:n}={})=>{let r=[];return bP(!(t||n),!!t,new Map,r)(e),r},SP=typeof structuredClone==`function`?(e,t)=>t&&(`json`in t||`lossy`in t)?pP(xP(e,t)):structuredClone(e):(e,t)=>pP(xP(e,t));function CP(e,t){let n=[{type:`text`,value:`↩`}];return t>1&&n.push({type:`element`,tagName:`sup`,properties:{},children:[{type:`text`,value:String(t)}]}),n}function wP(e,t){return`Back to reference `+(e+1)+(t>1?`-`+t:``)}function TP(e){let t=typeof e.options.clobberPrefix==`string`?e.options.clobberPrefix:`user-content-`,n=e.options.footnoteBackContent||CP,r=e.options.footnoteBackLabel||wP,i=e.options.footnoteLabel||`Footnotes`,a=e.options.footnoteLabelTagName||`h2`,o=e.options.footnoteLabelProperties||{className:[`sr-only`]},s=[],c=-1;for(;++c0&&d.push({type:`text`,value:` `});let e=typeof n==`string`?n:n(c,u);typeof e==`string`&&(e={type:`text`,value:e}),d.push({type:`element`,tagName:`a`,properties:{href:`#`+t+`fnref-`+l+(u>1?`-`+u:``),dataFootnoteBackref:``,ariaLabel:typeof r==`string`?r:r(c,u),className:[`data-footnote-backref`]},children:Array.isArray(e)?e:[e]})}let p=a[a.length-1];if(p&&p.type===`element`&&p.tagName===`p`){let e=p.children[p.children.length-1];e&&e.type===`text`?e.value+=` `:p.children.push({type:`text`,value:` `}),p.children.push(...d)}else a.push(...d);let m={type:`element`,tagName:`li`,properties:{id:t+`fn-`+l},children:e.wrap(a,!0)};e.patch(i,m),s.push(m)}if(s.length!==0)return{type:`element`,tagName:`section`,properties:{dataFootnotes:!0,className:[`footnotes`]},children:[{type:`element`,tagName:a,properties:{...SP(o),id:`footnote-label`},children:[{type:`text`,value:i}]},{type:`text`,value:` +`},{type:`element`,tagName:`ol`,properties:{},children:e.wrap(s,!0)},{type:`text`,value:` +`}]}}var EP=(function(e){if(e==null)return jP;if(typeof e==`function`)return AP(e);if(typeof e==`object`)return Array.isArray(e)?DP(e):OP(e);if(typeof e==`string`)return kP(e);throw Error(`Expected function, string, or object as test`)});function DP(e){let t=[],n=-1;for(;++n`:``))+`)`})}return u;function u(){let l=PP,u,d,f;if((!t||a(e,i,c[c.length-1]||void 0))&&(l=IP(n(e,c)),l[0]===!1))return l;if(`children`in e&&e.children){let t=e;if(t.children&&l[0]!==`skip`)for(d=(r?t.children.length:-1)+o,f=c.concat(t);d>-1&&d0&&n.push({type:`text`,value:` +`}),n}function GP(e){let t=0,n=e.charCodeAt(t);for(;n===9||n===32;)t++,n=e.charCodeAt(t);return e.slice(t)}function KP(e,t){let n=BP(e,t),r=n.one(e,void 0),i=TP(n),a=Array.isArray(r)?{type:`root`,children:r}:r||{type:`root`,children:[]};return i&&(`children`in a,a.children.push({type:`text`,value:` +`},i)),a}function qP(e,t){return e&&`run`in e?async function(n,r){let i=KP(n,{file:r,...t});await e.run(i,r)}:function(n,r){return KP(n,{file:r,...e||t})}}function JP(e){if(e)throw e}var YP=n(((e,t)=>{var n=Object.prototype.hasOwnProperty,r=Object.prototype.toString,i=Object.defineProperty,a=Object.getOwnPropertyDescriptor,o=function(e){return typeof Array.isArray==`function`?Array.isArray(e):r.call(e)===`[object Array]`},s=function(e){if(!e||r.call(e)!==`[object Object]`)return!1;var t=n.call(e,`constructor`),i=e.constructor&&e.constructor.prototype&&n.call(e.constructor.prototype,`isPrototypeOf`);if(e.constructor&&!t&&!i)return!1;for(var a in e);return a===void 0||n.call(e,a)},c=function(e,t){i&&t.name===`__proto__`?i(e,t.name,{enumerable:!0,configurable:!0,value:t.newValue,writable:!0}):e[t.name]=t.newValue},l=function(e,t){if(t===`__proto__`){if(!n.call(e,t))return;if(a)return a(e,t).value}return e[t]};t.exports=function e(){var t,n,r,i,a,u,d=arguments[0],f=1,p=arguments.length,m=!1;for(typeof d==`boolean`&&(m=d,d=arguments[1]||{},f=2),(d==null||typeof d!=`object`&&typeof d!=`function`)&&(d={});ft.length,o;r&&t.push(i);try{o=e.apply(this,t)}catch(e){let t=e;if(r&&n)throw t;return i(t)}r||(o&&o.then&&typeof o.then==`function`?o.then(a,i):o instanceof Error?i(o):a(o))}function i(e,...r){n||(n=!0,t(e,...r))}function a(e){i(null,e)}}var $P={basename:eF,dirname:tF,extname:nF,join:rF,sep:`/`};function eF(e,t){if(t!==void 0&&typeof t!=`string`)throw TypeError(`"ext" argument must be a string`);oF(e);let n=0,r=-1,i=e.length,a;if(t===void 0||t.length===0||t.length>e.length){for(;i--;)if(e.codePointAt(i)===47){if(a){n=i+1;break}}else r<0&&(a=!0,r=i+1);return r<0?``:e.slice(n,r)}if(t===e)return``;let o=-1,s=t.length-1;for(;i--;)if(e.codePointAt(i)===47){if(a){n=i+1;break}}else o<0&&(a=!0,o=i+1),s>-1&&(e.codePointAt(i)===t.codePointAt(s--)?s<0&&(r=i):(s=-1,r=o));return n===r?r=o:r<0&&(r=e.length),e.slice(n,r)}function tF(e){if(oF(e),e.length===0)return`.`;let t=-1,n=e.length,r;for(;--n;)if(e.codePointAt(n)===47){if(r){t=n;break}}else r||=!0;return t<0?e.codePointAt(0)===47?`/`:`.`:t===1&&e.codePointAt(0)===47?`//`:e.slice(0,t)}function nF(e){oF(e);let t=e.length,n=-1,r=0,i=-1,a=0,o;for(;t--;){let s=e.codePointAt(t);if(s===47){if(o){r=t+1;break}continue}n<0&&(o=!0,n=t+1),s===46?i<0?i=t:a!==1&&(a=1):i>-1&&(a=-1)}return i<0||n<0||a===0||a===1&&i===n-1&&i===r+1?``:e.slice(i,n)}function rF(...e){let t=-1,n;for(;++t0&&e.codePointAt(e.length-1)===47&&(n+=`/`),t?`/`+n:n}function aF(e,t){let n=``,r=0,i=-1,a=0,o=-1,s,c;for(;++o<=e.length;){if(o2){if(c=n.lastIndexOf(`/`),c!==n.length-1){c<0?(n=``,r=0):(n=n.slice(0,c),r=n.length-1-n.lastIndexOf(`/`)),i=o,a=0;continue}}else if(n.length>0){n=``,r=0,i=o,a=0;continue}}t&&(n=n.length>0?n+`/..`:`..`,r=2)}else n.length>0?n+=`/`+e.slice(i+1,o):n=e.slice(i+1,o),r=o-i-1}i=o,a=0}else s===46&&a>-1?a++:a=-1}return n}function oF(e){if(typeof e!=`string`)throw TypeError(`Path must be a string. Received `+JSON.stringify(e))}var sF={cwd:cF};function cF(){return`/`}function lF(e){return!!(typeof e==`object`&&e&&`href`in e&&e.href&&`protocol`in e&&e.protocol&&e.auth===void 0)}function uF(e){if(typeof e==`string`)e=new URL(e);else if(!lF(e)){let t=TypeError('The "path" argument must be of type string or an instance of URL. Received `'+e+"`");throw t.code=`ERR_INVALID_ARG_TYPE`,t}if(e.protocol!==`file:`){let e=TypeError(`The URL must be of scheme file`);throw e.code=`ERR_INVALID_URL_SCHEME`,e}return dF(e)}function dF(e){if(e.hostname!==``){let e=TypeError(`File URL host must be "localhost" or empty on darwin`);throw e.code=`ERR_INVALID_FILE_URL_HOST`,e}let t=e.pathname,n=-1;for(;++n0){let[r,...a]=t,o=n[i][1];XP(o)&&XP(r)&&(r=(0,yF.default)(!0,o,r)),n[i]=[e,r,...a]}}}}().freeze();function SF(e,t){if(typeof t!=`function`)throw TypeError("Cannot `"+e+"` without `parser`")}function CF(e,t){if(typeof t!=`function`)throw TypeError("Cannot `"+e+"` without `compiler`")}function wF(e,t){if(t)throw Error("Cannot call `"+e+"` on a frozen processor.\nCreate a new processor first, by calling it: use `processor()` instead of `processor`.")}function TF(e){if(!XP(e)||typeof e.type!=`string`)throw TypeError("Expected node, got `"+e+"`")}function EF(e,t,n){if(!n)throw Error("`"+e+"` finished async. Use `"+t+"` instead")}function DF(e){return OF(e)?e:new pF(e)}function OF(e){return!!(e&&typeof e==`object`&&`message`in e&&`messages`in e)}function kF(e){return typeof e==`string`||AF(e)}function AF(e){return!!(e&&typeof e==`object`&&`byteLength`in e&&`byteOffset`in e)}var jF=[],MF={allowDangerousHtml:!0},NF=/^(https?|ircs?|mailto|xmpp)$/i,PF=[{from:`astPlugins`,id:`remove-buggy-html-in-markdown-parser`},{from:`allowDangerousHtml`,id:`remove-buggy-html-in-markdown-parser`},{from:`allowNode`,id:`replace-allownode-allowedtypes-and-disallowedtypes`,to:`allowElement`},{from:`allowedTypes`,id:`replace-allownode-allowedtypes-and-disallowedtypes`,to:`allowedElements`},{from:`className`,id:`remove-classname`},{from:`disallowedTypes`,id:`replace-allownode-allowedtypes-and-disallowedtypes`,to:`disallowedElements`},{from:`escapeHtml`,id:`remove-buggy-html-in-markdown-parser`},{from:`includeElementIndex`,id:`#remove-includeelementindex`},{from:`includeNodeIndex`,id:`change-includenodeindex-to-includeelementindex`},{from:`linkTarget`,id:`remove-linktarget`},{from:`plugins`,id:`change-plugins-to-remarkplugins`,to:`remarkPlugins`},{from:`rawSourcePos`,id:`#remove-rawsourcepos`},{from:`renderers`,id:`change-renderers-to-components`,to:`components`},{from:`source`,id:`change-source-to-children`,to:`children`},{from:`sourcePos`,id:`#remove-sourcepos`},{from:`transformImageUri`,id:`#add-urltransform`,to:`urlTransform`},{from:`transformLinkUri`,id:`#add-urltransform`,to:`urlTransform`}];function FF(e){let t=IF(e),n=LF(e);return RF(t.runSync(t.parse(n),n),e)}function IF(e){let t=e.rehypePlugins||jF,n=e.remarkPlugins||jF,r=e.remarkRehypeOptions?{...e.remarkRehypeOptions,...MF}:MF;return xF().use(AN).use(n).use(qP,r).use(t)}function LF(e){let t=e.children||``,n=new pF;return typeof t==`string`?n.value=t:``+t,n}function RF(e,t){let n=t.allowedElements,r=t.allowElement,i=t.components,a=t.disallowedElements,o=t.skipHtml,s=t.unwrapDisallowed,c=t.urlTransform||zF;for(let e of PF)Object.hasOwn(t,e.from)&&``+e.from+(e.to?"use `"+e.to+"` instead":`remove it`)+e.id;return LP(e,l),sA(e,{Fragment:N.Fragment,components:i,ignoreInvalidStyle:!0,jsx:N.jsx,jsxs:N.jsxs,passKeys:!0,passNode:!0});function l(e,t,i){if(e.type===`raw`&&i&&typeof t==`number`)return o?i.children.splice(t,1):i.children[t]={type:`text`,value:e.value},t;if(e.type===`element`){let t;for(t in kA)if(Object.hasOwn(kA,t)&&Object.hasOwn(e.properties,t)){let n=e.properties[t],r=kA[t];(r===null||r.includes(e.tagName))&&(e.properties[t]=c(String(n||``),t,e))}}if(e.type===`element`){let o=n?!n.includes(e.tagName):a?a.includes(e.tagName):!1;if(!o&&r&&typeof t==`number`&&(o=!r(e,t,i)),o&&i&&typeof t==`number`)return s&&e.children?i.children.splice(t,1,...e.children):i.children.splice(t,1),t}}}function zF(e){let t=e.indexOf(`:`),n=e.indexOf(`?`),r=e.indexOf(`#`),i=e.indexOf(`/`);return t===-1||i!==-1&&t>i||n!==-1&&t>n||r!==-1&&t>r||NF.test(e.slice(0,t))?e:``}function BF(e,t){let n=String(e);if(typeof t!=`string`)throw TypeError(`Expected character`);let r=0,i=n.indexOf(t);for(;i!==-1;)r++,i=n.indexOf(t,i+t.length);return r}function VF(e){if(typeof e!=`string`)throw TypeError(`Expected a string`);return e.replace(/[|\\{}()[\]^$+*?.]/g,`\\$&`).replace(/-/g,`\\x2d`)}function HF(e,t,n){let r=EP((n||{}).ignore||[]),i=UF(t),a=-1;for(;++a0?{type:`text`,value:a}:void 0),a===!1?r.lastIndex=n+1:(s!==n&&u.push({type:`text`,value:e.value.slice(s,n)}),Array.isArray(a)?u.push(...a):a&&u.push(a),s=n+d[0].length,l=!0),!r.global)break;d=r.exec(e.value)}return l?(s?\]}]+$/.exec(e);if(!t)return[e,void 0];e=e.slice(0,t.index);let n=t[0],r=n.indexOf(`)`),i=BF(e,`(`),a=BF(e,`)`);for(;r!==-1&&i>a;)e+=n.slice(0,r+1),n=n.slice(r+1),r=n.indexOf(`)`),a++;return[e,n]}function sI(e,t){let n=e.input.charCodeAt(e.index-1);return(e.index===0||tj(n)||ej(n))&&(!t||n!==47)}_I.peek=gI;function cI(){this.buffer()}function lI(e){this.enter({type:`footnoteReference`,identifier:``,label:``},e)}function uI(){this.buffer()}function dI(e){this.enter({type:`footnoteDefinition`,identifier:``,label:``,children:[]},e)}function fI(e){let t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=WA(this.sliceSerialize(e)).toLowerCase(),n.label=t}function pI(e){this.exit(e)}function mI(e){let t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=WA(this.sliceSerialize(e)).toLowerCase(),n.label=t}function hI(e){this.exit(e)}function gI(){return`[`}function _I(e,t,n,r){let i=n.createTracker(r),a=i.move(`[^`),o=n.enter(`footnoteReference`),s=n.enter(`reference`);return a+=i.move(n.safe(n.associationId(e),{after:`]`,before:a})),s(),o(),a+=i.move(`]`),a}function vI(){return{enter:{gfmFootnoteCallString:cI,gfmFootnoteCall:lI,gfmFootnoteDefinitionLabelString:uI,gfmFootnoteDefinition:dI},exit:{gfmFootnoteCallString:fI,gfmFootnoteCall:pI,gfmFootnoteDefinitionLabelString:mI,gfmFootnoteDefinition:hI}}}function yI(e){let t=!1;return e&&e.firstLineBlank&&(t=!0),{handlers:{footnoteDefinition:n,footnoteReference:_I},unsafe:[{character:`[`,inConstruct:[`label`,`phrasing`,`reference`]}]};function n(e,n,r,i){let a=r.createTracker(i),o=a.move(`[^`),s=r.enter(`footnoteDefinition`),c=r.enter(`label`);return o+=a.move(r.safe(r.associationId(e),{before:o,after:`]`})),c(),o+=a.move(`]:`),e.children&&e.children.length>0&&(a.shift(4),o+=a.move((t?` +`:` `)+r.indentLines(r.containerFlow(e,a.current()),t?xI:bI))),s(),o}}function bI(e,t,n){return t===0?e:xI(e,t,n)}function xI(e,t,n){return(n?``:` `)+e}var SI=[`autolink`,`destinationLiteral`,`destinationRaw`,`reference`,`titleQuote`,`titleApostrophe`];DI.peek=OI;function CI(){return{canContainEols:[`delete`],enter:{strikethrough:TI},exit:{strikethrough:EI}}}function wI(){return{unsafe:[{character:`~`,inConstruct:`phrasing`,notInConstruct:SI}],handlers:{delete:DI}}}function TI(e){this.enter({type:`delete`,children:[]},e)}function EI(e){this.exit(e)}function DI(e,t,n,r){let i=n.createTracker(r),a=n.enter(`strikethrough`),o=i.move(`~~`);return o+=n.containerPhrasing(e,{...i.current(),before:o,after:`~`}),o+=i.move(`~~`),a(),o}function OI(){return`~`}function kI(e){return e.length}function AI(e,t){let n=t||{},r=(n.align||[]).concat(),i=n.stringLength||kI,a=[],o=[],s=[],c=[],l=0,u=-1;for(;++ul&&(l=e[u].length);++ac[a])&&(c[a]=e)}t.push(o)}o[u]=t,s[u]=r}let d=-1;if(typeof r==`object`&&`length`in r)for(;++dc[d]&&(c[d]=i),p[d]=i),f[d]=o}o.splice(1,0,f),s.splice(1,0,p),u=-1;let m=[];for(;++u `),a.shift(2);let o=n.indentLines(n.containerFlow(e,a.current()),PI);return i(),o}function PI(e,t,n){return`>`+(n?``:` `)+e}function FI(e,t){return II(e,t.inConstruct,!0)&&!II(e,t.notInConstruct,!1)}function II(e,t,n){if(typeof t==`string`&&(t=[t]),!t||t.length===0)return n;let r=-1;for(;++ro&&(o=a):a=1,i=r+t.length,r=n.indexOf(t,i);return o}function zI(e,t){return!(t.options.fences!==!1||!e.value||e.lang||!/[^ \r\n]/.test(e.value)||/^[\t ]*(?:[\r\n]|$)|(?:^|[\r\n])[\t ]*$/.test(e.value))}function BI(e){let t=e.options.fence||"`";if(t!=="`"&&t!==`~`)throw Error("Cannot serialize code with `"+t+"` for `options.fence`, expected `` ` `` or `~`");return t}function VI(e,t,n,r){let i=BI(n),a=e.value||``,o=i==="`"?`GraveAccent`:`Tilde`;if(zI(e,n)){let e=n.enter(`codeIndented`),t=n.indentLines(a,HI);return e(),t}let s=n.createTracker(r),c=i.repeat(Math.max(RI(a,i)+1,3)),l=n.enter(`codeFenced`),u=s.move(c);if(e.lang){let t=n.enter(`codeFencedLang${o}`);u+=s.move(n.safe(e.lang,{before:u,after:` `,encode:["`"],...s.current()})),t()}if(e.lang&&e.meta){let t=n.enter(`codeFencedMeta${o}`);u+=s.move(` `),u+=s.move(n.safe(e.meta,{before:u,after:` +`,encode:["`"],...s.current()})),t()}return u+=s.move(` +`),a&&(u+=s.move(a+` +`)),u+=s.move(c),l(),u}function HI(e,t,n){return(n?``:` `)+e}function UI(e){let t=e.options.quote||`"`;if(t!==`"`&&t!==`'`)throw Error("Cannot serialize title with `"+t+"` for `options.quote`, expected `\"`, or `'`");return t}function WI(e,t,n,r){let i=UI(n),a=i===`"`?`Quote`:`Apostrophe`,o=n.enter(`definition`),s=n.enter(`label`),c=n.createTracker(r),l=c.move(`[`);return l+=c.move(n.safe(n.associationId(e),{before:l,after:`]`,...c.current()})),l+=c.move(`]: `),s(),!e.url||/[\0- \u007F]/.test(e.url)?(s=n.enter(`destinationLiteral`),l+=c.move(`<`),l+=c.move(n.safe(e.url,{before:l,after:`>`,...c.current()})),l+=c.move(`>`)):(s=n.enter(`destinationRaw`),l+=c.move(n.safe(e.url,{before:l,after:e.title?` `:` +`,...c.current()}))),s(),e.title&&(s=n.enter(`title${a}`),l+=c.move(` `+i),l+=c.move(n.safe(e.title,{before:l,after:i,...c.current()})),l+=c.move(i),s()),o(),l}function GI(e){let t=e.options.emphasis||`*`;if(t!==`*`&&t!==`_`)throw Error("Cannot serialize emphasis with `"+t+"` for `options.emphasis`, expected `*`, or `_`");return t}function KI(e){return`&#x`+e.toString(16).toUpperCase()+`;`}function qI(e,t,n){let r=dj(e),i=dj(t);return r===void 0?i===void 0?n===`_`?{inside:!0,outside:!0}:{inside:!1,outside:!1}:i===1?{inside:!0,outside:!0}:{inside:!1,outside:!0}:r===1?i===void 0?{inside:!1,outside:!1}:i===1?{inside:!0,outside:!0}:{inside:!1,outside:!1}:i===void 0?{inside:!1,outside:!1}:i===1?{inside:!0,outside:!1}:{inside:!1,outside:!1}}JI.peek=YI;function JI(e,t,n,r){let i=GI(n),a=n.enter(`emphasis`),o=n.createTracker(r),s=o.move(i),c=o.move(n.containerPhrasing(e,{after:i,before:s,...o.current()})),l=c.charCodeAt(0),u=qI(r.before.charCodeAt(r.before.length-1),l,i);u.inside&&(c=KI(l)+c.slice(1));let d=c.charCodeAt(c.length-1),f=qI(r.after.charCodeAt(0),d,i);f.inside&&(c=c.slice(0,-1)+KI(d));let p=o.move(i);return a(),n.attentionEncodeSurroundingInfo={after:f.outside,before:u.outside},s+c+p}function YI(e,t,n){return n.options.emphasis||`*`}function XI(e,t){let n=!1;return LP(e,function(e){if(`value`in e&&/\r?\n|\r/.test(e.value)||e.type===`break`)return n=!0,!1}),!!((!e.depth||e.depth<3)&&jA(e)&&(t.options.setext||n))}function ZI(e,t,n,r){let i=Math.max(Math.min(6,e.depth||1),1),a=n.createTracker(r);if(XI(e,n)){let t=n.enter(`headingSetext`),r=n.enter(`phrasing`),o=n.containerPhrasing(e,{...a.current(),before:` +`,after:` +`});return r(),t(),o+` +`+(i===1?`=`:`-`).repeat(o.length-(Math.max(o.lastIndexOf(`\r`),o.lastIndexOf(` +`))+1))}let o=`#`.repeat(i),s=n.enter(`headingAtx`),c=n.enter(`phrasing`);a.move(o+` `);let l=n.containerPhrasing(e,{before:`# `,after:` +`,...a.current()});return/^[\t ]/.test(l)&&(l=KI(l.charCodeAt(0))+l.slice(1)),l=l?o+` `+l:o,n.options.closeAtx&&(l+=` `+o),c(),s(),l}QI.peek=$I;function QI(e){return e.value||``}function $I(){return`<`}eL.peek=tL;function eL(e,t,n,r){let i=UI(n),a=i===`"`?`Quote`:`Apostrophe`,o=n.enter(`image`),s=n.enter(`label`),c=n.createTracker(r),l=c.move(`![`);return l+=c.move(n.safe(e.alt,{before:l,after:`]`,...c.current()})),l+=c.move(`](`),s(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(s=n.enter(`destinationLiteral`),l+=c.move(`<`),l+=c.move(n.safe(e.url,{before:l,after:`>`,...c.current()})),l+=c.move(`>`)):(s=n.enter(`destinationRaw`),l+=c.move(n.safe(e.url,{before:l,after:e.title?` `:`)`,...c.current()}))),s(),e.title&&(s=n.enter(`title${a}`),l+=c.move(` `+i),l+=c.move(n.safe(e.title,{before:l,after:i,...c.current()})),l+=c.move(i),s()),l+=c.move(`)`),o(),l}function tL(){return`!`}nL.peek=rL;function nL(e,t,n,r){let i=e.referenceType,a=n.enter(`imageReference`),o=n.enter(`label`),s=n.createTracker(r),c=s.move(`![`),l=n.safe(e.alt,{before:c,after:`]`,...s.current()});c+=s.move(l+`][`),o();let u=n.stack;n.stack=[],o=n.enter(`reference`);let d=n.safe(n.associationId(e),{before:c,after:`]`,...s.current()});return o(),n.stack=u,a(),i===`full`||!l||l!==d?c+=s.move(d+`]`):i===`shortcut`?c=c.slice(0,-1):c+=s.move(`]`),c}function rL(){return`!`}iL.peek=aL;function iL(e,t,n){let r=e.value||``,i="`",a=-1;for(;RegExp("(^|[^`])"+i+"([^`]|$)").test(r);)i+="`";for(/[^ \r\n]/.test(r)&&(/^[ \r\n]/.test(r)&&/[ \r\n]$/.test(r)||/^`|`$/.test(r))&&(r=` `+r+` `);++a\u007F]/.test(e.url))}sL.peek=cL;function sL(e,t,n,r){let i=UI(n),a=i===`"`?`Quote`:`Apostrophe`,o=n.createTracker(r),s,c;if(oL(e,n)){let t=n.stack;n.stack=[],s=n.enter(`autolink`);let r=o.move(`<`);return r+=o.move(n.containerPhrasing(e,{before:r,after:`>`,...o.current()})),r+=o.move(`>`),s(),n.stack=t,r}s=n.enter(`link`),c=n.enter(`label`);let l=o.move(`[`);return l+=o.move(n.containerPhrasing(e,{before:l,after:`](`,...o.current()})),l+=o.move(`](`),c(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(c=n.enter(`destinationLiteral`),l+=o.move(`<`),l+=o.move(n.safe(e.url,{before:l,after:`>`,...o.current()})),l+=o.move(`>`)):(c=n.enter(`destinationRaw`),l+=o.move(n.safe(e.url,{before:l,after:e.title?` `:`)`,...o.current()}))),c(),e.title&&(c=n.enter(`title${a}`),l+=o.move(` `+i),l+=o.move(n.safe(e.title,{before:l,after:i,...o.current()})),l+=o.move(i),c()),l+=o.move(`)`),s(),l}function cL(e,t,n){return oL(e,n)?`<`:`[`}lL.peek=uL;function lL(e,t,n,r){let i=e.referenceType,a=n.enter(`linkReference`),o=n.enter(`label`),s=n.createTracker(r),c=s.move(`[`),l=n.containerPhrasing(e,{before:c,after:`]`,...s.current()});c+=s.move(l+`][`),o();let u=n.stack;n.stack=[],o=n.enter(`reference`);let d=n.safe(n.associationId(e),{before:c,after:`]`,...s.current()});return o(),n.stack=u,a(),i===`full`||!l||l!==d?c+=s.move(d+`]`):i===`shortcut`?c=c.slice(0,-1):c+=s.move(`]`),c}function uL(){return`[`}function dL(e){let t=e.options.bullet||`*`;if(t!==`*`&&t!==`+`&&t!==`-`)throw Error("Cannot serialize items with `"+t+"` for `options.bullet`, expected `*`, `+`, or `-`");return t}function fL(e){let t=dL(e),n=e.options.bulletOther;if(!n)return t===`*`?`-`:`*`;if(n!==`*`&&n!==`+`&&n!==`-`)throw Error("Cannot serialize items with `"+n+"` for `options.bulletOther`, expected `*`, `+`, or `-`");if(n===t)throw Error("Expected `bullet` (`"+t+"`) and `bulletOther` (`"+n+"`) to be different");return n}function pL(e){let t=e.options.bulletOrdered||`.`;if(t!==`.`&&t!==`)`)throw Error("Cannot serialize items with `"+t+"` for `options.bulletOrdered`, expected `.` or `)`");return t}function mL(e){let t=e.options.rule||`*`;if(t!==`*`&&t!==`-`&&t!==`_`)throw Error("Cannot serialize rules with `"+t+"` for `options.rule`, expected `*`, `-`, or `_`");return t}function hL(e,t,n,r){let i=n.enter(`list`),a=n.bulletCurrent,o=e.ordered?pL(n):dL(n),s=e.ordered?o===`.`?`)`:`.`:fL(n),c=t&&n.bulletLastUsed?o===n.bulletLastUsed:!1;if(!e.ordered){let t=e.children?e.children[0]:void 0;if((o===`*`||o===`-`)&&t&&(!t.children||!t.children[0])&&n.stack[n.stack.length-1]===`list`&&n.stack[n.stack.length-2]===`listItem`&&n.stack[n.stack.length-3]===`list`&&n.stack[n.stack.length-4]===`listItem`&&n.indexStack[n.indexStack.length-1]===0&&n.indexStack[n.indexStack.length-2]===0&&n.indexStack[n.indexStack.length-3]===0&&(c=!0),mL(n)===o&&t){let t=-1;for(;++t-1?t.start:1)+(n.options.incrementListMarker===!1?0:t.children.indexOf(e))+a);let o=a.length+1;(i===`tab`||i===`mixed`&&(t&&t.type===`list`&&t.spread||e.spread))&&(o=Math.ceil(o/4)*4);let s=n.createTracker(r);s.move(a+` `.repeat(o-a.length)),s.shift(o);let c=n.enter(`listItem`),l=n.indentLines(n.containerFlow(e,s.current()),u);return c(),l;function u(e,t,n){return t?(n?``:` `.repeat(o))+e:(n?a:a+` `.repeat(o-a.length))+e}}function vL(e,t,n,r){let i=n.enter(`paragraph`),a=n.enter(`phrasing`),o=n.containerPhrasing(e,r);return a(),i(),o}var yL=EP([`break`,`delete`,`emphasis`,`footnote`,`footnoteReference`,`image`,`imageReference`,`inlineCode`,`inlineMath`,`link`,`linkReference`,`mdxJsxTextElement`,`mdxTextExpression`,`strong`,`text`,`textDirective`]);function bL(e,t,n,r){return(e.children.some(function(e){return yL(e)})?n.containerPhrasing:n.containerFlow).call(n,e,r)}function xL(e){let t=e.options.strong||`*`;if(t!==`*`&&t!==`_`)throw Error("Cannot serialize strong with `"+t+"` for `options.strong`, expected `*`, or `_`");return t}SL.peek=CL;function SL(e,t,n,r){let i=xL(n),a=n.enter(`strong`),o=n.createTracker(r),s=o.move(i+i),c=o.move(n.containerPhrasing(e,{after:i,before:s,...o.current()})),l=c.charCodeAt(0),u=qI(r.before.charCodeAt(r.before.length-1),l,i);u.inside&&(c=KI(l)+c.slice(1));let d=c.charCodeAt(c.length-1),f=qI(r.after.charCodeAt(0),d,i);f.inside&&(c=c.slice(0,-1)+KI(d));let p=o.move(i+i);return a(),n.attentionEncodeSurroundingInfo={after:f.outside,before:u.outside},s+c+p}function CL(e,t,n){return n.options.strong||`*`}function wL(e,t,n,r){return n.safe(e.value,r)}function TL(e){let t=e.options.ruleRepetition||3;if(t<3)throw Error("Cannot serialize rules with repetition `"+t+"` for `options.ruleRepetition`, expected `3` or more");return t}function EL(e,t,n){let r=(mL(n)+(n.options.ruleSpaces?` `:``)).repeat(TL(n));return n.options.ruleSpaces?r.slice(0,-1):r}var DL={blockquote:NI,break:LI,code:VI,definition:WI,emphasis:JI,hardBreak:LI,heading:ZI,html:QI,image:eL,imageReference:nL,inlineCode:iL,link:sL,linkReference:lL,list:hL,listItem:_L,paragraph:vL,root:bL,strong:SL,text:wL,thematicBreak:EL};function OL(){return{enter:{table:kL,tableData:NL,tableHeader:NL,tableRow:jL},exit:{codeText:PL,table:AL,tableData:ML,tableHeader:ML,tableRow:ML}}}function kL(e){let t=e._align;this.enter({type:`table`,align:t.map(function(e){return e===`none`?null:e}),children:[]},e),this.data.inTable=!0}function AL(e){this.exit(e),this.data.inTable=void 0}function jL(e){this.enter({type:`tableRow`,children:[]},e)}function ML(e){this.exit(e)}function NL(e){this.enter({type:`tableCell`,children:[]},e)}function PL(e){let t=this.resume();this.data.inTable&&(t=t.replace(/\\([\\|])/g,FL));let n=this.stack[this.stack.length-1];n.type,n.value=t,this.exit(e)}function FL(e,t){return t===`|`?t:e}function IL(e){let t=e||{},n=t.tableCellPadding,r=t.tablePipeAlign,i=t.stringLength,a=n?` `:`|`;return{unsafe:[{character:`\r`,inConstruct:`tableCell`},{character:` +`,inConstruct:`tableCell`},{atBreak:!0,character:`|`,after:`[ :-]`},{character:`|`,inConstruct:`tableCell`},{atBreak:!0,character:`:`,after:`-`},{atBreak:!0,character:`-`,after:`[:|-]`}],handlers:{inlineCode:f,table:o,tableCell:c,tableRow:s}};function o(e,t,n,r){return l(u(e,n,r),e.align)}function s(e,t,n,r){let i=l([d(e,n,r)]);return i.slice(0,i.indexOf(` +`))}function c(e,t,n,r){let i=n.enter(`tableCell`),o=n.enter(`phrasing`),s=n.containerPhrasing(e,{...r,before:a,after:a});return o(),i(),s}function l(e,t){return AI(e,{align:t,alignDelimiters:r,padding:n,stringLength:i})}function u(e,t,n){let r=e.children,i=-1,a=[],o=t.enter(`table`);for(;++i0&&!n&&(e[e.length-1][1]._gfmAutolinkLiteralWalkedInto=!0),n}var mR={tokenize:SR,partial:!0};function hR(){return{document:{91:{name:`gfmFootnoteDefinition`,tokenize:yR,continuation:{tokenize:bR},exit:xR}},text:{91:{name:`gfmFootnoteCall`,tokenize:vR},93:{name:`gfmPotentialFootnoteCall`,add:`after`,tokenize:gR,resolveTo:_R}}}}function gR(e,t,n){let r=this,i=r.events.length,a=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]),o;for(;i--;){let e=r.events[i][1];if(e.type===`labelImage`){o=e;break}if(e.type===`gfmFootnoteCall`||e.type===`labelLink`||e.type===`label`||e.type===`image`||e.type===`link`)break}return s;function s(i){if(!o||!o._balanced)return n(i);let s=WA(r.sliceSerialize({start:o.end,end:r.now()}));return s.codePointAt(0)!==94||!a.includes(s.slice(1))?n(i):(e.enter(`gfmFootnoteCallLabelMarker`),e.consume(i),e.exit(`gfmFootnoteCallLabelMarker`),t(i))}}function _R(e,t){let n=e.length;for(;n--;)if(e[n][1].type===`labelImage`&&e[n][0]===`enter`){e[n][1];break}e[n+1][1].type=`data`,e[n+3][1].type=`gfmFootnoteCallLabelMarker`;let r={type:`gfmFootnoteCall`,start:Object.assign({},e[n+3][1].start),end:Object.assign({},e[e.length-1][1].end)},i={type:`gfmFootnoteCallMarker`,start:Object.assign({},e[n+3][1].end),end:Object.assign({},e[n+3][1].end)};i.end.column++,i.end.offset++,i.end._bufferIndex++;let a={type:`gfmFootnoteCallString`,start:Object.assign({},i.end),end:Object.assign({},e[e.length-1][1].start)},o={type:`chunkString`,contentType:`string`,start:Object.assign({},a.start),end:Object.assign({},a.end)},s=[e[n+1],e[n+2],[`enter`,r,t],e[n+3],e[n+4],[`enter`,i,t],[`exit`,i,t],[`enter`,a,t],[`enter`,o,t],[`exit`,o,t],[`exit`,a,t],e[e.length-2],e[e.length-1],[`exit`,r,t]];return e.splice(n,e.length-n+1,...s),e}function vR(e,t,n){let r=this,i=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]),a=0,o;return s;function s(t){return e.enter(`gfmFootnoteCall`),e.enter(`gfmFootnoteCallLabelMarker`),e.consume(t),e.exit(`gfmFootnoteCallLabelMarker`),c}function c(t){return t===94?(e.enter(`gfmFootnoteCallMarker`),e.consume(t),e.exit(`gfmFootnoteCallMarker`),e.enter(`gfmFootnoteCallString`),e.enter(`chunkString`).contentType=`string`,l):n(t)}function l(s){if(a>999||s===93&&!o||s===null||s===91||QA(s))return n(s);if(s===93){e.exit(`chunkString`);let a=e.exit(`gfmFootnoteCallString`);return i.includes(WA(r.sliceSerialize(a)))?(e.enter(`gfmFootnoteCallLabelMarker`),e.consume(s),e.exit(`gfmFootnoteCallLabelMarker`),e.exit(`gfmFootnoteCall`),t):n(s)}return QA(s)||(o=!0),a++,e.consume(s),s===92?u:l}function u(t){return t===91||t===92||t===93?(e.consume(t),a++,l):l(t)}}function yR(e,t,n){let r=this,i=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]),a,o=0,s;return c;function c(t){return e.enter(`gfmFootnoteDefinition`)._container=!0,e.enter(`gfmFootnoteDefinitionLabel`),e.enter(`gfmFootnoteDefinitionLabelMarker`),e.consume(t),e.exit(`gfmFootnoteDefinitionLabelMarker`),l}function l(t){return t===94?(e.enter(`gfmFootnoteDefinitionMarker`),e.consume(t),e.exit(`gfmFootnoteDefinitionMarker`),e.enter(`gfmFootnoteDefinitionLabelString`),e.enter(`chunkString`).contentType=`string`,u):n(t)}function u(t){if(o>999||t===93&&!s||t===null||t===91||QA(t))return n(t);if(t===93){e.exit(`chunkString`);let n=e.exit(`gfmFootnoteDefinitionLabelString`);return a=WA(r.sliceSerialize(n)),e.enter(`gfmFootnoteDefinitionLabelMarker`),e.consume(t),e.exit(`gfmFootnoteDefinitionLabelMarker`),e.exit(`gfmFootnoteDefinitionLabel`),f}return QA(t)||(s=!0),o++,e.consume(t),t===92?d:u}function d(t){return t===91||t===92||t===93?(e.consume(t),o++,u):u(t)}function f(t){return t===58?(e.enter(`definitionMarker`),e.consume(t),e.exit(`definitionMarker`),i.includes(a)||i.push(a),ij(e,p,`gfmFootnoteDefinitionWhitespace`)):n(t)}function p(e){return t(e)}}function bR(e,t,n){return e.check(yj,t,e.attempt(mR,t,n))}function xR(e){e.exit(`gfmFootnoteDefinition`)}function SR(e,t,n){let r=this;return ij(e,i,`gfmFootnoteDefinitionIndent`,5);function i(e){let i=r.events[r.events.length-1];return i&&i[1].type===`gfmFootnoteDefinitionIndent`&&i[2].sliceSerialize(i[1],!0).length===4?t(e):n(e)}}function CR(e){let t=(e||{}).singleTilde,n={name:`strikethrough`,tokenize:i,resolveAll:r};return t??=!0,{text:{126:n},insideSpan:{null:[n]},attentionMarkers:{null:[126]}};function r(e,t){let n=-1;for(;++n1?r(a):(e.consume(a),o++,c);if(o<2&&!t)return r(a);let l=e.exit(`strikethroughSequenceTemporary`),u=dj(a);return l._open=!u||u===2&&!!s,l._close=!s||s===2&&!!u,n(a)}}}var wR=class{constructor(){this.map=[]}add(e,t,n){TR(this,e,t,n)}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}};function TR(e,t,n,r){let i=0;if(n!==0||r.length!==0){for(;i-1;){let e=r.events[t][1].type;if(e===`lineEnding`||e===`linePrefix`)t--;else break}let i=t>-1?r.events[t][1].type:null,a=i===`tableHead`||i===`tableRow`?S:c;return a===S&&r.parser.lazy[r.now().line]?n(e):a(e)}function c(t){return e.enter(`tableHead`),e.enter(`tableRow`),l(t)}function l(e){return e===124?u(e):(o=!0,a+=1,u(e))}function u(t){return t===null?n(t):$(t)?a>1?(a=0,r.interrupt=!0,e.exit(`tableRow`),e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),p):n(t):$A(t)?ij(e,u,`whitespace`)(t):(a+=1,o&&(o=!1,i+=1),t===124?(e.enter(`tableCellDivider`),e.consume(t),e.exit(`tableCellDivider`),o=!0,u):(e.enter(`data`),d(t)))}function d(t){return t===null||t===124||QA(t)?(e.exit(`data`),u(t)):(e.consume(t),t===92?f:d)}function f(t){return t===92||t===124?(e.consume(t),d):d(t)}function p(t){return r.interrupt=!1,r.parser.lazy[r.now().line]?n(t):(e.enter(`tableDelimiterRow`),o=!1,$A(t)?ij(e,m,`linePrefix`,r.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4)(t):m(t))}function m(t){return t===45||t===58?g(t):t===124?(o=!0,e.enter(`tableCellDivider`),e.consume(t),e.exit(`tableCellDivider`),h):x(t)}function h(t){return $A(t)?ij(e,g,`whitespace`)(t):g(t)}function g(t){return t===58?(a+=1,o=!0,e.enter(`tableDelimiterMarker`),e.consume(t),e.exit(`tableDelimiterMarker`),_):t===45?(a+=1,_(t)):t===null||$(t)?b(t):x(t)}function _(t){return t===45?(e.enter(`tableDelimiterFiller`),v(t)):x(t)}function v(t){return t===45?(e.consume(t),v):t===58?(o=!0,e.exit(`tableDelimiterFiller`),e.enter(`tableDelimiterMarker`),e.consume(t),e.exit(`tableDelimiterMarker`),y):(e.exit(`tableDelimiterFiller`),y(t))}function y(t){return $A(t)?ij(e,b,`whitespace`)(t):b(t)}function b(n){return n===124?m(n):n===null||$(n)?!o||i!==a?x(n):(e.exit(`tableDelimiterRow`),e.exit(`tableHead`),t(n)):x(n)}function x(e){return n(e)}function S(t){return e.enter(`tableRow`),C(t)}function C(n){return n===124?(e.enter(`tableCellDivider`),e.consume(n),e.exit(`tableCellDivider`),C):n===null||$(n)?(e.exit(`tableRow`),t(n)):$A(n)?ij(e,C,`whitespace`)(n):(e.enter(`data`),w(n))}function w(t){return t===null||t===124||QA(t)?(e.exit(`data`),C(t)):(e.consume(t),t===92?T:w)}function T(t){return t===92||t===124?(e.consume(t),w):w(t)}}function kR(e,t){let n=-1,r=!0,i=0,a=[0,0,0,0],o=[0,0,0,0],s=!1,c=0,l,u,d,f=new wR;for(;++nn[2]+1){let t=n[2]+1,r=n[3]-n[2]-1;e.add(t,r,[])}}e.add(n[3]+1,0,[[`exit`,o,t]])}return i!==void 0&&(a.end=Object.assign({},MR(t.events,i)),e.add(i,0,[[`exit`,a,t]]),a=void 0),a}function jR(e,t,n,r,i){let a=[],o=MR(t.events,n);i&&(i.end=Object.assign({},o),a.push([`exit`,i,t])),r.end=Object.assign({},o),a.push([`exit`,r,t]),e.add(n+1,0,a)}function MR(e,t){let n=e[t],r=n[0]===`enter`?`start`:`end`;return n[1][r]}var NR={name:`tasklistCheck`,tokenize:FR};function PR(){return{text:{91:NR}}}function FR(e,t,n){let r=this;return i;function i(t){return r.previous!==null||!r._gfmTasklistFirstContentOfListItem?n(t):(e.enter(`taskListCheck`),e.enter(`taskListCheckMarker`),e.consume(t),e.exit(`taskListCheckMarker`),a)}function a(t){return QA(t)?(e.enter(`taskListCheckValueUnchecked`),e.consume(t),e.exit(`taskListCheckValueUnchecked`),o):t===88||t===120?(e.enter(`taskListCheckValueChecked`),e.consume(t),e.exit(`taskListCheckValueChecked`),o):n(t)}function o(t){return t===93?(e.enter(`taskListCheckMarker`),e.consume(t),e.exit(`taskListCheckMarker`),e.exit(`taskListCheck`),s):n(t)}function s(r){return $(r)?t(r):$A(r)?e.check({tokenize:IR},t,n)(r):n(r)}}function IR(e,t,n){return ij(e,r,`whitespace`);function r(e){return e===null?n(e):t(e)}}function LR(e){return BA([$L(),hR(),CR(e),DR(),PR()])}var RR={};function zR(e){let t=this,n=e||RR,r=t.data(),i=r.micromarkExtensions||=[],a=r.fromMarkdownExtensions||=[],o=r.toMarkdownExtensions||=[];i.push(LR(n)),a.push(HL()),o.push(UL(n))}var BR=[`agent-threads`];async function VR(e,t){let n=new URLSearchParams({limit:`30`});e&&n.set(`q`,e),t&&n.set(`cursor`,t);let r=await ve(`/api/agent/threads?${n}`);if(!r.ok)throw Error(`Unable to load conversations (${r.status})`);return r.json()}function HR({opened:e,activeThreadID:t,onClose:n,onNewChat:r,onSelect:i,onDeleted:a}){let o=Me(`(max-width: 48em)`),s=OD(),[c,l]=(0,M.useState)(``),[u]=Ha(c.trim(),250),[d,f]=(0,M.useState)(null),[p,m]=(0,M.useState)(null),[g,_]=(0,M.useState)(``),[v,y]=(0,M.useState)(``),[b,x]=(0,M.useState)(!1),S=(0,M.useRef)(null),C=ZO({queryKey:[...BR,u],queryFn:({pageParam:e})=>VR(u,e),initialPageParam:``,getNextPageParam:e=>e.nextCursor||void 0,enabled:e}),w=(0,M.useMemo)(()=>C.data?.pages.flatMap(e=>e.threads)??[],[C.data]),T=(0,M.useMemo)(()=>GR(w),[w]);(0,M.useEffect)(()=>{e&&requestAnimationFrame(()=>S.current?.focus())},[e]);function E(e){y(``),_(e.title),f(e)}async function D(){if(d&&g.trim()){x(!0),y(``);try{let e=await ve(`/api/agent/threads/${encodeURIComponent(d.threadId)}`,{method:`PATCH`,headers:{"Content-Type":`application/json`},body:JSON.stringify({title:g.trim()})});if(!e.ok)throw Error(`Unable to rename conversation (${e.status})`);await s.invalidateQueries({queryKey:BR}),f(null)}catch(e){y(e instanceof Error?e.message:`Unable to rename this conversation.`)}finally{x(!1)}}}async function O(){if(p){x(!0),y(``);try{let e=await ve(`/api/agent/threads/${encodeURIComponent(p.threadId)}`,{method:`DELETE`});if(!e.ok)throw Error(`Unable to delete conversation (${e.status})`);let t=p.threadId;m(null),await s.invalidateQueries({queryKey:BR}),a(t)}catch(e){y(e instanceof Error?e.message:`Unable to delete this conversation.`)}finally{x(!1)}}}return(0,N.jsxs)(N.Fragment,{children:[(0,N.jsx)(zm,{opened:e,onClose:n,position:`left`,size:o?`100%`:372,title:(0,N.jsx)(Ce,{fw:700,children:`Investigations`}),padding:`md`,overlayProps:{backgroundOpacity:.24,blur:1},children:(0,N.jsxs)(Le,{gap:`sm`,h:`calc(100dvh - 86px)`,children:[(0,N.jsx)(Oe,{leftSection:(0,N.jsx)(bD,{size:17,weight:`bold`}),onClick:r,children:`New investigation`}),(0,N.jsx)(xe,{ref:S,value:c,onChange:e=>l(e.currentTarget.value),leftSection:(0,N.jsx)(fD,{size:16}),placeholder:`Search investigations`,"aria-label":`Search investigations`}),(0,N.jsx)(ym,{}),(0,N.jsxs)(id,{type:`auto`,offsetScrollbars:!0,flex:1,children:[C.isLoading&&(0,N.jsx)(me,{py:`xl`,children:(0,N.jsx)(le,{size:`sm`})}),C.isError&&(0,N.jsx)(_e,{color:`bad`,title:`History unavailable`,children:`Your conversations could not be loaded.`}),!C.isLoading&&!C.isError&&w.length===0&&(0,N.jsxs)(Be,{py:`xl`,px:`sm`,ta:`center`,children:[(0,N.jsx)(Ce,{fw:600,children:u?`No matching investigations`:`No investigations yet`}),(0,N.jsx)(Ce,{c:`dimmed`,size:`sm`,mt:4,children:u?`Try words from the opening question.`:`Your completed investigations will appear here.`})]}),(0,N.jsxs)(Le,{gap:`lg`,pb:`md`,children:[T.map(e=>(0,N.jsxs)(Le,{gap:4,children:[(0,N.jsx)(Ce,{c:`dimmed`,size:`xs`,fw:700,tt:`uppercase`,lts:`0.08em`,px:`sm`,children:e.label}),e.threads.map(e=>{let n=e.threadId===t;return(0,N.jsx)(Be,{"data-active":n||void 0,className:`chat-history-item`,children:(0,N.jsxs)(ze,{gap:2,wrap:`nowrap`,children:[(0,N.jsx)(h,{onClick:()=>i(e.threadId),"aria-current":n?`page`:void 0,p:`sm`,flex:1,style:{minWidth:0},children:(0,N.jsxs)(ze,{justify:`space-between`,gap:`sm`,wrap:`nowrap`,children:[(0,N.jsx)(Ce,{size:`sm`,fw:n?650:500,truncate:!0,children:e.title}),(0,N.jsx)(Ce,{c:`dimmed`,size:`xs`,style:{flexShrink:0},children:KR(e.updatedAt)})]})}),(0,N.jsxs)(Mh,{position:`bottom-end`,withinPortal:!0,children:[(0,N.jsx)(Mh.Target,{children:(0,N.jsx)(Zd,{className:`chat-history-actions`,variant:`subtle`,color:`gray`,size:`sm`,mr:6,"aria-label":`Actions for ${e.title}`,children:(0,N.jsx)(iD,{size:18,weight:`bold`})})}),(0,N.jsxs)(Mh.Dropdown,{children:[(0,N.jsx)(Mh.Item,{leftSection:(0,N.jsx)(vD,{size:15}),onClick:()=>E(e),children:`Rename`}),(0,N.jsx)(Mh.Item,{color:`bad`,leftSection:(0,N.jsx)(ED,{size:15}),onClick:()=>{y(``),m(e)},children:`Delete`})]})]})]})},e.threadId)})]},e.label)),C.hasNextPage&&(0,N.jsx)(Oe,{variant:`subtle`,color:`gray`,loading:C.isFetchingNextPage,onClick:()=>void C.fetchNextPage(),children:`Load older`})]})]})]})}),(0,N.jsx)(Jh,{opened:d!==null,onClose:()=>!b&&f(null),title:`Rename investigation`,centered:!0,children:(0,N.jsx)(`form`,{onSubmit:e=>{e.preventDefault(),D()},children:(0,N.jsxs)(Le,{children:[(0,N.jsx)(xe,{label:`Name`,value:g,onChange:e=>_(e.currentTarget.value),maxLength:120,autoFocus:!0}),v&&(0,N.jsx)(_e,{color:`bad`,children:v}),(0,N.jsxs)(ze,{justify:`flex-end`,children:[(0,N.jsx)(Oe,{variant:`default`,onClick:()=>f(null),disabled:b,children:`Cancel`}),(0,N.jsx)(Oe,{type:`submit`,loading:b,disabled:!g.trim(),children:`Save`})]})]})})}),(0,N.jsx)(Jh,{opened:p!==null,onClose:()=>!b&&m(null),title:`Delete investigation?`,centered:!0,children:(0,N.jsxs)(Le,{children:[(0,N.jsxs)(Ce,{size:`sm`,children:[`This permanently removes `,(0,N.jsx)(Ce,{span:!0,fw:650,children:p?.title}),` and its saved conversation.`]}),v&&(0,N.jsx)(_e,{color:`bad`,children:v}),(0,N.jsxs)(ze,{justify:`flex-end`,children:[(0,N.jsx)(Oe,{variant:`default`,onClick:()=>m(null),disabled:b,children:`Cancel`}),(0,N.jsx)(Oe,{color:`bad`,loading:b,onClick:()=>void O(),children:`Delete`})]})]})})]})}function UR(e){return e.includes(`T`)?new Date(e):new Date(`${e.replace(` `,`T`)}Z`)}function WR(e){return new Date(e.getFullYear(),e.getMonth(),e.getDate()).getTime()}function GR(e){let t=WR(new Date),n=new Map;for(let r of e){let e=Math.floor((t-WR(UR(r.updatedAt)))/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[...n].map(([e,t])=>({label:e,threads:t}))}function KR(e){let t=UR(e),n=WR(new Date);return Math.floor((n-WR(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)}var qR=[];for(let e=0;e<256;++e)qR.push((e+256).toString(16).slice(1));function JR(e,t=0){return(qR[e[t+0]]+qR[e[t+1]]+qR[e[t+2]]+qR[e[t+3]]+`-`+qR[e[t+4]]+qR[e[t+5]]+`-`+qR[e[t+6]]+qR[e[t+7]]+`-`+qR[e[t+8]]+qR[e[t+9]]+`-`+qR[e[t+10]]+qR[e[t+11]]+qR[e[t+12]]+qR[e[t+13]]+qR[e[t+14]]+qR[e[t+15]]).toLowerCase()}var YR=new Uint8Array(16);function XR(){return crypto.getRandomValues(YR)}var ZR={};function QR(e,t,n){let r;if(e)r=ez(e.random??e.rng?.()??XR(),e.msecs,e.seq,t,n);else{let e=Date.now(),i=XR();$R(ZR,e,i),r=ez(i,ZR.msecs,ZR.seq,t,n)}return t??JR(r)}function $R(e,t,n){return e.msecs??=-1/0,e.seq??=0,t>e.msecs?(e.seq=tz(n),e.msecs=t):(e.seq=e.seq+1|0,e.seq===0&&e.msecs++),e}function ez(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??=tz(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 tz(e){return(e[6]&127)<<24|e[7]<<16|e[8]<<8|e[9]}function nz(){return QR()}var rz=`modulepreload`,iz=function(e){return`/`+e},az={},oz=function(e,t,n){let r=Promise.resolve();if(t&&t.length>0){let e=document.getElementsByTagName(`link`),i=document.querySelector(`meta[property=csp-nonce]`),a=i?.nonce||i?.getAttribute(`nonce`);function o(e){return Promise.all(e.map(e=>Promise.resolve(e).then(e=>({status:`fulfilled`,value:e}),e=>({status:`rejected`,reason:e}))))}function s(e){return import.meta.resolve?import.meta.resolve(e):new URL(e,import.meta.url).href}r=o(t.map(t=>{if(t=iz(t,n),t=s(t),t in az)return;az[t]=!0;let r=t.endsWith(`.css`);for(let n=e.length-1;n>=0;n--){let i=e[n];if(i.href===t&&(!r||i.rel===`stylesheet`))return}let i=document.createElement(`link`);if(i.rel=r?`stylesheet`:rz,r||(i.as=`script`),i.crossOrigin=``,i.href=t,a&&i.setAttribute(`nonce`,a),document.head.appendChild(i),r)return new Promise((e,n)=>{i.addEventListener(`load`,e),i.addEventListener(`error`,()=>n(Error(`Unable to preload CSS for ${t}`)))})}))}function i(e){let t=new Event(`vite:preloadError`,{cancelable:!0});if(t.payload=e,window.dispatchEvent(t),!t.defaultPrevented)throw e}return r.then(t=>{for(let e of t||[])e.status===`rejected`&&i(e.reason);return e().catch(i)})},sz=(0,M.lazy)(()=>oz(()=>import(`./mcp-app-frame-C0HSbiNW.js`),__vite__mapDeps([0,1,2]))),cz=(0,M.createContext)(null);function lz(){let e=(0,M.useContext)(cz);if(!e)throw Error(`Fanout app context is unavailable`);return e}function uz(){let{agent_available:e}=Te(),t=o(),n=OD(),r=va({select:e=>e.location.pathname}),i=r===`/chat`||r===`/chat/`||r.startsWith(`/chat/`),{threadId:a}=Oi({strict:!1}),s=(0,M.useRef)(nz()).current,[c,l]=(0,M.useState)(a??``),u=a??(c||s),[d,f]=(0,M.useState)([]),[p,m]=(0,M.useState)(``),[h,g]=(0,M.useState)(!1),[_,v]=(0,M.useState)(``),[y,b]=(0,M.useState)(``),[x,S]=(0,M.useState)(!1),C=(0,M.useRef)(``),w=(0,M.useRef)(null),T=(0,M.useRef)(null),E=(0,M.useMemo)(()=>new FE({url:`/api/agent`,threadId:u,fetch:(e,t)=>ve(e,t)}),[u]),D=!e||p===u;(0,M.useEffect)(()=>{a&&l(a)},[a]),(0,M.useEffect)(()=>{let t=!0;if(f([]),m(``),g(!1),b(``),!e){m(u);return}ve(`/api/agent/threads/${encodeURIComponent(u)}`).then(async e=>e.status===404?{messages:[]}:e.ok?e.json():Promise.reject(Error(`Unable to load thread (${e.status})`))).then(e=>{t&&(E.setMessages(e.messages??[]),f([...e.messages??[]]),m(u))}).catch(()=>{t&&(C.current=``,b(`This conversation could not be restored. Start a new chat or try again.`))});let r=E.subscribe({onEvent:({messages:e})=>f([...e]),onRunInitialized:()=>{g(!0),b(``)},onRunFinalized:({messages:e})=>{f([...e]),g(!1),n.invalidateQueries({queryKey:BR})},onRunFailed:e=>{console.error(`Agent run failed`,e),b(`Fanout could not complete this analysis. Please try again.`),g(!1),n.invalidateQueries({queryKey:BR})}});return()=>{t=!1,r.unsubscribe(),E.abortRun()}},[E,e,n,u]),(0,M.useEffect)(()=>{w.current?.scrollIntoView({behavior:`smooth`,block:`end`})},[d,h]),(0,M.useEffect)(()=>{if(!e)return;let n=e=>{let n=e.target,r=n?.matches(`input, textarea, [contenteditable='true']`);if((e.metaKey||e.ctrlKey)&&e.key.toLowerCase()===`k`){e.preventDefault(),S(!0);return}e.key===`/`&&!r&&(e.preventDefault(),t(c?{to:`/chat/$threadId`,params:{threadId:c}}:{to:`/chat`}),requestAnimationFrame(()=>T.current?.focus())),e.key===`Escape`&&n===T.current&&(v(``),T.current?.blur())};return window.addEventListener(`keydown`,n),()=>window.removeEventListener(`keydown`,n)},[e,c,t]);async function O(t){let n=t.trim();if(!e||!n||h||!D)return;let r={id:nz(),role:`user`,content:n};E.addMessage(r),f([...E.messages]),v(``),g(!0),b(``);try{await E.runAgent()}catch(e){console.error(`Agent run failed`,e),b(`Fanout could not complete this analysis. Please try again.`),g(!1)}}(0,M.useEffect)(()=>{let e=C.current;D&&i&&e&&(C.current=``,O(e))},[i,D,u]);function k(e){e.preventDefault(),O(_)}function ee(n){if(!e)return;let r=nz();C.current=n??``,S(!1),t({to:`/chat/$threadId`,params:{threadId:r}})}function te(){E.abortRun(),C.current=``,S(!1),t({to:`/chat`})}function ne(){t(c?{to:`/chat/$threadId`,params:{threadId:c}}:{to:`/chat`})}function re(e){S(!1),t({to:`/chat/$threadId`,params:{threadId:e}})}return(0,N.jsxs)(cz.Provider,{value:{agentAvailable:e,messages:d,ready:D,running:h,input:_,setInput:v,error:y,bottomRef:w,inputRef:T,send:O,submit:k,openChat:ee},children:[e&&(0,N.jsx)(HR,{opened:x,activeThreadID:i?u:void 0,onClose:()=>S(!1),onNewChat:te,onSelect:re,onDeleted:e=>{e===u&&te()}}),(0,N.jsxs)(rm,{header:{height:56},footer:{height:42},padding:0,children:[(0,N.jsx)(rm.Header,{children:(0,N.jsxs)(ze,{h:`100%`,px:{base:`sm`,sm:`lg`},justify:`space-between`,wrap:`nowrap`,children:[(0,N.jsx)(je,{size:`small`}),(0,N.jsxs)(ze,{gap:`xs`,wrap:`nowrap`,children:[(0,N.jsxs)(ze,{gap:6,mr:4,visibleFrom:`md`,children:[(0,N.jsx)(Be,{w:7,h:7,bg:`ok`,style:{borderRadius:`50%`}}),(0,N.jsx)(Ce,{c:`dimmed`,size:`xs`,fw:600,children:`Live`})]}),(e||i)&&(0,N.jsx)(Oe,{variant:`subtle`,color:`gray`,size:`compact-sm`,leftSection:i?(0,N.jsx)(uD,{size:16,weight:`bold`}):(0,N.jsx)(eD,{size:16,weight:`bold`}),onClick:()=>i?void t({to:`/dashboards`}):ne(),children:i?`Dashboard`:`Chat`}),e&&(0,N.jsx)(cg,{label:`Conversation history`,children:(0,N.jsx)(Zd,{variant:`subtle`,color:`gray`,"aria-label":`Conversation history`,onClick:()=>S(!0),children:(0,N.jsx)(nD,{size:17,weight:`bold`})})}),e&&i&&(0,N.jsx)(cg,{label:`New chat`,children:(0,N.jsx)(Zd,{variant:`subtle`,color:`gray`,"aria-label":`New chat`,onClick:te,children:(0,N.jsx)(bD,{size:17,weight:`bold`})})}),(0,N.jsx)(dz,{}),(0,N.jsx)(cg,{label:`Sign out`,children:(0,N.jsx)(Zd,{variant:`subtle`,color:`gray`,"aria-label":`Sign out`,onClick:()=>void se().catch(e=>b(e instanceof Error?e.message:`Sign-out failed — your session is still active.`)),children:(0,N.jsx)(SD,{size:17})})})]})]})}),(0,N.jsxs)(rm.Main,{children:[(0,N.jsx)(ca,{}),e&&i&&(0,N.jsx)(fz,{})]}),(0,N.jsx)(hz,{})]})]})}function dz(){let{setColorScheme:e}=xo(),t=wo(`light`,{getInitialValueInEffect:!0}),n=t===`dark`?`light`:`dark`;return(0,N.jsx)(cg,{label:`Switch to ${n} theme`,children:(0,N.jsx)(Zd,{variant:`subtle`,color:`gray`,"aria-label":`Switch to ${n} theme`,onClick:()=>e(n),children:t===`dark`?(0,N.jsx)(wD,{size:17,weight:`bold`}):(0,N.jsx)(mD,{size:17,weight:`bold`})})})}function fz(){let{input:e,setInput:t,inputRef:n,submit:r,send:i,ready:a,running:o}=lz();return(0,N.jsx)(Be,{pos:`fixed`,bottom:42,left:0,right:0,pb:`md`,pt:`md`,bg:`var(--mantine-color-body)`,style:{zIndex:20},children:(0,N.jsx)(Be,{maw:1440,mx:`auto`,px:{base:`md`,sm:`xl`,lg:72},children:(0,N.jsx)(ee,{component:`form`,onSubmit:r,className:`chat-composer-field`,withBorder:!0,shadow:`sm`,radius:28,py:6,pl:`lg`,pr:6,children:(0,N.jsxs)(ze,{align:`flex-end`,gap:`xs`,wrap:`nowrap`,children:[(0,N.jsx)(qm,{ref:n,"aria-label":`Message Fanout`,value:e,onChange:e=>t(e.currentTarget.value),onKeyDown:t=>{t.key===`Enter`&&!t.shiftKey&&(t.preventDefault(),i(e))},placeholder:o?`Fanout is analyzing…`:`Ask about health, errors, or latency…`,disabled:!a||o,autosize:!0,minRows:1,maxRows:6,variant:`unstyled`,flex:1}),(0,N.jsx)(Zd,{type:`submit`,variant:`filled`,size:40,radius:`xl`,disabled:!e.trim()||!a||o,"aria-label":`Send message`,children:(0,N.jsx)(gD,{size:17,weight:`fill`})})]})})})})}function pz(){let{agentAvailable:e,messages:t,ready:n,running:r,error:i,bottomRef:a,send:o}=lz();if(!e)return(0,N.jsx)(fe,{size:`sm`,py:96,children:(0,N.jsx)(ee,{withBorder:!0,radius:`xl`,p:{base:`xl`,sm:40},children:(0,N.jsxs)(Le,{gap:`md`,children:[(0,N.jsx)(Ce,{c:`brand`,fw:700,size:`xs`,tt:`uppercase`,lts:`0.12em`,children:`Optional capability`}),(0,N.jsx)(ue,{order:1,children:`Chat is not configured`}),(0,N.jsx)(Ce,{c:`dimmed`,children:`Add an AI provider key to enable investigation chat. Telemetry ingest, dashboards, traces, logs, and metrics remain available without it.`}),(0,N.jsx)(Oe,{component:`a`,href:`/dashboards`,variant:`light`,mt:`sm`,children:`Open dashboards`})]})})});let s=t.filter(e=>e.role!==`tool`);return n?(0,N.jsxs)(fe,{size:1440,px:{base:`md`,sm:`xl`,lg:72},pt:{base:36,sm:64},pb:190,children:[s.length===0&&(0,N.jsx)(mz,{onSelect:o}),(0,N.jsxs)(Le,{gap:`xl`,"aria-live":`polite`,children:[s.map(e=>(0,N.jsx)(gz,{message:e,send:o},e.id)),r&&(0,N.jsxs)(ze,{gap:`xs`,children:[(0,N.jsx)(le,{type:`dots`,size:`sm`}),(0,N.jsx)(Ce,{c:`dimmed`,size:`sm`,children:`Analyzing your system`})]}),i&&(0,N.jsx)(_e,{color:`bad`,title:`Something went wrong`,children:i}),(0,N.jsx)(`div`,{ref:a})]})]}):(0,N.jsxs)(me,{mih:`50vh`,children:[(0,N.jsx)(le,{size:`sm`}),(0,N.jsx)(Ce,{c:`dimmed`,size:`sm`,ml:`sm`,children:`Loading conversation`})]})}function mz({onSelect:e}){return(0,N.jsxs)(Le,{align:`center`,gap:`lg`,maw:780,mx:`auto`,mb:56,ta:`center`,children:[(0,N.jsx)(je,{size:`large`}),(0,N.jsx)(Ce,{c:`brand`,fw:700,size:`xs`,tt:`uppercase`,lts:`0.14em`,children:`Your system, understood`}),(0,N.jsxs)(ue,{order:1,fz:{base:40,sm:56},lh:1.05,lts:`-0.045em`,children:[`See what changed.`,(0,N.jsx)(`br`,{}),`Know what to do next.`]}),(0,N.jsx)(Ce,{c:`dimmed`,maw:620,children:`Ask about service health, latency, errors, or dependencies. Fanout turns live signals into clear answers and focused views.`}),(0,N.jsx)(_g,{cols:{base:1,sm:3},spacing:`sm`,w:`100%`,mt:`md`,children:[`Summarize system health for the last hour`,`Find the source of elevated errors`,`Map the current service dependencies`].map((t,n)=>(0,N.jsx)(h,{onClick:()=>void e(t),children:(0,N.jsx)(ee,{withBorder:!0,radius:`lg`,p:`md`,mih:{base:74,sm:120},h:`100%`,children:(0,N.jsxs)(Le,{justify:`space-between`,h:`100%`,gap:`md`,children:[(0,N.jsxs)(Ce,{c:`dimmed`,size:`xs`,fw:700,children:[`0`,n+1]}),(0,N.jsxs)(ze,{justify:`space-between`,wrap:`nowrap`,children:[(0,N.jsx)(Ce,{size:`sm`,fw:500,children:t}),(0,N.jsx)(QE,{size:17,weight:`bold`})]})]})})},t))})]})}function hz(){return(0,N.jsx)(rm.Footer,{children:(0,N.jsxs)(ze,{h:`100%`,px:{base:`sm`,sm:`lg`},justify:`space-between`,wrap:`nowrap`,children:[(0,N.jsxs)(Ce,{c:`dimmed`,size:`xs`,children:[`© 2026 Fanout by `,(0,N.jsx)(Ce,{component:`a`,href:`https://labstack.com`,target:`_blank`,rel:`noreferrer`,inherit:!0,fw:600,c:`var(--mantine-color-text)`,children:`LabStack`})]}),(0,N.jsxs)(ze,{gap:4,children:[(0,N.jsx)(cg,{label:`GitHub`,children:(0,N.jsx)(Zd,{component:`a`,href:`https://github.com/labstack/fanout`,target:`_blank`,rel:`noreferrer`,variant:`subtle`,color:`gray`,size:`sm`,"aria-label":`Fanout on GitHub`,children:(0,N.jsx)(oD,{size:14,weight:`bold`})})}),(0,N.jsx)(cg,{label:`LabStack`,children:(0,N.jsx)(Zd,{component:`a`,href:`https://labstack.com`,target:`_blank`,rel:`noreferrer`,variant:`subtle`,color:`gray`,size:`sm`,"aria-label":`LabStack website`,children:(0,N.jsx)(cD,{size:14})})})]})]})})}function gz({message:e,send:t}){if(e.role===`activity`){let n=e;return n.activityType===`mcp-app`?(0,N.jsx)(ee,{radius:`lg`,shadow:`md`,style:{overflow:`hidden`},"aria-label":_z(n.content.toolName),children:(0,N.jsx)(M.Suspense,{fallback:(0,N.jsx)(me,{mih:180,children:(0,N.jsx)(le,{size:`sm`})}),children:(0,N.jsx)(sz,{content:n.content,onMessage:t})})}):null}let n=typeof e.content==`string`?e.content:JSON.stringify(e.content);if(!n&&e.role===`assistant`)return null;let r=e.role===`user`;return(0,N.jsxs)(Le,{gap:`xs`,align:r?`flex-end`:`stretch`,maw:r?`min(92%, 650px)`:780,ml:r?`auto`:void 0,children:[(0,N.jsxs)(ze,{gap:`xs`,justify:r?`flex-end`:`flex-start`,children:[(0,N.jsx)(hm,{size:22,radius:`sm`,color:r?`gray`:`brand`,children:r?`Y`:`F`}),(0,N.jsx)(Ce,{c:`dimmed`,size:`xs`,fw:700,tt:`uppercase`,lts:`0.08em`,children:r?`You`:`Fanout`})]}),r?(0,N.jsx)(ee,{withBorder:!0,radius:`lg`,p:`sm`,bg:`var(--mantine-color-brand-light)`,children:(0,N.jsx)(Ce,{style:{whiteSpace:`pre-wrap`},children:n})}):(0,N.jsx)(yg,{children:(0,N.jsx)(FF,{remarkPlugins:[zR],children:n})})]})}function _z(e){return{observability_overview:`System health`,service_topology:`Service map`,service_performance:`Performance`,trace_detail:`Trace analysis`,search_logs:`Logs`}[e]??`System analysis`}function vz(){let e=(0,M.useMemo)(()=>new RO,[]);return(0,N.jsx)(kD,{client:e,children:(0,N.jsx)(Fe,{children:(0,N.jsx)(uz,{})})})}var yz=Yi({component:vz,notFoundComponent:()=>(0,N.jsx)(d,{to:`/`,replace:!0})}),bz=Xi(`/`)({component:Zi(()=>oz(()=>import(`./routes-UYU1YEPx.js`),__vite__mapDeps([3,1,2])),`component`)}),xz=Xi(`/chat/`)({component:Zi(()=>oz(()=>import(`./chat.index-B-B4AZ2m.js`),__vite__mapDeps([4,1])),`component`)}),Sz=Xi(`/chat/$threadId`)({component:Zi(()=>oz(()=>import(`./chat._threadId-Bn3zmcjJ.js`),[]),`component`)}),Cz=Xi(`/dashboards/`)({component:Zi(()=>oz(()=>import(`./dashboards.index-BoPfccdT.js`),__vite__mapDeps([5,1,6,2])),`component`)}),wz=Xi(`/dashboards/$dashboardId`)({component:Zi(()=>oz(()=>import(`./dashboards._dashboardId-BUndKTeA.js`),__vite__mapDeps([7,1,6,2])),`component`)}),Tz=bz.update({id:`/`,path:`/`,getParentRoute:()=>yz}),Ez=xz.update({id:`/chat/`,path:`/chat/`,getParentRoute:()=>yz}),Dz=Sz.update({id:`/chat/$threadId`,path:`/chat/$threadId`,getParentRoute:()=>yz}),Oz=Cz.update({id:`/dashboards/`,path:`/dashboards/`,getParentRoute:()=>yz}),kz={IndexRoute:Tz,ChatThreadIdRoute:Dz,DashboardsDashboardIdRoute:wz.update({id:`/dashboards/$dashboardId`,path:`/dashboards/$dashboardId`,getParentRoute:()=>yz}),ChatIndexRoute:Ez,DashboardsIndexRoute:Oz},Az=ma({routeTree:yz._addFileChildren(kz)._addFileTypes(),defaultPreload:`intent`,scrollRestoration:!0}),jz=[`#fafafa`,`#e6e4de`,`#bfbdb6`,`#8b8e99`,`#565b69`,`#1d2433`,`#131721`,`#0b0e14`,`#080a10`,`#05070b`],Mz=[`#f3ecfd`,`#ece3fb`,`#dcc9f7`,`#d2a6ff`,`#bf94ec`,`#a97ce0`,`#9163d6`,`#7c4dcc`,`#5b32a3`,`#40236f`],Nz=[`#eefbe6`,`#dcf7cc`,`#c2f0a6`,`#a5e880`,`#8fe06c`,`#7fd962`,`#66c04b`,`#4f9c3a`,`#3b7a2c`,`#2a5a1f`],Pz=[`#fff5e6`,`#ffe9c9`,`#ffd79b`,`#ffc571`,`#ffbc62`,`#ffb454`,`#ef9c33`,`#c87d21`,`#9c5f16`,`#74460f`],Fz=[`#fdecee`,`#fbd9dc`,`#f8b6bc`,`#f59099`,`#f37d87`,`#f26d78`,`#e04d5a`,`#c03642`,`#96262f`,`#6f1a21`],Iz=[`#e8f6ff`,`#ccebff`,`#a3daff`,`#7dcbff`,`#66c5ff`,`#59c2ff`,`#33a7e6`,`#1e86bd`,`#146694`,`#0d4a6d`],Lz={display:`"IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace`,body:`"IBM Plex Sans", ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif`},Rz={primaryColor:`brand`,primaryShade:{light:7,dark:5},autoContrast:!0,colors:{dark:jz,brand:Mz,ok:Nz,warn:Pz,bad:Fz,info:Iz},defaultRadius:`md`,fontFamily:Lz.body,fontFamilyMonospace:Lz.display,headings:{fontFamily:Lz.display,fontWeight:`500`},cursorType:`pointer`},zz=()=>({variables:{"--mantine-color-error":`var(--mantine-color-bad-filled)`},light:{},dark:{}}),Bz=Ro(Rz);(0,mv.createRoot)(document.getElementById(`root`)).render((0,N.jsx)(M.StrictMode,{children:(0,N.jsx)(Lo,{theme:Bz,defaultColorScheme:`auto`,cssVariablesResolver:zz,children:(0,N.jsx)(_a,{router:Az})})}));export{ro as A,Ud as C,mo as D,_o as E,xa as M,po as O,Zd as S,wo as T,_g as _,XO as a,ym as b,uO as c,PD as d,KD as f,QE as g,bD as h,nz as i,Sa as j,io as k,oO as l,OD as m,pz as n,PO as o,nO as p,lz as r,EO as s,wz as t,HD as u,cg as v,id as w,im as x,Mh as y}; \ No newline at end of file diff --git a/internal/ui/dist/assets/index-Cnw6TNqL.js b/internal/ui/dist/assets/index-Cnw6TNqL.js deleted file mode 100644 index f7f3ece6..00000000 --- a/internal/ui/dist/assets/index-Cnw6TNqL.js +++ /dev/null @@ -1,85 +0,0 @@ -const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/mcp-app-frame-DUBLTjXl.js","assets/useNavigate-BEpS2iE5.js","assets/auth-TmbGk91l.js","assets/routes-BQrzb4p9.js","assets/chat.index-9CJIOrfA.js","assets/dashboards.index-Dxwz9Ppx.js","assets/dashboard-Bf0GrxUB.js","assets/dashboards._dashboardId-BKkqXjF1.js"])))=>i.map(i=>d[i]); -import{a as e,c as t,d as n,g as r,i,l as a,n as o,o as s,p as c,r as l,s as u,t as d,u as f}from"./useNavigate-BEpS2iE5.js";import{$ as p,B as m,C as h,E as g,F as _,G as v,H as y,I as b,J as x,K as S,L as C,M as w,N as T,O as E,P as D,Q as O,R as k,S as ee,T as te,U as ne,W as re,X as A,Y as ie,Z as ae,_ as oe,a as se,at as ce,b as le,c as ue,ct as de,d as fe,dt as j,et as pe,f as me,ft as he,g as ge,h as _e,i as ve,it as ye,j as be,l as xe,lt as Se,m as Ce,mt as we,n as Te,nt as Ee,ot as De,p as Oe,pt as ke,q as Ae,r as je,rt as Me,s as Ne,st as Pe,t as Fe,tt as Ie,u as Le,ut as Re,v as ze,w as Be,x as Ve,y as He,z as Ue}from"./auth-TmbGk91l.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 We=n((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,O());else{var t=n(l);t!==null&&te(x,t.startTime-e)}}}var S=!1,C=-1,w=5,T=-1;function E(){return g?!0:!(e.unstable_now()-Tt&&E());){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&&te(x,u.startTime-t),i=!1}}break a}finally{d=null,f=a,p=!1}i=void 0}}finally{i?O():S=!1}}}var O;if(typeof y==`function`)O=function(){y(D)};else if(typeof MessageChannel<`u`){var k=new MessageChannel,ee=k.port2;k.port1.onmessage=D,O=function(){ee.postMessage(null)}}else O=function(){_(D,0)};function te(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,te(x,a-o))):(r.sortIndex=s,t(c,r),m||p||(m=!0,S||(S=!0,O()))),r},e.unstable_shouldYield=E,e.unstable_wrapCallback=function(e){var t=f;return function(){var n=f;f=t;try{return e.apply(this,arguments)}finally{f=n}}}})),Ge=n(((e,t)=>{t.exports=We()})),Ke=n((e=>{var t=Ge(),n=f(),r=we();function i(e){var t=`https://react.dev/errors/`+e;if(1se||(e.current=oe[se],oe[se]=null,se--)}function ue(e,t){se++,oe[se]=e.current,e.current=t}var de=ce(null),fe=ce(null),j=ce(null),pe=ce(null);function me(e,t){switch(ue(j,t),ue(fe,e),ue(de,null),t.nodeType){case 9:case 11:e=(e=t.documentElement)&&(e=e.namespaceURI)?cf(e):0;break;default:if(e=t.tagName,t=t.namespaceURI)t=cf(t),e=lf(t,e);else switch(e){case`svg`:e=1;break;case`math`:e=2;break;default:e=0}}le(de),ue(de,e)}function he(){le(de),le(fe),le(j)}function ge(e){e.memoizedState!==null&&ue(pe,e);var t=de.current,n=lf(t,e.type);t!==n&&(ue(fe,e),ue(de,n))}function _e(e){fe.current===e&&(le(de),le(fe)),pe.current===e&&(le(pe),vp._currentValue=ae)}var ve,ye;function be(e){if(ve===void 0)try{throw Error()}catch(e){var t=e.stack.trim().match(/\n( *(at )?)/);ve=t&&t[1]||``,ye=-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{xe=!1,Error.prepareStackTrace=n}return(n=e?e.displayName||e.name:``)?be(n):``}function Ce(e,t){switch(e.tag){case 26:case 27:case 5:return be(e.type);case 16:return be(`Lazy`);case 13:return e.child!==t&&t!==null?be(`Suspense Fallback`):be(`Suspense`);case 19:return be(`SuspenseList`);case 0:case 15:return Se(e.type,!1);case 11:return Se(e.type.render,!1);case 1:return Se(e.type,!0);case 31:return be(`Activity`);default:return``}}function Te(e){try{var t=``,n=null;do t+=Ce(e,n),n=e,e=e.return;while(e);return t}catch(e){return` -Error generating stack: `+e.message+` -`+e.stack}}var Ee=Object.prototype.hasOwnProperty,De=t.unstable_scheduleCallback,Oe=t.unstable_cancelCallback,ke=t.unstable_shouldYield,Ae=t.unstable_requestPaint,je=t.unstable_now,Me=t.unstable_getCurrentPriorityLevel,Ne=t.unstable_ImmediatePriority,Pe=t.unstable_UserBlockingPriority,Fe=t.unstable_NormalPriority,Ie=t.unstable_LowPriority,Le=t.unstable_IdlePriority,Re=t.log,ze=t.unstable_setDisableYieldValue,Be=null,Ve=null;function He(e){if(typeof Re==`function`&&ze(e),Ve&&typeof Ve.setStrictMode==`function`)try{Ve.setStrictMode(Be,e)}catch{}}var Ue=Math.clz32?Math.clz32:qe,We=Math.log,Ke=Math.LN2;function qe(e){return e>>>=0,e===0?32:31-(We(e)/Ke|0)|0}var Je=256,Ye=262144,Xe=4194304;function Ze(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&261888;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 Qe(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=Ze(n))):i=Ze(o):i=Ze(s)):(r=s&~a,r===0?(o&=s,o===0?n||(n=s&~e,n!==0&&(i=Ze(n))):i=Ze(o)):i=Ze(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 $e(e,t){return(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&t)===0}function et(e,t){switch(e){case 1:case 2:case 4:case 8:case 64:return t+250;case 16:case 32:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return t+5e3;case 4194304:case 8388608:case 16777216:case 33554432:return-1;case 67108864:case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function tt(){var e=Xe;return Xe<<=1,!(Xe&62914560)&&(Xe=4194304),e}function nt(e){for(var t=[],n=0;31>n;n++)t.push(e);return t}function rt(e,t){e.pendingLanes|=t,t!==268435456&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function it(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`u`||window.document===void 0||window.document.createElement===void 0),_n=!1;if(gn)try{var vn={};Object.defineProperty(vn,"passive",{get:function(){_n=!0}}),window.addEventListener(`test`,vn,vn),window.removeEventListener(`test`,vn,vn)}catch{_n=!1}var yn=null,bn=null,xn=null;function Sn(){if(xn)return xn;var e,t=bn,n=t.length,r,i=`value`in yn?yn.value:yn.textContent,a=i.length;for(e=0;e=er),rr=` `,ir=!1;function ar(e,t){switch(e){case`keyup`:return Qn.indexOf(t.keyCode)!==-1;case`keydown`:return t.keyCode!==229;case`keypress`:case`mousedown`:case`focusout`:return!0;default:return!1}}function or(e){return e=e.detail,typeof e==`object`&&`data`in e?e.data:null}var sr=!1;function cr(e,t){switch(e){case`compositionend`:return or(t);case`keypress`:return t.which===32?(ir=!0,rr):null;case`textInput`:return e=t.data,e===rr&&ir?null:e;default:return null}}function lr(e,t){if(sr)return e===`compositionend`||!$n&&ar(e,t)?(e=Sn(),xn=bn=yn=null,sr=!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=jr(n)}}function Nr(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?Nr(e,t.parentNode):`contains`in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function Pr(e){e=e!=null&&e.ownerDocument!=null&&e.ownerDocument.defaultView!=null?e.ownerDocument.defaultView:window;for(var t=Ut(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=Ut(e.document)}return t}function Fr(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 Ir=gn&&`documentMode`in document&&11>=document.documentMode,Lr=null,Rr=null,zr=null,Br=!1;function Vr(e,t,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;Br||Lr==null||Lr!==Ut(r)||(r=Lr,`selectionStart`in r&&Fr(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}),zr&&Ar(zr,r)||(zr=r,r=Gd(Rr,`onSelect`),0>=o,i-=o,ji=1<<32-Ue(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),Bi&&Ni(i,h),l;if(d===null){for(;hg?(_=h,h=null):_=h.sibling;var y=p(a,h,v.value,l);if(y===null){h===null&&(h=_);break}e&&h&&y.alternate===null&&t(a,h),s=o(y,s,g),d===null?u=y:d.sibling=y,d=y,h=_}if(v.done)return n(a,h),Bi&&Ni(a,g),u;if(h===null){for(;!v.done;g++,v=c.next())v=f(a,v.value,l),v!==null&&(s=o(v,s,g),d===null?u=v:d.sibling=v,d=v);return Bi&&Ni(a,g),u}for(h=r(h);!v.done;g++,v=c.next())v=m(h,a,g,v.value,l),v!==null&&(e&&v.alternate!==null&&h.delete(v.key===null?g:v.key),s=o(v,s,g),d===null?u=v:d.sibling=v,d=v);return e&&h.forEach(function(e){return t(a,e)}),Bi&&Ni(a,g),u}function b(e,r,o,c){if(typeof o==`object`&&o&&o.type===_&&o.key===null&&(o=o.props.children),typeof o==`object`&&o){switch(o.$$typeof){case h:a:{for(var l=o.key;r!==null;){if(r.key===l){if(l=o.type,l===_){if(r.tag===7){n(e,r.sibling),c=a(r,o.props.children),c.return=e,e=c;break a}}else if(r.elementType===l||typeof l==`object`&&l&&l.$$typeof===E&&Pa(l)===r.type){n(e,r.sibling),c=a(r,o.props),Va(c,o),c.return=e,e=c;break a}n(e,r);break}t(e,r),r=r.sibling}o.type===_?(c=vi(o.props.children,e.mode,c,o.key),c.return=e,e=c):(c=_i(o.type,o.key,o.props,null,e.mode,c),Va(c,o),c.return=e,e=c)}return s(e);case g: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=a(r,o.children||[]),c.return=e,e=c;break a}n(e,r);break}t(e,r),r=r.sibling}c=xi(o,e.mode,c),c.return=e,e=c}return s(e);case E:return o=Pa(o),b(e,r,o,c)}if(re(o))return v(e,r,o,c);if(ee(o)){if(l=ee(o),typeof l!=`function`)throw Error(i(150));return o=l.call(o),y(e,r,o,c)}if(typeof o.then==`function`)return b(e,r,Ba(o),c);if(o.$$typeof===x)return b(e,r,ca(e,o),c);Ha(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=a(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{za=0;var i=b(e,t,n,r);return Ra=null,i}catch(t){if(t===Oa||t===Aa)throw t;var a=pi(29,t,null,e.mode);return a.lanes=r,a.return=e,a}}}var Wa=Ua(!0),Ga=Ua(!1),Ka=!1;function qa(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function Ja(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 Ya(e){return{lane:e,tag:0,payload:null,callback:null,next:null}}function Xa(e,t,n){var r=e.updateQueue;if(r===null)return null;if(r=r.shared,Zl&2){var i=r.pending;return i===null?t.next=t:(t.next=i.next,i.next=t),r.pending=t,t=ui(e),li(e,null,n),t}return oi(e,r,t,n),ui(e)}function Za(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,ot(e,n)}}function Qa(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 $a=!1;function eo(){if($a){var e=ya;if(e!==null)throw e}}function to(e,t,n,r){$a=!1;var i=e.updateQueue;Ka=!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,m=f!==s.lane;if(m?(eu&f)===f:(r&f)===f){f!==0&&f===va&&($a=!0),u!==null&&(u=u.next={lane:0,tag:s.tag,payload:s.payload,callback:null,next:null});a:{var h=e,g=s;f=t;var _=n;switch(g.tag){case 1:if(h=g.payload,typeof h==`function`){d=h.call(_,d,f);break a}d=h;break a;case 3:h.flags=h.flags&-65537|128;case 0:if(h=g.payload,f=typeof h==`function`?h.call(_,d,f):h,f==null)break a;d=p({},d,f);break a;case 2:Ka=!0}}f=s.callback,f!==null&&(e.flags|=64,m&&(e.flags|=8192),m=i.callbacks,m===null?i.callbacks=[f]:m.push(f))}else m={lane:f,tag:s.tag,payload:s.payload,callback:s.callback,next:null},u===null?(l=u=m,c=d):u=u.next=m,o|=f;if(s=s.next,s===null){if(s=i.shared.pending,s===null)break;m=s,s=m.next,m.next=null,i.lastBaseUpdate=m,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),cu|=o,e.lanes=o,e.memoizedState=d}}function no(e,t){if(typeof e!=`function`)throw Error(i(191,e));e.call(t)}function ro(e,t){var n=e.callbacks;if(n!==null)for(e.callbacks=null,e=0;ea?a:8;var o=A.T,s={};A.T=s,Ws(e,!1,t,n);try{var c=i(),l=A.S;l!==null&&l(s,c),typeof c==`object`&&c&&typeof c.then==`function`?Us(e,t,Sa(c,r),Au(e)):Us(e,t,r,Au(e))}catch(n){Us(e,t,{then:function(){},status:`rejected`,reason:n},Au())}finally{ie.p=a,o!==null&&s.types!==null&&(o.types=s.types),A.T=o}}function Ns(){}function Ps(e,t,n,r){if(e.tag!==5)throw Error(i(476));var a=Fs(e).queue;Ms(e,a,t,ae,n===null?Ns:function(){return Is(e),n(r)})}function Fs(e){var t=e.memoizedState;if(t!==null)return t;t={memoizedState:ae,baseState:ae,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Go,lastRenderedState:ae},next:null};var n={};return t.next={memoizedState:n,baseState:n,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Go,lastRenderedState:n},next:null},e.memoizedState=t,e=e.alternate,e!==null&&(e.memoizedState=t),t}function Is(e){var t=Fs(e);t.next===null&&(t=e.alternate.memoizedState),Us(e,t.next.queue,{},Au())}function Ls(){return sa(vp)}function Rs(){return Bo().memoizedState}function zs(){return Bo().memoizedState}function Bs(e){for(var t=e.return;t!==null;){switch(t.tag){case 24:case 3:var n=Au();e=Ya(n);var r=Xa(t,e,n);r!==null&&(Mu(r,t,n),Za(r,t,n)),t={cache:ma()},e.payload=t;return}t=t.return}}function Vs(e,t,n){var r=Au();n={lane:r,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null},Gs(e)?Ks(t,n):(n=si(e,t,n,r),n!==null&&(Mu(n,e,r),qs(n,t,r)))}function Hs(e,t,n){Us(e,t,n,Au())}function Us(e,t,n,r){var i={lane:r,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null};if(Gs(e))Ks(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 oi(e,t,i,0),Ql===null&&ai(),!1}catch{}if(n=si(e,t,i,r),n!==null)return Mu(n,e,r),qs(n,t,r),!0}return!1}function Ws(e,t,n,r){if(r={lane:2,revertLane:kd(),gesture:null,action:r,hasEagerState:!1,eagerState:null,next:null},Gs(e)){if(t)throw Error(i(479))}else t=si(e,n,r,2),t!==null&&Mu(t,e,2)}function Gs(e){var t=e.alternate;return e===bo||t!==null&&t===bo}function Ks(e,t){wo=Co=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function qs(e,t,n){if(n&4194048){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,ot(e,n)}}var Js={readContext:sa,use:Uo,useCallback:Ao,useContext:Ao,useEffect:Ao,useImperativeHandle:Ao,useLayoutEffect:Ao,useInsertionEffect:Ao,useMemo:Ao,useReducer:Ao,useRef:Ao,useState:Ao,useDebugValue:Ao,useDeferredValue:Ao,useTransition:Ao,useSyncExternalStore:Ao,useId:Ao,useHostTransitionStatus:Ao,useFormState:Ao,useActionState:Ao,useOptimistic:Ao,useMemoCache:Ao,useCacheRefresh:Ao};Js.useEffectEvent=Ao;var Ys={readContext:sa,use:Uo,useCallback:function(e,t){return zo().memoizedState=[e,t===void 0?null:t],e},useContext:sa,useEffect:ys,useImperativeHandle:function(e,t,n){n=n==null?null:n.concat([e]),_s(4194308,4,Ts.bind(null,t,e),n)},useLayoutEffect:function(e,t){return _s(4194308,4,e,t)},useInsertionEffect:function(e,t){_s(4,2,e,t)},useMemo:function(e,t){var n=zo();t=t===void 0?null:t;var r=e();if(To){He(!0);try{e()}finally{He(!1)}}return n.memoizedState=[r,t],r},useReducer:function(e,t,n){var r=zo();if(n!==void 0){var i=n(t);if(To){He(!0);try{n(t)}finally{He(!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=Vs.bind(null,bo,e),[r.memoizedState,e]},useRef:function(e){var t=zo();return e={current:e},t.memoizedState=e},useState:function(e){e=ts(e);var t=e.queue,n=Hs.bind(null,bo,t);return t.dispatch=n,[e.memoizedState,n]},useDebugValue:Ds,useDeferredValue:function(e,t){return As(zo(),e,t)},useTransition:function(){var e=ts(!1);return e=Ms.bind(null,bo,e.queue,!0,!1),zo().memoizedState=e,[!1,e]},useSyncExternalStore:function(e,t,n){var r=bo,a=zo();if(Bi){if(n===void 0)throw Error(i(407));n=n()}else{if(n=t(),Ql===null)throw Error(i(349));eu&127||Xo(r,t,n)}a.memoizedState=n;var o={value:n,getSnapshot:t};return a.queue=o,ys(Qo.bind(null,r,o,e),[e]),r.flags|=2048,hs(9,{destroy:void 0},Zo.bind(null,r,o,n,t),null),n},useId:function(){var e=zo(),t=Ql.identifierPrefix;if(Bi){var n=Mi,r=ji;n=(r&~(1<<32-Ue(r)-1)).toString(32)+n,t=`_`+t+`R_`+n,n=Eo++,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(a,{is:r.is}):s.createElement(a)}}o[pt]=t,o[mt]=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(ef(o,a,r),a){case`button`:case`input`:case`select`:case`textarea`:r=!!r.autoFocus;break a;case`img`:r=!0;break a;default:r=!1}r&&Uc(t)}}return Jc(t),Wc(t,t.type,e===null?null:e.memoizedProps,t.pendingProps,n),null;case 6:if(e&&t.stateNode!=null)e.memoizedProps!==r&&Uc(t);else{if(typeof r!=`string`&&t.stateNode===null)throw Error(i(166));if(e=j.current,qi(t)){if(e=t.stateNode,n=t.memoizedProps,r=null,a=Ri,a!==null)switch(a.tag){case 27:case 5:r=a.memoizedProps}e[pt]=t,e=!!(e.nodeValue===n||r!==null&&!0===r.suppressHydrationWarning||Zd(e.nodeValue,n)),e||Wi(t,!0)}else e=sf(e).createTextNode(r),e[pt]=t,t.stateNode=e}return Jc(t),null;case 31:if(n=t.memoizedState,e===null||e.memoizedState!==null){if(r=qi(t),n!==null){if(e===null){if(!r)throw Error(i(318));if(e=t.memoizedState,e=e===null?null:e.dehydrated,!e)throw Error(i(557));e[pt]=t}else Ji(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;Jc(t),e=!1}else n=Yi(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=n),e=!0;if(!e)return t.flags&256?(go(t),t):(go(t),null);if(t.flags&128)throw Error(i(558))}return Jc(t),null;case 13:if(r=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(a=qi(t),r!==null&&r.dehydrated!==null){if(e===null){if(!a)throw Error(i(318));if(a=t.memoizedState,a=a===null?null:a.dehydrated,!a)throw Error(i(317));a[pt]=t}else Ji(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;Jc(t),a=!1}else a=Yi(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=a),a=!0;if(!a)return t.flags&256?(go(t),t):(go(t),null)}return go(t),t.flags&128?(t.lanes=n,t):(n=r!==null,e=e!==null&&e.memoizedState!==null,n&&(r=t.child,a=null,r.alternate!==null&&r.alternate.memoizedState!==null&&r.alternate.memoizedState.cachePool!==null&&(a=r.alternate.memoizedState.cachePool.pool),o=null,r.memoizedState!==null&&r.memoizedState.cachePool!==null&&(o=r.memoizedState.cachePool.pool),o!==a&&(r.flags|=2048)),n!==e&&n&&(t.child.flags|=8192),Kc(t,t.updateQueue),Jc(t),null);case 4:return he(),e===null&&Vd(t.stateNode.containerInfo),Jc(t),null;case 10:return ta(t.type),Jc(t),null;case 19:if(le(_o),r=t.memoizedState,r===null)return Jc(t),null;if(a=!!(t.flags&128),o=r.rendering,o===null){if(a)qc(r,!1);else{if(su!==0||e!==null&&e.flags&128)for(e=t.child;e!==null;){if(o=vo(e),o!==null){for(t.flags|=128,qc(r,!1),e=o.updateQueue,t.updateQueue=e,Kc(t,e),t.subtreeFlags=0,e=n,n=t.child;n!==null;)gi(n,e),n=n.sibling;return ue(_o,_o.current&1|2),Bi&&Ni(t,r.treeForkCount),t.child}e=e.sibling}r.tail!==null&&je()>vu&&(t.flags|=128,a=!0,qc(r,!1),t.lanes=4194304)}}else{if(!a){if(e=vo(o),e!==null){if(t.flags|=128,a=!0,e=e.updateQueue,t.updateQueue=e,Kc(t,e),qc(r,!0),r.tail===null&&r.tailMode===`hidden`&&!o.alternate&&!Bi)return Jc(t),null}else 2*je()-r.renderingStartTime>vu&&n!==536870912&&(t.flags|=128,a=!0,qc(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)}return r.tail===null?(Jc(t),null):(e=r.tail,r.rendering=e,r.tail=e.sibling,r.renderingStartTime=je(),e.sibling=null,n=_o.current,ue(_o,a?n&1|2:n&1),Bi&&Ni(t,r.treeForkCount),e);case 22:case 23:return go(t),co(),r=t.memoizedState!==null,e===null?r&&(t.flags|=8192):e.memoizedState!==null!==r&&(t.flags|=8192),r?n&536870912&&!(t.flags&128)&&(Jc(t),t.subtreeFlags&6&&(t.flags|=8192)):Jc(t),n=t.updateQueue,n!==null&&Kc(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&&le(wa),null;case 24:return n=null,e!==null&&(n=e.memoizedState.cache),t.memoizedState.cache!==n&&(t.flags|=2048),ta(pa),Jc(t),null;case 25:return null;case 30:return null}throw Error(i(156,t.tag))}function Xc(e,t){switch(Ii(t),t.tag){case 1:return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return ta(pa),he(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 26:case 27:case 5:return _e(t),null;case 31:if(t.memoizedState!==null){if(go(t),t.alternate===null)throw Error(i(340));Ji()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 13:if(go(t),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(i(340));Ji()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return le(_o),null;case 4:return he(),null;case 10:return ta(t.type),null;case 22:case 23:return go(t),co(),e!==null&&le(wa),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 24:return ta(pa),null;case 25:return null;default:return null}}function Zc(e,t){switch(Ii(t),t.tag){case 3:ta(pa),he();break;case 26:case 27:case 5:_e(t);break;case 4:he();break;case 31:t.memoizedState!==null&&go(t);break;case 13:go(t);break;case 19:le(_o);break;case 10:ta(t.type);break;case 22:case 23:go(t),co(),e!==null&&le(wa);break;case 24:ta(pa)}}function Qc(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){cd(t,t.return,e)}}function $c(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){cd(i,c,e)}}}r=r.next}while(r!==a)}}catch(e){cd(t,t.return,e)}}function el(e){var t=e.updateQueue;if(t!==null){var n=e.stateNode;try{ro(t,n)}catch(t){cd(e,e.return,t)}}}function tl(e,t,n){n.props=nc(e.type,e.memoizedProps),n.state=e.memoizedState;try{n.componentWillUnmount()}catch(n){cd(e,t,n)}}function nl(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:r=e.stateNode;break;default:r=e.stateNode}typeof n==`function`?e.refCleanup=n(r):n.current=r}}catch(n){cd(e,t,n)}}function rl(e,t){var n=e.ref,r=e.refCleanup;if(n!==null){if(typeof r==`function`)try{r()}catch(n){cd(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){cd(e,t,n)}else n.current=null}}function il(e){var t=e.type,n=e.memoizedProps,r=e.stateNode;try{a:switch(t){case`button`:case`input`:case`select`:case`textarea`:n.autoFocus&&r.focus();break a;case`img`:n.src?r.src=n.src:n.srcSet&&(r.srcset=n.srcSet)}}catch(t){cd(e,e.return,t)}}function al(e,t,n){try{var r=e.stateNode;tf(r,e.type,n,t),r[mt]=t}catch(t){cd(e,e.return,t)}}function ol(e){return e.tag===5||e.tag===3||e.tag===26||e.tag===27&&vf(e.type)||e.tag===4}function sl(e){a:for(;;){for(;e.sibling===null;){if(e.return===null||ol(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;e.tag!==5&&e.tag!==6&&e.tag!==18;){if(e.tag===27&&vf(e.type)||e.flags&2||e.child===null||e.tag===4)continue a;e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function cl(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?(n.nodeType===9?n.body:n.nodeName===`HTML`?n.ownerDocument.body:n).insertBefore(e,t):(t=n.nodeType===9?n.body:n.nodeName===`HTML`?n.ownerDocument.body:n,t.appendChild(e),n=n._reactRootContainer,n!=null||t.onclick!==null||(t.onclick=sn));else if(r!==4&&(r===27&&vf(e.type)&&(n=e.stateNode,t=null),e=e.child,e!==null))for(cl(e,t,n),e=e.sibling;e!==null;)cl(e,t,n),e=e.sibling}function ll(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?n.insertBefore(e,t):n.appendChild(e);else if(r!==4&&(r===27&&vf(e.type)&&(n=e.stateNode),e=e.child,e!==null))for(ll(e,t,n),e=e.sibling;e!==null;)ll(e,t,n),e=e.sibling}function ul(e){var t=e.stateNode,n=e.memoizedProps;try{for(var r=e.type,i=t.attributes;i.length;)t.removeAttributeNode(i[0]);ef(t,r,n),t[pt]=e,t[mt]=n}catch(t){cd(e,e.return,t)}}var dl=!1,fl=!1,pl=!1,ml=typeof WeakSet==`function`?WeakSet:Set,hl=null;function gl(e,t){if(e=e.containerInfo,af=Dp,e=Pr(e),Fr(e)){if(`selectionStart`in e)var n={start:e.selectionStart,end:e.selectionEnd};else a:{n=(n=e.ownerDocument)&&n.defaultView||window;var r=n.getSelection&&n.getSelection();if(r&&r.rangeCount!==0){n=r.anchorNode;var a=r.anchorOffset,o=r.focusNode;r=r.focusOffset;try{n.nodeType,o.nodeType}catch{n=null;break a}var s=0,c=-1,l=-1,u=0,d=0,f=e,p=null;b:for(;;){for(var m;f!==n||a!==0&&f.nodeType!==3||(c=s+a),f!==o||r!==0&&f.nodeType!==3||(l=s+r),f.nodeType===3&&(s+=f.nodeValue.length),(m=f.firstChild)!==null;)p=f,f=m;for(;;){if(f===e)break b;if(p===n&&++u===a&&(c=s),p===o&&++d===r&&(l=s),(m=f.nextSibling)!==null)break;f=p,p=f.parentNode}f=m}n=c===-1||l===-1?null:{start:c,end:l}}else n=null}n||={start:0,end:0}}else n=null;for(of={focusedElem:e,selectionRange:n},Dp=!1,hl=t;hl!==null;)if(t=hl,e=t.child,t.subtreeFlags&1028&&e!==null)e.return=t,hl=e;else for(;hl!==null;){switch(t=hl,o=t.alternate,e=t.flags,t.tag){case 0:if(e&4&&(e=t.updateQueue,e=e===null?null:e.events,e!==null))for(n=0;n title`))),ef(o,r,n),o[pt]=e,Et(o),r=o;break a;case`link`:var s=sp(`link`,`href`,a).get(r+(n.href||``));if(s){for(var c=0;cg&&(o=g,g=h,h=o);var _=Mr(s,h),v=Mr(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,A.T=null,n=Eu,Eu=null;var o=Su,s=wu;if(xu=0,Cu=Su=null,wu=0,Zl&6)throw Error(i(331));var c=Zl;if(Zl|=4,Kl(o.current),Rl(o,o.current,s,n),Zl=c,Sd(0,!1),Ve&&typeof Ve.onPostCommitFiberRoot==`function`)try{Ve.onPostCommitFiberRoot(Be,o)}catch{}return!0}finally{ie.p=a,A.T=r,id(e,t)}}function sd(e,t,n){t=Ci(n,t),t=cc(e.stateNode,t,2),e=Xa(e,t,2),e!==null&&(rt(e,2),xd(e))}function cd(e,t,n){if(e.tag===3)sd(e,e,n);else for(;t!==null;){if(t.tag===3){sd(t,e,n);break}if(t.tag===1){var r=t.stateNode;if(typeof t.type.getDerivedStateFromError==`function`||typeof r.componentDidCatch==`function`&&(bu===null||!bu.has(r))){e=Ci(n,e),n=lc(2),r=Xa(t,n,2),r!==null&&(uc(n,r,t,e),rt(r,2),xd(r));break}}t=t.return}}function ld(e,t,n){var r=e.pingCache;if(r===null){r=e.pingCache=new Xl;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)||(au=!0,i.add(n),e=ud.bind(null,e,t,n),t.then(e,e))}function ud(e,t,n){var r=e.pingCache;r!==null&&r.delete(t),e.pingedLanes|=e.suspendedLanes&n,e.warmLanes&=~n,Ql===e&&(eu&n)===n&&(su===4||su===3&&(eu&62914560)===eu&&300>je()-gu?!(Zl&2)&&zu(e,0):uu|=n,fu===eu&&(fu=0)),xd(e)}function dd(e,t){t===0&&(t=tt()),e=ci(e,t),e!==null&&(rt(e,t),xd(e))}function fd(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),dd(e,n)}function pd(e,t){var n=0;switch(e.tag){case 31:case 13:var r=e.stateNode,a=e.memoizedState;a!==null&&(n=a.retryLane);break;case 19:r=e.stateNode;break;case 22:r=e.stateNode._retryCache;break;default:throw Error(i(314))}r!==null&&r.delete(t),dd(e,n)}function md(e,t){return De(e,t)}var hd=null,gd=null,_d=!1,vd=!1,yd=!1,bd=0;function xd(e){e!==gd&&e.next===null&&(gd===null?hd=gd=e:gd=gd.next=e),vd=!0,_d||(_d=!0,Od())}function Sd(e,t){if(!yd&&vd){yd=!0;do for(var n=!1,r=hd;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-Ue(42|e)+1)-1,a&=i&~(o&~s),a=a&201326741?a&201326741|1:a?a|2:0}a!==0&&(n=!0,Dd(r,a))}else a=eu,a=Qe(r,r===Ql?a:0,r.cancelPendingCommit!==null||r.timeoutHandle!==-1),!(a&3)||$e(r,a)||(n=!0,Dd(r,a))}r=r.next}while(n);yd=!1}}function Cd(){wd()}function wd(){vd=_d=!1;var e=0;bd!==0&&ff()&&(e=bd);for(var t=je(),n=null,r=hd;r!==null;){var i=r.next,a=Td(r,t);a===0?(r.next=null,n===null?hd=i:n.next=i,i===null&&(gd=n)):(n=r,(e!==0||a&3)&&(vd=!0)),r=i}xu!==0&&xu!==5||Sd(e,!1),bd!==0&&(bd=0)}function Td(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&&nf(d)&&(c=c.responseEnd,o+=u*(c`u`?null:document;function Vf(e,t,n){var r=Bf;if(r&&typeof t==`string`&&t){var i=Gt(t);i=`link[rel="`+e+`"][href="`+i+`"]`,typeof n==`string`&&(i+=`[crossorigin="`+n+`"]`),Ff.has(i)||(Ff.add(i),e={rel:e,crossOrigin:n,href:t},r.querySelector(i)===null&&(t=r.createElement(`link`),ef(t,`link`,e),Et(t),r.head.appendChild(t)))}}function Hf(e){Lf.D(e),Vf(`dns-prefetch`,e,null)}function Uf(e,t){Lf.C(e,t),Vf(`preconnect`,e,t)}function Wf(e,t,n){Lf.L(e,t,n);var r=Bf;if(r&&e&&t){var i=`link[rel="preload"][as="`+Gt(t)+`"]`;t===`image`&&n&&n.imageSrcSet?(i+=`[imagesrcset="`+Gt(n.imageSrcSet)+`"]`,typeof n.imageSizes==`string`&&(i+=`[imagesizes="`+Gt(n.imageSizes)+`"]`)):i+=`[href="`+Gt(e)+`"]`;var a=i;switch(t){case`style`:a=Xf(e);break;case`script`:a=ep(e)}Pf.has(a)||(e=p({rel:`preload`,href:t===`image`&&n&&n.imageSrcSet?void 0:e,as:t},n),Pf.set(a,e),r.querySelector(i)!==null||t===`style`&&r.querySelector(Zf(a))||t===`script`&&r.querySelector(tp(a))||(t=r.createElement(`link`),ef(t,`link`,e),Et(t),r.head.appendChild(t)))}}function Gf(e,t){Lf.m(e,t);var n=Bf;if(n&&e){var r=t&&typeof t.as==`string`?t.as:`script`,i=`link[rel="modulepreload"][as="`+Gt(r)+`"][href="`+Gt(e)+`"]`,a=i;switch(r){case`audioworklet`:case`paintworklet`:case`serviceworker`:case`sharedworker`:case`worker`:case`script`:a=ep(e)}if(!Pf.has(a)&&(e=p({rel:`modulepreload`,href:e},t),Pf.set(a,e),n.querySelector(i)===null)){switch(r){case`audioworklet`:case`paintworklet`:case`serviceworker`:case`sharedworker`:case`worker`:case`script`:if(n.querySelector(tp(a)))return}r=n.createElement(`link`),ef(r,`link`,e),Et(r),n.head.appendChild(r)}}}function Kf(e,t,n){Lf.S(e,t,n);var r=Bf;if(r&&e){var i=Tt(r).hoistableStyles,a=Xf(e);t||=`default`;var o=i.get(a);if(!o){var s={loading:0,preload:null};if(o=r.querySelector(Zf(a)))s.loading=5;else{e=p({rel:`stylesheet`,href:e,"data-precedence":t},n),(n=Pf.get(a))&&ip(e,n);var c=o=r.createElement(`link`);Et(c),ef(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,rp(o,t,r)}o={type:`stylesheet`,instance:o,count:1,state:s},i.set(a,o)}}}function qf(e,t){Lf.X(e,t);var n=Bf;if(n&&e){var r=Tt(n).hoistableScripts,i=ep(e),a=r.get(i);a||(a=n.querySelector(tp(i)),a||(e=p({src:e,async:!0},t),(t=Pf.get(i))&&ap(e,t),a=n.createElement(`script`),Et(a),ef(a,`link`,e),n.head.appendChild(a)),a={type:`script`,instance:a,count:1,state:null},r.set(i,a))}}function Jf(e,t){Lf.M(e,t);var n=Bf;if(n&&e){var r=Tt(n).hoistableScripts,i=ep(e),a=r.get(i);a||(a=n.querySelector(tp(i)),a||(e=p({src:e,async:!0,type:`module`},t),(t=Pf.get(i))&&ap(e,t),a=n.createElement(`script`),Et(a),ef(a,`link`,e),n.head.appendChild(a)),a={type:`script`,instance:a,count:1,state:null},r.set(i,a))}}function Yf(e,t,n,r){var a=(a=j.current)?If(a):null;if(!a)throw Error(i(446));switch(e){case`meta`:case`title`:return null;case`style`:return typeof n.precedence==`string`&&typeof n.href==`string`?(t=Xf(n.href),n=Tt(a).hoistableStyles,r=n.get(t),r||(r={type:`style`,instance:null,count:0,state:null},n.set(t,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=Xf(n.href);var o=Tt(a).hoistableStyles,s=o.get(e);if(s||(a=a.ownerDocument||a,s={type:`stylesheet`,instance:null,count:0,state:{loading:0,preload:null}},o.set(e,s),(o=a.querySelector(Zf(e)))&&!o._p&&(s.instance=o,s.state.loading=5),Pf.has(e)||(n={rel:`preload`,as:`style`,href:n.href,crossOrigin:n.crossOrigin,integrity:n.integrity,media:n.media,hrefLang:n.hrefLang,referrerPolicy:n.referrerPolicy},Pf.set(e,n),o||$f(a,e,n,s.state))),t&&r===null)throw Error(i(528,``));return s}if(t&&r!==null)throw Error(i(529,``));return null;case`script`:return t=n.async,n=n.src,typeof n==`string`&&t&&typeof t!=`function`&&typeof t!=`symbol`?(t=ep(n),n=Tt(a).hoistableScripts,r=n.get(t),r||(r={type:`script`,instance:null,count:0,state:null},n.set(t,r)),r):{type:`void`,instance:null,count:0,state:null};default:throw Error(i(444,e))}}function Xf(e){return`href="`+Gt(e)+`"`}function Zf(e){return`link[rel="stylesheet"][`+e+`]`}function Qf(e){return p({},e,{"data-precedence":e.precedence,precedence:null})}function $f(e,t,n,r){e.querySelector(`link[rel="preload"][as="style"][`+t+`]`)?r.loading=1:(t=e.createElement(`link`),r.preload=t,t.addEventListener(`load`,function(){return r.loading|=1}),t.addEventListener(`error`,function(){return r.loading|=2}),ef(t,`link`,n),Et(t),e.head.appendChild(t))}function ep(e){return`[src="`+Gt(e)+`"]`}function tp(e){return`script[async]`+e}function np(e,t,n){if(t.count++,t.instance===null)switch(t.type){case`style`:var r=e.querySelector(`style[data-href~="`+Gt(n.href)+`"]`);if(r)return t.instance=r,Et(r),r;var a=p({},n,{"data-href":n.href,"data-precedence":n.precedence,href:null,precedence:null});return r=(e.ownerDocument||e).createElement(`style`),Et(r),ef(r,`style`,a),rp(r,n.precedence,e),t.instance=r;case`stylesheet`:a=Xf(n.href);var o=e.querySelector(Zf(a));if(o)return t.state.loading|=4,t.instance=o,Et(o),o;r=Qf(n),(a=Pf.get(a))&&ip(r,a),o=(e.ownerDocument||e).createElement(`link`),Et(o);var s=o;return s._p=new Promise(function(e,t){s.onload=e,s.onerror=t}),ef(o,`link`,r),t.state.loading|=4,rp(o,n.precedence,e),t.instance=o;case`script`:return o=ep(n.src),(a=e.querySelector(tp(o)))?(t.instance=a,Et(a),a):(r=n,(a=Pf.get(o))&&(r=p({},n),ap(r,a)),e=e.ownerDocument||e,a=e.createElement(`script`),Et(a),ef(a,`link`,r),e.head.appendChild(a),t.instance=a);case`void`:return null;default:throw Error(i(443,t.type))}else t.type===`stylesheet`&&!(t.state.loading&4)&&(r=t.instance,t.state.loading|=4,rp(r,n.precedence,e));return t.instance}function rp(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 lp(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 up(e){return!(e.type===`stylesheet`&&!(e.state.loading&3))}function dp(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=Xf(r.href),a=t.querySelector(Zf(i));if(a){t=a._p,typeof t==`object`&&t&&typeof t.then==`function`&&(e.count++,e=mp.bind(e),t.then(e,e)),n.state.loading|=4,n.instance=a,Et(a);return}a=t.ownerDocument||t,r=Qf(r),(i=Pf.get(i))&&ip(r,i),a=a.createElement(`link`),Et(a);var o=a;o._p=new Promise(function(e,t){o.onload=e,o.onerror=t}),ef(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=mp.bind(e),t.addEventListener(`load`,n),t.addEventListener(`error`,n))}}var fp=0;function pp(e,t){return e.stylesheets&&e.count===0&&gp(e,e.stylesheets),0fp?50:800)+t);return e.unsuspend=n,function(){e.unsuspend=null,clearTimeout(r),clearTimeout(i)}}:null}function mp(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)gp(this,this.stylesheets);else if(this.unsuspend){var e=this.unsuspend;this.unsuspend=null,e()}}}var hp=null;function gp(e,t){e.stylesheets=null,e.unsuspend!==null&&(e.count++,hp=new Map,t.forEach(_p,e),hp=null,mp.call(e))}function _p(e,t){if(!(t.state.loading&4)){var n=hp.get(e);if(n)var r=n.get(null);else{n=new Map,hp.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=Ke()}));function Je(e){return e[e.length-1]}function Ye(e,t){return typeof e==`function`?e(t):e}var Xe=Object.prototype.hasOwnProperty,Ze=Object.prototype.propertyIsEnumerable;function Qe(e){for(let t in e)if(Xe.call(e,t))return!0;return!1}var $e=()=>Object.create(null),et=(e,t)=>tt(e,t,$e);function tt(e,t,n=()=>({}),r=0){if(e===t)return e;if(r>500)return t;let i=t,a=at(e)&&at(i);if(!a&&!(rt(e)&&rt(i)))return i;let o=a?e:nt(e);if(!o)return i;let s=a?i:nt(i);if(!s)return i;let c=o.length,l=s.length,u=a?Array(l):n(),d=0;for(let t=0;ti||!ot(e[o],t[o],n)))return!1;return i===a}return!1}function st(e){return typeof e?.message==`string`?e.message.startsWith(`Failed to fetch dynamically imported module`)||e.message.startsWith(`error loading dynamically imported module`)||e.message.startsWith(`Importing a module script failed`):!1}var ct=/[\x00-\x1f\x7f"<>`{}]/g;function lt(e){return e.replace(ct,e=>`%`+e.charCodeAt(0).toString(16).toUpperCase().padStart(2,`0`))}function ut(e){let t;try{t=decodeURI(e)}catch{t=e.replaceAll(/%[0-9A-F]{2}/gi,e=>{try{return decodeURI(e)}catch{return e}})}return lt(t)}var dt=[`http:`,`https:`,`mailto:`,`tel:`];function ft(e,t){if(!e)return!1;try{let n=new URL(e);return!t.has(n.protocol)}catch{return!1}}function pt(e){if(!e||!/[%\\\x00-\x1f\x7f]/.test(e)&&!e.startsWith(`//`))return{path:e,handledProtocolRelativeURL:!1};let t=/%25|%5C/gi,n=0,r=``,i;for(;(i=t.exec(e))!==null;)r+=ut(e.slice(n,i.index))+i[0],n=t.lastIndex;r+=ut(n?e.slice(n):e);let a=!1;return r.startsWith(`//`)&&(a=!0,r=`/`+r.replace(/^\/+/,``)),{path:r,handledProtocolRelativeURL:a}}function mt(e){return/\s|[^\u0000-\u007F]/.test(e)?e.replace(/\s|[^\u0000-\u007F]/gu,encodeURIComponent):e}function ht(e,t){if(e===t)return!0;if(e.length!==t.length)return!1;for(let n=0;n{e.next&&(e.prev?(e.prev.next=e.next,e.next.prev=e.prev,e.next=void 0,r&&(r.next=e,e.prev=r)):(e.next.prev=void 0,n=e.next,e.next=void 0,r&&(e.prev=r,r.next=e)),r=e)};return{get(e){let n=t.get(e);if(n)return i(n),n.value},set(a,o){if(t.size>=e&&n){let e=n;t.delete(e.key),e.next&&(n=e.next,e.next.prev=void 0),e===r&&(r=void 0)}let s=t.get(a);if(s)s.value=o,i(s);else{let e={key:a,value:o,prev:r};r&&(r.next=e),r=e,n||=e,t.set(a,e)}},clear(){t.clear(),n=void 0,r=void 0}}}var vt=4,yt=5;function bt(e,t,n=new Uint16Array(6)){let r=e.indexOf(`/`,t),i=r===-1?e.length:r,a=e.substring(t,i);if(!a||!a.includes(`$`))return n[0]=0,n[1]=t,n[2]=t,n[3]=i,n[4]=i,n[5]=i,n;if(a===`$`){let r=e.length;return n[0]=2,n[1]=t,n[2]=t,n[3]=r,n[4]=r,n[5]=r,n}if(a.charCodeAt(0)===36)return n[0]=1,n[1]=t,n[2]=t+1,n[3]=i,n[4]=i,n[5]=i,n;let o=a.indexOf(`{`),s;if(o!==-1&&o+1!e.parse&&e.caseSensitive===p&&e.prefix===t&&e.suffix===c);if(h)n=h;else{let e=wt(f,r,p,t,c);n=e,e.parent=i,e.depth=a;let s;s=f===1?i.dynamic??=[]:f===3?i.optional??=[]:i.wildcard??=[],s.push(e),s.length===2&&o?.push(s)}break}}i=n}if(d&&n.children&&!n.isRoot&&n.id&&n.id.charCodeAt(n.id.lastIndexOf(`/`)+1)===95){let e=Ct(r);e.kind=yt,e.parent=i,a++,e.depth=a,i.pathless??=[],i.pathless.push(e),i=e}let f=(n.path||!n.children)&&!n.isRoot;if(f&&r.endsWith(`/`)){let e=Ct(r);e.kind=vt,e.parent=i,a++,e.depth=a,i.index=e,i=e}i.parse=d??null,i.priority=s?.params?.priority??0,f&&!i.route&&(i.route=n,i.fullPath=r)}if(n.children)for(let r of n.children)xt(e,t,r,c,i,a,o,s)}function St(e,t){if(e.parse&&!t.parse)return-1;if(!e.parse&&t.parse)return 1;if(e.parse&&t.parse&&(e.priority||t.priority))return t.priority-e.priority;if(e.prefix&&t.prefix&&e.prefix!==t.prefix){if(e.prefix.startsWith(t.prefix))return-1;if(t.prefix.startsWith(e.prefix))return 1}if(e.suffix&&t.suffix&&e.suffix!==t.suffix){if(e.suffix.endsWith(t.suffix))return-1;if(t.suffix.endsWith(e.suffix))return 1}return e.prefix&&!t.prefix?-1:!e.prefix&&t.prefix?1:e.suffix&&!t.suffix?-1:!e.suffix&&t.suffix?1:e.caseSensitive&&!t.caseSensitive?-1:!e.caseSensitive&&t.caseSensitive?1:0}function Ct(e){return{kind:0,depth:0,pathless:null,index:null,static:null,staticInsensitive:null,dynamic:null,optional:null,wildcard:null,route:null,fullPath:e,parent:null,parse:null,priority:0}}function wt(e,t,n,r,i){return{kind:e,depth:0,pathless:null,index:null,static:null,staticInsensitive:null,dynamic:null,optional:null,wildcard:null,route:null,fullPath:t,parent:null,parse:null,priority:0,caseSensitive:n,prefix:r,suffix:i}}function Tt(e,t){let n=Ct(`/`),r=new Uint16Array(6),i=[];for(let t of e)xt(!1,r,t,1,n,0,i);for(let e of i)e.sort(St);t.masksTree=n,t.flatCache=_t(1e3)}function Et(e,t){e||=`/`;let n=t.flatCache.get(e);if(n!==void 0)return n;let r=jt(e,t.masksTree);return t.flatCache.set(e,r),r}function Dt(e,t,n,r,i){e||=`/`,r||=`/`;let a=t?`case\0${e}`:e,o=i.singleCache.get(a);return o||(o=Ct(`/`),xt(t,new Uint16Array(6),{from:e},1,o,0),i.singleCache.set(a,o)),jt(r,o,n)}function Ot(e,t,n=!1){let r=n?e:`nofuzz\0${e}`,i=t.matchCache.get(r);if(i!==void 0)return i;e||=`/`;let a;try{a=jt(e,t.segmentTree,n)}catch(e){if(e instanceof URIError)a=null;else throw e}return a&&(a.branch=Nt(a.route)),t.matchCache.set(r,a),a}function kt(e){return e===`/`?e:e.replace(/\/{1,}$/,``)}function At(e,t=!1,n){let r=Ct(e.fullPath),i=new Uint16Array(6),a=[],o={},s={},c=0;xt(t,i,e,1,r,0,a,e=>{if(n?.(e,c),e.id in o&>(),o[e.id]=e,c!==0&&e.path){let t=kt(e.fullPath);(!s[t]||e.fullPath.endsWith(`/`))&&(s[t]=e)}c++});for(let e of a)e.sort(St);return{processedTree:{segmentTree:r,singleCache:_t(1e3),matchCache:_t(1e3),flatCache:null,masksTree:null},routesById:o,routesByPath:s}}function jt(e,t,n=!1){let r=e.split(`/`),i=Ft(e,r,t,n);if(!i)return null;let[a]=Mt(e,r,i);return{route:i.node.route,rawParams:a}}function Mt(e,t,n){let r=Pt(n.node),i=null,a=Object.create(null),o=n.extract?.part??0,s=n.extract?.node??0,c=n.extract?.path??0,l=n.extract?.segment??0;for(;s=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===vt)>(e.node.kind===vt)||t.node.kind===vt==(e.node.kind===vt)&&t.node.depth>e.node.depth)))}function Bt(e){return Vt(e.filter(e=>e!==void 0).join(`/`))}function Vt(e){return e.replace(/\/{2,}/g,`/`)}function Ht(e){return e===`/`?e:e.replace(/^\/{1,}/,``)}function Ut(e){let t=e.length;return t>1&&e[t-1]===`/`?e.replace(/\/{1,}$/,``):e}function Wt(e){return Ut(Ht(e))}function Gt(e,t){return e?.endsWith(`/`)&&e!==`/`&&e!==`${t}/`?e.slice(0,-1):e}function Kt(e,t,n){return Gt(e,n)===Gt(t,n)}function qt({base:e,to:t,trailingSlash:n=`never`,cache:r}){if(t.includes(`//`)&&(t=Vt(t)),t.startsWith(`/`))return t.length===1||n===`preserve`?t:n===`always`?t.endsWith(`/`)?t:`${t}/`:t.endsWith(`/`)?t.slice(0,-1):t;let i=t===`.`,a;if(r){a=i?e:e+`\0`+t;let n=r.get(a);if(n)return n}let o;if(i)o=e.split(`/`);else{for(e.includes(`//`)&&(e=Vt(e)),o=e.split(`/`);o.length>1&&Je(o)===``;)o.pop();let n=t.split(`/`);for(let e=0,t=n.length;e1?o.pop():o=[``]:r===`.`||o.push(r)}}o.length>1&&(Je(o)===``?n===`never`&&o.pop():n===`always`&&o.push(``));let s=o.join(`/`),c=(i?Vt(s):s)||`/`;return a&&r&&r.set(a,c),c}function Jt(e){let t=new Map(e.map(e=>[encodeURIComponent(e),e])),n=Array.from(t.keys()).map(e=>e.replace(/[.*+?^${}()|[\]\\]/g,`\\$&`)).join(`|`),r=new RegExp(n,`g`);return e=>e.replace(r,e=>t.get(e)??e)}function Yt(e,t,n){let r=t[e];return typeof r==`string`?e===`_splat`?/^[a-zA-Z0-9\-._~!/]*$/.test(r)?r:r.split(`/`).map(e=>Zt(e,n)).join(`/`):Zt(r,n):r}function Xt({path:e,params:t,decoder:n,...r}){let i=!1,a=Object.create(null);if(!e||e===`/`)return{interpolatedPath:`/`,usedParams:a,isMissingParams:i};if(!e.includes(`$`))return{interpolatedPath:e,usedParams:a,isMissingParams:i};let o=e.length,s=0,c,l=``;for(;se.state.__TSR_key||e.href;function cn(e){let t=e.getAttribute(on);if(t)return`[${on}="${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 ln=!1,un=`window`;function dn(e){try{return typeof e==`function`?e():document.querySelector(e)}catch{}}function fn(e){let t=new Set;for(let n of e){if(n===un)continue;let e=dn(n);e&&t.add(e)}return t}function pn(e,t){let n=t??e.options.scrollRestoration,r=e._scroll;n&&(r.restoring=!0);let i=e.options.getScrollRestorationKey||sn,a=new Set,o=e=>{let t=an[e]||={};for(let e of a)e===document?t[un]={scrollX,scrollY}:e.isConnected&&(t[cn(e)]={scrollX:e.scrollLeft,scrollY:e.scrollTop})};n&&!r.restoration&&(r.restoration=!0,ln=!1,history.scrollRestoration=`manual`,document.addEventListener(`scroll`,e=>{ln||a.add(e.target)},!0),e.subscribe(`onBeforeLoad`,e=>{e.fromLocation&&o(i(e.fromLocation)),a.clear()}),addEventListener(`pagehide`,()=>{o(i(e.stores.resolvedLocation.get()??e.stores.location.get())),rn()})),!r.reset&&(r.reset=!0,e.subscribe(`onRendered`,t=>{let n=e.options.scrollRestorationBehavior,o=e.options.scrollToTopSelectors,s=r.next,c=r.hash,l;if(a.clear(),r.next=!0,r.hash=!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.restoring&&d&&d!==u){let e=an[d];if(e){let t=an[u];for(let n in e){if(n===un){if(s)continue}else{let e=dn(n);if(!e||s&&o&&(l??=fn(o),l.has(e)))continue}t||=an[u]={},t[n]??=e[n]}}}ln=!0;try{let e=t.toLocation.hash,i=t.toLocation.state.__hashScrollIntoViewOptions??!0,a=!1;if(s){!e&&o&&(l??=fn(o));let t=e&&i&&c,s=r.restoring?an[u]:void 0;if(s)for(let e in s){let{scrollX:r,scrollY:i}=s[e];if(e===un){if(t)continue;scrollTo({top:i,left:r,behavior:n}),a=!0}else{let t=dn(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{ln=!1}}))}function mn(e,t=String){let n=new URLSearchParams;for(let r in e){let i=e[r];i!==void 0&&n.set(r,t(i))}return n.toString()}function hn(e){return e?e===`false`?!1:e===`true`?!0:e*0==0&&+e+``===e?+e:e:``}function gn(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]=hn(r):Array.isArray(t)?t.push(hn(r)):n[e]=[t,hn(r)]}return n}var _n=/^(?:\s|["[{\d-]|fa|nu|tr)/,vn=bn(JSON.parse),yn=xn(JSON.stringify,JSON.parse);function bn(e){return t=>{t[0]===`?`&&(t=t.substring(1));let n=gn(t);for(let t in n){let r=n[t];if(typeof r==`string`)try{n[t]=e(r)}catch{}}return n}}function xn(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&&!_n.test(r))return r;try{return t(r),e(r)}catch{}}return r}return e=>{let t=mn(e,r);return t?`?${t}`:``}}var Sn=`__root__`;function Cn(e){if(e.statusCode=e.statusCode||e.code||307,!e.reloadDocument&&typeof e.href==`string`)try{new URL(e.href),e.reloadDocument=!0}catch{}let t=new Headers(e.headers);e.href&&t.get(`Location`)===null&&t.set(`Location`,e.href);let n=new Response(null,{status:e.statusCode,headers:t});if(n.options=e,e.throw)throw n;return n}function wn(e){return e instanceof Response&&!!e.options}function Tn(e){return{input:({url:t})=>{for(let n of e)t=Dn(n,t);return t},output:({url:t})=>{for(let n=e.length-1;n>=0;n--)t=On(e[n],t);return t}}}function En(e){let t=Wt(e.basepath),n=`/${t}`,r=e.caseSensitive?n:n.toLowerCase(),i=`${r}/`;return{input:({url:t})=>{let a=e.caseSensitive?t.pathname:t.pathname.toLowerCase();return a===r?t.pathname=`/`:a.startsWith(i)&&(t.pathname=t.pathname.slice(n.length)),t},output:({url:e})=>(e.pathname=Bt([`/`,t,e.pathname]),e)}}function Dn(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 On(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 kn(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(()=>{ht(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 An=`__TSR_index`,jn=`popstate`,Mn=`beforeunload`;function Nn(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=Ln(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[An];i=Pn(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[An];i=Pn(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),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[An]!==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}}function Pn(e,t){t||={};let n=Rn();return{...t,key:n,__TSR_key:n,[An]:e}}function Fn(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=e?.createHref??(e=>e),c=e?.parseLocation??(()=>Ln(`${t.location.pathname}${t.location.search}${t.location.hash}`,t.history.state));if(!t.history.state?.__TSR_key&&!t.history.state?.key){let e=Rn();t.history.replaceState({[An]:0,key:e,__TSR_key:e},``)}let l=c(),u,d=!1,f=!1,p=!1,m=!1,h=()=>l,g,_=()=>{g&&(S._ignoreSubscribers=!0,(g[2]?t.history.pushState:t.history.replaceState)(g[1],``,g[0]),S._ignoreSubscribers=!1,g=void 0,u=void 0)},v=(e,t,n)=>{let r=s(t),i=!!g;i||(u=l),l=Ln(t,n),g=[r,n,g?.[2]||e],i||queueMicrotask(()=>_())},y=e=>{l=c(),S.notify({type:e})},b=async()=>{if(f){f=!1;return}let e=c(),n=e.state[An]-l.state[An],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 n=a();if(typeof document<`u`&&n.length){for(let r of n)if(await r.blockerFn({currentLocation:l,nextLocation:e,action:s})){f=!0,t.history.go(1),S.notify(u);return}}}l=c(),S.notify(u)},x=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=``},S=Nn({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=>{d=!0,t.history.go(e)},createHref:e=>s(e),flush:_,destroy:()=>{t.history.pushState=n,t.history.replaceState=r,t.removeEventListener(Mn,x,{capture:!0}),t.removeEventListener(jn,b)},onBlocked:()=>{u&&l!==u&&(l=u)},getBlockers:a,setBlockers:o,notifyOnIndexChange:!1});return t.addEventListener(Mn,x,{capture:!0}),t.addEventListener(jn,b),t.history.pushState=function(...e){let r=n.apply(t.history,e);return S._ignoreSubscribers||y(`PUSH`),r},t.history.replaceState=function(...e){let n=r.apply(t.history,e);return S._ignoreSubscribers||y(`REPLACE`),n},S}function In(e){let t=e.replace(/[\x00-\x1f\x7f]/g,``);return t.startsWith(`//`)&&(t=`/`+t.replace(/^\/+/,``)),t}function Ln(e,t){let n=In(e),r=n.indexOf(`#`),i=n.indexOf(`?`),a=Rn();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||{[An]:0,key:a,__TSR_key:a}}}function Rn(){return(Math.random()+1).toString(36).substring(7)}function zn(e){return e.options.loader||e.options.beforeLoad||e.lazyFn||e.options.component?.preload||e.options.pendingComponent?.preload}function Bn(e,t){return{fromLocation:t,toLocation:e,pathChanged:t?.pathname!==e.pathname,hrefChanged:t?.href!==e.href,hashChanged:t?.hash!==e.hash}}function Vn({key:e,__TSR_key:t,__TSR_index:n,__hashScrollIntoViewOptions:r,...i}){return i}function Hn(e,t,n,r){for(let i of t){if(r&&e._tx!==r)return;n.some(e=>e.routeId===i.routeId)||e.routesById[i.routeId].options.onLeave?.(i)}for(let i of n){if(r&&e._tx!==r)return;e.routesById[i.routeId].options[t.some(e=>e.routeId===i.routeId)?`onStay`:`onEnter`]?.(i)}}var Un=class{constructor(e,t){this.tempLocationKey=`${Math.round(Math.random()*1e7)}`,this._scroll={next:!0},this.subscribers=new Set,this._cache=new Map,this._committed=[],this.routeBranchCache=new WeakMap,this.lightweightCache=new WeakMap,this.startTransition=async e=>(e(),!1),this.update=e=>{let t=this.options,n=this.basepath??t?.basepath??`/`,r=this.basepath===void 0,i=t?.rewrite;if(this.options={...t,...e},this.isServer=this.options.isServer??!1??typeof document>`u`,this.protocolAllowlist=new Set(this.options.protocolAllowlist),this.options.pathParamsAllowedCharacters&&(this.pathParamsDecoder=Jt(this.options.pathParamsAllowedCharacters)),(!this.history||this.options.history&&this.options.history!==this.history)&&(this.history=this.options.history?this.options.history:Fn()),this.origin=this.options.origin,this.origin||=window?.origin&&window.origin!==`null`?window.origin:`http://localhost`,this.history&&this.updateLatestLocation(),this.options.routeTree!==this.routeTree){this.routeTree=this.options.routeTree;let e;this.resolvePathCache=_t(1e3),e=this.buildRouteTree(),this.setRoutes(e)}if(!this.stores&&this.latestLocation){let e=this.getStoreConfig(this);this.batch=e.batch,this.stores=kn(this.latestLocation,e),pn(this)}let a=this.options.basepath??`/`,o=this.options.rewrite;if(r||n!==a||i!==o){this.basepath=a;let e=[],t=Wt(a);t&&t!==`/`&&e.push(En({basepath:a})),o&&e.push(o),this.rewrite=e.length===0?void 0:e.length===1?e[0]:Tn(e),this.history&&this.updateLatestLocation(),this.stores&&this.stores.location.set(this.latestLocation)}},this.updateLatestLocation=()=>{this.latestLocation=this.parseLocation(this.history.location,this.latestLocation)},this.buildRouteTree=()=>{let e=At(this.routeTree,this.options.caseSensitive,(e,t)=>{e.init({originalIndex:t})});return this.options.routeMasks&&Tt(this.options.routeMasks,e.processedTree),e},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,state: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:pt(e).path,external:!1,searchStr:o,search:et(t?.search,i),hash:pt(r.slice(1)).path,state:tt(t?.state,a)}}let o=new URL(i,this.origin),s=Dn(this.rewrite,o),c=this.options.parseSearch(s.search),l=this.options.stringifySearch(c);return s.search=l,{href:s.href.replace(s.origin,``),publicHref:i,pathname:pt(s.pathname).path,external:!!this.rewrite&&s.origin!==this.origin,searchStr:l,search:et(t?.search,c),hash:pt(s.hash.slice(1)).path,state:tt(t?.state,a)}},r=n(e),{__tempLocation:i,__tempKey:a}=r.state;if(i&&(!a||a===this.tempLocationKey)){let e=n(i);return e.state.key=r.state.key,e.state.__TSR_key=r.state.__TSR_key,delete e.state.__tempLocation,{...e,maskedLocation:r}}return r},this.resolvePathWithBase=(e,t)=>qt({base:e,to:t,trailingSlash:this.options.trailingSlash,cache:this.resolvePathCache}),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=Ot(Ut(e),this.processedTree,!0);return n&&Object.assign(t,n.rawParams),[n?.branch||[this.routesById.__root__],t,n?.route]},this.buildLocation=e=>{let t=(t={})=>{if(t.href){let e=Ln(t.href,{});t={...t,to:Dn(this.rewrite,new URL(e.pathname,this.origin)).pathname,search:this.options.parseSearch(e.search),hash:e.hash.slice(1)}}let n=t._fromLocation||this._pendingLocation||this.latestLocation,r=this.matchRoutesLightweight(n);t.from;let i=t.unsafeRelative===`path`?n.pathname:t.from??r[1],a=r[2],o=r[3],s=this.resolvePathWithBase(i,t.to?`${t.to}`:`.`),c=Yn(t.params,o),l=this.routesByPath[Ut(s)],u;if(l)u=this.getRouteBranch(l);else if(s.includes(`$`))u=[];else{let[e,t,n]=this.getMatchedRoutes(s);u=e,this.options.notFoundRoute&&(!n||n.path!==`/`&&t[`**`])&&(u=[...u,this.options.notFoundRoute])}if(u.length&&Qe(c))for(let e of u){let t=e.options.params?.stringify??e.options.stringifyParams;if(t){c===o&&(c=Object.assign(Object.create(null),c));try{Object.assign(c,t(c))}catch{}}}let d=e.leaveParams?s:pt(Xt({path:s,params:c,decoder:this.pathParamsDecoder,server:this.isServer}).interpolatedPath).path,f=a;if(e._includeValidateSearch&&this.options.search?.strict){let e={};u.forEach(t=>{if(t.options.validateSearch)try{Object.assign(e,Kn(t.options.validateSearch,{...e,...f}))}catch{}}),f=e}f=qn(f,t,u,e._includeValidateSearch),f=et(a,f);let p=this.options.stringifySearch(f),m=t.hash===!0?n.hash:t.hash?Ye(t.hash,n.hash):void 0,h=m?`#${m}`:``,g=t.state===!0?n.state:t.state?Ye(t.state,n.state):{};t.state&&(g=tt(n.state,g));let _=`${d}${p}${h}`,v,y,b=!1;if(this.rewrite){let e=new URL(_,this.origin),t=On(this.rewrite,e);v=e.href.replace(e.origin,``),t.origin===this.origin?y=t.pathname+t.search+t.hash:(y=t.href,b=!0)}else v=mt(_),y=v;return{publicHref:y,href:v,pathname:d,search:f,searchStr:p,state:g,hash:m??``,external:b,unmaskOnReload:t.unmaskOnReload}},n=t(e);if(e.mask)n.maskedLocation=t({from:e.from,...e.mask});else if(this.options.routeMasks){let r=Et(n.pathname,this.processedTree);if(r){let i=Object.assign(Object.create(null),r.rawParams),{from:a,params:o,...s}=r.route,c=Yn(o,i);n.maskedLocation=t({from:e.from,...s,params:c})}}return n},this.commitLocation=async({viewTransition:e,ignoreBlocker:t,...n})=>{let r,i=Ut(this.latestLocation.href)===Ut(n.href)&&ot(Vn(n.state),Vn(this.latestLocation.state)),a=this._commitPromise,o,s=new Promise(e=>{o=e});if(s.resolve=()=>{o(),a?.resolve()},this._commitPromise=s,i)this.load();else{let{maskedLocation:i,hashScrollIntoView:a,...o}=n;i&&(o={...i,state:{...i.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.__hashScrollIntoViewOptions=a??this.options.defaultHashScrollIntoView??!0,this.shouldViewTransition=e,r=n.replace?`REPLACE`:`PUSH`,this.history[r===`REPLACE`?`replace`:`push`](o.publicHref,o.state,{ignoreBlocker:t}),this.history.subscribers.size||this.load({action:{type:r}})}return this._scroll.next=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=!1;if(n)try{new URL(`${n}`),a=!0}catch{}if(a&&!t&&(t=!0),t){if(e!==void 0||!n){let t=this.buildLocation({to:e,...i});n??=t.publicHref,r??=t.publicHref}let t=!a&&r?r:n;if(ft(t,this.protocolAllowlist))return;if(!i.ignoreBlocker){let e=this.history.getBlockers?.()??[];for(let t of e)if(t?.blockerFn&&await t.blockerFn({currentLocation:this.latestLocation,nextLocation:this.latestLocation,action:`PUSH`}))return}i.replace?window.location.replace(t):window.location.href=t;return}return this.buildAndCommitLocation({...i,href:n,to:e,_isNavigate:!0})},this.load=async e=>{this.updateLatestLocation(),e?.action&&(this._scroll.hash=e.action.type===`PUSH`||e.action.type===`REPLACE`),await Br(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(Bn(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([...t,...this._cache.values(),...[...r?.values()??[]].flat(),...this._tx?.[3]??[]].filter(e=>!n||n(e)).map(e=>e.id)),a=[];for(let[e,t]of r??[])t.some(e=>i.has(e.id))&&(r.delete(e),a.push(e));let o=t=>{if(i.has(t.id)){let n=this.routesById[t.routeId],r={...t,invalid:!0,...(e?.forcePending||t.status===`error`||t.status===`notFound`)&&zn(n)?{status:`pending`,error:void 0}:void 0};return t._flight=void 0,r}return t};this._committed=t.map(o);for(let[t,n]of this._cache)i.has(t)&&(n.invalid=!0,e?.forcePending&&(n.status=`pending`));for(let e of i)this._flights?.delete(e);for(let e of a)e.abort();return this.shouldViewTransition=!1,this.load({sync:e?.sync})},this.resolveRedirect=e=>{let t=e.headers.get(`Location`);if(!e.options.href){let t=this.buildLocation(e.options).publicHref||`/`;e.options.href=t,e.headers.set(`Location`,t)}else if(t)try{let n=new URL(t);if(this.origin&&n.origin===this.origin){let t=n.pathname+n.search+n.hash;e.options.href=t,e.headers.set(`Location`,t)}}catch{}if(e.options.href&&ft(e.options.href,this.protocolAllowlist))throw Error(`Redirect blocked: unsafe protocol`);return e.headers.get(`Location`)||e.headers.set(`Location`,e.options.href),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=$n,this.preloadRoute=e=>Vr(this,e),this.matchRoute=(e,t)=>{let n={...e,to:e.to?this.resolvePathWithBase(e.from||``,e.to):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=Dt(r.pathname,t?.caseSensitive??!1,t?.fuzzy??!1,a.pathname,this.processedTree);return!o||e.params&&!ot(o.rawParams,e.params,{partial:!0})?!1:t?.includeSearch??!0?ot(a.search,r.search,{partial:!0})?o.rawParams:!1:o.rawParams},this.getStoreConfig=t,this.update({defaultPreloadDelay:50,defaultPendingMs:1e3,defaultPendingMinMs:500,context:void 0,...e,caseSensitive:e.caseSensitive??!1,notFoundMode:e.notFoundMode??`fuzzy`,stringifySearch:e.stringifySearch??yn,parseSearch:e.parseSearch??vn,protocolAllowlist:e.protocolAllowlist??dt}),self.__TSR_ROUTER__=this}isShell(){return!!this.options.isShell}get state(){return this.stores.__store.get()}setRoutes({routesById:e,routesByPath:t,processedTree:n}){this.routesById=e,this.routesByPath=t,this.processedTree=n;let r=this.options.notFoundRoute;r&&(r.init({originalIndex:99999999999}),this.routesById[r.id]=r)}getRouteBranch(e){let t=this.routeBranchCache.get(e);return t||(t=Nt(e),this.routeBranchCache.set(e,t)),t}matchRoutesInternal(e,t){let[n,r,i]=this.getMatchedRoutes(e.pathname),a=n,o=!1;(i?i.path!==`/`&&r[`**`]:Ut(e.pathname))&&(this.options.notFoundRoute?a=[...a,this.options.notFoundRoute]:o=!0);let s=o?Jn(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;n{let r=n(t.preSearchFilters?t.preSearchFilters.reduce((e,t)=>t(e),e):e);return t.postSearchFilters?t.postSearchFilters.reduce((e,t)=>t(e),r):r});let n=t.validateSearch;r&&n&&i.push(({search:e,next:t,meta:r})=>{let i=t(e);try{let e=Kn(n,i);if(r&&e)for(let t in e)t in i||(r.defaulted||=new Map).set(t,e[t]);return{...i,...e}}catch{}return i})}let a=(e,n,r)=>{if(e>=i.length){if(!t.search)return{};if(t.search===!0)return n;let e=Ye(t.search,n);return r&&(r.explicit=e),e}return i[e]({search:n,next:(t,n)=>{if(n){let n=r||{};return{search:a(e+1,t,n),meta:n}}return a(e+1,t,r)},meta:r})};return a(0,e)}function Jn(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 Sn}function Yn(e,t){if(e===!1||e===null)return Object.create(null);if((e??!0)===!0)return t;let n=Object.assign(Object.create(null),t);return Object.assign(n,Ye(e,n))}function Xn(e,t){let n=e.options.params?.parse??e.options.parseParams;n&&Object.assign(t,n(t))}function Zn(e,t){return e.options[t]?.preload?.()}function Qn(e,t){let n=Zn(e,`component`),r=Zn(e,`pendingComponent`);return t&&(r?r=r.then(t):t()),n&&r?Promise.all([n,r]).then(()=>{}):n??r}function $n(e,t,n){let r=()=>t===!1?void 0:t?Zn(e,t):Qn(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 er(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).finally(()=>t.removeEventListener(`abort`,i))})}function cr(e,t){return e.routesById[t.routeId]}function lr(e,t,n){return wn(e)?[ir,e]:Qt(e)?(e.routeId||=n,[rr,e]):t?(typeof e?.then==`function`&&(e=Error(`A Promise was thrown`,{cause:e})),[nr,e]):[tr,e]}function ur(e,t){let n=lr(t,!0,e.id);if(n[0]!==nr)return n;try{e.options.onError?.(n[1])}catch(t){n=lr(t,!0,e.id)}return n}function dr(e,t,n,r,i){return i[0].signal.aborted?ar:Dr(e,t,n,ur(n,r),i)}async function fr(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 mr(e,r),[i,dr(e,t,u,a,n)]}if(c.aborted)return[i,ar];let p=r.paramsError??r.searchError;if(p!==void 0)return mr(e,r),[i,dr(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{_r(e,r,`beforeLoad`,n[0]);let a=await sr(m({...f,search:r.search,context:r.context,...e.options.additionalContext}),c);if(c.aborted)return[i,ar];let o=Dr(e,t,u,lr(a,!1,u.id),n);if(o[0]!==tr)return mr(e,r),[i,o];r.context={...r.context,...a}}catch(a){return mr(e,r),[i,dr(e,t,u,a,n)]}finally{r.status=h,_r(e,r,!1,n[0])}}i()}function pr(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 mr(e,t){let n=t._flight;t._flight=void 0,pr(e,t,n)?.abort()}function hr(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=pr(e,a,t);n&&i.push(n)}}for(let e of i)e.abort()}function gr(e){for(let t of e){let e=t._flight;e&&e[2]++}}function _r(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 vr(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 yr(e,t,n,r,i,a,o){let s=o[0],c=s.signal;if(c.aborted)return ar;if(!i)return[tr,void 0];let l=n._flight;_r(e,n,`loader`,s);try{if(!l){let s=new AbortController;l=[Promise.resolve().then(()=>i(vr(e,t,n,r,s,a,!!o[3]))).then(e=>lr(e,!1,r.id),e=>lr(e,!0,r.id)).then(t=>(t[0]!==tr&&e._flights?.get(n.id)===l&&(e._flights.delete(n.id),l[2]||s.abort()),t[0]===nr&&l[2]?ur(r,t[1]):t)),s,1],(e._flights??=new Map).set(n.id,l)}return n._flight=l,n.abortController=l[1],Dr(e,t,r,await sr(l[0],c),o)}catch(t){if(t!==c||!c.aborted)throw t;return mr(e,n),ar}finally{_r(e,n,!1,s)}}function br(e,t,n){t[0]!==ir&&(e.status=`success`,e.error=void 0,t[0]===tr?(e.loaderData=t[1],e.invalid=!1,e.updatedAt=Date.now(),e.preload=n):e.invalid=!0)}function xr(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&&mr(e,r)}function Sr(e,t){return t[0]===nr||t[0]===rr?{...e,status:t[0]===nr?`error`:`notFound`,error:t[1],_flight:void 0}:e}function Cr(e,t,n,r,i,a,o){let s=t[1][n],c=cr(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(vr(e,t,s,c,a[0],i,l))),a[0].signal.aborted&&(p=ar)),!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,mr(e,s),p=dr(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&&_,x=b&&!y&&(s.status!==`success`||!!m),S=n>=o?a[7]:void 0,C=c.lazyFn&&c._lazy!==!0?S:void 0;if(b&&!m&&(s.invalid=!1,s.updatedAt=Date.now()),v&&v[2]++,x){let t=s._flight;s._flight=v,pr(e,s,t)?.abort(),n>=o&&(s.status=`pending`),S?.()}b||(s.isFetching=!1);let w=(p?Promise.resolve(p):x?yr(e,t,s,c,g,i,a):Promise.resolve([tr,s.loaderData])).then(t=>(x&&(br(s,t,l),t[0]===tr&&(m&&!a[0].signal.aborted&&xr(e,s,u),n>=o&&(s.status=`pending`))),t)),T=sr(Promise.resolve().then(()=>$n(c,void 0,C)),a[0].signal).then(()=>void 0,r=>t[1].some((e,t)=>t<=n&&(e.status===`error`||e.status===`notFound`||e._notFound))?void 0:[n,dr(e,t,c,r,a)]).then(e=>w.then(t=>(x&&!e&&t[0]===tr&&s.status===`pending`&&!a[0].signal.aborted&&(s.status=`success`,S?.()),e)));if(r.push([n,w,T]),!y)return w.then(e=>Sr(s,e));let E={...s,status:`pending`,preload:!1,_flight:v};s.invalid=!1,s.isFetching=`loader`;let D=yr(e,t,E,c,g,i,a).then(e=>(s.isFetching=!1,br(E,e,!1),e));return(t[2]??=[]).push([n,D,T,E]),D.then(e=>Sr(E,e))}async function wr(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=cr(e,t[n]);try{let e=$n(i,!1);e&&await sr(e,r)}catch(e){if(e===r&&r.aborted)throw e}if(i.options.notFoundComponent)return n}return a?.routeId?o:i}function Tr(e,t){t[2]&&=(hr(e,t[2].map(e=>e[3])),void 0)}async function Er(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]>=ir)throw[a,t];!i&&t[0]!==tr&&(i=[a,t],await Promise.all((n??[]).map(e=>{if(!(e[0]<=a))return e[1].then(t=>{if(t[0]===ir)throw[e[0],t]})})))}})))}catch(e){return e}return t??i}function Dr(e,t,n,r,i,a){for(;r[0]===ir;){let o=r[1],s=o.options;if(s.reloadDocument?i[3]:i[1]>=20)return r;try{return s.href&&s.reloadDocument?(e.resolveRedirect(o),r):[ir,o,e.buildLocation({...s,_fromLocation:t[0],_includeValidateSearch:!0})]}catch(e){r=a?[nr,e]:ur(n,e),a=!0}}return r}async function Or(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]===rr?wr(e,o,t,r.signal):t[0],d=l<0?o.length:l;if((s?.[1][0]??0)>=ir)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]!==tr&&t[0]=d)break;let t=await e[2];if(t){s=t;break}}if((s?.[1][0]??0)>=ir){let n=s[1];if(n[0]!==ir||n[1].options.reloadDocument||n[2])return Tr(e,t),n;c=!0,s=[0,[nr,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===nr?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=cr(e,u);try{await sr(i?Promise.resolve().then(()=>$n(m,l===nr?`errorComponent`:`notFoundComponent`)):Promise.all([$n(m),$n(m,`notFoundComponent`)]),r.signal)}catch(n){if(n===r.signal&&r.signal.aborted)return Tr(e,t),ar}i?c&&(r.abort(),await Promise.all([...n.map(e=>e[1]),...n.map(e=>e[2]),...(t[2]??[]).map(e=>e[1])]),Tr(e,t),hr(e,o),p()):u.status=`success`}return t}async function kr(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 wr(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=ir&&(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=Or(e,i,u,r[0],Er(u,m,i[2]),r[7]);i[2]?.length&&(i[3]=Er(i[2],void 0,void 0,h.then(e=>or(e)?0:er(n).length,()=>0))),o=await h}catch(t){if(Tr(e,i),t===a&&a.aborted)return ar;throw t}return or(o)?o:kr(e,o,a,r[6]===n.length?r[6]:0)}function jr(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(()=>jr(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 Mr(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 Nr(e,t){let n=e._pending;if(!n)return;clearTimeout(n[3]);let r=n[2]-Date.now();if(!n[4]||r<=0||!er(t[3]).some(e=>e.id===n[1]))return;let i;try{await sr(new Promise(e=>{i=setTimeout(e,r)}),t[0].signal)}catch{}clearTimeout(i)}function Pr(e,t){e._committed=t,e.stores.setMatches(t)}function Fr(e,t,n,r){let i=e._committed,a=e._cache;for(let e of n)e.preload=!1,r&&(e._assetEnd=void 0);let o=er(n).length,s=new Map;{let t=Date.now();for(let r of[...i,...a.values()]){if(r.status!==`success`||n.some((e,t)=>e.id===r.id&&(t=(r.preload?i.options.preloadGcTime??e.options.defaultPreloadGcTime??3e5:i.options.gcTime??e.options.defaultGcTime??3e5)||s.set(r.id,a.get(r.id)===r?r:{...r,_flight:void 0,isFetching:!1,context:{}})}}t[3]=[],e._cache=s,Pr(e,n),hr(e,[...a.values(),...i],[...n,...s.values()]),Hn(e,i,n,t)}async function Ir(e,t){let n=e._tx;for(;n&&n!==t;){if(await n[5],e._tx===n)return;n=e._tx}}function Lr(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.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 Rr(e,t,n,r,i){let a=n.map(e=>({...e}));gr(a);for(let t of r)mr(e,a[t[0]]),a[t[0]]=t[3];let o=[t[2],a],s;try{s=await Or(e,o,r,t[0],i)}catch(t){throw hr(e,a),t}if(or(s)){hr(e,a),s[0]===ir&&e._tx===t&&e._committed===n&&await Lr(e,t,s);return}if(await kr(e,s,t[0].signal),e._tx!==t||e._committed!==n){hr(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),mr(e,n))}Pr(e,a),hr(e,n,a)}async function zr(e,t,n,r,i,a){let o=await Ar(e,t[2],t[3],[t[0],t[1],e._committed,void 0,i,n,a,r]);if(or(o)){let n=o[0]===ir&&e._tx===t;if((!n||o[1].options.reloadDocument)&&Mr(e,t),hr(e,t[3]),t[3]=[],!n)return;if(e._tx!==t){Mr(e,t);return}await Lr(e,t,o);return}let s=o[1];if(e._tx===t&&await Nr(e,t),e._tx!==t){Mr(e,t),hr(e,s),Tr(e,o);return}let c=t[2],l=Bn(c,e.stores.resolvedLocation.get()),u=o[2];await e.startViewTransition(async()=>{if(e._tx===t&&await Nr(e,t),e._tx!==t){Mr(e,t),hr(e,s),Tr(e,o);return}let n=await e.startTransition(()=>{Mr(e,t),Fr(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){Tr(e,o);return}u?.length&&Rr(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 Br(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=Bn(a,r);e.emit({type:`onBeforeNavigate`,...t}),u.signal.aborted||e.emit({type:`onBeforeLoad`,...t})}if(u.signal.aborted){await Ir(e,n);return}let f=i.href===a.href,p=u,m=e.matchRoutes(a,{_controller:u});gr(m);let h=l?c[1](m):void 0;if(h?p=l:l?.abort(),u.signal.aborted){hr(e,m),await Ir(e,n);return}e._preflight=void 0;let g,_=()=>zr(e,y,f,()=>jr(e,y),t?.sync,h),v=t?.sync?new Promise(e=>g=e):Promise.resolve().then(_).then(),y=[p,s,a,m,Date.now(),v];if(e._tx=y,n){for(let t of e.stores.matches.get()){if(e._tx!==y)break;t.isFetching&&_r(e,t,!1)}n[0].abort(),hr(e,n[3],y[3],!0)}if(e._tx!==y){hr(e,y[3]),y[3]=[],g?.(),await Ir(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))&&jr(e,y),g?.(_()),await v,await Ir(e,y)}async function Vr(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}),gr(a),o=(e._preloads??=new Map).set(i,a),s=await Ar(e,n,a,[i,t,r,!0])}finally{o&&(o=o.delete(i),hr(e,a)),i.abort()}if(!or(s))return s[1];if(!o||s.length<3)return;n=s[2]}catch(e){Qt(e)||console.error(e);return}}}var Hr=`Error preloading route! ☝️`,Ur=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.originalIndex;let t=this.options,n=!t?.path&&!t?.id;this.parentRoute=this.options.getParentRoute?.(),n?this._path=Sn:this.parentRoute||gt();let r=n?Sn:t?.path;r&&r!==`/`&&(r=Ht(r));let i=t?.id||r,a=n?Sn:Bt([this.parentRoute.id===`__root__`?``:this.parentRoute.id,i]);r===`__root__`&&(r=`/`),a!==`__root__`&&(a=Bt([`/`,a]));let o=a===`__root__`?`/`:Bt([this.parentRoute.fullPath,r]);this._path=r,this._id=a,this._fullPath=o,this._to=Ut(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=>Cn({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.`)}},Wr=class extends Ur{constructor(e){super(e)}},M=r(f(),1),N=e(),Gr=class extends M.Component{constructor(...e){super(...e),this.state={error:null},this.reset=()=>{this.setState({error:null})}}static getDerivedStateFromProps(e,t){let n=e.getResetKey();return t.error&&t.resetKey!==n?{resetKey:n,error:null}:{resetKey:n}}static getDerivedStateFromError(e){return{error:e}}componentDidCatch(e,t){this.props.onCatch?.(e,t)}render(){let e=this.state.error;return e?M.createElement(this.props.errorComponent??Kr,{error:e,reset:this.reset}):this.props.children}};function Kr({error:e}){let[t,n]=M.useState(!1);return(0,N.jsxs)(`div`,{style:{padding:`.5rem`,maxWidth:`100%`},children:[(0,N.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:`.5rem`},children:[(0,N.jsx)(`strong`,{style:{fontSize:`1rem`},children:`Something went wrong!`}),(0,N.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,N.jsx)(`div`,{style:{height:`.25rem`}}),t?(0,N.jsx)(`div`,{children:(0,N.jsx)(`pre`,{style:{fontSize:`.7em`,border:`1px solid red`,borderRadius:`.25rem`,padding:`.3rem`,color:`red`,overflow:`auto`},children:e.message?(0,N.jsx)(`code`,{children:e.message}):null})}):null]})}function qr({children:e,fallback:t=null}){return(0,N.jsx)(M.Fragment,{children:Jr()?e:t})}function Jr(){return M.useSyncExternalStore(Yr,()=>!0,()=>!1)}function Yr(){return()=>{}}var Xr=M.createContext(void 0),Zr=M.createContext(void 0),Qr=(e=>(e[e.None=0]=`None`,e[e.Mutable=1]=`Mutable`,e[e.Watching=2]=`Watching`,e[e.RecursedCheck=4]=`RecursedCheck`,e[e.Recursed=8]=`Recursed`,e[e.Dirty=16]=`Dirty`,e[e.Pending=32]=`Pending`,e))(Qr||{});function $r({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(!0)}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(!0)}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 ei(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 ti=[],ni=0,{link:ri,unlink:ii,propagate:ai,checkDirty:oi,shallowPropagate:si}=$r({update(e){return e._update()},notify(e){ti[li++]=e,e.flags&=~Qr.Watching},unwatched(e){e.depsTail!==void 0&&(e.depsTail=void 0,e.flags=Qr.Mutable|Qr.Dirty,pi(e))}}),ci=0,li=0,ui,di=0;function fi(e){try{++di,e()}finally{--di||mi()}}function pi(e){let t=e.depsTail,n=t===void 0?e.deps:t.nextDep;for(;n!==void 0;)n=ii(n,e)}function mi(){if(!(di>0)){for(;ci{i.get(),n.current?t.next?.(i._snapshot):n.current=!0});return{unsubscribe:()=>{r.stop()}}},_update(e){let a=ui,o=t?.compare??Object.is;if(n)ui=i,++ni,i.depsTail=void 0;else if(e===void 0)return!1;n&&(i.flags=Qr.Mutable|Qr.RecursedCheck);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{ui=a,n&&(i.flags&=~Qr.RecursedCheck),pi(i)}}};return n?(i.flags=Qr.Mutable|Qr.Dirty,i.get=function(){let e=i.flags;if(e&Qr.Dirty||e&Qr.Pending&&oi(i.deps,i)){if(i._update()){let e=i.subs;e!==void 0&&si(e)}}else e&Qr.Pending&&(i.flags=e&~Qr.Pending);return ui!==void 0&&ri(i,ui,ni),i._snapshot}):i.set=function(e){if(i._update(e)){let e=i.subs;e!==void 0&&(ai(e),si(e),mi())}},i}function gi(e){let t=()=>{let t=ui;ui=n,++ni,n.depsTail=void 0,n.flags=Qr.Watching|Qr.RecursedCheck;try{return e()}finally{ui=t,n.flags&=~Qr.RecursedCheck,pi(n)}},n={deps:void 0,depsTail:void 0,subs:void 0,subsTail:void 0,flags:Qr.Watching|Qr.RecursedCheck,notify(){let e=this.flags;e&Qr.Dirty||e&Qr.Pending&&oi(this.deps,this)?t():this.flags=Qr.Watching},stop(){this.flags=Qr.None,this.depsTail=void 0,pi(this)}};return t(),n}var _i=n((e=>{var t=f();function n(e,t){return e===t&&(e!==0||1/e==1/t)||e!==e&&t!==t}var r=typeof Object.is==`function`?Object.is:n,i=t.useState,a=t.useEffect,o=t.useLayoutEffect,s=t.useDebugValue;function c(e,t){var n=t(),r=i({inst:{value:n,getSnapshot:t}}),c=r[0].inst,u=r[1];return o(function(){c.value=n,c.getSnapshot=t,l(c)&&u({inst:c})},[e,n,t]),a(function(){return l(c)&&u({inst:c}),e(function(){l(c)&&u({inst:c})})},[e]),s(n),n}function l(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!r(e,n)}catch{return!0}}function u(e,t){return t()}var d=typeof window>`u`||window.document===void 0||window.document.createElement===void 0?u:c;e.useSyncExternalStore=t.useSyncExternalStore===void 0?d:t.useSyncExternalStore})),vi=n(((e,t)=>{t.exports=_i()})),yi=n((e=>{var t=f(),n=vi();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.useSyncExternalStore,o=t.useRef,s=t.useEffect,c=t.useMemo,l=t.useDebugValue;e.useSyncExternalStoreWithSelector=function(e,t,n,r,u){var d=o(null);if(d.current===null){var f={hasValue:!1,value:null};d.current=f}else f=d.current;d=c(function(){function e(e){if(!a){if(a=!0,o=e,e=r(e),u!==void 0&&f.hasValue){var t=f.value;if(u(t,e))return s=t}return s=e}if(t=s,i(o,e))return t;var n=r(e);return u!==void 0&&u(t,n)?(o=e,t):(o=e,s=n)}var a=!1,o,s,c=n===void 0?null:n;return[function(){return e(t())},c===null?void 0:function(){return e(c())}]},[t,n,r,u]);var p=a(e,d[0],d[1]);return s(function(){f.hasValue=!0,f.value=p},[p]),l(p),p}})),bi=n(((e,t)=>{t.exports=yi()}))();function xi(e,t){return e===t}function Si(e,t,n=xi){let r=(0,M.useCallback)(t=>{if(!e)return()=>{};let{unsubscribe:n}=e.subscribe(t);return n},[e]),i=(0,M.useCallback)(()=>e?.get(),[e]);return(0,bi.useSyncExternalStoreWithSelector)(r,i,i,t,n)}var Ci={};function wi(e,t){let n=M.useRef();return r=>{let i=e?.select?e.select(r):r;return e?.structuralSharing??t.options.defaultStructuralSharing?n.current=tt(n.current,i):i}}function Ti(e){let t=l(),n=M.useContext(e.from?Zr:Xr),r=e.from??n,i=t.stores.getMatchStore(r),a=wi(e,t),o=Si(i,e=>e?a(e):Ci);if(o!==Ci)return o;(e.shouldThrow??!0)&>()}function Ei(e){return Ti({from:e.from,strict:e.strict,structuralSharing:e.structuralSharing,select:t=>e.select?e.select(t.loaderData):t.loaderData})}function Di(e){let{select:t,...n}=e;return Ti({...n,select:e=>t?t(e.loaderDeps):e.loaderDeps})}function Oi(e){return Ti({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 ki(e){return Ti({from:e.from,strict:e.strict,shouldThrow:e.shouldThrow,structuralSharing:e.structuralSharing,select:t=>e.select?e.select(t.search):t.search})}function Ai(e){return Ti({...e,select:t=>e.select?e.select(t.context):t.context})}function ji(e){let t=M.useRef(e);return ot(t.current,e,{ignoreUndefined:!1})||(t.current=e),t.current}function Mi(e,t){return e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2]}function Ni(e,t,n){if(e?.external)return ft(e.href,n)?void 0:e.href;if(!Wi(t)&&typeof t==`string`&&t.indexOf(`:`)!==-1)try{return new URL(t),ft(t,n)?void 0:t}catch{}}function Pi(e,t,n,r,i,a){if(a)return!1;if(n?.exact){if(!Kt(e.pathname,t.pathname,r))return!1}else{let n=Gt(e.pathname,r),i=Gt(t.pathname,r);if(!(n.startsWith(i)&&(n.length===i.length||n[i.length]===`/`)))return!1}return(n?.includeSearch??!0)&&!ot(e.search,t.search,{partial:!n?.exact,ignoreUndefined:!n?.explicitUndefined})?!1:!n?.includeHash||i&&e.hash===t.hash}function Fi(e,n){let r=l(),i=u(n),{activeProps:a,inactiveProps:o,activeOptions:s,to:c,preload:d,preloadDelay:f,preloadIntentProximity:p,hashScrollIntoView:m,replace:h,startTransition:g,resetScroll:_,viewTransition:v,children:y,target:b,disabled:x,style:S,className:C,onClick:w,onBlur:T,onFocus:E,onMouseEnter:D,onMouseLeave:O,onTouchStart:k,ignoreBlocker:ee,params:te,search:ne,hash:re,state:A,mask:ie,reloadDocument:ae,unsafeRelative:oe,from:se,_fromLocation:ce,...le}=e,ue=Jr(),de=ji(e.search),fe=ji(e.params),j=ji(s),pe=M.useMemo(()=>e,[r,e.from,e._fromLocation,e.hash,e.to,de,fe,e.state,e.mask,e.unsafeRelative]),me=M.useCallback(e=>{let t=r.buildLocation({_fromLocation:e,...pe}),n=Ui(t.maskedLocation?t.maskedLocation.publicHref:t.publicHref,t.maskedLocation?t.maskedLocation.external:t.external,r.history,x),i=Ni(n,c,r.protocolAllowlist);return[n?.href,i,Pi(e,t,j,r.basepath,ue,i!==void 0)]},[j,x,ue,pe,r,c]),[he,ge,_e]=Si(r.stores.location,me,Mi),ve=_e?Ye(a,{})??Li:Ii,ye=_e?Ii:Ye(o,{})??Ii,be=[C,ve.className,ye.className].filter(Boolean).join(` `),xe=(S||ve.style||ye.style)&&{...S,...ve.style,...ye.style},Se=M.useRef(!1),Ce=e.reloadDocument||ge||x?!1:d??r.options.defaultPreload,we=f??r.options.defaultPreloadDelay??0,Te=M.useCallback(()=>{r.preloadRoute(pe).catch(e=>{console.warn(e),console.warn(Hr)})},[r,pe]),Ee=M.useCallback(e=>{if(!e){Vi(i);return}if(!(e.isIntersecting??Ce===`intent`)){e.isIntersecting===!1&&Vi(i);return}if(!we){Te();return}Bi.has(i)||Bi.set(i,setTimeout(()=>{Bi.delete(i),Te()},we))},[Te,i,Ce,we]);t(i,Ee,Ce!==`viewport`),M.useEffect(()=>{Se.current||Ce===`render`&&(Te(),Se.current=!0)},[Te,Ce]);let De=e=>{let t=e.currentTarget.getAttribute(`target`),n=b===void 0?t:b;!x&&!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)&&!e.defaultPrevented&&(!n||n===`_self`)&&e.button===0&&(e.preventDefault(),r.navigate({...pe,replace:h,resetScroll:_,hashScrollIntoView:m,startTransition:g,viewTransition:v,ignoreBlocker:ee}))};if(ge)return{...le,ref:i,href:ge,...y&&{children:y},...b&&{target:b},...x&&{disabled:x},...S&&{style:S},...C&&{className:C},...w&&{onClick:w},...T&&{onBlur:T},...E&&{onFocus:E},...D&&{onMouseEnter:D},...O&&{onMouseLeave:O},...k&&{onTouchStart:k}};let Oe=()=>{Ce===`intent`&&Te()},ke=()=>{Ce===`intent`&&Vi(i)};return{...le,...ve,...ye,href:he,ref:i,onClick:Hi([w,De]),onBlur:Hi([T,ke]),onFocus:Hi([E,Ee]),onMouseEnter:Hi([D,Ee]),onMouseLeave:Hi([O,ke]),onTouchStart:Hi([k,Oe]),disabled:!!x,target:b,...xe&&{style:xe},...be&&{className:be},...x&&Ri,..._e&&zi}}var Ii={},Li={className:`active`},Ri={role:`link`,"aria-disabled":!0},zi={"data-status":`active`,"aria-current":`page`},Bi=new WeakMap,Vi=e=>{clearTimeout(Bi.get(e)),Bi.delete(e)},Hi=e=>t=>{for(let n of e)if(n){if(t.defaultPrevented)return;n(t)}};function Ui(e,t,n,r){if(!r)return t?{href:e,external:!0}:{href:n.createHref(e)||`/`,external:!1}}function Wi(e){if(typeof e!=`string`)return!1;let t=e.charCodeAt(0);return t===47?e.charCodeAt(1)!==47:t===46}var Gi=M.forwardRef((e,t)=>{let{_asChild:n,...r}=e,{type:i,...a}=Fi(r,t),o=typeof r.children==`function`?r.children({isActive:a[`data-status`]===`active`}):r.children;if(!n){let{disabled:e,...t}=a;return M.createElement(`a`,t,o)}return M.createElement(n,a,o)}),Ki=class extends Ur{constructor(e){super(e),this.useMatch=e=>Ti({select:e?.select,from:this.id,structuralSharing:e?.structuralSharing}),this.useRouteContext=e=>Ai({...e,from:this.id}),this.useSearch=e=>ki({select:e?.select,structuralSharing:e?.structuralSharing,from:this.id}),this.useParams=e=>Oi({select:e?.select,structuralSharing:e?.structuralSharing,from:this.id}),this.useLoaderDeps=e=>Di({...e,from:this.id}),this.useLoaderData=e=>Ei({...e,from:this.id}),this.useNavigate=()=>o({from:this.fullPath}),this.Link=M.forwardRef((e,t)=>(0,N.jsx)(Gi,{ref:t,from:this.fullPath,...e}))}};function qi(e){return new Ki(e)}var Ji=class extends Wr{constructor(e){super(e),this.useMatch=e=>Ti({select:e?.select,from:this.id,structuralSharing:e?.structuralSharing}),this.useRouteContext=e=>Ai({...e,from:this.id}),this.useSearch=e=>ki({select:e?.select,structuralSharing:e?.structuralSharing,from:this.id}),this.useParams=e=>Oi({select:e?.select,structuralSharing:e?.structuralSharing,from:this.id}),this.useLoaderDeps=e=>Di({...e,from:this.id}),this.useLoaderData=e=>Ei({...e,from:this.id}),this.useNavigate=()=>o({from:this.fullPath}),this.Link=M.forwardRef((e,t)=>(0,N.jsx)(Gi,{ref:t,from:this.fullPath,...e}))}};function Yi(e){return new Ji(e)}function Xi(e){return e=>{let t=qi(e);return t.isRoot=!1,t}}function Zi(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(st(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(s)s(a());else throw a()}return M.createElement(r,e)};return o.preload=a,o}function Qi(e){let t=l(),n=`not-found-${Si(t.stores.location,e=>e.pathname)}-${Si(t.stores.status,e=>e)}`;return(0,N.jsx)(Gr,{getResetKey:()=>n,onCatch:(t,n)=>{if(Qt(t))e.onCatch?.(t,n);else throw t},errorComponent:({error:t})=>{if(Qt(t))return e.fallback?.(t);throw t},children:e.children})}function $i(){return(0,N.jsx)(`p`,{children:`Not Found`})}function ea(e){return(0,N.jsx)(N.Fragment,{children:e.children})}function ta(e,t,n){return t.options.notFoundComponent?(0,N.jsx)(t.options.notFoundComponent,{...n}):e.options.defaultNotFoundComponent?(0,N.jsx)(e.options.defaultNotFoundComponent,{...n}):(0,N.jsx)($i,{})}function na(e,t){let n=t?.options.pendingComponent??e.options.defaultPendingComponent;return n?(0,N.jsx)(n,{}):null}var ra=(e,t)=>e[0]===t[0]&&e[1]===t[1],ia=(e,t,n)=>!t.isRoot||t.options.shellComponent||t.options.wrapInSuspense||n===!1||n===`data-only`||!e.ssr,aa=M.memo(function({routeId:e}){let t=l();return(0,N.jsx)(oa,{router:t,match:Si(t.stores.getMatchStore(e),e=>e)})});function oa({router:e,match:t}){let n=e.routesById[t.routeId],r=na(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=ia(e,n,t.ssr)&&(n.options.wrapInSuspense??r??(n.options.errorComponent?.preload||s))?M.Suspense:ea,l=i?Gr:ea,u=o?Qi:ea;return(0,N.jsxs)(n.isRoot?n.options.shellComponent??ea:ea,{children:[(0,N.jsx)(Xr.Provider,{value:t.routeId,children:(0,N.jsx)(c,{fallback:r,children:(0,N.jsx)(l,{getResetKey:()=>t,errorComponent:i,onCatch:(e,n)=>{if(Qt(e))throw e.routeId??=t.routeId,e;a?.(e,n)},children:(0,N.jsx)(u,{fallback:e=>{if(e.routeId??=t.routeId,e.routeId!==t.routeId)throw e;return M.createElement(o,e)},children:s?(0,N.jsx)(qr,{fallback:r,children:(0,N.jsx)(sa,{match:t})}):(0,N.jsx)(sa,{match:t})})})})}),null]})}var sa=M.memo(function({match:e}){let t=l(),n=e.routeId,r=t.routesById[n],i=M.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=M.useMemo(()=>{let e=r.options.component??t.options.defaultComponent;return e?(0,N.jsx)(e,{},i):(0,N.jsx)(ca,{})},[i,r.options.component,t.options.defaultComponent]);if(e.status===`pending`){if(t.ssr&&!ia(t,r,e.ssr))return a;if(t._tx)throw t._tx[5];return na(t,r)}if(e.status===`notFound`)return ta(t,r,e.error);if(e.status===`error`)throw e.error;return a}),ca=M.memo(function(){let e=l(),t=M.useContext(Xr),n,r,i;{let a=e.stores.getMatchStore(t);[n,r]=Si(a,e=>[!!e._notFound,e.error],ra),i=Si(e.stores.ids,e=>e[e.indexOf(t)+1])}if(n)return ta(e,e.routesById[t],r);if(!i)return null;let a=(0,N.jsx)(aa,{routeId:i});return t===`__root__`?(0,N.jsx)(M.Suspense,{fallback:na(e),children:a}):a});function la(e,t){let n=e[1];e.length=0,n?.(t)}function ua({t:e}){let t=l(),n=t._rendered??=[];return t.startTransition=(r,i)=>new Promise(a=>{la(n,!1),n.push(i,a),e(t),M.startTransition(r)}),a(()=>{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(Ut(r.publicHref)!==Ut(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`,...Bn(a,a)})}):t._tx||t.load({sync:!0}).catch(console.error),e},[t,t.history]),null}function da(){let e=l(),t=e.routesById[Sn],n=na(e,t),r=e.ssr?ea:M.Suspense,i=(0,N.jsxs)(N.Fragment,{children:[(0,N.jsx)(ua,{t:M.useState()[1]}),(0,N.jsx)(r,{fallback:n,children:(0,N.jsx)(fa,{})})]});return e.options.InnerWrap?(0,N.jsx)(e.options.InnerWrap,{children:i}):i}function fa(){let e=l(),t=e._rendered,n=Si(e.stores.matches,e=>t[0]??e),r=n[0],i=r?.routeId;a(()=>{t[0]===n&&la(t,!0)},[t,n]);let o=i?(0,N.jsx)(aa,{routeId:i}):null;return(0,N.jsx)(Xr.Provider,{value:i,children:e.options.disableGlobalCatchBoundary?o:(0,N.jsx)(Gr,{getResetKey:()=>r,onCatch:void 0,children:o})})}var pa=e=>({createMutableStore:hi,createReadonlyStore:hi,batch:fi}),ma=e=>new ha(e),ha=class extends Un{constructor(e){super(e,pa)}};function ga({router:e,children:t,...n}){Qe(n)&&e.update({...e.options,...n,context:{...e.options.context,...n.context}});let r=(0,N.jsx)(i.Provider,{value:e,children:t});return e.options.Wrap?(0,N.jsx)(e.options.Wrap,{children:r}):r}function _a({router:e,...t}){return(0,N.jsx)(ga,{router:e,...t,children:(0,N.jsx)(da,{})})}function va(e){let t=l({warn:e?.router===void 0}),n=e?.router||t;return Si(n.stores.__store,wi(e,n))}function ya(e){return typeof e!=`string`||!e.includes(`var(--mantine-scale)`)?e:e.match(/^calc\((.*?)\)$/)?.[1].split(`*`)[0].trim()}function ba(e){let t=ya(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 xa(e){return Array.isArray(e)||e===null?!1:typeof e==`object`&&e.type!==M.Fragment}function Sa(e){let t=(0,M.createContext)(null);return[t,()=>{let n=(0,M.use)(t);if(n===null)throw Error(e);return n}]}function Ca(e,t){let n=e;for(;(n=n.parentElement)&&!n.matches(t););return n}function wa(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 Ta(e,t,n){for(let n=e+1;n{n?.(s);let c=Array.from(Ca(s.currentTarget,e)?.querySelectorAll(t)||[]).filter(t=>Ea(s.currentTarget,t,e)),l=c.findIndex(e=>s.currentTarget===e),u=Ta(l,c,r),d=wa(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[Ta(-1,c,!1)]?.focus();break;case`End`:s.stopPropagation(),s.preventDefault(),c[wa(c.length,c,!1)]?.focus()}}}var Oa={app:100,modal:200,popover:300,overlay:400,max:9999};function ka(e){return Oa[e]}var Aa=()=>{};function ja(e,t={active:!0}){return typeof e!=`function`||!t.active?t.onKeyDown||Aa:n=>{n.key===`Escape`&&(e(n),t.onTrigger?.())}}function Ma(e,t){return n=>{e?.(n),t?.(n)}}function Na(e,t){return e in t?ba(t[e]):ba(e)}function Pa(e,t){let n=e.map(e=>({value:e,px:Na(e,t)}));return n.sort((e,t)=>e.px-t.px),n}function Fa(e){return typeof e==`object`&&e?`base`in e?e.base:void 0:e}function Ia(e,t,n){return n?Array.from(Ca(n,t)?.querySelectorAll(e)||[]).findIndex(e=>e===n):null}function La(e){let t=(0,M.useRef)(e);return(0,M.useEffect)(()=>{t.current=e}),(0,M.useMemo)(()=>((...e)=>t.current?.(...e)),[])}function Ra(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=La(e),s=(0,M.useRef)(0),c=(0,M.useRef)(0),l=(0,M.useRef)(null),u=(0,M.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,M.useEffect)(()=>()=>{r?u.flush():u.cancel()},[u,r]),u}var za=[`mousedown`,`touchstart`];function Ba(e,t,n,r=!0){let i=(0,M.useRef)(null),a=t||za,o=(0,M.useEffectEvent)(t=>{let{target:r}=t??{};if(!document.body.contains(r)&&r?.tagName!==`HTML`)return;let a=t.composedPath();Array.isArray(n)?n.every(e=>!!e&&!a.includes(e))&&e(t):i.current&&!a.includes(i.current)&&e(t)}),s=a.join(`,`);return(0,M.useEffect)(()=>{if(!r)return;let e=s.split(`,`);return e.forEach(e=>document.addEventListener(e,o)),()=>{e.forEach(e=>document.removeEventListener(e,o))}},[s,r]),i}function Va(e,t){return Me(`(prefers-color-scheme: dark)`,e===`dark`,t)?`dark`:`light`}function Ha(e,t,n={leading:!1}){let[r,i]=(0,M.useState)(e),a=(0,M.useRef)(!1),o=(0,M.useRef)(null),s=(0,M.useRef)(!1),c=(0,M.useRef)(e);c.current=e;let l=(0,M.useCallback)(()=>{window.clearTimeout(o.current),o.current=null},[]),u=(0,M.useCallback)(()=>{l(),s.current=!1},[]),d=(0,M.useCallback)(()=>{o.current&&(u(),s.current=!1,i(c.current))},[]);return(0,M.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,M.useEffect)(()=>(a.current=!0,u),[]),[r,u,{cancel:u,flush:d}]}function Ua({opened:e,shouldReturnFocus:t=!0}){let n=(0,M.useRef)(null),r=()=>{n.current&&`focus`in n.current&&typeof n.current.focus==`function`&&n.current?.focus({preventScroll:!0})};return Ie(()=>{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 Wa=/input|select|textarea|button|object/,Ga=`a, input, select, textarea, button, object, [tabindex]`;function Ka(e){return e.style.display===`none`}function qa(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(Ka(t))return!1;t=t.parentNode}return!0}function Ja(e){let t=e.getAttribute(`tabindex`);return t===null&&(t=void 0),parseInt(t,10)}function Ya(e){let t=e.nodeName.toLowerCase(),n=!Number.isNaN(Ja(e));return(Wa.test(t)&&!e.disabled||e instanceof HTMLAnchorElement&&e.href||n)&&qa(e)}function Xa(e){let t=Ja(e);return(Number.isNaN(t)||t>=0)&&Ya(e)}function Za(e){return Array.from(e.querySelectorAll(Ga)).filter(Xa)}function Qa(e,t){let n=Za(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 $a(e=!0){let t=(0,M.useRef)(null),n=e=>{let t=e.querySelector(`[data-autofocus]`);if(!t){let n=Array.from(e.querySelectorAll(Ga));t=n.find(Xa)||n.find(Ya)||null,!t&&Ya(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,M.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,M.useEffect)(()=>{if(!e)return;t.current&&setTimeout(()=>{t.current&&n(t.current)});let r=e=>{e.key===`Tab`&&t.current&&Qa(t.current,e)};return document.addEventListener(`keydown`,r),()=>document.removeEventListener(`keydown`,r)},[e]),r}function eo(e,t,n){let r=(0,M.useEffectEvent)(t);(0,M.useEffect)(()=>(window.addEventListener(e,r,n),()=>window.removeEventListener(e,r,n)),[e])}function to(e,t){if(typeof e==`function`)return e(t);typeof e==`object`&&e&&`current`in e&&(e.current=t)}function no(...e){let t=new Map;return n=>{if(e.forEach(e=>{let r=to(e,n);r&&t.set(e,r)}),t.size>0)return()=>{e.forEach(e=>{let n=t.get(e);n&&typeof n==`function`?n():to(e,null)}),t.clear()}}}function ro(...e){return(0,M.useCallback)(no(...e),e)}function io({value:e,defaultValue:t,finalValue:n,onChange:r=()=>{}}){let[i,a]=(0,M.useState)(t===void 0?n:t);return e===void 0?[i,(e,...t)=>{a(e),r?.(e,...t)},!1]:[e,r,!0]}var ao=[`mouse`,`touch`],oo=10;function so(e,t={}){let{threshold:n=400,events:r=ao,cancelOnMove:i=!1,onStart:a,onFinish:o,onCancel:s}=t,c=(0,M.useRef)(!1),l=(0,M.useRef)(!1),u=(0,M.useRef)(-1),d=(0,M.useRef)(null);return(0,M.useEffect)(()=>()=>window.clearTimeout(u.current),[]),(0,M.useMemo)(()=>{if(typeof e!=`function`)return{};let t=i!==!1,f=i===!0?oo:i===!1?0:i,p=t=>{!uo(t)&&!lo(t)||(a&&a(t),d.current=co(t),l.current=!0,u.current=window.setTimeout(()=>{e(t),c.current=!0},n))},m=e=>{!uo(e)&&!lo(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=co(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,r.join(`,`)])}function co(e){if(lo(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 lo(e){return window.TouchEvent?e.nativeEvent instanceof TouchEvent:`touches`in e.nativeEvent}function uo(e){return e.nativeEvent instanceof MouseEvent}function fo(){return`development`}function po(e){return e?.props?.ref}function mo(e){let t=M.Children.toArray(e);return t.length!==1||!xa(t[0])?null:t[0]}function ho(e){return e===`auto`||e===`dark`||e===`light`}function go({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 ho(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&&ho(t.newValue)&&n(t.newValue)},window.addEventListener(`storage`,t)},unsubscribe:()=>{window.removeEventListener(`storage`,t)},clear:()=>{window.localStorage.removeItem(e)}}}function _o({color:e,theme:t,autoContrast:n,colorScheme:r}){return(typeof n==`boolean`?n:t.autoContrast)&&ie({color:e||t.primaryColor,theme:t,colorScheme:r}).isLight?`var(--mantine-color-black)`:`var(--mantine-color-white)`}function vo(e,t,n){return _o({color:n===`dark`?e.dark:e.light,theme:t,colorScheme:n,autoContrast:!0})}function yo(e,t){let n=e.colors[e.primaryColor];return Ae(n)?e.autoContrast?vo(n,e,t):`var(--mantine-color-white)`:_o({color:n[A(e,t)],theme:e,autoContrast:null})}function bo(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 xo({keepTransitions:e}={}){let t=(0,M.useRef)(Aa),n=(0,M.useRef)(-1),r=(0,M.use)(k),i=(0,M.useRef)(ne()?.());if(!r)throw Error(`[@mantine/core] MantineProvider was not found in tree`);let a=a=>{r.setColorScheme(a),t.current=e?()=>{}:bo(i.current),window.clearTimeout(n.current),n.current=window.setTimeout(()=>{t.current?.()},10)},o=()=>{r.clearColorScheme(),t.current=e?()=>{}:bo(i.current),window.clearTimeout(n.current),n.current=window.setTimeout(()=>{t.current?.()},10)},s=Va(`light`,{getInitialValueInEffect:!1}),c=r.colorScheme===`auto`?s:r.colorScheme,l=(0,M.useCallback)(()=>a(c===`light`?`dark`:`light`),[a,c]);return(0,M.useEffect)(()=>()=>{t.current?.(),window.clearTimeout(n.current)},[]),{colorScheme:r.colorScheme,setColorScheme:a,clearColorScheme:o,toggleColorScheme:l}}function So(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 Co({manager:e,defaultColorScheme:t,getRootElement:n,forceColorScheme:r}){let i=(0,M.useRef)(null),[a,o]=(0,M.useState)(()=>e.get(t)),s=r||a,c=(0,M.useCallback)(t=>{r||(So(t,n),o(t),e.set(t))},[e.set,s,r]),l=(0,M.useCallback)(()=>{o(t),So(t,n),e.clear()},[e.clear,t]);return(0,M.useEffect)(()=>(e.subscribe(c),e.unsubscribe),[e.subscribe,e.unsubscribe]),Ee(()=>{So(e.get(t),n)},[]),(0,M.useEffect)(()=>{if(r)return So(r,n),()=>{};r===void 0&&So(a,n),typeof window<`u`&&`matchMedia`in window&&(i.current=window.matchMedia(`(prefers-color-scheme: dark)`));let e=e=>{a===`auto`&&So(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 wo(e,t={getInitialValueInEffect:!0}){let n=Va(e,t),{colorScheme:r}=xo();return r===`auto`?n:r}function To(e){return Object.entries(e).map(([e,t])=>`${e}: ${t};`).join(``)}function Eo(e,t){let n=t?[t]:[`:root`,`:host`],r=To(e.variables),i=r?`${n.join(`, `)}{${r}}`:``,a=To(e.dark),o=To(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 Do({theme:e,color:t,colorScheme:n,name:r=t,withColorValues:i=!0}){if(!e.colors[t])return{};if(n===`light`){let n=A(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`]:re(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=A(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`]:S(e.colors[t][9],.5),[`--mantine-color-${r}-light-hover`]:S(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`]:re(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 Oo(e,t,n){ke(t).forEach(r=>Object.assign(e,{[`--mantine-${n}-${r}`]:t[r]}))}var ko=e=>{let t=A(e,`light`),n=e.defaultRadius in e.radius?e.radius[e.defaultRadius]:j(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":yo(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":yo(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)`}};Oo(r.variables,e.breakpoints,`breakpoint`),Oo(r.variables,e.spacing,`spacing`),Oo(r.variables,e.fontSizes,`font-size`),Oo(r.variables,e.lineHeights,`line-height`),Oo(r.variables,e.shadows,`shadow`),Oo(r.variables,e.radius,`radius`),Oo(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})`}),ke(e.colors).forEach(t=>{let n=e.colors[t];if(Ae(n)){Object.assign(r.light,Do({theme:e,name:n.name,color:n.light,colorScheme:`light`,withColorValues:!0})),Object.assign(r.dark,Do({theme:e,name:n.name,color:n.dark,colorScheme:`dark`,withColorValues:!0})),r.light[`--mantine-color-${n.name}-contrast`]=vo(n,e,`light`),r.dark[`--mantine-color-${n.name}-contrast`]=vo(n,e,`dark`);return}n.forEach((e,n)=>{r.variables[`--mantine-color-${t}-${n}`]=e}),Object.assign(r.light,Do({theme:e,color:t,colorScheme:`light`,withColorValues:!1})),Object.assign(r.dark,Do({theme:e,color:t,colorScheme:`dark`,withColorValues:!1}))});let i=e.headings.sizes;return ke(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 Ao(){let e=b(),t=ne(),n=ke(e.breakpoints).reduce((t,n)=>{let r=e.breakpoints[n].includes(`px`),i=ba(e.breakpoints[n]);return`${t}@media (max-width: ${r?`${i-.1}px`:Re(i-.1)}) {.mantine-visible-from-${n} {display: none !important;}}@media (min-width: ${r?`${i}px`:Re(i)}) {.mantine-hidden-from-${n} {display: none !important;}}`},``);return(0,N.jsx)(`style`,{"data-mantine-styles":`classes`,nonce:t?.(),dangerouslySetInnerHTML:{__html:n}})}function jo({theme:e,generator:t}){let n=ko(e),r=t?.(e);return r?he(n,r):n}var Mo=ko(C);function No(e){let t={variables:{},light:{},dark:{}};return ke(e.variables).forEach(n=>{Mo.variables[n]!==e.variables[n]&&(t.variables[n]=e.variables[n])}),ke(e.light).forEach(n=>{Mo.light[n]!==e.light[n]&&(t.light[n]=e.light[n])}),ke(e.dark).forEach(n=>{Mo.dark[n]!==e.dark[n]&&(t.dark[n]=e.dark[n])}),t}function Po(e){return Eo({variables:{},dark:{"--mantine-color-scheme":`dark`},light:{"--mantine-color-scheme":`light`}},e)}function Fo({cssVariablesSelector:e,deduplicateCssVariables:t}){let n=b(),r=ne(),i=jo({theme:n,generator:m()}),a=(e===void 0||e===`:root`||e===`:host`)&&t,o=Eo(a?No(i):i,e);return o?(0,N.jsx)(`style`,{"data-mantine-styles":!0,nonce:r?.(),dangerouslySetInnerHTML:{__html:`${o}${a?``:Po(e)}`}}):null}Fo.displayName=`@mantine/CssVariables`;function Io({respectReducedMotion:e,getRootElement:t}){Ee(()=>{e&&t()?.setAttribute(`data-respect-reduced-motion`,`true`)},[e])}function Lo({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=go(),defaultColorScheme:u=`light`,getRootElement:d=()=>document.documentElement,cssVariablesResolver:f,forceColorScheme:p,stylesTransform:m,env:h,deduplicateInlineStyles:g=!1}){let{colorScheme:v,setColorScheme:y,clearColorScheme:b}=Co({defaultColorScheme:u,forceColorScheme:p,manager:l,getRootElement:d});return Io({respectReducedMotion:e?.respectReducedMotion||!1,getRootElement:d}),(0,N.jsx)(k,{value:{colorScheme:v,setColorScheme:y,clearColorScheme:b,getRootElement:d,classNamesPrefix:c,getStyleNonce:n,cssVariablesResolver:f,cssVariablesSelector:s??`:root`,withStaticClasses:r,stylesTransform:m,env:h,deduplicateInlineStyles:g},children:(0,N.jsxs)(_,{theme:e,children:[o&&(0,N.jsx)(Fo,{cssVariablesSelector:s,deduplicateCssVariables:a}),i&&(0,N.jsx)(Ao,{}),t]})})}Lo.displayName=`@mantine/core/MantineProvider`;function Ro(e){return e}function zo(e,t){return Array.isArray(e)?[...e].reduce((e,n)=>({...e,...zo(n,t)}),{}):typeof e==`function`?e(t):e??{}}var Bo=(0,M.createContext)({dir:`ltr`,toggleDirection:()=>{},setDirection:()=>{}});function Vo(){return(0,M.use)(Bo)}var[Ho,Uo]=Sa(`ScrollArea.Root component was not found in tree`);function Wo(e,t){let n=(0,M.useEffectEvent)(t);Ee(()=>{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 Go(e){let{style:t,...n}=e,r=Uo(),[i,a]=(0,M.useState)(0),[o,s]=(0,M.useState)(0),c=!!(i&&o);return Wo(r.scrollbarX,()=>{let e=r.scrollbarX?.offsetHeight||0;r.onCornerHeightChange(e),s(e)}),Wo(r.scrollbarY,()=>{let e=r.scrollbarY?.offsetWidth||0;r.onCornerWidthChange(e),a(e)}),c?(0,N.jsx)(`div`,{...n,style:{...t,width:i,height:o}}):null}function Ko(e){let t=Uo(),n=!!(t.scrollbarX&&t.scrollbarY);return t.type!==`scroll`&&n?(0,N.jsx)(Go,{...e}):null}var qo={scrollHideDelay:1e3,type:`hover`};function Jo(e){let{type:t,scrollHideDelay:n,scrollbars:r,getStyles:i,ref:a,...o}=D(`ScrollAreaRoot`,qo,e),[s,c]=(0,M.useState)(null),[l,u]=(0,M.useState)(null),[d,f]=(0,M.useState)(null),[p,m]=(0,M.useState)(null),[h,g]=(0,M.useState)(null),[_,v]=(0,M.useState)(0),[y,b]=(0,M.useState)(0),[x,S]=(0,M.useState)(!1),[C,w]=(0,M.useState)(!1),T=ro(a,c);return(0,N.jsx)(Ho,{value:{type:t,scrollHideDelay:n,scrollArea:s,viewport:l,onViewportChange:u,content:d,onContentChange:f,scrollbarX:p,onScrollbarXChange:m,scrollbarXEnabled:x,onScrollbarXEnabledChange:S,scrollbarY:h,onScrollbarYChange:g,scrollbarYEnabled:C,onScrollbarYEnabledChange:w,onCornerWidthChange:v,onCornerHeightChange:b,getStyles:i},children:(0,N.jsx)(Be,{...o,ref:T,__vars:{"--sa-corner-width":r===`xy`?`${_}px`:`0px`,"--sa-corner-height":r===`xy`?`${y}px`:`0px`}})})}Jo.displayName=`@mantine/core/ScrollAreaRoot`;function Yo(e,t){let n=e/t;return Number.isNaN(n)?0:n}function Xo(e){let t=Yo(e.viewport,e.content),n=e.scrollbar.paddingStart+e.scrollbar.paddingEnd,r=(e.scrollbar.size-n)*t;return Math.max(r,18)}function Zo(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 Qo(e,[t,n]){return Math.min(n,Math.max(t,e))}function $o(e,t,n=`ltr`){let r=Xo(t),i=t.scrollbar.paddingStart+t.scrollbar.paddingEnd,a=t.scrollbar.size-i,o=t.content-t.viewport,s=a-r,c=Qo(e,n===`ltr`?[0,o]:[o*-1,0]);return Zo([0,o],[0,s])(c)}function es(e,t,n,r=`ltr`){let i=Xo(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 Zo([c,l],d)(e)}function ts(e,t){return e>0&&e{e?.(r),(n===!1||!r.defaultPrevented)&&t?.(r)}}var[is,as]=Sa(`ScrollAreaScrollbar was not found in tree`);function os(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=Uo(),[p,m]=(0,M.useState)(null),h=ro(u,m),g=(0,M.useRef)(null),_=(0,M.useRef)(``),{viewport:v}=f,y=t.content-t.viewport,b=(0,M.useEffectEvent)(c),x=La(o),S=Ra(l,10),C=e=>{if(g.current){let t=e.clientX-g.current.left,n=e.clientY-g.current.top;s({x:t,y:n})}};return(0,M.useEffect)(()=>{let e=e=>{let t=e.target;p?.contains(t)&&b(e,y)};return document.addEventListener(`wheel`,e,{passive:!1}),()=>document.removeEventListener(`wheel`,e,{passive:!1})},[v,p,y]),(0,M.useEffect)(x,[t,x]),Wo(p,S),Wo(f.content,S),(0,N.jsx)(is,{value:{scrollbar:p,hasThumb:n,onThumbChange:La(r),onThumbPointerUp:La(i),onThumbPositionChange:x,onThumbPointerDown:La(a)},children:(0,N.jsx)(`div`,{...d,ref:h,"data-mantine-scrollbar":!0,style:{position:`absolute`,...d.style},onPointerDown:rs(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`,C(e))}),onPointerMove:rs(e.onPointerMove,C),onPointerUp:rs(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 ss=e=>{let{sizes:t,onSizesChange:n,style:r,ref:i,...a}=e,o=Uo(),[s,c]=(0,M.useState)(),l=(0,M.useRef)(null),u=ro(i,l,o.onScrollbarXChange);return(0,M.useEffect)(()=>{l.current&&c(getComputedStyle(l.current))},[l]),(0,N.jsx)(os,{"data-orientation":`horizontal`,...a,ref:u,sizes:t,style:{...r,"--sa-thumb-width":`${Xo(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),ts(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:ns(s.paddingLeft),paddingEnd:ns(s.paddingRight)}})}})};ss.displayName=`@mantine/core/ScrollAreaScrollbarX`;function cs(e){let{sizes:t,onSizesChange:n,style:r,ref:i,...a}=e,o=Uo(),[s,c]=(0,M.useState)(),l=(0,M.useRef)(null),u=ro(i,l,o.onScrollbarYChange);return(0,M.useEffect)(()=>{l.current&&c(window.getComputedStyle(l.current))},[]),(0,N.jsx)(os,{...a,"data-orientation":`vertical`,ref:u,sizes:t,style:{"--sa-thumb-height":`${Xo(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),ts(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:ns(s.paddingTop),paddingEnd:ns(s.paddingBottom)}})}})}cs.displayName=`@mantine/core/ScrollAreaScrollbarY`;function ls(e){let{orientation:t=`vertical`,...n}=e,{dir:r}=Vo(),i=Uo(),a=(0,M.useRef)(null),o=(0,M.useRef)(0),[s,c]=(0,M.useState)({content:0,viewport:0,scrollbar:{size:0,paddingStart:0,paddingEnd:0}}),l=Yo(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)=>es(e,o.current,s,t);return t===`horizontal`?(0,N.jsx)(ss,{...u,onThumbPositionChange:()=>{if(i.viewport&&a.current){let e=i.viewport.scrollLeft,t=$o(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,N.jsx)(cs,{...u,onThumbPositionChange:()=>{if(i.viewport&&a.current){let e=i.viewport.scrollTop,t=$o(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}ls.displayName=`@mantine/core/ScrollAreaScrollbarVisible`;function us(e){let t=Uo(),{forceMount:n,...r}=e,[i,a]=(0,M.useState)(!1),o=e.orientation===`horizontal`,s=Ra(()=>{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,N.jsx)(us,{"data-state":i?`visible`:`hidden`,...n}):null}ds.displayName=`@mantine/core/ScrollAreaScrollbarHover`;function fs(e){let{forceMount:t,...n}=e,r=Uo(),i=e.orientation===`horizontal`,[a,o]=(0,M.useState)(`hidden`),s=Ra(()=>o(`idle`),100);return(0,M.useEffect)(()=>{if(a===`idle`){let e=window.setTimeout(()=>o(`hidden`),r.scrollHideDelay);return()=>window.clearTimeout(e)}},[a,r.scrollHideDelay]),(0,M.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,N.jsx)(ls,{"data-state":a===`hidden`?`hidden`:`visible`,...n,onPointerEnter:rs(e.onPointerEnter,()=>o(`interacting`)),onPointerLeave:rs(e.onPointerLeave,()=>o(`idle`))}):null}function ps(e){let{forceMount:t,...n}=e,r=Uo(),{onScrollbarXEnabledChange:i,onScrollbarYEnabledChange:a}=r,o=e.orientation===`horizontal`;return(0,M.useEffect)(()=>(o?i(!0):a(!0),()=>{o?i(!1):a(!1)}),[o,i,a]),r.type===`hover`?(0,N.jsx)(ds,{...n,forceMount:t}):r.type===`scroll`?(0,N.jsx)(fs,{...n,forceMount:t}):r.type===`auto`?(0,N.jsx)(us,{...n,forceMount:t}):r.type===`always`?(0,N.jsx)(ls,{...n}):null}ps.displayName=`@mantine/core/ScrollAreaScrollbar`;function ms(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 hs(e){let{style:t,ref:n,...r}=e,i=Uo(),a=as(),{onThumbPositionChange:o}=a,s=ro(n,a.onThumbChange),c=(0,M.useRef)(void 0),l=Ra(()=>{c.current&&=(c.current(),void 0)},100);return(0,M.useEffect)(()=>{let{viewport:e}=i;if(e){let t=()=>{if(l(),!c.current){let t=ms(e,o);c.current=t,o()}};return o(),e.addEventListener(`scroll`,t),()=>e.removeEventListener(`scroll`,t)}},[i.viewport,l,o]),(0,N.jsx)(`div`,{"data-state":a.hasThumb?`visible`:`hidden`,...r,ref:s,style:{width:`var(--sa-thumb-width)`,height:`var(--sa-thumb-height)`,...t},onPointerDownCapture:rs(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:rs(e.onPointerUp,a.onThumbPointerUp)})}hs.displayName=`@mantine/core/ScrollAreaThumb`;function gs(e){let{forceMount:t,...n}=e,r=as();return t||r.hasThumb?(0,N.jsx)(hs,{...n}):null}gs.displayName=`@mantine/core/ScrollAreaThumb`;function _s({children:e,style:t,ref:n,onWheel:r,...i}){let a=Uo(),o=ro(n,a.onViewportChange),s=e=>{if(r?.(e),a.scrollbarXEnabled&&a.viewport&&e.shiftKey){let{scrollTop:t,scrollHeight:n,clientHeight:r,scrollWidth:i,clientWidth:o}=a.viewport,s=t<1,c=t>=n-r-1;i>o&&(s||c)&&e.stopPropagation()}};return(0,N.jsx)(Be,{...i,ref:o,onWheel:s,"data-scrollarea-viewport":!0,style:{overflowX:a.scrollbarXEnabled?`scroll`:`hidden`,overflowY:a.scrollbarYEnabled?`scroll`:`hidden`,...t},children:(0,N.jsx)(`div`,{...a.getStyles(`content`),ref:a.onContentChange,children:e})})}_s.displayName=`@mantine/core/ScrollAreaViewport`;var vs={root:`m_d57069b5`,content:`m_b1336c6`,viewport:`m_c0783ff9`,viewportInner:`m_f8f631dd`,scrollbar:`m_c44ba933`,thumb:`m_d8b5e363`,corner:`m_21657268`};function ys(){return typeof window<`u`}function bs(e){return Cs(e)?(e.nodeName||``).toLowerCase():`#document`}function xs(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function Ss(e){return((Cs(e)?e.ownerDocument:e.document)||window.document)?.documentElement}function Cs(e){return ys()?e instanceof Node||e instanceof xs(e).Node:!1}function ws(e){return ys()?e instanceof Element||e instanceof xs(e).Element:!1}function Ts(e){return ys()?e instanceof HTMLElement||e instanceof xs(e).HTMLElement:!1}function Es(e){return!ys()||typeof ShadowRoot>`u`?!1:e instanceof ShadowRoot||e instanceof xs(e).ShadowRoot}function Ds(e){let{overflow:t,overflowX:n,overflowY:r,display:i}=Rs(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&i!==`inline`&&i!==`contents`}function Os(e){return/^(table|td|th)$/.test(bs(e))}function ks(e){try{if(e.matches(`:popover-open`))return!0}catch{}try{return e.matches(`:modal`)}catch{return!1}}var As=/transform|translate|scale|rotate|perspective|filter/,js=/paint|layout|strict|content/,Ms=e=>!!e&&e!==`none`,Ns;function Ps(e){let t=ws(e)?Rs(e):e;return Ms(t.transform)||Ms(t.translate)||Ms(t.scale)||Ms(t.rotate)||Ms(t.perspective)||!Is()&&(Ms(t.backdropFilter)||Ms(t.filter))||As.test(t.willChange||``)||js.test(t.contain||``)}function Fs(e){let t=Bs(e);for(;Ts(t)&&!Ls(t);){if(Ps(t))return t;if(ks(t))return null;t=Bs(t)}return null}function Is(){return Ns??=typeof CSS<`u`&&CSS.supports&&CSS.supports(`-webkit-backdrop-filter`,`none`),Ns}function Ls(e){return/^(html|body|#document)$/.test(bs(e))}function Rs(e){return xs(e).getComputedStyle(e)}function zs(e){return ws(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function Bs(e){if(bs(e)===`html`)return e;let t=e.assignedSlot||e.parentNode||Es(e)&&e.host||Ss(e);return Es(t)?t.host:t}function Vs(e){let t=Bs(e);return Ls(t)?(e.ownerDocument||e).body:Ts(t)&&Ds(t)?t:Vs(t)}function Hs(e,t,n){t===void 0&&(t=[]),n===void 0&&(n=!0);let r=Vs(e),i=r===e.ownerDocument?.body,a=xs(r);if(i){let e=Us(a);return t.concat(a,a.visualViewport||[],Ds(r)?r:[],e&&n?Hs(e):[])}return t.concat(r,Hs(r,[],n))}function Us(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}var Ws=[`top`,`right`,`bottom`,`left`],Gs=Math.min,Ks=Math.max,qs=Math.round,Js=Math.floor,Ys=e=>({x:e,y:e}),Xs={left:`right`,right:`left`,bottom:`top`,top:`bottom`};function Zs(e,t,n){return Ks(e,Gs(t,n))}function Qs(e,t){return typeof e==`function`?e(t):e}function $s(e){return e.split(`-`)[0]}function ec(e){return e.split(`-`)[1]}function tc(e){return e===`x`?`y`:`x`}function nc(e){return e===`y`?`height`:`width`}function rc(e){let t=e[0];return t===`t`||t===`b`?`y`:`x`}function ic(e){return tc(rc(e))}function ac(e,t,n){n===void 0&&(n=!1);let r=ec(e),i=ic(e),a=nc(i),o=i===`x`?r===(n?`end`:`start`)?`right`:`left`:r===`start`?`bottom`:`top`;return t.reference[a]>t.floating[a]&&(o=mc(o)),[o,mc(o)]}function oc(e){let t=mc(e);return[sc(e),t,sc(t)]}function sc(e){return e.includes(`start`)?e.replace(`start`,`end`):e.replace(`end`,`start`)}var cc=[`left`,`right`],lc=[`right`,`left`],uc=[`top`,`bottom`],dc=[`bottom`,`top`];function fc(e,t,n){switch(e){case`top`:case`bottom`:return n?t?lc:cc:t?cc:lc;case`left`:case`right`:return t?uc:dc;default:return[]}}function pc(e,t,n,r){let i=ec(e),a=fc($s(e),n===`start`,r);return i&&(a=a.map(e=>e+`-`+i),t&&(a=a.concat(a.map(sc)))),a}function mc(e){let t=$s(e);return Xs[t]+e.slice(t.length)}function hc(e){return{top:e.top??0,right:e.right??0,bottom:e.bottom??0,left:e.left??0}}function gc(e){return typeof e==`number`?{top:e,right:e,bottom:e,left:e}:hc(e)}function _c(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 vc(){let e=navigator.userAgentData;return e!=null&&e.platform?e.platform:navigator.platform}function yc(){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 bc(){return/apple/i.test(navigator.vendor)}function xc(){return vc().toLowerCase().startsWith(`mac`)&&!navigator.maxTouchPoints}function Sc(){return yc().includes(`jsdom/`)}var Cc=`data-floating-ui-focusable`,wc=`input:not([type='hidden']):not([disabled]),[contenteditable]:not([contenteditable='false']),textarea:not([disabled])`;function Tc(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 Ec(e,t){if(!e||!t)return!1;let n=t.getRootNode==null?void 0:t.getRootNode();if(e.contains(t))return!0;if(n&&Es(n)){let n=t;for(;n;){if(e===n)return!0;n=n.parentNode||n.host}}return!1}function Dc(e){return`composedPath`in e?e.composedPath()[0]:e.target}function Oc(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 kc(e){return e.matches(`html,body`)}function Ac(e){return e?.ownerDocument||document}function jc(e){return Ts(e)&&e.matches(wc)}function Mc(e){if(!e||Sc())return!0;try{return e.matches(`:focus-visible`)}catch{return!0}}function Nc(e){return e?e.hasAttribute(Cc)?e:e.querySelector(`[`+Cc+`]`)||e:null}function Pc(e,t,n){return n===void 0&&(n=!0),e.filter(e=>e.parentId===t&&(!n||e.context?.open)).flatMap(t=>[t,...Pc(e,t.id,n)])}function Fc(e){return`nativeEvent`in e}function Ic(e,t){let n=[`mouse`,`pen`];return t||n.push(``,void 0),n.includes(e)}var Lc=typeof document<`u`?M.useLayoutEffect:function(){},Rc={...M};function zc(e){let t=M.useRef(e);return Lc(()=>{t.current=e}),t}var Bc=Rc.useInsertionEffect||(e=>e());function Vc(e){let t=M.useRef(()=>{});return Bc(()=>{t.current=e}),M.useCallback(function(){var e=[...arguments];return t.current==null?void 0:t.current(...e)},[])}function Hc(e,t,n){let{reference:r,floating:i}=e,a=rc(t),o=ic(t),s=nc(o),c=$s(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=ec(t);return m&&(p[o]+=f*(m===`end`?1:-1)*(n&&l?-1:1)),p}async function Uc(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}=Qs(t,e),p=gc(f),m=o[d?u===`floating`?`reference`:`floating`:u],h=_c(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=_c(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 Wc=50,Gc=async(e,t,n)=>{let{placement:r=`bottom`,strategy:i=`absolute`,middleware:a=[],platform:o}=n,s=o.detectOverflow?o:{...o,detectOverflow:Uc},c=await(o.isRTL==null?void 0:o.isRTL(t)),l=await o.getElementRects({reference:e,floating:t,strategy:i}),{x:u,y:d}=Hc(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}=Qs(e,t)||{};if(l==null)return{};let d=gc(u),f={x:n,y:r},p=ic(i),m=nc(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=Gs(d[_],T),D=Gs(d[v],T),O=C-h[m]-D,k=C/2-h[m]/2+w,ee=Zs(E,k,O),te=!c.arrow&&ec(i)!=null&&k!==ee&&a.reference[m]/2-(ke<=0)){let e=(i.flip?.index||0)+1,t=S[e];if(t&&(u!==`alignment`||_===rc(t)||T.every(e=>rc(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=rc(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 Jc(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function Yc(e){return Ws.some(t=>e[t]>=0)}var Xc=function(e){return e===void 0&&(e={}),{name:`hide`,options:e,async fn(t){let{rects:n,platform:r}=t,{strategy:i=`referenceHidden`,...a}=Qs(e,t);switch(i){case`referenceHidden`:{let e=Jc(await r.detectOverflow(t,{...a,elementContext:`reference`}),n.reference);return{data:{referenceHiddenOffsets:e,referenceHidden:Yc(e)}}}case`escaped`:{let e=Jc(await r.detectOverflow(t,{...a,altBoundary:!0}),n.floating);return{data:{escapedOffsets:e,escaped:Yc(e)}}}default:return{}}}}};function Zc(e){let t=Gs(...e.map(e=>e.left)),n=Gs(...e.map(e=>e.top)),r=Ks(...e.map(e=>e.right)),i=Ks(...e.map(e=>e.bottom));return{x:t,y:n,width:r-t,height:i-n}}function Qc(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=>_c(Zc(e)))}var $c=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}=Qs(e,t),u=Array.from(await(a.getClientRects==null?void 0:a.getClientRects(r.reference))||[]);if(!u.length)return{};let d=Qc(u),f=_c(Zc(u)),p=gc(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(rc(n)===`y`){let e=d[0],t=d[d.length-1],r=$s(n)===`top`,i=e.top,a=t.bottom,o=r?e.left:t.left;return _c({x:o,y:i,width:(r?e.right:t.right)-o,height:a-i})}let e=$s(n)===`left`,t=Ks(...d.map(e=>e.right)),r=Gs(...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 _c({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}}:{}}}},el=new Set([`left`,`top`]);async function tl(e,t){let{placement:n,platform:r,elements:i}=e,a=await(r.isRTL==null?void 0:r.isRTL(i.floating)),o=$s(n),s=ec(n),c=rc(n)===`y`,l=el.has(o)?-1:1,u=a&&c?-1:1,d=Qs(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 nl=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 tl(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}}}}},rl=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}=Qs(e,t),u={x:n,y:r},d=await a.detectOverflow(t,l),f=rc(i),p=tc(f),m=u[p],h=u[f],g=(e,t)=>Zs(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}}}}}},il=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}=Qs(e,t),u={x:n,y:r},d=rc(i),f=tc(d),p=u[f],m=u[d],h=Qs(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=el.has($s(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}}}},al=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}=Qs(e,t),c=await i.detectOverflow(t,s),l=$s(n),u=ec(n),d=rc(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=Gs(p-c[m],g),y=Gs(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*Ks(c.left,c.right):S=p-2*Ks(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 ol(e){let t=Rs(e),n=parseFloat(t.width)||0,r=parseFloat(t.height)||0,i=Ts(e),a=i?e.offsetWidth:n,o=i?e.offsetHeight:r,s=qs(n)!==a||qs(r)!==o;return s&&(n=a,r=o),{width:n,height:r,$:s}}function sl(e){return ws(e)?e:e.contextElement}function cl(e){let t=sl(e);if(!Ts(t))return Ys(1);let n=t.getBoundingClientRect(),{width:r,height:i,$:a}=ol(t),o=(a?qs(n.width):n.width)/r,s=(a?qs(n.height):n.height)/i;return(!o||!Number.isFinite(o))&&(o=1),(!s||!Number.isFinite(s))&&(s=1),{x:o,y:s}}var ll=Ys(0);function ul(e){let t=xs(e);return!Is()||!t.visualViewport?ll:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function dl(e,t,n){return t===void 0&&(t=!1),!!n&&t&&n===xs(e)}function fl(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);let i=e.getBoundingClientRect(),a=sl(e),o=Ys(1);t&&(r?ws(r)&&(o=cl(r)):o=cl(e));let s=dl(a,n,r)?ul(a):Ys(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=xs(a),t=ws(r)?xs(r):r,n=e,i=Us(n);for(;i&&t!==n;){let e=cl(i),t=i.getBoundingClientRect(),r=Rs(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=xs(i),i=Us(n)}}return _c({width:u,height:d,x:c,y:l})}function pl(e,t){let n=zs(e).scrollLeft;return t?t.left+n:fl(Ss(e)).left+n}function ml(e,t){let n=e.getBoundingClientRect();return{x:n.left+t.scrollLeft-pl(e,n),y:n.top+t.scrollTop}}function hl(e){let{elements:t,rect:n,offsetParent:r,strategy:i}=e,a=i===`fixed`,o=Ss(r),s=t?ks(t.floating):!1;if(r===o||s&&a)return n;let c={scrollLeft:0,scrollTop:0},l=Ys(1),u=Ys(0),d=Ts(r);if((d||!a)&&((bs(r)!==`body`||Ds(o))&&(c=zs(r)),d)){let e=fl(r);l=cl(r),u.x=e.x+r.clientLeft,u.y=e.y+r.clientTop}let f=o&&!d&&!a?ml(o,c):Ys(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 gl(e){return e.getClientRects?Array.from(e.getClientRects()):[]}function _l(e){let t=zs(e),n=e.ownerDocument.body,r=Ks(e.scrollWidth,e.clientWidth,n.scrollWidth,n.clientWidth),i=Ks(e.scrollHeight,e.clientHeight,n.scrollHeight,n.clientHeight),a=-t.scrollLeft+pl(e),o=-t.scrollTop;return Rs(n).direction===`rtl`&&(a+=Ks(e.clientWidth,n.clientWidth)-r),{width:r,height:i,x:a,y:o}}var vl=25;function yl(e,t,n){n===void 0&&(n=`viewport`);let r=n===`layoutViewport`,i=xs(e),a=Ss(e),o=i.visualViewport,s=a.clientWidth,c=a.clientHeight,l=0,u=0;if(o){let e=!Is()||t===`fixed`;r?e||(l=-o.offsetLeft,u=-o.offsetTop):(s=o.width,c=o.height,e&&(l=o.offsetLeft,u=o.offsetTop))}if(pl(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<=vl&&(s-=o)}return{width:s,height:c,x:l,y:u}}function bl(e,t){let n=fl(e,!0,t===`fixed`),r=n.top+e.clientTop,i=n.left+e.clientLeft,a=cl(e);return{width:e.clientWidth*a.x,height:e.clientHeight*a.y,x:i*a.x,y:r*a.y}}function xl(e,t,n){let r;if(t===`viewport`||t===`layoutViewport`)r=yl(e,n,t);else if(t===`document`)r=_l(Ss(e));else if(ws(t))r=bl(t,n);else{let n=ul(e);r={x:t.x-n.x,y:t.y-n.y,width:t.width,height:t.height}}return _c(r)}function Sl(e,t){let n=t.get(e);if(n)return n;let r=Hs(e,[],!1).filter(e=>ws(e)&&bs(e)!==`body`),i=null,a=Rs(e).position===`fixed`,o=a?Bs(e):e;for(;ws(o)&&!Ls(o);){let e=Rs(o),t=Ps(o),n=i?i.position:a?`fixed`:``;!t&&(n===`fixed`||n===`absolute`&&e.position===`static`)?r=r.filter(e=>e!==o):i=e,o=Bs(o)}return t.set(e,r),r}function Cl(e){let{element:t,boundary:n,rootBoundary:r,strategy:i}=e,a=[...n===`clippingAncestors`?ks(t)?[]:Sl(t,this._c):[].concat(n),r],o=xl(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=xs(e),l=()=>s(n);return c.addEventListener(`resize`,l),s(!0),()=>{c.removeEventListener(`resize`,l),o()}}function Pl(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=sl(e),u=i||a?[...l?Hs(l):[],...t?Hs(t):[]]:[];u.forEach(e=>{i&&e.addEventListener(`scroll`,n),a&&e.addEventListener(`resize`,n)});let d=l&&s?Nl(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?fl(e):null;c&&g();function g(){let t=fl(e);h&&!Ml(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 Fl=nl,Il=rl,Ll=qc,Rl=al,zl=Xc,Bl=Kc,Vl=$c,Hl=il,Ul=(e,t,n)=>{let r=new Map,i=n??{},a={...jl,...i.platform,_c:r};return Gc(e,t,{...i,platform:a})},Wl=r(we(),1),Gl=typeof document<`u`?M.useLayoutEffect:function(){};function Kl(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(!Kl(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)&&!Kl(e[n],t[n]))return!1}return!0}return e!==e&&t!==t}function ql(e){return typeof window>`u`?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function Jl(e,t){let n=ql(e);return Math.round(t*n)/n}function Yl(e){let t=M.useRef(e);return Gl(()=>{t.current=e}),t}function Xl(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]=M.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[f,p]=M.useState(r);Kl(f,r)||p(r);let[m,h]=M.useState(null),[g,_]=M.useState(null),v=M.useCallback(e=>{e!==S.current&&(S.current=e,h(e))},[]),y=M.useCallback(e=>{e!==C.current&&(C.current=e,_(e))},[]),b=a||m,x=o||g,S=M.useRef(null),C=M.useRef(null),w=M.useRef(u),T=c!=null,E=Yl(c),D=Yl(i),O=Yl(l),k=M.useCallback(()=>{if(!S.current||!C.current)return;let e={placement:t,strategy:n,middleware:f};D.current&&(e.platform=D.current),Ul(S.current,C.current,e).then(e=>{let t={...e,isPositioned:O.current!==!1};ee.current&&!Kl(w.current,t)&&(w.current=t,Wl.flushSync(()=>{d(t)}))})},[f,t,n,D,O]);Gl(()=>{l===!1&&w.current.isPositioned&&(w.current.isPositioned=!1,d(e=>({...e,isPositioned:!1})))},[l]);let ee=M.useRef(!1);Gl(()=>(ee.current=!0,()=>{ee.current=!1}),[]),Gl(()=>{if(b&&(S.current=b),x&&(C.current=x),b&&x){if(E.current)return E.current(b,x,k);k()}},[b,x,k,E,T]);let te=M.useMemo(()=>({reference:S,floating:C,setReference:v,setFloating:y}),[v,y]),ne=M.useMemo(()=>({reference:b,floating:x}),[b,x]),re=M.useMemo(()=>{let e={position:n,left:0,top:0};if(!ne.floating)return e;let t=Jl(ne.floating,u.x),r=Jl(ne.floating,u.y);return s?{...e,transform:`translate(`+t+`px, `+r+`px)`,...ql(ne.floating)>=1.5&&{willChange:`transform`}}:{position:n,left:t,top:r}},[n,s,ne.floating,u.x,u.y]);return M.useMemo(()=>({...u,update:k,refs:te,elements:ne,floatingStyles:re}),[u,k,te,ne,re])}var Zl=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?{}:Bl({element:r.current,padding:i}).fn(n):r?Bl({element:r,padding:i}).fn(n):{}}}},Ql=(e,t)=>{let n=Fl(e);return{name:n.name,fn:n.fn,options:[e,t]}},$l=(e,t)=>{let n=Il(e);return{name:n.name,fn:n.fn,options:[e,t]}},eu=(e,t)=>({fn:Hl(e).fn,options:[e,t]}),tu=(e,t)=>{let n=Ll(e);return{name:n.name,fn:n.fn,options:[e,t]}},nu=(e,t)=>{let n=Rl(e);return{name:n.name,fn:n.fn,options:[e,t]}},ru=(e,t)=>{let n=zl(e);return{name:n.name,fn:n.fn,options:[e,t]}},iu=(e,t)=>{let n=Vl(e);return{name:n.name,fn:n.fn,options:[e,t]}},au=(e,t)=>{let n=Zl(e);return{name:n.name,fn:n.fn,options:[e,t]}};function ou(e){let t=M.useRef(void 0),n=M.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 M.useMemo(()=>e.every(e=>e==null)?null:e=>{t.current&&=(t.current(),void 0),e!=null&&(t.current=n(e))},e)}var su=`data-floating-ui-focusable`,cu=`active`,lu=`selected`,uu=`ArrowLeft`,du=`ArrowRight`,fu=`ArrowUp`,pu=`ArrowDown`,mu=[uu,du],hu=[fu,pu];[...mu,...hu];var gu={...M},_u=!1,vu=0,yu=()=>`floating-ui-`+Math.random().toString(36).slice(2,6)+vu++;function bu(){let[e,t]=M.useState(()=>_u?yu():void 0);return Lc(()=>{e??t(yu())},[]),M.useEffect(()=>{_u=!0},[]),e}var xu=gu.useId||bu;function Su(){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 Cu=M.createContext(null),wu=M.createContext(null),Tu=()=>M.useContext(Cu)?.id||null,Eu=()=>M.useContext(wu);function Du(e){return`data-floating-ui-`+e}function Ou(e){e.current!==-1&&(clearTimeout(e.current),e.current=-1)}var ku=Du(`safe-polygon`);function Au(e,t,n){if(n&&!Ic(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 ju(e){return typeof e==`function`?e():e}function Mu(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=Eu(),m=Tu(),h=zc(l),g=zc(c),_=zc(n),v=zc(d),y=M.useRef(),b=M.useRef(-1),x=M.useRef(),S=M.useRef(-1),C=M.useRef(!0),w=M.useRef(!1),T=M.useRef(()=>{}),E=M.useRef(!1),D=Vc(()=>{let e=i.current.openEvent?.type;return e?.includes(`mouse`)&&e!==`mousedown`});M.useEffect(()=>{if(!s)return;function e(e){let{open:t}=e;t||(Ou(b),Ou(S),C.current=!0,E.current=!1)}return a.on(`openchange`,e),()=>{a.off(`openchange`,e)}},[s,a]),M.useEffect(()=>{if(!s||!h.current||!n)return;function e(e){D()&&r(!1,e,`hover`)}let t=Ac(o.floating).documentElement;return t.addEventListener(`mouseleave`,e),()=>{t.removeEventListener(`mouseleave`,e)}},[o.floating,n,r,s,h,D]);let O=M.useCallback(function(e,t,n){t===void 0&&(t=!0),n===void 0&&(n=`hover`);let i=Au(g.current,`close`,y.current);i&&!x.current?(Ou(b),b.current=window.setTimeout(()=>r(!1,e,n),i)):t&&(Ou(b),r(!1,e,n))},[g,r]),k=Vc(()=>{T.current(),x.current=void 0}),ee=Vc(()=>{if(w.current){let e=Ac(o.floating).body;e.style.pointerEvents=``,e.removeAttribute(ku),w.current=!1}}),te=Vc(()=>i.current.openEvent?[`click`,`mousedown`].includes(i.current.openEvent.type):!1);M.useEffect(()=>{if(!s)return;function e(e){if(Ou(b),C.current=!1,u&&!Ic(y.current)||ju(v.current)>0&&!Au(g.current,`open`))return;let t=Au(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(te()){ee();return}T.current();let t=Ac(o.floating);if(Ou(S),E.current=!1,h.current&&i.current.floatingContext){n||Ou(b),x.current=h.current({...i.current.floatingContext,tree:p,x:e.clientX,y:e.clientY,onClose(){ee(),k(),te()||O(e,!0,`safe-polygon`)}});let r=x.current;t.addEventListener(`mousemove`,r),T.current=()=>{t.removeEventListener(`mousemove`,r)};return}(y.current!==`touch`||!Ec(o.floating,e.relatedTarget))&&O(e)}function a(e){te()||i.current.floatingContext&&(h.current==null||h.current({...i.current.floatingContext,tree:p,x:e.clientX,y:e.clientY,onClose(){ee(),k(),te()||O(e)}})(e))}function c(){Ou(b)}function l(e){te()||O(e,!1)}if(ws(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,O,k,ee,r,n,_,p,g,h,i,te,v]),Lc(()=>{var e;if(s&&n&&(e=h.current)!=null&&(e=e.__options)!=null&&e.blockPointerEvents&&D()){w.current=!0;let e=o.floating;if(ws(o.domReference)&&e){var t;let n=Ac(o.floating).body;n.setAttribute(ku,``);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,D]),Lc(()=>{n||(y.current=void 0,E.current=!1,k(),ee())},[n,k,ee]),M.useEffect(()=>()=>{k(),Ou(b),Ou(S),ee()},[s,o.domReference,k,ee]);let ne=M.useMemo(()=>{function e(e){y.current=e.pointerType}return{onPointerDown:e,onPointerEnter:e,onMouseMove(e){let{nativeEvent:t}=e;function i(){!C.current&&!_.current&&r(!0,t,`hover`)}u&&!Ic(y.current)||n||ju(v.current)===0||E.current&&e.movementX**2+e.movementY**2<2||(Ou(S),y.current===`touch`?i():(E.current=!0,S.current=window.setTimeout(i,ju(v.current))))}}},[u,r,n,_,v]);return M.useMemo(()=>s?{reference:ne}:{},[s,ne])}var Nu=()=>{},Pu=M.createContext({delay:0,initialDelay:0,timeoutMs:0,currentId:null,setCurrentId:Nu,setState:Nu,isInstantPhase:!1}),Fu=()=>M.useContext(Pu);function Iu(e){let{children:t,delay:n,timeoutMs:r=0}=e,[i,a]=M.useReducer((e,t)=>({...e,...t}),{delay:n,timeoutMs:r,initialDelay:n,currentId:null,isInstantPhase:!1}),o=M.useRef(null),s=M.useCallback(e=>{a({currentId:e})},[]);return Lc(()=>{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,N.jsx)(Pu.Provider,{value:M.useMemo(()=>({...i,setState:a,setCurrentId:s}),[i,s]),children:t})}function Lu(e,t){t===void 0&&(t={});let{open:n,onOpenChange:r,floatingId:i}=e,{id:a,enabled:o=!0}=t,s=a??i,c=Fu(),{currentId:l,setCurrentId:u,initialDelay:d,setState:f,timeoutMs:p}=c;return Lc(()=>{o&&l&&(f({delay:{open:1,close:Au(d,`close`)}}),l!==s&&r(!1))},[o,s,r,f,l,d]),Lc(()=>{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]),Lc(()=>{o&&(u===Nu||!n||u(s))},[o,n,u,s]),c}function Ru(e,t){if(!e||!t)return!1;let n=t.getRootNode==null?void 0:t.getRootNode();if(e.contains(t))return!0;if(n&&Es(n)){let n=t;for(;n;){if(e===n)return!0;n=n.parentNode||n.host}}return!1}function zu(e){return`composedPath`in e?e.composedPath()[0]:e.target}var Bu={pointerdown:`onPointerDown`,mousedown:`onMouseDown`,click:`onClick`},Vu={pointerdown:`onPointerDownCapture`,mousedown:`onMouseDownCapture`,click:`onClickCapture`},Hu=e=>({escapeKey:typeof e==`boolean`?e:e?.escapeKey??!1,outsidePress:typeof e==`boolean`?e:e?.outsidePress??!0});function Uu(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=Eu(),g=Vc(typeof c==`function`?c:()=>!1),_=typeof c==`function`?g:c,v=M.useRef(!1),{escapeKey:y,outsidePress:b}=Hu(p),{escapeKey:x,outsidePress:S}=Hu(m),C=M.useRef(!1),w=Vc(e=>{if(!n||!o||!s||e.key!==`Escape`||C.current)return;let t=a.current.floatingContext?.nodeId,i=h?Pc(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,Fc(e)?e.nativeEvent:e,`escape-key`)}),T=Vc(e=>{var t;let n=()=>{var t;w(e),(t=Dc(e))==null||t.removeEventListener(`keydown`,n)};(t=Dc(e))==null||t.addEventListener(`keydown`,n)}),E=Vc(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=Dc(e),s=`[`+Du(`inert`)+`]`,c=Ac(i.floating).querySelectorAll(s),u=ws(o)?o:null;for(;u&&!Ls(u);){let e=Bs(u);if(Ls(e)||!ws(e))break;u=e}if(c.length&&ws(o)&&!kc(o)&&!Ec(o,i.floating)&&Array.from(c).every(e=>!Ec(u,e)))return;if(Ts(o)&&k){let t=Ls(o),n=Rs(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&&Pc(h.nodesRef.current,d).some(t=>Oc(e,t.context?.elements.floating));if(Oc(e,i.floating)||Oc(e,i.domReference)||f)return;let p=h?Pc(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`)}),D=Vc(e=>{var t;let n=()=>{var t;E(e),(t=Dc(e))==null||t.removeEventListener(l,n)};(t=Dc(e))==null||t.addEventListener(l,n)});M.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),C.current=!0}function u(){e=window.setTimeout(()=>{C.current=!1},Is()?5:0)}let d=Ac(i.floating);s&&(d.addEventListener(`keydown`,x?T:w,x),d.addEventListener(`compositionstart`,c),d.addEventListener(`compositionend`,u)),_&&d.addEventListener(l,S?D:E,S);let p=[];return f&&(ws(i.domReference)&&(p=Hs(i.domReference)),ws(i.floating)&&(p=p.concat(Hs(i.floating))),!ws(i.reference)&&i.reference&&i.reference.contextElement&&(p=p.concat(Hs(i.reference.contextElement)))),p=p.filter(e=>e!==d.defaultView?.visualViewport),p.forEach(e=>{e.addEventListener(`scroll`,t)}),()=>{s&&(d.removeEventListener(`keydown`,x?T:w,x),d.removeEventListener(`compositionstart`,c),d.removeEventListener(`compositionend`,u)),_&&d.removeEventListener(l,S?D:E,S),p.forEach(e=>{e.removeEventListener(`scroll`,t)}),window.clearTimeout(e)}},[a,i,s,_,l,n,r,f,o,y,b,w,x,T,E,S,D]),M.useEffect(()=>{a.current.insideReactTree=!1},[a,_,l]);let O=M.useMemo(()=>({onKeyDown:w,...u&&{[Bu[d]]:e=>{r(!1,e.nativeEvent,`reference-press`)},...d!==`click`&&{onClick(e){r(!1,e.nativeEvent,`reference-press`)}}}}),[w,r,u,d]),k=M.useMemo(()=>{function e(e){e.button===0&&(v.current=!0)}return{onKeyDown:w,onMouseDown:e,onMouseUp:e,[Vu[l]]:()=>{a.current.insideReactTree=!0}}},[w,l,a]);return M.useMemo(()=>o?{reference:O,floating:k}:{},[o,O,k])}function Wu(e){let{open:t=!1,onOpenChange:n,elements:r}=e,i=xu(),a=M.useRef({}),[o]=M.useState(()=>Su()),s=Tu()!=null,[c,l]=M.useState(r.reference),u=Vc((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=M.useMemo(()=>({setPositionReference:l}),[]),f=M.useMemo(()=>({reference:c||r.reference||null,floating:r.floating||null,domReference:r.reference}),[c,r.reference,r.floating]);return M.useMemo(()=>({dataRef:a,open:t,onOpenChange:u,elements:f,events:o,floatingId:i,refs:d}),[t,u,f,o,i,d])}function Gu(e){let{elements:t,...n}=e===void 0?{}:e,{nodeId:r}=n,i=Wu({...n,elements:{reference:t?.reference??null,floating:t?.floating??null}}),a=n.rootContext||i,o=a.elements,[s,c]=M.useState(null),[l,u]=M.useState(null),d=o?.domReference||s,f=M.useRef(null),p=Eu();Lc(()=>{d&&(f.current=d)},[d]);let m=Xl({...n,elements:{...o,...l&&{reference:l}}}),h=M.useCallback(e=>{let t=ws(e)?{getBoundingClientRect:()=>e.getBoundingClientRect(),getClientRects:()=>e.getClientRects(),contextElement:e}:e;u(t),m.refs.setReference(t)},[m.refs]),g=M.useCallback(e=>{(ws(e)||e===null)&&(f.current=e,c(e)),(ws(m.refs.reference.current)||m.refs.reference.current===null||e!==null&&!ws(e))&&m.refs.setReference(e)},[m.refs]),_=M.useMemo(()=>({...m.refs,setReference:g,setPositionReference:h,domReference:f}),[m.refs,g,h]),v=M.useMemo(()=>({...m.elements,domReference:d}),[m.elements,d]),y=M.useMemo(()=>({...m,...a,refs:_,elements:v,nodeId:r}),[m,_,v,r,a]);return Lc(()=>{a.dataRef.current.floatingContext=y;let e=p?.nodesRef.current.find(e=>e.id===r);e&&(e.context=y)}),M.useMemo(()=>({...m,context:y,refs:_,elements:v}),[m,_,v,y])}function Ku(){return xc()&&bc()}function qu(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=M.useRef(!1),u=M.useRef(-1),d=M.useRef(!0);M.useEffect(()=>{if(!s)return;let e=xs(o.domReference);function t(){!n&&Ts(o.domReference)&&o.domReference===Tc(Ac(o.domReference))&&(l.current=!0)}function r(){d.current=!0}function i(){d.current=!1}return e.addEventListener(`blur`,t),Ku()&&(e.addEventListener(`keydown`,r,!0),e.addEventListener(`pointerdown`,i,!0)),()=>{e.removeEventListener(`blur`,t),Ku()&&(e.removeEventListener(`keydown`,r,!0),e.removeEventListener(`pointerdown`,i,!0))}},[o.domReference,n,s]),M.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]),M.useEffect(()=>()=>{Ou(u)},[]);let f=M.useMemo(()=>({onMouseLeave(){l.current=!1},onFocus(e){if(l.current)return;let t=Dc(e.nativeEvent);if(c&&ws(t)){if(Ku()&&!e.relatedTarget){if(!d.current&&!jc(t))return}else if(!Mc(t))return}r(!0,e.nativeEvent,`focus`)},onBlur(e){l.current=!1;let t=e.relatedTarget,n=e.nativeEvent,i=ws(t)&&t.hasAttribute(Du(`focus-guard`))&&t.getAttribute(`data-type`)===`outside`;u.current=window.setTimeout(()=>{let e=Tc(o.domReference?o.domReference.ownerDocument:document);!t&&e===o.domReference||Ec(a.current.floatingContext?.refs.floating.current,e)||Ec(o.domReference,e)||i||r(!1,n,`focus`)})}}),[a,o.domReference,r,c]);return M.useMemo(()=>s?{reference:f}:{},[s,f])}function Ju(e,t,n){let r=new Map,i=n===`item`,a=e;if(i&&e){let{[cu]:t,[lu]:n,...r}=e;a=r}return{...n===`floating`&&{tabIndex:-1,[su]:``},...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&&[cu,lu].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 Yu(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=M.useCallback(t=>Ju(t,e,`reference`),t),a=M.useCallback(t=>Ju(t,e,`floating`),n),o=M.useCallback(t=>Ju(t,e,`item`),r);return M.useMemo(()=>({getReferenceProps:i,getFloatingProps:a,getItemProps:o}),[i,a,o])}var Xu=new Map([[`select`,`listbox`],[`combobox`,`listbox`],[`label`,!1]]);function Zu(e,t){t===void 0&&(t={});let{open:n,elements:r,floatingId:i}=e,{enabled:a=!0,role:o=`dialog`}=t,s=xu(),c=r.domReference?.id||s,l=M.useMemo(()=>Nc(r.floating)?.id||i,[r.floating,i]),u=Xu.get(o)??o,d=Tu()!=null,f=M.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=M.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=M.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 M.useMemo(()=>a?{reference:f,floating:p,item:m}:{},[a,f,p,m])}function Qu(e,t,n){return n===void 0&&(n=!0),e.filter(e=>e.parentId===t&&(!n||e.context?.open)).flatMap(t=>[t,...Qu(e,t.id,n)])}function $u(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 ed(e,t){return e[0]>=t.x&&e[0]<=t.x+t.width&&e[1]>=t.y&&e[1]<=t.y+t.height}function td(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(){Ou(i),u()}if(Ou(i),!c.domReference||!c.floating||s==null||n==null||o==null)return;let{clientX:m,clientY:h}=e,g=[m,h],_=zu(e),v=e.type===`mouseleave`,y=Ru(c.floating,_),b=Ru(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=ed(g,x),D=S.width>x.width,O=S.height>x.height,k=(D?x:S).left,ee=(D?x:S).right,te=(O?x:S).top,ne=(O?x:S).bottom;if(y&&(a=!0,!v))return;if(b&&(a=!1),b&&!v){a=!0;return}if(v&&ws(e.relatedTarget)&&Ru(c.floating,e.relatedTarget)||f&&Qu(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 re=[];switch(C){case`top`:re=[[k,x.top+1],[k,S.bottom-1],[ee,S.bottom-1],[ee,x.top+1]];break;case`bottom`:re=[[k,S.top+1],[k,x.bottom-1],[ee,x.bottom-1],[ee,S.top+1]];break;case`left`:re=[[S.right-1,ne],[S.right-1,te],[x.left+1,te],[x.left+1,ne]];break;case`right`:re=[[x.right-1,ne],[x.right-1,te],[S.left+1,te],[S.left+1,ne]]}function A(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(!$u([m,h],re)){if(a&&!E)return p();if(!v&&r){let t=l(e.clientX,e.clientY);if(t!==null&&t<.1)return p()}$u([m,h],A([n,o]))?!a&&r&&(i.current=window.setTimeout(p,40)):p()}}};return u.__options={blockPointerEvents:n},u}var nd={scrollHideDelay:1e3,type:`hover`,scrollbars:`xy`},rd=O((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":j(t),"--scrollarea-over-scroll-behavior":i}}}),id=g(e=>{let t=D(`ScrollArea`,nd,e),{classNames:n,className:r,style:i,styles:a,unstyled:o,scrollbarSize:s,vars:c,type:l,scrollHideDelay:u,viewportProps:d,viewportRef:f,onScrollPositionChange:p,children:m,offsetScrollbars:h,scrollbars:g,onBottomReached:_,onTopReached:v,onLeftReached:y,onRightReached:b,overscrollBehavior:x,startScrollPosition:S,verticalScrollbarPosition:C,attributes:T,...E}=t,[O,k]=(0,M.useState)(!1),[ee,te]=(0,M.useState)(!1),[ne,re]=(0,M.useState)(!1),A=(0,M.useRef)(!0),ie=(0,M.useRef)(!1),ae=(0,M.useRef)(!0),oe=(0,M.useRef)(!1),se=w({name:`ScrollArea`,props:t,classes:vs,className:r,style:i,classNames:n,styles:a,unstyled:o,attributes:T,vars:c,varsResolver:rd}),ce=(0,M.useRef)(null),[le,ue]=(0,M.useState)(null),de=ou([f,ce,(0,M.useCallback)(e=>{ue(t=>t===e?t:e)},[])]);return Wo(h===`present`?le:null,()=>{let e=ce.current;e&&(te(e.scrollHeight>e.clientHeight),re(e.scrollWidth>e.clientWidth))}),Ee(()=>{S&&ce.current&&ce.current.scrollTo({left:S.x??0,top:S.y??0})},[]),(0,N.jsxs)(Jo,{getStyles:se,type:l===`never`?`always`:l,scrollHideDelay:u,scrollbars:g,...se(`root`),...E,children:[(0,N.jsx)(_s,{...d,...se(`viewport`,{style:d?.style}),ref:de,"data-offset-scrollbars":h===!0?`xy`:h||void 0,"data-scrollbars":g||void 0,"data-vertical-scrollbar-position":C||void 0,"data-horizontal-hidden":h===`present`&&!ne?`true`:void 0,"data-vertical-hidden":h===`present`&&!ee?`true`:void 0,onScroll:e=>{d?.onScroll?.(e),p?.({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&&!ie.current&&_?.(),c&&!A.current&&v?.(),ie.current=s,A.current=c;let l=i-(a-o)>=-.8,u=i===0;l&&!oe.current&&b?.(),u&&!ae.current&&y?.(),oe.current=l,ae.current=u},children:m}),(g===`xy`||g===`x`)&&(0,N.jsx)(ps,{...se(`scrollbar`),orientation:`horizontal`,"data-vertical-scrollbar-position":C||void 0,"data-hidden":l===`never`||h===`present`&&!ne||void 0,forceMount:!0,onMouseEnter:()=>k(!0),onMouseLeave:()=>k(!1),children:(0,N.jsx)(gs,{...se(`thumb`)})}),(g===`xy`||g===`y`)&&(0,N.jsx)(ps,{...se(`scrollbar`),orientation:`vertical`,"data-vertical-scrollbar-position":C||void 0,"data-hidden":l===`never`||h===`present`&&!ee||void 0,forceMount:!0,onMouseEnter:()=>k(!0),onMouseLeave:()=>k(!1),children:(0,N.jsx)(gs,{...se(`thumb`)})}),(0,N.jsx)(Ko,{...se(`corner`),"data-vertical-scrollbar-position":C||void 0,"data-hovered":O||void 0,"data-hidden":l===`never`||void 0})]})});id.displayName=`@mantine/core/ScrollArea`;var ad=g(e=>{let{children:t,classNames:n,styles:r,scrollbarSize:i,scrollHideDelay:a,type:o,dir:s,offsetScrollbars:c,overscrollBehavior:l,viewportRef:u,onScrollPositionChange:d,unstyled:f,variant:p,viewportProps:m,scrollbars:h,style:g,vars:_,onBottomReached:v,onTopReached:y,startScrollPosition:b,verticalScrollbarPosition:x,onOverflowChange:S,...C}=D(`ScrollAreaAutosize`,nd,e),w=(0,M.useRef)(null),[T,E]=(0,M.useState)(null),O=ou([u,w,(0,M.useCallback)(e=>{E(t=>t===e?t:e)},[])]),k=(0,M.useRef)(!1),ee=(0,M.useRef)(!1),te=(0,M.useEffectEvent)(()=>{let e=w.current;if(!e||!S)return;let t=e.scrollHeight>e.clientHeight;t!==k.current&&(ee.current?S(t):(ee.current=!0,t&&S(!0)),k.current=t)});return Wo(S?T:null,te),(0,N.jsx)(Be,{...C,variant:p,style:[{display:`flex`,overflow:`hidden`},g],children:(0,N.jsx)(Be,{style:{display:`flex`,flexDirection:`column`,flex:1,overflow:`hidden`,...h===`y`&&{minWidth:0},...h===`x`&&{minHeight:0},...h===`xy`&&{minWidth:0,minHeight:0},...h===!1&&{minWidth:0,minHeight:0}},children:(0,N.jsx)(id,{classNames:n,styles:r,scrollHideDelay:a,scrollbarSize:i,type:o,dir:s,offsetScrollbars:c,overscrollBehavior:l,viewportRef:O,onScrollPositionChange:d,unstyled:f,variant:p,viewportProps:m,vars:_,scrollbars:h,onBottomReached:v,onTopReached:y,startScrollPosition:b,verticalScrollbarPosition:x,"data-autosize":`true`,children:t})})})});id.classes=vs,id.varsResolver=rd,ad.displayName=`@mantine/core/ScrollAreaAutosize`,ad.classes=vs,id.Autosize=ad;var od={root:`m_515a97f8`},sd=g(e=>{let t=D(`VisuallyHidden`,null,e),{classNames:n,className:r,style:i,styles:a,unstyled:o,vars:s,attributes:c,...l}=t;return(0,N.jsx)(Be,{component:`span`,...w({name:`VisuallyHidden`,classes:od,props:t,className:r,style:i,classNames:n,styles:a,unstyled:o,attributes:c})(`root`),...l})});sd.classes=od,sd.displayName=`@mantine/core/VisuallyHidden`;function cd(e,t,n,r){return e===`center`||r===`center`?{top:t}:e===`end`?{bottom:n}:e===`start`?{top:n}:{}}function ld(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 ud={bottom:`borderTopLeftRadius`,left:`borderTopRightRadius`,right:`borderBottomLeftRadius`,top:`borderBottomRightRadius`};function dd({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 fd({position:e,arrowSize:t,arrowOffset:n,arrowRadius:r,arrowPosition:i,arrowX:a,arrowY:o,dir:s}){if(i===`merge`){let n=dd({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`,[ud[c]]:r},d=-t/2;return c===`left`?{...u,...cd(l,o,n,i),right:d,borderLeftColor:`transparent`,borderBottomColor:`transparent`,clipPath:`polygon(100% 0, 0 0, 100% 100%)`}:c===`right`?{...u,...cd(l,o,n,i),left:d,borderRightColor:`transparent`,borderTopColor:`transparent`,clipPath:`polygon(0 100%, 0 0, 100% 100%)`}:c===`top`?{...u,...ld(l,a,n,i,s),bottom:d,borderTopColor:`transparent`,borderLeftColor:`transparent`,clipPath:`polygon(0 100%, 100% 100%, 100% 0)`}:c===`bottom`?{...u,...ld(l,a,n,i,s),top:d,borderBottomColor:`transparent`,borderRightColor:`transparent`,clipPath:`polygon(0 100%, 0 0, 100% 0)`}:{}}function pd({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 md({position:e,arrowSize:t,arrowOffset:n,arrowRadius:r,arrowPosition:i,visible:a,arrowX:o,arrowY:s,style:c,...l}){let{dir:u}=Vo();return a?(0,N.jsx)(`div`,{role:`presentation`,...l,style:{...c,...fd({position:e,arrowSize:t,arrowOffset:n,arrowRadius:r,arrowPosition:i,dir:u,arrowX:o,arrowY:s})}}):null}md.displayName=`@mantine/core/FloatingArrow`;function hd(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 gd({open:e,close:t,openDelay:n,closeDelay:r}){let i=(0,M.useRef)(-1),a=(0,M.useRef)(-1),o=()=>{window.clearTimeout(i.current),window.clearTimeout(a.current)};return(0,M.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 _d={root:`m_9814e45f`},vd={zIndex:ka(`modal`)},yd=O((e,{gradient:t,color:n,backgroundOpacity:r,blur:i,radius:a,zIndex:o})=>({root:{"--overlay-bg":t||(n!==void 0||r!==void 0)&&v(n||`#000`,r??.6)||void 0,"--overlay-filter":i?`blur(${j(i)})`:void 0,"--overlay-radius":a===void 0?void 0:ce(a),"--overlay-z-index":o?.toString()}})),bd=te(e=>{let t=D(`Overlay`,vd,e),{classNames:n,className:r,style:i,styles:a,unstyled:o,vars:s,fixed:c,center:l,children:u,radius:d,zIndex:f,gradient:p,blur:m,color:h,backgroundOpacity:g,mod:_,attributes:v,...y}=t;return(0,N.jsx)(Be,{...w({name:`Overlay`,props:t,classes:_d,className:r,style:i,classNames:n,styles:a,unstyled:o,attributes:v,vars:s,varsResolver:yd})(`root`),mod:[{center:l,fixed:c},_],...y,children:u})});bd.classes=_d,bd.varsResolver=yd,bd.displayName=`@mantine/core/Overlay`;function xd(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}function Sd({target:e,reuseTargetNode:t,...n}){if(e)return typeof e==`string`?document.querySelector(e)||xd(n):e;if(t){let e=document.querySelector(`[data-mantine-shared-portal-node]`);if(e)return e;let t=xd(n);return t.setAttribute(`data-mantine-shared-portal-node`,`true`),document.body.appendChild(t),t}return xd(n)}var Cd={reuseTargetNode:!0},wd=g(e=>{let{children:t,target:n,reuseTargetNode:r,ref:i,...a}=D(`Portal`,Cd,e),[o,s]=(0,M.useState)(!1),c=(0,M.useRef)(null);return Ee(()=>(s(!0),c.current=Sd({target:n,reuseTargetNode:r,...a}),to(i,c.current),!n&&!r&&c.current&&document.body.appendChild(c.current),()=>{!n&&!r&&c.current&&document.body.removeChild(c.current)}),[n]),!o||!c.current?null:(0,Wl.createPortal)((0,N.jsx)(N.Fragment,{children:t}),c.current)});wd.displayName=`@mantine/core/Portal`;var Td=g(({withinPortal:e=!0,children:t,...n})=>y()===`test`||!e?(0,N.jsx)(N.Fragment,{children:t}):(0,N.jsx)(wd,{...n,children:t}));Td.displayName=`@mantine/core/OptionalPortal`;var Ed={duration:100,transition:`fade`};function Dd(e,t){return{...Ed,...t,...e}}var[Od,kd]=Sa(`Popover component was not found in the tree`);function Ad({childProps:e,disabled:t,opened:n,longPressDelay:r=500,setReference:i,open:a}){let o=(0,M.useRef)(!1),s=(0,M.useRef)(!1),c=(0,M.useRef)(null),l=(0,M.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=Ma(e.onMouseDown,e=>{t||e.button===2&&e.stopPropagation()}),f=Ma(e.onContextMenu,e=>{t||e.defaultPrevented||(e.preventDefault(),!s.current&&(u(e.clientX,e.clientY,e.currentTarget),o.current&&(s.current=!0)))}),p=so(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:Ma(e.onTouchStart,p.onTouchStart),onTouchEnd:Ma(e.onTouchEnd,p.onTouchEnd),onTouchCancel:Ma(e.onTouchCancel,p.onTouchCancel),onTouchMove:Ma(e.onTouchMove,p.onTouchMove),style:t?e.style:{...e.style,WebkitTouchCallout:`none`,WebkitUserSelect:`none`,userSelect:`none`},"data-expanded":n?!0:void 0}}function jd(e){let{children:t,disabled:n,longPressDelay:r}=D(`PopoverContextMenu`,null,e),i=mo(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=kd();return(0,M.cloneElement)(i,Ad({childProps:i.props,disabled:n||a.disabled,opened:a.opened,longPressDelay:r,setReference:a.reference,open:()=>{a.opened||a.onToggle()}}))}jd.displayName=`@mantine/core/PopoverContextMenu`;function Md({children:e,active:t=!0,refProp:n=`ref`,innerRef:r}){let i=ro($a(t),r),a=mo(e);return a?(0,M.cloneElement)(a,{[n]:i}):e}function Nd(e){return(0,N.jsx)(sd,{tabIndex:-1,"data-autofocus":!0,...e})}Md.displayName=`@mantine/core/FocusTrap`,Nd.displayName=`@mantine/core/FocusTrapInitialFocus`,Md.InitialFocus=Nd;var Pd={dropdown:`m_38a85659`,arrow:`m_a31dc6c1`,overlay:`m_3d7bc908`},Fd=g(e=>{let t=D(`PopoverDropdown`,null,e),{className:n,style:r,vars:i,children:a,onKeyDownCapture:o,variant:s,classNames:c,styles:l,ref:u,...d}=t,f=kd(),{dir:p}=Vo(),m=f.arrowPosition===`merge`&&f.withArrow?pd({position:f.placement,dir:p}):void 0,h=Ua({opened:f.opened,shouldReturnFocus:f.returnFocus}),g=f.withRoles?{"aria-labelledby":f.getTargetId(),id:f.getDropdownId(),role:`dialog`,tabIndex:-1}:{},_=ro(u,f.floating);return f.disabled?null:(0,N.jsx)(Td,{...f.portalProps,withinPortal:f.withinPortal,children:(0,N.jsx)(Ve,{mounted:f.opened,...f.transitionProps,transition:f.transitionProps?.transition||`fade`,duration:f.transitionProps?.duration??150,keepMounted:f.keepMounted,keepMountedMode:f.keepMountedMode,exitDuration:typeof f.transitionProps?.exitDuration==`number`?f.transitionProps.exitDuration:f.transitionProps?.duration,children:e=>(0,N.jsx)(Md,{active:f.trapFocus&&f.opened,innerRef:_,children:(0,N.jsxs)(Be,{...g,...d,variant:s,onKeyDownCapture:ja(()=>{f.onClose?.(),f.onDismiss?.()},{active:f.closeOnEscape,onTrigger:h,onKeyDown:o}),"data-position":f.placement,"data-fixed":f.floatingStrategy===`fixed`||void 0,...f.getStyles(`dropdown`,{className:n,props:t,classNames:c,styles:l,style:[{...e,...m,zIndex:f.zIndex,top:f.y??0,left:f.x??0,width:f.width===`target`?void 0:j(f.width),...f.referenceHidden?{display:`none`}:null},f.resolvedStyles?.dropdown,l?.dropdown,r]}),children:[a,(0,N.jsx)(md,{ref:f.arrowRef,arrowX:f.arrowX,arrowY:f.arrowY,visible:f.withArrow,position:f.placement,arrowSize:f.arrowSize,arrowRadius:f.arrowRadius,arrowOffset:f.arrowOffset,arrowPosition:f.arrowPosition,...f.getStyles(`arrow`,{props:t,classNames:c,styles:l})})]})})})})});Fd.classes=Pd,Fd.displayName=`@mantine/core/PopoverDropdown`;var Id={refProp:`ref`,popupType:`dialog`},Ld=g(e=>{let{children:t,refProp:n,popupType:r,ref:i,...a}=D(`PopoverTarget`,Id,e),o=mo(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=kd(),l=ro(c.reference,po(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,M.cloneElement)(o,{...s,...u,...c.targetProps,className:ae(c.targetProps.className,s.className,d.className),[n]:l,...c.controlled?null:{onClick:e=>{c.onToggle(),d.onClick?.(e)}}})});Ld.displayName=`@mantine/core/PopoverTarget`;function Rd(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 zd(e,t,n,r){let i=Rd(e.middlewares),a=[Ql(e.offset),ru()];if(i.flip&&!n){let e=typeof i.flip==`boolean`?{}:i.flip,t=r?{fallbackStrategy:`initialPlacement`,...e}:e;a.push(tu(t))}if(i.shift){let t=typeof i.shift==`boolean`?{}:i.shift;a.push($l(n=>{let r=n.placement.startsWith(`top`)||n.placement.startsWith(`bottom`);return{limiter:eu(),padding:5,...e.width===`target`&&r?{mainAxis:!1}:null,...t}}))}return i.inline&&a.push(typeof i.inline==`boolean`?iu():iu(i.inline)),a.push(au({element:e.arrowRef,padding:e.arrowOffset})),(i.size||e.width===`target`)&&a.push(nu({...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 Bd(e){let[t,n]=io({value:e.opened,defaultValue:e.defaultOpened,finalValue:!1,onChange:e.onChange}),r=(0,M.useRef)(t),[i,a]=(0,M.useState)(null),o=e.preventPositionChangeWhenVisible!==!1,s=(0,M.useRef)(t);t!==s.current&&(s.current=t,t&&i!==null&&a(null));let c=(0,M.useCallback)(()=>a(null),[]),l=()=>{t&&!e.disabled&&n(!1)},u=()=>{e.disabled||n(!t)},d=Gu({open:t,strategy:e.strategy,placement:o?i??e.position:e.position,middleware:zd(e,()=>d,o&&i!==null,o),whileElementsMounted:e.keepMounted?void 0:Pl});(0,M.useEffect)(()=>{if(!e.keepMounted)return;let n=d.refs.reference.current,r=d.refs.floating.current;if(t&&n&&r)return Pl(n,r,d.update)},[e.keepMounted,t,d.update,d.elements.reference,d.elements.floating]);let f=(0,M.useRef)(!1);Ee(()=>{if(!t){f.current=!1;return}if(!o||i!==null)return;let e=d.refs.floating.current;if(!(!e||e.offsetHeight===0||e.offsetWidth===0)){if(!f.current){f.current=!0,d.update();return}d.isPositioned&&a(d.placement)}},[o,t,d.isPositioned,d.placement,i,d.update]);let p=(0,M.useRef)(d.placement);return Ee(()=>{p.current!==d.placement&&(p.current=d.placement,e.onPositionChange?.(d.placement))},[d.placement]),Ie(()=>{t!==r.current&&(t?e.onOpen?.():e.onClose?.()),r.current=t},[t,e.onClose,e.onOpen]),{floating:d,controlled:typeof e.opened==`boolean`,opened:t,onClose:l,onToggle:u,resetLockedPlacement:c}}var Vd={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`],zIndex:ka(`popover`),__staticSelector:`Popover`,width:`max-content`},Hd=O((e,{radius:t,shadow:n})=>({dropdown:{"--popover-radius":t===void 0?void 0:ce(t),"--popover-shadow":De(n)}}));function Ud(e){let t=D(`Popover`,Vd,e),{children:n,position:r,offset:i,onPositionChange:a,opened:o,transitionProps:s,onExitTransitionEnd:c,onEnterTransitionEnd:l,width:u,middlewares:d,withArrow:f,arrowSize:p,arrowOffset:m,arrowRadius:h,arrowPosition:g,unstyled:_,classNames:v,styles:b,closeOnClickOutside:x,withinPortal:S,portalProps:C,closeOnEscape:E,clickOutsideEvents:O,trapFocus:k,onClose:ee,onDismiss:te,onOpen:ne,onChange:re,zIndex:A,radius:ie,shadow:ae,id:oe,defaultOpened:se,__staticSelector:ce,withRoles:le,disabled:ue,returnFocus:de,variant:fe,keepMounted:j,keepMountedMode:me,vars:he,floatingStrategy:ge,withOverlay:_e,overlayProps:ve,hideDetached:ye,attributes:be,preventPositionChangeWhenVisible:xe,...Se}=t,Ce=w({name:ce,props:t,classes:Pd,classNames:v,styles:b,unstyled:_,attributes:be,rootSelector:`dropdown`,vars:he,varsResolver:Hd}),{resolvedStyles:we}=T({classNames:v,styles:b,props:t}),Te=(0,M.useRef)(null),[Ee,De]=(0,M.useState)(null),[Oe,ke]=(0,M.useState)(null),{dir:Ae}=Vo(),je=y(),Me=pe(oe),Ne=Bd({middlewares:d,width:u,position:hd(Ae,r),offset:typeof i==`number`?i+(f?p/2:0):i,arrowRef:Te,arrowOffset:m,onPositionChange:a,opened:o,defaultOpened:se,onChange:re,onOpen:ne,onClose:ee,onDismiss:te,strategy:ge,disabled:ue,preventPositionChangeWhenVisible:xe,keepMounted:j});Ba(()=>{x&&(Ne.onClose(),te?.())},O,[Ee,Oe]);let Pe=(0,M.useCallback)(e=>{De(e),Ne.floating.refs.setReference(e)},[Ne.floating.refs.setReference]),Fe=(0,M.useCallback)(e=>{ke(e),Ne.floating.refs.setFloating(e)},[Ne.floating.refs.setFloating]),Ie=(0,M.useCallback)(()=>{s?.onExited?.(),c?.(),Ne.resetLockedPlacement()},[s?.onExited,c,Ne.resetLockedPlacement]),Le=(0,M.useCallback)(()=>{s?.onEntered?.(),l?.()},[s?.onEntered,l]);return(0,N.jsxs)(Od,{value:{returnFocus:de,disabled:ue,controlled:Ne.controlled,reference:Pe,floating:Fe,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:Ie,onEntered:Le},width:u,withArrow:f,arrowSize:p,arrowOffset:m,arrowRadius:h,arrowPosition:g,placement:Ne.floating.placement,trapFocus:k,withinPortal:S,portalProps:C,zIndex:A,radius:ie,shadow:ae,closeOnEscape:E,onDismiss:te,onClose:Ne.onClose,onToggle:Ne.onToggle,getTargetId:()=>Me,getDropdownId:()=>`${Me}-dropdown`,withRoles:le,targetProps:Se,__staticSelector:ce,classNames:v,styles:b,unstyled:_,variant:fe,keepMounted:j,keepMountedMode:me,getStyles:Ce,resolvedStyles:we,floatingStrategy:ge,referenceHidden:ye&&je!==`test`?Ne.floating.middlewareData.hide?.referenceHidden:!1},children:[n,_e&&(0,N.jsx)(Ve,{transition:`fade`,mounted:Ne.opened,duration:s?.duration||250,exitDuration:s?.exitDuration||250,children:e=>(0,N.jsx)(Td,{withinPortal:S,children:(0,N.jsx)(bd,{...ve,...Ce(`overlay`,{className:ve?.className,style:[e,ve?.style]})})})})]})}Ud.Target=Ld,Ud.Dropdown=Fd,Ud.ContextMenu=jd,Ud.varsResolver=Hd,Ud.displayName=`@mantine/core/Popover`,Ud.extend=e=>e,Ud.withProps=e=>{let t=t=>(0,N.jsx)(Ud,{...e,...t});return t.extend=Ud.extend,t.displayName=`WithProps(${Ud.displayName})`,t};var Wd={root:`m_8d3f4000`,icon:`m_8d3afb97`,loader:`m_302b9fb1`,group:`m_1a0f1b21`,groupSection:`m_437b6484`},Gd={orientation:`horizontal`},Kd=O((e,{borderWidth:t})=>({group:{"--ai-border-width":j(t)}})),qd=g(e=>{let t=D(`ActionIconGroup`,Gd,e),{className:n,style:r,classNames:i,styles:a,unstyled:o,orientation:s,vars:c,borderWidth:l,variant:u,mod:d,attributes:f,...p}=t;return(0,N.jsx)(Be,{...w({name:`ActionIconGroup`,props:t,classes:Wd,className:n,style:r,classNames:i,styles:a,unstyled:o,attributes:f,vars:c,varsResolver:Kd,rootSelector:`group`})(`group`),variant:u,mod:[{"data-orientation":s},d],role:`group`,...p})});qd.classes=Wd,qd.varsResolver=Kd,qd.displayName=`@mantine/core/ActionIconGroup`;var Jd=O((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":Pe(o,`section-height`),"--section-padding-x":Pe(o,`section-padding-x`),"--section-fz":ye(o),"--section-radius":t===void 0?void 0:ce(t),"--section-bg":n||i?s.background:void 0,"--section-color":s.color,"--section-bd":n||i?s.border:void 0}}}),Yd=g(e=>{let t=D(`ActionIconGroupSection`,null,e),{className:n,style:r,classNames:i,styles:a,unstyled:o,vars:s,variant:c,gradient:l,radius:u,autoContrast:d,attributes:f,...p}=t;return(0,N.jsx)(Be,{...w({name:`ActionIconGroupSection`,props:t,classes:Wd,className:n,style:r,classNames:i,styles:a,unstyled:o,attributes:f,vars:s,varsResolver:Jd,rootSelector:`groupSection`})(`groupSection`),variant:c,...p})});Yd.classes=Wd,Yd.varsResolver=Jd,Yd.displayName=`@mantine/core/ActionIconGroupSection`;var Xd=O((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:{"--ai-size":Pe(t,`ai-size`),"--ai-radius":n===void 0?void 0:ce(n),"--ai-bg":a||r?s.background:void 0,"--ai-hover":a||r?s.hover:void 0,"--ai-hover-color":a||r?s.hoverColor:void 0,"--ai-color":s.color,"--ai-bd":a||r?s.border:void 0}}}),Zd=te(e=>{let t=D(`ActionIcon`,null,e),{className:n,unstyled:r,variant:i,classNames:a,styles:o,style:s,loading:c,loaderProps:l,size:u,color:d,radius:f,__staticSelector:p,gradient:m,vars:g,children:_,disabled:v,"data-disabled":y,autoContrast:b,mod:x,attributes:S,...C}=t,T=w({name:[`ActionIcon`,p],props:t,className:n,style:s,classes:Wd,classNames:a,styles:o,unstyled:r,attributes:S,vars:g,varsResolver:Xd});return(0,N.jsxs)(h,{...T(`root`,{active:!v&&!c&&!y}),"aria-busy":c||void 0,...C,unstyled:r,variant:i,size:u,disabled:v||c,mod:[{loading:c,disabled:v||y},x],children:[typeof c==`boolean`&&(0,N.jsx)(Ve,{mounted:c,transition:`slide-down`,duration:150,children:e=>(0,N.jsx)(Be,{component:`span`,...T(`loader`,{style:e}),"aria-hidden":!0,children:(0,N.jsx)(le,{color:`var(--ai-color)`,size:`calc(var(--ai-size) * 0.55)`,...l})})}),(0,N.jsx)(Be,{component:`span`,mod:{loading:c},...T(`icon`),children:_})]})});Zd.classes=Wd,Zd.varsResolver=Xd,Zd.displayName=`@mantine/core/ActionIcon`,Zd.Group=qd,Zd.GroupSection=Yd;var[Qd,$d]=Sa(`ModalBase component was not found in tree`);function ef({opened:e,transitionDuration:t}){let[n,r]=(0,M.useState)(e),i=(0,M.useRef)(-1),a=p()?0:t;return(0,M.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 tf({id:e,transitionProps:t,opened:n,trapFocus:r,closeOnEscape:i,onClose:a,returnFocus:o}){let s=pe(e),[c,l]=(0,M.useState)(!1),[u,d]=(0,M.useState)(!1),f=ef({opened:n,transitionDuration:typeof t?.duration==`number`?t?.duration:200});return eo(`keydown`,e=>{e.key===`Escape`&&i&&!e.isComposing&&n&&e.target?.getAttribute(`data-mantine-stop-propagation`)!==`true`&&a()},{capture:!0}),Ua({opened:n,shouldReturnFocus:r&&o}),{_id:s,titleMounted:c,bodyMounted:u,shouldLockScroll:f,setTitleMounted:l,setBodyMounted:d}}var nf=function(e,t){return nf=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])},nf(e,t)};function rf(e,t){if(typeof t!=`function`&&t!==null)throw TypeError(`Class extends value `+String(t)+` is not a constructor or null`);nf(e,t);function n(){this.constructor=e}e.prototype=t===null?Object.create(t):(n.prototype=t.prototype,new n)}var af=function(){return af=Object.assign||function(e){for(var t,n=1,r=arguments.length;n0&&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 uf(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 df(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 ff?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 mf(e){if(!Symbol.asyncIterator)throw TypeError(`Symbol.asyncIterator is not defined.`);var t=e[Symbol.asyncIterator],n;return t?t.call(e):(e=typeof lf==`function`?lf(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)}}var hf=`right-scroll-bar-position`,gf=`width-before-scroll-bar`,_f=`with-scroll-bars-hidden`,vf=`--removed-body-scroll-bar-size`;function yf(e,t){return typeof e==`function`?e(t):e&&(e.current=t),e}function bf(e,t){var n=(0,M.useState)(function(){return{value:e,callback:t,facade:{get current(){return n.value},set current(e){var t=n.value;t!==e&&(n.value=e,n.callback(e,t))}}}})[0];return n.callback=t,n.facade}var xf=typeof window<`u`?M.useLayoutEffect:M.useEffect,Sf=new WeakMap;function Cf(e,t){var n=bf(t||null,function(t){return e.forEach(function(e){return yf(e,t)})});return xf(function(){var t=Sf.get(n);if(t){var r=new Set(t),i=new Set(e),a=n.current;r.forEach(function(e){i.has(e)||yf(e,null)}),i.forEach(function(e){r.has(e)||yf(e,a)})}Sf.set(n,e)},[e]),n}function wf(e){return e}function Tf(e,t){t===void 0&&(t=wf);var n=[],r=!1;return{read:function(){if(r)throw Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return n.length?n[n.length-1]:e},useMedium:function(e){var i=t(e,r);return n.push(i),function(){n=n.filter(function(e){return e!==i})}},assignSyncMedium:function(e){for(r=!0;n.length;){var t=n;n=[],t.forEach(e)}n={push:function(t){return e(t)},filter:function(){return n}}},assignMedium:function(e){r=!0;var t=[];if(n.length){var i=n;n=[],i.forEach(e),t=n}var a=function(){var n=t;t=[],n.forEach(e)},o=function(){return Promise.resolve().then(a)};o(),n={push:function(e){t.push(e),o()},filter:function(e){return t=t.filter(e),n}}}}}function Ef(e){e===void 0&&(e={});var t=Tf(null);return t.options=af({async:!0,ssr:!1},e),t}var Df=function(e){var t=e.sideCar,n=of(e,[`sideCar`]);if(!t)throw Error("Sidecar: please provide `sideCar` property to import the right car");var r=t.read();if(!r)throw Error(`Sidecar medium not found`);return M.createElement(r,af({},n))};Df.isSideCarExport=!0;function Of(e,t){return e.useMedium(t),Df}var kf=Ef(),Af=function(){},jf=M.forwardRef(function(e,t){var n=M.useRef(null),r=M.useState({onScrollCapture:Af,onWheelCapture:Af,onTouchMoveCapture:Af}),i=r[0],a=r[1],o=e.forwardProps,s=e.children,c=e.className,l=e.removeScrollBar,u=e.enabled,d=e.shards,f=e.sideCar,p=e.noRelative,m=e.noIsolation,h=e.inert,g=e.allowPinchZoom,_=e.as,v=_===void 0?`div`:_,y=e.gapMode,b=of(e,[`forwardProps`,`children`,`className`,`removeScrollBar`,`enabled`,`shards`,`sideCar`,`noRelative`,`noIsolation`,`inert`,`allowPinchZoom`,`as`,`gapMode`]),x=f,S=Cf([n,t]),C=af(af({},b),i);return M.createElement(M.Fragment,null,u&&M.createElement(x,{sideCar:kf,removeScrollBar:l,shards:d,noRelative:p,noIsolation:m,inert:h,setCallbacks:a,allowPinchZoom:!!g,lockRef:n,gapMode:y}),o?M.cloneElement(M.Children.only(s),af(af({},C),{ref:S})):M.createElement(v,af({},C,{className:c,ref:S}),s))});jf.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1},jf.classNames={fullWidth:gf,zeroRight:hf};var Mf=function(){if(typeof __webpack_nonce__<`u`)return __webpack_nonce__};function Nf(){if(!document)return null;var e=document.createElement(`style`);e.type=`text/css`;var t=Mf();return t&&e.setAttribute(`nonce`,t),e}function Pf(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function Ff(e){(document.head||document.getElementsByTagName(`head`)[0]).appendChild(e)}var If=function(){var e=0,t=null;return{add:function(n){e==0&&(t=Nf())&&(Pf(t,n),Ff(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},Lf=function(){var e=If();return function(t,n){M.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&n])}},Rf=function(){var e=Lf();return function(t){var n=t.styles,r=t.dynamic;return e(n,r),null}},zf={left:0,top:0,right:0,gap:0},Bf=function(e){return parseInt(e||``,10)||0},Vf=function(e){var t=window.getComputedStyle(document.body),n=t[e===`padding`?`paddingLeft`:`marginLeft`],r=t[e===`padding`?`paddingTop`:`marginTop`],i=t[e===`padding`?`paddingRight`:`marginRight`];return[Bf(n),Bf(r),Bf(i)]},Hf=function(e){if(e===void 0&&(e=`margin`),typeof window>`u`)return zf;var t=Vf(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])}},Uf=Rf(),Wf=`data-scroll-locked`,Gf=function(e,t,n,r){var i=e.left,a=e.top,o=e.right,s=e.gap;return n===void 0&&(n=`margin`),` - .${_f} { - overflow: hidden ${r}; - padding-right: ${s}px ${r}; - } - body[${Wf}] { - 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(``)} - } - - .${hf} { - right: ${s}px ${r}; - } - - .${gf} { - margin-right: ${s}px ${r}; - } - - .${hf} .${hf} { - right: 0 ${r}; - } - - .${gf} .${gf} { - margin-right: 0 ${r}; - } - - body[${Wf}] { - ${vf}: ${s}px; - } -`},Kf=function(){var e=parseInt(document.body.getAttribute(`data-scroll-locked`)||`0`,10);return isFinite(e)?e:0},qf=function(){M.useEffect(function(){return document.body.setAttribute(Wf,(Kf()+1).toString()),function(){var e=Kf()-1;e<=0?document.body.removeAttribute(Wf):document.body.setAttribute(Wf,e.toString())}},[])},Jf=function(e){var t=e.noRelative,n=e.noImportant,r=e.gapMode,i=r===void 0?`margin`:r;qf();var a=M.useMemo(function(){return Hf(i)},[i]);return M.createElement(Uf,{styles:Gf(a,!t,i,n?``:`!important`)})},Yf=!1;if(typeof window<`u`)try{var Xf=Object.defineProperty({},"passive",{get:function(){return Yf=!0,!0}});window.addEventListener(`test`,Xf,Xf),window.removeEventListener(`test`,Xf,Xf)}catch{Yf=!1}var Zf=Yf?{passive:!1}:!1,Qf=function(e){return e.tagName===`TEXTAREA`},$f=function(e,t){if(!(e instanceof Element))return!1;var n=window.getComputedStyle(e);return n[t]!==`hidden`&&!(n.overflowY===n.overflowX&&!Qf(e)&&n[t]===`visible`)},ep=function(e){return $f(e,`overflowY`)},tp=function(e){return $f(e,`overflowX`)},np=function(e,t){var n=t.ownerDocument,r=t;do{if(typeof ShadowRoot<`u`&&r instanceof ShadowRoot&&(r=r.host),ap(e,r)){var i=op(e,r);if(i[1]>i[2])return!0}r=r.parentNode}while(r&&r!==n.body);return!1},rp=function(e){return[e.scrollTop,e.scrollHeight,e.clientHeight]},ip=function(e){return[e.scrollLeft,e.scrollWidth,e.clientWidth]},ap=function(e,t){return e===`v`?ep(t):tp(t)},op=function(e,t){return e===`v`?rp(t):ip(t)},sp=function(e,t){return e===`h`&&t===`rtl`?-1:1},cp=function(e,t,n,r,i){var a=sp(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=op(e,s),m=p[0],h=p[1]-p[2]-a*m;(m||h)&&ap(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},lp=function(e){return`changedTouches`in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},up=function(e){return[e.deltaX,e.deltaY]},dp=function(e){return e&&`current`in e?e.current:e},fp=function(e,t){return e[0]===t[0]&&e[1]===t[1]},pp=function(e){return` - .block-interactivity-${e} {pointer-events: none;} - .allow-interactivity-${e} {pointer-events: all;} -`},mp=0,hp=[];function gp(e){var t=M.useRef([]),n=M.useRef([0,0]),r=M.useRef(),i=M.useState(mp++)[0],a=M.useState(Rf)[0],o=M.useRef(e);M.useEffect(function(){o.current=e},[e]),M.useEffect(function(){if(e.inert){document.body.classList.add(`block-interactivity-${i}`);var t=df([e.lockRef.current],(e.shards||[]).map(dp),!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=M.useCallback(function(e,t){if(`touches`in e&&e.touches.length===2||e.type===`wheel`&&e.ctrlKey)return!o.current.allowPinchZoom;var i=lp(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=np(d,u);if(!m)return!0;if(m?l=d:(l=d===`v`?`h`:`v`,m=np(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 cp(h,t,e,h===`h`?s:c,!0)},[]),c=M.useCallback(function(e){var n=e;if(!(!hp.length||hp[hp.length-1]!==a)){var r=`deltaY`in n?up(n):lp(n),i=t.current.filter(function(e){return e.name===n.type&&(e.target===n.target||n.target===e.shadowParent)&&fp(e.delta,r)})[0];if(i&&i.should){n.cancelable&&n.preventDefault();return}if(!i){var c=(o.current.shards||[]).map(dp).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=M.useCallback(function(e,n,r,i){var a={name:e,delta:n,target:r,should:i,shadowParent:_p(r)};t.current.push(a),setTimeout(function(){t.current=t.current.filter(function(e){return e!==a})},1)},[]),u=M.useCallback(function(e){n.current=lp(e),r.current=void 0},[]),d=M.useCallback(function(t){l(t.type,up(t),t.target,s(t,e.lockRef.current))},[]),f=M.useCallback(function(t){l(t.type,lp(t),t.target,s(t,e.lockRef.current))},[]);M.useEffect(function(){return hp.push(a),e.setCallbacks({onScrollCapture:d,onWheelCapture:d,onTouchMoveCapture:f}),document.addEventListener(`wheel`,c,Zf),document.addEventListener(`touchmove`,c,Zf),document.addEventListener(`touchstart`,u,Zf),function(){hp=hp.filter(function(e){return e!==a}),document.removeEventListener(`wheel`,c,Zf),document.removeEventListener(`touchmove`,c,Zf),document.removeEventListener(`touchstart`,u,Zf)}},[]);var p=e.removeScrollBar,m=e.inert;return M.createElement(M.Fragment,null,m?M.createElement(a,{styles:pp(i)}):null,p?M.createElement(Jf,{noRelative:e.noRelative,gapMode:e.gapMode}):null)}function _p(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}var vp=Of(kf,gp),yp=M.forwardRef(function(e,t){return M.createElement(jf,af({},e,{ref:t,sideCar:vp}))});yp.classNames=jf.classNames;function bp({keepMounted:e,keepMountedMode:t=`activity`,opened:n,onClose:r,id:i,transitionProps:a,onExitTransitionEnd:o,onEnterTransitionEnd:s,trapFocus:c,closeOnEscape:l,returnFocus:u,closeOnClickOutside:d,withinPortal:f,portalProps:p,lockScroll:m,children:h,zIndex:g,shadow:_,padding:v,__vars:y,unstyled:b,removeScrollProps:x,...S}){let{_id:C,titleMounted:w,bodyMounted:T,shouldLockScroll:E,setTitleMounted:D,setBodyMounted:O}=tf({id:i,transitionProps:a,opened:n,trapFocus:c,closeOnEscape:l,onClose:r,returnFocus:u}),{key:k,...ee}=x||{};return(0,N.jsx)(Td,{...p,withinPortal:f,children:(0,N.jsx)(Qd,{value:{opened:n,onClose:r,closeOnClickOutside:d,onExitTransitionEnd:o,onEnterTransitionEnd:s,transitionProps:{...a,keepMounted:e,keepMountedMode:t},getTitleId:()=>`${C}-title`,getBodyId:()=>`${C}-body`,titleMounted:w,bodyMounted:T,setTitleMounted:D,setBodyMounted:O,trapFocus:c,closeOnEscape:l,zIndex:g,unstyled:b},children:(0,N.jsx)(yp,{enabled:E&&m,...ee,children:(0,N.jsx)(Be,{...S,id:C,__vars:{...y,"--mb-z-index":(g||ka(`modal`)).toString(),"--mb-shadow":De(_),"--mb-padding":de(v)},children:h})},k)})})}bp.displayName=`@mantine/core/ModalBase`;function xp(){let e=$d();return(0,M.useEffect)(()=>(e.setBodyMounted(!0),()=>e.setBodyMounted(!1)),[]),e.getBodyId()}var Sp={title:`m_615af6c9`,header:`m_b5489c3c`,inner:`m_60c222c7`,content:`m_fd1ab0aa`,close:`m_606cb269`,body:`m_5df29311`};function Cp({className:e,...t}){let n=xp(),r=$d();return(0,N.jsx)(Be,{id:n,className:ae({[Sp.body]:!r.unstyled},e),...t})}Cp.displayName=`@mantine/core/ModalBaseBody`;function wp({className:e,onClick:t,...n}){let r=$d();return(0,N.jsx)(He,{...n,onClick:e=>{r.onClose(),t?.(e)},className:ae({[Sp.close]:!r.unstyled},e),unstyled:r.unstyled})}wp.displayName=`@mantine/core/ModalBaseCloseButton`;function Tp({transitionProps:e,className:t,innerProps:n,onKeyDown:r,style:i,ref:a,...o}){let s=$d();return(0,N.jsx)(Ve,{mounted:s.opened,transition:`pop`,...s.transitionProps,onExited:()=>{s.onExitTransitionEnd?.(),s.transitionProps?.onExited?.()},onEntered:()=>{s.onEnterTransitionEnd?.(),s.transitionProps?.onEntered?.()},...e,children:e=>(0,N.jsx)(`div`,{...n,className:ae({[Sp.inner]:!s.unstyled},n.className),children:(0,N.jsx)(Md,{active:s.opened&&s.trapFocus,innerRef:a,children:(0,N.jsx)(ee,{...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:ae({[Sp.content]:!s.unstyled},t),unstyled:s.unstyled,children:o.children})})})})}Tp.displayName=`@mantine/core/ModalBaseContent`;function Ep({className:e,...t}){let n=$d();return(0,N.jsx)(Be,{component:`header`,className:ae({[Sp.header]:!n.unstyled},e),...t})}Ep.displayName=`@mantine/core/ModalBaseHeader`;var Dp={duration:200,timingFunction:`ease`,transition:`fade`};function Op(e){let t=$d();return{...Dp,...t.transitionProps,...e}}function kp({onClick:e,transitionProps:t,style:n,visible:r,...i}){let a=$d(),o=Op(t);return(0,N.jsx)(Ve,{mounted:r===void 0?a.opened:r,...o,transition:`fade`,children:t=>(0,N.jsx)(bd,{fixed:!0,style:[n,t],zIndex:a.zIndex,unstyled:a.unstyled,onClick:t=>{e?.(t),a.closeOnClickOutside&&a.onClose()},...i})})}kp.displayName=`@mantine/core/ModalBaseOverlay`;function Ap(){let e=$d();return(0,M.useEffect)(()=>(e.setTitleMounted(!0),()=>e.setTitleMounted(!1)),[]),e.getTitleId()}function jp({className:e,...t}){let n=Ap(),r=$d();return(0,N.jsx)(Be,{component:`h2`,className:ae({[Sp.title]:!r.unstyled},e),id:n,...t})}jp.displayName=`@mantine/core/ModalBaseTitle`;function Mp({children:e}){return(0,N.jsx)(N.Fragment,{children:e})}function Np({style:e,size:t=16,...n}){return(0,N.jsx)(`svg`,{viewBox:`0 0 15 15`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`,style:{...e,width:j(t),height:j(t),display:`block`},...n,children:(0,N.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`})})}Np.displayName=`@mantine/core/AccordionChevron`;var[Pp,Fp]=Sa(`AppShell was not found in tree`),Ip={root:`m_89ab340`,navbar:`m_45252eee`,aside:`m_9cdde9a`,header:`m_3b16f56b`,main:`m_8983817`,footer:`m_3840c879`,section:`m_6dcfc7c7`},Lp=g(e=>{let{classNames:t,className:n,style:r,styles:i,unstyled:a,vars:o,withBorder:s,zIndex:c,mod:l,...u}=D(`AppShellAside`,null,e),d=Fp();return d.disabled?null:(0,N.jsx)(Be,{component:`aside`,mod:[{"with-border":s??d.withBorder},l],...d.getStyles(`aside`,{className:ae({[yp.classNames.zeroRight]:d.offsetScrollbars},n),classNames:t,styles:i,style:r}),...u,__vars:{"--app-shell-aside-z-index":`calc(${c??d.zIndex} + 1)`}})});Lp.classes=Ip,Lp.displayName=`@mantine/core/AppShellAside`;var Rp=g(e=>{let{classNames:t,className:n,style:r,styles:i,unstyled:a,vars:o,withBorder:s,zIndex:c,mod:l,...u}=D(`AppShellFooter`,null,e),d=Fp();return d.disabled?null:(0,N.jsx)(Be,{component:`footer`,mod:[{"with-border":s??d.withBorder},l],...d.getStyles(`footer`,{className:ae({[yp.classNames.zeroRight]:d.offsetScrollbars},n),classNames:t,styles:i,style:r}),...u,__vars:{"--app-shell-footer-z-index":(c??d.zIndex)?.toString()}})});Rp.classes=Ip,Rp.displayName=`@mantine/core/AppShellFooter`;var zp=g(e=>{let{classNames:t,className:n,style:r,styles:i,unstyled:a,vars:o,withBorder:s,zIndex:c,mod:l,...u}=D(`AppShellHeader`,null,e),d=Fp();return d.disabled?null:(0,N.jsx)(Be,{component:`header`,mod:[{"with-border":s??d.withBorder},l],...d.getStyles(`header`,{className:ae({[yp.classNames.zeroRight]:d.offsetScrollbars},n),classNames:t,styles:i,style:r}),...u,__vars:{"--app-shell-header-z-index":(c??d.zIndex)?.toString()}})});zp.classes=Ip,zp.displayName=`@mantine/core/AppShellHeader`;var Bp=g(e=>{let{classNames:t,className:n,style:r,styles:i,vars:a,...o}=D(`AppShellMain`,null,e);return(0,N.jsx)(Be,{component:`main`,...Fp().getStyles(`main`,{className:n,style:r,classNames:t,styles:i}),...o})});Bp.classes=Ip,Bp.displayName=`@mantine/core/AppShellMain`;var Vp=g(e=>{let{classNames:t,className:n,style:r,styles:i,unstyled:a,vars:o,withBorder:s,zIndex:c,mod:l,...u}=D(`AppShellNavbar`,null,e),d=Fp();return d.disabled?null:(0,N.jsx)(Be,{component:`nav`,mod:[{"with-border":s??d.withBorder},l],...d.getStyles(`navbar`,{className:n,classNames:t,styles:i,style:r}),...u,__vars:{"--app-shell-navbar-z-index":`calc(${c??d.zIndex} + 1)`}})});Vp.classes=Ip,Vp.displayName=`@mantine/core/AppShellNavbar`;var Hp=te(e=>{let{classNames:t,className:n,style:r,styles:i,vars:a,grow:o,mod:s,...c}=D(`AppShellSection`,null,e),l=Fp();return(0,N.jsx)(Be,{mod:[{grow:o},s],...l.getStyles(`section`,{className:n,style:r,classNames:t,styles:i}),...c})});Hp.classes=Ip,Hp.displayName=`@mantine/core/AppShellSection`;function Up(e){return typeof e==`object`?e.base:e}function Wp(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 Gp(e){return!(typeof e!=`object`||!e||Object.keys(e).length===1&&`base`in e)}function Kp({baseStyles:e,minMediaStyles:t,maxMediaStyles:n,aside:r,theme:i,mode:a}){let o=r?.width,s=`translateX(var(--app-shell-aside-width))`,c=`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`)),Wp(o)){let t=j(Up(o));e[`--app-shell-aside-width`]=t,e[`--app-shell-aside-offset`]=t}if(Gp(o)&&(o.base!==void 0&&(e[`--app-shell-aside-width`]=j(o.base),e[`--app-shell-aside-offset`]=j(o.base)),ke(o).forEach(e=>{e!==`base`&&(t[e]=t[e]||{},t[e][`--app-shell-aside-width`]=j(o[e]),t[e][`--app-shell-aside-offset`]=j(o[e]))})),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`]=s,t[e][`--app-shell-aside-transform-rtl`]=c,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`}if(r?.collapsed?.mobile){let e=Na(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`]=s,n[e][`--app-shell-aside-transform-rtl`]=c,n[e][`--app-shell-aside-scroll-locked-visibility`]=`hidden`}}function qp({baseStyles:e,minMediaStyles:t,footer:n,mode:r}){let i=n?.height,a=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`),Wp(i)){let t=j(Up(i));e[`--app-shell-footer-height`]=t,a&&(e[`--app-shell-footer-offset`]=t)}Gp(i)&&(i.base!==void 0&&(e[`--app-shell-footer-height`]=j(i.base),a&&(e[`--app-shell-footer-offset`]=j(i.base))),ke(i).forEach(e=>{e!==`base`&&(t[e]=t[e]||{},t[e][`--app-shell-footer-height`]=j(i[e]),a&&(t[e][`--app-shell-footer-offset`]=j(i[e])))})),n?.collapsed&&(e[`--app-shell-footer-transform`]=`translateY(var(--app-shell-footer-height))`,r===`fixed`&&(e[`--app-shell-footer-offset`]=`0px !important`))}function Jp({baseStyles:e,minMediaStyles:t,header:n,mode:r}){let i=n?.height,a=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`),Wp(i)){let t=j(Up(i));e[`--app-shell-header-height`]=t,a&&(e[`--app-shell-header-offset`]=t)}Gp(i)&&(i.base!==void 0&&(e[`--app-shell-header-height`]=j(i.base),a&&(e[`--app-shell-header-offset`]=j(i.base))),ke(i).forEach(e=>{e!==`base`&&(t[e]=t[e]||{},t[e][`--app-shell-header-height`]=j(i[e]),a&&(t[e][`--app-shell-header-offset`]=j(i[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`))}function Yp({baseStyles:e,minMediaStyles:t,maxMediaStyles:n,navbar:r,theme:i,mode:a}){let o=r?.width,s=`translateX(calc(var(--app-shell-navbar-width) * -1))`,c=`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`)),Wp(o)){let t=j(Up(o));e[`--app-shell-navbar-width`]=t,e[`--app-shell-navbar-offset`]=t,a===`static`&&(e[`--app-shell-navbar-grid-width`]=t)}if(Gp(o)&&(o.base!==void 0&&(e[`--app-shell-navbar-width`]=j(o.base),e[`--app-shell-navbar-offset`]=j(o.base),a===`static`&&(e[`--app-shell-navbar-grid-width`]=j(o.base))),ke(o).forEach(e=>{e!==`base`&&(t[e]=t[e]||{},t[e][`--app-shell-navbar-width`]=j(o[e]),t[e][`--app-shell-navbar-offset`]=j(o[e]),a===`static`&&(t[e][`--app-shell-navbar-grid-width`]=j(o[e])))})),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`]=s,t[e][`--app-shell-navbar-transform-rtl`]=c,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`)}if(r?.collapsed?.mobile){let e=Na(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`]=s,n[e][`--app-shell-navbar-transform-rtl`]=c}}function Xp(e){return Number(e)===0?`0px`:de(e)}function Zp({padding:e,baseStyles:t,minMediaStyles:n}){Wp(e)&&(t[`--app-shell-padding`]=Xp(Up(e))),Gp(e)&&(e.base&&(t[`--app-shell-padding`]=Xp(e.base)),ke(e).forEach(t=>{t!==`base`&&(n[t]=n[t]||{},n[t][`--app-shell-padding`]=Xp(e[t]))}))}function Qp({navbar:e,header:t,footer:n,aside:r,padding:i,theme:a,mode:o}){let s={},c={},l={};o===`static`&&(l[`--app-shell-main-grid-column`]=`1 / -1`,l[`--app-shell-main-grid-row`]=`2`),Yp({baseStyles:l,minMediaStyles:s,maxMediaStyles:c,navbar:e,theme:a,mode:o}),Kp({baseStyles:l,minMediaStyles:s,maxMediaStyles:c,aside:r,theme:a,mode:o}),Jp({baseStyles:l,minMediaStyles:s,header:t,mode:o}),qp({baseStyles:l,minMediaStyles:s,footer:n,mode:o}),Zp({baseStyles:l,minMediaStyles:s,padding:i});let u=Pa(ke(s),a.breakpoints).map(e=>({query:`(min-width: ${Re(e.px)})`,styles:s[e.value]})),d=Pa(ke(c),a.breakpoints).map(e=>({query:`(max-width: ${Re(e.px)})`,styles:c[e.value]}));return{baseStyles:l,media:[...u,...d]}}function $p({navbar:e,header:t,aside:n,footer:r,padding:i,mode:a,selector:o}){let s=b(),c=Ue(),{media:l,baseStyles:u}=Qp({navbar:e,header:t,footer:r,aside:n,padding:i,theme:s,mode:a});return(0,N.jsx)(be,{media:l,styles:u,selector:o||c.cssVariablesSelector})}function em({transitionDuration:e,disabled:t}){let[n,r]=(0,M.useState)(!0),i=(0,M.useRef)(-1),a=(0,M.useRef)(-1);return eo(`resize`,()=>{r(!0),clearTimeout(i.current),i.current=window.setTimeout(()=>(0,M.startTransition)(()=>{r(!1)}),200)}),Ee(()=>{r(!0),clearTimeout(a.current),a.current=window.setTimeout(()=>(0,M.startTransition)(()=>{r(!1)}),e||0)},[t,e]),n}var tm={withBorder:!0,padding:0,transitionDuration:200,transitionTimingFunction:`ease`,zIndex:ka(`app`),mode:`fixed`},nm=O((e,{transitionDuration:t,transitionTimingFunction:n})=>({root:{"--app-shell-transition-duration":`${t}ms`,"--app-shell-transition-timing-function":n}})),rm=g(e=>{let t=D(`AppShell`,tm,e),{classNames:n,className:r,style:i,styles:a,unstyled:o,vars:s,navbar:c,withBorder:l,padding:u,transitionDuration:d,transitionTimingFunction:f,header:p,zIndex:m,layout:h,disabled:g,aside:_,footer:v,offsetScrollbars:y=!0,mode:b,mod:x,attributes:S,id:C,...T}=t,E=w({name:`AppShell`,classes:Ip,props:t,className:r,style:i,classNames:n,styles:a,unstyled:o,attributes:S,vars:s,varsResolver:nm}),O=em({disabled:g,transitionDuration:d}),k=pe(C);return(0,N.jsxs)(Pp,{value:{getStyles:E,withBorder:l,zIndex:m,disabled:g,offsetScrollbars:y,mode:b},children:[(0,N.jsx)($p,{navbar:c,header:p,aside:_,footer:v,padding:u,mode:b,selector:b===`static`?`#${k}`:void 0}),(0,N.jsx)(Be,{...E(`root`),id:k,mod:[{resizing:O,layout:h,disabled:g,mode:b},x],...T})]})});rm.classes=Ip,rm.varsResolver=nm,rm.displayName=`@mantine/core/AppShell`,rm.Navbar=Vp,rm.Header=zp,rm.Main=Bp,rm.Aside=Lp,rm.Footer=Rp,rm.Section=Hp;function im({size:e,style:t,...n}){return(0,N.jsx)(`svg`,{viewBox:`0 0 10 7`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`,style:e===void 0?t:{width:j(e),height:j(e),...t},"aria-hidden":!0,...n,children:(0,N.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 am={group:`m_11def92b`,root:`m_f85678b6`,image:`m_11f8ac07`,placeholder:`m_104cd71f`},om=(0,M.createContext)({withinGroup:!1}),sm=O((e,{spacing:t})=>({group:{"--ag-spacing":de(t)}})),cm=g(e=>{let t=D(`AvatarGroup`,null,e),{classNames:n,className:r,style:i,styles:a,unstyled:o,vars:s,spacing:c,attributes:l,...u}=t,d=w({name:`AvatarGroup`,classes:am,props:t,className:r,style:i,classNames:n,styles:a,unstyled:o,attributes:l,vars:s,varsResolver:sm,rootSelector:`group`});return(0,N.jsx)(om,{value:{withinGroup:!0},children:(0,N.jsx)(Be,{...d(`group`),...u})})});cm.classes=am,cm.varsResolver=sm,cm.displayName=`@mantine/core/AvatarGroup`;function lm(e){return(0,N.jsx)(`svg`,{...e,"data-avatar-placeholder-icon":!0,viewBox:`0 0 15 15`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`,children:(0,N.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 um(e){let t=0;for(let n=0;ne[0]).slice(0,t).join(``).toUpperCase()}var mm=O((e,{size:t,radius:n,variant:r,gradient:i,color:a,autoContrast:o,name:s,allowedInitialsColors:c})=>{let l=a===`initials`&&typeof s==`string`?fm(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:ce(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}}}),hm=te(e=>{let t=D(`Avatar`,null,e),{classNames:n,className:r,style:i,styles:a,unstyled:o,vars:s,src:c,alt:l,radius:u,color:d,gradient:f,imageProps:p,children:m,autoContrast:h,mod:g,name:_,allowedInitialsColors:v,attributes:y,...b}=t,x=(0,M.use)(om),[S,C]=(0,M.useState)(!c),T=w({name:`Avatar`,props:t,classes:am,className:r,style:i,classNames:n,styles:a,unstyled:o,attributes:y,vars:s,varsResolver:mm});return(0,M.useEffect)(()=>C(!c),[c]),(0,N.jsx)(Be,{...T(`root`),mod:[{"within-group":x.withinGroup},g],...b,children:S||!c?(0,N.jsx)(`span`,{...T(`placeholder`),title:l,children:m||typeof _==`string`&&pm(_)||(0,N.jsx)(lm,{})}):(0,N.jsx)(`img`,{...p,...T(`image`),src:c,alt:l,onError:e=>{C(!0),p?.onError?.(e)}})})});hm.classes=am,hm.varsResolver=mm,hm.displayName=`@mantine/core/Avatar`,hm.Group=cm;var gm={root:`m_3eebeb36`,label:`m_9e365f20`},_m={orientation:`horizontal`},vm=O((e,{color:t,variant:n,size:r})=>({root:{"--divider-color":t?x(t,e):void 0,"--divider-border-style":n,"--divider-size":Pe(r,`divider-size`)}})),ym=g(e=>{let t=D(`Divider`,_m,e),{classNames:n,className:r,style:i,styles:a,unstyled:o,vars:s,color:c,orientation:l,label:u,labelPosition:d,mod:f,attributes:p,...m}=t,h=w({name:`Divider`,classes:gm,props:t,className:r,style:i,classNames:n,styles:a,unstyled:o,attributes:p,vars:s,varsResolver:vm});return(0,N.jsx)(Be,{mod:[{orientation:l,withLabel:!!u},f],role:`separator`,...h(`root`),...m,children:u&&(0,N.jsx)(Be,{component:`span`,mod:{position:d},...h(`label`),children:u})})});ym.classes=gm,ym.varsResolver=vm,ym.displayName=`@mantine/core/Divider`;var[bm,xm]=Sa(`Drawer component was not found in tree`),Sm={root:`m_f11b401e`,header:`m_5a7c2c9`,content:`m_b8a05bbd`,inner:`m_31cd769a`},Cm=g(e=>{let{classNames:t,className:n,style:r,styles:i,vars:a,...o}=D(`DrawerBody`,null,e);return(0,N.jsx)(Cp,{...xm().getStyles(`body`,{classNames:t,style:r,styles:i,className:n}),...o})});Cm.classes=Sm,Cm.displayName=`@mantine/core/DrawerBody`;var wm=g(e=>{let{classNames:t,className:n,style:r,styles:i,vars:a,...o}=D(`DrawerCloseButton`,null,e);return(0,N.jsx)(wp,{...xm().getStyles(`close`,{classNames:t,style:r,styles:i,className:n}),...o})});wm.classes=Sm,wm.displayName=`@mantine/core/DrawerCloseButton`;var Tm=g(e=>{let{classNames:t,className:n,style:r,styles:i,vars:a,children:o,radius:s,__hidden:c,...l}=D(`DrawerContent`,null,e),u=xm(),d=u.scrollAreaComponent||Mp;return(0,N.jsx)(Tp,{...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,N.jsx)(d,{style:{height:`calc(100vh - var(--drawer-offset) * 2)`},children:o})})});Tm.classes=Sm,Tm.displayName=`@mantine/core/DrawerContent`;var Em=g(e=>{let{classNames:t,className:n,style:r,styles:i,vars:a,...o}=D(`DrawerHeader`,null,e);return(0,N.jsx)(Ep,{...xm().getStyles(`header`,{classNames:t,style:r,styles:i,className:n}),...o})});Em.classes=Sm,Em.displayName=`@mantine/core/DrawerHeader`;var Dm=g(e=>{let{classNames:t,className:n,style:r,styles:i,vars:a,...o}=D(`DrawerOverlay`,null,e);return(0,N.jsx)(kp,{...xm().getStyles(`overlay`,{classNames:t,style:r,styles:i,className:n}),...o})});Dm.classes=Sm,Dm.displayName=`@mantine/core/DrawerOverlay`;function Om(e){switch(e){case`top`:return`flex-start`;case`bottom`:return`flex-end`;default:return}}function km(e){if(e===`top`||e===`bottom`)return`0 0 calc(100% - var(--drawer-offset, 0rem) * 2)`}var Am={top:`slide-down`,bottom:`slide-up`,left:`slide-right`,right:`slide-left`},jm={top:`slide-down`,bottom:`slide-up`,right:`slide-right`,left:`slide-left`},Mm={closeOnClickOutside:!0,withinPortal:!0,lockScroll:!0,trapFocus:!0,returnFocus:!0,closeOnEscape:!0,keepMounted:!1,zIndex:ka(`modal`),position:`left`},Nm=O((e,{position:t,size:n,offset:r})=>({root:{"--drawer-size":Pe(n,`drawer-size`),"--drawer-flex":km(t),"--drawer-height":t===`left`||t===`right`?void 0:`var(--drawer-size)`,"--drawer-align":Om(t),"--drawer-justify":t===`right`?`flex-end`:void 0,"--drawer-offset":j(r)}})),Pm=g(e=>{let t=D(`DrawerRoot`,Mm,e),{classNames:n,className:r,style:i,styles:a,unstyled:o,vars:s,scrollAreaComponent:c,position:l,transitionProps:u,radius:d,attributes:f,...p}=t,{dir:m}=Vo(),h=w({name:`Drawer`,classes:Sm,props:t,className:r,style:i,classNames:n,styles:a,unstyled:o,attributes:f,vars:s,varsResolver:Nm}),g=(m===`rtl`?jm:Am)[l];return(0,N.jsx)(bm,{value:{scrollAreaComponent:c,getStyles:h,radius:d},children:(0,N.jsx)(bp,{...h(`root`),transitionProps:{transition:g,...u},"data-offset-scrollbars":c===id.Autosize||void 0,unstyled:o,...p})})});Pm.classes=Sm,Pm.varsResolver=Nm,Pm.displayName=`@mantine/core/DrawerRoot`;var Fm=(0,M.createContext)(null);function Im({children:e}){let[t,n]=(0,M.useState)([]),[r,i]=(0,M.useState)(ka(`modal`));return(0,N.jsx)(Fm,{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},children:e})}Im.displayName=`@mantine/core/DrawerStack`;var Lm=g(e=>{let{classNames:t,className:n,style:r,styles:i,vars:a,...o}=D(`DrawerTitle`,null,e);return(0,N.jsx)(jp,{...xm().getStyles(`title`,{classNames:t,style:r,styles:i,className:n}),...o})});Lm.classes=Sm,Lm.displayName=`@mantine/core/DrawerTitle`;var Rm={closeOnClickOutside:!0,withinPortal:!0,lockScroll:!0,trapFocus:!0,returnFocus:!0,closeOnEscape:!0,keepMounted:!1,zIndex:ka(`modal`),withOverlay:!0,withCloseButton:!0},zm=g(e=>{let{title:t,withOverlay:n,overlayProps:r,withCloseButton:i,closeButtonProps:a,children:o,opened:s,stackId:c,zIndex:l,...u}=D(`Drawer`,Rm,e),d=(0,M.use)(Fm),f=!!t||i,p=d&&c?{closeOnEscape:d.currentId===c,trapFocus:d.currentId===c,zIndex:d.getZIndex(c)}:{},m=n===!1?!1:c&&d?d.currentId===c:s;return(0,M.useEffect)(()=>{d&&c&&(s?d.addModal(c,l||ka(`modal`)):d.removeModal(c))},[s,c,l]),(0,N.jsxs)(Pm,{opened:s,zIndex:d&&c?d.getZIndex(c):l,...u,...p,children:[n&&(0,N.jsx)(Dm,{visible:m,transitionProps:d&&c?{duration:0}:void 0,...r}),(0,N.jsxs)(Tm,{__hidden:d&&c&&s?c!==d.currentId:!1,children:[f&&(0,N.jsxs)(Em,{children:[t&&(0,N.jsx)(Lm,{children:t}),i&&(0,N.jsx)(wm,{...a})]}),(0,N.jsx)(Cm,{children:o})]})]})});zm.classes=Sm,zm.displayName=`@mantine/core/Drawer`,zm.Root=Pm,zm.Overlay=Dm,zm.Content=Tm,zm.Body=Cm,zm.Header=Em,zm.Title=Lm,zm.CloseButton=wm,zm.Stack=Im;var Bm=[`borderBottomWidth`,`borderLeftWidth`,`borderRightWidth`,`borderTopWidth`,`boxSizing`,`fontFamily`,`fontSize`,`fontStyle`,`fontWeight`,`letterSpacing`,`lineHeight`,`paddingBottom`,`paddingLeft`,`paddingRight`,`paddingTop`,`tabSize`,`textIndent`,`textRendering`,`textTransform`,`width`,`wordBreak`,`wordSpacing`,`scrollbarGutter`],Vm={"min-height":`0`,"max-height":`none`,height:`0`,visibility:`hidden`,overflow:`hidden`,position:`absolute`,"z-index":`-1000`,top:`0`,right:`0`,display:`block`};function Hm(e){Object.keys(Vm).forEach(t=>{e.style.setProperty(t,Vm[t],`important`)})}function Um(e){let t=window.getComputedStyle(e);if(t===null)return null;let n={};for(let e of Bm)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 Wm=null;function Gm(e,t,n=1,r=1/0){Wm||(Wm=document.createElement(`textarea`),Wm.setAttribute(`tabindex`,`-1`),Wm.setAttribute(`aria-hidden`,`true`),Wm.setAttribute(`aria-label`,`autosize measurement`),Hm(Wm)),Wm.parentNode===null&&document.body.appendChild(Wm);let{paddingSize:i,borderSize:a,sizingStyle:o}=e,{boxSizing:s}=o;Object.keys(o).forEach(e=>{Wm.style[e]=o[e]}),Hm(Wm),Wm.value=t;let c=s===`border-box`?Wm.scrollHeight+a:Wm.scrollHeight-i;Wm.value=t,c=s===`border-box`?Wm.scrollHeight+a:Wm.scrollHeight-i,Wm.value=`x`;let l=Wm.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 Km({maxRows:e,minRows:t,onChange:n,ref:r,...i}){let a=i.value!==void 0,o=(0,M.useRef)(null),s=ro(o,r),c=(0,M.useRef)(0),l=(0,M.useRef)(0),u=()=>{let n=o.current;if(!n)return;let r=Um(n);if(!r)return;let[i]=Gm(r,n.value||n.placeholder||`x`,t,e);c.current!==i&&(c.current=i,n.style.setProperty(`height`,`${i}px`,`important`))},d=e=>{a||u(),n?.(e)};return(0,M.useLayoutEffect)(u),(0,M.useEffect)(()=>{let e=()=>u();return window.addEventListener(`resize`,e),()=>window.removeEventListener(`resize`,e)},[]),(0,M.useEffect)(()=>{let e=o.current;if(!e||typeof ResizeObserver>`u`)return;l.current=e.offsetWidth;let t=new ResizeObserver(()=>{o.current&&o.current.offsetWidth!==l.current&&(l.current=o.current.offsetWidth,u())});return t.observe(e),()=>t.disconnect()},[]),(0,M.useEffect)(()=>{let e=()=>u();return document.fonts.addEventListener(`loadingdone`,e),()=>document.fonts.removeEventListener(`loadingdone`,e)},[]),(0,M.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,N.jsx)(`textarea`,{rows:t,...i,onChange:d,ref:s})}var qm=g(e=>{let{autosize:t,maxRows:n,minRows:r,__staticSelector:i,resize:a,bottomSection:o,bottomSectionProps:s,...c}=D([`Input`,`InputWrapper`,`Textarea`],null,e),l=t&&fo()!==`test`,u=l?{maxRows:n,minRows:r}:{};return(0,N.jsx)(ge,{component:l?Km:`textarea`,...c,__staticSelector:i||`Textarea`,__bottomSection:o,__bottomSectionProps:s,multiline:!0,"data-no-overflow":t&&n===void 0||void 0,__vars:{"--input-resize":a},...u})});qm.classes=ge.classes,qm.displayName=`@mantine/core/Textarea`;var[Jm,Ym]=Sa(`Menu component was not found in the tree`),Xm=(0,M.createContext)(null);function Zm(e){let{value:t,defaultValue:n,onChange:r,children:i}=D(`MenuCheckboxGroup`,null,e),[a,o]=io({value:t,defaultValue:n,finalValue:[],onChange:r});return(0,N.jsx)(Xm,{value:{values:a,onChange:(0,M.useCallback)(e=>{o(a.includes(e)?a.filter(t=>t!==e):[...a,e])},[a,o])},children:i})}Zm.displayName=`@mantine/core/MenuCheckboxGroup`;var Qm=(0,M.createContext)(null);function $m({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:g}){let _=Ym(),v=(0,M.use)(Qm),y=b(),{dir:x}=Vo(),S=(0,M.useRef)(null),C=Ma(g.onClick,()=>{l||(r(),a&&_.closeDropdownImmediately())}),w=Ma(g.onMouseMove,()=>{if(!_.hasSearch)return;let e=S.current?.closest(`[data-menu-dropdown]`);e&&e.querySelectorAll(`[data-menu-active]`).forEach(t=>{t!==S.current&&t.closest(`[data-menu-dropdown]`)===e&&t.removeAttribute(`data-menu-active`)})}),T=Ma(g.onKeyDown,e=>{e.key===`ArrowLeft`&&v&&(v.close(),v.focusParentItem())}),E=i?y.variantColorResolver({color:i,theme:y,variant:`light`}):void 0,D=i?ie({color:i,theme:y}):null,O=_.alignItemsLabels!==`none`||t;return(0,N.jsxs)(h,{onMouseDown:e=>e.preventDefault(),...g,unstyled:_.unstyled,tabIndex:_.menuItemTabIndex,..._.getStyles(`item`,{className:u,style:d,styles:f,classNames:p}),ref:ro(S,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:C,onMouseMove:w,onKeyDown:Da({siblingSelector:`[data-menu-item]:not([data-disabled])`,parentSelector:`[data-menu-dropdown]`,activateOnFocus:!1,loop:_.loop,dir:x,orientation:`vertical`,onKeyDown:T}),__vars:{"--menu-item-color":D?.isThemeColor&&D?.shade===void 0?`var(--mantine-color-${D.color}-6)`:E?.color,"--menu-item-hover":E?.hover},children:[O&&(0,N.jsx)(`div`,{..._.getStyles(`itemIndicator`,{styles:f,classNames:p}),"data-checked":t||void 0,children:t?n:null}),s&&(0,N.jsx)(`div`,{..._.getStyles(`itemLabel`,{styles:f,classNames:p}),"data-menu-item-label":!0,children:s}),o&&(0,N.jsx)(`div`,{..._.getStyles(`itemSection`,{styles:f,classNames:p}),"data-position":`right`,children:o})]})}var eh={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`},th=g(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:_,...v}=D(`MenuCheckboxItem`,null,e),y=Ym(),b=(0,M.use)(Xm),x=b&&f!==void 0?b.values.includes(f):void 0,[S,C]=io({value:p??x,defaultValue:m,finalValue:!1,onChange:h});return(0,N.jsx)($m,{role:`menuitemcheckbox`,checked:S,indicator:g??y.checkIcon??(0,N.jsx)(im,{size:10}),onSelect:()=>{h?C(!S):b&&f!==void 0?b.onChange(f):C(!S)},color:o,closeMenuOnClick:s,rightSection:c,disabled:u,dataDisabled:d,className:n,style:r,styles:i,classNames:t,buttonRef:_,others:v,children:l})});th.classes=eh,th.displayName=`@mantine/core/MenuCheckboxItem`;function nh(e){let{children:t,disabled:n,longPressDelay:r}=D(`MenuContextMenu`,null,e),i=mo(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=Ym(),o=kd();return(0,M.cloneElement)(i,Ad({childProps:i.props,disabled:n||o.disabled,opened:a.opened,longPressDelay:r,setReference:o.reference,open:()=>a.openDropdown()}))}nh.displayName=`@mantine/core/MenuContextMenu`;var rh=g(e=>{let{classNames:t,className:n,style:r,styles:i,vars:a,...o}=D(`MenuDivider`,null,e);return(0,N.jsx)(Be,{...Ym().getStyles(`divider`,{className:n,style:r,styles:i,classNames:t}),...o})});rh.classes=eh,rh.displayName=`@mantine/core/MenuDivider`;var ih=500;function ah(e){return((e.querySelector(`[data-menu-item-label]`)??e).textContent??``).trim().toLowerCase()}function oh(e){return e.length>1&&e.split(``).every(t=>t===e[0])}function sh({enabled:e,opened:t,getDropdown:n}){let r=(0,M.useRef)({buffer:``,timeoutId:null});return(0,M.useEffect)(()=>{if(t&&e)return;let n=r.current;n.timeoutId!==null&&(window.clearTimeout(n.timeoutId),n.timeoutId=null),n.buffer=``},[t,e]),(0,M.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},ih);let c=document.activeElement,l=c?o.indexOf(c):-1,u=null;if(s.buffer.length===1||oh(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}=D(`MenuDropdown`,null,e),f=(0,M.useRef)(null),p=Ym(),m=sh({enabled:!p.hasSearch,opened:p.opened,getDropdown:()=>f.current}),h=Ma(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=Ma(o,()=>(p.trigger===`hover`||p.trigger===`click-hover`)&&p.openDropdown()),_=Ma(s,()=>(p.trigger===`hover`||p.trigger===`click-hover`)&&p.closeDropdown());return(0,N.jsxs)(Ud.Dropdown,{...d,onMouseEnter:g,onMouseLeave:_,role:`menu`,"aria-orientation":`vertical`,ref:ro(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,N.jsx)(`div`,{role:`presentation`,tabIndex:-1,"data-autofocus":!0,"data-mantine-stop-propagation":!0,style:{outline:0}}),l]})});ch.classes=eh,ch.displayName=`@mantine/core/MenuDropdown`;var lh=te(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}=D(`MenuItem`,null,e),g=Ym(),_=(0,M.use)(Qm),v=b(),{dir:y}=Vo(),x=(0,M.useRef)(null),S=m,C=Ma(S.onClick,()=>{f||(typeof s==`boolean`?s&&g.closeDropdownImmediately():g.closeOnItemClick&&g.closeDropdownImmediately())}),w=Ma(S.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=o?v.variantColorResolver({color:o,theme:v,variant:`light`}):void 0,E=o?ie({color:o,theme:v}):null,O=Ma(S.onKeyDown,e=>{e.key===`ArrowLeft`&&_&&(_.close(),_.focusParentItem())});return(0,N.jsxs)(h,{onMouseDown:e=>e.preventDefault(),...m,unstyled:g.unstyled,tabIndex:g.menuItemTabIndex,...g.getStyles(`item`,{className:n,style:r,styles:i,classNames:t}),ref:ro(x,p),role:`menuitem`,disabled:d,"data-menu-item":!0,"data-disabled":d||f||void 0,"data-mantine-stop-propagation":!0,onClick:C,onMouseMove:w,onKeyDown:Da({siblingSelector:`[data-menu-item]:not([data-disabled])`,parentSelector:`[data-menu-dropdown]`,activateOnFocus:!1,loop:g.loop,dir:y,orientation:`vertical`,onKeyDown:O}),__vars:{"--menu-item-color":E?.isThemeColor&&E?.shade===void 0?`var(--mantine-color-${E.color}-6)`:T?.color,"--menu-item-hover":T?.hover},children:[g.alignItemsLabels===`all`&&(0,N.jsx)(`div`,{...g.getStyles(`itemIndicator`,{styles:i,classNames:t}),"data-placeholder":!0}),c&&(0,N.jsx)(`div`,{...g.getStyles(`itemSection`,{styles:i,classNames:t}),"data-position":`left`,children:c}),u&&(0,N.jsx)(`div`,{...g.getStyles(`itemLabel`,{styles:i,classNames:t}),"data-menu-item-label":!0,children:u}),l&&(0,N.jsx)(`div`,{...g.getStyles(`itemSection`,{styles:i,classNames:t}),"data-position":`right`,children:l})]})});lh.classes=eh,lh.displayName=`@mantine/core/MenuItem`;var uh=g(e=>{let{classNames:t,className:n,style:r,styles:i,vars:a,...o}=D(`MenuLabel`,null,e);return(0,N.jsx)(Be,{...Ym().getStyles(`label`,{className:n,style:r,styles:i,classNames:t}),...o})});uh.classes=eh,uh.displayName=`@mantine/core/MenuLabel`;var dh=(0,M.createContext)(null);function fh(e){let{value:t,defaultValue:n,onChange:r,children:i}=D(`MenuRadioGroup`,null,e),[a,o]=io({value:t,defaultValue:n,finalValue:null,onChange:r});return(0,N.jsx)(dh,{value:{value:a,onChange:e=>o(e)},children:i})}fh.displayName=`@mantine/core/MenuRadioGroup`;function ph({size:e,style:t,...n}){return(0,N.jsx)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,fill:`none`,viewBox:`0 0 5 5`,style:{width:j(e),height:j(e),...t},"aria-hidden":!0,...n,children:(0,N.jsx)(`circle`,{cx:`2.5`,cy:`2.5`,r:`2.5`,fill:`currentColor`})})}var mh=g(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,..._}=D(`MenuRadioItem`,null,e),v=Ym(),y=(0,M.use)(dh),b=p??(y?y.value===f:!1);return(0,N.jsx)($m,{role:`menuitemradio`,checked:b,indicator:h??v.checkIcon??(0,N.jsx)(ph,{size:5}),onSelect:()=>{b||(m?m(f):y&&y.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})});mh.classes=eh,mh.displayName=`@mantine/core/MenuRadioItem`;var hh=`[data-menu-item]:not([data-disabled])`,gh=`[data-menu-active]`;function _h(e){return e?.closest(`[data-menu-dropdown]`)}function vh(e){return e?Array.from(e.querySelectorAll(hh)).filter(t=>t.closest(`[data-menu-dropdown]`)===e):[]}function yh(e){e&&e.querySelectorAll(gh).forEach(t=>{t.closest(`[data-menu-dropdown]`)===e&&t.removeAttribute(`data-menu-active`)})}function bh(e,t){yh(t),e&&(e.setAttribute(`data-menu-active`,`true`),e.scrollIntoView({block:`nearest`}))}function xh(e){return e.findIndex(e=>e.hasAttribute(`data-menu-active`))}var Sh={clearSearchOnClose:!0},Ch=g(e=>{let{classNames:t,styles:n,onKeyDown:r,onChange:i,size:a,clearSearchOnClose:o,ref:s,...c}=D(`MenuSearch`,Sh,e),l=Ym(),u=(0,M.useRef)(null),d=ro(s,u),f=(0,M.useRef)(i);f.current=i,(0,M.useEffect)(()=>l.registerSearch(),[l.registerSearch]),(0,M.useEffect)(()=>{o?l.searchExitClearRef.current=()=>{f.current?.({currentTarget:{value:``}})}:l.searchExitClearRef.current=null},[o,l.searchExitClearRef]),(0,M.useEffect)(()=>{l.opened||yh(_h(u.current))},[l.opened]);let p=Ma(i,e=>{yh(_h(e.currentTarget))}),m=Ma(r,e=>{if(e.defaultPrevented)return;let t=_h(e.currentTarget),n=vh(t);if(e.key===`ArrowDown`){if(e.preventDefault(),n.length===0)return;let r=xh(n);bh(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=xh(n);bh(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&&bh(n[0],t);else if(e.key===`End`)e.preventDefault(),n.length>0&&bh(n[n.length-1],t);else if(e.key===`Enter`){if(e.nativeEvent.isComposing||e.nativeEvent.keyCode===229)return;let t=n[xh(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,N.jsx)(oe,{"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`})});Ch.classes=eh,Ch.displayName=`@mantine/core/MenuSearch`;var wh=g(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}=D(`MenuSubDropdown`,null,e),m=(0,M.useRef)(null),h=Ym(),g=(0,M.use)(Qm),_=sh({enabled:!h.hasSearch,opened:g?.opened??!1,getDropdown:()=>m.current}),v=Ma(u,e=>{_(e),!e.ctrlKey&&!e.metaKey&&!e.altKey&&e.key.length===1&&e.key!==` `&&e.stopPropagation()}),y=g?.getFloatingProps({onMouseEnter:o,onMouseLeave:s,onPointerEnter:c,onPointerLeave:l});return(0,N.jsx)(Ud.Dropdown,{...p,...y,role:`menu`,"aria-orientation":`vertical`,ref:ro(f,m,g?.setFloating),...h.getStyles(`dropdown`,{className:n,style:r,styles:i,classNames:t,withStaticClass:!1}),tabIndex:-1,"data-menu-dropdown":!0,onKeyDown:v,children:d})});wh.classes=eh,wh.displayName=`@mantine/core/MenuSubDropdown`;var Th=te(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}=D(`MenuSubItem`,null,e),g=Ym(),_=(0,M.use)(Qm),v=b(),{dir:y}=Vo(),x=(0,M.useRef)(null),S=m,C=o?v.variantColorResolver({color:o,theme:v,variant:`light`}):void 0,w=o?ie({color:o,theme:v}):null,T=Ma(S.onKeyDown,e=>{e.key===`ArrowRight`&&(_?.open(),_?.focusFirstItem()),e.key===`ArrowLeft`&&_?.parentContext&&(_.parentContext.close(),_.parentContext.focusParentItem())}),E=Ma(S.onClick,()=>{!d&&f&&g.closeDropdownImmediately()}),O=Ma(S.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`)})}),k=_?.getReferenceProps({onMouseEnter:S.onMouseEnter,onMouseLeave:S.onMouseLeave,onPointerEnter:S.onPointerEnter,onPointerLeave:S.onPointerLeave});return(0,N.jsxs)(h,{onMouseDown:e=>e.preventDefault(),...m,...k,unstyled:g.unstyled,tabIndex:g.menuItemTabIndex,...g.getStyles(`item`,{className:n,style:r,styles:i,classNames:t}),ref:ro(x,p,_?.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:O,onKeyDown:Da({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":w?.isThemeColor&&w?.shade===void 0?`var(--mantine-color-${w.color}-6)`:C?.color,"--menu-item-hover":C?.hover},children:[g.alignItemsLabels===`all`&&(0,N.jsx)(`div`,{...g.getStyles(`itemIndicator`,{styles:i,classNames:t}),"data-placeholder":!0}),s&&(0,N.jsx)(`div`,{...g.getStyles(`itemSection`,{styles:i,classNames:t}),"data-position":`left`,children:s}),l&&(0,N.jsx)(`div`,{...g.getStyles(`itemLabel`,{styles:i,classNames:t}),"data-menu-item-label":!0,children:l}),(0,N.jsx)(`div`,{...g.getStyles(`itemSection`,{styles:i,classNames:t}),"data-position":`right`,children:c||(0,N.jsx)(Np,{...g.getStyles(`chevron`),size:14})})]})});Th.classes=eh,Th.displayName=`@mantine/core/MenuSubItem`;function Eh({children:e,refProp:t}){if(!xa(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 Ym(),(0,N.jsx)(Ud.Target,{refProp:t,popupType:`menu`,children:e})}Eh.displayName=`@mantine/core/MenuSubTarget`;var Dh={offset:0,position:`right-start`,safeAreaPolygon:!0,transitionProps:{duration:0},openDelay:0,middlewares:{shift:{crossAxis:!0}}};function Oh(e){let{children:t,closeDelay:n,openDelay:r,position:i,safeAreaPolygon:a,opened:o,onChange:s,...c}=D(`MenuSub`,Dh,e),l=pe(),[u,d]=io({value:o,finalValue:!1,onChange:s}),f=(0,M.use)(Qm),p=Ym(),{dir:m}=Vo(),h=hd(m,i),g=f?.registerOpenSub??p.registerOpenSub,_=(0,M.useRef)(null),v=(0,M.useCallback)(e=>{let t=_.current;return t&&t!==e&&t(),_.current=e,()=>{_.current===e&&(_.current=null)}},[]),y=(0,M.useRef)(d);y.current=d;let b=(0,M.useCallback)(()=>y.current(!0),[]),x=(0,M.useCallback)(()=>y.current(!1),[]);(0,M.useEffect)(()=>{if(u)return g(x)},[u,g,x]);let{context:S,refs:C}=Gu({placement:h,open:u,onOpenChange:e=>{e?b():x()}}),{getReferenceProps:w,getFloatingProps:T}=Yu([Mu(S,{handleClose:a?td(typeof a==`object`?a:void 0):void 0,delay:{open:r,close:n}})]);return(0,N.jsx)(Qm,{value:{opened:u,close:x,open:b,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:C.setReference,setFloating:C.setFloating,getReferenceProps:w,getFloatingProps:T,registerOpenSub:v},children:(0,N.jsx)(Ud,{opened:u,onChange:e=>e?b():x(),withinPortal:!1,withArrow:!1,id:l,position:i,...c,children:t})})}Oh.extend=e=>e,Oh.displayName=`@mantine/core/MenuSub`,Oh.Target=Eh,Oh.Dropdown=wh,Oh.Item=Th;var kh={refProp:`ref`};function Ah(e){let{children:t,refProp:n,...r}=D(`MenuTarget`,kh,e),i=mo(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=Ym(),o=i.props,s=Ma(o.onClick,()=>{a.trigger===`click`?a.toggleDropdown():a.trigger===`click-hover`&&(a.setOpenedViaClick(!0),a.opened||a.openDropdown())}),c=Ma(o.onMouseEnter,()=>(a.trigger===`hover`||a.trigger===`click-hover`)&&a.openDropdown()),l=Ma(o.onMouseLeave,()=>{(a.trigger===`hover`||a.trigger===`click-hover`&&!a.openedViaClick)&&a.closeDropdown()});return(0,N.jsx)(Ud.Target,{refProp:n,popupType:`menu`,...r,children:(0,M.cloneElement)(i,{onClick:s,onMouseEnter:c,onMouseLeave:l,"data-expanded":a.opened?!0:void 0})})}Ah.displayName=`@mantine/core/MenuTarget`;var jh={trapFocus:!0,closeOnItemClick:!0,withInitialFocusPlaceholder:!0,clickOutsideEvents:[`mousedown`,`touchstart`,`keydown`],loop:!0,trigger:`click`,openDelay:0,closeDelay:100,menuItemTabIndex:-1,alignItemsLabels:`with-indicators`},Mh=g(e=>{let t=D(`Menu`,jh,e),{children:n,onOpen:r,onClose:i,opened:a,defaultOpened:o,trapFocus:s,onChange:c,closeOnItemClick:l,loop:u,closeOnEscape:d,trigger:f,openDelay:p,closeDelay:m,classNames:h,styles:g,unstyled:_,variant:v,vars:y,menuItemTabIndex:b,keepMounted:x,withInitialFocusPlaceholder:S,attributes:C,onExitTransitionEnd:E,alignItemsLabels:O,checkIcon:k,...ee}=t,te=w({name:`Menu`,classes:eh,props:t,classNames:h,styles:g,unstyled:_,attributes:C}),[ne,re]=io({value:a,defaultValue:o,finalValue:!1,onChange:c}),[A,ie]=(0,M.useState)(!1),ae=()=>{re(!1),ie(!1),ne&&i?.()},oe=()=>{re(!0),!ne&&r?.()},se=()=>{ne?ae():oe()},{openDropdown:ce,closeDropdown:le}=gd({open:oe,close:ae,closeDelay:m,openDelay:p}),ue=(0,M.useRef)(null),de=(0,M.useCallback)(e=>{let t=ue.current;return t&&t!==e&&t(),ue.current=e,()=>{ue.current===e&&(ue.current=null)}},[]),fe=(0,M.useRef)(0),[j,pe]=(0,M.useState)(!1),me=(0,M.useCallback)(()=>(fe.current+=1,fe.current===1&&pe(!0),()=>{--fe.current,fe.current===0&&pe(!1)}),[]),he=(0,M.useRef)(null),ge=()=>{he.current?.(),E?.()},_e=e=>Ia(`[data-menu-item]`,`[data-menu-dropdown]`,e),{resolvedClassNames:ve,resolvedStyles:ye}=T({classNames:h,styles:g,props:t});return(0,N.jsx)(Jm,{value:{getStyles:te,opened:ne,toggleDropdown:se,getItemIndex:_e,openedViaClick:A,setOpenedViaClick:ie,closeOnItemClick:l,closeDropdown:f===`click`?ae:le,openDropdown:f===`click`?oe:ce,closeDropdownImmediately:ae,loop:u,trigger:f,unstyled:_,menuItemTabIndex:b,withInitialFocusPlaceholder:S,registerOpenSub:de,hasSearch:j,registerSearch:me,searchExitClearRef:he,alignItemsLabels:O,checkIcon:k},children:(0,N.jsx)(Ud,{returnFocus:!0,...ee,opened:ne,onChange:se,defaultOpened:o,trapFocus:!x&&s,closeOnEscape:d,__staticSelector:`Menu`,classNames:ve,styles:ye,unstyled:_,variant:v,keepMounted:x,onExitTransitionEnd:ge,children:n})})});Mh.displayName=`@mantine/core/Menu`,Mh.classes=eh,Mh.Item=lh,Mh.Label=uh,Mh.Dropdown=ch,Mh.Target=Ah,Mh.Divider=rh,Mh.Search=Ch,Mh.Sub=Oh,Mh.CheckboxItem=th,Mh.CheckboxGroup=Zm,Mh.RadioItem=mh,Mh.RadioGroup=fh,Mh.ContextMenu=nh;var[Nh,Ph]=Sa(`Modal component was not found in tree`),Fh={root:`m_9df02822`,content:`m_54c44539`,inner:`m_1f958f16`,header:`m_d0e2b9cd`},Ih=g(e=>{let{classNames:t,className:n,style:r,styles:i,vars:a,...o}=D(`ModalBody`,null,e);return(0,N.jsx)(Cp,{...Ph().getStyles(`body`,{classNames:t,style:r,styles:i,className:n}),...o})});Ih.classes=Fh,Ih.displayName=`@mantine/core/ModalBody`;var Lh=g(e=>{let{classNames:t,className:n,style:r,styles:i,vars:a,...o}=D(`ModalCloseButton`,null,e);return(0,N.jsx)(wp,{...Ph().getStyles(`close`,{classNames:t,style:r,styles:i,className:n}),...o})});Lh.classes=Fh,Lh.displayName=`@mantine/core/ModalCloseButton`;var Rh=g(e=>{let{classNames:t,className:n,style:r,styles:i,vars:a,children:o,__hidden:s,...c}=D(`ModalContent`,null,e),l=Ph(),u=l.scrollAreaComponent||Mp;return(0,N.jsx)(Tp,{...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,N.jsx)(u,{style:{maxHeight:l.fullScreen?`100dvh`:`calc(100dvh - (${j(l.yOffset)} * 2))`},children:o})})});Rh.classes=Fh,Rh.displayName=`@mantine/core/ModalContent`;var zh=g(e=>{let{classNames:t,className:n,style:r,styles:i,vars:a,...o}=D(`ModalHeader`,null,e);return(0,N.jsx)(Ep,{...Ph().getStyles(`header`,{classNames:t,style:r,styles:i,className:n}),...o})});zh.classes=Fh,zh.displayName=`@mantine/core/ModalHeader`;var Bh=g(e=>{let{classNames:t,className:n,style:r,styles:i,vars:a,...o}=D(`ModalOverlay`,null,e);return(0,N.jsx)(kp,{...Ph().getStyles(`overlay`,{classNames:t,style:r,styles:i,className:n}),...o})});Bh.classes=Fh,Bh.displayName=`@mantine/core/ModalOverlay`;var Vh={__staticSelector:`Modal`,closeOnClickOutside:!0,withinPortal:!0,lockScroll:!0,trapFocus:!0,returnFocus:!0,closeOnEscape:!0,keepMounted:!1,zIndex:ka(`modal`),transitionProps:{duration:200,transition:`fade-down`},yOffset:`5dvh`},Hh=O((e,{radius:t,size:n,yOffset:r,xOffset:i})=>({root:{"--modal-radius":t===void 0?void 0:ce(t),"--modal-size":Pe(n,`modal-size`),"--modal-y-offset":j(r),"--modal-x-offset":j(i)}})),Uh=g(e=>{let t=D(`ModalRoot`,Vh,e),{classNames:n,className:r,style:i,styles:a,unstyled:o,vars:s,yOffset:c,scrollAreaComponent:l,radius:u,fullScreen:d,centered:f,xOffset:p,__staticSelector:m,attributes:h,...g}=t,_=w({name:m,classes:Fh,props:t,className:r,style:i,classNames:n,styles:a,unstyled:o,attributes:h,vars:s,varsResolver:Hh});return(0,N.jsx)(Nh,{value:{yOffset:c,scrollAreaComponent:l,getStyles:_,fullScreen:d},children:(0,N.jsx)(bp,{..._(`root`),"data-full-screen":d||void 0,"data-centered":f||void 0,"data-offset-scrollbars":l===id.Autosize||void 0,unstyled:o,...g})})});Uh.classes=Fh,Uh.varsResolver=Hh,Uh.displayName=`@mantine/core/ModalRoot`;var Wh=(0,M.createContext)(null);function Gh({children:e}){let[t,n]=(0,M.useState)([]),[r,i]=(0,M.useState)(ka(`modal`));return(0,N.jsx)(Wh,{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},children:e})}Gh.displayName=`@mantine/core/ModalStack`;var Kh=g(e=>{let{classNames:t,className:n,style:r,styles:i,vars:a,...o}=D(`ModalTitle`,null,e);return(0,N.jsx)(jp,{...Ph().getStyles(`title`,{classNames:t,style:r,styles:i,className:n}),...o})});Kh.classes=Fh,Kh.displayName=`@mantine/core/ModalTitle`;var qh={closeOnClickOutside:!0,withinPortal:!0,lockScroll:!0,trapFocus:!0,returnFocus:!0,closeOnEscape:!0,keepMounted:!1,zIndex:ka(`modal`),transitionProps:{duration:200,transition:`fade-down`},withOverlay:!0,withCloseButton:!0},Jh=g(e=>{let{title:t,withOverlay:n,overlayProps:r,withCloseButton:i,closeButtonProps:a,children:o,radius:s,opened:c,stackId:l,zIndex:u,...d}=D(`Modal`,qh,e),f=(0,M.use)(Wh),p=!!t||i,m=f&&l?{closeOnEscape:f.currentId===l,trapFocus:f.currentId===l,zIndex:f.getZIndex(l)}:{},h=n===!1?!1:l&&f?f.currentId===l:c;return(0,M.useEffect)(()=>{f&&l&&(c?f.addModal(l,u||ka(`modal`)):f.removeModal(l))},[c,l,u]),(0,N.jsxs)(Uh,{radius:s,opened:c,zIndex:f&&l?f.getZIndex(l):u,...d,...m,children:[n&&(0,N.jsx)(Bh,{visible:h,transitionProps:f&&l?{duration:0}:void 0,...r}),(0,N.jsxs)(Rh,{radius:s,__hidden:f&&l&&c?l!==f.currentId:!1,children:[p&&(0,N.jsxs)(zh,{children:[t&&(0,N.jsx)(Kh,{children:t}),i&&(0,N.jsx)(Lh,{...a})]}),(0,N.jsx)(Ih,{children:o})]})]})});Jh.classes=Fh,Jh.displayName=`@mantine/core/Modal`,Jh.Root=Uh,Jh.Overlay=Bh,Jh.Content=Rh,Jh.Body=Ih,Jh.Header=zh,Jh.Title=Kh,Jh.CloseButton=Lh,Jh.Stack=Gh;function Yh({offset:e,position:t,defaultOpened:n}){let[r,i]=(0,M.useState)(n),a=(0,M.useRef)(null),{x:o,y:s,elements:c,refs:l,update:u,placement:d}=Gu({placement:t,middleware:[$l({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,M.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,M.useEffect)(()=>{if(l.floating.current){let e=a.current;e.addEventListener(`mousemove`,m);let t=Hs(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 Xh={tooltip:`m_1b3c8819`,arrow:`m_f898399f`},Zh={refProp:`ref`,withinPortal:!0,offset:10,position:`right`,zIndex:ka(`popover`)},Qh=O((e,{radius:t,color:n})=>({tooltip:{"--tooltip-radius":t===void 0?void 0:ce(t),"--tooltip-bg":n?x(n,e):void 0,"--tooltip-color":n?`var(--mantine-color-white)`:void 0}})),$h=g(e=>{let t=D(`TooltipFloating`,Zh,e),{children:n,refProp:r,withinPortal:i,style:a,className:o,classNames:s,styles:c,unstyled:l,radius:u,color:d,label:f,offset:p,position:m,multiline:h,zIndex:g,disabled:_,defaultOpened:v,variant:y,vars:x,portalProps:S,attributes:C,ref:T,...E}=t,O=b(),k=w({name:`TooltipFloating`,props:t,classes:Xh,className:o,style:a,classNames:s,styles:c,unstyled:l,attributes:C,rootSelector:`tooltip`,vars:x,varsResolver:Qh}),{handleMouseMove:ee,x:te,y:ne,opened:re,boundaryRef:A,floating:ie,setOpened:ae}=Yh({offset:p,position:m,defaultOpened:v}),oe=mo(n);if(!oe)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=ro(A,po(oe),T),ce=oe.props,le=e=>{ce.onMouseEnter?.(e),ee(e),ae(!0)},ue=e=>{ce.onMouseLeave?.(e),ae(!1)};return(0,N.jsxs)(N.Fragment,{children:[(0,N.jsx)(Td,{...S,withinPortal:i,children:(0,N.jsx)(Be,{...E,...k(`tooltip`,{style:{...zo(a,O),zIndex:g,display:!_&&re?`block`:`none`,top:Number.isFinite(ne)?Math.round(ne):``,left:Number.isFinite(te)?Math.round(te):``}}),variant:y,ref:ie,mod:{multiline:h},children:f})}),(0,M.cloneElement)(oe,{...ce,[r]:se,onMouseEnter:le,onMouseLeave:ue})]})});$h.classes=Xh,$h.varsResolver=Qh,$h.displayName=`@mantine/core/TooltipFloating`;var eg=(0,M.createContext)({withinGroup:!1}),tg={openDelay:0,closeDelay:0};function ng(e){let{openDelay:t,closeDelay:n,children:r}=D(`TooltipGroup`,tg,e);return(0,N.jsx)(eg,{value:{withinGroup:!0},children:(0,N.jsx)(Iu,{delay:{open:t,close:n},children:r})})}ng.displayName=`@mantine/core/TooltipGroup`,ng.extend=e=>e;function rg(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 ig(e){let t=rg(e.middlewares),n=[Ql(e.offset)];return t.shift&&n.push($l(typeof t.shift==`boolean`?{padding:8}:{padding:8,...t.shift})),t.flip&&n.push(typeof t.flip==`boolean`?tu():tu(t.flip)),n.push(au({element:e.arrowRef,padding:e.arrowOffset})),t.inline?n.push(typeof t.inline==`boolean`?iu():iu(t.inline)):e.inline&&n.push(iu()),n}function ag(e){let[t,n]=(0,M.useState)(e.defaultOpened),r=typeof e.opened==`boolean`?e.opened:t,i=(0,M.use)(eg).withinGroup,a=pe(),o=(0,M.useCallback)(e=>{n(e),e&&g(a)},[a]),{x:s,y:c,context:l,refs:u,placement:d,middlewareData:{arrow:{x:f,y:p}={}}}=Gu({strategy:e.strategy,placement:e.position,open:r,onOpenChange:o,middleware:ig(e),whileElementsMounted:Pl}),{delay:m,currentId:h,setCurrentId:g}=Lu(l,{id:a}),{getReferenceProps:_,getFloatingProps:v}=Yu([Mu(l,{enabled:e.events?.hover,delay:i?m:{open:e.openDelay,close:e.closeDelay},mouseOnly:!e.events?.touch,handleClose:e.interactive?td():null}),qu(l,{enabled:e.events?.focus,visibleOnly:!0}),Zu(l,{role:`tooltip`}),Uu(l,{enabled:e.opened===void 0})]),y=(0,M.useRef)(d);Ee(()=>{y.current!==d&&(y.current=d,e.onPositionChange?.(d))},[d]);let b=r&&h&&h!==a;return{x:s,y:c,arrowX:f,arrowY:p,reference:u.setReference,floating:u.setFloating,getFloatingProps:v,getReferenceProps:_,isGroupPhase:b,opened:r,placement:d}}var og={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:ka(`popover`),middlewares:{flip:!0,shift:!0,inline:!1}},sg=O((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:ce(t),"--tooltip-bg":n?a.background:void 0,"--tooltip-color":n?a.color:void 0}}}),cg=g(e=>{let t=D(`Tooltip`,og,e),{children:n,position:r,refProp:i,label:a,openDelay:o,closeDelay:s,onPositionChange:c,opened:l,defaultOpened:u,withinPortal:d,radius:f,color:p,classNames:m,styles:h,unstyled:g,style:_,className:v,withArrow:y,arrowSize:b,arrowOffset:x,arrowRadius:S,arrowPosition:C,offset:T,transitionProps:E,multiline:O,events:k,interactive:ee,zIndex:te,disabled:ne,onClick:re,onMouseEnter:A,onMouseLeave:ie,inline:oe,variant:se,keepMounted:ce,vars:le,portalProps:ue,mod:de,floatingStrategy:fe,middlewares:j,autoContrast:pe,attributes:me,target:he,ref:ge,..._e}=t,{dir:ve}=Vo(),ye=(0,M.useRef)(null),be=ag({position:hd(ve,r),closeDelay:s,openDelay:o,onPositionChange:c,opened:l,defaultOpened:u,events:k,interactive:ee,arrowRef:ye,arrowOffset:x,offset:typeof T==`number`?T+(y?b/2:0):T,inline:oe,strategy:fe,middlewares:j});(0,M.useEffect)(()=>{let e=he instanceof HTMLElement?he:typeof he==`string`?document.querySelector(he):he?.current||null;e&&be.reference(e)},[he,be]);let xe=w({name:`Tooltip`,props:t,classes:Xh,className:v,style:_,classNames:m,styles:h,unstyled:g,attributes:me,rootSelector:`tooltip`,vars:le,varsResolver:sg}),Se=mo(n);if(!he&&!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=ee&&!ne&&!!be.opened,Te=C===`merge`&&y?pd({position:be.placement,dir:ve}):void 0;if(he){let e=Dd(E,{duration:100,transition:`fade`});return(0,N.jsx)(N.Fragment,{children:(0,N.jsx)(Td,{...ue,withinPortal:d,children:(0,N.jsx)(Ve,{...e,keepMounted:ce,mounted:!ne&&!!be.opened,duration:be.isGroupPhase?10:e.duration,children:e=>(0,N.jsxs)(Be,{..._e,"data-fixed":fe===`fixed`||void 0,variant:se,mod:[{multiline:O,interactive:we},de],...Ce,...be.getFloatingProps({ref:be.floating,className:Ce.className,style:{...Ce.style,...e,...Te,zIndex:te,top:be.y??0,left:be.x??0}}),children:[a,(0,N.jsx)(md,{ref:ye,arrowX:be.arrowX,arrowY:be.arrowY,visible:y,position:be.placement,arrowSize:b,arrowOffset:x,arrowRadius:S,arrowPosition:C,...xe(`arrow`)})]})})})})}let Ee=Se.props,De=ro(be.reference,po(Se),ge),Oe=Dd(E,{duration:100,transition:`fade`});return(0,N.jsxs)(N.Fragment,{children:[(0,N.jsx)(Td,{...ue,withinPortal:d,children:(0,N.jsx)(Ve,{...Oe,keepMounted:ce,mounted:!ne&&!!be.opened,duration:be.isGroupPhase?10:Oe.duration,children:e=>(0,N.jsxs)(Be,{..._e,"data-fixed":fe===`fixed`||void 0,variant:se,mod:[{multiline:O,interactive:we},de],...be.getFloatingProps({ref:be.floating,className:xe(`tooltip`).className,style:{...xe(`tooltip`).style,...e,...Te,zIndex:te,top:be.y??0,left:be.x??0}}),children:[a,(0,N.jsx)(md,{ref:ye,arrowX:be.arrowX,arrowY:be.arrowY,visible:y,position:be.placement,arrowSize:b,arrowOffset:x,arrowRadius:S,arrowPosition:C,...xe(`arrow`)})]})})}),(0,M.cloneElement)(Se,be.getReferenceProps({onClick:re,onMouseEnter:A,onMouseLeave:ie,onMouseMove:t.onMouseMove,onPointerDown:t.onPointerDown,onPointerEnter:t.onPointerEnter,...Ee,className:ae(v,Ee.className),[i]:De}))]})});cg.classes=Xh,cg.varsResolver=sg,cg.displayName=`@mantine/core/Tooltip`,cg.Floating=$h,cg.Group=ng;function lg(e){if(e!==void 0)return typeof e==`number`?j(e):e}function ug({spacing:e,verticalSpacing:t,cols:n,minColWidth:r,autoRows:i,selector:a}){let o=b(),s=t===void 0?e:t,c=r!==void 0,l=Se({"--sg-spacing-x":de(Fa(e)),"--sg-spacing-y":de(Fa(s)),"--sg-auto-rows":i,...c?{"--sg-min-col-width":lg(r)}:{"--sg-cols":Fa(n)?.toString()}}),u=ke(o.breakpoints).reduce((t,r)=>(t[r]||(t[r]={}),typeof e==`object`&&e[r]!==void 0&&(t[r][`--sg-spacing-x`]=de(e[r])),typeof s==`object`&&s[r]!==void 0&&(t[r][`--sg-spacing-y`]=de(s[r])),!c&&typeof n==`object`&&n[r]!==void 0&&(t[r][`--sg-cols`]=n[r]),t),{});return(0,N.jsx)(be,{styles:l,media:Pa(ke(u),o.breakpoints).filter(e=>ke(u[e.value]).length>0).map(e=>({query:`(min-width: ${o.breakpoints[e.value]})`,styles:u[e.value]})),selector:a})}function dg(e){return typeof e==`object`&&e?ke(e):[]}function fg(e){return e.sort((e,t)=>ba(e)-ba(t))}function pg({spacing:e,verticalSpacing:t,cols:n,minColWidth:r}){return fg(Array.from(new Set([...dg(e),...dg(t),...r===void 0?dg(n):[]])))}function mg({spacing:e,verticalSpacing:t,cols:n,minColWidth:r,autoRows:i,selector:a}){let o=t===void 0?e:t,s=r!==void 0,c=Se({"--sg-spacing-x":de(Fa(e)),"--sg-spacing-y":de(Fa(o)),"--sg-auto-rows":i,...s?{"--sg-min-col-width":lg(r)}:{"--sg-cols":Fa(n)?.toString()}}),l=pg({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`]=de(e[r])),typeof o==`object`&&o[r]!==void 0&&(t[r][`--sg-spacing-y`]=de(o[r])),!s&&typeof n==`object`&&n[r]!==void 0&&(t[r][`--sg-cols`]=n[r]),t),{});return(0,N.jsx)(be,{styles:c,container:l.map(e=>({query:`simple-grid (min-width: ${e})`,styles:u[e]})),selector:a})}var hg={container:`m_925c2d2c`,root:`m_2415a157`},gg={cols:1,spacing:`md`,type:`media`},_g=g(e=>{let t=D(`SimpleGrid`,gg,e),{classNames:n,className:r,style:i,styles:a,unstyled:o,vars:s,cols:c,verticalSpacing:l,spacing:u,type:d,minColWidth:f,autoFlow:p,autoRows:m,attributes:h,...g}=t,_=w({name:`SimpleGrid`,classes:hg,props:t,className:r,style:i,classNames:n,styles:a,unstyled:o,attributes:h,vars:s}),v=E(),y=f===void 0?void 0:p||`auto-fill`;return d===`container`?(0,N.jsxs)(N.Fragment,{children:[(0,N.jsx)(mg,{...t,selector:`.${v}`}),(0,N.jsx)(`div`,{..._(`container`),children:(0,N.jsx)(Be,{..._(`root`,{className:v}),...g,"data-auto-cols":y})})]}):(0,N.jsxs)(N.Fragment,{children:[(0,N.jsx)(ug,{...t,selector:`.${v}`}),(0,N.jsx)(Be,{..._(`root`,{className:v}),...g,"data-auto-cols":y})]})});_g.classes=hg,_g.displayName=`@mantine/core/SimpleGrid`;var vg={root:`m_d08caa0`},yg=g(e=>{let t=D(`Typography`,null,e),{classNames:n,className:r,style:i,styles:a,unstyled:o,attributes:s,...c}=t;return(0,N.jsx)(Be,{...w({name:`Typography`,classes:vg,props:t,className:r,style:i,classNames:n,styles:a,unstyled:o,attributes:s})(`root`),...c})});yg.classes=vg,yg.displayName=`@mantine/core/Typography`;var bg=[];for(let e=0;e<256;++e)bg.push((e+256).toString(16).slice(1));function xg(e,t=0){return(bg[e[t+0]]+bg[e[t+1]]+bg[e[t+2]]+bg[e[t+3]]+`-`+bg[e[t+4]]+bg[e[t+5]]+`-`+bg[e[t+6]]+bg[e[t+7]]+`-`+bg[e[t+8]]+bg[e[t+9]]+`-`+bg[e[t+10]]+bg[e[t+11]]+bg[e[t+12]]+bg[e[t+13]]+bg[e[t+14]]+bg[e[t+15]]).toLowerCase()}var Sg,Cg=new Uint8Array(16);function wg(){if(!Sg){if(typeof crypto>`u`||!crypto.getRandomValues)throw Error(`crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported`);Sg=crypto.getRandomValues.bind(crypto)}return Sg(Cg)}var Tg={randomUUID:typeof crypto<`u`&&crypto.randomUUID&&crypto.randomUUID.bind(crypto)};function Eg(e,t,n){if(Tg.randomUUID&&!t&&!e)return Tg.randomUUID();e||={};let r=e.random??e.rng?.()??wg();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 xg(r)}var Dg;(function(e){e.assertEqual=e=>{};function t(e){}e.assertIs=t;function n(e){throw Error()}e.assertNever=n,e.arrayToEnum=e=>{let t={};for(let n of e)t[n]=n;return t},e.getValidEnumValues=t=>{let n=e.objectKeys(t).filter(e=>typeof t[t[e]]!=`number`),r={};for(let e of n)r[e]=t[e];return e.objectValues(r)},e.objectValues=t=>e.objectKeys(t).map(function(e){return t[e]}),e.objectKeys=typeof Object.keys==`function`?e=>Object.keys(e):e=>{let t=[];for(let n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.push(n);return t},e.find=(e,t)=>{for(let n of e)if(t(n))return n},e.isInteger=typeof Number.isInteger==`function`?e=>Number.isInteger(e):e=>typeof e==`number`&&Number.isFinite(e)&&Math.floor(e)===e;function r(e,t=` | `){return e.map(e=>typeof e==`string`?`'${e}'`:e).join(t)}e.joinValues=r,e.jsonStringifyReplacer=(e,t)=>typeof t==`bigint`?t.toString():t})(Dg||={});var Og;(function(e){e.mergeShapes=(e,t)=>({...e,...t})})(Og||={});var P=Dg.arrayToEnum([`string`,`nan`,`number`,`integer`,`float`,`boolean`,`date`,`bigint`,`symbol`,`function`,`undefined`,`null`,`array`,`object`,`unknown`,`promise`,`void`,`never`,`map`,`set`]),kg=e=>{switch(typeof e){case`undefined`:return P.undefined;case`string`:return P.string;case`number`:return Number.isNaN(e)?P.nan:P.number;case`boolean`:return P.boolean;case`function`:return P.function;case`bigint`:return P.bigint;case`symbol`:return P.symbol;case`object`:return Array.isArray(e)?P.array:e===null?P.null:e.then&&typeof e.then==`function`&&e.catch&&typeof e.catch==`function`?P.promise:typeof Map<`u`&&e instanceof Map?P.map:typeof Set<`u`&&e instanceof Set?P.set:typeof Date<`u`&&e instanceof Date?P.date:P.object;default:return P.unknown}},F=Dg.arrayToEnum([`invalid_type`,`invalid_literal`,`custom`,`invalid_union`,`invalid_union_discriminator`,`invalid_enum_value`,`unrecognized_keys`,`invalid_arguments`,`invalid_return_type`,`invalid_date`,`invalid_string`,`too_small`,`too_big`,`invalid_intersection_types`,`not_multiple_of`,`not_finite`]),Ag=class e extends Error{get errors(){return this.issues}constructor(e){super(),this.issues=[],this.addIssue=e=>{this.issues=[...this.issues,e]},this.addIssues=(e=[])=>{this.issues=[...this.issues,...e]};let t=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,t):this.__proto__=t,this.name=`ZodError`,this.issues=e}format(e){let t=e||function(e){return e.message},n={_errors:[]},r=e=>{for(let i of e.issues)if(i.code===`invalid_union`)i.unionErrors.map(r);else if(i.code===`invalid_return_type`)r(i.returnTypeError);else if(i.code===`invalid_arguments`)r(i.argumentsError);else if(i.path.length===0)n._errors.push(t(i));else{let e=n,r=0;for(;re.message){let t={},n=[];for(let r of this.issues)if(r.path.length>0){let n=r.path[0];t[n]=t[n]||[],t[n].push(e(r))}else n.push(e(r));return{formErrors:n,fieldErrors:t}}get formErrors(){return this.flatten()}};Ag.create=e=>new Ag(e);var jg=(e,t)=>{let n;switch(e.code){case F.invalid_type:n=e.received===P.undefined?`Required`:`Expected ${e.expected}, received ${e.received}`;break;case F.invalid_literal:n=`Invalid literal value, expected ${JSON.stringify(e.expected,Dg.jsonStringifyReplacer)}`;break;case F.unrecognized_keys:n=`Unrecognized key(s) in object: ${Dg.joinValues(e.keys,`, `)}`;break;case F.invalid_union:n=`Invalid input`;break;case F.invalid_union_discriminator:n=`Invalid discriminator value. Expected ${Dg.joinValues(e.options)}`;break;case F.invalid_enum_value:n=`Invalid enum value. Expected ${Dg.joinValues(e.options)}, received '${e.received}'`;break;case F.invalid_arguments:n=`Invalid function arguments`;break;case F.invalid_return_type:n=`Invalid function return type`;break;case F.invalid_date:n=`Invalid date`;break;case F.invalid_string:typeof e.validation==`object`?`includes`in e.validation?(n=`Invalid input: must include "${e.validation.includes}"`,typeof e.validation.position==`number`&&(n=`${n} at one or more positions greater than or equal to ${e.validation.position}`)):`startsWith`in e.validation?n=`Invalid input: must start with "${e.validation.startsWith}"`:`endsWith`in e.validation?n=`Invalid input: must end with "${e.validation.endsWith}"`:Dg.assertNever(e.validation):n=e.validation===`regex`?`Invalid`:`Invalid ${e.validation}`;break;case F.too_small:n=e.type===`array`?`Array must contain ${e.exact?`exactly`:e.inclusive?`at least`:`more than`} ${e.minimum} element(s)`:e.type===`string`?`String must contain ${e.exact?`exactly`:e.inclusive?`at least`:`over`} ${e.minimum} character(s)`:e.type===`number`||e.type===`bigint`?`Number must be ${e.exact?`exactly equal to `:e.inclusive?`greater than or equal to `:`greater than `}${e.minimum}`:e.type===`date`?`Date must be ${e.exact?`exactly equal to `:e.inclusive?`greater than or equal to `:`greater than `}${new Date(Number(e.minimum))}`:`Invalid input`;break;case F.too_big:n=e.type===`array`?`Array must contain ${e.exact?`exactly`:e.inclusive?`at most`:`less than`} ${e.maximum} element(s)`:e.type===`string`?`String must contain ${e.exact?`exactly`:e.inclusive?`at most`:`under`} ${e.maximum} character(s)`:e.type===`number`?`Number must be ${e.exact?`exactly`:e.inclusive?`less than or equal to`:`less than`} ${e.maximum}`:e.type===`bigint`?`BigInt must be ${e.exact?`exactly`:e.inclusive?`less than or equal to`:`less than`} ${e.maximum}`:e.type===`date`?`Date must be ${e.exact?`exactly`:e.inclusive?`smaller than or equal to`:`smaller than`} ${new Date(Number(e.maximum))}`:`Invalid input`;break;case F.custom:n=`Invalid input`;break;case F.invalid_intersection_types:n=`Intersection results could not be merged`;break;case F.not_multiple_of:n=`Number must be a multiple of ${e.multipleOf}`;break;case F.not_finite:n=`Number must be finite`;break;default:n=t.defaultError,Dg.assertNever(e)}return{message:n}},Mg=jg;function Ng(){return Mg}var Pg=e=>{let{data:t,path:n,errorMaps:r,issueData:i}=e,a=[...n,...i.path||[]],o={...i,path:a};if(i.message!==void 0)return{...i,path:a,message:i.message};let s=``,c=r.filter(e=>!!e).slice().reverse();for(let e of c)s=e(o,{data:t,defaultError:s}).message;return{...i,path:a,message:s}};function I(e,t){let n=Ng(),r=Pg({issueData:t,data:e.data,path:e.path,errorMaps:[e.common.contextualErrorMap,e.schemaErrorMap,n,n===jg?void 0:jg].filter(e=>!!e)});e.common.issues.push(r)}var Fg=class e{constructor(){this.value=`valid`}dirty(){this.value===`valid`&&(this.value=`dirty`)}abort(){this.value!==`aborted`&&(this.value=`aborted`)}static mergeArray(e,t){let n=[];for(let r of t){if(r.status===`aborted`)return L;r.status===`dirty`&&e.dirty(),n.push(r.value)}return{status:e.value,value:n}}static async mergeObjectAsync(t,n){let r=[];for(let e of n){let t=await e.key,n=await e.value;r.push({key:t,value:n})}return e.mergeObjectSync(t,r)}static mergeObjectSync(e,t){let n={};for(let r of t){let{key:t,value:i}=r;if(t.status===`aborted`||i.status===`aborted`)return L;t.status===`dirty`&&e.dirty(),i.status===`dirty`&&e.dirty(),t.value!==`__proto__`&&(i.value!==void 0||r.alwaysSet)&&(n[t.value]=i.value)}return{status:e.value,value:n}}},L=Object.freeze({status:`aborted`}),Ig=e=>({status:`dirty`,value:e}),Lg=e=>({status:`valid`,value:e}),Rg=e=>e.status===`aborted`,zg=e=>e.status===`dirty`,Bg=e=>e.status===`valid`,Vg=e=>typeof Promise<`u`&&e instanceof Promise,R;(function(e){e.errToObj=e=>typeof e==`string`?{message:e}:e||{},e.toString=e=>typeof e==`string`?e:e?.message})(R||={});var Hg=class{constructor(e,t,n,r){this._cachedPath=[],this.parent=e,this.data=t,this._path=n,this._key=r}get path(){return this._cachedPath.length||(Array.isArray(this._key)?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}},Ug=(e,t)=>{if(Bg(t))return{success:!0,data:t.value};if(!e.common.issues.length)throw Error(`Validation failed but no issues detected.`);return{success:!1,get error(){if(this._error)return this._error;let t=new Ag(e.common.issues);return this._error=t,this._error}}};function Wg(e){if(!e)return{};let{errorMap:t,invalid_type_error:n,required_error:r,description:i}=e;if(t&&(n||r))throw Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return t?{errorMap:t,description:i}:{errorMap:(t,i)=>{let{message:a}=e;return t.code===`invalid_enum_value`?{message:a??i.defaultError}:i.data===void 0?{message:a??r??i.defaultError}:t.code===`invalid_type`?{message:a??n??i.defaultError}:{message:i.defaultError}},description:i}}var Gg=class{get description(){return this._def.description}_getType(e){return kg(e.data)}_getOrReturnCtx(e,t){return t||{common:e.parent.common,data:e.data,parsedType:kg(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}_processInputParams(e){return{status:new Fg,ctx:{common:e.parent.common,data:e.data,parsedType:kg(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}}_parseSync(e){let t=this._parse(e);if(Vg(t))throw Error(`Synchronous parse encountered promise.`);return t}_parseAsync(e){let t=this._parse(e);return Promise.resolve(t)}parse(e,t){let n=this.safeParse(e,t);if(n.success)return n.data;throw n.error}safeParse(e,t){let n={common:{issues:[],async:t?.async??!1,contextualErrorMap:t?.errorMap},path:t?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:kg(e)};return Ug(n,this._parseSync({data:e,path:n.path,parent:n}))}"~validate"(e){let t={common:{issues:[],async:!!this[`~standard`].async},path:[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:kg(e)};if(!this[`~standard`].async)try{let n=this._parseSync({data:e,path:[],parent:t});return Bg(n)?{value:n.value}:{issues:t.common.issues}}catch(e){e?.message?.toLowerCase()?.includes(`encountered`)&&(this[`~standard`].async=!0),t.common={issues:[],async:!0}}return this._parseAsync({data:e,path:[],parent:t}).then(e=>Bg(e)?{value:e.value}:{issues:t.common.issues})}async parseAsync(e,t){let n=await this.safeParseAsync(e,t);if(n.success)return n.data;throw n.error}async safeParseAsync(e,t){let n={common:{issues:[],contextualErrorMap:t?.errorMap,async:!0},path:t?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:kg(e)},r=this._parse({data:e,path:n.path,parent:n});return Ug(n,await(Vg(r)?r:Promise.resolve(r)))}refine(e,t){let n=e=>typeof t==`string`||t===void 0?{message:t}:typeof t==`function`?t(e):t;return this._refinement((t,r)=>{let i=e(t),a=()=>r.addIssue({code:F.custom,...n(t)});return typeof Promise<`u`&&i instanceof Promise?i.then(e=>e?!0:(a(),!1)):i?!0:(a(),!1)})}refinement(e,t){return this._refinement((n,r)=>e(n)?!0:(r.addIssue(typeof t==`function`?t(n,r):t),!1))}_refinement(e){return new J_({schema:this,typeName:z.ZodEffects,effect:{type:`refinement`,refinement:e}})}superRefine(e){return this._refinement(e)}constructor(e){this.spa=this.safeParseAsync,this._def=e,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this),this[`~standard`]={version:1,vendor:`zod`,validate:e=>this[`~validate`](e)}}optional(){return Y_.create(this,this._def)}nullable(){return X_.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return k_.create(this)}promise(){return q_.create(this,this._def)}or(e){return M_.create([this,e],this._def)}and(e){return I_.create(this,e,this._def)}transform(e){return new J_({...Wg(this._def),schema:this,typeName:z.ZodEffects,effect:{type:`transform`,transform:e}})}default(e){let t=typeof e==`function`?e:()=>e;return new Z_({...Wg(this._def),innerType:this,defaultValue:t,typeName:z.ZodDefault})}brand(){return new ev({typeName:z.ZodBranded,type:this,...Wg(this._def)})}catch(e){let t=typeof e==`function`?e:()=>e;return new Q_({...Wg(this._def),innerType:this,catchValue:t,typeName:z.ZodCatch})}describe(e){let t=this.constructor;return new t({...this._def,description:e})}pipe(e){return tv.create(this,e)}readonly(){return nv.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}},Kg=/^c[^\s-]{8,}$/i,qg=/^[0-9a-z]+$/,Jg=/^[0-9A-HJKMNP-TV-Z]{26}$/i,Yg=/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i,Xg=/^[a-z0-9_-]{21}$/i,Zg=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,Qg=/^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/,$g=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,e_=`^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$`,t_,n_=/^(?:(?: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])$/,r_=/^(?:(?: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])\/(3[0-2]|[12]?[0-9])$/,i_=/^(([0-9a-fA-F]{1,4}:){7,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}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))$/,a_=/^(([0-9a-fA-F]{1,4}:){7,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}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,o_=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,s_=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,c_=`((\\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])))`,l_=RegExp(`^${c_}$`);function u_(e){let t=`[0-5]\\d`;e.precision?t=`${t}\\.\\d{${e.precision}}`:e.precision??(t=`${t}(\\.\\d+)?`);let n=e.precision?`+`:`?`;return`([01]\\d|2[0-3]):[0-5]\\d(:${t})${n}`}function d_(e){return RegExp(`^${u_(e)}$`)}function f_(e){let t=`${c_}T${u_(e)}`,n=[];return n.push(e.local?`Z?`:`Z`),e.offset&&n.push(`([+-]\\d{2}:?\\d{2})`),t=`${t}(${n.join(`|`)})`,RegExp(`^${t}$`)}function p_(e,t){return!!((t===`v4`||!t)&&n_.test(e)||(t===`v6`||!t)&&i_.test(e))}function m_(e,t){if(!Zg.test(e))return!1;try{let[n]=e.split(`.`);if(!n)return!1;let r=n.replace(/-/g,`+`).replace(/_/g,`/`).padEnd(n.length+(4-n.length%4)%4,`=`),i=JSON.parse(atob(r));return!(typeof i!=`object`||!i||`typ`in i&&i?.typ!==`JWT`||!i.alg||t&&i.alg!==t)}catch{return!1}}function h_(e,t){return!!((t===`v4`||!t)&&r_.test(e)||(t===`v6`||!t)&&a_.test(e))}var g_=class e extends Gg{_parse(e){if(this._def.coerce&&(e.data=String(e.data)),this._getType(e)!==P.string){let t=this._getOrReturnCtx(e);return I(t,{code:F.invalid_type,expected:P.string,received:t.parsedType}),L}let t=new Fg,n;for(let r of this._def.checks)if(r.kind===`min`)e.data.lengthr.value&&(n=this._getOrReturnCtx(e,n),I(n,{code:F.too_big,maximum:r.value,type:`string`,inclusive:!0,exact:!1,message:r.message}),t.dirty());else if(r.kind===`length`){let i=e.data.length>r.value,a=e.data.lengthe.test(t),{validation:t,code:F.invalid_string,...R.errToObj(n)})}_addCheck(t){return new e({...this._def,checks:[...this._def.checks,t]})}email(e){return this._addCheck({kind:`email`,...R.errToObj(e)})}url(e){return this._addCheck({kind:`url`,...R.errToObj(e)})}emoji(e){return this._addCheck({kind:`emoji`,...R.errToObj(e)})}uuid(e){return this._addCheck({kind:`uuid`,...R.errToObj(e)})}nanoid(e){return this._addCheck({kind:`nanoid`,...R.errToObj(e)})}cuid(e){return this._addCheck({kind:`cuid`,...R.errToObj(e)})}cuid2(e){return this._addCheck({kind:`cuid2`,...R.errToObj(e)})}ulid(e){return this._addCheck({kind:`ulid`,...R.errToObj(e)})}base64(e){return this._addCheck({kind:`base64`,...R.errToObj(e)})}base64url(e){return this._addCheck({kind:`base64url`,...R.errToObj(e)})}jwt(e){return this._addCheck({kind:`jwt`,...R.errToObj(e)})}ip(e){return this._addCheck({kind:`ip`,...R.errToObj(e)})}cidr(e){return this._addCheck({kind:`cidr`,...R.errToObj(e)})}datetime(e){return typeof e==`string`?this._addCheck({kind:`datetime`,precision:null,offset:!1,local:!1,message:e}):this._addCheck({kind:`datetime`,precision:e?.precision===void 0?null:e?.precision,offset:e?.offset??!1,local:e?.local??!1,...R.errToObj(e?.message)})}date(e){return this._addCheck({kind:`date`,message:e})}time(e){return typeof e==`string`?this._addCheck({kind:`time`,precision:null,message:e}):this._addCheck({kind:`time`,precision:e?.precision===void 0?null:e?.precision,...R.errToObj(e?.message)})}duration(e){return this._addCheck({kind:`duration`,...R.errToObj(e)})}regex(e,t){return this._addCheck({kind:`regex`,regex:e,...R.errToObj(t)})}includes(e,t){return this._addCheck({kind:`includes`,value:e,position:t?.position,...R.errToObj(t?.message)})}startsWith(e,t){return this._addCheck({kind:`startsWith`,value:e,...R.errToObj(t)})}endsWith(e,t){return this._addCheck({kind:`endsWith`,value:e,...R.errToObj(t)})}min(e,t){return this._addCheck({kind:`min`,value:e,...R.errToObj(t)})}max(e,t){return this._addCheck({kind:`max`,value:e,...R.errToObj(t)})}length(e,t){return this._addCheck({kind:`length`,value:e,...R.errToObj(t)})}nonempty(e){return this.min(1,R.errToObj(e))}trim(){return new e({...this._def,checks:[...this._def.checks,{kind:`trim`}]})}toLowerCase(){return new e({...this._def,checks:[...this._def.checks,{kind:`toLowerCase`}]})}toUpperCase(){return new e({...this._def,checks:[...this._def.checks,{kind:`toUpperCase`}]})}get isDatetime(){return!!this._def.checks.find(e=>e.kind===`datetime`)}get isDate(){return!!this._def.checks.find(e=>e.kind===`date`)}get isTime(){return!!this._def.checks.find(e=>e.kind===`time`)}get isDuration(){return!!this._def.checks.find(e=>e.kind===`duration`)}get isEmail(){return!!this._def.checks.find(e=>e.kind===`email`)}get isURL(){return!!this._def.checks.find(e=>e.kind===`url`)}get isEmoji(){return!!this._def.checks.find(e=>e.kind===`emoji`)}get isUUID(){return!!this._def.checks.find(e=>e.kind===`uuid`)}get isNANOID(){return!!this._def.checks.find(e=>e.kind===`nanoid`)}get isCUID(){return!!this._def.checks.find(e=>e.kind===`cuid`)}get isCUID2(){return!!this._def.checks.find(e=>e.kind===`cuid2`)}get isULID(){return!!this._def.checks.find(e=>e.kind===`ulid`)}get isIP(){return!!this._def.checks.find(e=>e.kind===`ip`)}get isCIDR(){return!!this._def.checks.find(e=>e.kind===`cidr`)}get isBase64(){return!!this._def.checks.find(e=>e.kind===`base64`)}get isBase64url(){return!!this._def.checks.find(e=>e.kind===`base64url`)}get minLength(){let e=null;for(let t of this._def.checks)t.kind===`min`&&(e===null||t.value>e)&&(e=t.value);return e}get maxLength(){let e=null;for(let t of this._def.checks)t.kind===`max`&&(e===null||t.valuenew g_({checks:[],typeName:z.ZodString,coerce:e?.coerce??!1,...Wg(e)});function __(e,t){let n=(e.toString().split(`.`)[1]||``).length,r=(t.toString().split(`.`)[1]||``).length,i=n>r?n:r;return Number.parseInt(e.toFixed(i).replace(`.`,``))%Number.parseInt(t.toFixed(i).replace(`.`,``))/10**i}var v_=class e extends Gg{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(e){if(this._def.coerce&&(e.data=Number(e.data)),this._getType(e)!==P.number){let t=this._getOrReturnCtx(e);return I(t,{code:F.invalid_type,expected:P.number,received:t.parsedType}),L}let t,n=new Fg;for(let r of this._def.checks)r.kind===`int`?Dg.isInteger(e.data)||(t=this._getOrReturnCtx(e,t),I(t,{code:F.invalid_type,expected:`integer`,received:`float`,message:r.message}),n.dirty()):r.kind===`min`?(r.inclusive?e.datar.value:e.data>=r.value)&&(t=this._getOrReturnCtx(e,t),I(t,{code:F.too_big,maximum:r.value,type:`number`,inclusive:r.inclusive,exact:!1,message:r.message}),n.dirty()):r.kind===`multipleOf`?__(e.data,r.value)!==0&&(t=this._getOrReturnCtx(e,t),I(t,{code:F.not_multiple_of,multipleOf:r.value,message:r.message}),n.dirty()):r.kind===`finite`?Number.isFinite(e.data)||(t=this._getOrReturnCtx(e,t),I(t,{code:F.not_finite,message:r.message}),n.dirty()):Dg.assertNever(r);return{status:n.value,value:e.data}}gte(e,t){return this.setLimit(`min`,e,!0,R.toString(t))}gt(e,t){return this.setLimit(`min`,e,!1,R.toString(t))}lte(e,t){return this.setLimit(`max`,e,!0,R.toString(t))}lt(e,t){return this.setLimit(`max`,e,!1,R.toString(t))}setLimit(t,n,r,i){return new e({...this._def,checks:[...this._def.checks,{kind:t,value:n,inclusive:r,message:R.toString(i)}]})}_addCheck(t){return new e({...this._def,checks:[...this._def.checks,t]})}int(e){return this._addCheck({kind:`int`,message:R.toString(e)})}positive(e){return this._addCheck({kind:`min`,value:0,inclusive:!1,message:R.toString(e)})}negative(e){return this._addCheck({kind:`max`,value:0,inclusive:!1,message:R.toString(e)})}nonpositive(e){return this._addCheck({kind:`max`,value:0,inclusive:!0,message:R.toString(e)})}nonnegative(e){return this._addCheck({kind:`min`,value:0,inclusive:!0,message:R.toString(e)})}multipleOf(e,t){return this._addCheck({kind:`multipleOf`,value:e,message:R.toString(t)})}finite(e){return this._addCheck({kind:`finite`,message:R.toString(e)})}safe(e){return this._addCheck({kind:`min`,inclusive:!0,value:-(2**53-1),message:R.toString(e)})._addCheck({kind:`max`,inclusive:!0,value:2**53-1,message:R.toString(e)})}get minValue(){let e=null;for(let t of this._def.checks)t.kind===`min`&&(e===null||t.value>e)&&(e=t.value);return e}get maxValue(){let e=null;for(let t of this._def.checks)t.kind===`max`&&(e===null||t.valuee.kind===`int`||e.kind===`multipleOf`&&Dg.isInteger(e.value))}get isFinite(){let e=null,t=null;for(let n of this._def.checks)if(n.kind===`finite`||n.kind===`int`||n.kind===`multipleOf`)return!0;else n.kind===`min`?(t===null||n.value>t)&&(t=n.value):n.kind===`max`&&(e===null||n.valuenew v_({checks:[],typeName:z.ZodNumber,coerce:e?.coerce||!1,...Wg(e)});var y_=class e extends Gg{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(e){if(this._def.coerce)try{e.data=BigInt(e.data)}catch{return this._getInvalidInput(e)}if(this._getType(e)!==P.bigint)return this._getInvalidInput(e);let t,n=new Fg;for(let r of this._def.checks)r.kind===`min`?(r.inclusive?e.datar.value:e.data>=r.value)&&(t=this._getOrReturnCtx(e,t),I(t,{code:F.too_big,type:`bigint`,maximum:r.value,inclusive:r.inclusive,message:r.message}),n.dirty()):r.kind===`multipleOf`?e.data%r.value!==BigInt(0)&&(t=this._getOrReturnCtx(e,t),I(t,{code:F.not_multiple_of,multipleOf:r.value,message:r.message}),n.dirty()):Dg.assertNever(r);return{status:n.value,value:e.data}}_getInvalidInput(e){let t=this._getOrReturnCtx(e);return I(t,{code:F.invalid_type,expected:P.bigint,received:t.parsedType}),L}gte(e,t){return this.setLimit(`min`,e,!0,R.toString(t))}gt(e,t){return this.setLimit(`min`,e,!1,R.toString(t))}lte(e,t){return this.setLimit(`max`,e,!0,R.toString(t))}lt(e,t){return this.setLimit(`max`,e,!1,R.toString(t))}setLimit(t,n,r,i){return new e({...this._def,checks:[...this._def.checks,{kind:t,value:n,inclusive:r,message:R.toString(i)}]})}_addCheck(t){return new e({...this._def,checks:[...this._def.checks,t]})}positive(e){return this._addCheck({kind:`min`,value:BigInt(0),inclusive:!1,message:R.toString(e)})}negative(e){return this._addCheck({kind:`max`,value:BigInt(0),inclusive:!1,message:R.toString(e)})}nonpositive(e){return this._addCheck({kind:`max`,value:BigInt(0),inclusive:!0,message:R.toString(e)})}nonnegative(e){return this._addCheck({kind:`min`,value:BigInt(0),inclusive:!0,message:R.toString(e)})}multipleOf(e,t){return this._addCheck({kind:`multipleOf`,value:e,message:R.toString(t)})}get minValue(){let e=null;for(let t of this._def.checks)t.kind===`min`&&(e===null||t.value>e)&&(e=t.value);return e}get maxValue(){let e=null;for(let t of this._def.checks)t.kind===`max`&&(e===null||t.valuenew y_({checks:[],typeName:z.ZodBigInt,coerce:e?.coerce??!1,...Wg(e)});var b_=class extends Gg{_parse(e){if(this._def.coerce&&(e.data=!!e.data),this._getType(e)!==P.boolean){let t=this._getOrReturnCtx(e);return I(t,{code:F.invalid_type,expected:P.boolean,received:t.parsedType}),L}return Lg(e.data)}};b_.create=e=>new b_({typeName:z.ZodBoolean,coerce:e?.coerce||!1,...Wg(e)});var x_=class e extends Gg{_parse(e){if(this._def.coerce&&(e.data=new Date(e.data)),this._getType(e)!==P.date){let t=this._getOrReturnCtx(e);return I(t,{code:F.invalid_type,expected:P.date,received:t.parsedType}),L}if(Number.isNaN(e.data.getTime()))return I(this._getOrReturnCtx(e),{code:F.invalid_date}),L;let t=new Fg,n;for(let r of this._def.checks)r.kind===`min`?e.data.getTime()r.value&&(n=this._getOrReturnCtx(e,n),I(n,{code:F.too_big,message:r.message,inclusive:!0,exact:!1,maximum:r.value,type:`date`}),t.dirty()):Dg.assertNever(r);return{status:t.value,value:new Date(e.data.getTime())}}_addCheck(t){return new e({...this._def,checks:[...this._def.checks,t]})}min(e,t){return this._addCheck({kind:`min`,value:e.getTime(),message:R.toString(t)})}max(e,t){return this._addCheck({kind:`max`,value:e.getTime(),message:R.toString(t)})}get minDate(){let e=null;for(let t of this._def.checks)t.kind===`min`&&(e===null||t.value>e)&&(e=t.value);return e==null?null:new Date(e)}get maxDate(){let e=null;for(let t of this._def.checks)t.kind===`max`&&(e===null||t.valuenew x_({checks:[],coerce:e?.coerce||!1,typeName:z.ZodDate,...Wg(e)});var S_=class extends Gg{_parse(e){if(this._getType(e)!==P.symbol){let t=this._getOrReturnCtx(e);return I(t,{code:F.invalid_type,expected:P.symbol,received:t.parsedType}),L}return Lg(e.data)}};S_.create=e=>new S_({typeName:z.ZodSymbol,...Wg(e)});var C_=class extends Gg{_parse(e){if(this._getType(e)!==P.undefined){let t=this._getOrReturnCtx(e);return I(t,{code:F.invalid_type,expected:P.undefined,received:t.parsedType}),L}return Lg(e.data)}};C_.create=e=>new C_({typeName:z.ZodUndefined,...Wg(e)});var w_=class extends Gg{_parse(e){if(this._getType(e)!==P.null){let t=this._getOrReturnCtx(e);return I(t,{code:F.invalid_type,expected:P.null,received:t.parsedType}),L}return Lg(e.data)}};w_.create=e=>new w_({typeName:z.ZodNull,...Wg(e)});var T_=class extends Gg{constructor(){super(...arguments),this._any=!0}_parse(e){return Lg(e.data)}};T_.create=e=>new T_({typeName:z.ZodAny,...Wg(e)});var E_=class extends Gg{constructor(){super(...arguments),this._unknown=!0}_parse(e){return Lg(e.data)}};E_.create=e=>new E_({typeName:z.ZodUnknown,...Wg(e)});var D_=class extends Gg{_parse(e){let t=this._getOrReturnCtx(e);return I(t,{code:F.invalid_type,expected:P.never,received:t.parsedType}),L}};D_.create=e=>new D_({typeName:z.ZodNever,...Wg(e)});var O_=class extends Gg{_parse(e){if(this._getType(e)!==P.undefined){let t=this._getOrReturnCtx(e);return I(t,{code:F.invalid_type,expected:P.void,received:t.parsedType}),L}return Lg(e.data)}};O_.create=e=>new O_({typeName:z.ZodVoid,...Wg(e)});var k_=class e extends Gg{_parse(e){let{ctx:t,status:n}=this._processInputParams(e),r=this._def;if(t.parsedType!==P.array)return I(t,{code:F.invalid_type,expected:P.array,received:t.parsedType}),L;if(r.exactLength!==null){let e=t.data.length>r.exactLength.value,i=t.data.lengthr.maxLength.value&&(I(t,{code:F.too_big,maximum:r.maxLength.value,type:`array`,inclusive:!0,exact:!1,message:r.maxLength.message}),n.dirty()),t.common.async)return Promise.all([...t.data].map((e,n)=>r.type._parseAsync(new Hg(t,e,t.path,n)))).then(e=>Fg.mergeArray(n,e));let i=[...t.data].map((e,n)=>r.type._parseSync(new Hg(t,e,t.path,n)));return Fg.mergeArray(n,i)}get element(){return this._def.type}min(t,n){return new e({...this._def,minLength:{value:t,message:R.toString(n)}})}max(t,n){return new e({...this._def,maxLength:{value:t,message:R.toString(n)}})}length(t,n){return new e({...this._def,exactLength:{value:t,message:R.toString(n)}})}nonempty(e){return this.min(1,e)}};k_.create=(e,t)=>new k_({type:e,minLength:null,maxLength:null,exactLength:null,typeName:z.ZodArray,...Wg(t)});function A_(e){if(e instanceof j_){let t={};for(let n in e.shape){let r=e.shape[n];t[n]=Y_.create(A_(r))}return new j_({...e._def,shape:()=>t})}return e instanceof k_?new k_({...e._def,type:A_(e.element)}):e instanceof Y_?Y_.create(A_(e.unwrap())):e instanceof X_?X_.create(A_(e.unwrap())):e instanceof L_?L_.create(e.items.map(e=>A_(e))):e}var j_=class e extends Gg{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;let e=this._def.shape(),t=Dg.objectKeys(e);return this._cached={shape:e,keys:t},this._cached}_parse(e){if(this._getType(e)!==P.object){let t=this._getOrReturnCtx(e);return I(t,{code:F.invalid_type,expected:P.object,received:t.parsedType}),L}let{status:t,ctx:n}=this._processInputParams(e),{shape:r,keys:i}=this._getCached(),a=[];if(!(this._def.catchall instanceof D_&&this._def.unknownKeys===`strip`))for(let e in n.data)i.includes(e)||a.push(e);let o=[];for(let e of i){let t=r[e],i=n.data[e];o.push({key:{status:`valid`,value:e},value:t._parse(new Hg(n,i,n.path,e)),alwaysSet:e in n.data})}if(this._def.catchall instanceof D_){let e=this._def.unknownKeys;if(e===`passthrough`)for(let e of a)o.push({key:{status:`valid`,value:e},value:{status:`valid`,value:n.data[e]}});else if(e===`strict`)a.length>0&&(I(n,{code:F.unrecognized_keys,keys:a}),t.dirty());else if(e!==`strip`)throw Error(`Internal ZodObject error: invalid unknownKeys value.`)}else{let e=this._def.catchall;for(let t of a){let r=n.data[t];o.push({key:{status:`valid`,value:t},value:e._parse(new Hg(n,r,n.path,t)),alwaysSet:t in n.data})}}return n.common.async?Promise.resolve().then(async()=>{let e=[];for(let t of o){let n=await t.key,r=await t.value;e.push({key:n,value:r,alwaysSet:t.alwaysSet})}return e}).then(e=>Fg.mergeObjectSync(t,e)):Fg.mergeObjectSync(t,o)}get shape(){return this._def.shape()}strict(t){return R.errToObj,new e({...this._def,unknownKeys:`strict`,...t===void 0?{}:{errorMap:(e,n)=>{let r=this._def.errorMap?.(e,n).message??n.defaultError;return e.code===`unrecognized_keys`?{message:R.errToObj(t).message??r}:{message:r}}}})}strip(){return new e({...this._def,unknownKeys:`strip`})}passthrough(){return new e({...this._def,unknownKeys:`passthrough`})}extend(t){return new e({...this._def,shape:()=>({...this._def.shape(),...t})})}merge(t){return new e({unknownKeys:t._def.unknownKeys,catchall:t._def.catchall,shape:()=>({...this._def.shape(),...t._def.shape()}),typeName:z.ZodObject})}setKey(e,t){return this.augment({[e]:t})}catchall(t){return new e({...this._def,catchall:t})}pick(t){let n={};for(let e of Dg.objectKeys(t))t[e]&&this.shape[e]&&(n[e]=this.shape[e]);return new e({...this._def,shape:()=>n})}omit(t){let n={};for(let e of Dg.objectKeys(this.shape))t[e]||(n[e]=this.shape[e]);return new e({...this._def,shape:()=>n})}deepPartial(){return A_(this)}partial(t){let n={};for(let e of Dg.objectKeys(this.shape)){let r=this.shape[e];n[e]=t&&!t[e]?r:r.optional()}return new e({...this._def,shape:()=>n})}required(t){let n={};for(let e of Dg.objectKeys(this.shape))if(t&&!t[e])n[e]=this.shape[e];else{let t=this.shape[e];for(;t instanceof Y_;)t=t._def.innerType;n[e]=t}return new e({...this._def,shape:()=>n})}keyof(){return W_(Dg.objectKeys(this.shape))}};j_.create=(e,t)=>new j_({shape:()=>e,unknownKeys:`strip`,catchall:D_.create(),typeName:z.ZodObject,...Wg(t)}),j_.strictCreate=(e,t)=>new j_({shape:()=>e,unknownKeys:`strict`,catchall:D_.create(),typeName:z.ZodObject,...Wg(t)}),j_.lazycreate=(e,t)=>new j_({shape:e,unknownKeys:`strip`,catchall:D_.create(),typeName:z.ZodObject,...Wg(t)});var M_=class extends Gg{_parse(e){let{ctx:t}=this._processInputParams(e),n=this._def.options;function r(e){for(let t of e)if(t.result.status===`valid`)return t.result;for(let n of e)if(n.result.status===`dirty`)return t.common.issues.push(...n.ctx.common.issues),n.result;let n=e.map(e=>new Ag(e.ctx.common.issues));return I(t,{code:F.invalid_union,unionErrors:n}),L}if(t.common.async)return Promise.all(n.map(async e=>{let n={...t,common:{...t.common,issues:[]},parent:null};return{result:await e._parseAsync({data:t.data,path:t.path,parent:n}),ctx:n}})).then(r);{let e,r=[];for(let i of n){let n={...t,common:{...t.common,issues:[]},parent:null},a=i._parseSync({data:t.data,path:t.path,parent:n});if(a.status===`valid`)return a;a.status===`dirty`&&!e&&(e={result:a,ctx:n}),n.common.issues.length&&r.push(n.common.issues)}if(e)return t.common.issues.push(...e.ctx.common.issues),e.result;let i=r.map(e=>new Ag(e));return I(t,{code:F.invalid_union,unionErrors:i}),L}}get options(){return this._def.options}};M_.create=(e,t)=>new M_({options:e,typeName:z.ZodUnion,...Wg(t)});var N_=e=>e instanceof H_?N_(e.schema):e instanceof J_?N_(e.innerType()):e instanceof U_?[e.value]:e instanceof G_?e.options:e instanceof K_?Dg.objectValues(e.enum):e instanceof Z_?N_(e._def.innerType):e instanceof C_?[void 0]:e instanceof w_?[null]:e instanceof Y_?[void 0,...N_(e.unwrap())]:e instanceof X_?[null,...N_(e.unwrap())]:e instanceof ev||e instanceof nv?N_(e.unwrap()):e instanceof Q_?N_(e._def.innerType):[],P_=class e extends Gg{_parse(e){let{ctx:t}=this._processInputParams(e);if(t.parsedType!==P.object)return I(t,{code:F.invalid_type,expected:P.object,received:t.parsedType}),L;let n=this.discriminator,r=t.data[n],i=this.optionsMap.get(r);return i?t.common.async?i._parseAsync({data:t.data,path:t.path,parent:t}):i._parseSync({data:t.data,path:t.path,parent:t}):(I(t,{code:F.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[n]}),L)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(t,n,r){let i=new Map;for(let e of n){let n=N_(e.shape[t]);if(!n.length)throw Error(`A discriminator value for key \`${t}\` could not be extracted from all schema options`);for(let r of n){if(i.has(r))throw Error(`Discriminator property ${String(t)} has duplicate value ${String(r)}`);i.set(r,e)}}return new e({typeName:z.ZodDiscriminatedUnion,discriminator:t,options:n,optionsMap:i,...Wg(r)})}};function F_(e,t){let n=kg(e),r=kg(t);if(e===t)return{valid:!0,data:e};if(n===P.object&&r===P.object){let n=Dg.objectKeys(t),r=Dg.objectKeys(e).filter(e=>n.indexOf(e)!==-1),i={...e,...t};for(let n of r){let r=F_(e[n],t[n]);if(!r.valid)return{valid:!1};i[n]=r.data}return{valid:!0,data:i}}if(n===P.array&&r===P.array){if(e.length!==t.length)return{valid:!1};let n=[];for(let r=0;r{if(Rg(e)||Rg(r))return L;let i=F_(e.value,r.value);return i.valid?((zg(e)||zg(r))&&t.dirty(),{status:t.value,value:i.data}):(I(n,{code:F.invalid_intersection_types}),L)};return n.common.async?Promise.all([this._def.left._parseAsync({data:n.data,path:n.path,parent:n}),this._def.right._parseAsync({data:n.data,path:n.path,parent:n})]).then(([e,t])=>r(e,t)):r(this._def.left._parseSync({data:n.data,path:n.path,parent:n}),this._def.right._parseSync({data:n.data,path:n.path,parent:n}))}};I_.create=(e,t,n)=>new I_({left:e,right:t,typeName:z.ZodIntersection,...Wg(n)});var L_=class e extends Gg{_parse(e){let{status:t,ctx:n}=this._processInputParams(e);if(n.parsedType!==P.array)return I(n,{code:F.invalid_type,expected:P.array,received:n.parsedType}),L;if(n.data.lengththis._def.items.length&&(I(n,{code:F.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:`array`}),t.dirty());let r=[...n.data].map((e,t)=>{let r=this._def.items[t]||this._def.rest;return r?r._parse(new Hg(n,e,n.path,t)):null}).filter(e=>!!e);return n.common.async?Promise.all(r).then(e=>Fg.mergeArray(t,e)):Fg.mergeArray(t,r)}get items(){return this._def.items}rest(t){return new e({...this._def,rest:t})}};L_.create=(e,t)=>{if(!Array.isArray(e))throw Error(`You must pass an array of schemas to z.tuple([ ... ])`);return new L_({items:e,typeName:z.ZodTuple,rest:null,...Wg(t)})};var R_=class e extends Gg{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){let{status:t,ctx:n}=this._processInputParams(e);if(n.parsedType!==P.object)return I(n,{code:F.invalid_type,expected:P.object,received:n.parsedType}),L;let r=[],i=this._def.keyType,a=this._def.valueType;for(let e in n.data)r.push({key:i._parse(new Hg(n,e,n.path,e)),value:a._parse(new Hg(n,n.data[e],n.path,e)),alwaysSet:e in n.data});return n.common.async?Fg.mergeObjectAsync(t,r):Fg.mergeObjectSync(t,r)}get element(){return this._def.valueType}static create(t,n,r){return n instanceof Gg?new e({keyType:t,valueType:n,typeName:z.ZodRecord,...Wg(r)}):new e({keyType:g_.create(),valueType:t,typeName:z.ZodRecord,...Wg(n)})}},z_=class extends Gg{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){let{status:t,ctx:n}=this._processInputParams(e);if(n.parsedType!==P.map)return I(n,{code:F.invalid_type,expected:P.map,received:n.parsedType}),L;let r=this._def.keyType,i=this._def.valueType,a=[...n.data.entries()].map(([e,t],a)=>({key:r._parse(new Hg(n,e,n.path,[a,`key`])),value:i._parse(new Hg(n,t,n.path,[a,`value`]))}));if(n.common.async){let e=new Map;return Promise.resolve().then(async()=>{for(let n of a){let r=await n.key,i=await n.value;if(r.status===`aborted`||i.status===`aborted`)return L;(r.status===`dirty`||i.status===`dirty`)&&t.dirty(),e.set(r.value,i.value)}return{status:t.value,value:e}})}{let e=new Map;for(let n of a){let r=n.key,i=n.value;if(r.status===`aborted`||i.status===`aborted`)return L;(r.status===`dirty`||i.status===`dirty`)&&t.dirty(),e.set(r.value,i.value)}return{status:t.value,value:e}}}};z_.create=(e,t,n)=>new z_({valueType:t,keyType:e,typeName:z.ZodMap,...Wg(n)});var B_=class e extends Gg{_parse(e){let{status:t,ctx:n}=this._processInputParams(e);if(n.parsedType!==P.set)return I(n,{code:F.invalid_type,expected:P.set,received:n.parsedType}),L;let r=this._def;r.minSize!==null&&n.data.sizer.maxSize.value&&(I(n,{code:F.too_big,maximum:r.maxSize.value,type:`set`,inclusive:!0,exact:!1,message:r.maxSize.message}),t.dirty());let i=this._def.valueType;function a(e){let n=new Set;for(let r of e){if(r.status===`aborted`)return L;r.status===`dirty`&&t.dirty(),n.add(r.value)}return{status:t.value,value:n}}let o=[...n.data.values()].map((e,t)=>i._parse(new Hg(n,e,n.path,t)));return n.common.async?Promise.all(o).then(e=>a(e)):a(o)}min(t,n){return new e({...this._def,minSize:{value:t,message:R.toString(n)}})}max(t,n){return new e({...this._def,maxSize:{value:t,message:R.toString(n)}})}size(e,t){return this.min(e,t).max(e,t)}nonempty(e){return this.min(1,e)}};B_.create=(e,t)=>new B_({valueType:e,minSize:null,maxSize:null,typeName:z.ZodSet,...Wg(t)});var V_=class e extends Gg{constructor(){super(...arguments),this.validate=this.implement}_parse(e){let{ctx:t}=this._processInputParams(e);if(t.parsedType!==P.function)return I(t,{code:F.invalid_type,expected:P.function,received:t.parsedType}),L;function n(e,n){return Pg({data:e,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,Ng(),jg].filter(e=>!!e),issueData:{code:F.invalid_arguments,argumentsError:n}})}function r(e,n){return Pg({data:e,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,Ng(),jg].filter(e=>!!e),issueData:{code:F.invalid_return_type,returnTypeError:n}})}let i={errorMap:t.common.contextualErrorMap},a=t.data;if(this._def.returns instanceof q_){let e=this;return Lg(async function(...t){let o=new Ag([]),s=await e._def.args.parseAsync(t,i).catch(e=>{throw o.addIssue(n(t,e)),o}),c=await Reflect.apply(a,this,s);return await e._def.returns._def.type.parseAsync(c,i).catch(e=>{throw o.addIssue(r(c,e)),o})})}{let e=this;return Lg(function(...t){let o=e._def.args.safeParse(t,i);if(!o.success)throw new Ag([n(t,o.error)]);let s=Reflect.apply(a,this,o.data),c=e._def.returns.safeParse(s,i);if(!c.success)throw new Ag([r(s,c.error)]);return c.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...t){return new e({...this._def,args:L_.create(t).rest(E_.create())})}returns(t){return new e({...this._def,returns:t})}implement(e){return this.parse(e)}strictImplement(e){return this.parse(e)}static create(t,n,r){return new e({args:t||L_.create([]).rest(E_.create()),returns:n||E_.create(),typeName:z.ZodFunction,...Wg(r)})}},H_=class extends Gg{get schema(){return this._def.getter()}_parse(e){let{ctx:t}=this._processInputParams(e);return this._def.getter()._parse({data:t.data,path:t.path,parent:t})}};H_.create=(e,t)=>new H_({getter:e,typeName:z.ZodLazy,...Wg(t)});var U_=class extends Gg{_parse(e){if(e.data!==this._def.value){let t=this._getOrReturnCtx(e);return I(t,{received:t.data,code:F.invalid_literal,expected:this._def.value}),L}return{status:`valid`,value:e.data}}get value(){return this._def.value}};U_.create=(e,t)=>new U_({value:e,typeName:z.ZodLiteral,...Wg(t)});function W_(e,t){return new G_({values:e,typeName:z.ZodEnum,...Wg(t)})}var G_=class e extends Gg{_parse(e){if(typeof e.data!=`string`){let t=this._getOrReturnCtx(e),n=this._def.values;return I(t,{expected:Dg.joinValues(n),received:t.parsedType,code:F.invalid_type}),L}if(this._cache||=new Set(this._def.values),!this._cache.has(e.data)){let t=this._getOrReturnCtx(e),n=this._def.values;return I(t,{received:t.data,code:F.invalid_enum_value,options:n}),L}return Lg(e.data)}get options(){return this._def.values}get enum(){let e={};for(let t of this._def.values)e[t]=t;return e}get Values(){let e={};for(let t of this._def.values)e[t]=t;return e}get Enum(){let e={};for(let t of this._def.values)e[t]=t;return e}extract(t,n=this._def){return e.create(t,{...this._def,...n})}exclude(t,n=this._def){return e.create(this.options.filter(e=>!t.includes(e)),{...this._def,...n})}};G_.create=W_;var K_=class extends Gg{_parse(e){let t=Dg.getValidEnumValues(this._def.values),n=this._getOrReturnCtx(e);if(n.parsedType!==P.string&&n.parsedType!==P.number){let e=Dg.objectValues(t);return I(n,{expected:Dg.joinValues(e),received:n.parsedType,code:F.invalid_type}),L}if(this._cache||=new Set(Dg.getValidEnumValues(this._def.values)),!this._cache.has(e.data)){let e=Dg.objectValues(t);return I(n,{received:n.data,code:F.invalid_enum_value,options:e}),L}return Lg(e.data)}get enum(){return this._def.values}};K_.create=(e,t)=>new K_({values:e,typeName:z.ZodNativeEnum,...Wg(t)});var q_=class extends Gg{unwrap(){return this._def.type}_parse(e){let{ctx:t}=this._processInputParams(e);return t.parsedType!==P.promise&&t.common.async===!1?(I(t,{code:F.invalid_type,expected:P.promise,received:t.parsedType}),L):Lg((t.parsedType===P.promise?t.data:Promise.resolve(t.data)).then(e=>this._def.type.parseAsync(e,{path:t.path,errorMap:t.common.contextualErrorMap})))}};q_.create=(e,t)=>new q_({type:e,typeName:z.ZodPromise,...Wg(t)});var J_=class extends Gg{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===z.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(e){let{status:t,ctx:n}=this._processInputParams(e),r=this._def.effect||null,i={addIssue:e=>{I(n,e),e.fatal?t.abort():t.dirty()},get path(){return n.path}};if(i.addIssue=i.addIssue.bind(i),r.type===`preprocess`){let e=r.transform(n.data,i);if(n.common.async)return Promise.resolve(e).then(async e=>{if(t.value===`aborted`)return L;let r=await this._def.schema._parseAsync({data:e,path:n.path,parent:n});return r.status===`aborted`?L:r.status===`dirty`||t.value===`dirty`?Ig(r.value):r});{if(t.value===`aborted`)return L;let r=this._def.schema._parseSync({data:e,path:n.path,parent:n});return r.status===`aborted`?L:r.status===`dirty`||t.value===`dirty`?Ig(r.value):r}}if(r.type===`refinement`){let e=e=>{let t=r.refinement(e,i);if(n.common.async)return Promise.resolve(t);if(t instanceof Promise)throw Error(`Async refinement encountered during synchronous parse operation. Use .parseAsync instead.`);return e};if(n.common.async===!1){let r=this._def.schema._parseSync({data:n.data,path:n.path,parent:n});return r.status===`aborted`?L:(r.status===`dirty`&&t.dirty(),e(r.value),{status:t.value,value:r.value})}return this._def.schema._parseAsync({data:n.data,path:n.path,parent:n}).then(n=>n.status===`aborted`?L:(n.status===`dirty`&&t.dirty(),e(n.value).then(()=>({status:t.value,value:n.value}))))}if(r.type===`transform`){if(n.common.async===!1){let e=this._def.schema._parseSync({data:n.data,path:n.path,parent:n});if(!Bg(e))return L;let a=r.transform(e.value,i);if(a instanceof Promise)throw Error(`Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.`);return{status:t.value,value:a}}return this._def.schema._parseAsync({data:n.data,path:n.path,parent:n}).then(e=>Bg(e)?Promise.resolve(r.transform(e.value,i)).then(e=>({status:t.value,value:e})):L)}Dg.assertNever(r)}};J_.create=(e,t,n)=>new J_({schema:e,typeName:z.ZodEffects,effect:t,...Wg(n)}),J_.createWithPreprocess=(e,t,n)=>new J_({schema:t,effect:{type:`preprocess`,transform:e},typeName:z.ZodEffects,...Wg(n)});var Y_=class extends Gg{_parse(e){return this._getType(e)===P.undefined?Lg(void 0):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}};Y_.create=(e,t)=>new Y_({innerType:e,typeName:z.ZodOptional,...Wg(t)});var X_=class extends Gg{_parse(e){return this._getType(e)===P.null?Lg(null):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}};X_.create=(e,t)=>new X_({innerType:e,typeName:z.ZodNullable,...Wg(t)});var Z_=class extends Gg{_parse(e){let{ctx:t}=this._processInputParams(e),n=t.data;return t.parsedType===P.undefined&&(n=this._def.defaultValue()),this._def.innerType._parse({data:n,path:t.path,parent:t})}removeDefault(){return this._def.innerType}};Z_.create=(e,t)=>new Z_({innerType:e,typeName:z.ZodDefault,defaultValue:typeof t.default==`function`?t.default:()=>t.default,...Wg(t)});var Q_=class extends Gg{_parse(e){let{ctx:t}=this._processInputParams(e),n={...t,common:{...t.common,issues:[]}},r=this._def.innerType._parse({data:n.data,path:n.path,parent:{...n}});return Vg(r)?r.then(e=>({status:`valid`,value:e.status===`valid`?e.value:this._def.catchValue({get error(){return new Ag(n.common.issues)},input:n.data})})):{status:`valid`,value:r.status===`valid`?r.value:this._def.catchValue({get error(){return new Ag(n.common.issues)},input:n.data})}}removeCatch(){return this._def.innerType}};Q_.create=(e,t)=>new Q_({innerType:e,typeName:z.ZodCatch,catchValue:typeof t.catch==`function`?t.catch:()=>t.catch,...Wg(t)});var $_=class extends Gg{_parse(e){if(this._getType(e)!==P.nan){let t=this._getOrReturnCtx(e);return I(t,{code:F.invalid_type,expected:P.nan,received:t.parsedType}),L}return{status:`valid`,value:e.data}}};$_.create=e=>new $_({typeName:z.ZodNaN,...Wg(e)});var ev=class extends Gg{_parse(e){let{ctx:t}=this._processInputParams(e),n=t.data;return this._def.type._parse({data:n,path:t.path,parent:t})}unwrap(){return this._def.type}},tv=class e extends Gg{_parse(e){let{status:t,ctx:n}=this._processInputParams(e);if(n.common.async)return(async()=>{let e=await this._def.in._parseAsync({data:n.data,path:n.path,parent:n});return e.status===`aborted`?L:e.status===`dirty`?(t.dirty(),Ig(e.value)):this._def.out._parseAsync({data:e.value,path:n.path,parent:n})})();{let e=this._def.in._parseSync({data:n.data,path:n.path,parent:n});return e.status===`aborted`?L:e.status===`dirty`?(t.dirty(),{status:`dirty`,value:e.value}):this._def.out._parseSync({data:e.value,path:n.path,parent:n})}}static create(t,n){return new e({in:t,out:n,typeName:z.ZodPipeline})}},nv=class extends Gg{_parse(e){let t=this._def.innerType._parse(e),n=e=>(Bg(e)&&(e.value=Object.freeze(e.value)),e);return Vg(t)?t.then(e=>n(e)):n(t)}unwrap(){return this._def.innerType}};nv.create=(e,t)=>new nv({innerType:e,typeName:z.ZodReadonly,...Wg(t)}),j_.lazycreate;var z;(function(e){e.ZodString=`ZodString`,e.ZodNumber=`ZodNumber`,e.ZodNaN=`ZodNaN`,e.ZodBigInt=`ZodBigInt`,e.ZodBoolean=`ZodBoolean`,e.ZodDate=`ZodDate`,e.ZodSymbol=`ZodSymbol`,e.ZodUndefined=`ZodUndefined`,e.ZodNull=`ZodNull`,e.ZodAny=`ZodAny`,e.ZodUnknown=`ZodUnknown`,e.ZodNever=`ZodNever`,e.ZodVoid=`ZodVoid`,e.ZodArray=`ZodArray`,e.ZodObject=`ZodObject`,e.ZodUnion=`ZodUnion`,e.ZodDiscriminatedUnion=`ZodDiscriminatedUnion`,e.ZodIntersection=`ZodIntersection`,e.ZodTuple=`ZodTuple`,e.ZodRecord=`ZodRecord`,e.ZodMap=`ZodMap`,e.ZodSet=`ZodSet`,e.ZodFunction=`ZodFunction`,e.ZodLazy=`ZodLazy`,e.ZodLiteral=`ZodLiteral`,e.ZodEnum=`ZodEnum`,e.ZodEffects=`ZodEffects`,e.ZodNativeEnum=`ZodNativeEnum`,e.ZodOptional=`ZodOptional`,e.ZodNullable=`ZodNullable`,e.ZodDefault=`ZodDefault`,e.ZodCatch=`ZodCatch`,e.ZodPromise=`ZodPromise`,e.ZodBranded=`ZodBranded`,e.ZodPipeline=`ZodPipeline`,e.ZodReadonly=`ZodReadonly`})(z||={});var B=g_.create,rv=v_.create;$_.create,y_.create;var iv=b_.create;x_.create,S_.create,C_.create,w_.create;var av=T_.create,ov=E_.create;D_.create,O_.create;var sv=k_.create,cv=j_.create;j_.strictCreate;var lv=M_.create,uv=P_.create;I_.create,L_.create;var dv=R_.create;z_.create,B_.create,V_.create,H_.create;var V=U_.create,fv=G_.create,pv=K_.create;q_.create,J_.create,Y_.create,X_.create,J_.createWithPreprocess,tv.create;var mv=qe(),hv=cv({name:B(),arguments:B()}),gv=cv({id:B(),type:V(`function`),function:hv,encryptedValue:B().optional()}),_v=cv({id:B(),role:B(),content:B().optional(),name:B().optional(),encryptedValue:B().optional()}),vv=cv({type:V(`text`),text:B()}),yv=uv(`type`,[cv({type:V(`data`),value:B(),mimeType:B()}),cv({type:V(`url`),value:B(),mimeType:B().optional()})]),bv=cv({type:V(`image`),source:yv,metadata:ov().optional()}),xv=cv({type:V(`audio`),source:yv,metadata:ov().optional()}),Sv=cv({type:V(`video`),source:yv,metadata:ov().optional()}),Cv=cv({type:V(`document`),source:yv,metadata:ov().optional()}),wv=cv({type:V(`binary`),mimeType:B(),id:B().optional(),url:B().optional(),data:B().optional(),filename:B().optional()}),Tv=(e,t)=>{!e.id&&!e.url&&!e.data&&t.addIssue({code:F.custom,message:`BinaryInputContent requires at least one of id, url, or data.`,path:[`id`]})};wv.superRefine((e,t)=>{Tv(e,t)});var Ev=uv(`type`,[vv,bv,xv,Sv,Cv,wv]).superRefine((e,t)=>{e.type===`binary`&&Tv(e,t)}),Dv=uv(`role`,[_v.extend({role:V(`developer`),content:B()}),_v.extend({role:V(`system`),content:B()}),_v.extend({role:V(`assistant`),content:B().optional(),toolCalls:sv(gv).optional()}),_v.extend({role:V(`user`),content:lv([B(),sv(Ev)])}),cv({id:B(),content:B(),role:V(`tool`),toolCallId:B(),error:B().optional(),encryptedValue:B().optional()}),cv({id:B(),role:V(`activity`),activityType:B(),content:dv(av())}),cv({id:B(),role:V(`reasoning`),content:B(),encryptedValue:B().optional()})]);lv([V(`developer`),V(`system`),V(`assistant`),V(`user`),V(`tool`),V(`activity`),V(`reasoning`)]);var Ov=cv({description:B(),value:B()}),kv=cv({name:B(),description:B(),parameters:av(),metadata:dv(av()).optional()}),Av=cv({id:B(),reason:B(),message:B().optional(),toolCallId:B().optional(),responseSchema:dv(av()).optional(),expiresAt:B().optional(),metadata:dv(av()).optional()}),jv=cv({interruptId:B(),status:fv([`resolved`,`cancelled`]),payload:av().optional()}),Mv=cv({threadId:B(),runId:B(),parentRunId:B().optional(),state:av(),messages:sv(Dv),tools:sv(kv),context:sv(Ov),forwardedProps:av(),resume:sv(jv).optional()}),Nv=av(),Pv=class extends Error{constructor(e){super(e)}},Fv=class extends Pv{constructor(){super(`Connect not implemented. This method is not supported by the current agent.`)}},Iv=cv({name:B(),description:B().optional()}),Lv=cv({name:B().optional(),type:B().optional(),description:B().optional(),version:B().optional(),provider:B().optional(),documentationUrl:B().optional(),metadata:dv(ov()).optional()}),Rv=cv({streaming:iv().optional(),websocket:iv().optional(),httpBinary:iv().optional(),pushNotifications:iv().optional(),resumable:iv().optional()}),zv=cv({supported:iv().optional(),items:sv(kv).optional(),parallelCalls:iv().optional(),clientProvided:iv().optional()}),Bv=cv({structuredOutput:iv().optional(),supportedMimeTypes:sv(B()).optional()}),Vv=cv({snapshots:iv().optional(),deltas:iv().optional(),memory:iv().optional(),persistentState:iv().optional()}),Hv=cv({supported:iv().optional(),delegation:iv().optional(),handoffs:iv().optional(),subAgents:sv(Iv).optional()}),Uv=cv({supported:iv().optional(),streaming:iv().optional(),encrypted:iv().optional()}),Wv=cv({image:iv().optional(),audio:iv().optional(),video:iv().optional(),pdf:iv().optional(),file:iv().optional()}),Gv=cv({image:iv().optional(),audio:iv().optional()}),Kv=cv({input:Wv.optional(),output:Gv.optional()}),qv=cv({codeExecution:iv().optional(),sandboxed:iv().optional(),maxIterations:rv().optional(),maxExecutionTime:rv().optional()}),Jv=cv({supported:iv().optional(),approvals:iv().optional(),interventions:iv().optional(),feedback:iv().optional(),interrupts:iv().optional(),approveWithEdits:iv().optional()});cv({identity:Lv.optional(),transport:Rv.optional(),tools:zv.optional(),output:Bv.optional(),state:Vv.optional(),multiAgent:Hv.optional(),reasoning:Uv.optional(),multimodal:Kv.optional(),execution:qv.optional(),humanInTheLoop:Jv.optional(),custom:dv(ov()).optional()});var Yv=lv([V(`developer`),V(`system`),V(`assistant`),V(`user`)]),H=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.THINKING_START=`THINKING_START`,e.THINKING_END=`THINKING_END`,e.THINKING_TEXT_MESSAGE_START=`THINKING_TEXT_MESSAGE_START`,e.THINKING_TEXT_MESSAGE_CONTENT=`THINKING_TEXT_MESSAGE_CONTENT`,e.THINKING_TEXT_MESSAGE_END=`THINKING_TEXT_MESSAGE_END`,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}({}),Xv=cv({type:pv(H),timestamp:rv().optional(),rawEvent:av().optional()}).passthrough(),Zv=Xv.extend({type:V(H.TEXT_MESSAGE_START),messageId:B(),role:Yv.default(`assistant`),name:B().optional()}),Qv=Xv.extend({type:V(H.TEXT_MESSAGE_CONTENT),messageId:B(),delta:B()}),$v=Xv.extend({type:V(H.TEXT_MESSAGE_END),messageId:B()}),ey=Xv.extend({type:V(H.TEXT_MESSAGE_CHUNK),messageId:B().optional(),role:Yv.optional(),delta:B().optional(),name:B().optional()}),ty=Xv.extend({type:V(H.THINKING_TEXT_MESSAGE_START)}),ny=Qv.omit({messageId:!0,type:!0}).extend({type:V(H.THINKING_TEXT_MESSAGE_CONTENT)}),ry=Xv.extend({type:V(H.THINKING_TEXT_MESSAGE_END)}),iy=Xv.extend({type:V(H.TOOL_CALL_START),toolCallId:B(),toolCallName:B(),parentMessageId:B().nullable().optional().transform(e=>e??void 0)}),ay=Xv.extend({type:V(H.TOOL_CALL_ARGS),toolCallId:B(),delta:B()}),oy=Xv.extend({type:V(H.TOOL_CALL_END),toolCallId:B()}),sy=Xv.extend({messageId:B(),type:V(H.TOOL_CALL_RESULT),toolCallId:B(),content:B(),role:V(`tool`).optional()}),cy=Xv.extend({type:V(H.TOOL_CALL_CHUNK),toolCallId:B().optional(),toolCallName:B().optional(),parentMessageId:B().nullable().optional().transform(e=>e??void 0),delta:B().optional()}),ly=Xv.extend({type:V(H.THINKING_START),title:B().optional()}),uy=Xv.extend({type:V(H.THINKING_END)}),dy=Xv.extend({type:V(H.STATE_SNAPSHOT),snapshot:Nv}),fy=Xv.extend({type:V(H.STATE_DELTA),delta:sv(av())}),py=Xv.extend({type:V(H.MESSAGES_SNAPSHOT),messages:sv(Dv)}),my=Xv.extend({type:V(H.ACTIVITY_SNAPSHOT),messageId:B(),activityType:B(),content:dv(av()),replace:iv().optional().default(!0)}),hy=Xv.extend({type:V(H.ACTIVITY_DELTA),messageId:B(),activityType:B(),patch:sv(av())}),gy=Xv.extend({type:V(H.RAW),event:av(),source:B().optional()}),_y=Xv.extend({type:V(H.CUSTOM),name:B(),value:av()}),vy=Xv.extend({type:V(H.RUN_STARTED),threadId:B(),runId:B(),parentRunId:B().optional(),input:Mv.optional()}),yy=uv(`type`,[cv({type:V(`success`)}).strict(),cv({type:V(`interrupt`),interrupts:sv(Av).min(1)}).strict()]),by=cv({provider:B().optional(),model:B().optional(),inputTokens:rv().int().nonnegative().optional(),outputTokens:rv().int().nonnegative().optional(),totalTokens:rv().int().nonnegative().optional(),reasoningTokens:rv().int().nonnegative().optional(),cachedInputTokens:rv().int().nonnegative().optional()}),xy=Xv.extend({type:V(H.RUN_FINISHED),threadId:B(),runId:B(),result:av().optional(),outcome:yy.nullable().optional().transform(e=>e??void 0),usage:sv(by).optional()}),Sy=Xv.extend({type:V(H.RUN_ERROR),message:B(),code:B().optional(),usage:sv(by).optional()}),Cy=Xv.extend({type:V(H.STEP_STARTED),stepName:B()}),wy=Xv.extend({type:V(H.STEP_FINISHED),stepName:B()}),Ty=lv([V(`tool-call`),V(`message`)]),Ey=uv(`type`,[Zv,Qv,$v,ey,ly,uy,ty,ny,ry,iy,ay,oy,cy,sy,dy,fy,py,my,hy,gy,_y,vy,xy,Sy,Cy,wy,Xv.extend({type:V(H.REASONING_START),messageId:B()}),Xv.extend({type:V(H.REASONING_MESSAGE_START),messageId:B(),role:V(`reasoning`)}),Xv.extend({type:V(H.REASONING_MESSAGE_CONTENT),messageId:B(),delta:B()}),Xv.extend({type:V(H.REASONING_MESSAGE_END),messageId:B()}),Xv.extend({type:V(H.REASONING_MESSAGE_CHUNK),messageId:B().optional(),delta:B().optional()}),Xv.extend({type:V(H.REASONING_END),messageId:B()}),Xv.extend({type:V(H.REASONING_ENCRYPTED_VALUE),subtype:Ty,entityId:B(),encryptedValue:B()})]),Dy=(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)}})(),Oy=Object.prototype.hasOwnProperty;function ky(e,t){return Oy.call(e,t)}function Ay(e){if(Array.isArray(e)){for(var t=Array(e.length),n=0;n=48&&r<=57){t++;continue}return!1}return!0}function Ny(e){return e.indexOf(`/`)===-1&&e.indexOf(`~`)===-1?e:e.replace(/~/g,`~0`).replace(/\//g,`~1`)}function Py(e){return e.replace(/~1/g,`/`).replace(/~0/g,`~`)}function Fy(e){if(e===void 0)return!0;if(e){if(Array.isArray(e)){for(var t=0,n=e.length;tzy,_areEquals:()=>Yy,applyOperation:()=>Wy,applyPatch:()=>Gy,applyReducer:()=>Ky,deepClone:()=>By,getValueByPointer:()=>Uy,validate:()=>Jy,validator:()=>qy}),zy=Ly,By=jy,Vy={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=Uy(n,this.path);r&&=jy(r);var i=Wy(n,{op:`remove`,path:this.from}).removed;return Wy(n,{op:`add`,path:this.path,value:i}),{newDocument:n,removed:r}},copy:function(e,t,n){var r=Uy(n,this.from);return Wy(n,{op:`add`,path:this.path,value:jy(r)}),{newDocument:n}},test:function(e,t,n){return{newDocument:n,test:Yy(e[t],this.value)}},_get:function(e,t,n){return this.value=e[t],{newDocument:n}}},Hy={add:function(e,t,n){return My(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:Vy.move,copy:Vy.copy,test:Vy.test,_get:Vy._get};function Uy(e,t){if(t==``)return e;var n={op:`_get`,path:t};return Wy(e,n),n.value}function Wy(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):qy(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=Uy(e,t.from),t.op===`move`&&(o.removed=e),o;if(t.op===`test`){if(o.test=Yy(e,t.value),o.test===!1)throw new zy(`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 zy("Operation `op` property is not one of operations defined in RFC-6902",`OPERATION_OP_INVALID`,a,t,e);return o}r||(e=jy(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:qy;;){if(f=s[l],f&&f.indexOf(`~`)!=-1&&(f=Py(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&&!My(f))throw new zy(`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 My(f)&&(f=~~f);if(l>=u){if(n&&t.op===`add`&&f>c.length)throw new zy(`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=Hy[t.op].call(t,c,f,e);if(o.test===!1)throw new zy(`Test operation failed`,`TEST_OPERATION_FAILED`,a,t,e);return o}}else if(l>=u){var o=Vy[t.op].call(t,c,f,e);if(o.test===!1)throw new zy(`Test operation failed`,`TEST_OPERATION_FAILED`,a,t,e);return o}if(c=c[f],n&&l0)throw new zy('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 zy("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 zy("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`)&&Fy(e.value))throw new zy("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 zy("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 zy(`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=Jy([{op:`_get`,path:e.from,value:void 0}],n);if(o&&o.name===`OPERATION_PATH_UNRESOLVABLE`)throw new zy(`Cannot perform the operation from a path that does not exist`,`OPERATION_FROM_UNRESOLVABLE`,t,e,n)}}}function Jy(e,t,n){try{if(!Array.isArray(e))throw new zy(`Patch sequence must be an array`,`SEQUENCE_NOT_AN_ARRAY`);if(t)Gy(jy(t),jy(e),n||!0);else{n||=qy;for(var r=0;rsb,generate:()=>ab,observe:()=>ib,unobserve:()=>rb}),Zy=new WeakMap,Qy=function(){function e(e){this.observers=new Map,this.obj=e}return e}(),$y=function(){function e(e,t){this.callback=e,this.observer=t}return e}();function eb(e){return Zy.get(e)}function tb(e,t){return e.observers.get(t)}function nb(e,t){e.observers.delete(t.callback)}function rb(e,t){t.unobserve()}function ib(e,t){var n=[],r,i=eb(e);if(!i)i=new Qy(e),Zy.set(e,i);else{var a=tb(i,t);r=a&&a.observer}if(r)return r;if(r={},i.value=jy(e),t){r.callback=t,r.next=null;var o=function(){ab(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(){ab(r),clearTimeout(r.next),nb(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 $y(t,r)),r}function ab(e,t){t===void 0&&(t=!1);var n=Zy.get(e.object);ob(n.value,e.object,e.patches,``,t),e.patches.length&&Gy(n.value,e.patches);var r=e.patches;return r.length>0&&(e.patches=[],e.callback&&e.callback(r)),r}function ob(e,t,n,r,i){if(t!==e){typeof t.toJSON==`function`&&(t=t.toJSON());for(var a=Ay(t),o=Ay(e),s=!1,c=o.length-1;c>=0;c--){var l=o[c],u=e[l];if(ky(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)?ob(u,d,n,r+`/`+Ny(l),i):u!==d&&(i&&n.push({op:`test`,path:r+`/`+Ny(l),value:jy(u)}),n.push({op:`replace`,path:r+`/`+Ny(l),value:jy(d)}))}else Array.isArray(e)===Array.isArray(t)?(i&&n.push({op:`test`,path:r+`/`+Ny(l),value:jy(u)}),n.push({op:`remove`,path:r+`/`+Ny(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},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?mb:(this.currentObservers=null,a.push(e),new pb(function(){t.currentObservers=null,fb(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 Vb;return e.source=this,e},t.create=function(e,t){return new Zb(e,t)},t}(Vb),Zb=function(e){rf(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)??mb},t}(Xb),Qb={now:function(){return(Qb.delegate||Date).now()},delegate:void 0},$b=function(e){rf(t,e);function t(t,n,r){t===void 0&&(t=1/0),n===void 0&&(n=1/0),r===void 0&&(r=Qb);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 Xx(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():Yx(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`:Yx(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 Zx(){let e=0,t=0;for(let n=0;n<28;n+=7){let r=this.buf[this.pos++];if(e|=(r&127)<>4,!(n&128))return this.assertBounds(),[e,t];for(let n=3;n<=31;n+=7){let r=this.buf[this.pos++];if(t|=(r&127)<>>r,a=!(!(i>>>7)&&t==0),o=(a?i|128:i)&255;if(n.push(o),!a)return}let r=e>>>28&15|(t&7)<<4,i=!!(t>>3);if(n.push((i?r|128:r)&255),i){for(let e=3;e<31;e+=7){let r=t>>>e,i=!!(r>>>7),a=(i?r|128:r)&255;if(n.push(a),!i)return}n.push(t>>>31&1)}}var $x=4294967296;function eS(e){let t=e[0]===`-`;t&&(e=e.slice(1));let n=1e6,r=0,i=0;function a(t,a){let o=Number(e.slice(t,a));i*=n,r=r*n+o,r>=$x&&(i+=r/$x|0,r%=$x)}return a(-24,-18),a(-18,-12),a(-12,-6),a(-6),t?aS(r,i):iS(r,i)}function tS(e,t){let n=iS(e,t),r=n.hi&2147483648;r&&(n=aS(n.lo,n.hi));let i=nS(n.lo,n.hi);return r?`-`+i:i}function nS(e,t){if({lo:e,hi:t}=rS(e,t),t<=2097151)return String($x*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 rS(e,t){return{lo:e>>>0,hi:t>>>0}}function iS(e,t){return{lo:e|0,hi:t|0}}function aS(e,t){return t=~t,e?e=~e+1:t+=1,iS(e,t)}var oS=e=>{let t=String(e);return`0000000`.slice(t.length)+t};function sS(e,t){if(e>=0){for(;e>127;)t.push(e&127|128),e>>>=7;t.push(e)}else{for(let n=0;n<9;n++)t.push(e&127|128),e>>=7;t.push(1)}}function cS(){let e=this.buf[this.pos++],t=e&127;if(!(e&128)||(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 lS=uS();function uS(){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||t>>0)}raw(e){return this.buf.length&&(this.chunks.push(new Uint8Array(this.buf)),this.buf=[]),this.chunks.push(e),this}uint32(e){for(vS(e);e>127;)this.buf.push(e&127|128),e>>>=7;return this.buf.push(e),this}int32(e){return _S(e),sS(e,this.buf),this}bool(e){return this.buf.push(+!!e),this}bytes(e){return this.uint32(e.byteLength),this.raw(e)}string(e){let t=this.encodeUtf8(e);return this.uint32(t.byteLength),this.raw(t)}float(e){yS(e);let t=new Uint8Array(4);return new DataView(t.buffer).setFloat32(0,e,!0),this.raw(t)}double(e){let t=new Uint8Array(8);return new DataView(t.buffer).setFloat64(0,e,!0),this.raw(t)}fixed32(e){vS(e);let t=new Uint8Array(4);return new DataView(t.buffer).setUint32(0,e,!0),this.raw(t)}sfixed32(e){_S(e);let t=new Uint8Array(4);return new DataView(t.buffer).setInt32(0,e,!0),this.raw(t)}sint32(e){return _S(e),e=(e<<1^e>>31)>>>0,sS(e,this.buf),this}sfixed64(e){let t=new Uint8Array(8),n=new DataView(t.buffer),r=lS.enc(e);return n.setInt32(0,r.lo,!0),n.setInt32(4,r.hi,!0),this.raw(t)}fixed64(e){let t=new Uint8Array(8),n=new DataView(t.buffer),r=lS.uEnc(e);return n.setInt32(0,r.lo,!0),n.setInt32(4,r.hi,!0),this.raw(t)}int64(e){let t=lS.enc(e);return Qx(t.lo,t.hi,this.buf),this}sint64(e){let t=lS.enc(e),n=t.hi>>31;return Qx(t.lo<<1^n,(t.hi<<1|t.lo>>>31)^n,this.buf),this}uint64(e){let t=lS.uEnc(e);return Qx(t.lo,t.hi,this.buf),this}},U=class{constructor(e,t=mS().decodeUtf8){this.decodeUtf8=t,this.varint64=Zx,this.uint32=cS,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 hS.Varint:for(;this.buf[this.pos++]&128;);break;case hS.Bit64:this.pos+=4;case hS.Bit32:this.pos+=4;break;case hS.LengthDelimited:let r=this.uint32();this.pos+=r;break;case hS.StartGroup:if(n<=0)throw Error(`maximum recursion depth reached`);for(;;){let[e,r]=this.tag();if(r===hS.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 lS.dec(...this.varint64())}uint64(){return lS.uDec(...this.varint64())}sint64(){let[e,t]=this.varint64(),n=-(e&1);return e=(e>>>1|(t&1)<<31)^n,t=t>>>1^n,lS.dec(e,t)}bool(){let[e,t]=this.varint64();return e!==0||t!==0}fixed32(){return this.view.getUint32((this.pos+=4)-4,!0)}sfixed32(){return this.view.getInt32((this.pos+=4)-4,!0)}fixed64(){return lS.uDec(this.sfixed32(),this.sfixed32())}sfixed64(){return lS.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){return this.decodeUtf8(this.bytes(),e)}};function _S(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 vS(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 yS(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(e)&&(e>34028234663852886e22||e<-34028234663852886e22))throw Error(`invalid float32: `+e)}var bS=function(e){return e[e.NULL_VALUE=0]=`NULL_VALUE`,e[e.UNRECOGNIZED=-1]=`UNRECOGNIZED`,e}({});function xS(){return{fields:{}}}var SS={encode(e,t=new gS){return Object.entries(e.fields).forEach(([e,n])=>{n!==void 0&&wS.encode({key:e,value:n},t.uint32(10).fork()).join()}),t},decode(e,t){let n=e instanceof U?e:new U(e),r=t===void 0?n.len:n.pos+t,i=xS();for(;n.pos>>3){case 1:{if(e!==10)break;let t=wS.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 SS.fromPartial(e??{})},fromPartial(e){let t=xS();return t.fields=Object.entries(e.fields??{}).reduce((e,[t,n])=>(n!==void 0&&(e[t]=n),e),{}),t},wrap(e){let t=xS();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 CS(){return{key:``,value:void 0}}var wS={encode(e,t=new gS){return e.key!==``&&t.uint32(10).string(e.key),e.value!==void 0&&W.encode(W.wrap(e.value),t.uint32(18).fork()).join(),t},decode(e,t){let n=e instanceof U?e:new U(e),r=t===void 0?n.len:n.pos+t,i=CS();for(;n.pos>>3){case 1:if(e!==10)break;i.key=n.string();continue;case 2:if(e!==18)break;i.value=W.unwrap(W.decode(n,n.uint32()));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.key=e.key??``,t.value=e.value??void 0,t}};function TS(){return{nullValue:void 0,numberValue:void 0,stringValue:void 0,boolValue:void 0,structValue:void 0,listValue:void 0}}var W={encode(e,t=new gS){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&&SS.encode(SS.wrap(e.structValue),t.uint32(42).fork()).join(),e.listValue!==void 0&&DS.encode(DS.wrap(e.listValue),t.uint32(50).fork()).join(),t},decode(e,t){let n=e instanceof U?e:new U(e),r=t===void 0?n.len:n.pos+t,i=TS();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=SS.unwrap(SS.decode(n,n.uint32()));continue;case 6:if(e!==50)break;i.listValue=DS.unwrap(DS.decode(n,n.uint32()));continue}if((e&7)==4||e===0)break;n.skip(e&7)}return i},create(e){return W.fromPartial(e??{})},fromPartial(e){let t=TS();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=TS();if(e===null)t.nullValue=bS.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 ES(){return{values:[]}}var DS={encode(e,t=new gS){for(let n of e.values)W.encode(W.wrap(n),t.uint32(10).fork()).join();return t},decode(e,t){let n=e instanceof U?e:new U(e),r=t===void 0?n.len:n.pos+t,i=ES();for(;n.pos>>3){case 1:if(e!==10)break;i.values.push(W.unwrap(W.decode(n,n.uint32())));continue}if((e&7)==4||e===0)break;n.skip(e&7)}return i},create(e){return DS.fromPartial(e??{})},fromPartial(e){let t=ES();return t.values=e.values?.map(e=>e)||[],t},wrap(e){let t=ES();return t.values=e??[],t},unwrap(e){return e?.hasOwnProperty(`values`)&&globalThis.Array.isArray(e.values)?e.values:e}},OS=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 kS(){return{op:0,path:``,from:void 0,value:void 0}}var AS={encode(e,t=new gS){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&&W.encode(W.wrap(e.value),t.uint32(34).fork()).join(),t},decode(e,t){let n=e instanceof U?e:new U(e),r=t===void 0?n.len:n.pos+t,i=kS();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=W.unwrap(W.decode(n,n.uint32()));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.op=e.op??0,t.path=e.path??``,t.from=e.from??void 0,t.value=e.value??void 0,t}};function jS(){return{id:``,type:``,function:void 0}}var MS={encode(e,t=new gS){return e.id!==``&&t.uint32(10).string(e.id),e.type!==``&&t.uint32(18).string(e.type),e.function!==void 0&&PS.encode(e.function,t.uint32(26).fork()).join(),t},decode(e,t){let n=e instanceof U?e:new U(e),r=t===void 0?n.len:n.pos+t,i=jS();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=PS.decode(n,n.uint32());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.id=e.id??``,t.type=e.type??``,t.function=e.function!==void 0&&e.function!==null?PS.fromPartial(e.function):void 0,t}};function NS(){return{name:``,arguments:``}}var PS={encode(e,t=new gS){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 U?e:new U(e),r=t===void 0?n.len:n.pos+t,i=NS();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 PS.fromPartial(e??{})},fromPartial(e){let t=NS();return t.name=e.name??``,t.arguments=e.arguments??``,t}};function FS(){return{value:``,mimeType:``}}var IS={encode(e,t=new gS){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 U?e:new U(e),r=t===void 0?n.len:n.pos+t,i=FS();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 IS.fromPartial(e??{})},fromPartial(e){let t=FS();return t.value=e.value??``,t.mimeType=e.mimeType??``,t}};function LS(){return{value:``,mimeType:void 0}}var RS={encode(e,t=new gS){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 U?e:new U(e),r=t===void 0?n.len:n.pos+t,i=LS();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 RS.fromPartial(e??{})},fromPartial(e){let t=LS();return t.value=e.value??``,t.mimeType=e.mimeType??void 0,t}};function zS(){return{data:void 0,url:void 0}}var BS={encode(e,t=new gS){return e.data!==void 0&&IS.encode(e.data,t.uint32(10).fork()).join(),e.url!==void 0&&RS.encode(e.url,t.uint32(18).fork()).join(),t},decode(e,t){let n=e instanceof U?e:new U(e),r=t===void 0?n.len:n.pos+t,i=zS();for(;n.pos>>3){case 1:if(e!==10)break;i.data=IS.decode(n,n.uint32());continue;case 2:if(e!==18)break;i.url=RS.decode(n,n.uint32());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.data=e.data!==void 0&&e.data!==null?IS.fromPartial(e.data):void 0,t.url=e.url!==void 0&&e.url!==null?RS.fromPartial(e.url):void 0,t}};function VS(){return{text:``}}var HS={encode(e,t=new gS){return e.text!==``&&t.uint32(10).string(e.text),t},decode(e,t){let n=e instanceof U?e:new U(e),r=t===void 0?n.len:n.pos+t,i=VS();for(;n.pos>>3){case 1:if(e!==10)break;i.text=n.string();continue}if((e&7)==4||e===0)break;n.skip(e&7)}return i},create(e){return HS.fromPartial(e??{})},fromPartial(e){let t=VS();return t.text=e.text??``,t}};function US(){return{source:void 0,metadata:void 0}}var WS={encode(e,t=new gS){return e.source!==void 0&&BS.encode(e.source,t.uint32(10).fork()).join(),e.metadata!==void 0&&W.encode(W.wrap(e.metadata),t.uint32(18).fork()).join(),t},decode(e,t){let n=e instanceof U?e:new U(e),r=t===void 0?n.len:n.pos+t,i=US();for(;n.pos>>3){case 1:if(e!==10)break;i.source=BS.decode(n,n.uint32());continue;case 2:if(e!==18)break;i.metadata=W.unwrap(W.decode(n,n.uint32()));continue}if((e&7)==4||e===0)break;n.skip(e&7)}return i},create(e){return WS.fromPartial(e??{})},fromPartial(e){let t=US();return t.source=e.source!==void 0&&e.source!==null?BS.fromPartial(e.source):void 0,t.metadata=e.metadata??void 0,t}};function GS(){return{source:void 0,metadata:void 0}}var KS={encode(e,t=new gS){return e.source!==void 0&&BS.encode(e.source,t.uint32(10).fork()).join(),e.metadata!==void 0&&W.encode(W.wrap(e.metadata),t.uint32(18).fork()).join(),t},decode(e,t){let n=e instanceof U?e:new U(e),r=t===void 0?n.len:n.pos+t,i=GS();for(;n.pos>>3){case 1:if(e!==10)break;i.source=BS.decode(n,n.uint32());continue;case 2:if(e!==18)break;i.metadata=W.unwrap(W.decode(n,n.uint32()));continue}if((e&7)==4||e===0)break;n.skip(e&7)}return i},create(e){return KS.fromPartial(e??{})},fromPartial(e){let t=GS();return t.source=e.source!==void 0&&e.source!==null?BS.fromPartial(e.source):void 0,t.metadata=e.metadata??void 0,t}};function qS(){return{source:void 0,metadata:void 0}}var JS={encode(e,t=new gS){return e.source!==void 0&&BS.encode(e.source,t.uint32(10).fork()).join(),e.metadata!==void 0&&W.encode(W.wrap(e.metadata),t.uint32(18).fork()).join(),t},decode(e,t){let n=e instanceof U?e:new U(e),r=t===void 0?n.len:n.pos+t,i=qS();for(;n.pos>>3){case 1:if(e!==10)break;i.source=BS.decode(n,n.uint32());continue;case 2:if(e!==18)break;i.metadata=W.unwrap(W.decode(n,n.uint32()));continue}if((e&7)==4||e===0)break;n.skip(e&7)}return i},create(e){return JS.fromPartial(e??{})},fromPartial(e){let t=qS();return t.source=e.source!==void 0&&e.source!==null?BS.fromPartial(e.source):void 0,t.metadata=e.metadata??void 0,t}};function YS(){return{source:void 0,metadata:void 0}}var XS={encode(e,t=new gS){return e.source!==void 0&&BS.encode(e.source,t.uint32(10).fork()).join(),e.metadata!==void 0&&W.encode(W.wrap(e.metadata),t.uint32(18).fork()).join(),t},decode(e,t){let n=e instanceof U?e:new U(e),r=t===void 0?n.len:n.pos+t,i=YS();for(;n.pos>>3){case 1:if(e!==10)break;i.source=BS.decode(n,n.uint32());continue;case 2:if(e!==18)break;i.metadata=W.unwrap(W.decode(n,n.uint32()));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.source=e.source!==void 0&&e.source!==null?BS.fromPartial(e.source):void 0,t.metadata=e.metadata??void 0,t}};function ZS(){return{text:void 0,image:void 0,audio:void 0,video:void 0,document:void 0}}var QS={encode(e,t=new gS){return e.text!==void 0&&HS.encode(e.text,t.uint32(10).fork()).join(),e.image!==void 0&&WS.encode(e.image,t.uint32(18).fork()).join(),e.audio!==void 0&&KS.encode(e.audio,t.uint32(26).fork()).join(),e.video!==void 0&&JS.encode(e.video,t.uint32(34).fork()).join(),e.document!==void 0&&XS.encode(e.document,t.uint32(42).fork()).join(),t},decode(e,t){let n=e instanceof U?e:new U(e),r=t===void 0?n.len:n.pos+t,i=ZS();for(;n.pos>>3){case 1:if(e!==10)break;i.text=HS.decode(n,n.uint32());continue;case 2:if(e!==18)break;i.image=WS.decode(n,n.uint32());continue;case 3:if(e!==26)break;i.audio=KS.decode(n,n.uint32());continue;case 4:if(e!==34)break;i.video=JS.decode(n,n.uint32());continue;case 5:if(e!==42)break;i.document=XS.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.text=e.text!==void 0&&e.text!==null?HS.fromPartial(e.text):void 0,t.image=e.image!==void 0&&e.image!==null?WS.fromPartial(e.image):void 0,t.audio=e.audio!==void 0&&e.audio!==null?KS.fromPartial(e.audio):void 0,t.video=e.video!==void 0&&e.video!==null?JS.fromPartial(e.video):void 0,t.document=e.document!==void 0&&e.document!==null?XS.fromPartial(e.document):void 0,t}};function $S(){return{id:``,role:``,content:void 0,name:void 0,toolCalls:[],toolCallId:void 0,error:void 0,contentParts:[]}}var eC={encode(e,t=new gS){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)MS.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)QS.encode(n,t.uint32(66).fork()).join();return t},decode(e,t){let n=e instanceof U?e:new U(e),r=t===void 0?n.len:n.pos+t,i=$S();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(MS.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(QS.decode(n,n.uint32()));continue}if((e&7)==4||e===0)break;n.skip(e&7)}return i},create(e){return eC.fromPartial(e??{})},fromPartial(e){let t=$S();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=>MS.fromPartial(e))||[],t.toolCallId=e.toolCallId??void 0,t.error=e.error??void 0,t.contentParts=e.contentParts?.map(e=>QS.fromPartial(e))||[],t}};function tC(){return{id:``,reason:``,message:void 0,toolCallId:void 0,responseSchema:void 0,expiresAt:void 0,metadata:void 0}}var nC={encode(e,t=new gS){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&&W.encode(W.wrap(e.responseSchema),t.uint32(42).fork()).join(),e.expiresAt!==void 0&&t.uint32(50).string(e.expiresAt),e.metadata!==void 0&&W.encode(W.wrap(e.metadata),t.uint32(58).fork()).join(),t},decode(e,t){let n=e instanceof U?e:new U(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.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=W.unwrap(W.decode(n,n.uint32()));continue;case 6:if(e!==50)break;i.expiresAt=n.string();continue;case 7:if(e!==58)break;i.metadata=W.unwrap(W.decode(n,n.uint32()));continue}if((e&7)==4||e===0)break;n.skip(e&7)}return i},create(e){return nC.fromPartial(e??{})},fromPartial(e){let t=tC();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}},rC=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.UNRECOGNIZED=-1]=`UNRECOGNIZED`,e}({});function iC(){return{type:0,timestamp:void 0,rawEvent:void 0}}var G={encode(e,t=new gS){return e.type!==0&&t.uint32(8).int32(e.type),e.timestamp!==void 0&&t.uint32(16).int64(e.timestamp),e.rawEvent!==void 0&&W.encode(W.wrap(e.rawEvent),t.uint32(26).fork()).join(),t},decode(e,t){let n=e instanceof U?e:new U(e),r=t===void 0?n.len:n.pos+t,i=iC();for(;n.pos>>3){case 1:if(e!==8)break;i.type=n.int32();continue;case 2:if(e!==16)break;i.timestamp=GC(n.int64());continue;case 3:if(e!==26)break;i.rawEvent=W.unwrap(W.decode(n,n.uint32()));continue}if((e&7)==4||e===0)break;n.skip(e&7)}return i},create(e){return G.fromPartial(e??{})},fromPartial(e){let t=iC();return t.type=e.type??0,t.timestamp=e.timestamp??void 0,t.rawEvent=e.rawEvent??void 0,t}};function aC(){return{baseEvent:void 0,messageId:``,role:void 0,name:void 0}}var oC={encode(e,t=new gS){return e.baseEvent!==void 0&&G.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),t},decode(e,t){let n=e instanceof U?e:new U(e),r=t===void 0?n.len:n.pos+t,i=aC();for(;n.pos>>3){case 1:if(e!==10)break;i.baseEvent=G.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}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.baseEvent=e.baseEvent!==void 0&&e.baseEvent!==null?G.fromPartial(e.baseEvent):void 0,t.messageId=e.messageId??``,t.role=e.role??void 0,t.name=e.name??void 0,t}};function sC(){return{baseEvent:void 0,messageId:``,delta:``}}var cC={encode(e,t=new gS){return e.baseEvent!==void 0&&G.encode(e.baseEvent,t.uint32(10).fork()).join(),e.messageId!==``&&t.uint32(18).string(e.messageId),e.delta!==``&&t.uint32(26).string(e.delta),t},decode(e,t){let n=e instanceof U?e:new U(e),r=t===void 0?n.len:n.pos+t,i=sC();for(;n.pos>>3){case 1:if(e!==10)break;i.baseEvent=G.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}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.baseEvent=e.baseEvent!==void 0&&e.baseEvent!==null?G.fromPartial(e.baseEvent):void 0,t.messageId=e.messageId??``,t.delta=e.delta??``,t}};function lC(){return{baseEvent:void 0,messageId:``}}var uC={encode(e,t=new gS){return e.baseEvent!==void 0&&G.encode(e.baseEvent,t.uint32(10).fork()).join(),e.messageId!==``&&t.uint32(18).string(e.messageId),t},decode(e,t){let n=e instanceof U?e:new U(e),r=t===void 0?n.len:n.pos+t,i=lC();for(;n.pos>>3){case 1:if(e!==10)break;i.baseEvent=G.decode(n,n.uint32());continue;case 2:if(e!==18)break;i.messageId=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.baseEvent=e.baseEvent!==void 0&&e.baseEvent!==null?G.fromPartial(e.baseEvent):void 0,t.messageId=e.messageId??``,t}};function dC(){return{baseEvent:void 0,toolCallId:``,toolCallName:``,parentMessageId:void 0}}var fC={encode(e,t=new gS){return e.baseEvent!==void 0&&G.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),t},decode(e,t){let n=e instanceof U?e:new U(e),r=t===void 0?n.len:n.pos+t,i=dC();for(;n.pos>>3){case 1:if(e!==10)break;i.baseEvent=G.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}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.baseEvent=e.baseEvent!==void 0&&e.baseEvent!==null?G.fromPartial(e.baseEvent):void 0,t.toolCallId=e.toolCallId??``,t.toolCallName=e.toolCallName??``,t.parentMessageId=e.parentMessageId??void 0,t}};function pC(){return{baseEvent:void 0,toolCallId:``,delta:``}}var mC={encode(e,t=new gS){return e.baseEvent!==void 0&&G.encode(e.baseEvent,t.uint32(10).fork()).join(),e.toolCallId!==``&&t.uint32(18).string(e.toolCallId),e.delta!==``&&t.uint32(26).string(e.delta),t},decode(e,t){let n=e instanceof U?e:new U(e),r=t===void 0?n.len:n.pos+t,i=pC();for(;n.pos>>3){case 1:if(e!==10)break;i.baseEvent=G.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}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.baseEvent=e.baseEvent!==void 0&&e.baseEvent!==null?G.fromPartial(e.baseEvent):void 0,t.toolCallId=e.toolCallId??``,t.delta=e.delta??``,t}};function hC(){return{baseEvent:void 0,toolCallId:``}}var gC={encode(e,t=new gS){return e.baseEvent!==void 0&&G.encode(e.baseEvent,t.uint32(10).fork()).join(),e.toolCallId!==``&&t.uint32(18).string(e.toolCallId),t},decode(e,t){let n=e instanceof U?e:new U(e),r=t===void 0?n.len:n.pos+t,i=hC();for(;n.pos>>3){case 1:if(e!==10)break;i.baseEvent=G.decode(n,n.uint32());continue;case 2:if(e!==18)break;i.toolCallId=n.string();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.baseEvent=e.baseEvent!==void 0&&e.baseEvent!==null?G.fromPartial(e.baseEvent):void 0,t.toolCallId=e.toolCallId??``,t}};function _C(){return{baseEvent:void 0,snapshot:void 0}}var vC={encode(e,t=new gS){return e.baseEvent!==void 0&&G.encode(e.baseEvent,t.uint32(10).fork()).join(),e.snapshot!==void 0&&W.encode(W.wrap(e.snapshot),t.uint32(18).fork()).join(),t},decode(e,t){let n=e instanceof U?e:new U(e),r=t===void 0?n.len:n.pos+t,i=_C();for(;n.pos>>3){case 1:if(e!==10)break;i.baseEvent=G.decode(n,n.uint32());continue;case 2:if(e!==18)break;i.snapshot=W.unwrap(W.decode(n,n.uint32()));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.baseEvent=e.baseEvent!==void 0&&e.baseEvent!==null?G.fromPartial(e.baseEvent):void 0,t.snapshot=e.snapshot??void 0,t}};function yC(){return{baseEvent:void 0,delta:[]}}var bC={encode(e,t=new gS){e.baseEvent!==void 0&&G.encode(e.baseEvent,t.uint32(10).fork()).join();for(let n of e.delta)AS.encode(n,t.uint32(18).fork()).join();return t},decode(e,t){let n=e instanceof U?e:new U(e),r=t===void 0?n.len:n.pos+t,i=yC();for(;n.pos>>3){case 1:if(e!==10)break;i.baseEvent=G.decode(n,n.uint32());continue;case 2:if(e!==18)break;i.delta.push(AS.decode(n,n.uint32()));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.baseEvent=e.baseEvent!==void 0&&e.baseEvent!==null?G.fromPartial(e.baseEvent):void 0,t.delta=e.delta?.map(e=>AS.fromPartial(e))||[],t}};function xC(){return{baseEvent:void 0,messages:[]}}var SC={encode(e,t=new gS){e.baseEvent!==void 0&&G.encode(e.baseEvent,t.uint32(10).fork()).join();for(let n of e.messages)eC.encode(n,t.uint32(18).fork()).join();return t},decode(e,t){let n=e instanceof U?e:new U(e),r=t===void 0?n.len:n.pos+t,i=xC();for(;n.pos>>3){case 1:if(e!==10)break;i.baseEvent=G.decode(n,n.uint32());continue;case 2:if(e!==18)break;i.messages.push(eC.decode(n,n.uint32()));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.baseEvent=e.baseEvent!==void 0&&e.baseEvent!==null?G.fromPartial(e.baseEvent):void 0,t.messages=e.messages?.map(e=>eC.fromPartial(e))||[],t}};function CC(){return{baseEvent:void 0,event:void 0,source:void 0}}var wC={encode(e,t=new gS){return e.baseEvent!==void 0&&G.encode(e.baseEvent,t.uint32(10).fork()).join(),e.event!==void 0&&W.encode(W.wrap(e.event),t.uint32(18).fork()).join(),e.source!==void 0&&t.uint32(26).string(e.source),t},decode(e,t){let n=e instanceof U?e:new U(e),r=t===void 0?n.len:n.pos+t,i=CC();for(;n.pos>>3){case 1:if(e!==10)break;i.baseEvent=G.decode(n,n.uint32());continue;case 2:if(e!==18)break;i.event=W.unwrap(W.decode(n,n.uint32()));continue;case 3:if(e!==26)break;i.source=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=CC();return t.baseEvent=e.baseEvent!==void 0&&e.baseEvent!==null?G.fromPartial(e.baseEvent):void 0,t.event=e.event??void 0,t.source=e.source??void 0,t}};function TC(){return{baseEvent:void 0,name:``,value:void 0}}var EC={encode(e,t=new gS){return e.baseEvent!==void 0&&G.encode(e.baseEvent,t.uint32(10).fork()).join(),e.name!==``&&t.uint32(18).string(e.name),e.value!==void 0&&W.encode(W.wrap(e.value),t.uint32(26).fork()).join(),t},decode(e,t){let n=e instanceof U?e:new U(e),r=t===void 0?n.len:n.pos+t,i=TC();for(;n.pos>>3){case 1:if(e!==10)break;i.baseEvent=G.decode(n,n.uint32());continue;case 2:if(e!==18)break;i.name=n.string();continue;case 3:if(e!==26)break;i.value=W.unwrap(W.decode(n,n.uint32()));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.baseEvent=e.baseEvent!==void 0&&e.baseEvent!==null?G.fromPartial(e.baseEvent):void 0,t.name=e.name??``,t.value=e.value??void 0,t}};function DC(){return{baseEvent:void 0,threadId:``,runId:``}}var OC={encode(e,t=new gS){return e.baseEvent!==void 0&&G.encode(e.baseEvent,t.uint32(10).fork()).join(),e.threadId!==``&&t.uint32(18).string(e.threadId),e.runId!==``&&t.uint32(26).string(e.runId),t},decode(e,t){let n=e instanceof U?e:new U(e),r=t===void 0?n.len:n.pos+t,i=DC();for(;n.pos>>3){case 1:if(e!==10)break;i.baseEvent=G.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}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.baseEvent=e.baseEvent!==void 0&&e.baseEvent!==null?G.fromPartial(e.baseEvent):void 0,t.threadId=e.threadId??``,t.runId=e.runId??``,t}};function kC(){return{provider:void 0,model:void 0,inputTokens:void 0,outputTokens:void 0,totalTokens:void 0,reasoningTokens:void 0,cachedInputTokens:void 0}}var AC={encode(e,t=new gS){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),t},decode(e,t){let n=e instanceof U?e:new U(e),r=t===void 0?n.len:n.pos+t,i=kC();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=GC(n.int64());continue;case 4:if(e!==32)break;i.outputTokens=GC(n.int64());continue;case 5:if(e!==40)break;i.totalTokens=GC(n.int64());continue;case 6:if(e!==48)break;i.reasoningTokens=GC(n.int64());continue;case 7:if(e!==56)break;i.cachedInputTokens=GC(n.int64());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.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}};function jC(){return{baseEvent:void 0,threadId:``,runId:``,result:void 0,outcome:``,interrupts:[],usage:[]}}var MC={encode(e,t=new gS){e.baseEvent!==void 0&&G.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&&W.encode(W.wrap(e.result),t.uint32(34).fork()).join(),e.outcome!==``&&t.uint32(42).string(e.outcome);for(let n of e.interrupts)nC.encode(n,t.uint32(50).fork()).join();for(let n of e.usage)AC.encode(n,t.uint32(58).fork()).join();return t},decode(e,t){let n=e instanceof U?e:new U(e),r=t===void 0?n.len:n.pos+t,i=jC();for(;n.pos>>3){case 1:if(e!==10)break;i.baseEvent=G.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=W.unwrap(W.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(nC.decode(n,n.uint32()));continue;case 7:if(e!==58)break;i.usage.push(AC.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.baseEvent=e.baseEvent!==void 0&&e.baseEvent!==null?G.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=>nC.fromPartial(e))||[],t.usage=e.usage?.map(e=>AC.fromPartial(e))||[],t}};function NC(){return{baseEvent:void 0,code:void 0,message:``,usage:[]}}var PC={encode(e,t=new gS){e.baseEvent!==void 0&&G.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)AC.encode(n,t.uint32(34).fork()).join();return t},decode(e,t){let n=e instanceof U?e:new U(e),r=t===void 0?n.len:n.pos+t,i=NC();for(;n.pos>>3){case 1:if(e!==10)break;i.baseEvent=G.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(AC.decode(n,n.uint32()));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.baseEvent=e.baseEvent!==void 0&&e.baseEvent!==null?G.fromPartial(e.baseEvent):void 0,t.code=e.code??void 0,t.message=e.message??``,t.usage=e.usage?.map(e=>AC.fromPartial(e))||[],t}};function FC(){return{baseEvent:void 0,stepName:``}}var IC={encode(e,t=new gS){return e.baseEvent!==void 0&&G.encode(e.baseEvent,t.uint32(10).fork()).join(),e.stepName!==``&&t.uint32(18).string(e.stepName),t},decode(e,t){let n=e instanceof U?e:new U(e),r=t===void 0?n.len:n.pos+t,i=FC();for(;n.pos>>3){case 1:if(e!==10)break;i.baseEvent=G.decode(n,n.uint32());continue;case 2:if(e!==18)break;i.stepName=n.string();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.baseEvent=e.baseEvent!==void 0&&e.baseEvent!==null?G.fromPartial(e.baseEvent):void 0,t.stepName=e.stepName??``,t}};function LC(){return{baseEvent:void 0,stepName:``}}var RC={encode(e,t=new gS){return e.baseEvent!==void 0&&G.encode(e.baseEvent,t.uint32(10).fork()).join(),e.stepName!==``&&t.uint32(18).string(e.stepName),t},decode(e,t){let n=e instanceof U?e:new U(e),r=t===void 0?n.len:n.pos+t,i=LC();for(;n.pos>>3){case 1:if(e!==10)break;i.baseEvent=G.decode(n,n.uint32());continue;case 2:if(e!==18)break;i.stepName=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.baseEvent=e.baseEvent!==void 0&&e.baseEvent!==null?G.fromPartial(e.baseEvent):void 0,t.stepName=e.stepName??``,t}};function zC(){return{baseEvent:void 0,messageId:void 0,role:void 0,delta:void 0,name:void 0}}var BC={encode(e,t=new gS){return e.baseEvent!==void 0&&G.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),t},decode(e,t){let n=e instanceof U?e:new U(e),r=t===void 0?n.len:n.pos+t,i=zC();for(;n.pos>>3){case 1:if(e!==10)break;i.baseEvent=G.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}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.baseEvent=e.baseEvent!==void 0&&e.baseEvent!==null?G.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}};function VC(){return{baseEvent:void 0,toolCallId:void 0,toolCallName:void 0,parentMessageId:void 0,delta:void 0}}var HC={encode(e,t=new gS){return e.baseEvent!==void 0&&G.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),t},decode(e,t){let n=e instanceof U?e:new U(e),r=t===void 0?n.len:n.pos+t,i=VC();for(;n.pos>>3){case 1:if(e!==10)break;i.baseEvent=G.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}if((e&7)==4||e===0)break;n.skip(e&7)}return i},create(e){return HC.fromPartial(e??{})},fromPartial(e){let t=VC();return t.baseEvent=e.baseEvent!==void 0&&e.baseEvent!==null?G.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}};function UC(){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}}var WC={encode(e,t=new gS){return e.textMessageStart!==void 0&&oC.encode(e.textMessageStart,t.uint32(10).fork()).join(),e.textMessageContent!==void 0&&cC.encode(e.textMessageContent,t.uint32(18).fork()).join(),e.textMessageEnd!==void 0&&uC.encode(e.textMessageEnd,t.uint32(26).fork()).join(),e.toolCallStart!==void 0&&fC.encode(e.toolCallStart,t.uint32(34).fork()).join(),e.toolCallArgs!==void 0&&mC.encode(e.toolCallArgs,t.uint32(42).fork()).join(),e.toolCallEnd!==void 0&&gC.encode(e.toolCallEnd,t.uint32(50).fork()).join(),e.stateSnapshot!==void 0&&vC.encode(e.stateSnapshot,t.uint32(58).fork()).join(),e.stateDelta!==void 0&&bC.encode(e.stateDelta,t.uint32(66).fork()).join(),e.messagesSnapshot!==void 0&&SC.encode(e.messagesSnapshot,t.uint32(74).fork()).join(),e.raw!==void 0&&wC.encode(e.raw,t.uint32(82).fork()).join(),e.custom!==void 0&&EC.encode(e.custom,t.uint32(90).fork()).join(),e.runStarted!==void 0&&OC.encode(e.runStarted,t.uint32(98).fork()).join(),e.runFinished!==void 0&&MC.encode(e.runFinished,t.uint32(106).fork()).join(),e.runError!==void 0&&PC.encode(e.runError,t.uint32(114).fork()).join(),e.stepStarted!==void 0&&IC.encode(e.stepStarted,t.uint32(122).fork()).join(),e.stepFinished!==void 0&&RC.encode(e.stepFinished,t.uint32(130).fork()).join(),e.textMessageChunk!==void 0&&BC.encode(e.textMessageChunk,t.uint32(138).fork()).join(),e.toolCallChunk!==void 0&&HC.encode(e.toolCallChunk,t.uint32(146).fork()).join(),t},decode(e,t){let n=e instanceof U?e:new U(e),r=t===void 0?n.len:n.pos+t,i=UC();for(;n.pos>>3){case 1:if(e!==10)break;i.textMessageStart=oC.decode(n,n.uint32());continue;case 2:if(e!==18)break;i.textMessageContent=cC.decode(n,n.uint32());continue;case 3:if(e!==26)break;i.textMessageEnd=uC.decode(n,n.uint32());continue;case 4:if(e!==34)break;i.toolCallStart=fC.decode(n,n.uint32());continue;case 5:if(e!==42)break;i.toolCallArgs=mC.decode(n,n.uint32());continue;case 6:if(e!==50)break;i.toolCallEnd=gC.decode(n,n.uint32());continue;case 7:if(e!==58)break;i.stateSnapshot=vC.decode(n,n.uint32());continue;case 8:if(e!==66)break;i.stateDelta=bC.decode(n,n.uint32());continue;case 9:if(e!==74)break;i.messagesSnapshot=SC.decode(n,n.uint32());continue;case 10:if(e!==82)break;i.raw=wC.decode(n,n.uint32());continue;case 11:if(e!==90)break;i.custom=EC.decode(n,n.uint32());continue;case 12:if(e!==98)break;i.runStarted=OC.decode(n,n.uint32());continue;case 13:if(e!==106)break;i.runFinished=MC.decode(n,n.uint32());continue;case 14:if(e!==114)break;i.runError=PC.decode(n,n.uint32());continue;case 15:if(e!==122)break;i.stepStarted=IC.decode(n,n.uint32());continue;case 16:if(e!==130)break;i.stepFinished=RC.decode(n,n.uint32());continue;case 17:if(e!==138)break;i.textMessageChunk=BC.decode(n,n.uint32());continue;case 18:if(e!==146)break;i.toolCallChunk=HC.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=UC();return t.textMessageStart=e.textMessageStart!==void 0&&e.textMessageStart!==null?oC.fromPartial(e.textMessageStart):void 0,t.textMessageContent=e.textMessageContent!==void 0&&e.textMessageContent!==null?cC.fromPartial(e.textMessageContent):void 0,t.textMessageEnd=e.textMessageEnd!==void 0&&e.textMessageEnd!==null?uC.fromPartial(e.textMessageEnd):void 0,t.toolCallStart=e.toolCallStart!==void 0&&e.toolCallStart!==null?fC.fromPartial(e.toolCallStart):void 0,t.toolCallArgs=e.toolCallArgs!==void 0&&e.toolCallArgs!==null?mC.fromPartial(e.toolCallArgs):void 0,t.toolCallEnd=e.toolCallEnd!==void 0&&e.toolCallEnd!==null?gC.fromPartial(e.toolCallEnd):void 0,t.stateSnapshot=e.stateSnapshot!==void 0&&e.stateSnapshot!==null?vC.fromPartial(e.stateSnapshot):void 0,t.stateDelta=e.stateDelta!==void 0&&e.stateDelta!==null?bC.fromPartial(e.stateDelta):void 0,t.messagesSnapshot=e.messagesSnapshot!==void 0&&e.messagesSnapshot!==null?SC.fromPartial(e.messagesSnapshot):void 0,t.raw=e.raw!==void 0&&e.raw!==null?wC.fromPartial(e.raw):void 0,t.custom=e.custom!==void 0&&e.custom!==null?EC.fromPartial(e.custom):void 0,t.runStarted=e.runStarted!==void 0&&e.runStarted!==null?OC.fromPartial(e.runStarted):void 0,t.runFinished=e.runFinished!==void 0&&e.runFinished!==null?MC.fromPartial(e.runFinished):void 0,t.runError=e.runError!==void 0&&e.runError!==null?PC.fromPartial(e.runError):void 0,t.stepStarted=e.stepStarted!==void 0&&e.stepStarted!==null?IC.fromPartial(e.stepStarted):void 0,t.stepFinished=e.stepFinished!==void 0&&e.stepFinished!==null?RC.fromPartial(e.stepFinished):void 0,t.textMessageChunk=e.textMessageChunk!==void 0&&e.textMessageChunk!==null?BC.fromPartial(e.textMessageChunk):void 0,t.toolCallChunk=e.toolCallChunk!==void 0&&e.toolCallChunk!==null?HC.fromPartial(e.toolCallChunk):void 0,t}};function GC(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,qC=e=>{let t=KC(e);if(t){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}}}},JC=e=>{let t=KC(e);if(t){if(t.text)return{type:`text`,text:t.text.text};if(t.image){let e=t.image;return{type:`image`,source:qC(e.source),metadata:e.metadata}}if(t.audio){let e=t.audio;return{type:`audio`,source:qC(e.source),metadata:e.metadata}}if(t.video){let e=t.video;return{type:`video`,source:qC(e.source),metadata:e.metadata}}if(t.document){let e=t.document;return{type:`document`,source:qC(e.source),metadata:e.metadata}}}};function YC(e){let t=WC.decode(e),n=Object.values(t).find(e=>e!==void 0);if(!n)throw Error(`Invalid event`);if(n.type=rC[n.baseEvent.type],n.timestamp=n.baseEvent.timestamp,n.rawEvent=n.baseEvent.rawEvent,delete n.baseEvent,n.type===H.MESSAGES_SNAPSHOT)for(let e of n.messages){let t=e;if(t.role===`user`&&Array.isArray(t.contentParts)){let e=t.contentParts.map(e=>JC(e)).filter(e=>e!==void 0);e.length>0&&(t.content=e)}Array.isArray(t.contentParts)&&t.contentParts.length===0&&(t.contentParts=void 0),t.toolCalls?.length===0&&(t.toolCalls=void 0)}if(n.type===H.RUN_FINISHED){let e=n,t=typeof e.outcome==`string`&&e.outcome!==``?e.outcome:void 0,r=Array.isArray(e.interrupts)?e.interrupts:[];delete e.interrupts,t===`interrupt`?e.outcome={type:`interrupt`,interrupts:r}:t===`success`?e.outcome={type:`success`}:delete e.outcome}if((n.type===H.RUN_FINISHED||n.type===H.RUN_ERROR)&&Array.isArray(n.usage)&&n.usage.length===0&&delete n.usage,n.type===H.STATE_DELTA)for(let e of n.delta)e.op=OS[e.op].toLowerCase(),Object.keys(e).forEach(t=>{e[t]===void 0&&delete e[t]});return Object.keys(n).forEach(e=>{n[e]===void 0&&delete n[e]}),Ey.parse(n)}var XC;(function(e){e.assertEqual=e=>{};function t(e){}e.assertIs=t;function n(e){throw Error()}e.assertNever=n,e.arrayToEnum=e=>{let t={};for(let n of e)t[n]=n;return t},e.getValidEnumValues=t=>{let n=e.objectKeys(t).filter(e=>typeof t[t[e]]!=`number`),r={};for(let e of n)r[e]=t[e];return e.objectValues(r)},e.objectValues=t=>e.objectKeys(t).map(function(e){return t[e]}),e.objectKeys=typeof Object.keys==`function`?e=>Object.keys(e):e=>{let t=[];for(let n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.push(n);return t},e.find=(e,t)=>{for(let n of e)if(t(n))return n},e.isInteger=typeof Number.isInteger==`function`?e=>Number.isInteger(e):e=>typeof e==`number`&&Number.isFinite(e)&&Math.floor(e)===e;function r(e,t=` | `){return e.map(e=>typeof e==`string`?`'${e}'`:e).join(t)}e.joinValues=r,e.jsonStringifyReplacer=(e,t)=>typeof t==`bigint`?t.toString():t})(XC||={});var ZC;(function(e){e.mergeShapes=(e,t)=>({...e,...t})})(ZC||={});var K=XC.arrayToEnum([`string`,`nan`,`number`,`integer`,`float`,`boolean`,`date`,`bigint`,`symbol`,`function`,`undefined`,`null`,`array`,`object`,`unknown`,`promise`,`void`,`never`,`map`,`set`]),QC=e=>{switch(typeof e){case`undefined`:return K.undefined;case`string`:return K.string;case`number`:return Number.isNaN(e)?K.nan:K.number;case`boolean`:return K.boolean;case`function`:return K.function;case`bigint`:return K.bigint;case`symbol`:return K.symbol;case`object`:return Array.isArray(e)?K.array:e===null?K.null:e.then&&typeof e.then==`function`&&e.catch&&typeof e.catch==`function`?K.promise:typeof Map<`u`&&e instanceof Map?K.map:typeof Set<`u`&&e instanceof Set?K.set:typeof Date<`u`&&e instanceof Date?K.date:K.object;default:return K.unknown}},q=XC.arrayToEnum([`invalid_type`,`invalid_literal`,`custom`,`invalid_union`,`invalid_union_discriminator`,`invalid_enum_value`,`unrecognized_keys`,`invalid_arguments`,`invalid_return_type`,`invalid_date`,`invalid_string`,`too_small`,`too_big`,`invalid_intersection_types`,`not_multiple_of`,`not_finite`]),$C=class e extends Error{get errors(){return this.issues}constructor(e){super(),this.issues=[],this.addIssue=e=>{this.issues=[...this.issues,e]},this.addIssues=(e=[])=>{this.issues=[...this.issues,...e]};let t=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,t):this.__proto__=t,this.name=`ZodError`,this.issues=e}format(e){let t=e||function(e){return e.message},n={_errors:[]},r=e=>{for(let i of e.issues)if(i.code===`invalid_union`)i.unionErrors.map(r);else if(i.code===`invalid_return_type`)r(i.returnTypeError);else if(i.code===`invalid_arguments`)r(i.argumentsError);else if(i.path.length===0)n._errors.push(t(i));else{let e=n,r=0;for(;re.message){let t={},n=[];for(let r of this.issues)if(r.path.length>0){let n=r.path[0];t[n]=t[n]||[],t[n].push(e(r))}else n.push(e(r));return{formErrors:n,fieldErrors:t}}get formErrors(){return this.flatten()}};$C.create=e=>new $C(e);var ew=(e,t)=>{let n;switch(e.code){case q.invalid_type:n=e.received===K.undefined?`Required`:`Expected ${e.expected}, received ${e.received}`;break;case q.invalid_literal:n=`Invalid literal value, expected ${JSON.stringify(e.expected,XC.jsonStringifyReplacer)}`;break;case q.unrecognized_keys:n=`Unrecognized key(s) in object: ${XC.joinValues(e.keys,`, `)}`;break;case q.invalid_union:n=`Invalid input`;break;case q.invalid_union_discriminator:n=`Invalid discriminator value. Expected ${XC.joinValues(e.options)}`;break;case q.invalid_enum_value:n=`Invalid enum value. Expected ${XC.joinValues(e.options)}, received '${e.received}'`;break;case q.invalid_arguments:n=`Invalid function arguments`;break;case q.invalid_return_type:n=`Invalid function return type`;break;case q.invalid_date:n=`Invalid date`;break;case q.invalid_string:typeof e.validation==`object`?`includes`in e.validation?(n=`Invalid input: must include "${e.validation.includes}"`,typeof e.validation.position==`number`&&(n=`${n} at one or more positions greater than or equal to ${e.validation.position}`)):`startsWith`in e.validation?n=`Invalid input: must start with "${e.validation.startsWith}"`:`endsWith`in e.validation?n=`Invalid input: must end with "${e.validation.endsWith}"`:XC.assertNever(e.validation):n=e.validation===`regex`?`Invalid`:`Invalid ${e.validation}`;break;case q.too_small:n=e.type===`array`?`Array must contain ${e.exact?`exactly`:e.inclusive?`at least`:`more than`} ${e.minimum} element(s)`:e.type===`string`?`String must contain ${e.exact?`exactly`:e.inclusive?`at least`:`over`} ${e.minimum} character(s)`:e.type===`number`||e.type===`bigint`?`Number must be ${e.exact?`exactly equal to `:e.inclusive?`greater than or equal to `:`greater than `}${e.minimum}`:e.type===`date`?`Date must be ${e.exact?`exactly equal to `:e.inclusive?`greater than or equal to `:`greater than `}${new Date(Number(e.minimum))}`:`Invalid input`;break;case q.too_big:n=e.type===`array`?`Array must contain ${e.exact?`exactly`:e.inclusive?`at most`:`less than`} ${e.maximum} element(s)`:e.type===`string`?`String must contain ${e.exact?`exactly`:e.inclusive?`at most`:`under`} ${e.maximum} character(s)`:e.type===`number`?`Number must be ${e.exact?`exactly`:e.inclusive?`less than or equal to`:`less than`} ${e.maximum}`:e.type===`bigint`?`BigInt must be ${e.exact?`exactly`:e.inclusive?`less than or equal to`:`less than`} ${e.maximum}`:e.type===`date`?`Date must be ${e.exact?`exactly`:e.inclusive?`smaller than or equal to`:`smaller than`} ${new Date(Number(e.maximum))}`:`Invalid input`;break;case q.custom:n=`Invalid input`;break;case q.invalid_intersection_types:n=`Intersection results could not be merged`;break;case q.not_multiple_of:n=`Number must be a multiple of ${e.multipleOf}`;break;case q.not_finite:n=`Number must be finite`;break;default:n=t.defaultError,XC.assertNever(e)}return{message:n}},tw=ew;function nw(){return tw}var rw=e=>{let{data:t,path:n,errorMaps:r,issueData:i}=e,a=[...n,...i.path||[]],o={...i,path:a};if(i.message!==void 0)return{...i,path:a,message:i.message};let s=``,c=r.filter(e=>!!e).slice().reverse();for(let e of c)s=e(o,{data:t,defaultError:s}).message;return{...i,path:a,message:s}};function J(e,t){let n=nw(),r=rw({issueData:t,data:e.data,path:e.path,errorMaps:[e.common.contextualErrorMap,e.schemaErrorMap,n,n===ew?void 0:ew].filter(e=>!!e)});e.common.issues.push(r)}var iw=class e{constructor(){this.value=`valid`}dirty(){this.value===`valid`&&(this.value=`dirty`)}abort(){this.value!==`aborted`&&(this.value=`aborted`)}static mergeArray(e,t){let n=[];for(let r of t){if(r.status===`aborted`)return Y;r.status===`dirty`&&e.dirty(),n.push(r.value)}return{status:e.value,value:n}}static async mergeObjectAsync(t,n){let r=[];for(let e of n){let t=await e.key,n=await e.value;r.push({key:t,value:n})}return e.mergeObjectSync(t,r)}static mergeObjectSync(e,t){let n={};for(let r of t){let{key:t,value:i}=r;if(t.status===`aborted`||i.status===`aborted`)return Y;t.status===`dirty`&&e.dirty(),i.status===`dirty`&&e.dirty(),t.value!==`__proto__`&&(i.value!==void 0||r.alwaysSet)&&(n[t.value]=i.value)}return{status:e.value,value:n}}},Y=Object.freeze({status:`aborted`}),aw=e=>({status:`dirty`,value:e}),ow=e=>({status:`valid`,value:e}),sw=e=>e.status===`aborted`,cw=e=>e.status===`dirty`,lw=e=>e.status===`valid`,uw=e=>typeof Promise<`u`&&e instanceof Promise,X;(function(e){e.errToObj=e=>typeof e==`string`?{message:e}:e||{},e.toString=e=>typeof e==`string`?e:e?.message})(X||={});var dw=class{constructor(e,t,n,r){this._cachedPath=[],this.parent=e,this.data=t,this._path=n,this._key=r}get path(){return this._cachedPath.length||(Array.isArray(this._key)?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}},fw=(e,t)=>{if(lw(t))return{success:!0,data:t.value};if(!e.common.issues.length)throw Error(`Validation failed but no issues detected.`);return{success:!1,get error(){if(this._error)return this._error;let t=new $C(e.common.issues);return this._error=t,this._error}}};function pw(e){if(!e)return{};let{errorMap:t,invalid_type_error:n,required_error:r,description:i}=e;if(t&&(n||r))throw Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return t?{errorMap:t,description:i}:{errorMap:(t,i)=>{let{message:a}=e;return t.code===`invalid_enum_value`?{message:a??i.defaultError}:i.data===void 0?{message:a??r??i.defaultError}:t.code===`invalid_type`?{message:a??n??i.defaultError}:{message:i.defaultError}},description:i}}var mw=class{get description(){return this._def.description}_getType(e){return QC(e.data)}_getOrReturnCtx(e,t){return t||{common:e.parent.common,data:e.data,parsedType:QC(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}_processInputParams(e){return{status:new iw,ctx:{common:e.parent.common,data:e.data,parsedType:QC(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}}_parseSync(e){let t=this._parse(e);if(uw(t))throw Error(`Synchronous parse encountered promise.`);return t}_parseAsync(e){let t=this._parse(e);return Promise.resolve(t)}parse(e,t){let n=this.safeParse(e,t);if(n.success)return n.data;throw n.error}safeParse(e,t){let n={common:{issues:[],async:t?.async??!1,contextualErrorMap:t?.errorMap},path:t?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:QC(e)};return fw(n,this._parseSync({data:e,path:n.path,parent:n}))}"~validate"(e){let t={common:{issues:[],async:!!this[`~standard`].async},path:[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:QC(e)};if(!this[`~standard`].async)try{let n=this._parseSync({data:e,path:[],parent:t});return lw(n)?{value:n.value}:{issues:t.common.issues}}catch(e){e?.message?.toLowerCase()?.includes(`encountered`)&&(this[`~standard`].async=!0),t.common={issues:[],async:!0}}return this._parseAsync({data:e,path:[],parent:t}).then(e=>lw(e)?{value:e.value}:{issues:t.common.issues})}async parseAsync(e,t){let n=await this.safeParseAsync(e,t);if(n.success)return n.data;throw n.error}async safeParseAsync(e,t){let n={common:{issues:[],contextualErrorMap:t?.errorMap,async:!0},path:t?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:QC(e)},r=this._parse({data:e,path:n.path,parent:n});return fw(n,await(uw(r)?r:Promise.resolve(r)))}refine(e,t){let n=e=>typeof t==`string`||t===void 0?{message:t}:typeof t==`function`?t(e):t;return this._refinement((t,r)=>{let i=e(t),a=()=>r.addIssue({code:q.custom,...n(t)});return typeof Promise<`u`&&i instanceof Promise?i.then(e=>e?!0:(a(),!1)):i?!0:(a(),!1)})}refinement(e,t){return this._refinement((n,r)=>e(n)?!0:(r.addIssue(typeof t==`function`?t(n,r):t),!1))}_refinement(e){return new _T({schema:this,typeName:Z.ZodEffects,effect:{type:`refinement`,refinement:e}})}superRefine(e){return this._refinement(e)}constructor(e){this.spa=this.safeParseAsync,this._def=e,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this),this[`~standard`]={version:1,vendor:`zod`,validate:e=>this[`~validate`](e)}}optional(){return vT.create(this,this._def)}nullable(){return yT.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return Qw.create(this)}promise(){return gT.create(this,this._def)}or(e){return tT.create([this,e],this._def)}and(e){return aT.create(this,e,this._def)}transform(e){return new _T({...pw(this._def),schema:this,typeName:Z.ZodEffects,effect:{type:`transform`,transform:e}})}default(e){let t=typeof e==`function`?e:()=>e;return new bT({...pw(this._def),innerType:this,defaultValue:t,typeName:Z.ZodDefault})}brand(){return new CT({typeName:Z.ZodBranded,type:this,...pw(this._def)})}catch(e){let t=typeof e==`function`?e:()=>e;return new xT({...pw(this._def),innerType:this,catchValue:t,typeName:Z.ZodCatch})}describe(e){let t=this.constructor;return new t({...this._def,description:e})}pipe(e){return wT.create(this,e)}readonly(){return TT.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}},hw=/^c[^\s-]{8,}$/i,gw=/^[0-9a-z]+$/,_w=/^[0-9A-HJKMNP-TV-Z]{26}$/i,vw=/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i,yw=/^[a-z0-9_-]{21}$/i,bw=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,xw=/^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/,Sw=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,Cw=`^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$`,ww,Tw=/^(?:(?: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])$/,Ew=/^(?:(?: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])\/(3[0-2]|[12]?[0-9])$/,Dw=/^(([0-9a-fA-F]{1,4}:){7,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}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))$/,Ow=/^(([0-9a-fA-F]{1,4}:){7,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}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,kw=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,Aw=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,jw=`((\\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])))`,Mw=RegExp(`^${jw}$`);function Nw(e){let t=`[0-5]\\d`;e.precision?t=`${t}\\.\\d{${e.precision}}`:e.precision??(t=`${t}(\\.\\d+)?`);let n=e.precision?`+`:`?`;return`([01]\\d|2[0-3]):[0-5]\\d(:${t})${n}`}function Pw(e){return RegExp(`^${Nw(e)}$`)}function Fw(e){let t=`${jw}T${Nw(e)}`,n=[];return n.push(e.local?`Z?`:`Z`),e.offset&&n.push(`([+-]\\d{2}:?\\d{2})`),t=`${t}(${n.join(`|`)})`,RegExp(`^${t}$`)}function Iw(e,t){return!!((t===`v4`||!t)&&Tw.test(e)||(t===`v6`||!t)&&Dw.test(e))}function Lw(e,t){if(!bw.test(e))return!1;try{let[n]=e.split(`.`);if(!n)return!1;let r=n.replace(/-/g,`+`).replace(/_/g,`/`).padEnd(n.length+(4-n.length%4)%4,`=`),i=JSON.parse(atob(r));return!(typeof i!=`object`||!i||`typ`in i&&i?.typ!==`JWT`||!i.alg||t&&i.alg!==t)}catch{return!1}}function Rw(e,t){return!!((t===`v4`||!t)&&Ew.test(e)||(t===`v6`||!t)&&Ow.test(e))}var zw=class e extends mw{_parse(e){if(this._def.coerce&&(e.data=String(e.data)),this._getType(e)!==K.string){let t=this._getOrReturnCtx(e);return J(t,{code:q.invalid_type,expected:K.string,received:t.parsedType}),Y}let t=new iw,n;for(let r of this._def.checks)if(r.kind===`min`)e.data.lengthr.value&&(n=this._getOrReturnCtx(e,n),J(n,{code:q.too_big,maximum:r.value,type:`string`,inclusive:!0,exact:!1,message:r.message}),t.dirty());else if(r.kind===`length`){let i=e.data.length>r.value,a=e.data.lengthe.test(t),{validation:t,code:q.invalid_string,...X.errToObj(n)})}_addCheck(t){return new e({...this._def,checks:[...this._def.checks,t]})}email(e){return this._addCheck({kind:`email`,...X.errToObj(e)})}url(e){return this._addCheck({kind:`url`,...X.errToObj(e)})}emoji(e){return this._addCheck({kind:`emoji`,...X.errToObj(e)})}uuid(e){return this._addCheck({kind:`uuid`,...X.errToObj(e)})}nanoid(e){return this._addCheck({kind:`nanoid`,...X.errToObj(e)})}cuid(e){return this._addCheck({kind:`cuid`,...X.errToObj(e)})}cuid2(e){return this._addCheck({kind:`cuid2`,...X.errToObj(e)})}ulid(e){return this._addCheck({kind:`ulid`,...X.errToObj(e)})}base64(e){return this._addCheck({kind:`base64`,...X.errToObj(e)})}base64url(e){return this._addCheck({kind:`base64url`,...X.errToObj(e)})}jwt(e){return this._addCheck({kind:`jwt`,...X.errToObj(e)})}ip(e){return this._addCheck({kind:`ip`,...X.errToObj(e)})}cidr(e){return this._addCheck({kind:`cidr`,...X.errToObj(e)})}datetime(e){return typeof e==`string`?this._addCheck({kind:`datetime`,precision:null,offset:!1,local:!1,message:e}):this._addCheck({kind:`datetime`,precision:e?.precision===void 0?null:e?.precision,offset:e?.offset??!1,local:e?.local??!1,...X.errToObj(e?.message)})}date(e){return this._addCheck({kind:`date`,message:e})}time(e){return typeof e==`string`?this._addCheck({kind:`time`,precision:null,message:e}):this._addCheck({kind:`time`,precision:e?.precision===void 0?null:e?.precision,...X.errToObj(e?.message)})}duration(e){return this._addCheck({kind:`duration`,...X.errToObj(e)})}regex(e,t){return this._addCheck({kind:`regex`,regex:e,...X.errToObj(t)})}includes(e,t){return this._addCheck({kind:`includes`,value:e,position:t?.position,...X.errToObj(t?.message)})}startsWith(e,t){return this._addCheck({kind:`startsWith`,value:e,...X.errToObj(t)})}endsWith(e,t){return this._addCheck({kind:`endsWith`,value:e,...X.errToObj(t)})}min(e,t){return this._addCheck({kind:`min`,value:e,...X.errToObj(t)})}max(e,t){return this._addCheck({kind:`max`,value:e,...X.errToObj(t)})}length(e,t){return this._addCheck({kind:`length`,value:e,...X.errToObj(t)})}nonempty(e){return this.min(1,X.errToObj(e))}trim(){return new e({...this._def,checks:[...this._def.checks,{kind:`trim`}]})}toLowerCase(){return new e({...this._def,checks:[...this._def.checks,{kind:`toLowerCase`}]})}toUpperCase(){return new e({...this._def,checks:[...this._def.checks,{kind:`toUpperCase`}]})}get isDatetime(){return!!this._def.checks.find(e=>e.kind===`datetime`)}get isDate(){return!!this._def.checks.find(e=>e.kind===`date`)}get isTime(){return!!this._def.checks.find(e=>e.kind===`time`)}get isDuration(){return!!this._def.checks.find(e=>e.kind===`duration`)}get isEmail(){return!!this._def.checks.find(e=>e.kind===`email`)}get isURL(){return!!this._def.checks.find(e=>e.kind===`url`)}get isEmoji(){return!!this._def.checks.find(e=>e.kind===`emoji`)}get isUUID(){return!!this._def.checks.find(e=>e.kind===`uuid`)}get isNANOID(){return!!this._def.checks.find(e=>e.kind===`nanoid`)}get isCUID(){return!!this._def.checks.find(e=>e.kind===`cuid`)}get isCUID2(){return!!this._def.checks.find(e=>e.kind===`cuid2`)}get isULID(){return!!this._def.checks.find(e=>e.kind===`ulid`)}get isIP(){return!!this._def.checks.find(e=>e.kind===`ip`)}get isCIDR(){return!!this._def.checks.find(e=>e.kind===`cidr`)}get isBase64(){return!!this._def.checks.find(e=>e.kind===`base64`)}get isBase64url(){return!!this._def.checks.find(e=>e.kind===`base64url`)}get minLength(){let e=null;for(let t of this._def.checks)t.kind===`min`&&(e===null||t.value>e)&&(e=t.value);return e}get maxLength(){let e=null;for(let t of this._def.checks)t.kind===`max`&&(e===null||t.valuenew zw({checks:[],typeName:Z.ZodString,coerce:e?.coerce??!1,...pw(e)});function Bw(e,t){let n=(e.toString().split(`.`)[1]||``).length,r=(t.toString().split(`.`)[1]||``).length,i=n>r?n:r;return Number.parseInt(e.toFixed(i).replace(`.`,``))%Number.parseInt(t.toFixed(i).replace(`.`,``))/10**i}var Vw=class e extends mw{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(e){if(this._def.coerce&&(e.data=Number(e.data)),this._getType(e)!==K.number){let t=this._getOrReturnCtx(e);return J(t,{code:q.invalid_type,expected:K.number,received:t.parsedType}),Y}let t,n=new iw;for(let r of this._def.checks)r.kind===`int`?XC.isInteger(e.data)||(t=this._getOrReturnCtx(e,t),J(t,{code:q.invalid_type,expected:`integer`,received:`float`,message:r.message}),n.dirty()):r.kind===`min`?(r.inclusive?e.datar.value:e.data>=r.value)&&(t=this._getOrReturnCtx(e,t),J(t,{code:q.too_big,maximum:r.value,type:`number`,inclusive:r.inclusive,exact:!1,message:r.message}),n.dirty()):r.kind===`multipleOf`?Bw(e.data,r.value)!==0&&(t=this._getOrReturnCtx(e,t),J(t,{code:q.not_multiple_of,multipleOf:r.value,message:r.message}),n.dirty()):r.kind===`finite`?Number.isFinite(e.data)||(t=this._getOrReturnCtx(e,t),J(t,{code:q.not_finite,message:r.message}),n.dirty()):XC.assertNever(r);return{status:n.value,value:e.data}}gte(e,t){return this.setLimit(`min`,e,!0,X.toString(t))}gt(e,t){return this.setLimit(`min`,e,!1,X.toString(t))}lte(e,t){return this.setLimit(`max`,e,!0,X.toString(t))}lt(e,t){return this.setLimit(`max`,e,!1,X.toString(t))}setLimit(t,n,r,i){return new e({...this._def,checks:[...this._def.checks,{kind:t,value:n,inclusive:r,message:X.toString(i)}]})}_addCheck(t){return new e({...this._def,checks:[...this._def.checks,t]})}int(e){return this._addCheck({kind:`int`,message:X.toString(e)})}positive(e){return this._addCheck({kind:`min`,value:0,inclusive:!1,message:X.toString(e)})}negative(e){return this._addCheck({kind:`max`,value:0,inclusive:!1,message:X.toString(e)})}nonpositive(e){return this._addCheck({kind:`max`,value:0,inclusive:!0,message:X.toString(e)})}nonnegative(e){return this._addCheck({kind:`min`,value:0,inclusive:!0,message:X.toString(e)})}multipleOf(e,t){return this._addCheck({kind:`multipleOf`,value:e,message:X.toString(t)})}finite(e){return this._addCheck({kind:`finite`,message:X.toString(e)})}safe(e){return this._addCheck({kind:`min`,inclusive:!0,value:-(2**53-1),message:X.toString(e)})._addCheck({kind:`max`,inclusive:!0,value:2**53-1,message:X.toString(e)})}get minValue(){let e=null;for(let t of this._def.checks)t.kind===`min`&&(e===null||t.value>e)&&(e=t.value);return e}get maxValue(){let e=null;for(let t of this._def.checks)t.kind===`max`&&(e===null||t.valuee.kind===`int`||e.kind===`multipleOf`&&XC.isInteger(e.value))}get isFinite(){let e=null,t=null;for(let n of this._def.checks)if(n.kind===`finite`||n.kind===`int`||n.kind===`multipleOf`)return!0;else n.kind===`min`?(t===null||n.value>t)&&(t=n.value):n.kind===`max`&&(e===null||n.valuenew Vw({checks:[],typeName:Z.ZodNumber,coerce:e?.coerce||!1,...pw(e)});var Hw=class e extends mw{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(e){if(this._def.coerce)try{e.data=BigInt(e.data)}catch{return this._getInvalidInput(e)}if(this._getType(e)!==K.bigint)return this._getInvalidInput(e);let t,n=new iw;for(let r of this._def.checks)r.kind===`min`?(r.inclusive?e.datar.value:e.data>=r.value)&&(t=this._getOrReturnCtx(e,t),J(t,{code:q.too_big,type:`bigint`,maximum:r.value,inclusive:r.inclusive,message:r.message}),n.dirty()):r.kind===`multipleOf`?e.data%r.value!==BigInt(0)&&(t=this._getOrReturnCtx(e,t),J(t,{code:q.not_multiple_of,multipleOf:r.value,message:r.message}),n.dirty()):XC.assertNever(r);return{status:n.value,value:e.data}}_getInvalidInput(e){let t=this._getOrReturnCtx(e);return J(t,{code:q.invalid_type,expected:K.bigint,received:t.parsedType}),Y}gte(e,t){return this.setLimit(`min`,e,!0,X.toString(t))}gt(e,t){return this.setLimit(`min`,e,!1,X.toString(t))}lte(e,t){return this.setLimit(`max`,e,!0,X.toString(t))}lt(e,t){return this.setLimit(`max`,e,!1,X.toString(t))}setLimit(t,n,r,i){return new e({...this._def,checks:[...this._def.checks,{kind:t,value:n,inclusive:r,message:X.toString(i)}]})}_addCheck(t){return new e({...this._def,checks:[...this._def.checks,t]})}positive(e){return this._addCheck({kind:`min`,value:BigInt(0),inclusive:!1,message:X.toString(e)})}negative(e){return this._addCheck({kind:`max`,value:BigInt(0),inclusive:!1,message:X.toString(e)})}nonpositive(e){return this._addCheck({kind:`max`,value:BigInt(0),inclusive:!0,message:X.toString(e)})}nonnegative(e){return this._addCheck({kind:`min`,value:BigInt(0),inclusive:!0,message:X.toString(e)})}multipleOf(e,t){return this._addCheck({kind:`multipleOf`,value:e,message:X.toString(t)})}get minValue(){let e=null;for(let t of this._def.checks)t.kind===`min`&&(e===null||t.value>e)&&(e=t.value);return e}get maxValue(){let e=null;for(let t of this._def.checks)t.kind===`max`&&(e===null||t.valuenew Hw({checks:[],typeName:Z.ZodBigInt,coerce:e?.coerce??!1,...pw(e)});var Uw=class extends mw{_parse(e){if(this._def.coerce&&(e.data=!!e.data),this._getType(e)!==K.boolean){let t=this._getOrReturnCtx(e);return J(t,{code:q.invalid_type,expected:K.boolean,received:t.parsedType}),Y}return ow(e.data)}};Uw.create=e=>new Uw({typeName:Z.ZodBoolean,coerce:e?.coerce||!1,...pw(e)});var Ww=class e extends mw{_parse(e){if(this._def.coerce&&(e.data=new Date(e.data)),this._getType(e)!==K.date){let t=this._getOrReturnCtx(e);return J(t,{code:q.invalid_type,expected:K.date,received:t.parsedType}),Y}if(Number.isNaN(e.data.getTime()))return J(this._getOrReturnCtx(e),{code:q.invalid_date}),Y;let t=new iw,n;for(let r of this._def.checks)r.kind===`min`?e.data.getTime()r.value&&(n=this._getOrReturnCtx(e,n),J(n,{code:q.too_big,message:r.message,inclusive:!0,exact:!1,maximum:r.value,type:`date`}),t.dirty()):XC.assertNever(r);return{status:t.value,value:new Date(e.data.getTime())}}_addCheck(t){return new e({...this._def,checks:[...this._def.checks,t]})}min(e,t){return this._addCheck({kind:`min`,value:e.getTime(),message:X.toString(t)})}max(e,t){return this._addCheck({kind:`max`,value:e.getTime(),message:X.toString(t)})}get minDate(){let e=null;for(let t of this._def.checks)t.kind===`min`&&(e===null||t.value>e)&&(e=t.value);return e==null?null:new Date(e)}get maxDate(){let e=null;for(let t of this._def.checks)t.kind===`max`&&(e===null||t.valuenew Ww({checks:[],coerce:e?.coerce||!1,typeName:Z.ZodDate,...pw(e)});var Gw=class extends mw{_parse(e){if(this._getType(e)!==K.symbol){let t=this._getOrReturnCtx(e);return J(t,{code:q.invalid_type,expected:K.symbol,received:t.parsedType}),Y}return ow(e.data)}};Gw.create=e=>new Gw({typeName:Z.ZodSymbol,...pw(e)});var Kw=class extends mw{_parse(e){if(this._getType(e)!==K.undefined){let t=this._getOrReturnCtx(e);return J(t,{code:q.invalid_type,expected:K.undefined,received:t.parsedType}),Y}return ow(e.data)}};Kw.create=e=>new Kw({typeName:Z.ZodUndefined,...pw(e)});var qw=class extends mw{_parse(e){if(this._getType(e)!==K.null){let t=this._getOrReturnCtx(e);return J(t,{code:q.invalid_type,expected:K.null,received:t.parsedType}),Y}return ow(e.data)}};qw.create=e=>new qw({typeName:Z.ZodNull,...pw(e)});var Jw=class extends mw{constructor(){super(...arguments),this._any=!0}_parse(e){return ow(e.data)}};Jw.create=e=>new Jw({typeName:Z.ZodAny,...pw(e)});var Yw=class extends mw{constructor(){super(...arguments),this._unknown=!0}_parse(e){return ow(e.data)}};Yw.create=e=>new Yw({typeName:Z.ZodUnknown,...pw(e)});var Xw=class extends mw{_parse(e){let t=this._getOrReturnCtx(e);return J(t,{code:q.invalid_type,expected:K.never,received:t.parsedType}),Y}};Xw.create=e=>new Xw({typeName:Z.ZodNever,...pw(e)});var Zw=class extends mw{_parse(e){if(this._getType(e)!==K.undefined){let t=this._getOrReturnCtx(e);return J(t,{code:q.invalid_type,expected:K.void,received:t.parsedType}),Y}return ow(e.data)}};Zw.create=e=>new Zw({typeName:Z.ZodVoid,...pw(e)});var Qw=class e extends mw{_parse(e){let{ctx:t,status:n}=this._processInputParams(e),r=this._def;if(t.parsedType!==K.array)return J(t,{code:q.invalid_type,expected:K.array,received:t.parsedType}),Y;if(r.exactLength!==null){let e=t.data.length>r.exactLength.value,i=t.data.lengthr.maxLength.value&&(J(t,{code:q.too_big,maximum:r.maxLength.value,type:`array`,inclusive:!0,exact:!1,message:r.maxLength.message}),n.dirty()),t.common.async)return Promise.all([...t.data].map((e,n)=>r.type._parseAsync(new dw(t,e,t.path,n)))).then(e=>iw.mergeArray(n,e));let i=[...t.data].map((e,n)=>r.type._parseSync(new dw(t,e,t.path,n)));return iw.mergeArray(n,i)}get element(){return this._def.type}min(t,n){return new e({...this._def,minLength:{value:t,message:X.toString(n)}})}max(t,n){return new e({...this._def,maxLength:{value:t,message:X.toString(n)}})}length(t,n){return new e({...this._def,exactLength:{value:t,message:X.toString(n)}})}nonempty(e){return this.min(1,e)}};Qw.create=(e,t)=>new Qw({type:e,minLength:null,maxLength:null,exactLength:null,typeName:Z.ZodArray,...pw(t)});function $w(e){if(e instanceof eT){let t={};for(let n in e.shape){let r=e.shape[n];t[n]=vT.create($w(r))}return new eT({...e._def,shape:()=>t})}return e instanceof Qw?new Qw({...e._def,type:$w(e.element)}):e instanceof vT?vT.create($w(e.unwrap())):e instanceof yT?yT.create($w(e.unwrap())):e instanceof oT?oT.create(e.items.map(e=>$w(e))):e}var eT=class e extends mw{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;let e=this._def.shape(),t=XC.objectKeys(e);return this._cached={shape:e,keys:t},this._cached}_parse(e){if(this._getType(e)!==K.object){let t=this._getOrReturnCtx(e);return J(t,{code:q.invalid_type,expected:K.object,received:t.parsedType}),Y}let{status:t,ctx:n}=this._processInputParams(e),{shape:r,keys:i}=this._getCached(),a=[];if(!(this._def.catchall instanceof Xw&&this._def.unknownKeys===`strip`))for(let e in n.data)i.includes(e)||a.push(e);let o=[];for(let e of i){let t=r[e],i=n.data[e];o.push({key:{status:`valid`,value:e},value:t._parse(new dw(n,i,n.path,e)),alwaysSet:e in n.data})}if(this._def.catchall instanceof Xw){let e=this._def.unknownKeys;if(e===`passthrough`)for(let e of a)o.push({key:{status:`valid`,value:e},value:{status:`valid`,value:n.data[e]}});else if(e===`strict`)a.length>0&&(J(n,{code:q.unrecognized_keys,keys:a}),t.dirty());else if(e!==`strip`)throw Error(`Internal ZodObject error: invalid unknownKeys value.`)}else{let e=this._def.catchall;for(let t of a){let r=n.data[t];o.push({key:{status:`valid`,value:t},value:e._parse(new dw(n,r,n.path,t)),alwaysSet:t in n.data})}}return n.common.async?Promise.resolve().then(async()=>{let e=[];for(let t of o){let n=await t.key,r=await t.value;e.push({key:n,value:r,alwaysSet:t.alwaysSet})}return e}).then(e=>iw.mergeObjectSync(t,e)):iw.mergeObjectSync(t,o)}get shape(){return this._def.shape()}strict(t){return X.errToObj,new e({...this._def,unknownKeys:`strict`,...t===void 0?{}:{errorMap:(e,n)=>{let r=this._def.errorMap?.(e,n).message??n.defaultError;return e.code===`unrecognized_keys`?{message:X.errToObj(t).message??r}:{message:r}}}})}strip(){return new e({...this._def,unknownKeys:`strip`})}passthrough(){return new e({...this._def,unknownKeys:`passthrough`})}extend(t){return new e({...this._def,shape:()=>({...this._def.shape(),...t})})}merge(t){return new e({unknownKeys:t._def.unknownKeys,catchall:t._def.catchall,shape:()=>({...this._def.shape(),...t._def.shape()}),typeName:Z.ZodObject})}setKey(e,t){return this.augment({[e]:t})}catchall(t){return new e({...this._def,catchall:t})}pick(t){let n={};for(let e of XC.objectKeys(t))t[e]&&this.shape[e]&&(n[e]=this.shape[e]);return new e({...this._def,shape:()=>n})}omit(t){let n={};for(let e of XC.objectKeys(this.shape))t[e]||(n[e]=this.shape[e]);return new e({...this._def,shape:()=>n})}deepPartial(){return $w(this)}partial(t){let n={};for(let e of XC.objectKeys(this.shape)){let r=this.shape[e];n[e]=t&&!t[e]?r:r.optional()}return new e({...this._def,shape:()=>n})}required(t){let n={};for(let e of XC.objectKeys(this.shape))if(t&&!t[e])n[e]=this.shape[e];else{let t=this.shape[e];for(;t instanceof vT;)t=t._def.innerType;n[e]=t}return new e({...this._def,shape:()=>n})}keyof(){return pT(XC.objectKeys(this.shape))}};eT.create=(e,t)=>new eT({shape:()=>e,unknownKeys:`strip`,catchall:Xw.create(),typeName:Z.ZodObject,...pw(t)}),eT.strictCreate=(e,t)=>new eT({shape:()=>e,unknownKeys:`strict`,catchall:Xw.create(),typeName:Z.ZodObject,...pw(t)}),eT.lazycreate=(e,t)=>new eT({shape:e,unknownKeys:`strip`,catchall:Xw.create(),typeName:Z.ZodObject,...pw(t)});var tT=class extends mw{_parse(e){let{ctx:t}=this._processInputParams(e),n=this._def.options;function r(e){for(let t of e)if(t.result.status===`valid`)return t.result;for(let n of e)if(n.result.status===`dirty`)return t.common.issues.push(...n.ctx.common.issues),n.result;let n=e.map(e=>new $C(e.ctx.common.issues));return J(t,{code:q.invalid_union,unionErrors:n}),Y}if(t.common.async)return Promise.all(n.map(async e=>{let n={...t,common:{...t.common,issues:[]},parent:null};return{result:await e._parseAsync({data:t.data,path:t.path,parent:n}),ctx:n}})).then(r);{let e,r=[];for(let i of n){let n={...t,common:{...t.common,issues:[]},parent:null},a=i._parseSync({data:t.data,path:t.path,parent:n});if(a.status===`valid`)return a;a.status===`dirty`&&!e&&(e={result:a,ctx:n}),n.common.issues.length&&r.push(n.common.issues)}if(e)return t.common.issues.push(...e.ctx.common.issues),e.result;let i=r.map(e=>new $C(e));return J(t,{code:q.invalid_union,unionErrors:i}),Y}}get options(){return this._def.options}};tT.create=(e,t)=>new tT({options:e,typeName:Z.ZodUnion,...pw(t)});var nT=e=>e instanceof dT?nT(e.schema):e instanceof _T?nT(e.innerType()):e instanceof fT?[e.value]:e instanceof mT?e.options:e instanceof hT?XC.objectValues(e.enum):e instanceof bT?nT(e._def.innerType):e instanceof Kw?[void 0]:e instanceof qw?[null]:e instanceof vT?[void 0,...nT(e.unwrap())]:e instanceof yT?[null,...nT(e.unwrap())]:e instanceof CT||e instanceof TT?nT(e.unwrap()):e instanceof xT?nT(e._def.innerType):[],rT=class e extends mw{_parse(e){let{ctx:t}=this._processInputParams(e);if(t.parsedType!==K.object)return J(t,{code:q.invalid_type,expected:K.object,received:t.parsedType}),Y;let n=this.discriminator,r=t.data[n],i=this.optionsMap.get(r);return i?t.common.async?i._parseAsync({data:t.data,path:t.path,parent:t}):i._parseSync({data:t.data,path:t.path,parent:t}):(J(t,{code:q.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[n]}),Y)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(t,n,r){let i=new Map;for(let e of n){let n=nT(e.shape[t]);if(!n.length)throw Error(`A discriminator value for key \`${t}\` could not be extracted from all schema options`);for(let r of n){if(i.has(r))throw Error(`Discriminator property ${String(t)} has duplicate value ${String(r)}`);i.set(r,e)}}return new e({typeName:Z.ZodDiscriminatedUnion,discriminator:t,options:n,optionsMap:i,...pw(r)})}};function iT(e,t){let n=QC(e),r=QC(t);if(e===t)return{valid:!0,data:e};if(n===K.object&&r===K.object){let n=XC.objectKeys(t),r=XC.objectKeys(e).filter(e=>n.indexOf(e)!==-1),i={...e,...t};for(let n of r){let r=iT(e[n],t[n]);if(!r.valid)return{valid:!1};i[n]=r.data}return{valid:!0,data:i}}if(n===K.array&&r===K.array){if(e.length!==t.length)return{valid:!1};let n=[];for(let r=0;r{if(sw(e)||sw(r))return Y;let i=iT(e.value,r.value);return i.valid?((cw(e)||cw(r))&&t.dirty(),{status:t.value,value:i.data}):(J(n,{code:q.invalid_intersection_types}),Y)};return n.common.async?Promise.all([this._def.left._parseAsync({data:n.data,path:n.path,parent:n}),this._def.right._parseAsync({data:n.data,path:n.path,parent:n})]).then(([e,t])=>r(e,t)):r(this._def.left._parseSync({data:n.data,path:n.path,parent:n}),this._def.right._parseSync({data:n.data,path:n.path,parent:n}))}};aT.create=(e,t,n)=>new aT({left:e,right:t,typeName:Z.ZodIntersection,...pw(n)});var oT=class e extends mw{_parse(e){let{status:t,ctx:n}=this._processInputParams(e);if(n.parsedType!==K.array)return J(n,{code:q.invalid_type,expected:K.array,received:n.parsedType}),Y;if(n.data.lengththis._def.items.length&&(J(n,{code:q.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:`array`}),t.dirty());let r=[...n.data].map((e,t)=>{let r=this._def.items[t]||this._def.rest;return r?r._parse(new dw(n,e,n.path,t)):null}).filter(e=>!!e);return n.common.async?Promise.all(r).then(e=>iw.mergeArray(t,e)):iw.mergeArray(t,r)}get items(){return this._def.items}rest(t){return new e({...this._def,rest:t})}};oT.create=(e,t)=>{if(!Array.isArray(e))throw Error(`You must pass an array of schemas to z.tuple([ ... ])`);return new oT({items:e,typeName:Z.ZodTuple,rest:null,...pw(t)})};var sT=class e extends mw{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){let{status:t,ctx:n}=this._processInputParams(e);if(n.parsedType!==K.object)return J(n,{code:q.invalid_type,expected:K.object,received:n.parsedType}),Y;let r=[],i=this._def.keyType,a=this._def.valueType;for(let e in n.data)r.push({key:i._parse(new dw(n,e,n.path,e)),value:a._parse(new dw(n,n.data[e],n.path,e)),alwaysSet:e in n.data});return n.common.async?iw.mergeObjectAsync(t,r):iw.mergeObjectSync(t,r)}get element(){return this._def.valueType}static create(t,n,r){return n instanceof mw?new e({keyType:t,valueType:n,typeName:Z.ZodRecord,...pw(r)}):new e({keyType:zw.create(),valueType:t,typeName:Z.ZodRecord,...pw(n)})}},cT=class extends mw{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){let{status:t,ctx:n}=this._processInputParams(e);if(n.parsedType!==K.map)return J(n,{code:q.invalid_type,expected:K.map,received:n.parsedType}),Y;let r=this._def.keyType,i=this._def.valueType,a=[...n.data.entries()].map(([e,t],a)=>({key:r._parse(new dw(n,e,n.path,[a,`key`])),value:i._parse(new dw(n,t,n.path,[a,`value`]))}));if(n.common.async){let e=new Map;return Promise.resolve().then(async()=>{for(let n of a){let r=await n.key,i=await n.value;if(r.status===`aborted`||i.status===`aborted`)return Y;(r.status===`dirty`||i.status===`dirty`)&&t.dirty(),e.set(r.value,i.value)}return{status:t.value,value:e}})}{let e=new Map;for(let n of a){let r=n.key,i=n.value;if(r.status===`aborted`||i.status===`aborted`)return Y;(r.status===`dirty`||i.status===`dirty`)&&t.dirty(),e.set(r.value,i.value)}return{status:t.value,value:e}}}};cT.create=(e,t,n)=>new cT({valueType:t,keyType:e,typeName:Z.ZodMap,...pw(n)});var lT=class e extends mw{_parse(e){let{status:t,ctx:n}=this._processInputParams(e);if(n.parsedType!==K.set)return J(n,{code:q.invalid_type,expected:K.set,received:n.parsedType}),Y;let r=this._def;r.minSize!==null&&n.data.sizer.maxSize.value&&(J(n,{code:q.too_big,maximum:r.maxSize.value,type:`set`,inclusive:!0,exact:!1,message:r.maxSize.message}),t.dirty());let i=this._def.valueType;function a(e){let n=new Set;for(let r of e){if(r.status===`aborted`)return Y;r.status===`dirty`&&t.dirty(),n.add(r.value)}return{status:t.value,value:n}}let o=[...n.data.values()].map((e,t)=>i._parse(new dw(n,e,n.path,t)));return n.common.async?Promise.all(o).then(e=>a(e)):a(o)}min(t,n){return new e({...this._def,minSize:{value:t,message:X.toString(n)}})}max(t,n){return new e({...this._def,maxSize:{value:t,message:X.toString(n)}})}size(e,t){return this.min(e,t).max(e,t)}nonempty(e){return this.min(1,e)}};lT.create=(e,t)=>new lT({valueType:e,minSize:null,maxSize:null,typeName:Z.ZodSet,...pw(t)});var uT=class e extends mw{constructor(){super(...arguments),this.validate=this.implement}_parse(e){let{ctx:t}=this._processInputParams(e);if(t.parsedType!==K.function)return J(t,{code:q.invalid_type,expected:K.function,received:t.parsedType}),Y;function n(e,n){return rw({data:e,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,nw(),ew].filter(e=>!!e),issueData:{code:q.invalid_arguments,argumentsError:n}})}function r(e,n){return rw({data:e,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,nw(),ew].filter(e=>!!e),issueData:{code:q.invalid_return_type,returnTypeError:n}})}let i={errorMap:t.common.contextualErrorMap},a=t.data;if(this._def.returns instanceof gT){let e=this;return ow(async function(...t){let o=new $C([]),s=await e._def.args.parseAsync(t,i).catch(e=>{throw o.addIssue(n(t,e)),o}),c=await Reflect.apply(a,this,s);return await e._def.returns._def.type.parseAsync(c,i).catch(e=>{throw o.addIssue(r(c,e)),o})})}{let e=this;return ow(function(...t){let o=e._def.args.safeParse(t,i);if(!o.success)throw new $C([n(t,o.error)]);let s=Reflect.apply(a,this,o.data),c=e._def.returns.safeParse(s,i);if(!c.success)throw new $C([r(s,c.error)]);return c.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...t){return new e({...this._def,args:oT.create(t).rest(Yw.create())})}returns(t){return new e({...this._def,returns:t})}implement(e){return this.parse(e)}strictImplement(e){return this.parse(e)}static create(t,n,r){return new e({args:t||oT.create([]).rest(Yw.create()),returns:n||Yw.create(),typeName:Z.ZodFunction,...pw(r)})}},dT=class extends mw{get schema(){return this._def.getter()}_parse(e){let{ctx:t}=this._processInputParams(e);return this._def.getter()._parse({data:t.data,path:t.path,parent:t})}};dT.create=(e,t)=>new dT({getter:e,typeName:Z.ZodLazy,...pw(t)});var fT=class extends mw{_parse(e){if(e.data!==this._def.value){let t=this._getOrReturnCtx(e);return J(t,{received:t.data,code:q.invalid_literal,expected:this._def.value}),Y}return{status:`valid`,value:e.data}}get value(){return this._def.value}};fT.create=(e,t)=>new fT({value:e,typeName:Z.ZodLiteral,...pw(t)});function pT(e,t){return new mT({values:e,typeName:Z.ZodEnum,...pw(t)})}var mT=class e extends mw{_parse(e){if(typeof e.data!=`string`){let t=this._getOrReturnCtx(e),n=this._def.values;return J(t,{expected:XC.joinValues(n),received:t.parsedType,code:q.invalid_type}),Y}if(this._cache||=new Set(this._def.values),!this._cache.has(e.data)){let t=this._getOrReturnCtx(e),n=this._def.values;return J(t,{received:t.data,code:q.invalid_enum_value,options:n}),Y}return ow(e.data)}get options(){return this._def.values}get enum(){let e={};for(let t of this._def.values)e[t]=t;return e}get Values(){let e={};for(let t of this._def.values)e[t]=t;return e}get Enum(){let e={};for(let t of this._def.values)e[t]=t;return e}extract(t,n=this._def){return e.create(t,{...this._def,...n})}exclude(t,n=this._def){return e.create(this.options.filter(e=>!t.includes(e)),{...this._def,...n})}};mT.create=pT;var hT=class extends mw{_parse(e){let t=XC.getValidEnumValues(this._def.values),n=this._getOrReturnCtx(e);if(n.parsedType!==K.string&&n.parsedType!==K.number){let e=XC.objectValues(t);return J(n,{expected:XC.joinValues(e),received:n.parsedType,code:q.invalid_type}),Y}if(this._cache||=new Set(XC.getValidEnumValues(this._def.values)),!this._cache.has(e.data)){let e=XC.objectValues(t);return J(n,{received:n.data,code:q.invalid_enum_value,options:e}),Y}return ow(e.data)}get enum(){return this._def.values}};hT.create=(e,t)=>new hT({values:e,typeName:Z.ZodNativeEnum,...pw(t)});var gT=class extends mw{unwrap(){return this._def.type}_parse(e){let{ctx:t}=this._processInputParams(e);return t.parsedType!==K.promise&&t.common.async===!1?(J(t,{code:q.invalid_type,expected:K.promise,received:t.parsedType}),Y):ow((t.parsedType===K.promise?t.data:Promise.resolve(t.data)).then(e=>this._def.type.parseAsync(e,{path:t.path,errorMap:t.common.contextualErrorMap})))}};gT.create=(e,t)=>new gT({type:e,typeName:Z.ZodPromise,...pw(t)});var _T=class extends mw{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===Z.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(e){let{status:t,ctx:n}=this._processInputParams(e),r=this._def.effect||null,i={addIssue:e=>{J(n,e),e.fatal?t.abort():t.dirty()},get path(){return n.path}};if(i.addIssue=i.addIssue.bind(i),r.type===`preprocess`){let e=r.transform(n.data,i);if(n.common.async)return Promise.resolve(e).then(async e=>{if(t.value===`aborted`)return Y;let r=await this._def.schema._parseAsync({data:e,path:n.path,parent:n});return r.status===`aborted`?Y:r.status===`dirty`||t.value===`dirty`?aw(r.value):r});{if(t.value===`aborted`)return Y;let r=this._def.schema._parseSync({data:e,path:n.path,parent:n});return r.status===`aborted`?Y:r.status===`dirty`||t.value===`dirty`?aw(r.value):r}}if(r.type===`refinement`){let e=e=>{let t=r.refinement(e,i);if(n.common.async)return Promise.resolve(t);if(t instanceof Promise)throw Error(`Async refinement encountered during synchronous parse operation. Use .parseAsync instead.`);return e};if(n.common.async===!1){let r=this._def.schema._parseSync({data:n.data,path:n.path,parent:n});return r.status===`aborted`?Y:(r.status===`dirty`&&t.dirty(),e(r.value),{status:t.value,value:r.value})}return this._def.schema._parseAsync({data:n.data,path:n.path,parent:n}).then(n=>n.status===`aborted`?Y:(n.status===`dirty`&&t.dirty(),e(n.value).then(()=>({status:t.value,value:n.value}))))}if(r.type===`transform`){if(n.common.async===!1){let e=this._def.schema._parseSync({data:n.data,path:n.path,parent:n});if(!lw(e))return Y;let a=r.transform(e.value,i);if(a instanceof Promise)throw Error(`Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.`);return{status:t.value,value:a}}return this._def.schema._parseAsync({data:n.data,path:n.path,parent:n}).then(e=>lw(e)?Promise.resolve(r.transform(e.value,i)).then(e=>({status:t.value,value:e})):Y)}XC.assertNever(r)}};_T.create=(e,t,n)=>new _T({schema:e,typeName:Z.ZodEffects,effect:t,...pw(n)}),_T.createWithPreprocess=(e,t,n)=>new _T({schema:t,effect:{type:`preprocess`,transform:e},typeName:Z.ZodEffects,...pw(n)});var vT=class extends mw{_parse(e){return this._getType(e)===K.undefined?ow(void 0):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}};vT.create=(e,t)=>new vT({innerType:e,typeName:Z.ZodOptional,...pw(t)});var yT=class extends mw{_parse(e){return this._getType(e)===K.null?ow(null):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}};yT.create=(e,t)=>new yT({innerType:e,typeName:Z.ZodNullable,...pw(t)});var bT=class extends mw{_parse(e){let{ctx:t}=this._processInputParams(e),n=t.data;return t.parsedType===K.undefined&&(n=this._def.defaultValue()),this._def.innerType._parse({data:n,path:t.path,parent:t})}removeDefault(){return this._def.innerType}};bT.create=(e,t)=>new bT({innerType:e,typeName:Z.ZodDefault,defaultValue:typeof t.default==`function`?t.default:()=>t.default,...pw(t)});var xT=class extends mw{_parse(e){let{ctx:t}=this._processInputParams(e),n={...t,common:{...t.common,issues:[]}},r=this._def.innerType._parse({data:n.data,path:n.path,parent:{...n}});return uw(r)?r.then(e=>({status:`valid`,value:e.status===`valid`?e.value:this._def.catchValue({get error(){return new $C(n.common.issues)},input:n.data})})):{status:`valid`,value:r.status===`valid`?r.value:this._def.catchValue({get error(){return new $C(n.common.issues)},input:n.data})}}removeCatch(){return this._def.innerType}};xT.create=(e,t)=>new xT({innerType:e,typeName:Z.ZodCatch,catchValue:typeof t.catch==`function`?t.catch:()=>t.catch,...pw(t)});var ST=class extends mw{_parse(e){if(this._getType(e)!==K.nan){let t=this._getOrReturnCtx(e);return J(t,{code:q.invalid_type,expected:K.nan,received:t.parsedType}),Y}return{status:`valid`,value:e.data}}};ST.create=e=>new ST({typeName:Z.ZodNaN,...pw(e)});var CT=class extends mw{_parse(e){let{ctx:t}=this._processInputParams(e),n=t.data;return this._def.type._parse({data:n,path:t.path,parent:t})}unwrap(){return this._def.type}},wT=class e extends mw{_parse(e){let{status:t,ctx:n}=this._processInputParams(e);if(n.common.async)return(async()=>{let e=await this._def.in._parseAsync({data:n.data,path:n.path,parent:n});return e.status===`aborted`?Y:e.status===`dirty`?(t.dirty(),aw(e.value)):this._def.out._parseAsync({data:e.value,path:n.path,parent:n})})();{let e=this._def.in._parseSync({data:n.data,path:n.path,parent:n});return e.status===`aborted`?Y:e.status===`dirty`?(t.dirty(),{status:`dirty`,value:e.value}):this._def.out._parseSync({data:e.value,path:n.path,parent:n})}}static create(t,n){return new e({in:t,out:n,typeName:Z.ZodPipeline})}},TT=class extends mw{_parse(e){let t=this._def.innerType._parse(e),n=e=>(lw(e)&&(e.value=Object.freeze(e.value)),e);return uw(t)?t.then(e=>n(e)):n(t)}unwrap(){return this._def.innerType}};TT.create=(e,t)=>new TT({innerType:e,typeName:Z.ZodReadonly,...pw(t)}),eT.lazycreate;var Z;(function(e){e.ZodString=`ZodString`,e.ZodNumber=`ZodNumber`,e.ZodNaN=`ZodNaN`,e.ZodBigInt=`ZodBigInt`,e.ZodBoolean=`ZodBoolean`,e.ZodDate=`ZodDate`,e.ZodSymbol=`ZodSymbol`,e.ZodUndefined=`ZodUndefined`,e.ZodNull=`ZodNull`,e.ZodAny=`ZodAny`,e.ZodUnknown=`ZodUnknown`,e.ZodNever=`ZodNever`,e.ZodVoid=`ZodVoid`,e.ZodArray=`ZodArray`,e.ZodObject=`ZodObject`,e.ZodUnion=`ZodUnion`,e.ZodDiscriminatedUnion=`ZodDiscriminatedUnion`,e.ZodIntersection=`ZodIntersection`,e.ZodTuple=`ZodTuple`,e.ZodRecord=`ZodRecord`,e.ZodMap=`ZodMap`,e.ZodSet=`ZodSet`,e.ZodFunction=`ZodFunction`,e.ZodLazy=`ZodLazy`,e.ZodLiteral=`ZodLiteral`,e.ZodEnum=`ZodEnum`,e.ZodEffects=`ZodEffects`,e.ZodNativeEnum=`ZodNativeEnum`,e.ZodOptional=`ZodOptional`,e.ZodNullable=`ZodNullable`,e.ZodDefault=`ZodDefault`,e.ZodCatch=`ZodCatch`,e.ZodPromise=`ZodPromise`,e.ZodBranded=`ZodBranded`,e.ZodPipeline=`ZodPipeline`,e.ZodReadonly=`ZodReadonly`})(Z||={});var ET=zw.create;Vw.create,ST.create,Hw.create;var DT=Uw.create;Ww.create,Gw.create,Kw.create,qw.create;var OT=Jw.create;Yw.create,Xw.create,Zw.create,Qw.create;var kT=eT.create;eT.strictCreate,tT.create;var AT=rT.create;aT.create,oT.create,sT.create,cT.create,lT.create,uT.create,dT.create;var jT=fT.create,MT=mT.create;hT.create,gT.create,_T.create,vT.create,yT.create,_T.createWithPreprocess,wT.create;var NT=/^[v^~<>=]*?(\d+)(?:\.([x*]|\d+)(?:\.([x*]|\d+)(?:\.([x*]|\d+))?(?:-([\da-z\-]+(?:\.[\da-z\-]+)*))?(?:\+[\da-z\-]+(?:\.[\da-z\-]+)*)?)?)?$/i,PT=e=>{if(typeof e!=`string`)throw TypeError(`Invalid argument expected string`);let t=e.match(NT);if(!t)throw Error(`Invalid argument not valid semver ('${e}' received)`);return t.shift(),t},FT=e=>e===`*`||e===`x`||e===`X`,IT=e=>{let t=parseInt(e,10);return isNaN(t)?e:t},LT=(e,t)=>typeof e==typeof t?[e,t]:[String(e),String(t)],RT=(e,t)=>{if(FT(e)||FT(t))return 0;let[n,r]=LT(IT(e),IT(t));return n>r?1:n{for(let n=0;n{let n=PT(e),r=PT(t),i=n.pop(),a=r.pop(),o=zT(n,r);return o===0?i&&a?zT(i.split(`.`),a.split(`.`)):i||a?i?-1:1:0:o},VT=e=>{if(typeof structuredClone==`function`)return structuredClone(e);try{return JSON.parse(JSON.stringify(e))}catch{return Array.isArray(e)?[...e]:{...e}}};function HT(){return Eg()}function UT(e){if(Object.freeze(e),typeof e==`object`&&e)for(let t of Object.values(e))typeof t==`object`&&t&&!Object.isFrozen(t)&&UT(t);return e}var WT=524288;function GT(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 KT(e,t,n,r){let i=typeof process<`u`&&!0,a=i&&!!{}.VITEST_WORKER_ID,o=i&&!!{}.VITEST_WORKER_ID,s=o&&!GT(t,n,WT),c=s?VT(t):t,l=s?VT(n):n,u=!1,d=!1,f;for(let t of e)try{s&&(UT(c),UT(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=VT(e.messages),u=!0,n=!0),e.state!==void 0&&e.state!==l&&(l=VT(e.state),d=!0,n=!0),s&&n&>(c,l,WT)&&(s=!1),f=e.stopPropagation,f===!0)break}catch(e){if(o&&e instanceof TypeError){if(a)throw e;console.error(`AG-UI: Subscriber attempted to mutate frozen inputs in-place. Return mutations via AgentStateMutation instead of mutating directly.`,e)}else a||console.error(`Subscriber error:`,e);continue}return{...u?{messages:Object.isFrozen(c)?VT(c):c}:{},...d?{state:Object.isFrozen(l)?VT(l):l}:{},...f===void 0?{}:{stopPropagation:f}}}function qT(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 JT(e){if(e instanceof YT)return e;if(e===!0)return new YT(qT(!0))}var YT=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 XT(e){return e.enabled?new YT(e):void 0}function ZT(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}var QT=(e,t,n,r,i)=>{let a=JT(i),o=VT(n.messages),s=VT(e.state),c={},l=e=>{e.messages!==void 0&&(o=e.messages,c.messages=e.messages),e.state!==void 0&&(s=e.state,c.state=e.state)},u=()=>{let e=VT(c);return c={},e.messages!==void 0||e.state!==void 0?Nx(e):ex};return t.pipe(Ux(async t=>{let i=await KT(r,o,s,(r,i,a)=>r.onEvent?.({event:t,agent:n,input:e,messages:i,state:a}));if(l(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 u();switch(t.type){case H.TEXT_MESSAGE_START:{let i=await KT(r,o,s,(r,i,a)=>r.onTextMessageStartEvent?.({event:t,messages:i,state:a,agent:n,input:e}));if(l(i),i.stopPropagation!==!0){let{messageId:e,role:n=`assistant`,name:r}=t;if(!o.find(t=>t.id===e)){let t={id:e,role:n,content:``,...r!==void 0&&{name:r}};o.push(t),l({messages:o})}}return u()}case H.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}'`),u();let d=await KT(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 l(d),d.stopPropagation!==!0&&(c.content=`${typeof c.content==`string`?c.content:``}${a}`,l({messages:o})),u()}case H.TEXT_MESSAGE_END:{let{messageId:i}=t,a=o.find(e=>e.id===i);return a?(l(await KT(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:``}))),await Promise.all(r.map(t=>{t.onNewMessage?.({message:a,messages:o,state:s,agent:n,input:e})})),u()):(console.warn(`TEXT_MESSAGE_END: No message found with ID '${i}'`),u())}case H.TOOL_CALL_START:{let i=await KT(r,o,s,(r,i,a)=>r.onToolCallStartEvent?.({event:t,messages:i,state:a,agent:n,input:e}));if(l(i),i.stopPropagation!==!0){let{toolCallId:e,toolCallName:n,parentMessageId:r}=t,i=o.find(t=>t.toolCalls?.some(t=>t.id===e))?.toolCalls?.find(t=>t.id===e);if(i)return i.function.name!==n&&(console.warn(`TOOL_CALL_START: tool call '${e}' already exists with name '${i.function.name}' — updating it to '${n}'`),i.function.name=n,l({messages:o})),u();let a=ZT(o,r,e);a.toolCalls??=[],a.toolCalls.push({id:e,type:`function`,function:{name:n,arguments:``}}),l({messages:o})}return u()}case H.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}'`),u();let d=c.toolCalls?.find(e=>e.id===i);if(!d)return console.warn(`TOOL_CALL_ARGS: No tool call found with ID '${i}'`),u();let f=await KT(r,o,s,(r,i,a)=>{let o=d.function.arguments,s=d.function.name,c={};try{c=Xx(o)}catch{}return r.onToolCallArgsEvent?.({event:t,messages:i,state:a,agent:n,input:e,toolCallBuffer:o,toolCallName:s,partialToolCallArgs:c})});return l(f),f.stopPropagation!==!0&&(d.function.arguments+=a,l({messages:o})),u()}case H.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}'`),u();let c=a.toolCalls?.find(e=>e.id===i);return c?(l(await KT(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})})),await Promise.all(r.map(t=>{t.onNewToolCall?.({toolCall:c,messages:o,state:s,agent:n,input:e})})),u()):(console.warn(`TOOL_CALL_END: No tool call found with ID '${i}'`),u())}case H.TOOL_CALL_RESULT:{let i=await KT(r,o,s,(r,i,a)=>r.onToolCallResultEvent?.({event:t,messages:i,state:a,agent:n,input:e}));if(l(i),i.stopPropagation!==!0){let{messageId:i,toolCallId:a,content:c,role:u}=t,d={id:i,toolCallId:a,role:u||`tool`,content:c},f=o.findIndex(e=>e.role===`assistant`&&e.toolCalls?.some(e=>e.id===a));if(f===-1)o.push(d);else{let e=f+1;for(;e{t.onNewMessage?.({message:d,messages:o,state:s,agent:n,input:e})})),l({messages:o})}return u()}case H.STATE_SNAPSHOT:{let i=await KT(r,o,s,(r,i,a)=>r.onStateSnapshotEvent?.({event:t,messages:i,state:a,agent:n,input:e}));if(l(i),i.stopPropagation!==!0){let{snapshot:e}=t;s=e,l({state:s})}return u()}case H.STATE_DELTA:{let i=await KT(r,o,s,(r,i,a)=>r.onStateDeltaEvent?.({event:t,messages:i,state:a,agent:n,input:e}));if(l(i),i.stopPropagation!==!0){let{delta:e}=t;try{s=cb.applyPatch(s,e,!0,!1).newDocument,l({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 u()}case H.MESSAGES_SNAPSHOT:{let i=await KT(r,o,s,(r,i,a)=>r.onMessagesSnapshotEvent?.({event:t,messages:i,state:a,agent:n,input:e}));if(l(i),i.stopPropagation!==!0){let{messages:e}=t,n=new Map(e.map(e=>[e.id,e])),r=e.some(e=>e.role===`activity`),i=e.some(e=>e.role===`reasoning`),a=e=>e.role===`activity`&&!r||e.role===`reasoning`&&!i;o=o.filter(e=>a(e)||n.has(e.id)).map(e=>a(e)?e:n.get(e.id));let s=new Set(o.map(e=>e.id));for(let t of e)s.has(t.id)||o.push(t);l({messages:o})}return u()}case H.ACTIVITY_SNAPSHOT:{let i=t,a=o.findIndex(e=>e.id===i.messageId),c=a>=0?o[a]:void 0,d=c?.role===`activity`?c:void 0,f=i.replace??!0,p=await KT(r,o,s,(t,r,a)=>t.onActivitySnapshotEvent?.({event:i,messages:r,state:a,agent:n,input:e,activityMessage:d,existingMessage:c}));if(l(p),p.stopPropagation!==!0){let t={id:i.messageId,role:`activity`,activityType:i.activityType,content:VT(i.content)},c;a===-1?(o.push(t),c=t):d?f&&(o[a]={...d,activityType:i.activityType,content:VT(i.content)}):f&&(o[a]=t,c=t),l({messages:o}),c&&await Promise.all(r.map(t=>t.onNewMessage?.({message:c,messages:o,state:s,agent:n,input:e})))}return u()}case H.ACTIVITY_DELTA:{let i=t,a=o.findIndex(e=>e.id===i.messageId);if(a===-1)return u();let c=o[a];if(c.role!==`activity`)return console.warn(`ACTIVITY_DELTA: Message '${i.messageId}' is not an activity message`),u();let d=c,f=await KT(r,o,s,(t,r,a)=>t.onActivityDeltaEvent?.({event:i,messages:r,state:a,agent:n,input:e,activityMessage:d}));if(l(f),f.stopPropagation!==!0)try{let e=VT(d.content??{}),t=cb.applyPatch(e,i.patch??[],!0,!1).newDocument;o[a]={...d,content:VT(t),activityType:i.activityType},l({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 u()}case H.RAW:return l(await KT(r,o,s,(r,i,a)=>r.onRawEvent?.({event:t,messages:i,state:a,agent:n,input:e}))),u();case H.CUSTOM:return l(await KT(r,o,s,(r,i,a)=>r.onCustomEvent?.({event:t,messages:i,state:a,agent:n,input:e}))),u();case H.RUN_STARTED:{let i=await KT(r,o,s,(r,i,a)=>r.onRunStartedEvent?.({event:t,messages:i,state:a,agent:n,input:e}));if(l(i),i.stopPropagation!==!0){let e=t;if(e.input?.messages){for(let t of e.input.messages)o.find(e=>e.id===t.id)||o.push(t);l({messages:o})}}return u()}case H.RUN_FINISHED:{let i=t,a=i.outcome?.type===`interrupt`?{event:i,outcome:`interrupt`,interrupts:i.outcome.interrupts}:{event:i,outcome:`success`,result:i.result},c=await KT(r,o,s,(t,r,i)=>t.onRunFinishedEvent?.({...a,messages:r,state:i,agent:n,input:e}));return l(c),c.stopPropagation!==!0&&(n.pendingInterrupts=a.outcome===`interrupt`?[...a.interrupts]:[]),u()}case H.RUN_ERROR:return l(await KT(r,o,s,(r,i,a)=>r.onRunErrorEvent?.({event:t,messages:i,state:a,agent:n,input:e}))),u();case H.STEP_STARTED:return l(await KT(r,o,s,(r,i,a)=>r.onStepStartedEvent?.({event:t,messages:i,state:a,agent:n,input:e}))),u();case H.STEP_FINISHED:return l(await KT(r,o,s,(r,i,a)=>r.onStepFinishedEvent?.({event:t,messages:i,state:a,agent:n,input:e}))),u();case H.TEXT_MESSAGE_CHUNK:throw Error(`TEXT_MESSAGE_CHUNK must be tranformed before being applied`);case H.TOOL_CALL_CHUNK:throw Error(`TOOL_CALL_CHUNK must be tranformed before being applied`);case H.THINKING_START:return u();case H.THINKING_END:return u();case H.THINKING_TEXT_MESSAGE_START:return u();case H.THINKING_TEXT_MESSAGE_CONTENT:return u();case H.THINKING_TEXT_MESSAGE_END:return u();case H.REASONING_START:return l(await KT(r,o,s,(r,i,a)=>r.onReasoningStartEvent?.({event:t,messages:i,state:a,agent:n,input:e}))),u();case H.REASONING_MESSAGE_START:{let i=await KT(r,o,s,(r,i,a)=>r.onReasoningMessageStartEvent?.({event:t,messages:i,state:a,agent:n,input:e}));if(l(i),i.stopPropagation!==!0){let{messageId:e}=t;if(!o.find(t=>t.id===e)){let t={id:e,role:`reasoning`,content:``};o.push(t),l({messages:o})}}return u()}case H.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}'`),u();let d=await KT(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 l(d),d.stopPropagation!==!0&&(c.content=`${typeof c.content==`string`?c.content:``}${a}`,l({messages:o})),u()}case H.REASONING_MESSAGE_END:{let{messageId:i}=t,a=o.find(e=>e.id===i);return a?(l(await KT(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:``}))),await Promise.all(r.map(t=>{t.onNewMessage?.({message:a,messages:o,state:s,agent:n,input:e})})),u()):(console.warn(`REASONING_MESSAGE_END: No message found with ID '${i}'`),u())}case H.REASONING_MESSAGE_CHUNK:throw Error(`REASONING_MESSAGE_CHUNK must be transformed before being applied`);case H.REASONING_END:return l(await KT(r,o,s,(r,i,a)=>r.onReasoningEndEvent?.({event:t,messages:i,state:a,agent:n,input:e}))),u();case H.REASONING_ENCRYPTED_VALUE:{let{subtype:i,entityId:a,encryptedValue:d}=t,f=await KT(r,o,s,(r,i,a)=>r.onReasoningEncryptedValueEvent?.({event:t,messages:i,state:a,agent:n,input:e}));if(l(f),f.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=d,e=!0;break}}}else{let t=o.find(e=>e.id===a);t?.role!==`activity`&&t&&(t.encryptedValue=d,e=!0)}e&&(c.messages=o)}return u()}}return t.type,u()}),Bx(),r.length>0?Wx({}):e=>e)},$T=e=>t=>{let n=JT(e),r=new Map,i=new Map,a=!1,o=!1,s=!1,c=new Map,l=!1,u=!1,d=!1,f=()=>{r.clear(),i.clear(),c.clear(),l=!1,u=!1,a=!1,o=!1,d=!0};return t.pipe(zx(e=>{let t=e.type;if(n?.event(`VERIFY`,`Event:`,e,{type:e.type}),o)return Px(()=>new Pv(`Cannot send event type '${t}': The run has already errored with 'RUN_ERROR'. No further events can be sent.`));if(a&&t!==H.RUN_ERROR&&t!==H.RUN_STARTED)return Px(()=>new Pv(`Cannot send event type '${t}': The run has already finished with 'RUN_FINISHED'. Start a new run with 'RUN_STARTED'.`));if(!s){if(s=!0,t!==H.RUN_STARTED&&t!==H.RUN_ERROR)return Px(()=>new Pv(`First event must be 'RUN_STARTED'`))}else if(t===H.RUN_STARTED){if(d&&!a)return Px(()=>new Pv(`Cannot send 'RUN_STARTED' while a run is still active. The previous run must be finished with 'RUN_FINISHED' before starting a new run.`));a&&f()}switch(t){case H.TEXT_MESSAGE_START:{let t=e.messageId;return r.has(t)?Px(()=>new Pv(`Cannot send 'TEXT_MESSAGE_START' event: A text message with ID '${t}' is already in progress. Complete it with 'TEXT_MESSAGE_END' first.`)):(r.set(t,!0),Nx(e))}case H.TEXT_MESSAGE_CONTENT:{let t=e.messageId;return r.has(t)?Nx(e):Px(()=>new Pv(`Cannot send 'TEXT_MESSAGE_CONTENT' event: No active text message found with ID '${t}'. Start a text message with 'TEXT_MESSAGE_START' first.`))}case H.TEXT_MESSAGE_END:{let t=e.messageId;return r.has(t)?(r.delete(t),Nx(e)):Px(()=>new Pv(`Cannot send 'TEXT_MESSAGE_END' event: No active text message found with ID '${t}'. A 'TEXT_MESSAGE_START' event must be sent first.`))}case H.TOOL_CALL_START:{let t=e.toolCallId;return i.has(t)?Px(()=>new Pv(`Cannot send 'TOOL_CALL_START' event: A tool call with ID '${t}' is already in progress. Complete it with 'TOOL_CALL_END' first.`)):(i.set(t,!0),Nx(e))}case H.TOOL_CALL_ARGS:{let t=e.toolCallId;return i.has(t)?Nx(e):Px(()=>new Pv(`Cannot send 'TOOL_CALL_ARGS' event: No active tool call found with ID '${t}'. Start a tool call with 'TOOL_CALL_START' first.`))}case H.TOOL_CALL_END:{let t=e.toolCallId;return i.has(t)?(i.delete(t),Nx(e)):Px(()=>new Pv(`Cannot send 'TOOL_CALL_END' event: No active tool call found with ID '${t}'. A 'TOOL_CALL_START' event must be sent first.`))}case H.STEP_STARTED:{let t=e.stepName;return c.has(t)?Px(()=>new Pv(`Step "${t}" is already active for 'STEP_STARTED'`)):(c.set(t,!0),Nx(e))}case H.STEP_FINISHED:{let t=e.stepName;return c.has(t)?(c.delete(t),Nx(e)):Px(()=>new Pv(`Cannot send 'STEP_FINISHED' for step "${t}" that was not started`))}case H.RUN_STARTED:return d=!0,Nx(e);case H.RUN_FINISHED:if(c.size>0){let e=Array.from(c.keys()).join(`, `);return Px(()=>new Pv(`Cannot send 'RUN_FINISHED' while steps are still active: ${e}`))}if(r.size>0){let e=Array.from(r.keys()).join(`, `);return Px(()=>new Pv(`Cannot send 'RUN_FINISHED' while text messages are still active: ${e}`))}if(i.size>0){let e=Array.from(i.keys()).join(`, `);return Px(()=>new Pv(`Cannot send 'RUN_FINISHED' while tool calls are still active: ${e}`))}return a=!0,Nx(e);case H.RUN_ERROR:return o=!0,Nx(e);case H.CUSTOM:return Nx(e);case H.THINKING_TEXT_MESSAGE_START:return l?u?Px(()=>new Pv(`Cannot send 'THINKING_TEXT_MESSAGE_START' event: A thinking message is already in progress. Complete it with 'THINKING_TEXT_MESSAGE_END' first.`)):(u=!0,Nx(e)):Px(()=>new Pv(`Cannot send 'THINKING_TEXT_MESSAGE_START' event: A thinking step is not in progress. Create one with 'THINKING_START' first.`));case H.THINKING_TEXT_MESSAGE_CONTENT:return u?Nx(e):Px(()=>new Pv(`Cannot send 'THINKING_TEXT_MESSAGE_CONTENT' event: No active thinking message found. Start a message with 'THINKING_TEXT_MESSAGE_START' first.`));case H.THINKING_TEXT_MESSAGE_END:return u?(u=!1,Nx(e)):Px(()=>new Pv(`Cannot send 'THINKING_TEXT_MESSAGE_END' event: No active thinking message found. A 'THINKING_TEXT_MESSAGE_START' event must be sent first.`));case H.THINKING_START:return l?Px(()=>new Pv(`Cannot send 'THINKING_START' event: A thinking step is already in progress. End it with 'THINKING_END' first.`)):(l=!0,Nx(e));case H.THINKING_END:return l?(l=!1,Nx(e)):Px(()=>new Pv(`Cannot send 'THINKING_END' event: No active thinking step found. A 'THINKING_START' event must be sent first.`));default:return Nx(e)}}))},eE=function(e){return e.HEADERS=`headers`,e.DATA=`data`,e}({}),tE=e=>Vx(()=>Mx(e())).pipe(Kx(e=>{if(!e.ok){let t=e.headers.get(`content-type`)||``;return Mx(e.text()).pipe(zx(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,Px(()=>i)}))}let t={type:eE.HEADERS,status:e.status,headers:e.headers},n=e.body?.getReader();return n?new Vb(e=>(e.next(t),(async()=>{try{for(;;){let{done:t,value:r}=await n.read();if(t)break;let i={type:eE.DATA,data:r};e.next(i)}e.complete()}catch(t){e.error(t)}})(),()=>{n.cancel().catch(e=>{if(e?.name!==`AbortError`)throw e})})):Px(()=>Error(`Failed to getReader() from response`))})),nE=(e,t)=>{let n=JT(t),r=new Xb,i=new TextDecoder(`utf-8`,{fatal:!1}),a=``;e.subscribe({next:e=>{if(e.type!==eE.HEADERS&&e.type===eE.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)}},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()},rE=e=>{let t=new Xb,n=new Uint8Array;e.subscribe({next:e=>{if(e.type!==eE.HEADERS&&e.type===eE.DATA&&e.data){let t=new Uint8Array(n.length+e.data.length);t.set(n,0),t.set(e.data,n.length),n=t,r()}},error:e=>t.error(e),complete:()=>{if(n.length>0)try{r()}catch{console.warn(`Incomplete or invalid protocol buffer data at stream end`)}t.complete()}});function r(){for(;n.length>=4;){let e=4+new DataView(n.buffer,n.byteOffset,4).getUint32(0,!1);if(n.length{let n=JT(t),r=new Xb,i=new $b,a=!1;return e.subscribe({next:e=>{if(i.next(e),e.type===eE.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`?rE(i).subscribe({next:e=>r.next(e),error:e=>r.error(e),complete:()=>r.complete()}):nE(i,n).subscribe({next:e=>{try{let t=Ey.parse(e);n?.event(`HTTP`,`Event validated:`,t,{type:t.type,valid:!0}),r.next(t)}catch(t){n?.event(`HTTP`,`Event invalid:`,{json:e,error:String(t)}),r.error(t)}},error:e=>{if(e?.name===`AbortError`){r.next({type:H.RUN_ERROR,message:e.message||`Request aborted`,code:`abort`,rawEvent:e}),r.complete();return}return r.error(e)},complete:()=>r.complete()})}else a||r.error(Error(`No headers event received before data events`))},error:e=>{i.error(e),r.error(e)},complete:()=>{i.complete()}}),r.asObservable()},aE=MT([`TextMessageStart`,`TextMessageContent`,`TextMessageEnd`,`ActionExecutionStart`,`ActionExecutionArgs`,`ActionExecutionEnd`,`ActionExecutionResult`,`AgentStateMessage`,`MetaEvent`,`RunStarted`,`RunFinished`,`RunError`,`NodeStarted`,`NodeFinished`]),oE=MT([`LangGraphInterruptEvent`,`PredictState`,`Exit`]);AT(`type`,[kT({type:jT(aE.enum.TextMessageStart),messageId:ET(),parentMessageId:ET().optional(),role:ET().optional()}),kT({type:jT(aE.enum.TextMessageContent),messageId:ET(),content:ET()}),kT({type:jT(aE.enum.TextMessageEnd),messageId:ET()}),kT({type:jT(aE.enum.ActionExecutionStart),actionExecutionId:ET(),actionName:ET(),parentMessageId:ET().optional()}),kT({type:jT(aE.enum.ActionExecutionArgs),actionExecutionId:ET(),args:ET()}),kT({type:jT(aE.enum.ActionExecutionEnd),actionExecutionId:ET()}),kT({type:jT(aE.enum.ActionExecutionResult),actionName:ET(),actionExecutionId:ET(),result:ET()}),kT({type:jT(aE.enum.AgentStateMessage),threadId:ET(),agentName:ET(),nodeName:ET(),runId:ET(),active:DT(),role:ET(),state:ET(),running:DT()}),kT({type:jT(aE.enum.MetaEvent),name:oE,value:OT()}),kT({type:jT(aE.enum.RunError),message:ET(),code:ET().optional()})]),kT({id:ET(),role:ET(),content:ET(),parentMessageId:ET().optional()}),kT({id:ET(),name:ET(),arguments:OT(),parentMessageId:ET().optional()}),kT({id:ET(),result:OT(),actionExecutionId:ET(),actionName:ET()});var sE=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(` -`)},cE=(e,t,n)=>r=>{let i={},a=!0,o=!0,s=``,c=null,l=null,u=[],d={},f=e=>{typeof e==`object`&&e&&(`messages`in e&&delete e.messages,i=e)};return r.pipe(zx(r=>{switch(r.type){case H.TEXT_MESSAGE_START:{let e=r;return[{type:aE.enum.TextMessageStart,messageId:e.messageId,role:e.role}]}case H.TEXT_MESSAGE_CONTENT:{let e=r;return[{type:aE.enum.TextMessageContent,messageId:e.messageId,content:e.delta}]}case H.TEXT_MESSAGE_END:{let e=r;return[{type:aE.enum.TextMessageEnd,messageId:e.messageId}]}case H.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:aE.enum.ActionExecutionStart,actionExecutionId:e.toolCallId,actionName:e.toolCallName,parentMessageId:e.parentMessageId}]}case H.TOOL_CALL_ARGS:{let c=r,d=u.find(e=>e.id===c.toolCallId);if(!d)return console.warn(`TOOL_CALL_ARGS: No tool call found with ID '${c.toolCallId}'`),[];d.function.arguments+=c.delta;let p=!1;if(l){let e=l.find(e=>e.tool==d.function.name);if(e)try{let t=JSON.parse(Xx(d.function.arguments));e.tool_argument&&e.tool_argument in t?(f({...i,[e.state_key]:t[e.tool_argument]}),p=!0):e.tool_argument||(f({...i,[e.state_key]:t}),p=!0)}catch{}}return[{type:aE.enum.ActionExecutionArgs,actionExecutionId:c.toolCallId,args:c.delta},...p?[{type:aE.enum.AgentStateMessage,threadId:e,agentName:n,nodeName:s,runId:t,running:a,role:`assistant`,state:JSON.stringify(i),active:o}]:[]]}case H.TOOL_CALL_END:{let e=r;return[{type:aE.enum.ActionExecutionEnd,actionExecutionId:e.toolCallId}]}case H.TOOL_CALL_RESULT:{let e=r;return[{type:aE.enum.ActionExecutionResult,actionExecutionId:e.toolCallId,result:e.content,actionName:d[e.toolCallId]||`unknown`}]}case H.RAW:return[];case H.CUSTOM:{let e=r;switch(e.name){case`Exit`:a=!1;break;case`PredictState`:l=e.value}return[{type:aE.enum.MetaEvent,name:e.name,value:e.value}]}case H.STATE_SNAPSHOT:return f(r.snapshot),[{type:aE.enum.AgentStateMessage,threadId:e,agentName:n,nodeName:s,runId:t,running:a,role:`assistant`,state:JSON.stringify(i),active:o}];case H.STATE_DELTA:{let c=r,l=cb.applyPatch(i,c.delta,!0,!1);return l?(f(l.newDocument),[{type:aE.enum.AgentStateMessage,threadId:e,agentName:n,nodeName:s,runId:t,running:a,role:`assistant`,state:JSON.stringify(i),active:o}]):[]}case H.MESSAGES_SNAPSHOT:return c=r.messages,[{type:aE.enum.AgentStateMessage,threadId:e,agentName:n,nodeName:s,runId:t,running:a,role:`assistant`,state:JSON.stringify({...i,...c?{messages:c}:{}}),active:!0}];case H.RUN_STARTED:return[];case H.RUN_FINISHED:return c&&(i.messages=c),Object.keys(i).length===0?[]:[{type:aE.enum.AgentStateMessage,threadId:e,agentName:n,nodeName:s,runId:t,running:a,role:`assistant`,state:JSON.stringify({...i,...c?{messages:lE(c)}:{}}),active:!1}];case H.RUN_ERROR:{let e=r;return[{type:aE.enum.RunError,message:e.message,code:e.code}]}case H.STEP_STARTED:return s=r.stepName,u=[],l=null,[{type:aE.enum.AgentStateMessage,threadId:e,agentName:n,nodeName:s,runId:t,running:a,role:`assistant`,state:JSON.stringify(i),active:!0}];case H.STEP_FINISHED:return u=[],l=null,[{type:aE.enum.AgentStateMessage,threadId:e,agentName:n,nodeName:s,runId:t,running:a,role:`assistant`,state:JSON.stringify(i),active:!1}];default:return[]}}))};function lE(e){let t=[];for(let n of e)if(n.role===`assistant`||n.role===`user`||n.role===`system`){let e=sE(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={id:e.id,name:e.function.name,arguments:JSON.parse(e.function.arguments),parentMessageId:n.id};t.push(r)}}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:n.content,actionExecutionId:n.toolCallId,actionName:r};t.push(i)}return t}var uE=e=>t=>{let n=JT(e),r,i,a,o,s=()=>{if(!r||o!==`text`)throw Error(`No text message to close`);let e={type:H.TEXT_MESSAGE_END,messageId:r.messageId};return o=void 0,r=void 0,n?.event(`TRANSFORM`,`TEXT_MESSAGE_END`,e,{messageId:e.messageId}),e},c=()=>{if(!i||o!==`tool`)throw Error(`No tool call to close`);let e={type:H.TOOL_CALL_END,toolCallId:i.toolCallId};return o=void 0,i=void 0,n?.event(`TRANSFORM`,`TOOL_CALL_END`,e,{toolCallId:e.toolCallId}),e},l=()=>{if(!a||o!==`reasoning`)throw Error(`No reasoning message to close`);let e={type:H.REASONING_MESSAGE_END,messageId:a.messageId};return o=void 0,a=void 0,n?.event(`TRANSFORM`,`REASONING_MESSAGE_END`,e,{messageId:e.messageId}),e},u=()=>o===`text`?[s()]:o===`tool`?[c()]:o===`reasoning`?[l()]:[];return t.pipe(zx(e=>{switch(e.type){case H.TEXT_MESSAGE_START:case H.TEXT_MESSAGE_CONTENT:case H.TEXT_MESSAGE_END:case H.TOOL_CALL_START:case H.TOOL_CALL_ARGS:case H.TOOL_CALL_END:case H.TOOL_CALL_RESULT:case H.STATE_SNAPSHOT:case H.STATE_DELTA:case H.MESSAGES_SNAPSHOT:case H.CUSTOM:case H.RUN_STARTED:case H.RUN_FINISHED:case H.RUN_ERROR:case H.STEP_STARTED:case H.STEP_FINISHED:case H.THINKING_START:case H.THINKING_END:case H.THINKING_TEXT_MESSAGE_START:case H.THINKING_TEXT_MESSAGE_CONTENT:case H.THINKING_TEXT_MESSAGE_END:case H.REASONING_START:case H.REASONING_MESSAGE_START:case H.REASONING_MESSAGE_CONTENT:case H.REASONING_MESSAGE_END:case H.REASONING_END:return[...u(),e];case H.RAW:case H.ACTIVITY_SNAPSHOT:case H.ACTIVITY_DELTA:case H.REASONING_ENCRYPTED_VALUE:return[e];case H.TEXT_MESSAGE_CHUNK:{let t=e,i=[];if((o!==`text`||t.messageId!==void 0&&t.messageId!==r?.messageId)&&i.push(...u()),o!==`text`){if(t.messageId===void 0)throw Error(`First TEXT_MESSAGE_CHUNK must have a messageId`);r={messageId:t.messageId,name:t.name},o=`text`;let e={type:H.TEXT_MESSAGE_START,messageId:t.messageId,role:t.role||`assistant`,...t.name!==void 0&&{name:t.name}};i.push(e),n?.event(`TRANSFORM`,`TEXT_MESSAGE_START`,e,{messageId:t.messageId})}if(t.delta!==void 0){let e={type:H.TEXT_MESSAGE_CONTENT,messageId:r.messageId,delta:t.delta};i.push(e),n?.event(`TRANSFORM`,`TEXT_MESSAGE_CONTENT`,e,{messageId:r.messageId})}return i}case H.TOOL_CALL_CHUNK:{let t=e,r=[];if((o!==`tool`||t.toolCallId!==void 0&&t.toolCallId!==i?.toolCallId)&&r.push(...u()),o!==`tool`){if(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`);i={toolCallId:t.toolCallId,toolCallName:t.toolCallName,parentMessageId:t.parentMessageId},o=`tool`;let e={type:H.TOOL_CALL_START,toolCallId:t.toolCallId,toolCallName:t.toolCallName,parentMessageId:t.parentMessageId};r.push(e),n?.event(`TRANSFORM`,`TOOL_CALL_START`,e,{toolCallId:t.toolCallId,toolCallName:t.toolCallName})}if(t.delta!==void 0){let e={type:H.TOOL_CALL_ARGS,toolCallId:i.toolCallId,delta:t.delta};r.push(e),n?.event(`TRANSFORM`,`TOOL_CALL_ARGS`,e,{toolCallId:i.toolCallId})}return r}case H.REASONING_MESSAGE_CHUNK:{let t=e,r=[];if((o!==`reasoning`||t.messageId&&t.messageId!==a?.messageId)&&r.push(...u()),o!==`reasoning`){if(t.messageId===void 0)throw Error(`First REASONING_MESSAGE_CHUNK must have a messageId`);a={messageId:t.messageId},o=`reasoning`;let e={type:H.REASONING_MESSAGE_START,messageId:t.messageId};r.push(e),n?.event(`TRANSFORM`,`REASONING_MESSAGE_START`,e,{messageId:t.messageId})}if(t.delta!==void 0){let e={type:H.REASONING_MESSAGE_CONTENT,messageId:a.messageId,delta:t.delta};r.push(e),n?.event(`TRANSFORM`,`REASONING_MESSAGE_CONTENT`,e,{messageId:a.messageId})}return r}}return e.type,[]}),Gx(()=>{u()}))};function dE(e,t=new Date){return e.expiresAt!==void 0&&new Date(e.expiresAt)<=t}var fE=class{runNext(e,t){return t.run(e).pipe(uE(!1))}runNextWithState(e,t){let n=VT(e.messages||[]),r=VT(e.state||{}),i=new $b;return QT(e,i,t,[]).subscribe(e=>{e.messages!==void 0&&(n=e.messages),e.state!==void 0&&(r=e.state)}),this.runNext(e,t).pipe(Ux(async e=>(i.next(e),await new Promise(e=>setTimeout(e,0)),{event:e,messages:VT(n),state:VT(r)})))}},pE=class extends fE{constructor(e){super(),this.fn=e}run(e,t){return this.fn(e,t)}};function mE(e){let t=e.content;if(Array.isArray(t)){let n=t.filter(e=>typeof e==`object`&&!!e&&`type`in e&&e.type===`text`&&typeof e.text==`string`).map(e=>e.text).join(``);return{...e,content:n}}return typeof t==`string`?e:{...e,content:``}}var hE=class extends fE{run(e,t){let{parentRunId:n,...r}=e,i={...r,messages:r.messages.map(mE)};return this.runNext(i,t)}},gE=`THINKING_START`,_E=`THINKING_END`,vE=`THINKING_TEXT_MESSAGE_START`,yE=`THINKING_TEXT_MESSAGE_CONTENT`,bE=`THINKING_TEXT_MESSAGE_END`,xE=class extends fE{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(Lx(e=>this.transformEvent(e)))}transformEvent(e){switch(e.type){case gE:{this.currentReasoningId=HT();let{title:t,...n}=e;return this.warnAboutTransformation(gE,H.REASONING_START),{...n,type:H.REASONING_START,messageId:this.currentReasoningId}}case vE:return this.currentMessageId=HT(),this.warnAboutTransformation(vE,H.REASONING_MESSAGE_START),{...e,type:H.REASONING_MESSAGE_START,messageId:this.currentMessageId,role:`assistant`};case yE:{let{delta:t,...n}=e;return this.warnAboutTransformation(yE,H.REASONING_MESSAGE_CONTENT),{...n,type:H.REASONING_MESSAGE_CONTENT,messageId:this.currentMessageId??HT(),delta:t}}case bE:{let t=this.currentMessageId??HT();return this.warnAboutTransformation(bE,H.REASONING_MESSAGE_END),{...e,type:H.REASONING_MESSAGE_END,messageId:t}}case _E:{let t=this.currentReasoningId??HT();return this.warnAboutTransformation(_E,H.REASONING_END),{...e,type:H.REASONING_END,messageId:t}}default:return e}}};function SE(e){return e.startsWith(`image/`)?`image`:e.startsWith(`audio/`)?`audio`:e.startsWith(`video/`)?`video`:`document`}function CE(e){return typeof e==`object`&&!!e&&`type`in e&&e.type===`binary`&&`mimeType`in e&&typeof e.mimeType==`string`}function wE(e){let t=SE(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}}:{}}:e}function TE(e){let t=e.content;if(!Array.isArray(t))return e;let n=t.map(e=>CE(e)?wE(e):e);return{...e,content:n}}var EE=class extends fE{run(e,t){let n={...e,messages:e.messages.map(TE)};return this.runNext(n,t)}},DE=`0.0.58`,OE=class{get maxVersion(){return DE}get debug(){return this._debug}set debug(e){this._debug=qT(e),this._debugLogger=XT(this._debug)}get debugLogger(){return this._debugLogger}set debugLogger(e){this._debugLogger=typeof e==`boolean`?e?XT(qT(!0)):void 0:e}constructor({agentId:e,description:t,threadId:n,initialMessages:r,initialState:i,debug:a}={}){this.subscribers=[],this.isRunning=!1,this.pendingInterrupts=[],this.middlewares=[],this.agentId=e,this.description=t??``,this.threadId=n??Eg(),this.messages=VT(r??[]),this.state=VT(i??{}),this._debug=qT(a),this._debugLogger=XT(this._debug),BT(this.maxVersion,`0.0.39`)<=0&&this.middlewares.unshift(new hE),BT(this.maxVersion,`0.0.45`)<=0&&this.middlewares.unshift(new xE),BT(this.maxVersion,`0.0.47`)<=0&&this.middlewares.unshift(new EE)}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 pE(e):e);return this.middlewares.push(...t),this}async runAgent(e,t){try{this.isRunning=!0,this.agentId=this.agentId??Eg();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=[{onRunFinishedEvent:e=>{e.outcome===`success`&&(r=e.result)}},...this.subscribers,t??{}];await this.onInitialize(n,a),this.activeRunDetach$=new Xb;let o;this.activeRunCompletionPromise=new Promise(e=>{o=e}),await Ix(zb(()=>this.middlewares.length===0?this.run(n):this.middlewares.reduceRight((e,t)=>({run:n=>t.run(n,e),get messages(){return e.messages},get state(){return e.state}}),this).run(n),uE(this.debugLogger),$T(this.debugLogger),e=>e.pipe(qx(this.activeRunDetach$)),e=>this.apply(n,e,a),e=>this.processApplyEvents(n,e,a),Hx(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))),Gx(()=>{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}))(Nx(null)));let s=VT(this.messages).filter(e=>!i.has(e.id));return{result:r,newMessages:s}}finally{this.isRunning=!1}}connect(e){throw new Fv}async connectAgent(e,t){try{this.isRunning=!0,this.agentId=this.agentId??Eg();let n=this.prepareRunAgentInput(e),r,i=new Set(this.messages.map(e=>e.id)),a=[{onRunFinishedEvent:e=>{e.outcome===`success`&&(r=e.result)}},...this.subscribers,t??{}];await this.onInitialize(n,a),this.activeRunDetach$=new Xb;let o;this.activeRunCompletionPromise=new Promise(e=>{o=e}),await Ix(zb(()=>Vx(()=>this.connect(n)),uE(this.debugLogger),$T(this.debugLogger),e=>e.pipe(qx(this.activeRunDetach$)),e=>this.apply(n,e,a),e=>this.processApplyEvents(n,e,a),Hx(e=>(this.isRunning=!1,e instanceof Fv?ex:this.onError(n,e,a))),Gx(()=>{this.isRunning=!1,this.onFinalize(n,a),o?.(),o=void 0,this.activeRunCompletionPromise=void 0,this.activeRunDetach$=void 0}))(Nx(null)),{defaultValue:void 0});let s=VT(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}apply(e,t,n){return QT(e,t,this,n,this.debugLogger)}processApplyEvents(e,t,n){return t.pipe(Jx(t=>{t.messages&&(this.messages=t.messages,n.forEach(t=>{t.onMessagesChanged?.({messages:this.messages,state:this.state,agent:this,input:e})})),t.state&&(this.state=t.state,n.forEach(t=>{t.onStateChanged?.({state:this.state,messages:this.messages,agent:this,input:e})}))}))}prepareRunAgentInput(e){let t=VT(this.messages).filter(e=>e.role!==`activity`);return{threadId:this.threadId,runId:e?.runId||Eg(),tools:VT(e?.tools??[]),context:VT(e?.context??[]),forwardedProps:VT(e?.forwardedProps??{}),state:VT(this.state),messages:t,...e?.resume===void 0?{}:{resume:VT(e.resume)}}}async onInitialize(e,t){if(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 Pv(`Thread has ${n.length} pending interrupt(s) not addressed by resume: ${n.join(`, `)}`);for(let e of this.pendingInterrupts)if(dE(e))throw new Pv(`Interrupt ${e.id} expired at ${e.expiresAt}`)}let n=await KT(t,this.messages,this.state,(t,n,r)=>t.onRunInitialized?.({messages:n,state:r,agent:this,input:e}));(n.messages!==void 0||n.state!==void 0)&&(n.messages&&(this.messages=n.messages,e.messages=n.messages,t.forEach(t=>{t.onMessagesChanged?.({messages:this.messages,state:this.state,agent:this,input:e})})),n.state&&(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 Mx(KT(n,this.messages,this.state,(n,r,i)=>n.onRunFailed?.({error:t,messages:r,state:i,agent:this,input:e}))).pipe(Lx(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 KT(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=VT(this.messages),e.state=VT(this.state),e._debug=this._debug,e._debugLogger=this._debugLogger,e.isRunning=this.isRunning,e.subscribers=[...this.subscribers],e.middlewares=[...this.middlewares],e.pendingInterrupts=VT(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=VT(e),(async()=>{for(let e of this.subscribers)await e.onMessagesChanged?.({messages:this.messages,state:this.state,agent:this})})()}setState(e){this.state=VT(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??Eg();let t=this.prepareRunAgentInput(e);return(this.middlewares.length===0?this.run(t):this.middlewares.reduceRight((e,t)=>({run:n=>t.run(n,e),get messages(){return e.messages},get state(){return e.state}}),this).run(t)).pipe(uE(this.debugLogger),$T(this.debugLogger),cE(this.threadId,t.runId,this.agentId),e=>e.pipe(Lx(e=>(this.debugLogger?.event(`LEGACY`,`Event:`,e,{type:e.type}),e))))}},kE=class extends OE{requestInit(e){return{method:`POST`,headers:{...this.headers,"Content-Type":`application/json`,Accept:`text/event-stream`},body:JSON.stringify(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=VT(e.headers??{}),this.fetch=e.fetch??((e,t)=>fetch(e,t))}run(e){return iE(tE(()=>this.fetch(this.url,this.requestInit(e))),this.debugLogger)}clone(){let e=super.clone();e.url=this.url,e.headers=VT(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}},AE=new Map([[`bold`,M.createElement(M.Fragment,null,M.createElement(`path`,{d:`M204,64V168a12,12,0,0,1-24,0V93L72.49,200.49a12,12,0,0,1-17-17L163,76H88a12,12,0,0,1,0-24H192A12,12,0,0,1,204,64Z`}))],[`duotone`,M.createElement(M.Fragment,null,M.createElement(`path`,{d:`M192,64V168L88,64Z`,opacity:`0.2`}),M.createElement(`path`,{d:`M192,56H88a8,8,0,0,0-5.66,13.66L128.69,116,58.34,186.34a8,8,0,0,0,11.32,11.32L140,127.31l46.34,46.35A8,8,0,0,0,200,168V64A8,8,0,0,0,192,56Zm-8,92.69-38.34-38.34h0L107.31,72H184Z`}))],[`fill`,M.createElement(M.Fragment,null,M.createElement(`path`,{d:`M200,64V168a8,8,0,0,1-13.66,5.66L140,127.31,69.66,197.66a8,8,0,0,1-11.32-11.32L128.69,116,82.34,69.66A8,8,0,0,1,88,56H192A8,8,0,0,1,200,64Z`}))],[`light`,M.createElement(M.Fragment,null,M.createElement(`path`,{d:`M198,64V168a6,6,0,0,1-12,0V78.48L68.24,196.24a6,6,0,0,1-8.48-8.48L177.52,70H88a6,6,0,0,1,0-12H192A6,6,0,0,1,198,64Z`}))],[`regular`,M.createElement(M.Fragment,null,M.createElement(`path`,{d:`M200,64V168a8,8,0,0,1-16,0V83.31L69.66,197.66a8,8,0,0,1-11.32-11.32L172.69,72H88a8,8,0,0,1,0-16H192A8,8,0,0,1,200,64Z`}))],[`thin`,M.createElement(M.Fragment,null,M.createElement(`path`,{d:`M196,64V168a4,4,0,0,1-8,0V73.66L66.83,194.83a4,4,0,0,1-5.66-5.66L182.34,68H88a4,4,0,0,1,0-8H192A4,4,0,0,1,196,64Z`}))]]),jE=new Map([[`bold`,M.createElement(M.Fragment,null,M.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`,M.createElement(M.Fragment,null,M.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`}),M.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`,M.createElement(M.Fragment,null,M.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`,M.createElement(M.Fragment,null,M.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`,M.createElement(M.Fragment,null,M.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`,M.createElement(M.Fragment,null,M.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`}))]]),ME=new Map([[`bold`,M.createElement(M.Fragment,null,M.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`,M.createElement(M.Fragment,null,M.createElement(`path`,{d:`M216,128a88,88,0,1,1-88-88A88,88,0,0,1,216,128Z`,opacity:`0.2`}),M.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`,M.createElement(M.Fragment,null,M.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`,M.createElement(M.Fragment,null,M.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`,M.createElement(M.Fragment,null,M.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`,M.createElement(M.Fragment,null,M.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`}))]]),NE=new Map([[`bold`,M.createElement(M.Fragment,null,M.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`,M.createElement(M.Fragment,null,M.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`}),M.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`,M.createElement(M.Fragment,null,M.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`,M.createElement(M.Fragment,null,M.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`,M.createElement(M.Fragment,null,M.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`,M.createElement(M.Fragment,null,M.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`}))]]),PE=new Map([[`bold`,M.createElement(M.Fragment,null,M.createElement(`path`,{d:`M212.62,75.17A63.7,63.7,0,0,0,206.39,26,12,12,0,0,0,196,20a63.71,63.71,0,0,0-50,24H126A63.71,63.71,0,0,0,76,20a12,12,0,0,0-10.39,6,63.7,63.7,0,0,0-6.23,49.17A61.5,61.5,0,0,0,52,104v8a60.1,60.1,0,0,0,45.76,58.28A43.66,43.66,0,0,0,92,192v4H76a20,20,0,0,1-20-20,44.05,44.05,0,0,0-44-44,12,12,0,0,0,0,24,20,20,0,0,1,20,20,44.05,44.05,0,0,0,44,44H92v12a12,12,0,0,0,24,0V192a20,20,0,0,1,40,0v40a12,12,0,0,0,24,0V192a43.66,43.66,0,0,0-5.76-21.72A60.1,60.1,0,0,0,220,112v-8A61.5,61.5,0,0,0,212.62,75.17ZM196,112a36,36,0,0,1-36,36H112a36,36,0,0,1-36-36v-8a37.87,37.87,0,0,1,6.13-20.12,11.65,11.65,0,0,0,1.58-11.49,39.9,39.9,0,0,1-.4-27.72,39.87,39.87,0,0,1,26.41,17.8A12,12,0,0,0,119.82,68h32.35a12,12,0,0,0,10.11-5.53,39.84,39.84,0,0,1,26.41-17.8,39.9,39.9,0,0,1-.4,27.72,12,12,0,0,0,1.61,11.53A37.85,37.85,0,0,1,196,104Z`}))],[`duotone`,M.createElement(M.Fragment,null,M.createElement(`path`,{d:`M208,104v8a48,48,0,0,1-48,48H136a32,32,0,0,1,32,32v40H104V192a32,32,0,0,1,32-32H112a48,48,0,0,1-48-48v-8a49.28,49.28,0,0,1,8.51-27.3A51.92,51.92,0,0,1,76,32a52,52,0,0,1,43.83,24h32.34A52,52,0,0,1,196,32a51.92,51.92,0,0,1,3.49,44.7A49.28,49.28,0,0,1,208,104Z`,opacity:`0.2`}),M.createElement(`path`,{d:`M208.3,75.68A59.74,59.74,0,0,0,202.93,28,8,8,0,0,0,196,24a59.75,59.75,0,0,0-48,24H124A59.75,59.75,0,0,0,76,24a8,8,0,0,0-6.93,4,59.78,59.78,0,0,0-5.38,47.68A58.14,58.14,0,0,0,56,104v8a56.06,56.06,0,0,0,48.44,55.47A39.8,39.8,0,0,0,96,192v8H72a24,24,0,0,1-24-24A40,40,0,0,0,8,136a8,8,0,0,0,0,16,24,24,0,0,1,24,24,40,40,0,0,0,40,40H96v16a8,8,0,0,0,16,0V192a24,24,0,0,1,48,0v40a8,8,0,0,0,16,0V192a39.8,39.8,0,0,0-8.44-24.53A56.06,56.06,0,0,0,216,112v-8A58,58,0,0,0,208.3,75.68ZM200,112a40,40,0,0,1-40,40H112a40,40,0,0,1-40-40v-8a41.74,41.74,0,0,1,6.9-22.48A8,8,0,0,0,80,73.83a43.81,43.81,0,0,1,.79-33.58,43.88,43.88,0,0,1,32.32,20.06A8,8,0,0,0,119.82,64h32.35a8,8,0,0,0,6.74-3.69,43.87,43.87,0,0,1,32.32-20.06A43.81,43.81,0,0,1,192,73.83a8.09,8.09,0,0,0,1,7.65A41.76,41.76,0,0,1,200,104Z`}))],[`fill`,M.createElement(M.Fragment,null,M.createElement(`path`,{d:`M216,104v8a56.06,56.06,0,0,1-48.44,55.47A39.8,39.8,0,0,1,176,192v40a8,8,0,0,1-8,8H104a8,8,0,0,1-8-8V216H72a40,40,0,0,1-40-40A24,24,0,0,0,8,152a8,8,0,0,1,0-16,40,40,0,0,1,40,40,24,24,0,0,0,24,24H96v-8a39.8,39.8,0,0,1,8.44-24.53A56.06,56.06,0,0,1,56,112v-8a58.14,58.14,0,0,1,7.69-28.32A59.78,59.78,0,0,1,69.07,28,8,8,0,0,1,76,24a59.75,59.75,0,0,1,48,24h24a59.75,59.75,0,0,1,48-24,8,8,0,0,1,6.93,4,59.74,59.74,0,0,1,5.37,47.68A58,58,0,0,1,216,104Z`}))],[`light`,M.createElement(M.Fragment,null,M.createElement(`path`,{d:`M206.13,75.92A57.79,57.79,0,0,0,201.2,29a6,6,0,0,0-5.2-3,57.77,57.77,0,0,0-47,24H123A57.77,57.77,0,0,0,76,26a6,6,0,0,0-5.2,3,57.79,57.79,0,0,0-4.93,46.92A55.88,55.88,0,0,0,58,104v8a54.06,54.06,0,0,0,50.45,53.87A37.85,37.85,0,0,0,98,192v10H72a26,26,0,0,1-26-26A38,38,0,0,0,8,138a6,6,0,0,0,0,12,26,26,0,0,1,26,26,38,38,0,0,0,38,38H98v18a6,6,0,0,0,12,0V192a26,26,0,0,1,52,0v40a6,6,0,0,0,12,0V192a37.85,37.85,0,0,0-10.45-26.13A54.06,54.06,0,0,0,214,112v-8A55.88,55.88,0,0,0,206.13,75.92ZM202,112a42,42,0,0,1-42,42H112a42,42,0,0,1-42-42v-8a43.86,43.86,0,0,1,7.3-23.69,6,6,0,0,0,.81-5.76,45.85,45.85,0,0,1,1.43-36.42,45.85,45.85,0,0,1,35.23,21.1A6,6,0,0,0,119.83,62h32.34a6,6,0,0,0,5.06-2.76,45.83,45.83,0,0,1,35.23-21.11,45.85,45.85,0,0,1,1.43,36.42,6,6,0,0,0,.79,5.74A43.78,43.78,0,0,1,202,104Z`}))],[`regular`,M.createElement(M.Fragment,null,M.createElement(`path`,{d:`M208.31,75.68A59.78,59.78,0,0,0,202.93,28,8,8,0,0,0,196,24a59.75,59.75,0,0,0-48,24H124A59.75,59.75,0,0,0,76,24a8,8,0,0,0-6.93,4,59.78,59.78,0,0,0-5.38,47.68A58.14,58.14,0,0,0,56,104v8a56.06,56.06,0,0,0,48.44,55.47A39.8,39.8,0,0,0,96,192v8H72a24,24,0,0,1-24-24A40,40,0,0,0,8,136a8,8,0,0,0,0,16,24,24,0,0,1,24,24,40,40,0,0,0,40,40H96v16a8,8,0,0,0,16,0V192a24,24,0,0,1,48,0v40a8,8,0,0,0,16,0V192a39.8,39.8,0,0,0-8.44-24.53A56.06,56.06,0,0,0,216,112v-8A58.14,58.14,0,0,0,208.31,75.68ZM200,112a40,40,0,0,1-40,40H112a40,40,0,0,1-40-40v-8a41.74,41.74,0,0,1,6.9-22.48A8,8,0,0,0,80,73.83a43.81,43.81,0,0,1,.79-33.58,43.88,43.88,0,0,1,32.32,20.06A8,8,0,0,0,119.82,64h32.35a8,8,0,0,0,6.74-3.69,43.87,43.87,0,0,1,32.32-20.06A43.81,43.81,0,0,1,192,73.83a8.09,8.09,0,0,0,1,7.65A41.72,41.72,0,0,1,200,104Z`}))],[`thin`,M.createElement(M.Fragment,null,M.createElement(`path`,{d:`M203.94,76.16A55.73,55.73,0,0,0,199.46,30,4,4,0,0,0,196,28a55.78,55.78,0,0,0-46,24H122A55.78,55.78,0,0,0,76,28a4,4,0,0,0-3.46,2,55.73,55.73,0,0,0-4.48,46.16A53.78,53.78,0,0,0,60,104v8a52.06,52.06,0,0,0,52,52h1.41A36,36,0,0,0,100,192v12H72a28,28,0,0,1-28-28A36,36,0,0,0,8,140a4,4,0,0,0,0,8,28,28,0,0,1,28,28,36,36,0,0,0,36,36h28v20a4,4,0,0,0,8,0V192a28,28,0,0,1,56,0v40a4,4,0,0,0,8,0V192a36,36,0,0,0-13.41-28H160a52.06,52.06,0,0,0,52-52v-8A53.78,53.78,0,0,0,203.94,76.16ZM204,112a44.05,44.05,0,0,1-44,44H112a44.05,44.05,0,0,1-44-44v-8a45.76,45.76,0,0,1,7.71-24.89,4,4,0,0,0,.53-3.84,47.82,47.82,0,0,1,2.1-39.21,47.8,47.8,0,0,1,38.12,22.1A4,4,0,0,0,119.83,60h32.34a4,4,0,0,0,3.37-1.84,47.8,47.8,0,0,1,38.12-22.1,47.82,47.82,0,0,1,2.1,39.21,4,4,0,0,0,.53,3.83A45.85,45.85,0,0,1,204,104Z`}))]]),FE=new Map([[`bold`,M.createElement(M.Fragment,null,M.createElement(`path`,{d:`M128,20A108,108,0,1,0,236,128,108.12,108.12,0,0,0,128,20Zm84,108a83.64,83.64,0,0,1-4.47,27L167,130a19.65,19.65,0,0,0-7.8-2.78l-22.82-3.08A20.14,20.14,0,0,0,117.72,132h-4.07l-2.71-5.6a19.88,19.88,0,0,0-13.8-10.84L94.46,115l4-7h14.39a20,20,0,0,0,9.66-2.49l12.25-6.76a20.57,20.57,0,0,0,3.74-2.68l26.92-24.33A20,20,0,0,0,172,56.49,84,84,0,0,1,212,128ZM140.76,45l6.2,11.1L122.75,78l-10.93,6H96.14A20.05,20.05,0,0,0,78.78,94.06l-4.49,7.85L67.68,84.28l9.91-23.42A83.91,83.91,0,0,1,140.76,45ZM44,128a83.52,83.52,0,0,1,4.4-26.77l7.74,20.65a19.89,19.89,0,0,0,14.52,12.53l19.53,4.2,3,6.1a20.11,20.11,0,0,0,13.55,10.77l-5,11.12a20,20,0,0,0,3.58,21.71l.21.22,18.16,18.7-.89,4.59A84.09,84.09,0,0,1,44,128Zm103.65,81.66a20.11,20.11,0,0,0-5-17.3l-.21-.22-17.72-18.25,11.37-25.52,19,2.56,41.43,25.48A84.2,84.2,0,0,1,147.65,209.66Z`}))],[`duotone`,M.createElement(M.Fragment,null,M.createElement(`path`,{d:`M213.09,172.48a96,96,0,0,1-80.41,51.41l3.17-16.44a8,8,0,0,0-2-6.95l-19.74-20.33a8,8,0,0,1-1.44-8.69l13.7-30.74a8,8,0,0,1,8.38-4.67l22.82,3.08a8.11,8.11,0,0,1,3.12,1.11ZM116.71,95,129,88.24a7.46,7.46,0,0,0,1.5-1.07l26.91-24.33A8,8,0,0,0,159,53l-10.5-18.81A96.62,96.62,0,0,0,128,32,95.61,95.61,0,0,0,67.78,53.23L56,81.08A8,8,0,0,0,55.88,87l11.5,30.67a8,8,0,0,0,5.81,5l2.69.58L89.2,100a8,8,0,0,1,6.94-4h16.71A7.9,7.9,0,0,0,116.71,95Z`,opacity:`0.2`}),M.createElement(`path`,{d:`M128,24A104,104,0,1,0,232,128,104.11,104.11,0,0,0,128,24Zm88,104a87.62,87.62,0,0,1-6.4,32.94l-44.7-27.49a15.92,15.92,0,0,0-6.24-2.23l-22.82-3.08a16.11,16.11,0,0,0-16,7.86h-8.72l-3.8-7.86a15.91,15.91,0,0,0-11-8.67l-8-1.73L96.14,104h16.71a16.06,16.06,0,0,0,7.73-2l12.25-6.76a16.62,16.62,0,0,0,3-2.14l26.91-24.34A15.93,15.93,0,0,0,166,49.1l-.36-.65A88.11,88.11,0,0,1,216,128ZM143.31,41.34,152,56.9,125.09,81.24,112.85,88H96.14a16,16,0,0,0-13.88,8l-8.73,15.23L63.38,84.19,74.32,58.32a87.87,87.87,0,0,1,69-17ZM40,128a87.53,87.53,0,0,1,8.54-37.8l11.34,30.27a16,16,0,0,0,11.62,10l21.43,4.61L96.74,143a16.09,16.09,0,0,0,14.4,9h1.48l-7.23,16.23a16,16,0,0,0,2.86,17.37l.14.14L128,205.94l-1.94,10A88.11,88.11,0,0,1,40,128Zm102.58,86.78,1.13-5.81a16.09,16.09,0,0,0-4-13.9,1.85,1.85,0,0,1-.14-.14L120,174.74,133.7,144l22.82,3.08,45.72,28.12A88.18,88.18,0,0,1,142.58,214.78Z`}))],[`fill`,M.createElement(M.Fragment,null,M.createElement(`path`,{d:`M128,24A104,104,0,1,0,232,128,104.11,104.11,0,0,0,128,24Zm88,104a87.62,87.62,0,0,1-6.4,32.94l-44.7-27.49a15.92,15.92,0,0,0-6.24-2.23l-22.82-3.08a16.11,16.11,0,0,0-16,7.86h-8.72l-3.8-7.86a15.91,15.91,0,0,0-11-8.67l-8-1.73L96.14,104h16.71a16.06,16.06,0,0,0,7.73-2l12.25-6.76a16.62,16.62,0,0,0,3-2.14l26.91-24.34A15.93,15.93,0,0,0,166,49.1l-.36-.65A88.11,88.11,0,0,1,216,128ZM40,128a87.53,87.53,0,0,1,8.54-37.8l11.34,30.27a16,16,0,0,0,11.62,10l21.43,4.61L96.74,143a16.09,16.09,0,0,0,14.4,9h1.48l-7.23,16.23a16,16,0,0,0,2.86,17.37l.14.14L128,205.94l-1.94,10A88.11,88.11,0,0,1,40,128Z`}))],[`light`,M.createElement(M.Fragment,null,M.createElement(`path`,{d:`M128,26A102,102,0,1,0,230,128,102.12,102.12,0,0,0,128,26Zm90,102a89.55,89.55,0,0,1-7.46,35.86l-46.69-28.71a13.94,13.94,0,0,0-5.46-2l-22.82-3.07A14.06,14.06,0,0,0,121.06,138h-9.92a2,2,0,0,1-1.8-1.13l-3.8-7.86a13.94,13.94,0,0,0-9.66-7.59l-10.71-2.3L94.4,103a2,2,0,0,1,1.74-1h16.71a13.9,13.9,0,0,0,6.76-1.75l12.25-6.75a14.73,14.73,0,0,0,2.62-1.88l26.91-24.33a13.93,13.93,0,0,0,2.83-17.21L161,44.25A90.16,90.16,0,0,1,218,128ZM144.6,39.54l9.15,16.39a2,2,0,0,1-.41,2.46L126.43,82.72a1.84,1.84,0,0,1-.37.27l-12.25,6.76a2,2,0,0,1-1,.25H96.14A14,14,0,0,0,84,97L73.18,115.91a2,2,0,0,1-.19-.35L61.5,84.89a2,2,0,0,1,0-1.48L72.68,57.06A89.9,89.9,0,0,1,144.6,39.54ZM38,128A89.52,89.52,0,0,1,49.38,84.23a13.85,13.85,0,0,0,.89,4.87l11.49,30.67a13.94,13.94,0,0,0,10.16,8.78l21.44,4.6a2,2,0,0,1,1.38,1.09l3.8,7.86a14.07,14.07,0,0,0,12.6,7.9h4.56l-8.49,19a14,14,0,0,0,2.51,15.2l.1.11,19.68,20.26a2,2,0,0,1,.46,1.7L127.7,218A90.1,90.1,0,0,1,38,128Zm102.08,89.19,1.67-8.6a14.07,14.07,0,0,0-3.47-12.16l-.1-.11L118.5,176.06a2,2,0,0,1-.33-2.14l13.7-30.73A2,2,0,0,1,134,142l22.82,3.08a2,2,0,0,1,.78.27L205,174.55A90.18,90.18,0,0,1,140.08,217.19Z`}))],[`regular`,M.createElement(M.Fragment,null,M.createElement(`path`,{d:`M128,24A104,104,0,1,0,232,128,104.11,104.11,0,0,0,128,24Zm88,104a87.62,87.62,0,0,1-6.4,32.94l-44.7-27.49a15.92,15.92,0,0,0-6.24-2.23l-22.82-3.08a16.11,16.11,0,0,0-16,7.86h-8.72l-3.8-7.86a15.91,15.91,0,0,0-11-8.67l-8-1.73L96.14,104h16.71a16.06,16.06,0,0,0,7.73-2l12.25-6.76a16.62,16.62,0,0,0,3-2.14l26.91-24.34A15.93,15.93,0,0,0,166,49.1l-.36-.65A88.11,88.11,0,0,1,216,128ZM143.31,41.34,152,56.9,125.09,81.24,112.85,88H96.14a16,16,0,0,0-13.88,8l-8.73,15.23L63.38,84.19,74.32,58.32a87.87,87.87,0,0,1,69-17ZM40,128a87.53,87.53,0,0,1,8.54-37.8l11.34,30.27a16,16,0,0,0,11.62,10l21.43,4.61L96.74,143a16.09,16.09,0,0,0,14.4,9h1.48l-7.23,16.23a16,16,0,0,0,2.86,17.37l.14.14L128,205.94l-1.94,10A88.11,88.11,0,0,1,40,128Zm102.58,86.78,1.13-5.81a16.09,16.09,0,0,0-4-13.9,1.85,1.85,0,0,1-.14-.14L120,174.74,133.7,144l22.82,3.08,45.72,28.12A88.18,88.18,0,0,1,142.58,214.78Z`}))],[`thin`,M.createElement(M.Fragment,null,M.createElement(`path`,{d:`M128,28A100,100,0,1,0,228,128,100.11,100.11,0,0,0,128,28Zm92,100a91.44,91.44,0,0,1-8.58,38.76L162.8,136.85a12.07,12.07,0,0,0-4.68-1.67l-22.82-3.07a12,12,0,0,0-12.56,7l-.4.88h-11.2a4,4,0,0,1-3.6-2.26l-3.8-7.86a11.93,11.93,0,0,0-8.28-6.5L82.07,120.5,92.67,102a4,4,0,0,1,3.47-2h16.71a12,12,0,0,0,5.8-1.5l12.24-6.76a11.79,11.79,0,0,0,2.25-1.6L160.05,65.8a12,12,0,0,0,2.43-14.75l-5.86-10.49A92.17,92.17,0,0,1,220,128ZM145.89,37.75l9.6,17.2a4,4,0,0,1-.81,4.92L127.77,84.21a4.41,4.41,0,0,1-.75.53L114.78,91.5a4,4,0,0,1-1.93.5H96.14a12,12,0,0,0-10.41,6l-11.86,20.7a4,4,0,0,1-2.75-2.47L59.63,85.6a4,4,0,0,1,.06-3L71,55.81A91.51,91.51,0,0,1,128,36,92.53,92.53,0,0,1,145.89,37.75ZM36,128A91.52,91.52,0,0,1,56,70.77l-3.71,8.75a12,12,0,0,0-.18,8.88l11.49,30.67a11.93,11.93,0,0,0,8.72,7.52l21.43,4.61a4,4,0,0,1,2.76,2.17l3.8,7.86a12.07,12.07,0,0,0,10.8,6.77h7.64L109,169.85A12,12,0,0,0,111.26,183l19.68,20.26a4,4,0,0,1,1,3.47L129.36,220,128,220A92.1,92.1,0,0,1,36,128Zm101.6,91.5,2.18-11.29a12.08,12.08,0,0,0-3-10.49l-19.68-20.26a4,4,0,0,1-.71-4.35l13.7-30.74a4,4,0,0,1,4.18-2.33l22.82,3.07a4.12,4.12,0,0,1,1.56.56l49.11,30.2A92.12,92.12,0,0,1,137.6,219.5Z`}))]]),IE=new Map([[`bold`,M.createElement(M.Fragment,null,M.createElement(`path`,{d:`M216,36H40A20,20,0,0,0,20,56V200a20,20,0,0,0,20,20H216a20,20,0,0,0,20-20V56A20,20,0,0,0,216,36Zm-4,24V92H44V60ZM44,116H92v80H44Zm72,80V116h96v80Z`}))],[`duotone`,M.createElement(M.Fragment,null,M.createElement(`path`,{d:`M104,104V208H40a8,8,0,0,1-8-8V104Z`,opacity:`0.2`}),M.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,40Zm0,16V96H40V56ZM40,112H96v88H40Zm176,88H112V112H216v88Z`}))],[`fill`,M.createElement(M.Fragment,null,M.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,40ZM40,56H216V96H40ZM216,200H112V112H216v88Z`}))],[`light`,M.createElement(M.Fragment,null,M.createElement(`path`,{d:`M216,42H40A14,14,0,0,0,26,56V200a14,14,0,0,0,14,14H216a14,14,0,0,0,14-14V56A14,14,0,0,0,216,42ZM40,54H216a2,2,0,0,1,2,2V98H38V56A2,2,0,0,1,40,54ZM38,200V110H98v92H40A2,2,0,0,1,38,200Zm178,2H110V110H218v90A2,2,0,0,1,216,202Z`}))],[`regular`,M.createElement(M.Fragment,null,M.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,40Zm0,16V96H40V56ZM40,112H96v88H40Zm176,88H112V112H216v88Z`}))],[`thin`,M.createElement(M.Fragment,null,M.createElement(`path`,{d:`M216,44H40A12,12,0,0,0,28,56V200a12,12,0,0,0,12,12H216a12,12,0,0,0,12-12V56A12,12,0,0,0,216,44ZM40,52H216a4,4,0,0,1,4,4v44H36V56A4,4,0,0,1,40,52ZM36,200V108h64v96H40A4,4,0,0,1,36,200Zm180,4H108V108H220v92A4,4,0,0,1,216,204Z`}))]]),LE=new Map([[`bold`,M.createElement(M.Fragment,null,M.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`,M.createElement(M.Fragment,null,M.createElement(`path`,{d:`M192,112a80,80,0,1,1-80-80A80,80,0,0,1,192,112Z`,opacity:`0.2`}),M.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`,M.createElement(M.Fragment,null,M.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`,M.createElement(M.Fragment,null,M.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`,M.createElement(M.Fragment,null,M.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`,M.createElement(M.Fragment,null,M.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`}))]]),RE=new Map([[`bold`,M.createElement(M.Fragment,null,M.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`,M.createElement(M.Fragment,null,M.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`}),M.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`,M.createElement(M.Fragment,null,M.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`,M.createElement(M.Fragment,null,M.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`,M.createElement(M.Fragment,null,M.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`,M.createElement(M.Fragment,null,M.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`}))]]),zE=new Map([[`bold`,M.createElement(M.Fragment,null,M.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`,M.createElement(M.Fragment,null,M.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`}),M.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`,M.createElement(M.Fragment,null,M.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`,M.createElement(M.Fragment,null,M.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`,M.createElement(M.Fragment,null,M.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`,M.createElement(M.Fragment,null,M.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`}))]]),BE=new Map([[`bold`,M.createElement(M.Fragment,null,M.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`,M.createElement(M.Fragment,null,M.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`}),M.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`,M.createElement(M.Fragment,null,M.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`,M.createElement(M.Fragment,null,M.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`,M.createElement(M.Fragment,null,M.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`,M.createElement(M.Fragment,null,M.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`}))]]),VE=new Map([[`bold`,M.createElement(M.Fragment,null,M.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`,M.createElement(M.Fragment,null,M.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`}),M.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`,M.createElement(M.Fragment,null,M.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`,M.createElement(M.Fragment,null,M.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`,M.createElement(M.Fragment,null,M.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`,M.createElement(M.Fragment,null,M.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`}))]]),HE=new Map([[`bold`,M.createElement(M.Fragment,null,M.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`,M.createElement(M.Fragment,null,M.createElement(`path`,{d:`M224,56V200a16,16,0,0,1-16,16H48V40H208A16,16,0,0,1,224,56Z`,opacity:`0.2`}),M.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`,M.createElement(M.Fragment,null,M.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`,M.createElement(M.Fragment,null,M.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`,M.createElement(M.Fragment,null,M.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`,M.createElement(M.Fragment,null,M.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`}))]]),UE=new Map([[`bold`,M.createElement(M.Fragment,null,M.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`,M.createElement(M.Fragment,null,M.createElement(`path`,{d:`M184,128a56,56,0,1,1-56-56A56,56,0,0,1,184,128Z`,opacity:`0.2`}),M.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`,M.createElement(M.Fragment,null,M.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`,M.createElement(M.Fragment,null,M.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`,M.createElement(M.Fragment,null,M.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`,M.createElement(M.Fragment,null,M.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`}))]]),WE=new Map([[`bold`,M.createElement(M.Fragment,null,M.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`,M.createElement(M.Fragment,null,M.createElement(`path`,{d:`M200,56V208a8,8,0,0,1-8,8H64a8,8,0,0,1-8-8V56Z`,opacity:`0.2`}),M.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`,M.createElement(M.Fragment,null,M.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`,M.createElement(M.Fragment,null,M.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`,M.createElement(M.Fragment,null,M.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`,M.createElement(M.Fragment,null,M.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`}))]]),GE=M.forwardRef((e,t)=>M.createElement(Ne,{ref:t,...e,weights:AE}));GE.displayName=`ArrowUpRightIcon`;var KE=GE,qE=M.forwardRef((e,t)=>M.createElement(Ne,{ref:t,...e,weights:jE}));qE.displayName=`ChatCircleTextIcon`;var JE=qE,YE=M.forwardRef((e,t)=>M.createElement(Ne,{ref:t,...e,weights:ME}));YE.displayName=`ClockCounterClockwiseIcon`;var XE=YE,ZE=M.forwardRef((e,t)=>M.createElement(Ne,{ref:t,...e,weights:NE}));ZE.displayName=`DotsThreeIcon`;var QE=ZE,$E=M.forwardRef((e,t)=>M.createElement(Ne,{ref:t,...e,weights:PE}));$E.displayName=`GithubLogoIcon`;var eD=$E,tD=M.forwardRef((e,t)=>M.createElement(Ne,{ref:t,...e,weights:FE}));tD.displayName=`GlobeHemisphereWestIcon`;var nD=tD,rD=M.forwardRef((e,t)=>M.createElement(Ne,{ref:t,...e,weights:IE}));rD.displayName=`LayoutIcon`;var iD=rD,aD=M.forwardRef((e,t)=>M.createElement(Ne,{ref:t,...e,weights:LE}));aD.displayName=`MagnifyingGlassIcon`;var oD=aD,sD=M.forwardRef((e,t)=>M.createElement(Ne,{ref:t,...e,weights:RE}));sD.displayName=`MoonIcon`;var cD=sD,lD=M.forwardRef((e,t)=>M.createElement(Ne,{ref:t,...e,weights:zE}));lD.displayName=`PaperPlaneTiltIcon`;var uD=lD,dD=M.forwardRef((e,t)=>M.createElement(Ne,{ref:t,...e,weights:BE}));dD.displayName=`PencilSimpleIcon`;var fD=dD,pD=M.forwardRef((e,t)=>M.createElement(Ne,{ref:t,...e,weights:VE}));pD.displayName=`PlusIcon`;var mD=pD,hD=M.forwardRef((e,t)=>M.createElement(Ne,{ref:t,...e,weights:HE}));hD.displayName=`SignOutIcon`;var gD=hD,_D=M.forwardRef((e,t)=>M.createElement(Ne,{ref:t,...e,weights:UE}));_D.displayName=`SunIcon`;var vD=_D,yD=M.forwardRef((e,t)=>M.createElement(Ne,{ref:t,...e,weights:WE}));yD.displayName=`TrashIcon`;var bD=yD,xD=M.createContext(void 0),SD=e=>{let t=M.useContext(xD);if(e)return e;if(!t)throw Error(`No QueryClient set, use QueryClientProvider to set one`);return t},CD=({client:e,children:t})=>(M.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),(0,N.jsx)(xD.Provider,{value:e,children:t})),wD={setTimeout:(e,t)=>setTimeout(e,t),clearTimeout:e=>clearTimeout(e),setInterval:(e,t)=>setInterval(e,t),clearInterval:e=>clearInterval(e)},TD=new class{#e=wD;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 ED(e){setTimeout(e,0)}var DD=typeof window>`u`||`Deno`in globalThis;function OD(){}function kD(e,t){return typeof e==`function`?e(t):e}function AD(e){return typeof e==`number`&&e>=0&&e!==1/0}function jD(e,t){return Math.max(e+(t||0)-Date.now(),0)}function MD(e,t){return typeof e==`function`?e(t):e}function ND(e,t){let{type:n=`all`,exact:r,fetchStatus:i,predicate:a,queryKey:o,stale:s}=e;if(o){if(r){if(t.queryHash!==FD(o,t.options))return!1}else if(!LD(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 PD(e,t){let{exact:n,status:r,predicate:i,mutationKey:a}=e;if(a){if(!t.options.mutationKey)return!1;if(n){if(ID(t.options.mutationKey)!==ID(a))return!1}else if(!LD(t.options.mutationKey,a))return!1}return!(r&&t.state.status!==r||i&&!i(t))}function FD(e,t){return(t?.queryKeyHashFn||ID)(e)}function ID(e){return JSON.stringify(e,(e,t)=>HD(t)?Object.keys(t).sort().reduce((e,n)=>(e[n]=t[n],e),{}):t)}function LD(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)){for(let n=0;n500)return t;let r=VD(e)&&VD(t);if(!r&&!(HD(e)&&HD(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{TD.setTimeout(t,e)})}function GD(e,t,n){return typeof n.structuralSharing==`function`?n.structuralSharing(e,t):n.structuralSharing===!1?t:zD(e,t)}function KD(e,t,n=0){let r=[...e,t];return n&&r.length>n?r.slice(1):r}function qD(e,t,n=0){let r=[t,...e];return n&&r.length>n?r.slice(0,-1):r}var JD=Symbol();function YD(e,t){return!e.queryFn&&t?.initialPromise?()=>t.initialPromise:!e.queryFn||e.queryFn===JD?()=>Promise.reject(Error(`Missing queryFn: '${e.queryHash}'`)):e.queryFn}function XD(e,t){return typeof e==`function`?e(...t):!!e}function ZD(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 QD=()=>DD,$D=()=>QD(),eO=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(){}},tO=new class extends eO{#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`}},nO=ED;function rO(){let e=[],t=0,n=e=>{e()},r=e=>{e()},i=nO,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 iO=rO(),aO=new class extends eO{#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 oO(e){return Math.min(1e3*2**e,3e4)}function sO(e){return(e??`online`)!==`online`||aO.isOnline()}var cO=class extends Error{constructor(e){super(`CancelledError`),this.revert=e?.revert,this.silent=e?.silent}};function lO(e){let t=!1,n=0,r,i=`pending`,a,o,s=new Promise((e,t)=>{a=e,o=t});s.catch(OD);let c=()=>i!==`pending`,l=t=>{if(!c()){let n=new cO(t);h(n),e.onCancel?.(n)}},u=()=>{t=!0},d=()=>{t=!1},f=()=>tO.isFocused()&&(e.networkMode===`always`||aO.isOnline())&&e.canRun(),p=()=>sO(e.networkMode)&&e.canRun(),m=e=>{c()||(r?.(),i=`resolved`,a(e))},h=e=>{c()||(r?.(),i=`rejected`,o(e))},g=()=>new Promise(t=>{r=e=>{(c()||f())&&t(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??($D()?0:3),a=e.retryDelay??oO,o=typeof a==`function`?a(n,r):a,s=i===!0||typeof i==`number`&&nf()?void 0:g()).then(()=>{t?h(r):_()})})};return{promise:s,status:()=>i,cancel:l,continue:()=>(r?.(),s),cancelRetry:u,continueRetry:d,canStart:p,start:()=>(p()?_():g().then(_),s)}}var uO=class{#e;destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),AD(this.gcTime)&&(this.#e=TD.setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??($D()?1/0:3e5))}clearGcTimeout(){this.#e!==void 0&&(TD.clearTimeout(this.#e),this.#e=void 0)}};function dO(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=>{ZD(e,()=>t.signal,()=>n=!0)},u=YD(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?qD:KD;return{pages:c(e.pages,o,s),pageParams:c(e.pageParams,r,s)}};if(i&&a.length){let e=i===`backward`,t=e?pO:fO,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:fO(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 fO(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 pO(e,{pages:t,pageParams:n}){return t.length>0?e.getPreviousPageParam?.(t[0],t,n[0],n):void 0}function mO(e,t){return t?fO(e,t)!=null:!1}function hO(e,t){return!t||!e.getPreviousPageParam?!1:pO(e,t)!=null}var gO=class extends uO{#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=yO(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=yO(this.options);e.data!==void 0&&(this.setState(vO(e.data,e.dataUpdatedAt)),this.#t=e)}}optionalRemove(){!this.observers.length&&this.state.fetchStatus===`idle`&&this.#r.remove(this)}setData(e,t){let n=GD(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(OD).catch(OD):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=>MD(e.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===JD||!this.isFetched()}isFetched(){return this.state.dataUpdateCount+this.state.errorUpdateCount>0}isStatic(){return this.getObserversCount()>0&&this.observers.some(e=>MD(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:!jD(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=YD(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`?dO(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=lO({initialPromise:t?.initialPromise,fn:a.fetchFn,onCancel:e=>{e instanceof cO&&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 cO){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,..._O(t.data,this.options),fetchMeta:e.meta??null};case`success`:let n={...t,...vO(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),iO.batch(()=>{this.observers.slice().forEach(e=>{e.onQueryUpdate()}),this.#r.notify({query:this,type:`updated`,action:e})})}};function _O(e,t){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:sO(t.networkMode)?`fetching`:`paused`,...e===void 0&&{error:null,status:`pending`}}}function vO(e,t){return{data:e,dataUpdatedAt:t??Date.now(),error:null,isInvalidated:!1,status:`success`}}function yO(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 bO=class extends eO{#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),SO(this.#t,this.options)?this.#m():this.updateResult(),this.#y())}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return CO(this.#t,this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return CO(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 MD(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&&!BD(this.options,t)&&this.#e.getQueryCache().notify({type:`observerOptionsUpdated`,query:this.#t,observer:this});let r=this.hasListeners();r&&wO(this.#t,n,this.options,t)&&this.#m(),this.updateResult(),r&&(this.#t!==n||MD(this.options.enabled,this.#t)!==MD(t.enabled,this.#t)||MD(this.options.staleTime,this.#t)!==MD(t.staleTime,this.#t))&&this.#g();let i=this.#_();r&&(this.#t!==n||MD(this.options.enabled,this.#t)!==MD(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 BD(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(OD)),t}#h(e){return!$D()&&MD(this.options.enabled,this.#t)!==!1&&AD(e)}#g(){this.#b();let e=MD(this.options.staleTime,this.#t);if(this.#r.isStale||!this.#h(e))return;let t=jD(this.#r.dataUpdatedAt,e)+1;this.#u=TD.setTimeout(()=>{this.#r.isStale||this.updateResult()},t)}#_(){return(typeof this.options.refetchInterval==`function`?this.options.refetchInterval(this.#t):this.options.refetchInterval)??!1}#v(e){this.#x(),this.#f=e,!(this.#f===0||!this.#h(this.#f))&&(this.#d=TD.setInterval(()=>{(this.options.refetchIntervalInBackground||tO.isFocused())&&this.#m()},this.#f))}#y(){this.#g(),this.#v(this.#_())}#b(){this.#u!==void 0&&(TD.clearTimeout(this.#u),this.#u=void 0)}#x(){this.#d!==void 0&&(TD.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&&SO(e,t),o=i&&wO(e,n,t,r);(a||o)&&(l={...l,..._O(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=GD(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=GD(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:TO(e,t),refetch:this.refetch,isEnabled:MD(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),BD(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)})})();iO.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 xO(e,t){return MD(t.enabled,e)!==!1&&e.state.data===void 0&&(e.state.status!==`error`||MD(t.retryOnMount,e)!==!1)}function SO(e,t){return xO(e,t)||e.state.data!==void 0&&CO(e,t,t.refetchOnMount)}function CO(e,t,n){if(MD(t.enabled,e)!==!1&&MD(t.staleTime,e)!==`static`){let r=typeof n==`function`?n(e):n;return r===`always`||r!==!1&&TO(e,t)}return!1}function wO(e,t,n,r){return(e!==t||MD(r.enabled,e)===!1)&&(!n.suspense||e.state.status!==`error`)&&TO(e,n)}function TO(e,t){return MD(t.enabled,e)!==!1&&e.isStaleByTime(MD(t.staleTime,e))}var EO=class extends bO{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:mO(t,n.data),hasPreviousPage:hO(t,n.data),isFetchNextPageError:l,isFetchingNextPage:u,isFetchPreviousPageError:d,isFetchingPreviousPage:f,isRefetchError:s&&!l&&!d,isRefetching:a&&!u&&!f}}},DO=class extends uO{#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||OO(),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=lO({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),iO.batch(()=>{this.#t.forEach(t=>{t.onMutationUpdate(e)}),this.#n.notify({mutation:this,type:`updated`,action:e})})}};function OO(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:`idle`,variables:void 0,submittedAt:0}}var kO=class extends eO{#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 DO({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=AO(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=AO(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=AO(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=AO(e);return typeof t==`string`?(this.#t.get(t)?.find(t=>t!==e&&t.state.isPaused))?.continue()??Promise.resolve():Promise.resolve()}clear(){iO.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=>PD(t,e))}findAll(e={}){return this.getAll().filter(t=>PD(e,t))}notify(e){iO.batch(()=>{this.listeners.forEach(t=>{t(e)})})}resumePausedMutations(){let e=this.getAll().filter(e=>e.state.isPaused);return iO.batch(()=>Promise.all(e.map(e=>e.continue().catch(OD))))}};function AO(e){return e.options.scope?.id}var jO=class extends eO{#e;constructor(e={}){super(),this.config=e,this.#e=new Map}build(e,t,n){let r=t.queryKey,i=t.queryHash??FD(r,t),a=this.get(i);return a||(a=new gO({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){let t=this.#e.get(e.queryHash);t&&(e.destroy(),t===e&&this.#e.delete(e.queryHash),this.notify({type:`removed`,query:e}))}clear(){iO.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=>ND(t,e))}findAll(e={}){let t=this.getAll();return Object.keys(e).length>0?t.filter(t=>ND(e,t)):t}notify(e){iO.batch(()=>{this.listeners.forEach(t=>{t(e)})})}onFocus(){iO.batch(()=>{this.getAll().forEach(e=>{e.onFocus()})})}onOnline(){iO.batch(()=>{this.getAll().forEach(e=>{e.onOnline()})})}},MO=class{#e;#t;#n;#r;#i;#a;#o;#s;constructor(e={}){this.#e=e.queryCache||new jO,this.#t=e.mutationCache||new kO,this.#n=e.defaultOptions||{},this.#r=new Map,this.#i=new Map,this.#a=0}mount(){this.#a++,this.#a===1&&(this.#o=tO.subscribe(async e=>{e&&(await this.resumePausedMutations(),this.#e.onFocus())}),this.#s=aO.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(MD(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=kD(t,i);if(a!==void 0)return this.#e.build(this,r).setData(a,{...n,manual:!0})}setQueriesData(e,t,n){return iO.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;iO.batch(()=>{t.findAll(e).forEach(e=>{t.remove(e)})})}resetQueries(e,t){let n=this.#e;return iO.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=iO.batch(()=>this.#e.findAll(e).map(e=>e.cancel(n)));return Promise.all(r).then(OD).catch(OD)}invalidateQueries(e,t={}){return iO.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=iO.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(OD)),e.state.fetchStatus===`paused`?Promise.resolve():t}));return Promise.all(r).then(OD)}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(MD(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(MD(t.staleTime,n))?n.fetch(t):Promise.resolve(n.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(OD).catch(OD)}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(OD).catch(OD)}ensureInfiniteQueryData(e){return e._type=`infinite`,this.ensureQueryData(e)}resumePausedMutations(){return aO.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(ID(e),{queryKey:e,defaultOptions:t})}getQueryDefaults(e){let t=[...this.#r.values()],n={};return t.forEach(t=>{LD(e,t.queryKey)&&Object.assign(n,t.defaultOptions)}),n}setMutationDefaults(e,t){this.#i.set(ID(e),{mutationKey:e,defaultOptions:t})}getMutationDefaults(e){let t=[...this.#i.values()],n={};return t.forEach(t=>{LD(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||=FD(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===JD&&(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()}},NO=M.createContext(!1),PO=()=>M.useContext(NO);NO.Provider;function FO(){let e=!1;return{clearReset:()=>{e=!1},reset:()=>{e=!0},isReset:()=>e}}var IO=M.createContext(FO()),LO=()=>M.useContext(IO),RO=(e,t,n)=>{let r=n?.state.error&&typeof e.throwOnError==`function`?XD(e.throwOnError,[n.state.error,n]):e.throwOnError;(e.suspense||r)&&(t.isReset()||(e.retryOnMount=!1))},zO=e=>{M.useEffect(()=>{e.clearReset()},[e])},BO=({result:e,errorResetBoundary:t,throwOnError:n,query:r,suspense:i})=>e.isError&&!t.isReset()&&!e.isFetching&&r&&(i&&e.data===void 0||XD(n,[e.error,r])),VO=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))}},HO=(e,t)=>e?.suspense&&t.isPending,UO=(e,t,n)=>t.fetchOptimistic(e).catch(()=>{n.clearReset()});function WO(e,t,n){let r=PO(),i=LO(),a=SD(n),o=a.defaultQueryOptions(e),s=a.getQueryCache().get(o.queryHash),c=e.subscribed!==!1;o._optimisticResults=r?`isRestoring`:c?`optimistic`:void 0,VO(o),RO(o,i,s),zO(i);let[l]=M.useState(()=>new t(a,o)),u=l.getOptimisticResult(o),d=!r&&c;if(M.useSyncExternalStore(M.useCallback(e=>{let t=d?l.subscribe(iO.batchCalls(e)):OD;return l.updateResult(),t},[l,d]),()=>l.getCurrentResult(),()=>l.getCurrentResult()),M.useEffect(()=>{l.setOptions(o)},[o,l]),HO(o,u))throw UO(o,l,i);if(BO({result:u,errorResetBoundary:i,throwOnError:o.throwOnError,query:s,suspense:o.suspense}))throw u.error;return o.notifyOnChangeProps?u:l.trackResult(u)}function GO(e,t){return WO(e,EO,t)}function KO(e,t){let n=t||{};return(e[e.length-1]===``?[...e,``]:e).join((n.padRight?` `:``)+`,`+(n.padLeft===!1?``:` `)).trim()}var qO=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,JO=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,YO={};function XO(e,t){return((t||YO).jsx?JO:qO).test(e)}var ZO=/[ \t\n\f\r]/g;function QO(e){return typeof e==`object`?e.type===`text`&&$O(e.value):$O(e)}function $O(e){return e.replace(ZO,``)===``}var ek=class{constructor(e,t,n){this.normal=t,this.property=e,n&&(this.space=n)}};ek.prototype.normal={},ek.prototype.property={},ek.prototype.space=void 0;function tk(e,t){let n={},r={};for(let t of e)Object.assign(n,t.property),Object.assign(r,t.normal);return new ek(n,r,t)}function nk(e){return e.toLowerCase()}var rk=class{constructor(e,t){this.attribute=t,this.property=e}};rk.prototype.attribute=``,rk.prototype.booleanish=!1,rk.prototype.boolean=!1,rk.prototype.commaOrSpaceSeparated=!1,rk.prototype.commaSeparated=!1,rk.prototype.defined=!1,rk.prototype.mustUseProperty=!1,rk.prototype.number=!1,rk.prototype.overloadedBoolean=!1,rk.prototype.property=``,rk.prototype.spaceSeparated=!1,rk.prototype.space=void 0;var ik=c({boolean:()=>ok,booleanish:()=>sk,commaOrSpaceSeparated:()=>dk,commaSeparated:()=>uk,number:()=>Q,overloadedBoolean:()=>ck,spaceSeparated:()=>lk}),ak=0,ok=fk(),sk=fk(),ck=fk(),Q=fk(),lk=fk(),uk=fk(),dk=fk();function fk(){return 2**++ak}var pk=Object.keys(ik),mk=class extends rk{constructor(e,t,n,r){let i=-1;if(super(e,t),hk(this,`space`,r),typeof n==`number`)for(;++i4&&n.slice(0,4)===`data`&&Ok.test(t)){if(t.charAt(4)===`-`){let e=t.slice(5).replace(Dk,jk);r=`data`+e.charAt(0).toUpperCase()+e.slice(1)}else{let e=t.slice(4);if(!Dk.test(e)){let n=e.replace(Ek,Ak);n.charAt(0)!==`-`&&(n=`-`+n),t=`data`+n}}i=mk}return new i(r,t)}function Ak(e){return`-`+e.toLowerCase()}function jk(e){return e.charAt(1).toUpperCase()}var Mk=tk([_k,bk,Sk,Ck,wk],`html`),Nk=tk([_k,xk,Sk,Ck,wk],`svg`);function Pk(e){return e.join(` `).trim()}var Fk=n(((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})),Ik=n((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(Fk());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}})),Lk=n((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))}})),Rk=n(((e,t)=>{var n=(e&&e.__importDefault||function(e){return e&&e.__esModule?e:{default:e}})(Ik()),r=Lk();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})),zk=Vk(`end`),Bk=Vk(`start`);function Vk(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 Hk(e){let t=Bk(e),n=zk(e);if(t&&n)return{start:t,end:n}}function Uk(e){return!e||typeof e!=`object`?``:`position`in e||`type`in e?Gk(e.position):`start`in e||`end`in e?Gk(e):`line`in e||`column`in e?Wk(e):``}function Wk(e){return Kk(e&&e.line)+`:`+Kk(e&&e.column)}function Gk(e){return Wk(e&&e.start)+`-`+Wk(e&&e.end)}function Kk(e){return e&&typeof e==`number`?e:1}var qk=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=Uk(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}};qk.prototype.file=``,qk.prototype.name=``,qk.prototype.reason=``,qk.prototype.message=``,qk.prototype.stack=``,qk.prototype.column=void 0,qk.prototype.line=void 0,qk.prototype.ancestors=void 0,qk.prototype.cause=void 0,qk.prototype.fatal=void 0,qk.prototype.place=void 0,qk.prototype.ruleId=void 0,qk.prototype.source=void 0;var Jk=r(Rk(),1),Yk={}.hasOwnProperty,Xk=new Map,Zk=/[A-Z]/g,Qk=new Set([`table`,`tbody`,`thead`,`tfoot`,`tr`]),$k=new Set([`td`,`th`]),eA=`https://github.com/syntax-tree/hast-util-to-jsx-runtime`;function tA(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=fA(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=dA(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`?Nk:Mk,stylePropertyNameCase:t.stylePropertyNameCase||`dom`,tableCellAlignToStyle:t.tableCellAlignToStyle!==!1},a=nA(i,e,void 0);return a&&typeof a!=`string`?a:i.create(e,i.Fragment,{children:a||void 0},void 0)}function nA(e,t,n){if(t.type===`element`)return rA(e,t,n);if(t.type===`mdxFlowExpression`||t.type===`mdxTextExpression`)return iA(e,t);if(t.type===`mdxJsxFlowElement`||t.type===`mdxJsxTextElement`)return oA(e,t,n);if(t.type===`mdxjsEsm`)return aA(e,t);if(t.type===`root`)return sA(e,t,n);if(t.type===`text`)return cA(e,t)}function rA(e,t,n){let r=e.schema,i=r;t.tagName.toLowerCase()===`svg`&&r.space===`html`&&(i=Nk,e.schema=i),e.ancestors.push(t);let a=vA(e,t.tagName,!1),o=pA(e,t),s=hA(e,t);return Qk.has(t.tagName)&&(s=s.filter(function(e){return typeof e!=`string`||!QO(e)})),lA(e,o,a,t),uA(o,s),e.ancestors.pop(),e.schema=r,e.create(t,a,o,n)}function iA(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)}yA(e,t.position)}function aA(e,t){if(t.data&&t.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(t.data.estree);yA(e,t.position)}function oA(e,t,n){let r=e.schema,i=r;t.name===`svg`&&r.space===`html`&&(i=Nk,e.schema=i),e.ancestors.push(t);let a=t.name===null?e.Fragment:vA(e,t.name,!0),o=mA(e,t),s=hA(e,t);return lA(e,o,a,t),uA(o,s),e.ancestors.pop(),e.schema=r,e.create(t,a,o,n)}function sA(e,t,n){let r={};return uA(r,hA(e,t)),e.create(t,e.Fragment,r,n)}function cA(e,t){return t.value}function lA(e,t,n,r){typeof n!=`string`&&n!==e.Fragment&&e.passNode&&(t.node=r)}function uA(e,t){if(t.length>0){let n=t.length>1?t:t[0];n&&(e.children=n)}}function dA(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 fA(e,t){return n;function n(n,r,i,a){let o=Array.isArray(i.children),s=Bk(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 pA(e,t){let n={},r,i;for(i in t.properties)if(i!==`children`&&Yk.call(t.properties,i)){let a=gA(e,i,t.properties[i]);if(a){let[i,o]=a;e.tableCellAlignToStyle&&i===`align`&&typeof o==`string`&&$k.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 mA(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 yA(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 yA(e,t.position)}else a=r.value===null||r.value;n[i]=a}return n}function hA(e,t){let n=[],r=-1,i=e.passKeys?new Map:Xk;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?(jA(e,e.length,0,t),e):t}var NA={}.hasOwnProperty;function PA(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 RA(e){return e.replace(/[\t\n\r ]+/g,` `).replace(/^ | $/g,``).toLowerCase().toUpperCase()}var zA=XA(/[A-Za-z]/),BA=XA(/[\dA-Za-z]/),VA=XA(/[#-'*+\--9=?A-Z^-~]/);function HA(e){return e!==null&&(e<32||e===127)}var UA=XA(/\d/),WA=XA(/[\dA-Fa-f]/),GA=XA(/[!-/:-@[-`{-~]/);function $(e){return e!==null&&e<-2}function KA(e){return e!==null&&(e<0||e===32)}function qA(e){return e===-2||e===-1||e===32}var JA=XA(/\p{P}|\p{S}/u),YA=XA(/\s/);function XA(e){return t;function t(t){return t!==null&&t>-1&&e.test(String.fromCharCode(t))}}function ZA(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 QA(e,t,n,r){let i=r?r-1:1/0,a=0;return o;function o(r){return qA(r)?(e.enter(n),s(r)):t(r)}function s(r){return qA(r)&&a++o))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 ij(e,t,n){return QA(e,e.attempt(this.parser.constructs.document,t,n),`linePrefix`,this.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4)}function aj(e){if(e===null||KA(e)||YA(e))return 1;if(JA(e))return 2}function oj(e,t,n){let r=[],i=-1;for(;++i1&&e[n][1].end.offset-e[n][1].start.offset>1?2:1;let d={...e[r][1].end},f={...e[n][1].start};uj(d,-c),uj(f,c),o={type:c>1?`strongSequence`:`emphasisSequence`,start:d,end:{...e[r][1].end}},s={type:c>1?`strongSequence`:`emphasisSequence`,start:{...e[n][1].start},end:f},a={type:c>1?`strongText`:`emphasisText`,start:{...e[r][1].end},end:{...e[n][1].start}},i={type:c>1?`strong`:`emphasis`,start:{...o.start},end:{...s.end}},e[r][1].end={...o.start},e[n][1].start={...s.end},l=[],e[r][1].end.offset-e[r][1].start.offset&&(l=MA(l,[[`enter`,e[r][1],t],[`exit`,e[r][1],t]])),l=MA(l,[[`enter`,i,t],[`enter`,o,t],[`exit`,o,t],[`enter`,a,t]]),l=MA(l,oj(t.parser.constructs.insideSpan.null,e.slice(r+1,n),t)),l=MA(l,[[`exit`,a,t],[`enter`,s,t],[`exit`,s,t],[`exit`,i,t]]),e[n][1].end.offset-e[n][1].start.offset?(u=2,l=MA(l,[[`enter`,e[n][1],t],[`exit`,e[n][1],t]])):u=0,jA(e,r-1,n-r+3,l),n=r+l.length-u-2;break}}for(n=-1;++n0&&qA(t)?QA(e,v,`linePrefix`,a+1)(t):v(t)}function v(t){return t===null||$(t)?e.check(Cj,h,b)(t):(e.enter(`codeFlowValue`),y(t))}function y(t){return t===null||$(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`),qA(t)?QA(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`),qA(t)?QA(e,d,`whitespace`)(t):d(t)):n(t)}function d(r){return r===null||$(r)?(e.exit(`codeFencedFence`),t(r)):n(r)}}}function Ej(e,t,n){let r=this;return i;function i(t){return t===null?n(t):(e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),a)}function a(e){return r.parser.lazy[r.now().line]?n(e):t(e)}}var Dj={name:`codeIndented`,tokenize:kj},Oj={partial:!0,tokenize:Aj};function kj(e,t,n){let r=this;return i;function i(t){return e.enter(`codeIndented`),QA(e,a,`linePrefix`,5)(t)}function a(e){let t=r.events[r.events.length-1];return t&&t[1].type===`linePrefix`&&t[2].sliceSerialize(t[1],!0).length>=4?o(e):n(e)}function o(t){return t===null?c(t):$(t)?e.attempt(Oj,o,c)(t):(e.enter(`codeFlowValue`),s(t))}function s(t){return t===null||$(t)?(e.exit(`codeFlowValue`),o(t)):(e.consume(t),s)}function c(n){return e.exit(`codeIndented`),t(n)}}function Aj(e,t,n){let r=this;return i;function i(t){return r.parser.lazy[r.now().line]?n(t):$(t)?(e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),i):QA(e,a,`linePrefix`,5)(t)}function a(e){let a=r.events[r.events.length-1];return a&&a[1].type===`linePrefix`&&a[2].sliceSerialize(a[1],!0).length>=4?t(e):$(e)?i(e):n(e)}}var jj={name:`codeText`,previous:Nj,resolve:Mj,tokenize:Pj};function Mj(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&&Ij(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),Ij(this.left,e)}unshift(e){this.setCursor(0),this.right.push(e)}unshiftMany(e){this.setCursor(0),Ij(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 Wj(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||HA(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||$(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||KA(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):$(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||$(t)||s++>999?(e.exit(`chunkString`),u(t)):(e.consume(t),c||=!qA(t),t===92?f:d)}function f(t){return t===91||t===92||t===93?(e.consume(t),s++,d):d(t)}}function Kj(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):$(t)?(e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),QA(e,l,`linePrefix`)):(e.enter(`chunkString`,{contentType:`string`}),u(t))}function u(t){return t===o||t===null||$(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 qj(e,t){let n;return r;function r(i){return $(i)?(e.enter(`lineEnding`),e.consume(i),e.exit(`lineEnding`),n=!0,r):qA(i)?QA(e,r,n?`linePrefix`:`lineSuffix`)(i):t(i)}}var Jj={name:`definition`,tokenize:Xj},Yj={partial:!0,tokenize:Zj};function Xj(e,t,n){let r=this,i;return a;function a(t){return e.enter(`definition`),o(t)}function o(t){return Gj.call(r,e,s,n,`definitionLabel`,`definitionLabelMarker`,`definitionLabelString`)(t)}function s(t){return i=RA(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 KA(t)?qj(e,l)(t):l(t)}function l(t){return Wj(e,u,n,`definitionDestination`,`definitionDestinationLiteral`,`definitionDestinationLiteralMarker`,`definitionDestinationRaw`,`definitionDestinationString`)(t)}function u(t){return e.attempt(Yj,d,d)(t)}function d(t){return qA(t)?QA(e,f,`whitespace`)(t):f(t)}function f(a){return a===null||$(a)?(e.exit(`definition`),r.parser.defined.push(i),t(a)):n(a)}}function Zj(e,t,n){return r;function r(t){return KA(t)?qj(e,i)(t):n(t)}function i(t){return Kj(e,a,n,`definitionTitle`,`definitionTitleMarker`,`definitionTitleString`)(t)}function a(t){return qA(t)?QA(e,o,`whitespace`)(t):o(t)}function o(e){return e===null||$(e)?t(e):n(e)}}var Qj={name:`hardBreakEscape`,tokenize:$j};function $j(e,t,n){return r;function r(t){return e.enter(`hardBreakEscape`),e.consume(t),i}function i(r){return $(r)?(e.exit(`hardBreakEscape`),t(r)):n(r)}}var eM={name:`headingAtx`,resolve:tM,tokenize:nM};function tM(e,t){let n=e.length-2,r=3,i,a;return 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&&(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`},jA(e,r,n-r+1,[[`enter`,i,t],[`enter`,a,t],[`exit`,a,t],[`exit`,i,t]])),e}function nM(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||KA(t)?(e.exit(`atxHeadingSequence`),s(t)):n(t)}function s(n){return n===35?(e.enter(`atxHeadingSequence`),c(n)):n===null||$(n)?(e.exit(`atxHeading`),t(n)):qA(n)?QA(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||KA(t)?(e.exit(`atxHeadingText`),s(t)):(e.consume(t),l)}}var rM=`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(`.`),iM=[`pre`,`script`,`style`,`textarea`],aM={concrete:!0,name:`htmlFlow`,resolveTo:cM,tokenize:lM},oM={partial:!0,tokenize:dM},sM={partial:!0,tokenize:uM};function cM(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 lM(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:ae):zA(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):zA(a)?(e.consume(a),i=4,r.interrupt?t:ae):n(a)}function p(i){return i===45?(e.consume(i),r.interrupt?t:ae):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 zA(t)?(e.consume(t),o=String.fromCharCode(t),g):n(t)}function g(s){if(s===null||s===47||s===62||KA(s)){let c=s===47,l=o.toLowerCase();return!c&&!a&&iM.includes(l)?(i=1,r.interrupt?t(s):O(s)):rM.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||BA(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 qA(t)?(e.consume(t),v):E(t)}function y(t){return t===47?(e.consume(t),E):t===58||t===95||zA(t)?(e.consume(t),b):qA(t)?(e.consume(t),y):E(t)}function b(t){return t===45||t===46||t===58||t===95||BA(t)?(e.consume(t),b):x(t)}function x(t){return t===61?(e.consume(t),S):qA(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):qA(t)?(e.consume(t),S):w(t)}function C(t){return t===c?(e.consume(t),c=null,T):t===null||$(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||KA(t)?x(t):(e.consume(t),w)}function T(e){return e===47||e===62||qA(e)?y(e):n(e)}function E(t){return t===62?(e.consume(t),D):n(t)}function D(t){return t===null||$(t)?O(t):qA(t)?(e.consume(t),D):n(t)}function O(t){return t===45&&i===2?(e.consume(t),ne):t===60&&i===1?(e.consume(t),re):t===62&&i===4?(e.consume(t),oe):t===63&&i===3?(e.consume(t),ae):t===93&&i===5?(e.consume(t),ie):$(t)&&(i===6||i===7)?(e.exit(`htmlFlowData`),e.check(oM,se,k)(t)):t===null||$(t)?(e.exit(`htmlFlowData`),k(t)):(e.consume(t),O)}function k(t){return e.check(sM,ee,se)(t)}function ee(t){return e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),te}function te(t){return t===null||$(t)?k(t):(e.enter(`htmlFlowData`),O(t))}function ne(t){return t===45?(e.consume(t),ae):O(t)}function re(t){return t===47?(e.consume(t),o=``,A):O(t)}function A(t){if(t===62){let n=o.toLowerCase();return iM.includes(n)?(e.consume(t),oe):O(t)}return zA(t)&&o.length<8?(e.consume(t),o+=String.fromCharCode(t),A):O(t)}function ie(t){return t===93?(e.consume(t),ae):O(t)}function ae(t){return t===62?(e.consume(t),oe):t===45&&i===2?(e.consume(t),ae):O(t)}function oe(t){return t===null||$(t)?(e.exit(`htmlFlowData`),se(t)):(e.consume(t),oe)}function se(n){return e.exit(`htmlFlow`),t(n)}}function uM(e,t,n){let r=this;return i;function i(t){return $(t)?(e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),a):n(t)}function a(e){return r.parser.lazy[r.now().line]?n(e):t(e)}}function dM(e,t,n){return r;function r(r){return e.enter(`lineEnding`),e.consume(r),e.exit(`lineEnding`),e.attempt(pj,t,n)}}var fM={name:`htmlText`,tokenize:pM};function pM(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):zA(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):zA(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):$(t)?(o=d,re(t)):(e.consume(t),d)}function f(t){return t===45?(e.consume(t),p):d(t)}function p(e){return e===62?ne(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):$(t)?(o=h,re(t)):(e.consume(t),h)}function g(t){return t===93?(e.consume(t),_):h(t)}function _(t){return t===62?ne(t):t===93?(e.consume(t),_):h(t)}function v(t){return t===null||t===62?ne(t):$(t)?(o=v,re(t)):(e.consume(t),v)}function y(t){return t===null?n(t):t===63?(e.consume(t),b):$(t)?(o=y,re(t)):(e.consume(t),y)}function b(e){return e===62?ne(e):y(e)}function x(t){return zA(t)?(e.consume(t),S):n(t)}function S(t){return t===45||BA(t)?(e.consume(t),S):C(t)}function C(t){return $(t)?(o=C,re(t)):qA(t)?(e.consume(t),C):ne(t)}function w(t){return t===45||BA(t)?(e.consume(t),w):t===47||t===62||KA(t)?T(t):n(t)}function T(t){return t===47?(e.consume(t),ne):t===58||t===95||zA(t)?(e.consume(t),E):$(t)?(o=T,re(t)):qA(t)?(e.consume(t),T):ne(t)}function E(t){return t===45||t===46||t===58||t===95||BA(t)?(e.consume(t),E):D(t)}function D(t){return t===61?(e.consume(t),O):$(t)?(o=D,re(t)):qA(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):$(t)?(o=O,re(t)):qA(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):$(t)?(o=k,re(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||KA(t)?T(t):(e.consume(t),ee)}function te(e){return e===47||e===62||KA(e)?T(e):n(e)}function ne(r){return r===62?(e.consume(r),e.exit(`htmlTextData`),e.exit(`htmlText`),t):n(r)}function re(t){return e.exit(`htmlTextData`),e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),A}function A(t){return qA(t)?QA(e,ie,`linePrefix`,r.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4)(t):ie(t)}function ie(t){return e.enter(`htmlTextData`),o(t)}}var mM={name:`labelEnd`,resolveAll:vM,resolveTo:yM,tokenize:bM},hM={tokenize:xM},gM={tokenize:SM},_M={tokenize:CM};function vM(e){let t=-1,n=[];for(;++t=3&&(a===null||$(a))?(e.exit(`thematicBreak`),t(a)):n(a)}function c(t){return t===i?(e.consume(t),r++,c):(e.exit(`thematicBreakSequence`),qA(t)?QA(e,s,`whitespace`)(t):s(t))}}var MM={continuation:{tokenize:IM},exit:RM,name:`list`,tokenize:FM},NM={partial:!0,tokenize:zM},PM={partial:!0,tokenize:LM};function FM(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:UA(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(AM,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 UA(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(pj,r.interrupt?n:u,e.attempt(NM,f,d))}function u(e){return r.containerState.initialBlankLine=!0,a++,f(e)}function d(t){return qA(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 IM(e,t,n){let r=this;return r.containerState._closeFlow=void 0,e.check(pj,i,a);function i(n){return r.containerState.furtherBlankLines=r.containerState.furtherBlankLines||r.containerState.initialBlankLine,QA(e,t,`listItemIndent`,r.containerState.size+1)(n)}function a(n){return r.containerState.furtherBlankLines||!qA(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(PM,t,o)(n))}function o(i){return r.containerState._closeFlow=!0,r.interrupt=void 0,QA(e,e.attempt(MM,t,n),`linePrefix`,r.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4)(i)}}function LM(e,t,n){let r=this;return QA(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 RM(e){e.exit(this.containerState.type)}function zM(e,t,n){let r=this;return QA(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!qA(e)&&i&&i[1].type===`listItemPrefixWhitespace`?t(e):n(e)}}var BM={name:`setextUnderline`,resolveTo:VM,tokenize:HM};function VM(e,t){let n=e.length,r,i,a;for(;n--;)if(e[n][0]===`enter`){if(e[n][1].type===`content`){r=n;break}e[n][1].type===`paragraph`&&(i=n)}else e[n][1].type===`content`&&e.splice(n,1),!a&&e[n][1].type===`definition`&&(a=n);let o={type:`setextHeading`,start:{...e[r][1].start},end:{...e[e.length-1][1].end}};return e[i][1].type=`setextHeadingText`,a?(e.splice(i,0,[`enter`,o,t]),e.splice(a+1,0,[`exit`,e[r][1],t]),e[r][1].end={...e[a][1].end}):e[r][1]=o,e.push([`exit`,o,t]),e}function HM(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`),qA(t)?QA(e,c,`lineSuffix`)(t):c(t))}function c(r){return r===null||$(r)?(e.exit(`setextHeadingLine`),t(r)):n(r)}}var UM={tokenize:WM};function WM(e){let t=this,n=e.attempt(pj,r,e.attempt(this.parser.constructs.flowInitial,i,QA(e,e.attempt(this.parser.constructs.flow,i,e.attempt(zj,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 GM={resolveAll:YM()},KM=JM(`string`),qM=JM(`text`);function JM(e){return{resolveAll:YM(e===`text`?XM: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(;++iaN,contentInitial:()=>$M,disable:()=>oN,document:()=>QM,flow:()=>tN,flowInitial:()=>eN,insideSpan:()=>iN,string:()=>nN,text:()=>rN}),QM={42:MM,43:MM,45:MM,48:MM,49:MM,50:MM,51:MM,52:MM,53:MM,54:MM,55:MM,56:MM,57:MM,62:hj},$M={91:Jj},eN={[-2]:Dj,[-1]:Dj,32:Dj},tN={35:eM,42:AM,45:[BM,AM],60:aM,61:BM,95:AM,96:wj,126:wj},nN={38:xj,92:yj},rN={[-5]:OM,[-4]:OM,[-3]:OM,33:wM,38:xj,42:sj,60:[dj,fM],91:EM,92:[Qj,yj],93:mM,95:sj,96:jj},iN={null:[sj,GM]},aN={null:[42,95]},oN={null:[]};function sN(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=MA(o,e),g(),o[o.length-1]===null?(w(t,0),l.events=oj(a,l.events,l),l.events):[]}function f(e,t){return lN(p(e),t)}function p(e){return cN(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(){let e;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 lN(e,t){let n=-1,r=[],i;for(;++n0){let e=a.tokenStack[a.tokenStack.length-1];(e[1]||CN).call(a,void 0,e[0])}for(r.position={start:bN(e.length>0?e[0][1].start:{line:1,column:1,offset:0}),end:bN(e.length>0?e[e.length-2][1].end:{line:1,column:1,offset:0})},d=-1;++d0&&(r.className=[`language-`+i[0]]);let a={type:`element`,tagName:`code`,properties:r,children:[{type:`text`,value:n}]};return t.meta&&(a.data={meta:t.meta}),e.patch(t,a),a=e.applyData(t,a),a={type:`element`,tagName:`pre`,properties:{},children:[a]},e.patch(t,a),a}function ON(e,t){let n={type:`element`,tagName:`del`,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function kN(e,t){let n={type:`element`,tagName:`em`,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function AN(e,t){let n=typeof e.options.clobberPrefix==`string`?e.options.clobberPrefix:`user-content-`,r=String(t.identifier).toUpperCase(),i=ZA(r.toLowerCase()),a=e.footnoteOrder.indexOf(r),o,s=e.footnoteCounts.get(r);s===void 0?(s=0,e.footnoteOrder.push(r),o=e.footnoteOrder.length):o=a+1,s+=1,e.footnoteCounts.set(r,s);let c={type:`element`,tagName:`a`,properties:{href:`#`+n+`fn-`+i,id:n+`fnref-`+i+(s>1?`-`+s:``),dataFootnoteRef:!0,ariaDescribedBy:[`footnote-label`]},children:[{type:`text`,value:String(o)}]};e.patch(t,c);let l={type:`element`,tagName:`sup`,properties:{},children:[c]};return e.patch(t,l),e.applyData(t,l)}function jN(e,t){let n={type:`element`,tagName:`h`+t.depth,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function MN(e,t){if(e.options.allowDangerousHtml){let n={type:`raw`,value:t.value};return e.patch(t,n),e.applyData(t,n)}}function NN(e,t){let n=t.referenceType,r=`]`;if(n===`collapsed`?r+=`[]`:n===`full`&&(r+=`[`+(t.label||t.identifier)+`]`),t.type===`imageReference`)return[{type:`text`,value:`![`+t.alt+r}];let i=e.all(t),a=i[0];a&&a.type===`text`?a.value=`[`+a.value:i.unshift({type:`text`,value:`[`});let o=i[i.length-1];return o&&o.type===`text`?o.value+=r:i.push({type:`text`,value:r}),i}function PN(e,t){let n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return NN(e,t);let i={src:ZA(r.url||``),alt:t.alt};r.title!==null&&r.title!==void 0&&(i.title=r.title);let a={type:`element`,tagName:`img`,properties:i,children:[]};return e.patch(t,a),e.applyData(t,a)}function FN(e,t){let n={src:ZA(t.url)};t.alt!==null&&t.alt!==void 0&&(n.alt=t.alt),t.title!==null&&t.title!==void 0&&(n.title=t.title);let r={type:`element`,tagName:`img`,properties:n,children:[]};return e.patch(t,r),e.applyData(t,r)}function IN(e,t){let n={type:`text`,value:t.value.replace(/\r?\n|\r/g,` `)};e.patch(t,n);let r={type:`element`,tagName:`code`,properties:{},children:[n]};return e.patch(t,r),e.applyData(t,r)}function LN(e,t){let n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return NN(e,t);let i={href:ZA(r.url||``)};r.title!==null&&r.title!==void 0&&(i.title=r.title);let a={type:`element`,tagName:`a`,properties:i,children:e.all(t)};return e.patch(t,a),e.applyData(t,a)}function RN(e,t){let n={href:ZA(t.url)};t.title!==null&&t.title!==void 0&&(n.title=t.title);let r={type:`element`,tagName:`a`,properties:n,children:e.all(t)};return e.patch(t,r),e.applyData(t,r)}function zN(e,t,n){let r=e.all(t),i=n?BN(n):VN(t),a={},o=[];if(typeof t.checked==`boolean`){let e=r[0],n;e&&e.type===`element`&&e.tagName===`p`?n=e:(n={type:`element`,tagName:`p`,properties:{},children:[]},r.unshift(n)),n.children.length>0&&n.children.unshift({type:`text`,value:` `}),n.children.unshift({type:`element`,tagName:`input`,properties:{type:`checkbox`,checked:t.checked,disabled:!0},children:[]}),a.className=[`task-list-item`]}let s=-1;for(;++s1}function HN(e,t){let n={},r=e.all(t),i=-1;for(typeof t.start==`number`&&t.start!==1&&(n.start=t.start);++i0){let r={type:`element`,tagName:`tbody`,properties:{},children:e.wrap(n,!0)},a=Bk(t.children[1]),o=zk(t.children[t.children.length-1]);a&&o&&(r.position={start:a,end:o}),i.push(r)}let a={type:`element`,tagName:`table`,properties:{},children:e.wrap(i,!0)};return e.patch(t,a),e.applyData(t,a)}function qN(e,t,n){let r=n?n.children:void 0,i=(r?r.indexOf(t):1)===0?`th`:`td`,a=n&&n.type===`table`?n.align:void 0,o=a?a.length:t.children.length,s=-1,c=[];for(;++s0,!0),r[0]),i=r.index+r[0].length,r=n.exec(t);return a.push(QN(t.slice(i),i>0,!1)),a.join(``)}function QN(e,t,n){let r=0,i=e.length;if(t){let t=e.codePointAt(r);for(;t===YN||t===XN;)r++,t=e.codePointAt(r)}if(n){let t=e.codePointAt(i-1);for(;t===YN||t===XN;)i--,t=e.codePointAt(i-1)}return i>r?e.slice(r,i):``}function $N(e,t){let n={type:`text`,value:ZN(String(t.value))};return e.patch(t,n),e.applyData(t,n)}function eP(e,t){let n={type:`element`,tagName:`hr`,properties:{},children:[]};return e.patch(t,n),e.applyData(t,n)}var tP={blockquote:TN,break:EN,code:DN,delete:ON,emphasis:kN,footnoteReference:AN,heading:jN,html:MN,imageReference:PN,image:FN,inlineCode:IN,linkReference:LN,link:RN,listItem:zN,list:HN,paragraph:UN,root:WN,strong:GN,table:KN,tableCell:JN,tableRow:qN,text:$N,thematicBreak:eP,toml:nP,yaml:nP,definition:nP,footnoteDefinition:nP};function nP(){}var rP=typeof self==`object`?self:globalThis,iP=(e,t)=>{switch(e){case`Function`:case`SharedWorker`:case`Worker`:case`eval`:case`setInterval`:case`setTimeout`:throw TypeError(`unable to deserialize `+e)}return new rP[e](t)},aP=(e,t)=>{let n=(t,n)=>(e.set(n,t),t),r=i=>{if(e.has(i))return e.get(i);let[a,o]=t[i];switch(a){case 0:case-1:return n(o,i);case 1:{let e=n([],i);for(let t of o)e.push(r(t));return e}case 2:{let e=n({},i);for(let[t,n]of o)e[r(t)]=r(n);return e}case 3:return n(new Date(o),i);case 4:{let{source:e,flags:t}=o;return n(new RegExp(e,t),i)}case 5:{let e=n(new Map,i);for(let[t,n]of o)e.set(r(t),r(n));return e}case 6:{let e=n(new Set,i);for(let t of o)e.add(r(t));return e}case 7:{let{name:e,message:t}=o;return n(typeof rP[e]==`function`?iP(e,t):Error(t),i)}case 8:return n(BigInt(o),i);case`BigInt`:return n(Object(BigInt(o)),i);case`ArrayBuffer`:return n(new Uint8Array(o).buffer,o);case`DataView`:{let{buffer:e}=new Uint8Array(o);return n(new DataView(e),o)}}return n(iP(a,o),i)};return r},oP=e=>aP(new Map,e)(0),sP=``,{toString:cP}={},{keys:lP}=Object,uP=e=>{let t=typeof e;if(t!==`object`||!e)return[0,t];let n=cP.call(e).slice(8,-1);switch(n){case`Array`:return[1,sP];case`Object`:return[2,sP];case`Date`:return[3,sP];case`RegExp`:return[4,sP];case`Map`:return[5,sP];case`Set`:return[6,sP];case`DataView`:return[1,n]}return n.includes(`Array`)?[1,n]:e instanceof Error?[7,e.name||`Error`]:[2,n]},dP=([e,t])=>e===0&&(t===`function`||t===`symbol`),fP=(e,t,n,r)=>{let i=(e,t)=>{let i=r.push(e)-1;return n.set(t,i),i},a=r=>{if(n.has(r))return n.get(r);let[o,s]=uP(r);switch(o){case 0:{let t=r;switch(s){case`bigint`:o=8,t=r.toString();break;case`function`:case`symbol`:if(e)throw TypeError(`unable to serialize `+s);t=null;break;case`undefined`:return i([-1],r)}return i([o,t],r)}case 1:{if(s){let e=r;return s===`DataView`?e=new Uint8Array(r.buffer):s===`ArrayBuffer`&&(e=new Uint8Array(r)),i([s,[...e]],r)}let e=[],t=i([o,e],r);for(let t of r)e.push(a(t));return t}case 2:{if(s)switch(s){case`BigInt`:return i([s,r.toString()],r);case`Boolean`:case`Number`:case`String`:return i([s,r.valueOf()],r)}if(t&&`toJSON`in r)return a(r.toJSON());let n=[],c=i([o,n],r);for(let t of lP(r))(e||!dP(uP(r[t])))&&n.push([a(t),a(r[t])]);return c}case 3:return i([o,isNaN(r.getTime())?sP:r.toISOString()],r);case 4:{let{source:e,flags:t}=r;return i([o,{source:e,flags:t}],r)}case 5:{let t=[],n=i([o,t],r);for(let[n,i]of r)(e||!(dP(uP(n))||dP(uP(i))))&&t.push([a(n),a(i)]);return n}case 6:{let t=[],n=i([o,t],r);for(let n of r)(e||!dP(uP(n)))&&t.push(a(n));return n}}let{message:c}=r;return i([o,{name:s,message:c}],r)};return a},pP=(e,{json:t,lossy:n}={})=>{let r=[];return fP(!(t||n),!!t,new Map,r)(e),r},mP=typeof structuredClone==`function`?(e,t)=>t&&(`json`in t||`lossy`in t)?oP(pP(e,t)):structuredClone(e):(e,t)=>oP(pP(e,t));function hP(e,t){let n=[{type:`text`,value:`↩`}];return t>1&&n.push({type:`element`,tagName:`sup`,properties:{},children:[{type:`text`,value:String(t)}]}),n}function gP(e,t){return`Back to reference `+(e+1)+(t>1?`-`+t:``)}function _P(e){let t=typeof e.options.clobberPrefix==`string`?e.options.clobberPrefix:`user-content-`,n=e.options.footnoteBackContent||hP,r=e.options.footnoteBackLabel||gP,i=e.options.footnoteLabel||`Footnotes`,a=e.options.footnoteLabelTagName||`h2`,o=e.options.footnoteLabelProperties||{className:[`sr-only`]},s=[],c=-1;for(;++c0&&d.push({type:`text`,value:` `});let e=typeof n==`string`?n:n(c,u);typeof e==`string`&&(e={type:`text`,value:e}),d.push({type:`element`,tagName:`a`,properties:{href:`#`+t+`fnref-`+l+(u>1?`-`+u:``),dataFootnoteBackref:``,ariaLabel:typeof r==`string`?r:r(c,u),className:[`data-footnote-backref`]},children:Array.isArray(e)?e:[e]})}let p=a[a.length-1];if(p&&p.type===`element`&&p.tagName===`p`){let e=p.children[p.children.length-1];e&&e.type===`text`?e.value+=` `:p.children.push({type:`text`,value:` `}),p.children.push(...d)}else a.push(...d);let m={type:`element`,tagName:`li`,properties:{id:t+`fn-`+l},children:e.wrap(a,!0)};e.patch(i,m),s.push(m)}if(s.length!==0)return{type:`element`,tagName:`section`,properties:{dataFootnotes:!0,className:[`footnotes`]},children:[{type:`element`,tagName:a,properties:{...mP(o),id:`footnote-label`},children:[{type:`text`,value:i}]},{type:`text`,value:` -`},{type:`element`,tagName:`ol`,properties:{},children:e.wrap(s,!0)},{type:`text`,value:` -`}]}}var vP=(function(e){if(e==null)return CP;if(typeof e==`function`)return SP(e);if(typeof e==`object`)return Array.isArray(e)?yP(e):bP(e);if(typeof e==`string`)return xP(e);throw Error(`Expected function, string, or object as test`)});function yP(e){let t=[],n=-1;for(;++n`:``))+`)`})}return u;function u(){let l=EP,u,d,f;if((!t||a(e,i,c[c.length-1]||void 0))&&(l=OP(n(e,c)),l[0]===!1))return l;if(`children`in e&&e.children){let t=e;if(t.children&&l[0]!==`skip`)for(d=(r?t.children.length:-1)+o,f=c.concat(t);d>-1&&d0&&n.push({type:`text`,value:` -`}),n}function LP(e){let t=0,n=e.charCodeAt(t);for(;n===9||n===32;)t++,n=e.charCodeAt(t);return e.slice(t)}function RP(e,t){let n=MP(e,t),r=n.one(e,void 0),i=_P(n),a=Array.isArray(r)?{type:`root`,children:r}:r||{type:`root`,children:[]};return i&&(`children`in a,a.children.push({type:`text`,value:` -`},i)),a}function zP(e,t){return e&&`run`in e?async function(n,r){let i=RP(n,{file:r,...t});await e.run(i,r)}:function(n,r){return RP(n,{file:r,...e||t})}}function BP(e){if(e)throw e}var VP=n(((e,t)=>{var n=Object.prototype.hasOwnProperty,r=Object.prototype.toString,i=Object.defineProperty,a=Object.getOwnPropertyDescriptor,o=function(e){return typeof Array.isArray==`function`?Array.isArray(e):r.call(e)===`[object Array]`},s=function(e){if(!e||r.call(e)!==`[object Object]`)return!1;var t=n.call(e,`constructor`),i=e.constructor&&e.constructor.prototype&&n.call(e.constructor.prototype,`isPrototypeOf`);if(e.constructor&&!t&&!i)return!1;for(var a in e);return a===void 0||n.call(e,a)},c=function(e,t){i&&t.name===`__proto__`?i(e,t.name,{enumerable:!0,configurable:!0,value:t.newValue,writable:!0}):e[t.name]=t.newValue},l=function(e,t){if(t===`__proto__`){if(!n.call(e,t))return;if(a)return a(e,t).value}return e[t]};t.exports=function e(){var t,n,r,i,a,u,d=arguments[0],f=1,p=arguments.length,m=!1;for(typeof d==`boolean`&&(m=d,d=arguments[1]||{},f=2),(d==null||typeof d!=`object`&&typeof d!=`function`)&&(d={});ft.length,o;r&&t.push(i);try{o=e.apply(this,t)}catch(e){let t=e;if(r&&n)throw t;return i(t)}r||(o&&o.then&&typeof o.then==`function`?o.then(a,i):o instanceof Error?i(o):a(o))}function i(e,...r){n||(n=!0,t(e,...r))}function a(e){i(null,e)}}var GP={basename:KP,dirname:qP,extname:JP,join:YP,sep:`/`};function KP(e,t){if(t!==void 0&&typeof t!=`string`)throw TypeError(`"ext" argument must be a string`);QP(e);let n=0,r=-1,i=e.length,a;if(t===void 0||t.length===0||t.length>e.length){for(;i--;)if(e.codePointAt(i)===47){if(a){n=i+1;break}}else r<0&&(a=!0,r=i+1);return r<0?``:e.slice(n,r)}if(t===e)return``;let o=-1,s=t.length-1;for(;i--;)if(e.codePointAt(i)===47){if(a){n=i+1;break}}else o<0&&(a=!0,o=i+1),s>-1&&(e.codePointAt(i)===t.codePointAt(s--)?s<0&&(r=i):(s=-1,r=o));return n===r?r=o:r<0&&(r=e.length),e.slice(n,r)}function qP(e){if(QP(e),e.length===0)return`.`;let t=-1,n=e.length,r;for(;--n;)if(e.codePointAt(n)===47){if(r){t=n;break}}else r||=!0;return t<0?e.codePointAt(0)===47?`/`:`.`:t===1&&e.codePointAt(0)===47?`//`:e.slice(0,t)}function JP(e){QP(e);let t=e.length,n=-1,r=0,i=-1,a=0,o;for(;t--;){let s=e.codePointAt(t);if(s===47){if(o){r=t+1;break}continue}n<0&&(o=!0,n=t+1),s===46?i<0?i=t:a!==1&&(a=1):i>-1&&(a=-1)}return i<0||n<0||a===0||a===1&&i===n-1&&i===r+1?``:e.slice(i,n)}function YP(...e){let t=-1,n;for(;++t0&&e.codePointAt(e.length-1)===47&&(n+=`/`),t?`/`+n:n}function ZP(e,t){let n=``,r=0,i=-1,a=0,o=-1,s,c;for(;++o<=e.length;){if(o2){if(c=n.lastIndexOf(`/`),c!==n.length-1){c<0?(n=``,r=0):(n=n.slice(0,c),r=n.length-1-n.lastIndexOf(`/`)),i=o,a=0;continue}}else if(n.length>0){n=``,r=0,i=o,a=0;continue}}t&&(n=n.length>0?n+`/..`:`..`,r=2)}else n.length>0?n+=`/`+e.slice(i+1,o):n=e.slice(i+1,o),r=o-i-1}i=o,a=0}else s===46&&a>-1?a++:a=-1}return n}function QP(e){if(typeof e!=`string`)throw TypeError(`Path must be a string. Received `+JSON.stringify(e))}var $P={cwd:eF};function eF(){return`/`}function tF(e){return!!(typeof e==`object`&&e&&`href`in e&&e.href&&`protocol`in e&&e.protocol&&e.auth===void 0)}function nF(e){if(typeof e==`string`)e=new URL(e);else if(!tF(e)){let t=TypeError('The "path" argument must be of type string or an instance of URL. Received `'+e+"`");throw t.code=`ERR_INVALID_ARG_TYPE`,t}if(e.protocol!==`file:`){let e=TypeError(`The URL must be of scheme file`);throw e.code=`ERR_INVALID_URL_SCHEME`,e}return rF(e)}function rF(e){if(e.hostname!==``){let e=TypeError(`File URL host must be "localhost" or empty on darwin`);throw e.code=`ERR_INVALID_FILE_URL_HOST`,e}let t=e.pathname,n=-1;for(;++n0){let[r,...a]=t,o=n[i][1];HP(o)&&HP(r)&&(r=(0,dF.default)(!0,o,r)),n[i]=[e,r,...a]}}}}().freeze();function mF(e,t){if(typeof t!=`function`)throw TypeError("Cannot `"+e+"` without `parser`")}function hF(e,t){if(typeof t!=`function`)throw TypeError("Cannot `"+e+"` without `compiler`")}function gF(e,t){if(t)throw Error("Cannot call `"+e+"` on a frozen processor.\nCreate a new processor first, by calling it: use `processor()` instead of `processor`.")}function _F(e){if(!HP(e)||typeof e.type!=`string`)throw TypeError("Expected node, got `"+e+"`")}function vF(e,t,n){if(!n)throw Error("`"+e+"` finished async. Use `"+t+"` instead")}function yF(e){return bF(e)?e:new aF(e)}function bF(e){return!!(e&&typeof e==`object`&&`message`in e&&`messages`in e)}function xF(e){return typeof e==`string`||SF(e)}function SF(e){return!!(e&&typeof e==`object`&&`byteLength`in e&&`byteOffset`in e)}var CF=[],wF={allowDangerousHtml:!0},TF=/^(https?|ircs?|mailto|xmpp)$/i,EF=[{from:`astPlugins`,id:`remove-buggy-html-in-markdown-parser`},{from:`allowDangerousHtml`,id:`remove-buggy-html-in-markdown-parser`},{from:`allowNode`,id:`replace-allownode-allowedtypes-and-disallowedtypes`,to:`allowElement`},{from:`allowedTypes`,id:`replace-allownode-allowedtypes-and-disallowedtypes`,to:`allowedElements`},{from:`className`,id:`remove-classname`},{from:`disallowedTypes`,id:`replace-allownode-allowedtypes-and-disallowedtypes`,to:`disallowedElements`},{from:`escapeHtml`,id:`remove-buggy-html-in-markdown-parser`},{from:`includeElementIndex`,id:`#remove-includeelementindex`},{from:`includeNodeIndex`,id:`change-includenodeindex-to-includeelementindex`},{from:`linkTarget`,id:`remove-linktarget`},{from:`plugins`,id:`change-plugins-to-remarkplugins`,to:`remarkPlugins`},{from:`rawSourcePos`,id:`#remove-rawsourcepos`},{from:`renderers`,id:`change-renderers-to-components`,to:`components`},{from:`source`,id:`change-source-to-children`,to:`children`},{from:`sourcePos`,id:`#remove-sourcepos`},{from:`transformImageUri`,id:`#add-urltransform`,to:`urlTransform`},{from:`transformLinkUri`,id:`#add-urltransform`,to:`urlTransform`}];function DF(e){let t=OF(e),n=kF(e);return AF(t.runSync(t.parse(n),n),e)}function OF(e){let t=e.rehypePlugins||CF,n=e.remarkPlugins||CF,r=e.remarkRehypeOptions?{...e.remarkRehypeOptions,...wF}:wF;return pF().use(wN).use(n).use(zP,r).use(t)}function kF(e){let t=e.children||``,n=new aF;return typeof t==`string`?n.value=t:``+t,n}function AF(e,t){let n=t.allowedElements,r=t.allowElement,i=t.components,a=t.disallowedElements,o=t.skipHtml,s=t.unwrapDisallowed,c=t.urlTransform||jF;for(let e of EF)Object.hasOwn(t,e.from)&&``+e.from+(e.to?"use `"+e.to+"` instead":`remove it`)+e.id;return kP(e,l),tA(e,{Fragment:N.Fragment,components:i,ignoreInvalidStyle:!0,jsx:N.jsx,jsxs:N.jsxs,passKeys:!0,passNode:!0});function l(e,t,i){if(e.type===`raw`&&i&&typeof t==`number`)return o?i.children.splice(t,1):i.children[t]={type:`text`,value:e.value},t;if(e.type===`element`){let t;for(t in CA)if(Object.hasOwn(CA,t)&&Object.hasOwn(e.properties,t)){let n=e.properties[t],r=CA[t];(r===null||r.includes(e.tagName))&&(e.properties[t]=c(String(n||``),t,e))}}if(e.type===`element`){let o=n?!n.includes(e.tagName):a?a.includes(e.tagName):!1;if(!o&&r&&typeof t==`number`&&(o=!r(e,t,i)),o&&i&&typeof t==`number`)return s&&e.children?i.children.splice(t,1,...e.children):i.children.splice(t,1),t}}}function jF(e){let t=e.indexOf(`:`),n=e.indexOf(`?`),r=e.indexOf(`#`),i=e.indexOf(`/`);return t===-1||i!==-1&&t>i||n!==-1&&t>n||r!==-1&&t>r||TF.test(e.slice(0,t))?e:``}function MF(e,t){let n=String(e);if(typeof t!=`string`)throw TypeError(`Expected character`);let r=0,i=n.indexOf(t);for(;i!==-1;)r++,i=n.indexOf(t,i+t.length);return r}function NF(e){if(typeof e!=`string`)throw TypeError(`Expected a string`);return e.replace(/[|\\{}()[\]^$+*?.]/g,`\\$&`).replace(/-/g,`\\x2d`)}function PF(e,t,n){let r=vP((n||{}).ignore||[]),i=FF(t),a=-1;for(;++a0?{type:`text`,value:a}:void 0),a===!1?r.lastIndex=n+1:(s!==n&&u.push({type:`text`,value:e.value.slice(s,n)}),Array.isArray(a)?u.push(...a):a&&u.push(a),s=n+d[0].length,l=!0),!r.global)break;d=r.exec(e.value)}return l?(s?\]}]+$/.exec(e);if(!t)return[e,void 0];e=e.slice(0,t.index);let n=t[0],r=n.indexOf(`)`),i=MF(e,`(`),a=MF(e,`)`);for(;r!==-1&&i>a;)e+=n.slice(0,r+1),n=n.slice(r+1),r=n.indexOf(`)`),a++;return[e,n]}function $F(e,t){let n=e.input.charCodeAt(e.index-1);return(e.index===0||YA(n)||JA(n))&&(!t||n!==47)}lI.peek=cI;function eI(){this.buffer()}function tI(e){this.enter({type:`footnoteReference`,identifier:``,label:``},e)}function nI(){this.buffer()}function rI(e){this.enter({type:`footnoteDefinition`,identifier:``,label:``,children:[]},e)}function iI(e){let t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=RA(this.sliceSerialize(e)).toLowerCase(),n.label=t}function aI(e){this.exit(e)}function oI(e){let t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=RA(this.sliceSerialize(e)).toLowerCase(),n.label=t}function sI(e){this.exit(e)}function cI(){return`[`}function lI(e,t,n,r){let i=n.createTracker(r),a=i.move(`[^`),o=n.enter(`footnoteReference`),s=n.enter(`reference`);return a+=i.move(n.safe(n.associationId(e),{after:`]`,before:a})),s(),o(),a+=i.move(`]`),a}function uI(){return{enter:{gfmFootnoteCallString:eI,gfmFootnoteCall:tI,gfmFootnoteDefinitionLabelString:nI,gfmFootnoteDefinition:rI},exit:{gfmFootnoteCallString:iI,gfmFootnoteCall:aI,gfmFootnoteDefinitionLabelString:oI,gfmFootnoteDefinition:sI}}}function dI(e){let t=!1;return e&&e.firstLineBlank&&(t=!0),{handlers:{footnoteDefinition:n,footnoteReference:lI},unsafe:[{character:`[`,inConstruct:[`label`,`phrasing`,`reference`]}]};function n(e,n,r,i){let a=r.createTracker(i),o=a.move(`[^`),s=r.enter(`footnoteDefinition`),c=r.enter(`label`);return o+=a.move(r.safe(r.associationId(e),{before:o,after:`]`})),c(),o+=a.move(`]:`),e.children&&e.children.length>0&&(a.shift(4),o+=a.move((t?` -`:` `)+r.indentLines(r.containerFlow(e,a.current()),t?pI:fI))),s(),o}}function fI(e,t,n){return t===0?e:pI(e,t,n)}function pI(e,t,n){return(n?``:` `)+e}var mI=[`autolink`,`destinationLiteral`,`destinationRaw`,`reference`,`titleQuote`,`titleApostrophe`];yI.peek=bI;function hI(){return{canContainEols:[`delete`],enter:{strikethrough:_I},exit:{strikethrough:vI}}}function gI(){return{unsafe:[{character:`~`,inConstruct:`phrasing`,notInConstruct:mI}],handlers:{delete:yI}}}function _I(e){this.enter({type:`delete`,children:[]},e)}function vI(e){this.exit(e)}function yI(e,t,n,r){let i=n.createTracker(r),a=n.enter(`strikethrough`),o=i.move(`~~`);return o+=n.containerPhrasing(e,{...i.current(),before:o,after:`~`}),o+=i.move(`~~`),a(),o}function bI(){return`~`}function xI(e){return e.length}function SI(e,t){let n=t||{},r=(n.align||[]).concat(),i=n.stringLength||xI,a=[],o=[],s=[],c=[],l=0,u=-1;for(;++ul&&(l=e[u].length);++ac[a])&&(c[a]=e)}t.push(o)}o[u]=t,s[u]=r}let d=-1;if(typeof r==`object`&&`length`in r)for(;++dc[d]&&(c[d]=i),p[d]=i),f[d]=o}o.splice(1,0,f),s.splice(1,0,p),u=-1;let m=[];for(;++u `),a.shift(2);let o=n.indentLines(n.containerFlow(e,a.current()),EI);return i(),o}function EI(e,t,n){return`>`+(n?``:` `)+e}function DI(e,t){return OI(e,t.inConstruct,!0)&&!OI(e,t.notInConstruct,!1)}function OI(e,t,n){if(typeof t==`string`&&(t=[t]),!t||t.length===0)return n;let r=-1;for(;++ro&&(o=a):a=1,i=r+t.length,r=n.indexOf(t,i);return o}function jI(e,t){return!!(t.options.fences===!1&&e.value&&!e.lang&&/[^ \r\n]/.test(e.value)&&!/^[\t ]*(?:[\r\n]|$)|(?:^|[\r\n])[\t ]*$/.test(e.value))}function MI(e){let t=e.options.fence||"`";if(t!=="`"&&t!==`~`)throw Error("Cannot serialize code with `"+t+"` for `options.fence`, expected `` ` `` or `~`");return t}function NI(e,t,n,r){let i=MI(n),a=e.value||``,o=i==="`"?`GraveAccent`:`Tilde`;if(jI(e,n)){let e=n.enter(`codeIndented`),t=n.indentLines(a,PI);return e(),t}let s=n.createTracker(r),c=i.repeat(Math.max(AI(a,i)+1,3)),l=n.enter(`codeFenced`),u=s.move(c);if(e.lang){let t=n.enter(`codeFencedLang${o}`);u+=s.move(n.safe(e.lang,{before:u,after:` `,encode:["`"],...s.current()})),t()}if(e.lang&&e.meta){let t=n.enter(`codeFencedMeta${o}`);u+=s.move(` `),u+=s.move(n.safe(e.meta,{before:u,after:` -`,encode:["`"],...s.current()})),t()}return u+=s.move(` -`),a&&(u+=s.move(a+` -`)),u+=s.move(c),l(),u}function PI(e,t,n){return(n?``:` `)+e}function FI(e){let t=e.options.quote||`"`;if(t!==`"`&&t!==`'`)throw Error("Cannot serialize title with `"+t+"` for `options.quote`, expected `\"`, or `'`");return t}function II(e,t,n,r){let i=FI(n),a=i===`"`?`Quote`:`Apostrophe`,o=n.enter(`definition`),s=n.enter(`label`),c=n.createTracker(r),l=c.move(`[`);return l+=c.move(n.safe(n.associationId(e),{before:l,after:`]`,...c.current()})),l+=c.move(`]: `),s(),!e.url||/[\0- \u007F]/.test(e.url)?(s=n.enter(`destinationLiteral`),l+=c.move(`<`),l+=c.move(n.safe(e.url,{before:l,after:`>`,...c.current()})),l+=c.move(`>`)):(s=n.enter(`destinationRaw`),l+=c.move(n.safe(e.url,{before:l,after:e.title?` `:` -`,...c.current()}))),s(),e.title&&(s=n.enter(`title${a}`),l+=c.move(` `+i),l+=c.move(n.safe(e.title,{before:l,after:i,...c.current()})),l+=c.move(i),s()),o(),l}function LI(e){let t=e.options.emphasis||`*`;if(t!==`*`&&t!==`_`)throw Error("Cannot serialize emphasis with `"+t+"` for `options.emphasis`, expected `*`, or `_`");return t}function RI(e){return`&#x`+e.toString(16).toUpperCase()+`;`}function zI(e,t,n){let r=aj(e),i=aj(t);return r===void 0?i===void 0?n===`_`?{inside:!0,outside:!0}:{inside:!1,outside:!1}:i===1?{inside:!0,outside:!0}:{inside:!1,outside:!0}:r===1?i===void 0?{inside:!1,outside:!1}:i===1?{inside:!0,outside:!0}:{inside:!1,outside:!1}:i===void 0?{inside:!1,outside:!1}:i===1?{inside:!0,outside:!1}:{inside:!1,outside:!1}}BI.peek=VI;function BI(e,t,n,r){let i=LI(n),a=n.enter(`emphasis`),o=n.createTracker(r),s=o.move(i),c=o.move(n.containerPhrasing(e,{after:i,before:s,...o.current()})),l=c.charCodeAt(0),u=zI(r.before.charCodeAt(r.before.length-1),l,i);u.inside&&(c=RI(l)+c.slice(1));let d=c.charCodeAt(c.length-1),f=zI(r.after.charCodeAt(0),d,i);f.inside&&(c=c.slice(0,-1)+RI(d));let p=o.move(i);return a(),n.attentionEncodeSurroundingInfo={after:f.outside,before:u.outside},s+c+p}function VI(e,t,n){return n.options.emphasis||`*`}function HI(e,t){let n=!1;return kP(e,function(e){if(`value`in e&&/\r?\n|\r/.test(e.value)||e.type===`break`)return n=!0,!1}),!!((!e.depth||e.depth<3)&&TA(e)&&(t.options.setext||n))}function UI(e,t,n,r){let i=Math.max(Math.min(6,e.depth||1),1),a=n.createTracker(r);if(HI(e,n)){let t=n.enter(`headingSetext`),r=n.enter(`phrasing`),o=n.containerPhrasing(e,{...a.current(),before:` -`,after:` -`});return r(),t(),o+` -`+(i===1?`=`:`-`).repeat(o.length-(Math.max(o.lastIndexOf(`\r`),o.lastIndexOf(` -`))+1))}let o=`#`.repeat(i),s=n.enter(`headingAtx`),c=n.enter(`phrasing`);a.move(o+` `);let l=n.containerPhrasing(e,{before:`# `,after:` -`,...a.current()});return/^[\t ]/.test(l)&&(l=RI(l.charCodeAt(0))+l.slice(1)),l=l?o+` `+l:o,n.options.closeAtx&&(l+=` `+o),c(),s(),l}WI.peek=GI;function WI(e){return e.value||``}function GI(){return`<`}KI.peek=qI;function KI(e,t,n,r){let i=FI(n),a=i===`"`?`Quote`:`Apostrophe`,o=n.enter(`image`),s=n.enter(`label`),c=n.createTracker(r),l=c.move(`![`);return l+=c.move(n.safe(e.alt,{before:l,after:`]`,...c.current()})),l+=c.move(`](`),s(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(s=n.enter(`destinationLiteral`),l+=c.move(`<`),l+=c.move(n.safe(e.url,{before:l,after:`>`,...c.current()})),l+=c.move(`>`)):(s=n.enter(`destinationRaw`),l+=c.move(n.safe(e.url,{before:l,after:e.title?` `:`)`,...c.current()}))),s(),e.title&&(s=n.enter(`title${a}`),l+=c.move(` `+i),l+=c.move(n.safe(e.title,{before:l,after:i,...c.current()})),l+=c.move(i),s()),l+=c.move(`)`),o(),l}function qI(){return`!`}JI.peek=YI;function JI(e,t,n,r){let i=e.referenceType,a=n.enter(`imageReference`),o=n.enter(`label`),s=n.createTracker(r),c=s.move(`![`),l=n.safe(e.alt,{before:c,after:`]`,...s.current()});c+=s.move(l+`][`),o();let u=n.stack;n.stack=[],o=n.enter(`reference`);let d=n.safe(n.associationId(e),{before:c,after:`]`,...s.current()});return o(),n.stack=u,a(),i===`full`||!l||l!==d?c+=s.move(d+`]`):i===`shortcut`?c=c.slice(0,-1):c+=s.move(`]`),c}function YI(){return`!`}XI.peek=ZI;function XI(e,t,n){let r=e.value||``,i="`",a=-1;for(;RegExp("(^|[^`])"+i+"([^`]|$)").test(r);)i+="`";for(/[^ \r\n]/.test(r)&&(/^[ \r\n]/.test(r)&&/[ \r\n]$/.test(r)||/^`|`$/.test(r))&&(r=` `+r+` `);++a\u007F]/.test(e.url))}$I.peek=eL;function $I(e,t,n,r){let i=FI(n),a=i===`"`?`Quote`:`Apostrophe`,o=n.createTracker(r),s,c;if(QI(e,n)){let t=n.stack;n.stack=[],s=n.enter(`autolink`);let r=o.move(`<`);return r+=o.move(n.containerPhrasing(e,{before:r,after:`>`,...o.current()})),r+=o.move(`>`),s(),n.stack=t,r}s=n.enter(`link`),c=n.enter(`label`);let l=o.move(`[`);return l+=o.move(n.containerPhrasing(e,{before:l,after:`](`,...o.current()})),l+=o.move(`](`),c(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(c=n.enter(`destinationLiteral`),l+=o.move(`<`),l+=o.move(n.safe(e.url,{before:l,after:`>`,...o.current()})),l+=o.move(`>`)):(c=n.enter(`destinationRaw`),l+=o.move(n.safe(e.url,{before:l,after:e.title?` `:`)`,...o.current()}))),c(),e.title&&(c=n.enter(`title${a}`),l+=o.move(` `+i),l+=o.move(n.safe(e.title,{before:l,after:i,...o.current()})),l+=o.move(i),c()),l+=o.move(`)`),s(),l}function eL(e,t,n){return QI(e,n)?`<`:`[`}tL.peek=nL;function tL(e,t,n,r){let i=e.referenceType,a=n.enter(`linkReference`),o=n.enter(`label`),s=n.createTracker(r),c=s.move(`[`),l=n.containerPhrasing(e,{before:c,after:`]`,...s.current()});c+=s.move(l+`][`),o();let u=n.stack;n.stack=[],o=n.enter(`reference`);let d=n.safe(n.associationId(e),{before:c,after:`]`,...s.current()});return o(),n.stack=u,a(),i===`full`||!l||l!==d?c+=s.move(d+`]`):i===`shortcut`?c=c.slice(0,-1):c+=s.move(`]`),c}function nL(){return`[`}function rL(e){let t=e.options.bullet||`*`;if(t!==`*`&&t!==`+`&&t!==`-`)throw Error("Cannot serialize items with `"+t+"` for `options.bullet`, expected `*`, `+`, or `-`");return t}function iL(e){let t=rL(e),n=e.options.bulletOther;if(!n)return t===`*`?`-`:`*`;if(n!==`*`&&n!==`+`&&n!==`-`)throw Error("Cannot serialize items with `"+n+"` for `options.bulletOther`, expected `*`, `+`, or `-`");if(n===t)throw Error("Expected `bullet` (`"+t+"`) and `bulletOther` (`"+n+"`) to be different");return n}function aL(e){let t=e.options.bulletOrdered||`.`;if(t!==`.`&&t!==`)`)throw Error("Cannot serialize items with `"+t+"` for `options.bulletOrdered`, expected `.` or `)`");return t}function oL(e){let t=e.options.rule||`*`;if(t!==`*`&&t!==`-`&&t!==`_`)throw Error("Cannot serialize rules with `"+t+"` for `options.rule`, expected `*`, `-`, or `_`");return t}function sL(e,t,n,r){let i=n.enter(`list`),a=n.bulletCurrent,o=e.ordered?aL(n):rL(n),s=e.ordered?o===`.`?`)`:`.`:iL(n),c=t&&n.bulletLastUsed?o===n.bulletLastUsed:!1;if(!e.ordered){let t=e.children?e.children[0]:void 0;if((o===`*`||o===`-`)&&t&&(!t.children||!t.children[0])&&n.stack[n.stack.length-1]===`list`&&n.stack[n.stack.length-2]===`listItem`&&n.stack[n.stack.length-3]===`list`&&n.stack[n.stack.length-4]===`listItem`&&n.indexStack[n.indexStack.length-1]===0&&n.indexStack[n.indexStack.length-2]===0&&n.indexStack[n.indexStack.length-3]===0&&(c=!0),oL(n)===o&&t){let t=-1;for(;++t-1?t.start:1)+(n.options.incrementListMarker===!1?0:t.children.indexOf(e))+a);let o=a.length+1;(i===`tab`||i===`mixed`&&(t&&t.type===`list`&&t.spread||e.spread))&&(o=Math.ceil(o/4)*4);let s=n.createTracker(r);s.move(a+` `.repeat(o-a.length)),s.shift(o);let c=n.enter(`listItem`),l=n.indentLines(n.containerFlow(e,s.current()),u);return c(),l;function u(e,t,n){return t?(n?``:` `.repeat(o))+e:(n?a:a+` `.repeat(o-a.length))+e}}function uL(e,t,n,r){let i=n.enter(`paragraph`),a=n.enter(`phrasing`),o=n.containerPhrasing(e,r);return a(),i(),o}var dL=vP([`break`,`delete`,`emphasis`,`footnote`,`footnoteReference`,`image`,`imageReference`,`inlineCode`,`inlineMath`,`link`,`linkReference`,`mdxJsxTextElement`,`mdxTextExpression`,`strong`,`text`,`textDirective`]);function fL(e,t,n,r){return(e.children.some(function(e){return dL(e)})?n.containerPhrasing:n.containerFlow).call(n,e,r)}function pL(e){let t=e.options.strong||`*`;if(t!==`*`&&t!==`_`)throw Error("Cannot serialize strong with `"+t+"` for `options.strong`, expected `*`, or `_`");return t}mL.peek=hL;function mL(e,t,n,r){let i=pL(n),a=n.enter(`strong`),o=n.createTracker(r),s=o.move(i+i),c=o.move(n.containerPhrasing(e,{after:i,before:s,...o.current()})),l=c.charCodeAt(0),u=zI(r.before.charCodeAt(r.before.length-1),l,i);u.inside&&(c=RI(l)+c.slice(1));let d=c.charCodeAt(c.length-1),f=zI(r.after.charCodeAt(0),d,i);f.inside&&(c=c.slice(0,-1)+RI(d));let p=o.move(i+i);return a(),n.attentionEncodeSurroundingInfo={after:f.outside,before:u.outside},s+c+p}function hL(e,t,n){return n.options.strong||`*`}function gL(e,t,n,r){return n.safe(e.value,r)}function _L(e){let t=e.options.ruleRepetition||3;if(t<3)throw Error("Cannot serialize rules with repetition `"+t+"` for `options.ruleRepetition`, expected `3` or more");return t}function vL(e,t,n){let r=(oL(n)+(n.options.ruleSpaces?` `:``)).repeat(_L(n));return n.options.ruleSpaces?r.slice(0,-1):r}var yL={blockquote:TI,break:kI,code:NI,definition:II,emphasis:BI,hardBreak:kI,heading:UI,html:WI,image:KI,imageReference:JI,inlineCode:XI,link:$I,linkReference:tL,list:sL,listItem:lL,paragraph:uL,root:fL,strong:mL,text:gL,thematicBreak:vL};function bL(){return{enter:{table:xL,tableData:TL,tableHeader:TL,tableRow:CL},exit:{codeText:EL,table:SL,tableData:wL,tableHeader:wL,tableRow:wL}}}function xL(e){let t=e._align;this.enter({type:`table`,align:t.map(function(e){return e===`none`?null:e}),children:[]},e),this.data.inTable=!0}function SL(e){this.exit(e),this.data.inTable=void 0}function CL(e){this.enter({type:`tableRow`,children:[]},e)}function wL(e){this.exit(e)}function TL(e){this.enter({type:`tableCell`,children:[]},e)}function EL(e){let t=this.resume();this.data.inTable&&(t=t.replace(/\\([\\|])/g,DL));let n=this.stack[this.stack.length-1];n.type,n.value=t,this.exit(e)}function DL(e,t){return t===`|`?t:e}function OL(e){let t=e||{},n=t.tableCellPadding,r=t.tablePipeAlign,i=t.stringLength,a=n?` `:`|`;return{unsafe:[{character:`\r`,inConstruct:`tableCell`},{character:` -`,inConstruct:`tableCell`},{atBreak:!0,character:`|`,after:`[ :-]`},{character:`|`,inConstruct:`tableCell`},{atBreak:!0,character:`:`,after:`-`},{atBreak:!0,character:`-`,after:`[:|-]`}],handlers:{inlineCode:f,table:o,tableCell:c,tableRow:s}};function o(e,t,n,r){return l(u(e,n,r),e.align)}function s(e,t,n,r){let i=l([d(e,n,r)]);return i.slice(0,i.indexOf(` -`))}function c(e,t,n,r){let i=n.enter(`tableCell`),o=n.enter(`phrasing`),s=n.containerPhrasing(e,{...r,before:a,after:a});return o(),i(),s}function l(e,t){return SI(e,{align:t,alignDelimiters:r,padding:n,stringLength:i})}function u(e,t,n){let r=e.children,i=-1,a=[],o=t.enter(`table`);for(;++i0&&!n&&(e[e.length-1][1]._gfmAutolinkLiteralWalkedInto=!0),n}var oR={tokenize:mR,partial:!0};function sR(){return{document:{91:{name:`gfmFootnoteDefinition`,tokenize:dR,continuation:{tokenize:fR},exit:pR}},text:{91:{name:`gfmFootnoteCall`,tokenize:uR},93:{name:`gfmPotentialFootnoteCall`,add:`after`,tokenize:cR,resolveTo:lR}}}}function cR(e,t,n){let r=this,i=r.events.length,a=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]),o;for(;i--;){let e=r.events[i][1];if(e.type===`labelImage`){o=e;break}if(e.type===`gfmFootnoteCall`||e.type===`labelLink`||e.type===`label`||e.type===`image`||e.type===`link`)break}return s;function s(i){if(!o||!o._balanced)return n(i);let s=RA(r.sliceSerialize({start:o.end,end:r.now()}));return s.codePointAt(0)!==94||!a.includes(s.slice(1))?n(i):(e.enter(`gfmFootnoteCallLabelMarker`),e.consume(i),e.exit(`gfmFootnoteCallLabelMarker`),t(i))}}function lR(e,t){let n=e.length;for(;n--;)if(e[n][1].type===`labelImage`&&e[n][0]===`enter`){e[n][1];break}e[n+1][1].type=`data`,e[n+3][1].type=`gfmFootnoteCallLabelMarker`;let r={type:`gfmFootnoteCall`,start:Object.assign({},e[n+3][1].start),end:Object.assign({},e[e.length-1][1].end)},i={type:`gfmFootnoteCallMarker`,start:Object.assign({},e[n+3][1].end),end:Object.assign({},e[n+3][1].end)};i.end.column++,i.end.offset++,i.end._bufferIndex++;let a={type:`gfmFootnoteCallString`,start:Object.assign({},i.end),end:Object.assign({},e[e.length-1][1].start)},o={type:`chunkString`,contentType:`string`,start:Object.assign({},a.start),end:Object.assign({},a.end)},s=[e[n+1],e[n+2],[`enter`,r,t],e[n+3],e[n+4],[`enter`,i,t],[`exit`,i,t],[`enter`,a,t],[`enter`,o,t],[`exit`,o,t],[`exit`,a,t],e[e.length-2],e[e.length-1],[`exit`,r,t]];return e.splice(n,e.length-n+1,...s),e}function uR(e,t,n){let r=this,i=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]),a=0,o;return s;function s(t){return e.enter(`gfmFootnoteCall`),e.enter(`gfmFootnoteCallLabelMarker`),e.consume(t),e.exit(`gfmFootnoteCallLabelMarker`),c}function c(t){return t===94?(e.enter(`gfmFootnoteCallMarker`),e.consume(t),e.exit(`gfmFootnoteCallMarker`),e.enter(`gfmFootnoteCallString`),e.enter(`chunkString`).contentType=`string`,l):n(t)}function l(s){if(a>999||s===93&&!o||s===null||s===91||KA(s))return n(s);if(s===93){e.exit(`chunkString`);let a=e.exit(`gfmFootnoteCallString`);return i.includes(RA(r.sliceSerialize(a)))?(e.enter(`gfmFootnoteCallLabelMarker`),e.consume(s),e.exit(`gfmFootnoteCallLabelMarker`),e.exit(`gfmFootnoteCall`),t):n(s)}return KA(s)||(o=!0),a++,e.consume(s),s===92?u:l}function u(t){return t===91||t===92||t===93?(e.consume(t),a++,l):l(t)}}function dR(e,t,n){let r=this,i=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]),a,o=0,s;return c;function c(t){return e.enter(`gfmFootnoteDefinition`)._container=!0,e.enter(`gfmFootnoteDefinitionLabel`),e.enter(`gfmFootnoteDefinitionLabelMarker`),e.consume(t),e.exit(`gfmFootnoteDefinitionLabelMarker`),l}function l(t){return t===94?(e.enter(`gfmFootnoteDefinitionMarker`),e.consume(t),e.exit(`gfmFootnoteDefinitionMarker`),e.enter(`gfmFootnoteDefinitionLabelString`),e.enter(`chunkString`).contentType=`string`,u):n(t)}function u(t){if(o>999||t===93&&!s||t===null||t===91||KA(t))return n(t);if(t===93){e.exit(`chunkString`);let n=e.exit(`gfmFootnoteDefinitionLabelString`);return a=RA(r.sliceSerialize(n)),e.enter(`gfmFootnoteDefinitionLabelMarker`),e.consume(t),e.exit(`gfmFootnoteDefinitionLabelMarker`),e.exit(`gfmFootnoteDefinitionLabel`),f}return KA(t)||(s=!0),o++,e.consume(t),t===92?d:u}function d(t){return t===91||t===92||t===93?(e.consume(t),o++,u):u(t)}function f(t){return t===58?(e.enter(`definitionMarker`),e.consume(t),e.exit(`definitionMarker`),i.includes(a)||i.push(a),QA(e,p,`gfmFootnoteDefinitionWhitespace`)):n(t)}function p(e){return t(e)}}function fR(e,t,n){return e.check(pj,t,e.attempt(oR,t,n))}function pR(e){e.exit(`gfmFootnoteDefinition`)}function mR(e,t,n){let r=this;return QA(e,i,`gfmFootnoteDefinitionIndent`,5);function i(e){let i=r.events[r.events.length-1];return i&&i[1].type===`gfmFootnoteDefinitionIndent`&&i[2].sliceSerialize(i[1],!0).length===4?t(e):n(e)}}function hR(e){let t=(e||{}).singleTilde,n={name:`strikethrough`,tokenize:i,resolveAll:r};return t??=!0,{text:{126:n},insideSpan:{null:[n]},attentionMarkers:{null:[126]}};function r(e,t){let n=-1;for(;++n1?r(a):(e.consume(a),o++,c);if(o<2&&!t)return r(a);let l=e.exit(`strikethroughSequenceTemporary`),u=aj(a);return l._open=!u||u===2&&!!s,l._close=!s||s===2&&!!u,n(a)}}}var gR=class{constructor(){this.map=[]}add(e,t,n){_R(this,e,t,n)}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}};function _R(e,t,n,r){let i=0;if(n!==0||r.length!==0){for(;i-1;){let e=r.events[t][1].type;if(e===`lineEnding`||e===`linePrefix`)t--;else break}let i=t>-1?r.events[t][1].type:null,a=i===`tableHead`||i===`tableRow`?S:c;return a===S&&r.parser.lazy[r.now().line]?n(e):a(e)}function c(t){return e.enter(`tableHead`),e.enter(`tableRow`),l(t)}function l(e){return e===124?u(e):(o=!0,a+=1,u(e))}function u(t){return t===null?n(t):$(t)?a>1?(a=0,r.interrupt=!0,e.exit(`tableRow`),e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),p):n(t):qA(t)?QA(e,u,`whitespace`)(t):(a+=1,o&&(o=!1,i+=1),t===124?(e.enter(`tableCellDivider`),e.consume(t),e.exit(`tableCellDivider`),o=!0,u):(e.enter(`data`),d(t)))}function d(t){return t===null||t===124||KA(t)?(e.exit(`data`),u(t)):(e.consume(t),t===92?f:d)}function f(t){return t===92||t===124?(e.consume(t),d):d(t)}function p(t){return r.interrupt=!1,r.parser.lazy[r.now().line]?n(t):(e.enter(`tableDelimiterRow`),o=!1,qA(t)?QA(e,m,`linePrefix`,r.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4)(t):m(t))}function m(t){return t===45||t===58?g(t):t===124?(o=!0,e.enter(`tableCellDivider`),e.consume(t),e.exit(`tableCellDivider`),h):x(t)}function h(t){return qA(t)?QA(e,g,`whitespace`)(t):g(t)}function g(t){return t===58?(a+=1,o=!0,e.enter(`tableDelimiterMarker`),e.consume(t),e.exit(`tableDelimiterMarker`),_):t===45?(a+=1,_(t)):t===null||$(t)?b(t):x(t)}function _(t){return t===45?(e.enter(`tableDelimiterFiller`),v(t)):x(t)}function v(t){return t===45?(e.consume(t),v):t===58?(o=!0,e.exit(`tableDelimiterFiller`),e.enter(`tableDelimiterMarker`),e.consume(t),e.exit(`tableDelimiterMarker`),y):(e.exit(`tableDelimiterFiller`),y(t))}function y(t){return qA(t)?QA(e,b,`whitespace`)(t):b(t)}function b(n){return n===124?m(n):n===null||$(n)?!o||i!==a?x(n):(e.exit(`tableDelimiterRow`),e.exit(`tableHead`),t(n)):x(n)}function x(e){return n(e)}function S(t){return e.enter(`tableRow`),C(t)}function C(n){return n===124?(e.enter(`tableCellDivider`),e.consume(n),e.exit(`tableCellDivider`),C):n===null||$(n)?(e.exit(`tableRow`),t(n)):qA(n)?QA(e,C,`whitespace`)(n):(e.enter(`data`),w(n))}function w(t){return t===null||t===124||KA(t)?(e.exit(`data`),C(t)):(e.consume(t),t===92?T:w)}function T(t){return t===92||t===124?(e.consume(t),w):w(t)}}function xR(e,t){let n=-1,r=!0,i=0,a=[0,0,0,0],o=[0,0,0,0],s=!1,c=0,l,u,d,f=new gR;for(;++nn[2]+1){let t=n[2]+1,r=n[3]-n[2]-1;e.add(t,r,[])}}e.add(n[3]+1,0,[[`exit`,o,t]])}return i!==void 0&&(a.end=Object.assign({},wR(t.events,i)),e.add(i,0,[[`exit`,a,t]]),a=void 0),a}function CR(e,t,n,r,i){let a=[],o=wR(t.events,n);i&&(i.end=Object.assign({},o),a.push([`exit`,i,t])),r.end=Object.assign({},o),a.push([`exit`,r,t]),e.add(n+1,0,a)}function wR(e,t){let n=e[t],r=n[0]===`enter`?`start`:`end`;return n[1][r]}var TR={name:`tasklistCheck`,tokenize:DR};function ER(){return{text:{91:TR}}}function DR(e,t,n){let r=this;return i;function i(t){return r.previous!==null||!r._gfmTasklistFirstContentOfListItem?n(t):(e.enter(`taskListCheck`),e.enter(`taskListCheckMarker`),e.consume(t),e.exit(`taskListCheckMarker`),a)}function a(t){return KA(t)?(e.enter(`taskListCheckValueUnchecked`),e.consume(t),e.exit(`taskListCheckValueUnchecked`),o):t===88||t===120?(e.enter(`taskListCheckValueChecked`),e.consume(t),e.exit(`taskListCheckValueChecked`),o):n(t)}function o(t){return t===93?(e.enter(`taskListCheckMarker`),e.consume(t),e.exit(`taskListCheckMarker`),e.exit(`taskListCheck`),s):n(t)}function s(r){return $(r)?t(r):qA(r)?e.check({tokenize:OR},t,n)(r):n(r)}}function OR(e,t,n){return QA(e,r,`whitespace`);function r(e){return e===null?n(e):t(e)}}function kR(e){return PA([GL(),sR(),hR(e),yR(),ER()])}var AR={};function jR(e){let t=this,n=e||AR,r=t.data(),i=r.micromarkExtensions||=[],a=r.fromMarkdownExtensions||=[],o=r.toMarkdownExtensions||=[];i.push(kR(n)),a.push(PL()),o.push(FL(n))}var MR=[`agent-threads`];async function NR(e,t){let n=new URLSearchParams({limit:`30`});e&&n.set(`q`,e),t&&n.set(`cursor`,t);let r=await ve(`/api/agent/threads?${n}`);if(!r.ok)throw Error(`Unable to load conversations (${r.status})`);return r.json()}function PR({opened:e,activeThreadID:t,onClose:n,onNewChat:r,onSelect:i,onDeleted:a}){let o=Me(`(max-width: 48em)`),s=SD(),[c,l]=(0,M.useState)(``),[u]=Ha(c.trim(),250),[d,f]=(0,M.useState)(null),[p,m]=(0,M.useState)(null),[g,_]=(0,M.useState)(``),[v,y]=(0,M.useState)(``),[b,x]=(0,M.useState)(!1),S=(0,M.useRef)(null),C=GO({queryKey:[...MR,u],queryFn:({pageParam:e})=>NR(u,e),initialPageParam:``,getNextPageParam:e=>e.nextCursor||void 0,enabled:e}),w=(0,M.useMemo)(()=>C.data?.pages.flatMap(e=>e.threads)??[],[C.data]),T=(0,M.useMemo)(()=>LR(w),[w]);(0,M.useEffect)(()=>{e&&requestAnimationFrame(()=>S.current?.focus())},[e]);function E(e){y(``),_(e.title),f(e)}async function D(){if(!(!d||!g.trim())){x(!0),y(``);try{let e=await ve(`/api/agent/threads/${encodeURIComponent(d.threadId)}`,{method:`PATCH`,headers:{"Content-Type":`application/json`},body:JSON.stringify({title:g.trim()})});if(!e.ok)throw Error(`Unable to rename conversation (${e.status})`);await s.invalidateQueries({queryKey:MR}),f(null)}catch(e){y(e instanceof Error?e.message:`Unable to rename this conversation.`)}finally{x(!1)}}}async function O(){if(p){x(!0),y(``);try{let e=await ve(`/api/agent/threads/${encodeURIComponent(p.threadId)}`,{method:`DELETE`});if(!e.ok)throw Error(`Unable to delete conversation (${e.status})`);let t=p.threadId;m(null),await s.invalidateQueries({queryKey:MR}),a(t)}catch(e){y(e instanceof Error?e.message:`Unable to delete this conversation.`)}finally{x(!1)}}}return(0,N.jsxs)(N.Fragment,{children:[(0,N.jsx)(zm,{opened:e,onClose:n,position:`left`,size:o?`100%`:372,title:(0,N.jsx)(Ce,{fw:700,children:`Investigations`}),padding:`md`,overlayProps:{backgroundOpacity:.24,blur:1},children:(0,N.jsxs)(Le,{gap:`sm`,h:`calc(100dvh - 86px)`,children:[(0,N.jsx)(Oe,{leftSection:(0,N.jsx)(mD,{size:17,weight:`bold`}),onClick:r,children:`New investigation`}),(0,N.jsx)(xe,{ref:S,value:c,onChange:e=>l(e.currentTarget.value),leftSection:(0,N.jsx)(oD,{size:16}),placeholder:`Search investigations`,"aria-label":`Search investigations`}),(0,N.jsx)(ym,{}),(0,N.jsxs)(id,{type:`auto`,offsetScrollbars:!0,flex:1,children:[C.isLoading&&(0,N.jsx)(me,{py:`xl`,children:(0,N.jsx)(le,{size:`sm`})}),C.isError&&(0,N.jsx)(_e,{color:`bad`,title:`History unavailable`,children:`Your conversations could not be loaded.`}),!C.isLoading&&!C.isError&&w.length===0&&(0,N.jsxs)(Be,{py:`xl`,px:`sm`,ta:`center`,children:[(0,N.jsx)(Ce,{fw:600,children:u?`No matching investigations`:`No investigations yet`}),(0,N.jsx)(Ce,{c:`dimmed`,size:`sm`,mt:4,children:u?`Try words from the opening question.`:`Your completed investigations will appear here.`})]}),(0,N.jsxs)(Le,{gap:`lg`,pb:`md`,children:[T.map(e=>(0,N.jsxs)(Le,{gap:4,children:[(0,N.jsx)(Ce,{c:`dimmed`,size:`xs`,fw:700,tt:`uppercase`,lts:`0.08em`,px:`sm`,children:e.label}),e.threads.map(e=>{let n=e.threadId===t;return(0,N.jsx)(Be,{"data-active":n||void 0,className:`chat-history-item`,children:(0,N.jsxs)(ze,{gap:2,wrap:`nowrap`,children:[(0,N.jsx)(h,{onClick:()=>i(e.threadId),"aria-current":n?`page`:void 0,p:`sm`,flex:1,style:{minWidth:0},children:(0,N.jsxs)(ze,{justify:`space-between`,gap:`sm`,wrap:`nowrap`,children:[(0,N.jsx)(Ce,{size:`sm`,fw:n?650:500,truncate:!0,children:e.title}),(0,N.jsx)(Ce,{c:`dimmed`,size:`xs`,style:{flexShrink:0},children:RR(e.updatedAt)})]})}),(0,N.jsxs)(Mh,{position:`bottom-end`,withinPortal:!0,children:[(0,N.jsx)(Mh.Target,{children:(0,N.jsx)(Zd,{className:`chat-history-actions`,variant:`subtle`,color:`gray`,size:`sm`,mr:6,"aria-label":`Actions for ${e.title}`,children:(0,N.jsx)(QE,{size:18,weight:`bold`})})}),(0,N.jsxs)(Mh.Dropdown,{children:[(0,N.jsx)(Mh.Item,{leftSection:(0,N.jsx)(fD,{size:15}),onClick:()=>E(e),children:`Rename`}),(0,N.jsx)(Mh.Item,{color:`bad`,leftSection:(0,N.jsx)(bD,{size:15}),onClick:()=>{y(``),m(e)},children:`Delete`})]})]})]})},e.threadId)})]},e.label)),C.hasNextPage&&(0,N.jsx)(Oe,{variant:`subtle`,color:`gray`,loading:C.isFetchingNextPage,onClick:()=>void C.fetchNextPage(),children:`Load older`})]})]})]})}),(0,N.jsx)(Jh,{opened:d!==null,onClose:()=>!b&&f(null),title:`Rename investigation`,centered:!0,children:(0,N.jsx)(`form`,{onSubmit:e=>{e.preventDefault(),D()},children:(0,N.jsxs)(Le,{children:[(0,N.jsx)(xe,{label:`Name`,value:g,onChange:e=>_(e.currentTarget.value),maxLength:120,autoFocus:!0}),v&&(0,N.jsx)(_e,{color:`bad`,children:v}),(0,N.jsxs)(ze,{justify:`flex-end`,children:[(0,N.jsx)(Oe,{variant:`default`,onClick:()=>f(null),disabled:b,children:`Cancel`}),(0,N.jsx)(Oe,{type:`submit`,loading:b,disabled:!g.trim(),children:`Save`})]})]})})}),(0,N.jsx)(Jh,{opened:p!==null,onClose:()=>!b&&m(null),title:`Delete investigation?`,centered:!0,children:(0,N.jsxs)(Le,{children:[(0,N.jsxs)(Ce,{size:`sm`,children:[`This permanently removes `,(0,N.jsx)(Ce,{span:!0,fw:650,children:p?.title}),` and its saved conversation.`]}),v&&(0,N.jsx)(_e,{color:`bad`,children:v}),(0,N.jsxs)(ze,{justify:`flex-end`,children:[(0,N.jsx)(Oe,{variant:`default`,onClick:()=>m(null),disabled:b,children:`Cancel`}),(0,N.jsx)(Oe,{color:`bad`,loading:b,onClick:()=>void O(),children:`Delete`})]})]})})]})}function FR(e){return e.includes(`T`)?new Date(e):new Date(`${e.replace(` `,`T`)}Z`)}function IR(e){return new Date(e.getFullYear(),e.getMonth(),e.getDate()).getTime()}function LR(e){let t=IR(new Date),n=new Map;for(let r of e){let e=Math.floor((t-IR(FR(r.updatedAt)))/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[...n].map(([e,t])=>({label:e,threads:t}))}function RR(e){let t=FR(e),n=IR(new Date);return Math.floor((n-IR(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)}var zR=[];for(let e=0;e<256;++e)zR.push((e+256).toString(16).slice(1));function BR(e,t=0){return(zR[e[t+0]]+zR[e[t+1]]+zR[e[t+2]]+zR[e[t+3]]+`-`+zR[e[t+4]]+zR[e[t+5]]+`-`+zR[e[t+6]]+zR[e[t+7]]+`-`+zR[e[t+8]]+zR[e[t+9]]+`-`+zR[e[t+10]]+zR[e[t+11]]+zR[e[t+12]]+zR[e[t+13]]+zR[e[t+14]]+zR[e[t+15]]).toLowerCase()}var VR=new Uint8Array(16);function HR(){return crypto.getRandomValues(VR)}var UR={};function WR(e,t,n){let r;if(e)r=KR(e.random??e.rng?.()??HR(),e.msecs,e.seq,t,n);else{let e=Date.now(),i=HR();GR(UR,e,i),r=KR(i,UR.msecs,UR.seq,t,n)}return t??BR(r)}function GR(e,t,n){return e.msecs??=-1/0,e.seq??=0,t>e.msecs?(e.seq=qR(n),e.msecs=t):(e.seq=e.seq+1|0,e.seq===0&&e.msecs++),e}function KR(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??=qR(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 qR(e){return(e[6]&127)<<24|e[7]<<16|e[8]<<8|e[9]}function JR(){return WR()}var YR=`modulepreload`,XR=function(e){return`/`+e},ZR={},QR=function(e,t,n){let r=Promise.resolve();if(t&&t.length>0){let e=document.getElementsByTagName(`link`),i=document.querySelector(`meta[property=csp-nonce]`),a=i?.nonce||i?.getAttribute(`nonce`);function o(e){return Promise.all(e.map(e=>Promise.resolve(e).then(e=>({status:`fulfilled`,value:e}),e=>({status:`rejected`,reason:e}))))}function s(e){return import.meta.resolve?import.meta.resolve(e):new URL(e,import.meta.url).href}r=o(t.map(t=>{if(t=XR(t,n),t=s(t),t in ZR)return;ZR[t]=!0;let r=t.endsWith(`.css`);for(let n=e.length-1;n>=0;n--){let i=e[n];if(i.href===t&&(!r||i.rel===`stylesheet`))return}let i=document.createElement(`link`);if(i.rel=r?`stylesheet`:YR,r||(i.as=`script`),i.crossOrigin=``,i.href=t,a&&i.setAttribute(`nonce`,a),document.head.appendChild(i),r)return new Promise((e,n)=>{i.addEventListener(`load`,e),i.addEventListener(`error`,()=>n(Error(`Unable to preload CSS for ${t}`)))})}))}function i(e){let t=new Event(`vite:preloadError`,{cancelable:!0});if(t.payload=e,window.dispatchEvent(t),!t.defaultPrevented)throw e}return r.then(t=>{for(let e of t||[])e.status===`rejected`&&i(e.reason);return e().catch(i)})},$R=(0,M.lazy)(()=>QR(()=>import(`./mcp-app-frame-DUBLTjXl.js`),__vite__mapDeps([0,1,2]))),ez=(0,M.createContext)(null);function tz(){let e=(0,M.useContext)(ez);if(!e)throw Error(`Fanout app context is unavailable`);return e}function nz(){let{agent_available:e}=Te(),t=o(),n=SD(),r=va({select:e=>e.location.pathname}),i=r===`/chat`||r===`/chat/`||r.startsWith(`/chat/`),{threadId:a}=Oi({strict:!1}),s=(0,M.useRef)(JR()).current,[c,l]=(0,M.useState)(a??``),u=a??(c||s),[d,f]=(0,M.useState)([]),[p,m]=(0,M.useState)(``),[h,g]=(0,M.useState)(!1),[_,v]=(0,M.useState)(``),[y,b]=(0,M.useState)(``),[x,S]=(0,M.useState)(!1),C=(0,M.useRef)(``),w=(0,M.useRef)(null),T=(0,M.useRef)(null),E=(0,M.useMemo)(()=>new kE({url:`/api/agent`,threadId:u,fetch:(e,t)=>ve(e,t)}),[u]),D=!e||p===u;(0,M.useEffect)(()=>{a&&l(a)},[a]),(0,M.useEffect)(()=>{let t=!0;if(f([]),m(``),g(!1),b(``),!e){m(u);return}ve(`/api/agent/threads/${encodeURIComponent(u)}`).then(async e=>e.status===404?{messages:[]}:e.ok?e.json():Promise.reject(Error(`Unable to load thread (${e.status})`))).then(e=>{t&&(E.setMessages(e.messages??[]),f([...e.messages??[]]),m(u))}).catch(()=>{t&&(C.current=``,b(`This conversation could not be restored. Start a new chat or try again.`))});let r=E.subscribe({onEvent:({messages:e})=>f([...e]),onRunInitialized:()=>{g(!0),b(``)},onRunFinalized:({messages:e})=>{f([...e]),g(!1),n.invalidateQueries({queryKey:MR})},onRunFailed:e=>{console.error(`Agent run failed`,e),b(`Fanout could not complete this analysis. Please try again.`),g(!1),n.invalidateQueries({queryKey:MR})}});return()=>{t=!1,r.unsubscribe(),E.abortRun()}},[E,e,n,u]),(0,M.useEffect)(()=>{w.current?.scrollIntoView({behavior:`smooth`,block:`end`})},[d,h]),(0,M.useEffect)(()=>{if(!e)return;let n=e=>{let n=e.target,r=n?.matches(`input, textarea, [contenteditable='true']`);if((e.metaKey||e.ctrlKey)&&e.key.toLowerCase()===`k`){e.preventDefault(),S(!0);return}e.key===`/`&&!r&&(e.preventDefault(),t(c?{to:`/chat/$threadId`,params:{threadId:c}}:{to:`/chat`}),requestAnimationFrame(()=>T.current?.focus())),e.key===`Escape`&&n===T.current&&(v(``),T.current?.blur())};return window.addEventListener(`keydown`,n),()=>window.removeEventListener(`keydown`,n)},[e,c,t]);async function O(t){let n=t.trim();if(!e||!n||h||!D)return;let r={id:JR(),role:`user`,content:n};E.addMessage(r),f([...E.messages]),v(``),g(!0),b(``);try{await E.runAgent()}catch(e){console.error(`Agent run failed`,e),b(`Fanout could not complete this analysis. Please try again.`),g(!1)}}(0,M.useEffect)(()=>{let e=C.current;!D||!i||!e||(C.current=``,O(e))},[i,D,u]);function k(e){e.preventDefault(),O(_)}function ee(n){if(!e)return;let r=JR();C.current=n??``,S(!1),t({to:`/chat/$threadId`,params:{threadId:r}})}function te(){E.abortRun(),C.current=``,S(!1),t({to:`/chat`})}function ne(){t(c?{to:`/chat/$threadId`,params:{threadId:c}}:{to:`/chat`})}function re(e){S(!1),t({to:`/chat/$threadId`,params:{threadId:e}})}return(0,N.jsxs)(ez.Provider,{value:{agentAvailable:e,messages:d,ready:D,running:h,input:_,setInput:v,error:y,bottomRef:w,inputRef:T,send:O,submit:k,openChat:ee},children:[e&&(0,N.jsx)(PR,{opened:x,activeThreadID:i?u:void 0,onClose:()=>S(!1),onNewChat:te,onSelect:re,onDeleted:e=>{e===u&&te()}}),(0,N.jsxs)(rm,{header:{height:56},footer:{height:42},padding:0,children:[(0,N.jsx)(rm.Header,{children:(0,N.jsxs)(ze,{h:`100%`,px:{base:`sm`,sm:`lg`},justify:`space-between`,wrap:`nowrap`,children:[(0,N.jsx)(je,{size:`small`}),(0,N.jsxs)(ze,{gap:`xs`,wrap:`nowrap`,children:[(0,N.jsxs)(ze,{gap:6,mr:4,visibleFrom:`md`,children:[(0,N.jsx)(Be,{w:7,h:7,bg:`ok`,style:{borderRadius:`50%`}}),(0,N.jsx)(Ce,{c:`dimmed`,size:`xs`,fw:600,children:`Live`})]}),(e||i)&&(0,N.jsx)(Oe,{variant:`subtle`,color:`gray`,size:`compact-sm`,leftSection:i?(0,N.jsx)(iD,{size:16,weight:`bold`}):(0,N.jsx)(JE,{size:16,weight:`bold`}),onClick:()=>i?void t({to:`/dashboards`}):ne(),children:i?`Dashboard`:`Chat`}),e&&(0,N.jsx)(cg,{label:`Conversation history`,children:(0,N.jsx)(Zd,{variant:`subtle`,color:`gray`,"aria-label":`Conversation history`,onClick:()=>S(!0),children:(0,N.jsx)(XE,{size:17,weight:`bold`})})}),e&&i&&(0,N.jsx)(cg,{label:`New chat`,children:(0,N.jsx)(Zd,{variant:`subtle`,color:`gray`,"aria-label":`New chat`,onClick:te,children:(0,N.jsx)(mD,{size:17,weight:`bold`})})}),(0,N.jsx)(rz,{}),(0,N.jsx)(cg,{label:`Sign out`,children:(0,N.jsx)(Zd,{variant:`subtle`,color:`gray`,"aria-label":`Sign out`,onClick:()=>void se().catch(e=>b(e instanceof Error?e.message:`Sign-out failed — your session is still active.`)),children:(0,N.jsx)(gD,{size:17})})})]})]})}),(0,N.jsxs)(rm.Main,{children:[(0,N.jsx)(ca,{}),e&&i&&(0,N.jsx)(iz,{})]}),(0,N.jsx)(sz,{})]})]})}function rz(){let{setColorScheme:e}=xo(),t=wo(`light`,{getInitialValueInEffect:!0}),n=t===`dark`?`light`:`dark`;return(0,N.jsx)(cg,{label:`Switch to ${n} theme`,children:(0,N.jsx)(Zd,{variant:`subtle`,color:`gray`,"aria-label":`Switch to ${n} theme`,onClick:()=>e(n),children:t===`dark`?(0,N.jsx)(vD,{size:17,weight:`bold`}):(0,N.jsx)(cD,{size:17,weight:`bold`})})})}function iz(){let{input:e,setInput:t,inputRef:n,submit:r,send:i,ready:a,running:o}=tz();return(0,N.jsx)(Be,{pos:`fixed`,bottom:42,left:0,right:0,pb:`md`,pt:`md`,bg:`var(--mantine-color-body)`,style:{zIndex:20},children:(0,N.jsx)(Be,{maw:1440,mx:`auto`,px:{base:`md`,sm:`xl`,lg:72},children:(0,N.jsx)(ee,{component:`form`,onSubmit:r,className:`chat-composer-field`,withBorder:!0,shadow:`sm`,radius:28,py:6,pl:`lg`,pr:6,children:(0,N.jsxs)(ze,{align:`flex-end`,gap:`xs`,wrap:`nowrap`,children:[(0,N.jsx)(qm,{ref:n,"aria-label":`Message Fanout`,value:e,onChange:e=>t(e.currentTarget.value),onKeyDown:t=>{t.key===`Enter`&&!t.shiftKey&&(t.preventDefault(),i(e))},placeholder:o?`Fanout is analyzing…`:`Ask about health, errors, or latency…`,disabled:!a||o,autosize:!0,minRows:1,maxRows:6,variant:`unstyled`,flex:1}),(0,N.jsx)(Zd,{type:`submit`,variant:`filled`,size:40,radius:`xl`,disabled:!e.trim()||!a||o,"aria-label":`Send message`,children:(0,N.jsx)(uD,{size:17,weight:`fill`})})]})})})})}function az(){let{agentAvailable:e,messages:t,ready:n,running:r,error:i,bottomRef:a,send:o}=tz();if(!e)return(0,N.jsx)(fe,{size:`sm`,py:96,children:(0,N.jsx)(ee,{withBorder:!0,radius:`xl`,p:{base:`xl`,sm:40},children:(0,N.jsxs)(Le,{gap:`md`,children:[(0,N.jsx)(Ce,{c:`brand`,fw:700,size:`xs`,tt:`uppercase`,lts:`0.12em`,children:`Optional capability`}),(0,N.jsx)(ue,{order:1,children:`Chat is not configured`}),(0,N.jsx)(Ce,{c:`dimmed`,children:`Add an AI provider key to enable investigation chat. Telemetry ingest, dashboards, traces, logs, and metrics remain available without it.`}),(0,N.jsx)(Oe,{component:`a`,href:`/dashboards`,variant:`light`,mt:`sm`,children:`Open dashboards`})]})})});let s=t.filter(e=>e.role!==`tool`);return n?(0,N.jsxs)(fe,{size:1440,px:{base:`md`,sm:`xl`,lg:72},pt:{base:36,sm:64},pb:190,children:[s.length===0&&(0,N.jsx)(oz,{onSelect:o}),(0,N.jsxs)(Le,{gap:`xl`,"aria-live":`polite`,children:[s.map(e=>(0,N.jsx)(cz,{message:e,send:o},e.id)),r&&(0,N.jsxs)(ze,{gap:`xs`,children:[(0,N.jsx)(le,{type:`dots`,size:`sm`}),(0,N.jsx)(Ce,{c:`dimmed`,size:`sm`,children:`Analyzing your system`})]}),i&&(0,N.jsx)(_e,{color:`bad`,title:`Something went wrong`,children:i}),(0,N.jsx)(`div`,{ref:a})]})]}):(0,N.jsxs)(me,{mih:`50vh`,children:[(0,N.jsx)(le,{size:`sm`}),(0,N.jsx)(Ce,{c:`dimmed`,size:`sm`,ml:`sm`,children:`Loading conversation`})]})}function oz({onSelect:e}){return(0,N.jsxs)(Le,{align:`center`,gap:`lg`,maw:780,mx:`auto`,mb:56,ta:`center`,children:[(0,N.jsx)(je,{size:`large`}),(0,N.jsx)(Ce,{c:`brand`,fw:700,size:`xs`,tt:`uppercase`,lts:`0.14em`,children:`Your system, understood`}),(0,N.jsxs)(ue,{order:1,fz:{base:40,sm:56},lh:1.05,lts:`-0.045em`,children:[`See what changed.`,(0,N.jsx)(`br`,{}),`Know what to do next.`]}),(0,N.jsx)(Ce,{c:`dimmed`,maw:620,children:`Ask about service health, latency, errors, or dependencies. Fanout turns live signals into clear answers and focused views.`}),(0,N.jsx)(_g,{cols:{base:1,sm:3},spacing:`sm`,w:`100%`,mt:`md`,children:[`Summarize system health for the last hour`,`Find the source of elevated errors`,`Map the current service dependencies`].map((t,n)=>(0,N.jsx)(h,{onClick:()=>void e(t),children:(0,N.jsx)(ee,{withBorder:!0,radius:`lg`,p:`md`,mih:{base:74,sm:120},h:`100%`,children:(0,N.jsxs)(Le,{justify:`space-between`,h:`100%`,gap:`md`,children:[(0,N.jsxs)(Ce,{c:`dimmed`,size:`xs`,fw:700,children:[`0`,n+1]}),(0,N.jsxs)(ze,{justify:`space-between`,wrap:`nowrap`,children:[(0,N.jsx)(Ce,{size:`sm`,fw:500,children:t}),(0,N.jsx)(KE,{size:17,weight:`bold`})]})]})})},t))})]})}function sz(){return(0,N.jsx)(rm.Footer,{children:(0,N.jsxs)(ze,{h:`100%`,px:{base:`sm`,sm:`lg`},justify:`space-between`,wrap:`nowrap`,children:[(0,N.jsxs)(Ce,{c:`dimmed`,size:`xs`,children:[`© 2026 Fanout by `,(0,N.jsx)(Ce,{component:`a`,href:`https://labstack.com`,target:`_blank`,rel:`noreferrer`,inherit:!0,fw:600,c:`var(--mantine-color-text)`,children:`LabStack`})]}),(0,N.jsxs)(ze,{gap:4,children:[(0,N.jsx)(cg,{label:`GitHub`,children:(0,N.jsx)(Zd,{component:`a`,href:`https://github.com/labstack/fanout`,target:`_blank`,rel:`noreferrer`,variant:`subtle`,color:`gray`,size:`sm`,"aria-label":`Fanout on GitHub`,children:(0,N.jsx)(eD,{size:14,weight:`bold`})})}),(0,N.jsx)(cg,{label:`LabStack`,children:(0,N.jsx)(Zd,{component:`a`,href:`https://labstack.com`,target:`_blank`,rel:`noreferrer`,variant:`subtle`,color:`gray`,size:`sm`,"aria-label":`LabStack website`,children:(0,N.jsx)(nD,{size:14})})})]})]})})}function cz({message:e,send:t}){if(e.role===`activity`){let n=e;return n.activityType===`mcp-app`?(0,N.jsx)(ee,{radius:`lg`,shadow:`md`,style:{overflow:`hidden`},"aria-label":lz(n.content.toolName),children:(0,N.jsx)(M.Suspense,{fallback:(0,N.jsx)(me,{mih:180,children:(0,N.jsx)(le,{size:`sm`})}),children:(0,N.jsx)($R,{content:n.content,onMessage:t})})}):null}let n=typeof e.content==`string`?e.content:JSON.stringify(e.content);if(!n&&e.role===`assistant`)return null;let r=e.role===`user`;return(0,N.jsxs)(Le,{gap:`xs`,align:r?`flex-end`:`stretch`,maw:r?`min(92%, 650px)`:780,ml:r?`auto`:void 0,children:[(0,N.jsxs)(ze,{gap:`xs`,justify:r?`flex-end`:`flex-start`,children:[(0,N.jsx)(hm,{size:22,radius:`sm`,color:r?`gray`:`brand`,children:r?`Y`:`F`}),(0,N.jsx)(Ce,{c:`dimmed`,size:`xs`,fw:700,tt:`uppercase`,lts:`0.08em`,children:r?`You`:`Fanout`})]}),r?(0,N.jsx)(ee,{withBorder:!0,radius:`lg`,p:`sm`,bg:`var(--mantine-color-brand-light)`,children:(0,N.jsx)(Ce,{style:{whiteSpace:`pre-wrap`},children:n})}):(0,N.jsx)(yg,{children:(0,N.jsx)(DF,{remarkPlugins:[jR],children:n})})]})}function lz(e){return{observability_overview:`System health`,service_topology:`Service map`,service_performance:`Performance`,trace_detail:`Trace analysis`,search_logs:`Logs`}[e]??`System analysis`}function uz(){let e=(0,M.useMemo)(()=>new MO,[]);return(0,N.jsx)(CD,{client:e,children:(0,N.jsx)(Fe,{children:(0,N.jsx)(nz,{})})})}var dz=Yi({component:uz,notFoundComponent:()=>(0,N.jsx)(d,{to:`/`,replace:!0})}),fz=Xi(`/`)({component:Zi(()=>QR(()=>import(`./routes-BQrzb4p9.js`),__vite__mapDeps([3,1,2])),`component`)}),pz=Xi(`/chat/`)({component:Zi(()=>QR(()=>import(`./chat.index-9CJIOrfA.js`),__vite__mapDeps([4,1])),`component`)}),mz=Xi(`/chat/$threadId`)({component:Zi(()=>QR(()=>import(`./chat._threadId-DuBrYsq9.js`),[]),`component`)}),hz=Xi(`/dashboards/`)({component:Zi(()=>QR(()=>import(`./dashboards.index-Dxwz9Ppx.js`),__vite__mapDeps([5,1,6,2])),`component`)}),gz=Xi(`/dashboards/$dashboardId`)({component:Zi(()=>QR(()=>import(`./dashboards._dashboardId-BKkqXjF1.js`),__vite__mapDeps([7,1,6,2])),`component`)}),_z=fz.update({id:`/`,path:`/`,getParentRoute:()=>dz}),vz=pz.update({id:`/chat/`,path:`/chat/`,getParentRoute:()=>dz}),yz=mz.update({id:`/chat/$threadId`,path:`/chat/$threadId`,getParentRoute:()=>dz}),bz=hz.update({id:`/dashboards/`,path:`/dashboards/`,getParentRoute:()=>dz}),xz={IndexRoute:_z,ChatThreadIdRoute:yz,DashboardsDashboardIdRoute:gz.update({id:`/dashboards/$dashboardId`,path:`/dashboards/$dashboardId`,getParentRoute:()=>dz}),ChatIndexRoute:vz,DashboardsIndexRoute:bz},Sz=ma({routeTree:dz._addFileChildren(xz)._addFileTypes(),defaultPreload:`intent`,scrollRestoration:!0}),Cz=[`#fafafa`,`#e6e4de`,`#bfbdb6`,`#8b8e99`,`#565b69`,`#1d2433`,`#131721`,`#0b0e14`,`#080a10`,`#05070b`],wz=[`#f3ecfd`,`#ece3fb`,`#dcc9f7`,`#d2a6ff`,`#bf94ec`,`#a97ce0`,`#9163d6`,`#7c4dcc`,`#5b32a3`,`#40236f`],Tz=[`#eefbe6`,`#dcf7cc`,`#c2f0a6`,`#a5e880`,`#8fe06c`,`#7fd962`,`#66c04b`,`#4f9c3a`,`#3b7a2c`,`#2a5a1f`],Ez=[`#fff5e6`,`#ffe9c9`,`#ffd79b`,`#ffc571`,`#ffbc62`,`#ffb454`,`#ef9c33`,`#c87d21`,`#9c5f16`,`#74460f`],Dz=[`#fdecee`,`#fbd9dc`,`#f8b6bc`,`#f59099`,`#f37d87`,`#f26d78`,`#e04d5a`,`#c03642`,`#96262f`,`#6f1a21`],Oz=[`#e8f6ff`,`#ccebff`,`#a3daff`,`#7dcbff`,`#66c5ff`,`#59c2ff`,`#33a7e6`,`#1e86bd`,`#146694`,`#0d4a6d`],kz={display:`"IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace`,body:`"IBM Plex Sans", ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif`},Az={primaryColor:`brand`,primaryShade:{light:7,dark:5},autoContrast:!0,colors:{dark:Cz,brand:wz,ok:Tz,warn:Ez,bad:Dz,info:Oz},defaultRadius:`md`,fontFamily:kz.body,fontFamilyMonospace:kz.display,headings:{fontFamily:kz.display,fontWeight:`500`},cursorType:`pointer`},jz=()=>({variables:{"--mantine-color-error":`var(--mantine-color-bad-filled)`},light:{},dark:{}}),Mz=Ro(Az);(0,mv.createRoot)(document.getElementById(`root`)).render((0,N.jsx)(M.StrictMode,{children:(0,N.jsx)(Lo,{theme:Mz,defaultColorScheme:`auto`,cssVariablesResolver:jz,children:(0,N.jsx)(_a,{router:Sz})})}));export{ro as A,Ud as C,mo as D,_o as E,xa as M,po as O,Zd as S,wo as T,_g as _,WO as a,ym as b,iO as c,OD as d,BD as f,KE as g,mD as h,JR as i,Sa as j,io as k,eO as l,SD as m,az as n,OO as o,XD as p,tz as r,bO as s,gz as t,ID as u,cg as v,id as w,im as x,Mh as y}; \ No newline at end of file diff --git a/internal/ui/dist/assets/mcp-app-frame-C0HSbiNW.js b/internal/ui/dist/assets/mcp-app-frame-C0HSbiNW.js new file mode 100644 index 00000000..b6f7f906 --- /dev/null +++ b/internal/ui/dist/assets/mcp-app-frame-C0HSbiNW.js @@ -0,0 +1,113 @@ +import{a as e,d as t,f as n,g as r,h as i,m as a,p as o,u as s}from"./useNavigate-BEpS2iE5.js";import{b as c,f as l,h as u,i as d,m as f,w as p}from"./auth-DhIxmh_D.js";import{T as m}from"./index-Ckl_dWuh.js";function h(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 g(e,t=`|`){return e.map(e=>se(e)).join(t)}function _(e,t){return typeof t==`bigint`?t.toString():t}function v(e){return{get value(){{let t=e();return Object.defineProperty(this,"value",{value:t}),t}}}}function y(e){return e==null}function b(e){let t=+!!e.startsWith(`^`),n=e.endsWith(`$`)?e.length-1:e.length;return e.slice(t,n)}function x(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){};function w(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}var re=v(()=>{if(Ke.jitless||typeof navigator<`u`&&navigator?.userAgent?.includes(`Cloudflare`))return!1;try{return Function(``),!0}catch{return!1}});function T(e){if(w(e)===!1)return!1;let t=e.constructor;if(t===void 0||typeof t!=`function`)return!0;let n=t.prototype;return w(n)!==!1&&Object.prototype.hasOwnProperty.call(n,`isPrototypeOf`)!==!1}function ie(e){return T(e)?{...e}:Array.isArray(e)?[...e]:e instanceof Map?new Map(e):e instanceof Set?new Set(e):e}var ae=new Set([`string`,`number`,`symbol`]);function oe(e){return e.replace(/[.*+?^${}()|[\]\\]/g,`\\$&`)}function E(e,t,n){let r=new e._zod.constr(t??e._zod.def);return(!t||n?.parent)&&(r._zod.parent=e),r}function D(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 se(e){return typeof e==`bigint`?e.toString()+`n`:typeof e==`string`?`"${e}"`:`${e}`}function ce(e){return Object.keys(e).filter(t=>e[t]._zod.optin!==void 0&&e[t]._zod.optout===`optional`)}var le={safeint:[-(2**53-1),2**53-1],int32:[-2147483648,2147483647],uint32:[0,4294967295],float32:[-34028234663852886e22,34028234663852886e22],float64:[-Number.MAX_VALUE,Number.MAX_VALUE]};function ue(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`);return E(e,C(e._zod.def,{get shape(){let e={};for(let r of Reflect.ownKeys(t)){if(!Object.prototype.hasOwnProperty.call(n.shape,r))throw Error(`Unrecognized key: "${String(r)}"`);t[r]&&S(e,r,n.shape[r])}return S(this,`shape`,e),e},checks:[]}))}function de(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`);return E(e,C(e._zod.def,{get shape(){let r={...e._zod.def.shape};for(let e of Reflect.ownKeys(t)){if(!Object.prototype.hasOwnProperty.call(n.shape,e))throw Error(`Unrecognized key: "${String(e)}"`);t[e]&&delete r[e]}return S(this,`shape`,r),r},checks:[]}))}function fe(e,t){if(!T(t))throw Error(`Invalid input to extend: expected a plain object`);let n=e._zod.def.checks;if(n&&n.length>0){let n=e._zod.def.shape;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 E(e,C(e._zod.def,{get shape(){let n={...e._zod.def.shape,...t};return S(this,`shape`,n),n}}))}function pe(e,t){if(!T(t))throw Error(`Invalid input to safeExtend: expected a plain object`);return E(e,C(e._zod.def,{get shape(){let n={...e._zod.def.shape,...t};return S(this,`shape`,n),n}}))}function me(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.`);return E(e,C(e._zod.def,{get shape(){let n={...e._zod.def.shape,...t._zod.def.shape};return S(this,`shape`,n),n},get catchall(){return t._zod.def.catchall},checks:t._zod.def.checks??[]}))}function he(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`);return E(t,C(t._zod.def,{get shape(){let r=t._zod.def.shape,i={...r};if(n)for(let t of Reflect.ownKeys(n)){if(!Object.prototype.hasOwnProperty.call(r,t))throw Error(`Unrecognized key: "${String(t)}"`);n[t]&&(i[t]=e?new e({type:`optional`,innerType:r[t]}):r[t])}else for(let t of Reflect.ownKeys(r))i[t]=e?new e({type:`optional`,innerType:r[t]}):r[t];return S(this,`shape`,i),i},checks:[]}))}function ge(e,t,n){return E(t,C(t._zod.def,{get shape(){let r=t._zod.def.shape,i={...r};if(n)for(let t of Reflect.ownKeys(n)){if(!Object.prototype.hasOwnProperty.call(i,t))throw Error(`Unrecognized key: "${String(t)}"`);n[t]&&(i[t]=new e({type:`nonoptional`,innerType:r[t]}))}else for(let t of Reflect.ownKeys(r))i[t]=new e({type:`nonoptional`,innerType:r[t]});return S(this,`shape`,i),i}}))}function _e(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 be(e){return typeof e==`string`?e:e?.message}function xe(e,t,n){var r;for(let i=t;ie;return t[Le]=!0,t}var ze,Be=Object.freeze({status:`aborted`}),Ve={value:void 0,enumerable:!1},He=`captureStackTrace`in Error?Error:null;function Ue(e){let t=He;if(t){let n=t.stackTraceLimit;if(typeof n==`number`){try{t.stackTraceLimit=0}catch{return He=null,new e}try{return new e}finally{t.stackTraceLimit=n}}}return new e}function k(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){Ve.value=new a(r);try{Object.defineProperty(n,"_zod",Ve)}finally{Ve.value=void 0}}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),Oe(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?Ue(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 We=class extends Error{constructor(){super(`Encountered Promise during synchronous parse. Use .parseAsync() instead.`)}},Ge=class extends Error{constructor(e){super(`Encountered unidirectional transform during encode: ${e}`),this.name=`ZodEncodeError`}};(ze=globalThis).__zod_globalConfig??(ze.__zod_globalConfig={});var Ke=globalThis.__zod_globalConfig;function qe(e){return e&&Object.assign(Ke,e),Ke}function Je(){let e=this._zod;return e.message??=JSON.stringify(e.def,_,2),e.message}function Ye(e){this._zod.message=e}var Xe={get:Je,set:Ye,enumerable:!0,configurable:!0},Ze={value:void 0,enumerable:!1},Qe={value:void 0,enumerable:!1},$e=new WeakSet([Object.prototype,Error.prototype]),et=(e,t)=>{e.name=`$ZodError`,Ze.value=e._zod,Object.defineProperty(e,"_zod",Ze),Qe.value=t,Object.defineProperty(e,"issues",Qe),Ze.value=void 0,Qe.value=void 0,Object.defineProperty(e,"message",Xe);let n=Object.getPrototypeOf(e);$e.has(n)||($e.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})}}))},tt=k(`$ZodError`,et),nt=k(`$ZodError`,et,void 0,{Parent:Error});function rt(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 it(e,t=e=>e.message){let n={},r=[];for(let i of e.issues)i.path.length>0?rt(n,i.path[0],()=>[]).push(t(i)):r.push(t(i));return{formErrors:r,fieldErrors:n}}function at(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 We;if(s.issues.length){let n=new((a?.Err)??e)(s.issues.map(e=>Se(e,o,qe())));throw ne(n,a?.callee??t),n}return s.value};return t},ct=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=>Se(e,o,qe())));throw ne(n,a?.callee??t),n}return s.value};return t},lt=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 We;return a.issues.length?{success:!1,error:new(e??tt)(a.issues.map(e=>Se(e,i,qe())))}:{success:!0,data:a.value}},ut=lt(nt),dt=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?{success:!1,error:new e(a.issues.map(e=>Se(e,i,qe())))}:{success:!0,data:a.value}},ft=dt(nt),pt=e=>{let t=st(e),n=(e,r,i,a)=>{let o=i?{...i,direction:`backward`}:{direction:`backward`};return t(e,r,o,ot(n,a))};return n},mt=e=>{let t=st(e),n=(e,r,i,a)=>t(e,r,i,ot(n,a));return n},ht=e=>{let t=ct(e),n=async(e,r,i,a)=>{let o=i?{...i,direction:`backward`}:{direction:`backward`};return await t(e,r,o,ot(n,a))};return n},gt=e=>{let t=ct(e),n=async(e,r,i,a)=>await t(e,r,i,ot(n,a));return n},_t=e=>(t,n,r)=>{let i=r?{...r,direction:`backward`}:{direction:`backward`};return lt(e)(t,n,i)},vt=e=>(t,n,r)=>lt(e)(t,n,r),yt=e=>async(t,n,r)=>{let i=r?{...r,direction:`backward`}:{direction:`backward`};return dt(e)(t,n,i)},bt=e=>async(t,n,r)=>dt(e)(t,n,r),xt=/^[cC][0-9a-z]{6,}$/,St=/^[0-9a-z]+$/,Ct=/^[0-7][0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{25}$/,wt=/^[0-9a-vA-V]{20}$/,Tt=/^[A-Za-z0-9]{27}$/,Et=/^[a-zA-Z0-9_-]{21}$/;function Dt(e){return RegExp(`^[a-zA-Z0-9_-]{${e}}$`)}var Ot=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,kt=/^([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})$/,At=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)$/,jt=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,Mt=`^[\\p{Extended_Pictographic}\\p{Emoji_Component}]+$`;function Nt(){return new RegExp(Mt,`u`)}var Pt=/^(?:(?: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])$/,Ft=/^(([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}|:))$/,It=/^((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])$/,Lt=/^(([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])$/,Rt=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,zt=/^[A-Za-z0-9_-]*$/,Bt=/^https?$/,Vt=/^\+[1-9]\d{6,14}$/,Ht=`(?:(?:\\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 Ut(e){return RegExp(`^${e}$`)}var Wt=Ut(Ht);function Gt(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 Kt(e){return RegExp(`^${Gt(e)}$`)}function qt(e){let t=[`Z`];e.offset&&t.push(`([+-](?:[01]\\d|2[0-3]):[0-5]\\d)`);let n=`${Gt({precision:e.precision,seconds:!0})}(?:${t.join(`|`)})`,r=e.local?`${n}|${Gt({precision:e.precision})}`:n;return RegExp(`^${Ht}T(?:${r})$`)}var Jt=e=>{let t=e?`[\\s\\S]{${e?.minimum??0},${e?.maximum??``}}`:`[\\s\\S]*`;return RegExp(`^${t}$`)},Yt=/^-?\d+$/,Xt=/^-?\d+(?:\.\d+)?$/,Zt=/^(?:true|false)$/i,Qt=/^null$/i,$t=/^undefined$/i,en=/^[^A-Z]*$/,tn=/^[^a-z]*$/,nn=k(`$ZodCheck`,(e,t)=>{var n;e._zod??={},e._zod.def=t,(n=e._zod).onattach??(n.onattach=[])}),rn=e=>{let t=e.value;return!y(t)&&t.length!==void 0},an={number:`number`,bigint:`bigint`,object:`date`},on=k(`$ZodCheckLessThan`,(e,t)=>{nn.init(e,t);let n=an[typeof t.value];e._zod.onattach.push(e=>{let n=e._zod.bag,r=(t.inclusive?n.maximum:n.exclusiveMaximum)??1/0;t.value{(t.inclusive?r.value<=t.value:r.value{nn.init(e,t);let n=an[typeof t.value];e._zod.onattach.push(e=>{let n=e._zod.bag,r=(t.inclusive?n.minimum:n.exclusiveMinimum)??-1/0;t.value>r&&(t.inclusive?n.minimum=t.value:n.exclusiveMinimum=t.value)}),e._zod.check=r=>{(t.inclusive?r.value>=t.value:r.value>t.value)||r.issues.push({origin:an[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})}}),cn=k(`$ZodCheckMultipleOf`,(e,t)=>{nn.init(e,t),e._zod.onattach.push(e=>{var n;(n=e._zod.bag).multipleOf??(n.multipleOf=t.value)}),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):x(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})}}),ln=k(`$ZodCheckNumberFormat`,(e,t)=>{nn.init(e,t),t.format=t.format||`float64`;let n=t.format?.includes(`int`),r=n?`int`:`number`,[i,a]=le[t.format];e._zod.onattach.push(e=>{let r=e._zod.bag;r.format=t.format,r.minimum=i,r.maximum=a,n&&(r.pattern=Yt)}),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})}}),un=k(`$ZodCheckMaxLength`,(e,t)=>{var n;nn.init(e,t),(n=e._zod.def).when??(n.when=rn),e._zod.onattach.push(e=>{let n=e._zod.bag.maximum??1/0;t.maximum{let r=n.value,i=r.length;if((typeof r==`string`&&i>t.maximum?we(r):i)<=t.maximum)return;let a=Te(r);n.issues.push({origin:a,code:`too_big`,maximum:t.maximum,inclusive:!0,input:r,inst:e,continue:!t.abort})}}),dn=k(`$ZodCheckMinLength`,(e,t)=>{var n;nn.init(e,t),(n=e._zod.def).when??(n.when=rn),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,i=r.length;if((typeof r==`string`&&i>=t.minimum&&i=t.minimum)return;let a=Te(r);n.issues.push({origin:a,code:`too_small`,minimum:t.minimum,inclusive:!0,input:r,inst:e,continue:!t.abort})}}),fn=k(`$ZodCheckLengthEquals`,(e,t)=>{var n;nn.init(e,t),(n=e._zod.def).when??(n.when=rn),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,a=typeof r==`string`&&i>=t.length&&i<=t.length*2?we(r):i;if(a===t.length)return;let o=Te(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})}}),pn=k(`$ZodCheckStringFormat`,(e,t)=>{var n,r;nn.init(e,t),e._zod.onattach.push(e=>{let n=e._zod.bag;n.format=t.format,t.pattern&&(n.patterns??=new Set,n.patterns.add(t.pattern))}),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=()=>{})}),mn=k(`$ZodCheckRegex`,(e,t)=>{pn.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})}}),hn=k(`$ZodCheckLowerCase`,(e,t)=>{t.pattern??=en,pn.init(e,t)}),gn=k(`$ZodCheckUpperCase`,(e,t)=>{t.pattern??=tn,pn.init(e,t)}),_n=k(`$ZodCheckIncludes`,(e,t)=>{nn.init(e,t);let n=oe(t.includes),r=new RegExp(typeof t.position==`number`?`^.{${t.position},}${n}`:n);t.pattern=r,e._zod.onattach.push(e=>{let t=e._zod.bag;t.patterns??=new Set,t.patterns.add(r)}),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})}}),vn=k(`$ZodCheckStartsWith`,(e,t)=>{nn.init(e,t);let n=RegExp(`^${oe(t.prefix)}.*`);t.pattern??=n,e._zod.onattach.push(e=>{let t=e._zod.bag;t.patterns??=new Set,t.patterns.add(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})}}),yn=k(`$ZodCheckEndsWith`,(e,t)=>{nn.init(e,t);let n=RegExp(`.*${oe(t.suffix)}$`);t.pattern??=n,e._zod.onattach.push(e=>{let t=e._zod.bag;t.patterns??=new Set,t.patterns.add(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})}}),bn=k(`$ZodCheckOverwrite`,(e,t)=>{nn.init(e,t),e._zod.check=e=>{e.value=t.tx(e.value)}}),xn=class{constructor(e=[],t={}){this.content=[],this.indent=0,this.args=e,this.closed=t}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?.content??[``];return new e(...Object.keys(this.closed),`return function (${this.args.join(`, `)}) {\n${t.join(` +`)}\n};`)(...Object.values(this.closed))}},Sn={major:4,minor:5,patch:4},A=k(`$ZodType`,(e,t)=>{var n;e??={},e._zod.def=t,e._zod.bag=e._zod.bag||{},e._zod.version=Sn;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=_e(t),a;for(let o of n){if(o._zod.def.when){if(ve(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 We;if(a||s instanceof Promise)a=(a??Promise.resolve()).then(async()=>{await s,t.issues.length!==n&&(xe(t.issues,n,e),i||=_e(t,n))});else{if(t.issues.length===n)continue;xe(t.issues,n,e),i||=_e(t,n)}}return a?a.then(()=>t):t},n=(n,r,a)=>{if(_e(n))return n.aborted=!0,n;let o=t(r,i,a);if(o instanceof Promise){if(a.async===!1)throw new We;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 We;return o.then(e=>t(e,i,a))}return t(o,i,a)}}},{get"~standard"(){return Ae(this,`~standard`,wn(this))},set"~standard"(e){ke(this,`~standard`,e)}}),Cn=e=>e.success?{value:e.data}:{issues:e.error?.issues};function wn(e){return{validate:t=>{try{return Cn(ut(e,t))}catch{return ft(e,t).then(Cn)}},vendor:`zod`,version:1}}var Tn=k(`$ZodString`,(e,t)=>{A.init(e,t),e._zod.pattern=[...e?._zod.bag?.patterns??[]].pop()??Jt(e._zod.bag),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}}),j=k(`$ZodStringFormat`,(e,t)=>{pn.init(e,t),Tn.init(e,t)}),En=k(`$ZodGUID`,(e,t)=>{t.pattern??=kt,j.init(e,t)}),Dn=k(`$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??=At(e)}else t.pattern??=At();j.init(e,t)}),On=k(`$ZodEmail`,(e,t)=>{t.pattern??=jt,j.init(e,t)});function kn(e,t){if(!t.normalize&&t.protocol?.source===Bt.source&&!/^https?:\/\//i.test(e))return 1;try{return new URL(e)}catch{return 2}}var An=/[\t\n\r]/g;function jn(e){return e.replace(An,``)}function Mn(e,t){return t.lastIndex=0,t.test(e.hostname)}function Nn(e,t){return t.lastIndex=0,t.test(e.protocol.endsWith(`:`)?e.protocol.slice(0,-1):e.protocol)}var Pn=k(`$ZodURL`,(e,t)=>{j.init(e,t),e._zod.check=n=>{try{let r=n.value.trim(),i=kn(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}t.hostname&&!Mn(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&&!Nn(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:jn(r);return}catch{n.issues.push({code:`invalid_format`,format:`url`,input:n.value,inst:e,continue:!t.abort})}}}),Fn=k(`$ZodEmoji`,(e,t)=>{t.pattern??=Nt(),j.init(e,t)}),In=k(`$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?Et:Dt(t.length),j.init(e,t)}),Ln=k(`$ZodCUID`,(e,t)=>{t.pattern??=xt,j.init(e,t)}),Rn=k(`$ZodCUID2`,(e,t)=>{t.pattern??=St,j.init(e,t)}),zn=k(`$ZodULID`,(e,t)=>{t.pattern??=Ct,j.init(e,t)}),Bn=k(`$ZodXID`,(e,t)=>{t.pattern??=wt,j.init(e,t)}),Vn=k(`$ZodKSUID`,(e,t)=>{t.pattern??=Tt,j.init(e,t)}),Hn=k(`$ZodISODateTime`,(e,t)=>{t.pattern??=qt(t),j.init(e,t),(t.local||t.precision===-1)&&(e._zod.bag.laxFormat=!0,e._zod.onattach.push(e=>{e._zod.bag.laxFormat=!0}))}),Un=k(`$ZodISODate`,(e,t)=>{t.pattern??=Wt,j.init(e,t)}),Wn=k(`$ZodISOTime`,(e,t)=>{t.pattern??=Kt(t),j.init(e,t)}),Gn=k(`$ZodISODuration`,(e,t)=>{t.pattern??=Ot,j.init(e,t)}),Kn=k(`$ZodIPv4`,(e,t)=>{t.pattern??=Pt,j.init(e,t),e._zod.bag.format=`ipv4`}),qn=/^[0-9a-fA-F:.]+$/;function Jn(e){if(!qn.test(e))return!1;try{return new URL(`http://[${e}]`),!0}catch{return!1}}var Yn=k(`$ZodIPv6`,(e,t)=>{t.pattern??=Ft,j.init(e,t),e._zod.bag.format=`ipv6`,e._zod.check=n=>{Jn(n.value)||n.issues.push({code:`invalid_format`,format:`ipv6`,input:n.value,inst:e,continue:!t.abort})}}),Xn=k(`$ZodCIDRv4`,(e,t)=>{t.pattern??=It,j.init(e,t)});function Zn(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:Jn(n)}var Qn=k(`$ZodCIDRv6`,(e,t)=>{t.pattern??=Lt,j.init(e,t),e._zod.check=n=>{Zn(n.value)||n.issues.push({code:`invalid_format`,format:`cidrv6`,input:n.value,inst:e,continue:!t.abort})}});function $n(e){if(e===``)return!0;if(/\s/.test(e)||e.length%4!=0)return!1;try{return atob(e),!0}catch{return!1}}var er=k(`$ZodBase64`,(e,t)=>{t.pattern??=Rt,j.init(e,t),e._zod.bag.contentEncoding=`base64`,e._zod.check=n=>{$n(n.value)||n.issues.push({code:`invalid_format`,format:`base64`,input:n.value,inst:e,continue:!t.abort})}});function tr(e){if(!zt.test(e))return!1;let t=e.replace(/[-_]/g,e=>e===`-`?`+`:`/`);return $n(t.padEnd(Math.ceil(t.length/4)*4,`=`))}var nr=k(`$ZodBase64URL`,(e,t)=>{t.pattern??=zt,j.init(e,t),e._zod.bag.contentEncoding=`base64url`,e._zod.check=n=>{tr(n.value)||n.issues.push({code:`invalid_format`,format:`base64url`,input:n.value,inst:e,continue:!t.abort})}}),rr=k(`$ZodE164`,(e,t)=>{t.pattern??=Vt,j.init(e,t)});function ir(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 ar=k(`$ZodJWT`,(e,t)=>{j.init(e,t),e._zod.check=n=>{ir(n.value,t.alg)||n.issues.push({code:`invalid_format`,format:`jwt`,input:n.value,inst:e,continue:!t.abort})}}),or=k(`$ZodNumber`,(e,t)=>{A.init(e,t),e._zod.pattern=e._zod.bag.pattern??Xt,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}}),sr=k(`$ZodNumberFormat`,(e,t)=>{ln.init(e,t),or.init(e,t)}),cr=k(`$ZodBoolean`,(e,t)=>{A.init(e,t),e._zod.pattern=Zt,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}}),lr=k(`$ZodUndefined`,(e,t)=>{A.init(e,t),e._zod.pattern=$t,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}}),ur=k(`$ZodNull`,(e,t)=>{A.init(e,t),e._zod.pattern=Qt,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}}),dr=k(`$ZodAny`,(e,t)=>{A.init(e,t),e._zod.parse=e=>e}),fr=k(`$ZodUnknown`,(e,t)=>{A.init(e,t),e._zod.parse=e=>e}),pr=k(`$ZodNever`,(e,t)=>{A.init(e,t),e._zod.parse=(t,n)=>(t.issues.push({expected:`never`,code:`invalid_type`,input:t.value,inst:e}),t)});function mr(e,t,n){e.issues.length&&t.issues.push(...ye(n,e.issues)),t.value[n]=e.value}var hr=k(`$ZodArray`,(e,t)=>{A.init(e,t);let n=Ke.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=[];for(let e=0;emr(t,r,e))):mr(s,r,e)}return o.length?Promise.all(o).then(()=>r):r}});function gr(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(...ye(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&&(t.value[n]=void 0):t.value[n]=e.value}}var _r=[];function vr(e){let t=Object.keys(e.shape),n=Object.getOwnPropertySymbols(e.shape),r=n.length?n:_r,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=ce(e.shape);return{...e,allKeys:i,symbolKeys:r,keySet:new Set(t),numKeys:t.length,optionalKeys:new Set(a)}}function yr(e,t,n,r,i,a){let o=[],s=i.keySet,c=i.catchall._zod,l=c.def.type,u=c.optin,d=c.optout;for(let i in t){if(s.has(i))continue;if(i===`__proto__`){l===`never`&&o.push(i);continue}if(l===`never`){o.push(i);continue}let a=c.run({value:t[i],issues:[]},r);a instanceof Promise?e.push(a.then(e=>gr(e,n,i,t,u,d))):gr(a,n,i,t,u,d)}return o.length&&n.issues.push({code:`unrecognized_keys`,keys:o,input:t,inst:a,continue:!0}),e.length?Promise.all(e).then(()=>n):n}var br=new WeakMap,xr=k(`$ZodObject`,(e,t)=>{if(A.init(e,t),!Object.getOwnPropertyDescriptor(t,`shape`)?.get){let e=t.shape;br.set(t,e),Object.defineProperty(t,"shape",{get:()=>{let n={...e};return Object.defineProperty(t,"shape",{value:n}),br.set(t,n),n}})}let n=v(()=>vr(t));O(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)||S(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 r=w,i=t.catchall,a,o=Ke.memoizer;o?.attach(e),e._zod.parse=(t,s)=>{a??=n.value;let c=t.value;if(!r(c))return t.issues.push({expected:`object`,code:`invalid_type`,input:c,inst:e}),t;t.value=o?o.alloc(e,t,{},s):{};let l=[],u=a.shape;for(let e of a.allKeys){if(e===`__proto__`)continue;let n=u[e],r=n._zod.optin,i=n._zod.optout,a=n._zod.run({value:c[e],issues:[]},s);a instanceof Promise?l.push(a.then(n=>gr(n,t,e,c,r,i))):gr(a,t,e,c,r,i)}return i?yr(l,c,t,s,n.value,e):l.length?Promise.all(l).then(()=>t):t}}),Sr=k(`$ZodObjectJIT`,(e,t)=>{xr.init(e,t);let n=e._zod.parse,r=v(()=>vr(t)),i=Ke.memoizer,a=t=>{let n=r.value,a=n.symbolKeys,o=new xn([`payload`,`ctx`],{shape:t,inst:e,memo:i,syms:a}),s=e=>`shape[${e}]._zod.run({ value: input[${e}], issues: [] }, ctx)`,c=(e,t)=>` + 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); + }`;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)}]`:ee(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)} + } + + if (${n}.value === undefined) { + if (${i}) { + newResult[${r}] = undefined; + } + } else { + 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 (${n}_present) { + newResult[${r}] = ${n}.value; + } + + `)}return o.write(`payload.value = newResult;`),o.write(`return payload;`),o.compile()},o,s=w,c=!Ke.jitless,l=c&&re.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?yr([],p,i,f,d,e):i):n(i,f):(i.issues.push({expected:`object`,code:`invalid_type`,input:p,inst:e}),i)}});function Cr(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=>!_e(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=>Se(e,r,qe())))}),t)}var wr=k(`$ZodUnion`,(e,t)=>{A.init(e,t),O(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),O(e,`optout`,e=>e.def.options.some(e=>e._zod.optout===`optional`)?`optional`:void 0),O(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)))}),O(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=>b(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=>Cr(t,r,e,i)):Cr(o,r,e,i)}}),Tr=k(`$ZodDiscriminatedUnion`,(e,t)=>{t.inclusive=!1,wr.init(e,t);let n=e._zod.parse;O(e,`propValues`,e=>{let t={};for(let n of e.def.options){let r=n._zod.propValues;if(!r||Object.keys(r).length===0)throw Error(`Invalid discriminated union option at index "${e.def.options.indexOf(n)}"`);for(let[e,n]of Object.entries(r)){Object.prototype.hasOwnProperty.call(t,e)||S(t,e,new Set);for(let r of n)t[e].add(r)}}return t}),t.options.forEach((e,n)=>{let r=br.get(e._zod.def);if(r&&!Object.prototype.hasOwnProperty.call(r,t.discriminator))throw Error(`Invalid discriminated union option at index "${n}"`)});let r=v(()=>{let e=t.options,n=new Map;for(let r of e){let e=r._zod.propValues?.[t.discriminator];if(!e||e.size===0)throw Error(`Invalid discriminated union option at index "${t.options.indexOf(r)}"`);for(let t of e){if(n.has(t))throw Error(`Duplicate discriminator value "${String(t)}"`);n.set(t,r)}}return n});e._zod.parse=(i,a)=>{let o=i.value;if(!w(o))return i.issues.push({code:`invalid_type`,expected:`object`,input:o,inst:e}),i;let s=r.value.get(o?.[t.discriminator]);return s?s._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()),input:o,path:[t.discriminator],inst:e}),i)}}),Er=k(`$ZodIntersection`,(e,t)=>{A.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])=>Or(e,t,n)):Or(e,i,a)}});function Dr(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};Object.prototype.hasOwnProperty.call(i,`__proto__`)&&delete i.__proto__;for(let n of r){if(n===`__proto__`)continue;let r=Dr(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=Dr(t.value,n.value);if(!c.valid){if(_e(e))return e;throw Error(`Unmergable intersection. Error path: ${JSON.stringify(c.mergeErrorPath)}`)}return e.value=c.data,e}var kr=k(`$ZodRecord`,(e,t)=>{A.init(e,t);let n=Ke.memoizer;n?.attach(e),e._zod.parse=(r,i)=>{let a=r.value;if(!T(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=>Se(e,i,qe())),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(...ye(n,e.issues)),r.value[l]=e.value})):(u.issues.length&&r.issues.push(...ye(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`&&Xt.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=>Se(e,i,qe())),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(...ye(n,e.issues)),r.value[u]=e.value})):(d.issues.length&&r.issues.push(...ye(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}}),Ar=k(`$ZodEnum`,(e,t)=>{A.init(e,t);let n=h(t.entries),r=new Set(n);e._zod.values=r;let i=n.filter(e=>ae.has(typeof e));e._zod.pattern=RegExp(i.length?`^(${i.map(e=>oe(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}}),jr=k(`$ZodLiteral`,(e,t)=>{A.init(e,t);let n=new Set(t.values);e._zod.values=n,e._zod.pattern=RegExp(t.values.length?`^(${t.values.map(e=>typeof e==`string`?oe(e):e?oe(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}}),Mr=k(`$ZodTransform`,(e,t)=>{A.init(e,t),e._zod.optin=`optional`,Ke.memoizer?.guard(e),e._zod.parse=(n,r)=>{if(r.direction===`backward`)throw new Ge(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 We;return n.value=i,n}});function Nr(e,t){return e.value=t.issues.length?void 0:t.value,e}var Pr=k(`$ZodOptional`,(e,t)=>{A.init(e,t),O(e,`optin`,e=>e.def.innerType._zod.optin===`defaulted`?`defaulted`:`optional`),e._zod.optout=`optional`,O(e,`values`,e=>{let t=e.def.innerType._zod.values;return t?new Set([...t,void 0]):void 0}),O(e,`pattern`,e=>{let t=e.def.innerType._zod.pattern;return t?RegExp(`^(${b(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=>Nr(e,t)):Nr(e,r)}return t.innerType._zod.run(e,n)}}),Fr=k(`$ZodExactOptional`,(e,t)=>{Pr.init(e,t),O(e,`values`,e=>e.def.innerType._zod.values),O(e,`pattern`,e=>e.def.innerType._zod.pattern),e._zod.parse=(e,n)=>t.innerType._zod.run(e,n)}),Ir=k(`$ZodNullable`,(e,t)=>{A.init(e,t),O(e,`optin`,e=>e.def.innerType._zod.optin),O(e,`optout`,e=>e.def.innerType._zod.optout),O(e,`pattern`,e=>{let t=e.def.innerType._zod.pattern;return t?RegExp(`^(${b(t.source)}|null)$`):void 0}),O(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)}),Lr=k(`$ZodDefault`,(e,t)=>{A.init(e,t),e._zod.optin=`defaulted`,O(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=>Rr(e,t)):Rr(r,t)}});function Rr(e,t){return e.value===void 0&&(e.value=t.defaultValue),e}var zr=k(`$ZodPrefault`,(e,t)=>{A.init(e,t),e._zod.optin=`defaulted`,O(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))}),Br=k(`$ZodNonOptional`,(e,t)=>{A.init(e,t),O(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=>Vr(t,e)):Vr(i,e)}});function Vr(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 Hr(e,t,n,r){return t.issues.length?(e.value=n.catchValue({...t,value:e.value,error:{issues:t.issues.map(e=>Se(e,r,qe()))},input:e.value}),e):(e.value=t.value,t.memo&&(e.memo=!0),e)}var Ur=k(`$ZodCatch`,(e,t)=>{A.init(e,t),O(e,`optin`,e=>e.def.innerType._zod.optin===`defaulted`?`defaulted`:`optional`),O(e,`optout`,e=>e.def.innerType._zod.optout),O(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=>Hr(e,r,t,n)):Hr(e,r,t,n)}}),Wr=k(`$ZodPipe`,(e,t)=>{A.init(e,t),O(e,`values`,e=>e.def.in._zod.values),O(e,`optin`,e=>e.def.in._zod.optin),O(e,`optout`,e=>e.def.out._zod.optout),O(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=>Gr(e,t.in,n)):Gr(r,t.in,n)}let r=t.in._zod.run(e,n);return r instanceof Promise?r.then(e=>Gr(e,t.out,n)):Gr(r,t.out,n)}});function Gr(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 Kr=k(`$ZodPreprocess`,(e,t)=>{Wr.init(e,t)}),qr=k(`$ZodReadonly`,(e,t)=>{A.init(e,t),O(e,`propValues`,e=>e.def.innerType._zod.propValues),O(e,`values`,e=>e.def.innerType._zod.values),O(e,`optin`,e=>e.def.innerType?._zod?.optin),O(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(Jr):Jr(r)}});function Jr(e){return e.memo||(e.value=Object.freeze(e.value)),e}var Yr=k(`$ZodCustom`,(e,t)=>{nn.init(e,t),A.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=>Xr(t,n,r,e));Xr(i,n,r,e)}});function Xr(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(De(e))}}var Zr=class extends Error{constructor(){super(`Cannot parse a reference cycle that closes through a transform`),this.name=`ZodCyclicError`}},Qr=`~memo`,$r=[];function ei(e){return e.map(e=>e.path?{...e,path:e.path.slice()}:{...e})}var ti=new WeakMap;function ni(e,t){let n=ti.get(e);if(n!==void 0)return n;if(t.has(e))return!0;t.add(e);let r=!1,i=e=>{!r&&e?._zod&&ni(e,t)&&(r=!0)},a=e._zod.def;switch(a.type){case`object`:for(let e of Reflect.ownKeys(a.shape))i(a.shape[e]);i(a.catchall);break;case`array`:i(a.element);break;case`tuple`:for(let e of a.items)i(e);i(a.rest);break;case`record`:case`map`:i(a.keyType),i(a.valueType);break;case`set`:i(a.valueType);break;case`union`:for(let e of a.options)i(e);break;case`intersection`:i(a.left),i(a.right);break;case`optional`:case`nullable`:case`default`:case`prefault`:case`catch`:case`readonly`:case`nonoptional`:case`promise`:case`success`:i(a.innerType);break;case`pipe`:i(a.in),i(a.out);break;case`function`:i(a.input),i(a.output);break;case`lazy`:i(e._zod.innerType);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 a){let t=Object.getOwnPropertyDescriptor(a,e);if(!t||t.get)continue;let n=t.value;if(n&&typeof n==`object`){if(n._zod)i(n);else if(Array.isArray(n))for(let e of n)i(e)}}}return t.delete(e),ti.set(e,r),r}function ri(e,t){let n=e.buckets.get(t);return n||(n=new Map,e.buckets.set(t,n)),n}var ii,ai=[],oi={alloc(e,t,n){let r=ii;if(!r)return n;ii=void 0;let i={value:n,issues:null};return r.set(t.value,i),ai.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`&&ci(n,e.value))throw new Zr;return t(e,n)};e._zod.parse=n,e._zod.run===t&&(e._zod.run=n)})},attach(e){var t;let n,r,i;(t=e._zod).deferred??(t.deferred=[]),e._zod.deferred.push(()=>{let t=e._zod.parse,a=(o,s)=>{if(n===void 0&&(n=ni(e,new Set),!n))return e._zod.parse=t,e._zod.run===a&&(e._zod.run=t),t(o,s);let c=o.value;if(typeof c!=`object`||!c)return t(o,s);let l=s[Qr];l||(l={buckets:new Map,backEdges:void 0},s[Qr]=l);let u;r===s?u=i:(u=ri(l,e),r=s,i=u);let d=u.get(c);if(d)return o.value=d.value,d.issues?d.issues.length&&o.issues.push(...ei(d.issues)):(o.memo=!0,l.backEdges??(l.backEdges=new Set),l.backEdges.add(d.value)),o;ii=u;let f=ai.length,p=t(o,s);ii=void 0;let m=ai.length>f?ai.pop():void 0;return p instanceof Promise?p.then(e=>(m&&(m.issues=e.issues.length?ei(e.issues):$r),e)):(m&&(m.issues=p.issues.length?ei(p.issues):$r),p)};e._zod.parse=a,e._zod.run===t&&(e._zod.run=a)})}};function si(){return oi}function ci(e,t){let n=e[Qr]?.backEdges;return n!==void 0&&typeof t==`object`&&!!t&&n.has(t)}var li=()=>{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`,credit_card:`credit card number`,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(Ee(e.input),e.input)}`;case`invalid_value`:return e.values.length===1?`Invalid input: expected ${se(e.values[0])}`:`Invalid option: expected one of ${g(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`:``}: ${g(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 ui(){return{localeError:li()}}var di,fi=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 pi(){return new fi}(di=globalThis).__zod_globalRegistry??(di.__zod_globalRegistry=pi());var mi=globalThis.__zod_globalRegistry;function hi(e,t){return new e({type:`string`,...D(t)})}function gi(e,t){return new e({type:`string`,format:`email`,check:`string_format`,abort:!1,...D(t)})}function _i(e,t){return new e({type:`string`,format:`guid`,check:`string_format`,abort:!1,...D(t)})}function vi(e,t){return new e({type:`string`,format:`uuid`,check:`string_format`,abort:!1,...D(t)})}function yi(e,t){return new e({type:`string`,format:`uuid`,check:`string_format`,abort:!1,version:`v4`,...D(t)})}function bi(e,t){return new e({type:`string`,format:`uuid`,check:`string_format`,abort:!1,version:`v6`,...D(t)})}function xi(e,t){return new e({type:`string`,format:`uuid`,check:`string_format`,abort:!1,version:`v7`,...D(t)})}function Si(e,t){return new e({type:`string`,format:`url`,check:`string_format`,abort:!1,...D(t)})}function Ci(e,t){return new e({type:`string`,format:`emoji`,check:`string_format`,abort:!1,...D(t)})}function wi(e,t){return new e({type:`string`,format:`nanoid`,check:`string_format`,abort:!1,...D(t)})}function Ti(e,t){return new e({type:`string`,format:`cuid`,check:`string_format`,abort:!1,...D(t)})}function Ei(e,t){return new e({type:`string`,format:`cuid2`,check:`string_format`,abort:!1,...D(t)})}function Di(e,t){return new e({type:`string`,format:`ulid`,check:`string_format`,abort:!1,...D(t)})}function Oi(e,t){return new e({type:`string`,format:`xid`,check:`string_format`,abort:!1,...D(t)})}function ki(e,t){return new e({type:`string`,format:`ksuid`,check:`string_format`,abort:!1,...D(t)})}function Ai(e,t){return new e({type:`string`,format:`ipv4`,check:`string_format`,abort:!1,...D(t)})}function ji(e,t){return new e({type:`string`,format:`ipv6`,check:`string_format`,abort:!1,...D(t)})}function Mi(e,t){return new e({type:`string`,format:`cidrv4`,check:`string_format`,abort:!1,...D(t)})}function Ni(e,t){return new e({type:`string`,format:`cidrv6`,check:`string_format`,abort:!1,...D(t)})}function Pi(e,t){return new e({type:`string`,format:`base64`,check:`string_format`,abort:!1,...D(t)})}function Fi(e,t){return new e({type:`string`,format:`base64url`,check:`string_format`,abort:!1,...D(t)})}function Ii(e,t){return new e({type:`string`,format:`e164`,check:`string_format`,abort:!1,...D(t)})}function Li(e,t){return new e({type:`string`,format:`jwt`,check:`string_format`,abort:!1,...D(t)})}function Ri(e,t){return new e({type:`string`,format:`datetime`,check:`string_format`,offset:!1,local:!1,precision:null,...D(t)})}function zi(e,t){return new e({type:`string`,format:`date`,check:`string_format`,...D(t)})}function Bi(e,t){return new e({type:`string`,format:`time`,check:`string_format`,precision:null,...D(t)})}function Vi(e,t){return new e({type:`string`,format:`duration`,check:`string_format`,...D(t)})}function Hi(e,t){return new e({type:`number`,checks:[],...D(t)})}function Ui(e,t){return new e({type:`number`,coerce:!0,checks:[],...D(t)})}function Wi(e,t){return new e({type:`number`,check:`number_format`,abort:!1,format:`safeint`,...D(t)})}function Gi(e,t){return new e({type:`boolean`,...D(t)})}function Ki(e,t){return new e({type:`undefined`,...D(t)})}function qi(e,t){return new e({type:`null`,...D(t)})}function Ji(e){return new e({type:`any`})}function Yi(e){return new e({type:`unknown`})}function Xi(e,t){return new e({type:`never`,...D(t)})}function Zi(e,t){return new on({check:`less_than`,...D(t),value:e,inclusive:!1})}function Qi(e,t){return new on({check:`less_than`,...D(t),value:e,inclusive:!0})}function $i(e,t){return new sn({check:`greater_than`,...D(t),value:e,inclusive:!1})}function ea(e,t){return new sn({check:`greater_than`,...D(t),value:e,inclusive:!0})}function ta(e,t){return new cn({check:`multiple_of`,...D(t),value:e})}function na(e,t){return new un({check:`max_length`,...D(t),maximum:e})}function ra(e,t){return new dn({check:`min_length`,...D(t),minimum:e})}function ia(e,t){return new fn({check:`length_equals`,...D(t),length:e})}function aa(e,t){return new mn({check:`string_format`,format:`regex`,...D(t),pattern:e})}function oa(e){return new hn({check:`string_format`,format:`lowercase`,...D(e)})}function sa(e){return new gn({check:`string_format`,format:`uppercase`,...D(e)})}function ca(e,t){return new _n({check:`string_format`,format:`includes`,...D(t),includes:e})}function la(e,t){return new vn({check:`string_format`,format:`starts_with`,...D(t),prefix:e})}function ua(e,t){return new yn({check:`string_format`,format:`ends_with`,...D(t),suffix:e})}function da(e){return new bn({check:`overwrite`,tx:e})}function fa(e){return da(t=>t.normalize(e))}function pa(){return da(e=>e.trim())}function ma(){return da(e=>e.toLowerCase())}function ha(){return da(e=>e.toUpperCase())}function ga(){return da(e=>te(e))}function _a(e,t,n){return new e({type:`array`,element:t,...D(n)})}function va(e,t,n){let r=D(n);return r.abort??=!0,new e({type:`custom`,check:`custom`,fn:t,...r})}function ya(e,t,n){return new e({type:`custom`,check:`custom`,fn:t,...D(n)})}function ba(e,t){let n=xa(t=>(t.addIssue=e=>{if(typeof e==`string`)t.issues.push(De(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(De(r))}},e(t.value,t)),t);return n}function xa(e,t){let n=new nn({check:`custom`,...D(t)});return n._zod.check=e,n}function Sa(e,...t){for(let n of t)for(let t of Reflect.ownKeys(n))Object.prototype.propertyIsEnumerable.call(n,t)&&S(e,t,n[t]);return e}function Ca(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??mi,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 wa(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 M(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,M(a,t,r),t.seen.get(a).isParent=!0)}let c=t.metadataRegistry.get(e);return c&&Sa(o.schema,c),t.io===`input`&&Pa(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 Ta(e){return e.replace(/~/g,`~0`).replace(/\//g,`~1`)}function Ea(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}/${Ta(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+Ta(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}if(r.count>1&&e.reused===`ref`){a(n);continue}}e.external&&(e.sharedDefsExtractedFor=e.external)}function Da(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;Da(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 Oa=new Set([`type`,`properties`,`required`,`additionalProperties`]),ka=[`oneOf`,`anyOf`];function Aa(e){let t=e.additionalProperties;return t===void 0||t===!1||typeof t!=`object`||!t?null:Object.keys(t).length?t:null}function ja(e){let t=[];for(let n of e){if(typeof n!=`object`||n.type!==`object`)return null;for(let e in n)if(!Oa.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]??Aa(n);t!=null&&(e.some(e=>JSON.stringify(e)===JSON.stringify(t))||e.push(t))}S(n,r,e.length===1?e[0]:ja(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=Aa(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 Ma(e){let t=e.allOf;if(!Array.isArray(t)||t.length<2)return;for(let t of Oa)if(t in e)return;let n=t.filter(e=>ka.some(t=>Array.isArray(e[t]))),r=null;if(!n.length)r=ja(t);else{let e=n[0],i=ka.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=>ja([...a,e]));if(o.some(e=>!e))return;r={[i]:o}}r&&(delete e.allOf,Sa(e,r))}function Na(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)):Sa(i,s),Sa(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())Da(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)??[])Ma(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)}Sa(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,S(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:Ia(t,`input`,e.processors),output:Ia(t,`output`,e.processors)}},enumerable:!1,writable:!1}),n}catch{throw Error(`Error converting schema to JSON.`)}}function Pa(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 Pa(r.element,n);if(r.type===`set`)return Pa(r.valueType,n);if(r.type===`lazy`)return Pa(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 Pa(r.innerType,n);if(r.type===`intersection`)return Pa(r.left,n)||Pa(r.right,n);if(r.type===`record`||r.type===`map`)return Pa(r.keyType,n)||Pa(r.valueType,n);if(r.type===`pipe`)return e._zod.traits.has(`$ZodCodec`)?!0:Pa(r.in,n)||Pa(r.out,n);if(r.type===`object`){for(let e in r.shape)if(Pa(r.shape[e],n))return!0;return!1}if(r.type===`union`){for(let e of r.options)if(Pa(e,n))return!0;return!1}if(r.type===`tuple`){for(let e of r.items)if(Pa(e,n))return!0;return!!(r.rest&&Pa(r.rest,n))}return!1}var Fa=(e,t={})=>n=>{let r=Ca({...n,processors:t});return M(e,r),Ea(r,e),Na(r,e)},Ia=(e,t,n={})=>r=>{let{libraryOptions:i,target:a}=r??{},o=Ca({...i??{},target:a,io:t,processors:n});return M(e,o),Ea(o,e),Na(o,e)},La={guid:`uuid`,url:`uri`,datetime:`date-time`,json_string:`json-string`,regex:``},Ra=(e,t,n,r)=>{let i=n;i.type=`string`;let{minimum:a,maximum:o,format:s,patterns:c,contentEncoding:l,laxFormat:u}=e._zod.bag;if(typeof a==`number`&&(i.minLength=a),typeof o==`number`&&(i.maxLength=o),s&&(i.format=La[s]??s,i.format===``&&delete i.format,(s===`time`||u)&&delete i.format),l&&(i.contentEncoding=l),c&&c.size>0){let e=[...c];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}))])}},za=(e,t,n,r)=>{let i=n,{minimum:a,maximum:o,format:s,multipleOf:c,exclusiveMaximum:l,exclusiveMinimum:u}=e._zod.bag;i.type=typeof s==`string`&&s.includes(`int`)?`integer`:`number`;let d=typeof u==`number`&&u>=(a??-1/0),f=typeof l==`number`&&l<=(o??1/0),p=t.target===`draft-04`||t.target===`openapi-3.0`;d?p?(i.minimum=u,i.exclusiveMinimum=!0):i.exclusiveMinimum=u:typeof a==`number`&&(i.minimum=a),f?p?(i.maximum=l,i.exclusiveMaximum=!0):i.exclusiveMaximum=l:typeof o==`number`&&(i.maximum=o),typeof c==`number`&&(Number.isFinite(c)&&c!==0?i.multipleOf=Math.abs(c):wa(e,t,i,r,`A multipleOf divisor of ${c} cannot be represented in JSON Schema`))},Ba=(e,t,n,r)=>{n.type=`boolean`},Va=(e,t,n,r)=>{t.target===`openapi-3.0`?(n.type=`string`,n.nullable=!0,n.enum=[null]):n.type=`null`},Ha=(e,t,n,r)=>{wa(e,t,n,r,`Undefined cannot be represented in JSON Schema`)},Ua=(e,t,n,r)=>{n.not={}},Wa=(e,t,n,r)=>{let i=e._zod.def,a=h(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},Ga=(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(wa(e,t,n,r,"Literal `undefined` cannot be represented in JSON Schema"))return}else if(typeof o==`bigint`){if(wa(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}},Ka=(e,t,n,r)=>{wa(e,t,n,r,`Custom types cannot be represented in JSON Schema`)},qa=(e,t,n,r)=>{wa(e,t,n,r,`Transforms cannot be represented in JSON Schema`)},Ja=(e,t,n,r)=>{let i=n,a=e._zod.def,{minimum:o,maximum:s}=e._zod.bag;typeof o==`number`&&(i.minItems=o),typeof s==`number`&&(i.maxItems=s),i.type=`array`,i.items=M(a.element,t,{...r,path:[...r.path,`items`]})};function Ya(e){let t=e._zod.def;return t.type===`pipe`&&t.in._zod.traits.has(`$ZodTransform`)?Ya(t.out):t.type===`catch`?Ya(t.innerType):e._zod.optin}var Xa=(e,t,n,r)=>{let i=n,a=e._zod.def,o=a.shape;if(Object.getOwnPropertySymbols(o).length&&wa(e,t,i,r,`Symbol keys cannot be represented in JSON Schema`))return;i.type=`object`,i.properties={};for(let e in o)S(i.properties,e,M(o[e],t,{...r,path:[...r.path,`properties`,e]}));let s=new Set(Object.keys(o)),c=new Set([...s].filter(e=>{let n=a.shape[e];return t.io===`input`?Ya(n)===void 0:n._zod.optout===void 0}));c.size>0&&(i.required=Array.from(c)),a.catchall?._zod.def.type===`never`?i.additionalProperties=!1:a.catchall?a.catchall&&(i.additionalProperties=M(a.catchall,t,{...r,path:[...r.path,`additionalProperties`]})):t.io===`output`&&(i.additionalProperties=!1)},Za=(e,t,n,r)=>{let i=e._zod.def,a=i.inclusive===!1,o=i.options.map((e,n)=>M(e,t,{...r,path:[...r.path,a?`oneOf`:`anyOf`,n]}));a?n.oneOf=o:n.anyOf=o},Qa=(e,t,n,r)=>{let i=e._zod.def,a=M(i.left,t,{...r,path:[...r.path,`allOf`,0]}),o=M(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)};function $a(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=$a(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=>$a(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`)?Xt:Yt).source),p):p}var eo=new WeakMap;function to(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 eo.get(e)??[]){let i=e.seen.get(r),a=(i?.def??i?.schema)?.propertyNames;if(!a||a===!0||n.has(a))continue;let o=$a(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 no=(e,t,n,r)=>{let i=n,a=e._zod.def;i.type=`object`;let o=a.keyType,s=o._zod.bag?.patterns;if(a.mode===`loose`&&s&&s.size>0){let e=M(a.valueType,t,{...r,path:[...r.path,`patternProperties`,`*`]});i.patternProperties={};for(let t of s)S(i.patternProperties,t.source,e)}else{if(t.target===`draft-07`||t.target===`draft-2020-12`){i.propertyNames=M(a.keyType,t,{...r,path:[...r.path,`propertyNames`]});let n=eo.get(t);n||(n=[],eo.set(t,n),t.deferred.push(()=>to(t))),n.push(e)}i.additionalProperties=M(a.valueType,t,{...r,path:[...r.path,`additionalProperties`]})}let c=o._zod.values,l=t.io===`input`&&Ya(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))}},ro=(e,t,n,r)=>{let i=e._zod.def,a=M(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`}]},io=(e,t,n,r)=>{let i=e._zod.def;M(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType},ao=Symbol();function oo(e,t,n,r,i){let a=!1,o=JSON.stringify(e,(e,t)=>typeof t==`bigint`?(a=!0,null):t);return a?(wa(t,n,r,i,`BigInt defaults cannot be represented in JSON Schema`),ao):JSON.parse(o)}var so=(e,t,n,r)=>{let i=e._zod.def;M(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType;let o=oo(i.defaultValue,e,t,n,r);o!==ao&&(n.default=o)},co=(e,t,n,r)=>{let i=e._zod.def;M(i.innerType,t,r);let a=t.seen.get(e);if(a.ref=i.innerType,t.io!==`input`)return;let o=oo(i.defaultValue,e,t,n,r);o!==ao&&(n._prefault=o)},lo=(e,t,n,r)=>{let i=e._zod.def;M(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType;let o;try{o=i.catchValue(void 0)}catch{wa(e,t,n,r,`Dynamic catch values are not supported in JSON Schema`);return}n.default=o},uo=(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;M(o,t,r);let s=t.seen.get(e);s.ref=o},fo=(e,t,n,r)=>{let i=e._zod.def;M(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType,n.readOnly=!0},po=(e,t,n,r)=>{let i=e._zod.def;M(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType},mo=new WeakSet([Object.prototype,Error.prototype]);function ho(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 go=k(`ZodError`,(e,t)=>{tt.init(e,t),e.name=`ZodError`;let n=Object.getPrototypeOf(e);mo.has(n)||(mo.add(n),ho(n,`format`,e=>t=>at(e,t)),ho(n,`flatten`,e=>t=>it(e,t)),ho(n,`addIssue`,e=>t=>{e.issues.push(t),e.message=JSON.stringify(e.issues,_,2)}),ho(n,`addIssues`,e=>t=>{e.issues.push(...t),e.message=JSON.stringify(e.issues,_,2)}),Object.defineProperty(n,"isEmpty",{configurable:!0,enumerable:!1,get(){return this.issues.length===0}}))},void 0,{Parent:Error}),_o=st(go),vo=ct(go),yo=lt(go),bo=dt(go),xo=pt(go),So=mt(go),Co=ht(go),wo=gt(go),To=_t(go),Eo=vt(go),Do=yt(go),Oo=bt(go);function ko(){Ke.localeError||qe(ui())}function Ao(){Ke.memoizer||qe({memoizer:si()})}var N=k(`ZodType`,(e,t)=>(ko(),A.init(e,t),e.def=t,e.type=t.type,e),{check(...e){let t=this.def;return this.clone(C(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 E(this,e,t)},brand(){return this},register(e,t){return e.add(this,t),this},refine(e,t){return this.check(Ys(e,t))},superRefine(e,t){return this.check(Xs(e,t))},overwrite(e){return this.check(da(e))},optional(){return G(this)},exactOptional(){return js(this)},nullable(){return Ns(this)},nullish(){return G(Ns(this))},nonoptional(e){return zs(this,e)},array(){return z(this)},or(e){return H([this,e])},and(e){return Ss(this,e)},transform(e){return Us(this,Os(e))},default(e){return Fs(this,e)},prefault(e){return Ls(this,e)},catch(e){return Vs(this,e)},pipe(e){return Us(this,e)},readonly(){return Ks(this)},describe(e){let t=this.clone();return mi.add(t,{description:e}),t},meta(...e){if(e.length===0)return mi.get(this);let t=this.clone();return mi.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 Ae(this,`~standard`,{...wn(this),jsonSchema:{input:Ia(this,`input`),output:Ia(this,`output`)}})},set"~standard"(e){ke(this,`~standard`,e)},parse:function e(t,n){return _o(this,t,n,{callee:e})},parseAsync:async function e(t,n){return await vo(this,t,n,{callee:e})},safeParse(e,t){return yo(this,e,t)},async safeParseAsync(e,t){return bo(this,e,t)},get spa(){return this?.safeParseAsync},set spa(e){ke(this,`spa`,e)},encode:function e(t,n){return xo(this,t,n,{callee:e})},decode:function e(t,n){return So(this,t,n,{callee:e})},encodeAsync:async function e(t,n){return await Co(this,t,n,{callee:e})},decodeAsync:async function e(t,n){return await wo(this,t,n,{callee:e})},safeEncode(e,t){return To(this,e,t)},safeDecode(e,t){return Eo(this,e,t)},async safeEncodeAsync(e,t){return Do(this,e,t)},async safeDecodeAsync(e,t){return Oo(this,e,t)},toJSONSchema(e){return Fa(this,{})(e)},get description(){return mi.get(this)?.description},get _def(){return this._zod.def}}),jo=k(`_ZodString`,(e,t)=>{Tn.init(e,t),N.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Ra(e,t,n,r);let n=e._zod.bag;e.format=n.format??null,e.minLength=n.minimum??null,e.maxLength=n.maximum??null},{regex(...e){return this.check(aa(...e))},includes(...e){return this.check(ca(...e))},startsWith(...e){return this.check(la(...e))},endsWith(...e){return this.check(ua(...e))},min(...e){return this.check(ra(...e))},max(...e){return this.check(na(...e))},length(...e){return this.check(ia(...e))},nonempty(...e){return this.check(ra(1,...e))},lowercase(e){return this.check(oa(e))},uppercase(e){return this.check(sa(e))},trim(){return this.check(pa())},normalize(...e){return this.check(fa(...e))},toLowerCase(){return this.check(ma())},toUpperCase(){return this.check(ha())},slugify(){return this.check(ga())}}),Mo=k(`ZodString`,(e,t)=>{Tn.init(e,t),jo.init(e,t)},{email(e){return this.check(gi(Lo,e))},url(e){return this.check(Si(Bo,e))},jwt(e){return this.check(Li(ns,e))},emoji(e){return this.check(Ci(Ho,e))},guid(e){return this.check(_i(Ro,e))},uuid(e){return this.check(vi(zo,e))},uuidv4(e){return this.check(yi(zo,e))},uuidv6(e){return this.check(bi(zo,e))},uuidv7(e){return this.check(xi(zo,e))},nanoid(e){return this.check(wi(Uo,e))},cuid(e){return this.check(Ti(Wo,e))},cuid2(e){return this.check(Ei(Go,e))},ulid(e){return this.check(Di(Ko,e))},base64(e){return this.check(Pi($o,e))},base64url(e){return this.check(Fi(es,e))},xid(e){return this.check(Oi(qo,e))},ksuid(e){return this.check(ki(Jo,e))},ipv4(e){return this.check(Ai(Yo,e))},ipv6(e){return this.check(ji(Xo,e))},cidrv4(e){return this.check(Mi(Zo,e))},cidrv6(e){return this.check(Ni(Qo,e))},e164(e){return this.check(Ii(ts,e))},datetime(e){return this.check(Ri(No,e))},date(e){return this.check(zi(Po,e))},time(e){return this.check(Bi(Fo,e))},duration(e){return this.check(Vi(Io,e))}});function P(e){return hi(Mo,e)}var F=k(`ZodStringFormat`,(e,t)=>{j.init(e,t),jo.init(e,t)}),No=k(`ZodISODateTime`,(e,t)=>{Hn.init(e,t),F.init(e,t)}),Po=k(`ZodISODate`,(e,t)=>{Un.init(e,t),F.init(e,t)}),Fo=k(`ZodISOTime`,(e,t)=>{Wn.init(e,t),F.init(e,t)}),Io=k(`ZodISODuration`,(e,t)=>{Gn.init(e,t),F.init(e,t)}),Lo=k(`ZodEmail`,(e,t)=>{On.init(e,t),F.init(e,t)}),Ro=k(`ZodGUID`,(e,t)=>{En.init(e,t),F.init(e,t)}),zo=k(`ZodUUID`,(e,t)=>{Dn.init(e,t),F.init(e,t)}),Bo=k(`ZodURL`,(e,t)=>{Pn.init(e,t),F.init(e,t)});function Vo(e){return Si(Bo,e)}var Ho=k(`ZodEmoji`,(e,t)=>{Fn.init(e,t),F.init(e,t)}),Uo=k(`ZodNanoID`,(e,t)=>{In.init(e,t),F.init(e,t)}),Wo=k(`ZodCUID`,(e,t)=>{Ln.init(e,t),F.init(e,t)}),Go=k(`ZodCUID2`,(e,t)=>{Rn.init(e,t),F.init(e,t)}),Ko=k(`ZodULID`,(e,t)=>{zn.init(e,t),F.init(e,t)}),qo=k(`ZodXID`,(e,t)=>{Bn.init(e,t),F.init(e,t)}),Jo=k(`ZodKSUID`,(e,t)=>{Vn.init(e,t),F.init(e,t)}),Yo=k(`ZodIPv4`,(e,t)=>{Kn.init(e,t),F.init(e,t)}),Xo=k(`ZodIPv6`,(e,t)=>{Yn.init(e,t),F.init(e,t)}),Zo=k(`ZodCIDRv4`,(e,t)=>{Xn.init(e,t),F.init(e,t)}),Qo=k(`ZodCIDRv6`,(e,t)=>{Qn.init(e,t),F.init(e,t)}),$o=k(`ZodBase64`,(e,t)=>{er.init(e,t),F.init(e,t)}),es=k(`ZodBase64URL`,(e,t)=>{nr.init(e,t),F.init(e,t)}),ts=k(`ZodE164`,(e,t)=>{rr.init(e,t),F.init(e,t)}),ns=k(`ZodJWT`,(e,t)=>{ar.init(e,t),F.init(e,t)}),rs=k(`ZodNumber`,(e,t)=>{or.init(e,t),N.init(e,t),e._zod.processJSONSchema=(t,n,r)=>za(e,t,n,r);let n=e._zod.bag;e.minValue=Math.max(n.minimum??-1/0,n.exclusiveMinimum??-1/0)??null,e.maxValue=Math.min(n.maximum??1/0,n.exclusiveMaximum??1/0)??null,e.isInt=(n.format??``).includes(`int`)||Number.isSafeInteger(n.multipleOf??.5),e.isFinite=!0,e.format=n.format??null},{gt(e,t){return this.check($i(e,t))},gte(e,t){return this.check(ea(e,t))},min(e,t){return this.check(ea(e,t))},lt(e,t){return this.check(Zi(e,t))},lte(e,t){return this.check(Qi(e,t))},max(e,t){return this.check(Qi(e,t))},int(e){return this.check(as(e))},safe(e){return this.check(as(e))},positive(e){return this.check($i(0,e))},nonnegative(e){return this.check(ea(0,e))},negative(e){return this.check(Zi(0,e))},nonpositive(e){return this.check(Qi(0,e))},multipleOf(e,t){return this.check(ta(e,t))},step(e,t){return this.check(ta(e,t))},finite(){return this}});function I(e){return Hi(rs,e)}var is=k(`ZodNumberFormat`,(e,t)=>{sr.init(e,t),rs.init(e,t)});function as(e){return Wi(is,e)}var os=k(`ZodBoolean`,(e,t)=>{cr.init(e,t),N.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Ba(e,t,n,r)});function L(e){return Gi(os,e)}var ss=k(`ZodUndefined`,(e,t)=>{lr.init(e,t),N.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Ha(e,t,n,r)});function cs(e){return Ki(ss,e)}var ls=k(`ZodNull`,(e,t)=>{ur.init(e,t),N.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Va(e,t,n,r)});function us(e){return qi(ls,e)}var ds=k(`ZodAny`,(e,t)=>{dr.init(e,t),N.init(e,t),e._zod.processJSONSchema=(e,t,n)=>void 0});function fs(){return Ji(ds)}var ps=k(`ZodUnknown`,(e,t)=>{fr.init(e,t),N.init(e,t),e._zod.processJSONSchema=(e,t,n)=>void 0});function R(){return Yi(ps)}var ms=k(`ZodNever`,(e,t)=>{pr.init(e,t),N.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Ua(e,t,n,r)});function hs(e){return Xi(ms,e)}var gs=k(`ZodArray`,(e,t)=>{Ao(),hr.init(e,t),N.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Ja(e,t,n,r),e.element=t.element},{min(e,t){return this.check(ra(e,t))},nonempty(e){return this.check(ra(1,e))},max(e,t){return this.check(na(e,t))},length(e,t){return this.check(ia(e,t))},unwrap(){return this.element}});function z(e,t){return _a(gs,e,t)}var _s=k(`ZodObject`,(e,t)=>{Ao(),Sr.init(e,t),N.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Xa(e,t,n,r),Ie(e,`shape`,e=>e._zod.def.shape,!1)},{keyof(){return Ts(Object.keys(this._zod.def.shape))},catchall(e){return this.clone({...this._zod.def,catchall:e})},passthrough(){return this.clone({...this._zod.def,catchall:R()})},loose(){return this.clone({...this._zod.def,catchall:R()})},strict(){return this.clone({...this._zod.def,catchall:hs()})},strip(){return this.clone({...this._zod.def,catchall:void 0})},extend(e){return fe(this,e)},safeExtend(e){return pe(this,e)},merge(e){return me(this,e)},pick(e){return ue(this,e)},omit(e){return de(this,e)},partial(...e){return he(ks,this,e[0])},exactPartial(...e){return he(As,this,e[0],`exactPartial`)},required(...e){return ge(Rs,this,e[0])}});function B(e,t){return new _s({type:`object`,shape:e??{},...D(t)})}function V(e,t){return new _s({type:`object`,shape:e,catchall:R(),...D(t)})}var vs=k(`ZodUnion`,(e,t)=>{wr.init(e,t),N.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Za(e,t,n,r),e.options=t.options});function H(e,t){return new vs({type:`union`,options:e,...D(t)})}var ys=k(`ZodDiscriminatedUnion`,(e,t)=>{vs.init(e,t),Tr.init(e,t)});function bs(e,t,n){return new ys({type:`union`,options:t,discriminator:e,...D(n)})}var xs=k(`ZodIntersection`,(e,t)=>{Er.init(e,t),N.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Qa(e,t,n,r)});function Ss(e,t){return new xs({type:`intersection`,left:e,right:t})}var Cs=k(`ZodRecord`,(e,t)=>{Ao(),kr.init(e,t),N.init(e,t),e._zod.processJSONSchema=(t,n,r)=>no(e,t,n,r),e.keyType=t.keyType,e.valueType=t.valueType});function U(e,t,n){return!t||!t._zod?new Cs({type:`record`,keyType:P(),valueType:e,...D(t)}):new Cs({type:`record`,keyType:e,valueType:t,...D(n)})}var ws=k(`ZodEnum`,(e,t)=>{Ar.init(e,t),N.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Wa(e,t,n,r),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 ws({...t,checks:[],...D(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 ws({...t,checks:[],...D(r),entries:i})}});function Ts(e,t){return new ws({type:`enum`,entries:Array.isArray(e)?Object.fromEntries(e.map(e=>[e,e])):e,...D(t)})}var Es=k(`ZodLiteral`,(e,t)=>{jr.init(e,t),N.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Ga(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 W(e,t){return new Es({type:`literal`,values:Array.isArray(e)?e:[e],...D(t)})}var Ds=k(`ZodTransform`,(e,t)=>{Ao(),Mr.init(e,t),N.init(e,t),e._zod.processJSONSchema=(t,n,r)=>qa(e,t,n,r),e._zod.parse=(n,r)=>{if(r.direction===`backward`)throw new Ge(e.constructor.name);n.addIssue=r=>{if(typeof r==`string`)n.issues.push(De(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(De(t))}};let i=t.transform(n.value,n);return i instanceof Promise?i.then(e=>(n.value=e,n)):(n.value=i,n)}});function Os(e){return new Ds({type:`transform`,transform:e})}var ks=k(`ZodOptional`,(e,t)=>{Pr.init(e,t),N.init(e,t),e._zod.processJSONSchema=(t,n,r)=>po(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function G(e){return new ks({type:`optional`,innerType:e})}var As=k(`ZodExactOptional`,(e,t)=>{Fr.init(e,t),N.init(e,t),e._zod.processJSONSchema=(t,n,r)=>po(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function js(e){return new As({type:`optional`,innerType:e})}var Ms=k(`ZodNullable`,(e,t)=>{Ir.init(e,t),N.init(e,t),e._zod.processJSONSchema=(t,n,r)=>ro(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function Ns(e){return new Ms({type:`nullable`,innerType:e})}var Ps=k(`ZodDefault`,(e,t)=>{Lr.init(e,t),N.init(e,t),e._zod.processJSONSchema=(t,n,r)=>so(e,t,n,r),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap});function Fs(e,t){return new Ps({type:`default`,innerType:e,get defaultValue(){return typeof t==`function`?t():ie(t)}})}var Is=k(`ZodPrefault`,(e,t)=>{zr.init(e,t),N.init(e,t),e._zod.processJSONSchema=(t,n,r)=>co(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function Ls(e,t){return new Is({type:`prefault`,innerType:e,get defaultValue(){return typeof t==`function`?t():ie(t)}})}var Rs=k(`ZodNonOptional`,(e,t)=>{Br.init(e,t),N.init(e,t),e._zod.processJSONSchema=(t,n,r)=>io(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function zs(e,t){return new Rs({type:`nonoptional`,innerType:e,...D(t)})}var Bs=k(`ZodCatch`,(e,t)=>{Ur.init(e,t),N.init(e,t),e._zod.processJSONSchema=(t,n,r)=>lo(e,t,n,r),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap});function Vs(e,t){return new Bs({type:`catch`,innerType:e,catchValue:typeof t==`function`?t:Re(t)})}var Hs=k(`ZodPipe`,(e,t)=>{Wr.init(e,t),N.init(e,t),e._zod.processJSONSchema=(t,n,r)=>uo(e,t,n,r),e.in=t.in,e.out=t.out});function Us(e,t){return new Hs({type:`pipe`,in:e,out:t})}var Ws=k(`ZodPreprocess`,(e,t)=>{Hs.init(e,t),Kr.init(e,t)}),Gs=k(`ZodReadonly`,(e,t)=>{qr.init(e,t),N.init(e,t),e._zod.processJSONSchema=(t,n,r)=>fo(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function Ks(e){return new Gs({type:`readonly`,innerType:e})}var qs=k(`ZodCustom`,(e,t)=>{Yr.init(e,t),N.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Ka(e,t,n,r)});function Js(e,t){return va(qs,e??(()=>!0),t)}function Ys(e,t={}){return ya(qs,e,t)}function Xs(e,t){return ba(e,t)}function Zs(e,t){return new Ws({type:`pipe`,in:Os(e),out:t})}var Qs={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`},$s;$s||={};function ec(e){return Ri(No,e)}function tc(e){return Ui(rs,e)}var nc=`2025-11-25`,rc=[nc,`2025-06-18`,`2025-03-26`,`2024-11-05`,`2024-10-07`],ic=`io.modelcontextprotocol/related-task`,K=Js(e=>e!==null&&(typeof e==`object`||typeof e==`function`)),ac=H([P(),I().int()]),oc=P();V({ttl:I().optional(),pollInterval:I().optional()});var sc=B({ttl:I().optional()}),cc=B({taskId:P()}),lc=V({progressToken:ac.optional(),[ic]:cc.optional()}),uc=B({_meta:lc.optional()}),dc=uc.extend({task:sc.optional()}),fc=e=>dc.safeParse(e).success,q=B({method:P(),params:uc.loose().optional()}),pc=B({_meta:lc.optional()}),mc=B({method:P(),params:pc.loose().optional()}),J=V({_meta:lc.optional()}),hc=H([P(),I().int()]),gc=B({jsonrpc:W(`2.0`),id:hc,...q.shape}).strict(),_c=e=>gc.safeParse(e).success,vc=B({jsonrpc:W(`2.0`),...mc.shape}).strict(),yc=e=>vc.safeParse(e).success,bc=B({jsonrpc:W(`2.0`),id:hc,result:J}).strict(),xc=e=>bc.safeParse(e).success,Y;(function(e){e[e.ConnectionClosed=-32e3]=`ConnectionClosed`,e[e.RequestTimeout=-32001]=`RequestTimeout`,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.UrlElicitationRequired=-32042]=`UrlElicitationRequired`})(Y||={});var Sc=B({jsonrpc:W(`2.0`),id:hc.optional(),error:B({code:I().int(),message:P(),data:R().optional()})}).strict(),Cc=e=>Sc.safeParse(e).success,wc=H([gc,vc,bc,Sc]);H([bc,Sc]);var Tc=J.strict(),Ec=pc.extend({requestId:hc.optional(),reason:P().optional()}),Dc=mc.extend({method:W(`notifications/cancelled`),params:Ec}),Oc=B({icons:z(B({src:P(),mimeType:P().optional(),sizes:z(P()).optional(),theme:Ts([`light`,`dark`]).optional()})).optional()}),kc=B({name:P(),title:P().optional()}),Ac=kc.extend({...kc.shape,...Oc.shape,version:P(),websiteUrl:P().optional(),description:P().optional()}),jc=Zs(e=>e&&typeof e==`object`&&!Array.isArray(e)&&Object.keys(e).length===0?{form:{}}:e,Ss(B({form:Ss(B({applyDefaults:L().optional()}),U(P(),R())).optional(),url:K.optional()}),U(P(),R()).optional())),Mc=V({list:K.optional(),cancel:K.optional(),requests:V({sampling:V({createMessage:K.optional()}).optional(),elicitation:V({create:K.optional()}).optional()}).optional()}),Nc=V({list:K.optional(),cancel:K.optional(),requests:V({tools:V({call:K.optional()}).optional()}).optional()}),Pc=B({experimental:U(P(),K).optional(),sampling:B({context:K.optional(),tools:K.optional()}).optional(),elicitation:jc.optional(),roots:B({listChanged:L().optional()}).optional(),tasks:Mc.optional(),extensions:U(P(),K).optional()}),Fc=uc.extend({protocolVersion:P(),capabilities:Pc,clientInfo:Ac}),Ic=q.extend({method:W(`initialize`),params:Fc}),Lc=B({experimental:U(P(),K).optional(),logging:K.optional(),completions:K.optional(),prompts:B({listChanged:L().optional()}).optional(),resources:B({subscribe:L().optional(),listChanged:L().optional()}).optional(),tools:B({listChanged:L().optional()}).optional(),tasks:Nc.optional(),extensions:U(P(),K).optional()}),Rc=J.extend({protocolVersion:P(),capabilities:Lc,serverInfo:Ac,instructions:P().optional()}),zc=mc.extend({method:W(`notifications/initialized`),params:pc.optional()}),Bc=e=>zc.safeParse(e).success,Vc=q.extend({method:W(`ping`),params:uc.optional()}),Hc=B({progress:I(),total:G(I()),message:G(P())}),Uc=B({...pc.shape,...Hc.shape,progressToken:ac}),Wc=mc.extend({method:W(`notifications/progress`),params:Uc}),Gc=uc.extend({cursor:oc.optional()}),Kc=q.extend({params:Gc.optional()}),qc=J.extend({nextCursor:oc.optional()}),Jc=Ts([`working`,`input_required`,`completed`,`failed`,`cancelled`]),Yc=B({taskId:P(),status:Jc,ttl:H([I(),us()]),createdAt:P(),lastUpdatedAt:P(),pollInterval:G(I()),statusMessage:G(P())}),Xc=J.extend({task:Yc}),Zc=pc.merge(Yc),Qc=mc.extend({method:W(`notifications/tasks/status`),params:Zc}),$c=q.extend({method:W(`tasks/get`),params:uc.extend({taskId:P()})}),el=J.merge(Yc),tl=q.extend({method:W(`tasks/result`),params:uc.extend({taskId:P()})});J.loose();var nl=Kc.extend({method:W(`tasks/list`)}),rl=qc.extend({tasks:z(Yc)}),il=q.extend({method:W(`tasks/cancel`),params:uc.extend({taskId:P()})}),al=J.merge(Yc),ol=B({uri:P(),mimeType:G(P()),_meta:U(P(),R()).optional()}),sl=ol.extend({text:P()}),cl=P().refine(e=>{try{return atob(e),!0}catch{return!1}},{message:`Invalid Base64 string`}),ll=ol.extend({blob:cl}),ul=Ts([`user`,`assistant`]),dl=B({audience:z(ul).optional(),priority:I().min(0).max(1).optional(),lastModified:ec({offset:!0}).optional()}),fl=B({...kc.shape,...Oc.shape,uri:P(),description:G(P()),mimeType:G(P()),size:G(I()),annotations:dl.optional(),_meta:G(V({}))}),pl=B({...kc.shape,...Oc.shape,uriTemplate:P(),description:G(P()),mimeType:G(P()),annotations:dl.optional(),_meta:G(V({}))}),ml=Kc.extend({method:W(`resources/list`)}),hl=qc.extend({resources:z(fl)}),gl=Kc.extend({method:W(`resources/templates/list`)}),_l=qc.extend({resourceTemplates:z(pl)}),vl=uc.extend({uri:P()}),yl=vl,bl=q.extend({method:W(`resources/read`),params:yl}),xl=J.extend({contents:z(H([sl,ll]))}),Sl=mc.extend({method:W(`notifications/resources/list_changed`),params:pc.optional()}),Cl=vl,wl=q.extend({method:W(`resources/subscribe`),params:Cl}),Tl=vl,El=q.extend({method:W(`resources/unsubscribe`),params:Tl}),Dl=pc.extend({uri:P()}),Ol=mc.extend({method:W(`notifications/resources/updated`),params:Dl}),kl=B({name:P(),description:G(P()),required:G(L())}),Al=B({...kc.shape,...Oc.shape,description:G(P()),arguments:G(z(kl)),_meta:G(V({}))}),jl=Kc.extend({method:W(`prompts/list`)}),Ml=qc.extend({prompts:z(Al)}),Nl=uc.extend({name:P(),arguments:U(P(),P()).optional()}),Pl=q.extend({method:W(`prompts/get`),params:Nl}),Fl=B({type:W(`text`),text:P(),annotations:dl.optional(),_meta:U(P(),R()).optional()}),Il=B({type:W(`image`),data:cl,mimeType:P(),annotations:dl.optional(),_meta:U(P(),R()).optional()}),Ll=B({type:W(`audio`),data:cl,mimeType:P(),annotations:dl.optional(),_meta:U(P(),R()).optional()}),Rl=B({type:W(`tool_use`),name:P(),id:P(),input:U(P(),R()),_meta:U(P(),R()).optional()}),zl=B({type:W(`resource`),resource:H([sl,ll]),annotations:dl.optional(),_meta:U(P(),R()).optional()}),Bl=fl.extend({type:W(`resource_link`)}),Vl=H([Fl,Il,Ll,Bl,zl]),Hl=B({role:ul,content:Vl}),Ul=J.extend({description:P().optional(),messages:z(Hl)}),Wl=mc.extend({method:W(`notifications/prompts/list_changed`),params:pc.optional()}),Gl=B({title:P().optional(),readOnlyHint:L().optional(),destructiveHint:L().optional(),idempotentHint:L().optional(),openWorldHint:L().optional()}),Kl=B({taskSupport:Ts([`required`,`optional`,`forbidden`]).optional()}),ql=B({...kc.shape,...Oc.shape,description:P().optional(),inputSchema:B({type:W(`object`),properties:U(P(),K).optional(),required:z(P()).optional()}).catchall(R()),outputSchema:B({type:W(`object`),properties:U(P(),K).optional(),required:z(P()).optional()}).catchall(R()).optional(),annotations:Gl.optional(),execution:Kl.optional(),_meta:U(P(),R()).optional()}),Jl=Kc.extend({method:W(`tools/list`)}),Yl=qc.extend({tools:z(ql)}),Xl=J.extend({content:z(Vl).default([]),structuredContent:U(P(),R()).optional(),isError:L().optional()});Xl.or(J.extend({toolResult:R()}));var Zl=dc.extend({name:P(),arguments:U(P(),R()).optional()}),Ql=q.extend({method:W(`tools/call`),params:Zl}),$l=mc.extend({method:W(`notifications/tools/list_changed`),params:pc.optional()}),eu=B({autoRefresh:L().default(!0),debounceMs:I().int().nonnegative().default(300)}),tu=Ts([`debug`,`info`,`notice`,`warning`,`error`,`critical`,`alert`,`emergency`]),nu=uc.extend({level:tu}),ru=q.extend({method:W(`logging/setLevel`),params:nu}),iu=pc.extend({level:tu,logger:P().optional(),data:R()}),au=mc.extend({method:W(`notifications/message`),params:iu}),ou=B({hints:z(B({name:P().optional()})).optional(),costPriority:I().min(0).max(1).optional(),speedPriority:I().min(0).max(1).optional(),intelligencePriority:I().min(0).max(1).optional()}),su=B({mode:Ts([`auto`,`required`,`none`]).optional()}),cu=B({type:W(`tool_result`),toolUseId:P().describe(`The unique identifier for the corresponding tool call.`),content:z(Vl).default([]),structuredContent:B({}).loose().optional(),isError:L().optional(),_meta:U(P(),R()).optional()}),lu=bs(`type`,[Fl,Il,Ll]),uu=bs(`type`,[Fl,Il,Ll,Rl,cu]),du=B({role:ul,content:H([uu,z(uu)]),_meta:U(P(),R()).optional()}),fu=dc.extend({messages:z(du),modelPreferences:ou.optional(),systemPrompt:P().optional(),includeContext:Ts([`none`,`thisServer`,`allServers`]).optional(),temperature:I().optional(),maxTokens:I().int(),stopSequences:z(P()).optional(),metadata:K.optional(),tools:z(ql).optional(),toolChoice:su.optional()}),pu=q.extend({method:W(`sampling/createMessage`),params:fu}),mu=J.extend({model:P(),stopReason:G(Ts([`endTurn`,`stopSequence`,`maxTokens`]).or(P())),role:ul,content:lu}),hu=J.extend({model:P(),stopReason:G(Ts([`endTurn`,`stopSequence`,`maxTokens`,`toolUse`]).or(P())),role:ul,content:H([uu,z(uu)])}),gu=B({type:W(`boolean`),title:P().optional(),description:P().optional(),default:L().optional()}),_u=B({type:W(`string`),title:P().optional(),description:P().optional(),minLength:I().optional(),maxLength:I().optional(),format:Ts([`email`,`uri`,`date`,`date-time`]).optional(),default:P().optional()}),vu=B({type:Ts([`number`,`integer`]),title:P().optional(),description:P().optional(),minimum:I().optional(),maximum:I().optional(),default:I().optional()}),yu=B({type:W(`string`),title:P().optional(),description:P().optional(),enum:z(P()),default:P().optional()}),bu=B({type:W(`string`),title:P().optional(),description:P().optional(),oneOf:z(B({const:P(),title:P()})),default:P().optional()}),xu=H([H([B({type:W(`string`),title:P().optional(),description:P().optional(),enum:z(P()),enumNames:z(P()).optional(),default:P().optional()}),H([yu,bu]),H([B({type:W(`array`),title:P().optional(),description:P().optional(),minItems:I().optional(),maxItems:I().optional(),items:B({type:W(`string`),enum:z(P())}),default:z(P()).optional()}),B({type:W(`array`),title:P().optional(),description:P().optional(),minItems:I().optional(),maxItems:I().optional(),items:B({anyOf:z(B({const:P(),title:P()}))}),default:z(P()).optional()})])]),gu,_u,vu]),Su=H([dc.extend({mode:W(`form`).optional(),message:P(),requestedSchema:B({type:W(`object`),properties:U(P(),xu),required:z(P()).optional()})}),dc.extend({mode:W(`url`),message:P(),elicitationId:P(),url:P().url()})]),Cu=q.extend({method:W(`elicitation/create`),params:Su}),wu=pc.extend({elicitationId:P()}),Tu=mc.extend({method:W(`notifications/elicitation/complete`),params:wu}),Eu=J.extend({action:Ts([`accept`,`decline`,`cancel`]),content:Zs(e=>e===null?void 0:e,U(P(),H([P(),I(),L(),z(P())])).optional())}),Du=B({type:W(`ref/resource`),uri:P()}),Ou=B({type:W(`ref/prompt`),name:P()}),ku=uc.extend({ref:H([Ou,Du]),argument:B({name:P(),value:P()}),context:B({arguments:U(P(),P()).optional()}).optional()}),Au=q.extend({method:W(`completion/complete`),params:ku}),ju=J.extend({completion:V({values:z(P()).max(100),total:G(I().int()),hasMore:G(L())})}),Mu=B({uri:P().startsWith(`file://`),name:P().optional(),_meta:U(P(),R()).optional()}),Nu=q.extend({method:W(`roots/list`),params:uc.optional()}),Pu=J.extend({roots:z(Mu)}),Fu=mc.extend({method:W(`notifications/roots/list_changed`),params:pc.optional()});H([Vc,Ic,Au,ru,Pl,jl,ml,gl,bl,wl,El,Ql,Jl,$c,tl,nl,il]),H([Dc,Wc,zc,Fu,Qc]),H([Tc,mu,hu,Eu,Pu,el,rl,Xc]),H([Vc,pu,Cu,Nu,$c,tl,nl,il]),H([Dc,Wc,au,Ol,Sl,$l,Wl,Qc,Tu]),H([Tc,Rc,ju,Ul,Ml,hl,_l,xl,Xl,Yl,el,rl,Xc]);var X=class e extends Error{constructor(e,t,n){super(`MCP error ${e}: ${t}`),this.code=e,this.data=n,this.name=`McpError`}static fromError(t,n,r){if(t===Y.UrlElicitationRequired&&r){let e=r;if(e.elicitations)return new Iu(e.elicitations,n)}return new e(t,n,r)}},Iu=class extends X{constructor(e,t=`URL elicitation${e.length>1?`s`:``} required`){super(Y.UrlElicitationRequired,t,{elicitations:e})}get elicitations(){return this.data?.elicitations??[]}};function Lu(e){return!!e._zod}function Ru(e,t){return Lu(e)?ut(e,t):e.safeParse(t)}function zu(e){if(!e)return;let t;if(t=Lu(e)?e._zod?.def?.shape:e.shape,t){if(typeof t==`function`)try{return t()}catch{return}return t}}function Bu(e){if(Lu(e)){let t=e._zod?.def;if(t){if(t.value!==void 0)return t.value;if(Array.isArray(t.values)&&t.values.length>0)return t.values[0]}}let t=e._def;if(t){if(t.value!==void 0)return t.value;if(Array.isArray(t.values)&&t.values.length>0)return t.values[0]}let n=e.value;if(n!==void 0)return n}function Vu(e){return e===`completed`||e===`failed`||e===`cancelled`}function Hu(e){let t=zu(e)?.method;if(!t)throw Error(`Schema is missing a method literal`);let n=Bu(t);if(typeof n!=`string`)throw Error(`Schema method literal must be a string`);return n}function Uu(e,t){let n=Ru(e,t);if(!n.success)throw n.error;return n.data}var Wu=class{constructor(e){this._options=e,this._requestMessageId=0,this._requestHandlers=new Map,this._requestHandlerAbortControllers=new Map,this._notificationHandlers=new Map,this._responseHandlers=new Map,this._progressHandlers=new Map,this._timeoutInfo=new Map,this._pendingDebouncedNotifications=new Set,this._taskProgressTokens=new Map,this._requestResolvers=new Map,this.setNotificationHandler(Dc,e=>{this._oncancel(e)}),this.setNotificationHandler(Wc,e=>{this._onprogress(e)}),this.setRequestHandler(Vc,e=>({})),this._taskStore=e?.taskStore,this._taskMessageQueue=e?.taskMessageQueue,this._taskStore&&(this.setRequestHandler($c,async(e,t)=>{let n=await this._taskStore.getTask(e.params.taskId,t.sessionId);if(!n)throw new X(Y.InvalidParams,`Failed to retrieve task: Task not found`);return{...n}}),this.setRequestHandler(tl,async(e,t)=>{let n=async()=>{let r=e.params.taskId;if(this._taskMessageQueue){let e;for(;e=await this._taskMessageQueue.dequeue(r,t.sessionId);){if(e.type===`response`||e.type===`error`){let t=e.message,n=t.id,r=this._requestResolvers.get(n);if(r){if(this._requestResolvers.delete(n),e.type===`response`)r(t);else{let e=t;r(new X(e.error.code,e.error.message,e.error.data))}}else{let t=e.type===`response`?`Response`:`Error`;this._onerror(Error(`${t} handler missing for request ${n}`))}continue}await this._transport?.send(e.message,{relatedRequestId:t.requestId})}}let i=await this._taskStore.getTask(r,t.sessionId);if(!i)throw new X(Y.InvalidParams,`Task not found: ${r}`);if(!Vu(i.status))return await this._waitForTaskUpdate(r,t.signal),await n();if(Vu(i.status)){let e=await this._taskStore.getTaskResult(r,t.sessionId);return this._clearTaskQueue(r),{...e,_meta:{...e._meta,[ic]:{taskId:r}}}}return await n()};return await n()}),this.setRequestHandler(nl,async(e,t)=>{try{let{tasks:n,nextCursor:r}=await this._taskStore.listTasks(e.params?.cursor,t.sessionId);return{tasks:n,nextCursor:r,_meta:{}}}catch(e){throw new X(Y.InvalidParams,`Failed to list tasks: ${e instanceof Error?e.message:String(e)}`)}}),this.setRequestHandler(il,async(e,t)=>{try{let n=await this._taskStore.getTask(e.params.taskId,t.sessionId);if(!n)throw new X(Y.InvalidParams,`Task not found: ${e.params.taskId}`);if(Vu(n.status))throw new X(Y.InvalidParams,`Cannot cancel task in terminal status: ${n.status}`);await this._taskStore.updateTaskStatus(e.params.taskId,`cancelled`,`Client cancelled task execution.`,t.sessionId),this._clearTaskQueue(e.params.taskId);let r=await this._taskStore.getTask(e.params.taskId,t.sessionId);if(!r)throw new X(Y.InvalidParams,`Task not found after cancellation: ${e.params.taskId}`);return{_meta:{},...r}}catch(e){throw e instanceof X?e:new X(Y.InvalidRequest,`Failed to cancel task: ${e instanceof Error?e.message:String(e)}`)}}))}async _oncancel(e){e.params.requestId&&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),X.fromError(Y.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){if(this._transport)throw Error(`Already connected to a transport. Call close() before connecting to a new transport, or use a separate Protocol instance per connection.`);this._transport=e;let t=this.transport?.onclose;this._transport.onclose=()=>{t?.(),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),xc(e)||Cc(e)?this._onresponse(e):_c(e)?this._onrequest(e,t):yc(e)?this._onnotification(e):this._onerror(Error(`Unknown message type: ${JSON.stringify(e)}`))},await this._transport.start()}_onclose(){let e=this._responseHandlers;this._responseHandlers=new Map,this._progressHandlers.clear(),this._taskProgressTokens.clear(),this._pendingDebouncedNotifications.clear();for(let e of this._timeoutInfo.values())clearTimeout(e.timeoutId);this._timeoutInfo.clear();for(let e of this._requestHandlerAbortControllers.values())e.abort();this._requestHandlerAbortControllers.clear();let t=X.fromError(Y.ConnectionClosed,`Connection closed`);this._transport=void 0,this.onclose?.();for(let n of e.values())n(t)}_onerror(e){this.onerror?.(e)}_onnotification(e){let t=this._notificationHandlers.get(e.method)??this.fallbackNotificationHandler;t!==void 0&&Promise.resolve().then(()=>t(e)).catch(e=>this._onerror(Error(`Uncaught error in notification handler: ${e}`)))}_onrequest(e,t){let n=this._requestHandlers.get(e.method)??this.fallbackRequestHandler,r=this._transport,i=e.params?._meta?.[ic]?.taskId;if(n===void 0){let t={jsonrpc:`2.0`,id:e.id,error:{code:Y.MethodNotFound,message:`Method not found`}};i&&this._taskMessageQueue?this._enqueueTaskMessage(i,{type:`error`,message:t,timestamp:Date.now()},r?.sessionId).catch(e=>this._onerror(Error(`Failed to enqueue error response: ${e}`))):r?.send(t).catch(e=>this._onerror(Error(`Failed to send an error response: ${e}`)));return}let a=new AbortController;this._requestHandlerAbortControllers.set(e.id,a);let o=fc(e.params)?e.params.task:void 0,s=this._taskStore?this.requestTaskStore(e,r?.sessionId):void 0,c={signal:a.signal,sessionId:r?.sessionId,_meta:e.params?._meta,sendNotification:async t=>{if(a.signal.aborted)return;let n={relatedRequestId:e.id};i&&(n.relatedTask={taskId:i}),await this.notification(t,n)},sendRequest:async(t,n,r)=>{if(a.signal.aborted)throw new X(Y.ConnectionClosed,`Request was cancelled`);let o={...r,relatedRequestId:e.id};i&&!o.relatedTask&&(o.relatedTask={taskId:i});let c=o.relatedTask?.taskId??i;return c&&s&&await s.updateTaskStatus(c,`input_required`),await this.request(t,n,o)},authInfo:t?.authInfo,requestId:e.id,requestInfo:t?.requestInfo,taskId:i,taskStore:s,taskRequestedTtl:o?.ttl,closeSSEStream:t?.closeSSEStream,closeStandaloneSSEStream:t?.closeStandaloneSSEStream};Promise.resolve().then(()=>{o&&this.assertTaskHandlerCapability(e.method)}).then(()=>n(e,c)).then(async t=>{if(a.signal.aborted)return;let n={result:t,jsonrpc:`2.0`,id:e.id};i&&this._taskMessageQueue?await this._enqueueTaskMessage(i,{type:`response`,message:n,timestamp:Date.now()},r?.sessionId):await r?.send(n)},async t=>{if(a.signal.aborted)return;let n={jsonrpc:`2.0`,id:e.id,error:{code:Number.isSafeInteger(t.code)?t.code:Y.InternalError,message:t.message??`Internal error`,...t.data!==void 0&&{data:t.data}}};i&&this._taskMessageQueue?await this._enqueueTaskMessage(i,{type:`error`,message:n,timestamp:Date.now()},r?.sessionId):await r?.send(n)}).catch(e=>this._onerror(Error(`Failed to send response: ${e}`))).finally(()=>{this._requestHandlerAbortControllers.get(e.id)===a&&this._requestHandlerAbortControllers.delete(e.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._requestResolvers.get(t);if(n){this._requestResolvers.delete(t),xc(e)?n(e):n(new X(e.error.code,e.error.message,e.error.data));return}let r=this._responseHandlers.get(t);if(r===void 0){this._onerror(Error(`Received a response for an unknown message ID: ${JSON.stringify(e)}`));return}this._responseHandlers.delete(t),this._cleanupTimeout(t);let i=!1;if(xc(e)&&e.result&&typeof e.result==`object`){let n=e.result;if(n.task&&typeof n.task==`object`){let e=n.task;typeof e.taskId==`string`&&(i=!0,this._taskProgressTokens.set(e.taskId,t))}}i||this._progressHandlers.delete(t),xc(e)?r(e):r(X.fromError(e.error.code,e.error.message,e.error.data))}get transport(){return this._transport}async close(){await this._transport?.close()}async*requestStream(e,t,n){let{task:r}=n??{};if(!r){try{yield{type:`result`,result:await this.request(e,t,n)}}catch(e){yield{type:`error`,error:e instanceof X?e:new X(Y.InternalError,String(e))}}return}let i;try{let r=await this.request(e,Xc,n);if(r.task)i=r.task.taskId,yield{type:`taskCreated`,task:r.task};else throw new X(Y.InternalError,`Task creation did not return a task`);for(;;){let e=await this.getTask({taskId:i},n);if(yield{type:`taskStatus`,task:e},Vu(e.status)){e.status===`completed`?yield{type:`result`,result:await this.getTaskResult({taskId:i},t,n)}:e.status===`failed`?yield{type:`error`,error:new X(Y.InternalError,`Task ${i} failed`)}:e.status===`cancelled`&&(yield{type:`error`,error:new X(Y.InternalError,`Task ${i} was cancelled`)});return}if(e.status===`input_required`){yield{type:`result`,result:await this.getTaskResult({taskId:i},t,n)};return}let r=e.pollInterval??this._options?.defaultTaskPollInterval??1e3;await new Promise(e=>setTimeout(e,r)),n?.signal?.throwIfAborted()}}catch(e){yield{type:`error`,error:e instanceof X?e:new X(Y.InternalError,String(e))}}}request(e,t,n){let{relatedRequestId:r,resumptionToken:i,onresumptiontoken:a,task:o,relatedTask:s}=n??{};return new Promise((c,l)=>{let u=e=>{l(e)};if(!this._transport){u(Error(`Not connected`));return}if(this._options?.enforceStrictCapabilities===!0)try{this.assertCapabilityForMethod(e.method),o&&this.assertTaskCapability(e.method)}catch(e){u(e);return}n?.signal?.throwIfAborted();let d=this._requestMessageId++,f={...e,jsonrpc:`2.0`,id:d};n?.onprogress&&(this._progressHandlers.set(d,n.onprogress),f.params={...e.params,_meta:{...e.params?._meta||{},progressToken:d}}),o&&(f.params={...f.params,task:o}),s&&(f.params={...f.params,_meta:{...f.params?._meta||{},[ic]:s}});let p=e=>{this._responseHandlers.delete(d),this._progressHandlers.delete(d),this._cleanupTimeout(d),this._transport?.send({jsonrpc:`2.0`,method:`notifications/cancelled`,params:{requestId:d,reason:String(e)}},{relatedRequestId:r,resumptionToken:i,onresumptiontoken:a}).catch(e=>this._onerror(Error(`Failed to send cancellation: ${e}`))),l(e instanceof X?e:new X(Y.RequestTimeout,String(e)))};this._responseHandlers.set(d,e=>{if(!n?.signal?.aborted){if(e instanceof Error)return l(e);try{let n=Ru(t,e.result);n.success?c(n.data):l(n.error)}catch(e){l(e)}}}),n?.signal?.addEventListener(`abort`,()=>{p(n?.signal?.reason)});let m=n?.timeout??6e4;this._setupTimeout(d,m,n?.maxTotalTimeout,()=>p(X.fromError(Y.RequestTimeout,`Request timed out`,{timeout:m})),n?.resetTimeoutOnProgress??!1);let h=s?.taskId;h?(this._requestResolvers.set(d,e=>{let t=this._responseHandlers.get(d);t?t(e):this._onerror(Error(`Response handler missing for side-channeled request ${d}`))}),this._enqueueTaskMessage(h,{type:`request`,message:f,timestamp:Date.now()}).catch(e=>{this._cleanupTimeout(d),l(e)})):this._transport.send(f,{relatedRequestId:r,resumptionToken:i,onresumptiontoken:a}).catch(e=>{this._cleanupTimeout(d),l(e)})})}async getTask(e,t){return this.request({method:`tasks/get`,params:e},el,t)}async getTaskResult(e,t,n){return this.request({method:`tasks/result`,params:e},t,n)}async listTasks(e,t){return this.request({method:`tasks/list`,params:e},rl,t)}async cancelTask(e,t){return this.request({method:`tasks/cancel`,params:e},al,t)}async notification(e,t){if(!this._transport)throw Error(`Not connected`);this.assertNotificationCapability(e.method);let n=t?.relatedTask?.taskId;if(n){let r={...e,jsonrpc:`2.0`,params:{...e.params,_meta:{...e.params?._meta||{},[ic]:t.relatedTask}}};await this._enqueueTaskMessage(n,{type:`notification`,message:r,timestamp:Date.now()});return}if((this._options?.debouncedNotificationMethods??[]).includes(e.method)&&!e.params&&!t?.relatedRequestId&&!t?.relatedTask){if(this._pendingDebouncedNotifications.has(e.method))return;this._pendingDebouncedNotifications.add(e.method),Promise.resolve().then(()=>{if(this._pendingDebouncedNotifications.delete(e.method),!this._transport)return;let n={...e,jsonrpc:`2.0`};t?.relatedTask&&(n={...n,params:{...n.params,_meta:{...n.params?._meta||{},[ic]:t.relatedTask}}}),this._transport?.send(n,t).catch(e=>this._onerror(e))});return}let r={...e,jsonrpc:`2.0`};t?.relatedTask&&(r={...r,params:{...r.params,_meta:{...r.params?._meta||{},[ic]:t.relatedTask}}}),await this._transport.send(r,t)}setRequestHandler(e,t){let n=Hu(e);this.assertRequestHandlerCapability(n),this._requestHandlers.set(n,(n,r)=>{let i=Uu(e,n);return Promise.resolve(t(i,r))})}removeRequestHandler(e){this._requestHandlers.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){let n=Hu(e);this._notificationHandlers.set(n,n=>{let r=Uu(e,n);return Promise.resolve(t(r))})}removeNotificationHandler(e){this._notificationHandlers.delete(e)}_cleanupTaskProgressHandler(e){let t=this._taskProgressTokens.get(e);t!==void 0&&(this._progressHandlers.delete(t),this._taskProgressTokens.delete(e))}async _enqueueTaskMessage(e,t,n){if(!this._taskStore||!this._taskMessageQueue)throw Error(`Cannot enqueue task message: taskStore and taskMessageQueue are not configured`);let r=this._options?.maxTaskQueueSize;await this._taskMessageQueue.enqueue(e,t,n,r)}async _clearTaskQueue(e,t){if(this._taskMessageQueue){let n=await this._taskMessageQueue.dequeueAll(e,t);for(let t of n)if(t.type===`request`&&_c(t.message)){let n=t.message.id,r=this._requestResolvers.get(n);r?(r(new X(Y.InternalError,`Task cancelled or completed`)),this._requestResolvers.delete(n)):this._onerror(Error(`Resolver missing for request ${n} during task ${e} cleanup`))}}}async _waitForTaskUpdate(e,t){let n=this._options?.defaultTaskPollInterval??1e3;try{let t=await this._taskStore?.getTask(e);t?.pollInterval&&(n=t.pollInterval)}catch{}return new Promise((e,r)=>{if(t.aborted){r(new X(Y.InvalidRequest,`Request cancelled`));return}let i=setTimeout(e,n);t.addEventListener(`abort`,()=>{clearTimeout(i),r(new X(Y.InvalidRequest,`Request cancelled`))},{once:!0})})}requestTaskStore(e,t){let n=this._taskStore;if(!n)throw Error(`No task store configured`);return{createTask:async r=>{if(!e)throw Error(`No request provided`);return await n.createTask(r,e.id,{method:e.method,params:e.params},t)},getTask:async e=>{let r=await n.getTask(e,t);if(!r)throw new X(Y.InvalidParams,`Failed to retrieve task: Task not found`);return r},storeTaskResult:async(e,r,i)=>{await n.storeTaskResult(e,r,i,t);let a=await n.getTask(e,t);if(a){let t=Qc.parse({method:`notifications/tasks/status`,params:a});await this.notification(t),Vu(a.status)&&this._cleanupTaskProgressHandler(e)}},getTaskResult:e=>n.getTaskResult(e,t),updateTaskStatus:async(e,r,i)=>{let a=await n.getTask(e,t);if(!a)throw new X(Y.InvalidParams,`Task "${e}" not found - it may have been cleaned up`);if(Vu(a.status))throw new X(Y.InvalidParams,`Cannot update task "${e}" from terminal status "${a.status}" to "${r}". Terminal states (completed, failed, cancelled) cannot transition to other states.`);await n.updateTaskStatus(e,r,i,t);let o=await n.getTask(e,t);if(o){let t=Qc.parse({method:`notifications/tasks/status`,params:o});await this.notification(t),Vu(o.status)&&this._cleanupTaskProgressHandler(e)}},listTasks:e=>n.listTasks(e,t)}}};function Gu(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function Ku(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]=Gu(a)&&Gu(i)?{...a,...i}:i}return n}(e=>typeof a<`u`?a:typeof Proxy<`u`?new Proxy(e,{get:(e,t)=>(typeof a<`u`?a:e)[t]}):e)(function(e){if(typeof a<`u`)return a.apply(this,arguments);throw Error(`Dynamic require of "`+e+`" is not supported`)});var qu=class extends Wu{_registeredMethods=new Set;_eventSlots=new Map;onEventDispatch(e,t){}_ensureEventSlot(e){let t=this._eventSlots.get(e);if(!t){let n=this.eventSchemas[e];if(!n)throw Error(`Unknown event: ${String(e)}`);t={listeners:[]},this._eventSlots.set(e,t);let r=n.shape.method.value;this._registeredMethods.add(r);let i=t;super.setNotificationHandler(n,t=>{let n=t.params;this.onEventDispatch(e,n),i.onHandler?.(n);for(let e of[...i.listeners])e(n)})}return t}setEventHandler(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}getEventHandler(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)}setRequestHandler=(e,t)=>{this._assertMethodNotRegistered(e,`setRequestHandler`),super.setRequestHandler(e,t)};setNotificationHandler=(e,t)=>{this._assertMethodNotRegistered(e,`setNotificationHandler`),super.setNotificationHandler(e,t)};warnIfRequestHandlerReplaced(e,t,n){t&&n&&console.warn(`[MCP Apps] ${e} handler replaced. Previous handler will no longer be called.`)}replaceRequestHandler=(e,t)=>{let n=e.shape.method.value;this._registeredMethods.add(n),super.setRequestHandler(e,t)};_assertMethodNotRegistered(e,t){let n=e.shape.method.value;if(this._registeredMethods.has(n))throw Error(`Handler for "${n}" already registered (via ${t}). Use addEventListener() to attach multiple listeners, or the on* setter for replace semantics.`);this._registeredMethods.add(n)}},Ju=`2026-01-26`,Yu=H([W(`light`),W(`dark`)]).describe(`Color theme preference for the host environment.`),Xu=H([W(`inline`),W(`fullscreen`),W(`pip`)]).describe(`Display mode for UI presentation.`),Zu=U(H([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.`).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([P(),cs()]).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.`),Qu=B({method:W(`ui/open-link`),params:B({url:P().describe(`URL to open in the host's browser`)})});B({isError:L().optional().describe(`True if the host failed to open the URL (e.g., due to security policy).`)}).passthrough(),B({isError:L().optional().describe(`True if the download failed (e.g., user cancelled or host denied).`)}).passthrough(),B({isError:L().optional().describe(`True if the host rejected or failed to deliver the message.`)}).passthrough();var $u=B({method:W(`ui/notifications/sandbox-proxy-ready`),params:B({})}),ed=B({connectDomains:z(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:z(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:z(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:z(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'`)")}),td=B({camera:B({}).optional().describe(`Request camera access. + +Maps to Permission Policy \`camera\` feature.`),microphone:B({}).optional().describe(`Request microphone access. + +Maps to Permission Policy \`microphone\` feature.`),geolocation:B({}).optional().describe(`Request geolocation access. + +Maps to Permission Policy \`geolocation\` feature.`),clipboardWrite:B({}).optional().describe(`Request clipboard write access. + +Maps to Permission Policy \`clipboard-write\` feature.`)}),nd=B({method:W(`ui/notifications/size-changed`),params:B({width:I().optional().describe(`New width in pixels.`),height:I().optional().describe(`New height in pixels.`)})});B({method:W(`ui/notifications/tool-input`),params:B({arguments:U(P(),R().describe(`Complete tool call arguments as key-value pairs.`)).optional().describe(`Complete tool call arguments as key-value pairs.`)})}),B({method:W(`ui/notifications/tool-input-partial`),params:B({arguments:U(P(),R().describe(`Partial tool call arguments (incomplete, may change).`)).optional().describe(`Partial tool call arguments (incomplete, may change).`)})}),B({method:W(`ui/notifications/tool-cancelled`),params:B({reason:P().optional().describe(`Optional reason for the cancellation (e.g., "user action", "timeout").`)})});var rd=B({fonts:P().optional()}),id=B({variables:Zu.optional().describe(`CSS variables for theming the app.`),css:rd.optional().describe(`CSS blocks that apps can inject.`)});B({method:W(`ui/resource-teardown`),params:B({})});var ad=U(P(),R()),od=B({text:B({}).optional().describe(`Host supports text content blocks.`),image:B({}).optional().describe(`Host supports image content blocks.`),audio:B({}).optional().describe(`Host supports audio content blocks.`),resource:B({}).optional().describe(`Host supports resource content blocks.`),resourceLink:B({}).optional().describe(`Host supports resource link content blocks.`),structuredContent:B({}).optional().describe(`Host supports structured content.`)}),sd=B({method:W(`ui/notifications/request-teardown`),params:B({}).optional()}),cd=B({experimental:U(P(),U(P(),fs()).describe(`Experimental features keyed by identifier.`)).optional().describe(`Experimental features keyed by identifier.`),openLinks:B({}).optional().describe(`Host supports opening external URLs.`),downloadFile:B({}).optional().describe(`Host supports file downloads via ui/download-file.`),serverTools:B({listChanged:L().optional().describe(`Host supports tools/list_changed notifications.`)}).optional().describe(`Host can proxy tool calls to the MCP server.`),serverResources:B({listChanged:L().optional().describe(`Host supports resources/list_changed notifications.`)}).optional().describe(`Host can proxy resource reads to the MCP server.`),logging:B({}).optional().describe(`Host accepts log messages.`),sandbox:B({permissions:td.optional().describe(`Permissions granted by the host (camera, microphone, geolocation).`),csp:ed.optional().describe(`CSP domains approved by the host.`)}).optional().describe(`Sandbox configuration applied by the host.`),updateModelContext:od.optional().describe(`Host accepts context updates (ui/update-model-context) to be included in the model's context for future turns.`),message:od.optional().describe(`Host supports receiving content messages (ui/message) from the view.`),sampling:B({tools:B({}).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.")}),ld=B({experimental:U(P(),U(P(),fs()).describe(`Experimental features keyed by identifier.`)).optional().describe(`Experimental features keyed by identifier.`),tools:B({listChanged:L().optional().describe(`App supports tools/list_changed notifications.`)}).optional().describe(`App exposes MCP-style tools that the host can call.`),availableDisplayModes:z(Xu).optional().describe(`Display modes the app supports.`)}),ud=B({method:W(`ui/notifications/initialized`),params:B({}).optional()});B({csp:ed.optional().describe(`Content Security Policy configuration for UI resources.`),permissions:td.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:L().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 dd=B({method:W(`ui/request-display-mode`),params:B({mode:Xu.describe(`The display mode being requested.`)})});B({mode:Xu.describe(`The display mode that was actually set. May differ from requested if not supported.`)}).passthrough();var fd=H([W(`model`),W(`app`)]).describe(`Tool visibility scope - who can access the tool.`);B({resourceUri:P().optional(),visibility:z(fd).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:hs().optional(),permissions:hs().optional()}),B({mimeTypes:z(P()).optional().describe('Array of supported MIME types for UI resources.\nMust include `"text/html;profile=mcp-app"` for MCP Apps support.')});var pd=B({method:W(`ui/download-file`),params:B({contents:z(H([zl,Bl])).describe(`Resource contents to download — embedded (inline data) or linked (host fetches). Uses standard MCP resource types.`)})}),md=B({method:W(`ui/message`),params:B({role:W(`user`).describe(`Message role, currently only "user" is supported.`),content:z(Vl).describe(`Message content blocks (text, image, etc.).`)})});B({method:W(`ui/notifications/sandbox-resource-ready`),params:B({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:ed.optional().describe(`CSP configuration from resource metadata.`),permissions:td.optional().describe(`Sandbox permissions from resource metadata.`)})}),B({method:W(`ui/notifications/tool-result`),params:Xl.describe(`Standard MCP tool execution result.`)});var hd=B({toolInfo:B({id:hc.optional().describe(`JSON-RPC id of the tools/call request.`),tool:ql.describe(`Tool definition including name, inputSchema, etc.`)}).optional().describe(`Metadata of the tool call that instantiated this App.`),theme:Yu.optional().describe(`Current color theme preference.`),styles:id.optional().describe(`Style configuration for theming the app.`),displayMode:Xu.optional().describe(`How the UI is currently displayed.`),availableDisplayModes:z(Xu).optional().describe(`Display modes the host supports.`),containerDimensions:H([B({height:I().describe(`Fixed container height in pixels.`)}),B({maxHeight:H([I(),cs()]).optional().describe(`Maximum container height in pixels.`)})]).and(H([B({width:I().describe(`Fixed container width in pixels.`)}),B({maxWidth:H([I(),cs()]).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:H([W(`web`),W(`desktop`),W(`mobile`)]).optional().describe(`Platform type for responsive design decisions.`),deviceCapabilities:B({touch:L().optional().describe(`Whether the device supports touch input.`),hover:L().optional().describe(`Whether the device supports hover interactions.`)}).optional().describe(`Device input capabilities.`),safeAreaInsets:B({top:I().describe(`Top safe area inset in pixels.`),right:I().describe(`Right safe area inset in pixels.`),bottom:I().describe(`Bottom safe area inset in pixels.`),left:I().describe(`Left safe area inset in pixels.`)}).optional().describe(`Mobile safe area boundaries in pixels.`)}).passthrough();B({method:W(`ui/notifications/host-context-changed`),params:hd.describe(`Partial context update containing only changed fields.`)});var gd=B({method:W(`ui/update-model-context`),params:B({content:z(Vl).optional().describe(`Context content blocks (text, image, etc.).`),structuredContent:U(P(),R().describe(`Structured content for machine-readable context data.`)).optional().describe(`Structured content for machine-readable context data.`)})}),_d=B({method:W(`ui/initialize`),params:B({appInfo:Ac.describe(`App identification (name and version).`),appCapabilities:ld.describe(`Features and capabilities this app provides.`),protocolVersion:P().describe(`Protocol version this app supports.`)})});B({protocolVersion:P().describe(`Negotiated protocol version string (e.g., "2025-11-21").`),hostInfo:Ac.describe(`Host application identification and version.`),hostCapabilities:cd.describe(`Features and capabilities provided by the host.`),hostContext:hd.describe(`Rich context about the host environment.`)}).passthrough();var vd=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=wc.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},yd=[Ju],bd=class extends qu{_client;_hostInfo;_capabilities;_appCapabilities;_hostContext={};_appInfo;_initializedReceived=!1;_baseReplaceRequestHandler=this.replaceRequestHandler;replaceRequestHandler=(e,t)=>{this._baseReplaceRequestHandler(e,(e,n)=>(this._initializedReceived||console.warn(`[ext-apps] AppBridge received '${e.method}' before ui/notifications/initialized. The View is calling host methods before completing the handshake; it should await app.connect() first.`),t(e,n)))};eventSchemas={sizechange:nd,sandboxready:$u,initialized:ud,requestteardown:sd,loggingmessage:au};constructor(e,t,n,r){super(r),this._client=e,this._hostInfo=t,this._capabilities=n,this.addEventListener(`initialized`,()=>{this._initializedReceived=!0}),this._hostContext=r?.hostContext||{},this.setRequestHandler(_d,e=>this._oninitialize(e)),this.setRequestHandler(Vc,(e,t)=>(this.onping?.(e.params,t),{})),this.replaceRequestHandler(dd,e=>({mode:this._hostContext.displayMode??`inline`}))}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(md,async(e,t)=>{if(!this._onmessage)throw Error(`No onmessage handler set`);return this._onmessage(e.params,t)})}_onopenlink;get onopenlink(){return this._onopenlink}set onopenlink(e){this.warnIfRequestHandlerReplaced(`onopenlink`,this._onopenlink,e),this._onopenlink=e,this.replaceRequestHandler(Qu,async(e,t)=>{if(!this._onopenlink)throw Error(`No onopenlink handler set`);return this._onopenlink(e.params,t)})}_ondownloadfile;get ondownloadfile(){return this._ondownloadfile}set ondownloadfile(e){this.warnIfRequestHandlerReplaced(`ondownloadfile`,this._ondownloadfile,e),this._ondownloadfile=e,this.replaceRequestHandler(pd,async(e,t)=>{if(!this._ondownloadfile)throw Error(`No ondownloadfile handler set`);return this._ondownloadfile(e.params,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(dd,async(e,t)=>{if(!this._onrequestdisplaymode)throw Error(`No onrequestdisplaymode handler set`);return this._onrequestdisplaymode(e.params,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(gd,async(e,t)=>{if(!this._onupdatemodelcontext)throw Error(`No onupdatemodelcontext handler set`);return this._onupdatemodelcontext(e.params,t)})}_oncalltool;get oncalltool(){return this._oncalltool}set oncalltool(e){this.warnIfRequestHandlerReplaced(`oncalltool`,this._oncalltool,e),this._oncalltool=e,this.replaceRequestHandler(Ql,async(e,t)=>{if(!this._oncalltool)throw Error(`No oncalltool handler set`);return this._oncalltool(e.params,t)})}set oncreatesamplingmessage(e){this.setRequestHandler(pu,async(t,n)=>e(t.params,n))}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(ml,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(gl,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(bl,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(jl,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})}assertCapabilityForMethod(e){}assertRequestHandlerCapability(e){}assertNotificationCapability(e){}assertTaskCapability(e){throw Error(`Tasks are not supported in MCP Apps`)}assertTaskHandlerCapability(e){throw Error(`Task handlers are not supported in MCP Apps`)}getCapabilities(){return this._capabilities}async _oninitialize(e){let t=e.params.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.params.appCapabilities,this._appInfo=e.params.appInfo,{protocolVersion:yd.includes(t)?t:Ju,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];xd(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},ad,t)}sendResourceTeardown=this.teardownResource;callTool(e,t){return this.request({method:`tools/call`,params:e},Xl,t)}listTools(e,t){return this.request({method:`tools/list`,params:e},Yl,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},Xl,{signal:t.signal}),e.tools.listChanged&&this._client.setNotificationHandler($l,e=>this.sendToolListChanged(e.params))),e.resources&&(this.onlistresources=async(e,t)=>this._client.request({method:`resources/list`,params:e},hl,{signal:t.signal}),this.onlistresourcetemplates=async(e,t)=>this._client.request({method:`resources/templates/list`,params:e},_l,{signal:t.signal}),this.onreadresource=async(e,t)=>this._client.request({method:`resources/read`,params:e},xl,{signal:t.signal}),e.resources.listChanged&&this._client.setNotificationHandler(Sl,e=>this.sendResourceListChanged(e.params))),e.prompts&&(this.onlistprompts=async(e,t)=>this._client.request({method:`prompts/list`,params:e},Ml,{signal:t.signal}),e.prompts.listChanged&&this._client.setNotificationHandler(Wl,e=>this.sendPromptListChanged(e.params)))}return super.connect(e)}};function xd(e,t){return JSON.stringify(e)===JSON.stringify(t)}var Sd=t((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.regexpCode=e.getEsmExportName=e.getProperty=e.safeStringify=e.stringify=e.strConcat=e.addCodeArg=e.str=e._=e.nil=e._Code=e.Name=e.IDENTIFIER=e._CodeOrName=void 0;var t=class{};e._CodeOrName=t,e.IDENTIFIER=/^[a-z$_][a-z$_0-9]*$/i;var n=class extends t{constructor(t){if(super(),!e.IDENTIFIER.test(t))throw Error(`CodeGen: name must be a valid identifier`);this.str=t}toString(){return this.str}emptyStr(){return!1}get names(){return{[this.str]:1}}};e.Name=n;var r=class extends t{constructor(e){super(),this._items=typeof e==`string`?[e]:e}toString(){return this.str}emptyStr(){if(this._items.length>1)return!1;let e=this._items[0];return e===``||e===`""`}get str(){return this._str??=this._items.reduce((e,t)=>`${e}${t}`,``)}get names(){return this._names??=this._items.reduce((e,t)=>(t instanceof n&&(e[t.str]=(e[t.str]||0)+1),e),{})}};e._Code=r,e.nil=new r(``);function i(e,...t){let n=[e[0]],i=0;for(;i{Object.defineProperty(e,"__esModule",{value:!0}),e.ValueScope=e.ValueScopeName=e.Scope=e.varKinds=e.UsedValueState=void 0;var t=Sd(),n=class extends Error{constructor(e){super(`CodeGen: "code" for ${e} not defined`),this.value=e.value}},r;(function(e){e[e.Started=0]=`Started`,e[e.Completed=1]=`Completed`})(r||(e.UsedValueState=r={})),e.varKinds={const:new t.Name(`const`),let:new t.Name(`let`),var:new t.Name(`var`)};var i=class{constructor({prefixes:e,parent:t}={}){this._names={},this._prefixes=e,this._parent=t}toName(e){return e instanceof t.Name?e:this.name(e)}name(e){return new t.Name(this._newName(e))}_newName(e){let t=this._names[e]||this._nameGroup(e);return`${e}${t.index++}`}_nameGroup(e){if((this._parent?._prefixes)?.has(e)||this._prefixes&&!this._prefixes.has(e))throw Error(`CodeGen: prefix "${e}" is not allowed in this scope`);return this._names[e]={prefix:e,index:0}}};e.Scope=i;var a=class extends t.Name{constructor(e,t){super(t),this.prefix=e}setValue(e,{property:n,itemIndex:r}){this.value=e,this.scopePath=(0,t._)`.${new t.Name(n)}[${r}]`}};e.ValueScopeName=a;var o=(0,t._)`\n`;e.ValueScope=class extends i{constructor(e){super(e),this._values={},this._scope=e.scope,this.opts={...e,_n:e.lines?o:t.nil}}get(){return this._scope}name(e){return new a(e,this._newName(e))}value(e,t){if(t.ref===void 0)throw Error(`CodeGen: ref must be passed in value`);let n=this.toName(e),{prefix:r}=n,i=t.key??t.ref,a=this._values[r];if(a){let e=a.get(i);if(e)return e}else a=this._values[r]=new Map;a.set(i,n);let o=this._scope[r]||(this._scope[r]=[]),s=o.length;return o[s]=t.ref,n.setValue(t,{property:r,itemIndex:s}),n}getValue(e,t){let n=this._values[e];if(n)return n.get(t)}scopeRefs(e,n=this._values){return this._reduceValues(n,n=>{if(n.scopePath===void 0)throw Error(`CodeGen: name "${n}" has no value`);return(0,t._)`${e}${n.scopePath}`})}scopeCode(e=this._values,t,n){return this._reduceValues(e,e=>{if(e.value===void 0)throw Error(`CodeGen: name "${e}" has no value`);return e.value.code},t,n)}_reduceValues(i,a,o={},s){let c=t.nil;for(let l in i){let u=i[l];if(!u)continue;let d=o[l]=o[l]||new Map;u.forEach(i=>{if(d.has(i))return;d.set(i,r.Started);let o=a(i);if(o){let n=this.opts.es5?e.varKinds.var:e.varKinds.const;c=(0,t._)`${c}${n} ${i} = ${o};${this.opts._n}`}else if(o=s?.(i))c=(0,t._)`${c}${o}${this.opts._n}`;else throw new n(i);d.set(i,r.Completed)})}return c}}})),Z=t((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.or=e.and=e.not=e.CodeGen=e.operators=e.varKinds=e.ValueScopeName=e.ValueScope=e.Scope=e.Name=e.regexpCode=e.stringify=e.getProperty=e.nil=e.strConcat=e.str=e._=void 0;var t=Sd(),n=Cd(),r=Sd();Object.defineProperty(e,"_",{enumerable:!0,get:function(){return r._}}),Object.defineProperty(e,"str",{enumerable:!0,get:function(){return r.str}}),Object.defineProperty(e,"strConcat",{enumerable:!0,get:function(){return r.strConcat}}),Object.defineProperty(e,"nil",{enumerable:!0,get:function(){return r.nil}}),Object.defineProperty(e,"getProperty",{enumerable:!0,get:function(){return r.getProperty}}),Object.defineProperty(e,"stringify",{enumerable:!0,get:function(){return r.stringify}}),Object.defineProperty(e,"regexpCode",{enumerable:!0,get:function(){return r.regexpCode}}),Object.defineProperty(e,"Name",{enumerable:!0,get:function(){return r.Name}});var i=Cd();Object.defineProperty(e,"Scope",{enumerable:!0,get:function(){return i.Scope}}),Object.defineProperty(e,"ValueScope",{enumerable:!0,get:function(){return i.ValueScope}}),Object.defineProperty(e,"ValueScopeName",{enumerable:!0,get:function(){return i.ValueScopeName}}),Object.defineProperty(e,"varKinds",{enumerable:!0,get:function(){return i.varKinds}}),e.operators={GT:new t._Code(`>`),GTE:new t._Code(`>=`),LT:new t._Code(`<`),LTE:new t._Code(`<=`),EQ:new t._Code(`===`),NEQ:new t._Code(`!==`),NOT:new t._Code(`!`),OR:new t._Code(`||`),AND:new t._Code(`&&`),ADD:new t._Code(`+`)};var a=class{optimizeNodes(){return this}optimizeNames(e,t){return this}},o=class extends a{constructor(e,t,n){super(),this.varKind=e,this.name=t,this.rhs=n}render({es5:e,_n:t}){let r=e?n.varKinds.var:this.varKind,i=this.rhs===void 0?``:` = ${this.rhs}`;return`${r} ${this.name}${i};`+t}optimizeNames(e,t){if(e[this.name.str])return this.rhs&&=T(this.rhs,e,t),this}get names(){return this.rhs instanceof t._CodeOrName?this.rhs.names:{}}},s=class extends a{constructor(e,t,n){super(),this.lhs=e,this.rhs=t,this.sideEffects=n}render({_n:e}){return`${this.lhs} = ${this.rhs};`+e}optimizeNames(e,n){if(!(this.lhs instanceof t.Name&&!e[this.lhs.str]&&!this.sideEffects))return this.rhs=T(this.rhs,e,n),this}get names(){return re(this.lhs instanceof t.Name?{}:{...this.lhs.names},this.rhs)}},c=class extends s{constructor(e,t,n,r){super(e,n,r),this.op=t}render({_n:e}){return`${this.lhs} ${this.op}= ${this.rhs};`+e}},l=class extends a{constructor(e){super(),this.label=e,this.names={}}render({_n:e}){return`${this.label}:`+e}},u=class extends a{constructor(e){super(),this.label=e,this.names={}}render({_n:e}){return`break${this.label?` ${this.label}`:``};`+e}},d=class extends a{constructor(e){super(),this.error=e}render({_n:e}){return`throw ${this.error};`+e}get names(){return this.error.names}},f=class extends a{constructor(e){super(),this.code=e}render({_n:e}){return`${this.code};`+e}optimizeNodes(){return`${this.code}`?this:void 0}optimizeNames(e,t){return this.code=T(this.code,e,t),this}get names(){return this.code instanceof t._CodeOrName?this.code.names:{}}},p=class extends a{constructor(e=[]){super(),this.nodes=e}render(e){return this.nodes.reduce((t,n)=>t+n.render(e),``)}optimizeNodes(){let{nodes:e}=this,t=e.length;for(;t--;){let n=e[t].optimizeNodes();Array.isArray(n)?e.splice(t,1,...n):n?e[t]=n:e.splice(t,1)}return e.length>0?this:void 0}optimizeNames(e,t){let{nodes:n}=this,r=n.length;for(;r--;){let i=n[r];i.optimizeNames(e,t)||(ie(e,i.names),n.splice(r,1))}return n.length>0?this:void 0}get names(){return this.nodes.reduce((e,t)=>w(e,t.names),{})}},m=class extends p{render(e){return`{`+e._n+super.render(e)+`}`+e._n}},h=class extends p{},g=class extends m{};g.kind=`else`;var _=class e extends m{constructor(e,t){super(t),this.condition=e}render(e){let t=`if(${this.condition})`+super.render(e);return this.else&&(t+=`else `+this.else.render(e)),t}optimizeNodes(){super.optimizeNodes();let t=this.condition;if(t===!0)return this.nodes;let n=this.else;if(n){let e=n.optimizeNodes();n=this.else=Array.isArray(e)?new g(e):e}if(n)return t===!1?n instanceof e?n:n.nodes:this.nodes.length?this:new e(ae(t),n instanceof e?[n]:n.nodes);if(t!==!1&&this.nodes.length)return this}optimizeNames(e,t){if(this.else=this.else?.optimizeNames(e,t),super.optimizeNames(e,t)||this.else)return this.condition=T(this.condition,e,t),this}get names(){let e=super.names;return re(e,this.condition),this.else&&w(e,this.else.names),e}};_.kind=`if`;var v=class extends m{};v.kind=`for`;var y=class extends v{constructor(e){super(),this.iteration=e}render(e){return`for(${this.iteration})`+super.render(e)}optimizeNames(e,t){if(super.optimizeNames(e,t))return this.iteration=T(this.iteration,e,t),this}get names(){return w(super.names,this.iteration.names)}},b=class extends v{constructor(e,t,n,r){super(),this.varKind=e,this.name=t,this.from=n,this.to=r}render(e){let t=e.es5?n.varKinds.var:this.varKind,{name:r,from:i,to:a}=this;return`for(${t} ${r}=${i}; ${r}<${a}; ${r}++)`+super.render(e)}get names(){return re(re(super.names,this.from),this.to)}},x=class extends v{constructor(e,t,n,r){super(),this.loop=e,this.varKind=t,this.name=n,this.iterable=r}render(e){return`for(${this.varKind} ${this.name} ${this.loop} ${this.iterable})`+super.render(e)}optimizeNames(e,t){if(super.optimizeNames(e,t))return this.iterable=T(this.iterable,e,t),this}get names(){return w(super.names,this.iterable.names)}},S=class extends m{constructor(e,t,n){super(),this.name=e,this.args=t,this.async=n}render(e){return`${this.async?`async `:``}function ${this.name}(${this.args})`+super.render(e)}};S.kind=`func`;var C=class extends p{render(e){return`return `+super.render(e)}};C.kind=`return`;var ee=class extends m{render(e){let t=`try`+super.render(e);return this.catch&&(t+=this.catch.render(e)),this.finally&&(t+=this.finally.render(e)),t}optimizeNodes(){var e,t;return super.optimizeNodes(),(e=this.catch)==null||e.optimizeNodes(),(t=this.finally)==null||t.optimizeNodes(),this}optimizeNames(e,t){var n,r;return super.optimizeNames(e,t),(n=this.catch)==null||n.optimizeNames(e,t),(r=this.finally)==null||r.optimizeNames(e,t),this}get names(){let e=super.names;return this.catch&&w(e,this.catch.names),this.finally&&w(e,this.finally.names),e}},te=class extends m{constructor(e){super(),this.error=e}render(e){return`catch(${this.error})`+super.render(e)}};te.kind=`catch`;var ne=class extends m{render(e){return`finally`+super.render(e)}};ne.kind=`finally`,e.CodeGen=class{constructor(e,t={}){this._values={},this._blockStarts=[],this._constants={},this.opts={...t,_n:t.lines?` +`:``},this._extScope=e,this._scope=new n.Scope({parent:e}),this._nodes=[new h]}toString(){return this._root.render(this.opts)}name(e){return this._scope.name(e)}scopeName(e){return this._extScope.name(e)}scopeValue(e,t){let n=this._extScope.value(e,t);return(this._values[n.prefix]||(this._values[n.prefix]=new Set)).add(n),n}getScopeValue(e,t){return this._extScope.getValue(e,t)}scopeRefs(e){return this._extScope.scopeRefs(e,this._values)}scopeCode(){return this._extScope.scopeCode(this._values)}_def(e,t,n,r){let i=this._scope.toName(t);return n!==void 0&&r&&(this._constants[i.str]=n),this._leafNode(new o(e,i,n)),i}const(e,t,r){return this._def(n.varKinds.const,e,t,r)}let(e,t,r){return this._def(n.varKinds.let,e,t,r)}var(e,t,r){return this._def(n.varKinds.var,e,t,r)}assign(e,t,n){return this._leafNode(new s(e,t,n))}add(t,n){return this._leafNode(new c(t,e.operators.ADD,n))}code(e){return typeof e==`function`?e():e!==t.nil&&this._leafNode(new f(e)),this}object(...e){let n=[`{`];for(let[r,i]of e)n.length>1&&n.push(`,`),n.push(r),(r!==i||this.opts.es5)&&(n.push(`:`),(0,t.addCodeArg)(n,i));return n.push(`}`),new t._Code(n)}if(e,t,n){if(this._blockNode(new _(e)),t&&n)this.code(t).else().code(n).endIf();else if(t)this.code(t).endIf();else if(n)throw Error(`CodeGen: "else" body without "then" body`);return this}elseIf(e){return this._elseNode(new _(e))}else(){return this._elseNode(new g)}endIf(){return this._endBlockNode(_,g)}_for(e,t){return this._blockNode(e),t&&this.code(t).endFor(),this}for(e,t){return this._for(new y(e),t)}forRange(e,t,r,i,a=this.opts.es5?n.varKinds.var:n.varKinds.let){let o=this._scope.toName(e);return this._for(new b(a,o,t,r),()=>i(o))}forOf(e,r,i,a=n.varKinds.const){let o=this._scope.toName(e);if(this.opts.es5){let e=r instanceof t.Name?r:this.var(`_arr`,r);return this.forRange(`_i`,0,(0,t._)`${e}.length`,n=>{this.var(o,(0,t._)`${e}[${n}]`),i(o)})}return this._for(new x(`of`,a,o,r),()=>i(o))}forIn(e,r,i,a=this.opts.es5?n.varKinds.var:n.varKinds.const){if(this.opts.ownProperties)return this.forOf(e,(0,t._)`Object.keys(${r})`,i);let o=this._scope.toName(e);return this._for(new x(`in`,a,o,r),()=>i(o))}endFor(){return this._endBlockNode(v)}label(e){return this._leafNode(new l(e))}break(e){return this._leafNode(new u(e))}return(e){let t=new C;if(this._blockNode(t),this.code(e),t.nodes.length!==1)throw Error(`CodeGen: "return" should have one node`);return this._endBlockNode(C)}try(e,t,n){if(!t&&!n)throw Error(`CodeGen: "try" without "catch" and "finally"`);let r=new ee;if(this._blockNode(r),this.code(e),t){let e=this.name(`e`);this._currNode=r.catch=new te(e),t(e)}return n&&(this._currNode=r.finally=new ne,this.code(n)),this._endBlockNode(te,ne)}throw(e){return this._leafNode(new d(e))}block(e,t){return this._blockStarts.push(this._nodes.length),e&&this.code(e).endBlock(t),this}endBlock(e){let t=this._blockStarts.pop();if(t===void 0)throw Error(`CodeGen: not in self-balancing block`);let n=this._nodes.length-t;if(n<0||e!==void 0&&n!==e)throw Error(`CodeGen: wrong number of nodes: ${n} vs ${e} expected`);return this._nodes.length=t,this}func(e,n=t.nil,r,i){return this._blockNode(new S(e,n,r)),i&&this.code(i).endFunc(),this}endFunc(){return this._endBlockNode(S)}optimize(e=1){for(;e-->0;)this._root.optimizeNodes(),this._root.optimizeNames(this._root.names,this._constants)}_leafNode(e){return this._currNode.nodes.push(e),this}_blockNode(e){this._currNode.nodes.push(e),this._nodes.push(e)}_endBlockNode(e,t){let n=this._currNode;if(n instanceof e||t&&n instanceof t)return this._nodes.pop(),this;throw Error(`CodeGen: not in block "${t?`${e.kind}/${t.kind}`:e.kind}"`)}_elseNode(e){let t=this._currNode;if(!(t instanceof _))throw Error(`CodeGen: "else" without "if"`);return this._currNode=t.else=e,this}get _root(){return this._nodes[0]}get _currNode(){let e=this._nodes;return e[e.length-1]}set _currNode(e){let t=this._nodes;t[t.length-1]=e}};function w(e,t){for(let n in t)e[n]=(e[n]||0)+(t[n]||0);return e}function re(e,n){return n instanceof t._CodeOrName?w(e,n.names):e}function T(e,n,r){if(e instanceof t.Name)return i(e);if(!a(e))return e;return new t._Code(e._items.reduce((e,n)=>(n instanceof t.Name&&(n=i(n)),n instanceof t._Code?e.push(...n._items):e.push(n),e),[]));function i(e){let t=r[e.str];return t===void 0||n[e.str]!==1?e:(delete n[e.str],t)}function a(e){return e instanceof t._Code&&e._items.some(e=>e instanceof t.Name&&n[e.str]===1&&r[e.str]!==void 0)}}function ie(e,t){for(let n in t)e[n]=(e[n]||0)-(t[n]||0)}function ae(e){return typeof e==`boolean`||typeof e==`number`||e===null?!e:(0,t._)`!${le(e)}`}e.not=ae;var oe=ce(e.operators.AND);function E(...e){return e.reduce(oe)}e.and=E;var D=ce(e.operators.OR);function se(...e){return e.reduce(D)}e.or=se;function ce(e){return(n,r)=>n===t.nil?r:r===t.nil?n:(0,t._)`${le(n)} ${e} ${le(r)}`}function le(e){return e instanceof t.Name?e:(0,t._)`(${e})`}})),Q=t((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.checkStrictMode=e.getErrorPath=e.Type=e.useFunc=e.setEvaluated=e.evaluatedPropsToName=e.mergeEvaluated=e.eachItem=e.unescapeJsonPointer=e.escapeJsonPointer=e.escapeFragment=e.unescapeFragment=e.schemaRefOrVal=e.schemaHasRulesButRef=e.schemaHasRules=e.checkUnknownRules=e.alwaysValidSchema=e.toHash=void 0;var t=Z(),n=Sd();function r(e){let t={};for(let n of e)t[n]=!0;return t}e.toHash=r;function i(e,t){return typeof t==`boolean`?t:Object.keys(t).length===0||(a(e,t),!o(t,e.self.RULES.all))}e.alwaysValidSchema=i;function a(e,t=e.schema){let{opts:n,self:r}=e;if(!n.strictSchema||typeof t==`boolean`)return;let i=r.RULES.keywords;for(let n in t)i[n]||x(e,`unknown keyword: "${n}"`)}e.checkUnknownRules=a;function o(e,t){if(typeof e==`boolean`)return!e;for(let n in e)if(t[n])return!0;return!1}e.schemaHasRules=o;function s(e,t){if(typeof e==`boolean`)return!e;for(let n in e)if(n!==`$ref`&&t.all[n])return!0;return!1}e.schemaHasRulesButRef=s;function c({topSchemaRef:e,schemaPath:n},r,i,a){if(!a){if(typeof r==`number`||typeof r==`boolean`)return r;if(typeof r==`string`)return(0,t._)`${r}`}return(0,t._)`${e}${n}${(0,t.getProperty)(i)}`}e.schemaRefOrVal=c;function l(e){return f(decodeURIComponent(e))}e.unescapeFragment=l;function u(e){return encodeURIComponent(d(e))}e.escapeFragment=u;function d(e){return typeof e==`number`?`${e}`:e.replace(/~/g,`~0`).replace(/\//g,`~1`)}e.escapeJsonPointer=d;function f(e){return e.replace(/~1/g,`/`).replace(/~0/g,`~`)}e.unescapeJsonPointer=f;function p(e,t){if(Array.isArray(e))for(let n of e)t(n);else t(e)}e.eachItem=p;function m({mergeNames:e,mergeToName:n,mergeValues:r,resultToName:i}){return(a,o,s,c)=>{let l=s===void 0?o:s instanceof t.Name?(o instanceof t.Name?e(a,o,s):n(a,o,s),s):o instanceof t.Name?(n(a,s,o),o):r(o,s);return c===t.Name&&!(l instanceof t.Name)?i(a,l):l}}e.mergeEvaluated={props:m({mergeNames:(e,n,r)=>e.if((0,t._)`${r} !== true && ${n} !== undefined`,()=>{e.if((0,t._)`${n} === true`,()=>e.assign(r,!0),()=>e.assign(r,(0,t._)`${r} || {}`).code((0,t._)`Object.assign(${r}, ${n})`))}),mergeToName:(e,n,r)=>e.if((0,t._)`${r} !== true`,()=>{n===!0?e.assign(r,!0):(e.assign(r,(0,t._)`${r} || {}`),g(e,r,n))}),mergeValues:(e,t)=>e===!0||{...e,...t},resultToName:h}),items:m({mergeNames:(e,n,r)=>e.if((0,t._)`${r} !== true && ${n} !== undefined`,()=>e.assign(r,(0,t._)`${n} === true ? true : ${r} > ${n} ? ${r} : ${n}`)),mergeToName:(e,n,r)=>e.if((0,t._)`${r} !== true`,()=>e.assign(r,n===!0||(0,t._)`${r} > ${n} ? ${r} : ${n}`)),mergeValues:(e,t)=>e===!0||Math.max(e,t),resultToName:(e,t)=>e.var(`items`,t)})};function h(e,n){if(n===!0)return e.var(`props`,!0);let r=e.var(`props`,(0,t._)`{}`);return n!==void 0&&g(e,r,n),r}e.evaluatedPropsToName=h;function g(e,n,r){Object.keys(r).forEach(r=>e.assign((0,t._)`${n}${(0,t.getProperty)(r)}`,!0))}e.setEvaluated=g;var _={};function v(e,t){return e.scopeValue(`func`,{ref:t,code:_[t.code]||(_[t.code]=new n._Code(t.code))})}e.useFunc=v;var y;(function(e){e[e.Num=0]=`Num`,e[e.Str=1]=`Str`})(y||(e.Type=y={}));function b(e,n,r){if(e instanceof t.Name){let i=n===y.Num;return r?i?(0,t._)`"[" + ${e} + "]"`:(0,t._)`"['" + ${e} + "']"`:i?(0,t._)`"/" + ${e}`:(0,t._)`"/" + ${e}.replace(/~/g, "~0").replace(/\\//g, "~1")`}return r?(0,t.getProperty)(e).toString():`/`+d(e)}e.getErrorPath=b;function x(e,t,n=e.opts.strictSchema){if(n){if(t=`strict mode: ${t}`,n===!0)throw Error(t);e.self.logger.warn(t)}}e.checkStrictMode=x})),wd=t((e=>{Object.defineProperty(e,"__esModule",{value:!0});var t=Z();e.default={data:new t.Name(`data`),valCxt:new t.Name(`valCxt`),instancePath:new t.Name(`instancePath`),parentData:new t.Name(`parentData`),parentDataProperty:new t.Name(`parentDataProperty`),rootData:new t.Name(`rootData`),dynamicAnchors:new t.Name(`dynamicAnchors`),vErrors:new t.Name(`vErrors`),errors:new t.Name(`errors`),this:new t.Name(`this`),self:new t.Name(`self`),scope:new t.Name(`scope`),json:new t.Name(`json`),jsonPos:new t.Name(`jsonPos`),jsonLen:new t.Name(`jsonLen`),jsonPart:new t.Name(`jsonPart`)}})),Td=t((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.extendErrors=e.resetErrorsCount=e.reportExtraError=e.reportError=e.keyword$DataError=e.keywordError=void 0;var t=Z(),n=Q(),r=wd();e.keywordError={message:({keyword:e})=>(0,t.str)`must pass "${e}" keyword validation`},e.keyword$DataError={message:({keyword:e,schemaType:n})=>n?(0,t.str)`"${e}" keyword must be ${n} ($data)`:(0,t.str)`"${e}" keyword is invalid ($data)`};function i(n,r=e.keywordError,i,a){let{it:o}=n,{gen:s,compositeRule:u,allErrors:f}=o,p=d(n,r,i);a??(u||f)?c(s,p):l(o,(0,t._)`[${p}]`)}e.reportError=i;function a(t,n=e.keywordError,i){let{it:a}=t,{gen:o,compositeRule:s,allErrors:u}=a;c(o,d(t,n,i)),s||u||l(a,r.default.vErrors)}e.reportExtraError=a;function o(e,n){e.assign(r.default.errors,n),e.if((0,t._)`${r.default.vErrors} !== null`,()=>e.if(n,()=>e.assign((0,t._)`${r.default.vErrors}.length`,n),()=>e.assign(r.default.vErrors,null)))}e.resetErrorsCount=o;function s({gen:e,keyword:n,schemaValue:i,data:a,errsCount:o,it:s}){if(o===void 0)throw Error(`ajv implementation error`);let c=e.name(`err`);e.forRange(`i`,o,r.default.errors,o=>{e.const(c,(0,t._)`${r.default.vErrors}[${o}]`),e.if((0,t._)`${c}.instancePath === undefined`,()=>e.assign((0,t._)`${c}.instancePath`,(0,t.strConcat)(r.default.instancePath,s.errorPath))),e.assign((0,t._)`${c}.schemaPath`,(0,t.str)`${s.errSchemaPath}/${n}`),s.opts.verbose&&(e.assign((0,t._)`${c}.schema`,i),e.assign((0,t._)`${c}.data`,a))})}e.extendErrors=s;function c(e,n){let i=e.const(`err`,n);e.if((0,t._)`${r.default.vErrors} === null`,()=>e.assign(r.default.vErrors,(0,t._)`[${i}]`),(0,t._)`${r.default.vErrors}.push(${i})`),e.code((0,t._)`${r.default.errors}++`)}function l(e,n){let{gen:r,validateName:i,schemaEnv:a}=e;a.$async?r.throw((0,t._)`new ${e.ValidationError}(${n})`):(r.assign((0,t._)`${i}.errors`,n),r.return(!1))}var u={keyword:new t.Name(`keyword`),schemaPath:new t.Name(`schemaPath`),params:new t.Name(`params`),propertyName:new t.Name(`propertyName`),message:new t.Name(`message`),schema:new t.Name(`schema`),parentSchema:new t.Name(`parentSchema`)};function d(e,n,r){let{createErrors:i}=e.it;return i===!1?(0,t._)`{}`:f(e,n,r)}function f(e,t,n={}){let{gen:r,it:i}=e,a=[p(i,n),m(e,n)];return h(e,t,a),r.object(...a)}function p({errorPath:e},{instancePath:i}){let a=i?(0,t.str)`${e}${(0,n.getErrorPath)(i,n.Type.Str)}`:e;return[r.default.instancePath,(0,t.strConcat)(r.default.instancePath,a)]}function m({keyword:e,it:{errSchemaPath:r}},{schemaPath:i,parentSchema:a}){let o=a?r:(0,t.str)`${r}/${e}`;return i&&(o=(0,t.str)`${o}${(0,n.getErrorPath)(i,n.Type.Str)}`),[u.schemaPath,o]}function h(e,{params:n,message:i},a){let{keyword:o,data:s,schemaValue:c,it:l}=e,{opts:d,propertyName:f,topSchemaRef:p,schemaPath:m}=l;a.push([u.keyword,o],[u.params,typeof n==`function`?n(e):n||(0,t._)`{}`]),d.messages&&a.push([u.message,typeof i==`function`?i(e):i]),d.verbose&&a.push([u.schema,c],[u.parentSchema,(0,t._)`${p}${m}`],[r.default.data,s]),f&&a.push([u.propertyName,f])}})),Ed=t((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.boolOrEmptySchema=e.topBoolOrEmptySchema=void 0;var t=Td(),n=Z(),r=wd(),i={message:`boolean schema is false`};function a(e){let{gen:t,schema:i,validateName:a}=e;i===!1?s(e,!1):typeof i==`object`&&i.$async===!0?t.return(r.default.data):(t.assign((0,n._)`${a}.errors`,null),t.return(!0))}e.topBoolOrEmptySchema=a;function o(e,t){let{gen:n,schema:r}=e;r===!1?(n.var(t,!1),s(e)):n.var(t,!0)}e.boolOrEmptySchema=o;function s(e,n){let{gen:r,data:a}=e,o={gen:r,keyword:`false schema`,data:a,schema:!1,schemaCode:!1,schemaValue:!1,params:{},it:e};(0,t.reportError)(o,i,void 0,n)}})),Dd=t((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.getRules=e.isJSONType=void 0;var t=new Set([`string`,`number`,`integer`,`boolean`,`null`,`object`,`array`]);function n(e){return typeof e==`string`&&t.has(e)}e.isJSONType=n;function r(){let e={number:{type:`number`,rules:[]},string:{type:`string`,rules:[]},array:{type:`array`,rules:[]},object:{type:`object`,rules:[]}};return{types:{...e,integer:!0,boolean:!0,null:!0},rules:[{rules:[]},e.number,e.string,e.array,e.object],post:{rules:[]},all:{},keywords:{}}}e.getRules=r})),Od=t((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.shouldUseRule=e.shouldUseGroup=e.schemaHasRulesForType=void 0;function t({schema:e,self:t},r){let i=t.RULES.types[r];return i&&i!==!0&&n(e,i)}e.schemaHasRulesForType=t;function n(e,t){return t.rules.some(t=>r(e,t))}e.shouldUseGroup=n;function r(e,t){return e[t.keyword]!==void 0||t.definition.implements?.some(t=>e[t]!==void 0)}e.shouldUseRule=r})),kd=t((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.reportTypeError=e.checkDataTypes=e.checkDataType=e.coerceAndCheckDataType=e.getJSONTypes=e.getSchemaTypes=e.DataType=void 0;var t=Dd(),n=Od(),r=Td(),i=Z(),a=Q(),o;(function(e){e[e.Correct=0]=`Correct`,e[e.Wrong=1]=`Wrong`})(o||(e.DataType=o={}));function s(e){let t=c(e.type);if(t.includes(`null`)){if(e.nullable===!1)throw Error(`type: null contradicts nullable: false`)}else{if(!t.length&&e.nullable!==void 0)throw Error(`"nullable" cannot be used without "type"`);e.nullable===!0&&t.push(`null`)}return t}e.getSchemaTypes=s;function c(e){let n=Array.isArray(e)?e:e?[e]:[];if(n.every(t.isJSONType))return n;throw Error(`type must be JSONType or JSONType[]: `+n.join(`,`))}e.getJSONTypes=c;function l(e,t){let{gen:r,data:i,opts:a}=e,s=d(t,a.coerceTypes),c=t.length>0&&!(s.length===0&&t.length===1&&(0,n.schemaHasRulesForType)(e,t[0]));if(c){let n=h(t,i,a.strictNumbers,o.Wrong);r.if(n,()=>{s.length?f(e,t,s):_(e)})}return c}e.coerceAndCheckDataType=l;var u=new Set([`string`,`number`,`integer`,`boolean`,`null`]);function d(e,t){return t?e.filter(e=>u.has(e)||t===`array`&&e===`array`):[]}function f(e,t,n){let{gen:r,data:a,opts:o}=e,s=r.let(`dataType`,(0,i._)`typeof ${a}`),c=r.let(`coerced`,(0,i._)`undefined`);o.coerceTypes===`array`&&r.if((0,i._)`${s} == 'object' && Array.isArray(${a}) && ${a}.length == 1`,()=>r.assign(a,(0,i._)`${a}[0]`).assign(s,(0,i._)`typeof ${a}`).if(h(t,a,o.strictNumbers),()=>r.assign(c,a))),r.if((0,i._)`${c} !== undefined`);for(let e of n)(u.has(e)||e===`array`&&o.coerceTypes===`array`)&&l(e);r.else(),_(e),r.endIf(),r.if((0,i._)`${c} !== undefined`,()=>{r.assign(a,c),p(e,c)});function l(e){switch(e){case`string`:r.elseIf((0,i._)`${s} == "number" || ${s} == "boolean"`).assign(c,(0,i._)`"" + ${a}`).elseIf((0,i._)`${a} === null`).assign(c,(0,i._)`""`);return;case`number`:r.elseIf((0,i._)`${s} == "boolean" || ${a} === null + || (${s} == "string" && ${a} && ${a} == +${a})`).assign(c,(0,i._)`+${a}`);return;case`integer`:r.elseIf((0,i._)`${s} === "boolean" || ${a} === null + || (${s} === "string" && ${a} && ${a} == +${a} && !(${a} % 1))`).assign(c,(0,i._)`+${a}`);return;case`boolean`:r.elseIf((0,i._)`${a} === "false" || ${a} === 0 || ${a} === null`).assign(c,!1).elseIf((0,i._)`${a} === "true" || ${a} === 1`).assign(c,!0);return;case`null`:r.elseIf((0,i._)`${a} === "" || ${a} === 0 || ${a} === false`),r.assign(c,null);return;case`array`:r.elseIf((0,i._)`${s} === "string" || ${s} === "number" + || ${s} === "boolean" || ${a} === null`).assign(c,(0,i._)`[${a}]`)}}}function p({gen:e,parentData:t,parentDataProperty:n},r){e.if((0,i._)`${t} !== undefined`,()=>e.assign((0,i._)`${t}[${n}]`,r))}function m(e,t,n,r=o.Correct){let a=r===o.Correct?i.operators.EQ:i.operators.NEQ,s;switch(e){case`null`:return(0,i._)`${t} ${a} null`;case`array`:s=(0,i._)`Array.isArray(${t})`;break;case`object`:s=(0,i._)`${t} && typeof ${t} == "object" && !Array.isArray(${t})`;break;case`integer`:s=c((0,i._)`!(${t} % 1) && !isNaN(${t})`);break;case`number`:s=c();break;default:return(0,i._)`typeof ${t} ${a} ${e}`}return r===o.Correct?s:(0,i.not)(s);function c(e=i.nil){return(0,i.and)((0,i._)`typeof ${t} == "number"`,e,n?(0,i._)`isFinite(${t})`:i.nil)}}e.checkDataType=m;function h(e,t,n,r){if(e.length===1)return m(e[0],t,n,r);let o,s=(0,a.toHash)(e);if(s.array&&s.object){let e=(0,i._)`typeof ${t} != "object"`;o=s.null?e:(0,i._)`!${t} || ${e}`,delete s.null,delete s.array,delete s.object}else o=i.nil;s.number&&delete s.integer;for(let e in s)o=(0,i.and)(o,m(e,t,n,r));return o}e.checkDataTypes=h;var g={message:({schema:e})=>`must be ${e}`,params:({schema:e,schemaValue:t})=>typeof e==`string`?(0,i._)`{type: ${e}}`:(0,i._)`{type: ${t}}`};function _(e){let t=v(e);(0,r.reportError)(t,g)}e.reportTypeError=_;function v(e){let{gen:t,data:n,schema:r}=e,i=(0,a.schemaRefOrVal)(e,r,`type`);return{gen:t,keyword:`type`,data:n,schema:r.type,schemaCode:i,schemaValue:i,parentSchema:r,params:{},it:e}}})),Ad=t((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.assignDefaults=void 0;var t=Z(),n=Q();function r(e,t){let{properties:n,items:r}=e.schema;if(t===`object`&&n)for(let t in n)i(e,t,n[t].default);else t===`array`&&Array.isArray(r)&&r.forEach((t,n)=>i(e,n,t.default))}e.assignDefaults=r;function i(e,r,i){let{gen:a,compositeRule:o,data:s,opts:c}=e;if(i===void 0)return;let l=(0,t._)`${s}${(0,t.getProperty)(r)}`;if(o){(0,n.checkStrictMode)(e,`default is ignored for: ${l}`);return}let u=(0,t._)`${l} === undefined`;c.useDefaults===`empty`&&(u=(0,t._)`${u} || ${l} === null || ${l} === ""`),a.if(u,(0,t._)`${l} = ${(0,t.stringify)(i)}`)}})),jd=t((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.validateUnion=e.validateArray=e.usePattern=e.callValidateCode=e.schemaProperties=e.allSchemaProperties=e.noPropertyInData=e.propertyInData=e.isOwnProperty=e.hasPropFunc=e.reportMissingProp=e.checkMissingProp=e.checkReportMissingProp=void 0;var t=Z(),n=Q(),r=wd(),i=Q();function a(e,n){let{gen:r,data:i,it:a}=e;r.if(d(r,i,n,a.opts.ownProperties),()=>{e.setParams({missingProperty:(0,t._)`${n}`},!0),e.error()})}e.checkReportMissingProp=a;function o({gen:e,data:n,it:{opts:r}},i,a){return(0,t.or)(...i.map(i=>(0,t.and)(d(e,n,i,r.ownProperties),(0,t._)`${a} = ${i}`)))}e.checkMissingProp=o;function s(e,t){e.setParams({missingProperty:t},!0),e.error()}e.reportMissingProp=s;function c(e){return e.scopeValue(`func`,{ref:Object.prototype.hasOwnProperty,code:(0,t._)`Object.prototype.hasOwnProperty`})}e.hasPropFunc=c;function l(e,n,r){return(0,t._)`${c(e)}.call(${n}, ${r})`}e.isOwnProperty=l;function u(e,n,r,i){let a=(0,t._)`${n}${(0,t.getProperty)(r)} !== undefined`;return i?(0,t._)`${a} && ${l(e,n,r)}`:a}e.propertyInData=u;function d(e,n,r,i){let a=(0,t._)`${n}${(0,t.getProperty)(r)} === undefined`;return i?(0,t.or)(a,(0,t.not)(l(e,n,r))):a}e.noPropertyInData=d;function f(e){return e?Object.keys(e).filter(e=>e!==`__proto__`):[]}e.allSchemaProperties=f;function p(e,t){return f(t).filter(r=>!(0,n.alwaysValidSchema)(e,t[r]))}e.schemaProperties=p;function m({schemaCode:e,data:n,it:{gen:i,topSchemaRef:a,schemaPath:o,errorPath:s},it:c},l,u,d){let f=d?(0,t._)`${e}, ${n}, ${a}${o}`:n,p=[[r.default.instancePath,(0,t.strConcat)(r.default.instancePath,s)],[r.default.parentData,c.parentData],[r.default.parentDataProperty,c.parentDataProperty],[r.default.rootData,r.default.rootData]];c.opts.dynamicRef&&p.push([r.default.dynamicAnchors,r.default.dynamicAnchors]);let m=(0,t._)`${f}, ${i.object(...p)}`;return u===t.nil?(0,t._)`${l}(${m})`:(0,t._)`${l}.call(${u}, ${m})`}e.callValidateCode=m;var h=(0,t._)`new RegExp`;function g({gen:e,it:{opts:n}},r){let a=n.unicodeRegExp?`u`:``,{regExp:o}=n.code,s=o(r,a);return e.scopeValue(`pattern`,{key:s.toString(),ref:s,code:(0,t._)`${o.code===`new RegExp`?h:(0,i.useFunc)(e,o)}(${r}, ${a})`})}e.usePattern=g;function _(e){let{gen:r,data:i,keyword:a,it:o}=e,s=r.name(`valid`);if(o.allErrors){let e=r.let(`valid`,!0);return c(()=>r.assign(e,!1)),e}return r.var(s,!0),c(()=>r.break()),s;function c(o){let c=r.const(`len`,(0,t._)`${i}.length`);r.forRange(`i`,0,c,i=>{e.subschema({keyword:a,dataProp:i,dataPropType:n.Type.Num},s),r.if((0,t.not)(s),o)})}}e.validateArray=_;function v(e){let{gen:r,schema:i,keyword:a,it:o}=e;if(!Array.isArray(i))throw Error(`ajv implementation error`);if(i.some(e=>(0,n.alwaysValidSchema)(o,e))&&!o.opts.unevaluated)return;let s=r.let(`valid`,!1),c=r.name(`_valid`);r.block(()=>i.forEach((n,i)=>{let o=e.subschema({keyword:a,schemaProp:i,compositeRule:!0},c);r.assign(s,(0,t._)`${s} || ${c}`),e.mergeValidEvaluated(o,c)||r.if((0,t.not)(s))})),e.result(s,()=>e.reset(),()=>e.error(!0))}e.validateUnion=v})),Md=t((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.validateKeywordUsage=e.validSchemaType=e.funcKeywordCode=e.macroKeywordCode=void 0;var t=Z(),n=wd(),r=jd(),i=Td();function a(e,n){let{gen:r,keyword:i,schema:a,parentSchema:o,it:s}=e,c=n.macro.call(s.self,a,o,s),l=u(r,i,c);s.opts.validateSchema!==!1&&s.self.validateSchema(c,!0);let d=r.name(`valid`);e.subschema({schema:c,schemaPath:t.nil,errSchemaPath:`${s.errSchemaPath}/${i}`,topSchemaRef:l,compositeRule:!0},d),e.pass(d,()=>e.error(!0))}e.macroKeywordCode=a;function o(e,i){let{gen:a,keyword:o,schema:d,parentSchema:f,$data:p,it:m}=e;l(m,i);let h=u(a,o,!p&&i.compile?i.compile.call(m.self,d,f,m):i.validate),g=a.let(`valid`);e.block$data(g,_),e.ok(i.valid??g);function _(){if(i.errors===!1)b(),i.modifying&&s(e),x(()=>e.error());else{let t=i.async?v():y();i.modifying&&s(e),x(()=>c(e,t))}}function v(){let e=a.let(`ruleErrs`,null);return a.try(()=>b((0,t._)`await `),n=>a.assign(g,!1).if((0,t._)`${n} instanceof ${m.ValidationError}`,()=>a.assign(e,(0,t._)`${n}.errors`),()=>a.throw(n))),e}function y(){let e=(0,t._)`${h}.errors`;return a.assign(e,null),b(t.nil),e}function b(o=i.async?(0,t._)`await `:t.nil){let s=m.opts.passContext?n.default.this:n.default.self,c=!(`compile`in i&&!p||i.schema===!1);a.assign(g,(0,t._)`${o}${(0,r.callValidateCode)(e,h,s,c)}`,i.modifying)}function x(e){a.if((0,t.not)(i.valid??g),e)}}e.funcKeywordCode=o;function s(e){let{gen:n,data:r,it:i}=e;n.if(i.parentData,()=>n.assign(r,(0,t._)`${i.parentData}[${i.parentDataProperty}]`))}function c(e,r){let{gen:a}=e;a.if((0,t._)`Array.isArray(${r})`,()=>{a.assign(n.default.vErrors,(0,t._)`${n.default.vErrors} === null ? ${r} : ${n.default.vErrors}.concat(${r})`).assign(n.default.errors,(0,t._)`${n.default.vErrors}.length`),(0,i.extendErrors)(e)},()=>e.error())}function l({schemaEnv:e},t){if(t.async&&!e.$async)throw Error(`async keyword in sync schema`)}function u(e,n,r){if(r===void 0)throw Error(`keyword "${n}" failed to compile`);return e.scopeValue(`keyword`,typeof r==`function`?{ref:r}:{ref:r,code:(0,t.stringify)(r)})}function d(e,t,n=!1){return!t.length||t.some(t=>t===`array`?Array.isArray(e):t===`object`?e&&typeof e==`object`&&!Array.isArray(e):typeof e==t||n&&e===void 0)}e.validSchemaType=d;function f({schema:e,opts:t,self:n,errSchemaPath:r},i,a){if(Array.isArray(i.keyword)?!i.keyword.includes(a):i.keyword!==a)throw Error(`ajv implementation error`);let o=i.dependencies;if(o?.some(t=>!Object.prototype.hasOwnProperty.call(e,t)))throw Error(`parent schema must have dependencies of ${a}: ${o.join(`,`)}`);if(i.validateSchema&&!i.validateSchema(e[a])){let e=`keyword "${a}" value is invalid at path "${r}": `+n.errorsText(i.validateSchema.errors);if(t.validateSchema===`log`)n.logger.error(e);else throw Error(e)}}e.validateKeywordUsage=f})),Nd=t((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.extendSubschemaMode=e.extendSubschemaData=e.getSubschema=void 0;var t=Z(),n=Q();function r(e,{keyword:r,schemaProp:i,schema:a,schemaPath:o,errSchemaPath:s,topSchemaRef:c}){if(r!==void 0&&a!==void 0)throw Error(`both "keyword" and "schema" passed, only one allowed`);if(r!==void 0){let a=e.schema[r];return i===void 0?{schema:a,schemaPath:(0,t._)`${e.schemaPath}${(0,t.getProperty)(r)}`,errSchemaPath:`${e.errSchemaPath}/${r}`}:{schema:a[i],schemaPath:(0,t._)`${e.schemaPath}${(0,t.getProperty)(r)}${(0,t.getProperty)(i)}`,errSchemaPath:`${e.errSchemaPath}/${r}/${(0,n.escapeFragment)(i)}`}}if(a!==void 0){if(o===void 0||s===void 0||c===void 0)throw Error(`"schemaPath", "errSchemaPath" and "topSchemaRef" are required with "schema"`);return{schema:a,schemaPath:o,topSchemaRef:c,errSchemaPath:s}}throw Error(`either "keyword" or "schema" must be passed`)}e.getSubschema=r;function i(e,r,{dataProp:i,dataPropType:a,data:o,dataTypes:s,propertyName:c}){if(o!==void 0&&i!==void 0)throw Error(`both "data" and "dataProp" passed, only one allowed`);let{gen:l}=r;if(i!==void 0){let{errorPath:o,dataPathArr:s,opts:c}=r;u(l.let(`data`,(0,t._)`${r.data}${(0,t.getProperty)(i)}`,!0)),e.errorPath=(0,t.str)`${o}${(0,n.getErrorPath)(i,a,c.jsPropertySyntax)}`,e.parentDataProperty=(0,t._)`${i}`,e.dataPathArr=[...s,e.parentDataProperty]}o!==void 0&&(u(o instanceof t.Name?o:l.let(`data`,o,!0)),c!==void 0&&(e.propertyName=c)),s&&(e.dataTypes=s);function u(t){e.data=t,e.dataLevel=r.dataLevel+1,e.dataTypes=[],r.definedProperties=new Set,e.parentData=r.data,e.dataNames=[...r.dataNames,t]}}e.extendSubschemaData=i;function a(e,{jtdDiscriminator:t,jtdMetadata:n,compositeRule:r,createErrors:i,allErrors:a}){r!==void 0&&(e.compositeRule=r),i!==void 0&&(e.createErrors=i),a!==void 0&&(e.allErrors=a),e.jtdDiscriminator=t,e.jtdMetadata=n}e.extendSubschemaMode=a})),Pd=t(((e,t)=>{t.exports=function e(t,n){if(t===n)return!0;if(t&&n&&typeof t==`object`&&typeof n==`object`){if(t.constructor!==n.constructor)return!1;var r,i,a;if(Array.isArray(t)){if(r=t.length,r!=n.length)return!1;for(i=r;i--!==0;)if(!e(t[i],n[i]))return!1;return!0}if(t.constructor===RegExp)return t.source===n.source&&t.flags===n.flags;if(t.valueOf!==Object.prototype.valueOf)return t.valueOf()===n.valueOf();if(t.toString!==Object.prototype.toString)return t.toString()===n.toString();if(a=Object.keys(t),r=a.length,r!==Object.keys(n).length)return!1;for(i=r;i--!==0;)if(!Object.prototype.hasOwnProperty.call(n,a[i]))return!1;for(i=r;i--!==0;){var o=a[i];if(!e(t[o],n[o]))return!1}return!0}return t!==t&&n!==n}})),Fd=t(((e,t)=>{var n=t.exports=function(e,t,n){typeof t==`function`&&(n=t,t={}),n=t.cb||n;var i=typeof n==`function`?n:n.pre||function(){},a=n.post||function(){};r(t,i,a,e,``,e)};n.keywords={additionalItems:!0,items:!0,contains:!0,additionalProperties:!0,propertyNames:!0,not:!0,if:!0,then:!0,else:!0},n.arrayKeywords={items:!0,allOf:!0,anyOf:!0,oneOf:!0},n.propsKeywords={$defs:!0,definitions:!0,properties:!0,patternProperties:!0,dependencies:!0},n.skipKeywords={default:!0,enum:!0,const:!0,required:!0,maximum:!0,minimum:!0,exclusiveMaximum:!0,exclusiveMinimum:!0,multipleOf:!0,maxLength:!0,minLength:!0,pattern:!0,format:!0,maxItems:!0,minItems:!0,uniqueItems:!0,maxProperties:!0,minProperties:!0};function r(e,t,a,o,s,c,l,u,d,f){if(o&&typeof o==`object`&&!Array.isArray(o)){for(var p in t(o,s,c,l,u,d,f),o){var m=o[p];if(Array.isArray(m)){if(p in n.arrayKeywords)for(var h=0;h{Object.defineProperty(e,"__esModule",{value:!0}),e.getSchemaRefs=e.resolveUrl=e.normalizeId=e._getFullPath=e.getFullPath=e.inlineRef=void 0;var t=Q(),n=Pd(),r=Fd(),i=new Set([`type`,`format`,`pattern`,`maxLength`,`minLength`,`maxProperties`,`minProperties`,`maxItems`,`minItems`,`maximum`,`minimum`,`uniqueItems`,`multipleOf`,`required`,`enum`,`const`]);function a(e,t=!0){return typeof e==`boolean`?!0:t===!0?!s(e):t?c(e)<=t:!1}e.inlineRef=a;var o=new Set([`$ref`,`$recursiveRef`,`$recursiveAnchor`,`$dynamicRef`,`$dynamicAnchor`]);function s(e){for(let t in e){if(o.has(t))return!0;let n=e[t];if(Array.isArray(n)&&n.some(s)||typeof n==`object`&&s(n))return!0}return!1}function c(e){let n=0;for(let r in e)if(r===`$ref`||(n++,!i.has(r)&&(typeof e[r]==`object`&&(0,t.eachItem)(e[r],e=>n+=c(e)),n===1/0)))return 1/0;return n}function l(e,t=``,n){return n!==!1&&(t=f(t)),u(e,e.parse(t))}e.getFullPath=l;function u(e,t){return e.serialize(t).split(`#`)[0]+`#`}e._getFullPath=u;var d=/#\/?$/;function f(e){return e?e.replace(d,``):``}e.normalizeId=f;function p(e,t,n){return n=f(n),e.resolve(t,n)}e.resolveUrl=p;var m=/^[a-z_][-a-z0-9._]*$/i;function h(e,t){if(typeof e==`boolean`)return{};let{schemaId:i,uriResolver:a}=this.opts,o=f(e[i]||t),s={"":o},c=l(a,o,!1),u={},d=new Set;return r(e,{allKeys:!0},(e,t,n,r)=>{if(r===void 0)return;let a=c+t,o=s[r];typeof e[i]==`string`&&(o=l.call(this,e[i])),g.call(this,e.$anchor),g.call(this,e.$dynamicAnchor),s[t]=o;function l(t){let n=this.opts.uriResolver.resolve;if(t=f(o?n(o,t):t),d.has(t))throw h(t);d.add(t);let r=this.refs[t];return typeof r==`string`&&(r=this.refs[r]),typeof r==`object`?p(e,r.schema,t):t!==f(a)&&(t[0]===`#`?(p(e,u[t],t),u[t]=e):this.refs[t]=a),t}function g(e){if(typeof e==`string`){if(!m.test(e))throw Error(`invalid anchor "${e}"`);l.call(this,`#${e}`)}}}),u;function p(e,t,r){if(t!==void 0&&!n(e,t))throw h(r)}function h(e){return Error(`reference "${e}" resolves to more than one schema`)}}e.getSchemaRefs=h})),Ld=t((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.getData=e.KeywordCxt=e.validateFunctionCode=void 0;var t=Ed(),n=kd(),r=Od(),i=kd(),a=Ad(),o=Md(),s=Nd(),c=Z(),l=wd(),u=Id(),d=Q(),f=Td();function p(e){if(S(e)&&(ee(e),x(e))){_(e);return}m(e,()=>(0,t.topBoolOrEmptySchema)(e))}e.validateFunctionCode=p;function m({gen:e,validateName:t,schema:n,schemaEnv:r,opts:i},a){i.code.es5?e.func(t,(0,c._)`${l.default.data}, ${l.default.valCxt}`,r.$async,()=>{e.code((0,c._)`"use strict"; ${y(n,i)}`),g(e,i),e.code(a)}):e.func(t,(0,c._)`${l.default.data}, ${h(i)}`,r.$async,()=>e.code(y(n,i)).code(a))}function h(e){return(0,c._)`{${l.default.instancePath}="", ${l.default.parentData}, ${l.default.parentDataProperty}, ${l.default.rootData}=${l.default.data}${e.dynamicRef?(0,c._)`, ${l.default.dynamicAnchors}={}`:c.nil}}={}`}function g(e,t){e.if(l.default.valCxt,()=>{e.var(l.default.instancePath,(0,c._)`${l.default.valCxt}.${l.default.instancePath}`),e.var(l.default.parentData,(0,c._)`${l.default.valCxt}.${l.default.parentData}`),e.var(l.default.parentDataProperty,(0,c._)`${l.default.valCxt}.${l.default.parentDataProperty}`),e.var(l.default.rootData,(0,c._)`${l.default.valCxt}.${l.default.rootData}`),t.dynamicRef&&e.var(l.default.dynamicAnchors,(0,c._)`${l.default.valCxt}.${l.default.dynamicAnchors}`)},()=>{e.var(l.default.instancePath,(0,c._)`""`),e.var(l.default.parentData,(0,c._)`undefined`),e.var(l.default.parentDataProperty,(0,c._)`undefined`),e.var(l.default.rootData,l.default.data),t.dynamicRef&&e.var(l.default.dynamicAnchors,(0,c._)`{}`)})}function _(e){let{schema:t,opts:n,gen:r}=e;m(e,()=>{n.$comment&&t.$comment&&ie(e),w(e),r.let(l.default.vErrors,null),r.let(l.default.errors,0),n.unevaluated&&v(e),te(e),ae(e)})}function v(e){let{gen:t,validateName:n}=e;e.evaluated=t.const(`evaluated`,(0,c._)`${n}.evaluated`),t.if((0,c._)`${e.evaluated}.dynamicProps`,()=>t.assign((0,c._)`${e.evaluated}.props`,(0,c._)`undefined`)),t.if((0,c._)`${e.evaluated}.dynamicItems`,()=>t.assign((0,c._)`${e.evaluated}.items`,(0,c._)`undefined`))}function y(e,t){let n=typeof e==`object`&&e[t.schemaId];return n&&(t.code.source||t.code.process)?(0,c._)`/*# sourceURL=${n} */`:c.nil}function b(e,n){if(S(e)&&(ee(e),x(e))){C(e,n);return}(0,t.boolOrEmptySchema)(e,n)}function x({schema:e,self:t}){if(typeof e==`boolean`)return!e;for(let n in e)if(t.RULES.all[n])return!0;return!1}function S(e){return typeof e.schema!=`boolean`}function C(e,t){let{schema:n,gen:r,opts:i}=e;i.$comment&&n.$comment&&ie(e),re(e),T(e);let a=r.const(`_errs`,l.default.errors);te(e,a),r.var(t,(0,c._)`${a} === ${l.default.errors}`)}function ee(e){(0,d.checkUnknownRules)(e),ne(e)}function te(e,t){if(e.opts.jtd)return E(e,[],!1,t);let r=(0,n.getSchemaTypes)(e.schema);E(e,r,!(0,n.coerceAndCheckDataType)(e,r),t)}function ne(e){let{schema:t,errSchemaPath:n,opts:r,self:i}=e;t.$ref&&r.ignoreKeywordsWithRef&&(0,d.schemaHasRulesButRef)(t,i.RULES)&&i.logger.warn(`$ref: keywords ignored in schema at path "${n}"`)}function w(e){let{schema:t,opts:n}=e;t.default!==void 0&&n.useDefaults&&n.strictSchema&&(0,d.checkStrictMode)(e,`default is ignored in the schema root`)}function re(e){let t=e.schema[e.opts.schemaId];t&&(e.baseId=(0,u.resolveUrl)(e.opts.uriResolver,e.baseId,t))}function T(e){if(e.schema.$async&&!e.schemaEnv.$async)throw Error(`async schema in sync schema`)}function ie({gen:e,schemaEnv:t,schema:n,errSchemaPath:r,opts:i}){let a=n.$comment;if(i.$comment===!0)e.code((0,c._)`${l.default.self}.logger.log(${a})`);else if(typeof i.$comment==`function`){let n=(0,c.str)`${r}/$comment`,i=e.scopeValue(`root`,{ref:t.root});e.code((0,c._)`${l.default.self}.opts.$comment(${a}, ${n}, ${i}.schema)`)}}function ae(e){let{gen:t,schemaEnv:n,validateName:r,ValidationError:i,opts:a}=e;n.$async?t.if((0,c._)`${l.default.errors} === 0`,()=>t.return(l.default.data),()=>t.throw((0,c._)`new ${i}(${l.default.vErrors})`)):(t.assign((0,c._)`${r}.errors`,l.default.vErrors),a.unevaluated&&oe(e),t.return((0,c._)`${l.default.errors} === 0`))}function oe({gen:e,evaluated:t,props:n,items:r}){n instanceof c.Name&&e.assign((0,c._)`${t}.props`,n),r instanceof c.Name&&e.assign((0,c._)`${t}.items`,r)}function E(e,t,n,a){let{gen:o,schema:s,data:u,allErrors:f,opts:p,self:m}=e,{RULES:h}=m;if(s.$ref&&(p.ignoreKeywordsWithRef||!(0,d.schemaHasRulesButRef)(s,h))){o.block(()=>ge(e,`$ref`,h.all.$ref.definition));return}p.jtd||se(e,t),o.block(()=>{for(let e of h.rules)g(e);g(h.post)});function g(d){(0,r.shouldUseGroup)(s,d)&&(d.type?(o.if((0,i.checkDataType)(d.type,u,p.strictNumbers)),D(e,d),t.length===1&&t[0]===d.type&&n&&(o.else(),(0,i.reportTypeError)(e)),o.endIf()):D(e,d),f||o.if((0,c._)`${l.default.errors} === ${a||0}`))}}function D(e,t){let{gen:n,schema:i,opts:{useDefaults:o}}=e;o&&(0,a.assignDefaults)(e,t.type),n.block(()=>{for(let n of t.rules)(0,r.shouldUseRule)(i,n)&&ge(e,n.keyword,n.definition,t.type)})}function se(e,t){!e.schemaEnv.meta&&e.opts.strictTypes&&(ce(e,t),e.opts.allowUnionTypes||le(e,t),ue(e,e.dataTypes))}function ce(e,t){if(t.length){if(!e.dataTypes.length){e.dataTypes=t;return}t.forEach(t=>{fe(e.dataTypes,t)||me(e,`type "${t}" not allowed by context "${e.dataTypes.join(`,`)}"`)}),pe(e,t)}}function le(e,t){t.length>1&&!(t.length===2&&t.includes(`null`))&&me(e,`use allowUnionTypes to allow union type keyword`)}function ue(e,t){let n=e.self.RULES.all;for(let i in n){let a=n[i];if(typeof a==`object`&&(0,r.shouldUseRule)(e.schema,a)){let{type:n}=a.definition;n.length&&!n.some(e=>de(t,e))&&me(e,`missing type "${n.join(`,`)}" for keyword "${i}"`)}}}function de(e,t){return e.includes(t)||t===`number`&&e.includes(`integer`)}function fe(e,t){return e.includes(t)||t===`integer`&&e.includes(`number`)}function pe(e,t){let n=[];for(let r of e.dataTypes)fe(t,r)?n.push(r):t.includes(`integer`)&&r===`number`&&n.push(`integer`);e.dataTypes=n}function me(e,t){let n=e.schemaEnv.baseId+e.errSchemaPath;t+=` at "${n}" (strictTypes)`,(0,d.checkStrictMode)(e,t,e.opts.strictTypes)}var he=class{constructor(e,t,n){if((0,o.validateKeywordUsage)(e,t,n),this.gen=e.gen,this.allErrors=e.allErrors,this.keyword=n,this.data=e.data,this.schema=e.schema[n],this.$data=t.$data&&e.opts.$data&&this.schema&&this.schema.$data,this.schemaValue=(0,d.schemaRefOrVal)(e,this.schema,n,this.$data),this.schemaType=t.schemaType,this.parentSchema=e.schema,this.params={},this.it=e,this.def=t,this.$data)this.schemaCode=e.gen.const(`vSchema`,ye(this.$data,e));else if(this.schemaCode=this.schemaValue,!(0,o.validSchemaType)(this.schema,t.schemaType,t.allowUndefined))throw Error(`${n} value must be ${JSON.stringify(t.schemaType)}`);(`code`in t?t.trackErrors:t.errors!==!1)&&(this.errsCount=e.gen.const(`_errs`,l.default.errors))}result(e,t,n){this.failResult((0,c.not)(e),t,n)}failResult(e,t,n){this.gen.if(e),n?n():this.error(),t?(this.gen.else(),t(),this.allErrors&&this.gen.endIf()):this.allErrors?this.gen.endIf():this.gen.else()}pass(e,t){this.failResult((0,c.not)(e),void 0,t)}fail(e){if(e===void 0){this.error(),this.allErrors||this.gen.if(!1);return}this.gen.if(e),this.error(),this.allErrors?this.gen.endIf():this.gen.else()}fail$data(e){if(!this.$data)return this.fail(e);let{schemaCode:t}=this;this.fail((0,c._)`${t} !== undefined && (${(0,c.or)(this.invalid$data(),e)})`)}error(e,t,n){if(t){this.setParams(t),this._error(e,n),this.setParams({});return}this._error(e,n)}_error(e,t){(e?f.reportExtraError:f.reportError)(this,this.def.error,t)}$dataError(){(0,f.reportError)(this,this.def.$dataError||f.keyword$DataError)}reset(){if(this.errsCount===void 0)throw Error(`add "trackErrors" to keyword definition`);(0,f.resetErrorsCount)(this.gen,this.errsCount)}ok(e){this.allErrors||this.gen.if(e)}setParams(e,t){t?Object.assign(this.params,e):this.params=e}block$data(e,t,n=c.nil){this.gen.block(()=>{this.check$data(e,n),t()})}check$data(e=c.nil,t=c.nil){if(!this.$data)return;let{gen:n,schemaCode:r,schemaType:i,def:a}=this;n.if((0,c.or)((0,c._)`${r} === undefined`,t)),e!==c.nil&&n.assign(e,!0),(i.length||a.validateSchema)&&(n.elseIf(this.invalid$data()),this.$dataError(),e!==c.nil&&n.assign(e,!1)),n.else()}invalid$data(){let{gen:e,schemaCode:t,schemaType:n,def:r,it:a}=this;return(0,c.or)(o(),s());function o(){if(n.length){if(!(t instanceof c.Name))throw Error(`ajv implementation error`);let e=Array.isArray(n)?n:[n];return(0,c._)`${(0,i.checkDataTypes)(e,t,a.opts.strictNumbers,i.DataType.Wrong)}`}return c.nil}function s(){if(r.validateSchema){let n=e.scopeValue(`validate$data`,{ref:r.validateSchema});return(0,c._)`!${n}(${t})`}return c.nil}}subschema(e,t){let n=(0,s.getSubschema)(this.it,e);(0,s.extendSubschemaData)(n,this.it,e),(0,s.extendSubschemaMode)(n,e);let r={...this.it,...n,items:void 0,props:void 0};return b(r,t),r}mergeEvaluated(e,t){let{it:n,gen:r}=this;n.opts.unevaluated&&(n.props!==!0&&e.props!==void 0&&(n.props=d.mergeEvaluated.props(r,e.props,n.props,t)),n.items!==!0&&e.items!==void 0&&(n.items=d.mergeEvaluated.items(r,e.items,n.items,t)))}mergeValidEvaluated(e,t){let{it:n,gen:r}=this;if(n.opts.unevaluated&&(n.props!==!0||n.items!==!0))return r.if(t,()=>this.mergeEvaluated(e,c.Name)),!0}};e.KeywordCxt=he;function ge(e,t,n,r){let i=new he(e,n,t);`code`in n?n.code(i,r):i.$data&&n.validate?(0,o.funcKeywordCode)(i,n):`macro`in n?(0,o.macroKeywordCode)(i,n):(n.compile||n.validate)&&(0,o.funcKeywordCode)(i,n)}var _e=/^\/(?:[^~]|~0|~1)*$/,ve=/^([0-9]+)(#|\/(?:[^~]|~0|~1)*)?$/;function ye(e,{dataLevel:t,dataNames:n,dataPathArr:r}){let i,a;if(e===``)return l.default.rootData;if(e[0]===`/`){if(!_e.test(e))throw Error(`Invalid JSON-pointer: ${e}`);i=e,a=l.default.rootData}else{let o=ve.exec(e);if(!o)throw Error(`Invalid JSON-pointer: ${e}`);let s=+o[1];if(i=o[2],i===`#`){if(s>=t)throw Error(u(`property/index`,s));return r[t-s]}if(s>t)throw Error(u(`data`,s));if(a=n[t-s],!i)return a}let o=a,s=i.split(`/`);for(let e of s)e&&(a=(0,c._)`${a}${(0,c.getProperty)((0,d.unescapeJsonPointer)(e))}`,o=(0,c._)`${o} && ${a}`);return o;function u(e,n){return`Cannot access ${e} ${n} levels up, current level is ${t}`}}e.getData=ye})),Rd=t((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.default=class extends Error{constructor(e){super(`validation failed`),this.errors=e,this.ajv=this.validation=!0}}})),zd=t((e=>{Object.defineProperty(e,"__esModule",{value:!0});var t=Id();e.default=class extends Error{constructor(e,n,r,i){super(i||`can't resolve reference ${r} from id ${n}`),this.missingRef=(0,t.resolveUrl)(e,n,r),this.missingSchema=(0,t.normalizeId)((0,t.getFullPath)(e,this.missingRef))}}})),Bd=t((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.resolveSchema=e.getCompilingSchema=e.resolveRef=e.compileSchema=e.SchemaEnv=void 0;var t=Z(),n=Rd(),r=wd(),i=Id(),a=Q(),o=Ld(),s=class{constructor(e){this.refs={},this.dynamicAnchors={};let t;typeof e.schema==`object`&&(t=e.schema),this.schema=e.schema,this.schemaId=e.schemaId,this.root=e.root||this,this.baseId=e.baseId??(0,i.normalizeId)(t?.[e.schemaId||`$id`]),this.schemaPath=e.schemaPath,this.localRefs=e.localRefs,this.meta=e.meta,this.$async=t?.$async,this.refs={}}};e.SchemaEnv=s;function c(e){let a=d.call(this,e);if(a)return a;let s=(0,i.getFullPath)(this.opts.uriResolver,e.root.baseId),{es5:c,lines:l}=this.opts.code,{ownProperties:u}=this.opts,f=new t.CodeGen(this.scope,{es5:c,lines:l,ownProperties:u}),p;e.$async&&(p=f.scopeValue(`Error`,{ref:n.default,code:(0,t._)`require("ajv/dist/runtime/validation_error").default`}));let m=f.scopeName(`validate`);e.validateName=m;let h={gen:f,allErrors:this.opts.allErrors,data:r.default.data,parentData:r.default.parentData,parentDataProperty:r.default.parentDataProperty,dataNames:[r.default.data],dataPathArr:[t.nil],dataLevel:0,dataTypes:[],definedProperties:new Set,topSchemaRef:f.scopeValue(`schema`,this.opts.code.source===!0?{ref:e.schema,code:(0,t.stringify)(e.schema)}:{ref:e.schema}),validateName:m,ValidationError:p,schema:e.schema,schemaEnv:e,rootId:s,baseId:e.baseId||s,schemaPath:t.nil,errSchemaPath:e.schemaPath||(this.opts.jtd?``:`#`),errorPath:(0,t._)`""`,opts:this.opts,self:this},g;try{this._compilations.add(e),(0,o.validateFunctionCode)(h),f.optimize(this.opts.code.optimize);let n=f.toString();g=`${f.scopeRefs(r.default.scope)}return ${n}`,this.opts.code.process&&(g=this.opts.code.process(g,e));let i=Function(`${r.default.self}`,`${r.default.scope}`,g)(this,this.scope.get());if(this.scope.value(m,{ref:i}),i.errors=null,i.schema=e.schema,i.schemaEnv=e,e.$async&&(i.$async=!0),this.opts.code.source===!0&&(i.source={validateName:m,validateCode:n,scopeValues:f._values}),this.opts.unevaluated){let{props:e,items:n}=h;i.evaluated={props:e instanceof t.Name?void 0:e,items:n instanceof t.Name?void 0:n,dynamicProps:e instanceof t.Name,dynamicItems:n instanceof t.Name},i.source&&(i.source.evaluated=(0,t.stringify)(i.evaluated))}return e.validate=i,e}catch(t){throw delete e.validate,delete e.validateName,g&&this.logger.error(`Error compiling schema, function code:`,g),t}finally{this._compilations.delete(e)}}e.compileSchema=c;function l(e,t,n){n=(0,i.resolveUrl)(this.opts.uriResolver,t,n);let r=e.refs[n];if(r)return r;let a=p.call(this,e,n);if(a===void 0){let r=e.localRefs?.[n],{schemaId:i}=this.opts;r&&(a=new s({schema:r,schemaId:i,root:e,baseId:t}))}if(a!==void 0)return e.refs[n]=u.call(this,a)}e.resolveRef=l;function u(e){return(0,i.inlineRef)(e.schema,this.opts.inlineRefs)?e.schema:e.validate?e:c.call(this,e)}function d(e){for(let t of this._compilations)if(f(t,e))return t}e.getCompilingSchema=d;function f(e,t){return e.schema===t.schema&&e.root===t.root&&e.baseId===t.baseId}function p(e,t){let n;for(;typeof(n=this.refs[t])==`string`;)t=n;return n||this.schemas[t]||m.call(this,e,t)}function m(e,t){let n=this.opts.uriResolver.parse(t),r=(0,i._getFullPath)(this.opts.uriResolver,n),a=(0,i.getFullPath)(this.opts.uriResolver,e.baseId,void 0);if(Object.keys(e.schema).length>0&&r===a)return g.call(this,n,e);let o=(0,i.normalizeId)(r),l=this.refs[o]||this.schemas[o];if(typeof l==`string`){let t=m.call(this,e,l);return typeof t?.schema==`object`?g.call(this,n,t):void 0}if(typeof l?.schema==`object`){if(l.validate||c.call(this,l),o===(0,i.normalizeId)(t)){let{schema:t}=l,{schemaId:n}=this.opts,r=t[n];return r&&(a=(0,i.resolveUrl)(this.opts.uriResolver,a,r)),new s({schema:t,schemaId:n,root:e,baseId:a})}return g.call(this,n,l)}}e.resolveSchema=m;var h=new Set([`properties`,`patternProperties`,`enum`,`dependencies`,`definitions`]);function g(e,{baseId:t,schema:n,root:r}){if(e.fragment?.[0]!==`/`)return;for(let r of e.fragment.slice(1).split(`/`)){if(typeof n==`boolean`)return;let e=n[(0,a.unescapeFragment)(r)];if(e===void 0)return;n=e;let o=typeof n==`object`&&n[this.opts.schemaId];!h.has(r)&&o&&(t=(0,i.resolveUrl)(this.opts.uriResolver,t,o))}let o;if(typeof n!=`boolean`&&n.$ref&&!(0,a.schemaHasRulesButRef)(n,this.RULES)){let e=(0,i.resolveUrl)(this.opts.uriResolver,t,n.$ref);o=m.call(this,r,e)}let{schemaId:c}=this.opts;if(o||=new s({schema:n,schemaId:c,root:r,baseId:t}),o.schema!==o.root.schema)return o}})),Vd=o({$id:()=>Hd,additionalProperties:()=>!1,default:()=>qd,description:()=>Ud,properties:()=>Kd,required:()=>Gd,type:()=>Wd}),Hd,Ud,Wd,Gd,Kd,qd,Jd=n((()=>{Hd=`https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#`,Ud=`Meta-schema for $data reference (JSON AnySchema extension proposal)`,Wd=`object`,Gd=[`$data`],Kd={$data:{type:`string`,anyOf:[{format:`relative-json-pointer`},{format:`json-pointer`}]}},qd={$id:Hd,description:Ud,type:Wd,required:Gd,properties:Kd,additionalProperties:!1}})),Yd=t(((e,t)=>{var n=RegExp.prototype.test.bind(/^[\da-f]{8}-[\da-f]{4}-[\da-f]{4}-[\da-f]{4}-[\da-f]{12}$/iu),r=RegExp.prototype.test.bind(/^(?:(?:25[0-5]|2[0-4]\d|1\d{2}|[1-9]\d|\d)\.){3}(?:25[0-5]|2[0-4]\d|1\d{2}|[1-9]\d|\d)$/u),i=RegExp.prototype.test.bind(/^\d*$/u),a=RegExp.prototype.test.bind(/^[\da-f]{2}$/iu),o=RegExp.prototype.test.bind(/^[\da-z\-._~]$/iu),s=RegExp.prototype.test.bind(/^[A-Za-z0-9\-._~!$&'()*+,;=:@/]$/u),c=RegExp.prototype.test.bind(/^[A-Za-z0-9\-._~!$&'()*+,;=:@/?]$/u),l=RegExp.prototype.test.bind(/^[A-Za-z0-9\-._~!$&'()*+,;=:]$/u),u=Array(256);{let e=`0123456789ABCDEF`;for(let t=0;t<256;t++)u[t]=`%`+e[t>>4]+e[t&15]}function d(e){return e<2048?u[192|e>>6]+u[128|e&63]:e<65536?u[224|e>>12]+u[128|e>>6&63]+u[128|e&63]:u[240|e>>18]+u[128|e>>12&63]+u[128|e>>6&63]+u[128|e&63]}function f(e){let t=``,n=0,r=0;for(r=0;r=48&&n<=57||n>=65&&n<=70||n>=97&&n<=102))return``;t+=e[r];break}for(r+=1;r=48&&n<=57||n>=65&&n<=70||n>=97&&n<=102))return``;t+=e[r]}return t}var p=RegExp.prototype.test.bind(/^[\dA-Fa-f]{1,4}$/),m=RegExp.prototype.test.bind(/^[vV][\dA-Fa-f]+\.[A-Za-z\d\-._~!$&'()*+,;=:]+$/),h=RegExp.prototype.test.bind(/^[A-Za-z\d\-._~]$/),g=RegExp.prototype.test.bind(/[^!"$&'()*+,\-.;=_`a-z{}~]/u);function _(e){if(e.length===0)return!1;for(let t=0;tn&&(n=i,t=r)):(r=-1,i=0);if(n<2)return e.join(`:`);let a=e.slice(0,t).join(`:`),o=e.slice(t+n).join(`:`);return a+`::`+o}function y(e){let t=e.indexOf(`::`);if(t!==-1&&e.indexOf(`::`,t+1)!==-1)return;let n=t===-1?e.split(`:`):e.slice(0,t).split(`:`),i=t===-1?[]:e.slice(t+2).split(`:`);t!==-1&&(n.length===1&&n[0]===``&&(n.length=0),i.length===1&&i[0]===``&&(i.length=0));let a=n.concat(i),o=0;for(let e=0;e=8)return;let s=a.slice(0,n.length);for(let e=o;e<8;e++)s.push(`0`);for(let e=n.length;eC[e])}function w(e,t=!1){if(e.indexOf(`%`)===-1)return e;let n=``;for(let r=0;r57343)t+=d(i);else if(i<=56319&&n+1=56320&&r<=57343?(t+=d(65536+(i-55296<<10)+(r-56320)),n++):t+=d(65533)}else t+=d(65533)}}return t}function T(e,t=!1){let n=``,r=t&&e[0]!==`/`;for(let t=0;t57343)n+=d(r);else if(r<=56319&&t+1=56320&&i<=57343?(n+=d(65536+(r-55296<<10)+(i-56320)),t++):n+=d(65533)}else n+=d(65533)}}return n}function ie(e,t){let n=``;for(let r=0;r57343)n+=d(t);else if(t<=56319&&r+1=56320&&i<=57343?(n+=d(65536+(t-55296<<10)+(i-56320)),r++):n+=d(65533)}else n+=d(65533)}}return n}function ae(e){return ie(e,l)}function oe(e){return ie(e,c)}function E(e){return ie(e,c)}function D(e){return e>=48&&e<=57||e>=65&&e<=90||e>=97&&e<=122||e===42||e===43||e===45||e===46||e===47||e===64||e===95}function se(e){let t=``;for(let n=0;n57343)t+=d(i);else if(i<=56319&&n+1=56320&&r<=57343?(t+=d(65536+(i-55296<<10)+(r-56320)),n++):t+=d(65533)}else t+=d(65533)}}return t}function ce(e){let t=``;for(let n=0;n{var{isUUID:n}=Yd(),r=/^([\da-z][\d\-a-z]{0,31}):((?:[\w!$'()*+,\-./:;=@]|%[\da-f]{2})+)$/iu,i=[`http`,`https`,`ws`,`wss`,`urn`,`urn:uuid`];function a(e){return i.indexOf(e)!==-1}function o(e){return e.secure===!0?!0:e.secure===!1?!1:e.scheme?e.scheme.length===3&&(e.scheme[0]===`w`||e.scheme[0]===`W`)&&(e.scheme[1]===`s`||e.scheme[1]===`S`)&&(e.scheme[2]===`s`||e.scheme[2]===`S`):!1}function s(e){return e.host||(e.error=e.error||`HTTP URIs must have a host.`),e}function c(e){let t=String(e.scheme).toLowerCase()===`https`;return(e.port===(t?443:80)||e.port===``)&&(e.port=void 0),e.path||=`/`,e}function l(e){return e.secure=o(e),e.resourceName=(e.path||`/`)+(e.query?`?`+e.query:``),e.path=void 0,e.query=void 0,e}function u(e){if((e.port===(o(e)?443:80)||e.port===``)&&(e.port=void 0),typeof e.secure==`boolean`&&(e.scheme=e.secure?`wss`:`ws`,e.secure=void 0),e.resourceName){let t=e.resourceName.indexOf(`?`),n=t===-1?e.resourceName:e.resourceName.slice(0,t);e.path=n&&n!==`/`?n:void 0,e.query=t===-1?void 0:e.resourceName.slice(t+1),e.resourceName=void 0}return e.fragment=void 0,e}function d(e,t){if(!e.path)return e.error=`URN can not be parsed`,e;let n=e.path.match(r);if(n&&n[0]===e.path){let r=t.scheme||e.scheme||`urn`;e.nid=n[1].toLowerCase(),e.nss=n[2];let i=y(`${r}:${t.nid||e.nid}`);e.path=void 0,i&&(e=i.parse(e,t))}else e.error=e.error||`URN can not be parsed.`;return e}function f(e,t){if(e.nid===void 0)throw Error(`URN without nid cannot be serialized`);let n=t.scheme||e.scheme||`urn`,r=e.nid.toLowerCase(),i=y(`${n}:${t.nid||r}`);i&&(e=i.serialize(e,t));let a=e,o=e.nss;return a.path=`${r||t.nid}:${o}`,t.skipEscape=!0,a}function p(e,t){let r=e;return r.uuid=r.nss,r.nss=void 0,!t.tolerant&&(!r.uuid||!n(r.uuid))&&(r.error=r.error||`UUID is not valid.`),r}function m(e){let t=e;return t.nss=(e.uuid||``).toLowerCase(),t}var h={scheme:`http`,domainHost:!0,parse:s,serialize:c},g={scheme:`https`,domainHost:h.domainHost,parse:s,serialize:c},_={scheme:`ws`,domainHost:!0,parse:l,serialize:u},v={http:h,https:g,ws:_,wss:{scheme:`wss`,domainHost:_.domainHost,parse:_.parse,serialize:_.serialize},urn:{scheme:`urn`,parse:d,serialize:f,skipNormalize:!0},"urn:uuid":{scheme:`urn:uuid`,parse:p,serialize:m,skipNormalize:!0}};Object.setPrototypeOf(v,null);function y(e){return e&&(v[e]||v[e.toLowerCase()])||void 0}t.exports={wsIsSecure:o,SCHEMES:v,isValidSchemeName:a,getSchemeHandler:y}})),Zd=t(((e,t)=>{var{normalizeIPv6:n,removeDotSegments:r,recomposeAuthority:i,normalizePercentEncoding:a,normalizePathEncoding:o,serializePathEncoding:s,normalizeQueryFragmentEncoding:c,encodeQuery:l,encodeFragment:u,reescapeHostDelimiters:d,isIPv4:f,nonSimpleDomain:p}=Yd(),{SCHEMES:m,getSchemeHandler:h}=Xd(),g=/^[A-Za-z][A-Za-z0-9+.-]*$/u,_=`URI scheme is malformed.`;function v(e){let t=unescape(String(e));if(!g.test(t))throw TypeError(_);return t}function y(e,t){return typeof e==`string`?e=D(e,t):typeof e==`object`&&(e=E(C(e,t),t)),e}function b(e,t,r){let i=r?Object.assign({scheme:`null`},r):{scheme:`null`},{parsed:a,malformedAuthorityOrPort:o,malformedPercentEncoding:s,malformedSchemeSpecific:c,malformedHost:l,malformedScheme:u}=oe(e,i),{parsed:d,malformedAuthorityOrPort:p,malformedPercentEncoding:m,malformedSchemeSpecific:g,malformedHost:_,malformedScheme:v}=oe(t,i);if(o||p||s||m||c||g||l||_||u||v)throw Error(a.error||d.error||`URI is malformed.`);let y=x(a,d,i,!0),b=h(r&&r.scheme||y.scheme),S=y.host,ee=S!==void 0&&S!==``&&(f(S)||n(S).isIPV6);ae(y,r||{},b,ee);let te=S&&S.indexOf(`%`)!==-1&&!/\P{ASCII}/u.test(S);if(y.error&&!te)throw Error(y.error);return i.skipEscape=!0,C(y,i)}function x(e,t,n,i){let a={};return i||(e=E(C(e,n),n),t=E(C(t,n),n)),n||={},!n.tolerant&&t.scheme?(a.scheme=t.scheme,a.userinfo=t.userinfo,a.host=t.host,a.port=t.port,a.path=r(t.path||``),a.query=t.query):(t.userinfo!==void 0||t.host!==void 0||t.port!==void 0?(a.userinfo=t.userinfo,a.host=t.host,a.port=t.port,a.path=r(t.path||``),a.query=t.query):(t.path?(t.path[0]===`/`?a.path=r(t.path):(a.path=(e.userinfo!==void 0||e.host!==void 0||e.port!==void 0)&&!e.path?`/`+t.path:e.path?e.path.slice(0,e.path.lastIndexOf(`/`)+1)+t.path:t.path,a.path=r(a.path)),a.query=t.query):(a.path=e.path,a.query=t.query===void 0?e.query:t.query),a.userinfo=e.userinfo,a.host=e.host,a.port=e.port),a.scheme=e.scheme),a.fragment=t.fragment,a}function S(e,t,n){let r=ce(e,n),i=ce(t,n);return r!==void 0&&i!==void 0&&r===i}function C(e,t){let n={host:e.host,scheme:e.scheme,userinfo:e.userinfo,port:e.port,path:e.path,query:e.query,nid:e.nid,nss:e.nss,uuid:e.uuid,fragment:e.fragment,reference:e.reference,resourceName:e.resourceName,secure:e.secure,error:``},o=Object.assign({},t),c=[];n.scheme&&=v(n.scheme);let d=h(o.scheme||n.scheme);d&&d.serialize&&d.serialize(n,o);let f=n.userinfo!==void 0||n.host!==void 0||n.port!==void 0,p=!o.skipEscape&&n.scheme===void 0&&!f;n.path!==void 0&&(n.path=o.skipEscape?a(n.path):s(n.path,p)),o.reference!==`suffix`&&n.scheme&&(n.scheme=v(n.scheme),c.push(n.scheme,`:`));let m=i(n);if(m!==void 0&&(o.reference!==`suffix`&&c.push(`//`),c.push(m),n.path&&n.path[0]!==`/`&&c.push(`/`)),n.path!==void 0){let e=n.path;!o.absolutePath&&(!d||!d.absolutePath)&&(e=r(e)),p&&(e=s(e,!0)),m===void 0&&e[0]===`/`&&e[1]===`/`&&(e=`/%2F`+e.slice(2)),c.push(e)}return n.query!==void 0&&c.push(`?`,l(n.query)),n.fragment!==void 0&&c.push(`#`,u(n.fragment)),c.join(``)}var ee=/^(?:([^#/:?]+):)?(?:\/\/((?:([^#/?@]*)@)?(\[[^#/?\]]+\]|[^#/:?]*)(?::(\d*))?))?([^#?]*)(?:\?([^#]*))?(?:#((?:.|[\n\r])*))?/u,te=/^(?:[^#/:?]+:)?\/\/([^/?#]*)/,ne=/^(?:[^#/:?]+:)?([/\\\t\n\r]*)/;function w(e,t){if(t[2]!==void 0&&e.path&&e.path[0]!==`/`)return`URI path must start with "/" when authority is present.`;if(typeof e.port==`number`&&(e.port<0||e.port>65535))return`URI port is malformed.`}function re(e){if(e===void 0)return!1;let t=e.indexOf(`%`);for(;t!==-1;){if(t+2>=e.length||!/^[\da-f]{2}$/iu.test(e.slice(t+1,t+3)))return!0;t=e.indexOf(`%`,t+3)}return!1}function T(e){return e[0]===`[`&&e[e.length-1]===`]`}function ie(e){let t=e[4];return re(e[3])||t!==void 0&&!T(t)&&re(t)||re(e[6])||re(e[7])||re(e[8])}function ae(e,t,n,r){if(!t.unicodeSupport&&(!n||!n.unicodeSupport)&&e.host&&!T(e.host)&&(t.domainHost||n&&n.domainHost)&&r===!1&&p(e.host))try{e.host=new URL(`http://`+e.host).hostname}catch(t){return e.error=e.error||`Host's domain name can not be converted to ASCII: `+t,!0}return!1}function oe(e,t){let r=Object.assign({},t),i={scheme:void 0,userinfo:void 0,host:``,port:void 0,path:``,query:void 0,fragment:void 0},s=!1,l=!1,u=!1,p=!1,v=!1,y=!1,b=!1;r.reference===`suffix`&&(e=r.scheme?r.scheme+`:`+e:`//`+e);let x=e.match(te);x!==null&&x[1].indexOf(`\\`)!==-1&&(i.error=`URI authority must not contain a literal backslash.`,s=!0);let S=e.match(ne);if(S!==null){let e=S[1],t=e.replace(/[\t\n\r]/g,``);t.length>=2&&(t.slice(0,2)===`//`?e.length!==t.length&&(i.error=i.error||`URI authority introducer must not contain whitespace.`,s=!0):(i.error=i.error||`URI authority must not contain a literal backslash.`,s=!0))}let C=e.match(ee);if(C){if(i.scheme=C[1],i.userinfo=C[3],i.host=C[4],i.port=parseInt(C[5],10),i.path=C[6]||``,i.query=C[7],i.fragment=C[8],i.scheme!==void 0){let e=unescape(i.scheme);g.test(e)?i.scheme=e.toLowerCase():(i.error=i.error||_,y=!0)}l=ie(C),l&&(i.error=i.error||`URI contains malformed percent-encoding.`),isNaN(i.port)&&(i.port=C[5]);let t=w(i,C);if(t!==void 0&&(i.error=i.error||t,s=!0),i.host){if(f(i.host)===!1){let e=T(i.host),t=i.host.indexOf(`[`)!==-1||i.host.indexOf(`]`)!==-1,r=n(i.host);b=r.isIPV6||r.isIPVFuture===!0,v=t&&(!e||r.error===!0),i.host=b?r.host:r.host.toLowerCase(),v&&(i.error=i.error||`URI host is malformed.`,s=!0)}else b=!0}i.reference=i.scheme===void 0&&i.userinfo===void 0&&i.host===void 0&&i.port===void 0&&i.query===void 0&&!i.path?`same-document`:i.scheme===void 0?`relative`:i.fragment===void 0?`absolute`:`uri`,r.reference&&r.reference!==`suffix`&&r.reference!==i.reference&&(i.error=i.error||`URI is not a `+r.reference+` reference.`);let x=h(r.scheme||i.scheme);v||(p=ae(i,r,x,b)),(!x||x&&!x.skipNormalize)&&(e.indexOf(`%`)!==-1&&i.host!==void 0&&!v&&(i.host=d(b?i.host:a(i.host,!0),b)),i.path&&=o(i.path),i.query&&=c(i.query),i.fragment&&=c(i.fragment)),x&&x.parse&&(x.parse(i,r),x===m.urn&&i.nid===void 0&&(u=!0))}else i.error=i.error||`URI can not be parsed.`;return{parsed:i,malformedAuthorityOrPort:s,malformedPercentEncoding:l,malformedSchemeSpecific:u,malformedHost:p,malformedScheme:y}}function E(e,t){return oe(e,t).parsed}function D(e,t){return se(e,t).normalized}function se(e,t){let{parsed:n,malformedAuthorityOrPort:r,malformedPercentEncoding:i,malformedSchemeSpecific:a,malformedHost:o,malformedScheme:s}=oe(e,t);return{normalized:r||i||a||o||s?e:C(n,t),malformedAuthorityOrPort:r,malformedPercentEncoding:i,malformedSchemeSpecific:a,malformedHost:o,malformedScheme:s}}function ce(e,t){if(typeof e!=`string`&&typeof e!=`object`)return;let n;try{n=typeof e==`string`?e:C(e,t)}catch{return}let{normalized:r,malformedAuthorityOrPort:i,malformedPercentEncoding:a,malformedSchemeSpecific:o,malformedHost:s,malformedScheme:c}=se(n,t);return i||a||o||s||c?void 0:r}var le={SCHEMES:m,normalize:y,resolve:b,resolveComponent:x,equal:S,serialize:C,parse:E};t.exports=le,t.exports.default=le,t.exports.fastUri=le})),Qd=t((e=>{Object.defineProperty(e,"__esModule",{value:!0});var t=Zd();t.code=`require("ajv/dist/runtime/uri").default`,e.default=t})),$d=t((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.CodeGen=e.Name=e.nil=e.stringify=e.str=e._=e.KeywordCxt=void 0;var t=Ld();Object.defineProperty(e,"KeywordCxt",{enumerable:!0,get:function(){return t.KeywordCxt}});var n=Z();Object.defineProperty(e,"_",{enumerable:!0,get:function(){return n._}}),Object.defineProperty(e,"str",{enumerable:!0,get:function(){return n.str}}),Object.defineProperty(e,"stringify",{enumerable:!0,get:function(){return n.stringify}}),Object.defineProperty(e,"nil",{enumerable:!0,get:function(){return n.nil}}),Object.defineProperty(e,"Name",{enumerable:!0,get:function(){return n.Name}}),Object.defineProperty(e,"CodeGen",{enumerable:!0,get:function(){return n.CodeGen}});var r=Rd(),a=zd(),o=Dd(),s=Bd(),c=Z(),l=Id(),u=kd(),d=Q(),f=(Jd(),i(Vd).default),p=Qd(),m=(e,t)=>new RegExp(e,t);m.code=`new RegExp`;var h=[`removeAdditional`,`useDefaults`,`coerceTypes`],g=new Set([`validate`,`serialize`,`parse`,`wrapper`,`root`,`schema`,`keyword`,`pattern`,`formats`,`validate$data`,`func`,`obj`,`Error`]),_={errorDataPath:``,format:"`validateFormats: false` can be used instead.",nullable:`"nullable" keyword is supported by default.`,jsonPointers:`Deprecated jsPropertySyntax can be used instead.`,extendRefs:`Deprecated ignoreKeywordsWithRef can be used instead.`,missingRefs:`Pass empty schema with $id that should be ignored to ajv.addSchema.`,processCode:"Use option `code: {process: (code, schemaEnv: object) => string}`",sourceCode:"Use option `code: {source: true}`",strictDefaults:"It is default now, see option `strict`.",strictKeywords:"It is default now, see option `strict`.",uniqueItems:`"uniqueItems" keyword is always validated.`,unknownFormats:"Disable strict mode or pass `true` to `ajv.addFormat` (or `formats` option).",cache:`Map is used as cache, schema object as key.`,serialize:`Map is used as cache, schema object as key.`,ajvErrors:`It is default now.`},v={ignoreKeywordsWithRef:``,jsPropertySyntax:``,unicode:`"minLength"/"maxLength" account for unicode characters by default.`},y=200;function b(e){let t=e.strict,n=e.code?.optimize,r=n===!0||n===void 0?1:n||0,i=e.code?.regExp??m,a=e.uriResolver??p.default;return{strictSchema:e.strictSchema??t??!0,strictNumbers:e.strictNumbers??t??!0,strictTypes:e.strictTypes??t??`log`,strictTuples:e.strictTuples??t??`log`,strictRequired:e.strictRequired??t??!1,code:e.code?{...e.code,optimize:r,regExp:i}:{optimize:r,regExp:i},loopRequired:e.loopRequired??y,loopEnum:e.loopEnum??y,meta:e.meta??!0,messages:e.messages??!0,inlineRefs:e.inlineRefs??!0,schemaId:e.schemaId??`$id`,addUsedSchema:e.addUsedSchema??!0,validateSchema:e.validateSchema??!0,validateFormats:e.validateFormats??!0,unicodeRegExp:e.unicodeRegExp??!0,int32range:e.int32range??!0,uriResolver:a}}var x=class{constructor(e={}){this.schemas={},this.refs={},this.formats=Object.create(null),this._compilations=new Set,this._loading={},this._cache=new Map,e=this.opts={...e,...b(e)};let{es5:t,lines:n}=this.opts.code;this.scope=new c.ValueScope({scope:{},prefixes:g,es5:t,lines:n}),this.logger=T(e.logger);let r=e.validateFormats;e.validateFormats=!1,this.RULES=(0,o.getRules)(),S.call(this,_,e,`NOT SUPPORTED`),S.call(this,v,e,`DEPRECATED`,`warn`),this._metaOpts=w.call(this),e.formats&&te.call(this),this._addVocabularies(),this._addDefaultMetaSchema(),e.keywords&&ne.call(this,e.keywords),typeof e.meta==`object`&&this.addMetaSchema(e.meta),ee.call(this),e.validateFormats=r}_addVocabularies(){this.addKeyword(`$async`)}_addDefaultMetaSchema(){let{$data:e,meta:t,schemaId:n}=this.opts,r=f;n===`id`&&(r={...f},r.id=r.$id,delete r.$id),t&&e&&this.addMetaSchema(r,r[n],!1)}defaultMeta(){let{meta:e,schemaId:t}=this.opts;return this.opts.defaultMeta=typeof e==`object`?e[t]||e:void 0}validate(e,t){let n;if(typeof e==`string`){if(n=this.getSchema(e),!n)throw Error(`no schema with key or ref "${e}"`)}else n=this.compile(e);let r=n(t);return`$async`in n||(this.errors=n.errors),r}compile(e,t){let n=this._addSchema(e,t);return n.validate||this._compileSchemaEnv(n)}compileAsync(e,t){if(typeof this.opts.loadSchema!=`function`)throw Error(`options.loadSchema should be a function`);let{loadSchema:n}=this.opts;return r.call(this,e,t);async function r(e,t){await i.call(this,e.$schema);let n=this._addSchema(e,t);return n.validate||o.call(this,n)}async function i(e){e&&!this.getSchema(e)&&await r.call(this,{$ref:e},!0)}async function o(e){try{return this._compileSchemaEnv(e)}catch(t){if(!(t instanceof a.default))throw t;return s.call(this,t),await c.call(this,t.missingSchema),o.call(this,e)}}function s({missingSchema:e,missingRef:t}){if(this.refs[e])throw Error(`AnySchema ${e} is loaded but ${t} cannot be resolved`)}async function c(e){let n=await l.call(this,e);this.refs[e]||await i.call(this,n.$schema),this.refs[e]||this.addSchema(n,e,t)}async function l(e){let t=this._loading[e];if(t)return t;try{return await(this._loading[e]=n(e))}finally{delete this._loading[e]}}}addSchema(e,t,n,r=this.opts.validateSchema){if(Array.isArray(e)){for(let t of e)this.addSchema(t,void 0,n,r);return this}let i;if(typeof e==`object`){let{schemaId:t}=this.opts;if(i=e[t],i!==void 0&&typeof i!=`string`)throw Error(`schema ${t} must be string`)}return t=(0,l.normalizeId)(t||i),this._checkUnique(t),this.schemas[t]=this._addSchema(e,n,t,r,!0),this}addMetaSchema(e,t,n=this.opts.validateSchema){return this.addSchema(e,t,!0,n),this}validateSchema(e,t){if(typeof e==`boolean`)return!0;let n;if(n=e.$schema,n!==void 0&&typeof n!=`string`)throw Error(`$schema must be a string`);if(n=n||this.opts.defaultMeta||this.defaultMeta(),!n)return this.logger.warn(`meta-schema not available`),this.errors=null,!0;let r=this.validate(n,e);if(!r&&t){let e=`schema is invalid: `+this.errorsText();if(this.opts.validateSchema===`log`)this.logger.error(e);else throw Error(e)}return r}getSchema(e){let t;for(;typeof(t=C.call(this,e))==`string`;)e=t;if(t===void 0){let{schemaId:n}=this.opts,r=new s.SchemaEnv({schema:{},schemaId:n});if(t=s.resolveSchema.call(this,r,e),!t)return;this.refs[e]=t}return t.validate||this._compileSchemaEnv(t)}removeSchema(e){if(e instanceof RegExp)return this._removeAllSchemas(this.schemas,e),this._removeAllSchemas(this.refs,e),this;switch(typeof e){case`undefined`:return this._removeAllSchemas(this.schemas),this._removeAllSchemas(this.refs),this._cache.clear(),this;case`string`:{let t=C.call(this,e);return typeof t==`object`&&this._cache.delete(t.schema),delete this.schemas[e],delete this.refs[e],this}case`object`:{let t=e;this._cache.delete(t);let n=e[this.opts.schemaId];return n&&(n=(0,l.normalizeId)(n),delete this.schemas[n],delete this.refs[n]),this}default:throw Error(`ajv.removeSchema: invalid parameter`)}}addVocabulary(e){for(let t of e)this.addKeyword(t);return this}addKeyword(e,t){let n;if(typeof e==`string`)n=e,typeof t==`object`&&(this.logger.warn(`these parameters are deprecated, see docs for addKeyword`),t.keyword=n);else if(typeof e==`object`&&t===void 0){if(t=e,n=t.keyword,Array.isArray(n)&&!n.length)throw Error(`addKeywords: keyword must be string or non-empty array`)}else throw Error(`invalid addKeywords parameters`);if(ae.call(this,n,t),!t)return(0,d.eachItem)(n,e=>oe.call(this,e)),this;D.call(this,t);let r={...t,type:(0,u.getJSONTypes)(t.type),schemaType:(0,u.getJSONTypes)(t.schemaType)};return(0,d.eachItem)(n,r.type.length===0?e=>oe.call(this,e,r):e=>r.type.forEach(t=>oe.call(this,e,r,t))),this}getKeyword(e){let t=this.RULES.all[e];return typeof t==`object`?t.definition:!!t}removeKeyword(e){let{RULES:t}=this;delete t.keywords[e],delete t.all[e];for(let n of t.rules){let t=n.rules.findIndex(t=>t.keyword===e);t>=0&&n.rules.splice(t,1)}return this}addFormat(e,t){return typeof t==`string`&&(t=new RegExp(t)),this.formats[e]=t,this}errorsText(e=this.errors,{separator:t=`, `,dataVar:n=`data`}={}){return!e||e.length===0?`No errors`:e.map(e=>`${n}${e.instancePath} ${e.message}`).reduce((e,n)=>e+t+n)}$dataMetaSchema(e,t){let n=this.RULES.all;e=JSON.parse(JSON.stringify(e));for(let r of t){let t=r.split(`/`).slice(1),i=e;for(let e of t)i=i[e];for(let e in n){let t=n[e];if(typeof t!=`object`)continue;let{$data:r}=t.definition,a=i[e];r&&a&&(i[e]=ce(a))}}return e}_removeAllSchemas(e,t){for(let n in e){let r=e[n];(!t||t.test(n))&&(typeof r==`string`?delete e[n]:r&&!r.meta&&(this._cache.delete(r.schema),delete e[n]))}}_addSchema(e,t,n,r=this.opts.validateSchema,i=this.opts.addUsedSchema){let a,{schemaId:o}=this.opts;if(typeof e==`object`)a=e[o];else if(this.opts.jtd)throw Error(`schema must be object`);else if(typeof e!=`boolean`)throw Error(`schema must be object or boolean`);let c=this._cache.get(e);if(c!==void 0)return c;n=(0,l.normalizeId)(a||n);let u=l.getSchemaRefs.call(this,e,n);return c=new s.SchemaEnv({schema:e,schemaId:o,meta:t,baseId:n,localRefs:u}),this._cache.set(c.schema,c),i&&!n.startsWith(`#`)&&(n&&this._checkUnique(n),this.refs[n]=c),r&&this.validateSchema(e,!0),c}_checkUnique(e){if(this.schemas[e]||this.refs[e])throw Error(`schema with key or id "${e}" already exists`)}_compileSchemaEnv(e){if(e.meta?this._compileMetaSchema(e):s.compileSchema.call(this,e),!e.validate)throw Error(`ajv implementation error`);return e.validate}_compileMetaSchema(e){let t=this.opts;this.opts=this._metaOpts;try{s.compileSchema.call(this,e)}finally{this.opts=t}}};x.ValidationError=r.default,x.MissingRefError=a.default,e.default=x;function S(e,t,n,r=`error`){for(let i in e){let a=i;a in t&&this.logger[r](`${n}: option ${i}. ${e[a]}`)}}function C(e){return e=(0,l.normalizeId)(e),this.schemas[e]||this.refs[e]}function ee(){let e=this.opts.schemas;if(e){if(Array.isArray(e))this.addSchema(e);else for(let t in e)this.addSchema(e[t],t)}}function te(){for(let e in this.opts.formats){let t=this.opts.formats[e];t&&this.addFormat(e,t)}}function ne(e){if(Array.isArray(e)){this.addVocabulary(e);return}this.logger.warn(`keywords option as map is deprecated, pass array`);for(let t in e){let n=e[t];n.keyword||=t,this.addKeyword(n)}}function w(){let e={...this.opts};for(let t of h)delete e[t];return e}var re={log(){},warn(){},error(){}};function T(e){if(e===!1)return re;if(e===void 0)return console;if(e.log&&e.warn&&e.error)return e;throw Error(`logger must implement log, warn and error methods`)}var ie=/^[a-z_$][a-z0-9_$:-]*$/i;function ae(e,t){let{RULES:n}=this;if((0,d.eachItem)(e,e=>{if(n.keywords[e])throw Error(`Keyword ${e} is already defined`);if(!ie.test(e))throw Error(`Keyword ${e} has invalid name`)}),t&&t.$data&&!(`code`in t||`validate`in t))throw Error(`$data keyword must have "code" or "validate" function`)}function oe(e,t,n){var r;let i=t?.post;if(n&&i)throw Error(`keyword with "post" flag cannot have "type"`);let{RULES:a}=this,o=i?a.post:a.rules.find(({type:e})=>e===n);if(o||(o={type:n,rules:[]},a.rules.push(o)),a.keywords[e]=!0,!t)return;let s={keyword:e,definition:{...t,type:(0,u.getJSONTypes)(t.type),schemaType:(0,u.getJSONTypes)(t.schemaType)}};t.before?E.call(this,o,s,t.before):o.rules.push(s),a.all[e]=s,(r=t.implements)==null||r.forEach(e=>this.addKeyword(e))}function E(e,t,n){let r=e.rules.findIndex(e=>e.keyword===n);r>=0?e.rules.splice(r,0,t):(e.rules.push(t),this.logger.warn(`rule ${n} is not defined`))}function D(e){let{metaSchema:t}=e;t!==void 0&&(e.$data&&this.opts.$data&&(t=ce(t)),e.validateSchema=this.compile(t,!0))}var se={$ref:`https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#`};function ce(e){return{anyOf:[e,se]}}})),ef=t((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.default={keyword:`id`,code(){throw Error(`NOT SUPPORTED: keyword "id", use "$id" for schema ID`)}}})),tf=t((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.callRef=e.getValidate=void 0;var t=zd(),n=jd(),r=Z(),i=wd(),a=Bd(),o=Q(),s={keyword:`$ref`,schemaType:`string`,code(e){let{gen:n,schema:i,it:o}=e,{baseId:s,schemaEnv:u,validateName:d,opts:f,self:p}=o,{root:m}=u;if((i===`#`||i===`#/`)&&s===m.baseId)return g();let h=a.resolveRef.call(p,m,s,i);if(h===void 0)throw new t.default(o.opts.uriResolver,s,i);if(h instanceof a.SchemaEnv)return _(h);return v(h);function g(){if(u===m)return l(e,d,u,u.$async);let t=n.scopeValue(`root`,{ref:m});return l(e,(0,r._)`${t}.validate`,m,m.$async)}function _(t){l(e,c(e,t),t,t.$async)}function v(t){let a=n.scopeValue(`schema`,f.code.source===!0?{ref:t,code:(0,r.stringify)(t)}:{ref:t}),o=n.name(`valid`),s=e.subschema({schema:t,dataTypes:[],schemaPath:r.nil,topSchemaRef:a,errSchemaPath:i},o);e.mergeEvaluated(s),e.ok(o)}}};function c(e,t){let{gen:n}=e;return t.validate?n.scopeValue(`validate`,{ref:t.validate}):(0,r._)`${n.scopeValue(`wrapper`,{ref:t})}.validate`}e.getValidate=c;function l(e,t,a,s){let{gen:c,it:l}=e,{allErrors:u,schemaEnv:d,opts:f}=l,p=f.passContext?i.default.this:r.nil;s?m():h();function m(){if(!d.$async)throw Error(`async schema referenced by sync schema`);let i=c.let(`valid`);c.try(()=>{c.code((0,r._)`await ${(0,n.callValidateCode)(e,t,p)}`),_(t),u||c.assign(i,!0)},e=>{c.if((0,r._)`!(${e} instanceof ${l.ValidationError})`,()=>c.throw(e)),g(e),u||c.assign(i,!1)}),e.ok(i)}function h(){e.result((0,n.callValidateCode)(e,t,p),()=>_(t),()=>g(t))}function g(e){let t=(0,r._)`${e}.errors`;c.assign(i.default.vErrors,(0,r._)`${i.default.vErrors} === null ? ${t} : ${i.default.vErrors}.concat(${t})`),c.assign(i.default.errors,(0,r._)`${i.default.vErrors}.length`)}function _(e){if(!l.opts.unevaluated)return;let t=a?.validate?.evaluated;if(l.props!==!0){if(t&&!t.dynamicProps)t.props!==void 0&&(l.props=o.mergeEvaluated.props(c,t.props,l.props));else{let t=c.var(`props`,(0,r._)`${e}.evaluated.props`);l.props=o.mergeEvaluated.props(c,t,l.props,r.Name)}}if(l.items!==!0){if(t&&!t.dynamicItems)t.items!==void 0&&(l.items=o.mergeEvaluated.items(c,t.items,l.items));else{let t=c.var(`items`,(0,r._)`${e}.evaluated.items`);l.items=o.mergeEvaluated.items(c,t,l.items,r.Name)}}}}e.callRef=l,e.default=s})),nf=t((e=>{Object.defineProperty(e,"__esModule",{value:!0});var t=ef(),n=tf();e.default=[`$schema`,`$id`,`$defs`,`$vocabulary`,{keyword:`$comment`},`definitions`,t.default,n.default]})),rf=t((e=>{Object.defineProperty(e,"__esModule",{value:!0});var t=Z(),n=t.operators,r={maximum:{okStr:`<=`,ok:n.LTE,fail:n.GT},minimum:{okStr:`>=`,ok:n.GTE,fail:n.LT},exclusiveMaximum:{okStr:`<`,ok:n.LT,fail:n.GTE},exclusiveMinimum:{okStr:`>`,ok:n.GT,fail:n.LTE}};e.default={keyword:Object.keys(r),type:`number`,schemaType:`number`,$data:!0,error:{message:({keyword:e,schemaCode:n})=>(0,t.str)`must be ${r[e].okStr} ${n}`,params:({keyword:e,schemaCode:n})=>(0,t._)`{comparison: ${r[e].okStr}, limit: ${n}}`},code(e){let{keyword:n,data:i,schemaCode:a}=e;e.fail$data((0,t._)`${i} ${r[n].fail} ${a} || isNaN(${i})`)}}})),af=t((e=>{Object.defineProperty(e,"__esModule",{value:!0});var t=Z();e.default={keyword:`multipleOf`,type:`number`,schemaType:`number`,$data:!0,error:{message:({schemaCode:e})=>(0,t.str)`must be multiple of ${e}`,params:({schemaCode:e})=>(0,t._)`{multipleOf: ${e}}`},code(e){let{gen:n,data:r,schemaCode:i,it:a}=e,o=a.opts.multipleOfPrecision,s=n.let(`res`),c=o?(0,t._)`Math.abs(Math.round(${s}) - ${s}) > 1e-${o}`:(0,t._)`${s} !== parseInt(${s})`;e.fail$data((0,t._)`(${i} === 0 || (${s} = ${r}/${i}, ${c}))`)}}})),of=t((e=>{Object.defineProperty(e,"__esModule",{value:!0});function t(e){let t=e.length,n=0,r=0,i;for(;r=55296&&i<=56319&&r{Object.defineProperty(e,"__esModule",{value:!0});var t=Z(),n=Q(),r=of();e.default={keyword:[`maxLength`,`minLength`],type:`string`,schemaType:`number`,$data:!0,error:{message({keyword:e,schemaCode:n}){let r=e===`maxLength`?`more`:`fewer`;return(0,t.str)`must NOT have ${r} than ${n} characters`},params:({schemaCode:e})=>(0,t._)`{limit: ${e}}`},code(e){let{keyword:i,data:a,schemaCode:o,it:s}=e,c=i===`maxLength`?t.operators.GT:t.operators.LT,l=s.opts.unicode===!1?(0,t._)`${a}.length`:(0,t._)`${(0,n.useFunc)(e.gen,r.default)}(${a})`;e.fail$data((0,t._)`${l} ${c} ${o}`)}}})),cf=t((e=>{Object.defineProperty(e,"__esModule",{value:!0});var t=jd(),n=Q(),r=Z();e.default={keyword:`pattern`,type:`string`,schemaType:`string`,$data:!0,error:{message:({schemaCode:e})=>(0,r.str)`must match pattern "${e}"`,params:({schemaCode:e})=>(0,r._)`{pattern: ${e}}`},code(e){let{gen:i,data:a,$data:o,schema:s,schemaCode:c,it:l}=e,u=l.opts.unicodeRegExp?`u`:``;if(o){let{regExp:t}=l.opts.code,o=t.code===`new RegExp`?(0,r._)`new RegExp`:(0,n.useFunc)(i,t),s=i.let(`valid`);i.try(()=>i.assign(s,(0,r._)`${o}(${c}, ${u}).test(${a})`),()=>i.assign(s,!1)),e.fail$data((0,r._)`!${s}`)}else{let n=(0,t.usePattern)(e,s);e.fail$data((0,r._)`!${n}.test(${a})`)}}}})),lf=t((e=>{Object.defineProperty(e,"__esModule",{value:!0});var t=Z();e.default={keyword:[`maxProperties`,`minProperties`],type:`object`,schemaType:`number`,$data:!0,error:{message({keyword:e,schemaCode:n}){let r=e===`maxProperties`?`more`:`fewer`;return(0,t.str)`must NOT have ${r} than ${n} properties`},params:({schemaCode:e})=>(0,t._)`{limit: ${e}}`},code(e){let{keyword:n,data:r,schemaCode:i}=e,a=n===`maxProperties`?t.operators.GT:t.operators.LT;e.fail$data((0,t._)`Object.keys(${r}).length ${a} ${i}`)}}})),uf=t((e=>{Object.defineProperty(e,"__esModule",{value:!0});var t=jd(),n=Z(),r=Q();e.default={keyword:`required`,type:`object`,schemaType:`array`,$data:!0,error:{message:({params:{missingProperty:e}})=>(0,n.str)`must have required property '${e}'`,params:({params:{missingProperty:e}})=>(0,n._)`{missingProperty: ${e}}`},code(e){let{gen:i,schema:a,schemaCode:o,data:s,$data:c,it:l}=e,{opts:u}=l;if(!c&&a.length===0)return;let d=a.length>=u.loopRequired;if(l.allErrors?f():p(),u.strictRequired){let t=e.parentSchema.properties,{definedProperties:n}=e.it;for(let e of a)if(t?.[e]===void 0&&!n.has(e)){let t=`required property "${e}" is not defined at "${l.schemaEnv.baseId+l.errSchemaPath}" (strictRequired)`;(0,r.checkStrictMode)(l,t,l.opts.strictRequired)}}function f(){if(d||c)e.block$data(n.nil,m);else for(let n of a)(0,t.checkReportMissingProp)(e,n)}function p(){let n=i.let(`missing`);if(d||c){let t=i.let(`valid`,!0);e.block$data(t,()=>h(n,t)),e.ok(t)}else i.if((0,t.checkMissingProp)(e,a,n)),(0,t.reportMissingProp)(e,n),i.else()}function m(){i.forOf(`prop`,o,n=>{e.setParams({missingProperty:n}),i.if((0,t.noPropertyInData)(i,s,n,u.ownProperties),()=>e.error())})}function h(r,a){e.setParams({missingProperty:r}),i.forOf(r,o,()=>{i.assign(a,(0,t.propertyInData)(i,s,r,u.ownProperties)),i.if((0,n.not)(a),()=>{e.error(),i.break()})},n.nil)}}}})),df=t((e=>{Object.defineProperty(e,"__esModule",{value:!0});var t=Z();e.default={keyword:[`maxItems`,`minItems`],type:`array`,schemaType:`number`,$data:!0,error:{message({keyword:e,schemaCode:n}){let r=e===`maxItems`?`more`:`fewer`;return(0,t.str)`must NOT have ${r} than ${n} items`},params:({schemaCode:e})=>(0,t._)`{limit: ${e}}`},code(e){let{keyword:n,data:r,schemaCode:i}=e,a=n===`maxItems`?t.operators.GT:t.operators.LT;e.fail$data((0,t._)`${r}.length ${a} ${i}`)}}})),ff=t((e=>{Object.defineProperty(e,"__esModule",{value:!0});var t=Pd();t.code=`require("ajv/dist/runtime/equal").default`,e.default=t})),pf=t((e=>{Object.defineProperty(e,"__esModule",{value:!0});var t=kd(),n=Z(),r=Q(),i=ff();e.default={keyword:`uniqueItems`,type:`array`,schemaType:`boolean`,$data:!0,error:{message:({params:{i:e,j:t}})=>(0,n.str)`must NOT have duplicate items (items ## ${t} and ${e} are identical)`,params:({params:{i:e,j:t}})=>(0,n._)`{i: ${e}, j: ${t}}`},code(e){let{gen:a,data:o,$data:s,schema:c,parentSchema:l,schemaCode:u,it:d}=e;if(!s&&!c)return;let f=a.let(`valid`),p=l.items?(0,t.getSchemaTypes)(l.items):[];e.block$data(f,m,(0,n._)`${u} === false`),e.ok(f);function m(){let t=a.let(`i`,(0,n._)`${o}.length`),r=a.let(`j`);e.setParams({i:t,j:r}),a.assign(f,!0),a.if((0,n._)`${t} > 1`,()=>(h()?g:_)(t,r))}function h(){return p.length>0&&!p.some(e=>e===`object`||e===`array`)}function g(r,i){let s=a.name(`item`),c=(0,t.checkDataTypes)(p,s,d.opts.strictNumbers,t.DataType.Wrong),l=a.const(`indices`,(0,n._)`{}`);a.for((0,n._)`;${r}--;`,()=>{a.let(s,(0,n._)`${o}[${r}]`),a.if(c,(0,n._)`continue`),p.length>1&&a.if((0,n._)`typeof ${s} == "string"`,(0,n._)`${s} += "_"`),a.if((0,n._)`typeof ${l}[${s}] == "number"`,()=>{a.assign(i,(0,n._)`${l}[${s}]`),e.error(),a.assign(f,!1).break()}).code((0,n._)`${l}[${s}] = ${r}`)})}function _(t,s){let c=(0,r.useFunc)(a,i.default),l=a.name(`outer`);a.label(l).for((0,n._)`;${t}--;`,()=>a.for((0,n._)`${s} = ${t}; ${s}--;`,()=>a.if((0,n._)`${c}(${o}[${t}], ${o}[${s}])`,()=>{e.error(),a.assign(f,!1).break(l)})))}}}})),mf=t((e=>{Object.defineProperty(e,"__esModule",{value:!0});var t=Z(),n=Q(),r=ff();e.default={keyword:`const`,$data:!0,error:{message:`must be equal to constant`,params:({schemaCode:e})=>(0,t._)`{allowedValue: ${e}}`},code(e){let{gen:i,data:a,$data:o,schemaCode:s,schema:c}=e;o||c&&typeof c==`object`?e.fail$data((0,t._)`!${(0,n.useFunc)(i,r.default)}(${a}, ${s})`):e.fail((0,t._)`${c} !== ${a}`)}}})),hf=t((e=>{Object.defineProperty(e,"__esModule",{value:!0});var t=Z(),n=Q(),r=ff();e.default={keyword:`enum`,schemaType:`array`,$data:!0,error:{message:`must be equal to one of the allowed values`,params:({schemaCode:e})=>(0,t._)`{allowedValues: ${e}}`},code(e){let{gen:i,data:a,$data:o,schema:s,schemaCode:c,it:l}=e;if(!o&&s.length===0)throw Error(`enum must have non-empty array`);let u=s.length>=l.opts.loopEnum,d,f=()=>d??=(0,n.useFunc)(i,r.default),p;if(u||o)p=i.let(`valid`),e.block$data(p,m);else{if(!Array.isArray(s))throw Error(`ajv implementation error`);let e=i.const(`vSchema`,c);p=(0,t.or)(...s.map((t,n)=>h(e,n)))}e.pass(p);function m(){i.assign(p,!1),i.forOf(`v`,c,e=>i.if((0,t._)`${f()}(${a}, ${e})`,()=>i.assign(p,!0).break()))}function h(e,n){let r=s[n];return typeof r==`object`&&r?(0,t._)`${f()}(${a}, ${e}[${n}])`:(0,t._)`${a} === ${r}`}}}})),gf=t((e=>{Object.defineProperty(e,"__esModule",{value:!0});var t=rf(),n=af(),r=sf(),i=cf(),a=lf(),o=uf(),s=df(),c=pf(),l=mf(),u=hf();e.default=[t.default,n.default,r.default,i.default,a.default,o.default,s.default,c.default,{keyword:`type`,schemaType:[`string`,`array`]},{keyword:`nullable`,schemaType:`boolean`},l.default,u.default]})),_f=t((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.validateAdditionalItems=void 0;var t=Z(),n=Q(),r={keyword:`additionalItems`,type:`array`,schemaType:[`boolean`,`object`],before:`uniqueItems`,error:{message:({params:{len:e}})=>(0,t.str)`must NOT have more than ${e} items`,params:({params:{len:e}})=>(0,t._)`{limit: ${e}}`},code(e){let{parentSchema:t,it:r}=e,{items:a}=t;if(!Array.isArray(a)){(0,n.checkStrictMode)(r,`"additionalItems" is ignored when "items" is not an array of schemas`);return}i(e,a)}};function i(e,r){let{gen:i,schema:a,data:o,keyword:s,it:c}=e;c.items=!0;let l=i.const(`len`,(0,t._)`${o}.length`);if(a===!1)e.setParams({len:r.length}),e.pass((0,t._)`${l} <= ${r.length}`);else if(typeof a==`object`&&!(0,n.alwaysValidSchema)(c,a)){let n=i.var(`valid`,(0,t._)`${l} <= ${r.length}`);i.if((0,t.not)(n),()=>u(n)),e.ok(n)}function u(a){i.forRange(`i`,r.length,l,r=>{e.subschema({keyword:s,dataProp:r,dataPropType:n.Type.Num},a),c.allErrors||i.if((0,t.not)(a),()=>i.break())})}}e.validateAdditionalItems=i,e.default=r})),vf=t((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.validateTuple=void 0;var t=Z(),n=Q(),r=jd(),i={keyword:`items`,type:`array`,schemaType:[`object`,`array`,`boolean`],before:`uniqueItems`,code(e){let{schema:t,it:i}=e;if(Array.isArray(t))return a(e,`additionalItems`,t);i.items=!0,!(0,n.alwaysValidSchema)(i,t)&&e.ok((0,r.validateArray)(e))}};function a(e,r,i=e.schema){let{gen:a,parentSchema:o,data:s,keyword:c,it:l}=e;f(o),l.opts.unevaluated&&i.length&&l.items!==!0&&(l.items=n.mergeEvaluated.items(a,i.length,l.items));let u=a.name(`valid`),d=a.const(`len`,(0,t._)`${s}.length`);i.forEach((r,i)=>{(0,n.alwaysValidSchema)(l,r)||(a.if((0,t._)`${d} > ${i}`,()=>e.subschema({keyword:c,schemaProp:i,dataProp:i},u)),e.ok(u))});function f(e){let{opts:t,errSchemaPath:a}=l,o=i.length,s=o===e.minItems&&(o===e.maxItems||e[r]===!1);if(t.strictTuples&&!s){let e=`"${c}" is ${o}-tuple, but minItems or maxItems/${r} are not specified or different at path "${a}"`;(0,n.checkStrictMode)(l,e,t.strictTuples)}}}e.validateTuple=a,e.default=i})),yf=t((e=>{Object.defineProperty(e,"__esModule",{value:!0});var t=vf();e.default={keyword:`prefixItems`,type:`array`,schemaType:[`array`],before:`uniqueItems`,code:e=>(0,t.validateTuple)(e,`items`)}})),bf=t((e=>{Object.defineProperty(e,"__esModule",{value:!0});var t=Z(),n=Q(),r=jd(),i=_f();e.default={keyword:`items`,type:`array`,schemaType:[`object`,`boolean`],before:`uniqueItems`,error:{message:({params:{len:e}})=>(0,t.str)`must NOT have more than ${e} items`,params:({params:{len:e}})=>(0,t._)`{limit: ${e}}`},code(e){let{schema:t,parentSchema:a,it:o}=e,{prefixItems:s}=a;o.items=!0,!(0,n.alwaysValidSchema)(o,t)&&(s?(0,i.validateAdditionalItems)(e,s):e.ok((0,r.validateArray)(e)))}}})),xf=t((e=>{Object.defineProperty(e,"__esModule",{value:!0});var t=Z(),n=Q();e.default={keyword:`contains`,type:`array`,schemaType:[`object`,`boolean`],before:`uniqueItems`,trackErrors:!0,error:{message:({params:{min:e,max:n}})=>n===void 0?(0,t.str)`must contain at least ${e} valid item(s)`:(0,t.str)`must contain at least ${e} and no more than ${n} valid item(s)`,params:({params:{min:e,max:n}})=>n===void 0?(0,t._)`{minContains: ${e}}`:(0,t._)`{minContains: ${e}, maxContains: ${n}}`},code(e){let{gen:r,schema:i,parentSchema:a,data:o,it:s}=e,c,l,{minContains:u,maxContains:d}=a;s.opts.next?(c=u===void 0?1:u,l=d):c=1;let f=r.const(`len`,(0,t._)`${o}.length`);if(e.setParams({min:c,max:l}),l===void 0&&c===0){(0,n.checkStrictMode)(s,`"minContains" == 0 without "maxContains": "contains" keyword ignored`);return}if(l!==void 0&&c>l){(0,n.checkStrictMode)(s,`"minContains" > "maxContains" is always invalid`),e.fail();return}if((0,n.alwaysValidSchema)(s,i)){let n=(0,t._)`${f} >= ${c}`;l!==void 0&&(n=(0,t._)`${n} && ${f} <= ${l}`),e.pass(n);return}s.items=!0;let p=r.name(`valid`);l===void 0&&c===1?h(p,()=>r.if(p,()=>r.break())):c===0?(r.let(p,!0),l!==void 0&&r.if((0,t._)`${o}.length > 0`,m)):(r.let(p,!1),m()),e.result(p,()=>e.reset());function m(){let e=r.name(`_valid`),t=r.let(`count`,0);h(e,()=>r.if(e,()=>g(t)))}function h(t,i){r.forRange(`i`,0,f,r=>{e.subschema({keyword:`contains`,dataProp:r,dataPropType:n.Type.Num,compositeRule:!0},t),i()})}function g(e){r.code((0,t._)`${e}++`),l===void 0?r.if((0,t._)`${e} >= ${c}`,()=>r.assign(p,!0).break()):(r.if((0,t._)`${e} > ${l}`,()=>r.assign(p,!1).break()),c===1?r.assign(p,!0):r.if((0,t._)`${e} >= ${c}`,()=>r.assign(p,!0)))}}}})),Sf=t((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.validateSchemaDeps=e.validatePropertyDeps=e.error=void 0;var t=Z(),n=Q(),r=jd();e.error={message:({params:{property:e,depsCount:n,deps:r}})=>{let i=n===1?`property`:`properties`;return(0,t.str)`must have ${i} ${r} when property ${e} is present`},params:({params:{property:e,depsCount:n,deps:r,missingProperty:i}})=>(0,t._)`{property: ${e}, + missingProperty: ${i}, + depsCount: ${n}, + deps: ${r}}`};var i={keyword:`dependencies`,type:`object`,schemaType:`object`,error:e.error,code(e){let[t,n]=a(e);o(e,t),s(e,n)}};function a({schema:e}){let t={},n={};for(let r in e){if(r===`__proto__`)continue;let i=Array.isArray(e[r])?t:n;i[r]=e[r]}return[t,n]}function o(e,n=e.schema){let{gen:i,data:a,it:o}=e;if(Object.keys(n).length===0)return;let s=i.let(`missing`);for(let c in n){let l=n[c];if(l.length===0)continue;let u=(0,r.propertyInData)(i,a,c,o.opts.ownProperties);e.setParams({property:c,depsCount:l.length,deps:l.join(`, `)}),o.allErrors?i.if(u,()=>{for(let t of l)(0,r.checkReportMissingProp)(e,t)}):(i.if((0,t._)`${u} && (${(0,r.checkMissingProp)(e,l,s)})`),(0,r.reportMissingProp)(e,s),i.else())}}e.validatePropertyDeps=o;function s(e,t=e.schema){let{gen:i,data:a,keyword:o,it:s}=e,c=i.name(`valid`);for(let l in t)(0,n.alwaysValidSchema)(s,t[l])||(i.if((0,r.propertyInData)(i,a,l,s.opts.ownProperties),()=>{let t=e.subschema({keyword:o,schemaProp:l},c);e.mergeValidEvaluated(t,c)},()=>i.var(c,!0)),e.ok(c))}e.validateSchemaDeps=s,e.default=i})),Cf=t((e=>{Object.defineProperty(e,"__esModule",{value:!0});var t=Z(),n=Q();e.default={keyword:`propertyNames`,type:`object`,schemaType:[`object`,`boolean`],error:{message:`property name must be valid`,params:({params:e})=>(0,t._)`{propertyName: ${e.propertyName}}`},code(e){let{gen:r,schema:i,data:a,it:o}=e;if((0,n.alwaysValidSchema)(o,i))return;let s=r.name(`valid`);r.forIn(`key`,a,n=>{e.setParams({propertyName:n}),e.subschema({keyword:`propertyNames`,data:n,dataTypes:[`string`],propertyName:n,compositeRule:!0},s),r.if((0,t.not)(s),()=>{e.error(!0),o.allErrors||r.break()})}),e.ok(s)}}})),wf=t((e=>{Object.defineProperty(e,"__esModule",{value:!0});var t=jd(),n=Z(),r=wd(),i=Q();e.default={keyword:`additionalProperties`,type:[`object`],schemaType:[`boolean`,`object`],allowUndefined:!0,trackErrors:!0,error:{message:`must NOT have additional properties`,params:({params:e})=>(0,n._)`{additionalProperty: ${e.additionalProperty}}`},code(e){let{gen:a,schema:o,parentSchema:s,data:c,errsCount:l,it:u}=e;if(!l)throw Error(`ajv implementation error`);let{allErrors:d,opts:f}=u;if(u.props=!0,f.removeAdditional!==`all`&&(0,i.alwaysValidSchema)(u,o))return;let p=(0,t.allSchemaProperties)(s.properties),m=(0,t.allSchemaProperties)(s.patternProperties);h(),e.ok((0,n._)`${l} === ${r.default.errors}`);function h(){a.forIn(`key`,c,e=>{!p.length&&!m.length?v(e):a.if(g(e),()=>v(e))})}function g(r){let o;if(p.length>8){let e=(0,i.schemaRefOrVal)(u,s.properties,`properties`);o=(0,t.isOwnProperty)(a,e,r)}else o=p.length?(0,n.or)(...p.map(e=>(0,n._)`${r} === ${e}`)):n.nil;return m.length&&(o=(0,n.or)(o,...m.map(i=>(0,n._)`${(0,t.usePattern)(e,i)}.test(${r})`))),(0,n.not)(o)}function _(e){a.code((0,n._)`delete ${c}[${e}]`)}function v(t){if(f.removeAdditional===`all`||f.removeAdditional&&o===!1){_(t);return}if(o===!1){e.setParams({additionalProperty:t}),e.error(),d||a.break();return}if(typeof o==`object`&&!(0,i.alwaysValidSchema)(u,o)){let r=a.name(`valid`);f.removeAdditional===`failing`?(y(t,r,!1),a.if((0,n.not)(r),()=>{e.reset(),_(t)})):(y(t,r),d||a.if((0,n.not)(r),()=>a.break()))}}function y(t,n,r){let a={keyword:`additionalProperties`,dataProp:t,dataPropType:i.Type.Str};r===!1&&Object.assign(a,{compositeRule:!0,createErrors:!1,allErrors:!1}),e.subschema(a,n)}}}})),Tf=t((e=>{Object.defineProperty(e,"__esModule",{value:!0});var t=Ld(),n=jd(),r=Q(),i=wf();e.default={keyword:`properties`,type:`object`,schemaType:`object`,code(e){let{gen:a,schema:o,parentSchema:s,data:c,it:l}=e;l.opts.removeAdditional===`all`&&s.additionalProperties===void 0&&i.default.code(new t.KeywordCxt(l,i.default,`additionalProperties`));let u=(0,n.allSchemaProperties)(o);for(let e of u)l.definedProperties.add(e);l.opts.unevaluated&&u.length&&l.props!==!0&&(l.props=r.mergeEvaluated.props(a,(0,r.toHash)(u),l.props));let d=u.filter(e=>!(0,r.alwaysValidSchema)(l,o[e]));if(d.length===0)return;let f=a.name(`valid`);for(let t of d)p(t)?m(t):(a.if((0,n.propertyInData)(a,c,t,l.opts.ownProperties)),m(t),l.allErrors||a.else().var(f,!0),a.endIf()),e.it.definedProperties.add(t),e.ok(f);function p(e){return l.opts.useDefaults&&!l.compositeRule&&o[e].default!==void 0}function m(t){e.subschema({keyword:`properties`,schemaProp:t,dataProp:t},f)}}}})),Ef=t((e=>{Object.defineProperty(e,"__esModule",{value:!0});var t=jd(),n=Z(),r=Q(),i=Q();e.default={keyword:`patternProperties`,type:`object`,schemaType:`object`,code(e){let{gen:a,schema:o,data:s,parentSchema:c,it:l}=e,{opts:u}=l,d=(0,t.allSchemaProperties)(o),f=d.filter(e=>(0,r.alwaysValidSchema)(l,o[e]));if(d.length===0||f.length===d.length&&(!l.opts.unevaluated||l.props===!0))return;let p=u.strictSchema&&!u.allowMatchingProperties&&c.properties,m=a.name(`valid`);l.props!==!0&&!(l.props instanceof n.Name)&&(l.props=(0,i.evaluatedPropsToName)(a,l.props));let{props:h}=l;g();function g(){for(let e of d)p&&_(e),l.allErrors?v(e):(a.var(m,!0),v(e),a.if(m))}function _(e){for(let t in p)new RegExp(e).test(t)&&(0,r.checkStrictMode)(l,`property ${t} matches pattern ${e} (use allowMatchingProperties)`)}function v(r){a.forIn(`key`,s,o=>{a.if((0,n._)`${(0,t.usePattern)(e,r)}.test(${o})`,()=>{let t=f.includes(r);t||e.subschema({keyword:`patternProperties`,schemaProp:r,dataProp:o,dataPropType:i.Type.Str},m),l.opts.unevaluated&&h!==!0?a.assign((0,n._)`${h}[${o}]`,!0):!t&&!l.allErrors&&a.if((0,n.not)(m),()=>a.break())})})}}}})),Df=t((e=>{Object.defineProperty(e,"__esModule",{value:!0});var t=Q();e.default={keyword:`not`,schemaType:[`object`,`boolean`],trackErrors:!0,code(e){let{gen:n,schema:r,it:i}=e;if((0,t.alwaysValidSchema)(i,r)){e.fail();return}let a=n.name(`valid`);e.subschema({keyword:`not`,compositeRule:!0,createErrors:!1,allErrors:!1},a),e.failResult(a,()=>e.reset(),()=>e.error())},error:{message:`must NOT be valid`}}})),Of=t((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.default={keyword:`anyOf`,schemaType:`array`,trackErrors:!0,code:jd().validateUnion,error:{message:`must match a schema in anyOf`}}})),kf=t((e=>{Object.defineProperty(e,"__esModule",{value:!0});var t=Z(),n=Q();e.default={keyword:`oneOf`,schemaType:`array`,trackErrors:!0,error:{message:`must match exactly one schema in oneOf`,params:({params:e})=>(0,t._)`{passingSchemas: ${e.passing}}`},code(e){let{gen:r,schema:i,parentSchema:a,it:o}=e;if(!Array.isArray(i))throw Error(`ajv implementation error`);if(o.opts.discriminator&&a.discriminator)return;let s=i,c=r.let(`valid`,!1),l=r.let(`passing`,null),u=r.name(`_valid`);e.setParams({passing:l}),r.block(d),e.result(c,()=>e.reset(),()=>e.error(!0));function d(){s.forEach((i,a)=>{let s;(0,n.alwaysValidSchema)(o,i)?r.var(u,!0):s=e.subschema({keyword:`oneOf`,schemaProp:a,compositeRule:!0},u),a>0&&r.if((0,t._)`${u} && ${c}`).assign(c,!1).assign(l,(0,t._)`[${l}, ${a}]`).else(),r.if(u,()=>{r.assign(c,!0),r.assign(l,a),s&&e.mergeEvaluated(s,t.Name)})})}}}})),Af=t((e=>{Object.defineProperty(e,"__esModule",{value:!0});var t=Q();e.default={keyword:`allOf`,schemaType:`array`,code(e){let{gen:n,schema:r,it:i}=e;if(!Array.isArray(r))throw Error(`ajv implementation error`);let a=n.name(`valid`);r.forEach((n,r)=>{if((0,t.alwaysValidSchema)(i,n))return;let o=e.subschema({keyword:`allOf`,schemaProp:r},a);e.ok(a),e.mergeEvaluated(o)})}}})),jf=t((e=>{Object.defineProperty(e,"__esModule",{value:!0});var t=Z(),n=Q(),r={keyword:`if`,schemaType:[`object`,`boolean`],trackErrors:!0,error:{message:({params:e})=>(0,t.str)`must match "${e.ifClause}" schema`,params:({params:e})=>(0,t._)`{failingKeyword: ${e.ifClause}}`},code(e){let{gen:r,parentSchema:a,it:o}=e;a.then===void 0&&a.else===void 0&&(0,n.checkStrictMode)(o,`"if" without "then" and "else" is ignored`);let s=i(o,`then`),c=i(o,`else`);if(!s&&!c)return;let l=r.let(`valid`,!0),u=r.name(`_valid`);if(d(),e.reset(),s&&c){let t=r.let(`ifClause`);e.setParams({ifClause:t}),r.if(u,f(`then`,t),f(`else`,t))}else s?r.if(u,f(`then`)):r.if((0,t.not)(u),f(`else`));e.pass(l,()=>e.error(!0));function d(){let t=e.subschema({keyword:`if`,compositeRule:!0,createErrors:!1,allErrors:!1},u);e.mergeEvaluated(t)}function f(n,i){return()=>{let a=e.subschema({keyword:n},u);r.assign(l,u),e.mergeValidEvaluated(a,l),i?r.assign(i,(0,t._)`${n}`):e.setParams({ifClause:n})}}}};function i(e,t){let r=e.schema[t];return r!==void 0&&!(0,n.alwaysValidSchema)(e,r)}e.default=r})),Mf=t((e=>{Object.defineProperty(e,"__esModule",{value:!0});var t=Q();e.default={keyword:[`then`,`else`],schemaType:[`object`,`boolean`],code({keyword:e,parentSchema:n,it:r}){n.if===void 0&&(0,t.checkStrictMode)(r,`"${e}" without "if" is ignored`)}}})),Nf=t((e=>{Object.defineProperty(e,"__esModule",{value:!0});var t=_f(),n=yf(),r=vf(),i=bf(),a=xf(),o=Sf(),s=Cf(),c=wf(),l=Tf(),u=Ef(),d=Df(),f=Of(),p=kf(),m=Af(),h=jf(),g=Mf();function _(e=!1){let _=[d.default,f.default,p.default,m.default,h.default,g.default,s.default,c.default,o.default,l.default,u.default];return e?_.push(n.default,i.default):_.push(t.default,r.default),_.push(a.default),_}e.default=_})),Pf=t((e=>{Object.defineProperty(e,"__esModule",{value:!0});var t=Z();e.default={keyword:`format`,type:[`number`,`string`],schemaType:`string`,$data:!0,error:{message:({schemaCode:e})=>(0,t.str)`must match format "${e}"`,params:({schemaCode:e})=>(0,t._)`{format: ${e}}`},code(e,n){let{gen:r,data:i,$data:a,schema:o,schemaCode:s,it:c}=e,{opts:l,errSchemaPath:u,schemaEnv:d,self:f}=c;if(!l.validateFormats)return;a?p():m();function p(){let a=r.scopeValue(`formats`,{ref:f.formats,code:l.code.formats}),o=r.const(`fDef`,(0,t._)`${a}[${s}]`),c=r.let(`fType`),u=r.let(`format`);r.if((0,t._)`typeof ${o} == "object" && !(${o} instanceof RegExp)`,()=>r.assign(c,(0,t._)`${o}.type || "string"`).assign(u,(0,t._)`${o}.validate`),()=>r.assign(c,(0,t._)`"string"`).assign(u,o)),e.fail$data((0,t.or)(p(),m()));function p(){return l.strictSchema===!1?t.nil:(0,t._)`${s} && !${u}`}function m(){let e=d.$async?(0,t._)`(${o}.async ? await ${u}(${i}) : ${u}(${i}))`:(0,t._)`${u}(${i})`,r=(0,t._)`(typeof ${u} == "function" ? ${e} : ${u}.test(${i}))`;return(0,t._)`${u} && ${u} !== true && ${c} === ${n} && !${r}`}}function m(){let a=f.formats[o];if(!a){m();return}if(a===!0)return;let[s,c,p]=h(a);s===n&&e.pass(g());function m(){if(l.strictSchema===!1){f.logger.warn(e());return}throw Error(e());function e(){return`unknown format "${o}" ignored in schema at path "${u}"`}}function h(e){let n=e instanceof RegExp?(0,t.regexpCode)(e):l.code.formats?(0,t._)`${l.code.formats}${(0,t.getProperty)(o)}`:void 0,i=r.scopeValue(`formats`,{key:o,ref:e,code:n});return typeof e==`object`&&!(e instanceof RegExp)?[e.type||`string`,e.validate,(0,t._)`${i}.validate`]:[`string`,e,i]}function g(){if(typeof a==`object`&&!(a instanceof RegExp)&&a.async){if(!d.$async)throw Error(`async format in sync schema`);return(0,t._)`await ${p}(${i})`}return typeof c==`function`?(0,t._)`${p}(${i})`:(0,t._)`${p}.test(${i})`}}}}})),Ff=t((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.default=[Pf().default]})),If=t((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.contentVocabulary=e.metadataVocabulary=void 0,e.metadataVocabulary=[`title`,`description`,`default`,`deprecated`,`readOnly`,`writeOnly`,`examples`],e.contentVocabulary=[`contentMediaType`,`contentEncoding`,`contentSchema`]})),Lf=t((e=>{Object.defineProperty(e,"__esModule",{value:!0});var t=nf(),n=gf(),r=Nf(),i=Ff(),a=If();e.default=[t.default,n.default,(0,r.default)(),i.default,a.metadataVocabulary,a.contentVocabulary]})),Rf=t((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.DiscrError=void 0;var t;(function(e){e.Tag=`tag`,e.Mapping=`mapping`})(t||(e.DiscrError=t={}))})),zf=t((e=>{Object.defineProperty(e,"__esModule",{value:!0});var t=Z(),n=Rf(),r=Bd(),i=zd(),a=Q();e.default={keyword:`discriminator`,type:`object`,schemaType:`object`,error:{message:({params:{discrError:e,tagName:t}})=>e===n.DiscrError.Tag?`tag "${t}" must be string`:`value of tag "${t}" must be in oneOf`,params:({params:{discrError:e,tag:n,tagName:r}})=>(0,t._)`{error: ${e}, tag: ${r}, tagValue: ${n}}`},code(e){let{gen:o,data:s,schema:c,parentSchema:l,it:u}=e,{oneOf:d}=l;if(!u.opts.discriminator)throw Error(`discriminator: requires discriminator option`);let f=c.propertyName;if(typeof f!=`string`)throw Error(`discriminator: requires propertyName`);if(c.mapping)throw Error(`discriminator: mapping is not supported`);if(!d)throw Error(`discriminator: requires oneOf keyword`);let p=o.let(`valid`,!1),m=o.const(`tag`,(0,t._)`${s}${(0,t.getProperty)(f)}`);o.if((0,t._)`typeof ${m} == "string"`,()=>h(),()=>e.error(!1,{discrError:n.DiscrError.Tag,tag:m,tagName:f})),e.ok(p);function h(){let r=_();o.if(!1);for(let e in r)o.elseIf((0,t._)`${m} === ${e}`),o.assign(p,g(r[e]));o.else(),e.error(!1,{discrError:n.DiscrError.Mapping,tag:m,tagName:f}),o.endIf()}function g(n){let r=o.name(`valid`),i=e.subschema({keyword:`oneOf`,schemaProp:n},r);return e.mergeEvaluated(i,t.Name),r}function _(){let e={},t=o(l),n=!0;for(let e=0;eHf,$schema:()=>Vf,default:()=>qf,definitions:()=>Wf,properties:()=>Kf,title:()=>Uf,type:()=>Gf}),Vf,Hf,Uf,Wf,Gf,Kf,qf,Jf=n((()=>{Vf=`http://json-schema.org/draft-07/schema#`,Hf=`http://json-schema.org/draft-07/schema#`,Uf=`Core schema meta-schema`,Wf={schemaArray:{type:`array`,minItems:1,items:{$ref:`#`}},nonNegativeInteger:{type:`integer`,minimum:0},nonNegativeIntegerDefault0:{allOf:[{$ref:`#/definitions/nonNegativeInteger`},{default:0}]},simpleTypes:{enum:[`array`,`boolean`,`integer`,`null`,`number`,`object`,`string`]},stringArray:{type:`array`,items:{type:`string`},uniqueItems:!0,default:[]}},Gf=[`object`,`boolean`],Kf={$id:{type:`string`,format:`uri-reference`},$schema:{type:`string`,format:`uri`},$ref:{type:`string`,format:`uri-reference`},$comment:{type:`string`},title:{type:`string`},description:{type:`string`},default:!0,readOnly:{type:`boolean`,default:!1},examples:{type:`array`,items:!0},multipleOf:{type:`number`,exclusiveMinimum:0},maximum:{type:`number`},exclusiveMaximum:{type:`number`},minimum:{type:`number`},exclusiveMinimum:{type:`number`},maxLength:{$ref:`#/definitions/nonNegativeInteger`},minLength:{$ref:`#/definitions/nonNegativeIntegerDefault0`},pattern:{type:`string`,format:`regex`},additionalItems:{$ref:`#`},items:{anyOf:[{$ref:`#`},{$ref:`#/definitions/schemaArray`}],default:!0},maxItems:{$ref:`#/definitions/nonNegativeInteger`},minItems:{$ref:`#/definitions/nonNegativeIntegerDefault0`},uniqueItems:{type:`boolean`,default:!1},contains:{$ref:`#`},maxProperties:{$ref:`#/definitions/nonNegativeInteger`},minProperties:{$ref:`#/definitions/nonNegativeIntegerDefault0`},required:{$ref:`#/definitions/stringArray`},additionalProperties:{$ref:`#`},definitions:{type:`object`,additionalProperties:{$ref:`#`},default:{}},properties:{type:`object`,additionalProperties:{$ref:`#`},default:{}},patternProperties:{type:`object`,additionalProperties:{$ref:`#`},propertyNames:{format:`regex`},default:{}},dependencies:{type:`object`,additionalProperties:{anyOf:[{$ref:`#`},{$ref:`#/definitions/stringArray`}]}},propertyNames:{$ref:`#`},const:!0,enum:{type:`array`,items:!0,minItems:1,uniqueItems:!0},type:{anyOf:[{$ref:`#/definitions/simpleTypes`},{type:`array`,items:{$ref:`#/definitions/simpleTypes`},minItems:1,uniqueItems:!0}]},format:{type:`string`},contentMediaType:{type:`string`},contentEncoding:{type:`string`},if:{$ref:`#`},then:{$ref:`#`},else:{$ref:`#`},allOf:{$ref:`#/definitions/schemaArray`},anyOf:{$ref:`#/definitions/schemaArray`},oneOf:{$ref:`#/definitions/schemaArray`},not:{$ref:`#`}},qf={$schema:Vf,$id:Hf,title:Uf,definitions:Wf,type:Gf,properties:Kf,default:!0}})),Yf=t(((e,t)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.MissingRefError=e.ValidationError=e.CodeGen=e.Name=e.nil=e.stringify=e.str=e._=e.KeywordCxt=e.Ajv=void 0;var n=$d(),r=Lf(),a=zf(),o=(Jf(),i(Bf).default),s=[`/properties`],c=`http://json-schema.org/draft-07/schema`,l=class extends n.default{_addVocabularies(){super._addVocabularies(),r.default.forEach(e=>this.addVocabulary(e)),this.opts.discriminator&&this.addKeyword(a.default)}_addDefaultMetaSchema(){if(super._addDefaultMetaSchema(),!this.opts.meta)return;let e=this.opts.$data?this.$dataMetaSchema(o,s):o;this.addMetaSchema(e,c,!1),this.refs[`http://json-schema.org/schema`]=c}defaultMeta(){return this.opts.defaultMeta=super.defaultMeta()||(this.getSchema(c)?c:void 0)}};e.Ajv=l,t.exports=e=l,t.exports.Ajv=l,Object.defineProperty(e,"__esModule",{value:!0}),e.default=l;var u=Ld();Object.defineProperty(e,"KeywordCxt",{enumerable:!0,get:function(){return u.KeywordCxt}});var d=Z();Object.defineProperty(e,"_",{enumerable:!0,get:function(){return d._}}),Object.defineProperty(e,"str",{enumerable:!0,get:function(){return d.str}}),Object.defineProperty(e,"stringify",{enumerable:!0,get:function(){return d.stringify}}),Object.defineProperty(e,"nil",{enumerable:!0,get:function(){return d.nil}}),Object.defineProperty(e,"Name",{enumerable:!0,get:function(){return d.Name}}),Object.defineProperty(e,"CodeGen",{enumerable:!0,get:function(){return d.CodeGen}});var f=Rd();Object.defineProperty(e,"ValidationError",{enumerable:!0,get:function(){return f.default}});var p=zd();Object.defineProperty(e,"MissingRefError",{enumerable:!0,get:function(){return p.default}})})),Xf=t((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.formatNames=e.fastFormats=e.fullFormats=void 0;function t(e,t){return{validate:e,compare:t}}e.fullFormats={date:t(a,o),time:t(c(!0),l),"date-time":t(f(!0),p),"iso-time":t(c(),u),"iso-date-time":t(f(),m),duration:/^P(?!$)((\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+S)?)?|(\d+W)?)$/,uri:_,"uri-reference":/^(?:[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,"uri-template":/^(?:(?:[^\x00-\x20"'<>%\\^`{|}]|%[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,url:/^(?:https?|ftp):\/\/(?:\S+(?::\S*)?@)?(?:(?!(?:10|127)(?:\.\d{1,3}){3})(?!(?:169\.254|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-z0-9\u{00a1}-\u{ffff}]+-)*[a-z0-9\u{00a1}-\u{ffff}]+)(?:\.(?:[a-z0-9\u{00a1}-\u{ffff}]+-)*[a-z0-9\u{00a1}-\u{ffff}]+)*(?:\.(?:[a-z\u{00a1}-\u{ffff}]{2,})))(?::\d{2,5})?(?:\/[^\s]*)?$/iu,email:/^[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*@(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?$/i,hostname:/^(?=.{1,253}\.?$)[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?(?:\.[a-z0-9](?:[-0-9a-z]{0,61}[0-9a-z])?)*\.?$/i,ipv4:/^(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)\.){3}(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)$/,ipv6:/^((([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,regex:ne,uuid:/^(?:urn:uuid:)?[0-9a-f]{8}-(?:[0-9a-f]{4}-){3}[0-9a-f]{12}$/i,"json-pointer":/^(?:\/(?:[^~/]|~0|~1)*)*$/,"json-pointer-uri-fragment":/^#(?:\/(?:[a-z0-9_\-.!$&'()*+,;:=@]|%[0-9a-f]{2}|~0|~1)*)*$/i,"relative-json-pointer":/^(?:0|[1-9][0-9]*)(?:#|(?:\/(?:[^~/]|~0|~1)*)*)$/,byte:y,int32:{type:`number`,validate:S},int64:{type:`number`,validate:C},float:{type:`number`,validate:ee},double:{type:`number`,validate:ee},password:!0,binary:!0},e.fastFormats={...e.fullFormats,date:t(/^\d\d\d\d-[0-1]\d-[0-3]\d$/,o),time:t(/^(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)$/i,l),"date-time":t(/^\d\d\d\d-[0-1]\d-[0-3]\dt(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)$/i,p),"iso-time":t(/^(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)?$/i,u),"iso-date-time":t(/^\d\d\d\d-[0-1]\d-[0-3]\d[t\s](?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)?$/i,m),uri:/^(?:[a-z][a-z0-9+\-.]*:)(?:\/?\/)?[^\s]*$/i,"uri-reference":/^(?:(?:[a-z][a-z0-9+\-.]*:)?\/?\/)?(?:[^\\\s#][^\s#]*)?(?:#[^\\\s]*)?$/i,email:/^[a-z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?(?:\.[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?)*$/i},e.formatNames=Object.keys(e.fullFormats);function n(e){return e%4==0&&(e%100!=0||e%400==0)}var r=/^(\d\d\d\d)-(\d\d)-(\d\d)$/,i=[0,31,28,31,30,31,30,31,31,30,31,30,31];function a(e){let t=r.exec(e);if(!t)return!1;let a=+t[1],o=+t[2],s=+t[3];return o>=1&&o<=12&&s>=1&&s<=(o===2&&n(a)?29:i[o])}function o(e,t){if(e&&t)return e>t?1:e23||u>59||e&&!o)return!1;if(r<=23&&i<=59&&a<60)return!0;let d=i-u*c,f=r-l*c-+(d<0);return(f===23||f===-1)&&(d===59||d===-1)&&a<61}}function l(e,t){if(!(e&&t))return;let n=new Date(`2020-01-01T`+e).valueOf(),r=new Date(`2020-01-01T`+t).valueOf();if(n&&r)return n-r}function u(e,t){if(!(e&&t))return;let n=s.exec(e),r=s.exec(t);if(n&&r)return e=n[1]+n[2]+n[3],t=r[1]+r[2]+r[3],e>t?1:e=b}function C(e){return Number.isInteger(e)}function ee(){return!0}var te=/[^\\]\\Z/;function ne(e){if(te.test(e))return!1;try{return new RegExp(e),!0}catch{return!1}}})),Zf=t((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.formatLimitDefinition=void 0;var t=Yf(),n=Z(),r=n.operators,i={formatMaximum:{okStr:`<=`,ok:r.LTE,fail:r.GT},formatMinimum:{okStr:`>=`,ok:r.GTE,fail:r.LT},formatExclusiveMaximum:{okStr:`<`,ok:r.LT,fail:r.GTE},formatExclusiveMinimum:{okStr:`>`,ok:r.GT,fail:r.LTE}};e.formatLimitDefinition={keyword:Object.keys(i),type:`string`,schemaType:`string`,$data:!0,error:{message:({keyword:e,schemaCode:t})=>(0,n.str)`should be ${i[e].okStr} ${t}`,params:({keyword:e,schemaCode:t})=>(0,n._)`{comparison: ${i[e].okStr}, limit: ${t}}`},code(e){let{gen:r,data:a,schemaCode:o,keyword:s,it:c}=e,{opts:l,self:u}=c;if(!l.validateFormats)return;let d=new t.KeywordCxt(c,u.RULES.all.format.definition,`format`);d.$data?f():p();function f(){let t=r.scopeValue(`formats`,{ref:u.formats,code:l.code.formats}),i=r.const(`fmt`,(0,n._)`${t}[${d.schemaCode}]`);e.fail$data((0,n.or)((0,n._)`typeof ${i} != "object"`,(0,n._)`${i} instanceof RegExp`,(0,n._)`typeof ${i}.compare != "function"`,m(i)))}function p(){let t=d.schema,i=u.formats[t];if(!i||i===!0)return;if(typeof i!=`object`||i instanceof RegExp||typeof i.compare!=`function`)throw Error(`"${s}": format "${t}" does not define "compare" function`);let a=r.scopeValue(`formats`,{key:t,ref:i,code:l.code.formats?(0,n._)`${l.code.formats}${(0,n.getProperty)(t)}`:void 0});e.fail$data(m(a))}function m(e){return(0,n._)`${e}.compare(${a}, ${o}) ${i[s].fail} 0`}},dependencies:[`format`]},e.default=t=>(t.addKeyword(e.formatLimitDefinition),t)})),Qf=t(((e,t)=>{Object.defineProperty(e,"__esModule",{value:!0});var n=Xf(),r=Zf(),i=Z(),a=new i.Name(`fullFormats`),o=new i.Name(`fastFormats`),s=(e,t={keywords:!0})=>{if(Array.isArray(t))return c(e,t,n.fullFormats,a),e;let[i,s]=t.mode===`fast`?[n.fastFormats,o]:[n.fullFormats,a];return c(e,t.formats||n.formatNames,i,s),t.keywords&&(0,r.default)(e),e};s.get=(e,t=`full`)=>{let r=(t===`fast`?n.fastFormats:n.fullFormats)[e];if(!r)throw Error(`Unknown format "${e}"`);return r};function c(e,t,n,r){var a;(a=e.opts.code).formats??(a.formats=(0,i._)`require("ajv-formats/dist/formats").${r}`);for(let r of t)e.addFormat(r,n[r])}t.exports=e=s,Object.defineProperty(e,"__esModule",{value:!0}),e.default=s})),$f=r(Yf(),1),ep=r(Qf(),1);function tp(){let e=new $f.default({strict:!1,validateFormats:!0,validateSchema:!1,allErrors:!0});return(0,ep.default)(e),e}var np=class{constructor(e){this._ajv=e??tp()}getValidator(e){let t=`$id`in e&&typeof e.$id==`string`?this._ajv.getSchema(e.$id)??this._ajv.compile(e):this._ajv.compile(e);return e=>t(e)?{valid:!0,data:e,errorMessage:void 0}:{valid:!1,data:void 0,errorMessage:this._ajv.errorsText(t.errors)}}},rp=class{constructor(e){this._client=e}async*callToolStream(e,t=Xl,n){let r=this._client,i={...n,task:n?.task??(r.isToolTask(e.name)?{}:void 0)},a=r.requestStream({method:`tools/call`,params:e},t,i),o=r.getToolOutputValidator(e.name);for await(let t of a){if(t.type===`result`&&o){let n=t.result;if(!n.structuredContent&&!n.isError){yield{type:`error`,error:new X(Y.InvalidRequest,`Tool ${e.name} has an output schema but did not return structured content`)};return}if(n.structuredContent)try{let e=o(n.structuredContent);if(!e.valid){yield{type:`error`,error:new X(Y.InvalidParams,`Structured content does not match the tool's output schema: ${e.errorMessage}`)};return}}catch(e){if(e instanceof X){yield{type:`error`,error:e};return}yield{type:`error`,error:new X(Y.InvalidParams,`Failed to validate structured content: ${e instanceof Error?e.message:String(e)}`)};return}}yield t}}async getTask(e,t){return this._client.getTask({taskId:e},t)}async getTaskResult(e,t,n){return this._client.getTaskResult({taskId:e},t,n)}async listTasks(e,t){return this._client.listTasks(e?{cursor:e}:void 0,t)}async cancelTask(e,t){return this._client.cancelTask({taskId:e},t)}requestStream(e,t,n){return this._client.requestStream(e,t,n)}};function ip(e,t,n){if(!e)throw Error(`${n} does not support task creation (required for ${t})`);if(t===`tools/call`&&!e.tools?.call)throw Error(`${n} does not support task creation for tools/call (required for ${t})`)}function ap(e,t,n){if(!e)throw Error(`${n} does not support task creation (required for ${t})`);switch(t){case`sampling/createMessage`:if(!e.sampling?.createMessage)throw Error(`${n} does not support task creation for sampling/createMessage (required for ${t})`);break;case`elicitation/create`:if(!e.elicitation?.create)throw Error(`${n} does not support task creation for elicitation/create (required for ${t})`)}}function op(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&&op(t,n[e])}}if(Array.isArray(e.anyOf))for(let n of e.anyOf)typeof n!=`boolean`&&op(n,t);if(Array.isArray(e.oneOf))for(let n of e.oneOf)typeof n!=`boolean`&&op(n,t)}}function sp(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}}var cp=class extends Wu{constructor(e,t){super(t),this._clientInfo=e,this._cachedToolOutputValidators=new Map,this._cachedKnownTaskTools=new Set,this._cachedRequiredTaskTools=new Set,this._listChangedDebounceTimers=new Map,this._capabilities=t?.capabilities??{},this._jsonSchemaValidator=t?.jsonSchemaValidator??new np,t?.listChanged&&(this._pendingListChangedConfig=t.listChanged)}_setupListChangedHandlers(e){e.tools&&this._serverCapabilities?.tools?.listChanged&&this._setupListChangedHandler(`tools`,$l,e.tools,async()=>(await this.listTools()).tools),e.prompts&&this._serverCapabilities?.prompts?.listChanged&&this._setupListChangedHandler(`prompts`,Wl,e.prompts,async()=>(await this.listPrompts()).prompts),e.resources&&this._serverCapabilities?.resources?.listChanged&&this._setupListChangedHandler(`resources`,Sl,e.resources,async()=>(await this.listResources()).resources)}get experimental(){return this._experimental||={tasks:new rp(this)},this._experimental}registerCapabilities(e){if(this.transport)throw Error(`Cannot register capabilities after connecting to transport`);this._capabilities=Ku(this._capabilities,e)}setRequestHandler(e,t){let n=zu(e)?.method;if(!n)throw Error(`Schema is missing a method literal`);let r=Bu(n);if(typeof r!=`string`)throw Error(`Schema method literal must be a string`);let i=r;return i===`elicitation/create`?super.setRequestHandler(e,async(e,n)=>{let r=Ru(Cu,e);if(!r.success){let e=r.error instanceof Error?r.error.message:String(r.error);throw new X(Y.InvalidParams,`Invalid elicitation request: ${e}`)}let{params:i}=r.data;i.mode=i.mode??`form`;let{supportsFormMode:a,supportsUrlMode:o}=sp(this._capabilities.elicitation);if(i.mode===`form`&&!a)throw new X(Y.InvalidParams,`Client does not support form-mode elicitation requests`);if(i.mode===`url`&&!o)throw new X(Y.InvalidParams,`Client does not support URL-mode elicitation requests`);let s=await Promise.resolve(t(e,n));if(i.task){let e=Ru(Xc,s);if(!e.success){let t=e.error instanceof Error?e.error.message:String(e.error);throw new X(Y.InvalidParams,`Invalid task creation result: ${t}`)}return e.data}let c=Ru(Eu,s);if(!c.success){let e=c.error instanceof Error?c.error.message:String(c.error);throw new X(Y.InvalidParams,`Invalid elicitation result: ${e}`)}let l=c.data,u=i.mode===`form`?i.requestedSchema:void 0;if(i.mode===`form`&&l.action===`accept`&&l.content&&u&&this._capabilities.elicitation?.form?.applyDefaults)try{op(u,l.content)}catch{}return l}):i===`sampling/createMessage`?super.setRequestHandler(e,async(e,n)=>{let r=Ru(pu,e);if(!r.success){let e=r.error instanceof Error?r.error.message:String(r.error);throw new X(Y.InvalidParams,`Invalid sampling request: ${e}`)}let{params:i}=r.data,a=await Promise.resolve(t(e,n));if(i.task){let e=Ru(Xc,a);if(!e.success){let t=e.error instanceof Error?e.error.message:String(e.error);throw new X(Y.InvalidParams,`Invalid task creation result: ${t}`)}return e.data}let o=Ru(i.tools||i.toolChoice?hu:mu,a);if(!o.success){let e=o.error instanceof Error?o.error.message:String(o.error);throw new X(Y.InvalidParams,`Invalid sampling result: ${e}`)}return o.data}):super.setRequestHandler(e,t)}assertCapability(e,t){if(!this._serverCapabilities?.[e])throw Error(`Server does not support ${e} (required for ${t})`)}async connect(e,t){if(await super.connect(e),e.sessionId===void 0)try{let n=await this.request({method:`initialize`,params:{protocolVersion:nc,capabilities:this._capabilities,clientInfo:this._clientInfo}},Rc,t);if(n===void 0)throw Error(`Server sent invalid initialize result: ${n}`);if(!rc.includes(n.protocolVersion))throw Error(`Server's protocol version is not supported: ${n.protocolVersion}`);this._serverCapabilities=n.capabilities,this._serverVersion=n.serverInfo,e.setProtocolVersion&&e.setProtocolVersion(n.protocolVersion),this._instructions=n.instructions,await this.notification({method:`notifications/initialized`}),this._pendingListChangedConfig&&=(this._setupListChangedHandlers(this._pendingListChangedConfig),void 0)}catch(e){throw this.close(),e}}getServerCapabilities(){return this._serverCapabilities}getServerVersion(){return this._serverVersion}getInstructions(){return this._instructions}assertCapabilityForMethod(e){switch(e){case`logging/setLevel`:if(!this._serverCapabilities?.logging)throw Error(`Server does not support logging (required for ${e})`);break;case`prompts/get`:case`prompts/list`:if(!this._serverCapabilities?.prompts)throw Error(`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 Error(`Server does not support resources (required for ${e})`);if(e===`resources/subscribe`&&!this._serverCapabilities.resources.subscribe)throw Error(`Server does not support resource subscriptions (required for ${e})`);break;case`tools/call`:case`tools/list`:if(!this._serverCapabilities?.tools)throw Error(`Server does not support tools (required for ${e})`);break;case`completion/complete`:if(!this._serverCapabilities?.completions)throw Error(`Server does not support completions (required for ${e})`)}}assertNotificationCapability(e){if(e===`notifications/roots/list_changed`&&!this._capabilities.roots?.listChanged)throw Error(`Client does not support roots list changed notifications (required for ${e})`)}assertRequestHandlerCapability(e){if(this._capabilities)switch(e){case`sampling/createMessage`:if(!this._capabilities.sampling)throw Error(`Client does not support sampling capability (required for ${e})`);break;case`elicitation/create`:if(!this._capabilities.elicitation)throw Error(`Client does not support elicitation capability (required for ${e})`);break;case`roots/list`:if(!this._capabilities.roots)throw Error(`Client does not support roots capability (required for ${e})`);break;case`tasks/get`:case`tasks/list`:case`tasks/result`:case`tasks/cancel`:if(!this._capabilities.tasks)throw Error(`Client does not support tasks capability (required for ${e})`)}}assertTaskCapability(e){ip(this._serverCapabilities?.tasks?.requests,e,`Server`)}assertTaskHandlerCapability(e){this._capabilities&&ap(this._capabilities.tasks?.requests,e,`Client`)}async ping(e){return this.request({method:`ping`},Tc,e)}async complete(e,t){return this.request({method:`completion/complete`,params:e},ju,t)}async setLoggingLevel(e,t){return this.request({method:`logging/setLevel`,params:{level:e}},Tc,t)}async getPrompt(e,t){return this.request({method:`prompts/get`,params:e},Ul,t)}async listPrompts(e,t){return this.request({method:`prompts/list`,params:e},Ml,t)}async listResources(e,t){return this.request({method:`resources/list`,params:e},hl,t)}async listResourceTemplates(e,t){return this.request({method:`resources/templates/list`,params:e},_l,t)}async readResource(e,t){return this.request({method:`resources/read`,params:e},xl,t)}async subscribeResource(e,t){return this.request({method:`resources/subscribe`,params:e},Tc,t)}async unsubscribeResource(e,t){return this.request({method:`resources/unsubscribe`,params:e},Tc,t)}async callTool(e,t=Xl,n){if(this.isToolTaskRequired(e.name))throw new X(Y.InvalidRequest,`Tool "${e.name}" requires task-based execution. Use client.experimental.tasks.callToolStream() instead.`);let r=await this.request({method:`tools/call`,params:e},t,n),i=this.getToolOutputValidator(e.name);if(i){if(!r.structuredContent&&!r.isError)throw new X(Y.InvalidRequest,`Tool ${e.name} has an output schema but did not return structured content`);if(r.structuredContent)try{let e=i(r.structuredContent);if(!e.valid)throw new X(Y.InvalidParams,`Structured content does not match the tool's output schema: ${e.errorMessage}`)}catch(e){throw e instanceof X?e:new X(Y.InvalidParams,`Failed to validate structured content: ${e instanceof Error?e.message:String(e)}`)}}return r}isToolTask(e){return this._serverCapabilities?.tasks?.requests?.tools?.call?this._cachedKnownTaskTools.has(e):!1}isToolTaskRequired(e){return this._cachedRequiredTaskTools.has(e)}cacheToolMetadata(e){this._cachedToolOutputValidators.clear(),this._cachedKnownTaskTools.clear(),this._cachedRequiredTaskTools.clear();for(let t of e){if(t.outputSchema){let e=this._jsonSchemaValidator.getValidator(t.outputSchema);this._cachedToolOutputValidators.set(t.name,e)}let e=t.execution?.taskSupport;(e===`required`||e===`optional`)&&this._cachedKnownTaskTools.add(t.name),e===`required`&&this._cachedRequiredTaskTools.add(t.name)}}getToolOutputValidator(e){return this._cachedToolOutputValidators.get(e)}async listTools(e,t){let n=await this.request({method:`tools/list`,params:e},Yl,t);return this.cacheToolMetadata(n.tools),n}_setupListChangedHandler(e,t,n,r){let i=eu.safeParse(n);if(!i.success)throw Error(`Invalid ${e} listChanged options: ${i.error.message}`);if(typeof n.onChanged!=`function`)throw Error(`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{let e=await r();s(null,e)}catch(e){let t=e instanceof Error?e:Error(String(e));s(t,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`})}},lp=r(t((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 up(e){if(e)try{return lp.parse(e).type}catch{let t=(e.split(`;`,1)[0]??``).trim().toLowerCase();return t===``||e.slice(t.length).includes(`,`)?void 0:t}}function dp(e){return e?e instanceof Headers?Object.fromEntries(e.entries()):Array.isArray(e)?Object.fromEntries(e):{...e}:{}}function fp(e=fetch,t){return t?async(n,r)=>e(n,{...t,...r,headers:r?.headers?{...dp(t.headers),...dp(r.headers)}:t.headers}):e}var pp=globalThis.crypto;async function mp(e){return(await pp).getRandomValues(new Uint8Array(e))}async function hp(e){let t=``;for(;t.length128)throw`Expected a length between 43 and 128. Received ${e}.`;let t=await gp(e);return{code_verifier:t,code_challenge:await _p(t)}}var yp=Vo().superRefine((e,t)=>{if(!URL.canParse(e))return t.addIssue({code:Qs.custom,message:`URL must be parseable`,fatal:!0}),Be}).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`}),bp=V({resource:P().url(),authorization_servers:z(yp).optional(),jwks_uri:P().url().optional(),scopes_supported:z(P()).optional(),bearer_methods_supported:z(P()).optional(),resource_signing_alg_values_supported:z(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:L().optional(),authorization_details_types_supported:z(P()).optional(),dpop_signing_alg_values_supported:z(P()).optional(),dpop_bound_access_tokens_required:L().optional()}),xp=V({issuer:P(),authorization_endpoint:yp,token_endpoint:yp,registration_endpoint:yp.optional(),scopes_supported:z(P()).optional(),response_types_supported:z(P()),response_modes_supported:z(P()).optional(),grant_types_supported:z(P()).optional(),token_endpoint_auth_methods_supported:z(P()).optional(),token_endpoint_auth_signing_alg_values_supported:z(P()).optional(),service_documentation:yp.optional(),revocation_endpoint:yp.optional(),revocation_endpoint_auth_methods_supported:z(P()).optional(),revocation_endpoint_auth_signing_alg_values_supported:z(P()).optional(),introspection_endpoint:P().optional(),introspection_endpoint_auth_methods_supported:z(P()).optional(),introspection_endpoint_auth_signing_alg_values_supported:z(P()).optional(),code_challenge_methods_supported:z(P()).optional(),client_id_metadata_document_supported:L().optional()}),Sp=B({...V({issuer:P(),authorization_endpoint:yp,token_endpoint:yp,userinfo_endpoint:yp.optional(),jwks_uri:yp,registration_endpoint:yp.optional(),scopes_supported:z(P()).optional(),response_types_supported:z(P()),response_modes_supported:z(P()).optional(),grant_types_supported:z(P()).optional(),acr_values_supported:z(P()).optional(),subject_types_supported:z(P()),id_token_signing_alg_values_supported:z(P()),id_token_encryption_alg_values_supported:z(P()).optional(),id_token_encryption_enc_values_supported:z(P()).optional(),userinfo_signing_alg_values_supported:z(P()).optional(),userinfo_encryption_alg_values_supported:z(P()).optional(),userinfo_encryption_enc_values_supported:z(P()).optional(),request_object_signing_alg_values_supported:z(P()).optional(),request_object_encryption_alg_values_supported:z(P()).optional(),request_object_encryption_enc_values_supported:z(P()).optional(),token_endpoint_auth_methods_supported:z(P()).optional(),token_endpoint_auth_signing_alg_values_supported:z(P()).optional(),display_values_supported:z(P()).optional(),claim_types_supported:z(P()).optional(),claims_supported:z(P()).optional(),service_documentation:P().optional(),claims_locales_supported:z(P()).optional(),ui_locales_supported:z(P()).optional(),claims_parameter_supported:L().optional(),request_parameter_supported:L().optional(),request_uri_parameter_supported:L().optional(),require_request_uri_registration:L().optional(),op_policy_uri:yp.optional(),op_tos_uri:yp.optional(),client_id_metadata_document_supported:L().optional()}).shape,...xp.pick({code_challenge_methods_supported:!0}).shape}),Cp=B({access_token:P(),id_token:P().optional(),token_type:P(),expires_in:tc().optional(),scope:P().optional(),refresh_token:P().optional()}).strip(),wp=B({error:P(),error_description:P().optional(),error_uri:P().optional()}),Tp=yp.optional().or(W(``).transform(()=>void 0)),Ep=B({redirect_uris:z(yp),token_endpoint_auth_method:P().optional(),grant_types:z(P()).optional(),response_types:z(P()).optional(),client_name:P().optional(),client_uri:yp.optional(),logo_uri:Tp,scope:P().optional(),contacts:z(P()).optional(),tos_uri:Tp,policy_uri:P().optional(),jwks_uri:yp.optional(),jwks:fs().optional(),software_id:P().optional(),software_version:P().optional(),software_statement:P().optional()}).strip(),Dp=B({client_id:P(),client_secret:P().optional(),client_id_issued_at:I().optional(),client_secret_expires_at:I().optional()}).strip(),Op=Ep.merge(Dp);B({error:P(),error_description:P().optional()}).strip(),B({token:P(),token_type_hint:P().optional()}).strip();function kp(e){let t=typeof e==`string`?new URL(e):new URL(e.href);return t.hash=``,t}function Ap({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=400&&e.status<500&&t!==`/`}async function gm(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=pm(t,i.pathname);o=new URL(e,r?.metadataServerUrl??i),o.search=i.search}let s=await mm(o,a,n);return!r?.metadataUrl&&hm(s,i.pathname)&&(s=await mm(new URL(`/.well-known/${t}`,i),a,n)),s}function _m(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`}),r.push({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`}),r.push({url:new URL(`/.well-known/openid-configuration${i}`,t.origin),type:`oidc`}),r.push({url:new URL(`${i}/.well-known/openid-configuration`,t.origin),type:`oidc`}),r}async function vm(e,{fetchFn:t=fetch,protocolVersion:n=nc}={}){let r={"MCP-Protocol-Version":n,Accept:`application/json`},i=_m(e);for(let{url:e,type:n}of i){let i=await fm(e,r,t);if(i){if(!i.ok){if(await i.body?.cancel(),i.status>=400&&i.status<500)continue;throw Error(`HTTP ${i.status} trying to load ${n===`oauth`?`OAuth`:`OpenID provider`} metadata from ${e}`)}return n===`oauth`?xp.parse(await i.json()):Sp.parse(await i.json())}}}async function ym(e,t){let n,r;try{n=await dm(e,{resourceMetadataUrl:t?.resourceMetadataUrl},t?.fetchFn),n.authorization_servers&&n.authorization_servers.length>0&&(r=n.authorization_servers[0])}catch{}r||=String(new URL(`/`,e));let i=await vm(r,{fetchFn:t?.fetchFn});return{authorizationServerUrl:r,authorizationServerMetadata:i,resourceMetadata:n}}async function bm(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(Zp))throw Error(`Incompatible auth server: does not support response type ${Zp}`);if(t.code_challenge_methods_supported&&!t.code_challenge_methods_supported.includes(Qp))throw Error(`Incompatible auth server: does not support code challenge method ${Qp}`)}else s=new URL(`/authorize`,e);let c=await vp(),l=c.code_verifier,u=c.code_challenge;return s.searchParams.set(`response_type`,Zp),s.searchParams.set(`client_id`,n.client_id),s.searchParams.set(`code_challenge`,u),s.searchParams.set(`code_challenge_method`,Qp),s.searchParams.set(`redirect_uri`,String(r)),a&&s.searchParams.set(`state`,a),i&&s.searchParams.set(`scope`,i),i?.includes(`offline_access`)&&s.searchParams.append(`prompt`,`consent`),o&&s.searchParams.set(`resource`,o.href),{authorizationUrl:s,codeVerifier:l}}function xm(e,t,n){return new URLSearchParams({grant_type:`authorization_code`,code:e,code_verifier:t,redirect_uri:String(n)})}async function Sm(e,{metadata:t,tokenRequestParams:n,clientInformation:r,addClientAuthentication:i,resource:a,fetchFn:o}){let s=t?.token_endpoint?new URL(t.token_endpoint):new URL(`/token`,e),c=new Headers({"Content-Type":`application/x-www-form-urlencoded`,Accept:`application/json`});a&&n.set(`resource`,a.href),i?await i(c,n,s,t):r&&em($p(r,t?.token_endpoint_auth_methods_supported??[]),r,c,n);let l=await(o??fetch)(s,{method:`POST`,headers:c,body:n});if(!l.ok)throw await im(l);return Cp.parse(await l.json())}async function Cm(e,{metadata:t,clientInformation:n,refreshToken:r,resource:i,addClientAuthentication:a,fetchFn:o}){return{refresh_token:r,...await Sm(e,{metadata:t,tokenRequestParams:new URLSearchParams({grant_type:`refresh_token`,refresh_token:r}),clientInformation:n,addClientAuthentication:a,resource:i,fetchFn:o})}}async function wm(e,t,{metadata:n,resource:r,authorizationCode:i,fetchFn:a}={}){let o=e.clientMetadata.scope,s;if(e.prepareTokenRequest&&(s=await e.prepareTokenRequest(o)),!s){if(!i)throw Error(`Either provider.prepareTokenRequest() or authorizationCode is required`);if(!e.redirectUrl)throw Error(`redirectUrl is required for authorization_code flow`);s=xm(i,await e.codeVerifier(),e.redirectUrl)}let c=await e.clientInformation();return Sm(t,{metadata:n,tokenRequestParams:s,clientInformation:c??void 0,addClientAuthentication:e.addClientAuthentication,resource:r,fetchFn:a})}async function Tm(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=await(i??fetch)(a,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({...n,...r===void 0?{}:{scope:r}})});if(!o.ok)throw await im(o);return Op.parse(await o.json())}var Em=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}},Dm=10,Om=13,km=32;function Am(e){}function jm(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=Am,onError:n=Am,onRetry:r=Am,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 Em(`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(Mm(e,n,i)){let i=e.charCodeAt(n+5)===km?n+6:n+5,a=e.slice(i,r);if(d===0&&e.charCodeAt(r+1)===Dm){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 Nm(e,n,i)?f=e.slice(e.charCodeAt(n+6)===km?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 Mm(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 Nm(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 Pm=class extends TransformStream{constructor({onError:e,onRetry:t,onComment:n,maxBufferSize:r}={}){let i;super({start(a){i=jm({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)}})}},Fm={initialReconnectionDelay:1e3,maxReconnectionDelay:3e4,reconnectionDelayGrowFactor:1.5,maxRetries:2},Im=class extends Error{constructor(e,t){super(`Streamable HTTP error: ${t}`),this.code=e}},Lm=class{constructor(e,t){this._hasCompletedAuthFlow=!1,this._url=e,this._resourceMetadataUrl=void 0,this._scope=void 0,this._requestInit=t?.requestInit,this._authProvider=t?.authProvider,this._fetch=t?.fetch,this._fetchWithInit=fp(t?.fetch,t?.requestInit),this._sessionId=t?.sessionId,this._reconnectionOptions=t?.reconnectionOptions??Fm}async _authThenStart(){if(!this._authProvider)throw new Yp(`No auth provider`);let e;try{e=await am(this._authProvider,{serverUrl:this._url,resourceMetadataUrl:this._resourceMetadataUrl,scope:this._scope,fetchFn:this._fetchWithInit})}catch(e){throw this.onerror?.(e),e}if(e!==`AUTHORIZED`)throw new Yp;return await this._startOrAuthSse({resumptionToken:void 0})}async _commonHeaders(){let e={};if(this._authProvider){let t=await this._authProvider.tokens();t&&(e.Authorization=`Bearer ${t.access_token}`)}this._sessionId&&(e[`mcp-session-id`]=this._sessionId),this._protocolVersion&&(e[`mcp-protocol-version`]=this._protocolVersion);let t=dp(this._requestInit?.headers);return new Headers({...e,...t})}async _startOrAuthSse(e){let{resumptionToken:t}=e;try{let n=await this._commonHeaders();n.set(`Accept`,`text/event-stream`),t&&n.set(`last-event-id`,t);let r=await(this._fetch??fetch)(this._url,{method:`GET`,headers:n,signal:this._abortController?.signal});if(!r.ok){if(await r.body?.cancel(),r.status===401&&this._authProvider)return await this._authThenStart();if(r.status===405)return;throw new Im(r.status,`Failed to open SSE stream: ${r.statusText}`)}this._handleSseStream(r.body,e,!0)}catch(e){throw 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.`));return}let r=this._getNextReconnectionDelay(t);this._reconnectionTimeout=setTimeout(()=>{this._startOrAuthSse(e).catch(n=>{this.onerror?.(Error(`Failed to reconnect SSE stream: ${n instanceof Error?n.message:String(n)}`)),this._scheduleReconnection(e,t+1)})},r)}_handleSseStream(e,t,n){if(!e)return;let{onresumptiontoken:r,replayMessageId:i}=t,a,o=!1,s=!1;(async()=>{try{let t=e.pipeThrough(new TextDecoderStream).pipeThrough(new Pm({onRetry:e=>{this._serverRetryMs=e}})).getReader();for(;;){let{value:e,done:n}=await t.read();if(n)break;if(e.id&&(a=e.id,o=!0,r?.(e.id)),e.data&&(!e.event||e.event===`message`))try{let t=wc.parse(JSON.parse(e.data));xc(t)&&(s=!0,i!==void 0&&(t.id=i)),this.onmessage?.(t)}catch(e){this.onerror?.(e)}}(n||o)&&!s&&this._abortController&&!this._abortController.signal.aborted&&this._scheduleReconnection({resumptionToken:a,onresumptiontoken:r,replayMessageId:i},0)}catch(e){if(this.onerror?.(Error(`SSE stream disconnected: ${e}`)),(n||o)&&!s&&this._abortController&&!this._abortController.signal.aborted)try{this._scheduleReconnection({resumptionToken:a,onresumptiontoken:r,replayMessageId:i},0)}catch(e){this.onerror?.(Error(`Failed to reconnect: ${e instanceof Error?e.message:String(e)}`))}}})()}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){if(!this._authProvider)throw new Yp(`No auth provider`);if(await am(this._authProvider,{serverUrl:this._url,authorizationCode:e,resourceMetadataUrl:this._resourceMetadataUrl,scope:this._scope,fetchFn:this._fetchWithInit})!==`AUTHORIZED`)throw new Yp(`Failed to authorize`)}async close(){this._reconnectionTimeout&&=(clearTimeout(this._reconnectionTimeout),void 0),this._abortController?.abort(),this.onclose?.()}async send(e,t){try{let{resumptionToken:n,onresumptiontoken:r}=t||{};if(n){this._startOrAuthSse({resumptionToken:n,replayMessageId:_c(e)?e.id:void 0}).catch(e=>this.onerror?.(e));return}let i=await this._commonHeaders();i.set(`content-type`,`application/json`),i.set(`accept`,`application/json, text/event-stream`);let a={...this._requestInit,method:`POST`,headers:i,body:JSON.stringify(e),signal:this._abortController?.signal},o=await(this._fetch??fetch)(this._url,a),s=o.headers.get(`mcp-session-id`);if(s&&(this._sessionId=s),!o.ok){let t=await o.text().catch(()=>null);if(o.status===401&&this._authProvider){if(this._hasCompletedAuthFlow)throw new Im(401,`Server returned 401 after successful authentication`);let{resourceMetadataUrl:t,scope:n}=lm(o);if(this._resourceMetadataUrl=t,this._scope=n,await am(this._authProvider,{serverUrl:this._url,resourceMetadataUrl:this._resourceMetadataUrl,scope:this._scope,fetchFn:this._fetchWithInit})!==`AUTHORIZED`)throw new Yp;return this._hasCompletedAuthFlow=!0,this.send(e)}if(o.status===403&&this._authProvider){let{resourceMetadataUrl:t,scope:n,error:r}=lm(o);if(r===`insufficient_scope`){let r=o.headers.get(`WWW-Authenticate`);if(this._lastUpscopingHeader===r)throw new Im(403,`Server returned 403 after trying upscoping`);if(n&&(this._scope=n),t&&(this._resourceMetadataUrl=t),this._lastUpscopingHeader=r??void 0,await am(this._authProvider,{serverUrl:this._url,resourceMetadataUrl:this._resourceMetadataUrl,scope:this._scope,fetchFn:this._fetch})!==`AUTHORIZED`)throw new Yp;return this.send(e)}}throw new Im(o.status,`Error POSTing to endpoint: ${t}`)}if(this._hasCompletedAuthFlow=!1,this._lastUpscopingHeader=void 0,o.status===202){await o.body?.cancel(),Bc(e)&&this._startOrAuthSse({resumptionToken:void 0}).catch(e=>this.onerror?.(e));return}let c=(Array.isArray(e)?e:[e]).filter(e=>`method`in e&&`id`in e&&e.id!==void 0).length>0,l=o.headers.get(`content-type`),u=up(l);if(c){if(u===`text/event-stream`)this._handleSseStream(o.body,{onresumptiontoken:r},!1);else if(u===`application/json`){let e=await o.json(),t=Array.isArray(e)?e.map(e=>wc.parse(e)):[wc.parse(e)];for(let e of t)this.onmessage?.(e)}else throw await o.body?.cancel(),new Im(-1,`Unexpected content type: ${l}`)}else await o.body?.cancel()}catch(e){throw 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._fetch??fetch)(this._url,t);if(await n.body?.cancel(),!n.ok&&n.status!==405)throw new Im(n.status,`Failed to terminate session: ${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})}},Rm=r(s(),1),zm=e(),Bm=`text/html;profile=mcp-app`,Vm=`io.modelcontextprotocol/ui`,Hm=3,Um=5,Wm=2e3,Gm={observability_overview:620,service_topology:760,service_performance:700,trace_detail:720,search_logs:720},Km=class extends Error{},qm=null,Jm=null;async function Ym(){let e=new Lm(new URL(`/api/mcp`,location.origin),{fetch:(e,t)=>d(e,t)}),t=new cp({name:`fanout-browser`,version:`0.2.0`},{capabilities:{extensions:{[Vm]:{mimeTypes:[Bm]}}}});try{await t.connect(e);let n={client:t,references:0,closed:!1,closeListeners:new Set};return t.onclose=()=>Zm(n,!1),t.onerror=()=>Zm(n,!0),n}catch(t){throw await e.close().catch(()=>void 0),t}}async function Xm(){for(let e=0;e{Jm===e&&!t.closed&&(qm=t)}).catch(()=>{Jm===e&&(Jm=null)})}let e=Jm;if(!e)continue;let t=await e;if(t.closed){Jm===e&&(Jm=null);continue}return t.closeTimer&&=(clearTimeout(t.closeTimer),void 0),t.references+=1,t}throw Error(`MCP connection closed during setup`)}function Zm(e,t){if(!e.closed){e.closed=!0,e.closeTimer&&clearTimeout(e.closeTimer),e.closeTimer=void 0,qm===e&&(qm=null),Jm=null;for(let t of[...e.closeListeners])t();t&&e.client.close().catch(()=>void 0)}}function Qm(e){e.references=Math.max(0,e.references-1),!(e.closed||e.references||e.closeTimer)&&(e.closeTimer=setTimeout(()=>{e.closeTimer=void 0,!(e.references||qm!==e)&&(e.closed=!0,qm=null,Jm=null,e.client.close().catch(()=>void 0))},0))}function $m(e){return typeof e==`object`&&e&&!Array.isArray(e)?e:void 0}function eh(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 th(e){let t=$m($m($m(e)?.ui)?.csp),n=eh(t?.connectDomains,[`http`,`https`,`ws`,`wss`]),r=eh(t?.resourceDomains,[`http`,`https`]),i=eh(t?.frameDomains,[`http`,`https`]),a=eh(t?.baseUriDomains,[`http`,`https`]),o=r.length?` ${r.join(` `)}`:``,s=[`default-src 'none'`,`script-src 'self' 'unsafe-inline'${o}`,`style-src 'self' 'unsafe-inline'${o}`,`img-src 'self' data:${o}`,`media-src 'self' data:${o}`,`connect-src ${n.length?n.join(` `):`'none'`}`];return r.length&&s.push(`font-src 'self' ${r.join(` `)}`),i.length&&s.push(`frame-src ${i.join(` `)}`),a.length&&s.push(`base-uri ${a.join(` `)}`),`${s.join(`; `)};`}function nh(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 rh(e){return e.filter(e=>e.type===`text`).map(e=>String(e.text??``)).join(` +`)}function ih({content:e,onMessage:t}){let n=(0,Rm.useRef)(null),r=(0,Rm.useRef)(null),i=(0,Rm.useRef)(null),a=(0,Rm.useRef)(null),[o,s]=(0,Rm.useState)(``),d=Gm[e.toolName]??620,[h,g]=(0,Rm.useState)(d),[_,v]=(0,Rm.useState)(``),[y,b]=(0,Rm.useState)(0),x=(0,Rm.useRef)(0),S=m(`light`),C=(0,Rm.useRef)(S);C.current=S,(0,Rm.useEffect)(()=>{a.current?.setHostContext({theme:S,displayMode:`inline`})},[S]),(0,Rm.useEffect)(()=>{x.current=0},[e.resourceUri]),(0,Rm.useEffect)(()=>{let t=!1,n;s(``),v(``);let o=()=>{let e=x.current+1;if(e>Um)return;x.current=e;let t=e===1?0:Math.min(750*2**(e-2),6e3);t===0?b(e=>e+1):n=setTimeout(()=>b(e=>e+1),t)},c=()=>o();async function l(){try{let n=await Xm();if(t){Qm(n);return}i.current=n,n.closeListeners.add(c),r.current=n.client;let a=(await n.client.readResource({uri:e.resourceUri})).contents[0];if(!a||!(`text`in a)||!a.text)throw new Km(`MCP App resource has no HTML content`);if(a.uri!==e.resourceUri)throw new Km(`MCP App resource URI does not match the requested URI`);if(a.mimeType!==Bm)throw new Km(`MCP App resource has an unsupported MIME type`);t||(x.current=0,s(nh(a.text,a._meta)))}catch(e){console.error(`MCP app resource load failed`,e),t||(v(`This view could not be loaded. Please try again.`),x.current>0&&!(e instanceof Km)&&o())}}return l(),()=>{t=!0,n&&clearTimeout(n);let e=a.current?.teardownResource({}).catch(()=>void 0)??Promise.resolve(),o=i.current;o&&(o.closeListeners.delete(c),e.finally(()=>Qm(o))),a.current=null,r.current=null,i.current=null}},[e.resourceUri,y]);async function ee(){let i=n.current,s=r.current;if(i?.contentWindow&&o&&s&&!a.current)try{let n=new bd(null,{name:`Fanout`,version:`0.2.0`},{openLinks:{},serverTools:{},logging:{}},{hostContext:{theme:C.current,displayMode:`inline`}});n.oncalltool=(e,t)=>s.request({method:`tools/call`,params:e},Xl,{signal:t.signal}),a.current=n,n.onsizechange=({height:e})=>{e&&g(Math.min(Wm,Math.max(d,Math.ceil(e)+32)))},n.onmessage=async({content:e})=>{let n=rh(e);return n?(await t(n),{}):{isError:!0}},n.oninitialized=async()=>{await n.sendToolInput({arguments:e.toolInput??{}}),await n.sendToolResult({content:[{type:`text`,text:JSON.stringify(e.toolResult??{})}],structuredContent:e.toolResult,isError:e.isError})},await n.connect(new vd(i.contentWindow,i.contentWindow))}catch(e){console.error(`MCP app bridge connect failed`,e),v(`This view could not be loaded. Please try again.`)}}return _?(0,zm.jsx)(u,{color:`bad`,m:`md`,children:_}):o?(0,zm.jsx)(p,{component:`iframe`,ref:n,title:`Fanout analysis view`,sandbox:`allow-scripts`,scrolling:`auto`,srcDoc:o,w:`100%`,bd:0,bg:`var(--mantine-color-body)`,style:{display:`block`,height:h,transition:`height 200ms ease`},onLoad:()=>void ee()}):(0,zm.jsxs)(l,{mih:180,p:`xl`,children:[(0,zm.jsx)(c,{size:`sm`}),(0,zm.jsx)(f,{c:`dimmed`,size:`sm`,ml:`sm`,children:`Preparing view…`})]})}export{ih as default,th as mcpAppCSP}; \ No newline at end of file diff --git a/internal/ui/dist/assets/mcp-app-frame-DUBLTjXl.js b/internal/ui/dist/assets/mcp-app-frame-DUBLTjXl.js deleted file mode 100644 index 35168b41..00000000 --- a/internal/ui/dist/assets/mcp-app-frame-DUBLTjXl.js +++ /dev/null @@ -1,127 +0,0 @@ -import{a as e,d as t,f as n,g as r,h as i,m as a,p as o,u as s}from"./useNavigate-BEpS2iE5.js";import{b as c,f as l,h as u,i as d,m as f,w as p}from"./auth-TmbGk91l.js";import{T as m}from"./index-Cnw6TNqL.js";var h,g=Object.freeze({status:`aborted`});function _(e,t,n){function r(n,r){if(n._zod||Object.defineProperty(n,"_zod",{value:{def:r,constr:o,traits:new Set},enumerable:!1}),n._zod.traits.has(e))return;n._zod.traits.add(e),t(n,r);let i=o.prototype,a=Object.keys(i);for(let e=0;en?.Parent&&t instanceof n.Parent?!0:t?._zod?.traits?.has(e)}),Object.defineProperty(o,"name",{value:e}),o}var v=class extends Error{constructor(){super(`Encountered Promise during synchronous parse. Use .parseAsync() instead.`)}},y=class extends Error{constructor(e){super(`Encountered unidirectional transform during encode: ${e}`),this.name=`ZodEncodeError`}};(h=globalThis).__zod_globalConfig??(h.__zod_globalConfig={});var b=globalThis.__zod_globalConfig;function x(e){return e&&Object.assign(b,e),b}function S(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 C(e,t){return typeof t==`bigint`?t.toString():t}function ee(e){return{get value(){{let t=e();return Object.defineProperty(this,"value",{value:t}),t}}}}function te(e){return e==null}function ne(e){let t=+!!e.startsWith(`^`),n=e.endsWith(`$`)?e.length-1:e.length;return e.slice(t,n)}function re(e,t){let n=e/t,r=Math.round(n),i=2**-52*Math.max(Math.abs(n),1);return Math.abs(n-r){};function ue(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}var de=ee(()=>{if(b.jitless||typeof navigator<`u`&&navigator?.userAgent?.includes(`Cloudflare`))return!1;try{return Function(``),!0}catch{return!1}});function fe(e){if(ue(e)===!1)return!1;let t=e.constructor;if(t===void 0||typeof t!=`function`)return!0;let n=t.prototype;return ue(n)!==!1&&Object.prototype.hasOwnProperty.call(n,`isPrototypeOf`)!==!1}function pe(e){return fe(e)?{...e}:Array.isArray(e)?[...e]:e instanceof Map?new Map(e):e instanceof Set?new Set(e):e}var me=new Set([`string`,`number`,`symbol`]);function he(e){return e.replace(/[.*+?^${}()|[\]\\]/g,`\\$&`)}function ge(e,t,n){let r=new e._zod.constr(t??e._zod.def);return(!t||n?.parent)&&(r._zod.parent=e),r}function T(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 _e(e){return Object.keys(e).filter(t=>e[t]._zod.optin===`optional`&&e[t]._zod.optout===`optional`)}var ve={safeint:[-(2**53-1),2**53-1],int32:[-2147483648,2147483647],uint32:[0,4294967295],float32:[-34028234663852886e22,34028234663852886e22],float64:[-Number.MAX_VALUE,Number.MAX_VALUE]};function ye(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`);return ge(e,oe(e._zod.def,{get shape(){let e={};for(let r in t){if(!(r in n.shape))throw Error(`Unrecognized key: "${r}"`);t[r]&&(e[r]=n.shape[r])}return ae(this,`shape`,e),e},checks:[]}))}function be(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`);return ge(e,oe(e._zod.def,{get shape(){let r={...e._zod.def.shape};for(let e in t){if(!(e in n.shape))throw Error(`Unrecognized key: "${e}"`);t[e]&&delete r[e]}return ae(this,`shape`,r),r},checks:[]}))}function xe(e,t){if(!fe(t))throw Error(`Invalid input to extend: expected a plain object`);let n=e._zod.def.checks;if(n&&n.length>0){let n=e._zod.def.shape;for(let e in t)if(Object.getOwnPropertyDescriptor(n,e)!==void 0)throw Error("Cannot overwrite keys on object schemas containing refinements. Use `.safeExtend()` instead.")}return ge(e,oe(e._zod.def,{get shape(){let n={...e._zod.def.shape,...t};return ae(this,`shape`,n),n}}))}function Se(e,t){if(!fe(t))throw Error(`Invalid input to safeExtend: expected a plain object`);return ge(e,oe(e._zod.def,{get shape(){let n={...e._zod.def.shape,...t};return ae(this,`shape`,n),n}}))}function Ce(e,t){if(e._zod.def.checks?.length)throw Error(`.merge() cannot be used on object schemas containing refinements. Use .safeExtend() instead.`);return ge(e,oe(e._zod.def,{get shape(){let n={...e._zod.def.shape,...t._zod.def.shape};return ae(this,`shape`,n),n},get catchall(){return t._zod.def.catchall},checks:t._zod.def.checks??[]}))}function we(e,t,n){let r=t._zod.def.checks;if(r&&r.length>0)throw Error(`.partial() cannot be used on object schemas containing refinements`);return ge(t,oe(t._zod.def,{get shape(){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 ae(this,`shape`,i),i},checks:[]}))}function Te(e,t,n){return ge(t,oe(t._zod.def,{get shape(){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 ae(this,`shape`,i),i}}))}function Ee(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 ke(e){return typeof e==`string`?e:e?.message}function Ae(e,t,n){let r=e.message?e.message:ke(e.inst?._zod.def?.error?.(e))??ke(t?.error?.(e))??ke(n.customError?.(e))??ke(n.localeError?.(e))??`Invalid input`,{inst:i,continue:a,input:o,...s}=e;return s.path??=[],s.message=r,t?.reportInput&&(s.input=o),s}function je(e){return Array.isArray(e)?`array`:typeof e==`string`?`string`:`unknown`}function Me(...e){let[t,n,r]=e;return typeof t==`string`?{message:t,code:`custom`,input:n,inst:r}:{...t}}var Ne=(e,t)=>{e.name=`$ZodError`,Object.defineProperty(e,"_zod",{value:e._zod,enumerable:!1}),Object.defineProperty(e,"issues",{value:t,enumerable:!1}),e.message=JSON.stringify(t,C,2),Object.defineProperty(e,"toString",{value:()=>e.message,enumerable:!1})},Pe=_(`$ZodError`,Ne),Fe=_(`$ZodError`,Ne,{Parent:Error});function Ie(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 Le(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(t,n,r,i)=>{let a=r?{...r,async:!1}:{async:!1},o=t._zod.run({value:n,issues:[]},a);if(o instanceof Promise)throw new v;if(o.issues.length){let t=new((i?.Err)??e)(o.issues.map(e=>Ae(e,a,x())));throw le(t,i?.callee),t}return o.value},ze=e=>async(t,n,r,i)=>{let a=r?{...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=>Ae(e,a,x())));throw le(t,i?.callee),t}return o.value},Be=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 v;return a.issues.length?{success:!1,error:new(e??Pe)(a.issues.map(e=>Ae(e,i,x())))}:{success:!0,data:a.value}},Ve=Be(Fe),He=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?{success:!1,error:new e(a.issues.map(e=>Ae(e,i,x())))}:{success:!0,data:a.value}},Ue=He(Fe),We=e=>(t,n,r)=>{let i=r?{...r,direction:`backward`}:{direction:`backward`};return Re(e)(t,n,i)},Ge=e=>(t,n,r)=>Re(e)(t,n,r),Ke=e=>async(t,n,r)=>{let i=r?{...r,direction:`backward`}:{direction:`backward`};return ze(e)(t,n,i)},qe=e=>async(t,n,r)=>ze(e)(t,n,r),Je=e=>(t,n,r)=>{let i=r?{...r,direction:`backward`}:{direction:`backward`};return Be(e)(t,n,i)},Ye=e=>(t,n,r)=>Be(e)(t,n,r),Xe=e=>async(t,n,r)=>{let i=r?{...r,direction:`backward`}:{direction:`backward`};return He(e)(t,n,i)},Ze=e=>async(t,n,r)=>He(e)(t,n,r),Qe=/^[cC][0-9a-z]{6,}$/,$e=/^[0-9a-z]+$/,et=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,tt=/^[0-9a-vA-V]{20}$/,nt=/^[A-Za-z0-9]{27}$/,rt=/^[a-zA-Z0-9_-]{21}$/,it=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,at=/^([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})$/,ot=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)$/,st=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,ct=`^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$`;function lt(){return new RegExp(ct,`u`)}var ut=/^(?:(?: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])$/,dt=/^(([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}|:))$/,ft=/^((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])$/,pt=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|::|([0-9a-fA-F]{1,4})?::([0-9a-fA-F]{1,4}:?){0,6})\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,mt=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,ht=/^[A-Za-z0-9_-]*$/,gt=/^https?$/,_t=/^\+[1-9]\d{6,14}$/,vt=`(?:(?:\\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])))`,yt=RegExp(`^${vt}$`);function bt(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}}`:`${t}(?::[0-5]\\d(?:\\.\\d+)?)?`}function xt(e){return RegExp(`^${bt(e)}$`)}function St(e){let t=bt({precision:e.precision}),n=[`Z`];e.local&&n.push(``),e.offset&&n.push(`([+-](?:[01]\\d|2[0-3]):[0-5]\\d)`);let r=`${t}(?:${n.join(`|`)})`;return RegExp(`^${vt}T(?:${r})$`)}var Ct=e=>{let t=e?`[\\s\\S]{${e?.minimum??0},${e?.maximum??``}}`:`[\\s\\S]*`;return RegExp(`^${t}$`)},wt=/^-?\d+$/,Tt=/^-?\d+(?:\.\d+)?$/,Et=/^(?:true|false)$/i,Dt=/^null$/i,Ot=/^undefined$/i,kt=/^[^A-Z]*$/,At=/^[^a-z]*$/,E=_(`$ZodCheck`,(e,t)=>{var n;e._zod??={},e._zod.def=t,(n=e._zod).onattach??(n.onattach=[])}),jt={number:`number`,bigint:`bigint`,object:`date`},Mt=_(`$ZodCheckLessThan`,(e,t)=>{E.init(e,t);let n=jt[typeof t.value];e._zod.onattach.push(e=>{let n=e._zod.bag,r=(t.inclusive?n.maximum:n.exclusiveMaximum)??1/0;t.value{(t.inclusive?r.value<=t.value:r.value{E.init(e,t);let n=jt[typeof t.value];e._zod.onattach.push(e=>{let n=e._zod.bag,r=(t.inclusive?n.minimum:n.exclusiveMinimum)??-1/0;t.value>r&&(t.inclusive?n.minimum=t.value:n.exclusiveMinimum=t.value)}),e._zod.check=r=>{(t.inclusive?r.value>=t.value:r.value>t.value)||r.issues.push({origin: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})}}),Pt=_(`$ZodCheckMultipleOf`,(e,t)=>{E.init(e,t),e._zod.onattach.push(e=>{var n;(n=e._zod.bag).multipleOf??(n.multipleOf=t.value)}),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`?n.value%t.value===BigInt(0):re(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})}}),Ft=_(`$ZodCheckNumberFormat`,(e,t)=>{E.init(e,t),t.format=t.format||`float64`;let n=t.format?.includes(`int`),r=n?`int`:`number`,[i,a]=ve[t.format];e._zod.onattach.push(e=>{let r=e._zod.bag;r.format=t.format,r.minimum=i,r.maximum=a,n&&(r.pattern=wt)}),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})}}),It=_(`$ZodCheckMaxLength`,(e,t)=>{var n;E.init(e,t),(n=e._zod.def).when??(n.when=e=>{let t=e.value;return!te(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=je(r);n.issues.push({origin:i,code:`too_big`,maximum:t.maximum,inclusive:!0,input:r,inst:e,continue:!t.abort})}}),Lt=_(`$ZodCheckMinLength`,(e,t)=>{var n;E.init(e,t),(n=e._zod.def).when??(n.when=e=>{let t=e.value;return!te(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=je(r);n.issues.push({origin:i,code:`too_small`,minimum:t.minimum,inclusive:!0,input:r,inst:e,continue:!t.abort})}}),Rt=_(`$ZodCheckLengthEquals`,(e,t)=>{var n;E.init(e,t),(n=e._zod.def).when??(n.when=e=>{let t=e.value;return!te(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=je(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})}}),zt=_(`$ZodCheckStringFormat`,(e,t)=>{var n,r;E.init(e,t),e._zod.onattach.push(e=>{let n=e._zod.bag;n.format=t.format,t.pattern&&(n.patterns??=new Set,n.patterns.add(t.pattern))}),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=()=>{})}),Bt=_(`$ZodCheckRegex`,(e,t)=>{zt.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})}}),Vt=_(`$ZodCheckLowerCase`,(e,t)=>{t.pattern??=kt,zt.init(e,t)}),Ht=_(`$ZodCheckUpperCase`,(e,t)=>{t.pattern??=At,zt.init(e,t)}),Ut=_(`$ZodCheckIncludes`,(e,t)=>{E.init(e,t);let n=he(t.includes),r=new RegExp(typeof t.position==`number`?`^.{${t.position}}${n}`:n);t.pattern=r,e._zod.onattach.push(e=>{let t=e._zod.bag;t.patterns??=new Set,t.patterns.add(r)}),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})}}),Wt=_(`$ZodCheckStartsWith`,(e,t)=>{E.init(e,t);let n=RegExp(`^${he(t.prefix)}.*`);t.pattern??=n,e._zod.onattach.push(e=>{let t=e._zod.bag;t.patterns??=new Set,t.patterns.add(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})}}),Gt=_(`$ZodCheckEndsWith`,(e,t)=>{E.init(e,t);let n=RegExp(`.*${he(t.suffix)}$`);t.pattern??=n,e._zod.onattach.push(e=>{let t=e._zod.bag;t.patterns??=new Set,t.patterns.add(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})}}),Kt=_(`$ZodCheckOverwrite`,(e,t)=>{E.init(e,t),e._zod.check=e=>{e.value=t.tx(e.value)}}),qt=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(` -`))}},Jt={major:4,minor:4,patch:3},D=_(`$ZodType`,(e,t)=>{var n;e??={},e._zod.def=t,e._zod.bag=e._zod.bag||{},e._zod.version=Jt;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=Ee(e),i;for(let a of t){if(a._zod.def.when){if(De(e)||!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 v;if(i||o instanceof Promise)i=(i??Promise.resolve()).then(async()=>{await o,e.issues.length!==t&&(r||=Ee(e,t))});else{if(e.issues.length===t)continue;r||=Ee(e,t)}}return i?i.then(()=>e):e},n=(n,i,a)=>{if(Ee(n))return n.aborted=!0,n;let o=t(i,r,a);if(o instanceof Promise){if(a.async===!1)throw new v;return o.then(t=>e._zod.parse(t,a))}return e._zod.parse(o,a)};e._zod.run=(i,a)=>{if(a.skipChecks)return e._zod.parse(i,a);if(a.direction===`backward`){let t=e._zod.parse({value:i.value,issues:[]},{...a,skipChecks:!0});return t instanceof Promise?t.then(e=>n(e,i,a)):n(t,i,a)}let o=e._zod.parse(i,a);if(o instanceof Promise){if(a.async===!1)throw new v;return o.then(e=>t(e,r,a))}return t(o,r,a)}}w(e,`~standard`,()=>({validate:t=>{try{let n=Ve(e,t);return n.success?{value:n.data}:{issues:n.error?.issues}}catch{return Ue(e,t).then(e=>e.success?{value:e.data}:{issues:e.error?.issues})}},vendor:`zod`,version:1}))}),Yt=_(`$ZodString`,(e,t)=>{D.init(e,t),e._zod.pattern=[...e?._zod.bag?.patterns??[]].pop()??Ct(e._zod.bag),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}}),O=_(`$ZodStringFormat`,(e,t)=>{zt.init(e,t),Yt.init(e,t)}),Xt=_(`$ZodGUID`,(e,t)=>{t.pattern??=at,O.init(e,t)}),Zt=_(`$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??=ot(e)}else t.pattern??=ot();O.init(e,t)}),Qt=_(`$ZodEmail`,(e,t)=>{t.pattern??=st,O.init(e,t)}),$t=_(`$ZodURL`,(e,t)=>{O.init(e,t),e._zod.check=n=>{try{let r=n.value.trim();if(!t.normalize&&t.protocol?.source===gt.source&&!/^https?:\/\//i.test(r)){n.issues.push({code:`invalid_format`,format:`url`,note:`Invalid URL format`,input:n.value,inst:e,continue:!t.abort});return}let i=new URL(r);t.hostname&&(t.hostname.lastIndex=0,t.hostname.test(i.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&&(t.protocol.lastIndex=0,t.protocol.test(i.protocol.endsWith(`:`)?i.protocol.slice(0,-1):i.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:r;return}catch{n.issues.push({code:`invalid_format`,format:`url`,input:n.value,inst:e,continue:!t.abort})}}}),en=_(`$ZodEmoji`,(e,t)=>{t.pattern??=lt(),O.init(e,t)}),tn=_(`$ZodNanoID`,(e,t)=>{t.pattern??=rt,O.init(e,t)}),nn=_(`$ZodCUID`,(e,t)=>{t.pattern??=Qe,O.init(e,t)}),rn=_(`$ZodCUID2`,(e,t)=>{t.pattern??=$e,O.init(e,t)}),an=_(`$ZodULID`,(e,t)=>{t.pattern??=et,O.init(e,t)}),on=_(`$ZodXID`,(e,t)=>{t.pattern??=tt,O.init(e,t)}),sn=_(`$ZodKSUID`,(e,t)=>{t.pattern??=nt,O.init(e,t)}),cn=_(`$ZodISODateTime`,(e,t)=>{t.pattern??=St(t),O.init(e,t)}),ln=_(`$ZodISODate`,(e,t)=>{t.pattern??=yt,O.init(e,t)}),un=_(`$ZodISOTime`,(e,t)=>{t.pattern??=xt(t),O.init(e,t)}),dn=_(`$ZodISODuration`,(e,t)=>{t.pattern??=it,O.init(e,t)}),fn=_(`$ZodIPv4`,(e,t)=>{t.pattern??=ut,O.init(e,t),e._zod.bag.format=`ipv4`}),pn=_(`$ZodIPv6`,(e,t)=>{t.pattern??=dt,O.init(e,t),e._zod.bag.format=`ipv6`,e._zod.check=n=>{try{new URL(`http://[${n.value}]`)}catch{n.issues.push({code:`invalid_format`,format:`ipv6`,input:n.value,inst:e,continue:!t.abort})}}}),mn=_(`$ZodCIDRv4`,(e,t)=>{t.pattern??=ft,O.init(e,t)}),hn=_(`$ZodCIDRv6`,(e,t)=>{t.pattern??=pt,O.init(e,t),e._zod.check=n=>{let r=n.value.split(`/`);try{if(r.length!==2)throw Error();let[e,t]=r;if(!t)throw Error();let n=Number(t);if(`${n}`!==t||n<0||n>128)throw Error();new URL(`http://[${e}]`)}catch{n.issues.push({code:`invalid_format`,format:`cidrv6`,input:n.value,inst:e,continue:!t.abort})}}});function gn(e){if(e===``)return!0;if(/\s/.test(e)||e.length%4!=0)return!1;try{return atob(e),!0}catch{return!1}}var _n=_(`$ZodBase64`,(e,t)=>{t.pattern??=mt,O.init(e,t),e._zod.bag.contentEncoding=`base64`,e._zod.check=n=>{gn(n.value)||n.issues.push({code:`invalid_format`,format:`base64`,input:n.value,inst:e,continue:!t.abort})}});function vn(e){if(!ht.test(e))return!1;let t=e.replace(/[-_]/g,e=>e===`-`?`+`:`/`);return gn(t.padEnd(Math.ceil(t.length/4)*4,`=`))}var yn=_(`$ZodBase64URL`,(e,t)=>{t.pattern??=ht,O.init(e,t),e._zod.bag.contentEncoding=`base64url`,e._zod.check=n=>{vn(n.value)||n.issues.push({code:`invalid_format`,format:`base64url`,input:n.value,inst:e,continue:!t.abort})}}),bn=_(`$ZodE164`,(e,t)=>{t.pattern??=_t,O.init(e,t)});function xn(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 Sn=_(`$ZodJWT`,(e,t)=>{O.init(e,t),e._zod.check=n=>{xn(n.value,t.alg)||n.issues.push({code:`invalid_format`,format:`jwt`,input:n.value,inst:e,continue:!t.abort})}}),Cn=_(`$ZodNumber`,(e,t)=>{D.init(e,t),e._zod.pattern=e._zod.bag.pattern??Tt,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:`Infinity`:void 0;return n.issues.push({expected:`number`,code:`invalid_type`,input:i,inst:e,...a?{received:a}:{}}),n}}),wn=_(`$ZodNumberFormat`,(e,t)=>{Ft.init(e,t),Cn.init(e,t)}),Tn=_(`$ZodBoolean`,(e,t)=>{D.init(e,t),e._zod.pattern=Et,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}}),En=_(`$ZodUndefined`,(e,t)=>{D.init(e,t),e._zod.pattern=Ot,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}}),Dn=_(`$ZodNull`,(e,t)=>{D.init(e,t),e._zod.pattern=Dt,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}}),On=_(`$ZodAny`,(e,t)=>{D.init(e,t),e._zod.parse=e=>e}),kn=_(`$ZodUnknown`,(e,t)=>{D.init(e,t),e._zod.parse=e=>e}),An=_(`$ZodNever`,(e,t)=>{D.init(e,t),e._zod.parse=(t,n)=>(t.issues.push({expected:`never`,code:`invalid_type`,input:t.value,inst:e}),t)});function jn(e,t,n){e.issues.length&&t.issues.push(...Oe(n,e.issues)),t.value[n]=e.value}var Mn=_(`$ZodArray`,(e,t)=>{D.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;ejn(t,n,e))):jn(s,n,e)}return a.length?Promise.all(a).then(()=>n):n}});function Nn(e,t,n,r,i,a){let o=n in r;if(e.issues.length){if(i&&a&&!o)return;t.issues.push(...Oe(n,e.issues))}if(!o&&!i){e.issues.length||t.issues.push({code:`invalid_type`,expected:`nonoptional`,input:void 0,path:[n]});return}e.value===void 0?o&&(t.value[n]=void 0):t.value[n]=e.value}function Pn(e){let t=Object.keys(e.shape);for(let n of t)if(!e.shape?.[n]?._zod?.traits?.has(`$ZodType`))throw Error(`Invalid element at key "${n}": expected a Zod schema`);let n=_e(e.shape);return{...e,keys:t,keySet:new Set(t),numKeys:t.length,optionalKeys:new Set(n)}}function Fn(e,t,n,r,i,a){let o=[],s=i.keySet,c=i.catchall._zod,l=c.def.type,u=c.optin===`optional`,d=c.optout===`optional`;for(let i in t){if(i===`__proto__`||s.has(i))continue;if(l===`never`){o.push(i);continue}let a=c.run({value:t[i],issues:[]},r);a instanceof Promise?e.push(a.then(e=>Nn(e,n,i,t,u,d))):Nn(a,n,i,t,u,d)}return o.length&&n.issues.push({code:`unrecognized_keys`,keys:o,input:t,inst:a}),e.length?Promise.all(e).then(()=>n):n}var In=_(`$ZodObject`,(e,t)=>{if(D.init(e,t),!Object.getOwnPropertyDescriptor(t,`shape`)?.get){let e=t.shape;Object.defineProperty(t,"shape",{get:()=>{let n={...e};return Object.defineProperty(t,"shape",{value:n}),n}})}let n=ee(()=>Pn(t));w(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=ue,i=t.catchall,a;e._zod.parse=(t,o)=>{a??=n.value;let s=t.value;if(!r(s))return t.issues.push({expected:`object`,code:`invalid_type`,input:s,inst:e}),t;t.value={};let c=[],l=a.shape;for(let e of a.keys){let n=l[e],r=n._zod.optin===`optional`,i=n._zod.optout===`optional`,a=n._zod.run({value:s[e],issues:[]},o);a instanceof Promise?c.push(a.then(n=>Nn(n,t,e,s,r,i))):Nn(a,t,e,s,r,i)}return i?Fn(c,s,t,o,n.value,e):c.length?Promise.all(c).then(()=>t):t}}),Ln=_(`$ZodObjectJIT`,(e,t)=>{In.init(e,t);let n=e._zod.parse,r=ee(()=>Pn(t)),i=e=>{let t=new qt([`shape`,`payload`,`ctx`]),n=r.value,i=e=>{let t=se(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 n.keys)a[e]=`key_${o++}`;t.write(`const newResult = {};`);for(let r of n.keys){let n=a[r],o=se(r),s=e[r],c=s?._zod?.optin===`optional`,l=s?._zod?.optout===`optional`;t.write(`const ${n} = ${i(r)};`),c&&l?t.write(` - if (${n}.issues.length) { - if (${o} in input) { - payload.issues = payload.issues.concat(${n}.issues.map(iss => ({ - ...iss, - path: iss.path ? [${o}, ...iss.path] : [${o}] - }))); - } - } - - if (${n}.value === undefined) { - if (${o} in input) { - newResult[${o}] = undefined; - } - } else { - newResult[${o}] = ${n}.value; - } - - `):c?t.write(` - if (${n}.issues.length) { - payload.issues = payload.issues.concat(${n}.issues.map(iss => ({ - ...iss, - path: iss.path ? [${o}, ...iss.path] : [${o}] - }))); - } - - if (${n}.value === undefined) { - if (${o} in input) { - newResult[${o}] = undefined; - } - } else { - newResult[${o}] = ${n}.value; - } - - `):t.write(` - const ${n}_present = ${o} in input; - if (${n}.issues.length) { - payload.issues = payload.issues.concat(${n}.issues.map(iss => ({ - ...iss, - path: iss.path ? [${o}, ...iss.path] : [${o}] - }))); - } - if (!${n}_present && !${n}.issues.length) { - payload.issues.push({ - code: "invalid_type", - expected: "nonoptional", - input: undefined, - path: [${o}] - }); - } - - if (${n}_present) { - if (${n}.value === undefined) { - newResult[${o}] = undefined; - } else { - newResult[${o}] = ${n}.value; - } - } - - `)}t.write(`payload.value = newResult;`),t.write(`return payload;`);let s=t.compile();return(t,n)=>s(e,t,n)},a,o=ue,s=!b.jitless,c=s&&de.value,l=t.catchall,u;e._zod.parse=(d,f)=>{u??=r.value;let p=d.value;return o(p)?s&&c&&f?.async===!1&&f.jitless!==!0?(a||=i(t.shape),d=a(d,f),l?Fn([],p,d,f,u,e):d):n(d,f):(d.issues.push({expected:`object`,code:`invalid_type`,input:p,inst:e}),d)}});function Rn(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=>!Ee(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=>Ae(e,r,x())))}),t)}var zn=_(`$ZodUnion`,(e,t)=>{D.init(e,t),w(e._zod,`optin`,()=>t.options.some(e=>e._zod.optin===`optional`)?`optional`:void 0),w(e._zod,`optout`,()=>t.options.some(e=>e._zod.optout===`optional`)?`optional`:void 0),w(e._zod,`values`,()=>{if(t.options.every(e=>e._zod.values))return new Set(t.options.flatMap(e=>Array.from(e._zod.values)))}),w(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=>ne(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=>Rn(t,r,e,i)):Rn(o,r,e,i)}}),Bn=_(`$ZodDiscriminatedUnion`,(e,t)=>{t.inclusive=!1,zn.init(e,t);let n=e._zod.parse;w(e._zod,`propValues`,()=>{let e={};for(let n of t.options){let r=n._zod.propValues;if(!r||Object.keys(r).length===0)throw Error(`Invalid discriminated union option at index "${t.options.indexOf(n)}"`);for(let[t,n]of Object.entries(r)){e[t]||(e[t]=new Set);for(let r of n)e[t].add(r)}}return e});let r=ee(()=>{let e=t.options,n=new Map;for(let r of e){let e=r._zod.propValues?.[t.discriminator];if(!e||e.size===0)throw Error(`Invalid discriminated union option at index "${t.options.indexOf(r)}"`);for(let t of e){if(n.has(t))throw Error(`Duplicate discriminator value "${String(t)}"`);n.set(t,r)}}return n});e._zod.parse=(i,a)=>{let o=i.value;if(!ue(o))return i.issues.push({code:`invalid_type`,expected:`object`,input:o,inst:e}),i;let s=r.value.get(o?.[t.discriminator]);return s?s._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()),input:o,path:[t.discriminator],inst:e}),i)}}),Vn=_(`$ZodIntersection`,(e,t)=>{D.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])=>Un(e,t,n)):Un(e,i,a)}});function Hn(e,t){if(e===t||e instanceof Date&&t instanceof Date&&+e==+t)return{valid:!0,data:e};if(fe(e)&&fe(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=Hn(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;re.l&&e.r).map(([e])=>e);if(a.length&&i&&e.issues.push({...i,keys:a}),Ee(e))return e;let o=Hn(t.value,n.value);if(!o.valid)throw Error(`Unmergable intersection. Error path: ${JSON.stringify(o.mergeErrorPath)}`);return e.value=o.data,e}var Wn=_(`$ZodRecord`,(e,t)=>{D.init(e,t),e._zod.parse=(n,r)=>{let i=n.value;if(!fe(i))return n.issues.push({expected:`record`,code:`invalid_type`,input:i,inst:e}),n;let a=[],o=t.keyType._zod.values;if(o){n.value={};let s=new Set;for(let c of o)if(typeof c==`string`||typeof c==`number`||typeof c==`symbol`){s.add(typeof c==`number`?c.toString():c);let o=t.keyType._zod.run({value:c,issues:[]},r);if(o instanceof Promise)throw Error(`Async schemas not supported in object keys currently`);if(o.issues.length){n.issues.push({code:`invalid_key`,origin:`record`,issues:o.issues.map(e=>Ae(e,r,x())),input:c,path:[c],inst:e});continue}let l=o.value,u=t.valueType._zod.run({value:i[c],issues:[]},r);u instanceof Promise?a.push(u.then(e=>{e.issues.length&&n.issues.push(...Oe(c,e.issues)),n.value[l]=e.value})):(u.issues.length&&n.issues.push(...Oe(c,u.issues)),n.value[l]=u.value)}let c;for(let e in i)s.has(e)||(c??=[],c.push(e));c&&c.length>0&&n.issues.push({code:`unrecognized_keys`,input:i,inst:e,keys:c})}else{n.value={};for(let o of Reflect.ownKeys(i)){if(o===`__proto__`||!Object.prototype.propertyIsEnumerable.call(i,o))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(typeof o==`string`&&Tt.test(o)&&s.issues.length){let e=t.keyType._zod.run({value:Number(o),issues:[]},r);if(e instanceof Promise)throw Error(`Async schemas not supported in object keys currently`);e.issues.length===0&&(s=e)}if(s.issues.length){t.mode===`loose`?n.value[o]=i[o]:n.issues.push({code:`invalid_key`,origin:`record`,issues:s.issues.map(e=>Ae(e,r,x())),input:o,path:[o],inst:e});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(...Oe(o,e.issues)),n.value[s.value]=e.value})):(c.issues.length&&n.issues.push(...Oe(o,c.issues)),n.value[s.value]=c.value)}}return a.length?Promise.all(a).then(()=>n):n}}),Gn=_(`$ZodEnum`,(e,t)=>{D.init(e,t);let n=S(t.entries),r=new Set(n);e._zod.values=r,e._zod.pattern=RegExp(`^(${n.filter(e=>me.has(typeof e)).map(e=>typeof e==`string`?he(e):e.toString()).join(`|`)})$`),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}}),Kn=_(`$ZodLiteral`,(e,t)=>{if(D.init(e,t),t.values.length===0)throw Error(`Cannot create literal schema with no valid values`);let n=new Set(t.values);e._zod.values=n,e._zod.pattern=RegExp(`^(${t.values.map(e=>typeof e==`string`?he(e):e?he(e.toString()):String(e)).join(`|`)})$`),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}}),qn=_(`$ZodTransform`,(e,t)=>{D.init(e,t),e._zod.optin=`optional`,e._zod.parse=(n,r)=>{if(r.direction===`backward`)throw new y(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.fallback=!0,n));if(i instanceof Promise)throw new v;return n.value=i,n.fallback=!0,n}});function Jn(e,t){return t===void 0&&(e.issues.length||e.fallback)?{issues:[],value:void 0}:e}var Yn=_(`$ZodOptional`,(e,t)=>{D.init(e,t),e._zod.optin=`optional`,e._zod.optout=`optional`,w(e._zod,`values`,()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,void 0]):void 0),w(e._zod,`pattern`,()=>{let e=t.innerType._zod.pattern;return e?RegExp(`^(${ne(e.source)})?$`):void 0}),e._zod.parse=(e,n)=>{if(t.innerType._zod.optin===`optional`){let r=e.value,i=t.innerType._zod.run(e,n);return i instanceof Promise?i.then(e=>Jn(e,r)):Jn(i,r)}return e.value===void 0?e:t.innerType._zod.run(e,n)}}),Xn=_(`$ZodExactOptional`,(e,t)=>{Yn.init(e,t),w(e._zod,`values`,()=>t.innerType._zod.values),w(e._zod,`pattern`,()=>t.innerType._zod.pattern),e._zod.parse=(e,n)=>t.innerType._zod.run(e,n)}),Zn=_(`$ZodNullable`,(e,t)=>{D.init(e,t),w(e._zod,`optin`,()=>t.innerType._zod.optin),w(e._zod,`optout`,()=>t.innerType._zod.optout),w(e._zod,`pattern`,()=>{let e=t.innerType._zod.pattern;return e?RegExp(`^(${ne(e.source)}|null)$`):void 0}),w(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)}),Qn=_(`$ZodDefault`,(e,t)=>{D.init(e,t),e._zod.optin=`optional`,w(e._zod,`values`,()=>t.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=>$n(e,t)):$n(r,t)}});function $n(e,t){return e.value===void 0&&(e.value=t.defaultValue),e}var er=_(`$ZodPrefault`,(e,t)=>{D.init(e,t),e._zod.optin=`optional`,w(e._zod,`values`,()=>t.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))}),tr=_(`$ZodNonOptional`,(e,t)=>{D.init(e,t),w(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=>nr(t,e)):nr(i,e)}});function nr(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 rr=_(`$ZodCatch`,(e,t)=>{D.init(e,t),e._zod.optin=`optional`,w(e._zod,`optout`,()=>t.innerType._zod.optout),w(e._zod,`values`,()=>t.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(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=>Ae(e,n,x()))},input:e.value}),e.issues=[],e.fallback=!0),e)):(e.value=r.value,r.issues.length&&(e.value=t.catchValue({...e,error:{issues:r.issues.map(e=>Ae(e,n,x()))},input:e.value}),e.issues=[],e.fallback=!0),e)}}),ir=_(`$ZodPipe`,(e,t)=>{D.init(e,t),w(e._zod,`values`,()=>t.in._zod.values),w(e._zod,`optin`,()=>t.in._zod.optin),w(e._zod,`optout`,()=>t.out._zod.optout),w(e._zod,`propValues`,()=>t.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=>ar(e,t.in,n)):ar(r,t.in,n)}let r=t.in._zod.run(e,n);return r instanceof Promise?r.then(e=>ar(e,t.out,n)):ar(r,t.out,n)}});function ar(e,t,n){return e.issues.length?(e.aborted=!0,e):t._zod.run({value:e.value,issues:e.issues,fallback:e.fallback},n)}var or=_(`$ZodPreprocess`,(e,t)=>{ir.init(e,t)}),sr=_(`$ZodReadonly`,(e,t)=>{D.init(e,t),w(e._zod,`propValues`,()=>t.innerType._zod.propValues),w(e._zod,`values`,()=>t.innerType._zod.values),w(e._zod,`optin`,()=>t.innerType?._zod?.optin),w(e._zod,`optout`,()=>t.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(cr):cr(r)}});function cr(e){return e.value=Object.freeze(e.value),e}var lr=_(`$ZodCustom`,(e,t)=>{E.init(e,t),D.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=>ur(t,n,r,e));ur(i,n,r,e)}});function ur(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(Me(e))}}var dr,fr=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 pr(){return new fr}(dr=globalThis).__zod_globalRegistry??(dr.__zod_globalRegistry=pr());var mr=globalThis.__zod_globalRegistry;function hr(e,t){return new e({type:`string`,...T(t)})}function gr(e,t){return new e({type:`string`,format:`email`,check:`string_format`,abort:!1,...T(t)})}function _r(e,t){return new e({type:`string`,format:`guid`,check:`string_format`,abort:!1,...T(t)})}function vr(e,t){return new e({type:`string`,format:`uuid`,check:`string_format`,abort:!1,...T(t)})}function yr(e,t){return new e({type:`string`,format:`uuid`,check:`string_format`,abort:!1,version:`v4`,...T(t)})}function br(e,t){return new e({type:`string`,format:`uuid`,check:`string_format`,abort:!1,version:`v6`,...T(t)})}function xr(e,t){return new e({type:`string`,format:`uuid`,check:`string_format`,abort:!1,version:`v7`,...T(t)})}function Sr(e,t){return new e({type:`string`,format:`url`,check:`string_format`,abort:!1,...T(t)})}function Cr(e,t){return new e({type:`string`,format:`emoji`,check:`string_format`,abort:!1,...T(t)})}function wr(e,t){return new e({type:`string`,format:`nanoid`,check:`string_format`,abort:!1,...T(t)})}function Tr(e,t){return new e({type:`string`,format:`cuid`,check:`string_format`,abort:!1,...T(t)})}function Er(e,t){return new e({type:`string`,format:`cuid2`,check:`string_format`,abort:!1,...T(t)})}function Dr(e,t){return new e({type:`string`,format:`ulid`,check:`string_format`,abort:!1,...T(t)})}function Or(e,t){return new e({type:`string`,format:`xid`,check:`string_format`,abort:!1,...T(t)})}function kr(e,t){return new e({type:`string`,format:`ksuid`,check:`string_format`,abort:!1,...T(t)})}function Ar(e,t){return new e({type:`string`,format:`ipv4`,check:`string_format`,abort:!1,...T(t)})}function jr(e,t){return new e({type:`string`,format:`ipv6`,check:`string_format`,abort:!1,...T(t)})}function Mr(e,t){return new e({type:`string`,format:`cidrv4`,check:`string_format`,abort:!1,...T(t)})}function Nr(e,t){return new e({type:`string`,format:`cidrv6`,check:`string_format`,abort:!1,...T(t)})}function Pr(e,t){return new e({type:`string`,format:`base64`,check:`string_format`,abort:!1,...T(t)})}function Fr(e,t){return new e({type:`string`,format:`base64url`,check:`string_format`,abort:!1,...T(t)})}function Ir(e,t){return new e({type:`string`,format:`e164`,check:`string_format`,abort:!1,...T(t)})}function Lr(e,t){return new e({type:`string`,format:`jwt`,check:`string_format`,abort:!1,...T(t)})}function Rr(e,t){return new e({type:`string`,format:`datetime`,check:`string_format`,offset:!1,local:!1,precision:null,...T(t)})}function zr(e,t){return new e({type:`string`,format:`date`,check:`string_format`,...T(t)})}function Br(e,t){return new e({type:`string`,format:`time`,check:`string_format`,precision:null,...T(t)})}function Vr(e,t){return new e({type:`string`,format:`duration`,check:`string_format`,...T(t)})}function Hr(e,t){return new e({type:`number`,checks:[],...T(t)})}function Ur(e,t){return new e({type:`number`,coerce:!0,checks:[],...T(t)})}function Wr(e,t){return new e({type:`number`,check:`number_format`,abort:!1,format:`safeint`,...T(t)})}function Gr(e,t){return new e({type:`boolean`,...T(t)})}function Kr(e,t){return new e({type:`undefined`,...T(t)})}function qr(e,t){return new e({type:`null`,...T(t)})}function Jr(e){return new e({type:`any`})}function Yr(e){return new e({type:`unknown`})}function Xr(e,t){return new e({type:`never`,...T(t)})}function Zr(e,t){return new Mt({check:`less_than`,...T(t),value:e,inclusive:!1})}function Qr(e,t){return new Mt({check:`less_than`,...T(t),value:e,inclusive:!0})}function $r(e,t){return new Nt({check:`greater_than`,...T(t),value:e,inclusive:!1})}function ei(e,t){return new Nt({check:`greater_than`,...T(t),value:e,inclusive:!0})}function ti(e,t){return new Pt({check:`multiple_of`,...T(t),value:e})}function ni(e,t){return new It({check:`max_length`,...T(t),maximum:e})}function ri(e,t){return new Lt({check:`min_length`,...T(t),minimum:e})}function ii(e,t){return new Rt({check:`length_equals`,...T(t),length:e})}function ai(e,t){return new Bt({check:`string_format`,format:`regex`,...T(t),pattern:e})}function oi(e){return new Vt({check:`string_format`,format:`lowercase`,...T(e)})}function si(e){return new Ht({check:`string_format`,format:`uppercase`,...T(e)})}function ci(e,t){return new Ut({check:`string_format`,format:`includes`,...T(t),includes:e})}function li(e,t){return new Wt({check:`string_format`,format:`starts_with`,...T(t),prefix:e})}function ui(e,t){return new Gt({check:`string_format`,format:`ends_with`,...T(t),suffix:e})}function di(e){return new Kt({check:`overwrite`,tx:e})}function fi(e){return di(t=>t.normalize(e))}function pi(){return di(e=>e.trim())}function mi(){return di(e=>e.toLowerCase())}function hi(){return di(e=>e.toUpperCase())}function gi(){return di(e=>ce(e))}function _i(e,t,n){return new e({type:`array`,element:t,...T(n)})}function vi(e,t,n){let r=T(n);return r.abort??=!0,new e({type:`custom`,check:`custom`,fn:t,...r})}function yi(e,t,n){return new e({type:`custom`,check:`custom`,fn:t,...T(n)})}function bi(e,t){let n=xi(t=>(t.addIssue=e=>{if(typeof e==`string`)t.issues.push(Me(e,t.value,n._zod.def));else{let r=e;r.fatal&&(r.continue=!1),r.code??=`custom`,r.input??=t.value,r.inst??=n,r.continue??=!n._zod.def.abort,t.issues.push(Me(r))}},e(t.value,t)),t);return n}function xi(e,t){let n=new E({check:`custom`,...T(t)});return n._zod.check=e,n}function Si(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??mr,target:t,unrepresentable:e?.unrepresentable??`throw`,override:e?.override??(()=>{}),io:e?.io??`output`,counter:0,seen:new Map,cycles:e?.cycles??`ref`,reused:e?.reused??`inline`,external:e?.external??void 0}}function k(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);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,k(a,t,r),t.seen.get(a).isParent=!0)}let c=t.metadataRegistry.get(e);return c&&Object.assign(o.schema,c),t.io===`input`&&A(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 Ci(e,t){let n=e.seen.get(t);if(!n)throw Error(`Unprocessed schema. This is a bug in Zod.`);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}/${a}`}}if(t[1]===n)return{ref:`#`};let i=`#/${r}/`,a=t[1].schema.id??`__schema${e.counter++}`;return{defId:a,ref:i+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}if(r.count>1&&e.reused===`ref`){a(n);continue}}}function wi(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)):Object.assign(i,s),Object.assign(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??[]})};for(let t of[...e.seen.entries()].reverse())r(t[0]);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)}Object.assign(i,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??{};for(let t of e.seen.entries()){let e=t[1];e.def&&e.defId&&(e.def.id===e.defId&&delete e.def.id,o[e.defId]=e.def)}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:Ei(t,`input`,e.processors),output:Ei(t,`output`,e.processors)}},enumerable:!1,writable:!1}),n}catch{throw Error(`Error converting schema to JSON.`)}}function A(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 A(r.element,n);if(r.type===`set`)return A(r.valueType,n);if(r.type===`lazy`)return A(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`)return A(r.innerType,n);if(r.type===`intersection`)return A(r.left,n)||A(r.right,n);if(r.type===`record`||r.type===`map`)return A(r.keyType,n)||A(r.valueType,n);if(r.type===`pipe`)return e._zod.traits.has(`$ZodCodec`)?!0:A(r.in,n)||A(r.out,n);if(r.type===`object`){for(let e in r.shape)if(A(r.shape[e],n))return!0;return!1}if(r.type===`union`){for(let e of r.options)if(A(e,n))return!0;return!1}if(r.type===`tuple`){for(let e of r.items)if(A(e,n))return!0;return!!(r.rest&&A(r.rest,n))}return!1}var Ti=(e,t={})=>n=>{let r=Si({...n,processors:t});return k(e,r),Ci(r,e),wi(r,e)},Ei=(e,t,n={})=>r=>{let{libraryOptions:i,target:a}=r??{},o=Si({...i??{},target:a,io:t,processors:n});return k(e,o),Ci(o,e),wi(o,e)},Di={guid:`uuid`,url:`uri`,datetime:`date-time`,json_string:`json-string`,regex:``},Oi=(e,t,n,r)=>{let i=n;i.type=`string`;let{minimum:a,maximum:o,format:s,patterns:c,contentEncoding:l}=e._zod.bag;if(typeof a==`number`&&(i.minLength=a),typeof o==`number`&&(i.maxLength=o),s&&(i.format=Di[s]??s,i.format===``&&delete i.format,s===`time`&&delete i.format),l&&(i.contentEncoding=l),c&&c.size>0){let e=[...c];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}))])}},ki=(e,t,n,r)=>{let i=n,{minimum:a,maximum:o,format:s,multipleOf:c,exclusiveMaximum:l,exclusiveMinimum:u}=e._zod.bag;i.type=typeof s==`string`&&s.includes(`int`)?`integer`:`number`;let d=typeof u==`number`&&u>=(a??-1/0),f=typeof l==`number`&&l<=(o??1/0),p=t.target===`draft-04`||t.target===`openapi-3.0`;d?p?(i.minimum=u,i.exclusiveMinimum=!0):i.exclusiveMinimum=u:typeof a==`number`&&(i.minimum=a),f?p?(i.maximum=l,i.exclusiveMaximum=!0):i.exclusiveMaximum=l:typeof o==`number`&&(i.maximum=o),typeof c==`number`&&(i.multipleOf=c)},Ai=(e,t,n,r)=>{n.type=`boolean`},ji=(e,t,n,r)=>{t.target===`openapi-3.0`?(n.type=`string`,n.nullable=!0,n.enum=[null]):n.type=`null`},Mi=(e,t,n,r)=>{if(t.unrepresentable===`throw`)throw Error(`Undefined cannot be represented in JSON Schema`)},Ni=(e,t,n,r)=>{n.not={}},Pi=(e,t,n,r)=>{let i=e._zod.def,a=S(i.entries);a.every(e=>typeof e==`number`)&&(n.type=`number`),a.every(e=>typeof e==`string`)&&(n.type=`string`),n.enum=a},Fi=(e,t,n,r)=>{let i=e._zod.def,a=[];for(let e of i.values)if(e===void 0){if(t.unrepresentable===`throw`)throw Error("Literal `undefined` cannot be represented in JSON Schema")}else if(typeof e==`bigint`){if(t.unrepresentable===`throw`)throw Error(`BigInt literals cannot be represented in JSON Schema`);a.push(Number(e))}else a.push(e);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}},Ii=(e,t,n,r)=>{if(t.unrepresentable===`throw`)throw Error(`Custom types cannot be represented in JSON Schema`)},Li=(e,t,n,r)=>{if(t.unrepresentable===`throw`)throw Error(`Transforms cannot be represented in JSON Schema`)},Ri=(e,t,n,r)=>{let i=n,a=e._zod.def,{minimum:o,maximum:s}=e._zod.bag;typeof o==`number`&&(i.minItems=o),typeof s==`number`&&(i.maxItems=s),i.type=`array`,i.items=k(a.element,t,{...r,path:[...r.path,`items`]})},zi=(e,t,n,r)=>{let i=n,a=e._zod.def;i.type=`object`,i.properties={};let o=a.shape;for(let e in o)i.properties[e]=k(o[e],t,{...r,path:[...r.path,`properties`,e]});let s=new Set(Object.keys(o)),c=new Set([...s].filter(e=>{let n=a.shape[e]._zod;return t.io===`input`?n.optin===void 0:n.optout===void 0}));c.size>0&&(i.required=Array.from(c)),a.catchall?._zod.def.type===`never`?i.additionalProperties=!1:a.catchall?a.catchall&&(i.additionalProperties=k(a.catchall,t,{...r,path:[...r.path,`additionalProperties`]})):t.io===`output`&&(i.additionalProperties=!1)},Bi=(e,t,n,r)=>{let i=e._zod.def,a=i.inclusive===!1,o=i.options.map((e,n)=>k(e,t,{...r,path:[...r.path,a?`oneOf`:`anyOf`,n]}));a?n.oneOf=o:n.anyOf=o},Vi=(e,t,n,r)=>{let i=e._zod.def,a=k(i.left,t,{...r,path:[...r.path,`allOf`,0]}),o=k(i.right,t,{...r,path:[...r.path,`allOf`,1]}),s=e=>`allOf`in e&&Object.keys(e).length===1;n.allOf=[...s(a)?a.allOf:[a],...s(o)?o.allOf:[o]]},Hi=(e,t,n,r)=>{let i=n,a=e._zod.def;i.type=`object`;let o=a.keyType,s=o._zod.bag?.patterns;if(a.mode===`loose`&&s&&s.size>0){let e=k(a.valueType,t,{...r,path:[...r.path,`patternProperties`,`*`]});i.patternProperties={};for(let t of s)i.patternProperties[t.source]=e}else(t.target===`draft-07`||t.target===`draft-2020-12`)&&(i.propertyNames=k(a.keyType,t,{...r,path:[...r.path,`propertyNames`]})),i.additionalProperties=k(a.valueType,t,{...r,path:[...r.path,`additionalProperties`]});let c=o._zod.values;if(c){let e=[...c].filter(e=>typeof e==`string`||typeof e==`number`);e.length>0&&(i.required=e)}},Ui=(e,t,n,r)=>{let i=e._zod.def,a=k(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`}]},Wi=(e,t,n,r)=>{let i=e._zod.def;k(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType},Gi=(e,t,n,r)=>{let i=e._zod.def;k(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType,n.default=JSON.parse(JSON.stringify(i.defaultValue))},Ki=(e,t,n,r)=>{let i=e._zod.def;k(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType,t.io===`input`&&(n._prefault=JSON.parse(JSON.stringify(i.defaultValue)))},qi=(e,t,n,r)=>{let i=e._zod.def;k(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType;let o;try{o=i.catchValue(void 0)}catch{throw Error(`Dynamic catch values are not supported in JSON Schema`)}n.default=o},Ji=(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;k(o,t,r);let s=t.seen.get(e);s.ref=o},Yi=(e,t,n,r)=>{let i=e._zod.def;k(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType,n.readOnly=!0},Xi=(e,t,n,r)=>{let i=e._zod.def;k(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType},Zi=_(`ZodISODateTime`,(e,t)=>{cn.init(e,t),N.init(e,t)});function Qi(e){return Rr(Zi,e)}var $i=_(`ZodISODate`,(e,t)=>{ln.init(e,t),N.init(e,t)});function ea(e){return zr($i,e)}var ta=_(`ZodISOTime`,(e,t)=>{un.init(e,t),N.init(e,t)});function na(e){return Br(ta,e)}var ra=_(`ZodISODuration`,(e,t)=>{dn.init(e,t),N.init(e,t)});function ia(e){return Vr(ra,e)}var aa=_(`ZodError`,(e,t)=>{Pe.init(e,t),e.name=`ZodError`,Object.defineProperties(e,{format:{value:t=>Le(e,t)},flatten:{value:t=>Ie(e,t)},addIssue:{value:t=>{e.issues.push(t),e.message=JSON.stringify(e.issues,C,2)}},addIssues:{value:t=>{e.issues.push(...t),e.message=JSON.stringify(e.issues,C,2)}},isEmpty:{get(){return e.issues.length===0}}})},{Parent:Error}),oa=Re(aa),sa=ze(aa),ca=Be(aa),la=He(aa),ua=We(aa),da=Ge(aa),fa=Ke(aa),pa=qe(aa),ma=Je(aa),ha=Ye(aa),ga=Xe(aa),_a=Ze(aa),va=new WeakMap;function ya(e,t,n){let r=Object.getPrototypeOf(e),i=va.get(r);if(i||(i=new Set,va.set(r,i)),!i.has(t)){i.add(t);for(let e in n){let t=n[e];Object.defineProperty(r,e,{configurable:!0,enumerable:!1,get(){let n=t.bind(this);return Object.defineProperty(this,e,{configurable:!0,writable:!0,enumerable:!0,value:n}),n},set(t){Object.defineProperty(this,e,{configurable:!0,writable:!0,enumerable:!0,value:t})}})}}}var j=_(`ZodType`,(e,t)=>(D.init(e,t),Object.assign(e[`~standard`],{jsonSchema:{input:Ei(e,`input`),output:Ei(e,`output`)}}),e.toJSONSchema=Ti(e,{}),e.def=t,e.type=t.type,Object.defineProperty(e,"_def",{value:t}),e.parse=(t,n)=>oa(e,t,n,{callee:e.parse}),e.safeParse=(t,n)=>ca(e,t,n),e.parseAsync=async(t,n)=>sa(e,t,n,{callee:e.parseAsync}),e.safeParseAsync=async(t,n)=>la(e,t,n),e.spa=e.safeParseAsync,e.encode=(t,n)=>ua(e,t,n),e.decode=(t,n)=>da(e,t,n),e.encodeAsync=async(t,n)=>fa(e,t,n),e.decodeAsync=async(t,n)=>pa(e,t,n),e.safeEncode=(t,n)=>ma(e,t,n),e.safeDecode=(t,n)=>ha(e,t,n),e.safeEncodeAsync=async(t,n)=>ga(e,t,n),e.safeDecodeAsync=async(t,n)=>_a(e,t,n),ya(e,`ZodType`,{check(...e){let t=this.def;return this.clone(oe(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 ge(this,e,t)},brand(){return this},register(e,t){return e.add(this,t),this},refine(e,t){return this.check(Fo(e,t))},superRefine(e,t){return this.check(Io(e,t))},overwrite(e){return this.check(di(e))},optional(){return U(this)},exactOptional(){return _o(this)},nullable(){return yo(this)},nullish(){return U(yo(this))},nonoptional(e){return To(this,e)},array(){return L(this)},or(e){return B([this,e])},and(e){return so(this,e)},transform(e){return ko(this,mo(e))},default(e){return xo(this,e)},prefault(e){return Co(this,e)},catch(e){return Do(this,e)},pipe(e){return ko(this,e)},readonly(){return Mo(this)},describe(e){let t=this.clone();return mr.add(t,{description:e}),t},meta(...e){if(e.length===0)return mr.get(this);let t=this.clone();return mr.add(t,e[0]),t},isOptional(){return this.safeParse(void 0).success},isNullable(){return this.safeParse(null).success},apply(e){return e(this)}}),Object.defineProperty(e,"description",{get(){return mr.get(e)?.description},configurable:!0}),e)),ba=_(`_ZodString`,(e,t)=>{Yt.init(e,t),j.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Oi(e,t,n,r);let n=e._zod.bag;e.format=n.format??null,e.minLength=n.minimum??null,e.maxLength=n.maximum??null,ya(e,`_ZodString`,{regex(...e){return this.check(ai(...e))},includes(...e){return this.check(ci(...e))},startsWith(...e){return this.check(li(...e))},endsWith(...e){return this.check(ui(...e))},min(...e){return this.check(ri(...e))},max(...e){return this.check(ni(...e))},length(...e){return this.check(ii(...e))},nonempty(...e){return this.check(ri(1,...e))},lowercase(e){return this.check(oi(e))},uppercase(e){return this.check(si(e))},trim(){return this.check(pi())},normalize(...e){return this.check(fi(...e))},toLowerCase(){return this.check(mi())},toUpperCase(){return this.check(hi())},slugify(){return this.check(gi())}})}),xa=_(`ZodString`,(e,t)=>{Yt.init(e,t),ba.init(e,t),e.email=t=>e.check(gr(Sa,t)),e.url=t=>e.check(Sr(Ta,t)),e.jwt=t=>e.check(Lr(Va,t)),e.emoji=t=>e.check(Cr(Da,t)),e.guid=t=>e.check(_r(Ca,t)),e.uuid=t=>e.check(vr(wa,t)),e.uuidv4=t=>e.check(yr(wa,t)),e.uuidv6=t=>e.check(br(wa,t)),e.uuidv7=t=>e.check(xr(wa,t)),e.nanoid=t=>e.check(wr(Oa,t)),e.guid=t=>e.check(_r(Ca,t)),e.cuid=t=>e.check(Tr(ka,t)),e.cuid2=t=>e.check(Er(Aa,t)),e.ulid=t=>e.check(Dr(ja,t)),e.base64=t=>e.check(Pr(Ra,t)),e.base64url=t=>e.check(Fr(za,t)),e.xid=t=>e.check(Or(Ma,t)),e.ksuid=t=>e.check(kr(Na,t)),e.ipv4=t=>e.check(Ar(Pa,t)),e.ipv6=t=>e.check(jr(Fa,t)),e.cidrv4=t=>e.check(Mr(Ia,t)),e.cidrv6=t=>e.check(Nr(La,t)),e.e164=t=>e.check(Ir(Ba,t)),e.datetime=t=>e.check(Qi(t)),e.date=t=>e.check(ea(t)),e.time=t=>e.check(na(t)),e.duration=t=>e.check(ia(t))});function M(e){return hr(xa,e)}var N=_(`ZodStringFormat`,(e,t)=>{O.init(e,t),ba.init(e,t)}),Sa=_(`ZodEmail`,(e,t)=>{Qt.init(e,t),N.init(e,t)}),Ca=_(`ZodGUID`,(e,t)=>{Xt.init(e,t),N.init(e,t)}),wa=_(`ZodUUID`,(e,t)=>{Zt.init(e,t),N.init(e,t)}),Ta=_(`ZodURL`,(e,t)=>{$t.init(e,t),N.init(e,t)});function Ea(e){return Sr(Ta,e)}var Da=_(`ZodEmoji`,(e,t)=>{en.init(e,t),N.init(e,t)}),Oa=_(`ZodNanoID`,(e,t)=>{tn.init(e,t),N.init(e,t)}),ka=_(`ZodCUID`,(e,t)=>{nn.init(e,t),N.init(e,t)}),Aa=_(`ZodCUID2`,(e,t)=>{rn.init(e,t),N.init(e,t)}),ja=_(`ZodULID`,(e,t)=>{an.init(e,t),N.init(e,t)}),Ma=_(`ZodXID`,(e,t)=>{on.init(e,t),N.init(e,t)}),Na=_(`ZodKSUID`,(e,t)=>{sn.init(e,t),N.init(e,t)}),Pa=_(`ZodIPv4`,(e,t)=>{fn.init(e,t),N.init(e,t)}),Fa=_(`ZodIPv6`,(e,t)=>{pn.init(e,t),N.init(e,t)}),Ia=_(`ZodCIDRv4`,(e,t)=>{mn.init(e,t),N.init(e,t)}),La=_(`ZodCIDRv6`,(e,t)=>{hn.init(e,t),N.init(e,t)}),Ra=_(`ZodBase64`,(e,t)=>{_n.init(e,t),N.init(e,t)}),za=_(`ZodBase64URL`,(e,t)=>{yn.init(e,t),N.init(e,t)}),Ba=_(`ZodE164`,(e,t)=>{bn.init(e,t),N.init(e,t)}),Va=_(`ZodJWT`,(e,t)=>{Sn.init(e,t),N.init(e,t)}),Ha=_(`ZodNumber`,(e,t)=>{Cn.init(e,t),j.init(e,t),e._zod.processJSONSchema=(t,n,r)=>ki(e,t,n,r),ya(e,`ZodNumber`,{gt(e,t){return this.check($r(e,t))},gte(e,t){return this.check(ei(e,t))},min(e,t){return this.check(ei(e,t))},lt(e,t){return this.check(Zr(e,t))},lte(e,t){return this.check(Qr(e,t))},max(e,t){return this.check(Qr(e,t))},int(e){return this.check(Wa(e))},safe(e){return this.check(Wa(e))},positive(e){return this.check($r(0,e))},nonnegative(e){return this.check(ei(0,e))},negative(e){return this.check(Zr(0,e))},nonpositive(e){return this.check(Qr(0,e))},multipleOf(e,t){return this.check(ti(e,t))},step(e,t){return this.check(ti(e,t))},finite(){return this}});let n=e._zod.bag;e.minValue=Math.max(n.minimum??-1/0,n.exclusiveMinimum??-1/0)??null,e.maxValue=Math.min(n.maximum??1/0,n.exclusiveMaximum??1/0)??null,e.isInt=(n.format??``).includes(`int`)||Number.isSafeInteger(n.multipleOf??.5),e.isFinite=!0,e.format=n.format??null});function P(e){return Hr(Ha,e)}var Ua=_(`ZodNumberFormat`,(e,t)=>{wn.init(e,t),Ha.init(e,t)});function Wa(e){return Wr(Ua,e)}var Ga=_(`ZodBoolean`,(e,t)=>{Tn.init(e,t),j.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Ai(e,t,n,r)});function F(e){return Gr(Ga,e)}var Ka=_(`ZodUndefined`,(e,t)=>{En.init(e,t),j.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Mi(e,t,n,r)});function qa(e){return Kr(Ka,e)}var Ja=_(`ZodNull`,(e,t)=>{Dn.init(e,t),j.init(e,t),e._zod.processJSONSchema=(t,n,r)=>ji(e,t,n,r)});function Ya(e){return qr(Ja,e)}var Xa=_(`ZodAny`,(e,t)=>{On.init(e,t),j.init(e,t),e._zod.processJSONSchema=(e,t,n)=>void 0});function Za(){return Jr(Xa)}var Qa=_(`ZodUnknown`,(e,t)=>{kn.init(e,t),j.init(e,t),e._zod.processJSONSchema=(e,t,n)=>void 0});function I(){return Yr(Qa)}var $a=_(`ZodNever`,(e,t)=>{An.init(e,t),j.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Ni(e,t,n,r)});function eo(e){return Xr($a,e)}var to=_(`ZodArray`,(e,t)=>{Mn.init(e,t),j.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Ri(e,t,n,r),e.element=t.element,ya(e,`ZodArray`,{min(e,t){return this.check(ri(e,t))},nonempty(e){return this.check(ri(1,e))},max(e,t){return this.check(ni(e,t))},length(e,t){return this.check(ii(e,t))},unwrap(){return this.element}})});function L(e,t){return _i(to,e,t)}var no=_(`ZodObject`,(e,t)=>{Ln.init(e,t),j.init(e,t),e._zod.processJSONSchema=(t,n,r)=>zi(e,t,n,r),w(e,`shape`,()=>t.shape),ya(e,`ZodObject`,{keyof(){return uo(Object.keys(this._zod.def.shape))},catchall(e){return this.clone({...this._zod.def,catchall:e})},passthrough(){return this.clone({...this._zod.def,catchall:I()})},loose(){return this.clone({...this._zod.def,catchall:I()})},strict(){return this.clone({...this._zod.def,catchall:eo()})},strip(){return this.clone({...this._zod.def,catchall:void 0})},extend(e){return xe(this,e)},safeExtend(e){return Se(this,e)},merge(e){return Ce(this,e)},pick(e){return ye(this,e)},omit(e){return be(this,e)},partial(...e){return we(ho,this,e[0])},required(...e){return Te(wo,this,e[0])}})});function R(e,t){return new no({type:`object`,shape:e??{},...T(t)})}function z(e,t){return new no({type:`object`,shape:e,catchall:I(),...T(t)})}var ro=_(`ZodUnion`,(e,t)=>{zn.init(e,t),j.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Bi(e,t,n,r),e.options=t.options});function B(e,t){return new ro({type:`union`,options:e,...T(t)})}var io=_(`ZodDiscriminatedUnion`,(e,t)=>{ro.init(e,t),Bn.init(e,t)});function ao(e,t,n){return new io({type:`union`,options:t,discriminator:e,...T(n)})}var oo=_(`ZodIntersection`,(e,t)=>{Vn.init(e,t),j.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Vi(e,t,n,r)});function so(e,t){return new oo({type:`intersection`,left:e,right:t})}var co=_(`ZodRecord`,(e,t)=>{Wn.init(e,t),j.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Hi(e,t,n,r),e.keyType=t.keyType,e.valueType=t.valueType});function V(e,t,n){return!t||!t._zod?new co({type:`record`,keyType:M(),valueType:e,...T(t)}):new co({type:`record`,keyType:e,valueType:t,...T(n)})}var lo=_(`ZodEnum`,(e,t)=>{Gn.init(e,t),j.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Pi(e,t,n,r),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 lo({...t,checks:[],...T(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 lo({...t,checks:[],...T(r),entries:i})}});function uo(e,t){return new lo({type:`enum`,entries:Array.isArray(e)?Object.fromEntries(e.map(e=>[e,e])):e,...T(t)})}var fo=_(`ZodLiteral`,(e,t)=>{Kn.init(e,t),j.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Fi(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 H(e,t){return new fo({type:`literal`,values:Array.isArray(e)?e:[e],...T(t)})}var po=_(`ZodTransform`,(e,t)=>{qn.init(e,t),j.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Li(e,t,n,r),e._zod.parse=(n,r)=>{if(r.direction===`backward`)throw new y(e.constructor.name);n.addIssue=r=>{if(typeof r==`string`)n.issues.push(Me(r,n.value,t));else{let t=r;t.fatal&&(t.continue=!1),t.code??=`custom`,t.input??=n.value,t.inst??=e,n.issues.push(Me(t))}};let i=t.transform(n.value,n);return i instanceof Promise?i.then(e=>(n.value=e,n.fallback=!0,n)):(n.value=i,n.fallback=!0,n)}});function mo(e){return new po({type:`transform`,transform:e})}var ho=_(`ZodOptional`,(e,t)=>{Yn.init(e,t),j.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Xi(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function U(e){return new ho({type:`optional`,innerType:e})}var go=_(`ZodExactOptional`,(e,t)=>{Xn.init(e,t),j.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Xi(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function _o(e){return new go({type:`optional`,innerType:e})}var vo=_(`ZodNullable`,(e,t)=>{Zn.init(e,t),j.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Ui(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function yo(e){return new vo({type:`nullable`,innerType:e})}var bo=_(`ZodDefault`,(e,t)=>{Qn.init(e,t),j.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Gi(e,t,n,r),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap});function xo(e,t){return new bo({type:`default`,innerType:e,get defaultValue(){return typeof t==`function`?t():pe(t)}})}var So=_(`ZodPrefault`,(e,t)=>{er.init(e,t),j.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Ki(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function Co(e,t){return new So({type:`prefault`,innerType:e,get defaultValue(){return typeof t==`function`?t():pe(t)}})}var wo=_(`ZodNonOptional`,(e,t)=>{tr.init(e,t),j.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Wi(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function To(e,t){return new wo({type:`nonoptional`,innerType:e,...T(t)})}var Eo=_(`ZodCatch`,(e,t)=>{rr.init(e,t),j.init(e,t),e._zod.processJSONSchema=(t,n,r)=>qi(e,t,n,r),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap});function Do(e,t){return new Eo({type:`catch`,innerType:e,catchValue:typeof t==`function`?t:()=>t})}var Oo=_(`ZodPipe`,(e,t)=>{ir.init(e,t),j.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Ji(e,t,n,r),e.in=t.in,e.out=t.out});function ko(e,t){return new Oo({type:`pipe`,in:e,out:t})}var Ao=_(`ZodPreprocess`,(e,t)=>{Oo.init(e,t),or.init(e,t)}),jo=_(`ZodReadonly`,(e,t)=>{sr.init(e,t),j.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Yi(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function Mo(e){return new jo({type:`readonly`,innerType:e})}var No=_(`ZodCustom`,(e,t)=>{lr.init(e,t),j.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Ii(e,t,n,r)});function Po(e,t){return vi(No,e??(()=>!0),t)}function Fo(e,t={}){return yi(No,e,t)}function Io(e,t){return bi(e,t)}function Lo(e,t){return new Ao({type:`pipe`,in:mo(e),out:t})}var Ro={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`},zo;zo||={};function Bo(e){return Ur(Ha,e)}var Vo=`2025-11-25`,Ho=[Vo,`2025-06-18`,`2025-03-26`,`2024-11-05`,`2024-10-07`],Uo=`io.modelcontextprotocol/related-task`,W=Po(e=>e!==null&&(typeof e==`object`||typeof e==`function`)),Wo=B([M(),P().int()]),Go=M();z({ttl:P().optional(),pollInterval:P().optional()});var Ko=R({ttl:P().optional()}),qo=R({taskId:M()}),Jo=z({progressToken:Wo.optional(),[Uo]:qo.optional()}),Yo=R({_meta:Jo.optional()}),Xo=Yo.extend({task:Ko.optional()}),Zo=e=>Xo.safeParse(e).success,G=R({method:M(),params:Yo.loose().optional()}),Qo=R({_meta:Jo.optional()}),$o=R({method:M(),params:Qo.loose().optional()}),K=z({_meta:Jo.optional()}),es=B([M(),P().int()]),ts=R({jsonrpc:H(`2.0`),id:es,...G.shape}).strict(),ns=e=>ts.safeParse(e).success,rs=R({jsonrpc:H(`2.0`),...$o.shape}).strict(),is=e=>rs.safeParse(e).success,as=R({jsonrpc:H(`2.0`),id:es,result:K}).strict(),os=e=>as.safeParse(e).success,q;(function(e){e[e.ConnectionClosed=-32e3]=`ConnectionClosed`,e[e.RequestTimeout=-32001]=`RequestTimeout`,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.UrlElicitationRequired=-32042]=`UrlElicitationRequired`})(q||={});var ss=R({jsonrpc:H(`2.0`),id:es.optional(),error:R({code:P().int(),message:M(),data:I().optional()})}).strict(),cs=e=>ss.safeParse(e).success,ls=B([ts,rs,as,ss]);B([as,ss]);var us=K.strict(),ds=Qo.extend({requestId:es.optional(),reason:M().optional()}),fs=$o.extend({method:H(`notifications/cancelled`),params:ds}),ps=R({icons:L(R({src:M(),mimeType:M().optional(),sizes:L(M()).optional(),theme:uo([`light`,`dark`]).optional()})).optional()}),ms=R({name:M(),title:M().optional()}),hs=ms.extend({...ms.shape,...ps.shape,version:M(),websiteUrl:M().optional(),description:M().optional()}),gs=Lo(e=>e&&typeof e==`object`&&!Array.isArray(e)&&Object.keys(e).length===0?{form:{}}:e,so(R({form:so(R({applyDefaults:F().optional()}),V(M(),I())).optional(),url:W.optional()}),V(M(),I()).optional())),_s=z({list:W.optional(),cancel:W.optional(),requests:z({sampling:z({createMessage:W.optional()}).optional(),elicitation:z({create:W.optional()}).optional()}).optional()}),vs=z({list:W.optional(),cancel:W.optional(),requests:z({tools:z({call:W.optional()}).optional()}).optional()}),ys=R({experimental:V(M(),W).optional(),sampling:R({context:W.optional(),tools:W.optional()}).optional(),elicitation:gs.optional(),roots:R({listChanged:F().optional()}).optional(),tasks:_s.optional(),extensions:V(M(),W).optional()}),bs=Yo.extend({protocolVersion:M(),capabilities:ys,clientInfo:hs}),xs=G.extend({method:H(`initialize`),params:bs}),Ss=R({experimental:V(M(),W).optional(),logging:W.optional(),completions:W.optional(),prompts:R({listChanged:F().optional()}).optional(),resources:R({subscribe:F().optional(),listChanged:F().optional()}).optional(),tools:R({listChanged:F().optional()}).optional(),tasks:vs.optional(),extensions:V(M(),W).optional()}),Cs=K.extend({protocolVersion:M(),capabilities:Ss,serverInfo:hs,instructions:M().optional()}),ws=$o.extend({method:H(`notifications/initialized`),params:Qo.optional()}),Ts=e=>ws.safeParse(e).success,Es=G.extend({method:H(`ping`),params:Yo.optional()}),Ds=R({progress:P(),total:U(P()),message:U(M())}),Os=R({...Qo.shape,...Ds.shape,progressToken:Wo}),ks=$o.extend({method:H(`notifications/progress`),params:Os}),As=Yo.extend({cursor:Go.optional()}),js=G.extend({params:As.optional()}),Ms=K.extend({nextCursor:Go.optional()}),Ns=uo([`working`,`input_required`,`completed`,`failed`,`cancelled`]),Ps=R({taskId:M(),status:Ns,ttl:B([P(),Ya()]),createdAt:M(),lastUpdatedAt:M(),pollInterval:U(P()),statusMessage:U(M())}),Fs=K.extend({task:Ps}),Is=Qo.merge(Ps),Ls=$o.extend({method:H(`notifications/tasks/status`),params:Is}),Rs=G.extend({method:H(`tasks/get`),params:Yo.extend({taskId:M()})}),zs=K.merge(Ps),Bs=G.extend({method:H(`tasks/result`),params:Yo.extend({taskId:M()})});K.loose();var Vs=js.extend({method:H(`tasks/list`)}),Hs=Ms.extend({tasks:L(Ps)}),Us=G.extend({method:H(`tasks/cancel`),params:Yo.extend({taskId:M()})}),Ws=K.merge(Ps),Gs=R({uri:M(),mimeType:U(M()),_meta:V(M(),I()).optional()}),Ks=Gs.extend({text:M()}),qs=M().refine(e=>{try{return atob(e),!0}catch{return!1}},{message:`Invalid Base64 string`}),Js=Gs.extend({blob:qs}),Ys=uo([`user`,`assistant`]),Xs=R({audience:L(Ys).optional(),priority:P().min(0).max(1).optional(),lastModified:Qi({offset:!0}).optional()}),Zs=R({...ms.shape,...ps.shape,uri:M(),description:U(M()),mimeType:U(M()),size:U(P()),annotations:Xs.optional(),_meta:U(z({}))}),Qs=R({...ms.shape,...ps.shape,uriTemplate:M(),description:U(M()),mimeType:U(M()),annotations:Xs.optional(),_meta:U(z({}))}),$s=js.extend({method:H(`resources/list`)}),ec=Ms.extend({resources:L(Zs)}),tc=js.extend({method:H(`resources/templates/list`)}),nc=Ms.extend({resourceTemplates:L(Qs)}),rc=Yo.extend({uri:M()}),ic=rc,ac=G.extend({method:H(`resources/read`),params:ic}),oc=K.extend({contents:L(B([Ks,Js]))}),sc=$o.extend({method:H(`notifications/resources/list_changed`),params:Qo.optional()}),cc=rc,lc=G.extend({method:H(`resources/subscribe`),params:cc}),uc=rc,dc=G.extend({method:H(`resources/unsubscribe`),params:uc}),fc=Qo.extend({uri:M()}),pc=$o.extend({method:H(`notifications/resources/updated`),params:fc}),mc=R({name:M(),description:U(M()),required:U(F())}),hc=R({...ms.shape,...ps.shape,description:U(M()),arguments:U(L(mc)),_meta:U(z({}))}),gc=js.extend({method:H(`prompts/list`)}),_c=Ms.extend({prompts:L(hc)}),vc=Yo.extend({name:M(),arguments:V(M(),M()).optional()}),yc=G.extend({method:H(`prompts/get`),params:vc}),bc=R({type:H(`text`),text:M(),annotations:Xs.optional(),_meta:V(M(),I()).optional()}),xc=R({type:H(`image`),data:qs,mimeType:M(),annotations:Xs.optional(),_meta:V(M(),I()).optional()}),Sc=R({type:H(`audio`),data:qs,mimeType:M(),annotations:Xs.optional(),_meta:V(M(),I()).optional()}),Cc=R({type:H(`tool_use`),name:M(),id:M(),input:V(M(),I()),_meta:V(M(),I()).optional()}),wc=R({type:H(`resource`),resource:B([Ks,Js]),annotations:Xs.optional(),_meta:V(M(),I()).optional()}),Tc=Zs.extend({type:H(`resource_link`)}),Ec=B([bc,xc,Sc,Tc,wc]),Dc=R({role:Ys,content:Ec}),Oc=K.extend({description:M().optional(),messages:L(Dc)}),kc=$o.extend({method:H(`notifications/prompts/list_changed`),params:Qo.optional()}),Ac=R({title:M().optional(),readOnlyHint:F().optional(),destructiveHint:F().optional(),idempotentHint:F().optional(),openWorldHint:F().optional()}),jc=R({taskSupport:uo([`required`,`optional`,`forbidden`]).optional()}),Mc=R({...ms.shape,...ps.shape,description:M().optional(),inputSchema:R({type:H(`object`),properties:V(M(),W).optional(),required:L(M()).optional()}).catchall(I()),outputSchema:R({type:H(`object`),properties:V(M(),W).optional(),required:L(M()).optional()}).catchall(I()).optional(),annotations:Ac.optional(),execution:jc.optional(),_meta:V(M(),I()).optional()}),Nc=js.extend({method:H(`tools/list`)}),Pc=Ms.extend({tools:L(Mc)}),Fc=K.extend({content:L(Ec).default([]),structuredContent:V(M(),I()).optional(),isError:F().optional()});Fc.or(K.extend({toolResult:I()}));var Ic=Xo.extend({name:M(),arguments:V(M(),I()).optional()}),Lc=G.extend({method:H(`tools/call`),params:Ic}),Rc=$o.extend({method:H(`notifications/tools/list_changed`),params:Qo.optional()}),zc=R({autoRefresh:F().default(!0),debounceMs:P().int().nonnegative().default(300)}),Bc=uo([`debug`,`info`,`notice`,`warning`,`error`,`critical`,`alert`,`emergency`]),Vc=Yo.extend({level:Bc}),Hc=G.extend({method:H(`logging/setLevel`),params:Vc}),Uc=Qo.extend({level:Bc,logger:M().optional(),data:I()}),Wc=$o.extend({method:H(`notifications/message`),params:Uc}),Gc=R({hints:L(R({name:M().optional()})).optional(),costPriority:P().min(0).max(1).optional(),speedPriority:P().min(0).max(1).optional(),intelligencePriority:P().min(0).max(1).optional()}),Kc=R({mode:uo([`auto`,`required`,`none`]).optional()}),qc=R({type:H(`tool_result`),toolUseId:M().describe(`The unique identifier for the corresponding tool call.`),content:L(Ec).default([]),structuredContent:R({}).loose().optional(),isError:F().optional(),_meta:V(M(),I()).optional()}),Jc=ao(`type`,[bc,xc,Sc]),Yc=ao(`type`,[bc,xc,Sc,Cc,qc]),Xc=R({role:Ys,content:B([Yc,L(Yc)]),_meta:V(M(),I()).optional()}),Zc=Xo.extend({messages:L(Xc),modelPreferences:Gc.optional(),systemPrompt:M().optional(),includeContext:uo([`none`,`thisServer`,`allServers`]).optional(),temperature:P().optional(),maxTokens:P().int(),stopSequences:L(M()).optional(),metadata:W.optional(),tools:L(Mc).optional(),toolChoice:Kc.optional()}),Qc=G.extend({method:H(`sampling/createMessage`),params:Zc}),$c=K.extend({model:M(),stopReason:U(uo([`endTurn`,`stopSequence`,`maxTokens`]).or(M())),role:Ys,content:Jc}),el=K.extend({model:M(),stopReason:U(uo([`endTurn`,`stopSequence`,`maxTokens`,`toolUse`]).or(M())),role:Ys,content:B([Yc,L(Yc)])}),tl=R({type:H(`boolean`),title:M().optional(),description:M().optional(),default:F().optional()}),nl=R({type:H(`string`),title:M().optional(),description:M().optional(),minLength:P().optional(),maxLength:P().optional(),format:uo([`email`,`uri`,`date`,`date-time`]).optional(),default:M().optional()}),rl=R({type:uo([`number`,`integer`]),title:M().optional(),description:M().optional(),minimum:P().optional(),maximum:P().optional(),default:P().optional()}),il=R({type:H(`string`),title:M().optional(),description:M().optional(),enum:L(M()),default:M().optional()}),al=R({type:H(`string`),title:M().optional(),description:M().optional(),oneOf:L(R({const:M(),title:M()})),default:M().optional()}),ol=B([B([R({type:H(`string`),title:M().optional(),description:M().optional(),enum:L(M()),enumNames:L(M()).optional(),default:M().optional()}),B([il,al]),B([R({type:H(`array`),title:M().optional(),description:M().optional(),minItems:P().optional(),maxItems:P().optional(),items:R({type:H(`string`),enum:L(M())}),default:L(M()).optional()}),R({type:H(`array`),title:M().optional(),description:M().optional(),minItems:P().optional(),maxItems:P().optional(),items:R({anyOf:L(R({const:M(),title:M()}))}),default:L(M()).optional()})])]),tl,nl,rl]),sl=B([Xo.extend({mode:H(`form`).optional(),message:M(),requestedSchema:R({type:H(`object`),properties:V(M(),ol),required:L(M()).optional()})}),Xo.extend({mode:H(`url`),message:M(),elicitationId:M(),url:M().url()})]),cl=G.extend({method:H(`elicitation/create`),params:sl}),ll=Qo.extend({elicitationId:M()}),ul=$o.extend({method:H(`notifications/elicitation/complete`),params:ll}),dl=K.extend({action:uo([`accept`,`decline`,`cancel`]),content:Lo(e=>e===null?void 0:e,V(M(),B([M(),P(),F(),L(M())])).optional())}),fl=R({type:H(`ref/resource`),uri:M()}),pl=R({type:H(`ref/prompt`),name:M()}),ml=Yo.extend({ref:B([pl,fl]),argument:R({name:M(),value:M()}),context:R({arguments:V(M(),M()).optional()}).optional()}),hl=G.extend({method:H(`completion/complete`),params:ml}),gl=K.extend({completion:z({values:L(M()).max(100),total:U(P().int()),hasMore:U(F())})}),_l=R({uri:M().startsWith(`file://`),name:M().optional(),_meta:V(M(),I()).optional()}),vl=G.extend({method:H(`roots/list`),params:Yo.optional()}),yl=K.extend({roots:L(_l)}),bl=$o.extend({method:H(`notifications/roots/list_changed`),params:Qo.optional()});B([Es,xs,hl,Hc,yc,gc,$s,tc,ac,lc,dc,Lc,Nc,Rs,Bs,Vs,Us]),B([fs,ks,ws,bl,Ls]),B([us,$c,el,dl,yl,zs,Hs,Fs]),B([Es,Qc,cl,vl,Rs,Bs,Vs,Us]),B([fs,ks,Wc,pc,sc,Rc,kc,Ls,ul]),B([us,Cs,gl,Oc,_c,ec,nc,oc,Fc,Pc,zs,Hs,Fs]);var J=class e extends Error{constructor(e,t,n){super(`MCP error ${e}: ${t}`),this.code=e,this.data=n,this.name=`McpError`}static fromError(t,n,r){if(t===q.UrlElicitationRequired&&r){let e=r;if(e.elicitations)return new xl(e.elicitations,n)}return new e(t,n,r)}},xl=class extends J{constructor(e,t=`URL elicitation${e.length>1?`s`:``} required`){super(q.UrlElicitationRequired,t,{elicitations:e})}get elicitations(){return this.data?.elicitations??[]}};function Sl(e){return!!e._zod}function Cl(e,t){return Sl(e)?Ve(e,t):e.safeParse(t)}function wl(e){if(!e)return;let t;if(t=Sl(e)?e._zod?.def?.shape:e.shape,t){if(typeof t==`function`)try{return t()}catch{return}return t}}function Tl(e){if(Sl(e)){let t=e._zod?.def;if(t){if(t.value!==void 0)return t.value;if(Array.isArray(t.values)&&t.values.length>0)return t.values[0]}}let t=e._def;if(t){if(t.value!==void 0)return t.value;if(Array.isArray(t.values)&&t.values.length>0)return t.values[0]}let n=e.value;if(n!==void 0)return n}function El(e){return e===`completed`||e===`failed`||e===`cancelled`}function Dl(e){let t=wl(e)?.method;if(!t)throw Error(`Schema is missing a method literal`);let n=Tl(t);if(typeof n!=`string`)throw Error(`Schema method literal must be a string`);return n}function Ol(e,t){let n=Cl(e,t);if(!n.success)throw n.error;return n.data}var kl=class{constructor(e){this._options=e,this._requestMessageId=0,this._requestHandlers=new Map,this._requestHandlerAbortControllers=new Map,this._notificationHandlers=new Map,this._responseHandlers=new Map,this._progressHandlers=new Map,this._timeoutInfo=new Map,this._pendingDebouncedNotifications=new Set,this._taskProgressTokens=new Map,this._requestResolvers=new Map,this.setNotificationHandler(fs,e=>{this._oncancel(e)}),this.setNotificationHandler(ks,e=>{this._onprogress(e)}),this.setRequestHandler(Es,e=>({})),this._taskStore=e?.taskStore,this._taskMessageQueue=e?.taskMessageQueue,this._taskStore&&(this.setRequestHandler(Rs,async(e,t)=>{let n=await this._taskStore.getTask(e.params.taskId,t.sessionId);if(!n)throw new J(q.InvalidParams,`Failed to retrieve task: Task not found`);return{...n}}),this.setRequestHandler(Bs,async(e,t)=>{let n=async()=>{let r=e.params.taskId;if(this._taskMessageQueue){let e;for(;e=await this._taskMessageQueue.dequeue(r,t.sessionId);){if(e.type===`response`||e.type===`error`){let t=e.message,n=t.id,r=this._requestResolvers.get(n);if(r){if(this._requestResolvers.delete(n),e.type===`response`)r(t);else{let e=t;r(new J(e.error.code,e.error.message,e.error.data))}}else{let t=e.type===`response`?`Response`:`Error`;this._onerror(Error(`${t} handler missing for request ${n}`))}continue}await this._transport?.send(e.message,{relatedRequestId:t.requestId})}}let i=await this._taskStore.getTask(r,t.sessionId);if(!i)throw new J(q.InvalidParams,`Task not found: ${r}`);if(!El(i.status))return await this._waitForTaskUpdate(r,t.signal),await n();if(El(i.status)){let e=await this._taskStore.getTaskResult(r,t.sessionId);return this._clearTaskQueue(r),{...e,_meta:{...e._meta,[Uo]:{taskId:r}}}}return await n()};return await n()}),this.setRequestHandler(Vs,async(e,t)=>{try{let{tasks:n,nextCursor:r}=await this._taskStore.listTasks(e.params?.cursor,t.sessionId);return{tasks:n,nextCursor:r,_meta:{}}}catch(e){throw new J(q.InvalidParams,`Failed to list tasks: ${e instanceof Error?e.message:String(e)}`)}}),this.setRequestHandler(Us,async(e,t)=>{try{let n=await this._taskStore.getTask(e.params.taskId,t.sessionId);if(!n)throw new J(q.InvalidParams,`Task not found: ${e.params.taskId}`);if(El(n.status))throw new J(q.InvalidParams,`Cannot cancel task in terminal status: ${n.status}`);await this._taskStore.updateTaskStatus(e.params.taskId,`cancelled`,`Client cancelled task execution.`,t.sessionId),this._clearTaskQueue(e.params.taskId);let r=await this._taskStore.getTask(e.params.taskId,t.sessionId);if(!r)throw new J(q.InvalidParams,`Task not found after cancellation: ${e.params.taskId}`);return{_meta:{},...r}}catch(e){throw e instanceof J?e:new J(q.InvalidRequest,`Failed to cancel task: ${e instanceof Error?e.message:String(e)}`)}}))}async _oncancel(e){e.params.requestId&&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),J.fromError(q.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){if(this._transport)throw Error(`Already connected to a transport. Call close() before connecting to a new transport, or use a separate Protocol instance per connection.`);this._transport=e;let t=this.transport?.onclose;this._transport.onclose=()=>{t?.(),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),os(e)||cs(e)?this._onresponse(e):ns(e)?this._onrequest(e,t):is(e)?this._onnotification(e):this._onerror(Error(`Unknown message type: ${JSON.stringify(e)}`))},await this._transport.start()}_onclose(){let e=this._responseHandlers;this._responseHandlers=new Map,this._progressHandlers.clear(),this._taskProgressTokens.clear(),this._pendingDebouncedNotifications.clear();for(let e of this._timeoutInfo.values())clearTimeout(e.timeoutId);this._timeoutInfo.clear();for(let e of this._requestHandlerAbortControllers.values())e.abort();this._requestHandlerAbortControllers.clear();let t=J.fromError(q.ConnectionClosed,`Connection closed`);this._transport=void 0,this.onclose?.();for(let n of e.values())n(t)}_onerror(e){this.onerror?.(e)}_onnotification(e){let t=this._notificationHandlers.get(e.method)??this.fallbackNotificationHandler;t!==void 0&&Promise.resolve().then(()=>t(e)).catch(e=>this._onerror(Error(`Uncaught error in notification handler: ${e}`)))}_onrequest(e,t){let n=this._requestHandlers.get(e.method)??this.fallbackRequestHandler,r=this._transport,i=e.params?._meta?.[Uo]?.taskId;if(n===void 0){let t={jsonrpc:`2.0`,id:e.id,error:{code:q.MethodNotFound,message:`Method not found`}};i&&this._taskMessageQueue?this._enqueueTaskMessage(i,{type:`error`,message:t,timestamp:Date.now()},r?.sessionId).catch(e=>this._onerror(Error(`Failed to enqueue error response: ${e}`))):r?.send(t).catch(e=>this._onerror(Error(`Failed to send an error response: ${e}`)));return}let a=new AbortController;this._requestHandlerAbortControllers.set(e.id,a);let o=Zo(e.params)?e.params.task:void 0,s=this._taskStore?this.requestTaskStore(e,r?.sessionId):void 0,c={signal:a.signal,sessionId:r?.sessionId,_meta:e.params?._meta,sendNotification:async t=>{if(a.signal.aborted)return;let n={relatedRequestId:e.id};i&&(n.relatedTask={taskId:i}),await this.notification(t,n)},sendRequest:async(t,n,r)=>{if(a.signal.aborted)throw new J(q.ConnectionClosed,`Request was cancelled`);let o={...r,relatedRequestId:e.id};i&&!o.relatedTask&&(o.relatedTask={taskId:i});let c=o.relatedTask?.taskId??i;return c&&s&&await s.updateTaskStatus(c,`input_required`),await this.request(t,n,o)},authInfo:t?.authInfo,requestId:e.id,requestInfo:t?.requestInfo,taskId:i,taskStore:s,taskRequestedTtl:o?.ttl,closeSSEStream:t?.closeSSEStream,closeStandaloneSSEStream:t?.closeStandaloneSSEStream};Promise.resolve().then(()=>{o&&this.assertTaskHandlerCapability(e.method)}).then(()=>n(e,c)).then(async t=>{if(a.signal.aborted)return;let n={result:t,jsonrpc:`2.0`,id:e.id};i&&this._taskMessageQueue?await this._enqueueTaskMessage(i,{type:`response`,message:n,timestamp:Date.now()},r?.sessionId):await r?.send(n)},async t=>{if(a.signal.aborted)return;let n={jsonrpc:`2.0`,id:e.id,error:{code:Number.isSafeInteger(t.code)?t.code:q.InternalError,message:t.message??`Internal error`,...t.data!==void 0&&{data:t.data}}};i&&this._taskMessageQueue?await this._enqueueTaskMessage(i,{type:`error`,message:n,timestamp:Date.now()},r?.sessionId):await r?.send(n)}).catch(e=>this._onerror(Error(`Failed to send response: ${e}`))).finally(()=>{this._requestHandlerAbortControllers.get(e.id)===a&&this._requestHandlerAbortControllers.delete(e.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._requestResolvers.get(t);if(n){this._requestResolvers.delete(t),os(e)?n(e):n(new J(e.error.code,e.error.message,e.error.data));return}let r=this._responseHandlers.get(t);if(r===void 0){this._onerror(Error(`Received a response for an unknown message ID: ${JSON.stringify(e)}`));return}this._responseHandlers.delete(t),this._cleanupTimeout(t);let i=!1;if(os(e)&&e.result&&typeof e.result==`object`){let n=e.result;if(n.task&&typeof n.task==`object`){let e=n.task;typeof e.taskId==`string`&&(i=!0,this._taskProgressTokens.set(e.taskId,t))}}i||this._progressHandlers.delete(t),os(e)?r(e):r(J.fromError(e.error.code,e.error.message,e.error.data))}get transport(){return this._transport}async close(){await this._transport?.close()}async*requestStream(e,t,n){let{task:r}=n??{};if(!r){try{yield{type:`result`,result:await this.request(e,t,n)}}catch(e){yield{type:`error`,error:e instanceof J?e:new J(q.InternalError,String(e))}}return}let i;try{let r=await this.request(e,Fs,n);if(r.task)i=r.task.taskId,yield{type:`taskCreated`,task:r.task};else throw new J(q.InternalError,`Task creation did not return a task`);for(;;){let e=await this.getTask({taskId:i},n);if(yield{type:`taskStatus`,task:e},El(e.status)){e.status===`completed`?yield{type:`result`,result:await this.getTaskResult({taskId:i},t,n)}:e.status===`failed`?yield{type:`error`,error:new J(q.InternalError,`Task ${i} failed`)}:e.status===`cancelled`&&(yield{type:`error`,error:new J(q.InternalError,`Task ${i} was cancelled`)});return}if(e.status===`input_required`){yield{type:`result`,result:await this.getTaskResult({taskId:i},t,n)};return}let r=e.pollInterval??this._options?.defaultTaskPollInterval??1e3;await new Promise(e=>setTimeout(e,r)),n?.signal?.throwIfAborted()}}catch(e){yield{type:`error`,error:e instanceof J?e:new J(q.InternalError,String(e))}}}request(e,t,n){let{relatedRequestId:r,resumptionToken:i,onresumptiontoken:a,task:o,relatedTask:s}=n??{};return new Promise((c,l)=>{let u=e=>{l(e)};if(!this._transport){u(Error(`Not connected`));return}if(this._options?.enforceStrictCapabilities===!0)try{this.assertCapabilityForMethod(e.method),o&&this.assertTaskCapability(e.method)}catch(e){u(e);return}n?.signal?.throwIfAborted();let d=this._requestMessageId++,f={...e,jsonrpc:`2.0`,id:d};n?.onprogress&&(this._progressHandlers.set(d,n.onprogress),f.params={...e.params,_meta:{...e.params?._meta||{},progressToken:d}}),o&&(f.params={...f.params,task:o}),s&&(f.params={...f.params,_meta:{...f.params?._meta||{},[Uo]:s}});let p=e=>{this._responseHandlers.delete(d),this._progressHandlers.delete(d),this._cleanupTimeout(d),this._transport?.send({jsonrpc:`2.0`,method:`notifications/cancelled`,params:{requestId:d,reason:String(e)}},{relatedRequestId:r,resumptionToken:i,onresumptiontoken:a}).catch(e=>this._onerror(Error(`Failed to send cancellation: ${e}`))),l(e instanceof J?e:new J(q.RequestTimeout,String(e)))};this._responseHandlers.set(d,e=>{if(!n?.signal?.aborted){if(e instanceof Error)return l(e);try{let n=Cl(t,e.result);n.success?c(n.data):l(n.error)}catch(e){l(e)}}}),n?.signal?.addEventListener(`abort`,()=>{p(n?.signal?.reason)});let m=n?.timeout??6e4;this._setupTimeout(d,m,n?.maxTotalTimeout,()=>p(J.fromError(q.RequestTimeout,`Request timed out`,{timeout:m})),n?.resetTimeoutOnProgress??!1);let h=s?.taskId;h?(this._requestResolvers.set(d,e=>{let t=this._responseHandlers.get(d);t?t(e):this._onerror(Error(`Response handler missing for side-channeled request ${d}`))}),this._enqueueTaskMessage(h,{type:`request`,message:f,timestamp:Date.now()}).catch(e=>{this._cleanupTimeout(d),l(e)})):this._transport.send(f,{relatedRequestId:r,resumptionToken:i,onresumptiontoken:a}).catch(e=>{this._cleanupTimeout(d),l(e)})})}async getTask(e,t){return this.request({method:`tasks/get`,params:e},zs,t)}async getTaskResult(e,t,n){return this.request({method:`tasks/result`,params:e},t,n)}async listTasks(e,t){return this.request({method:`tasks/list`,params:e},Hs,t)}async cancelTask(e,t){return this.request({method:`tasks/cancel`,params:e},Ws,t)}async notification(e,t){if(!this._transport)throw Error(`Not connected`);this.assertNotificationCapability(e.method);let n=t?.relatedTask?.taskId;if(n){let r={...e,jsonrpc:`2.0`,params:{...e.params,_meta:{...e.params?._meta||{},[Uo]:t.relatedTask}}};await this._enqueueTaskMessage(n,{type:`notification`,message:r,timestamp:Date.now()});return}if((this._options?.debouncedNotificationMethods??[]).includes(e.method)&&!e.params&&!t?.relatedRequestId&&!t?.relatedTask){if(this._pendingDebouncedNotifications.has(e.method))return;this._pendingDebouncedNotifications.add(e.method),Promise.resolve().then(()=>{if(this._pendingDebouncedNotifications.delete(e.method),!this._transport)return;let n={...e,jsonrpc:`2.0`};t?.relatedTask&&(n={...n,params:{...n.params,_meta:{...n.params?._meta||{},[Uo]:t.relatedTask}}}),this._transport?.send(n,t).catch(e=>this._onerror(e))});return}let r={...e,jsonrpc:`2.0`};t?.relatedTask&&(r={...r,params:{...r.params,_meta:{...r.params?._meta||{},[Uo]:t.relatedTask}}}),await this._transport.send(r,t)}setRequestHandler(e,t){let n=Dl(e);this.assertRequestHandlerCapability(n),this._requestHandlers.set(n,(n,r)=>{let i=Ol(e,n);return Promise.resolve(t(i,r))})}removeRequestHandler(e){this._requestHandlers.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){let n=Dl(e);this._notificationHandlers.set(n,n=>{let r=Ol(e,n);return Promise.resolve(t(r))})}removeNotificationHandler(e){this._notificationHandlers.delete(e)}_cleanupTaskProgressHandler(e){let t=this._taskProgressTokens.get(e);t!==void 0&&(this._progressHandlers.delete(t),this._taskProgressTokens.delete(e))}async _enqueueTaskMessage(e,t,n){if(!this._taskStore||!this._taskMessageQueue)throw Error(`Cannot enqueue task message: taskStore and taskMessageQueue are not configured`);let r=this._options?.maxTaskQueueSize;await this._taskMessageQueue.enqueue(e,t,n,r)}async _clearTaskQueue(e,t){if(this._taskMessageQueue){let n=await this._taskMessageQueue.dequeueAll(e,t);for(let t of n)if(t.type===`request`&&ns(t.message)){let n=t.message.id,r=this._requestResolvers.get(n);r?(r(new J(q.InternalError,`Task cancelled or completed`)),this._requestResolvers.delete(n)):this._onerror(Error(`Resolver missing for request ${n} during task ${e} cleanup`))}}}async _waitForTaskUpdate(e,t){let n=this._options?.defaultTaskPollInterval??1e3;try{let t=await this._taskStore?.getTask(e);t?.pollInterval&&(n=t.pollInterval)}catch{}return new Promise((e,r)=>{if(t.aborted){r(new J(q.InvalidRequest,`Request cancelled`));return}let i=setTimeout(e,n);t.addEventListener(`abort`,()=>{clearTimeout(i),r(new J(q.InvalidRequest,`Request cancelled`))},{once:!0})})}requestTaskStore(e,t){let n=this._taskStore;if(!n)throw Error(`No task store configured`);return{createTask:async r=>{if(!e)throw Error(`No request provided`);return await n.createTask(r,e.id,{method:e.method,params:e.params},t)},getTask:async e=>{let r=await n.getTask(e,t);if(!r)throw new J(q.InvalidParams,`Failed to retrieve task: Task not found`);return r},storeTaskResult:async(e,r,i)=>{await n.storeTaskResult(e,r,i,t);let a=await n.getTask(e,t);if(a){let t=Ls.parse({method:`notifications/tasks/status`,params:a});await this.notification(t),El(a.status)&&this._cleanupTaskProgressHandler(e)}},getTaskResult:e=>n.getTaskResult(e,t),updateTaskStatus:async(e,r,i)=>{let a=await n.getTask(e,t);if(!a)throw new J(q.InvalidParams,`Task "${e}" not found - it may have been cleaned up`);if(El(a.status))throw new J(q.InvalidParams,`Cannot update task "${e}" from terminal status "${a.status}" to "${r}". Terminal states (completed, failed, cancelled) cannot transition to other states.`);await n.updateTaskStatus(e,r,i,t);let o=await n.getTask(e,t);if(o){let t=Ls.parse({method:`notifications/tasks/status`,params:o});await this.notification(t),El(o.status)&&this._cleanupTaskProgressHandler(e)}},listTasks:e=>n.listTasks(e,t)}}};function Al(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function jl(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]=Al(a)&&Al(i)?{...a,...i}:i}return n}(e=>typeof a<`u`?a:typeof Proxy<`u`?new Proxy(e,{get:(e,t)=>(typeof a<`u`?a:e)[t]}):e)(function(e){if(typeof a<`u`)return a.apply(this,arguments);throw Error(`Dynamic require of "`+e+`" is not supported`)});var Ml=class extends kl{_registeredMethods=new Set;_eventSlots=new Map;onEventDispatch(e,t){}_ensureEventSlot(e){let t=this._eventSlots.get(e);if(!t){let n=this.eventSchemas[e];if(!n)throw Error(`Unknown event: ${String(e)}`);t={listeners:[]},this._eventSlots.set(e,t);let r=n.shape.method.value;this._registeredMethods.add(r);let i=t;super.setNotificationHandler(n,t=>{let n=t.params;this.onEventDispatch(e,n),i.onHandler?.(n);for(let e of[...i.listeners])e(n)})}return t}setEventHandler(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}getEventHandler(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)}setRequestHandler=(e,t)=>{this._assertMethodNotRegistered(e,`setRequestHandler`),super.setRequestHandler(e,t)};setNotificationHandler=(e,t)=>{this._assertMethodNotRegistered(e,`setNotificationHandler`),super.setNotificationHandler(e,t)};warnIfRequestHandlerReplaced(e,t,n){t&&n&&console.warn(`[MCP Apps] ${e} handler replaced. Previous handler will no longer be called.`)}replaceRequestHandler=(e,t)=>{let n=e.shape.method.value;this._registeredMethods.add(n),super.setRequestHandler(e,t)};_assertMethodNotRegistered(e,t){let n=e.shape.method.value;if(this._registeredMethods.has(n))throw Error(`Handler for "${n}" already registered (via ${t}). Use addEventListener() to attach multiple listeners, or the on* setter for replace semantics.`);this._registeredMethods.add(n)}},Nl=`2026-01-26`,Pl=B([H(`light`),H(`dark`)]).describe(`Color theme preference for the host environment.`),Fl=B([H(`inline`),H(`fullscreen`),H(`pip`)]).describe(`Display mode for UI presentation.`),Il=V(B([H(`--color-background-primary`),H(`--color-background-secondary`),H(`--color-background-tertiary`),H(`--color-background-inverse`),H(`--color-background-ghost`),H(`--color-background-info`),H(`--color-background-danger`),H(`--color-background-success`),H(`--color-background-warning`),H(`--color-background-disabled`),H(`--color-text-primary`),H(`--color-text-secondary`),H(`--color-text-tertiary`),H(`--color-text-inverse`),H(`--color-text-ghost`),H(`--color-text-info`),H(`--color-text-danger`),H(`--color-text-success`),H(`--color-text-warning`),H(`--color-text-disabled`),H(`--color-border-primary`),H(`--color-border-secondary`),H(`--color-border-tertiary`),H(`--color-border-inverse`),H(`--color-border-ghost`),H(`--color-border-info`),H(`--color-border-danger`),H(`--color-border-success`),H(`--color-border-warning`),H(`--color-border-disabled`),H(`--color-ring-primary`),H(`--color-ring-secondary`),H(`--color-ring-inverse`),H(`--color-ring-info`),H(`--color-ring-danger`),H(`--color-ring-success`),H(`--color-ring-warning`),H(`--font-sans`),H(`--font-mono`),H(`--font-weight-normal`),H(`--font-weight-medium`),H(`--font-weight-semibold`),H(`--font-weight-bold`),H(`--font-text-xs-size`),H(`--font-text-sm-size`),H(`--font-text-md-size`),H(`--font-text-lg-size`),H(`--font-heading-xs-size`),H(`--font-heading-sm-size`),H(`--font-heading-md-size`),H(`--font-heading-lg-size`),H(`--font-heading-xl-size`),H(`--font-heading-2xl-size`),H(`--font-heading-3xl-size`),H(`--font-text-xs-line-height`),H(`--font-text-sm-line-height`),H(`--font-text-md-line-height`),H(`--font-text-lg-line-height`),H(`--font-heading-xs-line-height`),H(`--font-heading-sm-line-height`),H(`--font-heading-md-line-height`),H(`--font-heading-lg-line-height`),H(`--font-heading-xl-line-height`),H(`--font-heading-2xl-line-height`),H(`--font-heading-3xl-line-height`),H(`--border-radius-xs`),H(`--border-radius-sm`),H(`--border-radius-md`),H(`--border-radius-lg`),H(`--border-radius-xl`),H(`--border-radius-full`),H(`--border-width-regular`),H(`--shadow-hairline`),H(`--shadow-sm`),H(`--shadow-md`),H(`--shadow-lg`)]).describe(`CSS variable keys available to MCP apps for theming.`).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.`),B([M(),qa()]).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.`),Ll=R({method:H(`ui/open-link`),params:R({url:M().describe(`URL to open in the host's browser`)})});R({isError:F().optional().describe(`True if the host failed to open the URL (e.g., due to security policy).`)}).passthrough(),R({isError:F().optional().describe(`True if the download failed (e.g., user cancelled or host denied).`)}).passthrough(),R({isError:F().optional().describe(`True if the host rejected or failed to deliver the message.`)}).passthrough();var Rl=R({method:H(`ui/notifications/sandbox-proxy-ready`),params:R({})}),zl=R({connectDomains:L(M()).optional().describe(`Origins for network requests (fetch/XHR/WebSocket). - -- Maps to CSP \`connect-src\` directive -- Empty or omitted → no network connections (secure default)`),resourceDomains:L(M()).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:L(M()).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:L(M()).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'`)")}),Bl=R({camera:R({}).optional().describe(`Request camera access. - -Maps to Permission Policy \`camera\` feature.`),microphone:R({}).optional().describe(`Request microphone access. - -Maps to Permission Policy \`microphone\` feature.`),geolocation:R({}).optional().describe(`Request geolocation access. - -Maps to Permission Policy \`geolocation\` feature.`),clipboardWrite:R({}).optional().describe(`Request clipboard write access. - -Maps to Permission Policy \`clipboard-write\` feature.`)}),Vl=R({method:H(`ui/notifications/size-changed`),params:R({width:P().optional().describe(`New width in pixels.`),height:P().optional().describe(`New height in pixels.`)})});R({method:H(`ui/notifications/tool-input`),params:R({arguments:V(M(),I().describe(`Complete tool call arguments as key-value pairs.`)).optional().describe(`Complete tool call arguments as key-value pairs.`)})}),R({method:H(`ui/notifications/tool-input-partial`),params:R({arguments:V(M(),I().describe(`Partial tool call arguments (incomplete, may change).`)).optional().describe(`Partial tool call arguments (incomplete, may change).`)})}),R({method:H(`ui/notifications/tool-cancelled`),params:R({reason:M().optional().describe(`Optional reason for the cancellation (e.g., "user action", "timeout").`)})});var Hl=R({fonts:M().optional()}),Ul=R({variables:Il.optional().describe(`CSS variables for theming the app.`),css:Hl.optional().describe(`CSS blocks that apps can inject.`)});R({method:H(`ui/resource-teardown`),params:R({})});var Wl=V(M(),I()),Gl=R({text:R({}).optional().describe(`Host supports text content blocks.`),image:R({}).optional().describe(`Host supports image content blocks.`),audio:R({}).optional().describe(`Host supports audio content blocks.`),resource:R({}).optional().describe(`Host supports resource content blocks.`),resourceLink:R({}).optional().describe(`Host supports resource link content blocks.`),structuredContent:R({}).optional().describe(`Host supports structured content.`)}),Kl=R({method:H(`ui/notifications/request-teardown`),params:R({}).optional()}),ql=R({experimental:V(M(),V(M(),Za()).describe(`Experimental features keyed by identifier.`)).optional().describe(`Experimental features keyed by identifier.`),openLinks:R({}).optional().describe(`Host supports opening external URLs.`),downloadFile:R({}).optional().describe(`Host supports file downloads via ui/download-file.`),serverTools:R({listChanged:F().optional().describe(`Host supports tools/list_changed notifications.`)}).optional().describe(`Host can proxy tool calls to the MCP server.`),serverResources:R({listChanged:F().optional().describe(`Host supports resources/list_changed notifications.`)}).optional().describe(`Host can proxy resource reads to the MCP server.`),logging:R({}).optional().describe(`Host accepts log messages.`),sandbox:R({permissions:Bl.optional().describe(`Permissions granted by the host (camera, microphone, geolocation).`),csp:zl.optional().describe(`CSP domains approved by the host.`)}).optional().describe(`Sandbox configuration applied by the host.`),updateModelContext:Gl.optional().describe(`Host accepts context updates (ui/update-model-context) to be included in the model's context for future turns.`),message:Gl.optional().describe(`Host supports receiving content messages (ui/message) from the view.`),sampling:R({tools:R({}).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.")}),Jl=R({experimental:V(M(),V(M(),Za()).describe(`Experimental features keyed by identifier.`)).optional().describe(`Experimental features keyed by identifier.`),tools:R({listChanged:F().optional().describe(`App supports tools/list_changed notifications.`)}).optional().describe(`App exposes MCP-style tools that the host can call.`),availableDisplayModes:L(Fl).optional().describe(`Display modes the app supports.`)}),Yl=R({method:H(`ui/notifications/initialized`),params:R({}).optional()});R({csp:zl.optional().describe(`Content Security Policy configuration for UI resources.`),permissions:Bl.optional().describe(`Sandbox permissions requested by the UI resource.`),domain:M().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:F().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 Xl=R({method:H(`ui/request-display-mode`),params:R({mode:Fl.describe(`The display mode being requested.`)})});R({mode:Fl.describe(`The display mode that was actually set. May differ from requested if not supported.`)}).passthrough();var Zl=B([H(`model`),H(`app`)]).describe(`Tool visibility scope - who can access the tool.`);R({resourceUri:M().optional(),visibility:L(Zl).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:eo().optional(),permissions:eo().optional()}),R({mimeTypes:L(M()).optional().describe('Array of supported MIME types for UI resources.\nMust include `"text/html;profile=mcp-app"` for MCP Apps support.')});var Ql=R({method:H(`ui/download-file`),params:R({contents:L(B([wc,Tc])).describe(`Resource contents to download — embedded (inline data) or linked (host fetches). Uses standard MCP resource types.`)})}),$l=R({method:H(`ui/message`),params:R({role:H(`user`).describe(`Message role, currently only "user" is supported.`),content:L(Ec).describe(`Message content blocks (text, image, etc.).`)})});R({method:H(`ui/notifications/sandbox-resource-ready`),params:R({html:M().describe(`HTML content to load into the inner iframe.`),sandbox:M().optional().describe(`Optional override for the inner iframe's sandbox attribute.`),csp:zl.optional().describe(`CSP configuration from resource metadata.`),permissions:Bl.optional().describe(`Sandbox permissions from resource metadata.`)})}),R({method:H(`ui/notifications/tool-result`),params:Fc.describe(`Standard MCP tool execution result.`)});var eu=R({toolInfo:R({id:es.optional().describe(`JSON-RPC id of the tools/call request.`),tool:Mc.describe(`Tool definition including name, inputSchema, etc.`)}).optional().describe(`Metadata of the tool call that instantiated this App.`),theme:Pl.optional().describe(`Current color theme preference.`),styles:Ul.optional().describe(`Style configuration for theming the app.`),displayMode:Fl.optional().describe(`How the UI is currently displayed.`),availableDisplayModes:L(Fl).optional().describe(`Display modes the host supports.`),containerDimensions:B([R({height:P().describe(`Fixed container height in pixels.`)}),R({maxHeight:B([P(),qa()]).optional().describe(`Maximum container height in pixels.`)})]).and(B([R({width:P().describe(`Fixed container width in pixels.`)}),R({maxWidth:B([P(),qa()]).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:M().optional().describe(`User's language and region preference in BCP 47 format.`),timeZone:M().optional().describe(`User's timezone in IANA format.`),userAgent:M().optional().describe(`Host application identifier.`),platform:B([H(`web`),H(`desktop`),H(`mobile`)]).optional().describe(`Platform type for responsive design decisions.`),deviceCapabilities:R({touch:F().optional().describe(`Whether the device supports touch input.`),hover:F().optional().describe(`Whether the device supports hover interactions.`)}).optional().describe(`Device input capabilities.`),safeAreaInsets:R({top:P().describe(`Top safe area inset in pixels.`),right:P().describe(`Right safe area inset in pixels.`),bottom:P().describe(`Bottom safe area inset in pixels.`),left:P().describe(`Left safe area inset in pixels.`)}).optional().describe(`Mobile safe area boundaries in pixels.`)}).passthrough();R({method:H(`ui/notifications/host-context-changed`),params:eu.describe(`Partial context update containing only changed fields.`)});var tu=R({method:H(`ui/update-model-context`),params:R({content:L(Ec).optional().describe(`Context content blocks (text, image, etc.).`),structuredContent:V(M(),I().describe(`Structured content for machine-readable context data.`)).optional().describe(`Structured content for machine-readable context data.`)})}),nu=R({method:H(`ui/initialize`),params:R({appInfo:hs.describe(`App identification (name and version).`),appCapabilities:Jl.describe(`Features and capabilities this app provides.`),protocolVersion:M().describe(`Protocol version this app supports.`)})});R({protocolVersion:M().describe(`Negotiated protocol version string (e.g., "2025-11-21").`),hostInfo:hs.describe(`Host application identification and version.`),hostCapabilities:ql.describe(`Features and capabilities provided by the host.`),hostContext:eu.describe(`Rich context about the host environment.`)}).passthrough();var ru=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=ls.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},iu=[Nl],au=class extends Ml{_client;_hostInfo;_capabilities;_appCapabilities;_hostContext={};_appInfo;_initializedReceived=!1;_baseReplaceRequestHandler=this.replaceRequestHandler;replaceRequestHandler=(e,t)=>{this._baseReplaceRequestHandler(e,(e,n)=>(this._initializedReceived||console.warn(`[ext-apps] AppBridge received '${e.method}' before ui/notifications/initialized. The View is calling host methods before completing the handshake; it should await app.connect() first.`),t(e,n)))};eventSchemas={sizechange:Vl,sandboxready:Rl,initialized:Yl,requestteardown:Kl,loggingmessage:Wc};constructor(e,t,n,r){super(r),this._client=e,this._hostInfo=t,this._capabilities=n,this.addEventListener(`initialized`,()=>{this._initializedReceived=!0}),this._hostContext=r?.hostContext||{},this.setRequestHandler(nu,e=>this._oninitialize(e)),this.setRequestHandler(Es,(e,t)=>(this.onping?.(e.params,t),{})),this.replaceRequestHandler(Xl,e=>({mode:this._hostContext.displayMode??`inline`}))}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($l,async(e,t)=>{if(!this._onmessage)throw Error(`No onmessage handler set`);return this._onmessage(e.params,t)})}_onopenlink;get onopenlink(){return this._onopenlink}set onopenlink(e){this.warnIfRequestHandlerReplaced(`onopenlink`,this._onopenlink,e),this._onopenlink=e,this.replaceRequestHandler(Ll,async(e,t)=>{if(!this._onopenlink)throw Error(`No onopenlink handler set`);return this._onopenlink(e.params,t)})}_ondownloadfile;get ondownloadfile(){return this._ondownloadfile}set ondownloadfile(e){this.warnIfRequestHandlerReplaced(`ondownloadfile`,this._ondownloadfile,e),this._ondownloadfile=e,this.replaceRequestHandler(Ql,async(e,t)=>{if(!this._ondownloadfile)throw Error(`No ondownloadfile handler set`);return this._ondownloadfile(e.params,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(Xl,async(e,t)=>{if(!this._onrequestdisplaymode)throw Error(`No onrequestdisplaymode handler set`);return this._onrequestdisplaymode(e.params,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(tu,async(e,t)=>{if(!this._onupdatemodelcontext)throw Error(`No onupdatemodelcontext handler set`);return this._onupdatemodelcontext(e.params,t)})}_oncalltool;get oncalltool(){return this._oncalltool}set oncalltool(e){this.warnIfRequestHandlerReplaced(`oncalltool`,this._oncalltool,e),this._oncalltool=e,this.replaceRequestHandler(Lc,async(e,t)=>{if(!this._oncalltool)throw Error(`No oncalltool handler set`);return this._oncalltool(e.params,t)})}set oncreatesamplingmessage(e){this.setRequestHandler(Qc,async(t,n)=>e(t.params,n))}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($s,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(tc,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(ac,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(gc,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})}assertCapabilityForMethod(e){}assertRequestHandlerCapability(e){}assertNotificationCapability(e){}assertTaskCapability(e){throw Error(`Tasks are not supported in MCP Apps`)}assertTaskHandlerCapability(e){throw Error(`Task handlers are not supported in MCP Apps`)}getCapabilities(){return this._capabilities}async _oninitialize(e){let t=e.params.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.params.appCapabilities,this._appInfo=e.params.appInfo,{protocolVersion:iu.includes(t)?t:Nl,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];ou(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},Wl,t)}sendResourceTeardown=this.teardownResource;callTool(e,t){return this.request({method:`tools/call`,params:e},Fc,t)}listTools(e,t){return this.request({method:`tools/list`,params:e},Pc,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},Fc,{signal:t.signal}),e.tools.listChanged&&this._client.setNotificationHandler(Rc,e=>this.sendToolListChanged(e.params))),e.resources&&(this.onlistresources=async(e,t)=>this._client.request({method:`resources/list`,params:e},ec,{signal:t.signal}),this.onlistresourcetemplates=async(e,t)=>this._client.request({method:`resources/templates/list`,params:e},nc,{signal:t.signal}),this.onreadresource=async(e,t)=>this._client.request({method:`resources/read`,params:e},oc,{signal:t.signal}),e.resources.listChanged&&this._client.setNotificationHandler(sc,e=>this.sendResourceListChanged(e.params))),e.prompts&&(this.onlistprompts=async(e,t)=>this._client.request({method:`prompts/list`,params:e},_c,{signal:t.signal}),e.prompts.listChanged&&this._client.setNotificationHandler(kc,e=>this.sendPromptListChanged(e.params)))}return super.connect(e)}};function ou(e,t){return JSON.stringify(e)===JSON.stringify(t)}var su=t((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.regexpCode=e.getEsmExportName=e.getProperty=e.safeStringify=e.stringify=e.strConcat=e.addCodeArg=e.str=e._=e.nil=e._Code=e.Name=e.IDENTIFIER=e._CodeOrName=void 0;var t=class{};e._CodeOrName=t,e.IDENTIFIER=/^[a-z$_][a-z$_0-9]*$/i;var n=class extends t{constructor(t){if(super(),!e.IDENTIFIER.test(t))throw Error(`CodeGen: name must be a valid identifier`);this.str=t}toString(){return this.str}emptyStr(){return!1}get names(){return{[this.str]:1}}};e.Name=n;var r=class extends t{constructor(e){super(),this._items=typeof e==`string`?[e]:e}toString(){return this.str}emptyStr(){if(this._items.length>1)return!1;let e=this._items[0];return e===``||e===`""`}get str(){return this._str??=this._items.reduce((e,t)=>`${e}${t}`,``)}get names(){return this._names??=this._items.reduce((e,t)=>(t instanceof n&&(e[t.str]=(e[t.str]||0)+1),e),{})}};e._Code=r,e.nil=new r(``);function i(e,...t){let n=[e[0]],i=0;for(;i{Object.defineProperty(e,"__esModule",{value:!0}),e.ValueScope=e.ValueScopeName=e.Scope=e.varKinds=e.UsedValueState=void 0;var t=su(),n=class extends Error{constructor(e){super(`CodeGen: "code" for ${e} not defined`),this.value=e.value}},r;(function(e){e[e.Started=0]=`Started`,e[e.Completed=1]=`Completed`})(r||(e.UsedValueState=r={})),e.varKinds={const:new t.Name(`const`),let:new t.Name(`let`),var:new t.Name(`var`)};var i=class{constructor({prefixes:e,parent:t}={}){this._names={},this._prefixes=e,this._parent=t}toName(e){return e instanceof t.Name?e:this.name(e)}name(e){return new t.Name(this._newName(e))}_newName(e){let t=this._names[e]||this._nameGroup(e);return`${e}${t.index++}`}_nameGroup(e){if((this._parent?._prefixes)?.has(e)||this._prefixes&&!this._prefixes.has(e))throw Error(`CodeGen: prefix "${e}" is not allowed in this scope`);return this._names[e]={prefix:e,index:0}}};e.Scope=i;var a=class extends t.Name{constructor(e,t){super(t),this.prefix=e}setValue(e,{property:n,itemIndex:r}){this.value=e,this.scopePath=(0,t._)`.${new t.Name(n)}[${r}]`}};e.ValueScopeName=a;var o=(0,t._)`\n`;e.ValueScope=class extends i{constructor(e){super(e),this._values={},this._scope=e.scope,this.opts={...e,_n:e.lines?o:t.nil}}get(){return this._scope}name(e){return new a(e,this._newName(e))}value(e,t){if(t.ref===void 0)throw Error(`CodeGen: ref must be passed in value`);let n=this.toName(e),{prefix:r}=n,i=t.key??t.ref,a=this._values[r];if(a){let e=a.get(i);if(e)return e}else a=this._values[r]=new Map;a.set(i,n);let o=this._scope[r]||(this._scope[r]=[]),s=o.length;return o[s]=t.ref,n.setValue(t,{property:r,itemIndex:s}),n}getValue(e,t){let n=this._values[e];if(n)return n.get(t)}scopeRefs(e,n=this._values){return this._reduceValues(n,n=>{if(n.scopePath===void 0)throw Error(`CodeGen: name "${n}" has no value`);return(0,t._)`${e}${n.scopePath}`})}scopeCode(e=this._values,t,n){return this._reduceValues(e,e=>{if(e.value===void 0)throw Error(`CodeGen: name "${e}" has no value`);return e.value.code},t,n)}_reduceValues(i,a,o={},s){let c=t.nil;for(let l in i){let u=i[l];if(!u)continue;let d=o[l]=o[l]||new Map;u.forEach(i=>{if(d.has(i))return;d.set(i,r.Started);let o=a(i);if(o){let n=this.opts.es5?e.varKinds.var:e.varKinds.const;c=(0,t._)`${c}${n} ${i} = ${o};${this.opts._n}`}else if(o=s?.(i))c=(0,t._)`${c}${o}${this.opts._n}`;else throw new n(i);d.set(i,r.Completed)})}return c}}})),Y=t((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.or=e.and=e.not=e.CodeGen=e.operators=e.varKinds=e.ValueScopeName=e.ValueScope=e.Scope=e.Name=e.regexpCode=e.stringify=e.getProperty=e.nil=e.strConcat=e.str=e._=void 0;var t=su(),n=cu(),r=su();Object.defineProperty(e,"_",{enumerable:!0,get:function(){return r._}}),Object.defineProperty(e,"str",{enumerable:!0,get:function(){return r.str}}),Object.defineProperty(e,"strConcat",{enumerable:!0,get:function(){return r.strConcat}}),Object.defineProperty(e,"nil",{enumerable:!0,get:function(){return r.nil}}),Object.defineProperty(e,"getProperty",{enumerable:!0,get:function(){return r.getProperty}}),Object.defineProperty(e,"stringify",{enumerable:!0,get:function(){return r.stringify}}),Object.defineProperty(e,"regexpCode",{enumerable:!0,get:function(){return r.regexpCode}}),Object.defineProperty(e,"Name",{enumerable:!0,get:function(){return r.Name}});var i=cu();Object.defineProperty(e,"Scope",{enumerable:!0,get:function(){return i.Scope}}),Object.defineProperty(e,"ValueScope",{enumerable:!0,get:function(){return i.ValueScope}}),Object.defineProperty(e,"ValueScopeName",{enumerable:!0,get:function(){return i.ValueScopeName}}),Object.defineProperty(e,"varKinds",{enumerable:!0,get:function(){return i.varKinds}}),e.operators={GT:new t._Code(`>`),GTE:new t._Code(`>=`),LT:new t._Code(`<`),LTE:new t._Code(`<=`),EQ:new t._Code(`===`),NEQ:new t._Code(`!==`),NOT:new t._Code(`!`),OR:new t._Code(`||`),AND:new t._Code(`&&`),ADD:new t._Code(`+`)};var a=class{optimizeNodes(){return this}optimizeNames(e,t){return this}},o=class extends a{constructor(e,t,n){super(),this.varKind=e,this.name=t,this.rhs=n}render({es5:e,_n:t}){let r=e?n.varKinds.var:this.varKind,i=this.rhs===void 0?``:` = ${this.rhs}`;return`${r} ${this.name}${i};`+t}optimizeNames(e,t){if(e[this.name.str])return this.rhs&&=w(this.rhs,e,t),this}get names(){return this.rhs instanceof t._CodeOrName?this.rhs.names:{}}},s=class extends a{constructor(e,t,n){super(),this.lhs=e,this.rhs=t,this.sideEffects=n}render({_n:e}){return`${this.lhs} = ${this.rhs};`+e}optimizeNames(e,n){if(!(this.lhs instanceof t.Name&&!e[this.lhs.str]&&!this.sideEffects))return this.rhs=w(this.rhs,e,n),this}get names(){return ie(this.lhs instanceof t.Name?{}:{...this.lhs.names},this.rhs)}},c=class extends s{constructor(e,t,n,r){super(e,n,r),this.op=t}render({_n:e}){return`${this.lhs} ${this.op}= ${this.rhs};`+e}},l=class extends a{constructor(e){super(),this.label=e,this.names={}}render({_n:e}){return`${this.label}:`+e}},u=class extends a{constructor(e){super(),this.label=e,this.names={}}render({_n:e}){return`break${this.label?` ${this.label}`:``};`+e}},d=class extends a{constructor(e){super(),this.error=e}render({_n:e}){return`throw ${this.error};`+e}get names(){return this.error.names}},f=class extends a{constructor(e){super(),this.code=e}render({_n:e}){return`${this.code};`+e}optimizeNodes(){return`${this.code}`?this:void 0}optimizeNames(e,t){return this.code=w(this.code,e,t),this}get names(){return this.code instanceof t._CodeOrName?this.code.names:{}}},p=class extends a{constructor(e=[]){super(),this.nodes=e}render(e){return this.nodes.reduce((t,n)=>t+n.render(e),``)}optimizeNodes(){let{nodes:e}=this,t=e.length;for(;t--;){let n=e[t].optimizeNodes();Array.isArray(n)?e.splice(t,1,...n):n?e[t]=n:e.splice(t,1)}return e.length>0?this:void 0}optimizeNames(e,t){let{nodes:n}=this,r=n.length;for(;r--;){let i=n[r];i.optimizeNames(e,t)||(ae(e,i.names),n.splice(r,1))}return n.length>0?this:void 0}get names(){return this.nodes.reduce((e,t)=>re(e,t.names),{})}},m=class extends p{render(e){return`{`+e._n+super.render(e)+`}`+e._n}},h=class extends p{},g=class extends m{};g.kind=`else`;var _=class e extends m{constructor(e,t){super(t),this.condition=e}render(e){let t=`if(${this.condition})`+super.render(e);return this.else&&(t+=`else `+this.else.render(e)),t}optimizeNodes(){super.optimizeNodes();let t=this.condition;if(t===!0)return this.nodes;let n=this.else;if(n){let e=n.optimizeNodes();n=this.else=Array.isArray(e)?new g(e):e}if(n)return t===!1?n instanceof e?n:n.nodes:this.nodes.length?this:new e(oe(t),n instanceof e?[n]:n.nodes);if(!(t===!1||!this.nodes.length))return this}optimizeNames(e,t){if(this.else=this.else?.optimizeNames(e,t),super.optimizeNames(e,t)||this.else)return this.condition=w(this.condition,e,t),this}get names(){let e=super.names;return ie(e,this.condition),this.else&&re(e,this.else.names),e}};_.kind=`if`;var v=class extends m{};v.kind=`for`;var y=class extends v{constructor(e){super(),this.iteration=e}render(e){return`for(${this.iteration})`+super.render(e)}optimizeNames(e,t){if(super.optimizeNames(e,t))return this.iteration=w(this.iteration,e,t),this}get names(){return re(super.names,this.iteration.names)}},b=class extends v{constructor(e,t,n,r){super(),this.varKind=e,this.name=t,this.from=n,this.to=r}render(e){let t=e.es5?n.varKinds.var:this.varKind,{name:r,from:i,to:a}=this;return`for(${t} ${r}=${i}; ${r}<${a}; ${r}++)`+super.render(e)}get names(){return ie(ie(super.names,this.from),this.to)}},x=class extends v{constructor(e,t,n,r){super(),this.loop=e,this.varKind=t,this.name=n,this.iterable=r}render(e){return`for(${this.varKind} ${this.name} ${this.loop} ${this.iterable})`+super.render(e)}optimizeNames(e,t){if(super.optimizeNames(e,t))return this.iterable=w(this.iterable,e,t),this}get names(){return re(super.names,this.iterable.names)}},S=class extends m{constructor(e,t,n){super(),this.name=e,this.args=t,this.async=n}render(e){return`${this.async?`async `:``}function ${this.name}(${this.args})`+super.render(e)}};S.kind=`func`;var C=class extends p{render(e){return`return `+super.render(e)}};C.kind=`return`;var ee=class extends m{render(e){let t=`try`+super.render(e);return this.catch&&(t+=this.catch.render(e)),this.finally&&(t+=this.finally.render(e)),t}optimizeNodes(){var e,t;return super.optimizeNodes(),(e=this.catch)==null||e.optimizeNodes(),(t=this.finally)==null||t.optimizeNodes(),this}optimizeNames(e,t){var n,r;return super.optimizeNames(e,t),(n=this.catch)==null||n.optimizeNames(e,t),(r=this.finally)==null||r.optimizeNames(e,t),this}get names(){let e=super.names;return this.catch&&re(e,this.catch.names),this.finally&&re(e,this.finally.names),e}},te=class extends m{constructor(e){super(),this.error=e}render(e){return`catch(${this.error})`+super.render(e)}};te.kind=`catch`;var ne=class extends m{render(e){return`finally`+super.render(e)}};ne.kind=`finally`,e.CodeGen=class{constructor(e,t={}){this._values={},this._blockStarts=[],this._constants={},this.opts={...t,_n:t.lines?` -`:``},this._extScope=e,this._scope=new n.Scope({parent:e}),this._nodes=[new h]}toString(){return this._root.render(this.opts)}name(e){return this._scope.name(e)}scopeName(e){return this._extScope.name(e)}scopeValue(e,t){let n=this._extScope.value(e,t);return(this._values[n.prefix]||(this._values[n.prefix]=new Set)).add(n),n}getScopeValue(e,t){return this._extScope.getValue(e,t)}scopeRefs(e){return this._extScope.scopeRefs(e,this._values)}scopeCode(){return this._extScope.scopeCode(this._values)}_def(e,t,n,r){let i=this._scope.toName(t);return n!==void 0&&r&&(this._constants[i.str]=n),this._leafNode(new o(e,i,n)),i}const(e,t,r){return this._def(n.varKinds.const,e,t,r)}let(e,t,r){return this._def(n.varKinds.let,e,t,r)}var(e,t,r){return this._def(n.varKinds.var,e,t,r)}assign(e,t,n){return this._leafNode(new s(e,t,n))}add(t,n){return this._leafNode(new c(t,e.operators.ADD,n))}code(e){return typeof e==`function`?e():e!==t.nil&&this._leafNode(new f(e)),this}object(...e){let n=[`{`];for(let[r,i]of e)n.length>1&&n.push(`,`),n.push(r),(r!==i||this.opts.es5)&&(n.push(`:`),(0,t.addCodeArg)(n,i));return n.push(`}`),new t._Code(n)}if(e,t,n){if(this._blockNode(new _(e)),t&&n)this.code(t).else().code(n).endIf();else if(t)this.code(t).endIf();else if(n)throw Error(`CodeGen: "else" body without "then" body`);return this}elseIf(e){return this._elseNode(new _(e))}else(){return this._elseNode(new g)}endIf(){return this._endBlockNode(_,g)}_for(e,t){return this._blockNode(e),t&&this.code(t).endFor(),this}for(e,t){return this._for(new y(e),t)}forRange(e,t,r,i,a=this.opts.es5?n.varKinds.var:n.varKinds.let){let o=this._scope.toName(e);return this._for(new b(a,o,t,r),()=>i(o))}forOf(e,r,i,a=n.varKinds.const){let o=this._scope.toName(e);if(this.opts.es5){let e=r instanceof t.Name?r:this.var(`_arr`,r);return this.forRange(`_i`,0,(0,t._)`${e}.length`,n=>{this.var(o,(0,t._)`${e}[${n}]`),i(o)})}return this._for(new x(`of`,a,o,r),()=>i(o))}forIn(e,r,i,a=this.opts.es5?n.varKinds.var:n.varKinds.const){if(this.opts.ownProperties)return this.forOf(e,(0,t._)`Object.keys(${r})`,i);let o=this._scope.toName(e);return this._for(new x(`in`,a,o,r),()=>i(o))}endFor(){return this._endBlockNode(v)}label(e){return this._leafNode(new l(e))}break(e){return this._leafNode(new u(e))}return(e){let t=new C;if(this._blockNode(t),this.code(e),t.nodes.length!==1)throw Error(`CodeGen: "return" should have one node`);return this._endBlockNode(C)}try(e,t,n){if(!t&&!n)throw Error(`CodeGen: "try" without "catch" and "finally"`);let r=new ee;if(this._blockNode(r),this.code(e),t){let e=this.name(`e`);this._currNode=r.catch=new te(e),t(e)}return n&&(this._currNode=r.finally=new ne,this.code(n)),this._endBlockNode(te,ne)}throw(e){return this._leafNode(new d(e))}block(e,t){return this._blockStarts.push(this._nodes.length),e&&this.code(e).endBlock(t),this}endBlock(e){let t=this._blockStarts.pop();if(t===void 0)throw Error(`CodeGen: not in self-balancing block`);let n=this._nodes.length-t;if(n<0||e!==void 0&&n!==e)throw Error(`CodeGen: wrong number of nodes: ${n} vs ${e} expected`);return this._nodes.length=t,this}func(e,n=t.nil,r,i){return this._blockNode(new S(e,n,r)),i&&this.code(i).endFunc(),this}endFunc(){return this._endBlockNode(S)}optimize(e=1){for(;e-->0;)this._root.optimizeNodes(),this._root.optimizeNames(this._root.names,this._constants)}_leafNode(e){return this._currNode.nodes.push(e),this}_blockNode(e){this._currNode.nodes.push(e),this._nodes.push(e)}_endBlockNode(e,t){let n=this._currNode;if(n instanceof e||t&&n instanceof t)return this._nodes.pop(),this;throw Error(`CodeGen: not in block "${t?`${e.kind}/${t.kind}`:e.kind}"`)}_elseNode(e){let t=this._currNode;if(!(t instanceof _))throw Error(`CodeGen: "else" without "if"`);return this._currNode=t.else=e,this}get _root(){return this._nodes[0]}get _currNode(){let e=this._nodes;return e[e.length-1]}set _currNode(e){let t=this._nodes;t[t.length-1]=e}};function re(e,t){for(let n in t)e[n]=(e[n]||0)+(t[n]||0);return e}function ie(e,n){return n instanceof t._CodeOrName?re(e,n.names):e}function w(e,n,r){if(e instanceof t.Name)return i(e);if(!a(e))return e;return new t._Code(e._items.reduce((e,n)=>(n instanceof t.Name&&(n=i(n)),n instanceof t._Code?e.push(...n._items):e.push(n),e),[]));function i(e){let t=r[e.str];return t===void 0||n[e.str]!==1?e:(delete n[e.str],t)}function a(e){return e instanceof t._Code&&e._items.some(e=>e instanceof t.Name&&n[e.str]===1&&r[e.str]!==void 0)}}function ae(e,t){for(let n in t)e[n]=(e[n]||0)-(t[n]||0)}function oe(e){return typeof e==`boolean`||typeof e==`number`||e===null?!e:(0,t._)`!${fe(e)}`}e.not=oe;var se=de(e.operators.AND);function ce(...e){return e.reduce(se)}e.and=ce;var le=de(e.operators.OR);function ue(...e){return e.reduce(le)}e.or=ue;function de(e){return(n,r)=>n===t.nil?r:r===t.nil?n:(0,t._)`${fe(n)} ${e} ${fe(r)}`}function fe(e){return e instanceof t.Name?e:(0,t._)`(${e})`}})),X=t((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.checkStrictMode=e.getErrorPath=e.Type=e.useFunc=e.setEvaluated=e.evaluatedPropsToName=e.mergeEvaluated=e.eachItem=e.unescapeJsonPointer=e.escapeJsonPointer=e.escapeFragment=e.unescapeFragment=e.schemaRefOrVal=e.schemaHasRulesButRef=e.schemaHasRules=e.checkUnknownRules=e.alwaysValidSchema=e.toHash=void 0;var t=Y(),n=su();function r(e){let t={};for(let n of e)t[n]=!0;return t}e.toHash=r;function i(e,t){return typeof t==`boolean`?t:Object.keys(t).length===0||(a(e,t),!o(t,e.self.RULES.all))}e.alwaysValidSchema=i;function a(e,t=e.schema){let{opts:n,self:r}=e;if(!n.strictSchema||typeof t==`boolean`)return;let i=r.RULES.keywords;for(let n in t)i[n]||x(e,`unknown keyword: "${n}"`)}e.checkUnknownRules=a;function o(e,t){if(typeof e==`boolean`)return!e;for(let n in e)if(t[n])return!0;return!1}e.schemaHasRules=o;function s(e,t){if(typeof e==`boolean`)return!e;for(let n in e)if(n!==`$ref`&&t.all[n])return!0;return!1}e.schemaHasRulesButRef=s;function c({topSchemaRef:e,schemaPath:n},r,i,a){if(!a){if(typeof r==`number`||typeof r==`boolean`)return r;if(typeof r==`string`)return(0,t._)`${r}`}return(0,t._)`${e}${n}${(0,t.getProperty)(i)}`}e.schemaRefOrVal=c;function l(e){return f(decodeURIComponent(e))}e.unescapeFragment=l;function u(e){return encodeURIComponent(d(e))}e.escapeFragment=u;function d(e){return typeof e==`number`?`${e}`:e.replace(/~/g,`~0`).replace(/\//g,`~1`)}e.escapeJsonPointer=d;function f(e){return e.replace(/~1/g,`/`).replace(/~0/g,`~`)}e.unescapeJsonPointer=f;function p(e,t){if(Array.isArray(e))for(let n of e)t(n);else t(e)}e.eachItem=p;function m({mergeNames:e,mergeToName:n,mergeValues:r,resultToName:i}){return(a,o,s,c)=>{let l=s===void 0?o:s instanceof t.Name?(o instanceof t.Name?e(a,o,s):n(a,o,s),s):o instanceof t.Name?(n(a,s,o),o):r(o,s);return c===t.Name&&!(l instanceof t.Name)?i(a,l):l}}e.mergeEvaluated={props:m({mergeNames:(e,n,r)=>e.if((0,t._)`${r} !== true && ${n} !== undefined`,()=>{e.if((0,t._)`${n} === true`,()=>e.assign(r,!0),()=>e.assign(r,(0,t._)`${r} || {}`).code((0,t._)`Object.assign(${r}, ${n})`))}),mergeToName:(e,n,r)=>e.if((0,t._)`${r} !== true`,()=>{n===!0?e.assign(r,!0):(e.assign(r,(0,t._)`${r} || {}`),g(e,r,n))}),mergeValues:(e,t)=>e===!0||{...e,...t},resultToName:h}),items:m({mergeNames:(e,n,r)=>e.if((0,t._)`${r} !== true && ${n} !== undefined`,()=>e.assign(r,(0,t._)`${n} === true ? true : ${r} > ${n} ? ${r} : ${n}`)),mergeToName:(e,n,r)=>e.if((0,t._)`${r} !== true`,()=>e.assign(r,n===!0||(0,t._)`${r} > ${n} ? ${r} : ${n}`)),mergeValues:(e,t)=>e===!0||Math.max(e,t),resultToName:(e,t)=>e.var(`items`,t)})};function h(e,n){if(n===!0)return e.var(`props`,!0);let r=e.var(`props`,(0,t._)`{}`);return n!==void 0&&g(e,r,n),r}e.evaluatedPropsToName=h;function g(e,n,r){Object.keys(r).forEach(r=>e.assign((0,t._)`${n}${(0,t.getProperty)(r)}`,!0))}e.setEvaluated=g;var _={};function v(e,t){return e.scopeValue(`func`,{ref:t,code:_[t.code]||(_[t.code]=new n._Code(t.code))})}e.useFunc=v;var y;(function(e){e[e.Num=0]=`Num`,e[e.Str=1]=`Str`})(y||(e.Type=y={}));function b(e,n,r){if(e instanceof t.Name){let i=n===y.Num;return r?i?(0,t._)`"[" + ${e} + "]"`:(0,t._)`"['" + ${e} + "']"`:i?(0,t._)`"/" + ${e}`:(0,t._)`"/" + ${e}.replace(/~/g, "~0").replace(/\\//g, "~1")`}return r?(0,t.getProperty)(e).toString():`/`+d(e)}e.getErrorPath=b;function x(e,t,n=e.opts.strictSchema){if(n){if(t=`strict mode: ${t}`,n===!0)throw Error(t);e.self.logger.warn(t)}}e.checkStrictMode=x})),lu=t((e=>{Object.defineProperty(e,"__esModule",{value:!0});var t=Y();e.default={data:new t.Name(`data`),valCxt:new t.Name(`valCxt`),instancePath:new t.Name(`instancePath`),parentData:new t.Name(`parentData`),parentDataProperty:new t.Name(`parentDataProperty`),rootData:new t.Name(`rootData`),dynamicAnchors:new t.Name(`dynamicAnchors`),vErrors:new t.Name(`vErrors`),errors:new t.Name(`errors`),this:new t.Name(`this`),self:new t.Name(`self`),scope:new t.Name(`scope`),json:new t.Name(`json`),jsonPos:new t.Name(`jsonPos`),jsonLen:new t.Name(`jsonLen`),jsonPart:new t.Name(`jsonPart`)}})),uu=t((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.extendErrors=e.resetErrorsCount=e.reportExtraError=e.reportError=e.keyword$DataError=e.keywordError=void 0;var t=Y(),n=X(),r=lu();e.keywordError={message:({keyword:e})=>(0,t.str)`must pass "${e}" keyword validation`},e.keyword$DataError={message:({keyword:e,schemaType:n})=>n?(0,t.str)`"${e}" keyword must be ${n} ($data)`:(0,t.str)`"${e}" keyword is invalid ($data)`};function i(n,r=e.keywordError,i,a){let{it:o}=n,{gen:s,compositeRule:u,allErrors:f}=o,p=d(n,r,i);a??(u||f)?c(s,p):l(o,(0,t._)`[${p}]`)}e.reportError=i;function a(t,n=e.keywordError,i){let{it:a}=t,{gen:o,compositeRule:s,allErrors:u}=a;c(o,d(t,n,i)),s||u||l(a,r.default.vErrors)}e.reportExtraError=a;function o(e,n){e.assign(r.default.errors,n),e.if((0,t._)`${r.default.vErrors} !== null`,()=>e.if(n,()=>e.assign((0,t._)`${r.default.vErrors}.length`,n),()=>e.assign(r.default.vErrors,null)))}e.resetErrorsCount=o;function s({gen:e,keyword:n,schemaValue:i,data:a,errsCount:o,it:s}){if(o===void 0)throw Error(`ajv implementation error`);let c=e.name(`err`);e.forRange(`i`,o,r.default.errors,o=>{e.const(c,(0,t._)`${r.default.vErrors}[${o}]`),e.if((0,t._)`${c}.instancePath === undefined`,()=>e.assign((0,t._)`${c}.instancePath`,(0,t.strConcat)(r.default.instancePath,s.errorPath))),e.assign((0,t._)`${c}.schemaPath`,(0,t.str)`${s.errSchemaPath}/${n}`),s.opts.verbose&&(e.assign((0,t._)`${c}.schema`,i),e.assign((0,t._)`${c}.data`,a))})}e.extendErrors=s;function c(e,n){let i=e.const(`err`,n);e.if((0,t._)`${r.default.vErrors} === null`,()=>e.assign(r.default.vErrors,(0,t._)`[${i}]`),(0,t._)`${r.default.vErrors}.push(${i})`),e.code((0,t._)`${r.default.errors}++`)}function l(e,n){let{gen:r,validateName:i,schemaEnv:a}=e;a.$async?r.throw((0,t._)`new ${e.ValidationError}(${n})`):(r.assign((0,t._)`${i}.errors`,n),r.return(!1))}var u={keyword:new t.Name(`keyword`),schemaPath:new t.Name(`schemaPath`),params:new t.Name(`params`),propertyName:new t.Name(`propertyName`),message:new t.Name(`message`),schema:new t.Name(`schema`),parentSchema:new t.Name(`parentSchema`)};function d(e,n,r){let{createErrors:i}=e.it;return i===!1?(0,t._)`{}`:f(e,n,r)}function f(e,t,n={}){let{gen:r,it:i}=e,a=[p(i,n),m(e,n)];return h(e,t,a),r.object(...a)}function p({errorPath:e},{instancePath:i}){let a=i?(0,t.str)`${e}${(0,n.getErrorPath)(i,n.Type.Str)}`:e;return[r.default.instancePath,(0,t.strConcat)(r.default.instancePath,a)]}function m({keyword:e,it:{errSchemaPath:r}},{schemaPath:i,parentSchema:a}){let o=a?r:(0,t.str)`${r}/${e}`;return i&&(o=(0,t.str)`${o}${(0,n.getErrorPath)(i,n.Type.Str)}`),[u.schemaPath,o]}function h(e,{params:n,message:i},a){let{keyword:o,data:s,schemaValue:c,it:l}=e,{opts:d,propertyName:f,topSchemaRef:p,schemaPath:m}=l;a.push([u.keyword,o],[u.params,typeof n==`function`?n(e):n||(0,t._)`{}`]),d.messages&&a.push([u.message,typeof i==`function`?i(e):i]),d.verbose&&a.push([u.schema,c],[u.parentSchema,(0,t._)`${p}${m}`],[r.default.data,s]),f&&a.push([u.propertyName,f])}})),du=t((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.boolOrEmptySchema=e.topBoolOrEmptySchema=void 0;var t=uu(),n=Y(),r=lu(),i={message:`boolean schema is false`};function a(e){let{gen:t,schema:i,validateName:a}=e;i===!1?s(e,!1):typeof i==`object`&&i.$async===!0?t.return(r.default.data):(t.assign((0,n._)`${a}.errors`,null),t.return(!0))}e.topBoolOrEmptySchema=a;function o(e,t){let{gen:n,schema:r}=e;r===!1?(n.var(t,!1),s(e)):n.var(t,!0)}e.boolOrEmptySchema=o;function s(e,n){let{gen:r,data:a}=e,o={gen:r,keyword:`false schema`,data:a,schema:!1,schemaCode:!1,schemaValue:!1,params:{},it:e};(0,t.reportError)(o,i,void 0,n)}})),fu=t((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.getRules=e.isJSONType=void 0;var t=new Set([`string`,`number`,`integer`,`boolean`,`null`,`object`,`array`]);function n(e){return typeof e==`string`&&t.has(e)}e.isJSONType=n;function r(){let e={number:{type:`number`,rules:[]},string:{type:`string`,rules:[]},array:{type:`array`,rules:[]},object:{type:`object`,rules:[]}};return{types:{...e,integer:!0,boolean:!0,null:!0},rules:[{rules:[]},e.number,e.string,e.array,e.object],post:{rules:[]},all:{},keywords:{}}}e.getRules=r})),pu=t((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.shouldUseRule=e.shouldUseGroup=e.schemaHasRulesForType=void 0;function t({schema:e,self:t},r){let i=t.RULES.types[r];return i&&i!==!0&&n(e,i)}e.schemaHasRulesForType=t;function n(e,t){return t.rules.some(t=>r(e,t))}e.shouldUseGroup=n;function r(e,t){return e[t.keyword]!==void 0||t.definition.implements?.some(t=>e[t]!==void 0)}e.shouldUseRule=r})),mu=t((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.reportTypeError=e.checkDataTypes=e.checkDataType=e.coerceAndCheckDataType=e.getJSONTypes=e.getSchemaTypes=e.DataType=void 0;var t=fu(),n=pu(),r=uu(),i=Y(),a=X(),o;(function(e){e[e.Correct=0]=`Correct`,e[e.Wrong=1]=`Wrong`})(o||(e.DataType=o={}));function s(e){let t=c(e.type);if(t.includes(`null`)){if(e.nullable===!1)throw Error(`type: null contradicts nullable: false`)}else{if(!t.length&&e.nullable!==void 0)throw Error(`"nullable" cannot be used without "type"`);e.nullable===!0&&t.push(`null`)}return t}e.getSchemaTypes=s;function c(e){let n=Array.isArray(e)?e:e?[e]:[];if(n.every(t.isJSONType))return n;throw Error(`type must be JSONType or JSONType[]: `+n.join(`,`))}e.getJSONTypes=c;function l(e,t){let{gen:r,data:i,opts:a}=e,s=d(t,a.coerceTypes),c=t.length>0&&!(s.length===0&&t.length===1&&(0,n.schemaHasRulesForType)(e,t[0]));if(c){let n=h(t,i,a.strictNumbers,o.Wrong);r.if(n,()=>{s.length?f(e,t,s):_(e)})}return c}e.coerceAndCheckDataType=l;var u=new Set([`string`,`number`,`integer`,`boolean`,`null`]);function d(e,t){return t?e.filter(e=>u.has(e)||t===`array`&&e===`array`):[]}function f(e,t,n){let{gen:r,data:a,opts:o}=e,s=r.let(`dataType`,(0,i._)`typeof ${a}`),c=r.let(`coerced`,(0,i._)`undefined`);o.coerceTypes===`array`&&r.if((0,i._)`${s} == 'object' && Array.isArray(${a}) && ${a}.length == 1`,()=>r.assign(a,(0,i._)`${a}[0]`).assign(s,(0,i._)`typeof ${a}`).if(h(t,a,o.strictNumbers),()=>r.assign(c,a))),r.if((0,i._)`${c} !== undefined`);for(let e of n)(u.has(e)||e===`array`&&o.coerceTypes===`array`)&&l(e);r.else(),_(e),r.endIf(),r.if((0,i._)`${c} !== undefined`,()=>{r.assign(a,c),p(e,c)});function l(e){switch(e){case`string`:r.elseIf((0,i._)`${s} == "number" || ${s} == "boolean"`).assign(c,(0,i._)`"" + ${a}`).elseIf((0,i._)`${a} === null`).assign(c,(0,i._)`""`);return;case`number`:r.elseIf((0,i._)`${s} == "boolean" || ${a} === null - || (${s} == "string" && ${a} && ${a} == +${a})`).assign(c,(0,i._)`+${a}`);return;case`integer`:r.elseIf((0,i._)`${s} === "boolean" || ${a} === null - || (${s} === "string" && ${a} && ${a} == +${a} && !(${a} % 1))`).assign(c,(0,i._)`+${a}`);return;case`boolean`:r.elseIf((0,i._)`${a} === "false" || ${a} === 0 || ${a} === null`).assign(c,!1).elseIf((0,i._)`${a} === "true" || ${a} === 1`).assign(c,!0);return;case`null`:r.elseIf((0,i._)`${a} === "" || ${a} === 0 || ${a} === false`),r.assign(c,null);return;case`array`:r.elseIf((0,i._)`${s} === "string" || ${s} === "number" - || ${s} === "boolean" || ${a} === null`).assign(c,(0,i._)`[${a}]`)}}}function p({gen:e,parentData:t,parentDataProperty:n},r){e.if((0,i._)`${t} !== undefined`,()=>e.assign((0,i._)`${t}[${n}]`,r))}function m(e,t,n,r=o.Correct){let a=r===o.Correct?i.operators.EQ:i.operators.NEQ,s;switch(e){case`null`:return(0,i._)`${t} ${a} null`;case`array`:s=(0,i._)`Array.isArray(${t})`;break;case`object`:s=(0,i._)`${t} && typeof ${t} == "object" && !Array.isArray(${t})`;break;case`integer`:s=c((0,i._)`!(${t} % 1) && !isNaN(${t})`);break;case`number`:s=c();break;default:return(0,i._)`typeof ${t} ${a} ${e}`}return r===o.Correct?s:(0,i.not)(s);function c(e=i.nil){return(0,i.and)((0,i._)`typeof ${t} == "number"`,e,n?(0,i._)`isFinite(${t})`:i.nil)}}e.checkDataType=m;function h(e,t,n,r){if(e.length===1)return m(e[0],t,n,r);let o,s=(0,a.toHash)(e);if(s.array&&s.object){let e=(0,i._)`typeof ${t} != "object"`;o=s.null?e:(0,i._)`!${t} || ${e}`,delete s.null,delete s.array,delete s.object}else o=i.nil;s.number&&delete s.integer;for(let e in s)o=(0,i.and)(o,m(e,t,n,r));return o}e.checkDataTypes=h;var g={message:({schema:e})=>`must be ${e}`,params:({schema:e,schemaValue:t})=>typeof e==`string`?(0,i._)`{type: ${e}}`:(0,i._)`{type: ${t}}`};function _(e){let t=v(e);(0,r.reportError)(t,g)}e.reportTypeError=_;function v(e){let{gen:t,data:n,schema:r}=e,i=(0,a.schemaRefOrVal)(e,r,`type`);return{gen:t,keyword:`type`,data:n,schema:r.type,schemaCode:i,schemaValue:i,parentSchema:r,params:{},it:e}}})),hu=t((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.assignDefaults=void 0;var t=Y(),n=X();function r(e,t){let{properties:n,items:r}=e.schema;if(t===`object`&&n)for(let t in n)i(e,t,n[t].default);else t===`array`&&Array.isArray(r)&&r.forEach((t,n)=>i(e,n,t.default))}e.assignDefaults=r;function i(e,r,i){let{gen:a,compositeRule:o,data:s,opts:c}=e;if(i===void 0)return;let l=(0,t._)`${s}${(0,t.getProperty)(r)}`;if(o){(0,n.checkStrictMode)(e,`default is ignored for: ${l}`);return}let u=(0,t._)`${l} === undefined`;c.useDefaults===`empty`&&(u=(0,t._)`${u} || ${l} === null || ${l} === ""`),a.if(u,(0,t._)`${l} = ${(0,t.stringify)(i)}`)}})),gu=t((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.validateUnion=e.validateArray=e.usePattern=e.callValidateCode=e.schemaProperties=e.allSchemaProperties=e.noPropertyInData=e.propertyInData=e.isOwnProperty=e.hasPropFunc=e.reportMissingProp=e.checkMissingProp=e.checkReportMissingProp=void 0;var t=Y(),n=X(),r=lu(),i=X();function a(e,n){let{gen:r,data:i,it:a}=e;r.if(d(r,i,n,a.opts.ownProperties),()=>{e.setParams({missingProperty:(0,t._)`${n}`},!0),e.error()})}e.checkReportMissingProp=a;function o({gen:e,data:n,it:{opts:r}},i,a){return(0,t.or)(...i.map(i=>(0,t.and)(d(e,n,i,r.ownProperties),(0,t._)`${a} = ${i}`)))}e.checkMissingProp=o;function s(e,t){e.setParams({missingProperty:t},!0),e.error()}e.reportMissingProp=s;function c(e){return e.scopeValue(`func`,{ref:Object.prototype.hasOwnProperty,code:(0,t._)`Object.prototype.hasOwnProperty`})}e.hasPropFunc=c;function l(e,n,r){return(0,t._)`${c(e)}.call(${n}, ${r})`}e.isOwnProperty=l;function u(e,n,r,i){let a=(0,t._)`${n}${(0,t.getProperty)(r)} !== undefined`;return i?(0,t._)`${a} && ${l(e,n,r)}`:a}e.propertyInData=u;function d(e,n,r,i){let a=(0,t._)`${n}${(0,t.getProperty)(r)} === undefined`;return i?(0,t.or)(a,(0,t.not)(l(e,n,r))):a}e.noPropertyInData=d;function f(e){return e?Object.keys(e).filter(e=>e!==`__proto__`):[]}e.allSchemaProperties=f;function p(e,t){return f(t).filter(r=>!(0,n.alwaysValidSchema)(e,t[r]))}e.schemaProperties=p;function m({schemaCode:e,data:n,it:{gen:i,topSchemaRef:a,schemaPath:o,errorPath:s},it:c},l,u,d){let f=d?(0,t._)`${e}, ${n}, ${a}${o}`:n,p=[[r.default.instancePath,(0,t.strConcat)(r.default.instancePath,s)],[r.default.parentData,c.parentData],[r.default.parentDataProperty,c.parentDataProperty],[r.default.rootData,r.default.rootData]];c.opts.dynamicRef&&p.push([r.default.dynamicAnchors,r.default.dynamicAnchors]);let m=(0,t._)`${f}, ${i.object(...p)}`;return u===t.nil?(0,t._)`${l}(${m})`:(0,t._)`${l}.call(${u}, ${m})`}e.callValidateCode=m;var h=(0,t._)`new RegExp`;function g({gen:e,it:{opts:n}},r){let a=n.unicodeRegExp?`u`:``,{regExp:o}=n.code,s=o(r,a);return e.scopeValue(`pattern`,{key:s.toString(),ref:s,code:(0,t._)`${o.code===`new RegExp`?h:(0,i.useFunc)(e,o)}(${r}, ${a})`})}e.usePattern=g;function _(e){let{gen:r,data:i,keyword:a,it:o}=e,s=r.name(`valid`);if(o.allErrors){let e=r.let(`valid`,!0);return c(()=>r.assign(e,!1)),e}return r.var(s,!0),c(()=>r.break()),s;function c(o){let c=r.const(`len`,(0,t._)`${i}.length`);r.forRange(`i`,0,c,i=>{e.subschema({keyword:a,dataProp:i,dataPropType:n.Type.Num},s),r.if((0,t.not)(s),o)})}}e.validateArray=_;function v(e){let{gen:r,schema:i,keyword:a,it:o}=e;if(!Array.isArray(i))throw Error(`ajv implementation error`);if(i.some(e=>(0,n.alwaysValidSchema)(o,e))&&!o.opts.unevaluated)return;let s=r.let(`valid`,!1),c=r.name(`_valid`);r.block(()=>i.forEach((n,i)=>{let o=e.subschema({keyword:a,schemaProp:i,compositeRule:!0},c);r.assign(s,(0,t._)`${s} || ${c}`),e.mergeValidEvaluated(o,c)||r.if((0,t.not)(s))})),e.result(s,()=>e.reset(),()=>e.error(!0))}e.validateUnion=v})),_u=t((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.validateKeywordUsage=e.validSchemaType=e.funcKeywordCode=e.macroKeywordCode=void 0;var t=Y(),n=lu(),r=gu(),i=uu();function a(e,n){let{gen:r,keyword:i,schema:a,parentSchema:o,it:s}=e,c=n.macro.call(s.self,a,o,s),l=u(r,i,c);s.opts.validateSchema!==!1&&s.self.validateSchema(c,!0);let d=r.name(`valid`);e.subschema({schema:c,schemaPath:t.nil,errSchemaPath:`${s.errSchemaPath}/${i}`,topSchemaRef:l,compositeRule:!0},d),e.pass(d,()=>e.error(!0))}e.macroKeywordCode=a;function o(e,i){let{gen:a,keyword:o,schema:d,parentSchema:f,$data:p,it:m}=e;l(m,i);let h=u(a,o,!p&&i.compile?i.compile.call(m.self,d,f,m):i.validate),g=a.let(`valid`);e.block$data(g,_),e.ok(i.valid??g);function _(){if(i.errors===!1)b(),i.modifying&&s(e),x(()=>e.error());else{let t=i.async?v():y();i.modifying&&s(e),x(()=>c(e,t))}}function v(){let e=a.let(`ruleErrs`,null);return a.try(()=>b((0,t._)`await `),n=>a.assign(g,!1).if((0,t._)`${n} instanceof ${m.ValidationError}`,()=>a.assign(e,(0,t._)`${n}.errors`),()=>a.throw(n))),e}function y(){let e=(0,t._)`${h}.errors`;return a.assign(e,null),b(t.nil),e}function b(o=i.async?(0,t._)`await `:t.nil){let s=m.opts.passContext?n.default.this:n.default.self,c=!(`compile`in i&&!p||i.schema===!1);a.assign(g,(0,t._)`${o}${(0,r.callValidateCode)(e,h,s,c)}`,i.modifying)}function x(e){a.if((0,t.not)(i.valid??g),e)}}e.funcKeywordCode=o;function s(e){let{gen:n,data:r,it:i}=e;n.if(i.parentData,()=>n.assign(r,(0,t._)`${i.parentData}[${i.parentDataProperty}]`))}function c(e,r){let{gen:a}=e;a.if((0,t._)`Array.isArray(${r})`,()=>{a.assign(n.default.vErrors,(0,t._)`${n.default.vErrors} === null ? ${r} : ${n.default.vErrors}.concat(${r})`).assign(n.default.errors,(0,t._)`${n.default.vErrors}.length`),(0,i.extendErrors)(e)},()=>e.error())}function l({schemaEnv:e},t){if(t.async&&!e.$async)throw Error(`async keyword in sync schema`)}function u(e,n,r){if(r===void 0)throw Error(`keyword "${n}" failed to compile`);return e.scopeValue(`keyword`,typeof r==`function`?{ref:r}:{ref:r,code:(0,t.stringify)(r)})}function d(e,t,n=!1){return!t.length||t.some(t=>t===`array`?Array.isArray(e):t===`object`?e&&typeof e==`object`&&!Array.isArray(e):typeof e==t||n&&e===void 0)}e.validSchemaType=d;function f({schema:e,opts:t,self:n,errSchemaPath:r},i,a){if(Array.isArray(i.keyword)?!i.keyword.includes(a):i.keyword!==a)throw Error(`ajv implementation error`);let o=i.dependencies;if(o?.some(t=>!Object.prototype.hasOwnProperty.call(e,t)))throw Error(`parent schema must have dependencies of ${a}: ${o.join(`,`)}`);if(i.validateSchema&&!i.validateSchema(e[a])){let e=`keyword "${a}" value is invalid at path "${r}": `+n.errorsText(i.validateSchema.errors);if(t.validateSchema===`log`)n.logger.error(e);else throw Error(e)}}e.validateKeywordUsage=f})),vu=t((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.extendSubschemaMode=e.extendSubschemaData=e.getSubschema=void 0;var t=Y(),n=X();function r(e,{keyword:r,schemaProp:i,schema:a,schemaPath:o,errSchemaPath:s,topSchemaRef:c}){if(r!==void 0&&a!==void 0)throw Error(`both "keyword" and "schema" passed, only one allowed`);if(r!==void 0){let a=e.schema[r];return i===void 0?{schema:a,schemaPath:(0,t._)`${e.schemaPath}${(0,t.getProperty)(r)}`,errSchemaPath:`${e.errSchemaPath}/${r}`}:{schema:a[i],schemaPath:(0,t._)`${e.schemaPath}${(0,t.getProperty)(r)}${(0,t.getProperty)(i)}`,errSchemaPath:`${e.errSchemaPath}/${r}/${(0,n.escapeFragment)(i)}`}}if(a!==void 0){if(o===void 0||s===void 0||c===void 0)throw Error(`"schemaPath", "errSchemaPath" and "topSchemaRef" are required with "schema"`);return{schema:a,schemaPath:o,topSchemaRef:c,errSchemaPath:s}}throw Error(`either "keyword" or "schema" must be passed`)}e.getSubschema=r;function i(e,r,{dataProp:i,dataPropType:a,data:o,dataTypes:s,propertyName:c}){if(o!==void 0&&i!==void 0)throw Error(`both "data" and "dataProp" passed, only one allowed`);let{gen:l}=r;if(i!==void 0){let{errorPath:o,dataPathArr:s,opts:c}=r;u(l.let(`data`,(0,t._)`${r.data}${(0,t.getProperty)(i)}`,!0)),e.errorPath=(0,t.str)`${o}${(0,n.getErrorPath)(i,a,c.jsPropertySyntax)}`,e.parentDataProperty=(0,t._)`${i}`,e.dataPathArr=[...s,e.parentDataProperty]}o!==void 0&&(u(o instanceof t.Name?o:l.let(`data`,o,!0)),c!==void 0&&(e.propertyName=c)),s&&(e.dataTypes=s);function u(t){e.data=t,e.dataLevel=r.dataLevel+1,e.dataTypes=[],r.definedProperties=new Set,e.parentData=r.data,e.dataNames=[...r.dataNames,t]}}e.extendSubschemaData=i;function a(e,{jtdDiscriminator:t,jtdMetadata:n,compositeRule:r,createErrors:i,allErrors:a}){r!==void 0&&(e.compositeRule=r),i!==void 0&&(e.createErrors=i),a!==void 0&&(e.allErrors=a),e.jtdDiscriminator=t,e.jtdMetadata=n}e.extendSubschemaMode=a})),yu=t(((e,t)=>{t.exports=function e(t,n){if(t===n)return!0;if(t&&n&&typeof t==`object`&&typeof n==`object`){if(t.constructor!==n.constructor)return!1;var r,i,a;if(Array.isArray(t)){if(r=t.length,r!=n.length)return!1;for(i=r;i--!==0;)if(!e(t[i],n[i]))return!1;return!0}if(t.constructor===RegExp)return t.source===n.source&&t.flags===n.flags;if(t.valueOf!==Object.prototype.valueOf)return t.valueOf()===n.valueOf();if(t.toString!==Object.prototype.toString)return t.toString()===n.toString();if(a=Object.keys(t),r=a.length,r!==Object.keys(n).length)return!1;for(i=r;i--!==0;)if(!Object.prototype.hasOwnProperty.call(n,a[i]))return!1;for(i=r;i--!==0;){var o=a[i];if(!e(t[o],n[o]))return!1}return!0}return t!==t&&n!==n}})),bu=t(((e,t)=>{var n=t.exports=function(e,t,n){typeof t==`function`&&(n=t,t={}),n=t.cb||n;var i=typeof n==`function`?n:n.pre||function(){},a=n.post||function(){};r(t,i,a,e,``,e)};n.keywords={additionalItems:!0,items:!0,contains:!0,additionalProperties:!0,propertyNames:!0,not:!0,if:!0,then:!0,else:!0},n.arrayKeywords={items:!0,allOf:!0,anyOf:!0,oneOf:!0},n.propsKeywords={$defs:!0,definitions:!0,properties:!0,patternProperties:!0,dependencies:!0},n.skipKeywords={default:!0,enum:!0,const:!0,required:!0,maximum:!0,minimum:!0,exclusiveMaximum:!0,exclusiveMinimum:!0,multipleOf:!0,maxLength:!0,minLength:!0,pattern:!0,format:!0,maxItems:!0,minItems:!0,uniqueItems:!0,maxProperties:!0,minProperties:!0};function r(e,t,a,o,s,c,l,u,d,f){if(o&&typeof o==`object`&&!Array.isArray(o)){for(var p in t(o,s,c,l,u,d,f),o){var m=o[p];if(Array.isArray(m)){if(p in n.arrayKeywords)for(var h=0;h{Object.defineProperty(e,"__esModule",{value:!0}),e.getSchemaRefs=e.resolveUrl=e.normalizeId=e._getFullPath=e.getFullPath=e.inlineRef=void 0;var t=X(),n=yu(),r=bu(),i=new Set([`type`,`format`,`pattern`,`maxLength`,`minLength`,`maxProperties`,`minProperties`,`maxItems`,`minItems`,`maximum`,`minimum`,`uniqueItems`,`multipleOf`,`required`,`enum`,`const`]);function a(e,t=!0){return typeof e==`boolean`?!0:t===!0?!s(e):t?c(e)<=t:!1}e.inlineRef=a;var o=new Set([`$ref`,`$recursiveRef`,`$recursiveAnchor`,`$dynamicRef`,`$dynamicAnchor`]);function s(e){for(let t in e){if(o.has(t))return!0;let n=e[t];if(Array.isArray(n)&&n.some(s)||typeof n==`object`&&s(n))return!0}return!1}function c(e){let n=0;for(let r in e)if(r===`$ref`||(n++,!i.has(r)&&(typeof e[r]==`object`&&(0,t.eachItem)(e[r],e=>n+=c(e)),n===1/0)))return 1/0;return n}function l(e,t=``,n){return n!==!1&&(t=f(t)),u(e,e.parse(t))}e.getFullPath=l;function u(e,t){return e.serialize(t).split(`#`)[0]+`#`}e._getFullPath=u;var d=/#\/?$/;function f(e){return e?e.replace(d,``):``}e.normalizeId=f;function p(e,t,n){return n=f(n),e.resolve(t,n)}e.resolveUrl=p;var m=/^[a-z_][-a-z0-9._]*$/i;function h(e,t){if(typeof e==`boolean`)return{};let{schemaId:i,uriResolver:a}=this.opts,o=f(e[i]||t),s={"":o},c=l(a,o,!1),u={},d=new Set;return r(e,{allKeys:!0},(e,t,n,r)=>{if(r===void 0)return;let a=c+t,o=s[r];typeof e[i]==`string`&&(o=l.call(this,e[i])),g.call(this,e.$anchor),g.call(this,e.$dynamicAnchor),s[t]=o;function l(t){let n=this.opts.uriResolver.resolve;if(t=f(o?n(o,t):t),d.has(t))throw h(t);d.add(t);let r=this.refs[t];return typeof r==`string`&&(r=this.refs[r]),typeof r==`object`?p(e,r.schema,t):t!==f(a)&&(t[0]===`#`?(p(e,u[t],t),u[t]=e):this.refs[t]=a),t}function g(e){if(typeof e==`string`){if(!m.test(e))throw Error(`invalid anchor "${e}"`);l.call(this,`#${e}`)}}}),u;function p(e,t,r){if(t!==void 0&&!n(e,t))throw h(r)}function h(e){return Error(`reference "${e}" resolves to more than one schema`)}}e.getSchemaRefs=h})),Su=t((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.getData=e.KeywordCxt=e.validateFunctionCode=void 0;var t=du(),n=mu(),r=pu(),i=mu(),a=hu(),o=_u(),s=vu(),c=Y(),l=lu(),u=xu(),d=X(),f=uu();function p(e){if(S(e)&&(ee(e),x(e))){_(e);return}m(e,()=>(0,t.topBoolOrEmptySchema)(e))}e.validateFunctionCode=p;function m({gen:e,validateName:t,schema:n,schemaEnv:r,opts:i},a){i.code.es5?e.func(t,(0,c._)`${l.default.data}, ${l.default.valCxt}`,r.$async,()=>{e.code((0,c._)`"use strict"; ${y(n,i)}`),g(e,i),e.code(a)}):e.func(t,(0,c._)`${l.default.data}, ${h(i)}`,r.$async,()=>e.code(y(n,i)).code(a))}function h(e){return(0,c._)`{${l.default.instancePath}="", ${l.default.parentData}, ${l.default.parentDataProperty}, ${l.default.rootData}=${l.default.data}${e.dynamicRef?(0,c._)`, ${l.default.dynamicAnchors}={}`:c.nil}}={}`}function g(e,t){e.if(l.default.valCxt,()=>{e.var(l.default.instancePath,(0,c._)`${l.default.valCxt}.${l.default.instancePath}`),e.var(l.default.parentData,(0,c._)`${l.default.valCxt}.${l.default.parentData}`),e.var(l.default.parentDataProperty,(0,c._)`${l.default.valCxt}.${l.default.parentDataProperty}`),e.var(l.default.rootData,(0,c._)`${l.default.valCxt}.${l.default.rootData}`),t.dynamicRef&&e.var(l.default.dynamicAnchors,(0,c._)`${l.default.valCxt}.${l.default.dynamicAnchors}`)},()=>{e.var(l.default.instancePath,(0,c._)`""`),e.var(l.default.parentData,(0,c._)`undefined`),e.var(l.default.parentDataProperty,(0,c._)`undefined`),e.var(l.default.rootData,l.default.data),t.dynamicRef&&e.var(l.default.dynamicAnchors,(0,c._)`{}`)})}function _(e){let{schema:t,opts:n,gen:r}=e;m(e,()=>{n.$comment&&t.$comment&&ae(e),re(e),r.let(l.default.vErrors,null),r.let(l.default.errors,0),n.unevaluated&&v(e),te(e),oe(e)})}function v(e){let{gen:t,validateName:n}=e;e.evaluated=t.const(`evaluated`,(0,c._)`${n}.evaluated`),t.if((0,c._)`${e.evaluated}.dynamicProps`,()=>t.assign((0,c._)`${e.evaluated}.props`,(0,c._)`undefined`)),t.if((0,c._)`${e.evaluated}.dynamicItems`,()=>t.assign((0,c._)`${e.evaluated}.items`,(0,c._)`undefined`))}function y(e,t){let n=typeof e==`object`&&e[t.schemaId];return n&&(t.code.source||t.code.process)?(0,c._)`/*# sourceURL=${n} */`:c.nil}function b(e,n){if(S(e)&&(ee(e),x(e))){C(e,n);return}(0,t.boolOrEmptySchema)(e,n)}function x({schema:e,self:t}){if(typeof e==`boolean`)return!e;for(let n in e)if(t.RULES.all[n])return!0;return!1}function S(e){return typeof e.schema!=`boolean`}function C(e,t){let{schema:n,gen:r,opts:i}=e;i.$comment&&n.$comment&&ae(e),ie(e),w(e);let a=r.const(`_errs`,l.default.errors);te(e,a),r.var(t,(0,c._)`${a} === ${l.default.errors}`)}function ee(e){(0,d.checkUnknownRules)(e),ne(e)}function te(e,t){if(e.opts.jtd)return ce(e,[],!1,t);let r=(0,n.getSchemaTypes)(e.schema);ce(e,r,!(0,n.coerceAndCheckDataType)(e,r),t)}function ne(e){let{schema:t,errSchemaPath:n,opts:r,self:i}=e;t.$ref&&r.ignoreKeywordsWithRef&&(0,d.schemaHasRulesButRef)(t,i.RULES)&&i.logger.warn(`$ref: keywords ignored in schema at path "${n}"`)}function re(e){let{schema:t,opts:n}=e;t.default!==void 0&&n.useDefaults&&n.strictSchema&&(0,d.checkStrictMode)(e,`default is ignored in the schema root`)}function ie(e){let t=e.schema[e.opts.schemaId];t&&(e.baseId=(0,u.resolveUrl)(e.opts.uriResolver,e.baseId,t))}function w(e){if(e.schema.$async&&!e.schemaEnv.$async)throw Error(`async schema in sync schema`)}function ae({gen:e,schemaEnv:t,schema:n,errSchemaPath:r,opts:i}){let a=n.$comment;if(i.$comment===!0)e.code((0,c._)`${l.default.self}.logger.log(${a})`);else if(typeof i.$comment==`function`){let n=(0,c.str)`${r}/$comment`,i=e.scopeValue(`root`,{ref:t.root});e.code((0,c._)`${l.default.self}.opts.$comment(${a}, ${n}, ${i}.schema)`)}}function oe(e){let{gen:t,schemaEnv:n,validateName:r,ValidationError:i,opts:a}=e;n.$async?t.if((0,c._)`${l.default.errors} === 0`,()=>t.return(l.default.data),()=>t.throw((0,c._)`new ${i}(${l.default.vErrors})`)):(t.assign((0,c._)`${r}.errors`,l.default.vErrors),a.unevaluated&&se(e),t.return((0,c._)`${l.default.errors} === 0`))}function se({gen:e,evaluated:t,props:n,items:r}){n instanceof c.Name&&e.assign((0,c._)`${t}.props`,n),r instanceof c.Name&&e.assign((0,c._)`${t}.items`,r)}function ce(e,t,n,a){let{gen:o,schema:s,data:u,allErrors:f,opts:p,self:m}=e,{RULES:h}=m;if(s.$ref&&(p.ignoreKeywordsWithRef||!(0,d.schemaHasRulesButRef)(s,h))){o.block(()=>ve(e,`$ref`,h.all.$ref.definition));return}p.jtd||ue(e,t),o.block(()=>{for(let e of h.rules)g(e);g(h.post)});function g(d){(0,r.shouldUseGroup)(s,d)&&(d.type?(o.if((0,i.checkDataType)(d.type,u,p.strictNumbers)),le(e,d),t.length===1&&t[0]===d.type&&n&&(o.else(),(0,i.reportTypeError)(e)),o.endIf()):le(e,d),f||o.if((0,c._)`${l.default.errors} === ${a||0}`))}}function le(e,t){let{gen:n,schema:i,opts:{useDefaults:o}}=e;o&&(0,a.assignDefaults)(e,t.type),n.block(()=>{for(let n of t.rules)(0,r.shouldUseRule)(i,n)&&ve(e,n.keyword,n.definition,t.type)})}function ue(e,t){e.schemaEnv.meta||!e.opts.strictTypes||(de(e,t),e.opts.allowUnionTypes||fe(e,t),pe(e,e.dataTypes))}function de(e,t){if(t.length){if(!e.dataTypes.length){e.dataTypes=t;return}t.forEach(t=>{he(e.dataTypes,t)||T(e,`type "${t}" not allowed by context "${e.dataTypes.join(`,`)}"`)}),ge(e,t)}}function fe(e,t){t.length>1&&!(t.length===2&&t.includes(`null`))&&T(e,`use allowUnionTypes to allow union type keyword`)}function pe(e,t){let n=e.self.RULES.all;for(let i in n){let a=n[i];if(typeof a==`object`&&(0,r.shouldUseRule)(e.schema,a)){let{type:n}=a.definition;n.length&&!n.some(e=>me(t,e))&&T(e,`missing type "${n.join(`,`)}" for keyword "${i}"`)}}}function me(e,t){return e.includes(t)||t===`number`&&e.includes(`integer`)}function he(e,t){return e.includes(t)||t===`integer`&&e.includes(`number`)}function ge(e,t){let n=[];for(let r of e.dataTypes)he(t,r)?n.push(r):t.includes(`integer`)&&r===`number`&&n.push(`integer`);e.dataTypes=n}function T(e,t){let n=e.schemaEnv.baseId+e.errSchemaPath;t+=` at "${n}" (strictTypes)`,(0,d.checkStrictMode)(e,t,e.opts.strictTypes)}var _e=class{constructor(e,t,n){if((0,o.validateKeywordUsage)(e,t,n),this.gen=e.gen,this.allErrors=e.allErrors,this.keyword=n,this.data=e.data,this.schema=e.schema[n],this.$data=t.$data&&e.opts.$data&&this.schema&&this.schema.$data,this.schemaValue=(0,d.schemaRefOrVal)(e,this.schema,n,this.$data),this.schemaType=t.schemaType,this.parentSchema=e.schema,this.params={},this.it=e,this.def=t,this.$data)this.schemaCode=e.gen.const(`vSchema`,xe(this.$data,e));else if(this.schemaCode=this.schemaValue,!(0,o.validSchemaType)(this.schema,t.schemaType,t.allowUndefined))throw Error(`${n} value must be ${JSON.stringify(t.schemaType)}`);(`code`in t?t.trackErrors:t.errors!==!1)&&(this.errsCount=e.gen.const(`_errs`,l.default.errors))}result(e,t,n){this.failResult((0,c.not)(e),t,n)}failResult(e,t,n){this.gen.if(e),n?n():this.error(),t?(this.gen.else(),t(),this.allErrors&&this.gen.endIf()):this.allErrors?this.gen.endIf():this.gen.else()}pass(e,t){this.failResult((0,c.not)(e),void 0,t)}fail(e){if(e===void 0){this.error(),this.allErrors||this.gen.if(!1);return}this.gen.if(e),this.error(),this.allErrors?this.gen.endIf():this.gen.else()}fail$data(e){if(!this.$data)return this.fail(e);let{schemaCode:t}=this;this.fail((0,c._)`${t} !== undefined && (${(0,c.or)(this.invalid$data(),e)})`)}error(e,t,n){if(t){this.setParams(t),this._error(e,n),this.setParams({});return}this._error(e,n)}_error(e,t){(e?f.reportExtraError:f.reportError)(this,this.def.error,t)}$dataError(){(0,f.reportError)(this,this.def.$dataError||f.keyword$DataError)}reset(){if(this.errsCount===void 0)throw Error(`add "trackErrors" to keyword definition`);(0,f.resetErrorsCount)(this.gen,this.errsCount)}ok(e){this.allErrors||this.gen.if(e)}setParams(e,t){t?Object.assign(this.params,e):this.params=e}block$data(e,t,n=c.nil){this.gen.block(()=>{this.check$data(e,n),t()})}check$data(e=c.nil,t=c.nil){if(!this.$data)return;let{gen:n,schemaCode:r,schemaType:i,def:a}=this;n.if((0,c.or)((0,c._)`${r} === undefined`,t)),e!==c.nil&&n.assign(e,!0),(i.length||a.validateSchema)&&(n.elseIf(this.invalid$data()),this.$dataError(),e!==c.nil&&n.assign(e,!1)),n.else()}invalid$data(){let{gen:e,schemaCode:t,schemaType:n,def:r,it:a}=this;return(0,c.or)(o(),s());function o(){if(n.length){if(!(t instanceof c.Name))throw Error(`ajv implementation error`);let e=Array.isArray(n)?n:[n];return(0,c._)`${(0,i.checkDataTypes)(e,t,a.opts.strictNumbers,i.DataType.Wrong)}`}return c.nil}function s(){if(r.validateSchema){let n=e.scopeValue(`validate$data`,{ref:r.validateSchema});return(0,c._)`!${n}(${t})`}return c.nil}}subschema(e,t){let n=(0,s.getSubschema)(this.it,e);(0,s.extendSubschemaData)(n,this.it,e),(0,s.extendSubschemaMode)(n,e);let r={...this.it,...n,items:void 0,props:void 0};return b(r,t),r}mergeEvaluated(e,t){let{it:n,gen:r}=this;n.opts.unevaluated&&(n.props!==!0&&e.props!==void 0&&(n.props=d.mergeEvaluated.props(r,e.props,n.props,t)),n.items!==!0&&e.items!==void 0&&(n.items=d.mergeEvaluated.items(r,e.items,n.items,t)))}mergeValidEvaluated(e,t){let{it:n,gen:r}=this;if(n.opts.unevaluated&&(n.props!==!0||n.items!==!0))return r.if(t,()=>this.mergeEvaluated(e,c.Name)),!0}};e.KeywordCxt=_e;function ve(e,t,n,r){let i=new _e(e,n,t);`code`in n?n.code(i,r):i.$data&&n.validate?(0,o.funcKeywordCode)(i,n):`macro`in n?(0,o.macroKeywordCode)(i,n):(n.compile||n.validate)&&(0,o.funcKeywordCode)(i,n)}var ye=/^\/(?:[^~]|~0|~1)*$/,be=/^([0-9]+)(#|\/(?:[^~]|~0|~1)*)?$/;function xe(e,{dataLevel:t,dataNames:n,dataPathArr:r}){let i,a;if(e===``)return l.default.rootData;if(e[0]===`/`){if(!ye.test(e))throw Error(`Invalid JSON-pointer: ${e}`);i=e,a=l.default.rootData}else{let o=be.exec(e);if(!o)throw Error(`Invalid JSON-pointer: ${e}`);let s=+o[1];if(i=o[2],i===`#`){if(s>=t)throw Error(u(`property/index`,s));return r[t-s]}if(s>t)throw Error(u(`data`,s));if(a=n[t-s],!i)return a}let o=a,s=i.split(`/`);for(let e of s)e&&(a=(0,c._)`${a}${(0,c.getProperty)((0,d.unescapeJsonPointer)(e))}`,o=(0,c._)`${o} && ${a}`);return o;function u(e,n){return`Cannot access ${e} ${n} levels up, current level is ${t}`}}e.getData=xe})),Cu=t((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.default=class extends Error{constructor(e){super(`validation failed`),this.errors=e,this.ajv=this.validation=!0}}})),wu=t((e=>{Object.defineProperty(e,"__esModule",{value:!0});var t=xu();e.default=class extends Error{constructor(e,n,r,i){super(i||`can't resolve reference ${r} from id ${n}`),this.missingRef=(0,t.resolveUrl)(e,n,r),this.missingSchema=(0,t.normalizeId)((0,t.getFullPath)(e,this.missingRef))}}})),Tu=t((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.resolveSchema=e.getCompilingSchema=e.resolveRef=e.compileSchema=e.SchemaEnv=void 0;var t=Y(),n=Cu(),r=lu(),i=xu(),a=X(),o=Su(),s=class{constructor(e){this.refs={},this.dynamicAnchors={};let t;typeof e.schema==`object`&&(t=e.schema),this.schema=e.schema,this.schemaId=e.schemaId,this.root=e.root||this,this.baseId=e.baseId??(0,i.normalizeId)(t?.[e.schemaId||`$id`]),this.schemaPath=e.schemaPath,this.localRefs=e.localRefs,this.meta=e.meta,this.$async=t?.$async,this.refs={}}};e.SchemaEnv=s;function c(e){let a=d.call(this,e);if(a)return a;let s=(0,i.getFullPath)(this.opts.uriResolver,e.root.baseId),{es5:c,lines:l}=this.opts.code,{ownProperties:u}=this.opts,f=new t.CodeGen(this.scope,{es5:c,lines:l,ownProperties:u}),p;e.$async&&(p=f.scopeValue(`Error`,{ref:n.default,code:(0,t._)`require("ajv/dist/runtime/validation_error").default`}));let m=f.scopeName(`validate`);e.validateName=m;let h={gen:f,allErrors:this.opts.allErrors,data:r.default.data,parentData:r.default.parentData,parentDataProperty:r.default.parentDataProperty,dataNames:[r.default.data],dataPathArr:[t.nil],dataLevel:0,dataTypes:[],definedProperties:new Set,topSchemaRef:f.scopeValue(`schema`,this.opts.code.source===!0?{ref:e.schema,code:(0,t.stringify)(e.schema)}:{ref:e.schema}),validateName:m,ValidationError:p,schema:e.schema,schemaEnv:e,rootId:s,baseId:e.baseId||s,schemaPath:t.nil,errSchemaPath:e.schemaPath||(this.opts.jtd?``:`#`),errorPath:(0,t._)`""`,opts:this.opts,self:this},g;try{this._compilations.add(e),(0,o.validateFunctionCode)(h),f.optimize(this.opts.code.optimize);let n=f.toString();g=`${f.scopeRefs(r.default.scope)}return ${n}`,this.opts.code.process&&(g=this.opts.code.process(g,e));let i=Function(`${r.default.self}`,`${r.default.scope}`,g)(this,this.scope.get());if(this.scope.value(m,{ref:i}),i.errors=null,i.schema=e.schema,i.schemaEnv=e,e.$async&&(i.$async=!0),this.opts.code.source===!0&&(i.source={validateName:m,validateCode:n,scopeValues:f._values}),this.opts.unevaluated){let{props:e,items:n}=h;i.evaluated={props:e instanceof t.Name?void 0:e,items:n instanceof t.Name?void 0:n,dynamicProps:e instanceof t.Name,dynamicItems:n instanceof t.Name},i.source&&(i.source.evaluated=(0,t.stringify)(i.evaluated))}return e.validate=i,e}catch(t){throw delete e.validate,delete e.validateName,g&&this.logger.error(`Error compiling schema, function code:`,g),t}finally{this._compilations.delete(e)}}e.compileSchema=c;function l(e,t,n){n=(0,i.resolveUrl)(this.opts.uriResolver,t,n);let r=e.refs[n];if(r)return r;let a=p.call(this,e,n);if(a===void 0){let r=e.localRefs?.[n],{schemaId:i}=this.opts;r&&(a=new s({schema:r,schemaId:i,root:e,baseId:t}))}if(a!==void 0)return e.refs[n]=u.call(this,a)}e.resolveRef=l;function u(e){return(0,i.inlineRef)(e.schema,this.opts.inlineRefs)?e.schema:e.validate?e:c.call(this,e)}function d(e){for(let t of this._compilations)if(f(t,e))return t}e.getCompilingSchema=d;function f(e,t){return e.schema===t.schema&&e.root===t.root&&e.baseId===t.baseId}function p(e,t){let n;for(;typeof(n=this.refs[t])==`string`;)t=n;return n||this.schemas[t]||m.call(this,e,t)}function m(e,t){let n=this.opts.uriResolver.parse(t),r=(0,i._getFullPath)(this.opts.uriResolver,n),a=(0,i.getFullPath)(this.opts.uriResolver,e.baseId,void 0);if(Object.keys(e.schema).length>0&&r===a)return g.call(this,n,e);let o=(0,i.normalizeId)(r),l=this.refs[o]||this.schemas[o];if(typeof l==`string`){let t=m.call(this,e,l);return typeof t?.schema==`object`?g.call(this,n,t):void 0}if(typeof l?.schema==`object`){if(l.validate||c.call(this,l),o===(0,i.normalizeId)(t)){let{schema:t}=l,{schemaId:n}=this.opts,r=t[n];return r&&(a=(0,i.resolveUrl)(this.opts.uriResolver,a,r)),new s({schema:t,schemaId:n,root:e,baseId:a})}return g.call(this,n,l)}}e.resolveSchema=m;var h=new Set([`properties`,`patternProperties`,`enum`,`dependencies`,`definitions`]);function g(e,{baseId:t,schema:n,root:r}){if(e.fragment?.[0]!==`/`)return;for(let r of e.fragment.slice(1).split(`/`)){if(typeof n==`boolean`)return;let e=n[(0,a.unescapeFragment)(r)];if(e===void 0)return;n=e;let o=typeof n==`object`&&n[this.opts.schemaId];!h.has(r)&&o&&(t=(0,i.resolveUrl)(this.opts.uriResolver,t,o))}let o;if(typeof n!=`boolean`&&n.$ref&&!(0,a.schemaHasRulesButRef)(n,this.RULES)){let e=(0,i.resolveUrl)(this.opts.uriResolver,t,n.$ref);o=m.call(this,r,e)}let{schemaId:c}=this.opts;if(o||=new s({schema:n,schemaId:c,root:r,baseId:t}),o.schema!==o.root.schema)return o}})),Eu=o({$id:()=>Du,additionalProperties:()=>!1,default:()=>Mu,description:()=>Ou,properties:()=>ju,required:()=>Au,type:()=>ku}),Du,Ou,ku,Au,ju,Mu,Nu=n((()=>{Du=`https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#`,Ou=`Meta-schema for $data reference (JSON AnySchema extension proposal)`,ku=`object`,Au=[`$data`],ju={$data:{type:`string`,anyOf:[{format:`relative-json-pointer`},{format:`json-pointer`}]}},Mu={$id:Du,description:Ou,type:ku,required:Au,properties:ju,additionalProperties:!1}})),Pu=t(((e,t)=>{var n=RegExp.prototype.test.bind(/^[\da-f]{8}-[\da-f]{4}-[\da-f]{4}-[\da-f]{4}-[\da-f]{12}$/iu),r=RegExp.prototype.test.bind(/^(?:(?:25[0-5]|2[0-4]\d|1\d{2}|[1-9]\d|\d)\.){3}(?:25[0-5]|2[0-4]\d|1\d{2}|[1-9]\d|\d)$/u),i=RegExp.prototype.test.bind(/^[\da-f]{2}$/iu),a=RegExp.prototype.test.bind(/^[\da-z\-._~]$/iu),o=RegExp.prototype.test.bind(/^[\da-z\-._~!$&'()*+,;=:@/]$/iu);function s(e){let t=``,n=0,r=0;for(r=0;r=48&&n<=57||n>=65&&n<=70||n>=97&&n<=102))return``;t+=e[r];break}for(r+=1;r=48&&n<=57||n>=65&&n<=70||n>=97&&n<=102))return``;t+=e[r]}return t}var c=RegExp.prototype.test.bind(/[^!"$&'()*+,\-.;=_`a-z{}~]/u);function l(e){return e.length=0,!0}function u(e,t,n){if(e.length){let r=s(e);if(r!==``)t.push(r);else return n.error=!0,!1;e.length=0}return!0}function d(e){let t=0,n={error:!1,address:``,zone:``},r=[],i=[],a=!1,o=!1,c=u;for(let s=0;s7){n.error=!0;break}s>0&&e[s-1]===`:`&&(a=!0),r.push(`:`);continue}if(u===`%`){if(!c(i,r,n))break;c=l}else{i.push(u);continue}}}return i.length&&(c===l?n.zone=i.join(``):o?r.push(i.join(``)):r.push(s(i))),n.address=r.join(``),n}function f(e){if(p(e,`:`)<2)return{host:e,isIPV6:!1};let t=d(e);if(t.error)return{host:e,isIPV6:!1};{let e=t.address,n=t.address;return t.zone&&(e+=`%`+t.zone,n+=`%25`+t.zone),{host:e,isIPV6:!0,escapedHost:n}}}function p(e,t){let n=0;for(let r=0;rh[e])}function y(e,t=!1){if(e.indexOf(`%`)===-1)return e;let n=``;for(let r=0;r{var{isUUID:n}=Pu(),r=/([\da-z][\d\-a-z]{0,31}):((?:[\w!$'()*+,\-.:;=@]|%[\da-f]{2})+)/iu,i=[`http`,`https`,`ws`,`wss`,`urn`,`urn:uuid`];function a(e){return i.indexOf(e)!==-1}function o(e){return e.secure===!0?!0:e.secure===!1?!1:e.scheme?e.scheme.length===3&&(e.scheme[0]===`w`||e.scheme[0]===`W`)&&(e.scheme[1]===`s`||e.scheme[1]===`S`)&&(e.scheme[2]===`s`||e.scheme[2]===`S`):!1}function s(e){return e.host||(e.error=e.error||`HTTP URIs must have a host.`),e}function c(e){let t=String(e.scheme).toLowerCase()===`https`;return(e.port===(t?443:80)||e.port===``)&&(e.port=void 0),e.path||=`/`,e}function l(e){return e.secure=o(e),e.resourceName=(e.path||`/`)+(e.query?`?`+e.query:``),e.path=void 0,e.query=void 0,e}function u(e){if((e.port===(o(e)?443:80)||e.port===``)&&(e.port=void 0),typeof e.secure==`boolean`&&(e.scheme=e.secure?`wss`:`ws`,e.secure=void 0),e.resourceName){let[t,n]=e.resourceName.split(`?`);e.path=t&&t!==`/`?t:void 0,e.query=n,e.resourceName=void 0}return e.fragment=void 0,e}function d(e,t){if(!e.path)return e.error=`URN can not be parsed`,e;let n=e.path.match(r);if(n){let r=t.scheme||e.scheme||`urn`;e.nid=n[1].toLowerCase(),e.nss=n[2];let i=y(`${r}:${t.nid||e.nid}`);e.path=void 0,i&&(e=i.parse(e,t))}else e.error=e.error||`URN can not be parsed.`;return e}function f(e,t){if(e.nid===void 0)throw Error(`URN without nid cannot be serialized`);let n=t.scheme||e.scheme||`urn`,r=e.nid.toLowerCase(),i=y(`${n}:${t.nid||r}`);i&&(e=i.serialize(e,t));let a=e,o=e.nss;return a.path=`${r||t.nid}:${o}`,t.skipEscape=!0,a}function p(e,t){let r=e;return r.uuid=r.nss,r.nss=void 0,!t.tolerant&&(!r.uuid||!n(r.uuid))&&(r.error=r.error||`UUID is not valid.`),r}function m(e){let t=e;return t.nss=(e.uuid||``).toLowerCase(),t}var h={scheme:`http`,domainHost:!0,parse:s,serialize:c},g={scheme:`https`,domainHost:h.domainHost,parse:s,serialize:c},_={scheme:`ws`,domainHost:!0,parse:l,serialize:u},v={http:h,https:g,ws:_,wss:{scheme:`wss`,domainHost:_.domainHost,parse:_.parse,serialize:_.serialize},urn:{scheme:`urn`,parse:d,serialize:f,skipNormalize:!0},"urn:uuid":{scheme:`urn:uuid`,parse:p,serialize:m,skipNormalize:!0}};Object.setPrototypeOf(v,null);function y(e){return e&&(v[e]||v[e.toLowerCase()])||void 0}t.exports={wsIsSecure:o,SCHEMES:v,isValidSchemeName:a,getSchemeHandler:y}})),Iu=t(((e,t)=>{var{normalizeIPv6:n,removeDotSegments:r,recomposeAuthority:i,normalizePercentEncoding:a,normalizePathEncoding:o,escapePreservingEscapes:s,reescapeHostDelimiters:c,isIPv4:l,nonSimpleDomain:u}=Pu(),{SCHEMES:d,getSchemeHandler:f}=Fu();function p(e,t){return typeof e==`string`?e=ee(e,t):typeof e==`object`&&(e=C(_(e,t),t)),e}function m(e,t,n){let r=n?Object.assign({scheme:`null`},n):{scheme:`null`},{parsed:i,malformedAuthorityOrPort:a}=S(e,r),{parsed:o,malformedAuthorityOrPort:s}=S(t,r);if(a||s)throw Error(i.error||o.error||`URI is malformed.`);let c=h(i,o,r,!0);return r.skipEscape=!0,_(c,r)}function h(e,t,n,i){let a={};return i||(e=C(_(e,n),n),t=C(_(t,n),n)),n||={},!n.tolerant&&t.scheme?(a.scheme=t.scheme,a.userinfo=t.userinfo,a.host=t.host,a.port=t.port,a.path=r(t.path||``),a.query=t.query):(t.userinfo!==void 0||t.host!==void 0||t.port!==void 0?(a.userinfo=t.userinfo,a.host=t.host,a.port=t.port,a.path=r(t.path||``),a.query=t.query):(t.path?(t.path[0]===`/`?a.path=r(t.path):(a.path=(e.userinfo!==void 0||e.host!==void 0||e.port!==void 0)&&!e.path?`/`+t.path:e.path?e.path.slice(0,e.path.lastIndexOf(`/`)+1)+t.path:t.path,a.path=r(a.path)),a.query=t.query):(a.path=e.path,a.query=t.query===void 0?e.query:t.query),a.userinfo=e.userinfo,a.host=e.host,a.port=e.port),a.scheme=e.scheme),a.fragment=t.fragment,a}function g(e,t,n){let r=ne(e,n),i=ne(t,n);return r!==void 0&&i!==void 0&&r.toLowerCase()===i.toLowerCase()}function _(e,t){let n={host:e.host,scheme:e.scheme,userinfo:e.userinfo,port:e.port,path:e.path,query:e.query,nid:e.nid,nss:e.nss,uuid:e.uuid,fragment:e.fragment,reference:e.reference,resourceName:e.resourceName,secure:e.secure,error:``},o=Object.assign({},t),c=[],l=f(o.scheme||n.scheme);l&&l.serialize&&l.serialize(n,o),n.path!==void 0&&(o.skipEscape?n.path=a(n.path):(n.path=s(n.path),n.scheme!==void 0&&(n.path=n.path.split(`%3A`).join(`:`)))),o.reference!==`suffix`&&n.scheme&&c.push(n.scheme,`:`);let u=i(n);if(u!==void 0&&(o.reference!==`suffix`&&c.push(`//`),c.push(u),n.path&&n.path[0]!==`/`&&c.push(`/`)),n.path!==void 0){let e=n.path;!o.absolutePath&&(!l||!l.absolutePath)&&(e=r(e)),u===void 0&&e[0]===`/`&&e[1]===`/`&&(e=`/%2F`+e.slice(2)),c.push(e)}return n.query!==void 0&&c.push(`?`,n.query),n.fragment!==void 0&&c.push(`#`,n.fragment),c.join(``)}var v=/^(?:([^#/:?]+):)?(?:\/\/((?:([^#/?@]*)@)?(\[[^#/?\]]+\]|[^#/:?]*)(?::(\d*))?))?([^#?]*)(?:\?([^#]*))?(?:#((?:.|[\n\r])*))?/u,y=/^(?:[^#/:?]+:)?\/\/([^/?#]*)/,b=/^(?:[^#/:?]+:)?([/\\\t\n\r]*)/;function x(e,t){if(t[2]!==void 0&&e.path&&e.path[0]!==`/`)return`URI path must start with "/" when authority is present.`;if(typeof e.port==`number`&&(e.port<0||e.port>65535))return`URI port is malformed.`}function S(e,t){let r=Object.assign({},t),i={scheme:void 0,userinfo:void 0,host:``,port:void 0,path:``,query:void 0,fragment:void 0},a=!1,s=!1;r.reference===`suffix`&&(e=r.scheme?r.scheme+`:`+e:`//`+e);let d=e.match(y);d!==null&&d[1].indexOf(`\\`)!==-1&&(i.error=`URI authority must not contain a literal backslash.`,a=!0);let p=e.match(b);if(p!==null){let e=p[1],t=e.replace(/[\t\n\r]/g,``);t.length>=2&&(t.slice(0,2)===`//`?e.length!==t.length&&(i.error=i.error||`URI authority introducer must not contain whitespace.`,a=!0):(i.error=i.error||`URI authority must not contain a literal backslash.`,a=!0))}let m=e.match(v);if(m){i.scheme=m[1],i.userinfo=m[3],i.host=m[4],i.port=parseInt(m[5],10),i.path=m[6]||``,i.query=m[7],i.fragment=m[8],isNaN(i.port)&&(i.port=m[5]);let t=x(i,m);if(t!==void 0&&(i.error=i.error||t,a=!0),i.host){if(l(i.host)===!1){let e=n(i.host);i.host=e.host.toLowerCase(),s=e.isIPV6}else s=!0}i.reference=i.scheme===void 0&&i.userinfo===void 0&&i.host===void 0&&i.port===void 0&&i.query===void 0&&!i.path?`same-document`:i.scheme===void 0?`relative`:i.fragment===void 0?`absolute`:`uri`,r.reference&&r.reference!==`suffix`&&r.reference!==i.reference&&(i.error=i.error||`URI is not a `+r.reference+` reference.`);let d=f(r.scheme||i.scheme);if(!r.unicodeSupport&&(!d||!d.unicodeSupport)&&i.host&&(r.domainHost||d&&d.domainHost)&&s===!1&&u(i.host))try{i.host=new URL(`http://`+i.host).hostname}catch(e){i.error=i.error||`Host's domain name can not be converted to ASCII: `+e}if((!d||d&&!d.skipNormalize)&&(e.indexOf(`%`)!==-1&&(i.scheme!==void 0&&(i.scheme=unescape(i.scheme)),i.host!==void 0&&(i.host=c(unescape(i.host),s))),i.path&&=o(i.path),i.fragment))try{i.fragment=encodeURI(decodeURIComponent(i.fragment))}catch{i.error=i.error||`URI malformed`}d&&d.parse&&d.parse(i,r)}else i.error=i.error||`URI can not be parsed.`;return{parsed:i,malformedAuthorityOrPort:a}}function C(e,t){return S(e,t).parsed}function ee(e,t){return te(e,t).normalized}function te(e,t){let{parsed:n,malformedAuthorityOrPort:r}=S(e,t);return{normalized:r?e:_(n,t),malformedAuthorityOrPort:r}}function ne(e,t){if(typeof e==`string`){let{normalized:n,malformedAuthorityOrPort:r}=te(e,t);return r?void 0:n}if(typeof e==`object`)return _(e,t)}var re={SCHEMES:d,normalize:p,resolve:m,resolveComponent:h,equal:g,serialize:_,parse:C};t.exports=re,t.exports.default=re,t.exports.fastUri=re})),Lu=t((e=>{Object.defineProperty(e,"__esModule",{value:!0});var t=Iu();t.code=`require("ajv/dist/runtime/uri").default`,e.default=t})),Ru=t((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.CodeGen=e.Name=e.nil=e.stringify=e.str=e._=e.KeywordCxt=void 0;var t=Su();Object.defineProperty(e,"KeywordCxt",{enumerable:!0,get:function(){return t.KeywordCxt}});var n=Y();Object.defineProperty(e,"_",{enumerable:!0,get:function(){return n._}}),Object.defineProperty(e,"str",{enumerable:!0,get:function(){return n.str}}),Object.defineProperty(e,"stringify",{enumerable:!0,get:function(){return n.stringify}}),Object.defineProperty(e,"nil",{enumerable:!0,get:function(){return n.nil}}),Object.defineProperty(e,"Name",{enumerable:!0,get:function(){return n.Name}}),Object.defineProperty(e,"CodeGen",{enumerable:!0,get:function(){return n.CodeGen}});var r=Cu(),a=wu(),o=fu(),s=Tu(),c=Y(),l=xu(),u=mu(),d=X(),f=(Nu(),i(Eu).default),p=Lu(),m=(e,t)=>new RegExp(e,t);m.code=`new RegExp`;var h=[`removeAdditional`,`useDefaults`,`coerceTypes`],g=new Set([`validate`,`serialize`,`parse`,`wrapper`,`root`,`schema`,`keyword`,`pattern`,`formats`,`validate$data`,`func`,`obj`,`Error`]),_={errorDataPath:``,format:"`validateFormats: false` can be used instead.",nullable:`"nullable" keyword is supported by default.`,jsonPointers:`Deprecated jsPropertySyntax can be used instead.`,extendRefs:`Deprecated ignoreKeywordsWithRef can be used instead.`,missingRefs:`Pass empty schema with $id that should be ignored to ajv.addSchema.`,processCode:"Use option `code: {process: (code, schemaEnv: object) => string}`",sourceCode:"Use option `code: {source: true}`",strictDefaults:"It is default now, see option `strict`.",strictKeywords:"It is default now, see option `strict`.",uniqueItems:`"uniqueItems" keyword is always validated.`,unknownFormats:"Disable strict mode or pass `true` to `ajv.addFormat` (or `formats` option).",cache:`Map is used as cache, schema object as key.`,serialize:`Map is used as cache, schema object as key.`,ajvErrors:`It is default now.`},v={ignoreKeywordsWithRef:``,jsPropertySyntax:``,unicode:`"minLength"/"maxLength" account for unicode characters by default.`},y=200;function b(e){let t=e.strict,n=e.code?.optimize,r=n===!0||n===void 0?1:n||0,i=e.code?.regExp??m,a=e.uriResolver??p.default;return{strictSchema:e.strictSchema??t??!0,strictNumbers:e.strictNumbers??t??!0,strictTypes:e.strictTypes??t??`log`,strictTuples:e.strictTuples??t??`log`,strictRequired:e.strictRequired??t??!1,code:e.code?{...e.code,optimize:r,regExp:i}:{optimize:r,regExp:i},loopRequired:e.loopRequired??y,loopEnum:e.loopEnum??y,meta:e.meta??!0,messages:e.messages??!0,inlineRefs:e.inlineRefs??!0,schemaId:e.schemaId??`$id`,addUsedSchema:e.addUsedSchema??!0,validateSchema:e.validateSchema??!0,validateFormats:e.validateFormats??!0,unicodeRegExp:e.unicodeRegExp??!0,int32range:e.int32range??!0,uriResolver:a}}var x=class{constructor(e={}){this.schemas={},this.refs={},this.formats=Object.create(null),this._compilations=new Set,this._loading={},this._cache=new Map,e=this.opts={...e,...b(e)};let{es5:t,lines:n}=this.opts.code;this.scope=new c.ValueScope({scope:{},prefixes:g,es5:t,lines:n}),this.logger=w(e.logger);let r=e.validateFormats;e.validateFormats=!1,this.RULES=(0,o.getRules)(),S.call(this,_,e,`NOT SUPPORTED`),S.call(this,v,e,`DEPRECATED`,`warn`),this._metaOpts=re.call(this),e.formats&&te.call(this),this._addVocabularies(),this._addDefaultMetaSchema(),e.keywords&&ne.call(this,e.keywords),typeof e.meta==`object`&&this.addMetaSchema(e.meta),ee.call(this),e.validateFormats=r}_addVocabularies(){this.addKeyword(`$async`)}_addDefaultMetaSchema(){let{$data:e,meta:t,schemaId:n}=this.opts,r=f;n===`id`&&(r={...f},r.id=r.$id,delete r.$id),t&&e&&this.addMetaSchema(r,r[n],!1)}defaultMeta(){let{meta:e,schemaId:t}=this.opts;return this.opts.defaultMeta=typeof e==`object`?e[t]||e:void 0}validate(e,t){let n;if(typeof e==`string`){if(n=this.getSchema(e),!n)throw Error(`no schema with key or ref "${e}"`)}else n=this.compile(e);let r=n(t);return`$async`in n||(this.errors=n.errors),r}compile(e,t){let n=this._addSchema(e,t);return n.validate||this._compileSchemaEnv(n)}compileAsync(e,t){if(typeof this.opts.loadSchema!=`function`)throw Error(`options.loadSchema should be a function`);let{loadSchema:n}=this.opts;return r.call(this,e,t);async function r(e,t){await i.call(this,e.$schema);let n=this._addSchema(e,t);return n.validate||o.call(this,n)}async function i(e){e&&!this.getSchema(e)&&await r.call(this,{$ref:e},!0)}async function o(e){try{return this._compileSchemaEnv(e)}catch(t){if(!(t instanceof a.default))throw t;return s.call(this,t),await c.call(this,t.missingSchema),o.call(this,e)}}function s({missingSchema:e,missingRef:t}){if(this.refs[e])throw Error(`AnySchema ${e} is loaded but ${t} cannot be resolved`)}async function c(e){let n=await l.call(this,e);this.refs[e]||await i.call(this,n.$schema),this.refs[e]||this.addSchema(n,e,t)}async function l(e){let t=this._loading[e];if(t)return t;try{return await(this._loading[e]=n(e))}finally{delete this._loading[e]}}}addSchema(e,t,n,r=this.opts.validateSchema){if(Array.isArray(e)){for(let t of e)this.addSchema(t,void 0,n,r);return this}let i;if(typeof e==`object`){let{schemaId:t}=this.opts;if(i=e[t],i!==void 0&&typeof i!=`string`)throw Error(`schema ${t} must be string`)}return t=(0,l.normalizeId)(t||i),this._checkUnique(t),this.schemas[t]=this._addSchema(e,n,t,r,!0),this}addMetaSchema(e,t,n=this.opts.validateSchema){return this.addSchema(e,t,!0,n),this}validateSchema(e,t){if(typeof e==`boolean`)return!0;let n;if(n=e.$schema,n!==void 0&&typeof n!=`string`)throw Error(`$schema must be a string`);if(n=n||this.opts.defaultMeta||this.defaultMeta(),!n)return this.logger.warn(`meta-schema not available`),this.errors=null,!0;let r=this.validate(n,e);if(!r&&t){let e=`schema is invalid: `+this.errorsText();if(this.opts.validateSchema===`log`)this.logger.error(e);else throw Error(e)}return r}getSchema(e){let t;for(;typeof(t=C.call(this,e))==`string`;)e=t;if(t===void 0){let{schemaId:n}=this.opts,r=new s.SchemaEnv({schema:{},schemaId:n});if(t=s.resolveSchema.call(this,r,e),!t)return;this.refs[e]=t}return t.validate||this._compileSchemaEnv(t)}removeSchema(e){if(e instanceof RegExp)return this._removeAllSchemas(this.schemas,e),this._removeAllSchemas(this.refs,e),this;switch(typeof e){case`undefined`:return this._removeAllSchemas(this.schemas),this._removeAllSchemas(this.refs),this._cache.clear(),this;case`string`:{let t=C.call(this,e);return typeof t==`object`&&this._cache.delete(t.schema),delete this.schemas[e],delete this.refs[e],this}case`object`:{let t=e;this._cache.delete(t);let n=e[this.opts.schemaId];return n&&(n=(0,l.normalizeId)(n),delete this.schemas[n],delete this.refs[n]),this}default:throw Error(`ajv.removeSchema: invalid parameter`)}}addVocabulary(e){for(let t of e)this.addKeyword(t);return this}addKeyword(e,t){let n;if(typeof e==`string`)n=e,typeof t==`object`&&(this.logger.warn(`these parameters are deprecated, see docs for addKeyword`),t.keyword=n);else if(typeof e==`object`&&t===void 0){if(t=e,n=t.keyword,Array.isArray(n)&&!n.length)throw Error(`addKeywords: keyword must be string or non-empty array`)}else throw Error(`invalid addKeywords parameters`);if(oe.call(this,n,t),!t)return(0,d.eachItem)(n,e=>se.call(this,e)),this;le.call(this,t);let r={...t,type:(0,u.getJSONTypes)(t.type),schemaType:(0,u.getJSONTypes)(t.schemaType)};return(0,d.eachItem)(n,r.type.length===0?e=>se.call(this,e,r):e=>r.type.forEach(t=>se.call(this,e,r,t))),this}getKeyword(e){let t=this.RULES.all[e];return typeof t==`object`?t.definition:!!t}removeKeyword(e){let{RULES:t}=this;delete t.keywords[e],delete t.all[e];for(let n of t.rules){let t=n.rules.findIndex(t=>t.keyword===e);t>=0&&n.rules.splice(t,1)}return this}addFormat(e,t){return typeof t==`string`&&(t=new RegExp(t)),this.formats[e]=t,this}errorsText(e=this.errors,{separator:t=`, `,dataVar:n=`data`}={}){return!e||e.length===0?`No errors`:e.map(e=>`${n}${e.instancePath} ${e.message}`).reduce((e,n)=>e+t+n)}$dataMetaSchema(e,t){let n=this.RULES.all;e=JSON.parse(JSON.stringify(e));for(let r of t){let t=r.split(`/`).slice(1),i=e;for(let e of t)i=i[e];for(let e in n){let t=n[e];if(typeof t!=`object`)continue;let{$data:r}=t.definition,a=i[e];r&&a&&(i[e]=de(a))}}return e}_removeAllSchemas(e,t){for(let n in e){let r=e[n];(!t||t.test(n))&&(typeof r==`string`?delete e[n]:r&&!r.meta&&(this._cache.delete(r.schema),delete e[n]))}}_addSchema(e,t,n,r=this.opts.validateSchema,i=this.opts.addUsedSchema){let a,{schemaId:o}=this.opts;if(typeof e==`object`)a=e[o];else if(this.opts.jtd)throw Error(`schema must be object`);else if(typeof e!=`boolean`)throw Error(`schema must be object or boolean`);let c=this._cache.get(e);if(c!==void 0)return c;n=(0,l.normalizeId)(a||n);let u=l.getSchemaRefs.call(this,e,n);return c=new s.SchemaEnv({schema:e,schemaId:o,meta:t,baseId:n,localRefs:u}),this._cache.set(c.schema,c),i&&!n.startsWith(`#`)&&(n&&this._checkUnique(n),this.refs[n]=c),r&&this.validateSchema(e,!0),c}_checkUnique(e){if(this.schemas[e]||this.refs[e])throw Error(`schema with key or id "${e}" already exists`)}_compileSchemaEnv(e){if(e.meta?this._compileMetaSchema(e):s.compileSchema.call(this,e),!e.validate)throw Error(`ajv implementation error`);return e.validate}_compileMetaSchema(e){let t=this.opts;this.opts=this._metaOpts;try{s.compileSchema.call(this,e)}finally{this.opts=t}}};x.ValidationError=r.default,x.MissingRefError=a.default,e.default=x;function S(e,t,n,r=`error`){for(let i in e){let a=i;a in t&&this.logger[r](`${n}: option ${i}. ${e[a]}`)}}function C(e){return e=(0,l.normalizeId)(e),this.schemas[e]||this.refs[e]}function ee(){let e=this.opts.schemas;if(e){if(Array.isArray(e))this.addSchema(e);else for(let t in e)this.addSchema(e[t],t)}}function te(){for(let e in this.opts.formats){let t=this.opts.formats[e];t&&this.addFormat(e,t)}}function ne(e){if(Array.isArray(e)){this.addVocabulary(e);return}this.logger.warn(`keywords option as map is deprecated, pass array`);for(let t in e){let n=e[t];n.keyword||=t,this.addKeyword(n)}}function re(){let e={...this.opts};for(let t of h)delete e[t];return e}var ie={log(){},warn(){},error(){}};function w(e){if(e===!1)return ie;if(e===void 0)return console;if(e.log&&e.warn&&e.error)return e;throw Error(`logger must implement log, warn and error methods`)}var ae=/^[a-z_$][a-z0-9_$:-]*$/i;function oe(e,t){let{RULES:n}=this;if((0,d.eachItem)(e,e=>{if(n.keywords[e])throw Error(`Keyword ${e} is already defined`);if(!ae.test(e))throw Error(`Keyword ${e} has invalid name`)}),t&&t.$data&&!(`code`in t||`validate`in t))throw Error(`$data keyword must have "code" or "validate" function`)}function se(e,t,n){var r;let i=t?.post;if(n&&i)throw Error(`keyword with "post" flag cannot have "type"`);let{RULES:a}=this,o=i?a.post:a.rules.find(({type:e})=>e===n);if(o||(o={type:n,rules:[]},a.rules.push(o)),a.keywords[e]=!0,!t)return;let s={keyword:e,definition:{...t,type:(0,u.getJSONTypes)(t.type),schemaType:(0,u.getJSONTypes)(t.schemaType)}};t.before?ce.call(this,o,s,t.before):o.rules.push(s),a.all[e]=s,(r=t.implements)==null||r.forEach(e=>this.addKeyword(e))}function ce(e,t,n){let r=e.rules.findIndex(e=>e.keyword===n);r>=0?e.rules.splice(r,0,t):(e.rules.push(t),this.logger.warn(`rule ${n} is not defined`))}function le(e){let{metaSchema:t}=e;t!==void 0&&(e.$data&&this.opts.$data&&(t=de(t)),e.validateSchema=this.compile(t,!0))}var ue={$ref:`https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#`};function de(e){return{anyOf:[e,ue]}}})),zu=t((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.default={keyword:`id`,code(){throw Error(`NOT SUPPORTED: keyword "id", use "$id" for schema ID`)}}})),Bu=t((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.callRef=e.getValidate=void 0;var t=wu(),n=gu(),r=Y(),i=lu(),a=Tu(),o=X(),s={keyword:`$ref`,schemaType:`string`,code(e){let{gen:n,schema:i,it:o}=e,{baseId:s,schemaEnv:u,validateName:d,opts:f,self:p}=o,{root:m}=u;if((i===`#`||i===`#/`)&&s===m.baseId)return g();let h=a.resolveRef.call(p,m,s,i);if(h===void 0)throw new t.default(o.opts.uriResolver,s,i);if(h instanceof a.SchemaEnv)return _(h);return v(h);function g(){if(u===m)return l(e,d,u,u.$async);let t=n.scopeValue(`root`,{ref:m});return l(e,(0,r._)`${t}.validate`,m,m.$async)}function _(t){l(e,c(e,t),t,t.$async)}function v(t){let a=n.scopeValue(`schema`,f.code.source===!0?{ref:t,code:(0,r.stringify)(t)}:{ref:t}),o=n.name(`valid`),s=e.subschema({schema:t,dataTypes:[],schemaPath:r.nil,topSchemaRef:a,errSchemaPath:i},o);e.mergeEvaluated(s),e.ok(o)}}};function c(e,t){let{gen:n}=e;return t.validate?n.scopeValue(`validate`,{ref:t.validate}):(0,r._)`${n.scopeValue(`wrapper`,{ref:t})}.validate`}e.getValidate=c;function l(e,t,a,s){let{gen:c,it:l}=e,{allErrors:u,schemaEnv:d,opts:f}=l,p=f.passContext?i.default.this:r.nil;s?m():h();function m(){if(!d.$async)throw Error(`async schema referenced by sync schema`);let i=c.let(`valid`);c.try(()=>{c.code((0,r._)`await ${(0,n.callValidateCode)(e,t,p)}`),_(t),u||c.assign(i,!0)},e=>{c.if((0,r._)`!(${e} instanceof ${l.ValidationError})`,()=>c.throw(e)),g(e),u||c.assign(i,!1)}),e.ok(i)}function h(){e.result((0,n.callValidateCode)(e,t,p),()=>_(t),()=>g(t))}function g(e){let t=(0,r._)`${e}.errors`;c.assign(i.default.vErrors,(0,r._)`${i.default.vErrors} === null ? ${t} : ${i.default.vErrors}.concat(${t})`),c.assign(i.default.errors,(0,r._)`${i.default.vErrors}.length`)}function _(e){if(!l.opts.unevaluated)return;let t=a?.validate?.evaluated;if(l.props!==!0){if(t&&!t.dynamicProps)t.props!==void 0&&(l.props=o.mergeEvaluated.props(c,t.props,l.props));else{let t=c.var(`props`,(0,r._)`${e}.evaluated.props`);l.props=o.mergeEvaluated.props(c,t,l.props,r.Name)}}if(l.items!==!0){if(t&&!t.dynamicItems)t.items!==void 0&&(l.items=o.mergeEvaluated.items(c,t.items,l.items));else{let t=c.var(`items`,(0,r._)`${e}.evaluated.items`);l.items=o.mergeEvaluated.items(c,t,l.items,r.Name)}}}}e.callRef=l,e.default=s})),Vu=t((e=>{Object.defineProperty(e,"__esModule",{value:!0});var t=zu(),n=Bu();e.default=[`$schema`,`$id`,`$defs`,`$vocabulary`,{keyword:`$comment`},`definitions`,t.default,n.default]})),Hu=t((e=>{Object.defineProperty(e,"__esModule",{value:!0});var t=Y(),n=t.operators,r={maximum:{okStr:`<=`,ok:n.LTE,fail:n.GT},minimum:{okStr:`>=`,ok:n.GTE,fail:n.LT},exclusiveMaximum:{okStr:`<`,ok:n.LT,fail:n.GTE},exclusiveMinimum:{okStr:`>`,ok:n.GT,fail:n.LTE}};e.default={keyword:Object.keys(r),type:`number`,schemaType:`number`,$data:!0,error:{message:({keyword:e,schemaCode:n})=>(0,t.str)`must be ${r[e].okStr} ${n}`,params:({keyword:e,schemaCode:n})=>(0,t._)`{comparison: ${r[e].okStr}, limit: ${n}}`},code(e){let{keyword:n,data:i,schemaCode:a}=e;e.fail$data((0,t._)`${i} ${r[n].fail} ${a} || isNaN(${i})`)}}})),Uu=t((e=>{Object.defineProperty(e,"__esModule",{value:!0});var t=Y();e.default={keyword:`multipleOf`,type:`number`,schemaType:`number`,$data:!0,error:{message:({schemaCode:e})=>(0,t.str)`must be multiple of ${e}`,params:({schemaCode:e})=>(0,t._)`{multipleOf: ${e}}`},code(e){let{gen:n,data:r,schemaCode:i,it:a}=e,o=a.opts.multipleOfPrecision,s=n.let(`res`),c=o?(0,t._)`Math.abs(Math.round(${s}) - ${s}) > 1e-${o}`:(0,t._)`${s} !== parseInt(${s})`;e.fail$data((0,t._)`(${i} === 0 || (${s} = ${r}/${i}, ${c}))`)}}})),Wu=t((e=>{Object.defineProperty(e,"__esModule",{value:!0});function t(e){let t=e.length,n=0,r=0,i;for(;r=55296&&i<=56319&&r{Object.defineProperty(e,"__esModule",{value:!0});var t=Y(),n=X(),r=Wu();e.default={keyword:[`maxLength`,`minLength`],type:`string`,schemaType:`number`,$data:!0,error:{message({keyword:e,schemaCode:n}){let r=e===`maxLength`?`more`:`fewer`;return(0,t.str)`must NOT have ${r} than ${n} characters`},params:({schemaCode:e})=>(0,t._)`{limit: ${e}}`},code(e){let{keyword:i,data:a,schemaCode:o,it:s}=e,c=i===`maxLength`?t.operators.GT:t.operators.LT,l=s.opts.unicode===!1?(0,t._)`${a}.length`:(0,t._)`${(0,n.useFunc)(e.gen,r.default)}(${a})`;e.fail$data((0,t._)`${l} ${c} ${o}`)}}})),Ku=t((e=>{Object.defineProperty(e,"__esModule",{value:!0});var t=gu(),n=X(),r=Y();e.default={keyword:`pattern`,type:`string`,schemaType:`string`,$data:!0,error:{message:({schemaCode:e})=>(0,r.str)`must match pattern "${e}"`,params:({schemaCode:e})=>(0,r._)`{pattern: ${e}}`},code(e){let{gen:i,data:a,$data:o,schema:s,schemaCode:c,it:l}=e,u=l.opts.unicodeRegExp?`u`:``;if(o){let{regExp:t}=l.opts.code,o=t.code===`new RegExp`?(0,r._)`new RegExp`:(0,n.useFunc)(i,t),s=i.let(`valid`);i.try(()=>i.assign(s,(0,r._)`${o}(${c}, ${u}).test(${a})`),()=>i.assign(s,!1)),e.fail$data((0,r._)`!${s}`)}else{let n=(0,t.usePattern)(e,s);e.fail$data((0,r._)`!${n}.test(${a})`)}}}})),qu=t((e=>{Object.defineProperty(e,"__esModule",{value:!0});var t=Y();e.default={keyword:[`maxProperties`,`minProperties`],type:`object`,schemaType:`number`,$data:!0,error:{message({keyword:e,schemaCode:n}){let r=e===`maxProperties`?`more`:`fewer`;return(0,t.str)`must NOT have ${r} than ${n} properties`},params:({schemaCode:e})=>(0,t._)`{limit: ${e}}`},code(e){let{keyword:n,data:r,schemaCode:i}=e,a=n===`maxProperties`?t.operators.GT:t.operators.LT;e.fail$data((0,t._)`Object.keys(${r}).length ${a} ${i}`)}}})),Ju=t((e=>{Object.defineProperty(e,"__esModule",{value:!0});var t=gu(),n=Y(),r=X();e.default={keyword:`required`,type:`object`,schemaType:`array`,$data:!0,error:{message:({params:{missingProperty:e}})=>(0,n.str)`must have required property '${e}'`,params:({params:{missingProperty:e}})=>(0,n._)`{missingProperty: ${e}}`},code(e){let{gen:i,schema:a,schemaCode:o,data:s,$data:c,it:l}=e,{opts:u}=l;if(!c&&a.length===0)return;let d=a.length>=u.loopRequired;if(l.allErrors?f():p(),u.strictRequired){let t=e.parentSchema.properties,{definedProperties:n}=e.it;for(let e of a)if(t?.[e]===void 0&&!n.has(e)){let t=`required property "${e}" is not defined at "${l.schemaEnv.baseId+l.errSchemaPath}" (strictRequired)`;(0,r.checkStrictMode)(l,t,l.opts.strictRequired)}}function f(){if(d||c)e.block$data(n.nil,m);else for(let n of a)(0,t.checkReportMissingProp)(e,n)}function p(){let n=i.let(`missing`);if(d||c){let t=i.let(`valid`,!0);e.block$data(t,()=>h(n,t)),e.ok(t)}else i.if((0,t.checkMissingProp)(e,a,n)),(0,t.reportMissingProp)(e,n),i.else()}function m(){i.forOf(`prop`,o,n=>{e.setParams({missingProperty:n}),i.if((0,t.noPropertyInData)(i,s,n,u.ownProperties),()=>e.error())})}function h(r,a){e.setParams({missingProperty:r}),i.forOf(r,o,()=>{i.assign(a,(0,t.propertyInData)(i,s,r,u.ownProperties)),i.if((0,n.not)(a),()=>{e.error(),i.break()})},n.nil)}}}})),Yu=t((e=>{Object.defineProperty(e,"__esModule",{value:!0});var t=Y();e.default={keyword:[`maxItems`,`minItems`],type:`array`,schemaType:`number`,$data:!0,error:{message({keyword:e,schemaCode:n}){let r=e===`maxItems`?`more`:`fewer`;return(0,t.str)`must NOT have ${r} than ${n} items`},params:({schemaCode:e})=>(0,t._)`{limit: ${e}}`},code(e){let{keyword:n,data:r,schemaCode:i}=e,a=n===`maxItems`?t.operators.GT:t.operators.LT;e.fail$data((0,t._)`${r}.length ${a} ${i}`)}}})),Xu=t((e=>{Object.defineProperty(e,"__esModule",{value:!0});var t=yu();t.code=`require("ajv/dist/runtime/equal").default`,e.default=t})),Zu=t((e=>{Object.defineProperty(e,"__esModule",{value:!0});var t=mu(),n=Y(),r=X(),i=Xu();e.default={keyword:`uniqueItems`,type:`array`,schemaType:`boolean`,$data:!0,error:{message:({params:{i:e,j:t}})=>(0,n.str)`must NOT have duplicate items (items ## ${t} and ${e} are identical)`,params:({params:{i:e,j:t}})=>(0,n._)`{i: ${e}, j: ${t}}`},code(e){let{gen:a,data:o,$data:s,schema:c,parentSchema:l,schemaCode:u,it:d}=e;if(!s&&!c)return;let f=a.let(`valid`),p=l.items?(0,t.getSchemaTypes)(l.items):[];e.block$data(f,m,(0,n._)`${u} === false`),e.ok(f);function m(){let t=a.let(`i`,(0,n._)`${o}.length`),r=a.let(`j`);e.setParams({i:t,j:r}),a.assign(f,!0),a.if((0,n._)`${t} > 1`,()=>(h()?g:_)(t,r))}function h(){return p.length>0&&!p.some(e=>e===`object`||e===`array`)}function g(r,i){let s=a.name(`item`),c=(0,t.checkDataTypes)(p,s,d.opts.strictNumbers,t.DataType.Wrong),l=a.const(`indices`,(0,n._)`{}`);a.for((0,n._)`;${r}--;`,()=>{a.let(s,(0,n._)`${o}[${r}]`),a.if(c,(0,n._)`continue`),p.length>1&&a.if((0,n._)`typeof ${s} == "string"`,(0,n._)`${s} += "_"`),a.if((0,n._)`typeof ${l}[${s}] == "number"`,()=>{a.assign(i,(0,n._)`${l}[${s}]`),e.error(),a.assign(f,!1).break()}).code((0,n._)`${l}[${s}] = ${r}`)})}function _(t,s){let c=(0,r.useFunc)(a,i.default),l=a.name(`outer`);a.label(l).for((0,n._)`;${t}--;`,()=>a.for((0,n._)`${s} = ${t}; ${s}--;`,()=>a.if((0,n._)`${c}(${o}[${t}], ${o}[${s}])`,()=>{e.error(),a.assign(f,!1).break(l)})))}}}})),Qu=t((e=>{Object.defineProperty(e,"__esModule",{value:!0});var t=Y(),n=X(),r=Xu();e.default={keyword:`const`,$data:!0,error:{message:`must be equal to constant`,params:({schemaCode:e})=>(0,t._)`{allowedValue: ${e}}`},code(e){let{gen:i,data:a,$data:o,schemaCode:s,schema:c}=e;o||c&&typeof c==`object`?e.fail$data((0,t._)`!${(0,n.useFunc)(i,r.default)}(${a}, ${s})`):e.fail((0,t._)`${c} !== ${a}`)}}})),$u=t((e=>{Object.defineProperty(e,"__esModule",{value:!0});var t=Y(),n=X(),r=Xu();e.default={keyword:`enum`,schemaType:`array`,$data:!0,error:{message:`must be equal to one of the allowed values`,params:({schemaCode:e})=>(0,t._)`{allowedValues: ${e}}`},code(e){let{gen:i,data:a,$data:o,schema:s,schemaCode:c,it:l}=e;if(!o&&s.length===0)throw Error(`enum must have non-empty array`);let u=s.length>=l.opts.loopEnum,d,f=()=>d??=(0,n.useFunc)(i,r.default),p;if(u||o)p=i.let(`valid`),e.block$data(p,m);else{if(!Array.isArray(s))throw Error(`ajv implementation error`);let e=i.const(`vSchema`,c);p=(0,t.or)(...s.map((t,n)=>h(e,n)))}e.pass(p);function m(){i.assign(p,!1),i.forOf(`v`,c,e=>i.if((0,t._)`${f()}(${a}, ${e})`,()=>i.assign(p,!0).break()))}function h(e,n){let r=s[n];return typeof r==`object`&&r?(0,t._)`${f()}(${a}, ${e}[${n}])`:(0,t._)`${a} === ${r}`}}}})),ed=t((e=>{Object.defineProperty(e,"__esModule",{value:!0});var t=Hu(),n=Uu(),r=Gu(),i=Ku(),a=qu(),o=Ju(),s=Yu(),c=Zu(),l=Qu(),u=$u();e.default=[t.default,n.default,r.default,i.default,a.default,o.default,s.default,c.default,{keyword:`type`,schemaType:[`string`,`array`]},{keyword:`nullable`,schemaType:`boolean`},l.default,u.default]})),td=t((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.validateAdditionalItems=void 0;var t=Y(),n=X(),r={keyword:`additionalItems`,type:`array`,schemaType:[`boolean`,`object`],before:`uniqueItems`,error:{message:({params:{len:e}})=>(0,t.str)`must NOT have more than ${e} items`,params:({params:{len:e}})=>(0,t._)`{limit: ${e}}`},code(e){let{parentSchema:t,it:r}=e,{items:a}=t;if(!Array.isArray(a)){(0,n.checkStrictMode)(r,`"additionalItems" is ignored when "items" is not an array of schemas`);return}i(e,a)}};function i(e,r){let{gen:i,schema:a,data:o,keyword:s,it:c}=e;c.items=!0;let l=i.const(`len`,(0,t._)`${o}.length`);if(a===!1)e.setParams({len:r.length}),e.pass((0,t._)`${l} <= ${r.length}`);else if(typeof a==`object`&&!(0,n.alwaysValidSchema)(c,a)){let n=i.var(`valid`,(0,t._)`${l} <= ${r.length}`);i.if((0,t.not)(n),()=>u(n)),e.ok(n)}function u(a){i.forRange(`i`,r.length,l,r=>{e.subschema({keyword:s,dataProp:r,dataPropType:n.Type.Num},a),c.allErrors||i.if((0,t.not)(a),()=>i.break())})}}e.validateAdditionalItems=i,e.default=r})),nd=t((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.validateTuple=void 0;var t=Y(),n=X(),r=gu(),i={keyword:`items`,type:`array`,schemaType:[`object`,`array`,`boolean`],before:`uniqueItems`,code(e){let{schema:t,it:i}=e;if(Array.isArray(t))return a(e,`additionalItems`,t);i.items=!0,!(0,n.alwaysValidSchema)(i,t)&&e.ok((0,r.validateArray)(e))}};function a(e,r,i=e.schema){let{gen:a,parentSchema:o,data:s,keyword:c,it:l}=e;f(o),l.opts.unevaluated&&i.length&&l.items!==!0&&(l.items=n.mergeEvaluated.items(a,i.length,l.items));let u=a.name(`valid`),d=a.const(`len`,(0,t._)`${s}.length`);i.forEach((r,i)=>{(0,n.alwaysValidSchema)(l,r)||(a.if((0,t._)`${d} > ${i}`,()=>e.subschema({keyword:c,schemaProp:i,dataProp:i},u)),e.ok(u))});function f(e){let{opts:t,errSchemaPath:a}=l,o=i.length,s=o===e.minItems&&(o===e.maxItems||e[r]===!1);if(t.strictTuples&&!s){let e=`"${c}" is ${o}-tuple, but minItems or maxItems/${r} are not specified or different at path "${a}"`;(0,n.checkStrictMode)(l,e,t.strictTuples)}}}e.validateTuple=a,e.default=i})),rd=t((e=>{Object.defineProperty(e,"__esModule",{value:!0});var t=nd();e.default={keyword:`prefixItems`,type:`array`,schemaType:[`array`],before:`uniqueItems`,code:e=>(0,t.validateTuple)(e,`items`)}})),id=t((e=>{Object.defineProperty(e,"__esModule",{value:!0});var t=Y(),n=X(),r=gu(),i=td();e.default={keyword:`items`,type:`array`,schemaType:[`object`,`boolean`],before:`uniqueItems`,error:{message:({params:{len:e}})=>(0,t.str)`must NOT have more than ${e} items`,params:({params:{len:e}})=>(0,t._)`{limit: ${e}}`},code(e){let{schema:t,parentSchema:a,it:o}=e,{prefixItems:s}=a;o.items=!0,!(0,n.alwaysValidSchema)(o,t)&&(s?(0,i.validateAdditionalItems)(e,s):e.ok((0,r.validateArray)(e)))}}})),ad=t((e=>{Object.defineProperty(e,"__esModule",{value:!0});var t=Y(),n=X();e.default={keyword:`contains`,type:`array`,schemaType:[`object`,`boolean`],before:`uniqueItems`,trackErrors:!0,error:{message:({params:{min:e,max:n}})=>n===void 0?(0,t.str)`must contain at least ${e} valid item(s)`:(0,t.str)`must contain at least ${e} and no more than ${n} valid item(s)`,params:({params:{min:e,max:n}})=>n===void 0?(0,t._)`{minContains: ${e}}`:(0,t._)`{minContains: ${e}, maxContains: ${n}}`},code(e){let{gen:r,schema:i,parentSchema:a,data:o,it:s}=e,c,l,{minContains:u,maxContains:d}=a;s.opts.next?(c=u===void 0?1:u,l=d):c=1;let f=r.const(`len`,(0,t._)`${o}.length`);if(e.setParams({min:c,max:l}),l===void 0&&c===0){(0,n.checkStrictMode)(s,`"minContains" == 0 without "maxContains": "contains" keyword ignored`);return}if(l!==void 0&&c>l){(0,n.checkStrictMode)(s,`"minContains" > "maxContains" is always invalid`),e.fail();return}if((0,n.alwaysValidSchema)(s,i)){let n=(0,t._)`${f} >= ${c}`;l!==void 0&&(n=(0,t._)`${n} && ${f} <= ${l}`),e.pass(n);return}s.items=!0;let p=r.name(`valid`);l===void 0&&c===1?h(p,()=>r.if(p,()=>r.break())):c===0?(r.let(p,!0),l!==void 0&&r.if((0,t._)`${o}.length > 0`,m)):(r.let(p,!1),m()),e.result(p,()=>e.reset());function m(){let e=r.name(`_valid`),t=r.let(`count`,0);h(e,()=>r.if(e,()=>g(t)))}function h(t,i){r.forRange(`i`,0,f,r=>{e.subschema({keyword:`contains`,dataProp:r,dataPropType:n.Type.Num,compositeRule:!0},t),i()})}function g(e){r.code((0,t._)`${e}++`),l===void 0?r.if((0,t._)`${e} >= ${c}`,()=>r.assign(p,!0).break()):(r.if((0,t._)`${e} > ${l}`,()=>r.assign(p,!1).break()),c===1?r.assign(p,!0):r.if((0,t._)`${e} >= ${c}`,()=>r.assign(p,!0)))}}}})),od=t((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.validateSchemaDeps=e.validatePropertyDeps=e.error=void 0;var t=Y(),n=X(),r=gu();e.error={message:({params:{property:e,depsCount:n,deps:r}})=>{let i=n===1?`property`:`properties`;return(0,t.str)`must have ${i} ${r} when property ${e} is present`},params:({params:{property:e,depsCount:n,deps:r,missingProperty:i}})=>(0,t._)`{property: ${e}, - missingProperty: ${i}, - depsCount: ${n}, - deps: ${r}}`};var i={keyword:`dependencies`,type:`object`,schemaType:`object`,error:e.error,code(e){let[t,n]=a(e);o(e,t),s(e,n)}};function a({schema:e}){let t={},n={};for(let r in e){if(r===`__proto__`)continue;let i=Array.isArray(e[r])?t:n;i[r]=e[r]}return[t,n]}function o(e,n=e.schema){let{gen:i,data:a,it:o}=e;if(Object.keys(n).length===0)return;let s=i.let(`missing`);for(let c in n){let l=n[c];if(l.length===0)continue;let u=(0,r.propertyInData)(i,a,c,o.opts.ownProperties);e.setParams({property:c,depsCount:l.length,deps:l.join(`, `)}),o.allErrors?i.if(u,()=>{for(let t of l)(0,r.checkReportMissingProp)(e,t)}):(i.if((0,t._)`${u} && (${(0,r.checkMissingProp)(e,l,s)})`),(0,r.reportMissingProp)(e,s),i.else())}}e.validatePropertyDeps=o;function s(e,t=e.schema){let{gen:i,data:a,keyword:o,it:s}=e,c=i.name(`valid`);for(let l in t)(0,n.alwaysValidSchema)(s,t[l])||(i.if((0,r.propertyInData)(i,a,l,s.opts.ownProperties),()=>{let t=e.subschema({keyword:o,schemaProp:l},c);e.mergeValidEvaluated(t,c)},()=>i.var(c,!0)),e.ok(c))}e.validateSchemaDeps=s,e.default=i})),sd=t((e=>{Object.defineProperty(e,"__esModule",{value:!0});var t=Y(),n=X();e.default={keyword:`propertyNames`,type:`object`,schemaType:[`object`,`boolean`],error:{message:`property name must be valid`,params:({params:e})=>(0,t._)`{propertyName: ${e.propertyName}}`},code(e){let{gen:r,schema:i,data:a,it:o}=e;if((0,n.alwaysValidSchema)(o,i))return;let s=r.name(`valid`);r.forIn(`key`,a,n=>{e.setParams({propertyName:n}),e.subschema({keyword:`propertyNames`,data:n,dataTypes:[`string`],propertyName:n,compositeRule:!0},s),r.if((0,t.not)(s),()=>{e.error(!0),o.allErrors||r.break()})}),e.ok(s)}}})),cd=t((e=>{Object.defineProperty(e,"__esModule",{value:!0});var t=gu(),n=Y(),r=lu(),i=X();e.default={keyword:`additionalProperties`,type:[`object`],schemaType:[`boolean`,`object`],allowUndefined:!0,trackErrors:!0,error:{message:`must NOT have additional properties`,params:({params:e})=>(0,n._)`{additionalProperty: ${e.additionalProperty}}`},code(e){let{gen:a,schema:o,parentSchema:s,data:c,errsCount:l,it:u}=e;if(!l)throw Error(`ajv implementation error`);let{allErrors:d,opts:f}=u;if(u.props=!0,f.removeAdditional!==`all`&&(0,i.alwaysValidSchema)(u,o))return;let p=(0,t.allSchemaProperties)(s.properties),m=(0,t.allSchemaProperties)(s.patternProperties);h(),e.ok((0,n._)`${l} === ${r.default.errors}`);function h(){a.forIn(`key`,c,e=>{!p.length&&!m.length?v(e):a.if(g(e),()=>v(e))})}function g(r){let o;if(p.length>8){let e=(0,i.schemaRefOrVal)(u,s.properties,`properties`);o=(0,t.isOwnProperty)(a,e,r)}else o=p.length?(0,n.or)(...p.map(e=>(0,n._)`${r} === ${e}`)):n.nil;return m.length&&(o=(0,n.or)(o,...m.map(i=>(0,n._)`${(0,t.usePattern)(e,i)}.test(${r})`))),(0,n.not)(o)}function _(e){a.code((0,n._)`delete ${c}[${e}]`)}function v(t){if(f.removeAdditional===`all`||f.removeAdditional&&o===!1){_(t);return}if(o===!1){e.setParams({additionalProperty:t}),e.error(),d||a.break();return}if(typeof o==`object`&&!(0,i.alwaysValidSchema)(u,o)){let r=a.name(`valid`);f.removeAdditional===`failing`?(y(t,r,!1),a.if((0,n.not)(r),()=>{e.reset(),_(t)})):(y(t,r),d||a.if((0,n.not)(r),()=>a.break()))}}function y(t,n,r){let a={keyword:`additionalProperties`,dataProp:t,dataPropType:i.Type.Str};r===!1&&Object.assign(a,{compositeRule:!0,createErrors:!1,allErrors:!1}),e.subschema(a,n)}}}})),ld=t((e=>{Object.defineProperty(e,"__esModule",{value:!0});var t=Su(),n=gu(),r=X(),i=cd();e.default={keyword:`properties`,type:`object`,schemaType:`object`,code(e){let{gen:a,schema:o,parentSchema:s,data:c,it:l}=e;l.opts.removeAdditional===`all`&&s.additionalProperties===void 0&&i.default.code(new t.KeywordCxt(l,i.default,`additionalProperties`));let u=(0,n.allSchemaProperties)(o);for(let e of u)l.definedProperties.add(e);l.opts.unevaluated&&u.length&&l.props!==!0&&(l.props=r.mergeEvaluated.props(a,(0,r.toHash)(u),l.props));let d=u.filter(e=>!(0,r.alwaysValidSchema)(l,o[e]));if(d.length===0)return;let f=a.name(`valid`);for(let t of d)p(t)?m(t):(a.if((0,n.propertyInData)(a,c,t,l.opts.ownProperties)),m(t),l.allErrors||a.else().var(f,!0),a.endIf()),e.it.definedProperties.add(t),e.ok(f);function p(e){return l.opts.useDefaults&&!l.compositeRule&&o[e].default!==void 0}function m(t){e.subschema({keyword:`properties`,schemaProp:t,dataProp:t},f)}}}})),ud=t((e=>{Object.defineProperty(e,"__esModule",{value:!0});var t=gu(),n=Y(),r=X(),i=X();e.default={keyword:`patternProperties`,type:`object`,schemaType:`object`,code(e){let{gen:a,schema:o,data:s,parentSchema:c,it:l}=e,{opts:u}=l,d=(0,t.allSchemaProperties)(o),f=d.filter(e=>(0,r.alwaysValidSchema)(l,o[e]));if(d.length===0||f.length===d.length&&(!l.opts.unevaluated||l.props===!0))return;let p=u.strictSchema&&!u.allowMatchingProperties&&c.properties,m=a.name(`valid`);l.props!==!0&&!(l.props instanceof n.Name)&&(l.props=(0,i.evaluatedPropsToName)(a,l.props));let{props:h}=l;g();function g(){for(let e of d)p&&_(e),l.allErrors?v(e):(a.var(m,!0),v(e),a.if(m))}function _(e){for(let t in p)new RegExp(e).test(t)&&(0,r.checkStrictMode)(l,`property ${t} matches pattern ${e} (use allowMatchingProperties)`)}function v(r){a.forIn(`key`,s,o=>{a.if((0,n._)`${(0,t.usePattern)(e,r)}.test(${o})`,()=>{let t=f.includes(r);t||e.subschema({keyword:`patternProperties`,schemaProp:r,dataProp:o,dataPropType:i.Type.Str},m),l.opts.unevaluated&&h!==!0?a.assign((0,n._)`${h}[${o}]`,!0):!t&&!l.allErrors&&a.if((0,n.not)(m),()=>a.break())})})}}}})),dd=t((e=>{Object.defineProperty(e,"__esModule",{value:!0});var t=X();e.default={keyword:`not`,schemaType:[`object`,`boolean`],trackErrors:!0,code(e){let{gen:n,schema:r,it:i}=e;if((0,t.alwaysValidSchema)(i,r)){e.fail();return}let a=n.name(`valid`);e.subschema({keyword:`not`,compositeRule:!0,createErrors:!1,allErrors:!1},a),e.failResult(a,()=>e.reset(),()=>e.error())},error:{message:`must NOT be valid`}}})),fd=t((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.default={keyword:`anyOf`,schemaType:`array`,trackErrors:!0,code:gu().validateUnion,error:{message:`must match a schema in anyOf`}}})),pd=t((e=>{Object.defineProperty(e,"__esModule",{value:!0});var t=Y(),n=X();e.default={keyword:`oneOf`,schemaType:`array`,trackErrors:!0,error:{message:`must match exactly one schema in oneOf`,params:({params:e})=>(0,t._)`{passingSchemas: ${e.passing}}`},code(e){let{gen:r,schema:i,parentSchema:a,it:o}=e;if(!Array.isArray(i))throw Error(`ajv implementation error`);if(o.opts.discriminator&&a.discriminator)return;let s=i,c=r.let(`valid`,!1),l=r.let(`passing`,null),u=r.name(`_valid`);e.setParams({passing:l}),r.block(d),e.result(c,()=>e.reset(),()=>e.error(!0));function d(){s.forEach((i,a)=>{let s;(0,n.alwaysValidSchema)(o,i)?r.var(u,!0):s=e.subschema({keyword:`oneOf`,schemaProp:a,compositeRule:!0},u),a>0&&r.if((0,t._)`${u} && ${c}`).assign(c,!1).assign(l,(0,t._)`[${l}, ${a}]`).else(),r.if(u,()=>{r.assign(c,!0),r.assign(l,a),s&&e.mergeEvaluated(s,t.Name)})})}}}})),md=t((e=>{Object.defineProperty(e,"__esModule",{value:!0});var t=X();e.default={keyword:`allOf`,schemaType:`array`,code(e){let{gen:n,schema:r,it:i}=e;if(!Array.isArray(r))throw Error(`ajv implementation error`);let a=n.name(`valid`);r.forEach((n,r)=>{if((0,t.alwaysValidSchema)(i,n))return;let o=e.subschema({keyword:`allOf`,schemaProp:r},a);e.ok(a),e.mergeEvaluated(o)})}}})),hd=t((e=>{Object.defineProperty(e,"__esModule",{value:!0});var t=Y(),n=X(),r={keyword:`if`,schemaType:[`object`,`boolean`],trackErrors:!0,error:{message:({params:e})=>(0,t.str)`must match "${e.ifClause}" schema`,params:({params:e})=>(0,t._)`{failingKeyword: ${e.ifClause}}`},code(e){let{gen:r,parentSchema:a,it:o}=e;a.then===void 0&&a.else===void 0&&(0,n.checkStrictMode)(o,`"if" without "then" and "else" is ignored`);let s=i(o,`then`),c=i(o,`else`);if(!s&&!c)return;let l=r.let(`valid`,!0),u=r.name(`_valid`);if(d(),e.reset(),s&&c){let t=r.let(`ifClause`);e.setParams({ifClause:t}),r.if(u,f(`then`,t),f(`else`,t))}else s?r.if(u,f(`then`)):r.if((0,t.not)(u),f(`else`));e.pass(l,()=>e.error(!0));function d(){let t=e.subschema({keyword:`if`,compositeRule:!0,createErrors:!1,allErrors:!1},u);e.mergeEvaluated(t)}function f(n,i){return()=>{let a=e.subschema({keyword:n},u);r.assign(l,u),e.mergeValidEvaluated(a,l),i?r.assign(i,(0,t._)`${n}`):e.setParams({ifClause:n})}}}};function i(e,t){let r=e.schema[t];return r!==void 0&&!(0,n.alwaysValidSchema)(e,r)}e.default=r})),gd=t((e=>{Object.defineProperty(e,"__esModule",{value:!0});var t=X();e.default={keyword:[`then`,`else`],schemaType:[`object`,`boolean`],code({keyword:e,parentSchema:n,it:r}){n.if===void 0&&(0,t.checkStrictMode)(r,`"${e}" without "if" is ignored`)}}})),_d=t((e=>{Object.defineProperty(e,"__esModule",{value:!0});var t=td(),n=rd(),r=nd(),i=id(),a=ad(),o=od(),s=sd(),c=cd(),l=ld(),u=ud(),d=dd(),f=fd(),p=pd(),m=md(),h=hd(),g=gd();function _(e=!1){let _=[d.default,f.default,p.default,m.default,h.default,g.default,s.default,c.default,o.default,l.default,u.default];return e?_.push(n.default,i.default):_.push(t.default,r.default),_.push(a.default),_}e.default=_})),vd=t((e=>{Object.defineProperty(e,"__esModule",{value:!0});var t=Y();e.default={keyword:`format`,type:[`number`,`string`],schemaType:`string`,$data:!0,error:{message:({schemaCode:e})=>(0,t.str)`must match format "${e}"`,params:({schemaCode:e})=>(0,t._)`{format: ${e}}`},code(e,n){let{gen:r,data:i,$data:a,schema:o,schemaCode:s,it:c}=e,{opts:l,errSchemaPath:u,schemaEnv:d,self:f}=c;if(!l.validateFormats)return;a?p():m();function p(){let a=r.scopeValue(`formats`,{ref:f.formats,code:l.code.formats}),o=r.const(`fDef`,(0,t._)`${a}[${s}]`),c=r.let(`fType`),u=r.let(`format`);r.if((0,t._)`typeof ${o} == "object" && !(${o} instanceof RegExp)`,()=>r.assign(c,(0,t._)`${o}.type || "string"`).assign(u,(0,t._)`${o}.validate`),()=>r.assign(c,(0,t._)`"string"`).assign(u,o)),e.fail$data((0,t.or)(p(),m()));function p(){return l.strictSchema===!1?t.nil:(0,t._)`${s} && !${u}`}function m(){let e=d.$async?(0,t._)`(${o}.async ? await ${u}(${i}) : ${u}(${i}))`:(0,t._)`${u}(${i})`,r=(0,t._)`(typeof ${u} == "function" ? ${e} : ${u}.test(${i}))`;return(0,t._)`${u} && ${u} !== true && ${c} === ${n} && !${r}`}}function m(){let a=f.formats[o];if(!a){m();return}if(a===!0)return;let[s,c,p]=h(a);s===n&&e.pass(g());function m(){if(l.strictSchema===!1){f.logger.warn(e());return}throw Error(e());function e(){return`unknown format "${o}" ignored in schema at path "${u}"`}}function h(e){let n=e instanceof RegExp?(0,t.regexpCode)(e):l.code.formats?(0,t._)`${l.code.formats}${(0,t.getProperty)(o)}`:void 0,i=r.scopeValue(`formats`,{key:o,ref:e,code:n});return typeof e==`object`&&!(e instanceof RegExp)?[e.type||`string`,e.validate,(0,t._)`${i}.validate`]:[`string`,e,i]}function g(){if(typeof a==`object`&&!(a instanceof RegExp)&&a.async){if(!d.$async)throw Error(`async format in sync schema`);return(0,t._)`await ${p}(${i})`}return typeof c==`function`?(0,t._)`${p}(${i})`:(0,t._)`${p}.test(${i})`}}}}})),yd=t((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.default=[vd().default]})),bd=t((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.contentVocabulary=e.metadataVocabulary=void 0,e.metadataVocabulary=[`title`,`description`,`default`,`deprecated`,`readOnly`,`writeOnly`,`examples`],e.contentVocabulary=[`contentMediaType`,`contentEncoding`,`contentSchema`]})),xd=t((e=>{Object.defineProperty(e,"__esModule",{value:!0});var t=Vu(),n=ed(),r=_d(),i=yd(),a=bd();e.default=[t.default,n.default,(0,r.default)(),i.default,a.metadataVocabulary,a.contentVocabulary]})),Sd=t((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.DiscrError=void 0;var t;(function(e){e.Tag=`tag`,e.Mapping=`mapping`})(t||(e.DiscrError=t={}))})),Cd=t((e=>{Object.defineProperty(e,"__esModule",{value:!0});var t=Y(),n=Sd(),r=Tu(),i=wu(),a=X();e.default={keyword:`discriminator`,type:`object`,schemaType:`object`,error:{message:({params:{discrError:e,tagName:t}})=>e===n.DiscrError.Tag?`tag "${t}" must be string`:`value of tag "${t}" must be in oneOf`,params:({params:{discrError:e,tag:n,tagName:r}})=>(0,t._)`{error: ${e}, tag: ${r}, tagValue: ${n}}`},code(e){let{gen:o,data:s,schema:c,parentSchema:l,it:u}=e,{oneOf:d}=l;if(!u.opts.discriminator)throw Error(`discriminator: requires discriminator option`);let f=c.propertyName;if(typeof f!=`string`)throw Error(`discriminator: requires propertyName`);if(c.mapping)throw Error(`discriminator: mapping is not supported`);if(!d)throw Error(`discriminator: requires oneOf keyword`);let p=o.let(`valid`,!1),m=o.const(`tag`,(0,t._)`${s}${(0,t.getProperty)(f)}`);o.if((0,t._)`typeof ${m} == "string"`,()=>h(),()=>e.error(!1,{discrError:n.DiscrError.Tag,tag:m,tagName:f})),e.ok(p);function h(){let r=_();o.if(!1);for(let e in r)o.elseIf((0,t._)`${m} === ${e}`),o.assign(p,g(r[e]));o.else(),e.error(!1,{discrError:n.DiscrError.Mapping,tag:m,tagName:f}),o.endIf()}function g(n){let r=o.name(`valid`),i=e.subschema({keyword:`oneOf`,schemaProp:n},r);return e.mergeEvaluated(i,t.Name),r}function _(){let e={},t=o(l),n=!0;for(let e=0;eEd,$schema:()=>Td,default:()=>jd,definitions:()=>Od,properties:()=>Ad,title:()=>Dd,type:()=>kd}),Td,Ed,Dd,Od,kd,Ad,jd,Md=n((()=>{Td=`http://json-schema.org/draft-07/schema#`,Ed=`http://json-schema.org/draft-07/schema#`,Dd=`Core schema meta-schema`,Od={schemaArray:{type:`array`,minItems:1,items:{$ref:`#`}},nonNegativeInteger:{type:`integer`,minimum:0},nonNegativeIntegerDefault0:{allOf:[{$ref:`#/definitions/nonNegativeInteger`},{default:0}]},simpleTypes:{enum:[`array`,`boolean`,`integer`,`null`,`number`,`object`,`string`]},stringArray:{type:`array`,items:{type:`string`},uniqueItems:!0,default:[]}},kd=[`object`,`boolean`],Ad={$id:{type:`string`,format:`uri-reference`},$schema:{type:`string`,format:`uri`},$ref:{type:`string`,format:`uri-reference`},$comment:{type:`string`},title:{type:`string`},description:{type:`string`},default:!0,readOnly:{type:`boolean`,default:!1},examples:{type:`array`,items:!0},multipleOf:{type:`number`,exclusiveMinimum:0},maximum:{type:`number`},exclusiveMaximum:{type:`number`},minimum:{type:`number`},exclusiveMinimum:{type:`number`},maxLength:{$ref:`#/definitions/nonNegativeInteger`},minLength:{$ref:`#/definitions/nonNegativeIntegerDefault0`},pattern:{type:`string`,format:`regex`},additionalItems:{$ref:`#`},items:{anyOf:[{$ref:`#`},{$ref:`#/definitions/schemaArray`}],default:!0},maxItems:{$ref:`#/definitions/nonNegativeInteger`},minItems:{$ref:`#/definitions/nonNegativeIntegerDefault0`},uniqueItems:{type:`boolean`,default:!1},contains:{$ref:`#`},maxProperties:{$ref:`#/definitions/nonNegativeInteger`},minProperties:{$ref:`#/definitions/nonNegativeIntegerDefault0`},required:{$ref:`#/definitions/stringArray`},additionalProperties:{$ref:`#`},definitions:{type:`object`,additionalProperties:{$ref:`#`},default:{}},properties:{type:`object`,additionalProperties:{$ref:`#`},default:{}},patternProperties:{type:`object`,additionalProperties:{$ref:`#`},propertyNames:{format:`regex`},default:{}},dependencies:{type:`object`,additionalProperties:{anyOf:[{$ref:`#`},{$ref:`#/definitions/stringArray`}]}},propertyNames:{$ref:`#`},const:!0,enum:{type:`array`,items:!0,minItems:1,uniqueItems:!0},type:{anyOf:[{$ref:`#/definitions/simpleTypes`},{type:`array`,items:{$ref:`#/definitions/simpleTypes`},minItems:1,uniqueItems:!0}]},format:{type:`string`},contentMediaType:{type:`string`},contentEncoding:{type:`string`},if:{$ref:`#`},then:{$ref:`#`},else:{$ref:`#`},allOf:{$ref:`#/definitions/schemaArray`},anyOf:{$ref:`#/definitions/schemaArray`},oneOf:{$ref:`#/definitions/schemaArray`},not:{$ref:`#`}},jd={$schema:Td,$id:Ed,title:Dd,definitions:Od,type:kd,properties:Ad,default:!0}})),Nd=t(((e,t)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.MissingRefError=e.ValidationError=e.CodeGen=e.Name=e.nil=e.stringify=e.str=e._=e.KeywordCxt=e.Ajv=void 0;var n=Ru(),r=xd(),a=Cd(),o=(Md(),i(wd).default),s=[`/properties`],c=`http://json-schema.org/draft-07/schema`,l=class extends n.default{_addVocabularies(){super._addVocabularies(),r.default.forEach(e=>this.addVocabulary(e)),this.opts.discriminator&&this.addKeyword(a.default)}_addDefaultMetaSchema(){if(super._addDefaultMetaSchema(),!this.opts.meta)return;let e=this.opts.$data?this.$dataMetaSchema(o,s):o;this.addMetaSchema(e,c,!1),this.refs[`http://json-schema.org/schema`]=c}defaultMeta(){return this.opts.defaultMeta=super.defaultMeta()||(this.getSchema(c)?c:void 0)}};e.Ajv=l,t.exports=e=l,t.exports.Ajv=l,Object.defineProperty(e,"__esModule",{value:!0}),e.default=l;var u=Su();Object.defineProperty(e,"KeywordCxt",{enumerable:!0,get:function(){return u.KeywordCxt}});var d=Y();Object.defineProperty(e,"_",{enumerable:!0,get:function(){return d._}}),Object.defineProperty(e,"str",{enumerable:!0,get:function(){return d.str}}),Object.defineProperty(e,"stringify",{enumerable:!0,get:function(){return d.stringify}}),Object.defineProperty(e,"nil",{enumerable:!0,get:function(){return d.nil}}),Object.defineProperty(e,"Name",{enumerable:!0,get:function(){return d.Name}}),Object.defineProperty(e,"CodeGen",{enumerable:!0,get:function(){return d.CodeGen}});var f=Cu();Object.defineProperty(e,"ValidationError",{enumerable:!0,get:function(){return f.default}});var p=wu();Object.defineProperty(e,"MissingRefError",{enumerable:!0,get:function(){return p.default}})})),Pd=t((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.formatNames=e.fastFormats=e.fullFormats=void 0;function t(e,t){return{validate:e,compare:t}}e.fullFormats={date:t(a,o),time:t(c(!0),l),"date-time":t(f(!0),p),"iso-time":t(c(),u),"iso-date-time":t(f(),m),duration:/^P(?!$)((\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+S)?)?|(\d+W)?)$/,uri:_,"uri-reference":/^(?:[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,"uri-template":/^(?:(?:[^\x00-\x20"'<>%\\^`{|}]|%[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,url:/^(?:https?|ftp):\/\/(?:\S+(?::\S*)?@)?(?:(?!(?:10|127)(?:\.\d{1,3}){3})(?!(?:169\.254|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-z0-9\u{00a1}-\u{ffff}]+-)*[a-z0-9\u{00a1}-\u{ffff}]+)(?:\.(?:[a-z0-9\u{00a1}-\u{ffff}]+-)*[a-z0-9\u{00a1}-\u{ffff}]+)*(?:\.(?:[a-z\u{00a1}-\u{ffff}]{2,})))(?::\d{2,5})?(?:\/[^\s]*)?$/iu,email:/^[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*@(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?$/i,hostname:/^(?=.{1,253}\.?$)[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?(?:\.[a-z0-9](?:[-0-9a-z]{0,61}[0-9a-z])?)*\.?$/i,ipv4:/^(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)\.){3}(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)$/,ipv6:/^((([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,regex:ne,uuid:/^(?:urn:uuid:)?[0-9a-f]{8}-(?:[0-9a-f]{4}-){3}[0-9a-f]{12}$/i,"json-pointer":/^(?:\/(?:[^~/]|~0|~1)*)*$/,"json-pointer-uri-fragment":/^#(?:\/(?:[a-z0-9_\-.!$&'()*+,;:=@]|%[0-9a-f]{2}|~0|~1)*)*$/i,"relative-json-pointer":/^(?:0|[1-9][0-9]*)(?:#|(?:\/(?:[^~/]|~0|~1)*)*)$/,byte:y,int32:{type:`number`,validate:S},int64:{type:`number`,validate:C},float:{type:`number`,validate:ee},double:{type:`number`,validate:ee},password:!0,binary:!0},e.fastFormats={...e.fullFormats,date:t(/^\d\d\d\d-[0-1]\d-[0-3]\d$/,o),time:t(/^(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)$/i,l),"date-time":t(/^\d\d\d\d-[0-1]\d-[0-3]\dt(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)$/i,p),"iso-time":t(/^(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)?$/i,u),"iso-date-time":t(/^\d\d\d\d-[0-1]\d-[0-3]\d[t\s](?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)?$/i,m),uri:/^(?:[a-z][a-z0-9+\-.]*:)(?:\/?\/)?[^\s]*$/i,"uri-reference":/^(?:(?:[a-z][a-z0-9+\-.]*:)?\/?\/)?(?:[^\\\s#][^\s#]*)?(?:#[^\\\s]*)?$/i,email:/^[a-z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?(?:\.[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?)*$/i},e.formatNames=Object.keys(e.fullFormats);function n(e){return e%4==0&&(e%100!=0||e%400==0)}var r=/^(\d\d\d\d)-(\d\d)-(\d\d)$/,i=[0,31,28,31,30,31,30,31,31,30,31,30,31];function a(e){let t=r.exec(e);if(!t)return!1;let a=+t[1],o=+t[2],s=+t[3];return o>=1&&o<=12&&s>=1&&s<=(o===2&&n(a)?29:i[o])}function o(e,t){if(e&&t)return e>t?1:e23||u>59||e&&!o)return!1;if(r<=23&&i<=59&&a<60)return!0;let d=i-u*c,f=r-l*c-+(d<0);return(f===23||f===-1)&&(d===59||d===-1)&&a<61}}function l(e,t){if(!(e&&t))return;let n=new Date(`2020-01-01T`+e).valueOf(),r=new Date(`2020-01-01T`+t).valueOf();if(n&&r)return n-r}function u(e,t){if(!(e&&t))return;let n=s.exec(e),r=s.exec(t);if(n&&r)return e=n[1]+n[2]+n[3],t=r[1]+r[2]+r[3],e>t?1:e=b}function C(e){return Number.isInteger(e)}function ee(){return!0}var te=/[^\\]\\Z/;function ne(e){if(te.test(e))return!1;try{return new RegExp(e),!0}catch{return!1}}})),Fd=t((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.formatLimitDefinition=void 0;var t=Nd(),n=Y(),r=n.operators,i={formatMaximum:{okStr:`<=`,ok:r.LTE,fail:r.GT},formatMinimum:{okStr:`>=`,ok:r.GTE,fail:r.LT},formatExclusiveMaximum:{okStr:`<`,ok:r.LT,fail:r.GTE},formatExclusiveMinimum:{okStr:`>`,ok:r.GT,fail:r.LTE}};e.formatLimitDefinition={keyword:Object.keys(i),type:`string`,schemaType:`string`,$data:!0,error:{message:({keyword:e,schemaCode:t})=>(0,n.str)`should be ${i[e].okStr} ${t}`,params:({keyword:e,schemaCode:t})=>(0,n._)`{comparison: ${i[e].okStr}, limit: ${t}}`},code(e){let{gen:r,data:a,schemaCode:o,keyword:s,it:c}=e,{opts:l,self:u}=c;if(!l.validateFormats)return;let d=new t.KeywordCxt(c,u.RULES.all.format.definition,`format`);d.$data?f():p();function f(){let t=r.scopeValue(`formats`,{ref:u.formats,code:l.code.formats}),i=r.const(`fmt`,(0,n._)`${t}[${d.schemaCode}]`);e.fail$data((0,n.or)((0,n._)`typeof ${i} != "object"`,(0,n._)`${i} instanceof RegExp`,(0,n._)`typeof ${i}.compare != "function"`,m(i)))}function p(){let t=d.schema,i=u.formats[t];if(!i||i===!0)return;if(typeof i!=`object`||i instanceof RegExp||typeof i.compare!=`function`)throw Error(`"${s}": format "${t}" does not define "compare" function`);let a=r.scopeValue(`formats`,{key:t,ref:i,code:l.code.formats?(0,n._)`${l.code.formats}${(0,n.getProperty)(t)}`:void 0});e.fail$data(m(a))}function m(e){return(0,n._)`${e}.compare(${a}, ${o}) ${i[s].fail} 0`}},dependencies:[`format`]},e.default=t=>(t.addKeyword(e.formatLimitDefinition),t)})),Id=t(((e,t)=>{Object.defineProperty(e,"__esModule",{value:!0});var n=Pd(),r=Fd(),i=Y(),a=new i.Name(`fullFormats`),o=new i.Name(`fastFormats`),s=(e,t={keywords:!0})=>{if(Array.isArray(t))return c(e,t,n.fullFormats,a),e;let[i,s]=t.mode===`fast`?[n.fastFormats,o]:[n.fullFormats,a];return c(e,t.formats||n.formatNames,i,s),t.keywords&&(0,r.default)(e),e};s.get=(e,t=`full`)=>{let r=(t===`fast`?n.fastFormats:n.fullFormats)[e];if(!r)throw Error(`Unknown format "${e}"`);return r};function c(e,t,n,r){var a;(a=e.opts.code).formats??(a.formats=(0,i._)`require("ajv-formats/dist/formats").${r}`);for(let r of t)e.addFormat(r,n[r])}t.exports=e=s,Object.defineProperty(e,"__esModule",{value:!0}),e.default=s})),Ld=r(Nd(),1),Rd=r(Id(),1);function zd(){let e=new Ld.default({strict:!1,validateFormats:!0,validateSchema:!1,allErrors:!0});return(0,Rd.default)(e),e}var Bd=class{constructor(e){this._ajv=e??zd()}getValidator(e){let t=`$id`in e&&typeof e.$id==`string`?this._ajv.getSchema(e.$id)??this._ajv.compile(e):this._ajv.compile(e);return e=>t(e)?{valid:!0,data:e,errorMessage:void 0}:{valid:!1,data:void 0,errorMessage:this._ajv.errorsText(t.errors)}}},Vd=class{constructor(e){this._client=e}async*callToolStream(e,t=Fc,n){let r=this._client,i={...n,task:n?.task??(r.isToolTask(e.name)?{}:void 0)},a=r.requestStream({method:`tools/call`,params:e},t,i),o=r.getToolOutputValidator(e.name);for await(let t of a){if(t.type===`result`&&o){let n=t.result;if(!n.structuredContent&&!n.isError){yield{type:`error`,error:new J(q.InvalidRequest,`Tool ${e.name} has an output schema but did not return structured content`)};return}if(n.structuredContent)try{let e=o(n.structuredContent);if(!e.valid){yield{type:`error`,error:new J(q.InvalidParams,`Structured content does not match the tool's output schema: ${e.errorMessage}`)};return}}catch(e){if(e instanceof J){yield{type:`error`,error:e};return}yield{type:`error`,error:new J(q.InvalidParams,`Failed to validate structured content: ${e instanceof Error?e.message:String(e)}`)};return}}yield t}}async getTask(e,t){return this._client.getTask({taskId:e},t)}async getTaskResult(e,t,n){return this._client.getTaskResult({taskId:e},t,n)}async listTasks(e,t){return this._client.listTasks(e?{cursor:e}:void 0,t)}async cancelTask(e,t){return this._client.cancelTask({taskId:e},t)}requestStream(e,t,n){return this._client.requestStream(e,t,n)}};function Hd(e,t,n){if(!e)throw Error(`${n} does not support task creation (required for ${t})`);if(t===`tools/call`&&!e.tools?.call)throw Error(`${n} does not support task creation for tools/call (required for ${t})`)}function Ud(e,t,n){if(!e)throw Error(`${n} does not support task creation (required for ${t})`);switch(t){case`sampling/createMessage`:if(!e.sampling?.createMessage)throw Error(`${n} does not support task creation for sampling/createMessage (required for ${t})`);break;case`elicitation/create`:if(!e.elicitation?.create)throw Error(`${n} does not support task creation for elicitation/create (required for ${t})`)}}function Wd(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&&Wd(t,n[e])}}if(Array.isArray(e.anyOf))for(let n of e.anyOf)typeof n!=`boolean`&&Wd(n,t);if(Array.isArray(e.oneOf))for(let n of e.oneOf)typeof n!=`boolean`&&Wd(n,t)}}function Gd(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}}var Kd=class extends kl{constructor(e,t){super(t),this._clientInfo=e,this._cachedToolOutputValidators=new Map,this._cachedKnownTaskTools=new Set,this._cachedRequiredTaskTools=new Set,this._listChangedDebounceTimers=new Map,this._capabilities=t?.capabilities??{},this._jsonSchemaValidator=t?.jsonSchemaValidator??new Bd,t?.listChanged&&(this._pendingListChangedConfig=t.listChanged)}_setupListChangedHandlers(e){e.tools&&this._serverCapabilities?.tools?.listChanged&&this._setupListChangedHandler(`tools`,Rc,e.tools,async()=>(await this.listTools()).tools),e.prompts&&this._serverCapabilities?.prompts?.listChanged&&this._setupListChangedHandler(`prompts`,kc,e.prompts,async()=>(await this.listPrompts()).prompts),e.resources&&this._serverCapabilities?.resources?.listChanged&&this._setupListChangedHandler(`resources`,sc,e.resources,async()=>(await this.listResources()).resources)}get experimental(){return this._experimental||={tasks:new Vd(this)},this._experimental}registerCapabilities(e){if(this.transport)throw Error(`Cannot register capabilities after connecting to transport`);this._capabilities=jl(this._capabilities,e)}setRequestHandler(e,t){let n=wl(e)?.method;if(!n)throw Error(`Schema is missing a method literal`);let r=Tl(n);if(typeof r!=`string`)throw Error(`Schema method literal must be a string`);let i=r;return i===`elicitation/create`?super.setRequestHandler(e,async(e,n)=>{let r=Cl(cl,e);if(!r.success){let e=r.error instanceof Error?r.error.message:String(r.error);throw new J(q.InvalidParams,`Invalid elicitation request: ${e}`)}let{params:i}=r.data;i.mode=i.mode??`form`;let{supportsFormMode:a,supportsUrlMode:o}=Gd(this._capabilities.elicitation);if(i.mode===`form`&&!a)throw new J(q.InvalidParams,`Client does not support form-mode elicitation requests`);if(i.mode===`url`&&!o)throw new J(q.InvalidParams,`Client does not support URL-mode elicitation requests`);let s=await Promise.resolve(t(e,n));if(i.task){let e=Cl(Fs,s);if(!e.success){let t=e.error instanceof Error?e.error.message:String(e.error);throw new J(q.InvalidParams,`Invalid task creation result: ${t}`)}return e.data}let c=Cl(dl,s);if(!c.success){let e=c.error instanceof Error?c.error.message:String(c.error);throw new J(q.InvalidParams,`Invalid elicitation result: ${e}`)}let l=c.data,u=i.mode===`form`?i.requestedSchema:void 0;if(i.mode===`form`&&l.action===`accept`&&l.content&&u&&this._capabilities.elicitation?.form?.applyDefaults)try{Wd(u,l.content)}catch{}return l}):i===`sampling/createMessage`?super.setRequestHandler(e,async(e,n)=>{let r=Cl(Qc,e);if(!r.success){let e=r.error instanceof Error?r.error.message:String(r.error);throw new J(q.InvalidParams,`Invalid sampling request: ${e}`)}let{params:i}=r.data,a=await Promise.resolve(t(e,n));if(i.task){let e=Cl(Fs,a);if(!e.success){let t=e.error instanceof Error?e.error.message:String(e.error);throw new J(q.InvalidParams,`Invalid task creation result: ${t}`)}return e.data}let o=Cl(i.tools||i.toolChoice?el:$c,a);if(!o.success){let e=o.error instanceof Error?o.error.message:String(o.error);throw new J(q.InvalidParams,`Invalid sampling result: ${e}`)}return o.data}):super.setRequestHandler(e,t)}assertCapability(e,t){if(!this._serverCapabilities?.[e])throw Error(`Server does not support ${e} (required for ${t})`)}async connect(e,t){if(await super.connect(e),e.sessionId===void 0)try{let n=await this.request({method:`initialize`,params:{protocolVersion:Vo,capabilities:this._capabilities,clientInfo:this._clientInfo}},Cs,t);if(n===void 0)throw Error(`Server sent invalid initialize result: ${n}`);if(!Ho.includes(n.protocolVersion))throw Error(`Server's protocol version is not supported: ${n.protocolVersion}`);this._serverCapabilities=n.capabilities,this._serverVersion=n.serverInfo,e.setProtocolVersion&&e.setProtocolVersion(n.protocolVersion),this._instructions=n.instructions,await this.notification({method:`notifications/initialized`}),this._pendingListChangedConfig&&=(this._setupListChangedHandlers(this._pendingListChangedConfig),void 0)}catch(e){throw this.close(),e}}getServerCapabilities(){return this._serverCapabilities}getServerVersion(){return this._serverVersion}getInstructions(){return this._instructions}assertCapabilityForMethod(e){switch(e){case`logging/setLevel`:if(!this._serverCapabilities?.logging)throw Error(`Server does not support logging (required for ${e})`);break;case`prompts/get`:case`prompts/list`:if(!this._serverCapabilities?.prompts)throw Error(`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 Error(`Server does not support resources (required for ${e})`);if(e===`resources/subscribe`&&!this._serverCapabilities.resources.subscribe)throw Error(`Server does not support resource subscriptions (required for ${e})`);break;case`tools/call`:case`tools/list`:if(!this._serverCapabilities?.tools)throw Error(`Server does not support tools (required for ${e})`);break;case`completion/complete`:if(!this._serverCapabilities?.completions)throw Error(`Server does not support completions (required for ${e})`)}}assertNotificationCapability(e){if(e===`notifications/roots/list_changed`&&!this._capabilities.roots?.listChanged)throw Error(`Client does not support roots list changed notifications (required for ${e})`)}assertRequestHandlerCapability(e){if(this._capabilities)switch(e){case`sampling/createMessage`:if(!this._capabilities.sampling)throw Error(`Client does not support sampling capability (required for ${e})`);break;case`elicitation/create`:if(!this._capabilities.elicitation)throw Error(`Client does not support elicitation capability (required for ${e})`);break;case`roots/list`:if(!this._capabilities.roots)throw Error(`Client does not support roots capability (required for ${e})`);break;case`tasks/get`:case`tasks/list`:case`tasks/result`:case`tasks/cancel`:if(!this._capabilities.tasks)throw Error(`Client does not support tasks capability (required for ${e})`)}}assertTaskCapability(e){Hd(this._serverCapabilities?.tasks?.requests,e,`Server`)}assertTaskHandlerCapability(e){this._capabilities&&Ud(this._capabilities.tasks?.requests,e,`Client`)}async ping(e){return this.request({method:`ping`},us,e)}async complete(e,t){return this.request({method:`completion/complete`,params:e},gl,t)}async setLoggingLevel(e,t){return this.request({method:`logging/setLevel`,params:{level:e}},us,t)}async getPrompt(e,t){return this.request({method:`prompts/get`,params:e},Oc,t)}async listPrompts(e,t){return this.request({method:`prompts/list`,params:e},_c,t)}async listResources(e,t){return this.request({method:`resources/list`,params:e},ec,t)}async listResourceTemplates(e,t){return this.request({method:`resources/templates/list`,params:e},nc,t)}async readResource(e,t){return this.request({method:`resources/read`,params:e},oc,t)}async subscribeResource(e,t){return this.request({method:`resources/subscribe`,params:e},us,t)}async unsubscribeResource(e,t){return this.request({method:`resources/unsubscribe`,params:e},us,t)}async callTool(e,t=Fc,n){if(this.isToolTaskRequired(e.name))throw new J(q.InvalidRequest,`Tool "${e.name}" requires task-based execution. Use client.experimental.tasks.callToolStream() instead.`);let r=await this.request({method:`tools/call`,params:e},t,n),i=this.getToolOutputValidator(e.name);if(i){if(!r.structuredContent&&!r.isError)throw new J(q.InvalidRequest,`Tool ${e.name} has an output schema but did not return structured content`);if(r.structuredContent)try{let e=i(r.structuredContent);if(!e.valid)throw new J(q.InvalidParams,`Structured content does not match the tool's output schema: ${e.errorMessage}`)}catch(e){throw e instanceof J?e:new J(q.InvalidParams,`Failed to validate structured content: ${e instanceof Error?e.message:String(e)}`)}}return r}isToolTask(e){return this._serverCapabilities?.tasks?.requests?.tools?.call?this._cachedKnownTaskTools.has(e):!1}isToolTaskRequired(e){return this._cachedRequiredTaskTools.has(e)}cacheToolMetadata(e){this._cachedToolOutputValidators.clear(),this._cachedKnownTaskTools.clear(),this._cachedRequiredTaskTools.clear();for(let t of e){if(t.outputSchema){let e=this._jsonSchemaValidator.getValidator(t.outputSchema);this._cachedToolOutputValidators.set(t.name,e)}let e=t.execution?.taskSupport;(e===`required`||e===`optional`)&&this._cachedKnownTaskTools.add(t.name),e===`required`&&this._cachedRequiredTaskTools.add(t.name)}}getToolOutputValidator(e){return this._cachedToolOutputValidators.get(e)}async listTools(e,t){let n=await this.request({method:`tools/list`,params:e},Pc,t);return this.cacheToolMetadata(n.tools),n}_setupListChangedHandler(e,t,n,r){let i=zc.safeParse(n);if(!i.success)throw Error(`Invalid ${e} listChanged options: ${i.error.message}`);if(typeof n.onChanged!=`function`)throw Error(`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{let e=await r();s(null,e)}catch(e){let t=e instanceof Error?e:Error(String(e));s(t,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`})}},qd=r(t((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 Jd(e){if(e)try{return qd.parse(e).type}catch{let t=(e.split(`;`,1)[0]??``).trim().toLowerCase();return t===``||e.slice(t.length).includes(`,`)?void 0:t}}function Yd(e){return e?e instanceof Headers?Object.fromEntries(e.entries()):Array.isArray(e)?Object.fromEntries(e):{...e}:{}}function Xd(e=fetch,t){return t?async(n,r)=>e(n,{...t,...r,headers:r?.headers?{...Yd(t.headers),...Yd(r.headers)}:t.headers}):e}var Zd=globalThis.crypto;async function Qd(e){return(await Zd).getRandomValues(new Uint8Array(e))}async function $d(e){let t=``;for(;t.length128)throw`Expected a length between 43 and 128. Received ${e}.`;let t=await ef(e);return{code_verifier:t,code_challenge:await tf(t)}}var Z=Ea().superRefine((e,t)=>{if(!URL.canParse(e))return t.addIssue({code:Ro.custom,message:`URL must be parseable`,fatal:!0}),g}).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`}),rf=z({resource:M().url(),authorization_servers:L(Z).optional(),jwks_uri:M().url().optional(),scopes_supported:L(M()).optional(),bearer_methods_supported:L(M()).optional(),resource_signing_alg_values_supported:L(M()).optional(),resource_name:M().optional(),resource_documentation:M().optional(),resource_policy_uri:M().url().optional(),resource_tos_uri:M().url().optional(),tls_client_certificate_bound_access_tokens:F().optional(),authorization_details_types_supported:L(M()).optional(),dpop_signing_alg_values_supported:L(M()).optional(),dpop_bound_access_tokens_required:F().optional()}),af=z({issuer:M(),authorization_endpoint:Z,token_endpoint:Z,registration_endpoint:Z.optional(),scopes_supported:L(M()).optional(),response_types_supported:L(M()),response_modes_supported:L(M()).optional(),grant_types_supported:L(M()).optional(),token_endpoint_auth_methods_supported:L(M()).optional(),token_endpoint_auth_signing_alg_values_supported:L(M()).optional(),service_documentation:Z.optional(),revocation_endpoint:Z.optional(),revocation_endpoint_auth_methods_supported:L(M()).optional(),revocation_endpoint_auth_signing_alg_values_supported:L(M()).optional(),introspection_endpoint:M().optional(),introspection_endpoint_auth_methods_supported:L(M()).optional(),introspection_endpoint_auth_signing_alg_values_supported:L(M()).optional(),code_challenge_methods_supported:L(M()).optional(),client_id_metadata_document_supported:F().optional()}),of=R({...z({issuer:M(),authorization_endpoint:Z,token_endpoint:Z,userinfo_endpoint:Z.optional(),jwks_uri:Z,registration_endpoint:Z.optional(),scopes_supported:L(M()).optional(),response_types_supported:L(M()),response_modes_supported:L(M()).optional(),grant_types_supported:L(M()).optional(),acr_values_supported:L(M()).optional(),subject_types_supported:L(M()),id_token_signing_alg_values_supported:L(M()),id_token_encryption_alg_values_supported:L(M()).optional(),id_token_encryption_enc_values_supported:L(M()).optional(),userinfo_signing_alg_values_supported:L(M()).optional(),userinfo_encryption_alg_values_supported:L(M()).optional(),userinfo_encryption_enc_values_supported:L(M()).optional(),request_object_signing_alg_values_supported:L(M()).optional(),request_object_encryption_alg_values_supported:L(M()).optional(),request_object_encryption_enc_values_supported:L(M()).optional(),token_endpoint_auth_methods_supported:L(M()).optional(),token_endpoint_auth_signing_alg_values_supported:L(M()).optional(),display_values_supported:L(M()).optional(),claim_types_supported:L(M()).optional(),claims_supported:L(M()).optional(),service_documentation:M().optional(),claims_locales_supported:L(M()).optional(),ui_locales_supported:L(M()).optional(),claims_parameter_supported:F().optional(),request_parameter_supported:F().optional(),request_uri_parameter_supported:F().optional(),require_request_uri_registration:F().optional(),op_policy_uri:Z.optional(),op_tos_uri:Z.optional(),client_id_metadata_document_supported:F().optional()}).shape,...af.pick({code_challenge_methods_supported:!0}).shape}),sf=R({access_token:M(),id_token:M().optional(),token_type:M(),expires_in:Bo().optional(),scope:M().optional(),refresh_token:M().optional()}).strip(),cf=R({error:M(),error_description:M().optional(),error_uri:M().optional()}),lf=Z.optional().or(H(``).transform(()=>void 0)),uf=R({redirect_uris:L(Z),token_endpoint_auth_method:M().optional(),grant_types:L(M()).optional(),response_types:L(M()).optional(),client_name:M().optional(),client_uri:Z.optional(),logo_uri:lf,scope:M().optional(),contacts:L(M()).optional(),tos_uri:lf,policy_uri:M().optional(),jwks_uri:Z.optional(),jwks:Za().optional(),software_id:M().optional(),software_version:M().optional(),software_statement:M().optional()}).strip(),df=R({client_id:M(),client_secret:M().optional(),client_id_issued_at:P().optional(),client_secret_expires_at:P().optional()}).strip(),ff=uf.merge(df);R({error:M(),error_description:M().optional()}).strip(),R({token:M(),token_type_hint:M().optional()}).strip();function pf(e){let t=typeof e==`string`?new URL(e):new URL(e.href);return t.hash=``,t}function mf({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=400&&e.status<500&&t!==`/`}async function ep(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=Zf(t,i.pathname);o=new URL(e,r?.metadataServerUrl??i),o.search=i.search}let s=await Qf(o,a,n);return!r?.metadataUrl&&$f(s,i.pathname)&&(s=await Qf(new URL(`/.well-known/${t}`,i),a,n)),s}function tp(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`}),r.push({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`}),r.push({url:new URL(`/.well-known/openid-configuration${i}`,t.origin),type:`oidc`}),r.push({url:new URL(`${i}/.well-known/openid-configuration`,t.origin),type:`oidc`}),r}async function np(e,{fetchFn:t=fetch,protocolVersion:n=Vo}={}){let r={"MCP-Protocol-Version":n,Accept:`application/json`},i=tp(e);for(let{url:e,type:n}of i){let i=await Xf(e,r,t);if(i){if(!i.ok){if(await i.body?.cancel(),i.status>=400&&i.status<500)continue;throw Error(`HTTP ${i.status} trying to load ${n===`oauth`?`OAuth`:`OpenID provider`} metadata from ${e}`)}return n===`oauth`?af.parse(await i.json()):of.parse(await i.json())}}}async function rp(e,t){let n,r;try{n=await Yf(e,{resourceMetadataUrl:t?.resourceMetadataUrl},t?.fetchFn),n.authorization_servers&&n.authorization_servers.length>0&&(r=n.authorization_servers[0])}catch{}r||=String(new URL(`/`,e));let i=await np(r,{fetchFn:t?.fetchFn});return{authorizationServerUrl:r,authorizationServerMetadata:i,resourceMetadata:n}}async function ip(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(Ff))throw Error(`Incompatible auth server: does not support response type ${Ff}`);if(t.code_challenge_methods_supported&&!t.code_challenge_methods_supported.includes(If))throw Error(`Incompatible auth server: does not support code challenge method ${If}`)}else s=new URL(`/authorize`,e);let c=await nf(),l=c.code_verifier,u=c.code_challenge;return s.searchParams.set(`response_type`,Ff),s.searchParams.set(`client_id`,n.client_id),s.searchParams.set(`code_challenge`,u),s.searchParams.set(`code_challenge_method`,If),s.searchParams.set(`redirect_uri`,String(r)),a&&s.searchParams.set(`state`,a),i&&s.searchParams.set(`scope`,i),i?.includes(`offline_access`)&&s.searchParams.append(`prompt`,`consent`),o&&s.searchParams.set(`resource`,o.href),{authorizationUrl:s,codeVerifier:l}}function ap(e,t,n){return new URLSearchParams({grant_type:`authorization_code`,code:e,code_verifier:t,redirect_uri:String(n)})}async function op(e,{metadata:t,tokenRequestParams:n,clientInformation:r,addClientAuthentication:i,resource:a,fetchFn:o}){let s=t?.token_endpoint?new URL(t.token_endpoint):new URL(`/token`,e),c=new Headers({"Content-Type":`application/x-www-form-urlencoded`,Accept:`application/json`});a&&n.set(`resource`,a.href),i?await i(c,n,s,t):r&&Rf(Lf(r,t?.token_endpoint_auth_methods_supported??[]),r,c,n);let l=await(o??fetch)(s,{method:`POST`,headers:c,body:n});if(!l.ok)throw await Hf(l);return sf.parse(await l.json())}async function sp(e,{metadata:t,clientInformation:n,refreshToken:r,resource:i,addClientAuthentication:a,fetchFn:o}){return{refresh_token:r,...await op(e,{metadata:t,tokenRequestParams:new URLSearchParams({grant_type:`refresh_token`,refresh_token:r}),clientInformation:n,addClientAuthentication:a,resource:i,fetchFn:o})}}async function cp(e,t,{metadata:n,resource:r,authorizationCode:i,fetchFn:a}={}){let o=e.clientMetadata.scope,s;if(e.prepareTokenRequest&&(s=await e.prepareTokenRequest(o)),!s){if(!i)throw Error(`Either provider.prepareTokenRequest() or authorizationCode is required`);if(!e.redirectUrl)throw Error(`redirectUrl is required for authorization_code flow`);s=ap(i,await e.codeVerifier(),e.redirectUrl)}let c=await e.clientInformation();return op(t,{metadata:n,tokenRequestParams:s,clientInformation:c??void 0,addClientAuthentication:e.addClientAuthentication,resource:r,fetchFn:a})}async function lp(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=await(i??fetch)(a,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({...n,...r===void 0?{}:{scope:r}})});if(!o.ok)throw await Hf(o);return ff.parse(await o.json())}var up=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}},dp=10,fp=13,pp=32;function mp(e){}function hp(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=mp,onError:n=mp,onRetry:r=mp,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 up(`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(gp(e,n,i)){let i=e.charCodeAt(n+5)===pp?n+6:n+5,a=e.slice(i,r);if(d===0&&e.charCodeAt(r+1)===dp){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 _p(e,n,i)?f=e.slice(e.charCodeAt(n+6)===pp?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 gp(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 _p(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 vp=class extends TransformStream{constructor({onError:e,onRetry:t,onComment:n,maxBufferSize:r}={}){let i;super({start(a){i=hp({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)}})}},yp={initialReconnectionDelay:1e3,maxReconnectionDelay:3e4,reconnectionDelayGrowFactor:1.5,maxRetries:2},bp=class extends Error{constructor(e,t){super(`Streamable HTTP error: ${t}`),this.code=e}},xp=class{constructor(e,t){this._hasCompletedAuthFlow=!1,this._url=e,this._resourceMetadataUrl=void 0,this._scope=void 0,this._requestInit=t?.requestInit,this._authProvider=t?.authProvider,this._fetch=t?.fetch,this._fetchWithInit=Xd(t?.fetch,t?.requestInit),this._sessionId=t?.sessionId,this._reconnectionOptions=t?.reconnectionOptions??yp}async _authThenStart(){if(!this._authProvider)throw new Nf(`No auth provider`);let e;try{e=await Uf(this._authProvider,{serverUrl:this._url,resourceMetadataUrl:this._resourceMetadataUrl,scope:this._scope,fetchFn:this._fetchWithInit})}catch(e){throw this.onerror?.(e),e}if(e!==`AUTHORIZED`)throw new Nf;return await this._startOrAuthSse({resumptionToken:void 0})}async _commonHeaders(){let e={};if(this._authProvider){let t=await this._authProvider.tokens();t&&(e.Authorization=`Bearer ${t.access_token}`)}this._sessionId&&(e[`mcp-session-id`]=this._sessionId),this._protocolVersion&&(e[`mcp-protocol-version`]=this._protocolVersion);let t=Yd(this._requestInit?.headers);return new Headers({...e,...t})}async _startOrAuthSse(e){let{resumptionToken:t}=e;try{let n=await this._commonHeaders();n.set(`Accept`,`text/event-stream`),t&&n.set(`last-event-id`,t);let r=await(this._fetch??fetch)(this._url,{method:`GET`,headers:n,signal:this._abortController?.signal});if(!r.ok){if(await r.body?.cancel(),r.status===401&&this._authProvider)return await this._authThenStart();if(r.status===405)return;throw new bp(r.status,`Failed to open SSE stream: ${r.statusText}`)}this._handleSseStream(r.body,e,!0)}catch(e){throw 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.`));return}let r=this._getNextReconnectionDelay(t);this._reconnectionTimeout=setTimeout(()=>{this._startOrAuthSse(e).catch(n=>{this.onerror?.(Error(`Failed to reconnect SSE stream: ${n instanceof Error?n.message:String(n)}`)),this._scheduleReconnection(e,t+1)})},r)}_handleSseStream(e,t,n){if(!e)return;let{onresumptiontoken:r,replayMessageId:i}=t,a,o=!1,s=!1;(async()=>{try{let t=e.pipeThrough(new TextDecoderStream).pipeThrough(new vp({onRetry:e=>{this._serverRetryMs=e}})).getReader();for(;;){let{value:e,done:n}=await t.read();if(n)break;if(e.id&&(a=e.id,o=!0,r?.(e.id)),e.data&&(!e.event||e.event===`message`))try{let t=ls.parse(JSON.parse(e.data));os(t)&&(s=!0,i!==void 0&&(t.id=i)),this.onmessage?.(t)}catch(e){this.onerror?.(e)}}(n||o)&&!s&&this._abortController&&!this._abortController.signal.aborted&&this._scheduleReconnection({resumptionToken:a,onresumptiontoken:r,replayMessageId:i},0)}catch(e){if(this.onerror?.(Error(`SSE stream disconnected: ${e}`)),(n||o)&&!s&&this._abortController&&!this._abortController.signal.aborted)try{this._scheduleReconnection({resumptionToken:a,onresumptiontoken:r,replayMessageId:i},0)}catch(e){this.onerror?.(Error(`Failed to reconnect: ${e instanceof Error?e.message:String(e)}`))}}})()}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){if(!this._authProvider)throw new Nf(`No auth provider`);if(await Uf(this._authProvider,{serverUrl:this._url,authorizationCode:e,resourceMetadataUrl:this._resourceMetadataUrl,scope:this._scope,fetchFn:this._fetchWithInit})!==`AUTHORIZED`)throw new Nf(`Failed to authorize`)}async close(){this._reconnectionTimeout&&=(clearTimeout(this._reconnectionTimeout),void 0),this._abortController?.abort(),this.onclose?.()}async send(e,t){try{let{resumptionToken:n,onresumptiontoken:r}=t||{};if(n){this._startOrAuthSse({resumptionToken:n,replayMessageId:ns(e)?e.id:void 0}).catch(e=>this.onerror?.(e));return}let i=await this._commonHeaders();i.set(`content-type`,`application/json`),i.set(`accept`,`application/json, text/event-stream`);let a={...this._requestInit,method:`POST`,headers:i,body:JSON.stringify(e),signal:this._abortController?.signal},o=await(this._fetch??fetch)(this._url,a),s=o.headers.get(`mcp-session-id`);if(s&&(this._sessionId=s),!o.ok){let t=await o.text().catch(()=>null);if(o.status===401&&this._authProvider){if(this._hasCompletedAuthFlow)throw new bp(401,`Server returned 401 after successful authentication`);let{resourceMetadataUrl:t,scope:n}=qf(o);if(this._resourceMetadataUrl=t,this._scope=n,await Uf(this._authProvider,{serverUrl:this._url,resourceMetadataUrl:this._resourceMetadataUrl,scope:this._scope,fetchFn:this._fetchWithInit})!==`AUTHORIZED`)throw new Nf;return this._hasCompletedAuthFlow=!0,this.send(e)}if(o.status===403&&this._authProvider){let{resourceMetadataUrl:t,scope:n,error:r}=qf(o);if(r===`insufficient_scope`){let r=o.headers.get(`WWW-Authenticate`);if(this._lastUpscopingHeader===r)throw new bp(403,`Server returned 403 after trying upscoping`);if(n&&(this._scope=n),t&&(this._resourceMetadataUrl=t),this._lastUpscopingHeader=r??void 0,await Uf(this._authProvider,{serverUrl:this._url,resourceMetadataUrl:this._resourceMetadataUrl,scope:this._scope,fetchFn:this._fetch})!==`AUTHORIZED`)throw new Nf;return this.send(e)}}throw new bp(o.status,`Error POSTing to endpoint: ${t}`)}if(this._hasCompletedAuthFlow=!1,this._lastUpscopingHeader=void 0,o.status===202){await o.body?.cancel(),Ts(e)&&this._startOrAuthSse({resumptionToken:void 0}).catch(e=>this.onerror?.(e));return}let c=(Array.isArray(e)?e:[e]).filter(e=>`method`in e&&`id`in e&&e.id!==void 0).length>0,l=o.headers.get(`content-type`),u=Jd(l);if(c){if(u===`text/event-stream`)this._handleSseStream(o.body,{onresumptiontoken:r},!1);else if(u===`application/json`){let e=await o.json(),t=Array.isArray(e)?e.map(e=>ls.parse(e)):[ls.parse(e)];for(let e of t)this.onmessage?.(e)}else throw await o.body?.cancel(),new bp(-1,`Unexpected content type: ${l}`)}else await o.body?.cancel()}catch(e){throw 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._fetch??fetch)(this._url,t);if(await n.body?.cancel(),!n.ok&&n.status!==405)throw new bp(n.status,`Failed to terminate session: ${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})}},$=r(s(),1),Sp=e(),Cp=`text/html;profile=mcp-app`,wp=`io.modelcontextprotocol/ui`,Tp=3,Ep=5,Dp=2e3,Op={observability_overview:620,service_topology:760,service_performance:700,trace_detail:720,search_logs:720},kp=class extends Error{},Ap=null,jp=null;async function Mp(){let e=new xp(new URL(`/api/mcp`,location.origin),{fetch:(e,t)=>d(e,t)}),t=new Kd({name:`fanout-browser`,version:`0.2.0`},{capabilities:{extensions:{[wp]:{mimeTypes:[Cp]}}}});try{await t.connect(e);let n={client:t,references:0,closed:!1,closeListeners:new Set};return t.onclose=()=>Pp(n,!1),t.onerror=()=>Pp(n,!0),n}catch(t){throw await e.close().catch(()=>void 0),t}}async function Np(){for(let e=0;e{jp===e&&!t.closed&&(Ap=t)}).catch(()=>{jp===e&&(jp=null)})}let e=jp;if(!e)continue;let t=await e;if(t.closed){jp===e&&(jp=null);continue}return t.closeTimer&&=(clearTimeout(t.closeTimer),void 0),t.references+=1,t}throw Error(`MCP connection closed during setup`)}function Pp(e,t){if(!e.closed){e.closed=!0,e.closeTimer&&clearTimeout(e.closeTimer),e.closeTimer=void 0,Ap===e&&(Ap=null),jp=null;for(let t of[...e.closeListeners])t();t&&e.client.close().catch(()=>void 0)}}function Fp(e){e.references=Math.max(0,e.references-1),!(e.closed||e.references||e.closeTimer)&&(e.closeTimer=setTimeout(()=>{e.closeTimer=void 0,!(e.references||Ap!==e)&&(e.closed=!0,Ap=null,jp=null,e.client.close().catch(()=>void 0))},0))}function Ip(e){return typeof e==`object`&&e&&!Array.isArray(e)?e:void 0}function Lp(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 Rp(e){let t=Ip(Ip(Ip(e)?.ui)?.csp),n=Lp(t?.connectDomains,[`http`,`https`,`ws`,`wss`]),r=Lp(t?.resourceDomains,[`http`,`https`]),i=Lp(t?.frameDomains,[`http`,`https`]),a=Lp(t?.baseUriDomains,[`http`,`https`]),o=r.length?` ${r.join(` `)}`:``,s=[`default-src 'none'`,`script-src 'self' 'unsafe-inline'${o}`,`style-src 'self' 'unsafe-inline'${o}`,`img-src 'self' data:${o}`,`media-src 'self' data:${o}`,`connect-src ${n.length?n.join(` `):`'none'`}`];return r.length&&s.push(`font-src 'self' ${r.join(` `)}`),i.length&&s.push(`frame-src ${i.join(` `)}`),a.length&&s.push(`base-uri ${a.join(` `)}`),`${s.join(`; `)};`}function zp(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 Bp(e){return e.filter(e=>e.type===`text`).map(e=>String(e.text??``)).join(` -`)}function Vp({content:e,onMessage:t}){let n=(0,$.useRef)(null),r=(0,$.useRef)(null),i=(0,$.useRef)(null),a=(0,$.useRef)(null),[o,s]=(0,$.useState)(``),d=Op[e.toolName]??620,[h,g]=(0,$.useState)(d),[_,v]=(0,$.useState)(``),[y,b]=(0,$.useState)(0),x=(0,$.useRef)(0),S=m(`light`),C=(0,$.useRef)(S);C.current=S,(0,$.useEffect)(()=>{a.current?.setHostContext({theme:S,displayMode:`inline`})},[S]),(0,$.useEffect)(()=>{x.current=0},[e.resourceUri]),(0,$.useEffect)(()=>{let t=!1,n;s(``),v(``);let o=()=>{let e=x.current+1;if(e>Ep)return;x.current=e;let t=e===1?0:Math.min(750*2**(e-2),6e3);t===0?b(e=>e+1):n=setTimeout(()=>b(e=>e+1),t)},c=()=>o();async function l(){try{let n=await Np();if(t){Fp(n);return}i.current=n,n.closeListeners.add(c),r.current=n.client;let a=(await n.client.readResource({uri:e.resourceUri})).contents[0];if(!a||!(`text`in a)||!a.text)throw new kp(`MCP App resource has no HTML content`);if(a.uri!==e.resourceUri)throw new kp(`MCP App resource URI does not match the requested URI`);if(a.mimeType!==Cp)throw new kp(`MCP App resource has an unsupported MIME type`);t||(x.current=0,s(zp(a.text,a._meta)))}catch(e){console.error(`MCP app resource load failed`,e),t||(v(`This view could not be loaded. Please try again.`),x.current>0&&!(e instanceof kp)&&o())}}return l(),()=>{t=!0,n&&clearTimeout(n);let e=a.current?.teardownResource({}).catch(()=>void 0)??Promise.resolve(),o=i.current;o&&(o.closeListeners.delete(c),e.finally(()=>Fp(o))),a.current=null,r.current=null,i.current=null}},[e.resourceUri,y]);async function ee(){let i=n.current,s=r.current;if(!(!i?.contentWindow||!o||!s||a.current))try{let n=new au(null,{name:`Fanout`,version:`0.2.0`},{openLinks:{},serverTools:{},logging:{}},{hostContext:{theme:C.current,displayMode:`inline`}});n.oncalltool=(e,t)=>s.request({method:`tools/call`,params:e},Fc,{signal:t.signal}),a.current=n,n.onsizechange=({height:e})=>{e&&g(Math.min(Dp,Math.max(d,Math.ceil(e)+32)))},n.onmessage=async({content:e})=>{let n=Bp(e);return n?(await t(n),{}):{isError:!0}},n.oninitialized=async()=>{await n.sendToolInput({arguments:e.toolInput??{}}),await n.sendToolResult({content:[{type:`text`,text:JSON.stringify(e.toolResult??{})}],structuredContent:e.toolResult,isError:e.isError})},await n.connect(new ru(i.contentWindow,i.contentWindow))}catch(e){console.error(`MCP app bridge connect failed`,e),v(`This view could not be loaded. Please try again.`)}}return _?(0,Sp.jsx)(u,{color:`bad`,m:`md`,children:_}):o?(0,Sp.jsx)(p,{component:`iframe`,ref:n,title:`Fanout analysis view`,sandbox:`allow-scripts`,scrolling:`auto`,srcDoc:o,w:`100%`,bd:0,bg:`var(--mantine-color-body)`,style:{display:`block`,height:h,transition:`height 200ms ease`},onLoad:()=>void ee()}):(0,Sp.jsxs)(l,{mih:180,p:`xl`,children:[(0,Sp.jsx)(c,{size:`sm`}),(0,Sp.jsx)(f,{c:`dimmed`,size:`sm`,ml:`sm`,children:`Preparing view…`})]})}export{Vp as default,Rp as mcpAppCSP}; \ No newline at end of file diff --git a/internal/ui/dist/assets/routes-BQrzb4p9.js b/internal/ui/dist/assets/routes-UYU1YEPx.js similarity index 84% rename from internal/ui/dist/assets/routes-BQrzb4p9.js rename to internal/ui/dist/assets/routes-UYU1YEPx.js index 731b8c7d..aea1bb8e 100644 --- a/internal/ui/dist/assets/routes-BQrzb4p9.js +++ b/internal/ui/dist/assets/routes-UYU1YEPx.js @@ -1 +1 @@ -import{a as e,t}from"./useNavigate-BEpS2iE5.js";import{n}from"./auth-TmbGk91l.js";var r=e();function i(){let{agent_available:e}=n();if(!e)return(0,r.jsx)(t,{to:`/dashboards`,replace:!0});let i=localStorage.getItem(`fanout.thread-id`);return i?(localStorage.removeItem(`fanout.thread-id`),(0,r.jsx)(t,{to:`/chat/$threadId`,params:{threadId:i},replace:!0})):(0,r.jsx)(t,{to:`/chat`,replace:!0})}export{i as component}; \ No newline at end of file +import{a as e,t}from"./useNavigate-BEpS2iE5.js";import{n}from"./auth-DhIxmh_D.js";var r=e();function i(){let{agent_available:e}=n();if(!e)return(0,r.jsx)(t,{to:`/dashboards`,replace:!0});let i=localStorage.getItem(`fanout.thread-id`);return i?(localStorage.removeItem(`fanout.thread-id`),(0,r.jsx)(t,{to:`/chat/$threadId`,params:{threadId:i},replace:!0})):(0,r.jsx)(t,{to:`/chat`,replace:!0})}export{i as component}; \ No newline at end of file diff --git a/internal/ui/dist/index.html b/internal/ui/dist/index.html index 9b2a4c68..42606927 100644 --- a/internal/ui/dist/index.html +++ b/internal/ui/dist/index.html @@ -21,9 +21,9 @@ document.documentElement.setAttribute("data-mantine-color-scheme", computed); } catch (e) {} - + - + diff --git a/site/package-lock.json b/site/package-lock.json index c6b10d0f..81d40fb5 100644 --- a/site/package-lock.json +++ b/site/package-lock.json @@ -3905,9 +3905,9 @@ } }, "node_modules/fast-uri": { - "version": "3.1.5", - "resolved": "https://registry.npmjs.org/fast-uri/-/fast-uri-3.1.5.tgz", - "integrity": "sha512-gHwA1O9LDIcKunMKhObS/HimwtehO1nPUECKAu5TpKgaO19fcWEl4bliWe1jWxVFvIXztJjjQ4L8XQ1EU9f7Jw==", + "version": "3.1.7", + "resolved": "https://registry.npmjs.org/fast-uri/-/fast-uri-3.1.7.tgz", + "integrity": "sha512-dOvZVzjdZdz7phd9v6jCbwxrBW3fK6n8Rc0CtdmM4bumzMnxywBYhuph6J819RRw/ku+rLbelwfMunktuzVVHg==", "dev": true, "funding": [ { diff --git a/ui/apps/bun.lock b/ui/apps/bun.lock index 66ec1264..a79f46d0 100644 --- a/ui/apps/bun.lock +++ b/ui/apps/bun.lock @@ -1,35 +1,35 @@ { - "lockfileVersion": 1, + "lockfileVersion": 2, "configVersion": 1, "workspaces": { "": { "name": "@fanout/ui-apps", "dependencies": { - "@fontsource/ibm-plex-mono": "latest", - "@fontsource/ibm-plex-sans": "latest", - "@mantine/core": "latest", - "@mantine/hooks": "latest", - "@modelcontextprotocol/ext-apps": "latest", - "@modelcontextprotocol/sdk": "latest", - "@phosphor-icons/react": "latest", - "echarts": "latest", - "react": "latest", - "react-dom": "latest", + "@fontsource/ibm-plex-mono": "^5.3.0", + "@fontsource/ibm-plex-sans": "^5.3.0", + "@mantine/core": "9.5.2", + "@mantine/hooks": "9.5.2", + "@modelcontextprotocol/ext-apps": "1.7.5", + "@modelcontextprotocol/sdk": "1.30.0", + "@phosphor-icons/react": "2.1.10", + "echarts": "6.1.0", + "react": "19.2.8", + "react-dom": "19.2.8", }, "devDependencies": { - "@types/react": "latest", - "@types/react-dom": "latest", - "@vitejs/plugin-react": "latest", - "cross-env": "latest", - "typescript": "latest", - "vite": "latest", - "vite-plugin-singlefile": "latest", + "@types/react": "19.2.18", + "@types/react-dom": "19.2.5", + "@vitejs/plugin-react": "6.1.0", + "cross-env": "10.1.0", + "typescript": "7.0.2", + "vite": "8.2.2", + "vite-plugin-singlefile": "2.3.3", }, }, }, "overrides": { "@hono/node-server": "1.19.15", - "fast-uri": "3.1.5", + "fast-uri": "3.1.7", "hono": "4.12.34", "ip-address": "10.5.0", "nanoid": "3.3.18", @@ -61,39 +61,39 @@ "@modelcontextprotocol/sdk": ["@modelcontextprotocol/sdk@1.30.0", "", { "dependencies": { "@hono/node-server": "^1.19.9 || ^2.0.5", "ajv": "^8.17.1", "ajv-formats": "^3.0.1", "content-type": "^1.0.5", "cors": "^2.8.5", "cross-spawn": "^7.0.5", "eventsource": "^3.0.2", "eventsource-parser": "^3.0.0", "express": "^5.2.1", "express-rate-limit": "^8.2.1", "hono": "^4.11.4", "jose": "^6.1.3", "json-schema-typed": "^8.0.2", "pkce-challenge": "^5.0.0", "raw-body": "^3.0.0", "zod": "^3.25 || ^4.0", "zod-to-json-schema": "^3.25.1" }, "peerDependencies": { "@cfworker/json-schema": "^4.1.1" }, "optionalPeers": ["@cfworker/json-schema"] }, "sha512-xKd8OIzlqNzcqcNumGAa6g+PW2kjD5vrpcKOnfldAUPP3j7lnqMPwlTXQm8gF+UwH72z0lqaRbjr9hqGz0eITA=="], - "@oxc-project/types": ["@oxc-project/types@0.146.0", "", {}, "sha512-XC0QsnnhVe7sLIWmYmdPw7x5P0h4W8vUU3Nv1ySgWXtvCz8NizoAEpGXA0sOYoJQV2Rl13LgURAHQ5cI5ILCSA=="], + "@oxc-project/types": ["@oxc-project/types@0.148.0", "", {}, "sha512-Nm4s/jB+4FpFsPhWGEC4h7rzksesmtnMXomo6rCMcg/b8zLQuOziRgkCS1fxDCXOlJB/6Q8oABOZ/OP6RIPj9A=="], "@phosphor-icons/react": ["@phosphor-icons/react@2.1.10", "", { "peerDependencies": { "react": ">= 16.8", "react-dom": ">= 16.8" } }, "sha512-vt8Tvq8GLjheAZZYa+YG/pW7HDbov8El/MANW8pOAz4eGxrwhnbfrQZq0Cp4q8zBEu8NIhHdnr+r8thnfRSNYA=="], - "@rolldown/binding-android-arm-eabi": ["@rolldown/binding-android-arm-eabi@1.2.5", "", { "os": "android", "cpu": "arm" }, "sha512-DLe/i+l8ynIBY7XEQ191TeZvCoowIGa18R+dIV30GW7DiOtp74i/xX8hs8GUjW5ARV7VZuie3d6AumSmCwbeRA=="], + "@rolldown/binding-android-arm-eabi": ["@rolldown/binding-android-arm-eabi@1.2.7", "", { "os": "android", "cpu": "arm" }, "sha512-EypzgnYCwyVY4NDHKzGmNJT5b+XaQEBniHxsMdeIQLB/tcCzZnhqrzHpZFbX9iaxx+5RiB8caATBtfvZP7zVxQ=="], - "@rolldown/binding-android-arm64": ["@rolldown/binding-android-arm64@1.2.5", "", { "os": "android", "cpu": "arm64" }, "sha512-zXcwKlQApYAOELHd8PwKDFkagYF9Wy4e0RJ+0qnzl9Pjnpj75TEG8ufv40p2J7kCEfwZAsNiuzRIyNNMWT38ig=="], + "@rolldown/binding-android-arm64": ["@rolldown/binding-android-arm64@1.2.7", "", { "os": "android", "cpu": "arm64" }, "sha512-l17HE9EweWaqJZhuUuNBN/FzM62xw+DECVnJyvMsxn8vJFAGLy5QfLDoYAcronkAN8VxKZHezDpulHDPx95vFw=="], - "@rolldown/binding-darwin-arm64": ["@rolldown/binding-darwin-arm64@1.2.5", "", { "os": "darwin", "cpu": "arm64" }, "sha512-dK4QakI42nzWgJT5sm4y4y/O//D4OxM75/cH28RLV+nzIN9AY+YsbuUVrUTjlLjXR6vpyxFbSsbmNuJ6BP9sww=="], + "@rolldown/binding-darwin-arm64": ["@rolldown/binding-darwin-arm64@1.2.7", "", { "os": "darwin", "cpu": "arm64" }, "sha512-8ED8ELFvHXc6OCETIn4gXObPiaR6bckM/ipXtbzlPVDRMBfEGjCKgO90F9YtfdpDatVx/ZQw7aZ1vUMf/+T3Mw=="], - "@rolldown/binding-darwin-x64": ["@rolldown/binding-darwin-x64@1.2.5", "", { "os": "darwin", "cpu": "x64" }, "sha512-fqSALaUu1Wjd1nK2uW2kJDWdLCc8lx1IcY+MTY26Aurfdx19anlzhqXOgCFbBFQnlFDTn4TC1/7Nz4Bl2mLP3A=="], + "@rolldown/binding-darwin-x64": ["@rolldown/binding-darwin-x64@1.2.7", "", { "os": "darwin", "cpu": "x64" }, "sha512-/WPripjtiAIZ2tWY7ddijORT0Ujg87wxWW/qcoFVCKAWVDPhtY0xr7Dj0M3GyNGz60jGwTElhro/mkF9dT7dDQ=="], - "@rolldown/binding-freebsd-x64": ["@rolldown/binding-freebsd-x64@1.2.5", "", { "os": "freebsd", "cpu": "x64" }, "sha512-/vCnNxlkxs9tKxNDcyWUePpJ/PgTzxIaVhoM5SmG8UV+GR/IcPam4VYxi7GIMo7PSDuNqlJqvprqii9NqqVCMw=="], + "@rolldown/binding-freebsd-x64": ["@rolldown/binding-freebsd-x64@1.2.7", "", { "os": "freebsd", "cpu": "x64" }, "sha512-14DI4NcqpvbICxSnGLx3PmtDaWqRP/KGSGb6C+JLLVPeZRl6dKdHba3pGsqT3vpdTqhEYIPG0MMQ8c0xYqoJxA=="], - "@rolldown/binding-linux-arm-gnueabihf": ["@rolldown/binding-linux-arm-gnueabihf@1.2.5", "", { "os": "linux", "cpu": "arm" }, "sha512-abk0NLA519LxRCszmbE0jYKuQ9YPocOXTiOXOo6Yr+YAT95VH+PtqYAjOJvGKt3viEd/x4qzabAlwd5bHOOARg=="], + "@rolldown/binding-linux-arm-gnueabihf": ["@rolldown/binding-linux-arm-gnueabihf@1.2.7", "", { "os": "linux", "cpu": "arm" }, "sha512-bxrWIRvHWQvbJwi+VIie/kDJmQxcNE6xxWwZdqF/ExVAigtHkv54WTLQPb+QsZdnFy18fg7JPfWGL0RH6vwIlQ=="], - "@rolldown/binding-linux-arm64-gnu": ["@rolldown/binding-linux-arm64-gnu@1.2.5", "", { "os": "linux", "cpu": "arm64" }, "sha512-Y7eALiJ8lr0M2HH103Js+g7V34wf6snlpZLAsHI90uLhr3PVlNsbFVAXJC9d/V6BnPyKtpSwI+NcB/RLxsQxuA=="], + "@rolldown/binding-linux-arm64-gnu": ["@rolldown/binding-linux-arm64-gnu@1.2.7", "", { "os": "linux", "cpu": "arm64" }, "sha512-toOY2BChBZyuxU7OYX6Tn389di4IzAqPTycVcci0O7FSfBqzRB3RZn+K5Is6ANf4tmgRd/K1yZTsNTXbkXsnLg=="], - "@rolldown/binding-linux-arm64-musl": ["@rolldown/binding-linux-arm64-musl@1.2.5", "", { "os": "linux", "cpu": "arm64" }, "sha512-xMvZgnbZg4YVnR/AX2b3oOPDTFYJvUVaJg5FedA/LuvexAtXibZQej4cnTkw3rjsJ/ggUROB64TdtETiim+FYA=="], + "@rolldown/binding-linux-arm64-musl": ["@rolldown/binding-linux-arm64-musl@1.2.7", "", { "os": "linux", "cpu": "arm64" }, "sha512-lAIXTH/aiLRLxsTgQvfhjo4K1ydWIp00+V0voOr9beb/9ZmkUFrSIb03dXNFRgMNvkE6oGsF10ioQ6UsI+vS5Q=="], - "@rolldown/binding-linux-ppc64-gnu": ["@rolldown/binding-linux-ppc64-gnu@1.2.5", "", { "os": "linux", "cpu": "ppc64" }, "sha512-GRjeqTUDHTo5GwntsLaAMcBahG3nlpjftXWZLN73HiYQlhwEowvarFgQnRnQZtIp4keXX7quXFbG38uPZBa2EA=="], + "@rolldown/binding-linux-ppc64-gnu": ["@rolldown/binding-linux-ppc64-gnu@1.2.7", "", { "os": "linux", "cpu": "ppc64" }, "sha512-kdnwS28Pkenp/mZMRwjXXXwxQ7pIsm+bF919LUK93BOyhcLsrVKdP2p9fxpiPNPAbNuch8ypQt0pm2P2LYCAGg=="], - "@rolldown/binding-linux-s390x-gnu": ["@rolldown/binding-linux-s390x-gnu@1.2.5", "", { "os": "linux", "cpu": "s390x" }, "sha512-vLNTR45F2Uwc8AufkNXPmB4VliaXs+FvcheEogIzOXzO4l+LzieXF5A/TWxLy5HtqpsRCHUfd0lPVrrdgXdLHQ=="], + "@rolldown/binding-linux-s390x-gnu": ["@rolldown/binding-linux-s390x-gnu@1.2.7", "", { "os": "linux", "cpu": "s390x" }, "sha512-516OdsyLdr5E65paF3yBF55t8mfm9+gmtCsK3xI7XKXIT7EfRlHhxL8K/NR6Hu8BWSgF5+1w74lTL0+nxcc8Qw=="], - "@rolldown/binding-linux-x64-gnu": ["@rolldown/binding-linux-x64-gnu@1.2.5", "", { "os": "linux", "cpu": "x64" }, "sha512-Mgj59/HTuYeK9Gz2MA+mBWKnHsAgkBSec15ZMb1st3oIfFbX7gCjOae7GydHhzcyQi9Z/7M1QuN9bR3oFqF0jQ=="], + "@rolldown/binding-linux-x64-gnu": ["@rolldown/binding-linux-x64-gnu@1.2.7", "", { "os": "linux", "cpu": "x64" }, "sha512-r8/z8n7GFaYRln3xmP1Cxy0HH/HLM0uBUPkEuSVEfKGDA89M0FsZRZJRSwe/tJjRx+fpH/gjorfhB8tmEbSFLA=="], - "@rolldown/binding-linux-x64-musl": ["@rolldown/binding-linux-x64-musl@1.2.5", "", { "os": "linux", "cpu": "x64" }, "sha512-mY8AP0/ichsbhAxGnLa3d3+MwV0EfgrPND2bplI3Ym8T6R2pJ0N87bvrKVwNXmdy3jnr6eQBecdqx/HMknBmpA=="], + "@rolldown/binding-linux-x64-musl": ["@rolldown/binding-linux-x64-musl@1.2.7", "", { "os": "linux", "cpu": "x64" }, "sha512-pAsE8iiDxUg1xBqdhrTfg45AVDVpirjz00sblEYClGNNcMnDb+e8beQgqIAw6LvauX/APvgxUnwrgun/YYGBhw=="], - "@rolldown/binding-openharmony-arm64": ["@rolldown/binding-openharmony-arm64@1.2.5", "", { "os": "none", "cpu": "arm64" }, "sha512-8SLssA2oweAxyRgDp789ACfRb/3P+zNRJpzZxSizxF9m8NUDQ4+3xjo8ttjhVGGw6Qxb70oZiEtIjaKikCO7Yw=="], + "@rolldown/binding-openharmony-arm64": ["@rolldown/binding-openharmony-arm64@1.2.7", "", { "os": "none", "cpu": "arm64" }, "sha512-lTcIYmmnQQA8Or/2DatS6oSqcdLHvendjS+zLu+FwgToynWMRSmQdpM65fTANJgIS4mjbMOo5KT2lnT9SAb96w=="], - "@rolldown/binding-win32-arm64-msvc": ["@rolldown/binding-win32-arm64-msvc@1.2.5", "", { "os": "win32", "cpu": "arm64" }, "sha512-vGbruD5zquhoc8D9SViXgN2FBJtNdTyQ4DtG+SWiEGlJiAzoKcZ2xp+xuXCffhubVdt0NJlTZqkeRuERy7g8Cw=="], + "@rolldown/binding-win32-arm64-msvc": ["@rolldown/binding-win32-arm64-msvc@1.2.7", "", { "os": "win32", "cpu": "arm64" }, "sha512-e3Gu3WxbNk/UqQhxqU7YIYO+9ZBvWNz3U+h/qRFosscMFzdRPbXYSaSWgSnklv2fz1TgzBTcti2z35c/7irsHw=="], - "@rolldown/binding-win32-x64-msvc": ["@rolldown/binding-win32-x64-msvc@1.2.5", "", { "os": "win32", "cpu": "x64" }, "sha512-e/SXpgISz+IoqVcSSI0rx/d/he8zqLex+/rCWpnHpmVfmPIUjag9H6P7zotf0gJHwPUhQxZ/mF8tr6acebT9yw=="], + "@rolldown/binding-win32-x64-msvc": ["@rolldown/binding-win32-x64-msvc@1.2.7", "", { "os": "win32", "cpu": "x64" }, "sha512-W/jg5qoRSqjsEv0+dZi4e687mcHqmVuU0P4fK6qS/xjetW2Gmc1W8j//z5nAeNcC8Ttm0hV46IjcYeuVwYhuiw=="], "@rolldown/pluginutils": ["@rolldown/pluginutils@1.0.1", "", {}, "sha512-2j9bGt5Jh8hj+vPtgzPtl72j0yRxHAyumoo6TNfAjsLB04UtpSvPbPcDcBMxz7n+9CYB0c1GxQFxYRg2jimqGw=="], @@ -207,15 +207,15 @@ "eventsource": ["eventsource@3.0.7", "", { "dependencies": { "eventsource-parser": "^3.0.1" } }, "sha512-CRT1WTyuQoD771GW56XEZFQ/ZoSfWid1alKGDYMmkt2yl8UXrVR4pspqWNEcqKvVIzg6PAltWjxcSSPrboA4iA=="], - "eventsource-parser": ["eventsource-parser@3.1.0", "", {}, "sha512-kJezFj9YFAMLeORyi7aCLxLbD5/qWMQnoMVlVPyHIll7lgRJCc3JVln9Vgl9nwQi0YkMnhdGTMNn7CkRRAptMg=="], + "eventsource-parser": ["eventsource-parser@3.1.1", "", {}, "sha512-EKN1vKAMcZ8MlYMpaNuxN6R9yakzH6uajHcHVTqWJzvu5pWw9DyhbP35HH8MVBQ+dZjAfDxk+A8NiR9KWaXiyQ=="], "express": ["express@5.2.1", "", { "dependencies": { "accepts": "^2.0.0", "body-parser": "^2.2.1", "content-disposition": "^1.0.0", "content-type": "^1.0.5", "cookie": "^0.7.1", "cookie-signature": "^1.2.1", "debug": "^4.4.0", "depd": "^2.0.0", "encodeurl": "^2.0.0", "escape-html": "^1.0.3", "etag": "^1.8.1", "finalhandler": "^2.1.0", "fresh": "^2.0.0", "http-errors": "^2.0.0", "merge-descriptors": "^2.0.0", "mime-types": "^3.0.0", "on-finished": "^2.4.1", "once": "^1.4.0", "parseurl": "^1.3.3", "proxy-addr": "^2.0.7", "qs": "^6.14.0", "range-parser": "^1.2.1", "router": "^2.2.0", "send": "^1.1.0", "serve-static": "^2.2.0", "statuses": "^2.0.1", "type-is": "^2.0.1", "vary": "^1.1.2" } }, "sha512-hIS4idWWai69NezIdRt2xFVofaF4j+6INOpJlVOLDO8zXGpUVEVzIYk12UUi2JzjEzWL3IOAxcTubgz9Po0yXw=="], - "express-rate-limit": ["express-rate-limit@8.6.0", "", { "dependencies": { "debug": "^4.4.3", "ip-address": "^10.2.0" }, "peerDependencies": { "express": ">= 4.11" } }, "sha512-XKJXDsASUOo0LLtFwW5hCcQGH0N4WQc/Rn8/Pvoia+TJFOkkFPvrtW9lZOeeNcxQJspvOIERMwiRLsVFlhHEkA=="], + "express-rate-limit": ["express-rate-limit@8.7.0", "", { "dependencies": { "debug": "^4.4.3", "ip-address": "^10.2.0" }, "peerDependencies": { "express": ">= 4.11" } }, "sha512-hOwV7WOxXfjRpAM1DSJWZDXx3GhplwD8IfwuwvogD8i1Qnkgosw/H45s4ZnFAUHDAhPjlY9hLBvJhKmGMyY26g=="], "fast-deep-equal": ["fast-deep-equal@3.1.3", "", {}, "sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q=="], - "fast-uri": ["fast-uri@3.1.5", "", {}, "sha512-gHwA1O9LDIcKunMKhObS/HimwtehO1nPUECKAu5TpKgaO19fcWEl4bliWe1jWxVFvIXztJjjQ4L8XQ1EU9f7Jw=="], + "fast-uri": ["fast-uri@3.1.7", "", {}, "sha512-dOvZVzjdZdz7phd9v6jCbwxrBW3fK6n8Rc0CtdmM4bumzMnxywBYhuph6J819RRw/ku+rLbelwfMunktuzVVHg=="], "fdir": ["fdir@6.5.0", "", { "peerDependencies": { "picomatch": "^3 || ^4" }, "optionalPeers": ["picomatch"] }, "sha512-tIbYtZbucOs0BRGqPJkshJUYdL+SDH7dVM8gjy+ERp3WAUjLEFJE+02kanyHtwjWOnwrKYBiwAmM0p4kLJAnXg=="], @@ -261,7 +261,7 @@ "isexe": ["isexe@2.0.0", "", {}, "sha512-RHxMLp9lnKHGHRng9QFhRCMbYAcVpn69smSGcq3f36xjgVVWThj4qqLbTLlq7Ssj8B+fIQ1EuCEGI2lKsyQeIw=="], - "jose": ["jose@6.2.3", "", {}, "sha512-YYVDInQKFJfR/xa3ojUTl8c2KoTwiL1R5Wg9YCydwH0x0B9grbzlg5HC7mMjCtUJjbQ/YnGEZIhI5tCgfTb4Hw=="], + "jose": ["jose@6.2.10", "", {}, "sha512-iiW7J9qRFlGxvCOIBDBDxFePQSn7ZMAnrYGhrrOo6siO/MIqwfyilLR27pkfDgUk+raLuzADS8A3S/KLBisc0g=="], "json-schema-traverse": ["json-schema-traverse@1.0.0", "", {}, "sha512-NM8/P9n3XjXhIZn1lLhkFaACTOURQXjWhV4BA/RnOv8xvgqtqpAX9IO4mRQxSx1Rlo4tqzeqb0sOlruaOy3dug=="], @@ -293,7 +293,7 @@ "math-intrinsics": ["math-intrinsics@1.1.0", "", {}, "sha512-/IXtbwEk5HTPyEwyKX6hGkYXxM9nbj64B+ilVJnC/R6B0pH5G4V3b0pVbL7DBj4tkhBAppbQUlf6F6Xl9LHu1g=="], - "media-typer": ["media-typer@1.1.0", "", {}, "sha512-aisnrDP4GNe06UcKFnV5bfMNPBUw4jsLGaWwWfnH3v02GnBuXX2MCVn5RbrWo0j3pczUilYblq7fQ7Nw2t5XKw=="], + "media-typer": ["media-typer@1.1.1", "", {}, "sha512-yz3xRaG20c6/BOzvYoDaGtPmGscs7YivItZEEqe6GbwNfHuxu9YNmvnEkMzKldAGY4/80pRcQRZSEnhquk9XuQ=="], "merge-descriptors": ["merge-descriptors@2.0.0", "", {}, "sha512-Snk314V5ayFLhp3fkUREub6WtjBfPdCPY1Ln8/8munuLuiYhsABgBVWsozAG+MWMbVEvcdcpbi9R7ww22l9Q3g=="], @@ -307,7 +307,7 @@ "nanoid": ["nanoid@3.3.18", "", { "bin": { "nanoid": "bin/nanoid.cjs" } }, "sha512-DTg4MJbGMWkfi6VZFdNt2/caMbQy4Ou+Op/hJQvGEWcnVfoA1QA+xzRKAzw9jD6+GVOOeYr/mIcuDSdug6F6+w=="], - "negotiator": ["negotiator@1.0.0", "", {}, "sha512-8Ofs/AUQh8MaEcrlq5xOX0CQ9ypTF5dl78mjlMNfOK08fzpgTHQRQPBxcPlEtIw0yRpws+Zo/3r+5WRby7u3Gg=="], + "negotiator": ["negotiator@1.1.0", "", { "dependencies": { "content-type": "^2.1.0" } }, "sha512-NMPBRMJgiQHjbd8phG3Vebdx4kZ1H121rbl5IkMqeOsahptB9BKo/d7oJ3zTXqTgagn2bWlNSXkh0QUGM31RYg=="], "object-assign": ["object-assign@4.1.1", "", {}, "sha512-rJgTQnkUnH1sFw8yT6VSU3zD3sWmu6sZhIseY8VX+GRu3P6F7Fu+JNDoXfklElbLJSnc3FUQHVe4cU5hj+BcUg=="], @@ -325,15 +325,15 @@ "picocolors": ["picocolors@1.1.1", "", {}, "sha512-xceH2snhtb5M9liqDsmEw56le376mTZkEX/jEb/RxNFyegNul7eNslCXP9FDj/Lcu0X8KEyMceP2ntpaHrDEVA=="], - "picomatch": ["picomatch@4.0.5", "", {}, "sha512-RvwwcruNjI1ncT5xRakeyS9Lf8lcItv34KD+aif+VH9kduAyfYBipGh12274xtenIPZ119/R9BdTBa8gAwSh0A=="], + "picomatch": ["picomatch@4.0.7", "", {}, "sha512-qcJu88Q2IWqJsDD529JKMdwGm/dvInW4HvQnRwiH9JtihJvzGOscDtHE3x1pBKeUOTysQ8kVmLnJ2kJu7yhcGA=="], "pkce-challenge": ["pkce-challenge@5.0.1", "", {}, "sha512-wQ0b/W4Fr01qtpHlqSqspcj3EhBvimsdh0KlHhH8HRZnMsEa0ea2fTULOXOS9ccQr3om+GcGRk4e+isrZWV8qQ=="], - "postcss": ["postcss@8.5.26", "", { "dependencies": { "nanoid": "^3.3.17", "picocolors": "^1.1.1", "source-map-js": "^1.2.1" } }, "sha512-u82N74LFzG8ca+dD8puPnplTXoGH4fTPpVGuIbt36G3qvNlkvfD0lEAZSxaly3KX8TS/L1A1gsCEmvKmBcVbkQ=="], + "postcss": ["postcss@8.5.27", "", { "dependencies": { "nanoid": "^3.3.18", "picocolors": "^1.1.1", "source-map-js": "^1.2.1" } }, "sha512-79Iho8QeYyooJ8e9lCRyTVlyTAkS/kXBYKff6TMzS3kEWGQ8Ds5UEtXpGrSUDLUWok6QTvxeYy0GO8fopHnaSA=="], "proxy-addr": ["proxy-addr@2.0.7", "", { "dependencies": { "forwarded": "0.2.0", "ipaddr.js": "1.9.1" } }, "sha512-llQsMLSUDUPT44jdrU/O37qlnifitDP+ZwrmmZcoSKyLKvtZxpyV0n2/bD/N4tBAAZ/gJEdZU7KMraoK1+XYAg=="], - "qs": ["qs@6.15.3", "", { "dependencies": { "es-define-property": "^1.0.1", "side-channel": "^1.1.1" } }, "sha512-O9gl3zCl5h5blw1KGUzQKhA5oUXSl8rwUIM5o0S3nCXMliSvy5Dzx7/DJcI+SwgICv+IneSZwhBh1oSyEHA71A=="], + "qs": ["qs@6.16.0", "", { "dependencies": { "es-define-property": "^1.0.1", "side-channel": "^1.1.1" } }, "sha512-h6fhOIaRrID2CbEY2fqs+7t+UXZo+MLAnU5gRIq85uFtdiUPCdsApMlHhXogKVM4HM2DVbIjGNTTYH2OcmP1vA=="], "range-parser": ["range-parser@1.3.0", "", {}, "sha512-hek2mFQpPuI4E1BBKrSto+BU3e3x4xuarsbiwr3+lf7p44juvFMV0XFWQAP3xUyqXA4RrXLIoaSUGbSt056ZMw=="], @@ -353,7 +353,7 @@ "require-from-string": ["require-from-string@2.0.2", "", {}, "sha512-Xf0nWe6RseziFMu+Ap9biiUbmplq6S9/p+7w7YXP/JBHhrUDDUhwa+vANyubuqfZWTveU//DYVGsDG7RKL/vEw=="], - "rolldown": ["rolldown@1.2.5", "", { "dependencies": { "@oxc-project/types": "=0.146.0", "@rolldown/pluginutils": "^1.0.0" }, "optionalDependencies": { "@rolldown/binding-android-arm-eabi": "1.2.5", "@rolldown/binding-android-arm64": "1.2.5", "@rolldown/binding-darwin-arm64": "1.2.5", "@rolldown/binding-darwin-x64": "1.2.5", "@rolldown/binding-freebsd-x64": "1.2.5", "@rolldown/binding-linux-arm-gnueabihf": "1.2.5", "@rolldown/binding-linux-arm64-gnu": "1.2.5", "@rolldown/binding-linux-arm64-musl": "1.2.5", "@rolldown/binding-linux-ppc64-gnu": "1.2.5", "@rolldown/binding-linux-s390x-gnu": "1.2.5", "@rolldown/binding-linux-x64-gnu": "1.2.5", "@rolldown/binding-linux-x64-musl": "1.2.5", "@rolldown/binding-openharmony-arm64": "1.2.5", "@rolldown/binding-win32-arm64-msvc": "1.2.5", "@rolldown/binding-win32-x64-msvc": "1.2.5" }, "bin": { "rolldown": "./bin/cli.mjs" } }, "sha512-VD2IE5PUG4Oj8zz2VGykiYd5wbnjdIiSsNQb8Qu5B+noEp+A78mu2iVvpp27g8es14Tk9rofNs5Tku9iQCS4fA=="], + "rolldown": ["rolldown@1.2.7", "", { "dependencies": { "@oxc-project/types": "=0.148.0", "@rolldown/pluginutils": "^1.0.0" }, "optionalDependencies": { "@rolldown/binding-android-arm-eabi": "1.2.7", "@rolldown/binding-android-arm64": "1.2.7", "@rolldown/binding-darwin-arm64": "1.2.7", "@rolldown/binding-darwin-x64": "1.2.7", "@rolldown/binding-freebsd-x64": "1.2.7", "@rolldown/binding-linux-arm-gnueabihf": "1.2.7", "@rolldown/binding-linux-arm64-gnu": "1.2.7", "@rolldown/binding-linux-arm64-musl": "1.2.7", "@rolldown/binding-linux-ppc64-gnu": "1.2.7", "@rolldown/binding-linux-s390x-gnu": "1.2.7", "@rolldown/binding-linux-x64-gnu": "1.2.7", "@rolldown/binding-linux-x64-musl": "1.2.7", "@rolldown/binding-openharmony-arm64": "1.2.7", "@rolldown/binding-win32-arm64-msvc": "1.2.7", "@rolldown/binding-win32-x64-msvc": "1.2.7" }, "bin": { "rolldown": "./bin/cli.mjs" } }, "sha512-g0EtLvBjTUB7jhyV0S/TCup3v/XSVl45vUIGbOGU4QPiyjTenCe4mKuFvW9fEgYmS2Fo42AUssRmNuMziXdrig=="], "router": ["router@2.2.0", "", { "dependencies": { "debug": "^4.4.0", "depd": "^2.0.0", "is-promise": "^4.0.0", "parseurl": "^1.3.3", "path-to-regexp": "^8.0.0" } }, "sha512-nLTrUKm2UyiL7rlhapu/Zl45FwNgkZGaCpZbIHajDYgwlJCOzLSk+cIPAnsEqV955GjILJnKbdQC1nVPz+gAYQ=="], @@ -395,7 +395,7 @@ "tslib": ["tslib@2.3.0", "", {}, "sha512-N82ooyxVNm6h1riLCoyS9e3fuJ3AMG2zIZs2Gd1ATcSFjSA23Q0fzjjZeh0jbJvWVDZ0cJT8yaNNaaXHzueNjg=="], - "type-fest": ["type-fest@5.8.0", "", { "dependencies": { "tagged-tag": "^1.0.0" } }, "sha512-YGYEVz3Fm5iy/AybuA0oyNFq7H4CgQNfRp/qfe8nurE1kuCeNm3/vfm9X4Mtl+qLyaKJUh5xrFZwogr41SMjYA=="], + "type-fest": ["type-fest@5.9.0", "", { "dependencies": { "tagged-tag": "^1.0.0" } }, "sha512-yANm3Jr3GiJ1qgJlxGAVxTOIcEOk1rhQHamlXtnrCK7EHP4HeM9OGxtMg/W7HFdrVzw/ZWJKGVIJusVH85sLtw=="], "type-is": ["type-is@2.1.0", "", { "dependencies": { "content-type": "^2.0.0", "media-typer": "^1.1.0", "mime-types": "^3.0.0" } }, "sha512-faYHw0anBbc/kWF3zFTEnxSFOAGUX9GFbOBthvDdLsIlEoWOFOtS0zgCiQYwIskL9iGXZL3kAXD8OoZ4GmMATA=="], @@ -417,26 +417,18 @@ "wrappy": ["wrappy@1.0.2", "", {}, "sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ=="], - "zod": ["zod@4.4.3", "", {}, "sha512-ytENFjIJFl2UwYglde2jchW2Hwm4GJFLDiSXWdTrJQBIN9Fcyp7n4DhxJEiWNAJMV1/BqWfW/kkg71UDcHJyTQ=="], + "zod": ["zod@4.5.4", "", {}, "sha512-sC95tT5iHHH9gtpj6A81kh+NEaRAUFN+qlUPDUbRfOMvNf5QCBqsb3WgvnpVtK5Y+4UfA6KqufotuTvMGiTlsA=="], "zod-to-json-schema": ["zod-to-json-schema@3.25.2", "", { "peerDependencies": { "zod": "^3.25.28 || ^4" } }, "sha512-O/PgfnpT1xKSDeQYSCfRI5Gy3hPf91mKVDuYLUHZJMiDFptvP41MSnWofm8dnCm0256ZNfZIM7DSzuSMAFnjHA=="], "zrender": ["zrender@6.1.0", "", { "dependencies": { "tslib": "2.3.0" } }, "sha512-oEGMDB6pOP2S6OwRR4PdVv610zrjnA3Bh+JnSG12fYJlBKjtNAoEb5fSUoCOOINlH96I2fU38/A2UpRKs67xYQ=="], - "body-parser/content-type": ["content-type@2.0.0", "", {}, "sha512-j/O/d7GcZCyNl7/hwZAb606rzqkyvaDctLmckbxLzHvFBzTJHuGEdodATcP3yIRoDrLHkIATJuvzbFlp/ki2cQ=="], + "body-parser/content-type": ["content-type@2.1.0", "", {}, "sha512-mj7UPXE0jaqaOsukNZRUEfEi2AcL7C/vwmwcHV0O97eO1E1pxBZuyjlZrx5seTaNBg1U6+o35wpa35Qfcc+7ag=="], "micromatch/picomatch": ["picomatch@2.3.2", "", {}, "sha512-V7+vQEJ06Z+c5tSye8S+nHUfI51xoXIXjHQ99cQtKUkQqqO1kO/KCJUfZXuB47h/YBlDhah2H3hdUGXn8ie0oA=="], - "react-remove-scroll/tslib": ["tslib@2.8.1", "", {}, "sha512-oJFu94HQb+KVduSUQL7wnpmqnfmLsOA/nAh6b6EH0wCEoK0/mPeXU6c3wKDV83MkOuHPRHtSXKKU99IBazS/2w=="], + "negotiator/content-type": ["content-type@2.1.0", "", {}, "sha512-mj7UPXE0jaqaOsukNZRUEfEi2AcL7C/vwmwcHV0O97eO1E1pxBZuyjlZrx5seTaNBg1U6+o35wpa35Qfcc+7ag=="], - "react-remove-scroll-bar/tslib": ["tslib@2.8.1", "", {}, "sha512-oJFu94HQb+KVduSUQL7wnpmqnfmLsOA/nAh6b6EH0wCEoK0/mPeXU6c3wKDV83MkOuHPRHtSXKKU99IBazS/2w=="], - - "react-style-singleton/tslib": ["tslib@2.8.1", "", {}, "sha512-oJFu94HQb+KVduSUQL7wnpmqnfmLsOA/nAh6b6EH0wCEoK0/mPeXU6c3wKDV83MkOuHPRHtSXKKU99IBazS/2w=="], - - "type-is/content-type": ["content-type@2.0.0", "", {}, "sha512-j/O/d7GcZCyNl7/hwZAb606rzqkyvaDctLmckbxLzHvFBzTJHuGEdodATcP3yIRoDrLHkIATJuvzbFlp/ki2cQ=="], - - "use-callback-ref/tslib": ["tslib@2.8.1", "", {}, "sha512-oJFu94HQb+KVduSUQL7wnpmqnfmLsOA/nAh6b6EH0wCEoK0/mPeXU6c3wKDV83MkOuHPRHtSXKKU99IBazS/2w=="], - - "use-sidecar/tslib": ["tslib@2.8.1", "", {}, "sha512-oJFu94HQb+KVduSUQL7wnpmqnfmLsOA/nAh6b6EH0wCEoK0/mPeXU6c3wKDV83MkOuHPRHtSXKKU99IBazS/2w=="], + "type-is/content-type": ["content-type@2.1.0", "", {}, "sha512-mj7UPXE0jaqaOsukNZRUEfEi2AcL7C/vwmwcHV0O97eO1E1pxBZuyjlZrx5seTaNBg1U6+o35wpa35Qfcc+7ag=="], } } diff --git a/ui/apps/package.json b/ui/apps/package.json index 0dda0282..aac0d2ac 100644 --- a/ui/apps/package.json +++ b/ui/apps/package.json @@ -35,7 +35,7 @@ }, "overrides": { "@hono/node-server": "1.19.15", - "fast-uri": "3.1.5", + "fast-uri": "3.1.7", "hono": "4.12.34", "ip-address": "10.5.0", "nanoid": "3.3.18" diff --git a/ui/host/bun.lock b/ui/host/bun.lock index 878e04e6..7f79bb5a 100644 --- a/ui/host/bun.lock +++ b/ui/host/bun.lock @@ -1,42 +1,42 @@ { - "lockfileVersion": 1, + "lockfileVersion": 2, "configVersion": 1, "workspaces": { "": { "name": "@fanout/web", "dependencies": { - "@ag-ui/client": "latest", - "@fontsource/ibm-plex-mono": "latest", - "@fontsource/ibm-plex-sans": "latest", - "@mantine/core": "latest", - "@mantine/hooks": "latest", - "@modelcontextprotocol/ext-apps": "latest", - "@modelcontextprotocol/sdk": "latest", - "@phosphor-icons/react": "latest", - "@tanstack/react-query": "latest", - "@tanstack/react-router": "latest", - "react": "latest", - "react-dom": "latest", - "react-grid-layout": "latest", - "react-markdown": "latest", - "remark-gfm": "latest", - "uuid": "latest", + "@ag-ui/client": "0.0.58", + "@fontsource/ibm-plex-mono": "^5.3.0", + "@fontsource/ibm-plex-sans": "^5.3.0", + "@mantine/core": "9.5.2", + "@mantine/hooks": "9.5.2", + "@modelcontextprotocol/ext-apps": "1.7.5", + "@modelcontextprotocol/sdk": "1.30.0", + "@phosphor-icons/react": "2.1.10", + "@tanstack/react-query": "5.102.5", + "@tanstack/react-router": "1.170.32", + "react": "19.2.8", + "react-dom": "19.2.8", + "react-grid-layout": "2.2.4", + "react-markdown": "^10.1.0", + "remark-gfm": "^4.0.1", + "uuid": "14.0.2", }, "devDependencies": { - "@tanstack/router-plugin": "latest", - "@types/react": "latest", - "@types/react-dom": "latest", - "@vitejs/plugin-react": "latest", - "happy-dom": "latest", - "typescript": "latest", - "vite": "latest", - "vitest": "latest", + "@tanstack/router-plugin": "1.168.35", + "@types/react": "19.2.18", + "@types/react-dom": "19.2.5", + "@vitejs/plugin-react": "6.1.0", + "happy-dom": "20.11.6", + "typescript": "7.0.2", + "vite": "8.2.2", + "vitest": "^4.1.11", }, }, }, "overrides": { "@hono/node-server": "1.19.15", - "fast-uri": "3.1.5", + "fast-uri": "3.1.7", "hono": "4.12.34", "ip-address": "10.5.0", "nanoid": "3.3.18", @@ -56,7 +56,7 @@ "@babel/core": ["@babel/core@7.29.7", "", { "dependencies": { "@babel/code-frame": "^7.29.7", "@babel/generator": "^7.29.7", "@babel/helper-compilation-targets": "^7.29.7", "@babel/helper-module-transforms": "^7.29.7", "@babel/helpers": "^7.29.7", "@babel/parser": "^7.29.7", "@babel/template": "^7.29.7", "@babel/traverse": "^7.29.7", "@babel/types": "^7.29.7", "@jridgewell/remapping": "^2.3.5", "convert-source-map": "^2.0.0", "debug": "^4.1.0", "gensync": "^1.0.0-beta.2", "json5": "^2.2.3", "semver": "^6.3.1" } }, "sha512-RgHBCvtjbOK2gXSNBNIkNoEc9qoVEtau3hj8gEqKQuL3HZAibKarWFEI3Lfm6EYKkLalOh8eSrj9b+ch9H/VBA=="], - "@babel/generator": ["@babel/generator@7.29.7", "", { "dependencies": { "@babel/parser": "^7.29.7", "@babel/types": "^7.29.7", "@jridgewell/gen-mapping": "^0.3.12", "@jridgewell/trace-mapping": "^0.3.28", "jsesc": "^3.0.2" } }, "sha512-DkXD5OJQaAQIdZ1bt3UZdEnHAn9Imd3IVBdX03UFe+ony9Ojw5pzr9YVKGDY1jt+Gcn/FnGkNf8r+Vj5NOJWtQ=="], + "@babel/generator": ["@babel/generator@7.29.8", "", { "dependencies": { "@babel/parser": "^7.29.8", "@babel/types": "^7.29.8", "@jridgewell/gen-mapping": "^0.3.12", "@jridgewell/trace-mapping": "^0.3.28", "jsesc": "^3.0.2" } }, "sha512-gZbepsdh3WDtgZKWL+vTPh71LSBrm/Y4/QDZBVCcYfmeTEEuoOYwlSy+G1StfJg+/Zy550u/3TATbm7qDbbMtg=="], "@babel/helper-compilation-targets": ["@babel/helper-compilation-targets@7.29.7", "", { "dependencies": { "@babel/compat-data": "^7.29.7", "@babel/helper-validator-option": "^7.29.7", "browserslist": "^4.24.0", "lru-cache": "^5.1.1", "semver": "^6.3.1" } }, "sha512-wem6WaBj4NaVYVdNhLPPVacES6ZJ+KBBfSkTMD3YZxbP3rm3Di85tJU5ljaUNhaOynt+Aj0xruhYuzQBt8n71g=="], @@ -74,21 +74,15 @@ "@babel/helpers": ["@babel/helpers@7.29.7", "", { "dependencies": { "@babel/template": "^7.29.7", "@babel/types": "^7.29.7" } }, "sha512-1k2lAGRMfHTcwuNYcCNUmaUffmQv8KWMfh2iJUUeRlwlwH4FdNG7mfPI10NPfLHJFThE4Tyr4mv7kTNZOiPuBg=="], - "@babel/parser": ["@babel/parser@7.29.7", "", { "dependencies": { "@babel/types": "^7.29.7" }, "bin": "./bin/babel-parser.js" }, "sha512-hnORnjP/1P/zFEndoeX+n+t1RwWRJiJpM/jO7FW32Kn9r5+sJB2JWOdYo4L6k78j15eCwY3Gm/7364B1EMwtNg=="], + "@babel/parser": ["@babel/parser@7.29.8", "", { "dependencies": { "@babel/types": "^7.29.8" }, "bin": "./bin/babel-parser.js" }, "sha512-E8lTAYNB1KW+FH+VGJuZM1ioAx2E6oVlvQFRrf5P8ZZmsiJXYAD9vTFV7yyEURNzgh1dFqMZuO6tUwcARbqFCA=="], "@babel/template": ["@babel/template@7.29.7", "", { "dependencies": { "@babel/code-frame": "^7.29.7", "@babel/parser": "^7.29.7", "@babel/types": "^7.29.7" } }, "sha512-puq+Gf35oI24FeN11LkoUQFqv9uwNeWpxXZi/Ji3rRIoKAzKnxRaZ+Gkj0vKS9ZCiTESfng1N9LyOyXvo+m+Gg=="], - "@babel/traverse": ["@babel/traverse@7.29.7", "", { "dependencies": { "@babel/code-frame": "^7.29.7", "@babel/generator": "^7.29.7", "@babel/helper-globals": "^7.29.7", "@babel/parser": "^7.29.7", "@babel/template": "^7.29.7", "@babel/types": "^7.29.7", "debug": "^4.3.1" } }, "sha512-EhlfNQtZ+NK22w5BM61ciuiq1m58ed33Wr1Xan//ZRTy6hgjnwyCffRYwzsGXdASJSUJ1guZILsErh1eQcl+zw=="], + "@babel/traverse": ["@babel/traverse@7.29.8", "", { "dependencies": { "@babel/code-frame": "^7.29.7", "@babel/generator": "^7.29.8", "@babel/helper-globals": "^7.29.7", "@babel/parser": "^7.29.8", "@babel/template": "^7.29.7", "@babel/types": "^7.29.8", "debug": "^4.3.1" } }, "sha512-I5z7H3bf/41ktsNVLtpN0wAa336HkqIHQ5BuPLEhTkt1jVSyZpeNKIzTgEWmlxjdg81R0IgUCcaE+Ok3NvrfZg=="], - "@babel/types": ["@babel/types@7.29.7", "", { "dependencies": { "@babel/helper-string-parser": "^7.29.7", "@babel/helper-validator-identifier": "^7.29.7" } }, "sha512-4zBIxpPzowiZpusoFkyGVwakdRJUyuH5PxQ/PrqghfdFWWasvnCdPfQXHrenDai+gyLARulZjZowCOj6fjT4pA=="], + "@babel/types": ["@babel/types@7.29.8", "", { "dependencies": { "@babel/helper-string-parser": "^7.29.7", "@babel/helper-validator-identifier": "^7.29.7" } }, "sha512-Vj1jF3cPfxg7OAfoI7QnVKLoILlm2JF9pnVHrX8qx7AHMiYWT+NDAA7jChlNgRS4WTLc/fD1lXLmPixluj+3Gg=="], - "@bufbuild/protobuf": ["@bufbuild/protobuf@2.12.1", "", {}, "sha512-BvAMfS6LrgZiryOAZ4pBYucu4wG/Ei/9o9DZ9akbREnMLbPJiom2i8b9C8IsKErQoiKqVhrerzt3kOT/RrzLHg=="], - - "@emnapi/core": ["@emnapi/core@2.0.0-alpha.3", "", { "dependencies": { "@emnapi/wasi-threads": "2.0.1", "tslib": "^2.4.0" } }, "sha512-AZypUeJ/yByuxyS7BlSNRDOMLMlROYtjYdIAuBmJssVz1UJDSeYxLrdizhXCFYhedC5bqd/ASy8EuNXbVVXp9g=="], - - "@emnapi/runtime": ["@emnapi/runtime@2.0.0-alpha.3", "", { "dependencies": { "tslib": "^2.4.0" } }, "sha512-hFPAhMUjJD9BSyCANEISPOogeXC9Zo9ZQl7L6vKnaVsMkCtzznaW/naYypeyl0Gv5rYfWYsZbpixTMpjDJzQeA=="], - - "@emnapi/wasi-threads": ["@emnapi/wasi-threads@2.0.1", "", { "dependencies": { "tslib": "^2.4.0" } }, "sha512-9DsSk+o5NBX0CCJT8s0EROGSGxjR/tKu6aBTaVyq+SjAEQH4XcdcRxPBRzsBLizTTJ49MJjF+jgu3qnO9GLQcQ=="], + "@bufbuild/protobuf": ["@bufbuild/protobuf@2.14.1", "", {}, "sha512-agRJn3+EJDUe8AvxTx/LnHA/GErvLE62pSaSk7+MwFOtOv8eWBu/qCq2qoZjBjVZ3C2aiFJCveuSs17KMkYGOw=="], "@floating-ui/core": ["@floating-ui/core@1.8.0", "", { "dependencies": { "@floating-ui/utils": "^0.2.12" } }, "sha512-0CIZ5itps/8x7BG8dEIhs53BvCUH2PCoogtakwRTut+Arm58sJooJ0AuZhLw2HJYIR5cMLNPBSS728sPho2khQ=="], @@ -112,7 +106,7 @@ "@jridgewell/resolve-uri": ["@jridgewell/resolve-uri@3.1.2", "", {}, "sha512-bRISgCIjP20/tbWSPWMEi54QVPRZExkuD9lJL+UIxUKtwVJA8wW1Trb1jMs1RFXo1CBTNZ/5hpC9QvmKWdopKw=="], - "@jridgewell/sourcemap-codec": ["@jridgewell/sourcemap-codec@1.5.5", "", {}, "sha512-cYQ9310grqxueWbl+WuIUIaiUaDcj7WOq5fVhEljNVgRfOUhY9fy2zTvfoqWsnebh8Sl70VScFbICvJnLKB0Og=="], + "@jridgewell/sourcemap-codec": ["@jridgewell/sourcemap-codec@1.6.0", "", {}, "sha512-T7jf+5zgsZHwNJ4lvQ7/aezbyk0nNX+zJVWpmHA7VYsEx7a7qr5Rg5IbtJFqkgze5Y2sruq1RUY8Q837Od7iFw=="], "@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=="], @@ -124,45 +118,41 @@ "@modelcontextprotocol/sdk": ["@modelcontextprotocol/sdk@1.30.0", "", { "dependencies": { "@hono/node-server": "^1.19.9 || ^2.0.5", "ajv": "^8.17.1", "ajv-formats": "^3.0.1", "content-type": "^1.0.5", "cors": "^2.8.5", "cross-spawn": "^7.0.5", "eventsource": "^3.0.2", "eventsource-parser": "^3.0.0", "express": "^5.2.1", "express-rate-limit": "^8.2.1", "hono": "^4.11.4", "jose": "^6.1.3", "json-schema-typed": "^8.0.2", "pkce-challenge": "^5.0.0", "raw-body": "^3.0.0", "zod": "^3.25 || ^4.0", "zod-to-json-schema": "^3.25.1" }, "peerDependencies": { "@cfworker/json-schema": "^4.1.1" }, "optionalPeers": ["@cfworker/json-schema"] }, "sha512-xKd8OIzlqNzcqcNumGAa6g+PW2kjD5vrpcKOnfldAUPP3j7lnqMPwlTXQm8gF+UwH72z0lqaRbjr9hqGz0eITA=="], - "@napi-rs/wasm-runtime": ["@napi-rs/wasm-runtime@1.2.2", "", { "dependencies": { "@tybys/wasm-util": "^0.10.3" }, "peerDependencies": { "@emnapi/core": "^1.7.1 || ^2.0.0-alpha.3", "@emnapi/runtime": "^1.7.1 || ^2.0.0-alpha.3" } }, "sha512-JfB4kuJQjaoHuCTseIINHtHWeJnvgEcxjwA5t/Y00ZgaOO1Crz3fjT/p8kT28zA/Caz7oiUMn3d6H2yOVCVwuw=="], - - "@oxc-project/types": ["@oxc-project/types@0.146.0", "", {}, "sha512-XC0QsnnhVe7sLIWmYmdPw7x5P0h4W8vUU3Nv1ySgWXtvCz8NizoAEpGXA0sOYoJQV2Rl13LgURAHQ5cI5ILCSA=="], + "@oxc-project/types": ["@oxc-project/types@0.148.0", "", {}, "sha512-Nm4s/jB+4FpFsPhWGEC4h7rzksesmtnMXomo6rCMcg/b8zLQuOziRgkCS1fxDCXOlJB/6Q8oABOZ/OP6RIPj9A=="], "@phosphor-icons/react": ["@phosphor-icons/react@2.1.10", "", { "peerDependencies": { "react": ">= 16.8", "react-dom": ">= 16.8" } }, "sha512-vt8Tvq8GLjheAZZYa+YG/pW7HDbov8El/MANW8pOAz4eGxrwhnbfrQZq0Cp4q8zBEu8NIhHdnr+r8thnfRSNYA=="], "@protobuf-ts/protoc": ["@protobuf-ts/protoc@2.11.1", "", { "bin": { "protoc": "protoc.js" } }, "sha512-mUZJaV0daGO6HUX90o/atzQ6A7bbN2RSuHtdwo8SSF2Qoe3zHwa4IHyCN1evftTeHfLmdz+45qo47sL+5P8nyg=="], - "@rolldown/binding-android-arm-eabi": ["@rolldown/binding-android-arm-eabi@1.2.5", "", { "os": "android", "cpu": "arm" }, "sha512-DLe/i+l8ynIBY7XEQ191TeZvCoowIGa18R+dIV30GW7DiOtp74i/xX8hs8GUjW5ARV7VZuie3d6AumSmCwbeRA=="], + "@rolldown/binding-android-arm-eabi": ["@rolldown/binding-android-arm-eabi@1.2.7", "", { "os": "android", "cpu": "arm" }, "sha512-EypzgnYCwyVY4NDHKzGmNJT5b+XaQEBniHxsMdeIQLB/tcCzZnhqrzHpZFbX9iaxx+5RiB8caATBtfvZP7zVxQ=="], - "@rolldown/binding-android-arm64": ["@rolldown/binding-android-arm64@1.2.5", "", { "os": "android", "cpu": "arm64" }, "sha512-zXcwKlQApYAOELHd8PwKDFkagYF9Wy4e0RJ+0qnzl9Pjnpj75TEG8ufv40p2J7kCEfwZAsNiuzRIyNNMWT38ig=="], + "@rolldown/binding-android-arm64": ["@rolldown/binding-android-arm64@1.2.7", "", { "os": "android", "cpu": "arm64" }, "sha512-l17HE9EweWaqJZhuUuNBN/FzM62xw+DECVnJyvMsxn8vJFAGLy5QfLDoYAcronkAN8VxKZHezDpulHDPx95vFw=="], - "@rolldown/binding-darwin-arm64": ["@rolldown/binding-darwin-arm64@1.2.5", "", { "os": "darwin", "cpu": "arm64" }, "sha512-dK4QakI42nzWgJT5sm4y4y/O//D4OxM75/cH28RLV+nzIN9AY+YsbuUVrUTjlLjXR6vpyxFbSsbmNuJ6BP9sww=="], + "@rolldown/binding-darwin-arm64": ["@rolldown/binding-darwin-arm64@1.2.7", "", { "os": "darwin", "cpu": "arm64" }, "sha512-8ED8ELFvHXc6OCETIn4gXObPiaR6bckM/ipXtbzlPVDRMBfEGjCKgO90F9YtfdpDatVx/ZQw7aZ1vUMf/+T3Mw=="], - "@rolldown/binding-darwin-x64": ["@rolldown/binding-darwin-x64@1.2.5", "", { "os": "darwin", "cpu": "x64" }, "sha512-fqSALaUu1Wjd1nK2uW2kJDWdLCc8lx1IcY+MTY26Aurfdx19anlzhqXOgCFbBFQnlFDTn4TC1/7Nz4Bl2mLP3A=="], + "@rolldown/binding-darwin-x64": ["@rolldown/binding-darwin-x64@1.2.7", "", { "os": "darwin", "cpu": "x64" }, "sha512-/WPripjtiAIZ2tWY7ddijORT0Ujg87wxWW/qcoFVCKAWVDPhtY0xr7Dj0M3GyNGz60jGwTElhro/mkF9dT7dDQ=="], - "@rolldown/binding-freebsd-x64": ["@rolldown/binding-freebsd-x64@1.2.5", "", { "os": "freebsd", "cpu": "x64" }, "sha512-/vCnNxlkxs9tKxNDcyWUePpJ/PgTzxIaVhoM5SmG8UV+GR/IcPam4VYxi7GIMo7PSDuNqlJqvprqii9NqqVCMw=="], + "@rolldown/binding-freebsd-x64": ["@rolldown/binding-freebsd-x64@1.2.7", "", { "os": "freebsd", "cpu": "x64" }, "sha512-14DI4NcqpvbICxSnGLx3PmtDaWqRP/KGSGb6C+JLLVPeZRl6dKdHba3pGsqT3vpdTqhEYIPG0MMQ8c0xYqoJxA=="], - "@rolldown/binding-linux-arm-gnueabihf": ["@rolldown/binding-linux-arm-gnueabihf@1.2.5", "", { "os": "linux", "cpu": "arm" }, "sha512-abk0NLA519LxRCszmbE0jYKuQ9YPocOXTiOXOo6Yr+YAT95VH+PtqYAjOJvGKt3viEd/x4qzabAlwd5bHOOARg=="], + "@rolldown/binding-linux-arm-gnueabihf": ["@rolldown/binding-linux-arm-gnueabihf@1.2.7", "", { "os": "linux", "cpu": "arm" }, "sha512-bxrWIRvHWQvbJwi+VIie/kDJmQxcNE6xxWwZdqF/ExVAigtHkv54WTLQPb+QsZdnFy18fg7JPfWGL0RH6vwIlQ=="], - "@rolldown/binding-linux-arm64-gnu": ["@rolldown/binding-linux-arm64-gnu@1.2.5", "", { "os": "linux", "cpu": "arm64" }, "sha512-Y7eALiJ8lr0M2HH103Js+g7V34wf6snlpZLAsHI90uLhr3PVlNsbFVAXJC9d/V6BnPyKtpSwI+NcB/RLxsQxuA=="], + "@rolldown/binding-linux-arm64-gnu": ["@rolldown/binding-linux-arm64-gnu@1.2.7", "", { "os": "linux", "cpu": "arm64" }, "sha512-toOY2BChBZyuxU7OYX6Tn389di4IzAqPTycVcci0O7FSfBqzRB3RZn+K5Is6ANf4tmgRd/K1yZTsNTXbkXsnLg=="], - "@rolldown/binding-linux-arm64-musl": ["@rolldown/binding-linux-arm64-musl@1.2.5", "", { "os": "linux", "cpu": "arm64" }, "sha512-xMvZgnbZg4YVnR/AX2b3oOPDTFYJvUVaJg5FedA/LuvexAtXibZQej4cnTkw3rjsJ/ggUROB64TdtETiim+FYA=="], + "@rolldown/binding-linux-arm64-musl": ["@rolldown/binding-linux-arm64-musl@1.2.7", "", { "os": "linux", "cpu": "arm64" }, "sha512-lAIXTH/aiLRLxsTgQvfhjo4K1ydWIp00+V0voOr9beb/9ZmkUFrSIb03dXNFRgMNvkE6oGsF10ioQ6UsI+vS5Q=="], - "@rolldown/binding-linux-ppc64-gnu": ["@rolldown/binding-linux-ppc64-gnu@1.2.5", "", { "os": "linux", "cpu": "ppc64" }, "sha512-GRjeqTUDHTo5GwntsLaAMcBahG3nlpjftXWZLN73HiYQlhwEowvarFgQnRnQZtIp4keXX7quXFbG38uPZBa2EA=="], + "@rolldown/binding-linux-ppc64-gnu": ["@rolldown/binding-linux-ppc64-gnu@1.2.7", "", { "os": "linux", "cpu": "ppc64" }, "sha512-kdnwS28Pkenp/mZMRwjXXXwxQ7pIsm+bF919LUK93BOyhcLsrVKdP2p9fxpiPNPAbNuch8ypQt0pm2P2LYCAGg=="], - "@rolldown/binding-linux-s390x-gnu": ["@rolldown/binding-linux-s390x-gnu@1.2.5", "", { "os": "linux", "cpu": "s390x" }, "sha512-vLNTR45F2Uwc8AufkNXPmB4VliaXs+FvcheEogIzOXzO4l+LzieXF5A/TWxLy5HtqpsRCHUfd0lPVrrdgXdLHQ=="], + "@rolldown/binding-linux-s390x-gnu": ["@rolldown/binding-linux-s390x-gnu@1.2.7", "", { "os": "linux", "cpu": "s390x" }, "sha512-516OdsyLdr5E65paF3yBF55t8mfm9+gmtCsK3xI7XKXIT7EfRlHhxL8K/NR6Hu8BWSgF5+1w74lTL0+nxcc8Qw=="], - "@rolldown/binding-linux-x64-gnu": ["@rolldown/binding-linux-x64-gnu@1.2.5", "", { "os": "linux", "cpu": "x64" }, "sha512-Mgj59/HTuYeK9Gz2MA+mBWKnHsAgkBSec15ZMb1st3oIfFbX7gCjOae7GydHhzcyQi9Z/7M1QuN9bR3oFqF0jQ=="], + "@rolldown/binding-linux-x64-gnu": ["@rolldown/binding-linux-x64-gnu@1.2.7", "", { "os": "linux", "cpu": "x64" }, "sha512-r8/z8n7GFaYRln3xmP1Cxy0HH/HLM0uBUPkEuSVEfKGDA89M0FsZRZJRSwe/tJjRx+fpH/gjorfhB8tmEbSFLA=="], - "@rolldown/binding-linux-x64-musl": ["@rolldown/binding-linux-x64-musl@1.2.5", "", { "os": "linux", "cpu": "x64" }, "sha512-mY8AP0/ichsbhAxGnLa3d3+MwV0EfgrPND2bplI3Ym8T6R2pJ0N87bvrKVwNXmdy3jnr6eQBecdqx/HMknBmpA=="], + "@rolldown/binding-linux-x64-musl": ["@rolldown/binding-linux-x64-musl@1.2.7", "", { "os": "linux", "cpu": "x64" }, "sha512-pAsE8iiDxUg1xBqdhrTfg45AVDVpirjz00sblEYClGNNcMnDb+e8beQgqIAw6LvauX/APvgxUnwrgun/YYGBhw=="], - "@rolldown/binding-openharmony-arm64": ["@rolldown/binding-openharmony-arm64@1.2.5", "", { "os": "none", "cpu": "arm64" }, "sha512-8SLssA2oweAxyRgDp789ACfRb/3P+zNRJpzZxSizxF9m8NUDQ4+3xjo8ttjhVGGw6Qxb70oZiEtIjaKikCO7Yw=="], + "@rolldown/binding-openharmony-arm64": ["@rolldown/binding-openharmony-arm64@1.2.7", "", { "os": "none", "cpu": "arm64" }, "sha512-lTcIYmmnQQA8Or/2DatS6oSqcdLHvendjS+zLu+FwgToynWMRSmQdpM65fTANJgIS4mjbMOo5KT2lnT9SAb96w=="], - "@rolldown/binding-wasm32-wasi": ["@rolldown/binding-wasm32-wasi@1.2.1", "", { "dependencies": { "@emnapi/core": "2.0.0-alpha.3", "@emnapi/runtime": "2.0.0-alpha.3", "@napi-rs/wasm-runtime": "^1.2.0" } }, "sha512-/TX0SoRGojHzSAHpfVBbavRVSazg5U3h3Y3VXfcc0cdugq6kxdqw8LPGFiPr+/7gE/60zRcsOY2Vi9b9eT0jww=="], + "@rolldown/binding-win32-arm64-msvc": ["@rolldown/binding-win32-arm64-msvc@1.2.7", "", { "os": "win32", "cpu": "arm64" }, "sha512-e3Gu3WxbNk/UqQhxqU7YIYO+9ZBvWNz3U+h/qRFosscMFzdRPbXYSaSWgSnklv2fz1TgzBTcti2z35c/7irsHw=="], - "@rolldown/binding-win32-arm64-msvc": ["@rolldown/binding-win32-arm64-msvc@1.2.5", "", { "os": "win32", "cpu": "arm64" }, "sha512-vGbruD5zquhoc8D9SViXgN2FBJtNdTyQ4DtG+SWiEGlJiAzoKcZ2xp+xuXCffhubVdt0NJlTZqkeRuERy7g8Cw=="], - - "@rolldown/binding-win32-x64-msvc": ["@rolldown/binding-win32-x64-msvc@1.2.5", "", { "os": "win32", "cpu": "x64" }, "sha512-e/SXpgISz+IoqVcSSI0rx/d/he8zqLex+/rCWpnHpmVfmPIUjag9H6P7zotf0gJHwPUhQxZ/mF8tr6acebT9yw=="], + "@rolldown/binding-win32-x64-msvc": ["@rolldown/binding-win32-x64-msvc@1.2.7", "", { "os": "win32", "cpu": "x64" }, "sha512-W/jg5qoRSqjsEv0+dZi4e687mcHqmVuU0P4fK6qS/xjetW2Gmc1W8j//z5nAeNcC8Ttm0hV46IjcYeuVwYhuiw=="], "@rolldown/pluginutils": ["@rolldown/pluginutils@1.0.1", "", {}, "sha512-2j9bGt5Jh8hj+vPtgzPtl72j0yRxHAyumoo6TNfAjsLB04UtpSvPbPcDcBMxz7n+9CYB0c1GxQFxYRg2jimqGw=="], @@ -190,8 +180,6 @@ "@tanstack/virtual-file-routes": ["@tanstack/virtual-file-routes@1.162.0", "", {}, "sha512-uhOeFyxLcU41HzvrxsGpiWdcMbScY1EDgbZ5K7DVRMYInbLYWAC0EA/kx9wXAoSM8q82bUG2hRl8+EAjE6XAbA=="], - "@tybys/wasm-util": ["@tybys/wasm-util@0.10.3", "", { "dependencies": { "tslib": "^2.4.0" } }, "sha512-F3fo1MYrRJYL3zER0OUOmkutjr1Vp23m7OsSgp7nq4SP6OqX6C/56XFIPAl5bt3zaBRjmW7SGz3u/6LwFpYcOg=="], - "@types/chai": ["@types/chai@5.2.3", "", { "dependencies": { "@types/deep-eql": "*", "assertion-error": "^2.0.1" } }, "sha512-Mw558oeA9fFbv65/y4mHtXDs9bPnFMZAL/jxdPFUpOHHIXX91mcgEHbS5Lahr+pwZFR8A7GQleRWeI6cGFC2UA=="], "@types/debug": ["@types/debug@4.1.13", "", { "dependencies": { "@types/ms": "*" } }, "sha512-KSVgmQmzMwPlmtljOomayoR89W4FynCAi3E8PPs7vmDVPe84hT+vGPKkJfThkmXs0x0jAaa9U8uW8bbfyS2fWw=="], @@ -208,7 +196,7 @@ "@types/ms": ["@types/ms@2.1.0", "", {}, "sha512-GsCCIZDE/p3i96vtEqx+7dBUGXrc7zeSK3wwPHIaRThS+9OhWIXRqzs4d6k1SVU8g91DrNRWxWUGhp5KXQb2VA=="], - "@types/node": ["@types/node@20.19.43", "", { "dependencies": { "undici-types": "~6.21.0" } }, "sha512-6oYBAi5ikg4Pl+kGsoYtawUMBT2zZMCvPNF7pVLnHZfd1zf38DRiWn/gT01RYCdUqkv7Fhr+C9ot4/tb+2sVvA=="], + "@types/node": ["@types/node@26.4.1", "", { "dependencies": { "undici-types": "~8.3.0" } }, "sha512-k97ENvZWtvA6yqz5/FS6a7duDgOPEeOQOc2iKS/nY6mX6qJUKtLnWzQS+Xj6tXweyj6ZcTAK2Qecetnvi9nCLA=="], "@types/react": ["@types/react@19.2.18", "", { "dependencies": { "csstype": "^3.2.2" } }, "sha512-AnzbBERsrLKtk2XSfTbYRLjQPdy116Sty4q+T+Bp3IC4l6jNBvreVPAHmpq9qhXQM7CXZPjLVmGMw9sy+hxQ3w=="], @@ -262,7 +250,7 @@ "@typescript/typescript-win32-x64": ["@typescript/typescript-win32-x64@7.0.2", "", { "os": "win32", "cpu": "x64" }, "sha512-0BQ3HkAHHlKLSp1qRvf3SUhGpGsDuhB/jgFw75guyqbxJqEaS0Cw/VFO8i2nHglJUzQCRtMMR/IBAKE3ETMC4g=="], - "@ungap/structured-clone": ["@ungap/structured-clone@1.3.3", "", {}, "sha512-60YRaenCQcVjYEKOcG824+DRGGIQ3VKErcBoAEDJZz5bKIs2ZG+X/H9Nk+Q6EVkwJk5QNApxbrc5QtBSwtrXAg=="], + "@ungap/structured-clone": ["@ungap/structured-clone@1.4.0", "", {}, "sha512-1mEZtMKPM09vDmQt5y7YvmN2+DFTP7Tg0EWXdic8/C6VRnpb33e4ghisCIE3WZjsE2N8mf+QV1Zqh7ZFYLWInQ=="], "@vitejs/plugin-react": ["@vitejs/plugin-react@6.1.0", "", { "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.145.0", "vite": "^8.0.0" }, "optionalPeers": ["@rolldown/plugin-babel", "babel-plugin-react-compiler", "oxc-transform-react"] }, "sha512-qd2BzUBehkov86WFhg0JkEFEYyCLG9uPCe6qWTY/kRlss9OvJrOF2UbIWT7p+8IzZHkEu0DNGHc4HSv+JdDLsw=="], @@ -294,11 +282,11 @@ "bail": ["bail@2.0.2", "", {}, "sha512-0xO6mYd7JB2YesxDKplafRpsiOzPt9V02ddPCLbY1xYGPOX24NTyN50qnUxgCPcSoYMhKpAuBTjQoRZCAkUDRw=="], - "baseline-browser-mapping": ["baseline-browser-mapping@2.10.44", "", { "bin": { "baseline-browser-mapping": "dist/cli.cjs" } }, "sha512-T3ghW+sl/ZJ8w1v/yQx3qvJ9040DWoLBz8JT/CILbAKcFyG9b2MRe75v6W5uXjv6uH1lumK2Kv46y2zSkcej0Q=="], + "baseline-browser-mapping": ["baseline-browser-mapping@2.11.20", "", { "bin": { "baseline-browser-mapping": "dist/cli.cjs" } }, "sha512-H0ulySigv6icDJ1F7SjtdCD6PrhTpdYCmP0CactWy1+ekh0AFd0o1Wn5T8b+hnTmdBx19u9yhL6wvCylXMY7zw=="], "body-parser": ["body-parser@2.3.0", "", { "dependencies": { "bytes": "^3.1.2", "content-type": "^2.0.0", "debug": "^4.4.3", "http-errors": "^2.0.1", "iconv-lite": "^0.7.2", "on-finished": "^2.4.1", "qs": "^6.15.2", "raw-body": "^3.0.2", "type-is": "^2.1.0" } }, "sha512-2cGmJupaNgg+QUwVLAucDuWuoMZ6EX9iHDRswZ5lsNYEmwPaRknMPCLZz07yTzVq/83p4o/wzbDZbBrTvGGTIw=="], - "browserslist": ["browserslist@4.28.6", "", { "dependencies": { "baseline-browser-mapping": "^2.10.42", "caniuse-lite": "^1.0.30001803", "electron-to-chromium": "^1.5.389", "node-releases": "^2.0.51", "update-browserslist-db": "^1.2.3" }, "bin": { "browserslist": "cli.js" } }, "sha512-FQBYNK15VMslhLHpA7+n+n1GOlF1kId2xcCg7/j95f24AOF6VDYMNH4mFxF7KuaTdv627faazpOAjFzMrfJOUw=="], + "browserslist": ["browserslist@4.28.8", "", { "dependencies": { "baseline-browser-mapping": "^2.11.12", "caniuse-lite": "^1.0.30001809", "electron-to-chromium": "^1.5.402", "node-releases": "^2.0.53", "update-browserslist-db": "^1.3.0" }, "bin": { "browserslist": "cli.js" } }, "sha512-V2NpofLblG64mfOtSgDhOJESZEGogzDMBv/q+W6oc4LXWP/q75eOXoOaaOu1EOadB9U4Bwx/e0yzbvwKH8zalA=="], "buffer-image-size": ["buffer-image-size@0.6.4", "", { "dependencies": { "@types/node": "*" } }, "sha512-nEh+kZOPY1w+gcCMobZ6ETUp9WfibndnosbpwB1iJk/8Gt5ZF2bhS6+B6bPYz424KtwsR6Rflc3tCz1/ghX2dQ=="], @@ -308,7 +296,7 @@ "call-bound": ["call-bound@1.0.4", "", { "dependencies": { "call-bind-apply-helpers": "^1.0.2", "get-intrinsic": "^1.3.0" } }, "sha512-+ys997U96po4Kx/ABpBCqhA9EuxJaQWDQg7295H4hBphv3IZg0boBKuwYpt4YXp6MZ5AmZQnU/tyMTlRpaSejg=="], - "caniuse-lite": ["caniuse-lite@1.0.30001806", "", {}, "sha512-72Cuvd95zbSYPKq6Fhg8eDJRlzgWDf7/mtoZv6Qe/DYNCEBdNxoA3+rZAU2ZhGCpZlns3EssFavaZomckT5Uuw=="], + "caniuse-lite": ["caniuse-lite@1.0.30001810", "", {}, "sha512-TITQPUkaz+aVk5GL6NhOdwk1aEaNTSDPsGFWrTuhKGtjTF70jL/Oht2W4c6rXUe5fu7Ie19VIahAXHIIiWWNeg=="], "ccount": ["ccount@2.0.1", "", {}, "sha512-eyrF0jiFpY+3drT6383f1qhkbGsLSifNAjA61IUjZjmLCWjItY6LB9ft9YhoDgwfmclB2zhu51Lc7+95b8NRAg=="], @@ -368,7 +356,7 @@ "ee-first": ["ee-first@1.1.1", "", {}, "sha512-WMwm9LhRUo+WUaRN+vRuETqG89IgZphVSNkdFgeb6sS/E4OrDIN7t48CAewSHXc6C8lefD8KKfr5vY61brQlow=="], - "electron-to-chromium": ["electron-to-chromium@1.5.394", "", {}, "sha512-Wmt2Gm0o8JWBuGgmc4XZ0u9s1RaCRqhxP47phplmfg04+qypTUurpeJGP45A7Fhv7jdrrVH44PLlR9qXo37cVQ=="], + "electron-to-chromium": ["electron-to-chromium@1.5.420", "", {}, "sha512-2yD6XreGusOfNV+dUcvipJEXc3n/n7fgr7996aszTG+YY5E4mqM4tOq/3uhP129cazL9YHbVWSpc79ePotWtPA=="], "encodeurl": ["encodeurl@2.0.0", "", {}, "sha512-Q0n9HRi4m6JuGIV1eFlmvJB7ZEVxu93IrMyiMsGC0lrMJMWzRgx6WGquyfQgZVb31vhGgXnfmPNNXmxnOkRBrg=="], @@ -378,7 +366,7 @@ "es-errors": ["es-errors@1.3.0", "", {}, "sha512-Zf5H2Kxt2xjTvbJvP2ZWLEICxA6j+hAmMzIlypy4xcBg1vKVnx89Wy0GbS+kf5cwCVFFzdCFh2XSCFNULS6csw=="], - "es-module-lexer": ["es-module-lexer@2.3.1", "", {}, "sha512-shc1dbU90Yl/xq1QrC7QRtfcwURZuVRfPhZbDoldJ1cn1gzDvBaBWlv0eFolj5+0znnPJz5TXLxsN77X/12KTA=="], + "es-module-lexer": ["es-module-lexer@2.3.2", "", {}, "sha512-poHGpORABojJJucnV9KbOavETW8lBVnphkW77ER5/BQ5Fz7oXSoCNek7IH3vR5nRjdsEz926ibFYX8KtLQmdyw=="], "es-object-atoms": ["es-object-atoms@1.1.2", "", { "dependencies": { "es-errors": "^1.3.0" } }, "sha512-HWcBoN6NileqtSydK2FqHbS/LoDd2pqrnQHLyJzBj4kOp/ky2MWMN694xOfkK8/SnUsW2DH7EfyVlydKCsm1Zw=="], @@ -396,13 +384,13 @@ "eventsource": ["eventsource@3.0.7", "", { "dependencies": { "eventsource-parser": "^3.0.1" } }, "sha512-CRT1WTyuQoD771GW56XEZFQ/ZoSfWid1alKGDYMmkt2yl8UXrVR4pspqWNEcqKvVIzg6PAltWjxcSSPrboA4iA=="], - "eventsource-parser": ["eventsource-parser@3.1.0", "", {}, "sha512-kJezFj9YFAMLeORyi7aCLxLbD5/qWMQnoMVlVPyHIll7lgRJCc3JVln9Vgl9nwQi0YkMnhdGTMNn7CkRRAptMg=="], + "eventsource-parser": ["eventsource-parser@3.1.1", "", {}, "sha512-EKN1vKAMcZ8MlYMpaNuxN6R9yakzH6uajHcHVTqWJzvu5pWw9DyhbP35HH8MVBQ+dZjAfDxk+A8NiR9KWaXiyQ=="], "expect-type": ["expect-type@1.4.0", "", {}, "sha512-KfYbmpRm0VbLjEvVa9yGwCi9GI34xvi7A/HXYWQO65CSD2u3MczUJSuwXKFIxlGsgBQizV9q5J9NHj4VG0n+pA=="], "express": ["express@5.2.1", "", { "dependencies": { "accepts": "^2.0.0", "body-parser": "^2.2.1", "content-disposition": "^1.0.0", "content-type": "^1.0.5", "cookie": "^0.7.1", "cookie-signature": "^1.2.1", "debug": "^4.4.0", "depd": "^2.0.0", "encodeurl": "^2.0.0", "escape-html": "^1.0.3", "etag": "^1.8.1", "finalhandler": "^2.1.0", "fresh": "^2.0.0", "http-errors": "^2.0.0", "merge-descriptors": "^2.0.0", "mime-types": "^3.0.0", "on-finished": "^2.4.1", "once": "^1.4.0", "parseurl": "^1.3.3", "proxy-addr": "^2.0.7", "qs": "^6.14.0", "range-parser": "^1.2.1", "router": "^2.2.0", "send": "^1.1.0", "serve-static": "^2.2.0", "statuses": "^2.0.1", "type-is": "^2.0.1", "vary": "^1.1.2" } }, "sha512-hIS4idWWai69NezIdRt2xFVofaF4j+6INOpJlVOLDO8zXGpUVEVzIYk12UUi2JzjEzWL3IOAxcTubgz9Po0yXw=="], - "express-rate-limit": ["express-rate-limit@8.6.0", "", { "dependencies": { "debug": "^4.4.3", "ip-address": "^10.2.0" }, "peerDependencies": { "express": ">= 4.11" } }, "sha512-XKJXDsASUOo0LLtFwW5hCcQGH0N4WQc/Rn8/Pvoia+TJFOkkFPvrtW9lZOeeNcxQJspvOIERMwiRLsVFlhHEkA=="], + "express-rate-limit": ["express-rate-limit@8.7.0", "", { "dependencies": { "debug": "^4.4.3", "ip-address": "^10.2.0" }, "peerDependencies": { "express": ">= 4.11" } }, "sha512-hOwV7WOxXfjRpAM1DSJWZDXx3GhplwD8IfwuwvogD8i1Qnkgosw/H45s4ZnFAUHDAhPjlY9hLBvJhKmGMyY26g=="], "extend": ["extend@3.0.2", "", {}, "sha512-fjquC59cD7CyW6urNXK0FBufkZcoiGG80wTuPujX590cB5Ttln20E2UB4S/WARVqhXffZl2LNgS+gQdPIIim/g=="], @@ -412,7 +400,7 @@ "fast-json-patch": ["fast-json-patch@3.1.1", "", {}, "sha512-vf6IHUX2SBcA+5/+4883dsIjpBTqmfBjmYiWK1savxQmFk4JfBMLa7ynTYOs1Rolp/T1betJxHiGD3g1Mn8lUQ=="], - "fast-uri": ["fast-uri@3.1.5", "", {}, "sha512-gHwA1O9LDIcKunMKhObS/HimwtehO1nPUECKAu5TpKgaO19fcWEl4bliWe1jWxVFvIXztJjjQ4L8XQ1EU9f7Jw=="], + "fast-uri": ["fast-uri@3.1.7", "", {}, "sha512-dOvZVzjdZdz7phd9v6jCbwxrBW3fK6n8Rc0CtdmM4bumzMnxywBYhuph6J819RRw/ku+rLbelwfMunktuzVVHg=="], "fdir": ["fdir@6.5.0", "", { "peerDependencies": { "picomatch": "^3 || ^4" }, "optionalPeers": ["picomatch"] }, "sha512-tIbYtZbucOs0BRGqPJkshJUYdL+SDH7dVM8gjy+ERp3WAUjLEFJE+02kanyHtwjWOnwrKYBiwAmM0p4kLJAnXg=="], @@ -474,13 +462,13 @@ "is-promise": ["is-promise@4.0.0", "", {}, "sha512-hvpoI6korhJMnej285dSg6nu1+e6uxs7zG3BYAm5byqDsgJNWwxzM6z6iZiAgQR4TJ30JmBTOwqZUw3WlyH3AQ=="], - "isbot": ["isbot@5.2.1", "", {}, "sha512-dJ+LpKyClQZ7NG+j3OensC/mAZkGpukE9YUrgPYvAZj2doVL0edfDgywTUh5CXa0o+nW9a1V9e5+CJTX8+SxRw=="], + "isbot": ["isbot@5.2.2", "", {}, "sha512-iQcBXcd+Rv/pkubRyGh2utW2j1oPG5hZY6TUhVPpqK4G+o3IbxpJNx04hgksjc/N7GK5pEorUxDeg31cFgEk/w=="], "isexe": ["isexe@2.0.0", "", {}, "sha512-RHxMLp9lnKHGHRng9QFhRCMbYAcVpn69smSGcq3f36xjgVVWThj4qqLbTLlq7Ssj8B+fIQ1EuCEGI2lKsyQeIw=="], "jiti": ["jiti@2.7.0", "", { "bin": { "jiti": "lib/jiti-cli.mjs" } }, "sha512-AC/7JofJvZGrrneWNaEnJeOLUx+JlGt7tNa0wZiRPT4MY1wmfKjt2+6O2p2uz2+skll8OZZmJMNqeke7kKbNgQ=="], - "jose": ["jose@6.2.3", "", {}, "sha512-YYVDInQKFJfR/xa3ojUTl8c2KoTwiL1R5Wg9YCydwH0x0B9grbzlg5HC7mMjCtUJjbQ/YnGEZIhI5tCgfTb4Hw=="], + "jose": ["jose@6.2.10", "", {}, "sha512-iiW7J9qRFlGxvCOIBDBDxFePQSn7ZMAnrYGhrrOo6siO/MIqwfyilLR27pkfDgUk+raLuzADS8A3S/KLBisc0g=="], "js-tokens": ["js-tokens@4.0.0", "", {}, "sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ=="], @@ -558,7 +546,7 @@ "mdast-util-to-string": ["mdast-util-to-string@4.0.0", "", { "dependencies": { "@types/mdast": "^4.0.0" } }, "sha512-0H44vDimn51F0YwvxSJSm0eCDOJTRlmN0R1yBh4HLj9wiV1Dn0QoXGbvFAWj2hSItVTlCmBF1hqKlIyUBVFLPg=="], - "media-typer": ["media-typer@1.1.0", "", {}, "sha512-aisnrDP4GNe06UcKFnV5bfMNPBUw4jsLGaWwWfnH3v02GnBuXX2MCVn5RbrWo0j3pczUilYblq7fQ7Nw2t5XKw=="], + "media-typer": ["media-typer@1.1.1", "", {}, "sha512-yz3xRaG20c6/BOzvYoDaGtPmGscs7YivItZEEqe6GbwNfHuxu9YNmvnEkMzKldAGY4/80pRcQRZSEnhquk9XuQ=="], "merge-descriptors": ["merge-descriptors@2.0.0", "", {}, "sha512-Snk314V5ayFLhp3fkUREub6WtjBfPdCPY1Ln8/8munuLuiYhsABgBVWsozAG+MWMbVEvcdcpbi9R7ww22l9Q3g=="], @@ -626,9 +614,9 @@ "nanoid": ["nanoid@3.3.18", "", { "bin": { "nanoid": "bin/nanoid.cjs" } }, "sha512-DTg4MJbGMWkfi6VZFdNt2/caMbQy4Ou+Op/hJQvGEWcnVfoA1QA+xzRKAzw9jD6+GVOOeYr/mIcuDSdug6F6+w=="], - "negotiator": ["negotiator@1.0.0", "", {}, "sha512-8Ofs/AUQh8MaEcrlq5xOX0CQ9ypTF5dl78mjlMNfOK08fzpgTHQRQPBxcPlEtIw0yRpws+Zo/3r+5WRby7u3Gg=="], + "negotiator": ["negotiator@1.1.0", "", { "dependencies": { "content-type": "^2.1.0" } }, "sha512-NMPBRMJgiQHjbd8phG3Vebdx4kZ1H121rbl5IkMqeOsahptB9BKo/d7oJ3zTXqTgagn2bWlNSXkh0QUGM31RYg=="], - "node-releases": ["node-releases@2.0.51", "", {}, "sha512-wRNIrw4DmVLKQlbgOMdkMx27Wrpzes2hh5Jtbi2bjPd+4wJstWIqP5A+lscnqbm0xxmT5Bpg8Lec5ItEBwx6BQ=="], + "node-releases": ["node-releases@2.0.54", "", {}, "sha512-YHs7BmmcsdAI5Ozuf8JZo6PT0mv2GIWC9vMfvUC3dp65M8hn7Ux8CPL+2oBI7juNuj9d0ndhTcznq2ODBps9cQ=="], "object-assign": ["object-assign@4.1.1", "", {}, "sha512-rJgTQnkUnH1sFw8yT6VSU3zD3sWmu6sZhIseY8VX+GRu3P6F7Fu+JNDoXfklElbLJSnc3FUQHVe4cU5hj+BcUg=="], @@ -652,13 +640,13 @@ "picocolors": ["picocolors@1.1.1", "", {}, "sha512-xceH2snhtb5M9liqDsmEw56le376mTZkEX/jEb/RxNFyegNul7eNslCXP9FDj/Lcu0X8KEyMceP2ntpaHrDEVA=="], - "picomatch": ["picomatch@4.0.5", "", {}, "sha512-RvwwcruNjI1ncT5xRakeyS9Lf8lcItv34KD+aif+VH9kduAyfYBipGh12274xtenIPZ119/R9BdTBa8gAwSh0A=="], + "picomatch": ["picomatch@4.0.7", "", {}, "sha512-qcJu88Q2IWqJsDD529JKMdwGm/dvInW4HvQnRwiH9JtihJvzGOscDtHE3x1pBKeUOTysQ8kVmLnJ2kJu7yhcGA=="], "pkce-challenge": ["pkce-challenge@5.0.1", "", {}, "sha512-wQ0b/W4Fr01qtpHlqSqspcj3EhBvimsdh0KlHhH8HRZnMsEa0ea2fTULOXOS9ccQr3om+GcGRk4e+isrZWV8qQ=="], - "postcss": ["postcss@8.5.26", "", { "dependencies": { "nanoid": "^3.3.17", "picocolors": "^1.1.1", "source-map-js": "^1.2.1" } }, "sha512-u82N74LFzG8ca+dD8puPnplTXoGH4fTPpVGuIbt36G3qvNlkvfD0lEAZSxaly3KX8TS/L1A1gsCEmvKmBcVbkQ=="], + "postcss": ["postcss@8.5.27", "", { "dependencies": { "nanoid": "^3.3.18", "picocolors": "^1.1.1", "source-map-js": "^1.2.1" } }, "sha512-79Iho8QeYyooJ8e9lCRyTVlyTAkS/kXBYKff6TMzS3kEWGQ8Ds5UEtXpGrSUDLUWok6QTvxeYy0GO8fopHnaSA=="], - "prettier": ["prettier@3.9.5", "", { "bin": { "prettier": "bin/prettier.cjs" } }, "sha512-/FVl766LpUfB5vXgCYOYa0MeV/441Ia99AeICQIQFTY/Nw0roZwULcXpku5i1/m5kt/baz+s4Zogspd839HSMg=="], + "prettier": ["prettier@3.9.6", "", { "bin": { "prettier": "bin/prettier.cjs" } }, "sha512-OpN0zzVdiaiAhxpuuj5efpIS4sY9j7bY6uR5mnj5yPzGkdkjNKSJeUThPb60Jw29QuAZgA4o+/iB49kFiaBX6g=="], "prop-types": ["prop-types@15.8.1", "", { "dependencies": { "loose-envify": "^1.4.0", "object-assign": "^4.1.1", "react-is": "^16.13.1" } }, "sha512-oj87CgZICdulUohogVAR7AjlC0327U4el4L6eAvOqCeudMDVU0NThNaV+b9Df4dXgSP1gXMTnPdhfe/2qDH5cg=="], @@ -666,7 +654,7 @@ "proxy-addr": ["proxy-addr@2.0.7", "", { "dependencies": { "forwarded": "0.2.0", "ipaddr.js": "1.9.1" } }, "sha512-llQsMLSUDUPT44jdrU/O37qlnifitDP+ZwrmmZcoSKyLKvtZxpyV0n2/bD/N4tBAAZ/gJEdZU7KMraoK1+XYAg=="], - "qs": ["qs@6.15.3", "", { "dependencies": { "es-define-property": "^1.0.1", "side-channel": "^1.1.1" } }, "sha512-O9gl3zCl5h5blw1KGUzQKhA5oUXSl8rwUIM5o0S3nCXMliSvy5Dzx7/DJcI+SwgICv+IneSZwhBh1oSyEHA71A=="], + "qs": ["qs@6.16.0", "", { "dependencies": { "es-define-property": "^1.0.1", "side-channel": "^1.1.1" } }, "sha512-h6fhOIaRrID2CbEY2fqs+7t+UXZo+MLAnU5gRIq85uFtdiUPCdsApMlHhXogKVM4HM2DVbIjGNTTYH2OcmP1vA=="], "range-parser": ["range-parser@1.3.0", "", {}, "sha512-hek2mFQpPuI4E1BBKrSto+BU3e3x4xuarsbiwr3+lf7p44juvFMV0XFWQAP3xUyqXA4RrXLIoaSUGbSt056ZMw=="], @@ -676,7 +664,7 @@ "react-dom": ["react-dom@19.2.8", "", { "dependencies": { "scheduler": "^0.27.0" }, "peerDependencies": { "react": "^19.2.8" } }, "sha512-rVprimfGBG3DR+Tq0IQG2DT5PxKth1WIGDmj5yPmlzr4YBe7uyE+Du4oVqTDXZSHGGGXRtTJEGSSePyQCMBglQ=="], - "react-draggable": ["react-draggable@4.7.0", "", { "dependencies": { "clsx": "^2.1.1", "prop-types": "^15.8.1" }, "peerDependencies": { "react": ">= 16.3.0", "react-dom": ">= 16.3.0" } }, "sha512-kTpANmKWVnFXiZ76Ag2ZowiFStuBYnJ606PI1TbUsOg29/400/JNIxI9+CuenhiAqFuXWJffz6F4UI3R51kUug=="], + "react-draggable": ["react-draggable@4.7.1", "", { "dependencies": { "clsx": "^2.1.1", "prop-types": "^15.8.1" }, "peerDependencies": { "react": ">= 16.3.0", "react-dom": ">= 16.3.0" } }, "sha512-wa3tzfFnYt3yaZLuyU58fl1TNunfWfBekDgWhZA1+gb2jnp42wZ0ymuopR6M5kqDYmm4hKmzGlcKWjZf3Zb6RQ=="], "react-grid-layout": ["react-grid-layout@2.2.4", "", { "dependencies": { "clsx": "^2.1.1", "fast-equals": "^4.0.3", "prop-types": "^15.8.1", "react-draggable": "^4.4.6", "react-resizable": "^3.1.3", "resize-observer-polyfill": "^1.5.1" }, "peerDependencies": { "react": ">= 16.3.0", "react-dom": ">= 16.3.0" } }, "sha512-Eb57FsgOMYOfsUGrMI1ku/FFR+dPNPrE8qo+3hwZubpqVSy4GO9v52DeX50Tl3JDYAlCypP4rmw7Vrqk/zOIvA=="], @@ -694,7 +682,7 @@ "react-style-singleton": ["react-style-singleton@2.2.3", "", { "dependencies": { "get-nonce": "^1.0.0", "tslib": "^2.0.0" }, "peerDependencies": { "@types/react": "*", "react": "^16.8.0 || ^17.0.0 || ^18.0.0 || ^19.0.0 || ^19.0.0-rc" }, "optionalPeers": ["@types/react"] }, "sha512-b6jSvxvVnyptAiLjbkWLE/lOnR4lfTtDAl+eUC7RZy+QQWc6wRzIV2CE6xBuMmDxc2qIihtDCZD5NPOFl7fRBQ=="], - "readdirp": ["readdirp@5.0.0", "", {}, "sha512-9u/XQ1pvrQtYyMpZe7DXKv2p5CNvyVwzUB6uhLAnQwHMSgKMBR62lc7AHljaeteeHXn11XTAaLLUVZYVZyuRBQ=="], + "readdirp": ["readdirp@5.1.1", "", {}, "sha512-Kko+Y5XQ6fM+Ce3dq3m9YGxnacYZYl9cA1wZjaF3Vbry2L3i1qVg8+CAgNPsXRArPMUMCaOR7oa9Nqntc43JKA=="], "remark-gfm": ["remark-gfm@4.0.1", "", { "dependencies": { "@types/mdast": "^4.0.0", "mdast-util-gfm": "^3.0.0", "micromark-extension-gfm": "^3.0.0", "remark-parse": "^11.0.0", "remark-stringify": "^11.0.0", "unified": "^11.0.0" } }, "sha512-1quofZ2RQ9EWdeN34S79+KExV1764+wCUGop5CPL1WGdD0ocPpu91lzPGbwWMECpEpd42kJGQwzRfyov9j4yNg=="], @@ -708,7 +696,7 @@ "resize-observer-polyfill": ["resize-observer-polyfill@1.5.1", "", {}, "sha512-LwZrotdHOo12nQuZlHEmtuXdqGoOD0OhaxopaNFxWzInpEgaLWoVuAMbTzixuosCx2nEG58ngzW3vxdWoxIgdg=="], - "rolldown": ["rolldown@1.2.5", "", { "dependencies": { "@oxc-project/types": "=0.146.0", "@rolldown/pluginutils": "^1.0.0" }, "optionalDependencies": { "@rolldown/binding-android-arm-eabi": "1.2.5", "@rolldown/binding-android-arm64": "1.2.5", "@rolldown/binding-darwin-arm64": "1.2.5", "@rolldown/binding-darwin-x64": "1.2.5", "@rolldown/binding-freebsd-x64": "1.2.5", "@rolldown/binding-linux-arm-gnueabihf": "1.2.5", "@rolldown/binding-linux-arm64-gnu": "1.2.5", "@rolldown/binding-linux-arm64-musl": "1.2.5", "@rolldown/binding-linux-ppc64-gnu": "1.2.5", "@rolldown/binding-linux-s390x-gnu": "1.2.5", "@rolldown/binding-linux-x64-gnu": "1.2.5", "@rolldown/binding-linux-x64-musl": "1.2.5", "@rolldown/binding-openharmony-arm64": "1.2.5", "@rolldown/binding-win32-arm64-msvc": "1.2.5", "@rolldown/binding-win32-x64-msvc": "1.2.5" }, "bin": { "rolldown": "./bin/cli.mjs" } }, "sha512-VD2IE5PUG4Oj8zz2VGykiYd5wbnjdIiSsNQb8Qu5B+noEp+A78mu2iVvpp27g8es14Tk9rofNs5Tku9iQCS4fA=="], + "rolldown": ["rolldown@1.2.7", "", { "dependencies": { "@oxc-project/types": "=0.148.0", "@rolldown/pluginutils": "^1.0.0" }, "optionalDependencies": { "@rolldown/binding-android-arm-eabi": "1.2.7", "@rolldown/binding-android-arm64": "1.2.7", "@rolldown/binding-darwin-arm64": "1.2.7", "@rolldown/binding-darwin-x64": "1.2.7", "@rolldown/binding-freebsd-x64": "1.2.7", "@rolldown/binding-linux-arm-gnueabihf": "1.2.7", "@rolldown/binding-linux-arm64-gnu": "1.2.7", "@rolldown/binding-linux-arm64-musl": "1.2.7", "@rolldown/binding-linux-ppc64-gnu": "1.2.7", "@rolldown/binding-linux-s390x-gnu": "1.2.7", "@rolldown/binding-linux-x64-gnu": "1.2.7", "@rolldown/binding-linux-x64-musl": "1.2.7", "@rolldown/binding-openharmony-arm64": "1.2.7", "@rolldown/binding-win32-arm64-msvc": "1.2.7", "@rolldown/binding-win32-x64-msvc": "1.2.7" }, "bin": { "rolldown": "./bin/cli.mjs" } }, "sha512-g0EtLvBjTUB7jhyV0S/TCup3v/XSVl45vUIGbOGU4QPiyjTenCe4mKuFvW9fEgYmS2Fo42AUssRmNuMziXdrig=="], "router": ["router@2.2.0", "", { "dependencies": { "debug": "^4.4.0", "depd": "^2.0.0", "is-promise": "^4.0.0", "parseurl": "^1.3.3", "path-to-regexp": "^8.0.0" } }, "sha512-nLTrUKm2UyiL7rlhapu/Zl45FwNgkZGaCpZbIHajDYgwlJCOzLSk+cIPAnsEqV955GjILJnKbdQC1nVPz+gAYQ=="], @@ -722,9 +710,9 @@ "send": ["send@1.2.1", "", { "dependencies": { "debug": "^4.4.3", "encodeurl": "^2.0.0", "escape-html": "^1.0.3", "etag": "^1.8.1", "fresh": "^2.0.0", "http-errors": "^2.0.1", "mime-types": "^3.0.2", "ms": "^2.1.3", "on-finished": "^2.4.1", "range-parser": "^1.2.1", "statuses": "^2.0.2" } }, "sha512-1gnZf7DFcoIcajTjTwjwuDjzuz4PPcY2StKPlsGAQ1+YH20IRVrBaXSWmdjowTJ6u8Rc01PoYOGHXfP1mYcZNQ=="], - "seroval": ["seroval@1.6.3", "", {}, "sha512-5PwLbVPpT4DEki1hYVSSsoxWY6xCNMVucAVLK/CH0mXSDfp/I4KaAex72q80GNt5hpn7CCMGdSpIg4YGqH/wXQ=="], + "seroval": ["seroval@1.6.4", "", {}, "sha512-LErWMNS2RRFdu2RMA5u/PA59/IWs0XsikyEXGQ2/36iEWFrdG0ABmg17E17cikrv76891kOAMq3TkTFXpwAHXw=="], - "seroval-plugins": ["seroval-plugins@1.6.3", "", { "peerDependencies": { "seroval": "^1.0" } }, "sha512-zQIy62HW683pMIUOKv9yKueQmOr+xMjpP2eH/qEPhr6nTAC+pJTh508md571Oduf/K/QpAoyeWpOhOp1+RFeDA=="], + "seroval-plugins": ["seroval-plugins@1.6.4", "", { "peerDependencies": { "seroval": "^1.0" } }, "sha512-R0f1U9hmn38+dFMz6b6ab8lwucmw4AtiY7St+JPWudy1dm+Bs3g884nyrsH9Cy6rKpZKLYayXuMda9GZ/fl8JQ=="], "serve-static": ["serve-static@2.2.1", "", { "dependencies": { "encodeurl": "^2.0.0", "escape-html": "^1.0.3", "parseurl": "^1.3.3", "send": "^1.2.0" } }, "sha512-xRXBn0pPqQTVQiC8wyQrKs2MOlX24zQ0POGaj0kultvoOCstBQM5yvOhAVSUwOMjQtTvsPWoNCHfPGwaaQJhTw=="], @@ -766,11 +754,11 @@ "tinybench": ["tinybench@2.9.0", "", {}, "sha512-0+DUvqWMValLmha6lr4kD8iAMK1HzV0/aKnCtWb9v9641TnP/MFb7Pc2bxoxQjTXAErryXVgUOfv2YqNllqGeg=="], - "tinyexec": ["tinyexec@1.2.4", "", {}, "sha512-SHf/r48b7vOrjve9PxJo3MN5v5yuyjHvdUcrQffT3WXMUfnGmHDVbC4k3sHJaJTgZCwpUplIaAo5ANtMyp3YHg=="], + "tinyexec": ["tinyexec@1.3.1", "", {}, "sha512-GCvB3aoys96IuDFBMcTB46JOR6mdMtAToqwiW8JlWhsoh1mhHi/xn9ss/Dg7N555GiJyEt2qzoG/NHCwM6h1EA=="], "tinyglobby": ["tinyglobby@0.2.17", "", { "dependencies": { "fdir": "^6.5.0", "picomatch": "^4.0.4" } }, "sha512-wXR/dYpcqKmfWpEdZjiKJOwCNFndD0DMnrW/cYjVGttEkBfVgcLFHoNrlj47mjOVic9yyNu65alsgF4NQyTa2g=="], - "tinyrainbow": ["tinyrainbow@3.1.0", "", {}, "sha512-Bf+ILmBgretUrdJxzXM0SgXLZ3XfiaUuOj/IKQHuTXip+05Xn+uyEYdVg0kYDipTBcLrCVyUzAPz7QmArb0mmw=="], + "tinyrainbow": ["tinyrainbow@3.1.1", "", {}, "sha512-yau8yJdTt989Mm0Bd/236QnzEiPf2xLLTqUZRUJOo/3CB078LSwzei343DgtJVmfJKJE3TMINY1u42SQsP6mXw=="], "toidentifier": ["toidentifier@1.0.1", "", {}, "sha512-o5sSPKEkg/DIQNmH43V0/uerLrpzVedkUh8tGNvaeXpfpuwjKenlSox/2O/BTlZUtEe+JG7s5YhEz608PlAHRA=="], @@ -780,13 +768,13 @@ "tslib": ["tslib@2.8.1", "", {}, "sha512-oJFu94HQb+KVduSUQL7wnpmqnfmLsOA/nAh6b6EH0wCEoK0/mPeXU6c3wKDV83MkOuHPRHtSXKKU99IBazS/2w=="], - "type-fest": ["type-fest@5.8.0", "", { "dependencies": { "tagged-tag": "^1.0.0" } }, "sha512-YGYEVz3Fm5iy/AybuA0oyNFq7H4CgQNfRp/qfe8nurE1kuCeNm3/vfm9X4Mtl+qLyaKJUh5xrFZwogr41SMjYA=="], + "type-fest": ["type-fest@5.9.0", "", { "dependencies": { "tagged-tag": "^1.0.0" } }, "sha512-yANm3Jr3GiJ1qgJlxGAVxTOIcEOk1rhQHamlXtnrCK7EHP4HeM9OGxtMg/W7HFdrVzw/ZWJKGVIJusVH85sLtw=="], "type-is": ["type-is@2.1.0", "", { "dependencies": { "content-type": "^2.0.0", "media-typer": "^1.1.0", "mime-types": "^3.0.0" } }, "sha512-faYHw0anBbc/kWF3zFTEnxSFOAGUX9GFbOBthvDdLsIlEoWOFOtS0zgCiQYwIskL9iGXZL3kAXD8OoZ4GmMATA=="], "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=="], - "undici-types": ["undici-types@6.21.0", "", {}, "sha512-iwDZqg0QAGrg9Rav5H4n0M64c3mkR59cJ6wQp+7C4nI0gsmExaedaYLNO44eT4AtBBwjbTiGPMlt2Md0T9H9JQ=="], + "undici-types": ["undici-types@8.3.0", "", {}, "sha512-j375ScV60dom+YkPFIfTLcOiPxkN/buHz5GobjLhixFuANaNs3C9l4GmrWqejgXWJ7BbJcFYpTEUkS1Ge8bpZQ=="], "unified": ["unified@11.0.5", "", { "dependencies": { "@types/unist": "^3.0.0", "bail": "^2.0.0", "devlop": "^1.0.0", "extend": "^3.0.0", "is-plain-obj": "^4.0.0", "trough": "^2.0.0", "vfile": "^6.0.0" } }, "sha512-xKvGhPWw3k84Qjh8bI3ZeJjqnyadK+GEFtazSfZv/rKeTkTjOJho6mFqh2SM96iIcZokxiOpg78GazTSg8+KHA=="], @@ -806,7 +794,7 @@ "untruncate-json": ["untruncate-json@0.0.1", "", {}, "sha512-4W9enDK4X1y1s2S/Rz7ysw6kDuMS3VmRjMFg7GZrNO+98OSe+x5Lh7PKYoVjy3lW/1wmhs6HW0lusnQRHgMarA=="], - "update-browserslist-db": ["update-browserslist-db@1.2.3", "", { "dependencies": { "escalade": "^3.2.0", "picocolors": "^1.1.1" }, "peerDependencies": { "browserslist": ">= 4.21.0" }, "bin": { "update-browserslist-db": "cli.js" } }, "sha512-Js0m9cx+qOgDxo0eMiFGEueWztz+d4+M3rGlmKPT+T4IS/jP4ylw3Nwpu6cpTTP8R1MAC1kF4VbdLt3ARf209w=="], + "update-browserslist-db": ["update-browserslist-db@1.3.2", "", { "dependencies": { "escalade": "^3.2.0", "picocolors": "^1.1.1" }, "peerDependencies": { "browserslist": ">= 4.21.0" }, "bin": { "update-browserslist-db": "cli.js" } }, "sha512-UQ+MSxlhRm1bzjhU+DcuXfjFO1FzNtqhK5+9Yvlp90ItDLk5vT932A0rFu619nf7RVS+Y/VeaUW1jaRDqZ8VJw=="], "use-callback-ref": ["use-callback-ref@1.3.3", "", { "dependencies": { "tslib": "^2.0.0" }, "peerDependencies": { "@types/react": "*", "react": "^16.8.0 || ^17.0.0 || ^18.0.0 || ^19.0.0 || ^19.0.0-rc" }, "optionalPeers": ["@types/react"] }, "sha512-jQL3lRnocaFtu3V00JToYz/4QkNWswxijDaCVNZRiRTO3HQDLsdu1ZtmIUvV4yPp+rvWm5j0y0TG/S61cuijTg=="], @@ -836,11 +824,11 @@ "wrappy": ["wrappy@1.0.2", "", {}, "sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ=="], - "ws": ["ws@8.21.1", "", { "peerDependencies": { "bufferutil": "^4.0.1", "utf-8-validate": ">=5.0.2" }, "optionalPeers": ["bufferutil", "utf-8-validate"] }, "sha512-+0NTnW77fFN/DjQi6k/Sq/Yvk4Sgajw7urW8V+asjXnRgDs9gyGkdb7EzgfhA4goXsRIZKE28fzIXBHEzhuiWw=="], + "ws": ["ws@8.21.3", "", { "peerDependencies": { "bufferutil": "^4.0.1", "utf-8-validate": ">=5.0.2" }, "optionalPeers": ["bufferutil", "utf-8-validate"] }, "sha512-201TZ/kPWxoPr/OKWjquZR1SWKXcvxdH+e1xrx89b3YbmzLMFCLfnaG1HFIgWzJOEWZ7MvpK++odZufgYR50Rw=="], "yallist": ["yallist@3.1.1", "", {}, "sha512-a4UGQaWPH59mOXUYnAG2ewncQS4i4F43Tv3JoAM+s2VDAmS9NsK8GpDMLrCHPksFT7h3K6TOoUNn2pb7RoXx4g=="], - "zod": ["zod@4.4.3", "", {}, "sha512-ytENFjIJFl2UwYglde2jchW2Hwm4GJFLDiSXWdTrJQBIN9Fcyp7n4DhxJEiWNAJMV1/BqWfW/kkg71UDcHJyTQ=="], + "zod": ["zod@4.5.4", "", {}, "sha512-sC95tT5iHHH9gtpj6A81kh+NEaRAUFN+qlUPDUbRfOMvNf5QCBqsb3WgvnpVtK5Y+4UfA6KqufotuTvMGiTlsA=="], "zod-to-json-schema": ["zod-to-json-schema@3.25.2", "", { "peerDependencies": { "zod": "^3.25.28 || ^4" } }, "sha512-O/PgfnpT1xKSDeQYSCfRI5Gy3hPf91mKVDuYLUHZJMiDFptvP41MSnWofm8dnCm0256ZNfZIM7DSzuSMAFnjHA=="], @@ -852,46 +840,12 @@ "@ag-ui/core/zod": ["zod@3.25.76", "", {}, "sha512-gzUt/qt81nXsFGKIFcC3YnfEAx5NkunCfnDlvuBSSFS02bcXu4Lmea0AFIUwbLWxWPx3d9p8S5QoaujKcNQxcQ=="], - "body-parser/content-type": ["content-type@2.0.0", "", {}, "sha512-j/O/d7GcZCyNl7/hwZAb606rzqkyvaDctLmckbxLzHvFBzTJHuGEdodATcP3yIRoDrLHkIATJuvzbFlp/ki2cQ=="], - - "parse-entities/@types/unist": ["@types/unist@2.0.11", "", {}, "sha512-CmBKiL6NNo/OqgmMn95Fk9Whlp2mtvIv+KNpQKN2F4SjvrEesubTRWGYSg+BnWZOnlCaSTU1sMpsBOzgbYhnsA=="], - - "type-is/content-type": ["content-type@2.0.0", "", {}, "sha512-j/O/d7GcZCyNl7/hwZAb606rzqkyvaDctLmckbxLzHvFBzTJHuGEdodATcP3yIRoDrLHkIATJuvzbFlp/ki2cQ=="], - - "vitest/vite": ["vite@8.2.0", "", { "dependencies": { "lightningcss": "^1.33.0", "picomatch": "^4.0.5", "postcss": "^8.5.23", "rolldown": "~1.2.0", "tinyglobby": "^0.2.17" }, "optionalDependencies": { "fsevents": "~2.3.3" }, "peerDependencies": { "@types/node": "^20.19.0 || >=22.12.0", "@vitejs/devtools": "^0.4.0", "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-pn+CFpM0lwDeKwmOq1ZaBK/9sjorZcgqxki6MbY/jPEVd9vichIlmlD4HmQ5wdP5EgqQCFRaACBxMC7uEGc6lQ=="], - - "vitest/vite/postcss": ["postcss@8.5.25", "", { "dependencies": { "nanoid": "^3.3.16", "picocolors": "^1.1.1", "source-map-js": "^1.2.1" } }, "sha512-DTPx3RWSSnWyzLxQnlH0rJP+EW5ekl16ZU4/psbIhA0e53kJfdgaN5vKM+xP7yJtXVu+nfdVFmlgFDEKAe4Pyw=="], - - "vitest/vite/rolldown": ["rolldown@1.2.1", "", { "dependencies": { "@oxc-project/types": "=0.142.0", "@rolldown/pluginutils": "^1.0.0" }, "optionalDependencies": { "@rolldown/binding-android-arm64": "1.2.1", "@rolldown/binding-darwin-arm64": "1.2.1", "@rolldown/binding-darwin-x64": "1.2.1", "@rolldown/binding-freebsd-x64": "1.2.1", "@rolldown/binding-linux-arm-gnueabihf": "1.2.1", "@rolldown/binding-linux-arm64-gnu": "1.2.1", "@rolldown/binding-linux-arm64-musl": "1.2.1", "@rolldown/binding-linux-ppc64-gnu": "1.2.1", "@rolldown/binding-linux-s390x-gnu": "1.2.1", "@rolldown/binding-linux-x64-gnu": "1.2.1", "@rolldown/binding-linux-x64-musl": "1.2.1", "@rolldown/binding-openharmony-arm64": "1.2.1", "@rolldown/binding-wasm32-wasi": "1.2.1", "@rolldown/binding-win32-arm64-msvc": "1.2.1", "@rolldown/binding-win32-x64-msvc": "1.2.1" }, "bin": { "rolldown": "./bin/cli.mjs" } }, "sha512-4FKJhg8d3OiyQOA6Q1Q0hoFFpW9/OoX+VsHzpECsdsIZoOArrAK90gl59YK/Z+gnDel45bgJZK03ozH/9bCqEw=="], - - "vitest/vite/rolldown/@oxc-project/types": ["@oxc-project/types@0.142.0", "", {}, "sha512-7W+2q5AKQVU36fkaryontrHn3YDt1RyUYXatw9i5H8ocYe2sPKSFB6eS8WNPeRKiN1qAWWZUPm7gwFzJGrccqQ=="], + "body-parser/content-type": ["content-type@2.1.0", "", {}, "sha512-mj7UPXE0jaqaOsukNZRUEfEi2AcL7C/vwmwcHV0O97eO1E1pxBZuyjlZrx5seTaNBg1U6+o35wpa35Qfcc+7ag=="], - "vitest/vite/rolldown/@rolldown/binding-android-arm64": ["@rolldown/binding-android-arm64@1.2.1", "", { "os": "android", "cpu": "arm64" }, "sha512-02hOeOSryYxVrOIphmLAsqnCJWxwlzFk+pEt/N/i6OgT3lShHO7xGCU5cpgchRDHboAEbSjzgGh+O/u1GswQmA=="], + "negotiator/content-type": ["content-type@2.1.0", "", {}, "sha512-mj7UPXE0jaqaOsukNZRUEfEi2AcL7C/vwmwcHV0O97eO1E1pxBZuyjlZrx5seTaNBg1U6+o35wpa35Qfcc+7ag=="], - "vitest/vite/rolldown/@rolldown/binding-darwin-arm64": ["@rolldown/binding-darwin-arm64@1.2.1", "", { "os": "darwin", "cpu": "arm64" }, "sha512-fMsTOnN0OjFm3CyppWPitKnc8UlliVARUULW6cfU6AIqjdtgmSFWSk9vecHzZduv/yMWIHDlRhM1e8Iff9uAfA=="], - - "vitest/vite/rolldown/@rolldown/binding-darwin-x64": ["@rolldown/binding-darwin-x64@1.2.1", "", { "os": "darwin", "cpu": "x64" }, "sha512-1wjKdz/XLGKHaTNHjQveQ/B23TKx4ItAqm1JbyVuvNPc4Ze0Fb48s49TAd/2zcplPl8okE/UbTgmlVfwT7eFeQ=="], - - "vitest/vite/rolldown/@rolldown/binding-freebsd-x64": ["@rolldown/binding-freebsd-x64@1.2.1", "", { "os": "freebsd", "cpu": "x64" }, "sha512-Fa0jHR07E7YBN4vOEsbVf2briYNsuOowfLJaXULZM0ldMlaCaj2LJgLMbMe4iacRyZmvR8efFhgR9wKuGclQUg=="], - - "vitest/vite/rolldown/@rolldown/binding-linux-arm-gnueabihf": ["@rolldown/binding-linux-arm-gnueabihf@1.2.1", "", { "os": "linux", "cpu": "arm" }, "sha512-pzkgu1SSHGgRRyRZ4fbmSgmajbVt+epaLP99NDjFft69v/ypfTi6swBMiVdh2EkQ0OSnHE1lZDM7DRGkyAzUpA=="], - - "vitest/vite/rolldown/@rolldown/binding-linux-arm64-gnu": ["@rolldown/binding-linux-arm64-gnu@1.2.1", "", { "os": "linux", "cpu": "arm64" }, "sha512-QI5SEDY8cbiYWHx0VO4vIc3UlS6a32vXHjU8Qy/17adEmZIPuByJg13UEvo9c/UCiUkdcVWY83C+b+JrwnNyUg=="], - - "vitest/vite/rolldown/@rolldown/binding-linux-arm64-musl": ["@rolldown/binding-linux-arm64-musl@1.2.1", "", { "os": "linux", "cpu": "arm64" }, "sha512-Sm41FyCeXqmYcERoYOCbGIL5hNfd8w9LQ7Y61Bev48HkcjaJqV/iiVOaiDxjVTRMS+QKrZmD8cfPt4uMVnvM+A=="], - - "vitest/vite/rolldown/@rolldown/binding-linux-ppc64-gnu": ["@rolldown/binding-linux-ppc64-gnu@1.2.1", "", { "os": "linux", "cpu": "ppc64" }, "sha512-2x+WhXTGl9yJYPbltW/BSEPTVz9OIWQyER4N+gJEDWkkn904eRcBzELqh/Hf7K0w/ubGbKNMv0ZC+94QK/IFEg=="], - - "vitest/vite/rolldown/@rolldown/binding-linux-s390x-gnu": ["@rolldown/binding-linux-s390x-gnu@1.2.1", "", { "os": "linux", "cpu": "s390x" }, "sha512-eEjmQpuRQayHPWWnywaWHkFT3ToPbP3RYy42VVd/B9aBGDA+Ol25EIWHxKQST3IiWJjikCWUF7KtbfqwZrzVwQ=="], - - "vitest/vite/rolldown/@rolldown/binding-linux-x64-gnu": ["@rolldown/binding-linux-x64-gnu@1.2.1", "", { "os": "linux", "cpu": "x64" }, "sha512-/Orga1fZYkLc/56jBICcHrKchl8Z2UKdDSr3LG9ToWO1lQ6a4Livk9Xz+9WN91zsz5QR3XQz2NNoSDEvP6qadw=="], - - "vitest/vite/rolldown/@rolldown/binding-linux-x64-musl": ["@rolldown/binding-linux-x64-musl@1.2.1", "", { "os": "linux", "cpu": "x64" }, "sha512-xxBJRL+0q0Kce7orznGWLuylHDY65vuARXZRpX+hPdv+DqK2c3NlCsVA98tlWzWNEE7yPqA/1NQ5nnCrj49Y5A=="], - - "vitest/vite/rolldown/@rolldown/binding-openharmony-arm64": ["@rolldown/binding-openharmony-arm64@1.2.1", "", { "os": "none", "cpu": "arm64" }, "sha512-M6AdXIXw3s+/8XpKMzdGDEXGS1S7kwUsy+rcTIUIOx5Ge4nXKCtAFHFV9YKkXvGcC5WMoTjAteLzlsQROVI0Yw=="], - - "vitest/vite/rolldown/@rolldown/binding-win32-arm64-msvc": ["@rolldown/binding-win32-arm64-msvc@1.2.1", "", { "os": "win32", "cpu": "arm64" }, "sha512-EvRrivJieyHG+AO9lleZWgq+g0+S7oV2C51yuqlcyU/R9net+sI4Pj0F+lUoP2bEr6TWX3SqFaaS0SzfLxSzkw=="], + "parse-entities/@types/unist": ["@types/unist@2.0.11", "", {}, "sha512-CmBKiL6NNo/OqgmMn95Fk9Whlp2mtvIv+KNpQKN2F4SjvrEesubTRWGYSg+BnWZOnlCaSTU1sMpsBOzgbYhnsA=="], - "vitest/vite/rolldown/@rolldown/binding-win32-x64-msvc": ["@rolldown/binding-win32-x64-msvc@1.2.1", "", { "os": "win32", "cpu": "x64" }, "sha512-Z4eCmn5QJ/5+azF9knpLWKfVd9aidn0mAe9TpJgvBLId9Ax3t0+JVxBmT25Bv7NBbVW1TZyKjQjQReouMeH5UQ=="], + "type-is/content-type": ["content-type@2.1.0", "", {}, "sha512-mj7UPXE0jaqaOsukNZRUEfEi2AcL7C/vwmwcHV0O97eO1E1pxBZuyjlZrx5seTaNBg1U6+o35wpa35Qfcc+7ag=="], } } diff --git a/ui/host/package.json b/ui/host/package.json index 7c586bb8..a9a4b61e 100644 --- a/ui/host/package.json +++ b/ui/host/package.json @@ -41,7 +41,7 @@ }, "overrides": { "@hono/node-server": "1.19.15", - "fast-uri": "3.1.5", + "fast-uri": "3.1.7", "hono": "4.12.34", "ip-address": "10.5.0", "nanoid": "3.3.18"